/* Shared by the report (inlined, so a downloaded report stays one file) and
   the website (served as /static/site-<hash>.css with web/static/site.css).
   Colours, light/dark and the pieces both use. Report-only tokens (series,
   class colours, meter bars) stay in the report template.

   Direction C3, "Ironforge" (docs/design/README.md): soot ground, riveted
   iron plates, molten gold for actions and links, gems for colour. Dark is
   the default; light is the "daylight forge" (data-theme="light", which
   _theme.html also sets for "your device's setting" on a light device).
   Item-quality colours (--q0 ... --q5) are WoW's and stay as they are. */
:root {
  color-scheme: dark;
  --bg: #120f0d; --surface: #2a2420; --surface-2: #352d28; --border: #4d4038;
  --text: #eadfd2; --text-2: #cdbcaa; --muted: #a6937f; --grid: #3d332c;
  --accent: #ffc24d; --good: #8fd19a; --critical: #ff8f8f;
  --q0: #9d9d9d; --q1: var(--text); --q2: #1eff00; --q3: #3d9bff;
  --q4: #b964f5; --q5: #ff8000;
  --heading: #f3e6d6; --gold: #ffbe3d; --accent-ink: #2a1802;
  --molten: #ff8a1f; --well: #0c0907; --drop: #070504; --rivet: #6b5a4c;
  --speck: rgba(255, 255, 255, 0.025); --pit: rgba(0, 0, 0, 0.5);
  --stamp: 0 -1px 0 rgba(0, 0, 0, 0.95), 0 1px 0 rgba(255, 225, 190, 0.14),
           0 3px 8px rgba(0, 0, 0, 0.55);
  --gem-reports: #d42a4a; --gem-items: #1fa99c; --gem-world: #c9a227;
  --gem-addons: #d9669a;
  --font-body: "Alegreya Sans", system-ui, -apple-system, "Segoe UI", Roboto,
               sans-serif;
  --font-head: "Grenze", Georgia, "Times New Roman", serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e6e0d6; --surface: #f5f0e8; --surface-2: #ebe3d6; --border: #b3a493;
  --text: #1c1612; --text-2: #4a3e35; --muted: #675849; --grid: #d6ccbf;
  --accent: #8a4b00; --good: #1d6e2a; --critical: #a8231b;
  --q0: #6b6b6b; --q2: #1a8a00; --q3: #0062c4; --q4: #8a2bd1; --q5: #c05f00;
  --heading: #120f0d; --well: #ddd4c6; --drop: #a8998a; --rivet: #9a8674;
  --speck: rgba(255, 255, 255, 0.35); --pit: rgba(60, 40, 20, 0.07);
  --stamp: 0 1px 0 rgba(255, 255, 255, 0.7);
}

* { box-sizing: border-box; }
body {
  margin: 0; color: var(--text);
  background-color: var(--bg);
  /* soot: a fine speckle, two offset layers */
  background-image: radial-gradient(var(--speck) 1px, transparent 1.2px),
                    radial-gradient(var(--pit) 1px, transparent 1.4px);
  background-size: 7px 7px, 11px 11px; background-position: 0 0, 3px 5px;
  font: 15px/1.5 var(--font-body);
}
a { color: var(--accent); }
h1, h2 { font-family: var(--font-head); color: var(--heading);
         text-shadow: var(--stamp); letter-spacing: 0.01em; }
h2 { font-size: 22px; font-weight: 800; margin: 0 0 10px; line-height: 1.15; }
[hidden] { display: none !important; }

/* a riveted iron plate (in daylight, pale stone): every card */
.card { position: relative; min-width: 0; margin-bottom: 18px; padding: 18px;
        background-color: var(--surface);
        background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.05),
                                          rgba(0, 0, 0, 0.12));
        border: 2px solid var(--border); border-radius: 4px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
                    inset 0 -2px 0 rgba(0, 0, 0, 0.25), 0 3px 0 var(--drop); }
.rivet { position: absolute; width: 9px; height: 9px; border-radius: 50%;
         background: var(--rivet); pointer-events: none;
         box-shadow: inset -1px -1px 0 rgba(0, 0, 0, 0.45),
                     inset 1px 1px 0 rgba(255, 255, 255, 0.3); }
