:root {
  --bg: #f6f5f3; --card: #ffffff; --ink: #1d1d1f; --muted: #6b6b70; --line: #e4e2de;
  --accent: #b3261e; --accent-ink: #ffffff; --ok: #1e7d3a; --warn: #a15c00; --bad: #b3261e;
  --chip-ok: #e6f4ea; --chip-warn: #fff4e0; --chip-bad: #fde8e7; --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111113; --card: #1c1c1f; --ink: #f2f2f4; --muted: #a0a0a8; --line: #2e2e33;
    --accent: #ff6b5e; --accent-ink: #111113; --chip-ok: #15301d; --chip-warn: #3a2a0d; --chip-bad: #3d1715; }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 96px; }
header.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 12px 16px 8px; border-bottom: 1px solid var(--line); }
header.top .row { max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { font-weight: 700; letter-spacing: .01em; font-size: 17px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
nav.tabs button { flex: 1; min-width: 0; border: 0; background: none; color: var(--muted); font-family: inherit; font-weight: 600; font-size: 12px; line-height: 1.2; padding: 10px 2px 12px; }
nav.tabs button.on { color: var(--accent); }
h1 { font-size: 24px; margin: 8px 0 4px; } h2 { font-size: 19px; margin: 18px 0 8px; } h3 { font-size: 16px; margin: 12px 0 6px; }
p { margin: 6px 0; } .muted { color: var(--muted); } .small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; overflow: hidden; }
.card.next { border-color: var(--accent); border-width: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
input, select, textarea { font-family: inherit; font-size: 16px; line-height: 1.3; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; min-height: 44px; width: 100%; max-width: 100%; }
textarea { min-height: 96px; resize: vertical; }
label.f { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.grid2 > * { min-width: 0; }
input[type=date], input[type=time] { min-width: 0; -webkit-appearance: none; appearance: none; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--line); }
.chip.ok { background: var(--chip-ok); color: var(--ok); } .chip.warn { background: var(--chip-warn); color: var(--warn); } .chip.bad { background: var(--chip-bad); color: var(--bad); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.t { border-collapse: collapse; font-size: 13px; width: 100%; }
table.t th, table.t td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.t th:first-child, table.t td:first-child { text-align: left; }
.cov td { text-align: center; font-size: 12px; }
.cov td.y { color: var(--ok); font-weight: 700; } .cov td.n { color: var(--bad); }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14px; }
.kv span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
pre.mail { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; max-height: 220px; overflow-y: auto; }
.rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 6px 0 2px; }
.rating button { min-height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-family: inherit; font-weight: 700; font-size: 17px; }
.rating button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.toast { position: fixed; left: 16px; right: 16px; bottom: 76px; z-index: 9; background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 12px;
  font-weight: 600; text-align: center; max-width: 560px; margin: 0 auto; }
.hide { display: none !important; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; background: var(--accent); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.seg button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 12px; font-family: inherit; font-weight: 600; font-size: 13px; min-height: 36px; }
.seg button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.shift { display: grid; grid-template-columns: 1fr 104px; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.shift .who { min-width: 0; overflow-wrap: anywhere; }
.shift select { min-height: 40px; padding: 6px 8px; font-size: 14px; }
.shift input { min-height: 40px; padding: 6px 8px; }
details summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.breakdown li { font-size: 13px; padding: 3px 0; }
.err { color: var(--bad); font-weight: 600; }
