/* The operator dashboard (step 4, unit 3c). Visual target:
   docs/mockups/control-panel-v2.html. Palette and type: docs/DESIGN-TOKENS.md,
   the same values as admin-frontend/css/admin.css; do not invent colours here.

   The control host's CSP is "default-src 'self'; style-src 'self'": no inline
   <style>, no style="" in markup. JS sets only CSS custom properties through
   element.style.setProperty (CSSOM, which the CSP does not govern). */

/* Self-hosted, SIL OFL 1.1 (licences beside the files in fonts/). Latin and
   Latin Extended subsets of the Google Fonts builds; a character outside them
   falls back to the system stack. */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../fonts/bricolage-grotesque-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/public-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/public-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/spline-sans-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f6f4ee; --surface: #ffffff; --ink: #1f241f; --muted: #5d5a4f; --line: #d9d5ca;
  --green: #1d3b2a; --green-deep: #142a1e; --brass: #b08d3e; --ok: #2f7d4f; --warn: #a3641f;
  --error: #9c3a2e; --on-green: #f6f4ee; --soft: #ece8dd; --shadow: 0 1px 2px rgba(31,36,31,.06);
  --lift: 0 12px 32px rgba(31,36,31,.14);
  --scrim: rgba(0,0,0,.25);
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Public Sans', system-ui, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161815; --surface: #1e211d; --ink: #e7e5dd; --muted: #9aa094; --line: #2b2f2a;
    --green: #7fb894; --green-deep: #6fae86; --brass: #c9a45a; --ok: #7fb894; --warn: #d9a05b;
    --error: #d07a6c; --on-green: #142a1e; --soft: #252924; --shadow: none;
    --lift: 0 12px 32px rgba(0,0,0,.45);
    --scrim: rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #161815; --surface: #1e211d; --ink: #e7e5dd; --muted: #9aa094; --line: #2b2f2a;
  --green: #7fb894; --green-deep: #6fae86; --brass: #c9a45a; --ok: #7fb894; --warn: #d9a05b;
  --error: #d07a6c; --on-green: #142a1e; --soft: #252924; --shadow: none;
  --lift: 0 12px 32px rgba(0,0,0,.45);
  --scrim: rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 400 14px/1.5 var(--body); }
/* Hidden until the session is confirmed (js/theme.js adds it, main.js removes it). */
html.auth-pending body { visibility: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.err-text { color: var(--error); }
.warn-text { color: var(--warn); }
[hidden] { display: none !important; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75;
        stroke-linecap: round; stroke-linejoin: round; flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
                   clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 30; background: var(--surface);
             color: var(--ink); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
main:focus { outline: none; }

/* Shell */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.rail { border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column;
        gap: 4px; position: sticky; top: 0; height: 100vh; background: var(--paper); }
.brand { display: flex; align-items: center; gap: 10px; font: 700 17px var(--display); padding: 0 8px 18px; }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--green); color: var(--on-green);
        display: grid; place-items: center; font: 800 16px var(--display); }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
       color: var(--muted); text-decoration: none; }
.nav:hover { background: var(--soft); color: var(--ink); }
.nav[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
                            outline: 1px solid var(--line); }
.nav[aria-current="page"]:focus-visible { outline: 2px solid var(--brass); }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.rail .spacer { flex: 1; }
.budget { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface); }
.budget b { font: 600 13px var(--body); }
.whoami { padding: 10px 8px 0; overflow-wrap: anywhere; }
.whoami.is-error { color: var(--error); }

.meter { height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; margin: 8px 0 6px;
         display: flex; }
.meter i { display: block; height: 100%; width: var(--fill, 0%); background: var(--green); }
.meter i.held { width: var(--held, 0%);
                background: repeating-linear-gradient(135deg, var(--green) 0 3px, transparent 3px 6px); }
.meter.big { height: 14px; margin: 12px 0 8px; }
.meter.over i { background: var(--error); }

