/* Instrument pages. Loaded after /style.css and built only from its tokens:
   same ink, paper, serif and mono. Wider measure, because a calculation needs room. */

:root {
  --warn:    #6b3f00;
  --warn-bg: #f7efe1;
  --bad:     #8f1d1d;
  --bad-bg:  #f8e9e7;
  --past:    var(--ink);
  --future:  #8a8a91;
}

@media (prefers-color-scheme: dark) {
  :root {
    --warn:    #ecc27c;
    --warn-bg: #2a2110;
    --bad:     #f3aaa3;
    --bad-bg:  #2e1716;
    --future:  #7d7b76;
  }
}

.page.wide { max-width: 66rem; }
.panel.solo { margin: 2.5rem 0 3.5rem; }
form.panel.solo { margin-bottom: 0; }
#out.panel.solo { margin-top: 3rem; }
header + main { margin-top: 3.25rem; }
.row.spread { justify-content: space-between; }

.num, .v, td { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.eyebrow,
.panel h3.k {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.crumb { margin: 0 0 0.5rem; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.crumb a { color: var(--ink-muted); }

.facts { margin: 1rem 0 0; font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-muted); }
.facts .bad { color: var(--bad); font-weight: 600; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: start; margin: 2.5rem 0 3.5rem; }
@media (min-width: 56em) { .grid { grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr); gap: 2.75rem; } }

.panel { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; padding-top: 1rem; border-top: 2px solid var(--ink); }
.panel > h2, .ladder h2, .block h2 { margin: 0; }

.f { display: flex; flex-direction: column; gap: 0.3rem; }
label { font-size: 0.9375rem; font-weight: 600; }
.hint { margin: 0; font-size: 0.875rem; line-height: 1.5; color: var(--ink-muted); }
.hint.warn { color: var(--warn); }

.inp { display: flex; align-items: center; border: 1px solid var(--rule); border-bottom: 2px solid var(--ink); background: var(--paper); }
.inp:focus-within { border-color: var(--ink); }
.inp span { padding: 0 0.6rem; font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-muted); white-space: nowrap; }
.inp input, select { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 500 1rem var(--mono); padding: 0.55rem 0.6rem; font-variant-numeric: tabular-nums; }
.inp input:focus, select:focus { outline: 0; }
.inp input:disabled { color: var(--ink-faint); }
input[type="date"] { font-family: var(--mono); }

.example { margin: 0; padding: 0.55rem 0.75rem; border-left: 3px solid var(--warn); background: var(--warn-bg); color: var(--warn); font-size: 0.875rem; }

.headline { display: flex; flex-direction: column; gap: 1rem; }
.total { min-width: 0; }
.total .v { margin-top: 0.35rem; font-size: clamp(1.5rem, 1rem + 2.2vw, 2.6rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; white-space: nowrap; }
.total .sub { margin: 0.5rem 0 0; font-size: 0.875rem; color: var(--ink-muted); }

/* the stamp that is not there: the empty space of a certification, drawn in ink */
.stamp { align-self: flex-start; max-width: 15rem; padding: 0.55rem 0.8rem 0.5rem; border: 2px dashed var(--ink); transform: rotate(-2deg); display: flex; flex-direction: column; gap: 0.1rem; }
.stamp b { font: 600 0.8125rem var(--mono); letter-spacing: 0.2em; }
.stamp small { font: 0.6875rem/1.35 var(--mono); color: var(--ink-muted); }

.bar { display: flex; height: 0.9rem; background: var(--rule); overflow: hidden; }
.bar i { display: block; height: 100%; }
.bar .past { background: var(--past); }
.bar .future { background: var(--future); }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; }
.split div { display: flex; flex-direction: column; gap: 0.1rem; }
.split .k { font-size: 0.875rem; color: var(--ink-muted); display: flex; align-items: center; gap: 0.5rem; }
.split .k::before { content: ""; width: 0.7rem; height: 0.7rem; background: var(--past); }
.split .fu .k::before { background: var(--future); }
.split .v { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.02em; }
.split small { font-size: 0.8125rem; color: var(--ink-muted); }

