/* Household Brain: one calm system. Tokens first, then components, then screens. */
:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #efe9dd;
  --text: #1d2320;
  --muted: #5d6762;
  --line: #e2dccf;
  --brand: #1f5e52;
  --brand-ink: #ffffff;
  --brand-soft: #e3efe9;
  --accent: #d9702a;
  --danger: #b83a27;
  --danger-soft: #f8e4df;
  --warn-soft: #f6ecd2;
  --ok: #2f7a47;
  --ok-soft: #e1f0e5;
  --shadow: 0 1px 2px rgba(20, 30, 25, .07), 0 4px 14px rgba(20, 30, 25, .05);
  --radius: 14px;
  --tap: 44px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* people: one colour each, used the same way everywhere */
  --p-teal: #1f7a6a; --p-coral: #c9502f; --p-blue: #2f6fb5; --p-amber: #9a6412; --p-rose: #b83f68; --p-green: #4a7f2a;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121614; --surface: #1b211e; --surface-2: #232b27; --text: #edf1ee; --muted: #a2ada8; --line: #2d3732;
    --brand: #4fb39c; --brand-ink: #0c1512; --brand-soft: #1f3530;
    --danger: #ef7a67; --danger-soft: #3a211d; --warn-soft: #34301f; --ok: #6cc088; --ok-soft: #1d3326;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121614; --surface: #1b211e; --surface-2: #232b27; --text: #edf1ee; --muted: #a2ada8; --line: #2d3732;
  --brand: #4fb39c; --brand-ink: #0c1512; --brand-soft: #1f3530;
  --danger: #ef7a67; --danger-soft: #3a211d; --warn-soft: #34301f; --ok: #6cc088; --ok-soft: #1d3326;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px;
}
[hidden] { display: none !important; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 4px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px 8px 16px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
}
.topbar.has-back { padding-left: 4px; }
.title { font-weight: 700; font-size: 1.25rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { border: 0; background: transparent; width: var(--tap); height: var(--tap); border-radius: 12px; display: grid; place-items: center; color: var(--text); }
.icon-btn:active { background: var(--surface-2); }

main { padding: 4px 16px 0; max-width: 680px; margin: 0 auto; }

/* ---- type + sections ---- */
h2.section {
  margin: 24px 2px 8px; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
h2.section::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.empty { color: var(--muted); padding: 12px 4px; }
.kicker { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--muted); }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.card + .card { margin-top: 10px; }

/* ---- people ---- */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; display: inline-grid; place-items: center;
  background: var(--c, #6b7570); color: #fff; font-weight: 700; font-size: .85rem; line-height: 1;
}
.avatar.lg { width: 40px; height: 40px; font-size: 1rem; }
.who { display: inline-flex; align-items: center; gap: 6px; }
.who .avatar { width: 20px; height: 20px; font-size: .65rem; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: var(--tap); height: var(--tap); border-radius: 50%; border: 3px solid transparent; background: var(--c); padding: 0; display: grid; place-items: center; color: #fff; }
.swatch[aria-pressed="true"] { border-color: var(--text); }

/* ---- summary chips (Home + wall) ---- */
.stat-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 2px; }
.stat { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: .9rem; color: var(--muted); }
.stat b { font-size: 1.1rem; color: var(--text); }
.stat.bad { background: var(--danger-soft); color: var(--danger); } .stat.bad b { color: var(--danger); }
.stat.warn { background: var(--warn-soft); }
.stat.good { background: var(--ok-soft); color: var(--ok); } .stat.good b { color: var(--ok); }

/* ---- the task row: who, what, one clear action ---- */
.task { display: flex; align-items: center; gap: 4px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin: 8px 0; padding: 6px 8px 6px 12px; }
.task .avatar { margin-right: 4px; }
.task-body { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 8px 4px; min-height: 52px; display: flex; flex-direction: column; justify-content: center; }
.task-title { font-weight: 600; overflow-wrap: anywhere; }
.task-meta { font-size: .82rem; color: var(--muted); margin-top: 1px; }
.task-meta .due-bad { color: var(--danger); font-weight: 700; }
.task.waiting { background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.task-go {
  flex: 0 0 auto; min-height: var(--tap); padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--brand);
  background: transparent; color: var(--brand); font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; max-width: 46vw;
}
.task-go .ic { width: 18px; height: 18px; }
.task-go:active { background: var(--brand-soft); }
.task-go span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* quiet list of schedule lines */
.deadline { display: flex; gap: 12px; align-items: baseline; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.deadline:last-child { border-bottom: 0; }
.deadline .when { min-width: 72px; color: var(--muted); font-size: .9rem; }
.deadline.overdue .when { color: var(--danger); font-weight: 700; }

/* ---- generic buttons ---- */
.btn { border: 0; border-radius: 12px; min-height: var(--tap); padding: 12px 16px; font-weight: 700; background: var(--brand); color: var(--brand-ink); width: 100%; }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.sm { min-height: 40px; padding: 8px 14px; width: auto; }
.btn:active { filter: brightness(.94); }
a.btn { display: block; text-align: center; text-decoration: none; }
.link { border: 0; background: none; color: var(--brand); font-weight: 600; padding: 10px 4px; min-height: var(--tap); flex: 0 0 auto !important; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.stack { display: grid; gap: 8px; }

/* ---- list rows (settings hub, areas, routines) ---- */
.list-btn { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 56px; text-align: left; border: 0; background: var(--surface); color: inherit; padding: 10px 14px; border-radius: var(--radius); margin: 6px 0; box-shadow: var(--shadow); text-decoration: none; }
.list-btn > span:first-child { flex: 1; min-width: 0; }
.list-btn .go { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.list-btn.radar { border-left: 0; }
.hub-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }
.hub-row { display: flex; align-items: center; gap: 12px; }
.hub-row .t { font-weight: 600; }
.group { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 14px; margin: 6px 0; }
.group .list-btn { box-shadow: none; padding-left: 0; padding-right: 0; margin: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.group .list-btn:last-child { border-bottom: 0; }
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin-left: 6px; }
.tag.stale { background: var(--warn-soft); color: var(--text); }

/* ---- disclosure: secondary content stays one tap away ---- */
details.more-box { margin: 18px 0 0; }
details.more-box > summary {
  list-style: none; cursor: pointer; min-height: var(--tap); display: flex; align-items: center; gap: 8px; padding: 0 2px;
  font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700;
}
details.more-box > summary::-webkit-details-marker { display: none; }
details.more-box > summary::after { content: ""; flex: 1; height: 1px; background: var(--line); }
details.more-box > summary .ic { width: 16px; height: 16px; transition: transform .15s; }
details.more-box[open] > summary .ic { transform: rotate(90deg); }
details summary { cursor: pointer; }

/* ---- briefing + nudges: flat, quiet ---- */
.brief { background: var(--brand-soft); box-shadow: none; }
.brief h3 { margin: 4px 0; font-size: 1.05rem; }
.brief p { margin: 0 0 12px; }
.nudge { border: 1.5px solid color-mix(in srgb, var(--brand) 40%, transparent); margin-top: 10px; }
.nudge p { margin: 6px 0 10px; }
.tonight { margin-top: 10px; background: var(--warn-soft); box-shadow: none; }
.digest-line { padding: 5px 0; line-height: 1.4; }

/* ---- bottom navigation: the + lives in the bar, never over content ---- */
.tabbar {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.tabbar a.active { color: var(--brand); }
.fab {
  justify-self: center; width: 56px; height: 56px; border-radius: 50%; border: 0; margin-top: -18px;
  background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(217, 112, 42, .4);
}
.fab .ic { width: 28px; height: 28px; stroke-width: 2.2; }
.fab:active { transform: scale(.94); }
.badge {
  position: absolute; top: 6px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center;
}

/* ---- triage flashcards ---- */
.triage-head { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 2px 12px; }
.flashcard {
  min-height: 30vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  font-size: 1.4rem; font-weight: 600; padding: 28px 22px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow);
  animation: slide-in .18s ease-out; overflow-wrap: anywhere;
}
.flashcard .source { font-size: .8rem; color: var(--muted); font-weight: 500; margin-top: 14px; }
.flashcard.jit { border: 2px solid var(--accent); }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.suggests { text-align: center; margin: 14px 0 10px; color: var(--muted); min-height: 1.4em; }
.suggests b { color: var(--brand); }
.macro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.macro { border: 2px solid transparent; background: var(--surface); border-radius: 14px; min-height: 60px; padding: 14px 10px; font-weight: 700; box-shadow: var(--shadow); }
.macro.suggested { border-color: var(--brand); background: var(--brand-soft); }
.macro.discard { grid-column: 1 / -1; color: var(--danger); min-height: var(--tap); padding: 10px; box-shadow: none; background: transparent; }

/* ---- lists ---- */
.list-picker { display: flex; gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); min-height: 40px; padding: 8px 14px; border-radius: 999px; font-weight: 600; }
.chip.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.chip.off { opacity: .45; text-decoration: line-through; }
.chip:disabled { opacity: .4; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip-wrap .chip { font-weight: 500; font-size: .92rem; text-align: left; }
.chip .count { font-size: .75rem; opacity: .7; margin-left: 2px; }
.list-picker a.chip { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }
.list-picker a.chip.active { color: var(--brand-ink); }
.check { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check input { width: 24px; height: 24px; accent-color: var(--brand); flex: 0 0 auto; }
.check.done span { text-decoration: line-through; color: var(--muted); }
.check.have { opacity: .55; }
.spec { padding: 6px 2px; }

/* ---- calendar ---- */
.day { margin-top: 18px; }
.day h3 { margin: 0 0 6px; font-size: .85rem; color: var(--muted); position: sticky; top: calc(env(safe-area-inset-top, 0px) + 56px); background: var(--bg); padding: 4px 0; z-index: 1; }
.day.today h3 { color: var(--brand); }
.event { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 8px 12px; background: var(--surface); border-radius: 12px; margin: 6px 0; box-shadow: var(--shadow); }
.event .src { font-size: .8rem; color: var(--muted); margin-left: auto; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.event.task { background: transparent; box-shadow: none; border: 1px dashed var(--line); }

/* ---- forms + sheets ---- */
.field { display: grid; gap: 6px; margin: 12px 0; }
.field label { font-size: .875rem; color: var(--muted); font-weight: 600; }
input[type=text], input[type=date], input[type=time], input[type=datetime-local], input[type=password], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px; font-size: 16px; min-height: var(--tap);
}
textarea { min-height: 110px; resize: vertical; }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; border: 0; background: transparent; min-height: 40px; padding: 8px; border-radius: 10px; font-weight: 600; }
.seg button.active { background: var(--surface); box-shadow: var(--shadow); }
.seg.wrap { flex-wrap: wrap; }
.seg.mini { flex: 0 0 auto; }
.seg.mini button { padding: 6px 10px; }

.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 30; }
.sheet {
  position: fixed; z-index: 31; left: 0; right: 0; bottom: 0; max-height: 90dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + var(--safe-b));
  animation: up .18s ease-out; max-width: 640px; margin: 0 auto;
}
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet h2 { margin: 4px 0 10px; font-size: 1.2rem; }
.sheet h2.section { font-size: .8rem; margin: 22px 2px 8px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.choice { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; border: 0; background: var(--surface); padding: 14px 16px; border-radius: var(--radius); box-shadow: var(--shadow); margin: 8px 0; min-height: 64px; }
.choice .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }

.toast {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; max-width: 90vw;
}

/* ---- loading ---- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes net-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.spinner { display: inline-block; width: 1em; height: 1em; margin-right: 8px; vertical-align: -0.15em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.busy { opacity: .85; cursor: progress; }
.btn.busy::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: 8px; vertical-align: -0.15em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.page-loading { display: flex; align-items: center; justify-content: center; padding: 60px 0; color: var(--muted); }
.net-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; overflow: hidden; opacity: 0; transition: opacity .15s; pointer-events: none; }
.net-bar.on { opacity: 1; }
.net-bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--brand); animation: net-slide 1.1s ease-in-out infinite; }

/* ---- the remaining feature screens ---- */
.blindspot { border-left: 4px solid var(--accent); border-radius: 4px var(--radius) var(--radius) 4px; }
.blindspot h4, .rec h4 { margin: 0 0 4px; }
.blindspot p, .rec p { margin: 0 0 6px; }
.member-row { display: grid; grid-template-columns: 52px 1fr 110px; gap: 8px; margin: 8px 0; }
.member-row input[type=date] { grid-column: 2 / -1; }
.g-progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin: 6px 2px 10px; }
.g-progress div { height: 100%; background: var(--brand); transition: width .2s ease; }
.g-card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 22px 18px 16px; animation: slide-in .18s ease-out; }
.g-question { font-size: 1.3rem; font-weight: 650; margin-bottom: 8px; }
.g-card textarea { min-height: 64px; margin-top: 6px; }
.breakdown-btn { margin: 0; }
.breakdown-btn.suggested { background: var(--accent); color: #fff; }
.small-card { min-height: 0; font-size: 1rem; padding: 14px 16px; margin-bottom: 8px; animation: none; }
.bd-row { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border-radius: 14px; padding: 10px 12px; margin: 8px 0; box-shadow: var(--shadow); }
.bd-row > input[type=checkbox] { width: 24px; height: 24px; margin-top: 12px; accent-color: var(--brand); flex: 0 0 24px; }
.bd-fields { flex: 1; min-width: 0; display: grid; gap: 6px; }
.bd-fields input[type=text], .bd-fields textarea { padding: 9px 10px; }
.bd-fields textarea { min-height: 0; resize: none; }
.bd-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bd-meta input[type=date] { width: auto; padding: 6px 8px; font-size: 14px; }
.bd-meta .tag { margin-left: 0; }
.ledger-card { width: 100%; text-align: left; border: 0; color: inherit; font: inherit; cursor: pointer; }
.ledger-row { display: grid; grid-template-columns: 7.5em 1fr auto; gap: 8px; align-items: center; margin: 6px 0; }
.ledger-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-row .bars { display: grid; gap: 3px; }
.ledger-row .bar { display: block; height: 7px; border-radius: 4px; min-width: 3px; }
.bar.think, .dot.think { background: var(--accent); }
.bar.do, .dot.do { background: var(--brand); }
.ledger-key { margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.ledger-grid { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 4px 10px; margin-top: 8px; }
.standard { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.others-line { margin: 12px 4px 0; text-align: center; }
.meal-row { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.meal-row.past { opacity: .5; }
.meal-main { flex: 1; display: grid; grid-template-columns: 3.2em 1fr; gap: 10px; align-items: center; text-align: left; border: 0; background: var(--surface); color: inherit; font: inherit; padding: 12px 14px; border-radius: 14px; box-shadow: var(--shadow); min-height: 56px; }
.meal-main .when { font-weight: 700; color: var(--muted); }
.more { border: 0; background: var(--surface); border-radius: 999px; width: var(--tap); height: var(--tap); flex: 0 0 var(--tap); box-shadow: var(--shadow); font-size: 1.1rem; }
.area-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--surface); border-radius: 12px; padding: 8px 8px 8px 14px; margin: 6px 0; box-shadow: var(--shadow); }
.sticky-foot { position: sticky; bottom: calc(-18px - var(--safe-b)); background: var(--bg); padding: 10px 0 4px; margin-top: 10px; padding-bottom: calc(18px + var(--safe-b)); border-top: 1px solid var(--line); }
code { font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }

@media (max-width: 599px) { #wall-btn { display: none; } }

/* ---- tablets used as a normal app ---- */
@media (min-width: 768px) {
  main { max-width: 760px; padding-top: 8px; }
  .sheet { border-radius: 22px; bottom: 5vh; max-width: 560px; }
}

/* ================================================================== WALL MODE
   A mounted tablet: read from across the room, nothing to hunt for.
   Sizes scale with the screen so it fills a 10" or a 13" the same way. */
body.wall { padding: 0; overflow: hidden; height: 100dvh; }
body.wall .topbar, body.wall .tabbar, body.wall .backdrop { display: none; }
body.wall main { max-width: none; padding: 0; height: 100dvh; }
.wall-root {
  --u: clamp(16px, 1.85vw, 30px);
  font-size: var(--u); height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: calc(var(--u) * .8);
  padding: calc(var(--u) * 1) calc(var(--u) * 1.2) calc(var(--u) * .9); background: var(--bg);
}
.wall-head { display: flex; align-items: center; gap: calc(var(--u) * 1.2); }
.wall-date { font-size: 2.1em; font-weight: 700; line-height: 1.1; }
.wall-clock { font-size: 2.1em; font-weight: 300; color: var(--muted); }
.wall-head .stat-row { margin: 0 0 0 auto; }
.wall-head .stat { font-size: 1em; padding: .35em .8em; }
.wall-head .stat b { font-size: 1.35em; }
.wall-exit { border: 0; background: transparent; color: var(--muted); width: 2.4em; height: 2.4em; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.wall-exit .ic { width: 1.2em; height: 1.2em; }
.wall-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: calc(var(--u) * .9); min-height: 0; }
.wall-col { background: var(--surface); border-radius: 1em; box-shadow: var(--shadow); padding: .9em 1em; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: .5em; }
.wall-col h3 { margin: 0; font-size: .8em; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wall-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)); gap: calc(var(--u) * .9); min-height: 0; align-content: start; }
.wall-person { border-top: .3em solid var(--c); }
.wall-person-head { display: flex; align-items: center; gap: .6em; }
.wall-person-head .avatar { width: 2.1em; height: 2.1em; font-size: 1em; }
.wall-person-head .name { font-weight: 700; font-size: 1.25em; }
.wall-person-head .n { margin-left: auto; color: var(--muted); font-size: .95em; }
.wall-item { display: flex; align-items: center; gap: .6em; padding: .45em 0; border-bottom: 1px solid var(--line); min-height: 3em; }
.wall-item:last-child { border-bottom: 0; }
.wall-item .t { flex: 1; min-width: 0; font-size: 1.05em; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.wall-item .s { display: block; font-size: .78em; font-weight: 400; color: var(--muted); }
.wall-item .s.bad { color: var(--danger); font-weight: 700; }
.wall-tick { flex: 0 0 auto; width: 2.6em; height: 2.6em; border-radius: 50%; border: .13em solid var(--c, var(--brand)); background: transparent; color: var(--c, var(--brand)); display: grid; place-items: center; }
.wall-tick .ic { width: 1.3em; height: 1.3em; }
.wall-tick:active { background: var(--c, var(--brand)); color: #fff; }
.wall-line { display: flex; gap: .8em; align-items: baseline; padding: .4em 0; border-bottom: 1px solid var(--line); font-size: 1.05em; }
.wall-line:last-child { border-bottom: 0; }
.wall-line .w { min-width: 4.6em; color: var(--muted); font-size: .9em; }
.wall-line.bad .w, .wall-line.bad { color: var(--danger); }
.wall-line.bad .w { font-weight: 700; }
.wall-more { color: var(--muted); font-size: .85em; padding-top: .3em; }
.wall-wait { grid-column: 1 / -1; display: flex; gap: .5em 1.2em; flex-wrap: wrap; align-items: baseline; padding: .6em 1em; background: var(--warn-soft); border-radius: 1em; font-size: .95em; }
.wall-done-all { display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 1.3em; height: 100%; }
.wall-empty { color: var(--muted); font-size: .95em; padding: .4em 0; }
@media (max-width: 900px), (orientation: portrait) {
  body.wall { overflow: auto; height: auto; }
  body.wall main { height: auto; }
  .wall-root { height: auto; min-height: 100dvh; grid-template-rows: auto auto; }
  .wall-grid { grid-template-columns: 1fr; }
  .wall-head { flex-wrap: wrap; }
  .wall-head .stat-row { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