.sub { color: var(--text-2); font-size: 14px; }
.scroll { overflow-x: auto; }

/* buttons: cold iron; .primary (and a pressed toggle) molten gold */
.btn { font: inherit; font-size: 14px; font-weight: 700; padding: 6px 14px;
       min-height: 36px; border-radius: 3px; cursor: pointer;
       display: inline-flex; align-items: center; justify-content: center;
       gap: 6px; text-decoration: none; color: var(--heading);
       background-color: var(--surface-2);
       background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.10),
                                         rgba(0, 0, 0, 0.18));
       border: 1px solid var(--border);
       box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 0 var(--drop); }
.btn:hover { filter: brightness(1.12); }
.btn.primary, .btn[aria-pressed="true"] {
  color: var(--accent-ink); border-color: #fff0c0;
  background-color: var(--gold);
  background-image: linear-gradient(180deg, #ffe08f, var(--gold) 55%, #e8962a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 240, 0.7),
              0 0 12px rgba(255, 190, 60, 0.25), 0 2px 0 #3a2406; }
.btn.danger { color: var(--critical); }
.btn:disabled { opacity: .5; cursor: progress; }
.linkbtn { font: inherit; background: none; border: 0; padding: 0;
           color: var(--accent); cursor: pointer; }

/* the molten seam under the header and above the footer */
.seam { height: 3px; background: var(--molten);
        box-shadow: 0 0 10px 2px rgba(255, 120, 20, 0.45), 0 0 2px #ffe0a0; }

/* item quality */
.q0 { color: var(--q0); } .q1 { color: var(--q1); } .q2 { color: var(--q2); }
.q3 { color: var(--q3); } .q4 { color: var(--q4); } .q5 { color: var(--q5); }

/* The site header (_header.html): on site pages via the site stylesheet,
   and inside report pages via reports/sitebar.html. Every rule is scoped
   to .wp-top, and every token added for direction C3 has a fallback
   (var(--gold, #ffbe3d)): a stored report has its own, possibly older, CSS
   and tokens around it. */

/* an iron plate across the top, staying put while the page scrolls, above
   what scrolls under it (a report's charts and positioned bits) */
.wp-top { position: sticky; top: 0; z-index: 100; color: var(--text);
  background-color: var(--surface);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.18));
  border-bottom: 2px solid var(--border);
  font: 16px/1.4 var(--font-body, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif); }
.wp-top a { text-decoration: none; }
.wp-top .wp-bar { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap;
  max-width: 1200px; margin: 0 auto; padding: 8px 16px; }
.wp-top .wp-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--heading, var(--text)); }
.wp-top .wp-logo { flex: none; }
.wp-top .wp-word { font-family: var(--font-head, Georgia, serif); font-weight: 900;
  font-size: 27px; letter-spacing: 0.03em; line-height: 1;
  text-shadow: var(--stamp, none); }
/* the sections: cold iron when lit, a cut gem each */
.wp-top .wp-sections { display: flex; flex-wrap: wrap; gap: 4px; flex-grow: 1; }
.wp-top .wp-sections a { display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border-radius: 3px; border: 1px solid transparent;
  color: var(--text-2); font-weight: 700; }