.note { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.75rem 0.95rem; border-left: 3px solid var(--warn); background: var(--warn-bg); font-size: 0.9375rem; }
.note b { color: var(--warn); }
.refusal { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem 1.1rem; border: 1px solid var(--bad); border-left-width: 3px; background: var(--bad-bg); }
.refusal .eyebrow { color: var(--bad); }

.sec { display: flex; flex-direction: column; gap: 0.7rem; padding-top: 1rem; border-top: 1px solid var(--rule); }

.drv { display: grid; grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr) auto; gap: 0.35rem 0.75rem; align-items: center; font-size: 0.9375rem; }
.drv .track { height: 0.6rem; background: var(--rule); overflow: hidden; }
.drv .track i { display: block; height: 100%; background: var(--ink); }
.drv .rg { grid-column: 1 / -1; margin: -0.15rem 0 0.35rem; font-size: 0.8125rem; color: var(--ink-muted); }

svg.chart { width: 100%; height: auto; display: block; }
svg.chart text { font-family: var(--mono); font-size: 10.5px; fill: var(--ink-muted); }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.8125rem; }
th, td { padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
th { font: 500 0.6875rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); border-bottom: 2px solid var(--ink); }
td:nth-child(2), th:nth-child(2), td:nth-child(3), th:nth-child(3) { text-align: left; }
tfoot td { font-weight: 600; border-bottom: 0; border-top: 2px solid var(--ink); }
details summary { cursor: pointer; font-weight: 600; }

.btn { align-self: flex-start; font: 600 0.9375rem var(--serif); color: var(--paper); background: var(--ink); border: 1px solid var(--ink); padding: 0.5rem 1rem; cursor: pointer; }
.btn.ghost { color: var(--ink); background: transparent; }
.btn:hover { opacity: 0.85; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem 0.8rem; align-items: center; }
textarea { width: 100%; min-height: 9rem; font: 0.8125rem/1.5 var(--mono); color: var(--ink); background: var(--paper); border: 1px solid var(--rule); padding: 0.6rem; }

.ladder { display: flex; flex-direction: column; gap: 0.8rem; margin: 0 0 3.5rem; }
.steps { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 2px solid var(--ink); }
@media (min-width: 46em) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps section { margin: 0; padding: 1rem 1rem 1.1rem 0; display: flex; flex-direction: column; gap: 0.45rem; border-bottom: 1px solid var(--rule); }
@media (min-width: 46em) { .steps section { border-bottom: 0; padding-right: 1.25rem; } .steps section + section { padding-left: 1.25rem; border-left: 1px solid var(--rule); } }
.steps h3 { margin: 0; font-size: 1.125rem; }
.steps .here .eyebrow { color: var(--ink); }
.steps ul { list-style: none; margin: 0; padding: 0; font-size: 0.9375rem; display: flex; flex-direction: column; gap: 0.2rem; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 46em) { .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cols section { margin: 0; font-size: 0.9375rem; }
.cols ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }

