/* =========================================================
   Frank apps — shared shell and components
   Load after ../css/base.css (tokens, type, .btn, .field, .badge).
   Homeowner + Pro: mobile-first, side nav from 960px. Ops: desktop console.
   ========================================================= */
:root {
  --app-bg: var(--background);   /* 07 §9: Paper page and cards, Mist bands */
  --side-w: 248px;
  --tab-h: 64px;
  --top-h: 56px;
  --col: 720px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
html.app { background: var(--app-bg); }
/* Wordmarks carry the brand colour-way (07 §4); text stays ink */
.wordmark, .sf-logo, .hf-logo, .hm-flowhead__logo { color: var(--brand); }
html.app body { background: var(--app-bg); overflow-x: hidden; }
html.has-sheet body { overflow: hidden; }
.app main:focus { outline: none; }
.i { flex-shrink: 0; display: block; }
.tnum { font-variant-numeric: tabular-nums; }
.c-attention { color: var(--attention); }
.c-success { color: var(--success); }
.c-info { color: var(--info); }
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 8px); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1 1 0; min-width: 0; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px; background: var(--nav-glass);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.topbar .t-logo { font-size: 22px; }
.topbar__right { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 999px;
  display: inline-grid; place-items: center; color: var(--foreground);
  transition: background-color var(--dur-ui) ease, transform var(--dur-press) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--muted); } }
.dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 99px; background: var(--attention); box-shadow: 0 0 0 2px var(--app-bg); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: color-mix(in srgb, var(--card) 96%, transparent); border-top: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; line-height: 14px; font-weight: 500; color: var(--muted-foreground);
  -webkit-tap-highlight-color: transparent; transition: color var(--dur-ui) ease;
}
.tabbar a[aria-current="page"] { color: var(--foreground); }
.tabbar .dot { top: 8px; right: calc(50% - 16px); }

.sidenav { display: none; }
.content { min-width: 0; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); }
.page { max-width: var(--col); margin: 0 auto; padding: 20px 16px 32px; display: flex; flex-direction: column; gap: 20px; }
.page--wide { max-width: 1120px; }
.page__head { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.page__title { font-weight: 300; font-size: 32px; line-height: 38px; letter-spacing: -0.6px; }
.page__sub { font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted-foreground); width: fit-content; margin-left: -4px; }
.section-title { font-size: 13px; line-height: 16px; font-weight: 500; letter-spacing: .2px; color: var(--muted-foreground); }

@media (min-width: 960px) {
  .shell { grid-template-columns: var(--side-w) 1fr; }
  .tabbar { display: none; }
  .topbar--mobile { display: none; }
  .content { padding-bottom: 48px; }
  .sidenav {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh;
    padding: 24px 16px; border-right: 1px solid var(--border-subtle); background: var(--card);
  }
  .sidenav .t-logo { padding: 0 12px 20px; }
  .sidenav a.side-link {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
    font-size: 14px; line-height: 20px; color: var(--muted-foreground);
    transition: background-color var(--dur-ui) ease, color var(--dur-ui) ease;
  }
  .sidenav a.side-link[aria-current="page"] { background: var(--muted); color: var(--foreground); font-weight: 500; }
  .sidenav .dot { position: static; margin-left: auto; box-shadow: none; }
  .sidenav__foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 12px; }
  .page { padding: 40px 32px 48px; gap: 24px; }
  .page__title { font-size: 40px; line-height: 46px; letter-spacing: -0.8px; }
}
@media (min-width: 960px) and (hover: hover) and (pointer: fine) {
  .sidenav a.side-link:hover { color: var(--foreground); background: var(--muted); }
}