.wp-top .wp-sections a:hover { color: var(--heading, var(--text)); background: var(--surface-2); }
.wp-top .wp-sections a.active { color: var(--heading, var(--text)); font-weight: 800;
  background-color: var(--surface-2);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(0, 0, 0, 0.18));
  border-color: var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 0 var(--drop, #070504); }
.wp-top .wp-gem { flex: none; }
.wp-top .wp-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.wp-top .wp-theme { font: inherit; background: none; border: 1px solid transparent;
  cursor: pointer; color: var(--text-2); width: 44px; height: 44px; border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center; }
.wp-top .wp-theme:hover { color: var(--heading, var(--text)); background: var(--surface-2);
  border-color: var(--border); }
.wp-top .wp-theme svg { width: 18px; height: 18px; transition: transform .15s ease; }
/* the icon's filled half sits on the other side in dark, so the button shows
   which mode you're in, not just that it toggles */
:root:not([data-theme="light"]) .wp-top .wp-theme svg { transform: scaleX(-1); }
/* logged out: "Log in" in molten gold where the account menu is */
.wp-top .wp-login { display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 16px; border-radius: 3px; white-space: nowrap; font-weight: 800;
  color: var(--accent-ink, #2a1802); border: 1px solid #fff0c0;
  background-color: var(--gold, #ffbe3d);
  background-image: linear-gradient(180deg, #ffe08f, var(--gold, #ffbe3d) 55%, #e8962a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 240, 0.7), 0 2px 0 #3a2406; }
.wp-top .wp-login:hover { filter: brightness(1.06); }
.wp-top .wp-narrow { display: none; }
.wp-top .wp-account { position: relative; min-width: 0; }
.wp-top .wp-account > summary { cursor: pointer; color: var(--text-2); list-style: none;
  display: flex; align-items: center; min-height: 44px; padding: 0 12px;
  border-radius: 3px; border: 1px solid transparent; font-weight: 700; }
.wp-top .wp-account > summary::-webkit-details-marker { display: none; }
.wp-top .wp-account > summary::after { content: " ▾"; color: var(--muted); white-space: pre; }
.wp-top .wp-account > summary:hover, .wp-top .wp-account[open] > summary {
  color: var(--heading, var(--text)); background: var(--surface-2); border-color: var(--border); }
.wp-top .wp-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  min-width: 180px; padding: 6px; display: grid; background: var(--surface);
  border: 2px solid var(--border); border-radius: 4px;
  box-shadow: 0 3px 0 var(--drop, #070504), 0 10px 28px rgba(0, 0, 0, .35); }
.wp-top .wp-menu a, .wp-top .wp-menu button { display: flex; align-items: center;
  width: 100%; min-height: 44px; text-align: left; font: inherit; color: var(--text);
  background: none; border: 0; cursor: pointer; padding: 0 12px; border-radius: 3px; margin: 0; }
.wp-top .wp-menu a:hover, .wp-top .wp-menu button:hover { background: var(--surface-2); }
.wp-top .wp-menu form { margin: 0; }
/* a section's tabs */
.wp-top .wp-tabs { display: flex; gap: 4px 22px; max-width: 1200px; margin: 0 auto;
  padding: 0 16px; overflow-x: auto; font-size: 15px; }
.wp-top .wp-tabs a { display: inline-flex; align-items: center; min-height: 44px;
  color: var(--text-2); white-space: nowrap; font-weight: 700;
  border-bottom: 3px solid transparent; }
.wp-top .wp-tabs a:hover { color: var(--heading, var(--text)); }
.wp-top .wp-tabs a.active { color: var(--heading, var(--text));
  border-bottom-color: var(--gold, var(--accent)); }
/* the trail on a page inside a section, and a report's details beside it */
.wp-top .wp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 16px;
  max-width: 1200px; margin: 0 auto; padding: 4px 16px 8px; font-size: 15px;
  color: var(--text-2); }
.wp-top .wp-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px;
  min-width: 0; }
.wp-top .wp-trail a { display: inline-flex; align-items: center; min-height: 40px;
  color: var(--text-2); font-weight: 700; }
.wp-top .wp-trail a:hover { color: var(--heading, var(--text)); }
.wp-top .wp-sep { color: var(--muted); }
.wp-top .wp-here { color: var(--heading, var(--text)); font-weight: 800; overflow-wrap: anywhere; }
.wp-top .wp-meta { color: var(--muted); }
.wp-top .wp-meta a, .wp-top .wp-actions a, .wp-top .wp-actions button {
  color: var(--accent); font-weight: 700; }
.wp-top .wp-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0 16px;
  align-items: center; }
.wp-top .wp-actions > * { display: inline-flex; align-items: center; min-height: 40px; }
.wp-top .wp-actions form { margin: 0; }
.wp-top .wp-actions button { font: inherit; background: none; border: 0; padding: 0;
  cursor: pointer; }
.wp-top .wp-actions button.wp-danger { color: var(--critical); }
/* the molten seam: the header's bottom edge */
.wp-top .wp-seam { height: 3px; background: var(--molten, #ff8a1f);
  box-shadow: 0 0 10px 2px rgba(255, 120, 20, 0.45), 0 0 2px #ffe0a0; }
@media (max-width: 640px) {
  /* a phone: the menu takes its own line under the logo, so the header is
     two or three rows - too much of a short screen to keep: it scrolls away
     with the page there (on every page, not just a report's). */
  .wp-top { position: static; }
  .wp-top .wp-bar { gap: 4px 8px; padding: 6px 10px; }
  .wp-top .wp-word { font-size: 23px; }
  .wp-top .wp-sections { order: 3; flex-basis: 100%; gap: 2px; }
  .wp-top .wp-sections a { padding: 0 10px; }
  .wp-top .wp-account > summary { padding: 0 8px; max-width: 9em; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; display: block; line-height: 44px; }
  .wp-top .wp-wide { position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap; }   /* still read out */
  .wp-top .wp-narrow { display: inline; }
  .wp-top .wp-login { padding: 0 12px; }
  .wp-top .wp-tabs, .wp-top .wp-crumbs { padding-left: 10px; padding-right: 10px; }
  .wp-top .wp-actions { margin-left: 0; } }

/* The website's own styles; served after report/_base.css (colours, plates,
   buttons) and templates/_header.css as one file - see _site_css() in
   app.py. Direction C3, "Ironforge": docs/design/README.md. Phone first:
   touch targets are 44px or more, tables scroll inside their plate. */

/* -- Page frame ------------------------------------------------------------ */
body { font-size: 16px; display: flex; flex-direction: column; min-height: 100vh; }
main { width: 100%; max-width: 1100px; margin: 0 auto; padding: 28px 16px 56px;
  flex: 1 0 auto; }
/* off-screen until focused (Tab from the top of the page), so keyboard and
   screen-reader users can jump past the menus straight to the content */
.wp-skip { position: absolute; left: -9999px; top: 0; z-index: 200;
  padding: 10px 16px; background: var(--surface); color: var(--text);
  border: 2px solid var(--border); border-radius: 0 0 4px 0; }
.wp-skip:focus { left: 0; }
h1 { font-size: 34px; font-weight: 900; line-height: 1.05; margin: 0 0 10px; }
.card h3 { font-size: 17px; font-weight: 800; color: var(--heading); margin: 20px 0 8px; }
.card > h3:first-child, .card > h2:first-child { margin-top: 0; }
.card p { margin: 0 0 10px; }
.card > :last-child { margin-bottom: 0; }
.lede { font-size: 18px; color: var(--text-2); margin: 0 0 12px; max-width: 46em; }
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent); }
/* "How this works": a page's details, out of the way of its one-line intro */
details.how { margin: 6px 0 0; font-size: 15px; color: var(--text-2); }
details.how > summary { cursor: pointer; color: var(--accent); width: max-content;
  min-height: 44px; display: flex; align-items: center; font-weight: 700; }
details.how > :not(summary) { margin: 4px 0 0; }
details.how[open] { margin-bottom: 14px; }
details.how ul { padding-left: 20px; }
.dim { color: var(--muted); }
.error { border-color: var(--critical); color: var(--critical); font-weight: 700; }
form.inline { display: inline; }
code { font-size: 0.92em; background: var(--well); padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--border); overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 0; }
/* an empty state: dashed, sunken, no rivets */
.empty { border: 2px dashed var(--border); border-radius: 4px; padding: 18px;
  background: rgba(0, 0, 0, 0.18); color: var(--text-2); }
.empty h3 { margin: 0 0 6px; }

/* every button and field is a 44px touch target on the site */
.btn { min-height: 44px; padding: 8px 18px; font-size: 16px; }
.btn.big { min-height: 50px; padding: 10px 26px; font-size: 18px; }

/* -- Footer ---------------------------------------------------------------- */
.wp-foot-seam { opacity: 0.6; }
.wp-foot { padding: 20px 16px; text-align: center; font-size: 14px; color: var(--muted);
  background: var(--well); }

/* -- Tables: inside a plate, scrolling sideways on a phone ---------------- */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 11px 12px; vertical-align: top;
  border-top: 1px solid var(--grid); }
th { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); background: rgba(0, 0, 0, 0.18); border-top: 0; white-space: nowrap; }
td.r, th.r { text-align: right; }
td a { font-weight: 700; text-decoration: none; }
td a:hover { text-decoration: underline; }
.card .scroll { margin: 0 -18px; padding: 0 18px; }
.card .scroll > table { min-width: 520px; }
/* a short table that reads fine squeezed: fit the phone, don't scroll */
.card .scroll.fit > table { min-width: 0; }
.card .scroll.fit th, .card .scroll.fit td { padding-left: 8px; padding-right: 8px; }
.pager { display: flex; gap: 12px; justify-content: space-between; align-items: center;
  margin-top: 14px; }
