:root {
  color-scheme: light;
  --ink: #212920;
  --muted: #536052;
  --line: #d9e1d6;
  --surface: #f3f6f1;
  --accent: #e8f6ae;
  --pass: #e4f4df;
  --pass-ink: #28542c;
  --fail: #fff0e5;
  --fail-ink: #854329;
  background: var(--surface);
  color: var(--ink);
  font: 1rem/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: #2c5837; text-underline-offset: 4px; }
.shell { max-width: 1180px; width: calc(100% - 64px); margin-inline: auto; }
.masthead { background: var(--accent); overflow: hidden; }
.topbar { min-height: 65px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #37492a32; }
.wordmark { color: var(--ink); display: flex; align-items: center; gap: 9px; font-size: 1.13rem; font-weight: 760; text-decoration: none; }
.logo { display: inline-block; height: 19px; width: 19px; border-radius: 5px; border: 2px solid #253325; background: linear-gradient(135deg, #253325 0 50%, #e8f6ae 50% 100%); }
nav { display: flex; gap: 15px; align-items: center; }
nav a { color: #2c462c; font-size: .9rem; }
.intro { padding: 42px 0 57px; position: relative; isolation: isolate; }
.intro::after { content: ''; z-index: -1; position: absolute; right: 0; top: 34px; width: 40%; height: 170px; background-image: linear-gradient(to bottom, #34522b25 1px, transparent 1px), linear-gradient(to right, #34522b25 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(90deg, transparent 2%, #000 75%, transparent); }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(2.5rem, 6vw, 4.85rem); line-height: .98; letter-spacing: -.073em; font-weight: 780; }
.intro p { margin-top: 17px; max-width: 460px; font-size: 1.06rem; color: #38482f; }
.workbench { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; gap: 16px; position: relative; margin-top: -22px; }
.panel { min-width: 0; background: #fff; padding: 21px; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 5px 17px #22332309; }
h2 { font-size: 1.26rem; line-height: 1.25; letter-spacing: -.026em; }
h3 { font-size: 1.03rem; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; min-height: 41px; padding: 7px 12px; border-radius: 8px; border: 1px solid transparent; font-size: .9rem; font-weight: 690; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid #4e7848; outline-offset: 3px; }
label { display: block; font-size: .88rem; font-weight: 690; }
.color-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.color-entry { display: flex; gap: 6px; align-items: center; margin-top: 5px; }
input[type="color"] { width: 38px; height: 40px; padding: 3px; border-radius: 8px; border: 1px solid #c8d2c5; background: #fff; cursor: pointer; flex-shrink: 0; }
input[type="color"]::-webkit-color-swatch { border: 1px solid #0003; border-radius: 4px; }
input[type="text"], select, textarea { padding: 8px 9px; border-radius: 8px; border: 1px solid #c8d2c5; background: #fff; color: var(--ink); width: 100%; min-width: 0; }
input[type="text"], textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .94rem; }
select { margin-top: 5px; }
textarea { margin-top: 5px; resize: vertical; }
.muted { color: var(--muted); }
.hint { margin-top: 6px; font-size: .87rem; }
.secondary { background: #f4f8f1; color: #2c5430; border-color: #d0decc; }
.secondary:hover:not(:disabled) { background: #e8f3e3; }
#swap { margin-top: 11px; }
.error { color: var(--fail-ink); background: var(--fail); padding: 7px 10px; border-radius: 8px; margin-top: 10px; font-size: .88rem; }
.suggestion { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 11px; }
#apply-color:not([hidden]) { margin-top: 8px; }
.score-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.score { font-size: 2.35rem; letter-spacing: -.06em; line-height: 1; font-weight: 770; font-variant-numeric: tabular-nums; }
.grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 13px; }
.grades div { border-radius: 8px; padding: 6px 7px; background: var(--pass); color: var(--pass-ink); }
.grades .fail { background: var(--fail); color: var(--fail-ink); }
.grades dt { font-size: .82rem; line-height: 1.2; }
.grades dd { font-weight: 720; font-size: .9rem; margin-top: 2px; }
.preview { margin-top: 13px; padding: 14px 17px 17px; min-height: 137px; border: 1px solid #0001; border-radius: 10px; background: var(--background, #f5faed); color: var(--foreground, #274166); }
.preview span { font-size: .84rem; }
.preview strong { display: block; line-height: 1.08; letter-spacing: -.07em; font-size: clamp(2.5rem, 5vw, 3.6rem); font-weight: 760; margin: 4px 0 6px; }
.palette { margin-top: 17px; }
.palette-head { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 9px 16px; }
.palette-body { margin-top: 15px; display: grid; grid-template-columns: minmax(215px, 245px) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-target { margin-top: 10px; }
.matrix { min-width: 0; }
.matrix-status { color: var(--muted); font-size: .89rem; margin: 0 0 7px; }
.matrix-status.error { color: var(--fail-ink); }
.table-wrap { overflow: auto; padding: 2px 0 6px; }
table { border-collapse: separate; border-spacing: 4px; margin-left: -4px; width: 100%; }
th { min-width: 81px; max-width: 105px; font-size: .79rem; line-height: 1.25; padding: 5px 5px; color: #354736; font-weight: 680; overflow-wrap: anywhere; }
th:first-child { min-width: 105px; text-align: left; position: sticky; inset-inline-start: 0; z-index: 1; background: white; }
thead th:first-child { color: var(--muted); font-weight: 570; }
.swatch { display: inline-block; width: 10px; height: 10px; border: 1px solid #0003; border-radius: 3px; margin-inline-end: 4px; vertical-align: -1px; }
td { padding: 0; text-align: center; }
.ratio-button { min-height: 36px; width: 100%; font-variant-numeric: tabular-nums; font-size: .82rem; padding: 5px 4px; background: var(--pass); color: var(--pass-ink); border-color: #d4e8cf; }
.ratio-button:hover { border-color: #4e7848; }
.ratio-button.fail { background: var(--fail); color: var(--fail-ink); border-color: #f4e4d7; }
.ratio-button.fail:hover { border-color: #a36e53; }
.ratio-button span { display: block; font-size: .73rem; line-height: 1; }
.same { color: #738073; background: #f3f6f2; border-radius: 7px; }
.notes { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 28px 0 24px; }
.notes p { color: var(--muted); margin: 5px 0; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; border-top: 1px solid var(--line); color: var(--muted); padding: 17px 0 23px; font-size: .9rem; }
@media (max-width: 850px) { .shell { width: calc(100% - 34px); } .panel { padding: 17px; } .grades { grid-template-columns: 1fr 1fr; } }
@media (max-width: 655px) { .shell { width: calc(100% - 27px); } .intro { padding: 34px 0 46px; } .intro::after { opacity: .4; } .workbench, .palette-body, .notes { grid-template-columns: 1fr; } .notes { gap: 15px; } }
@media (max-width: 355px) { nav { gap: 9px; } .color-fields { grid-template-columns: 1fr; } }
