/* ڕێبەری زانکۆ — Zirek brand (tokens match zirek.org).
   Signature: the Zirek block mark. The skyline is every department as a block;
   each result's chance is the mark itself, filled block by block (full mark = «ئەگەری زۆر»).
   Structure: one header, one spacing scale, one card shape for every department everywhere. */

@font-face { font-family: 'Kufi'; src: url('fonts/kufi.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Rudaw'; src: url('fonts/RudawRegular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('fonts/mono.woff2') format('woff2'); font-display: swap; }

:root {
  --paper: #FAFAF9;
  --card: #FFFFFF;
  --surface: #F4F4F2;
  --line: #E7E5E0;
  --line-2: #D4D1CA;
  --ink: #0E1116;
  --ink-2: #3F3F46;
  --muted: #6B6B73;
  --ember: #F97316;
  --ember-text: #C2410C;
  --ember-soft: rgba(249, 115, 22, .12);
  --grad: linear-gradient(135deg, #FB923C 0%, #EA580C 52%, #DC2626 100%);
  --good: #15803D;
  --glow: radial-gradient(70% 60% at 50% 0%, rgba(234, 88, 12, .11), transparent 70%);
  --shadow: 0 1px 2px rgba(16, 16, 18, .04), 0 1px 1px rgba(16, 16, 18, .03);
  --lift: 0 12px 32px -14px rgba(16, 16, 18, .20), 0 2px 6px rgba(16, 16, 18, .05);
  --cta-glow: 0 18px 44px -16px rgba(234, 88, 12, .55);
  --top-bg: rgba(250, 250, 249, .86);
  --display: 'Kufi', 'Rudaw', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --body: 'Rudaw', 'Segoe UI', Tahoma, 'Noto Sans Arabic', system-ui, sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  /* one spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r: 20px;
  --r-sm: 12px;
  --wide: 1140px;
  --aside: 320px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #000000; --card: #0F0F0F; --surface: #1A1A1A; --line: #262626; --line-2: #3A3A3A;
    --ink: #F5F5F5; --ink-2: #D4D4D8; --muted: #A1A1AA;
    --ember: #F97316; --ember-text: #FB923C; --ember-soft: rgba(249, 115, 22, .16);
    --good: #34D399;
    --glow: radial-gradient(70% 60% at 50% 0%, rgba(249, 115, 22, .18), transparent 70%);
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .02);
    --lift: 0 14px 40px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .03);
    --top-bg: rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #000000; --card: #0F0F0F; --surface: #1A1A1A; --line: #262626; --line-2: #3A3A3A;
  --ink: #F5F5F5; --ink-2: #D4D4D8; --muted: #A1A1AA;
  --ember: #F97316; --ember-text: #FB923C; --ember-soft: rgba(249, 115, 22, .16);
  --good: #34D399;
  --glow: radial-gradient(70% 60% at 50% 0%, rgba(249, 115, 22, .18), transparent 70%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .02);
  --lift: 0 14px 40px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .03);
  --top-bg: rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.75; color: var(--ink);
  background: var(--paper); background-image: var(--glow); background-repeat: no-repeat; background-size: 100% 520px;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; line-height: 1.4; }
p { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-family: var(--display); font-weight: 600; font-size: .88rem; color: var(--ink-2); margin-bottom: var(--s2); }
dl, dd { margin: 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; letter-spacing: -.01em; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 8px; }
.small { font-size: .84rem; color: var(--muted); line-height: 1.7; }
.hint { font-size: .78rem; color: var(--muted); font-weight: 400; font-family: var(--body); }
.pos { color: var(--good); }
.neg { color: var(--ember-text); }
[hidden] { display: none !important; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.field-label { display: block; font-family: var(--display); font-weight: 600; font-size: .9rem; color: var(--ink-2); }

/* ------------------------------------------------------------------ header: brand + the four places */
.top {
  position: sticky; top: -56px; z-index: 30;
  background: var(--top-bg); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: var(--wide); margin: 0 auto; padding: 0 var(--s4);
  display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s3);
}
.brand { display: inline-flex; align-items: center; gap: var(--s2); text-decoration: none; height: 56px; }
.blocks { display: block; width: 30px; height: auto; }
.blocks rect { fill: var(--ink); }
.blocks rect.e { fill: var(--ember); }
.wordmark { font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; font-weight: 800; font-size: 1.3rem; letter-spacing: -.05em; line-height: 1; }
.product {
  font-family: var(--display); font-weight: 600; font-size: .82rem; color: var(--ink-2);
  padding: 2px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); white-space: nowrap;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; flex: none;
  border: 1px solid var(--line); background: var(--card); display: grid; place-items: center;
}
.top .icon-btn { margin-inline-start: auto; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn .moon { fill: currentColor; stroke: none; display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .sun { display: none; }
  :root:not([data-theme="light"]) .icon-btn .moon { display: block; }
}

.tabs {
  order: 5; flex-basis: 100%; display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--s4)); padding: var(--s2) var(--s4) var(--s3);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px;
  text-decoration: none; font-size: .9rem; color: var(--ink-2); border: 1px solid transparent; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.tabs a:hover { border-color: var(--line); background: var(--card); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.tabs .count { font-size: .72rem; padding: 0 7px; border-radius: 999px; background: var(--surface); color: var(--ink-2); line-height: 1.7; }
.tabs a[aria-current="page"] .count { background: color-mix(in srgb, var(--paper) 18%, transparent); color: var(--paper); }
#cmpCount { background: var(--ember); color: #fff; }
.spark { width: 8px; height: 8px; border-radius: 2px; background: var(--ember); animation: spark 2.4s ease-in-out infinite; }
@keyframes spark { 50% { transform: rotate(45deg) scale(.7); opacity: .55; } }
@media (max-width: 420px) {
  .tabs { gap: 2px; }
  .tabs a { padding: 0 10px; font-size: .84rem; gap: 4px; }
  #tabCount { display: none; }
}
@media (min-width: 1000px) {
  .top { top: 0; }
  .top-in { flex-wrap: nowrap; height: 64px; }
  .tabs { order: 0; flex-basis: auto; margin: 0 var(--s4) 0 0; padding: 0; }
}

/* ------------------------------------------------------------------ page grid */
.page { max-width: var(--wide); margin: 0 auto; padding: 0 var(--s4); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); align-items: start; }
.main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); min-width: 0; }
/* grids never grow wider than their box (the skyline svg would stretch them) */
.step, .dock, .panel, .helper, .quiz, .tool, .filters, .credits, .foot-notes, .note { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
  .layout { gap: var(--s6); }
  .layout-form { grid-template-columns: minmax(0, 1fr) var(--aside); }
  .layout-list { grid-template-columns: var(--aside) minmax(0, 1fr); }
  .aside > * { position: sticky; top: calc(64px + var(--s5)); max-height: calc(100vh - 64px - var(--s6)); overflow-y: auto; scrollbar-width: thin; }
}

/* ------------------------------------------------------------------ hero */
.hero { padding: var(--s6) 0 var(--s5); max-width: 760px; }
.notice {
  display: flex; align-items: center; gap: 10px; margin-bottom: var(--s5); padding: 7px 12px 7px 14px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-size: .84rem; line-height: 1.5; box-shadow: var(--shadow);
  width: fit-content; max-width: 100%;
}
.notice:hover { border-color: var(--ember); }
.notice b { font-family: var(--display); font-weight: 700; }
.notice svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--ember-text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.live { flex: none; position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--good); }
.live::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--good); opacity: 0; animation: ping 2s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }
.eyebrow { font-size: .84rem; color: var(--muted); margin-bottom: var(--s2); }
.eyebrow::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--ember);
  margin-inline-end: 8px; vertical-align: 1px;
}
h1 { font-weight: 800; font-size: clamp(1.7rem, 6vw, 2.7rem); letter-spacing: -.01em; line-height: 1.45; }
h1 .accent {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hero-lead { margin-top: var(--s3); color: var(--muted); font-size: .95rem; }

/* ------------------------------------------------------------------ form steps */
.step { padding: var(--s5) var(--s4); display: grid; gap: var(--s4); }
@media (min-width: 640px) { .step { padding: var(--s5); } }
.step-head { display: flex; align-items: flex-start; gap: var(--s3); }
.step-n {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); font-size: .92rem; line-height: 1;
}
.step-head h2 { font-weight: 700; font-size: 1.2rem; line-height: 1.5; }
.step-lead { font-size: .86rem; color: var(--muted); }