/* ---------- Cards and rows ---------- */
.card {
  background: var(--card); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.card--flush { padding: 0; gap: 0; overflow: hidden; }
.card--muted { background: var(--muted); border-color: transparent; }
.card--attention { background: var(--attention-subtle); border-color: color-mix(in srgb, var(--attention) 18%, var(--attention-subtle)); }
.card--success { background: var(--success-subtle); border-color: color-mix(in srgb, var(--success) 18%, var(--success-subtle)); }
.card--info { background: var(--info-subtle); border-color: color-mix(in srgb, var(--info) 18%, var(--info-subtle)); }
.card__title { font-size: 18px; line-height: 24px; font-weight: 400; letter-spacing: -0.2px; }
.card__meta { font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
a.card, button.card { width: 100%; text-align: left; transition: border-color var(--dur-ui) ease, transform var(--dur-press) var(--ease-out), box-shadow 250ms var(--ease-out); -webkit-tap-highlight-color: transparent; }
a.card:active, button.card:active { transform: scale(.99); }
@media (hover: hover) and (pointer: fine) { a.card:hover, button.card:hover { border-color: var(--border); box-shadow: var(--shadow-md); } }

.hero-num { font-weight: 300; font-size: 44px; line-height: 48px; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.big-num { font-weight: 300; font-size: 32px; line-height: 38px; letter-spacing: -0.6px; font-variant-numeric: tabular-nums; }

.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px; min-height: 56px; width: 100%; text-align: left;
  border-top: 1px solid var(--border-subtle); -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-ui) ease;
}
.list > .row:first-child, .card--flush > .row:first-child { border-top: 0; }
.row__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--muted); display: grid; place-items: center; flex-shrink: 0; color: var(--foreground); }
.row__icon--success { background: var(--success-subtle); color: var(--success); }
.row__icon--attention { background: var(--attention-subtle); color: var(--attention); }
.row__body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__title { font-size: 15px; line-height: 20px; font-weight: 500; }
.row__meta { font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.row__end { display: flex; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 14px; flex-shrink: 0; }
a.row:active, button.row:active { background: var(--muted); }
@media (hover: hover) and (pointer: fine) { a.row:hover, button.row:hover { background: color-mix(in srgb, var(--foreground) 3%, var(--card)); } }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; line-height: 20px; }
.kv dt { color: var(--muted-foreground); }
.kv dd { text-align: right; font-variant-numeric: tabular-nums; }

.avatar { width: 40px; height: 40px; border-radius: 999px; display: inline-grid; place-items: center; flex-shrink: 0; font-size: 14px; font-weight: 500; letter-spacing: .3px; }
.avatar--0 { background: var(--lawn-wash); color: var(--lawn-deep); } .avatar--1 { background: var(--sun-wash); color: var(--sun-deep); }
.avatar--2 { background: var(--gulf-wash); color: var(--gulf-deep); } .avatar--3 { background: var(--line-subtle); color: var(--ink); }
.avatar--lg { width: 56px; height: 56px; font-size: 18px; }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }

.badge--info { background: var(--info-subtle); color: var(--info); }
.badge--outline { background: transparent; border: 1px solid var(--border); color: var(--foreground); }

/* ---------- Banners (one per state; ember for exceptions) ---------- */
.banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius-lg);
  background: var(--muted); font-size: 14px; line-height: 20px;
}
.banner .i { margin-top: 1px; }
.banner__body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.banner__title { font-weight: 500; }
.banner__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.banner--attention { background: var(--attention-subtle); color: color-mix(in srgb, var(--attention) 40%, var(--ink)); }
.banner--attention .i { color: var(--attention); }
.banner--success { background: var(--success-subtle); color: var(--success); }
.banner--info { background: var(--info-subtle); color: var(--gulf-deep); }
.banner--info .i { color: var(--info); }

