/* 头一位 — nine bars and nine marks.
   The mark is where Benford says the digit sits; conformity is "the bars stop
   at the marks". The only saturated colour is on the digits that don't. */
:root {
  --bg: #0f1116;
  --panel: #171a21;
  --sunk: #12141a;
  --line: #252a34;
  --ink: #e6e9ee;
  --dim: #949cab;
  --faint: #666e7d;
  --obs: #d9a34f;
  --exp: #7d879b;
  --off: #d9694f;
  --ok: #63b98a;
  --na: #7d8595;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
b { font-weight: 600; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--sunk);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--dim); }

.topbar { display: flex; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  border-bottom: 1px solid var(--line); background: #141720; }
.mark { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid;
  place-items: center; font-weight: 700; font-size: 19px; color: #141720;
  font-family: var(--mono);
  background: linear-gradient(140deg, #edc584, var(--obs)); }
.titles { min-width: 0; }
.titles h1 { margin: 0; font-size: 17px; letter-spacing: .06em; }
.titles p { margin: 0; font-size: 11px; color: var(--faint); }

main { padding: 14px 12px 24px; max-width: 820px; margin: 0 auto; }
textarea, button, input { font: inherit; font-family: inherit; }

.panel { background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.panel h2 { margin: 0 0 6px; font-size: 15px; }
.panel.quiet { background: none; }
.panel.intro { background: none; border-style: dashed; }
.sub { color: var(--dim); font-size: 13.5px; margin: 0 0 8px; }
.sub:last-child { margin-bottom: 0; }
.tiny { color: var(--faint); font-size: 12px; line-height: 1.6; margin: 10px 0 0; }
.note { font-size: 12px; color: var(--faint); margin: 8px 0 0; line-height: 1.6; }
.note.bad { color: var(--off); }

/* ---- input ---- */
.egs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
@media (max-width: 400px) { .egs { grid-template-columns: 1fr; } }
.eg { text-align: left; padding: 10px 12px; background: var(--sunk); color: var(--ink);
  border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.eg b { display: block; font-size: 14px; }
.eg span { display: block; font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.eg.on { border-color: var(--obs); }

.lbl { display: block; font-size: 12.5px; color: var(--faint); margin-bottom: 6px;
  line-height: 1.7; }
.drop { border: 1px dashed var(--line); border-radius: 12px; padding: 8px; }
.drop.over { border-color: var(--obs); background: #1b1a15; }
textarea { width: 100%; padding: 10px; background: var(--sunk); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; font-family: var(--mono);
  font-size: 12.5px; line-height: 1.6; resize: vertical; }
textarea:focus-visible { outline: 2px solid var(--obs); outline-offset: 1px; }
.dropnote { font-size: 11.5px; color: var(--faint); text-align: center; padding: 8px 4px 4px; }

/* ---- the precondition gate ---- */
.gate.pass { border-color: #2a4437; }
.gate.fail { border-color: #3a3f4b; }
.checks { display: grid; gap: 6px; margin-top: 10px; }
.chk { display: grid; grid-template-columns: 1.4em 1fr auto; gap: 8px; align-items: baseline;
  font-size: 13px; }
.chk .mk { font-family: var(--mono); }
.chk.y .mk { color: var(--ok); }
.chk.n .mk { color: var(--off); }
.chk.n .l { color: var(--off); }
.chk .l { color: var(--dim); }
.chk .need { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.stop { margin-top: 12px; padding: 12px; background: var(--sunk); border: 1px solid var(--line);
  border-radius: 11px; font-size: 13px; color: var(--dim); line-height: 1.65; }
.stop > b { display: block; color: var(--na); font-size: 15px; margin-bottom: 4px; }

/* ---- the verdict ---- */
.verdict { background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.verdict > b { display: block; font-size: 17px; }
.verdict.ok { border-color: #2a4437; background: #131d18; }
.verdict.ok > b { color: var(--ok); }
.verdict.warn { border-color: #453a1f; background: #1c1a12; }
.verdict.warn > b { color: var(--obs); }
.verdict.off { border-color: #45302b; background: #1d1614; }
.verdict.off > b { color: var(--off); }
.verdict .say { margin: 12px 0 0; font-size: 13.5px; color: var(--dim); }

.mad { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline;
  gap: 4px 8px; margin-top: 12px; }
.mad .v { font-family: var(--mono); font-size: 30px; font-variant-numeric: tabular-nums; }
.mad .k { font-size: 11px; color: var(--faint); }
.scaleline { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 4px; margin-top: 6px; }
.scaleline > span { background: var(--sunk); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 4px; text-align: center; font-size: 11px;
  color: var(--faint); }
.scaleline > span i { display: block; font-style: normal; font-family: var(--mono);
  font-size: 10px; margin-top: 1px; }
/* The band the value has already passed is dimmed, so the reader's eye lands on
   the first one it hasn't. */
.scaleline > span.past { opacity: .35; }
.scaleline > span.hitline { border-color: var(--off); color: var(--off); }

/* ---- the nine bars ---- */
.digits { display: grid; gap: 5px; margin-top: 10px; }
.drow { display: grid; grid-template-columns: 1.4em 1fr 3.4em 3.2em; gap: 8px;
  align-items: center; }
.drow .d { font-family: var(--mono); font-size: 14px; color: var(--dim); text-align: center; }
.drow .t { position: relative; height: 20px; background: var(--sunk); border-radius: 5px;
  box-shadow: inset 0 0 0 1px var(--line); }
.drow .bar { position: absolute; left: 0; top: 3px; bottom: 3px; background: var(--obs);
  opacity: .6; border-radius: 3px; }
/* The expected position, drawn over the bar so it reads as a target rather than
   as another quantity. */
.drow .mk { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px;
  background: var(--exp); }
.drow .o, .drow .g { font-family: var(--mono); font-size: 11.5px; text-align: right;
  color: var(--dim); font-variant-numeric: tabular-nums; }
.drow .g { color: var(--faint); }
.drow.far .bar { opacity: 1; background: var(--off); }
.drow.far .d, .drow.far .o { color: var(--ink); }
.drow.far .g { color: var(--off); }
.digits.second .drow .d { color: var(--faint); }

.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 10px;
  font-size: 11.5px; color: var(--dim); }
.legend .sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px;
  margin-right: 5px; vertical-align: -1px; }
.sw.bar { background: var(--obs); opacity: .6; }
.sw.mk { width: 2px; height: 13px; background: var(--exp); margin-right: 10px; }

.worst { display: grid; grid-template-columns: 1.8em 1fr; gap: 10px; align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--line); }
.worst:first-of-type { border-top: none; }
.worst > b { font-family: var(--mono); font-size: 20px; text-align: center; }
.worst span { font-size: 12.5px; color: var(--dim); }
.worst em { font-style: normal; font-family: var(--mono); }
.worst em.up { color: var(--obs); }
.worst em.down { color: var(--off); }

.foot { text-align: center; padding: 6px 12px max(18px, env(safe-area-inset-bottom));
  color: var(--faint); font-size: 11px; }