.mark-box { display: grid; gap: var(--s1); padding: var(--s3) var(--s4); border-radius: var(--r-sm); background: var(--surface); }
.mark {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  font-size: clamp(2.6rem, 13vw, 4rem); font-weight: 400; line-height: 1.15; text-align: left;
  color: var(--ink); caret-color: var(--ember);
}
.mark::placeholder { color: var(--line-2); }
.mark:focus { outline: none; }
.mark-box:focus-within { box-shadow: inset 0 0 0 1.5px var(--ember); }

/* skyline: departments as blocks along the 50–100 axis */
.sky { position: relative; margin: 0; direction: ltr; padding-top: 18px; }
#sky { display: block; width: 100%; height: auto; overflow: visible; }
#sky rect { fill: var(--line); transition: fill .25s ease; }
#sky rect.in { fill: var(--ink); }
#sky rect.edge { fill: var(--ember); }
#sky rect.out { fill: var(--line); opacity: .55; }
.sky.animate #sky rect { transform-box: fill-box; transform-origin: bottom; animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--d, 0) * 1ms); }
@keyframes rise { from { transform: scaleY(0); opacity: 0; } }
.cursor {
  position: absolute; top: 14px; bottom: 26px; width: 2px; background: var(--ember); border-radius: 2px;
  left: var(--x, 50%); transform: translateX(-1px); transition: left .18s ease; pointer-events: none;
}
.cursor span {
  position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -2px);
  background: var(--ember); color: #fff; font-size: .72rem; padding: 0 7px; border-radius: 999px; white-space: nowrap; line-height: 1.6;
}
.axis { font-size: .7rem; color: var(--muted); margin-top: 6px; }
.sky-note { font-size: .86rem; color: var(--muted); min-height: 3.2em; }
.sky-note b { font-family: var(--mono); font-weight: 400; color: var(--ink); font-size: 1.02rem; }
.sky-note .dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-inline: 2px 4px; }
.dot.in { background: var(--ink); }
.dot.edge { background: var(--ember); }

