:root {
  color-scheme: light dark;
  --background: light-dark(#f5f6f4, #141b20);
  --surface: light-dark(#fff, #202a30);
  --text: light-dark(#19313b, #e4eeef);
  --muted: light-dark(#51656d, #b6c8cf);
  --line: light-dark(#dce4e4, #3a4b53);
  --accent: light-dark(#136c67, #95e2d4);
  --on-accent: light-dark(#fff, #133b35);
  --soft: light-dark(#eaf4f1, #263f3d);
  --error: light-dark(#a32828, #ffb6b6);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--text); font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif; }
main { max-width: 1100px; margin: auto; padding: 28px; }
header, .brand, .entry, .actions, .total, .heading { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
header, .entry, .total, .heading { justify-content: space-between; }
h1 { font-size: 28px; line-height: 1.35; margin: 8px 0; font-weight: 600; }
h2 { font-size: 20px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 16px; margin: 18px 0 8px; }
p { margin: 12px 0; }
.logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.badge { font-size: 12px; color: var(--muted); background: var(--background); padding: 4px 8px; border-radius: 6px; }
.notice { background: var(--soft); padding: 12px 14px; border-radius: 8px; font-size: 14px; }
.muted, small, footer { font-size: 13px; color: var(--muted); }
small { display: block; margin-top: 5px; }
nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0; }
button, input, select { font: inherit; }
button { min-height: 44px; background: var(--surface); color: var(--text); border: 1px solid var(--line); padding: 9px 14px; border-radius: 8px; cursor: pointer; }
button.primary, button.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
button:disabled { opacity: .55; cursor: not-allowed; }
input, select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; color: var(--text); background: var(--surface); }
label { display: block; margin: 14px 0; }
label input, label select { margin-top: 6px; }
input[type="file"] { padding: 8px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.entry { margin-bottom: 18px; }
.actions { margin-top: 16px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; }
details { border-top: 1px solid var(--line); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; }
.learning { margin-top: 32px; }
.error { white-space: pre-wrap; color: var(--error); border-left: 3px solid var(--error); padding-left: 12px; overflow-wrap: anywhere; }
.numbers { margin: 22px 0; font-variant-numeric: tabular-nums; }
.numbers strong { display: block; font-size: 30px; line-height: 1.5; overflow-wrap: anywhere; }
.numbers span { display: block; color: var(--muted); font-size: 13px; }
.total { border-top: 1px solid var(--line); padding: 12px 0; }
.total strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result { overflow-wrap: anywhere; }
.result.stale { opacity: .65; }
.result .stale-message { color: var(--error); font-weight: 600; }
.result-card { margin-top: 20px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; }
.check input { width: 18px; min-height: 18px; height: 18px; margin-top: 4px; flex-shrink: 0; accent-color: var(--accent); }
.table-wrap { overflow-x: auto; margin: 14px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); min-width: 100px; overflow-wrap: anywhere; vertical-align: top; }
th { font-weight: 600; }
.plot { width: 100%; height: 95px; color: var(--text); }
.plot text { fill: currentColor; font-size: 12px; }
.plot .axis { stroke: var(--line); stroke-width: 1; }
.plot .zero { stroke: var(--muted); stroke-width: 1; }
.plot .interval { stroke: var(--accent); stroke-width: 6; stroke-linecap: round; }
.plot .point { fill: var(--accent); }
ul, ol { padding-left: 22px; }
footer { margin-top: 26px; }
@media (max-width: 760px) {
  main { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .two { grid-template-columns: 1fr; gap: 0; }
  .numbers { grid-template-columns: 1fr 1fr; gap: 12px; }
  .numbers strong { font-size: 24px; }
  .panel { padding: 16px; }
  h1 { font-size: 24px; }
  input, select { font-size: 16px; }
}