/* LEQ: the portfolio list */
.cases { display: flex; flex-direction: column; gap: 0.6rem; }
.case { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; align-items: end; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.case .cid, .case .cfam, .case .cend, .case .desc { grid-column: 1 / -1; }
@media (min-width: 62em) {
  .case { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.1fr) repeat(3, minmax(0, 1.15fr)) auto; padding: 0.25rem 0; border-bottom: 0; }
  .case .cid, .case .cfam, .case .cend { grid-column: auto; }
  .case:not(:first-child) .f:not(.desc) > label { display: none; }
}
.case.err { outline: 2px solid var(--bad); outline-offset: 3px; }
.case label { font: 500 0.6875rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.case .inp input, .case select { font-size: 0.875rem; padding: 0.4rem 0.45rem; }
.case .inp span { padding: 0 0 0 0.4rem; font-size: 0.75rem; }
.case .cid input, .case .desc input { font-family: var(--serif); }
.case select { width: 100%; border: 1px solid var(--rule); border-bottom: 2px solid var(--ink); background: var(--paper); font-family: var(--serif); }
.case .cend { display: flex; gap: 0.6rem; align-items: center; justify-content: space-between; padding-bottom: 0.3rem; }
.case .chk { display: flex; gap: 0.35rem; align-items: center; font: 0.8125rem var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink-muted); white-space: nowrap; }
.case .x { border: 0; background: transparent; color: var(--ink-muted); font-size: 1.15rem; line-height: 1; cursor: pointer; padding: 0.1rem 0.4rem; }
.case .x:hover { color: var(--bad); }
.seg { display: inline-flex; border: 1px solid var(--ink); }
.seg button { font: 500 0.8125rem var(--mono); border: 0; border-right: 1px solid var(--rule); background: transparent; color: var(--ink-muted); padding: 0.35rem 0.85rem; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.plus { width: 2.1rem; height: 2.1rem; border: 1px solid var(--ink); border-radius: 50%; background: transparent; color: var(--ink); font-size: 1.2rem; line-height: 1; cursor: pointer; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.9rem; }
.kpis div { display: flex; flex-direction: column; gap: 0.05rem; }
.kpis .v { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
.kpis .k { font-size: 0.8125rem; color: var(--ink-muted); }

.rank { display: grid; grid-template-columns: minmax(6rem, 1.2fr) minmax(0, 2fr) auto auto; gap: 0.3rem 0.75rem; align-items: center; font-size: 0.9375rem; }
@media (max-width: 36em) { .rank { grid-template-columns: minmax(0, 1fr) auto auto; } .rank .trk { grid-column: 1 / -1; order: 2; } }
.rank .nm { min-width: 0; overflow-wrap: anywhere; }
.rank .trk { position: relative; height: 0.75rem; }
.rank .trk i { position: absolute; top: 0.3rem; height: 2px; background: var(--ink-faint); }
.rank .trk b { position: absolute; top: 0; left: 0; height: 0.75rem; background: var(--future); }
.rank .trk.top b { background: var(--ink); }
.rank .pc { font-size: 0.8125rem; color: var(--ink-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { font-size: 0.8125rem; border: 1px solid var(--rule); padding: 0.1rem 0.55rem; color: var(--ink-muted); }
.lst { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9375rem; }

@media (prefers-reduced-motion: no-preference) { .bar i, .drv .track i { transition: width 0.25s ease; } }
@media (max-width: 61.99em) { .case .inp span { display: none; } }
a.btn { display: inline-block; text-decoration: none; }
.from { margin: 0; padding: 0.55rem 0.75rem; border-left: 3px solid var(--ink); background: var(--rule); font-size: 0.875rem; }
.case p.desc { margin: -0.15rem 0 0.2rem; }

/* IS-01 */
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.reading { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.85rem 0 0; border-top: 2px solid var(--future); min-width: 0; }
.reading.b { border-top-color: var(--ink); }
.reading h3 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.reading .ln { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; font-size: 0.9375rem; }
.reading .ln b { font: 600 0.95rem var(--mono); font-variant-numeric: tabular-nums; }
.reading .ln.tot { border-top: 1px solid var(--rule); padding-top: 0.35rem; }
.reading .ln.tot b { font-size: 1.25rem; letter-spacing: -0.02em; }
.total .v .per { font-size: 0.5em; font-weight: 500; color: var(--ink-muted); }
svg.chart text.strong { fill: var(--ink); }
td.r { text-align: right; }
label.chk { display: flex; gap: 0.45rem; align-items: flex-start; font-size: 0.875rem; font-weight: 400; }