.field-grid { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
.field-grid .wide { flex-basis: 100%; }
.field-stack { display: grid; gap: var(--s4); }

/* segmented control */
.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface); padding: 4px; border-radius: 20px; width: fit-content; max-width: 100%; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 4px 14px; border-radius: 999px; font-size: .9rem; color: var(--ink-2); transition: background .15s, color .15s; white-space: nowrap; }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--ember); outline-offset: 2px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: .9rem; transition: background .15s, border-color .15s, color .15s; }
.chip small { color: var(--muted); font-size: .74rem; margin-inline-start: 2px; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip input:checked + span small { color: inherit; opacity: .7; }
.chip input:focus-visible + span { outline: 2px solid var(--ember); outline-offset: 2px; }
.chip input:disabled + span { opacity: .45; }

/* foldable extra (subject marks) */
.fold { border-top: 1px solid var(--line); padding-top: var(--s3); }
.fold summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-family: var(--display); font-weight: 600; font-size: .9rem; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before { content: '+'; font-family: var(--mono); width: 22px; height: 22px; border-radius: 6px; background: var(--surface); display: inline-grid; place-items: center; }
.fold[open] summary::before { content: '−'; }
.fold .small { margin: var(--s3) 0; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--s2); }
.subject { display: grid; gap: 2px; font-size: .78rem; color: var(--muted); }
.subject input { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); text-align: left; font-size: 1rem; }
.subject input:focus { outline: none; border-color: var(--ember); }

/* writing box */
.write { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); padding: var(--s3) var(--s4) var(--s2); }
.write:focus-within { border-color: var(--ember); }
.write textarea {
  width: 100%; border: 0; resize: none; background: none; min-height: 58px; overflow: hidden;
  font-size: 1.02rem; line-height: 1.8; color: var(--ink);
}
.write textarea:focus { outline: none; }
.write textarea::placeholder { color: var(--muted); opacity: .75; }
.examples {
  display: flex; gap: 6px; margin: 4px calc(-1 * var(--s4)) 0; padding: 2px var(--s4) 4px; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 16px, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(to left, transparent 0, #000 16px, #000 calc(100% - 28px), transparent 100%);
}
.examples::-webkit-scrollbar { display: none; }
.examples button {
  border: 1px dashed var(--line-2); background: var(--card); border-radius: 999px; padding: 1px 12px;
  font-size: .8rem; color: var(--muted); white-space: nowrap; flex: none;
}
.examples button:hover { border-color: var(--ember); color: var(--ink); }
.understood { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .86rem; margin-top: calc(-1 * var(--s2)); }
.understood:empty { display: none; }
.understood .lbl { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.understood .lbl::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--ember); }
.u { display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 999px; background: var(--surface); }
.u.spec { background: var(--ember-soft); color: var(--ink); font-weight: 600; }
.u.no { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--muted); }
.u.info { background: none; border: 1px solid var(--line); color: var(--ink-2); }

.unsure-btn {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: calc(-1 * var(--s2));
  border: 0; background: none; padding: 2px 0; color: var(--ember-text); font-size: .88rem;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ember) 45%, transparent); text-underline-offset: 5px;
}
.unsure-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.unsure-btn[aria-expanded="true"] { color: var(--ink-2); text-decoration: none; }

