:root {
  color-scheme: light dark;
  --ink: light-dark(#152d35,#e8f4f4);
  --muted: light-dark(#526b73,#aac3c8);
  --surface: light-dark(#fff,#142a32);
  --page: light-dark(#e8f1ee,#0d2026);
  --accent: light-dark(#116858,#82e4ce);
  --on-accent: light-dark(#fff,#102e2c);
  --line: light-dark(#d8e7e3,#34525a);
  --error: light-dark(#9c2634,#ffadb6);
  font: 16px/1.45 system-ui,sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); }
.shell { max-width: 630px; margin: auto; min-height: 100dvh; padding-bottom: max(10px,env(safe-area-inset-bottom)); }
header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; font-size: 23px; background: var(--accent); color: var(--on-accent); }
small { display: block; color: var(--muted); }
main { display: grid; gap: 12px; padding: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 15px; overflow-wrap: anywhere; }
h1,h2,p { margin: 0; }
h1 { font-size: 24px; letter-spacing: -.45px; }
h2 { font-size: 17px; }
.range { margin-top: 2px; color: var(--muted); }
.metrics { display: grid; gap: 8px; margin-top: 12px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.row strong { font-variant-numeric: tabular-nums; text-align: right; }
.total { padding-top: 8px; border-top: 1px solid var(--line); color: var(--accent); }
.actions,.list,form { display: grid; gap: 8px; }
.actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
.span { grid-column: 1/-1; }
button,input,select,textarea { font: inherit; }
button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--accent); font-weight: 600; cursor: pointer; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .6; cursor: wait; }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
button.danger { color: var(--error); }
form { margin-top: 10px; }
label { display: grid; gap: 4px; }
label.check { display: flex; align-items: center; min-height: 44px; gap: 8px; }
input:not([type=checkbox]),select,textarea { width: 100%; min-width: 0; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
textarea { resize: vertical; }
nav { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; padding: 8px 16px; background: var(--page); border-top: 1px solid var(--line); }
nav [aria-current=page] { background: var(--accent); color: var(--on-accent); }
#notice { position: sticky; top: 0; z-index: 1; padding: 9px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
#notice.error { color: var(--error); }
ul { list-style: none; padding: 0; margin: 8px 0 0; }
li + li { border-top: 1px solid var(--line); }
li > button { display: block; width: 100%; padding: 8px 0; text-align: left; border: 0; background: transparent; }
li > button:hover { text-decoration: underline; }
.chart { display: grid; gap: 9px; margin-top: 10px; }
.bar { height: 5px; background: var(--line); border-radius: 8px; overflow: hidden; margin-top: 4px; }
.bar span { display: block; height: 100%; background: var(--accent); }
