/* P12S progress site. Chart colours follow the dataviz reference palette; the violet accent is the trainer's. */

:root{
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255,255,255,0.10);
  --accent: #c084fc;
  --series: #3987e5;
  --series-wash: rgba(57,135,229,0.12);
  /* heatmap ramp, from the step nearest the surface to the strongest */
  --heat-0: #184f95; --heat-1: #256abf; --heat-2: #3987e5; --heat-3: #86b6ef; --heat-4: #cde2fb;
  --zone: rgba(240,239,236,0.07);
  --good: #0ca30c; --warn: #fab219; --bad: #d03b3b;
  --div-neg: #e66767; --div-mid: #383835; --div-pos: #3987e5; --wipe: #b02a3a;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: light){
  :root:where(:not([data-theme="dark"])){
    color-scheme: light;
    --page: #f9f9f7; --surface: #fcfcfb; --surface-2: #f0efec;
    --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781; --grid: #e1e0d9; --axis: #c3c2b7;
    --border: rgba(11,11,11,0.10); --accent: #7e22ce;
    --series: #2a78d6; --series-wash: rgba(42,120,214,0.10);
    --heat-0: #86b6ef; --heat-1: #5598e7; --heat-2: #2a78d6; --heat-3: #1c5cab; --heat-4: #104281;
    --zone: rgba(11,11,11,0.06);
    --div-neg: #e34948; --div-mid: #f0efec; --div-pos: #2a78d6; --wipe: #8e1626;
  }
}
:root[data-theme="light"]{
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --surface-2: #f0efec;
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781; --grid: #e1e0d9; --axis: #c3c2b7;
  --border: rgba(11,11,11,0.10); --accent: #7e22ce;
  --series: #2a78d6; --series-wash: rgba(42,120,214,0.10);
  --heat-0: #86b6ef; --heat-1: #5598e7; --heat-2: #2a78d6; --heat-3: #1c5cab; --heat-4: #104281;
  --zone: rgba(11,11,11,0.06);
  --div-neg: #e34948; --div-mid: #f0efec; --div-pos: #2a78d6; --wipe: #8e1626;
}

*{ box-sizing: border-box; }
[hidden]{ display: none !important; }
body{ margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 var(--font); }
a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }
.muted{ color: var(--muted); }
.ink2{ color: var(--ink-2); }

