/* ============================================================
   Style Field Guide — site chrome
   Deliberately neutral: system font, greys, plain controls.
   Only the specimens carry a style.
   ============================================================ */

:root {
  --ground: #ffffff;
  --panel: #ffffff;
  --panel-2: #f4f4f4;
  --ink: #141414;
  --ink-2: #3a3a3a;
  --muted: #6b6b6b;
  --line: #d9d9d9;
  --line-2: #ebebeb;
  --accent: #141414;
  --accent-ink: #ffffff;
  --accent-soft: #ececec;
  --want: #2c6e3f;
  --avoid: #b3261e;
  --f-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-display: var(--f-ui);
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --hdr: 52px;
  --gut: clamp(16px, 2.4vw, 32px);
  --radius: 4px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #131313;
    --panel: #131313;
    --panel-2: #1d1d1d;
    --ink: #ececec;
    --ink-2: #c9c9c9;
    --muted: #999999;
    --line: #353535;
    --line-2: #262626;
    --accent: #ececec;
    --accent-ink: #131313;
    --accent-soft: #2b2b2b;
    --want: #7ccf94;
    --avoid: #ff8a80;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #131313;
  --panel: #131313;
  --panel-2: #1d1d1d;
  --ink: #ececec;
  --ink-2: #c9c9c9;
  --muted: #999999;
  --line: #353535;
  --line-2: #262626;
  --accent: #ececec;
  --accent-ink: #131313;
  --accent-soft: #2b2b2b;
  --want: #7ccf94;
  --avoid: #ff8a80;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { background: var(--ground); }
body { margin: 0; color: var(--ink); font-family: var(--f-ui); font-size: 15px; line-height: 1.5; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label, .eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  display: grid; grid-template-columns: auto 1fr auto; align-items: stretch; gap: 28px;
  min-height: var(--hdr); padding-inline: var(--gut);
  background: var(--ground); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-name { font-size: 15px; font-weight: 600; white-space: nowrap; }
.tabs { display: flex; gap: 22px; }
.tabs a { display: flex; align-items: center; font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); }
.topbar-end { display: flex; align-items: center; gap: 10px; }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 9px; width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.search input { width: 180px; height: 32px; padding: 0 10px 0 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.brief-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font-size: 14px; cursor: pointer; }
.brief-btn:hover { border-color: var(--ink-2); }
.brief-btn .count { min-width: 20px; padding: 0 5px; border-radius: 3px; background: var(--panel-2); color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; }
.brief-btn.bump .count { background: var(--ink); color: var(--ground); transition: background-color .6s ease-out, color .6s ease-out; }
@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; gap: 0 12px; padding-top: 8px; }
  .brand { min-height: 40px; }
  .tabs { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; scrollbar-width: none; min-height: 40px; }
  .search input { width: 140px; }
}
@media (max-width: 480px) {
  .search input { width: 38px; padding-right: 0; }
  .search input:focus { width: 150px; padding-right: 10px; }
}

/* ---------- generic controls ---------- */
.view { padding-inline: var(--gut); padding-block: 28px 72px; outline: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--ink);
  font-size: 14px; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn:hover { border-color: var(--ink-2); }