/* ---------- Buttons extra ---------- */
.btn--block { width: 100%; }
.btn--ghost { background: transparent; color: var(--foreground); }
.btn--attention { background: var(--attention); color: var(--paper); }
.btn--dark { background: var(--foreground); color: var(--background); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn--xs { height: 30px; padding: 0 12px; font-size: 13px; }
@media (hover: hover) and (pointer: fine) {
  .btn--ghost:hover { background: var(--muted); }
  .btn--attention:hover { background: color-mix(in srgb, var(--attention) 88%, var(--foreground)); }
  .btn--dark:hover { background: color-mix(in srgb, var(--foreground) 88%, var(--card)); }
}
.text-btn { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; transition: text-decoration-color var(--dur-ui) ease; }
@media (hover: hover) and (pointer: fine) { .text-btn:hover { text-decoration-color: currentColor; } }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions--stack { flex-direction: column; }
.actions--stack .btn { width: 100%; }

/* ---------- Form controls ---------- */
.field + .field { margin-top: 0; }
.field select.field__input { appearance: none; background: transparent; }
textarea.field__input { resize: vertical; min-height: 72px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid > .full { grid-column: 1 / -1; }
.hint { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.error-text { font-size: 12px; line-height: 16px; color: var(--attention); }

.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice {
  position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 16px; width: 100%; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); cursor: pointer;
  transition: border-color var(--dur-ui) ease, box-shadow var(--dur-ui) ease, transform var(--dur-press) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.choice:active { transform: scale(.99); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__mark { width: 20px; height: 20px; border-radius: 99px; border: 1.5px solid var(--border); flex-shrink: 0; margin-top: 1px; display: grid; place-items: center; transition: border-color var(--dur-ui) ease; }
.choice__mark::after { content: ""; width: 10px; height: 10px; border-radius: 99px; background: var(--foreground); transform: scale(.4); opacity: 0; transition: transform var(--dur-ui) var(--ease-out), opacity var(--dur-ui) ease; }
.choice--check .choice__mark { border-radius: 6px; }
.choice--check .choice__mark::after { border-radius: 2px; }
.choice__body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.choice__title { font-size: 15px; line-height: 20px; font-weight: 500; }
.choice__meta { font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.choice__end { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.choice:has(input:checked), .choice[aria-checked="true"] { border-color: var(--foreground); box-shadow: 0 0 0 1px var(--foreground) inset; }
.choice:has(input:checked) .choice__mark, .choice[aria-checked="true"] .choice__mark { border-color: var(--foreground); }
.choice:has(input:checked) .choice__mark::after, .choice[aria-checked="true"] .choice__mark::after { transform: none; opacity: 1; }
.choice:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.choice[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--muted); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted-foreground); text-align: center; white-space: nowrap; transition: background-color var(--dur-ui) ease, color var(--dur-ui) ease, box-shadow var(--dur-ui) ease; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border); transition: background-color var(--dur-ui) ease; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 99px; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--dur-ui) var(--ease-out); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:disabled + span { opacity: .5; }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.code-input { display: flex; gap: 8px; }
.code-input input { width: 44px; height: 52px; text-align: center; font: inherit; font-size: 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.code-input input:focus { outline: none; border-color: var(--foreground); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }

/* ---------- Steps / progress ---------- */
.progress { height: 4px; border-radius: 99px; background: var(--border-subtle); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--foreground); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform var(--dur-state) var(--ease-out); }
.timeline { display: flex; flex-direction: column; }
.tl-item { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.tl-item::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 1.5px; background: var(--border-subtle); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 24px; height: 24px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--card); flex-shrink: 0; display: grid; place-items: center; color: var(--paper); }
.tl-item.is-done .tl-dot { background: var(--success); border-color: var(--success); }
.tl-item.is-now .tl-dot { border-color: var(--info); box-shadow: 0 0 0 4px var(--info-subtle); }
.tl-item.is-attention .tl-dot { border-color: var(--attention); background: var(--attention); }
.tl-body { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; min-width: 0; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 21px; background: var(--muted); align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble--me { align-self: flex-end; background: var(--foreground); color: var(--paper); border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
.bubble--care { background: var(--info-subtle); }
.bubble__meta { font-size: 11px; line-height: 14px; color: var(--muted-foreground); margin-top: 2px; }
.bubble--me + .bubble__meta { align-self: flex-end; }
.bubble__orig { display: block; margin-top: 6px; font-size: 12px; opacity: .72; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 12px 0 0; }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: 11px 16px; border-radius: 22px; border: 1px solid var(--border); font: inherit; font-size: 15px; line-height: 20px; background: var(--card); }
.composer textarea:focus { outline: none; border-color: var(--foreground); }

/* ---------- Tables (Ops) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted-foreground); padding: 10px 14px; background: color-mix(in srgb, var(--foreground) 3%, var(--card)); border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.is-clickable { cursor: pointer; transition: background-color var(--dur-ui) ease; }
@media (hover: hover) and (pointer: fine) { .table tr.is-clickable:hover td { background: color-mix(in srgb, var(--foreground) 3%, var(--card)); } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.stat__label { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.stat__value { font-size: 24px; line-height: 30px; font-weight: 300; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }

/* ---------- Empty ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; text-align: center; color: var(--muted-foreground); font-size: 14px; }
.empty .i { color: var(--border); }

/* ---------- Photo placeholder (visit photos) ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo { aspect-ratio: 4 / 3; border-radius: 10px; background: linear-gradient(135deg, var(--lawn-wash), color-mix(in srgb, var(--lawn) 45%, var(--lawn-wash))); position: relative; overflow: hidden; }
.photo--clean { background: linear-gradient(135deg, var(--gulf-wash), color-mix(in srgb, var(--gulf) 22%, var(--gulf-wash))); }
.photo span { position: absolute; left: 8px; bottom: 6px; font-size: 11px; color: rgba(0,0,0,.6); }

/* ---------- Sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.32); opacity: 0; transition: opacity 250ms var(--ease-out); }
.sheet {
  position: relative; width: 100%; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 32px rgba(0,0,0,.12);
  transform: translateY(24px); opacity: 0; transition: transform 300ms var(--ease-out), opacity 200ms var(--ease-out);
  padding-bottom: var(--safe-b);
}
.sheet__grab { width: 36px; height: 4px; border-radius: 99px; background: var(--border); margin: 8px auto 0; }
.sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 20px 4px; }
.sheet__title { font-weight: 400; font-size: 22px; line-height: 28px; letter-spacing: -0.3px; }
.sheet__sub { font-size: 14px; line-height: 20px; color: var(--muted-foreground); margin-top: 4px; }
.sheet__body { padding: 12px 20px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.sheet__actions { display: flex; flex-direction: column; gap: 8px; padding: 12px 20px 20px; border-top: 1px solid var(--border-subtle); }
.sheet-wrap.is-open .sheet-backdrop { opacity: 1; }
.sheet-wrap.is-open .sheet { transform: none; opacity: 1; }
.sheet-wrap.is-closing .sheet { transform: translateY(16px); opacity: 0; transition-duration: 200ms; }
@media (min-width: 720px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { max-width: 520px; border-radius: 20px; transform: translateY(8px) scale(.98); }
  .sheet--wide { max-width: 760px; }
  .sheet__grab { display: none; }
  .sheet__head { padding-top: 20px; }
  .sheet__actions { flex-direction: row-reverse; }
  .sheet__actions .btn { flex: 0 0 auto; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); z-index: 90;
  max-width: min(92vw, 440px); padding: 12px 18px; border-radius: 14px; background: var(--foreground); color: var(--paper);
  font-size: 14px; line-height: 20px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity 200ms var(--ease-out), transform 250ms var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast--success { background: var(--success); }
.toast--attention { background: var(--attention); }
@media (min-width: 960px) { .toast { bottom: 24px; } }

/* ---------- Entrance for route changes ---------- */
.page > * { animation: rise 420ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Demo dock (prototype controls, not product UI) ---------- */
.demo-fab {
  position: fixed; right: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); z-index: 70;
  height: 36px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  background: #1b1b1b; color: var(--paper); font-size: 12px; font-weight: 500; letter-spacing: .2px; box-shadow: var(--shadow-lg);
  transition: transform var(--dur-press) var(--ease-out);
}
.demo-fab:active { transform: scale(.96); }
.demo-fab .clock { opacity: .7; font-variant-numeric: tabular-nums; }
@media (min-width: 960px) { .demo-fab { bottom: 20px; } }
.demo-panel { position: fixed; right: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 60px); z-index: 71; width: min(360px, calc(100vw - 32px)); max-height: 70dvh; overflow: auto;
  background: #1b1b1b; color: #eee; border-radius: 16px; padding: 16px; box-shadow: 0 20px 40px rgba(0,0,0,.3); font-size: 13px; line-height: 18px;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 200ms var(--ease-out), transform 250ms var(--ease-out); }
.demo-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }
@media (min-width: 960px) { .demo-panel { bottom: 64px; } }
.demo-panel h3 { font-size: 11px; font-weight: 500; letter-spacing: .6px; text-transform: uppercase; color: #9a9a96; margin: 14px 0 6px; }
.demo-panel h3:first-child { margin-top: 0; }
.demo-panel button, .demo-panel a { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; color: #eee; }
.demo-panel button:hover, .demo-panel a:hover { background: #2a2a2a; }
.demo-panel .is-active { background: #2e2e2e; }
.demo-panel .apps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.demo-panel .apps a { background: #262626; text-align: center; }
.demo-panel p { color: #9a9a96; padding: 0 10px; }

@media (prefers-reduced-motion: reduce) {
  .page > * { animation: none; }
  .sheet, .toast, .demo-panel { transform: none !important; }
  .choice:active, a.card:active, button.card:active, .icon-btn:active { transform: none; }
}
