/* Homebase Mobile look. The token block and kit pieces are copied from the PC kit (Core\homebase\static\kit\kit.css, 17 Nov 2026) so the phone looks like the PC suite. Phone parts follow at the end. */
:root {
  /* surfaces */
  --hb-bg: #f5f4f0;
  --hb-surface: #ffffff;
  --hb-surface-2: #faf9f6;
  --hb-sidebar: #ecebe6;
  --hb-line: #e2e0d9;
  --hb-line-strong: #cfcdc4;
  /* text */
  --hb-ink: #1d1d1b;
  --hb-muted: #6b6b66;
  --hb-faint: #9a9993;
  /* Homebase is black and white. Accent is ink. */
  --hb-accent: #1d1d1b;
  --hb-accent-ink: #ffffff;
  /* states */
  --hb-good: #2e8b57;
  --hb-warn: #b7791f;
  --hb-bad: #c0392b;
  --hb-off: #b8b6ae;
  /* badges, same colours the old Home tiles used */
  --hb-badge-red: #dc2626;
  --hb-badge-blue: #2563eb;
  --hb-badge-yellow: #eab308;
  --hb-badge-green: #16a34a;
  /* section colours, for icons and small marks only */
  --hb-otto: #3f8f5a;
  --hb-postie: #2563eb;
  --hb-vault: #6d5bd0;
  --hb-reeve: #b45309;
  --hb-tally: #0e7490;
  --hb-echo: #475569;
  --hb-hansard: #7a2e2e;
  --hb-scribe: #db2777;
  /* shape and type */
  --hb-radius: 12px;
  --hb-radius-lg: 16px;
  --hb-radius-sm: 8px;
  --hb-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
  --hb-font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --hb-font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --hb-mono: "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hb-bg: #161614; --hb-surface: #212120; --hb-surface-2: #1b1b1a; --hb-sidebar: #1b1b19;
    --hb-line: #33332f; --hb-line-strong: #45453f;
    --hb-ink: #ecebe6; --hb-muted: #a3a29c; --hb-faint: #75746e;
    --hb-accent: #ecebe6; --hb-accent-ink: #161614;
    --hb-good: #4cc38a; --hb-warn: #e0a64a; --hb-bad: #ef6b5b; --hb-off: #55544f;
    --hb-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --hb-bg: #161614; --hb-surface: #212120; --hb-surface-2: #1b1b1a; --hb-sidebar: #1b1b19;
  --hb-line: #33332f; --hb-line-strong: #45453f;
  --hb-ink: #ecebe6; --hb-muted: #a3a29c; --hb-faint: #75746e;
  --hb-accent: #ecebe6; --hb-accent-ink: #161614;
  --hb-good: #4cc38a; --hb-warn: #e0a64a; --hb-bad: #ef6b5b; --hb-off: #55544f;
  --hb-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--hb-bg); color: var(--hb-ink); font: 15px/1.45 var(--hb-font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--hb-font-display); line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 26px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 .8em; }
.hb-muted { color: var(--hb-muted); }
.hb-small { font-size: 13px; }
.hb-mono { font-family: var(--hb-mono); font-size: 13px; }

/* page layout for section pages */
.hb-page { max-width: 960px; margin: 0 auto; padding: 24px 28px 64px; }
.hb-page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hb-page-head h1 { flex: 1; margin: 0; }
.hb-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hb-stack > * + * { margin-top: 12px; }

/* cards */
.hb-card { background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: var(--hb-radius-lg);
           padding: 18px 20px; box-shadow: var(--hb-shadow); }
.hb-card h2 { display: flex; align-items: center; gap: 8px; }
.hb-card + .hb-card { margin-top: 14px; }

/* buttons */
.hb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px;
          font-weight: 550; color: var(--hb-ink); background: var(--hb-surface); border: 1px solid var(--hb-line-strong);
          border-radius: var(--hb-radius-sm); padding: 7px 14px; cursor: pointer; white-space: nowrap;
          transition: background .12s, border-color .12s; }
.hb-btn:hover { border-color: var(--hb-muted); }
.hb-btn:focus-visible, .hb-input:focus-visible { outline: 2px solid var(--hb-accent); outline-offset: 2px; }
.hb-btn:disabled { opacity: .5; cursor: default; }
.hb-btn.primary { background: var(--hb-accent); color: var(--hb-accent-ink); border-color: var(--hb-accent); }
.hb-btn.danger { color: var(--hb-bad); }
.hb-btn.ghost { background: transparent; border-color: transparent; }
.hb-btn.ghost:hover { background: var(--hb-surface-2); border-color: var(--hb-line); }
.hb-btn.small { font-size: 13px; padding: 4px 10px; }
.hb-btn svg { width: 16px; height: 16px; }

/* inputs */
.hb-input, .hb-select { font: inherit; color: var(--hb-ink); background: var(--hb-surface); border: 1px solid var(--hb-line-strong);
                        border-radius: var(--hb-radius-sm); padding: 8px 12px; min-width: 0; }
.hb-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--hb-muted); }
.hb-field .hb-input, .hb-field .hb-select { font-size: 15px; color: var(--hb-ink); }

