/* Farrington Self-Serve: one stylesheet for every screen.
   Tokens, type and components come from the approved design (farrington-portal-prototype.html).
   Mobile first. Homeowner screens sit in a centered ~640px column; board screens may use ~1040px.
   Light and dark follow prefers-color-scheme. No inline styles anywhere: the CSP forbids them. */

@font-face { font-family: "Overpass"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/overpass-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/overpass-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/overpass-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/overpass-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Overpass Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/overpass-mono-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/public-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/public-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/public-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/public-sans-latin-400-italic.woff2") format("woff2"); }

:root {
  --bg: #F3F5F3;
  --surface: #FFFFFF;
  --sunk: #ECEFEC;
  --ink: #17202A;
  --muted: #59656F;
  --line: #D7DDD9;
  --accent: #1F4E8C;
  --accent-ink: #FFFFFF;
  --accent-soft: #E2EAF5;
  --sign: #14613F;
  --sign-ink: #FFFFFF;
  --ok: #2B7549;
  --ok-soft: #E0F0E6;
  --warn: #93600F;
  --warn-soft: #F6ECD7;
  --bad: #AD382C;
  --bad-soft: #F8E2DE;
  --info: #4A5A76;
  --info-soft: #E5E9F0;
  --demo: #F2E6B8;
  --demo-ink: #4E4213;
  --f-display: "Overpass", "Highway Gothic", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Overpass Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --col: 640px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1318; --surface: #161D25; --sunk: #1C242E; --ink: #E3E8ED; --muted: #99A4AF; --line: #29323C;
    --accent: #7FA7DF; --accent-ink: #0E1318; --accent-soft: #1A283B; --sign: #1B7650; --sign-ink: #FFFFFF;
    --ok: #6BC08C; --ok-soft: #16301F; --warn: #E1AA52; --warn-soft: #33270F; --bad: #EE8D80; --bad-soft: #3A201C;
    --info: #A8B5CB; --info-soft: #212A37; --demo: #3A3316; --demo-ink: #EBDDA2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1318; --surface: #161D25; --sunk: #1C242E; --ink: #E3E8ED; --muted: #99A4AF; --line: #29323C;
  --accent: #7FA7DF; --accent-ink: #0E1318; --accent-soft: #1A283B; --sign: #1B7650; --sign-ink: #FFFFFF;
  --ok: #6BC08C; --ok-soft: #16301F; --warn: #E1AA52; --warn-soft: #33270F; --bad: #EE8D80; --bad-soft: #3A201C;
  --info: #A8B5CB; --info-soft: #212A37; --demo: #3A3316; --demo-ink: #EBDDA2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 8px; }

svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ===== Shell ===== */
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
#app[data-area="board"] { --col: 1040px; }

.demo-bar { background: var(--demo); color: var(--demo-ink); font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em; text-align: center; padding: 5px 12px; }

.appbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.appbar-in { display: flex; align-items: center; gap: 10px; padding: 6px 16px; min-height: 56px; max-width: var(--col); margin-inline: auto; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--f-display); font-weight: 800; font-size: 15px; letter-spacing: 0.01em; color: var(--ink); text-decoration: none; min-height: 44px; }
.mark { width: 26px; height: 20px; border-radius: 3px; background: var(--sign); color: var(--sign-ink); display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 12px; box-shadow: inset 0 0 0 1.5px var(--sign), inset 0 0 0 2.5px var(--sign-ink); }
.role { margin-left: auto; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.role.board { background: var(--accent-soft); color: var(--accent); }
.appbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.appbar-end .role { margin-left: 0; }

.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; min-width: 44px; padding: 4px 10px 4px 0; border: 0; background: transparent; cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; }

.topnav { display: none; }
.topnav a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.topnav a:hover { background: var(--sunk); }
.topnav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.view-wrap { flex: 1; width: 100%; max-width: var(--col); margin-inline: auto; display: flex; flex-direction: column; }
.view { padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 18px; flex: 1; outline: none; }
.view h1 { font-family: var(--f-display); font-weight: 800; font-size: 1.45rem; line-height: 1.15; margin: 0; text-wrap: balance; }
.view .sect { font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0; font-family: var(--f-body); }
.view p { margin: 0; }
.view ul { margin: 0; }
.small { font-size: 13px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.tight { gap: 8px; }
.stack.loose { gap: 22px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mono { font-family: var(--f-mono); font-size: 12.5px; }
.grow { flex: 1; }

.tabbar { position: sticky; bottom: 0; margin-top: auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 5; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 4px 0; text-decoration: none; border-radius: 8px; }
.tabbar a[aria-current="page"] { color: var(--accent); }

/* ===== Components ===== */
.sign { display: inline-flex; align-items: center; font-family: var(--f-display); font-weight: 700; font-size: 12.5px; letter-spacing: 0.05em; text-transform: uppercase; background: var(--sign); color: var(--sign-ink); padding: 4px 9px 3px; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 3px var(--sign-ink); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 15px; cursor: pointer; text-align: center; text-decoration: none; line-height: 1.2; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.quiet { background: transparent; color: var(--accent); padding: 0 6px; min-height: 44px; }
.btn.danger { background: var(--surface); color: var(--bad); border-color: var(--line); }
.btn.wide { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn.busy { position: relative; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card > b { font-weight: 600; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; text-align: left; cursor: pointer; min-width: 0; color: var(--ink); text-decoration: none; }
.tile .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tile b { font-size: 15.5px; }
.tile span:not(.ic) { font-size: 13px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill .i { width: 14px; height: 14px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

.list-item { display: flex; flex-direction: column; gap: 6px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-align: left; width: 100%; color: var(--ink); text-decoration: none; min-width: 0; }
a.list-item, button.list-item { cursor: pointer; }
a.list-item:hover, button.list-item:hover { border-color: var(--accent); }
.list-item .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.list-item .kind { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); letter-spacing: 0.03em; }
.list-item b { font-size: 15px; font-weight: 600; }
.list-item.flagged { border-color: var(--bad); }
.list-item .row { gap: 8px; }
.cards { display: flex; flex-direction: column; gap: 10px; }

.field { display: flex; flex-direction: column; gap: 7px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > .lbl, .field > legend { font-weight: 600; font-size: 14px; padding: 0; }
.input, .textarea, .select { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font: inherit; color: var(--ink); min-height: 46px; }
.textarea { min-height: 112px; resize: vertical; line-height: 1.45; }
.textarea.tall { min-height: 190px; }
.input[disabled], .textarea[disabled] { background: var(--sunk); color: var(--muted); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--bad); }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.err { display: flex; gap: 6px; align-items: flex-start; color: var(--bad); font-size: 13px; font-weight: 600; }
.err .i { width: 16px; height: 16px; margin-top: 2px; }
.hint { font-size: 13px; color: var(--muted); }

/* Radio and toggle chips. The real input stays in the page (keyboard and screen reader friendly); the span is what you see. */
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip > span, button.chip-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; border: 1px solid var(--line); background: var(--surface); padding: 0 14px; border-radius: 999px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.chip > span .i, button.chip-btn .i { display: none; width: 15px; height: 15px; stroke-width: 2.6; }
.chip input:checked + span, button.chip-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chip input:checked + span .i, button.chip-btn[aria-pressed="true"] .i { display: inline-block; }
.chip input:focus-visible + span, button.chip-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice .tag { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13.5px; padding: 7px 12px; border-radius: 999px; }
.choice .tag .i { width: 15px; height: 15px; stroke-width: 2.6; }

.picker { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 12px; min-height: 52px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kv span { font-size: 12px; color: var(--muted); }
.kv b { font-weight: 600; overflow-wrap: anywhere; }

.photos, .photos.three { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 120px)); gap: 8px; justify-content: start; }
.ph { aspect-ratio: 1; border-radius: 10px; max-width: 100%; position: relative; overflow: hidden; background: var(--sunk); border: 0; padding: 0; display: block; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.ph { cursor: zoom-in; }
.ph.doc { display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); background: var(--surface); }
.ph.add { border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--muted); background: var(--surface); cursor: pointer; }
.ph.add:hover, .ph.add:focus-within { border-color: var(--accent); color: var(--accent); }
.ph.add input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.ph.add:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.ph .rm { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: start end; padding: 4px; }
.ph .rm span { width: 26px; height: 26px; border-radius: 50%; background: rgba(14, 20, 26, 0.78); color: #fff; display: grid; place-items: center; }
.ph .rm .i { width: 14px; height: 14px; stroke-width: 2.6; }
.ph .rm:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 10px; }
/* Stand-ins for photos that an example case does not carry. Same look as the design. */
.ph.lawn1 { background: linear-gradient(170deg, #9DB7C9 0 32%, #6E8F3E 32% 58%, #56722C 58%); }
.ph.lawn2 { background: linear-gradient(160deg, #A9BFCD 0 28%, #7B9B45 28% 70%, #8C6A3E 70%); }
.ph.lawn3 { background: radial-gradient(circle at 30% 70%, #5E7A2F 0 22%, transparent 23%), radial-gradient(circle at 70% 60%, #6C8B35 0 26%, transparent 27%), linear-gradient(#8E7A55, #7D6A48); }
.ph.shed { background: linear-gradient(180deg, #A7BDCB 0 40%, transparent 40%), linear-gradient(90deg, transparent 22%, #C9C2B2 22% 78%, transparent 78%), linear-gradient(#6F8D40, #5C7834); }
.ph.plan { background: repeating-linear-gradient(0deg, transparent 0 13px, rgba(31, 78, 140, 0.18) 13px 14px), repeating-linear-gradient(90deg, transparent 0 13px, rgba(31, 78, 140, 0.18) 13px 14px), #F4F6F9; }
.ph.trash { background: linear-gradient(180deg, #A7BDCB 0 38%, #8A8F93 38% 46%, #6F8D40 46%); }
.ph.trailer { background: linear-gradient(180deg, #A7BDCB 0 35%, #B9B1A2 35% 70%, #6F8D40 70%); }
.ph.paint { background: linear-gradient(135deg, #8A95A0, #6E7A86); }
.file { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; min-width: 0; }
.file > span:not(.small) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file .small { margin-left: auto; white-space: nowrap; }
.file .rm-file { margin-left: 4px; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 8px; }
.file .rm-file:hover { color: var(--bad); }

.callout { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); color: var(--ink); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; }
.callout .i { color: var(--accent); margin-top: 1px; }
.callout.warn { background: var(--warn-soft); }
.callout.warn .i { color: var(--warn); }
.callout.bad { background: var(--bad-soft); }
.callout.bad .i { color: var(--bad); }
.callout.neutral { background: var(--sunk); }
.callout.neutral .i { color: var(--muted); }
.callout > div { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.callout > span, .callout > div > span { min-width: 0; }

.timeline { display: flex; flex-direction: column; gap: 0; padding-left: 4px; }
.timeline .st { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; position: relative; }
.timeline .st::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline .st:last-child::before { display: none; }
.timeline .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; }
.timeline .st.done .dot { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.timeline .st.now .dot { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 11px var(--accent); }
.timeline .st.skipped .dot { background: var(--sunk); border-color: var(--line); color: var(--muted); }
.timeline .dot .i { width: 13px; height: 13px; stroke-width: 3; }
.timeline b { font-weight: 600; }

.ai { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ai-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; background: var(--sunk); border-bottom: 1px solid var(--line); }
.ai-head h2, .ai-head b { font-family: var(--f-display); font-size: 15px; margin: 0 auto 0 0; font-weight: 700; }
.ai-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ai.neutral .ai-head { background: var(--sunk); }
.cite { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; margin: 0; }
.cite .ref { font-family: var(--f-mono); font-size: 12px; font-weight: 600; color: var(--accent); }
.cite q { font-family: var(--f-body); font-style: italic; quotes: "\201C" "\201D"; }
.cite .ok { font-size: 12px; color: var(--ok); display: inline-flex; gap: 4px; align-items: center; }
.cite .ok .i { width: 14px; height: 14px; stroke-width: 2.4; }
.meter { height: 8px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.approvals { display: flex; flex-direction: column; gap: 8px; }
.appr { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14px; }
.appr .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); flex: none; }
.appr .dot.wait { background: var(--sunk); color: var(--muted); }
.appr .dot .i { width: 14px; height: 14px; stroke-width: 2.6; }

.email { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.email .meta { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; display: flex; flex-direction: column; gap: 2px; background: var(--sunk); }
.email .meta b { font-size: 14.5px; color: var(--ink); }
.email .msg { padding: 14px; font-size: 14px; display: flex; flex-direction: column; gap: 10px; }
.email .msg p { white-space: pre-line; }
.email-head { display: flex; flex-direction: column; gap: 6px; padding: 14px; width: 100%; text-align: left; background: var(--surface); border: 0; cursor: pointer; }
.email-head .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.email-head .kind { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); letter-spacing: 0.03em; }
.email-head b { font-size: 15px; font-weight: 600; }
.email.collapsed { border-radius: 12px; }

.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hero-mark { width: 64px; height: 48px; border-radius: 6px; background: var(--sign); color: var(--sign-ink); display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 26px; box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5px var(--sign-ink); }
.check-big { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.check-big .i { width: 28px; height: 28px; stroke-width: 2.6; }
.welcome h1 { font-size: 1.8rem; }
.welcome .view { padding-top: 40px; gap: 22px; }
.conds { padding-left: 1.1rem; display: flex; flex-direction: column; gap: 4px; }
.quote { white-space: pre-line; overflow-wrap: anywhere; }
.pre { white-space: pre-line; overflow-wrap: anywhere; }

/* Loading, empty and error states */
.skel { display: flex; flex-direction: column; gap: 12px; }
.skel i { display: block; height: 76px; border-radius: 12px; background: var(--sunk); }
.skel i.s { height: 22px; width: 60%; }
.skel i.l { height: 34px; width: 80%; }
.empty { border: 1px dashed var(--line); border-radius: 12px; padding: 22px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty b { color: var(--ink); font-weight: 600; }
.state { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; padding-top: 12px; }
.state h1 { font-size: 1.45rem; }

/* Modal */
dialog.modal { border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--surface); color: var(--ink); width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }
dialog.modal::backdrop { background: rgba(10, 14, 18, 0.55); }
dialog.modal form { padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
dialog.modal h2 { font-family: var(--f-display); font-size: 1.25rem; font-weight: 800; margin: 0; }
dialog.modal .actions { display: flex; flex-direction: column; gap: 8px; }

/* Toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 30; background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; max-width: min(92vw, 460px); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); }

/* Desktop */
@media (min-width: 768px) {
  .appbar-in { padding-inline: 0; gap: 16px; }
  .view { padding: 28px 0 40px; gap: 22px; }
  .tabbar { display: none; }
  .topnav { display: flex; gap: 4px; }
  .back.mobile-only { display: none; }
  .brand + .topnav { margin-left: 8px; }
  .toast { bottom: 28px; }
  dialog.modal .actions { flex-direction: row-reverse; justify-content: flex-start; }
  .cards.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}
.crumb { display: none; align-items: center; gap: 4px; min-height: 44px; color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; align-self: flex-start; margin-left: -4px; padding-right: 10px; }
@media (max-width: 767.98px) {
  .appbar-in .brand.desk-only { display: none; }
}
@media (min-width: 768px) { .crumb { display: inline-flex; } }

.split { display: flex; flex-direction: column; gap: 18px; }
.split > .col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (min-width: 960px) {
  .split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; align-items: start; }
  .split.stretch-left { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
}

.admin-grid { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 960px) { .admin-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; } }

@media (prefers-reduced-motion: no-preference) {
  .view { animation: rise 180ms ease-out; }
  @keyframes rise { from { transform: translateY(6px); opacity: 0.6; } to { transform: none; opacity: 1; } }
  .skel i { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.55; } }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

.noscript { padding: 16px; font-size: 14px; }

/* ===== Additions for the live app ===== */
.role-btn { margin-left: auto; border: 0; background: transparent; padding: 0 0 0 4px; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: flex-end; cursor: pointer; border-radius: 10px; }
.role-btn:hover .role { outline: 1px solid var(--line); }
.appbar-end { margin-left: auto; }

input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); width: 20px; height: 20px; margin: 0; flex: none; }
.select { appearance: auto; }

/* Filter links styled like the design's chips. */
.fchip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; border: 1px solid var(--line); background: var(--surface); padding: 0 14px; border-radius: 999px; font-size: 13.5px; color: var(--ink); text-decoration: none; }
.fchip .i { display: none; width: 15px; height: 15px; stroke-width: 2.6; }
.fchip[aria-current="page"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.fchip[aria-current="page"] .i { display: inline-block; }
.fchip:hover { border-color: var(--accent); }

.list-item.persona { cursor: pointer; }
.list-item.persona:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.list-item.persona .row { flex-wrap: nowrap; }

details.more > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 600; font-size: 14px; }
details.card.more > summary { color: var(--ink); }
details.more[open] > summary { margin-bottom: 6px; }
.cite details.more > summary { min-height: 36px; font-size: 13px; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.history li { display: flex; flex-direction: column; gap: 1px; padding-left: 12px; border-left: 2px solid var(--line); font-size: 14px; }
.sections { max-height: 50vh; overflow: auto; }
.proposal-h { font-family: var(--f-display); font-size: 1.1rem; margin: 0; }

details.email { padding: 0; }
details.email > summary { list-style: none; cursor: pointer; }
details.email > summary::-webkit-details-marker { display: none; }
details.email:not([open]) .meta, details.email:not([open]) .msg { display: none; }
details.email[open] > summary { border-bottom: 1px solid var(--line); }
details.email > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }

.welcome-foot { margin-top: auto; }
.welcome { flex: 1; }
.cards.grid { display: flex; flex-direction: column; }
fieldset.field > legend { margin-bottom: 7px; }
.field .row .input { flex: 1; min-width: 0; }
.choice .chip input:checked + span { font-weight: 600; }
.grid2 .field { min-width: 0; }
.kv b { display: block; }
.stack > .btn.quiet { align-self: flex-start; }
.btn .i { width: 18px; height: 18px; }

h1:focus, main:focus { outline: none; }
details.card.more { padding-block: 2px; }

details.email[open] .email-head .to { display: none; }