/* the "I don't know" helper */
.helper {
  display: grid; gap: var(--s4); padding: var(--s4); border-radius: var(--r-sm);
  background: var(--surface); border-inline-start: 3px solid var(--ember);
}
.helper-head { display: flex; gap: var(--s3); align-items: flex-start; }
.helper-head .blocks { width: 34px; flex: none; margin-top: 6px; }
.helper-head h3 { font-size: 1.02rem; font-weight: 700; }
.helper-head p { font-size: .88rem; color: var(--ink-2); }
.helper h4 { font-family: var(--display); font-weight: 600; font-size: .88rem; color: var(--ink-2); margin-bottom: var(--s2); }
.helper .chip span { background: var(--card); }
.opinion { font-size: .9rem; color: var(--ink-2); padding: var(--s3); border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.opinion b { color: var(--ink); }
.quiz { display: grid; gap: var(--s3); }
.quiz-out { font-size: .86rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.quiz-out:empty { display: none; }
.best { display: grid; gap: 6px; list-style: none; margin: 0; padding: 0; }
.best li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s3); background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.best li.small { display: block; }
.best .ic { font-size: 1.05rem; width: 26px; text-align: center; }
.best .bf { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--muted); line-height: 1.5; }
.best .bd { font-size: .9rem; font-weight: 600; line-height: 1.5; }
.best .bu { font-size: .76rem; color: var(--muted); line-height: 1.5; }
.best .tet { width: 20px; }
.best .like-btn { border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 1px 10px; font-size: .78rem; white-space: nowrap; }
.best .like-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.helper-foot { font-size: .84rem; color: var(--muted); }

/* field tiles */
.tiles-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px var(--s3); padding-top: var(--s4); border-top: 1px solid var(--line); }
.tiles-head .yes { color: var(--ink); }
.tiles-head .no { color: var(--ember-text); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile {
  position: relative; display: flex; align-items: center; gap: 10px; text-align: start;
  padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card);
  font-size: .88rem; line-height: 1.45; min-height: 54px; transition: border-color .15s, background .15s, transform .1s;
}
.tile:active { transform: scale(.98); }
.tile .ic { flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--surface); display: grid; place-items: center; font-size: 1.05rem; }
.tile .st {
  position: absolute; top: -7px; inset-inline-end: -5px; width: 22px; height: 22px; border-radius: 7px;
  display: none; place-items: center; font-size: .72rem; font-weight: 700; color: #fff; line-height: 1;
}
.tile[data-state="like"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tile[data-state="like"] .st.yes { display: grid; background: var(--ink); color: var(--paper); }
.tile[data-state="dislike"] { color: var(--muted); background: var(--surface); }
.tile[data-state="dislike"] .name { text-decoration: line-through; }
.tile[data-state="dislike"] .st.no { display: grid; background: var(--ember); }
.tile.ai[data-state="off"] { border-style: dashed; border-color: var(--ember); }

/* the form's side panel: summary + button (a sticky bar on phones) */
.dock { display: grid; gap: var(--s3); }
.summary { display: none; }
.go {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px; padding: 14px 24px; color: #fff; background: var(--grad); box-shadow: var(--cta-glow);
  font-family: var(--display); font-weight: 700; font-size: 1.05rem; transition: transform .15s, filter .15s;
}
.go:hover { filter: brightness(1.05); transform: translateY(-1px); }
.go:active { transform: scale(.99); }
.go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.error { background: var(--card); border: 1px solid var(--ember); color: var(--ember-text); border-radius: var(--r-sm); padding: 8px 12px; font-size: .88rem; }
.layout-form .aside {
  position: sticky; bottom: 0; z-index: 10; margin: 0 calc(-1 * var(--s4));
  padding: var(--s4) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 64%, transparent);
}
@media (min-width: 1000px) {
  .layout-form .aside { position: static; margin: 0; padding: 0; background: none; }
  .dock { padding: var(--s5); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
  .summary { display: grid; gap: var(--s3); }
  .summary-title { font-family: var(--display); font-weight: 700; font-size: 1rem; }
  .sum-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s2) var(--s3); font-size: .86rem; line-height: 1.6; }
  .sum-list dt { color: var(--muted); }
  .sum-list dd { color: var(--ink); min-width: 0; }
  .sum-list dd.empty { color: var(--muted); }
  .sum-list .u { font-size: .78rem; padding: 0 8px; margin: 0 0 3px 3px; }
}

