:root {
  --bg: #f6f7f5; --card: #ffffff; --ink: #14201b; --muted: #5b6b63; --line: #d9e0dc;
  --brand: #0b6e4f; --brand-ink: #ffffff; --brand-soft: #e3f2ec;
  --good: #137a3c; --good-soft: #e2f4e8; --bad: #b42318; --bad-soft: #fdecea; --warn: #9a6200; --warn-soft: #fff4dc;
  --radius: 16px; --tap: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1513; --card: #18211d; --ink: #eef3f0; --muted: #9fb0a7; --line: #2a3530;
    --brand: #2bb383; --brand-ink: #06120d; --brand-soft: #173a2d;
    --good: #48c27a; --good-soft: #143322; --bad: #ff7a6b; --bad-soft: #3a1714; --warn: #f0b44c; --warn-soft: #3a2c10;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 18px/1.4 system-ui, -apple-system, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Bengali", sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 15px; }

.bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px max(16px, calc((100% - 528px) / 2)); background: var(--brand); color: var(--brand-ink); }
.bar .muted { color: inherit; opacity: .85; display: block; }
.bar-who { font-weight: 700; font-size: 18px; min-width: 0; }
.bar-status { display: flex; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #9ee6c4; border: 2px solid #fff; }
.dot.off { background: #ffb4a8; }
.chip { border: 0; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; font-weight: 700; background: #fff; color: var(--brand); }

.view { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }
h1 { font-size: 26px; margin: 8px 0 16px; }
h2 { font-size: 20px; margin: 20px 0 10px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; min-height: 120px;
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink);
  font: inherit; font-size: 19px; font-weight: 700; text-align: center; padding: 12px; cursor: pointer; }
.tile:active { transform: scale(.98); }
.tile .ico { font-size: 34px; line-height: 1; }
.tile.wide { grid-column: span 2; min-height: 72px; flex-direction: row; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card h3 { margin: 0 0 4px; font-size: 20px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; }
.row b { font-variant-numeric: tabular-nums; }
.big { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }

label { display: block; font-weight: 700; margin: 14px 0 6px; }
input, select { width: 100%; min-height: var(--tap); font: inherit; font-size: 24px; padding: 10px 14px; border: 2px solid var(--line);
  border-radius: 12px; background: var(--card); color: var(--ink); }
input:focus, select:focus, button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
input[type=checkbox] { width: 32px; height: 32px; min-height: 0; flex: none; accent-color: var(--brand); }
.check { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hint { font-size: 15px; color: var(--muted); margin-top: 4px; }

.btn { display: block; width: 100%; min-height: var(--tap); margin-top: 18px; border: 0; border-radius: 14px; font: inherit;
  font-size: 22px; font-weight: 800; background: var(--brand); color: var(--brand-ink); cursor: pointer; }
.btn.ghost { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn:disabled { opacity: .5; }
.back { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 700; padding: 8px 0; cursor: pointer; }

.choices { display: grid; gap: 10px; }
.choice { min-height: var(--tap); border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
  font: inherit; font-size: 20px; font-weight: 700; text-align: left; padding: 10px 14px; cursor: pointer; }
.choice.on { border-color: var(--brand); background: var(--brand-soft); }
.choice small { display: block; font-weight: 400; font-size: 15px; color: var(--muted); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.notes .row { align-items: center; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 52px; height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font-size: 26px; font-weight: 800; }
.stepper span { min-width: 40px; text-align: center; font-size: 22px; font-weight: 800; }

.result { border-radius: var(--radius); padding: 18px; margin-top: 16px; text-align: center; }
.result.good { background: var(--good-soft); color: var(--good); }
.result.bad { background: var(--bad-soft); color: var(--bad); }
.result.warn { background: var(--warn-soft); color: var(--warn); }

.toast { position: fixed; left: 16px; right: 16px; bottom: 20px; max-width: 528px; margin: 0 auto; padding: 14px 16px; border-radius: 14px;
  background: var(--ink); color: var(--bg); font-weight: 700; z-index: 5; }
.toast.bad { background: var(--bad); color: #fff; }
.top-right { display: flex; justify-content: flex-end; }