.pager a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* -- Pills, badges, tags --------------------------------------------------- */
.pill { font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 2px;
  border: 1px solid var(--border); color: var(--text-2); white-space: nowrap;
  background: var(--well); }
.pill.done { color: var(--good); border-color: var(--good); }
.pill.failed { color: var(--critical); border-color: var(--critical); }
.pill.held { color: var(--accent); border-color: var(--accent); }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.badge { font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 2px;
  border: 1px solid var(--border); color: var(--text-2); white-space: nowrap;
  background: var(--well); }
.badge.seen { color: var(--good); border-color: var(--good); }
.badge.src { color: var(--accent); border-color: var(--accent); white-space: normal; }
.badge.no { color: var(--muted); text-decoration: line-through; }
.tag { display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: 0.06em;
  color: var(--heading); border: 1px solid var(--border); background: var(--well);
  padding: 1px 7px; border-radius: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* -- Forms ------------------------------------------------------------------ */
input[type=text], input[type=search], input[type=number], select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--well);
  border: 1px solid var(--border); border-radius: 3px; min-height: 44px;
  padding: 6px 10px; box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.25); max-width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible,
button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px; }
input[type=radio], input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gold);
  margin: 0; flex: none; }
label.check, .check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
input[type=file] { font: inherit; color: var(--text-2); max-width: 100%; min-height: 44px; }
input[type=file]::file-selector-button { font: inherit; font-weight: 700; min-height: 40px;
  margin-right: 12px; padding: 0 14px; border-radius: 3px; cursor: pointer;
  color: var(--heading); background: var(--surface-2); border: 1px solid var(--border); }