/* ------------------------------------------------------------------ list page: side panel */
.results, .view { padding-top: var(--s5); padding-bottom: var(--s5); }
.panel { display: grid; gap: var(--s4); padding: var(--s4); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
@media (min-width: 640px) { .panel { padding: var(--s5); } }
.link-btn { justify-self: start; border: 0; background: none; padding: 0; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: .9rem; }
.link-btn:hover { color: var(--ember-text); }
.link-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#resTitle { font-weight: 800; font-size: clamp(1.35rem, 5vw, 1.6rem); line-height: 1.45; }
#resTitle:focus { outline: none; }
.res-sub { color: var(--muted); font-size: .88rem; margin-top: calc(-1 * var(--s3)); }
.res-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-btn { border: 1px solid var(--line); background: var(--card); border-radius: 999px; height: 34px; padding: 0 16px; font-size: .88rem; display: inline-flex; align-items: center; }
.pill-btn:hover { border-color: var(--ink); }
.pill-btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tally .t {
  font: inherit; color: inherit; cursor: pointer; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; transition: border-color .15s, box-shadow .15s;
}
.tally b { font-family: var(--mono); font-weight: 400; font-size: 1.25rem; line-height: 1; }
.tally span { font-size: .68rem; color: var(--muted); line-height: 1.3; }
.tally .t.zero { opacity: .45; }
.tally .t:hover:not([disabled]) { border-color: var(--line-2); }
.tally .t[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tally .t[disabled] { cursor: default; }
.tally .tet { width: 26px; }

.tool { display: grid; gap: var(--s2); padding-top: var(--s4); border-top: 1px solid var(--line); }
.whatif-row { display: flex; align-items: center; gap: var(--s3); }
.whatif input[type="range"] { flex: 1; min-width: 0; accent-color: var(--ember); }
.whatif output { min-width: 5.4em; text-align: center; background: var(--surface); border-radius: 999px; padding: 1px 10px; font-size: .92rem; }
.whatif output.up { color: var(--good); }
.whatif output.down { color: var(--ember-text); }
.finder input { width: 100%; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.finder input:focus { outline: none; border-color: var(--ember); }
.found { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.found:empty { display: none; }
.found li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface); font-size: .84rem; line-height: 1.55; }
.found .fn { font-weight: 600; }
.found .fm { grid-column: 1; color: var(--muted); font-size: .74rem; }
.found button { grid-row: 1 / span 2; grid-column: 2; border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 2px 12px; font-size: .78rem; }
.found button:hover { border-color: var(--ember); }
.found button[disabled] { opacity: .5; cursor: default; }
.found .none { display: block; color: var(--muted); }

.note { background: var(--ember-soft); border-radius: var(--r-sm); padding: var(--s3) var(--s4); font-size: .88rem; display: grid; gap: 6px; }
.note .link-btn { display: inline; color: var(--ember-text); text-decoration: underline; text-underline-offset: 4px; font-size: inherit; }
.filter-note { font-size: .86rem; color: var(--ink-2); }
.filter-note .link-btn { display: inline; text-decoration: underline; text-underline-offset: 4px; font-size: inherit; }

/* ------------------------------------------------------------------ one card for every department */
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.item {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto;
  grid-template-areas: "no head badge" "stats stats stats" "foot foot foot";
  gap: var(--s3) var(--s2); padding: var(--s4); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
}
.item.row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head badge" "stats stats" "foot foot"; }
.item.pinned { border-color: var(--ember); box-shadow: inset 0 0 0 1px var(--ember); }
.item.enter { animation: itemIn .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 28ms); }
@keyframes itemIn { from { opacity: 0; transform: translateY(10px); } }
@media (min-width: 640px) {
  .item { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "no head badge" "no stats stats" "no foot foot"; column-gap: var(--s3); padding: var(--s4) var(--s5) var(--s4) var(--s4); }
  .item.row { padding: var(--s4) var(--s5); }
}
.item-no { grid-area: no; font-family: var(--mono); font-size: .9rem; color: var(--muted); line-height: 1.9; }
.item-head { grid-area: head; min-width: 0; }
.item-name { font-weight: 600; font-size: 1.02rem; line-height: 1.6; }
.open {
  border: 0; background: none; padding: 0; text-align: start; font: inherit; color: inherit; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 5px; text-decoration-thickness: 1px;
}
.open:hover { color: var(--ember-text); text-decoration-color: var(--ember); }
.item-place { color: var(--muted); font-size: .82rem; line-height: 1.6; }

/* chance badge: the Zirek mark + words */
.badge {
  grid-area: badge; align-self: start; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--surface); font-size: .74rem; color: var(--ink-2); line-height: 1.4;
}
.badge .tet { width: 22px; }
.badge.t-safe { color: var(--ink); }
.badge.t-edge, .badge.t-reach { background: var(--ember-soft); color: var(--ember-text); }
.badge.off { background: none; border: 1px dashed var(--line-2); color: var(--muted); white-space: normal; max-width: 128px; text-align: center; }

.tet { display: block; width: 34px; height: auto; flex: none; overflow: visible; }
.tet rect { fill: none; stroke: var(--line-2); stroke-width: 10; }
.tet[data-n="1"] rect:nth-child(-n+1),
.tet[data-n="2"] rect:nth-child(-n+2),
.tet[data-n="3"] rect:nth-child(-n+3),
.tet[data-n="4"] rect { fill: var(--ink); stroke: none; }
.tet[data-n="4"] rect:nth-child(4) { fill: var(--ember); }