main { padding: 24px 32px 48px; min-width: 0; }
.top { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.top h1 { font: 700 28px/1.1 var(--display); margin: 0; letter-spacing: -.01em; }
.top .sub { color: var(--muted); }
.top .grow { flex: 1; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px;
          padding: 0 12px; background: var(--surface); color: var(--muted); min-width: 220px; }
.search:focus-within { outline: 2px solid var(--brass); outline-offset: 2px; }
.search input { border: 0; background: none; padding: 8px 0; min-width: 0; flex: 1; color: var(--ink); }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input:focus { outline: none; }

.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 8px; padding: 9px 14px;
       border: 1px solid var(--line); background: var(--surface); font-weight: 600; white-space: nowrap;
       color: var(--ink); text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--green); border-color: var(--green); color: var(--on-green); }
.btn.primary:hover { background: var(--green-deep); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); }
.btn:disabled { cursor: not-allowed; color: var(--muted); border-style: dashed; }
.btn:disabled:hover { border-color: var(--line); }
.theme { width: 38px; justify-content: center; padding: 9px; }

/* Banners and per-section notes */
.banners:empty, .notes:empty { display: none; }
.banners { display: grid; gap: 8px; margin-bottom: 16px; }
.notes { display: grid; gap: 6px; margin-bottom: 16px; }
.banner { border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 10px;
          background: var(--surface); padding: 10px 14px; }
.banner b { display: block; font-weight: 600; }
.banner.err { border-left-color: var(--error); }
.banner.err b { color: var(--error); }
.note { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.note.warn::before, .note.err::before { content: ""; width: 8px; height: 8px; border-radius: 999px;
                                         background: var(--warn); flex: none; align-self: center; }
.note.err::before { background: var(--error); }
.empty { border: 1px dashed var(--line); border-radius: 10px; padding: 28px 20px; text-align: center;
         background: var(--surface); }
.empty h2 { font: 700 20px/1.2 var(--display); margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto; }

/* Today strip */
.today { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 24px; align-items: stretch; }
.tile:not(.call) { display: flex; flex-direction: column; justify-content: center; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
        box-shadow: var(--shadow); min-width: 0; }
.tile .k { font: 500 12px var(--body); color: var(--muted); }
.tile .v { font: 700 26px/1.2 var(--display); margin-top: 4px; }
.tile .s { font-size: 13px; color: var(--muted); }
.tile.call { background: var(--green); color: var(--on-green); border-color: var(--green); display: flex;
             gap: 14px; align-items: center; }
.tile.call .k, .tile.call .s { color: inherit; }
.tile.call .btn { margin-left: auto; background: var(--on-green); color: var(--green); border: 0; }
.tile.call .btn:focus-visible { outline-color: var(--on-green); }

.dispatch { font-size: 13px; color: var(--muted); margin: -12px 0 14px; display: flex; gap: 8px;
            align-items: center; flex-wrap: wrap; }

/* Board */
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.col { background: var(--soft); border-radius: 10px; padding: 10px; min-height: 200px; min-width: 0; }
.col h2 { display: flex; align-items: center; gap: 8px; margin: 2px 4px 10px; font: 600 13px var(--body); }
.col h2 .n { font: 500 12px var(--mono); color: var(--muted); }
.col h2 .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--muted); }
.col.drafting h2 .dot { background: var(--brass); }
.col.ready h2 .dot { background: var(--ok); }
.col.won h2 .dot { background: var(--green); }
.col ul { list-style: none; padding: 0; }
.col .none { color: var(--muted); font-size: 13px; padding: 4px 4px 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
        margin-bottom: 10px; box-shadow: var(--shadow); text-align: left; width: 100%;
        transition: transform .15s ease, box-shadow .15s ease; display: block; }
