:root {
  --bg: #FBF8F3; --card: #FFFFFF; --ink: #2B2A33; --muted: #5E5C66; --line: #E6E0D4;
  --green: #1F5A4C; --green2: #2F7D6B; --soft: #E4F1EC; --warn: #8A5A0B; --warnbg: #EFE7D6; --bad: #9B2C2C;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--green); }
.muted { color: var(--muted); font-weight: 400; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tab { border: 0; background: none; padding: 8px 14px; border-radius: 8px; font: inherit; color: var(--muted); cursor: pointer; }
.tab.active { background: var(--soft); color: var(--green); font-weight: 700; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.narrow { max-width: 420px; margin: 48px auto; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 14px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #8F8A7E; border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 80px; resize: vertical; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--green2); }
:focus-visible { outline: 3px solid var(--green2); outline-offset: 2px; }
.btn { min-height: 44px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--green); background: var(--green); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.btn.secondary { background: #fff; color: var(--green); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 13px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; background: var(--soft); color: var(--green); }
.pill.warn { background: var(--warnbg); color: var(--warn); }
.pill.off { background: #eee; color: var(--muted); }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dot { width: 12px; height: 12px; border-radius: 3px; background: #E6E0D4; }
.dot.done { background: var(--green2); }
.dot.skip { background: #C9B98A; }
.notice { background: var(--warnbg); color: var(--warn); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.error { color: var(--bad); margin-top: 8px; }
.qr { display: block; margin: 12px auto; width: 200px; height: 200px; background: #fff; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; background: var(--bg); padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); }
.count { color: var(--muted); font-size: 13px; text-align: right; }
.count.over { color: var(--bad); }
.qrow { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.qrow:last-child { border-bottom: 0; }
.qmeta { color: var(--muted); font-size: 13px; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 20px; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(43,42,51,.45); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; max-width: calc(100vw - 32px); }
.scroll { overflow-x: auto; }
@media (max-width: 640px) { .tabs { margin-left: 0; width: 100%; } .wrap { padding-top: 16px; } }
.row > select { width: auto; min-width: 160px; }
.row > .grow select, .row > .grow input { width: 100%; }
.card > .row { margin-bottom: 12px; }
.banner { margin: 0; border-radius: 0; text-align: center; font-weight: 600; }