/* the numbers strip: cutoff · your mark · difference, and the ruler */
.stats {
  grid-area: stats; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px var(--s3); align-items: end;
  padding: var(--s2) var(--s3) var(--s3); border-radius: var(--r-sm); background: var(--surface);
}
.stat { display: grid; min-width: 0; }
.stat .k { font-size: .72rem; color: var(--muted); line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b { justify-self: start; font-family: var(--mono); font-weight: 400; font-size: 1.08rem; line-height: 1.35; direction: ltr; unicode-bidi: isolate; }
.stats .ruler { grid-column: 1 / -1; margin-top: var(--s2); }
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(3, auto) minmax(110px, 1fr); column-gap: var(--s5); align-items: center; padding: var(--s2) var(--s4); }
  .stats .ruler { grid-column: auto; margin: 0; }
}
.ruler { direction: ltr; }
.track { position: relative; height: 8px; border-radius: 999px; background: var(--card); }
.track .cut { position: absolute; left: 50%; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 2px; }
.track .span { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--ink); opacity: .2; }
.track .span.neg { background: var(--ember); opacity: .45; }
.track .you {
  position: absolute; top: 50%; left: var(--at); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 4px;
  background: var(--ember); box-shadow: 0 0 0 3px var(--surface);
}
.track .you.off::after { content: ''; position: absolute; top: 50%; width: 0; height: 0; border: 5px solid transparent; margin-top: -5px; }
.track .you.hi::after { left: 100%; border-left-color: var(--ember); }
.track .you.lo::after { right: 100%; border-right-color: var(--ember); }

/* the three study systems (all departments) */
.stats.modes { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: var(--s1); gap: var(--s1); background: none; }
.cell { display: grid; padding: 4px 10px; border-radius: 10px; background: var(--surface); line-height: 1.4; min-width: 0; }
.cell small { font-size: .7rem; color: var(--muted); }
.cell .num { font-size: 1rem; }
.cell.sel { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--ink); }
.na { color: var(--muted); font-size: .8rem; }
@media (min-width: 640px) { .stats.modes { grid-template-columns: repeat(3, minmax(0, 150px)); padding: 0; } }

.item-foot { grid-area: foot; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: .74rem; padding: 0 9px; border-radius: 999px; background: var(--surface); color: var(--ink-2); line-height: 1.9; white-space: nowrap; }
.tag.code { background: var(--ink); color: var(--paper); }
.tag.code .num { font-size: .8rem; }
.tag.paid { background: none; border: 1px solid var(--line-2); }
.tag.fresh { background: var(--ember); color: #fff; }
.tag.why { background: none; border: 1px solid var(--line); }
.tag.why::before { content: '✓ '; color: var(--ember-text); font-weight: 700; }
.tag.news { background: var(--ember-soft); color: var(--ember-text); }
.tag.news-new { background: var(--ember); color: #fff; }
.tag.news-no-evening { background: none; border: 1px dashed var(--line-2); color: var(--muted); }
.tag.est { background: none; border: 1px dashed var(--ember); color: var(--ember-text); }
.tag.trend.up { color: var(--ember-text); }
.tag.trend.down { color: var(--good); }
.acts { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.mini-btn {
  border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; height: 30px; padding: 0 12px; font-size: .8rem; white-space: nowrap;
  display: inline-flex; align-items: center;
}
.mini-btn:hover { border-color: var(--ink); }
.mini-btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mini-btn[disabled] { opacity: .55; cursor: default; }
.move, .remove {
  width: 30px; height: 30px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--card);
  border-radius: 9px; font-size: .82rem; line-height: 1; color: var(--ink-2); padding: 0;
}
.move:hover:not([disabled]) { border-color: var(--ink); }
.move[disabled] { opacity: .35; cursor: default; }
.remove:hover { border-color: var(--ember); color: var(--ember-text); }
.remove.text { width: auto; padding: 0 10px; font-size: .8rem; }

.more { display: block; width: 100%; padding: 11px; border: 1px dashed var(--line-2); background: none; border-radius: var(--r-sm); color: var(--ink-2); }
.more:hover { border-color: var(--ember); color: var(--ink); }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line-2); border-radius: var(--r-sm); }

.how summary { cursor: pointer; padding: var(--s4); font-family: var(--display); font-weight: 600; font-size: .92rem; }
.how-body { padding: 0 var(--s4) var(--s4); display: grid; gap: 10px; font-size: .88rem; color: var(--ink-2); }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: .8rem; }
.legend .tet { width: 26px; }
.fine { font-size: .78rem; color: var(--muted); line-height: 1.8; }
.print-head { display: none; }

/* ------------------------------------------------------------------ other pages */
.view-head { margin-bottom: var(--s5); max-width: 760px; }
.view-head h2 { font-weight: 800; font-size: clamp(1.45rem, 5vw, 2rem); }
.lead { color: var(--muted); font-size: .92rem; margin-top: 4px; }