.card:hover { transform: translateY(-1px); box-shadow: var(--lift); }
.card[aria-expanded="true"] { outline: 2px solid var(--green); outline-offset: -1px; }
.card:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.card > span { display: block; }
.card .name { font: 600 15px/1.25 var(--display); overflow-wrap: anywhere; }
.card .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.card .row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.card .problem { color: var(--error); font-size: 12.5px; margin-top: 8px; overflow-wrap: anywhere; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 9px;
        font: 500 11.5px var(--body); border: 1px solid var(--line); color: var(--muted); }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.chip.err { color: var(--error); border-color: color-mix(in srgb, var(--error) 45%, transparent); }
.chip.model { font-family: var(--mono); }
.chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.thumb { margin: -2px -2px 10px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line);
         aspect-ratio: 16 / 10; background: var(--soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.steps, .card > .steps { display: flex; gap: 4px; margin-top: 10px; }
.steps i { flex: 1; height: 4px; border-radius: 999px; background: var(--line); }
.steps i.done { background: var(--ok); }
.steps i.now { background: var(--brass); animation: pulse 1.4s ease-in-out infinite; }
.steps i.bad { background: var(--error); }
@keyframes pulse { 50% { opacity: .35; } }
.stepnote { font: 500 12px var(--mono); color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
/* A note wraps only between its parts, never inside "12 more days". */
.card > .stepnote { display: flex; flex-wrap: wrap; }
.stepnote .part { white-space: nowrap; }
.stepnote .part:not(:last-child)::after { content: "\00a0·"; margin-right: 0.6ch; }
.attention { border-color: color-mix(in srgb, var(--error) 50%, var(--line)); }

.below { margin-top: 18px; display: grid; gap: 10px; }
.below details { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 10px 14px; }
.below summary { cursor: pointer; font-weight: 600; }
.below summary .n { font: 500 12px var(--mono); color: var(--muted); margin-left: 6px; }
.below ul { list-style: none; padding: 0; margin-top: 8px; }
.below li { padding: 6px 0; border-top: 1px solid var(--line); }
.linkish { background: none; border: 0; padding: 0; text-align: left; font-weight: 600;
           text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }

/* Drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface);
          border-left: 1px solid var(--line); box-shadow: var(--lift); transform: translateX(105%);
          visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s;
          display: flex; flex-direction: column; z-index: 20; }
.drawer.open { transform: none; visibility: visible; transition: transform .2s ease; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px;
               border-bottom: 1px solid var(--line); }
.drawer-title { min-width: 0; }
.drawer-head h2 { margin: 0; font: 700 22px/1.15 var(--display); overflow-wrap: anywhere; }
.drawer-body { overflow: auto; padding: 18px 20px 24px; flex: 1; }
.drawer .close { margin-left: auto; }
.drawer-bar { display: none; }
.previews { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: start; }
.previews.single { grid-template-columns: minmax(0, 1fr); }
.phone { border: 6px solid var(--ink); border-radius: 26px; overflow: hidden; aspect-ratio: 390 / 844;
         background: var(--soft); }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.desk img { width: 100%; display: block; }
.desk { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.desk .bar { height: 18px; background: var(--soft); display: flex; gap: 4px; align-items: center; padding: 0 8px; }
.desk .bar i { width: 6px; height: 6px; border-radius: 99px; background: var(--line); }
.no-shot { color: var(--muted); font-size: 13px; padding: 16px; text-align: center; }
.linkbox { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px;
           padding: 8px 10px; margin: 14px 0 8px; font: 400 12.5px var(--mono); overflow: hidden; }
.linkbox span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions.space { margin-top: 8px; }
.section { margin-top: 22px; }
.section h3 { font: 600 13px var(--body); margin: 0 0 8px; display: flex; align-items: center; gap: 8px;
              flex-wrap: wrap; }
.verify { padding-left: 18px; }
.verify li { margin: 6px 0; overflow-wrap: anywhere; }
.verify li.red { color: var(--error); }
.verify .src { color: var(--muted); font-size: 12.5px; }
.verify li.red .src { color: var(--error); }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 10px 16px; overflow-wrap: anywhere; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px;
                       border-radius: 99px; background: var(--surface); border: 2px solid var(--muted); }
.timeline li.ok::before { border-color: var(--ok); background: var(--ok); }
.timeline li.warn::before { border-color: var(--warn); }
.timeline li.err::before { border-color: var(--error); background: var(--error); }
.timeline li.now::before { border-color: var(--brass); }
.timeline .t { font: 500 12px var(--mono); color: var(--muted); }
.message { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--paper);
           white-space: pre-wrap; font: 400 13.5px/1.5 var(--body); color: var(--ink); overflow-wrap: anywhere;
           width: 100%; resize: vertical; min-height: 12em; display: block; }
.message:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.section h3 label { cursor: text; }
.contact { display: grid; gap: 2px; }
.contact .email { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.scrim { position: fixed; inset: 0; background: var(--scrim); opacity: 0; pointer-events: none;
         transition: opacity .2s; z-index: 10; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer-status { padding: 24px 0; color: var(--muted); }
.drawer-status.err { color: var(--error); }

/* Actions (unit 4a): the "I checked these" tick, the won and lost forms, and
   the waiting line while the host worker carries a request out. */
.tick { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 10px 12px;
        border: 1px solid color-mix(in srgb, var(--error) 45%, var(--line)); border-radius: 8px;
        cursor: pointer; }
.tick input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--green); }
.form-row { display: grid; gap: 6px; margin-top: 10px; }
.form-row label { font-size: 13px; color: var(--muted); }
.field { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--surface);
         color: var(--ink); font: inherit; min-width: 0; }