/* -- Uploads ---------------------------------------------------------------- */
.drop { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.upload-progress { display: flex; gap: 10px; align-items: center; margin-top: 12px;
  flex-wrap: wrap; }
.upload-progress progress { width: min(320px, 100%); height: 12px; accent-color: var(--molten); }
.choices { display: grid; gap: 12px; margin: 16px 0; }
.choices form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.board-guild h3 { margin: 18px 0 8px; font-size: 18px; }
code.token { display: inline-block; max-width: 100%; overflow-wrap: anywhere;
  user-select: all; padding: 8px 10px; font-size: 15px; }

/* -- Sharing ---------------------------------------------------------------- */
fieldset.share { border: 1px solid var(--border); border-radius: 4px; margin: 0 0 14px;
  padding: 10px 14px; display: grid; gap: 2px; background: rgba(0, 0, 0, 0.12); }
fieldset.share legend { font-weight: 800; padding: 0 6px; color: var(--heading); }
fieldset.share .check { align-items: flex-start; padding: 10px 0; }
fieldset.share[disabled] { opacity: .5; }
fieldset.share select { width: 100%; }

/* -- Search forms: item finder, XP, settings ------------------------------- */
.finder-form { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: end; }
.finder-form label { display: grid; gap: 4px; font-size: 14px; font-weight: 700;
  color: var(--text-2); }
.finder-form label.check { display: flex; font-weight: 500; }
.finder-form .wide { flex: 1 1 18em; max-width: 32em; }
.finder-form .wide input { width: 100%; }
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; }
.stat-filter { flex: 1 1 100%; border: 1px solid var(--border); border-radius: 4px;
  padding: 10px 14px 12px; margin: 0; display: grid; gap: 10px; min-width: 0;
  background: rgba(0, 0, 0, 0.12); }
.stat-filter legend { font-size: 14px; font-weight: 800; color: var(--heading); padding: 0 6px; }
.seg { display: inline-flex; justify-self: start; border: 1px solid var(--border);
  border-radius: 3px; overflow: hidden; }
.seg button { font: inherit; font-size: 15px; font-weight: 700; min-height: 44px;
  padding: 0 16px; border: 0; cursor: pointer; background: var(--well); color: var(--text-2); }