.filters { padding: var(--s4); display: grid; gap: var(--s3); }
.search { position: relative; }
.search svg { position: absolute; inset-inline-start: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { width: 100%; padding: 10px 44px 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: .98rem; }
.search input:focus { outline: none; border-color: var(--ember); }
.more-filters > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 14px;
  border: 1px solid var(--line); border-radius: 999px; font-size: .86rem; color: var(--ink-2);
}
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters > summary::before { content: '+'; font-family: var(--mono); }
.more-filters[open] > summary::before { content: '−'; }
.more-filters > summary .count:empty { display: none; }
.more-filters > summary .count { background: var(--ember); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .72rem; }
.more-filters[open] > summary { margin-bottom: var(--s3); }
.filter-toggles { margin-top: var(--s3); }
.filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
@media (min-width: 640px) and (max-width: 999px) { .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) {
  .more-filters > summary { display: none; }
  .filter-grid { grid-template-columns: 1fr; }
}
.select { display: grid; gap: 2px; font-size: .74rem; color: var(--muted); }
.select select {
  width: 100%; appearance: none; -webkit-appearance: none; font-size: .9rem; color: var(--ink);
  padding: 7px 12px 7px 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: 12px 55%, 16px 55%; background-size: 4px 4px; background-repeat: no-repeat;
}
.select select:focus { outline: none; border-color: var(--ember); }
.list-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .86rem; color: var(--muted); }

/* compare */
.cmp { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.cmp-row { display: grid; grid-template-columns: 96px repeat(var(--n), minmax(150px, 1fr)); min-width: min-content; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .cmp-row { grid-template-columns: 130px repeat(var(--n), minmax(180px, 1fr)); } }
.cmp-row:first-child { border-top: 0; }
.cmp-label { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--surface); padding: 10px 12px; font-size: .76rem; color: var(--muted); line-height: 1.5; }
.cmp-cell { padding: 10px 12px; font-size: .86rem; border-inline-start: 1px solid var(--line); min-width: 0; }
.cmp-top .cmp-cell { display: grid; gap: 4px; align-content: start; }
.cmp-top .row-name { border: 0; background: none; padding: 0; text-align: start; font-family: var(--display); font-weight: 600; font-size: .98rem; line-height: 1.5; cursor: pointer; }
.cmp-top .row-name:hover { color: var(--ember-text); }
.cmp-top .remove { width: auto; padding: 0 10px; justify-self: start; }
.big-num { font-size: 1.2rem; font-weight: 400; }
.cmp-chance { display: flex; align-items: center; gap: 6px; }
.cmp-chance .tet { width: 24px; }
.cmp-hint { margin-top: var(--s3); }
.add-more { display: inline-flex; margin-top: var(--s3); text-decoration: none; }
.empty-card { padding: 30px 20px; text-align: center; display: grid; justify-items: center; gap: 6px; }
.empty-card .pill-btn { margin-top: 8px; text-decoration: none; }
.blocks.big { width: 64px; margin-bottom: 6px; }

/* what changed */
.change-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); margin-bottom: var(--s4); }
.sum-tile:first-child { grid-column: 1 / -1; }
@media (min-width: 640px) { .change-sum { grid-template-columns: repeat(5, minmax(0, 1fr)); } .sum-tile:first-child { grid-column: auto; } }
.sum-tile { display: grid; gap: 2px; padding: var(--s3) var(--s4); text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.sum-tile:hover { border-color: var(--ember); }
.sum-tile b { justify-self: start; font-weight: 400; font-size: 1.7rem; line-height: 1.1; }
.sum-tile:first-child b { color: var(--ember-text); }
.sum-tile span { font-size: .8rem; color: var(--ink-2); line-height: 1.4; }
.chg { margin-bottom: var(--s3); scroll-margin-top: 130px; }
.chg summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: var(--s3) var(--s4); font-family: var(--display); font-weight: 600; }
.chg summary::-webkit-details-marker { display: none; }
.chg summary .count { font-size: .85rem; padding: 0 10px; border-radius: 999px; background: var(--surface); }
.chg[open] summary { border-bottom: 1px solid var(--line); }
.chg-lead { padding: 10px 16px 0; }
.chg-list { list-style: none; margin: 0; padding: 6px 8px 10px; display: grid; }
.chg-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border-radius: 12px; }
.chg-list li + li { border-top: 1px dashed var(--line); }
.chg-open { display: grid; min-width: 0; border: 0; background: none; padding: 0; text-align: start; font: inherit; color: inherit; cursor: pointer; }
.chg-open:hover b { color: var(--ember-text); }
.chg-was { font-size: .78rem; color: var(--muted); text-decoration: line-through; text-decoration-color: var(--ember); }
.chg-side { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; flex: none; }
.chg-cut { font-size: .95rem; }
.place { color: var(--muted); font-size: .82rem; line-height: 1.6; }

