/* 第二年 — one stylesheet, served from the binary.

   A rate card under the counter glass: cold ink-blue ground, and the numbers
   in the two colours a ledger has ever needed — one for the side you are on
   and one for the side you are not. The accent is a brass-teal, because this
   page is about a choice rather than a warning, and nothing on it is an alarm.

   The tones are `clear`, `fine`, `knife`. They say how far the rate would have
   to move before the answer flips. None of them is advice. */

:root {
  --bg: #0d1017;
  --panel: #141922;
  --panel2: #1a212c;
  --line: #28313f;
  --ink: #e7ebf1;
  --dim: #96a1b1;
  --faint: #68738a;

  --brass: #d6a955;
  --teal: #58b0a8;
  --steel: #6ea3d4;
  --moss: #93b877;
  --clay: #d4836b;

  --clear: #93b877;
  --fine: #d6a955;
  --knife: #d4836b;
  --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(--teal) 0%, #2b6f6a 100%);
  color: #06120f; font-size: 22px; font-weight: 700; line-height: 1;
}
.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, .block, .findings {
  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; }
h3 { margin: 0 0 8px; font-size: 14.5px; }
.sub { margin: 0 0 10px; color: var(--dim); font-size: 14px; }
.sub:last-child { margin-bottom: 0; }
.tiny { margin: 10px 0 0; color: var(--faint); font-size: 12.5px; line-height: 1.55; }
.cap { margin: 10px 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;
}

/* The identity the page is built on, given room to be looked at. */
.formula {
  margin: 12px 0; padding: 13px 14px; text-align: center;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 9px;
  color: var(--teal); font-size: 14.5px; line-height: 1.9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-x: auto;
}
.formula sub, .formula sup { font-size: 0.72em; }

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

.egs { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }
.eg {
  cursor: pointer; font: inherit; font-size: 12.5px;
  background: var(--panel2); color: var(--dim);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px;
}
.eg:hover { color: var(--ink); border-color: var(--faint); }
.eg:focus-visible, textarea:focus-visible, input:focus-visible, .go:focus-visible {
  outline: 2px solid var(--teal); outline-offset: 2px;
}
.go {
  display: block; width: 100%; margin-top: 14px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 650;
  background: var(--teal); color: #06120f;
  border: 0; border-radius: 9px; padding: 11px;
}

.fields {
  display: grid; gap: 9px; margin-bottom: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.fl { display: grid; gap: 4px; min-width: 0; }
.fl span { color: var(--dim); font-size: 12.5px; }
.fl input, textarea {
  width: 100%; min-width: 0;
  background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px;
  font: 13.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
textarea { resize: vertical; line-height: 1.7; font-size: 12.5px; padding: 10px; }
.lbl { display: block; margin: 4px 0 7px; color: var(--dim); font-size: 13.5px; line-height: 1.55; }

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

.verdict {
  border: 1px solid var(--line); border-left: 4px solid var(--teal);
  border-radius: var(--radius); background: var(--panel2); padding: 15px 16px; margin: 14px 0;
}
.verdict > b { display: block; font-size: 21px; line-height: 1.28; }
.verdict .say { margin: 8px 0 0; color: var(--dim); font-size: 13.5px; }
.verdict.clear { border-left-color: var(--clear); }
.verdict.fine { border-left-color: var(--fine); }
.verdict.knife { border-left-color: var(--knife); }

.findings { padding: 4px 16px; }
.finding { border-top: 1px solid var(--line); padding: 13px 0; }
.finding:first-child { border-top: 0; }
.finding > b { display: block; font-size: 14.5px; }
.finding > p { margin: 5px 0 0; color: var(--dim); font-size: 13.5px; }
.finding.clear > b { color: var(--clear); }
.finding.fine > b { color: var(--fine); }
.finding.knife > b { color: var(--knife); }

/* ------------------------------------------------------------- the chart */

svg.chart { display: block; width: 100%; max-width: 580px; height: auto; margin: 10px auto 2px; }
.grid { stroke: var(--line); stroke-width: 1; }
.grid.zero { stroke: var(--faint); stroke-width: 1.4; }
.today { stroke: var(--brass); stroke-width: 1.4; stroke-dasharray: 4 3; }
.ax { fill: var(--faint); font-size: 10px; font-family: inherit; }
.note {
  fill: var(--brass); font-size: 10px; font-family: inherit;
  paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round;
}
.line { fill: none; stroke-width: 2.4; stroke-linecap: round; }
.cross { stroke: var(--panel); stroke-width: 1.5; }
.cl {
  font-size: 10px; font-family: inherit; font-weight: 650;
  paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round;
}
.c0, .line.c0 { stroke: var(--steel); }
.c1, .line.c1 { stroke: var(--moss); }
.c2, .line.c2 { stroke: var(--clay); }
.c3, .line.c3 { stroke: var(--brass); }
circle.c0 { fill: var(--steel); }
circle.c1 { fill: var(--moss); }
circle.c2 { fill: var(--clay); }
circle.c3 { fill: var(--brass); }
text.c0 { fill: var(--steel); stroke: var(--panel); }
text.c1 { fill: var(--moss); stroke: var(--panel); }
text.c2 { fill: var(--clay); stroke: var(--panel); }
text.c3 { fill: var(--brass); stroke: var(--panel); }

.legend { display: flex; flex-wrap: wrap; gap: 5px 13px; margin-top: 10px; }
.legend .li { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-size: 12px; }
i.k { width: 13px; height: 4px; border-radius: 2px; display: inline-block; flex: none; }
i.k.c0 { background: var(--steel); }
i.k.c1 { background: var(--moss); }
i.k.c2 { background: var(--clay); }
i.k.c3 { background: var(--brass); }
i.k.zero { background: var(--faint); }

/* ------------------------------------------------------------- the tables */

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 4px; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; }
table.t th, table.t td {
  padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: right;
}
table.t thead th { color: var(--faint); font-weight: 600; font-size: 11.5px; }
/* `white-space: normal` without a floor lets a narrow scroll container squeeze
   this column to one character per line — taller, not wider, so no overflow
   check ever sees it. The floor is the fix and the check below is the guard. */
table.t th.ln { text-align: left; font-weight: 600; white-space: normal; min-width: 96px; }
table.t th.ln i { color: var(--brass); font-style: normal; font-size: 11px; }
table.t td { font-variant-numeric: tabular-nums; color: var(--dim); }
table.t td.amt { color: var(--ink); font-weight: 600; }
table.t td.amt.win { color: var(--steel); }
table.t td.amt.lose { color: var(--moss); }
table.t tr.base { background: rgba(214, 169, 85, 0.07); }
table.t tr.base th.ln { color: var(--brass); }

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

.panel.bad { border-color: var(--knife); }
.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;
}
