/* New House Command Center: navy, slate blue and brick red on cool white. */

:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #e9edf4;
  --ink: #1f2f4d;
  --muted: #5d6779;
  --line: #dde2ea;
  --accent: #3d5a8f;
  --accent-soft: #e3eaf6;
  --accent-ink: #ffffff;
  --brass: #8aaedf;
  --navy: #233e6b;
  --navy-2: #34507f;
  --navy-ink: #ffffff;
  --navy-muted: #a9bddc;
  --heading: #233e6b;
  --danger: #943a30;
  --danger-soft: #f5e2df;
  --ok: #2f6a53;
  --ok-soft: #dcede5;
  --warn: #9a6512;
  --warn-soft: #f6ead2;
  --shadow: 0 1px 2px rgba(20, 35, 60, .05), 0 6px 20px rgba(20, 35, 60, .06);
  --radius: 14px;
  --radius-sm: 9px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'DM Serif Display', Georgia, serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1726; --surface: #172235; --surface-2: #1f2d45; --ink: #e6ecf6; --muted: #9aa8bf;
    --line: #2a3a55; --accent: #8aaedf; --accent-soft: #22324d; --accent-ink: #0f1726; --brass: #8aaedf;
    --navy: #142139; --navy-2: #22324d; --navy-ink: #e6ecf6; --navy-muted: #8ea3c4; --heading: #e6ecf6;
    --danger: #e58a7f; --danger-soft: #3a1f1c; --ok: #7fc4a3; --ok-soft: #17302a; --warn: #e2b467; --warn-soft: #352a15;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1726; --surface: #172235; --surface-2: #1f2d45; --ink: #e6ecf6; --muted: #9aa8bf;
  --line: #2a3a55; --accent: #8aaedf; --accent-soft: #22324d; --accent-ink: #0f1726; --brass: #8aaedf;
  --navy: #142139; --navy-2: #22324d; --navy-ink: #e6ecf6; --navy-muted: #8ea3c4; --heading: #e6ecf6;
  --danger: #e58a7f; --danger-soft: #3a1f1c; --ok: #7fc4a3; --ok-soft: #17302a; --warn: #e2b467; --warn-soft: #352a15;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font);
  min-height: 100vh; padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .2px; margin: 0; color: var(--heading); }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px;
  padding: 10px 24px; background: var(--navy); color: var(--navy-ink);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy-ink); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--navy-ink); color: var(--navy); display: grid; place-items: center; }
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--display); font-weight: 400; font-size: 19px; }
.brand-text small { color: var(--navy-muted); font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tabs a {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px;
  text-decoration: none; color: var(--navy-muted); font-weight: 500; font-size: 14px; white-space: nowrap;
}
.tabs a svg { width: 18px; height: 18px; fill: currentColor; }
.tabs a:hover { background: var(--navy-2); color: var(--navy-ink); }
.tabs a.active { background: var(--navy-2); color: var(--navy-ink); box-shadow: inset 3px 0 0 var(--brass); }

.sync-badge {
  display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--navy-2); font-size: 12.5px; font-weight: 500; color: var(--navy-muted); white-space: nowrap;
}
.sync-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync-badge[data-mode="on"] { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.sync-badge[data-mode="on"] .dot { background: var(--ok); }
.sync-badge[data-mode="wait"] { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.sync-badge[data-mode="wait"] .dot { background: var(--warn); }
.sync-badge[data-mode="error"] { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.sync-badge[data-mode="error"] .dot { background: var(--danger); }

main { max-width: 1180px; margin: 0 auto; padding: 24px 24px 64px; outline: none; }

/* ---------- Building blocks ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h2 { margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.dash-grid { grid-template-columns: repeat(12, 1fr); }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line);
  background: var(--surface); padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 500;
  text-decoration: none; color: var(--ink); white-space: nowrap; min-height: 38px;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.icon-btn {
  border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  display: inline-grid; place-items: center; color: var(--muted); flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }

input[type=text], input[type=number], input[type=date], input[type=url], input[type=tel],
input[type=search], input[type=password], input:not([type]), select, textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 10px; min-height: 38px; width: 100%; outline: none;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
label.field > input, label.field > select, label.field > textarea { color: var(--ink); font-size: 15px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.high { background: var(--danger-soft); color: var(--danger); }
.pill.medium { background: var(--warn-soft); color: var(--warn); }
.pill.low { background: var(--surface-2); color: var(--muted); }
.pill.mine { background: var(--accent-soft); color: var(--accent); }
.pill.suggested { background: var(--ok-soft); color: var(--ok); }
.pill.overdue { background: var(--danger); color: #fff; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

.callout { border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px; background: var(--surface-2); }
.callout.warn { background: var(--warn-soft); color: var(--warn); }
.callout.danger { background: var(--danger-soft); color: var(--danger); }
.callout.ok { background: var(--ok-soft); color: var(--ok); }

.segmented { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented button { white-space: nowrap; }
.segmented button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 14px; }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar > input[type=search] { flex: 1 1 220px; width: auto; }
.toolbar > select { width: auto; flex: 0 1 auto; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 6px; }
.empty strong { display: block; color: var(--ink); font-family: var(--display); font-weight: 400; font-size: 20px; margin-bottom: 4px; }

/* ---------- Dashboard ---------- */
.countdown { display: flex; flex-direction: column; gap: 14px; background: var(--navy); color: var(--navy-ink); border-color: var(--navy); position: relative; overflow: hidden; }
.countdown::after {
  content: ''; position: absolute; inset: auto -40px -60px auto; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(138,174,223,.3), transparent 70%); pointer-events: none;
}
.countdown .big-num { font-family: var(--display); font-size: 64px; line-height: 1; color: var(--navy-ink); }
.countdown .label { color: var(--navy-muted); font-size: 14px; }
.countdown .dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative; z-index: 1; }
.countdown label.field { color: var(--navy-muted); }
.countdown input[type=date] { background: var(--navy-2); border-color: #4a6496; color: var(--navy-ink); color-scheme: dark; }
.countdown h2 { color: var(--navy-ink); margin: 0; }

.progress-wrap { display: flex; gap: 22px; align-items: center; }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-2); }
.ring .bar { stroke: var(--accent); transition: stroke-dashoffset .5s ease; }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .center strong { font-family: var(--display); font-size: 32px; font-weight: 400; display: block; line-height: 1; }
.ring .center span { font-size: 12px; color: var(--muted); }
.bars { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 13.5px; }
.bar-row .meter { grid-column: 1 / -1; }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s ease; }
.meter.over > i { background: var(--danger); }
.meter.lg { height: 12px; }