input.field { width: 9em; }
select.field { flex: 0 1 auto; }
.field[aria-invalid="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-size: 13px; margin: 0; }
.field-error:empty { display: none; }
.action-status { color: var(--ink); display: flex; gap: 8px; align-items: center; }
.action-status::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--brass);
                         flex: none; }
.action-note { font-size: 14px; }
.action-note.ok { color: var(--ok); }
.action-note.ok::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--ok);
                          flex: none; align-self: center; }
.action-note.err { color: var(--error); }
@media (prefers-reduced-motion: no-preference) {
  .action-status::before { animation: waiting 1.2s ease-in-out infinite alternate; }
}

/* Unit 4b: the confirm step under More, and the New lead form (a native
   <dialog>, so the page behind is inert and Esc closes it). */
.confirm { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
           background: var(--paper); }
.confirm .hold { font-weight: 600; }
.newlead-status { display: grid; gap: 6px; margin-bottom: 16px; }
.newlead-status:empty { display: none; }
.newlead-status .note { font-size: 14px; color: var(--ink); }
.newlead-status .note.ok { color: var(--ok); }
.newlead-status .note.pending::before { content: ""; width: 8px; height: 8px; border-radius: 999px;
                                        background: var(--brass); flex: none; align-self: center; }
.sheet { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink);
         padding: 0; width: min(560px, calc(100vw - 32px)); max-width: calc(100vw - 32px);
         max-height: calc(100vh - 32px); box-shadow: var(--lift); }
.sheet::backdrop { background: rgba(0, 0, 0, .35); }
.sheet form { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.sheet-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font: 700 22px/1.15 var(--display); margin-bottom: 4px; }
.sheet-body { overflow: auto; padding: 6px 20px 16px; display: grid; gap: 4px; flex: 1 1 auto;
              align-content: start; }
.sheet-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 20px;
              border-top: 1px solid var(--line); }
.sheet input.field, .sheet textarea.field { width: 100%; }
.sheet textarea.field { resize: vertical; min-height: 6em; }
textarea { font: inherit; color: inherit; }
@keyframes waiting { from { opacity: .35; } to { opacity: 1; } }

/* Sites */
.page-lead { color: var(--muted); margin-bottom: 12px; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
         box-shadow: var(--shadow); min-width: 0; }
.panel h2 { font: 700 18px/1.2 var(--display); display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
            overflow-wrap: anywhere; }