/* tables */
.hb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hb-table th { text-align: left; font-weight: 600; color: var(--hb-muted); font-size: 12px; text-transform: uppercase;
               letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--hb-line); }
.hb-table td { padding: 9px 10px; border-bottom: 1px solid var(--hb-line); vertical-align: top; }
.hb-table tr:last-child td { border-bottom: 0; }
.hb-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* key value list */
.hb-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; margin: 0; }
.hb-kv dt { color: var(--hb-muted); }
.hb-kv dd { margin: 0; overflow-wrap: anywhere; }

/* status dot and pill */
.hb-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--hb-off); flex: none; }
.hb-dot.good { background: var(--hb-good); }
.hb-dot.warn { background: var(--hb-warn); }
.hb-dot.bad { background: var(--hb-bad); }
.hb-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; color: var(--hb-muted);
           background: var(--hb-surface-2); border: 1px solid var(--hb-line); border-radius: 999px; padding: 2px 10px; }

/* badge, the round count on tiles and sidebar items */
.hb-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
            border-radius: 10px; font-size: 11px; font-weight: 700; line-height: 1; background: var(--hb-badge-red); color: #fff; }
.hb-badge.blue { background: var(--hb-badge-blue); }
.hb-badge.yellow { background: var(--hb-badge-yellow); color: #1c1917; }
.hb-badge.green { background: var(--hb-badge-green); }
.hb-badge.grey { background: var(--hb-off); color: var(--hb-ink); }

/* notice */
.hb-note { border: 1px solid var(--hb-line); background: var(--hb-surface-2); border-radius: var(--hb-radius); padding: 12px 14px; font-size: 14px; }
.hb-note.warn { border-color: color-mix(in srgb, var(--hb-warn) 45%, var(--hb-line)); }
.hb-note.bad { border-color: color-mix(in srgb, var(--hb-bad) 45%, var(--hb-line)); }

/* icons from the kit sprite */
.hb-icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
           stroke-linecap: round; stroke-linejoin: round; }

/* toast */
.hb-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); background: var(--hb-ink); color: var(--hb-bg);
            border-radius: var(--hb-radius); padding: 10px 16px; font-size: 14px; opacity: 0; pointer-events: none;
            transition: opacity .15s, transform .15s; z-index: 1000; max-width: min(560px, 90vw); display: flex; gap: 12px; align-items: center; }
.hb-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.hb-toast button { font: inherit; font-weight: 650; background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

/* dialog */
.hb-dialog { border: 1px solid var(--hb-line); border-radius: var(--hb-radius-lg); background: var(--hb-surface); color: var(--hb-ink);
             padding: 22px 24px; width: min(440px, 92vw); box-shadow: 0 10px 40px rgba(0, 0, 0, .18); }
.hb-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.hb-dialog .hb-row { justify-content: flex-end; margin-top: 16px; }

/* switch */
.hb-switch { position: relative; width: 36px; height: 20px; flex: none; appearance: none; background: var(--hb-off); border-radius: 10px;
             cursor: pointer; transition: background .15s; margin: 0; }
.hb-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.hb-switch:checked { background: var(--hb-good); }
.hb-switch:checked::after { left: 18px; }

/* ---------- design pass pieces. Every part uses these instead of its own versions ---------- */

/* page header: section icon, title, one line of state, then More and the one main action */
.hb-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hb-head .hb-head-icon { width: 38px; height: 38px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center;
                         color: var(--hb-colour, var(--hb-ink)); background: color-mix(in srgb, var(--hb-colour, var(--hb-ink)) 14%, var(--hb-surface)); }
.hb-head h1 { font-size: 24px; margin: 0; }
.hb-head .hb-head-sub { font-size: 13px; color: var(--hb-muted); margin: 2px 0 0; }
.hb-head .hb-head-text { flex: 1; min-width: 0; }

/* tabs, underlined. The active tab is ink, never a section colour */
.hb-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hb-line); margin-bottom: 16px; overflow-x: auto; }
.hb-tabs > a, .hb-tabs > button { font: inherit; font-size: 14px; font-weight: 550; color: var(--hb-muted); text-decoration: none; background: none;
                                  border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 12px; cursor: pointer; white-space: nowrap; }
.hb-tabs > .on, .hb-tabs > [aria-selected="true"] { color: var(--hb-ink); border-bottom-color: var(--hb-ink); }

/* More menu: Undo, Log, Settings and rare actions live here */
.hb-menu { position: relative; display: inline-flex; }
.hb-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; min-width: 200px; padding: 6px; margin: 0; list-style: none;
                background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: var(--hb-radius); box-shadow: 0 8px 28px rgba(0, 0, 0, .14); }
.hb-menu-list[hidden] { display: none; }
.hb-menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; font: inherit; font-size: 14px; color: var(--hb-ink); text-align: left;
                       background: none; border: 0; border-radius: var(--hb-radius-sm); padding: 8px 10px; cursor: pointer; }