.donext { list-style: none; margin: 0; padding: 0; }
.donext li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.donext li:first-child { border-top: 0; }
.donext .title { flex: 1; min-width: 0; }
.donext .title small { display: block; color: var(--muted); font-size: 12.5px; }
.donext li.overdue .title { color: var(--danger); }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.stat span { font-size: 12px; color: var(--muted); display: block; }
.stat strong { font-size: 19px; font-weight: 600; }
.stat.over strong { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Checkbox ---------- */
.check { appearance: none; width: 22px; height: 22px; border: 2px solid var(--muted); border-radius: 7px; cursor: pointer; flex: none; display: grid; place-items: center; background: var(--surface); margin: 0; }
.check:checked { background: var(--ok); border-color: var(--ok); }
.check:checked::after { content: ''; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }

/* ---------- Tasks ---------- */
.quick-add { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.quick-add input { flex: 1 1 260px; width: auto; }
.quick-add select { width: auto; }
.group { margin-bottom: 18px; }
.group-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.group-head h2 { font-size: 20px; }
.group-head .meter { flex: 0 0 120px; }
.task-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.task { border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task.dragging { opacity: .4; }
.task.drop-target { box-shadow: inset 0 3px 0 var(--accent); }
.handle { cursor: grab; color: var(--muted); opacity: .55; touch-action: none; }
.handle:hover { opacity: 1; }
.task-title { flex: 1; min-width: 0; font-weight: 500; cursor: pointer; }
.task-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.task-meta select { width: auto; min-height: 30px; padding: 3px 8px; font-size: 13px; }
.task-body { padding: 0 12px 14px 76px; display: none; }
.task.open .task-body { display: block; }
.task.open .chev { transform: rotate(180deg); }
.chev { transition: transform .2s; }
.hint { background: var(--surface-2); border-left: 3px solid var(--brass); padding: 10px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 14px; margin-bottom: 8px; }
.hint b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--brass); margin-bottom: 2px; }
.kv { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13.5px; color: var(--muted); }
.kv b { color: var(--ink); font-weight: 500; }
.warn-note { font-size: 12px; color: var(--warn); margin-top: 4px; }

/* ---------- Shopping ---------- */
.budget-strip { display: grid; grid-template-columns: 220px repeat(4, 1fr); gap: 12px; align-items: stretch; margin-bottom: 16px; }
.budget-strip .stat { background: var(--surface); border: 1px solid var(--line); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
th button { all: unset; cursor: pointer; }
th button:hover { color: var(--ink); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td select { width: auto; min-height: 30px; padding: 3px 8px; font-size: 13px; }
.item-name { font-weight: 500; cursor: pointer; }
.item-name:hover { color: var(--accent); }
.links-cell { display: flex; gap: 4px; flex-wrap: wrap; }
.link-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-chip.chosen { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ordered-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; white-space: nowrap; }

.board { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col h3 { font-family: var(--font); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); display: flex; justify-content: space-between; margin: 2px 4px 10px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 8px; cursor: grab; font-size: 14px; }
.kcard strong { font-weight: 500; display: block; margin-bottom: 4px; }
.kcard .muted { font-size: 12.5px; }
.kcard.dragging { opacity: .4; }

.room-card { margin-bottom: 14px; }
.room-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.room-head h2 { margin: 0; }
.room-head .spacer { flex: 1; }
.room-budget { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.room-budget input { width: 110px; min-height: 32px; padding: 4px 8px; }
.room-items { list-style: none; margin: 0; padding: 0; }
.room-items li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.room-items li .grow { flex: 1; min-width: 0; }

/* Shopping mode: big thumb targets */
.shop-mode .store { margin-bottom: 18px; }
.shop-mode h2 { font-size: 20px; margin: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; }
.shop-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: 17px; min-height: 64px;
}
.shop-row .box { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; }
.shop-row.got { opacity: .6; }
.shop-row.got .box { background: var(--ok); border-color: var(--ok); }
.shop-row.got .box::after { content: ''; width: 8px; height: 15px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -2px); }
.shop-row.got .nm { text-decoration: line-through; }
.shop-row small { display: block; color: var(--muted); font-size: 13px; }

/* ---------- Modal ---------- */
.modal { border: 0; border-radius: 18px; padding: 0; background: var(--surface); color: var(--ink); width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal::backdrop { background: rgba(15, 25, 45, .5); backdrop-filter: blur(2px); }
.modal-inner { padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.modal-actions .right { display: flex; gap: 8px; margin-left: auto; }
.confirm { width: min(420px, calc(100vw - 24px)); }
.confirm form { padding: 20px; }
.confirm p { color: var(--muted); }
.section-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 18px 0 8px; }
.link-row { display: grid; grid-template-columns: auto 1fr 2fr 100px auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.link-row input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); }
.dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* ---------- Home info ---------- */
.secret { display: flex; gap: 6px; }
.secret input { flex: 1; }
.qr-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr { width: 168px; height: 168px; background: #fff; border-radius: 12px; padding: 8px; display: grid; place-items: center; border: 1px solid var(--line); }
.qr svg { width: 100%; height: 100%; }
.rows-table td { padding: 6px 4px; border: 0; }
.rows-table input { min-height: 34px; }
.lock-note { display: flex; gap: 10px; align-items: flex-start; }
.lock-note svg { width: 20px; height: 20px; fill: var(--ok); flex: none; margin-top: 2px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; display: flex; gap: 12px; align-items: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .tabs a { padding: 8px 9px; gap: 5px; }
}
@media (max-width: 960px) {
  .tabs a svg { display: none; }
  .brand-text strong { white-space: nowrap; }
  .brand-text small { display: none; }
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
  .budget-strip { grid-template-columns: 1fr 1fr; }
  .budget-strip > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .topbar { padding: 10px 16px; gap: 12px; }
  .sync-badge { margin-left: auto; }
  .tabs {
    position: fixed; bottom: 0; left: 0; right: 0; justify-content: space-around; margin: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabs a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 4px; border-radius: 10px; color: var(--muted); }
  .tabs a:hover { background: var(--surface-2); color: var(--ink); }
  .tabs a svg { display: block; }
  .tabs a.active { background: var(--accent-soft); color: var(--navy); box-shadow: none; }
  main { padding: 16px 16px 110px; }
  h1 { font-size: 26px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .progress-wrap { flex-direction: column; align-items: stretch; }
  .ring { margin: 0 auto; }
  .task-row { flex-wrap: wrap; }
  .task-title { flex-basis: calc(100% - 110px); }
  .task-meta { width: 100%; justify-content: flex-start; padding-left: 64px; }
  .task-body { padding-left: 16px; }
  .link-row { grid-template-columns: auto 1fr auto auto; }
  .link-row .lr-url { grid-column: 2 / -1; grid-row: 2; }
  .link-row .lr-price { grid-column: 2; }
  .stat-row { grid-template-columns: 1fr 1fr 1fr; }
  .countdown .big-num { font-size: 52px; }
  .toast { bottom: 90px; }
}

/* Files and appointments */
.doc-row { align-items: flex-start !important; }
.doc-row strong { white-space: nowrap; }
.doc-summary { margin: 6px 0 0; font-size: 13.5px; color: var(--ink); }
.doc-files { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 13px; }
.papers { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.papers a { margin-left: 4px; }
details.past { margin-top: 10px; }
.more-files { display: inline; }
.more-files summary { display: inline; cursor: pointer; color: var(--muted); }
.more-files[open] { display: flex; flex-wrap: wrap; gap: 4px 12px; width: 100%; }
.card-head { flex-wrap: wrap; }
.card-head .segmented { max-width: 100%; overflow-x: auto; }
details.past summary { cursor: pointer; }
.donext li.muted .title { color: var(--muted); }

/* Password screen */
#lock { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.lock-card { width: 100%; max-width: 340px; display: grid; gap: 12px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px; }
.lock-card h1 { margin: 0; color: var(--heading); font-family: 'DM Serif Display', serif; font-weight: 400; font-size: 26px; }
.lock-card p { margin: 0; }
.lock-card input { font: inherit; font-size: 18px; text-align: center; letter-spacing: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.lock-mark { width: 44px; height: 44px; margin: 0 auto; border-radius: 12px; background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M14 34 32 18l18 16v14H38V38H26v10H14z' fill='%23ffffff'/%3E%3C/svg%3E") center/70% no-repeat; }
.lock-error { color: var(--danger); font-size: 13px; min-height: 1em; }
