/* Forever BiS: one dark theme in the look of the game's own interface (the item tooltip: a near-black navy panel, a thin
   steel border, round corners; gold titles; item names in their quality colour, class names in their class colour).
   System fonts, no images for decoration, no external resources. One accent (blue) for links and selected controls.
   Every text colour passes WCAG AA (4.5:1) on the page ground and on the panels (tests/test_site.py TestTheme).
   html.details (the "Show details" switch) shows the .d elements: scores, ids, flags, method notes. */
:root {
  color-scheme: dark;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --display: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --radius: 6px;

  --bg: #0b0d12;          /* page ground; the pick rows sit on it */
  --panel: #10131c;       /* tooltip surface: panels, slot header bands, a hovered row */
  --text: #e8e6df;
  --muted: #979186;       /* warm grey */
  --gold: #ffd100;        /* the game's title gold: headings, brand, column labels */
  --gold-dim: #a88f45;    /* rank numerals */
  --hair: #1f232d;        /* row hairlines: the steel grey at low contrast */
  --border: #3a4050;      /* panel borders: muted steel */
  --track: #59606b;
  --ring: rgba(255, 255, 255, .35);
  --accent: #7ab0ff;
  --accent-soft: #1a2638;
  --accent-contrast: #0b1220;
  --focus: #8cbaff;

  --warn-bg: #2a2310;
  --warn-border: #a87e16;
  --warn-text: #f3d68a;
  --error-bg: #2d1515;
  --error-border: #c25050;
  --error-text: #ffc6c6;

  /* Item quality: the game's colours; rare and epic lightened (hue and saturation kept) only as far as AA needs */
  --q0: #9d9d9d;
  --q1: #ffffff;
  --q2: #1eff00;
  --q3: #007bf2;          /* game #0070dd: 3.85:1 on the panel */
  --q4: #ae4df0;          /* game #a335ee: 3.80:1 on the panel */
  --q5: #ff8000;
  --q6: #e6cc80;
  --q7: #00ccff;
  /* The item tooltip: the game's green for Equip / Use lines (passes AA on the panel as it is), a light-grey frame */
  --green: #1eff00;
  --tt-border: #9fa4ae;

  /* Evidence badges (Data status) */
  --ev-revealed-bg: #16301a;
  --ev-revealed-fg: #92e08c;
  --ev-hotfixed-bg: #142742;
  --ev-hotfixed-fg: #9ac4ff;
  --ev-confirmed-bg: #33290f;
  --ev-confirmed-fg: #f0cf7a;
  --ev-visible-bg: #272b32;
  --ev-visible-fg: #bac1cc;
  --ev-bad-bg: #3a1919;
  --ev-bad-fg: #ffb3b3;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html:not(.details) .d { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
[tabindex="-1"]:focus { outline: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.25; color: var(--gold); }
h1, h2, .brand { font-family: var(--display); font-weight: 700; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.muted { color: var(--muted); }
code { font-family: var(--mono); font-size: .9em; background: var(--panel); padding: 0 3px; border-radius: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 8px; top: -48px; z-index: 10;
  background: var(--accent); color: var(--accent-contrast); padding: 8px 12px; border-radius: var(--radius);
}
.skip:focus { top: 8px; }

/* Site header */
header.site { border-bottom: 1px solid var(--hair); }
.site-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; padding-top: 14px; padding-bottom: 14px;
}
.brand { margin: 0; font-size: 1.125rem; font-weight: 700; }
.brand a { color: var(--gold); text-decoration: none; }
.tagline { margin: 0; font-size: .875rem; color: var(--muted); }
.top-nav ul { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.top-nav a { color: var(--text); text-decoration: none; font-size: .9375rem; padding: 4px 0; }
.top-nav a:hover { text-decoration: underline; }
.top-nav a[aria-current] { font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* Breadcrumbs */
.crumbs { margin: 0 0 16px; font-size: .875rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: "/"; padding: 0 8px; color: var(--track); }
.crumbs [aria-current] { color: var(--text); }

/* Before the page's script has taken over the list (and without JavaScript): no tick boxes, no switch (same space) */
html:not(.js) label.have, html:not(.js) .switch, html:not(.js) .tick-hint { visibility: hidden; }

main { padding-top: 24px; padding-bottom: 48px; }

/* The picker: class, spec, faction (links styled as buttons; the current one: aria-current) */
.picker { display: flex; flex-direction: column; gap: 10px; margin: 0 0 28px; }
.pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.choice {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none;
  font-size: .9375rem; line-height: 1.2;
}
.choice:hover { background: var(--panel); }
.choice[aria-current="true"] {
  font-weight: 600; background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
}
.choice.off { color: var(--muted); border-style: dashed; cursor: default; }
.choice.off:hover { background: none; }
.cc::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--cc, var(--muted)); border: 1px solid var(--ring);
}
/* Class colours: the game's own (shaman #0070de lightened as far as AA needs); class names wear them */
.cc-warrior { --cc: #c79c6e; }
.cc-paladin { --cc: #f58cba; }
.cc-hunter { --cc: #abd473; }
.cc-rogue { --cc: #fff569; }
.cc-priest { --cc: #ffffff; }
.cc-shaman { --cc: #007bf3; }
.cc-mage { --cc: #69ccf0; }
.cc-warlock { --cc: #9482c9; }
.cc-druid { --cc: #ff7d0a; }
.classes .choice, .class-card h3 a, .cname { color: var(--cc, var(--text)); }
.classes .choice[aria-current="true"] { background: var(--panel); }   /* a blue tint would take shaman blue under AA */
/* Spec and faction: segmented controls */
.pick-row.seg {
  display: inline-flex; align-self: flex-start; gap: 2px; padding: 3px; max-width: 100%;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.seg .choice { border-color: transparent; min-height: 32px; }
.seg .choice:hover { background: var(--bg); }
.seg .choice[aria-current="true"] { background: var(--bg); }
.seg .choice.off { border-color: transparent; }

/* Profile header */
.page-head h1 { font-size: 1.75rem; margin: 0; overflow-wrap: anywhere; }
.answer { margin: 10px 0 0; max-width: 80ch; font-size: 1.0625rem; }
.have-sum { margin: 0; font-size: .9375rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.have-sum:empty { display: none; }
.ranked { margin: 6px 0 0; color: var(--muted); font-size: .9375rem; overflow-wrap: anywhere; }
.store-note { margin: 8px 0 0; font-size: .875rem; color: var(--warn-text); }
.confirm { font-size: .9375rem; }

/* "Your next instance": a bounded panel under the answer, the ticks summary and the switch on its row */
.next {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px;
  margin-top: 20px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.next-main { flex: 1 1 30rem; min-width: 0; }
.next .advice { margin: 0 0 4px; font-size: 1rem; overflow-wrap: anywhere; }
.next .advice:first-child { font-size: 1.0625rem; }
.next-links { margin: 8px 0 0; font-size: .9375rem; color: var(--muted); }
.head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }

/* Buttons */
.switch {
  position: relative; display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px 6px 52px;
  border: 1px solid var(--border); border-radius: var(--radius); background: none; cursor: pointer; font-size: .9375rem;
}
.switch::before, .switch::after { content: ""; position: absolute; top: 50%; border-radius: 999px; }
.switch::before { left: 12px; width: 32px; height: 18px; margin-top: -9px; background: var(--track); }
.switch::after { left: 14px; width: 14px; height: 14px; margin-top: -7px; background: #ffffff; transition: transform .15s; }
.switch[aria-pressed="true"] { border-color: var(--accent); }
.switch[aria-pressed="true"]::before { background: var(--accent); }
.switch[aria-pressed="true"]::after { transform: translateX(14px); }
.switch:hover, button.quiet:hover { background: var(--panel); }
button.quiet {
  border: 0; background: none; color: var(--accent); padding: 4px 6px; border-radius: var(--radius);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: .9375rem;
}

/* The picks: the slot strip (sticky while the list is on screen), then a section per slot, one pick per row.
   Columns: rank, tick box, item, source, location (the same template on every row, so they align down the page). */
.picks-sec { --cols: 1.5rem 2rem 36px minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3.5fr); margin-top: 20px; }
.picks-sec :is([id], a, input, summary) { scroll-margin-top: 4.5rem; }   /* anchor targets and focus clear the strip */
.strip {
  position: sticky; top: 0; z-index: 2; margin: 0 0 4px; padding: 6px 0;
  background: var(--bg); border-bottom: 1px solid var(--hair);
}
/* position: the chips' sr-only words (absolute) stay inside this scroll box, not the strip (the page never scrolls sideways) */
.strip ul {
  position: relative; display: flex; gap: 4px; margin: 0; padding: 4px; list-style: none; overflow-x: auto;
  scrollbar-width: thin;
}
.strip li { flex: none; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none;
  font-size: .875rem; line-height: 1.2; white-space: nowrap;
}
.chip:hover { background: var(--panel); }
.chip.is-done { color: var(--muted); border-style: dashed; }
.chip-state { font-size: .8125rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip-state:empty { display: none; }
.tick-hint { margin: 10px 0 0; font-size: .9375rem; color: var(--muted); }
.slot { margin-top: 28px; }
/* the header band (slot name, column labels): a tooltip panel; the rows under it share its 12 px inset */
.slot h3 {
  margin: 0; padding: 8px 12px 4px; font-size: 1.125rem; overflow-wrap: anywhere;
  background: var(--panel); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
}
.wear { font-size: .875rem; font-weight: 400; color: var(--muted); }
.done {
  display: inline-block; margin-left: 4px; padding: 0 6px; font-size: .8125rem; font-weight: 600; vertical-align: 2px;
  border: 1px solid var(--border); border-radius: 4px;
}
.cols, li.pick { display: grid; grid-template-columns: var(--cols); column-gap: 12px; }
.cols {
  padding: 2px 12px 6px; font-size: .8125rem; color: var(--gold);
  background: var(--panel); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius);
}
.cols > :first-child { grid-column: 4; }
ol.picks { list-style: none; margin: 0; padding: 0; }
li.pick { align-items: baseline; min-height: 56px; padding: 14px 12px; border-bottom: 1px solid var(--hair); }
@media (hover: hover) { li.pick:hover { background: var(--panel); } }
.pick-rank { justify-self: end; font-size: .9375rem; font-weight: 600; color: var(--gold-dim); font-variant-numeric: tabular-nums; }
/* the tick box's hit area: the whole column, 32 px tall around the first line (the margins keep it off the row height) */
label.have {
  align-self: start; display: flex; align-items: center; justify-content: center; min-height: 32px; margin: -5px 0;
  cursor: pointer;
}
label.have input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.item, .got > * { min-width: 0; overflow-wrap: anywhere; }
.got { display: contents; }
.pick-name { font-weight: 600; line-height: 1.35; }
.pick-note { margin-top: 2px; font-size: .875rem; color: var(--muted); }
.pick-meta { margin-top: 2px; font-size: .8125rem; color: var(--muted); }
.src, .loc { font-size: .9375rem; }
.kind, .more { color: var(--muted); }
.src.none { grid-column: span 2; color: var(--muted); font-style: italic; }
.nums { font-variant-numeric: tabular-nums; }
.cue { display: block; margin-top: 2px; font-size: .8125rem; color: var(--muted); font-style: italic; }
.cue:empty { display: none; }
li.pick.empty .none { grid-column: 2 / -1; }
.none { font-size: .875rem; color: var(--muted); }
li.owned .iname, li.below .iname { color: var(--muted); font-weight: 500; }
.iname { overflow-wrap: anywhere; }
.iid { font-weight: 400; font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
:is(.iname, .tt-name).q0 { color: var(--q0); }
:is(.iname, .tt-name).q1 { color: var(--q1); }
:is(.iname, .tt-name).q2 { color: var(--q2); }
:is(.iname, .tt-name).q3 { color: var(--q3); }
:is(.iname, .tt-name).q4 { color: var(--q4); }
:is(.iname, .tt-name).q5 { color: var(--q5); }
:is(.iname, .tt-name).q6 { color: var(--q6); }
:is(.iname, .tt-name).q7 { color: var(--q7); }
/* Icons (Blizzard's 56 px art at 36 / 32 / 28 / 24 / 20 px): a 1 px frame and round corners like an item in a bag, the
   item's quality colour on items; a quiet square while a lazy one loads. The pick's icon has its own column, centred
   on the item name's line (the negative margins keep the row as tall as before). */
img.icon { flex: none; vertical-align: middle; border: 1px solid var(--border); border-radius: 4px; background: var(--panel); }
img.icon.q0 { border-color: var(--q0); }
img.icon.q1 { border-color: var(--q1); }
img.icon.q2 { border-color: var(--q2); }
img.icon.q3 { border-color: var(--q3); }
img.icon.q4 { border-color: var(--q4); }
img.icon.q5 { border-color: var(--q5); }
img.icon.q6 { border-color: var(--q6); }
img.icon.q7 { border-color: var(--q7); }
li.pick > img.icon { align-self: start; margin: -7px 0; }
ul.rows img.icon { margin-right: 6px; }
.with-icon { display: flex; align-items: center; gap: 10px; }
.spec-name { display: inline-flex; align-items: center; gap: 8px; }
details.harder { margin: 6px 0 0; padding-left: calc(3.5rem + 36px); font-size: .9375rem; }
details.harder > summary { width: max-content; max-width: 100%; padding: 4px 0; color: var(--muted); cursor: pointer; }
details.harder > ul { margin-top: 2px; }

/* An item name with a tooltip is a button (web/focus.js itemName, tipEl): it looks like the name, a dotted underline on
   hover. The tooltip sits outside the row's flow (absolute, under its row's corner: no layout shift); the page's script
   places it beside the name (CSSOM top / left), and hides it again. The game's tooltip: dark panel, light-grey frame,
   white lines, gold item level and set, green Equip / Use lines, our own lines muted under a hairline. */
li.pick, details.harder li { position: relative; }
button.tip-btn {
  padding: 0; margin: 0; border: 0; background: none; font: inherit; font-weight: inherit; line-height: inherit;
  text-align: left; cursor: pointer;
}
button.tip-btn:hover, button.tip-btn[aria-expanded="true"] { text-decoration: underline dotted; text-underline-offset: 3px; }
html:not(.js) button.tip-btn { cursor: text; }
a.iname { text-decoration: none; }              /* a name that links to its item page (web/focus.js itemName) */
a.iname:hover, a.iname:focus-visible, a.iname[aria-expanded="true"] { text-decoration: underline; text-underline-offset: 3px; }
.tt {
  position: absolute; z-index: 3; top: 100%; left: 0; width: 320px; max-width: calc(100vw - 16px); padding: 8px 12px 10px;
  background: var(--panel); border: 1px solid var(--tt-border); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .6); color: var(--q1); font-size: .875rem; font-weight: 400; line-height: 1.4;
  text-align: left; overflow-wrap: anywhere; cursor: auto; max-height: calc(100vh - 16px); overflow-y: auto;
  overscroll-behavior: contain;
}
.tt-name { font-size: 1rem; font-weight: 600; margin-bottom: 2px; }
.tt-gold { color: var(--gold); }
.tt-green { color: var(--green); }
.tt-note { color: var(--muted); }
.tt-pair { display: flex; justify-content: space-between; gap: 12px; }
.tt-set { margin-top: 8px; }
.tt-from { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border); }
.tt-close { display: none; }
.weapons { margin: 20px 0 0; font-size: .9375rem; }
.notes { margin-top: 16px; font-size: .875rem; color: var(--muted); }
.notes h3 { font-size: 1rem; margin: 0 0 4px; }
.notes ul { margin: 0; padding-left: 20px; }

/* Sections */
.where, section.report, details.fold { margin-top: 48px; }
.where > h2, section.report > h2 { font-size: 1.25rem; margin: 0 0 10px; }
section.report > h3, .where-body > h3 { font-size: 1rem; margin: 24px 0 6px; }
.advice { margin: 0 0 4px; font-size: 1.0625rem; }
.fine { margin: 4px 0 0; font-size: .875rem; color: var(--muted); }
.hint { font-size: .875rem; color: var(--muted); margin: 4px 0 0; }
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px 40px; margin-top: 24px; }
.place h3 { font-size: 1rem; margin: 0 0 4px; overflow-wrap: anywhere; }
.count { font-weight: 400; font-size: .875rem; color: var(--muted); }
ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows > li { padding: 3px 0; font-size: .9375rem; overflow-wrap: anywhere; }
.slot-word, .rank, .lead { color: var(--muted); }
.rank { font-size: .875rem; }
details.nothing { margin-top: 24px; }
details.nothing > summary, details.fold > summary { cursor: pointer; }
details.nothing > summary { color: var(--muted); }
details.nothing > ul { margin-top: 8px; }
details.fold > summary h2 { display: inline; font-size: 1.25rem; margin: 0; }
details.fold[open] > summary { margin-bottom: 10px; }
details.fold h3 { font-size: 1rem; margin: 20px 0 4px; }
details.fold p { margin: 4px 0 8px; max-width: 75ch; }

/* Data status and the details-only sections */
.page-head > h1:only-child { margin-bottom: 16px; }
.table-wrap { overflow-x: auto; margin: 8px 0; }
table caption { text-align: left; font-weight: 600; padding: 0 0 6px; }
table.plain { font-size: .9375rem; }
table.plain th, table.plain td { padding: 6px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hair); }
table.plain thead th { font-size: .875rem; font-weight: 600; color: var(--muted); border-bottom-color: var(--border); white-space: nowrap; }
table.plain tbody th { font-weight: 500; }
table.plain th:first-child, table.plain td:first-child { padding-left: 0; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-line { font-size: .875rem; color: var(--muted); margin: 8px 0; overflow-wrap: anywhere; }
.honesty li { margin: 4px 0; }
.change-list { list-style: none; padding: 0; margin: 0; }
.change-list li { padding: 6px 0; border-bottom: 1px solid var(--hair); overflow-wrap: anywhere; }
.change-list .iname { font-weight: 600; }
.sig { font-size: .875rem; color: var(--muted); }
.moves { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 16px; }
.moves .iname { font-weight: 500; }
.mv-out { color: var(--muted); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 20px; margin: 8px 0 16px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.badge {
  display: inline-block; padding: 0 6px; border-radius: 4px; font-size: .8125rem; line-height: 1.6; white-space: nowrap;
  background: var(--ev-visible-bg); color: var(--ev-visible-fg);
}
.badge.cand { background: var(--accent); color: var(--accent-contrast); margin-left: 6px; }
.ev-revealed, .ev-revealed-this-session { background: var(--ev-revealed-bg); color: var(--ev-revealed-fg); }
.ev-hotfixed { background: var(--ev-hotfixed-bg); color: var(--ev-hotfixed-fg); }
.ev-visible-confirmed { background: var(--ev-confirmed-bg); color: var(--ev-confirmed-fg); }
.ev-invalid, .ev-deleted, .ev-not-public { background: var(--ev-bad-bg); color: var(--ev-bad-fg); }
.alert { border: 1px solid; border-left-width: 4px; border-radius: var(--radius); padding: 10px 12px; margin: 12px 0; }
.alert ul { margin: 4px 0 0; padding-left: 20px; }
.alert-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.alert-error { background: var(--error-bg); border-color: var(--error-border); color: var(--error-text); }

/* Plain text pages (class hubs, What changed, About, Privacy, not found) */
.prose { max-width: calc(75ch + 48px); }
.prose h1 { font-size: 1.75rem; margin: 0 0 8px; }
.prose h2 { font-size: 1.25rem; margin: 32px 0 6px; }
.prose h3 { font-size: 1rem; margin: 20px 0 4px; }
.lede { font-size: 1.125rem; margin: 8px 0 12px; }
.tag, .others { color: var(--muted); }
.others { margin-top: 40px; }
.hub-spec { margin-top: 28px; }
.hub-spec h2 { margin: 0 0 4px; }
.hub-spec p { margin: 4px 0; }

/* Home: what the site is, then one card per class (a panel, no shadow) with its specs and their factions */
.intro { max-width: 75ch; }
.intro h1 { font-size: 2rem; margin: 0 0 8px; }
.intro p { margin: 8px 0; }
.home-classes { margin-top: 40px; }
.home-classes > h2 { font-size: 1.25rem; margin: 0 0 14px; }
.class-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.class-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 8px; }
.class-card h3 { margin: 0 0 6px; font-size: 1.125rem; }
.class-card h3 a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.class-card h3 a:hover { text-decoration: underline; }
.spec-list { list-style: none; margin: 0; padding: 0; }
.spec-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
  padding: 7px 0; border-top: 1px solid var(--hair); }
.facs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
a.fac {
  display: inline-flex; align-items: center; min-height: 30px; padding: 2px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); text-decoration: none; font-size: .875rem;
}
a.fac:hover { background: var(--panel); }
.site-links a[aria-current] { color: var(--text); font-weight: 600; }
@media (max-width: 960px) { .class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

footer.site { border-top: 1px solid var(--hair); font-size: .875rem; color: var(--muted); padding: 16px 0 28px; }
footer.site p { margin: 6px 0; max-width: 90ch; }

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

/* Phone: no horizontal scrolling; each slot is a block with its picks as a numbered list */
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  main { padding-top: 16px; }
  .page-head h1 { font-size: 1.5rem; }
  .tagline { display: none; }
  .intro h1 { font-size: 1.625rem; }
  .class-grid { grid-template-columns: 1fr; }
  .picker { gap: 8px; margin-bottom: 20px; }
  .choice { min-height: 32px; padding: 4px 10px; }
  /* a pick: rank, tick box, name (and its notes), then "source · location" in muted text; no column labels */
  .picks-sec { --cols: 1.25rem 1.75rem 36px minmax(0, 1fr); }
  .picks-sec :is([id], a, input, summary) { scroll-margin-top: 3.75rem; }
  .cols { display: none; }
  .slot h3 { padding: 8px; border-bottom: 1px solid var(--border); border-radius: var(--radius); }
  li.pick { column-gap: 8px; min-height: 0; padding: 12px 8px; }
  .got { display: block; grid-column: 4; margin-top: 2px; color: var(--muted); }
  .got > * { display: inline; font-size: .875rem; }
  .got .more { display: none; }   /* "· +4 more sources" here would read as part of the location */
  .loc::before { content: " · "; content: " · " / ""; }   /* a separator, silent where the browser allows */
  .src.none { font-style: italic; }
  details.harder { padding-left: calc(3rem + 24px); }
  .tt { max-width: none; }
  .tt-close {   /* sticky: stays in view while a capped panel scrolls */
    display: block; position: sticky; top: 0; z-index: 1; float: right; margin: 0 -4px 4px 8px; min-height: 32px;
    padding: 4px 10px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--bg); color: var(--text); font-size: .875rem; cursor: pointer;
  }
  .places { grid-template-columns: 1fr; }
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dd { margin-bottom: 6px; }
}

@media print {
  .picker, .head-tools, .strip, label.have, .tick-hint { display: none; }
}

/* The item database (tools/site/items.mjs): an item page shows the tooltip's facts openly; /items/ has the search box
   (web/items.js; hidden without the script). */
.tt.tt-open {
  position: static; width: auto; max-width: 360px; max-height: none; margin: 16px 0 8px; overflow: visible;
  box-shadow: none; font-size: .9375rem;
}
.search-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; margin: 16px 0 4px; }
.search-fields label { display: flex; flex-direction: column; gap: 2px; font-size: .875rem; color: var(--muted); }
.search-fields :is(input, select) {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 8px;
}
.search-fields input { width: min(320px, calc(100vw - 48px)); }
