/* 百年一遇 — one stylesheet, no framework.

   Water: a deep blue-green ground, one clear blue for the curve you are on,
   and one warm rust for the curve a rising hazard puts above it. The gap
   between those two colours is the entire climate-adjustment argument, so
   nothing else on the page is allowed to be saturated.

   Bar widths come from generated classes at the bottom of this file rather
   than from style attributes, because the Content-Security-Policy in the page
   drops an inline style silently — and a chart of zero-width bars reads as a
   design decision rather than a bug. */

:root {
  --bg: #0f1720;
  --panel: #16212c;
  --panel2: #1d2b38;
  --line: #2a3b4a;
  --ink: #e6edf3;
  --dim: #9db1c2;
  --faint: #6b8093;
  --water: #4fb3d9;
  --rising: #e07a5f;
  --warm: #f2cc8f;
  --ok: #5cb98b;
  --radius: 11px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 14px calc(30px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.62 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", "Noto Sans SC", "PingFang SC", sans-serif;
  overflow-wrap: anywhere;
}
main { max-width: 800px; margin: 0 auto; }

.topbar {
  max-width: 800px; margin: 0 auto; padding: 22px 0 14px;
  display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 13px; align-items: start;
}
.brand {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px;
  background: linear-gradient(160deg, var(--water) 0%, #2b7a99 100%);
  color: #08131a; font-size: 22px; font-weight: 700;
}
.titles h1 { margin: 0; font-size: 21px; letter-spacing: -0.01em; line-height: 1.25; }
.titles p { margin: 4px 0 0; color: var(--dim); font-size: 14px; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 14px 0;
}
.panel h2 { margin: 0 0 9px; font-size: 15px; }
.panel h3 { margin: 22px 0 6px; font-size: 14px; }
.sub { margin: 0 0 10px; color: var(--dim); font-size: 14px; }
.sub:last-child { margin-bottom: 0; }
.tiny { margin: 9px 0 0; color: var(--faint); font-size: 12.5px; line-height: 1.55; }
.quiet { background: transparent; }
code {
  font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}
.eq {
  margin: 12px 0; padding: 13px; background: var(--panel2);
  border-left: 3px solid var(--water); border-radius: 0 8px 8px 0;
  font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-x: auto;
}
.eq sup { font-size: 0.75em; }

/* ------------------------------------------------------------------ form */

.egs { display: grid; gap: 8px; margin: 12px 0 16px; }
.eg {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font: inherit;
}
.eg b { display: block; font-size: 14px; }
.eg span { display: block; color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.eg.on { border-color: var(--water); box-shadow: inset 0 0 0 1px var(--water); }
.eg:focus-visible, .quick:focus-visible, textarea:focus-visible, input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--water); outline-offset: 2px;
}

.grid2 { display: grid; gap: 11px; }
@media (min-width: 600px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.field label { display: block; color: var(--dim); font-size: 12.5px; margin-bottom: 4px; }
.field input {
  width: 100%; min-width: 0; background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit;
  font-size: 15px;
}
.withunit { display: flex; align-items: stretch; }
.withunit input { border-radius: 0; min-width: 0; flex: 1 1 auto; }
.withunit i {
  display: grid; place-items: center; padding: 0 10px; font-style: normal; white-space: nowrap;
  background: var(--line); color: var(--dim); font-size: 12.5px;
}
.withunit > :first-child { border-radius: 8px 0 0 8px; }
.withunit > :last-child { border-radius: 0 8px 8px 0; }

.quickrow { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.quick {
  cursor: pointer; background: var(--panel2); color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  font: inherit; font-size: 12.5px;
}
.quick.on { border-color: var(--water); color: var(--ink); }

.more {
  margin: 12px 0 0; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel2); padding: 11px 13px;
}
.more > summary {
  cursor: pointer; color: var(--water); font-weight: 650; font-size: 13.5px; list-style: none;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: "\002B  "; color: var(--faint); }
.more[open] > summary::before { content: "\2212  "; }
.more .field { margin-top: 10px; }
textarea {
  width: 100%; min-width: 0; resize: vertical; margin-top: 10px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px;
  font: 12.5px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* --------------------------------------------------------------- verdict */

.verdict {
  border: 1px solid var(--line); border-left: 4px solid var(--water);
  border-radius: var(--radius); background: var(--panel2); padding: 15px 16px; margin: 18px 0 12px;
}
.verdict > b { display: block; font-size: 26px; line-height: 1.2; }
.verdict .say { margin: 6px 0 0; color: var(--dim); font-size: 13.5px; }
.verdict.ok { border-left-color: var(--ok); }
.verdict.warn { border-left-color: var(--warm); }
.verdict.bad { border-left-color: var(--rising); }
.verdict.na { border-left-color: var(--faint); }

.findings { margin-top: 6px; }
.finding { border-top: 1px solid var(--line); padding: 13px 0; }
.finding:first-child { border-top: 0; }
.finding:last-child { padding-bottom: 0; }
.finding > b { display: block; font-size: 14.5px; }
.finding > p { margin: 5px 0 0; color: var(--dim); font-size: 13.5px; }
.finding.ok > b { color: var(--ok); }
.finding.warn > b { color: var(--warm); }
.finding.bad > b { color: var(--rising); }

/* ----------------------------------------------------------------- curve */

svg.cv { display: block; width: 100%; height: auto; margin: 6px 0 4px; }
.gl { stroke: var(--line); stroke-width: 1; }
.glv { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.gy, .gx, .ax { fill: var(--faint); font-size: 10px; font-family: inherit; }
.line { fill: none; stroke-width: 2.4; stroke-linejoin: round; }
.line.flat { stroke: var(--water); }
.line.rising { stroke: var(--rising); stroke-dasharray: 6 3; }
.you { stroke: var(--faint); stroke-width: 1.2; stroke-dasharray: 3 3; }
.youdot { fill: var(--bg); stroke: var(--warm); stroke-width: 2.5; }
.youlab { fill: var(--warm); font-size: 12px; font-weight: 700; font-family: inherit; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 2px 0 4px; }
.lg { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dim); }
.lg .sw { width: 16px; height: 3px; border-radius: 2px; }
.lg.flat .sw { background: var(--water); }
.lg.rising .sw { background: var(--rising); }

/* ---------------------------------------------------------------- counts */

.counts { display: grid; gap: 6px; margin-top: 4px; }
.countrow { display: grid; grid-template-columns: 34px minmax(0, 1fr) 56px; gap: 10px; align-items: center; }
.ck { color: var(--dim); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.ctrack { height: 16px; background: var(--panel2); border-radius: 4px; overflow: hidden; min-width: 0; }
.cfill { height: 100%; background: var(--rising); border-radius: 4px 0 0 4px; }
.cfill.none { background: var(--ok); }
.cval { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 650; }

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

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.dt { border-collapse: collapse; width: 100%; font-size: 13.5px; white-space: nowrap; }
table.dt th, table.dt td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; }
table.dt thead th { color: var(--faint); font-weight: 600; font-size: 12px; }
table.dt th.ln { text-align: left; font-weight: 650; }
table.dt td { font-variant-numeric: tabular-nums; color: var(--dim); }
table.dt td.tot { color: var(--water); font-weight: 650; }

/* ----------------------------------------------------------------- lists */

.bad { border-color: var(--rising); }
.badlist { margin: 0; padding-left: 18px; color: var(--dim); font-size: 13px; }
.badlist li { margin: 6px 0; }
.badlist b { color: var(--ink); }

.foot {
  max-width: 800px; margin: 22px auto 0; padding-top: 14px;
  border-top: 1px solid var(--line); color: var(--faint); font-size: 12.5px;
}

/* ------------------------------------------------- generated width classes

   Percentages 1–100 as classes, because a Content-Security-Policy with no
   unsafe-inline drops a style attribute without a word, and a bar chart whose
   bars are all zero pixels wide looks deliberate. */
.cfill.w1 { width: 1%; }
.cfill.w2 { width: 2%; }
.cfill.w3 { width: 3%; }
.cfill.w4 { width: 4%; }
.cfill.w5 { width: 5%; }
.cfill.w6 { width: 6%; }
.cfill.w7 { width: 7%; }
.cfill.w8 { width: 8%; }
.cfill.w9 { width: 9%; }
.cfill.w10 { width: 10%; }
.cfill.w11 { width: 11%; }
.cfill.w12 { width: 12%; }
.cfill.w13 { width: 13%; }
.cfill.w14 { width: 14%; }
.cfill.w15 { width: 15%; }
.cfill.w16 { width: 16%; }
.cfill.w17 { width: 17%; }
.cfill.w18 { width: 18%; }
.cfill.w19 { width: 19%; }
.cfill.w20 { width: 20%; }
.cfill.w21 { width: 21%; }
.cfill.w22 { width: 22%; }
.cfill.w23 { width: 23%; }
.cfill.w24 { width: 24%; }
.cfill.w25 { width: 25%; }
.cfill.w26 { width: 26%; }
.cfill.w27 { width: 27%; }
.cfill.w28 { width: 28%; }
.cfill.w29 { width: 29%; }
.cfill.w30 { width: 30%; }
.cfill.w31 { width: 31%; }
.cfill.w32 { width: 32%; }
.cfill.w33 { width: 33%; }
.cfill.w34 { width: 34%; }
.cfill.w35 { width: 35%; }
.cfill.w36 { width: 36%; }
.cfill.w37 { width: 37%; }
.cfill.w38 { width: 38%; }
.cfill.w39 { width: 39%; }
.cfill.w40 { width: 40%; }
.cfill.w41 { width: 41%; }
.cfill.w42 { width: 42%; }
.cfill.w43 { width: 43%; }
.cfill.w44 { width: 44%; }
.cfill.w45 { width: 45%; }
.cfill.w46 { width: 46%; }
.cfill.w47 { width: 47%; }
.cfill.w48 { width: 48%; }
.cfill.w49 { width: 49%; }
.cfill.w50 { width: 50%; }
.cfill.w51 { width: 51%; }
.cfill.w52 { width: 52%; }
.cfill.w53 { width: 53%; }
.cfill.w54 { width: 54%; }
.cfill.w55 { width: 55%; }
.cfill.w56 { width: 56%; }
.cfill.w57 { width: 57%; }
.cfill.w58 { width: 58%; }
.cfill.w59 { width: 59%; }
.cfill.w60 { width: 60%; }
.cfill.w61 { width: 61%; }
.cfill.w62 { width: 62%; }
.cfill.w63 { width: 63%; }
.cfill.w64 { width: 64%; }
.cfill.w65 { width: 65%; }
.cfill.w66 { width: 66%; }
.cfill.w67 { width: 67%; }
.cfill.w68 { width: 68%; }
.cfill.w69 { width: 69%; }
.cfill.w70 { width: 70%; }
.cfill.w71 { width: 71%; }
.cfill.w72 { width: 72%; }
.cfill.w73 { width: 73%; }
.cfill.w74 { width: 74%; }
.cfill.w75 { width: 75%; }
.cfill.w76 { width: 76%; }
.cfill.w77 { width: 77%; }
.cfill.w78 { width: 78%; }
.cfill.w79 { width: 79%; }
.cfill.w80 { width: 80%; }
.cfill.w81 { width: 81%; }
.cfill.w82 { width: 82%; }
.cfill.w83 { width: 83%; }
.cfill.w84 { width: 84%; }
.cfill.w85 { width: 85%; }
.cfill.w86 { width: 86%; }
.cfill.w87 { width: 87%; }
.cfill.w88 { width: 88%; }
.cfill.w89 { width: 89%; }
.cfill.w90 { width: 90%; }
.cfill.w91 { width: 91%; }
.cfill.w92 { width: 92%; }
.cfill.w93 { width: 93%; }
.cfill.w94 { width: 94%; }
.cfill.w95 { width: 95%; }
.cfill.w96 { width: 96%; }
.cfill.w97 { width: 97%; }
.cfill.w98 { width: 98%; }
.cfill.w99 { width: 99%; }
.cfill.w100 { width: 100%; }