.btn--solid { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.btn--solid:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn--sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn svg, .icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); cursor: pointer; }
.icon-btn:hover { border-color: var(--ink-2); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { height: 30px; padding: 0 12px; border: 0; background: var(--panel); color: var(--muted); font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
select.pick {
  appearance: none; height: 32px; max-width: 100%;
  padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center / 16px;
  color: var(--ink); font: inherit; font-size: 14px; cursor: pointer;
}
.pill { display: inline-flex; align-items: center; padding: 2px 8px; border: 1px solid var(--line); border-radius: 3px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
button.pill { background: var(--panel); cursor: pointer; font: inherit; font-size: 13px; }
button.pill:hover { border-color: var(--ink-2); }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.kbd { display: inline-block; min-width: 20px; padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; font-family: var(--f-mono); font-size: 11px; line-height: 17px; text-align: center; color: var(--ink-2); background: var(--panel); }

/* style swatch: the style's ground and ink, with its accent as a bottom stripe */
.chip {
  position: relative; flex: none; display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 2px;
  font-size: 12px; line-height: 1;
  background: var(--c-bg); color: var(--c-fg);
  box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .3), inset 0 -3px 0 var(--c-ac);
  overflow: hidden;
}
.chip--lg { width: 40px; height: 40px; font-size: 18px; }

/* specimen frame; container queries inside specimens resolve against it */
.frame { position: relative; container-type: inline-size; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.frame > .sp { min-height: 100%; }

/* ---------- ALL STYLES ---------- */
.wall-head { max-width: 1400px; margin: 0 auto 28px; }
.wall-head h1 { margin: 0 0 8px; font-size: 26px; font-weight: 600; line-height: 1.2; }
.wall-head h1 .n { color: var(--muted); font-weight: 400; }
.wall-head p { margin: 0; max-width: 72ch; color: var(--ink-2); }
.wall-head .hint { margin-top: 8px; font-size: 13px; color: var(--muted); }

.idea { max-width: 1400px; margin: 0 auto 36px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 28px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.idea h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.idea p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.idea textarea { width: 100%; min-height: 92px; resize: vertical; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); font: inherit; font-size: 15px; }
.idea-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.idea-status { font-size: 13px; color: var(--muted); }
.idea-out { min-height: 120px; padding: 14px; border-radius: var(--radius); background: var(--panel-2); }
.idea-out .empty { margin: 0; color: var(--muted); font-size: 14px; }
.idea-brief { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.idea-list { display: grid; gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.idea-list li { display: flex; align-items: flex-start; gap: 10px; }
.idea-list li > div { flex: 1; min-width: 0; }
.idea-list button[data-go] { all: unset; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.idea-list .why { font-size: 13px; color: var(--muted); }
.idea-terms { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 860px) { .idea { grid-template-columns: 1fr; } }

.family { max-width: 1400px; margin: 0 auto 40px; }
.family-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding-top: 14px; margin-bottom: 16px; border-top: 1px solid var(--line); }
.family-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.family-head .label { order: 2; font-weight: 400; }
.family-head p { order: 3; flex-basis: 100%; margin: 0; max-width: 80ch; font-size: 14px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 24px 16px; }
.tile { all: unset; display: flex; flex-direction: column; gap: 8px; min-width: 0; cursor: pointer; }
.tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); border-radius: 2px; background: var(--panel-2); }
.thumb .frame { position: absolute; top: 0; left: 0; width: 1120px; border: 0; transform-origin: 0 0; transform: scale(var(--k, .23)); pointer-events: none; }
.tile:hover .thumb { border-color: var(--ink-2); }
.tile:hover .tile-name span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.tile-meta { display: grid; gap: 1px; }
.tile-name { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.tile-year { font-size: 13px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile-line { font-size: 13px; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.no-results { max-width: 1400px; margin: 40px auto; color: var(--muted); }

/* ---------- SPECIMEN (one style) ---------- */
.sv {
  display: grid; grid-template-columns: 220px minmax(0, 1fr) minmax(320px, 380px);
  height: calc(100dvh - var(--hdr) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  margin: -28px calc(var(--gut) * -1) -72px;
}
.sv > * { min-height: 0; overflow: auto; }
.rail { padding: 16px 10px 40px 14px; border-right: 1px solid var(--line); }
.rail h3 { margin: 18px 8px 4px; }
.rail h3:first-child { margin-top: 0; }
.rail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.rail button {
  all: unset; box-sizing: border-box; width: 100%;
  display: flex; align-items: center; gap: 9px;
  padding: 4px 8px; border-radius: 3px; cursor: pointer;
  font-size: 14px; color: var(--ink-2);
}
.rail .chip { width: 20px; height: 20px; font-size: 9px; }
.rail button:hover { background: var(--panel-2); color: var(--ink); }
.rail button[aria-current="true"] { background: var(--panel-2); color: var(--ink); font-weight: 600; }
.rail button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.stage { padding: 16px 20px 40px; background: var(--panel-2); }
.stage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.stage-bar .placard { margin-right: auto; display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; color: var(--muted); }
.stage-bar .placard b { color: var(--ink); font-size: 16px; font-weight: 600; }
.stage-bar .placard .label { font-weight: 400; }
.stage .frame { background: var(--panel); }
.stage-hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

.guide { padding: 20px 22px 60px; border-left: 1px solid var(--line); }
.g-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.g-top .label { font-weight: 400; }
.g-name { margin: 0; font-size: 26px; font-weight: 600; line-height: 1.15; }
.g-aka { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.g-line { margin: 12px 0 14px; font-size: 16px; line-height: 1.5; }
.g-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.g-actions .btn[aria-pressed="true"] { background: var(--panel); color: var(--ink); border-color: var(--ink); }
.g-sec { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.g-sec > .label { display: block; margin-bottom: 8px; }
.g-sec p { margin: 0; font-size: 14px; color: var(--ink-2); }

.marks { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.mark {
  all: unset; box-sizing: border-box; width: 100%;
  display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start;
  padding: 6px 8px; margin-inline: -8px; border-radius: 3px; cursor: pointer;
  font-size: 14px; line-height: 1.4;
}
.mark .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 50%; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mark:hover, .mark:focus-visible, .mark.is-on { background: var(--panel-2); }
.mark:hover .n, .mark:focus-visible .n, .mark.is-on .n { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.mark:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.mark--static { cursor: default; }
.mark--static .n { border-style: dashed; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.swatch { all: unset; display: grid; gap: 4px; min-width: 0; font-size: 12px; cursor: pointer; }
.swatch span:first-child { height: 36px; border-radius: 2px; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .3); }
.swatch b { overflow: hidden; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.swatch .mono { font-size: 11px; color: var(--muted); }
.swatch:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.typeline { display: flex; align-items: center; gap: 12px; }
.typeline .aa { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 2px; font-size: 26px; background: var(--c-bg); color: var(--c-fg); box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .3); }

.profile { display: grid; gap: 12px; }
.axis { display: grid; gap: 4px; }
.axis-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.axis-ends .label { font-weight: 400; color: var(--ink-2); }
.axis-track { position: relative; height: 14px; }
.axis-track::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: var(--line); }
.axis-track i { position: absolute; top: 4px; width: 1px; height: 6px; background: var(--line); }
.axis-dot { position: absolute; top: 1px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--panel); }
.axis-dot.b { background: var(--panel); box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 2px var(--panel); }
.axis-dot.lab { display: grid; place-items: center; width: 18px; height: 18px; margin-left: -9px; top: -2px; font-size: 10px; font-weight: 600; color: var(--ground); }
.axis-dot.lab.b { color: var(--ink); }

.ask { display: flex; flex-wrap: wrap; gap: 5px; }
.quote { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--panel-2); font-size: 14px; }
.quote .btn { margin-top: 8px; }
.confused { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.confused li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 14px; }
.confused .who { font-weight: 600; }
.confused a.who { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.confused a.who:hover { text-decoration-color: var(--ink); }
.confused p { margin: 2px 0 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.two h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; }

@media (max-width: 1180px) {
  .sv { grid-template-columns: 200px minmax(0, 1fr); height: auto; }
  .sv > * { overflow: visible; }
  .guide { grid-column: 2; border-left: 0; border-top: 1px solid var(--line); }
  .rail { position: sticky; top: calc(var(--hdr) + env(safe-area-inset-top, 0px)); align-self: start; grid-row: 1 / span 2; max-height: calc(100dvh - var(--hdr)); overflow: auto; }
}
@media (max-width: 760px) {
  .sv { display: block; margin: -28px calc(var(--gut) * -1) 0; }
  .rail { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding: 10px var(--gut); border-right: 0; border-bottom: 1px solid var(--line); }
  .rail h3 { display: none; }
  .rail ul { display: flex; gap: 6px; }
  .rail button { width: auto; white-space: nowrap; border: 1px solid var(--line); }
  .stage { padding: 14px var(--gut) 18px; }
  .guide { padding: 18px var(--gut) 40px; }
  .two { grid-template-columns: 1fr; }
}

/* highlight drawn over a specimen: dim everything else, outline the part */
.hl { position: absolute; inset: 0; z-index: 30; pointer-events: none; overflow: visible; }
.hl .dim { fill: rgba(0, 0, 0, .5); }
.hl .ring-o { fill: none; stroke: #000; stroke-width: 4; }
.hl .ring { fill: none; stroke: #fff; stroke-width: 2; }
.hl .tag { fill: #000; stroke: #fff; stroke-width: 1.5; }
.hl text { fill: #fff; font-family: var(--f-ui); font-size: 11px; font-weight: 600; }

/* ---------- COMPARE ---------- */
.cmp { max-width: 1500px; margin: 0 auto; }
.cmp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.cmp-bar .grow { flex: 1; }
.ab { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--ink); border-radius: 3px; background: var(--ink); color: var(--ground); font-size: 11px; font-weight: 600; }
.ab.b { background: var(--panel); color: var(--ink); }
.pairs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 18px; }
.pairs .label { margin-right: 4px; font-weight: 400; }
.pairs .btn[aria-current="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.cmp-diff { margin: 0 0 18px; max-width: 90ch; font-size: 15px; }
.cmp-diff .label { display: block; margin-bottom: 2px; }
.cmp-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.cmp-side figure { margin: 0; display: grid; gap: 8px; min-width: 0; }
.cmp-side figcaption { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.cmp-slider { position: relative; user-select: none; touch-action: pan-y; }
.cmp-slider .frame { cursor: ew-resize; }
.cmp-slider .frame.top { position: absolute; inset: 0 0 auto 0; z-index: 2; clip-path: inset(0 0 0 var(--x, 50%)); }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--x, 50%); z-index: 3; width: 0; pointer-events: none; }
.cmp-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
.cmp-knob { position: sticky; top: 45%; margin-top: 120px; transform: translateX(-50%); display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(0, 0, 0, .35); border-radius: 50%; background: #fff; color: #111; cursor: ew-resize; pointer-events: auto; }
.cmp-knob svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cmp-tags { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 4; display: flex; justify-content: space-between; pointer-events: none; }
.cmp-tags span { padding: 3px 8px; border-radius: 3px; background: rgba(0, 0, 0, .75); color: #fff; font-size: 12px; }
.cmp-table { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); }
.cmp-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--line-2); }
.cmp-row:first-child { border-top: 0; }
.cmp-row > * { min-width: 0; padding: 12px 14px; font-size: 14px; }
.cmp-row > .label { padding-top: 14px; }
.cmp-row.head > div { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.cmp-row ol { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.cmp-row .mini-sw { display: flex; flex-wrap: wrap; gap: 4px; }
.cmp-row .mini-sw span { width: 24px; height: 24px; border-radius: 2px; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .3); }
.cmp-row.full > div { grid-column: 2 / -1; }
@media (max-width: 860px) {
  .cmp-side { grid-template-columns: 1fr; }
  .cmp-row { grid-template-columns: 1fr 1fr; }
  .cmp-row > .label { grid-column: 1 / -1; padding-bottom: 0; }
  .cmp-row.full > div { grid-column: 1 / -1; }
}

/* ---------- MAP ---------- */
.map-view { max-width: 1400px; margin: 0 auto; }
.map-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.map-bar h1 { margin: 0 auto 0 0; font-size: 22px; font-weight: 600; }
.map-bar label { font-size: 13px; color: var(--muted); }
.map-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.map { position: relative; min-width: 760px; height: min(72vh, 680px); min-height: 520px; }
.map-plot { position: absolute; left: 76px; right: 40px; top: 30px; bottom: 58px; }
.map-plot .gridline { position: absolute; background: var(--line-2); }
.map-plot .gridline.v { top: 0; bottom: 0; width: 1px; }
.map-plot .gridline.h { left: 0; right: 0; height: 1px; }
.map-plot .axisline { position: absolute; background: var(--line); }
.map-tick { position: absolute; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.map-axis-title { position: absolute; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.pt { all: unset; position: absolute; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 2px 7px 2px 2px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); font-size: 12px; white-space: nowrap; cursor: pointer; }
.pt .chip { width: 18px; height: 18px; font-size: 8px; }
.pt:hover, .pt:focus-visible { z-index: 5; border-color: var(--ink); }
.pt.dim { opacity: .25; }
.pt-anchor { position: absolute; z-index: 1; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: var(--ink-2); }
.map-lines { position: absolute; inset: 0; pointer-events: none; }
.map-lines line { stroke: var(--line); stroke-width: 1; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.map-legend .btn[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.map-note { max-width: 80ch; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.tip { position: absolute; z-index: 10; width: 280px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); pointer-events: none; box-shadow: 0 4px 16px rgba(0, 0, 0, .08); }
.tip .thumb { margin-bottom: 8px; }
.tip b { display: block; font-size: 14px; font-weight: 600; }
.tip span { display: block; font-size: 12.5px; line-height: 1.35; color: var(--muted); }

/* ---------- VOCABULARY ---------- */
.vocab { max-width: 1400px; margin: 0 auto; }
.vocab-head { margin-bottom: 14px; }
.vocab-head h1 { margin: 0; font-size: 26px; font-weight: 600; }
.vocab-head p { margin: 6px 0 0; max-width: 72ch; color: var(--ink-2); }
.vocab-jump { position: sticky; top: calc(var(--hdr) + env(safe-area-inset-top, 0px)); z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; padding-block: 10px; background: var(--ground); border-bottom: 1px solid var(--line-2); }
.vgroup { margin-bottom: 40px; scroll-margin-top: calc(var(--hdr) + 64px); }
.vgroup-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 14px; }
.vgroup-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.vgroup-head p { margin: 0; font-size: 14px; color: var(--muted); }
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.term { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); }
.term:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.term-demo { position: relative; display: grid; place-items: center; height: 116px; overflow: hidden; background: var(--panel-2); color: var(--ink); }
.term-body { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 10px 12px 12px; border-top: 1px solid var(--line-2); }
.term-body h3 { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 600; }
.term-body p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.term-uses { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: auto; padding-top: 6px; }
.term-uses a { font-size: 12.5px; color: var(--muted); text-underline-offset: 2px; }
.term-uses a:hover { color: var(--ink); }
.add { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); color: var(--ink-2); cursor: pointer; }
.add svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .15s; }
.add:hover { border-color: var(--ink-2); color: var(--ink); }
.add[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.add[aria-pressed="true"] svg { transform: rotate(45deg); }

/* ---------- BRIEF drawer ---------- */
.brief {
  position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(400px, 100vw);
  display: flex; flex-direction: column; gap: 12px; overflow: auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 18px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0, 0, 0, .08);
}
.brief-head { display: flex; align-items: center; justify-content: space-between; }
.brief-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.brief-help { margin: 0; font-size: 13px; color: var(--muted); }
.brief-items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.brief-items .empty { padding: 14px 0; font-size: 14px; color: var(--muted); }
.bi { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.bi .kind { font-size: 11px; color: var(--muted); }
.bi .nm { min-width: 0; font-size: 14px; line-height: 1.3; }
.bi .dot { width: 26px; height: 26px; border-radius: 2px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.bi .mode { height: 24px; padding: 0 8px; border: 1px solid currentColor; border-radius: 3px; background: transparent; color: var(--want); font-size: 12px; cursor: pointer; text-transform: capitalize; }
.bi .mode.avoid { color: var(--avoid); }
.bi .x { all: unset; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 3px; color: var(--muted); cursor: pointer; }
.bi .x:hover { background: var(--panel-2); color: var(--ink); }
.bi .x svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.brief-out { display: grid; gap: 6px; margin-top: auto; }
.brief-out textarea { width: 100%; resize: vertical; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); color: var(--ink); font: inherit; font-size: 14px; line-height: 1.5; }
.brief-actions { display: flex; gap: 8px; }

.toast {
  position: fixed; z-index: 80; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  padding: 8px 14px; border-radius: var(--radius); background: var(--ink); color: var(--ground); font-size: 14px;
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* detailed-brief toggle */
.brief-verbose { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; color: var(--muted); cursor: pointer; }
.brief-verbose input { flex: none; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--ink); cursor: pointer; }
.brief-verbose b { display: block; margin-bottom: 1px; font-size: 14px; font-weight: 600; color: var(--ink); }