.seg button[aria-pressed=true] { color: var(--accent-ink); background: var(--gold); }
.join-line { margin: 0; font-size: 15px; }
.stat-rows { display: grid; gap: 8px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stat-row select[name=s] { min-width: 0; max-width: 100%; flex: 0 1 16em; }
.stat-row input[readonly] { opacity: .45; }
.stat-row .x { font-size: 22px; line-height: 1; color: var(--text-2); min-width: 44px;
  min-height: 44px; }
.stat-filter .hint { margin: 0; }
@media (max-width: 560px) {
  .finder-form > label { flex: 1 1 100%; }
  /* full-width fields - not the checkboxes, which a width stretches away
     from their text */
  .finder-form > label select,
  .finder-form > label input:not([type=checkbox]):not([type=radio]) { width: 100%; }
  .stat-row { padding: 8px; border-radius: 3px; background: var(--surface-2); }
  .stat-row select[name=s] { flex: 1 1 100%; } }
.stats-help { margin-top: 8px; } .stats-help summary { cursor: pointer; min-height: 44px;
  display: flex; align-items: center; }

/* -- Item lists and one item's page ---------------------------------------- */
.items-list td { font-size: 15px; }
.items-list a { text-decoration: none; font-weight: 700; }
.items-list .pair { margin: 8px 0 0 2px; padding-left: 12px; border-left: 2px solid var(--border); }
.item-head h1 { margin-bottom: 4px; text-shadow: none; font-family: var(--font-body);
  font-weight: 800; font-size: 30px; }
.item-stats { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 3px;
  font-size: 17px; }
.item-facts { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 2px; }
dl.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* -- The landing page ------------------------------------------------------- */
.hero { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; margin-bottom: 36px; }
.hero > .card { margin: 0; }
.hero-main { flex: 999 1 480px; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.hero-main h1 { font-size: clamp(38px, 7vw, 58px); margin: 0; }
.hero-side { flex: 1 1 280px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; margin: 0 0 36px; }
.features .card { margin: 0; }
.features h2.addon-name { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.features h2.addon-name svg { width: 16px; height: 16px; }
/* numbered steps: a gold numeral in an iron socket */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 8px 0 12px;
  color: var(--text-2); }
ol.steps > li { counter-increment: step; position: relative; padding: 4px 0 10px 46px;
  min-height: 34px; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  font: 800 18px/1 var(--font-head); color: var(--accent); background: var(--well);
  border: 1px solid var(--border); border-radius: 50%; }
.features h3 { display: flex; align-items: center; gap: 12px; margin: 0 0 8px;
  font-size: 20px; color: var(--accent); }
.features h3 svg { flex: none; }
.features h3 a { color: inherit; text-decoration: none; }
.features h3 a:hover { text-decoration: underline; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: baseline; gap: 8px; margin: 0 0 12px; }
.section-head h2 { font-size: 30px; margin: 0; }
.section-head a { font-weight: 700; display: inline-flex; min-height: 44px; align-items: center; }
/* a sample meter: molten bars */
.meter-sample { display: grid; gap: 10px; }
.meter-sample .row { display: grid; gap: 4px; }
.meter-sample .row > div:first-child { display: flex; justify-content: space-between;
  font-weight: 700; }
.meter-sample .track { height: 10px; background: var(--well); border: 1px solid var(--border);
  border-radius: 2px; }
.molten { height: 8px; border-radius: 1px;
  background-image: linear-gradient(90deg, #a3260a, #ff6a13 45%, #ffc24d 80%, #fff1c2);
  box-shadow: 0 0 8px rgba(255, 140, 30, 0.45); }
@media (max-width: 560px) {
  main { padding-top: 18px; }
  h1 { font-size: 28px; }
  .hero-main { padding: 30px 22px 26px; }
  .card { padding: 16px; }
  .card .scroll { margin: 0 -16px; padding: 0 16px; } }

/* -- Daylight: the dark overlays above, softened for a pale ground -------- */
:root[data-theme="light"] th { background: rgba(90, 60, 30, 0.07); }
:root[data-theme="light"] .empty,
:root[data-theme="light"] fieldset.share,
:root[data-theme="light"] .stat-filter { background: rgba(90, 60, 30, 0.04); }
:root[data-theme="light"] input[type=text], :root[data-theme="light"] input[type=search],
:root[data-theme="light"] input[type=number], :root[data-theme="light"] select,
:root[data-theme="light"] textarea { box-shadow: inset 0 1px 2px rgba(60, 40, 20, 0.15); }

/* -- The login page: one plate, centred ------------------------------------ */
.login-card { max-width: 640px; margin: 24px auto; }
.login-card form { margin: 0 0 14px; }

/* Reports: compare nights */
.cmp-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cmp-pick a { padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px;
  text-decoration: none; }
.cmp-pick a.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.cmp-kill, .cmp-good { color: var(--good); }
.cmp-wipe, .cmp-bad { color: var(--critical); }
.cmp-nights td, .cmp-nights th { white-space: nowrap; }
.cmp-nights td:first-child, .cmp-nights th:first-child { position: sticky; left: 0;
  background: var(--surface); }

/* Reports: talents (/talents, and the builds on /compare) */
.cmp-respec { margin-left: 4px; padding: 0 5px; border: 1px solid var(--accent);
  border-radius: 999px; color: var(--accent); font-size: 12px; text-decoration: none; }
.tl-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px; }
.tl-tabs table { width: 100%; }
.tl-tabs tr.differs td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tl-tabs td.none { color: var(--muted); }
.tl-who { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px; }
.tl-who h3 { margin: 0; }
.tl-build { margin: 10px 0 0; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; }
.tl-build h4 { margin: 0 0 4px; }
.tl-heat { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px; margin-top: 12px; }
.tl-tree h3 { margin: 0 0 6px; }
.tl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.tl-node { min-height: 52px; padding: 4px; border: 1px solid var(--border); border-radius: 6px;
  display: flex; flex-direction: column; justify-content: space-between; font-size: 11px;
  line-height: 1.15; overflow: hidden; color: var(--text);
  /* at most half accent: the name stays readable on the busiest talent */
  background: color-mix(in srgb, var(--accent) calc(var(--heat) * 0.5), transparent); }
.tl-node.unseen { border-style: dashed; color: var(--muted); }
.tl-node .pc { font-weight: 700; font-size: 13px; }

/* the talent-tree icon by a name on /compare (a word there repeated down
   every row) */
.talent-ico { display: inline-flex; vertical-align: -2px; margin-left: 4px;
  padding: 2px; border-radius: 3px; text-decoration: none; }
.talent-ico:hover, .talent-ico:focus-visible { color: var(--accent); }

/* Sim: long tables keep their header in view (/sim/regen) */
.card .scroll.tall { max-height: 70vh; overflow: auto; margin: 0; padding: 0; }
.card .scroll.tall thead th { position: sticky; top: 0; z-index: 1;
  background: var(--surface); box-shadow: inset 0 -1px 0 var(--grid); }
/* ...and the first column, scrolling sideways on a phone */
.card .scroll.tall td:first-child, .card .scroll.tall th:first-child {
  position: sticky; left: 0; background: var(--surface); }
.card .scroll.tall thead th:first-child { z-index: 2; }
.rg-sub { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; }
.sim-spread { white-space: nowrap; }

/* coaching: a member's gear upgrades (coach/_upgrades.html) */
/* the upgrades' source checkboxes: wrap on a phone, a tap target each */
.up-sources { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 10px 0; }
.up-sources label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.up-sources input { width: 18px; height: 18px; accent-color: var(--accent); }
table.upgrades td:first-child { white-space: nowrap; font-weight: 700; }
table.upgrades .pick + .pick { margin-top: 8px; }
@media (max-width: 640px) {      /* a phone: each slot stacked, no sideways scroll */
  table.upgrades tr:first-child { display: none; }
  table.upgrades, table.upgrades tbody, table.upgrades tr, table.upgrades td { display: block; }
  .card .scroll > table.upgrades { min-width: 0; }
  table.upgrades td { overflow-wrap: anywhere; }
  table.upgrades td { padding: 4px 0; border: 0; }
  table.upgrades tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  table.upgrades td:nth-child(2)::before { content: "Wearing: "; color: var(--muted); font-weight: 400; }
}
/* an item's quality in words beside its colour ("Rare"): coach pages */
.qword { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; opacity: 0.85; }
