/* KIT — light ground, club colour carries identity, type carries hierarchy.
 *
 * Three rules, applied without exception:
 *   1. Nothing meant to be read sits below 7:1 against its ground.
 *   2. Colour is never the only signal. Every FDR chip carries its numeral;
 *      every confidence band carries its word.
 *   3. The type scale has four real steps, not four shades of the same step.
 */

:root {
  --ground:  #F7F5F0;   /* warm off-white */
  --card:    #FFFDF8;
  --sunk:    #EFEBE2;
  --rule:    #DCD6C9;
  --rule-2:  #C3BBA9;

  --ink:     #16150F;   /* 15.8:1 on --ground */
  --ink-2:   #3B382E;   /* 10.1:1 — secondary prose */
  --ink-3:   #5C574A;   /*  7.1:1 — the floor. Nothing readable goes below. */

  /* FDR ramp. Used in chips that always carry the numeral too, never as a
     background wash, and never as the only signal. */
  --fdr1: #1C6B3A;
  --fdr2: #4A7A24;
  --fdr3: #7A6410;
  --fdr4: #A6501A;
  --fdr5: #A31D22;

  --good: #1C6B3A;
  --bad:  #A31D22;

  /* four distinct steps, not four shades of one */
  --t-hero:  clamp(42px, 7.5vw, 88px);
  --t-big:   clamp(28px, 3.4vw, 42px);
  --t-num:   30px;
  --t-body:  15px;
  --t-label: 10.5px;

  --pad: clamp(16px, 3vw, 44px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Archivo, system-ui, -apple-system, sans-serif;
  font-size: var(--t-body);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.display {
  font-family: 'Bricolage Grotesque', Archivo, system-ui, sans-serif;
  font-variation-settings: 'wdth' 100, 'opsz' 48;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.92;
}

.label {
  font-size: var(--t-label);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--ink-3);
}

a { color: var(--ink); }

/* --- chrome ------------------------------------------------------------- */

header.top {
  display: flex; align-items: center; gap: clamp(14px, 3vw, 40px); flex-wrap: wrap;
  padding: 14px var(--pad);
  border-bottom: 2px solid var(--ink);
  position: sticky; top: 0; z-index: 30;
  background: var(--ground);
}
.wordmark { font-size: 26px; text-decoration: none; }
.wordmark em { font-style: normal; color: var(--ink-3); font-size: 15px; letter-spacing: -0.01em; }
nav { display: flex; gap: 4px; margin-right: auto; flex-wrap: wrap; }
nav a {
  text-decoration: none; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; font-weight: 700;
  padding: 6px 10px; border: 1.5px solid transparent;
}
nav a:hover { border-color: var(--rule-2); }
nav a[aria-current] { background: var(--ink); color: var(--ground); }

.deadline { text-align: right; line-height: 1.15; }
.deadline b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.deadline b.passed { color: var(--ink-3); }

main { padding: var(--pad); max-width: 1560px; margin: 0 auto; }

h1 { font-size: var(--t-hero); margin: 0 0 10px; }
h2 { font-size: var(--t-label); text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-3); font-weight: 700; margin: 40px 0 14px; }
h3 { font-size: 19px; margin: 26px 0 8px; letter-spacing: -0.01em; }
.sub { color: var(--ink-2); margin: 0 0 28px; max-width: 66ch; font-size: 16px; }

.layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: clamp(20px, 3vw, 48px); align-items: start; }
@media (max-width: 1040px) { .layout { grid-template-columns: 1fr; } }

.banner {
  border: 2px solid var(--ink); border-left-width: 10px;
  background: var(--card); padding: 14px 18px; margin: 0 0 26px; color: var(--ink-2);
}
.banner b { color: var(--ink); }

/* --- the kit card ------------------------------------------------------- */

.kit {
  background: var(--card);
  border: 1.5px solid var(--ink);
  padding: 0; width: 132px; text-align: left;
  font: inherit; color: inherit; cursor: pointer;
  display: flex; flex-direction: column;
  box-shadow: 3px 3px 0 var(--rule);
  transition: transform .1s, box-shadow .1s;
}
.kit:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--rule-2); }
.kit[aria-pressed="true"] { box-shadow: 5px 5px 0 var(--ink); }