/* department sheet */
.sheet {
  width: min(600px, 100vw); max-width: 100vw; max-height: 90vh; margin: auto auto 0; padding: 0; border: 0;
  border-radius: 24px 24px 0 0; background: var(--card); color: var(--ink); box-shadow: var(--lift);
}
.sheet::backdrop { background: rgba(10, 10, 12, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheetUp .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: var(--r); max-height: 86vh; } }
.sheet-in { max-height: inherit; overflow-y: auto; padding: var(--s5) var(--s5) calc(var(--s5) + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.sh-head { position: relative; padding-inline-end: 44px; }
.sh-close { position: absolute; top: -4px; inset-inline-end: -6px; margin: 0; }
.sh-close svg { stroke-width: 2.2; }
#sheetTitle { font-weight: 700; font-size: 1.3rem; margin-top: var(--s2); }
#sheetTitle:focus { outline: none; }
.sh-head .tags { margin: 0; }
.sh-was { font-size: .82rem; color: var(--muted); }
.sh-sec { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.sh-sec h4 { margin: 0 0 var(--s2); font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.sh-hint { margin-top: var(--s4); }
.sh-chances { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.sh-chances .small { display: block; }
.sh-chances li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s3); font-size: .9rem; line-height: 1.6; padding: var(--s2) var(--s3); border-radius: 12px; background: var(--surface); }
.sh-chances .tet { width: 28px; }
.charts { display: grid; gap: var(--s4); }
.chart-mode { font-size: .74rem; color: var(--muted); margin-bottom: 2px; }
.bars { display: flex; gap: 6px; direction: ltr; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.bar-track { height: 104px; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar-fill { display: block; width: 100%; max-width: 40px; border-radius: 7px 7px 2px 2px; background: var(--line-2); }
.bar-col.last .bar-fill { background: var(--ink); }
.bar-col.est .bar-fill { background: repeating-linear-gradient(135deg, var(--ember) 0 5px, transparent 5px 9px); box-shadow: inset 0 0 0 1.5px var(--ember); }
.bar-v { font-size: .68rem; color: var(--ink-2); line-height: 1.8; }
.bar-col.last .bar-v { color: var(--ink); font-weight: 600; }
.bar-y { font-size: .66rem; color: var(--muted); line-height: 1.9; border-top: 1px solid var(--line); width: 100%; text-align: center; }
.chart.est-only p:last-child { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rules p { font-size: .88rem; color: var(--ink-2); line-height: 1.8; }
.rules p + p { margin-top: 6px; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mini-list button {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 7px 10px; border: 0; border-radius: 12px; background: var(--surface); text-align: start; font-size: .86rem;
}
.mini-list button:hover { background: var(--ember-soft); }
.mini-list .tet { width: 24px; }
.mv { font-size: .9rem; }
.sh-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }

/* ------------------------------------------------------------------ toast + footer */
.toast {
  position: fixed; z-index: 40; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--paper);
  padding: 8px 10px 8px 18px; border-radius: 999px; box-shadow: var(--lift); font-size: .88rem;
  width: max-content; max-width: calc(100vw - 32px); line-height: 1.5;
}
.toast span { min-width: 0; }
@media (min-width: 1000px) { .toast { bottom: 24px; } }
.toast button { border: 0; background: var(--ember); color: #fff; border-radius: 999px; padding: 3px 12px; font-size: .84rem; }

.foot { margin-top: var(--s7); border-top: 1px solid var(--line); background: var(--card); }
.foot-in { max-width: var(--wide); margin: 0 auto; padding: var(--s6) var(--s4) calc(var(--s6) + 70px); display: grid; gap: var(--s5); }
@media (min-width: 1000px) { .foot-in { grid-template-columns: var(--aside) minmax(0, 1fr); gap: var(--s6); padding-bottom: var(--s6); } }
.credits { display: grid; gap: var(--s3); align-content: start; }
.foot-brand { display: inline-flex; align-items: center; gap: var(--s2); text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: .98rem; width: fit-content; }
.foot-brand .blocks { width: 28px; }
.foot-brand .site { font-weight: 400; font-size: .8rem; color: var(--ember-text); padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; }
.foot-brand:hover .site { border-color: var(--ember); }
.credits-label { font-size: .8rem; color: var(--muted); }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.people a {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 10px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: .86rem; font-weight: 600;
}
.people a:hover { border-color: #1877F2; color: #1877F2; }
.people svg { width: 18px; height: 18px; fill: #1877F2; flex: none; }
.people span { line-height: 1; padding-top: 2px; }
.foot-notes { display: grid; gap: var(--s2); font-size: .8rem; color: var(--muted); align-content: start; }
.foot-notes a { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .top, #form, .view, .sheet, .link-btn, .res-actions, .tool, .how, .toast, .foot, .acts, .ruler, .filter-note, .note { display: none !important; }
  .page, .layout { display: block; max-width: none; padding: 0; }
  #results { display: block !important; padding: 0; }
  .panel { border: 0; box-shadow: none; padding: 0 0 8px; }
  .print-head { display: block; font-size: .85rem; border-bottom: 2px solid #000; padding-bottom: 6px; }
  .tally .t { border-color: #ccc; }
  .item { box-shadow: none; break-inside: avoid; padding: 6px 10px; border-color: #ccc; margin-bottom: 4px; }
  .items { gap: 4px; }
  .stats { padding: 2px 8px; }
}