.panel h2.mono { font: 500 16px var(--mono); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin-top: 12px;
         font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.hosts { list-style: none; padding: 0; display: grid; gap: 4px; }
.hosts li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hosts li { min-width: 0; }
/* A hostname never breaks at its hyphen: one line, cut with an ellipsis if it
   must be (the full name is in its title). Its row spans the panel. */
.hosts .host { font: 400 12.5px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
               max-width: 100%; }
.facts dt.wide, .facts dd.wide { grid-column: 1 / -1; }
.facts dd.wide { margin-bottom: 4px; }
.page-section { margin-top: 28px; }
.page-section > h2 { font: 700 20px/1.2 var(--display); margin-bottom: 10px; }
.page-section > p { color: var(--muted); margin-bottom: 10px; }

/* Spend */
.spend-top { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: stretch; }
.big-number { font: 700 30px/1.15 var(--display); margin-top: 4px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--green);
                  vertical-align: -2px; margin-right: 6px; }
.legend .swatch.held { background: repeating-linear-gradient(135deg, var(--green) 0 3px, transparent 3px 6px);
                       border: 1px solid var(--green); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.name { overflow-wrap: anywhere; min-width: 10ch; }

/* Motion: one moment (the drawer), micro-interactions under 200 ms, none at all
   when the visitor asks for less. */
@media (prefers-reduced-motion: reduce) {
  .steps i.now { animation: none; }
  .card, .drawer, .drawer.open, .scrim { transition: none; }
  .card:hover { transform: none; }
}

/* Phone and tablet */
@media (max-width: 1180px) {
  .today { grid-template-columns: 1fr 1fr; }
  .spend-top { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row;
          padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0;
          border-top: 1px solid var(--line); z-index: 15; justify-content: space-around; }
  .rail .brand, .rail .spacer, .budget, .nav .count, .whoami { display: none; }
  .nav { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 12px; align-items: center; }
  .nav[aria-current="page"] { outline: 0; box-shadow: none; background: none; color: var(--green); }
  .nav[aria-current="page"]:focus-visible { outline: 2px solid var(--brass); }
  main { padding: 16px 16px 96px; }
  .top { flex-wrap: wrap; gap: 10px; }
  .top h1 { font-size: 24px; }
  .search { display: none; }
  .today { gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile.call { grid-column: 1 / -1; }
  .tile:not(.call) { padding: 10px 12px; }
  .tile:not(.call) .v { font-size: 20px; }
  .tile:not(.call) .s { display: none; }
  .board { grid-template-columns: repeat(5, 82vw); overflow-x: auto; scroll-snap-type: x mandatory;
           margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; }
  .col { scroll-snap-align: start; }
  .previews { grid-template-columns: 110px minmax(0, 1fr); }
  .drawer { width: 100vw; border-left: 0; }
  .sheet { width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; margin: 0; border: 0; border-radius: 0; }
  .sheet form { height: 100%; max-height: 100%; }
  .sheet-head { padding: 14px 16px 10px; }
  .sheet-body { padding: 6px 16px 16px; }
  .sheet-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .sheet-foot .btn { flex: 1 1 auto; justify-content: center; }
  .drawer-head { padding: 14px 16px 10px; }
  .drawer-body { padding: 14px 16px 20px; }
  .drawer-bar { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
                border-top: 1px solid var(--line); background: var(--surface); }
  .drawer-bar:empty { display: none; }
  .drawer-bar .btn { flex: 1 1 auto; justify-content: center; }
  /* The sticky bar carries Open preview on a phone: not twice. */
  .wide-only { display: none; }
  /* Board: the gap equals the gutter, so the column before Ready to send ends
     exactly at the screen edge instead of peeking as a clipped sliver. */
  .board { gap: 16px; }
  .drawer-body { padding-bottom: 28px; }
  .site-grid { grid-template-columns: minmax(0, 1fr); }
}