.hb-menu-list button:hover, .hb-menu-list button:focus-visible { background: var(--hb-surface-2); outline: none; }
.hb-menu-list .hb-icon { width: 16px; height: 16px; color: var(--hb-muted); }

/* centred screen: locked, off, empty, error. Always a sentence and one button */
.hb-screen { text-align: center; padding: 40px 20px; }
.hb-screen .hb-screen-icon { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center;
                             color: var(--hb-muted); background: var(--hb-surface-2); border: 1px solid var(--hb-line); }
.hb-screen .hb-screen-icon .hb-icon { width: 26px; height: 26px; }
.hb-screen h2 { font-size: 18px; margin: 0 0 6px; }
.hb-screen p { color: var(--hb-muted); max-width: 400px; margin: 0 auto 16px; }

/* list rows: Today on Home, Recent on helper pages */
.hb-list { list-style: none; margin: 0; padding: 0; }
.hb-list > li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--hb-line); min-height: 46px; }
.hb-list > li:last-child { border-bottom: 0; }
.hb-list .hb-list-src { width: 64px; flex: none; font-size: 12px; color: var(--hb-muted); }
.hb-list .hb-list-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hb-list .hb-list-when { font-size: 12px; font-weight: 600; color: var(--hb-muted); white-space: nowrap; }
.hb-list .hb-list-when.bad { color: var(--hb-bad); }
.hb-list time { width: 88px; flex: none; color: var(--hb-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hb-card.flush { padding: 0; overflow: hidden; }

/* group label above a block */
.hb-label { font-size: 12px; font-weight: 650; color: var(--hb-muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; }

/* keyboard key */
.hb-kbd { font: 600 11px/1 var(--hb-font); color: var(--hb-muted); border: 1px solid var(--hb-line-strong); border-bottom-width: 2px;
          border-radius: 5px; padding: 3px 6px; white-space: nowrap; }

@media (max-width: 600px) {
  .hb-list .hb-list-src { display: none; }
  .hb-page { padding: 16px 16px 48px; }
  .hb-kv { grid-template-columns: 1fr; gap: 2px; }
  .hb-kv dd { margin-bottom: 8px; }
}


/* ---------- phone parts ---------- */
html { -webkit-text-size-adjust: 100%; }
body { font-size: 16px; min-height: 100vh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
[hidden] { display: none !important; }
.hb-page { max-width: 640px; padding: 16px 16px 48px; }
.hb-page > * + * { margin-top: 12px; }
.hb-page > .hb-label { margin-top: 20px; }
.hb-head { margin-bottom: 4px; }
.hb-head .hb-btn { flex: none; }
.hb-btn { min-height: 44px; padding: 8px 16px; font-size: 15px; }
.hb-btn.small { min-height: 36px; }
.hb-btn.wide { width: 100%; }
.hb-input { width: 100%; font-size: 16px; min-height: 44px; }
.hb-code { font-family: var(--hb-mono); font-size: 13px; margin: 8px 0; }
.hb-row .grow { flex: 1; min-width: 0; }
.hb-pad { padding: 14px 16px; margin: 0; }
.hb-list > li.tap { cursor: pointer; }
.hb-list > li.tap:active { background: var(--hb-surface-2); }
details summary { cursor: pointer; color: var(--hb-muted); font-size: 14px; padding: 10px 0; }
.hb-scan { width: 100%; border-radius: var(--hb-radius); background: #000; aspect-ratio: 1; object-fit: cover; }

.hb-cmd { display: flex; gap: 8px; }
.hb-cmd .hb-input { flex: 1; }

.hb-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hb-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; font: inherit; color: var(--hb-ink);
           background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: var(--hb-radius-lg); padding: 14px; min-height: 92px;
           box-shadow: var(--hb-shadow); cursor: pointer; }
.hb-tile:active { background: var(--hb-surface-2); }
.hb-tile.off { opacity: .55; }
.hb-tile-mark { width: 26px; height: 26px; border-radius: 8px; background: color-mix(in srgb, var(--hb-colour, var(--hb-ink)) 22%, var(--hb-surface)); border: 2px solid var(--hb-colour, var(--hb-line-strong)); }
.hb-tile-name { font-weight: 600; }
.hb-tile-line { font-size: 13px; color: var(--hb-muted); overflow-wrap: anywhere; }
.hb-tile .hb-badge { position: absolute; top: 12px; right: 12px; }

.hb-sheet { border: 1px solid var(--hb-line); border-radius: var(--hb-radius-lg) var(--hb-radius-lg) 0 0; background: var(--hb-surface); color: var(--hb-ink);
            width: 100%; max-width: 640px; margin: auto auto 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 40px rgba(0, 0, 0, .18); }
.hb-sheet::backdrop { background: rgba(0, 0, 0, .35); }
.hb-sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.hb-sheet-head h2 { flex: 1; margin: 0; }
.hb-sheet .hb-row { justify-content: flex-end; }
.hb-toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

/* plain public pages (home.html, privacy.html) */
.hb-doc { max-width: 680px; margin: 0 auto; padding: 28px 18px 60px; }
.hb-doc h2 { margin-top: 1.6em; }
.hb-doc li { margin-bottom: .4em; }