/* the band: club identity, and the only place club colour appears */
.kit .band {
  padding: 5px 8px 4px; display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
}
.kit .band .shirt { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; opacity: .82; }
.kit .body { padding: 7px 9px 9px; }
.kit .cname { font-weight: 700; font-size: 13.5px; line-height: 1.2; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kit .cmeta { font-size: 10.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; }
.kit .cxp {
  font-family: Archivo, sans-serif;
  font-size: var(--t-num); font-weight: 800; line-height: 1; letter-spacing: -0.035em;
  margin: 5px 0 1px; display: block;
}
.kit .cxp small { font-size: 10px; font-weight: 700; color: var(--ink-3); letter-spacing: .08em; margin-left: 3px; }
.kit .crow { display: flex; gap: 4px; align-items: center; margin-top: 5px; flex-wrap: wrap; }
.kit.benched { opacity: .82; width: 116px; }
.kit.benched .cxp { font-size: 21px; }

.armband {
  display: inline-block; background: var(--ink); color: var(--ground);
  width: 17px; height: 17px; line-height: 17px; text-align: center;
  font-size: 10px; font-weight: 800; border-radius: 50%;
}

/* --- pitch -------------------------------------------------------------- */

.pitch {
  background: var(--sunk); border: 2px solid var(--ink);
  padding: clamp(16px,2.4vw,30px) clamp(10px,2vw,22px);
  display: flex; flex-direction: column; gap: clamp(16px,2.4vw,26px);
}
.row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.bench-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.benchslot { display: flex; flex-direction: column; gap: 5px; }

/* --- signals: colour is never alone ------------------------------------- */

.fx {
  display: inline-flex; align-items: center; gap: 3px;
  border: 1.5px solid currentColor; padding: 1px 4px;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  background: var(--card);
}
.fx .n { font-size: 10px; font-weight: 800; }
.fx.fdr1 { color: var(--fdr1); } .fx.fdr2 { color: var(--fdr2); }
.fx.fdr3 { color: var(--fdr3); } .fx.fdr4 { color: var(--fdr4); }
.fx.fdr5 { color: var(--fdr5); }
.fx.blank { color: var(--ink-3); border-style: dashed; }

.conf {
  display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; padding: 1px 4px; border: 1.5px solid currentColor;
}
.conf.high    { color: var(--ink-3); border-style: dotted; }
.conf.partial { color: var(--fdr4); }
.conf.none    { color: var(--bad); background: #F7E3E3; }

.risk { font-size: 10px; font-weight: 800; color: var(--bad); letter-spacing: .04em; }

/* --- summary strip ------------------------------------------------------ */

.strip { display: flex; flex-wrap: wrap; gap: 0; border: 2px solid var(--ink); margin: 0 0 26px; background: var(--card); }
.strip div { padding: 11px 20px; flex: 1 1 140px; border-right: 1.5px solid var(--rule); }
.strip div:last-child { border-right: 0; }
.strip dt { margin: 0; }
.strip dd { margin: 3px 0 0; font-size: var(--t-big); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.strip dd.sm { font-size: 21px; }

/* --- dial rail ---------------------------------------------------------- */

.rail { border: 2px solid var(--ink); background: var(--card); padding: 18px; position: sticky; top: 84px; }
.rail h2 { margin-top: 0; }
.dial { display: block; margin-bottom: 17px; }
.dial-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; }
.dial-head output { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.dial-head output.moved { background: var(--ink); color: var(--ground); padding: 0 4px; }
.dial-note { display: block; font-size: 11px; color: var(--ink-3); line-height: 1.4; margin-top: 4px; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; margin: 5px 0 0; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: var(--rule-2); }
input[type=range]::-moz-range-track { height: 2px; background: var(--rule-2); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: var(--ink); margin-top: -6px; border-radius: 0; cursor: grab; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; background: var(--ink); border: 0; border-radius: 0; cursor: grab; }

button.ghost {
  background: var(--card); border: 1.5px solid var(--ink); color: var(--ink);
  padding: 8px 12px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: .12em; width: 100%;
}
button.ghost:hover { background: var(--ink); color: var(--ground); }

/* --- detail panel ------------------------------------------------------- */

.detail { border: 2px solid var(--ink); background: var(--card); padding: 18px; margin-top: 20px; }
.detail .dname { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.detail .dmeta { color: var(--ink-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin: 4px 0 12px; }
.detail table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail td { padding: 4px 0; border-bottom: 1px solid var(--rule); }
.detail td:last-child { text-align: right; font-weight: 800; }
.detail tr.total td { border-bottom: 0; border-top: 2px solid var(--ink); padding-top: 7px; font-size: 17px; }
.detail .neg { color: var(--bad); }

/* --- controls / table --------------------------------------------------- */

.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: center; }
.controls input[type=search], .controls select {
  background: var(--card); border: 1.5px solid var(--ink); color: var(--ink);
  padding: 8px 10px; font: inherit; font-size: 13px; font-weight: 600;
}
.controls input[type=search] { min-width: 210px; }
.chipset { display: flex; border: 1.5px solid var(--ink); }
.chipset button {
  background: var(--card); border: 0; border-right: 1.5px solid var(--ink);
  color: var(--ink-2); font: inherit; font-size: 11px; font-weight: 700;
  padding: 8px 13px; cursor: pointer; text-transform: uppercase; letter-spacing: .1em;
}
.chipset button:last-child { border-right: 0; }
.chipset button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.rowcount { color: var(--ink-3); font-size: 12px; font-weight: 600; margin-left: auto; }

.tablewrap { border: 2px solid var(--ink); overflow-x: auto; background: var(--card); }
table.board { width: 100%; border-collapse: collapse; font-size: 13px; }
table.board th {
  position: sticky; top: 0; background: var(--ink); color: var(--ground); text-align: left;
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700;
  padding: 9px 10px; cursor: pointer; white-space: nowrap;
}
table.board th[aria-sort]::after { content: ' ↓'; }
table.board th[aria-sort=ascending]::after { content: ' ↑'; }
table.board td { padding: 7px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.board tbody tr:hover td { background: var(--sunk); }
table.board td.n, table.board th.n { text-align: right; }
table.board td.xp { font-weight: 800; font-size: 15px; letter-spacing: -0.02em; }
table.board .pname { font-weight: 700; }
table.board .swatch { display: inline-block; width: 4px; height: 13px; margin-right: 6px; vertical-align: -2px; }

/* --- DIFF --------------------------------------------------------------- */

.diffgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .diffgrid { grid-template-columns: 1fr; } }
.col { border: 2px solid var(--ink); background: var(--card); padding: 14px; }
.col > h3 { margin: 0 0 4px; font-size: 17px; }
.col .colsub { color: var(--ink-3); font-size: 12px; font-weight: 600; margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.line {
  display: grid; grid-template-columns: 4px 34px 1fr auto; gap: 9px; align-items: center;
  padding: 5px 7px; border: 1.5px solid var(--rule);
}
.line.shared { opacity: .5; }
.line.only { border-color: var(--ink); }
.line .lname { font-weight: 700; font-size: 13.5px; letter-spacing: -0.01em; }
.line .lmeta { font-size: 10.5px; color: var(--ink-3); font-weight: 600; }
.line .lxp { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.line .lpos { font-size: 10px; font-weight: 800; color: var(--ink-3); letter-spacing: .08em; }
.line .swatch { width: 4px; height: 100%; min-height: 26px; }

.verdict { font-weight: 800; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.verdict.go { color: var(--good); }
.verdict.no { color: var(--ink-3); }
.verdict.blocked { color: var(--bad); }

details.assumes { margin-top: 4px; }
details.assumes summary { cursor: pointer; font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
details.assumes .inner { border-left: 3px solid var(--rule-2); padding: 8px 0 4px 12px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }

.callout { border: 2px solid var(--ink); border-left-width: 10px; background: var(--card); padding: 14px 18px; margin: 0 0 22px; }
.callout .label { color: var(--bad); }
.callout p { margin: 6px 0 0; color: var(--ink-2); }

/* --- prose / METHOD ----------------------------------------------------- */

.prose { max-width: 76ch; }
.prose p, .prose li { color: var(--ink-2); }
.prose strong, .prose b { color: var(--ink); font-weight: 700; }
.prose code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--card); border: 1.5px solid var(--rule-2); }
.prose code { padding: 1px 5px; font-size: 13px; color: var(--ink); }
pre { padding: 18px; overflow-x: auto; font-size: 13px; color: var(--ink); line-height: 1.65; }
pre .v { color: var(--fdr1); font-weight: 700; }
.prose hr { border: 0; border-top: 2px solid var(--ink); margin: 36px 0; }

table.plain { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); }
table.plain th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--ground); background: var(--ink); padding: 8px 10px; font-weight: 700; }
table.plain td { padding: 7px 10px; border-bottom: 1px solid var(--rule); }
table.plain td.n, table.plain th.n { text-align: right; }
table.plain tfoot td { border-top: 2px solid var(--ink); font-weight: 800; }
.empty { color: var(--ink-2); padding: 18px; border: 2px dashed var(--rule-2); background: var(--card); }

footer { padding: 40px var(--pad); border-top: 2px solid var(--ink); color: var(--ink-3); font-size: 12px; display: flex; gap: 22px; flex-wrap: wrap; font-weight: 600; }