.top{ position: sticky; top: 0; z-index: 5; background: var(--page); border-bottom: 1px solid var(--border); }
.top-inner{ max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.brand{ font-weight: 650; color: var(--ink); }
.crumbs{ display: flex; gap: 6px; flex-wrap: wrap; color: var(--muted); flex: 1; min-width: min(14em, 100%); }
.crumbs a{ color: var(--ink-2); }
.crumbs span[aria-current]{ color: var(--ink); }
.navlink{ color: var(--ink-2); }
.navlink[aria-current]{ color: var(--ink); font-weight: 600; }
tr.moving td{ background: var(--series-wash); }
.page > figure.card + .grid{ margin-top: 12px; }
/* two columns of sections (player page: opener | rotation and abilities), one when narrow */
.cols{ display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); column-gap: 12px; align-items: start; }
.col{ min-width: 0; }
.col .grid.wide{ grid-template-columns: 1fr; }
.mini{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 12px; }
.mini .l{ color: var(--ink-2); font-size: 12px; }
.mini .v{ font-size: 22px; font-weight: 620; font-variant-numeric: tabular-nums; }
.mini .s{ color: var(--muted); font-size: 12px; }
/* the compact rotation: GCD icons on the line, the oGCDs woven after each smaller and raised */
.rot-strip{ display: flex; flex-direction: column; gap: 12px; }
.rot-seg{ display: flex; gap: 10px; align-items: flex-start; }
.rot-seg-label{ flex: 0 0 74px; font-size: 12px; line-height: 1.3; color: var(--ink-2); padding-top: 4px; }
.rot-seg-label span{ display: block; color: var(--muted); font-variant-numeric: tabular-nums; }
.rot-icons{ display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 4px; min-width: 0; }
.rot-g{ position: relative; display: flex; align-items: flex-start; gap: 1px; padding-bottom: 5px; border-radius: 5px; }
.rot-g .gcd{ width: 34px; height: 34px; border-radius: 5px; display: block; }
.rot-g .ogcd{ width: 22px; height: 22px; border-radius: 4px; display: block; }
.rot-g.moving::after{ content: ""; position: absolute; left: 2px; width: calc(3px + 27px * var(--run, 1)); bottom: 0; height: 3px; border-radius: 2px; background: var(--series); }
.rot-g.moving.instant::after{ background: var(--good); }
.rot-g:focus-visible{ outline: 2px solid var(--accent); outline-offset: 1px; }
.rot-g .noicon{ display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--ink-2); font-size: 10px; font-weight: 600; }
@media (max-width: 520px){
  .rot-seg{ flex-direction: column; gap: 4px; }
  .rot-seg-label{ flex: none; padding-top: 0; }
  .rot-seg-label span{ display: inline; margin-left: 6px; }
}
/* the rotations overview's job chart: our pulls as a box, the ceiling as a tick, the clears' players as dots */
.chart .box-mid{ fill: var(--series); }
.chart .box-med{ stroke: var(--surface); stroke-width: 2; }
.chart .box-whisker{ stroke: var(--series); stroke-width: 1.5; }
.chart .box-out{ fill: var(--series); stroke: var(--surface); stroke-width: 1.5; }
.chart .clear-dot{ fill: var(--muted); stroke: var(--surface); stroke-width: 2; }
.chart .ceil-tick{ stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.chart .ceil-band, .ceil-band-key{ fill: var(--ink); background: var(--ink); opacity: 0.09; }
.chart .hit.link{ cursor: pointer; }
.chart .hit.link:hover, .chart .hit.link:focus-visible{ fill: var(--surface-2); }
/* job icons: in the rotations table's Job column, and larger before a job page's title */
.job-icon{ width: 24px; height: 24px; margin: -4px 8px -4px 0; vertical-align: middle; }   /* inline: the name keeps the row's baseline */
/* a job's icon in place of its name: table cells, tiles, titles; several in a row sit close together */
.job-icon.mark{ width: 22px; height: 22px; margin: -4px 0; }
.tile .value .job-icon.mark{ width: 30px; height: 30px; margin: 0; }
.tile .label .job-icon.mark{ width: 16px; height: 16px; margin: -3px 0; }
.marks{ white-space: nowrap; }
/* the Players list's job entries: equal widths (the widest, "−10%*" and its dot, needs about 80 px), icons in columns;
   four to a line, a fifth job wraps under the first */
.marks .jv{ display: inline-block; width: 6.1em; }
.marks.jvs{ display: inline-block; white-space: normal; max-width: calc(4 * 6.1em); }
h1 .job-icon.big{ width: 40px; height: 40px; margin: -4px 10px -2px 0; }
.theme{ font: inherit; color: var(--ink-2); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; cursor: pointer; }

.page{ max-width: 1240px; margin: 0 auto; padding: 20px 16px 64px; }
h1{ font-size: 24px; font-weight: 650; margin: 4px 0 2px; }
h2{ font-size: 17px; font-weight: 650; margin: 32px 0 10px; scroll-margin-top: 64px; }   /* jumps land below the sticky header */
.lede{ color: var(--ink-2); margin: 0 0 18px; max-width: 72ch; }
.lede.challenges p{ margin: 0 0 6px; }
.lede.challenges ul{ margin: 0; padding-left: 18px; }
.lede.challenges li{ margin: 4px 0; }
.lede.challenges strong{ color: var(--ink); font-weight: 600; }
.lede.challenges li[data-k]{ cursor: pointer; border-radius: 4px; margin-left: -4px; padding: 1px 4px; outline: none; }
.lede.challenges li[data-k]:focus-visible{ box-shadow: 0 0 0 2px var(--accent); }
.lede.challenges li.on{ background: color-mix(in srgb, var(--accent) 12%, transparent); }
.focus-band{ fill: var(--accent); fill-opacity: .2; stroke: var(--accent); stroke-width: 1.5; opacity: 0; pointer-events: none; transition: opacity .15s; }
.focus-band.on{ opacity: 1; }

/* stat tiles */
.kpis{ display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 16px 0 8px; }
.tile{ background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.tile .label{ color: var(--ink-2); font-size: 13px; }
.tile .value{ font-size: 26px; font-weight: 620; margin-top: 2px; }
.tile .sub{ color: var(--muted); font-size: 13px; }

/* cards and charts */
.grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; }
.grid.wide{ grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); }
figure.card{ margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 14px 10px; min-width: 0; }
.card-head{ display: flex; align-items: baseline; gap: 10px; }
.card-head h3{ font-size: 15px; font-weight: 620; margin: 0; flex: 1; }
.card-head button{ font: inherit; font-size: 12px; color: var(--ink-2); background: transparent; border: 1px solid var(--border); border-radius: 6px; padding: 1px 8px; cursor: pointer; }
figcaption{ color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.legend{ display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); font-size: 12px; margin: 6px 0 0; }
.legend i{ display: inline-block; vertical-align: middle; margin-right: 5px; }
.chart svg{ display: block; width: 100%; height: auto; overflow: visible; }
.chart text{ fill: var(--muted); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.chart text.lbl{ fill: var(--ink-2); }
.chart text.val{ fill: var(--ink); font-weight: 600; }
.chart .gridline{ stroke: var(--grid); stroke-width: 1; }
.chart .axisline{ stroke: var(--axis); stroke-width: 1; }
.chart .ref{ stroke: var(--muted); stroke-width: 1; }
.chart line.strategy{ stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }   /* a strategy's start date */
.chart text.lbl.strategy{ fill: var(--muted); font-size: 11px; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.chart .barmark{ stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.chart .hit{ fill: transparent; cursor: default; }
/* only what carries a tooltip (hover() gives it a tabindex) takes the pointer: bars, lines and numbers drawn over a
   hover area let it through, so pointing inside a bar shows its tooltip, not only at its edges */
.chart svg *:not([tabindex]){ pointer-events: none; }
.chart svg [tabindex]{ pointer-events: all; }
.chart .hit:hover + .mark, .chart .mark.hover{ filter: brightness(1.2); }
.empty{ color: var(--muted); padding: 18px 0; }

/* tables */
.table-wrap{ position: relative; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
figure .table-wrap{ border: 0; background: transparent; }
table{ border-collapse: collapse; width: 100%; font-size: 14px; }
th, td{ padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th{ color: var(--ink-2); font-weight: 600; font-size: 13px; }
td.num, th.num{ text-align: right; font-variant-numeric: tabular-nums; }
tr.link{ cursor: pointer; }
tr.link:hover td{ background: var(--surface-2); }
tr.role td{ color: var(--muted); font-size: 12px; padding-top: 12px; border-bottom: 0; }
td.wrap{ white-space: normal; min-width: 260px; }
.names{ white-space: normal; } .names .nm{ white-space: nowrap; }   /* a name list wraps after its commas only */

/* grades: a green, yellow or red dot; the word rides along for hover and screen readers */
.g{ display: inline-flex; align-items: center; margin-left: 6px; vertical-align: middle; }
.g::before{ content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.sr-only{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.g.good{ --c: var(--good); } .g.ok{ --c: var(--warn); } .g.bad{ --c: var(--bad); }
.note{ color: var(--muted); font-size: 13px; margin-top: 8px; }

/* tooltip */
.tip{ position: fixed; z-index: 10; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--border);
      border-radius: 8px; padding: 8px 10px; font-size: 13px; box-shadow: 0 6px 24px rgba(0,0,0,0.25); max-width: 340px; }
.tip .t-title{ color: var(--ink-2); margin-bottom: 4px; }
.tip .t-row{ display: flex; gap: 8px; align-items: baseline; }
.tip .t-row b{ font-weight: 650; white-space: nowrap; flex: none; }   /* the number stays whole; the label wraps */
.tip .t-row span{ color: var(--ink-2); }
.tip .t-key{ width: 12px; height: 2px; background: var(--series); align-self: center; flex: none; }
/* keys drawn like the job chart's marks, in a 14 px slot, level with the row's first line */
.tip .t-key[class*=" k-"]{ width: 14px; height: 10px; align-self: flex-start; margin-top: 4px; background: none; }
.tip .t-key.k-box{ background: var(--series); border-radius: 2px; }
.tip .t-key.k-median{ background: linear-gradient(90deg, var(--series) 6px, var(--surface) 6px 8px, var(--series) 8px); border-radius: 2px; }
.tip .t-key.k-whisker{ border-left: 1.5px solid var(--series); border-right: 1.5px solid var(--series);
                       background: linear-gradient(var(--series), var(--series)) center / 100% 1.5px no-repeat; }
.tip .t-key.k-out{ background: radial-gradient(circle, var(--series) 3.5px, transparent 4px); }
.tip .t-key.k-ceil{ background: linear-gradient(var(--ink), var(--ink)) center / 2px 100% no-repeat; height: 14px; margin-top: 2px; }
.tip .t-key.k-band{ background: color-mix(in srgb, var(--ink) 9%, transparent); border-radius: 2px; height: 12px; margin-top: 3px; }
.tip .t-key.k-clear{ background: radial-gradient(circle, var(--muted) 3.5px, transparent 4px); }
/* k-none: an empty slot, for a line that breaks down the one above it */

/* passphrase screen */
.unlock{ display: grid; gap: 8px; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.unlock label{ color: var(--ink-2); font-size: 13px; }
.unlock label.check{ display: flex; gap: 6px; align-items: center; }
.unlock input[type=password]{ font: inherit; color: var(--ink); background: var(--page); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.unlock button.primary{ font: inherit; font-weight: 600; color: #fff; background: var(--series); border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; justify-self: start; }
.unlock button.primary:disabled{ opacity: 0.6; cursor: progress; }
/* accounts and the admin page */
.unlock.wide{ max-width: 560px; }
.unlock input[type=text], .unlock input[type=email], .unlock input[type=number], .unlock input[type=date], table.admin input[type=text]{ font: inherit; color: var(--ink); background: var(--page); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.unlock input[type=number]{ width: 4.5em; padding: 4px 6px; }
table.admin input[type=text]{ padding: 3px 6px; }
table.admin td.wrap{ white-space: normal; min-width: 8em; }
table.admin div.actions{ display: flex; flex-wrap: nowrap; gap: 4px; }
/* admin tabs: space between a tab's form and the list or search results under it */
.tabpanel form.unlock{ margin-bottom: 16px; }
.unlock .note:empty{ display: none; }   /* a form's status line takes no room until it says something */
.tabpanel .note + .table-wrap, .tabpanel .warn + .table-wrap{ margin-top: 8px; }
table.admin .names{ min-width: 16em; max-width: 30em; }
.actions{ display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions button, button.small{ font: inherit; font-size: 13px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.actions button:disabled, button.small:disabled{ opacity: 0.5; cursor: default; }
button.danger{ color: var(--div-neg); }
tr.muted td{ color: var(--muted); }

/* "?" explanations */
.help{ display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 8px; padding: 0;
       border: 1px solid var(--border); border-radius: 50%; background: transparent; color: var(--muted); font: 600 11px/1 inherit;
       vertical-align: middle; cursor: help; }
.help:hover, .help:focus-visible{ color: var(--ink); border-color: var(--ink-2); }
h3 .help{ width: 16px; height: 16px; margin-left: 6px; font-size: 10px; }
.tip .t-text{ color: var(--ink); line-height: 1.45; font-size: 13px; }

/* opener card */
.opener .summary{ margin: 0 0 8px; font-size: 14px; }
.opener table{ width: 100%; }
.opener .bad{ color: var(--div-neg); font-weight: 600; }
.opener ul.diffs{ margin: 0 0 10px; padding-left: 18px; font-size: 13px; }
.opener ul.diffs li{ margin: 2px 0; }

/* report-level warnings (e.g. The Echo) */
.warn{ border-left: 3px solid var(--div-neg); padding: 8px 12px; background: var(--surface); border-radius: 6px; color: var(--ink); max-width: 90ch; }

/* focus lists: what to work on */
/* "On this page" links under a long page's title */
.sections{ display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -6px 0 16px; font-size: 14px; }
/* "Show N more causes" under a cut-short heatmap */
.card p.more{ margin: 8px 0 0; }
/* sortable headers: the header is a button, the arrow marks the column and direction */
th button.sort{ font: inherit; font-weight: 600; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
th button.sort:hover{ color: var(--ink); text-decoration: underline; }
th[aria-sort="ascending"], th[aria-sort="descending"]{ color: var(--ink); }
/* the Players list's latest-night arrow after a grade dot */
.trend{ margin-left: 4px; font-size: 11px; }
.trend.bad{ color: var(--bad); } .trend.good{ color: var(--good); } .trend.flat{ color: var(--muted); }
input.filter{ font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; width: min(100%, 280px); }
.focus-card{ background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; max-width: 90ch; }
ol.focus{ margin: 0; padding-left: 22px; display: grid; gap: 10px; }
ol.focus li::marker{ color: var(--ink-2); font-weight: 600; }
.focus .f-title{ font-weight: 600; }
.focus .f-detail{ color: var(--ink-2); font-size: 14px; }
.focus .f-links{ font-size: 13px; margin-top: 2px; display: flex; gap: 12px; flex-wrap: wrap; }
.drill a{ color: var(--accent, #8b6cf6); }
.linklike{ background: none; border: 0; padding: 0; font: inherit; color: var(--accent, #8b6cf6); cursor: pointer; }
.linklike:hover, .drill a:hover{ text-decoration: underline; }

/* burndown */
.bd-pulls{ fill: none; stroke: var(--series); stroke-width: 1.2; stroke-linejoin: round; opacity: 0.85; }
.bd-best{ fill: none; stroke: #9b6cf2; stroke-width: 2.2; }
.milestone{ stroke: var(--muted); stroke-dasharray: 2 3; }
.tabs{ display: flex; gap: 6px; margin: 4px 0 8px; flex-wrap: wrap; }
.tabs button{ font: inherit; font-size: 13px; color: var(--ink-2); background: transparent; border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.tabs button.on{ color: var(--ink); border-color: var(--series); background: var(--series-wash); }
figure.card .summary{ margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }
td.good{ color: #3fae5a; } td.bad{ color: var(--div-neg); }
.chart line.ref.ref-min{ stroke: var(--div-neg); stroke-dasharray: 4 3; stroke-opacity: 0.9; }
.chart text.lbl.ref-min{ fill: var(--div-neg); }
.chart .series2{ fill: none; stroke: #9b6cf2; stroke-width: 2; stroke-dasharray: 5 4; }
.chart .mark2{ fill: var(--surface); stroke: #9b6cf2; stroke-width: 2; }
.chart text.second{ fill: #9b6cf2; }
.chart .ref-mark{ stroke: var(--ink); stroke-width: 2.5; }
.chart .extra{ fill: none; stroke-width: 1.8; stroke-dasharray: 5 4; }
.chart .extra.x-death{ stroke: var(--div-neg); } .chart .mark-extra.x-death{ fill: var(--div-neg); }
.chart .extra.x-dd{ stroke: #e0a03a; } .chart .mark-extra.x-dd{ fill: #e0a03a; }
.chart .extra.x-min{ stroke: #9b6cf2; } .chart .mark-extra.x-min{ fill: #9b6cf2; }
.card + .table-wrap{ margin-top: 16px; }

/* best-in-slot gear: item names in the game's rarity colours (2 green, 3 blue, 4 purple), materia by stat (the
   dataviz categorical slots 1-4, checked for colour-blind separation in both themes; every chip also carries its name) */
:root{ --r2: #5cc45c; --r3: #86b6ef; --r4: #c084fc; --m-crit: #3987e5; --m-dh: #d95926; --m-det: #199e70; --m-speed: #c98500; }
@media (prefers-color-scheme: light){
  :root:where(:not([data-theme="dark"])){ --r2: #1a7f1a; --r3: #1c5cab; --r4: #7e22ce; --m-crit: #2a78d6; --m-dh: #eb6834; --m-det: #1baf7a; --m-speed: #eda100; }
}
:root[data-theme="light"]{ --r2: #1a7f1a; --r3: #1c5cab; --r4: #7e22ce; --m-crit: #2a78d6; --m-dh: #eb6834; --m-det: #1baf7a; --m-speed: #eda100; }
.r2{ --rc: var(--r2); } .r3{ --rc: var(--r3); } .r4{ --rc: var(--r4); }
.m-crit{ --mc: var(--m-crit); } .m-dh{ --mc: var(--m-dh); } .m-det{ --mc: var(--m-det); } .m-speed{ --mc: var(--m-speed); }
.gear-doll{ display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.gear-col{ display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gear-item{ display: flex; gap: 9px; align-items: center; padding: 4px 6px; border-radius: 6px; min-width: 0; outline: none; }
.gear-item:hover, .gear-item:focus-visible{ background: var(--surface-2); }
.gear-item:focus-visible{ box-shadow: 0 0 0 2px var(--accent); }
.gear-icon{ width: 36px; height: 36px; flex: none; border-radius: 6px; box-shadow: 0 0 0 1px var(--rc, var(--border)); }
.gear-icon.noicon, .gf-icon.noicon{ display: inline-block; background: var(--surface-2); }
.gi-body{ min-width: 0; flex: 1; }
.gi-top, .gi-sub{ display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.gi-name{ color: var(--rc, var(--ink)); font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.gi-ilvl{ color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gi-sub{ font-size: 12px; margin-top: 1px; }
.gi-mats{ display: flex; gap: 3px; flex: none; }
.gi-off{ color: var(--muted); font-style: italic; }
.gi-stats{ color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: auto; font-variant-numeric: tabular-nums; }
.mat{ display: inline-flex; align-items: center; gap: 4px; font-size: 11px; line-height: 16px; padding: 0 5px 0 4px; border-radius: 8px; color: var(--ink-2);
      background: color-mix(in srgb, var(--mc) 16%, transparent); border: 1px solid transparent; white-space: nowrap; }
.mat::before{ content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mc); }
.mat.cut{ border: 1px dashed var(--mc); }
.mat.empty{ background: var(--surface-2); color: var(--muted); }
.mat.empty::before{ display: none; }
.gear-stats{ display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px 12px; margin: 10px 0 0; padding: 10px 6px 0; border-top: 1px solid var(--border); }
.gs .l{ color: var(--ink-2); font-size: 12px; }
.gs .v{ font-size: 17px; font-weight: 620; font-variant-numeric: tabular-nums; }
.gs .s{ color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.gear-foot{ display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; margin: 10px 0 2px; padding: 0 6px; font-size: 13px; color: var(--ink-2); }
.gf{ display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; outline: none; border-radius: 4px; }
.gf:focus-visible{ box-shadow: 0 0 0 2px var(--accent); }
.gf b{ color: var(--ink); font-weight: 600; }
.gf-icon{ width: 22px; height: 22px; border-radius: 4px; }
.gf-m{ display: inline-flex; gap: 3px; align-items: center; font-variant-numeric: tabular-nums; }
.tip .t-key.mk{ width: 8px; height: 8px; border-radius: 50%; background: var(--mc); align-self: center; }
.tip .t-key.k-tier-s{ width: 10px; height: 10px; border-radius: 50%; background: var(--series); align-self: center; }
.tip .t-key.k-tier-f{ width: 8px; height: 8px; border-radius: 50%; background: var(--muted); align-self: center; }
.chart .tier-f{ fill: var(--muted); stroke: var(--surface); stroke-width: 2; }
.chart .tier-s{ fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.chart .tier-g{ fill: var(--surface); stroke: var(--series); stroke-width: 1.5; }
.tip .t-key.k-tier-g{ width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--series); align-self: center; }
/* the classifier's confidence in a culprit: high reads plainly, the weaker ones recede */
.conf{ font-size: 12px; white-space: nowrap; color: var(--ink-2); } .conf.medium, .conf.low{ color: var(--muted); } .conf.low{ font-style: italic; }
/* a chained cause's earlier deaths, folded under the immediate cause */
details.trace{ margin-top: 4px; font-size: 13px; color: var(--ink-2); }
details.trace summary{ cursor: pointer; color: var(--muted); }
ul.trace{ margin: 4px 0 0; padding-left: 14px; border-left: 1px solid var(--grid); list-style: none; }
ul.trace li{ margin: 4px 0; }
.tag{ display: inline-block; font-size: 11px; line-height: 15px; padding: 0 5px; margin-left: 6px; border: 1px solid var(--accent); color: var(--accent); border-radius: 4px; vertical-align: 1px; }
@media (max-width: 760px){
  .gear-doll{ grid-template-columns: 1fr; }
}

/* bookkeeping and setups (setups.js): study history letters in their tier's colour, as the sheet's font colours */
:root{ --t1: #3fbf3f; --t2: #e6c229; --t3: #f08a3c; --t4: #ef5350; --t5: #c084fc; --t6: #4aa8ff; }
@media (prefers-color-scheme: light){ :root:where(:not([data-theme="dark"])){ --t1: #1a7f1a; --t2: #9a7400; --t3: #c25a00; --t4: #c62828; --t5: #7e22ce; --t6: #1565c0; } }
:root[data-theme="light"]{ --t1: #1a7f1a; --t2: #9a7400; --t3: #c25a00; --t4: #c62828; --t5: #7e22ce; --t6: #1565c0; }
.lt{ font-weight: 650; font-variant-numeric: tabular-nums; }
.lt.t1{ color: var(--t1); } .lt.t2{ color: var(--t2); } .lt.t3{ color: var(--t3); } .lt.t4{ color: var(--t4); } .lt.t5{ color: var(--t5); } .lt.t6{ color: var(--t6); }
table.matrix th, table.matrix td{ padding: 2px 5px; text-align: center; }
table.matrix td:first-child, table.matrix th:first-child{ text-align: left; white-space: nowrap; position: sticky; left: 0; background: var(--page); }
table.matrix th.rot{ writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-weight: 500; font-size: 12px; }
.matrix-wrap{ max-height: 75vh; overflow: auto; }
dl.facts{ display: grid; grid-template-columns: max-content 1fr; gap: 2px 16px; margin: 0 0 12px; }
dl.facts dt{ color: var(--muted); } dl.facts dd{ margin: 0; }
a.dutychip{ display: inline-block; margin: 0 10px 2px 0; white-space: nowrap; color: var(--ink-2); }
fieldset.dest{ border: 1px solid var(--border); border-radius: 8px; display: grid; gap: 4px; padding: 8px 12px; }
.unlock select, .actions select{ font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; }
.unlock input[type=time], .unlock input[type=search]{ font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; }
pre.cmd{ white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
details.signups{ margin: 6px 0; } details.signups summary{ cursor: pointer; color: var(--ink-2); }
.std{ font-size: 11px; font-weight: 600; padding: 0 4px; border-radius: 4px; border: 1px solid var(--border); }
.std.s-P{ color: var(--series); } .std.s-K{ color: var(--muted); } .std.s-new{ color: var(--good); } .std.s-q{ color: var(--warn); }
ul.warnlist{ padding-left: 18px; } ul.warnlist li{ margin: 2px 0; } ul.warnlist li.w-hard b{ color: var(--bad); } ul.warnlist li.w-soft b{ color: var(--warn); }
textarea.announce{ width: 100%; font: 13px/1.4 ui-monospace, monospace; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.linkbox input{ width: 12em; }

/* #/feats (feats.js) */
.feats-options{ display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }
.feats-options select, .page select{ font: inherit; }
.feats-copy{ margin: 0 0 14px; }
.feats-copy .card-head{ margin-bottom: 4px; }
.feats-post{ width: 100%; box-sizing: border-box; font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px; resize: vertical; }
.feats-checks{ list-style: none; margin: 0; padding: 0; font-size: 13px; }
.feats-checks li.ok{ color: var(--ink-2); }
.feats-checks li.no{ color: var(--div-neg); }
