/* Agency workspace — portal stylesheet (docs/portal-experience.md).
 *
 *   1. Tokens         colour, type, space, radius, motion
 *   2. Base
 *   3. Typography     serif only for page titles and the greeting
 *   4. Buttons        one filled (.primary) per card or screen
 *   5. Form controls
 *   6. Surfaces       cards, rows, review boxes
 *   7. Turn & status  .turn / .status / .chip with data-tone
 *   8. Feedback       messages, alerts, empty states
 *   9. Shell          top bar, destinations, staff strip, tab bar, sheet
 *  10. Home           customer Home
 *  11. Inbox          staff Inbox and lists
 *  12. Capability     existing guarded components hosted in the new views
 *  13. Responsive
 *
 * Theme: Aloha Desk. Warm brown ink on cream (never black), terracotta for
 * "go" and where you are, lagoon teal for links, focus and the agency's turn,
 * marigold for "current". Fraunces (soft, black) for titles and the greeting,
 * Figtree for everything else, Yellowtail for the wordmark only. Light only.
 *
 * CSP: style-src, font-src and img-src are 'self', so no inline styles. The
 * fonts are self-hosted latin subsets in assets/fonts/ (licences and sources
 * beside them); the header ribbon is painted by platform/tools/ribbon
 * (`just ribbon`) into assets/ribbon/, and its images and their geometry are
 * the generated --ribbon-* tokens in :root. The select chevron is drawn with
 * gradients.
 */

/* 0. Fonts ----------------------------------------------------------------- */
@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-soft-latin.woff2") format("woff2"); /* SOFT 100, opsz 72 built in */
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Yellowtail";
  src: url("fonts/yellowtail-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Aloha Desk palette */
  --cream: #fbf6ee;        /* "paper": wells and soft panels */
  --terracotta: #d9542f;   /* decoration: ribbon, marks, pins */
  --lagoon: #2f7e86;
  --lagoon-ink: #23656c;   /* lagoon deep enough for text (6.7:1 on white) */
  --marigold: #f0a93b;
  --sun: #f3c34a;

  /* Paper and ink */
  --paper: #fffcf7;        /* "page": the app's ground */
  --paper-deep: #f3eadc;
  --surface: #ffffff;
  --ink: #4a2e22;          /* warm brown ink for every line and heading, never black */
  --ink-soft: #5c3f31;
  --text: #4a2e22;
  --text-muted: #6e5547;   /* ≥5.2:1 on every ground used here, warm rows included */
  --text-faint: #8f786a;
  --hairline: #efe4cf;     /* dividers inside a card */
  --hairline-strong: rgb(74 46 34 / 0.35);
  --edge: rgb(74 46 34 / 0.35);         /* cards, fields, sheets */
  --edge-strong: rgb(74 46 34 / 0.5);   /* outline buttons, chips */

  /* Go: terracotta. Deepened to #c9482a wherever text sits on it (4.6:1). */
  --accent: #c9482a;
  --accent-hover: #b8401f;
  --accent-press: #a8391b;
  --accent-border: #b8401f;
  --accent-glow: 0 6px 14px -8px rgb(217 84 47 / 0.8);
  --accent-soft: #dcedf1;  /* lagoon soft: info messages, selected chips */
  --accent-ink: var(--lagoon-ink);
  --focus: var(--lagoon);
  --focus-ring: 0 0 0 2px var(--paper), 0 0 0 4.5px var(--lagoon);
  --field-ring: 0 0 0 3px rgb(47 126 134 / 0.25);

  /* Turn tones: bg / fg / dot / border */
  --you-bg: #fbe9c2;     --you-fg: #6b4510;     --you-dot: var(--sun);  --you-border: rgb(74 46 34 / 0.45);
  --agency-bg: #dcedf1;  --agency-fg: #1f5a61;  --agency-dot: var(--lagoon); --agency-border: rgb(74 46 34 / 0.45);
  --waiting-bg: #ffffff; --waiting-fg: #6e5547; --waiting-dot: #6e5547; --waiting-border: rgb(74 46 34 / 0.45);
  --failed-bg: #f9dcd2;  --failed-fg: #8a2c14;  --failed-dot: #c2401e;  --failed-border: rgb(194 64 30 / 0.5);
  --done-bg: #e4efec;    --done-fg: #35605a;    --done-dot: #7fb3ae;    --done-border: rgb(74 46 34 / 0.25);
  --neutral-bg: #f3eadc; --neutral-fg: #6e5547; --neutral-dot: #b9a595; --neutral-border: rgb(74 46 34 / 0.25);

  /* Type */
  --font-sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Fraunces", ui-serif, Georgia, Cambria, "Times New Roman", serif;
  --font-wordmark: "Yellowtail", "Brush Script MT", cursive;
  --display-weight: 850;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --text-2xs: 0.6875rem;  /* 11 */
  --text-xs: 0.75rem;     /* 12 */
  --text-sm: 0.875rem;    /* 14 */
  --text-base: 1rem;      /* 16 */
  /* The larger steps are fluid: they grow with the window from 320px to about
   * 1024px and then hold, so nothing jumps at a breakpoint. */
  --text-lg: clamp(1.0625rem, 1rem + 0.3125vw, 1.125rem);   /* 17–18 */
  --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.375rem);     /* 20–22 */
  --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 1.75rem);     /* 24–28 */
  --text-title: clamp(1.875rem, 1.45rem + 2.1vw, 2.625rem); /* 30–42, Fraunces */
  --text-amount: clamp(2rem, 1.75rem + 1.25vw, 2.5rem);     /* 32–40, Fraunces figures */
  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.55;

  /* Space (4px grid) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  /* Fluid layout space: the page gutter is 16px on a 320px phone and grows
   * smoothly to 40px; with viewport-fit=cover it never goes under a notch. */
  --gutter: clamp(1rem, 0.25rem + 3.75vw, 2.5rem);
  --gutter-l: max(var(--gutter), env(safe-area-inset-left, 0px));
  --gutter-r: max(var(--gutter), env(safe-area-inset-right, 0px));
  --page-pad-top: clamp(1.5rem, 1rem + 2.5vw, 2.5rem);
  --card-pad: clamp(1rem, 0.5rem + 2.5vw, 1.5rem);
  --tap: 2.75rem;          /* 44px: the smallest thing a thumb should have to hit */

  /* Shape */
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 22px;
  --radius-field: 12px;
  --radius-pill: 999px;
  --shadow-pop: 0 1px 2px rgb(74 46 34 / 0.08), 0 18px 40px -18px rgb(74 46 34 / 0.45);
  --shadow-press: 0 1px 0 rgb(74 46 34 / 0.25);

  --control-h: 2.5rem;
  --control-h-sm: 2rem;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 160ms;

  /* Surfaces and tints (theme hooks) */
  --surface-soft: var(--cream);
  --you-soft: #fff6e3;
  --hover-tint: rgb(74 46 34 / 0.06);
  --overlay: rgb(52 32 24 / 0.32);
  /* The bars are near-opaque paper, not frosted glass: a backdrop blur on a
   * fixed bar repaints everything under it on every scroll and resize frame. */
  --topbar-bg: rgb(255 252 247 / 0.97);
  --tabbar-bg: rgb(255 252 247 / 0.98);
  --strip-bg: #fdebd0;
  --strip-fg: var(--ink);
  --strip-muted: var(--text-muted);
  --strip-accent: var(--accent);
  --changed-stroke: var(--terracotta);
  --changed-fill: rgb(217 84 47 / 0.08);
  --pin: var(--terracotta);
  --pin-ink: #fffcf7;
  --warn: #c77a0e;
  --face-bg: #cfe6ec;
  --face-ink: var(--ink);
  --font-ui: var(--font-sans);
  --font-display: var(--font-serif);
  --texture: none;

  --page-max: 1120px;
  --header-h: 110px;     /* the full header: nav row over the ribbon */
  --topbar-h: 3.5rem;    /* the slim bar that takes over on scroll (and on phones) */
  --tabbar-h: 4rem;

  /* Header ribbon, painted in oil by platform/tools/ribbon. `just ribbon`
   * rewrites this block from the painting: the strip (--ribbon-image,
   * --ribbon-w wide, --header-h tall), where its S tops out (--ribbon-s-top,
   * from its left edge) and how far it rises across (--ribbon-rise), and the
   * two tiles that carry its flats on past its ends: the low flat (--ribbon-low,
   * a band --ribbon-band-y down and --ribbon-band-h tall) and the top flat
   * (--ribbon-top). Sizes in CSS px; the images are 2x. */
  /* ribbon:begin */
  --ribbon-image: url("/assets/ribbon/ribbon@2x.webp");
  --ribbon-w: 2576px;
  --ribbon-s-top: 1615px;
  --ribbon-rise: 80px;
  --ribbon-low: url("/assets/ribbon/ribbon-low@2x.webp");
  --ribbon-low-w: 320px;
  --ribbon-band-y: 72px;
  --ribbon-band-h: 16px;
  --ribbon-top: url("/assets/ribbon/ribbon-top@2x.webp");
  --ribbon-top-w: 288px;
  --ribbon-top-y: 1px;
  --ribbon-top-h: 16px;
  /* ribbon:end */
  --ribbon-end: 10rem;      /* width of the header's end cluster under the swoop */
  --band-scale: 0.75;       /* the slim bar's and phones' edge: the low band, smaller */
}

/* 2. Base ------------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }
html {
  font-family: var(--font-ui);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--paper);
  font-synthesis: none;
  /* No text-rendering: optimizeLegibility: kerning and ligatures are on by
   * default, and that switch makes every text relayout (resizing) slower. */
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body { margin: 0; min-width: 20rem; background: var(--paper); background-image: var(--texture); font-size: var(--text-base); }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, select, summary, [role="button"] { cursor: pointer; }
/* Taps act at once: no double-tap-to-zoom wait on controls. */
button, a, select, summary, label, input, textarea, [role="button"] { touch-action: manipulation; }
img, video { max-width: 100%; height: auto; }
svg { max-width: 100%; }
::selection { background: #fbe0b0; color: var(--ink); }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* 3. Typography ------------------------------------------------------------ */
h1, h2, h3, h4, p { overflow-wrap: anywhere; }
h1, h2, h3, h4 { color: var(--ink); margin: 0 0 var(--space-2); text-wrap: balance; }
/* Reading lines stop at about 75 characters on wide windows. */
.page p { max-inline-size: 75ch; }
h1 { font-size: var(--text-2xl); line-height: var(--leading-tight); letter-spacing: -0.02em; font-weight: 800; }
h2 { font-size: var(--text-lg); line-height: var(--leading-snug); letter-spacing: -0.01em; font-weight: 700; }
h3 { font-size: var(--text-base); line-height: var(--leading-snug); font-weight: 700; }
p { margin: 0 0 var(--space-3); }
p:last-child { margin-bottom: 0; }

.page-title {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--display-weight);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 var(--space-2);
}
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin: 0 0 var(--space-2);
}
.subtitle,
.muted { color: var(--text-muted); margin: 0; }
.subtitle { font-size: clamp(1rem, 0.9rem + 0.5vw, 1.125rem); line-height: 1.45; max-width: 60ch; }
.muted { font-size: var(--text-sm); line-height: var(--leading-normal); }
.meta {
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin: 0 0 var(--space-1);
}
.note { font-size: var(--text-sm); color: var(--text-muted); margin: var(--space-3) 0; }
code, kbd, samp { font-family: var(--font-mono); font-size: 0.9em; }

.page a:not(.button) {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgb(35 101 108 / 0.4);
}
.page a:not(.button):hover { text-decoration-color: currentColor; }
.link-button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgb(35 101 108 / 0.4);
}

/* 4. Buttons --------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: 0 1.1rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.button .icon { width: 1rem; height: 1rem; stroke-width: 2.2; }
.button.primary { background: var(--accent); border-color: var(--accent-border); color: #fffcf7; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), var(--accent-glow); }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); }
.button.primary:active:not(:disabled) { background: var(--accent-press); transform: translateY(1px); box-shadow: inset 0 2px 3px rgb(0 0 0 / 0.2); }
.button.secondary { background: var(--surface); border-color: var(--edge-strong); color: var(--ink); box-shadow: var(--shadow-press); }
.button.secondary:hover:not(:disabled) { border-color: rgb(74 46 34 / 0.7); background: var(--surface-soft); }
.button.secondary:active:not(:disabled) { background: var(--paper-deep); transform: translateY(1px); box-shadow: none; }
.button.ghost { background: transparent; color: var(--ink-soft); }
.button.ghost:hover:not(:disabled) { background: var(--hover-tint); color: var(--ink); }
.button.danger { background: var(--failed-fg); border-color: #6e220f; color: #fffcf7; }
.button.small { min-height: var(--control-h-sm); padding: 0 var(--space-3); font-size: var(--text-sm); }
.button:focus-visible,
.button.primary:focus-visible,
.button.secondary:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.button:disabled,
.button[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }

/* 5. Form controls --------------------------------------------------------- */
input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="hidden"]),
select,
textarea {
  display: block;
  width: 100%;
  min-height: var(--control-h);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius-field);
  background-color: var(--surface);
  color: var(--ink);
  font-size: var(--text-base);
  line-height: 1.4;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
textarea { min-height: 6.5rem; line-height: var(--leading-normal); resize: vertical; }
select {
  appearance: none;
  padding-right: 2.25rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
}
input::placeholder,
textarea::placeholder { color: var(--text-faint); opacity: 1; }
input:hover:not(:disabled, :focus),
select:hover:not(:disabled, :focus),
textarea:hover:not(:disabled, :focus) { border-color: rgb(74 46 34 / 0.55); }
input:focus,
select:focus,
textarea:focus { outline: none; border-color: var(--focus); box-shadow: var(--field-ring); }
input:disabled,
select:disabled,
textarea:disabled { background-color: var(--cream); color: var(--text-muted); cursor: not-allowed; }
input:user-invalid,
select:user-invalid,
textarea:user-invalid { border-color: var(--failed-dot); }
input[type="checkbox"],
input[type="radio"] { accent-color: var(--lagoon); width: 1rem; height: 1rem; }
input[type="file"] { display: block; width: 100%; font-size: var(--text-sm); color: var(--text-muted); }
input[type="file"]::file-selector-button {
  margin-right: var(--space-3);
  min-height: var(--control-h-sm);
  padding: 0 var(--space-3);
  border: 1.5px solid var(--edge-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.page label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-soft);
  margin: var(--space-4) 0 var(--space-1);
}
.page label:first-child { margin-top: 0; }
.page details {
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 0 var(--space-4);
  margin: var(--space-4) 0;
}
.page details[open] { padding-bottom: var(--space-4); }
.page summary,
.sheet summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-soft);
}
summary::-webkit-details-marker { display: none; }
.page summary::before,
.sheet summary::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: var(--space-1);
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--dur) var(--ease);
}
details[open] > summary::before { transform: rotate(45deg); }

/* 6. Surfaces -------------------------------------------------------------- */
.card,
.panel,
.empty-panel {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: var(--card-pad);
}
.panel,
.empty-panel { margin-bottom: var(--space-5); }
.empty-panel h2 { font-size: var(--text-lg); }
.empty-panel p { color: var(--text-muted); margin: 0; }
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--hairline);
}
.panel-heading h2 { margin: 0; }
.panel-heading .eyebrow { display: none; }
.record-list { display: grid; }
.record { padding: var(--space-5) 0; border-bottom: 1px solid var(--hairline); }
.record:last-child { border-bottom: 0; padding-bottom: 0; }
.record h3 { margin: var(--space-2) 0 var(--space-1); }
.record > p:not(.meta, .form-message) { margin: var(--space-2) 0; }
.record .meta { word-break: break-word; }
.record > .button,
.record > a.button { margin-top: var(--space-3); }
.record > .button + .button { margin-left: var(--space-2); }
.review-box {
  margin-top: var(--space-5);
  padding: var(--space-5);
  background: var(--surface-soft);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}
.review-box .meta { overflow-wrap: anywhere; }
.review-box > .button { margin-top: var(--space-3); }
.command { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-3) var(--space-2) 0 0; }
.command p { flex-basis: 100%; font-size: var(--text-sm); margin: 0 0 var(--space-1); }
/* An operation still running: nothing to press, just where it stands. */
.command.in-flight { gap: var(--space-2); }
.working { display: inline-flex; align-items: center; gap: 0.5em; font-size: var(--text-sm); font-weight: 700; color: var(--lagoon-ink); }
.working .pulse { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--lagoon); box-shadow: 0 0 0 1.5px var(--ink); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.6); opacity: 0.55; } }

/* 7. Turn & status ----------------------------------------------------------
 * .turn is the most important element on a card; .status is the quieter
 * per-record chip. data-tone: you | agency | waiting | failed | done | neutral */
.turn,
.status,
.chip,
.tag {
  --t-bg: var(--neutral-bg);
  --t-fg: var(--neutral-fg);
  --t-dot: var(--neutral-dot);
  --t-border: var(--neutral-border);
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  max-width: 100%;
  border: 1.5px solid var(--t-border);
  border-radius: var(--radius-pill);
  background: var(--t-bg);
  color: var(--t-fg);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.turn { padding: 0.25rem 0.7rem 0.25rem 0.55rem; font-size: var(--text-sm); font-weight: 700; }
.status,
.chip { padding: 0.15rem 0.55rem 0.15rem 0.45rem; font-size: var(--text-xs); font-weight: 700; }
.tag { padding: 0.15rem 0.6rem; font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.01em; border-color: transparent; --t-bg: #fde3d6; --t-fg: #8a3a1c; }
.tag[data-kind="inquiry"] { --t-bg: #e6ddf3; --t-fg: #4e3a70; }
.tag[data-kind="request"] { --t-bg: #d8ecee; --t-fg: #1f5a61; }
.turn::before,
.status::before,
.chip::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--t-dot);
  box-shadow: 0 0 0 1.5px var(--ink);
}
[data-tone="you"]     { --t-bg: var(--you-bg);     --t-fg: var(--you-fg);     --t-dot: var(--you-dot);     --t-border: var(--you-border); }
[data-tone="agency"]  { --t-bg: var(--agency-bg);  --t-fg: var(--agency-fg);  --t-dot: var(--agency-dot);  --t-border: var(--agency-border); }
[data-tone="waiting"] { --t-bg: var(--waiting-bg); --t-fg: var(--waiting-fg); --t-dot: var(--waiting-dot); --t-border: var(--waiting-border); }
[data-tone="failed"]  { --t-bg: var(--failed-bg);  --t-fg: var(--failed-fg);  --t-dot: var(--failed-dot);  --t-border: var(--failed-border); }
[data-tone="done"]    { --t-bg: var(--done-bg);    --t-fg: var(--done-fg);    --t-dot: var(--done-dot);    --t-border: var(--done-border); }
/* Glyphs so state is never colour alone */
.turn[data-tone="waiting"],
.status[data-tone="waiting"] { border-style: dashed; }
.turn[data-tone="waiting"]::before,
.status[data-tone="waiting"]::before { background: transparent; }
.turn[data-tone="failed"]::before,
.status[data-tone="failed"]::before { border-radius: 2px; transform: rotate(45deg); width: 0.45rem; height: 0.45rem; }

/* 8. Feedback -------------------------------------------------------------- */
.form-message {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: var(--text-sm);
}
.notice-error,
.page p[role="alert"],
.sheet p[role="alert"],
.state.error {
  color: var(--failed-fg);
  background: var(--failed-bg);
  border: 1px solid var(--failed-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  margin: var(--space-3) 0;
}
.state { padding: var(--space-6) 0; color: var(--text-muted); margin: 0; }
p[role="status"]:empty { display: none; }
.calm-empty {
  padding: var(--space-5) var(--space-6);
  border: 1.5px dashed var(--edge);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: rgb(255 255 255 / 0.55);
}
.calm-empty p { margin: 0; max-width: 60ch; }
.calm-empty strong { color: var(--ink-soft); }
.empty-state { display: grid; justify-items: center; text-align: center; padding: var(--space-10) var(--space-4) var(--space-6); }
.empty-state h3 { margin: 0 0 var(--space-1); }
.empty-state p { font-size: var(--text-sm); color: var(--text-muted); max-width: 40ch; margin: 0; }
.empty-icon { display: none; }
.center-state,
.sign-in {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-muted);
}
.center-state h1 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-2xl); }
.center-state .button { margin-top: var(--space-4); }
/* Sign-in: the wordmark, with the ribbon's three flat stripes along the top. */
.sign-in { position: relative; }
.sign-in::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--ribbon-band-h);
  background: var(--ribbon-low) left top / var(--ribbon-low-w) var(--ribbon-band-h) repeat-x;
}
.sign-in .brand-name { margin: 0 0 var(--space-6); color: var(--ink); font-size: 3.25rem; }
.sign-in .eyebrow { text-transform: none; letter-spacing: 0.08em; }
.sign-in h1 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-title); letter-spacing: -0.02em; max-width: 18ch; }
.sign-in > p:not(.eyebrow) { max-width: 26rem; font-size: var(--text-lg); line-height: 1.5; }
.sign-in .button { margin-top: var(--space-6); min-width: 14rem; min-height: 3rem; font-size: var(--text-base); }

/* 9. Shell ----------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-2);
  z-index: 50;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-pop);
}
.skip-link:focus { top: var(--space-2); }

/* The header. The slot keeps the full header's place in the flow. The full
 * header (nav row over the ribbon) scrolls away with the page; once it has
 * gone, header.mjs sets html[data-header="slim"] and the same header comes
 * back as a slim fixed bar edged with the three flat stripes (see 13). */
.topbar-slot { position: relative; z-index: 20; height: var(--header-h); }
.topbar { position: relative; height: var(--header-h); }
.topbar-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  max-width: var(--page-max);
  height: calc(var(--ribbon-band-y) + 1.125rem); /* the nav row sits above the low band */
  margin: 0 auto;
  padding: 0 var(--gutter-r) 0 var(--gutter-l);
}

/* The ribbon: one painted strip (.ribbon-art), placed by the page column's
 * right side so the S tops out just before the end cluster (New request, or
 * staff's customer search) and its flats run off both edges of the window up
 * to about 2576px wide; past its ends, seamless tiles carry the flats on
 * (::before the low flat leftwards, ::after the top flat rightwards). */
.ribbon {
  /* the strip's left edge, in the ribbon's own width (cqw: it is a size
   * container), so the art can move by transform alone */
  --ribbon-x: calc(min(100cqw, (100cqw + var(--page-max)) / 2) - var(--gutter-r) - var(--ribbon-end) - 4px - var(--ribbon-s-top));
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  container-type: inline-size;
  contain: strict;
}
/* The painted strip is its own compositor layer, placed by transform: while
 * the window is resized it slides without repainting the header. */
.ribbon-art {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--ribbon-w);
  height: var(--header-h);
  transform: translateX(var(--ribbon-x));
  will-change: transform;
  background: var(--ribbon-image) 0 0 / var(--ribbon-w) var(--header-h) no-repeat;
}
.ribbon::before,
.ribbon::after {
  content: "";
  position: absolute;
  background-repeat: repeat-x;
  transition: opacity 400ms var(--ease);
}
.ribbon::before {
  left: 0;
  right: calc(100% - var(--ribbon-x));
  top: var(--ribbon-band-y);
  height: var(--ribbon-band-h);
  background-image: var(--ribbon-low);
  background-position: right top;
  background-size: var(--ribbon-low-w) var(--ribbon-band-h);
}
.ribbon::after {
  left: calc(var(--ribbon-x) + var(--ribbon-w));
  right: 0;
  top: var(--ribbon-top-y);
  height: var(--ribbon-top-h);
  background-position: left top;
  background-size: var(--ribbon-top-w) var(--ribbon-top-h);
}
/* The strip reaches the right edge of every window narrower than about
 * 2500px (with staff's wider end cluster), so the top flat's tile is fetched
 * only on wider ones. */
@media (min-width: 2400px) {
  .ribbon::after { background-image: var(--ribbon-top); }
}
/* Fun mode's live painter (assets/ribbon/ribbon.mjs, through fun.mjs's
 * setRibbonPainter) paints the strip's columns that show into this canvas,
 * over the art; the painted canvas stays when it is done (.is-painted). */
.ribbon-paint {
  display: none;
  position: absolute;
  top: 0;
  left: calc(var(--ribbon-x) + var(--ribbon-paint-x, 0px));
  width: var(--ribbon-paint-w, 0px);
  height: var(--header-h);
}
.ribbon.is-painting .ribbon-paint,
.ribbon.is-painted .ribbon-paint { display: block; }
.ribbon.is-painting .ribbon-art,
.ribbon.is-painted .ribbon-art { background-image: none; }
.ribbon.is-painting::before,
.ribbon.is-painting::after { opacity: 0; }
/* No end cluster (a viewer): the low flat alone, edge to edge. */
.topbar:not(.has-end) .ribbon-art,
.topbar:not(.has-end) .ribbon-paint,
.topbar:not(.has-end) .ribbon::after { display: none; }
.topbar:not(.has-end) .ribbon::before { right: 0; opacity: 1; }

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 0 var(--space-2) 0 var(--space-1);
  margin-left: calc(-1 * var(--space-1));
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
}
.brand-name { font-family: var(--font-wordmark); font-size: 1.85rem; font-weight: 400; line-height: 1.1; letter-spacing: 0; }
.destinations { display: flex; gap: 2px; }
.dest {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 2.25rem;
  padding: 0 0.8rem 0 0.7rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.dest .icon { width: 1.05rem; height: 1.05rem; stroke-width: 2.2; }
.dest:hover { color: var(--ink); background: var(--hover-tint); }
.dest[aria-current="page"] { color: #fffcf7; background: var(--accent); box-shadow: var(--accent-glow); }
.dest:focus-visible { outline-offset: 2px; }
/* Utilities (workspace, mode, account) sit before the S; the end cluster
 * (New request, or staff's customer search) sits under the swoop. */
.topbar-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.topbar-end {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--ribbon-end);
  margin-left: calc(var(--ribbon-rise) + 32px - var(--space-5)); /* room for the S: its rise and its stripes' spread */
}
/* Staff's customer search narrows with the window (10–14rem) so the nav row
 * always fits; the S follows it. */
.app-staff { --ribbon-end: clamp(10rem, 24vw - 6rem, 14rem); }
.topbar-end .jump,
.topbar-end .jump input[type="search"] { width: 100%; }
.workspace-switch { width: auto; max-width: 14rem; min-height: 2.25rem; font-size: var(--text-sm); font-weight: 600; }

/* Business / Fun: two icons in one pill; the pressed one is the mode. */
.mode-toggle { display: inline-flex; gap: 2px; padding: 2px; border: 1.5px solid var(--edge); border-radius: var(--radius-pill); background: var(--surface); }
.mode-option { display: grid; place-items: center; width: 2rem; height: 1.75rem; padding: 0; border: 0; border-radius: var(--radius-pill); background: none; color: var(--text-muted); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.mode-option .icon { width: 1.05rem; height: 1.05rem; stroke-width: 2; }
.mode-option:hover { color: var(--ink); background: var(--hover-tint); }
.mode-option[aria-pressed="true"] { background: var(--ink); color: #fffcf7; }
.mode-option.fun[aria-pressed="true"] { background: var(--marigold); color: var(--ink); }
.mode-option:focus-visible { outline-offset: 1px; }

.account-menu { position: relative; }
.account-menu > summary { list-style: none; display: block; border-radius: 50%; }
.account-menu > summary::-webkit-details-marker { display: none; }
.avatar {
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 50%;
  background: var(--face-bg);
  border: 1.5px solid var(--edge);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 700;
}
.account-menu[open] .avatar { border-color: var(--lagoon); }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  z-index: 30;
  width: 17rem;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
}
.menu-who { display: grid; gap: 2px; padding: var(--space-2) var(--space-3) var(--space-3); border-bottom: 1px solid var(--hairline); margin-bottom: var(--space-1); }
.menu-who strong { font-size: var(--text-sm); color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.menu-who .meta { margin: 0; font-size: var(--text-xs); }
.menu-item,
.menu .logout .nav-item {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: left;
}
.menu-item:hover,
.menu .logout .nav-item:hover { background: var(--cream); color: var(--ink); }
.menu .logout p { font-size: var(--text-xs); color: var(--failed-fg); padding: 0 var(--space-3); }

.jump { position: relative; }
.jump input[type="search"] { width: 15rem; min-height: 2.25rem; padding-left: 1rem; padding-right: 2rem; border-radius: var(--radius-pill); font-size: var(--text-sm); background-color: var(--surface); }
.jump-key {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 0.35rem;
  border: 1px solid var(--edge);
  border-radius: 6px;
  color: var(--text-faint);
  font-size: var(--text-xs);
  pointer-events: none;
}
.jump-results {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  z-index: 30;
  width: 100%;
  min-width: 16rem;
  padding: var(--space-1);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
}
.jump-result {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  font-size: var(--text-sm);
  color: var(--ink);
}
.jump-result:hover,
.jump-result:focus-visible { background: var(--cream); }
.jump-result .meta { margin: 0; }
.jump-empty { padding: var(--space-2) var(--space-3); font-size: var(--text-sm); color: var(--text-muted); margin: 0; }

.staff-strip { background: var(--strip-bg); color: var(--strip-fg); border-bottom: 1px solid var(--edge); }
.staff-strip-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-2) var(--gutter-r) var(--space-2) var(--gutter-l);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.staff-strip-who { display: flex; align-items: baseline; gap: var(--space-2); flex: none; font-size: var(--text-sm); }
.staff-flag { padding: 0.05rem 0.55rem; border-radius: var(--radius-pill); background: var(--ink); color: #fdebd0; font-size: var(--text-2xs); font-weight: 800; letter-spacing: 0.04em; }
.staff-strip-who strong { color: var(--ink); }
.staff-strip-who .meta { color: var(--strip-muted); margin: 0; font-size: var(--text-xs); }
.strip-tabs { display: flex; align-items: center; gap: 2px; flex: none; }
.strip-tab {
  height: 2rem;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 700;
  white-space: nowrap;
}
.strip-tab:hover { color: var(--ink); background: rgb(74 46 34 / 0.07); }
.strip-tab[aria-current="page"] { color: #fffcf7; background: var(--ink); }
.strip-tab.staff-only:not([aria-current="page"]) { color: var(--lagoon-ink); }
.strip-divider { width: 1.5px; height: 1.25rem; background: var(--edge); margin: 0 var(--space-2); }

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--page-pad-top) var(--gutter-r) var(--space-16) var(--gutter-l);
  outline: none;
}
.app-staff .page { font-size: var(--text-sm); }
.page-header { margin-bottom: var(--space-8); }
.tabbar,
.fab { display: none; }
.icon { flex: none; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--overlay);
  animation: fade-in var(--dur) var(--ease);
}
.sheet {
  position: fixed;
  z-index: 41;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(36rem, 100%);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-left: 1px solid var(--edge);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: var(--shadow-pop);
  animation: slide-in 200ms var(--ease);
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--hairline);
}
.sheet-head h2 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-2xl); letter-spacing: -0.02em; margin: 0; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-6); }
.sheet-body .panel { border: 0; background: none; padding: 0; margin: 0; max-width: none; }
.sheet-body .panel > .eyebrow,
.sheet-body .panel > h2 { display: none; }
.sheet .lede { font-size: var(--text-lg); color: var(--ink-soft); margin-bottom: var(--space-5); }
.sheet label { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); margin: var(--space-4) 0 var(--space-1); }
.sheet details { border: 1px solid var(--edge); border-radius: var(--radius-sm); background: var(--surface); padding: 0 var(--space-4); margin: var(--space-4) 0; }
.sheet details[open] { padding-bottom: var(--space-4); }
.choice-grid { display: grid; gap: var(--space-3); }
.choice {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-5);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.choice:hover { border-color: var(--accent); background: #fff8f3; }
.choice strong { font-size: var(--text-lg); font-weight: 800; color: var(--ink); }
.choice span { color: var(--text-muted); font-size: var(--text-sm); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes rise-in { from { transform: translateY(24px); opacity: 0; } }

/* 10. Home ----------------------------------------------------------------- */
.home-header .greeting { margin-bottom: var(--space-3); }
.home-header .subtitle { color: var(--ink-soft); }
.home-section { margin-bottom: var(--space-10); }
.section-title { font-size: var(--text-lg); font-weight: 800; margin: 0 0 var(--space-4); }
.section-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
.section-head-row .section-title { margin-bottom: var(--space-4); }
.need-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17.5rem, 100%), 1fr)); gap: var(--space-4); }
.need-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-6) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}
.need-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: 100%; margin-bottom: var(--space-2); }
.need-top .meta { margin: 0; }
.need-eyebrow { font-size: var(--text-sm); color: var(--text-muted); margin: 0; }
.need-card h3 { font-size: var(--text-lg); line-height: 1.3; margin: 0; }
.need-body { color: var(--text); margin: 0 0 var(--space-3); flex: 1; }
.need-foot .button { margin-top: 0; }
.need-question {
  margin: var(--space-1) 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--you-border);
  background: var(--you-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}
.need-answer { margin-bottom: var(--space-3); min-height: 4.5rem; }
.need-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: auto; }
.need-actions .button { margin-top: 0; }
.need-card .form-message { margin: var(--space-2) 0 0; width: 100%; }

.home-columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--space-8); align-items: start; }
.progress-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.progress-row + .progress-row { border-top: 1px solid var(--hairline); }
.row-button {
  display: grid;
  gap: var(--space-1);
  width: 100%;
  padding: var(--space-4) var(--space-5);
  border: 0;
  background: none;
  text-align: left;
  transition: background-color var(--dur) var(--ease);
}
.row-button:hover { background: var(--surface-soft); }
.row-button:focus-visible { outline-offset: -3px; }
.row-top { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); }
.row-top .turn { font-size: var(--text-xs); padding: 0.15rem 0.55rem 0.15rem 0.45rem; }
.row-when { margin: 0 0 0 auto; font-size: var(--text-xs); }
.row-title { color: var(--ink); font-size: var(--text-base); font-weight: 600; }
.row-status { color: var(--ink-soft); font-size: var(--text-sm); }
.row-next { color: var(--text-muted); font-size: var(--text-sm); }

.live-dot { width: 0.625rem; height: 0.625rem; margin-top: 0.4rem; border-radius: 50%; border: 1.5px solid var(--waiting-dot); flex: none; }
.live-dot.on { background: var(--agency-dot); border-color: var(--agency-dot); box-shadow: 0 0 0 3px rgb(47 126 134 / 0.2); }

.checklist { list-style: none; margin: 0; padding: 0; }
.check { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); }
.check + .check { border-top: 1px solid var(--hairline); }
.check > div { flex: 1; min-width: 0; }
.check strong { color: var(--ink); }
.check .meta { margin: 2px 0 0; }
.check-mark { position: relative; width: 1.25rem; height: 1.25rem; flex: none; border-radius: 50%; border: 1.5px solid var(--edge-strong); }
/* Done: a teal check and muted words, never struck through. */
.check.done .check-mark { background: var(--lagoon); border-color: var(--lagoon); }
.check.done .check-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 45%;
  width: 0.3rem;
  height: 0.58rem;
  border: solid #fffcf7;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}
.check.done strong { color: var(--text-muted); font-weight: 600; text-decoration: none; }

/* 11. Inbox and lists ------------------------------------------------------ */
.inbox-bar { display: flex; justify-content: flex-end; margin: calc(-1 * var(--space-4)) 0 var(--space-6); }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1.5px solid var(--edge); border-radius: var(--radius-pill); background: var(--surface); }
.segmented button {
  min-height: 2rem;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 700;
}
.segmented button:hover { color: var(--ink); background: var(--hover-tint); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: #fffcf7; }
.inbox-group { margin-bottom: var(--space-8); }
.group-head { display: flex; align-items: baseline; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-3); }
.group-head h2 { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); font-weight: 800; margin: 0; }
.group-head .meta { margin: 0; font-size: var(--text-xs); }
.count {
  min-width: 1.5rem;
  padding: 0 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: var(--text-xs);
  font-weight: 700;
  text-align: center;
  line-height: 1.5rem;
}
.inbox-group[data-group="Urgent"] .count { background: var(--failed-bg); color: var(--failed-fg); }
.inbox-rows,
.row-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden; }
.list-card { padding: 0; }
.list-card .row-list { border: 0; }
.inbox-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) minmax(0, 1fr) 8.5rem auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
}
.inbox-row + .inbox-row,
.row + .row { border-top: 1px solid var(--hairline); }
.inbox-row.view-only .inbox-what strong { font-weight: 500; }
.inbox-row.overdue::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--failed-dot); }
.inbox-customer { font-weight: 600; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-what { display: grid; min-width: 0; }
.inbox-what strong { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-what .meta { margin: 0; font-size: var(--text-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-since { color: var(--text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.overdue-flag { color: var(--failed-fg); font-weight: 700; }
.inbox-empty { margin-top: var(--space-2); }
.row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-5); }
.row-main { display: grid; min-width: 0; }
.row-main strong { color: var(--ink); }
.row-main .meta { margin: 0; font-size: var(--text-xs); }

/* 12. Capability components hosted in the new views ------------------------ */
.legacy-section + .legacy-section { margin-top: var(--space-2); }
.form-panel { max-width: 46rem; }
.form-panel > .muted { margin-bottom: var(--space-2); }
.form-panel form { display: grid; margin-top: var(--space-5); }
.form-panel form > .button[type="submit"] { justify-self: start; margin-top: var(--space-5); }
.region-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-3); }
.page .region-grid label,
.sheet .region-grid label { display: grid; gap: var(--space-1); margin: 0; font-size: var(--text-xs); }
.preview-shell { position: relative; }
.preview-frame { display: block; width: 100%; height: clamp(22rem, 62svh, 40rem); margin: var(--space-5) 0; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--surface); }
.preview-overlay { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; pointer-events: all; }
.preview-overlay rect { pointer-events: none; }
.paste-zone {
  margin-top: var(--space-3);
  padding: var(--space-4);
  border: 1.5px dashed var(--edge);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-align: center;
}
.paste-zone:focus-visible { outline: none; border-color: var(--focus); box-shadow: var(--field-ring); }

/* 12b. Show, don't tell: shared pictures -------------------------------- */
.monogram {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  border: 1.5px solid rgb(74 46 34 / 0.45);
  background: var(--face-bg);
  color: var(--ink);
  font-size: var(--text-2xs);
  font-weight: 800;
}
.face {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--face-bg);
  color: var(--face-ink);
  border: 1.5px solid rgb(74 46 34 / 0.45);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.face.empty { background: transparent; border: 1.5px dashed rgb(74 46 34 / 0.55); }
.turn .face { width: 1.25rem; height: 1.25rem; margin-left: -0.3rem; border: 0; background: var(--surface); }
.turn:has(.face)::before { display: none; }
.turn.small { font-size: var(--text-xs); padding: 0.1rem 0.5rem 0.1rem 0.4rem; }

.track { display: inline-flex; align-items: center; flex: none; gap: 2px; padding: 2px 3px; border: 1.5px solid rgb(74 46 34 / 0.45); border-radius: var(--radius-pill); background: var(--surface); }
.stop { width: 13px; height: 8px; border-radius: var(--radius-pill); background: var(--paper-deep); }
.stop.done { background: var(--lagoon); }
.stop.now { background: var(--marigold); }

.thumb { position: relative; margin: 0; overflow: hidden; border-radius: 12px; border: 1px solid var(--edge); background: var(--surface-soft); }
.thumb svg { display: block; width: 100%; height: auto; }
.thumb rect.changed,
.before-after rect.changed { fill: var(--changed-fill); stroke: var(--changed-stroke); stroke-width: 4; stroke-dasharray: 14 10; }
.thumb-badge {
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-3);
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: 700;
  box-shadow: 0 1px 3px rgb(74 46 34 / 0.35);
}
.thumb.placeholder { display: grid; place-items: center; aspect-ratio: 1 / 0.62; }
.page-outline { width: 46%; height: 64%; border: 1.5px dashed var(--edge); border-radius: 8px; position: relative; }
.page-outline::before,
.page-outline::after { content: ""; position: absolute; left: 12%; height: 0.35rem; border-radius: 2px; background: var(--hairline); }
.page-outline::before { top: 18%; right: 30%; }
.page-outline::after { top: 34%; right: 12%; }
.pin rect { fill: var(--changed-fill); stroke: var(--pin); stroke-width: 4; stroke-dasharray: 14 10; }
.pin circle { fill: var(--pin); stroke: var(--pin-ink); stroke-width: 4; }
.pin text { fill: var(--pin-ink); font: 700 26px var(--font-ui); }

.before-after { margin: 0 0 var(--space-4); }
.before-after svg { display: block; width: 100%; height: auto; max-height: 64vh; max-height: 64svh; border-radius: 12px; border: 1px solid var(--edge); background: var(--surface-soft); }
.ba-line { stroke: var(--accent); stroke-width: 4; }
.ba-stage { position: relative; }
.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  appearance: none;
  background: transparent;
}
/* Markable: the page takes marks; only the handle moves the divider (region.mjs). */
.ba-stage.markable .ba-range { pointer-events: none; }
.ba-stage.markable svg { cursor: crosshair; touch-action: none; }
.ba-stage.markable .ba-handle { cursor: ew-resize; }
.ba-handle circle { fill: var(--surface); stroke: var(--accent); stroke-width: 4; }
.ba-handle path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.ba-stage:focus-within .ba-handle circle { stroke-width: 8; stroke: var(--focus); }
.ba-legend { margin-top: var(--space-2); }
.review-size { margin-bottom: var(--space-3); }
.review-stage.phone { max-width: 24rem; margin: 0 auto; }
.ba-legend { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--text-muted); }

.board { max-height: 70vh; max-height: 70svh; overflow: auto; border-radius: 12px; border: 1px solid var(--edge); background: var(--surface-soft); }
.board svg { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: none; }
.board-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: var(--space-2) 0; }
.board-tools .meta { margin: 0; }
.confirm-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }
.money-field { display: flex; align-items: center; gap: var(--space-2); }
.money-field input { flex: 1; font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.money-unit { font-weight: 700; color: var(--ink-soft); }
.edit-position { margin-top: var(--space-2); }

.warn-glyph {
  display: inline-block;
  width: 0.8rem;
  height: 0.72rem;
  margin-right: 0.3rem;
  vertical-align: -0.05rem;
  background: var(--warn);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.icon-link {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  font-size: var(--text-base);
}
.icon-link:hover { background: var(--hover-tint); color: var(--ink); }

.empty-art { display: inline-block; flex: none; width: 2.75rem; height: 2.25rem; border-radius: 8px; border: 1.5px solid var(--edge-strong); position: relative; background: var(--surface); }
.empty-art::before,
.empty-art::after { content: ""; position: absolute; left: 0.45rem; right: 0.45rem; height: 0.2rem; border-radius: 2px; background: var(--hairline); }
.empty-art::before { top: 0.6rem; }
.empty-art::after { top: 1.15rem; right: 1.1rem; }
.empty-art.tray { border-top-color: transparent; border-radius: 0 0 8px 8px; }
.calm-empty.illustrated { display: flex; align-items: center; gap: var(--space-4); }
.quiet-line { color: var(--text-muted); margin: calc(-1 * var(--space-4)) 0 var(--space-8); }

/* Toggles (switches) */
.toggle { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); cursor: pointer; margin: 0; }
.page .toggle,
.sheet .toggle { display: inline-flex; margin: 0; }
.toggle input { appearance: none; width: 2rem; height: 1.15rem; margin: 0; border-radius: var(--radius-pill); background: #c9b8ab; position: relative; transition: background-color var(--dur) var(--ease); cursor: pointer; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.15rem - 4px); height: calc(1.15rem - 4px); border-radius: 50%; background: var(--surface); transition: transform var(--dur) var(--ease); }
.toggle input:checked { background: var(--lagoon); }
.toggle input:checked::after { transform: translateX(0.85rem); }
.toggle.warm input:checked { background: var(--marigold); }
.toggle .warn-glyph { margin: 0; }
.toggle:not(.on) .warn-glyph { background: var(--text-faint); }

/* Reply: the one box under a question */
.reply { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.reply textarea { min-height: 4.5rem; }
.reply.compact textarea { min-height: 3.5rem; }
.reply.internal textarea { border-style: dashed; border-color: var(--you-dot); background: var(--you-soft); }
.reply-bar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-3); }
.reply-bar .toggle { margin-right: auto; }

/* Home, revised */
.needs-label { font-size: var(--text-lg); color: var(--ink-soft); margin: 0; }
.need-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); gap: var(--space-4); align-items: start; margin-bottom: var(--space-10); }
.need-card { display: grid; gap: var(--space-3); padding: var(--space-4); background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); }
.need-card.warm { background: var(--you-soft); border-color: var(--you-border); }
.need-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.need-foot h3 { margin: 0; font-size: var(--text-base); font-weight: 800; }
.need-foot.end { justify-content: flex-end; }
.need-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.need-top h3 { margin: var(--space-1) 0 0; }
.need-question { display: flex; gap: var(--space-2); align-items: flex-start; margin: 0; padding: var(--space-3); border-radius: var(--radius-sm); background: var(--you-soft); border: 0; color: var(--ink-soft); }
.need-card .reply { margin-top: 0; }
.need-card.terms { padding: var(--space-5); }
.amounts { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
.amount { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-amount); line-height: 1; letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.amount-sep { color: var(--text-faint); }
/* The first amount leads; later ones read "then $99/mo", quietly. */
.amounts .amount ~ .amount { font-family: var(--font-ui); font-size: var(--text-base); font-weight: 600; letter-spacing: 0; color: var(--text-muted); }
.amounts .amount-sep { font-size: 0; }
.amounts .amount-sep::after { content: "then"; font-size: var(--text-base); color: var(--text-muted); }
.scope { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: var(--text-sm); display: grid; gap: 4px; }
.scope li::marker { color: var(--lagoon); }

.progress-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden; }
.progress-row.warm { background: var(--you-soft); }
.row-line { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.row-line .row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-when { flex: none; color: var(--text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.row-reason { color: var(--text-muted); font-size: var(--text-sm); padding-left: calc(67px + var(--space-3)); } /* under the title: the track is 67px */

.site-card { display: grid; gap: var(--space-2); width: 100%; padding: 0; margin-bottom: var(--space-4); border: 0; background: none; text-align: left; color: inherit; }
.site-card .thumb { transition: border-color var(--dur) var(--ease); }
.site-card:hover .thumb { border-color: var(--edge-strong); }
.site-name { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.site-name strong { color: var(--ink); }
.site-name .meta { margin: 0; font-size: var(--text-xs); }

/* Requests */
.request-group { margin-bottom: var(--space-8); }
.request-group .section-title { display: flex; align-items: center; gap: var(--space-2); }

/* Site */
.site-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.site-tools { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.site-choice { display: inline-flex; gap: var(--space-1); flex-wrap: wrap; }
.site-choice button { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 2rem; padding: 0 var(--space-3) 0 var(--space-1); border: 1.5px solid var(--edge); border-radius: var(--radius-pill); background: var(--surface); font-size: var(--text-sm); font-weight: 700; color: var(--ink-soft); }
.site-choice button[aria-checked="true"] { border-color: var(--lagoon); background: var(--accent-soft); color: var(--accent-ink); }
.site-stage { margin-bottom: var(--space-10); }
.site-stage.phone { max-width: 24rem; margin-left: auto; margin-right: auto; }
/* Site: the preview first (sticky on wide screens), the version's files beside it. */
.site-review { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; margin-bottom: var(--space-10); }
.site-review.solo { grid-template-columns: minmax(0, 1fr); }
.site-review .site-stage { margin-bottom: 0; }
.site-preview-col { position: sticky; top: var(--space-3); display: grid; gap: var(--space-2); min-width: 0; }
@media (max-width: 960px) { .site-review { grid-template-columns: minmax(0, 1fr); } .site-preview-col { position: static; } }
.site-frame { border: 1px solid var(--edge); border-radius: 14px; overflow: hidden; background: var(--surface); }
.site-chrome { display: flex; align-items: center; gap: var(--space-2); padding: 6px var(--space-3); border-bottom: 1px solid var(--hairline); font: var(--text-xs) var(--font-mono); color: var(--text-muted); }
.site-chrome .dots { display: flex; gap: 5px; }
.site-chrome .dots i { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--hairline-strong); }
.site-chrome .button.small { padding-block: 2px; font-family: var(--font-sans); }
.site-chrome .url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.script-badge { font: 700 var(--text-2xs) var(--font-sans); text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--marigold); color: #3a2408; }
.site-stage.live { display: grid; justify-items: center; height: min(72vh, 640px); background: var(--paper); max-width: none; }
.site-stage.live iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.site-stage.live.phone iframe { width: 390px; max-width: 100%; border-inline: 1px solid var(--hairline); }
.site-caption { display: flex; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; margin: 0; font-size: var(--text-sm); color: var(--text-muted); }
.site-caption strong { color: var(--ink); font-weight: 700; }
.site-effect { min-height: 1.4em; margin: 0; font-size: var(--text-sm); font-weight: 700; color: var(--lagoon-ink); }
.site-files { display: grid; gap: var(--space-4); min-width: 0; }
.site-files-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.site-files-head .section-title { margin: 0; }
.site-files-legend { display: flex; gap: var(--space-3); font-size: var(--text-xs); color: var(--text-muted); }
.site-files-legend span::before, .file-dot { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: var(--terracotta); }
.site-files-legend [data-state="new"]::before, .file-row[data-state="new"] .file-dot { background: var(--lagoon); }
.file-group h3 { margin: 0 0 6px; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.file-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; }
.file-row + .file-row { border-top: 1px solid var(--hairline); }
.file-button { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: 10px var(--space-3); cursor: pointer; }
.file-button:hover, .file-row.active .file-button { background: var(--accent-soft); }
.file-button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.file-type { font: 700 10px var(--font-mono); color: var(--text-muted); text-align: center; }
.file-name { min-width: 0; }
.file-path { display: block; font: 600 var(--text-sm) var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.file-name small { display: block; font-size: var(--text-xs); color: var(--text-muted); }
.file-state { font-size: var(--text-2xs); font-weight: 700; padding: 3px 8px; border-radius: var(--radius-pill); white-space: nowrap; color: var(--text-muted); }
.file-state[data-state="changed"] { background: #f6e1d6; color: #9b3b1d; }
.file-state[data-state="new"] { background: var(--accent-soft); color: var(--lagoon-ink); }
.file-viewer { border-top: 1px dashed var(--hairline-strong); background: #fffdf9; }
.file-tools { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding: var(--space-2) var(--space-3); margin: 0; }
.file-links { display: flex; gap: var(--space-2); }
.segmented.small button { font-size: var(--text-xs); padding: 3px 10px; }
.file-image { display: grid; place-items: center; padding: var(--space-3); }
.file-image img { max-width: 100%; max-height: 240px; border-radius: 8px; border: 1px solid var(--hairline); }
.code { max-height: 360px; overflow: auto; padding-bottom: var(--space-2); font: 12.5px/1.6 var(--font-mono); }
.code:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.code table { border-collapse: collapse; width: 100%; }
.code td { padding: 0; vertical-align: top; }
.code td.src { white-space: pre-wrap; overflow-wrap: anywhere; padding-right: var(--space-3); color: var(--ink); }
.code td.ln { width: 1%; padding: 0 10px 0 var(--space-3); text-align: right; color: var(--text-faint); user-select: none; white-space: nowrap; }
.code td.sign { width: 1%; padding-right: 6px; user-select: none; }
.code tr.add { background: #e3f2e6; } .code tr.add td.sign { color: #1e6b33; }
.code tr.del { background: #fbe3e0; } .code tr.del td.sign { color: #9b2c1e; }
.code tr.gap td { color: var(--text-muted); font-style: italic; padding-block: 2px; }
.code-more { padding: 0 var(--space-3); }
.t-tag { color: #9b3b1d; } .t-attr { color: #1f6f75; } .t-str { color: #5b6b2f; } .t-com { color: #8a7a6d; font-style: italic; } .t-key { color: #6b3fa0; } .t-num { color: #a35f00; }
.site-files-note kbd { border: 1px solid var(--hairline-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface); }
.new-version { display: grid; grid-template-columns: minmax(0, 14rem) 1fr; gap: var(--space-5); align-items: center; padding: var(--space-4); margin-bottom: var(--space-6); background: var(--you-soft); border: 1px solid var(--edge); border-radius: var(--radius); }
.new-version-text { display: grid; gap: var(--space-2); justify-items: start; }
.new-version-text strong { color: var(--ink); font-size: var(--text-lg); font-weight: 800; }
.materials { margin-top: var(--space-6); }
/* Site → Materials: add first, then the files, newest first. */
.material-add { display: grid; gap: var(--space-3); padding: var(--space-5) var(--space-6); margin-bottom: var(--space-4); background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); }
.material-add-head h3 { margin: 0; font-size: var(--text-lg); font-weight: 800; color: var(--ink); }
.material-add-head .meta { margin: 2px 0 0; }
.material-form { display: grid; gap: var(--space-2); max-width: 40rem; }
.material-form label:not(.button) { font-size: var(--text-sm); font-weight: 700; color: var(--ink-soft); margin-top: var(--space-1); }
/* Ask them: one short box per question, the question as its label. */
.ask-her-question { margin-top: var(--space-4); }
.ask-her-question label { display: block; margin-bottom: var(--space-1); font-weight: 600; }
.ask-her-question textarea { width: 100%; min-height: 3.2em; }
.ask-her .builder-choice { margin-top: var(--space-5); }
/* Room for the longest line, so Start work stays put as the defaults load. */
.command .builder-line { min-height: 2lh; }
.material-pick { position: relative; display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.material-pick input[type="file"] { top: 0; left: 0; }
/* Before you go: the AI's homework on a draft's card. */
.homework-group { margin-top: var(--space-4); }
.homework-group h3 { font-size: 1rem; margin: 0 0 var(--space-2); }
.homework-group ul { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-1); }
.material-pick label.button { display: inline-flex; align-items: center; cursor: pointer; }
.material-pick:focus-within label.button { box-shadow: var(--focus-ring); }
.material-chosen { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-form .paste-zone { padding: var(--space-3); font-size: var(--text-sm); }
.material-form #paste-status { margin: 0; min-height: 0; }
.material-form #paste-status:empty { display: none; }
.material-form .form-actions { margin-top: var(--space-2); }
.material-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden; }
.material { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-5); }
.material + .material { border-top: 1px solid var(--hairline); }
.material-thumb { position: relative; display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 12px; overflow: hidden; background: var(--cream); border: 1px solid var(--edge); color: var(--ink-soft); }
.material-thumb[data-kind="image"] { background: #dcedf1; color: var(--lagoon-ink); }
.material-thumb[data-kind="pdf"] { background: #fde3d6; color: #8a3a1c; }
.material-thumb img { width: 100%; height: 100%; object-fit: cover; }
.material-thumb .icon { width: 1.5rem; height: 1.5rem; }
.material-ext { position: absolute; bottom: 3px; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.04em; }
.material-thumb:has(.material-ext) .icon { margin-bottom: 0.6rem; }
.material-main { min-width: 0; }
.material-name { display: block; color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-main .meta { margin: 2px 0 0; font-size: var(--text-xs); }
.material-rights { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.quiet { border-color: transparent; font-weight: 600; }
.material-review { grid-column: 2 / -1; display: grid; gap: var(--space-2); }
.material-review summary { cursor: pointer; font-size: var(--text-sm); font-weight: 700; color: var(--lagoon-ink); }
.material .form-message { grid-column: 2 / -1; margin: 0; }

/* Terms in their thread */
.terms-card { display: grid; gap: var(--space-3); }
.terms-card .entry-meta .chip { margin-left: auto; }
.terms-card .amount { font-size: 2rem; }
.terms-entry.open .terms-card { border: 1.5px solid var(--you-border); background: var(--you-soft); }
.terms-detail { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-4); margin: 0; font-size: var(--text-sm); }
.terms-detail dt { color: var(--text-muted); font-weight: 600; }
.terms-detail dd { margin: 0; color: var(--ink); }
.terms-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.terms-confirm { flex-basis: 100%; margin: 0; color: var(--ink); font-weight: 600; }

/* Terms on Account → Plan & billing: the server's words, money as currency */
.quote-card .quote-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.quote-card .quote-price { margin: var(--space-2) 0 var(--space-1); font-size: var(--text-lg); }
.quote-card .terms-detail { margin: var(--space-3) 0; }

/* An erasure request, in its thread and on Account */
.tag[data-kind="erasure"] { --t-bg: #ece6dc; --t-fg: var(--ink); }
.erasure-note { margin: var(--space-3) 0 0; font-size: var(--text-sm); color: var(--ink-soft); }
.erasure-asked { border-color: var(--you-border); background: var(--you-soft); }

/* Inbox, revised */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.title-row .page-title { margin: 0; }
.group-title { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); font-weight: 800; margin: 0 0 var(--space-3); }
.inbox-row { display: block; padding: 0; }
/* Past due: the ▲ and the age in the accent, no row fill (in real data most
 * rows are due, and the Urgent group already sets apart what's urgent). */
.inbox-row[data-warm="due"] .inbox-age { color: var(--accent); font-weight: 700; }
.inbox-row[data-warm="due"] .warn-glyph { background: var(--accent); }
.inbox-link {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr) 4.5rem 1.5rem 3.25rem;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-3) var(--space-5);
  border: 0;
  background: none;
  text-align: left;
  font-size: var(--text-sm);
  color: inherit;
  transition: background-color var(--dur) var(--ease);
}
.inbox-link:hover { background: var(--hover-tint); }
.inbox-link:focus-visible { outline-offset: -3px; }
.inbox-customer { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-weight: 600; color: var(--ink-soft); }
.inbox-customer span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-thumb .thumb { border-radius: 8px; }
.inbox-age { justify-self: end; color: var(--text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Thread */
.thread { max-width: 46rem; }
.thread.with-panel { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--space-8); align-items: start; }
.thread-head { margin-bottom: var(--space-6); }
.thread-state { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.thread-reason { margin: var(--space-3) 0 0; color: var(--ink-soft); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.entry .bubble { padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); }
.entry.from-customer .bubble { margin-left: var(--space-10); background: var(--cream); border-bottom-right-radius: 6px; }
.entry.from-agency .bubble { border-bottom-left-radius: 6px; }
.entry.from-agency .bubble { margin-right: var(--space-10); }
.entry.internal .bubble { margin-right: var(--space-10); background: var(--you-soft); border: 1.5px dashed var(--marigold); }
.entry-meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: 0 0 var(--space-2); font-size: var(--text-xs); color: var(--text-muted); }
.entry-meta .who { font-weight: 800; color: var(--ink); }
.internal-flag { margin-left: auto; padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--you-bg); color: var(--you-fg); font-weight: 700; }
.entry .bubble > strong { display: block; color: var(--ink); margin-bottom: var(--space-1); }
.entry .bubble p.question { font-size: var(--text-lg); color: var(--ink); }
.entry .thumb { margin: var(--space-2) 0 var(--space-3); }
.entry-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.entry.receipt { text-align: center; font-size: var(--text-sm); color: var(--text-muted); }
.entry.receipt p { display: inline-flex; align-items: center; gap: var(--space-2); margin: 0; }
.receipt-mark { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--agency-dot); }
.receipt-mark.live { box-shadow: 0 0 0 3px var(--agency-bg); }
.quiet-actions { margin-top: var(--space-8); opacity: 0.55; transition: opacity var(--dur) var(--ease); }
.quiet-actions:hover,
.quiet-actions:focus-within { opacity: 1; }
.staff-panel { position: sticky; top: calc(var(--topbar-h) + var(--space-6)); display: grid; gap: var(--space-4); }
.panel-block { padding: var(--space-4); background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); }
.panel-block h2 { font-size: var(--text-2xs); color: var(--text-muted); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 var(--space-3); }
.panel-block .review-box { margin-top: 0; padding: 0; border: 0; background: none; }
.handoff p { margin: 0 0 var(--space-2); }
.handoff code { overflow-wrap: anywhere; font-size: var(--text-2xs); }
.owner { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); }
/* Owner: Take it first, someone else quietly; once owned, the face, the name and Reassign. */
.owner-name { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.owner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.owner-pick { display: grid; gap: var(--space-2); }
.owner-pick label { font-size: var(--text-sm); font-weight: 700; color: var(--ink-soft); }

/* Sheets, revised: primary rightmost; bottom on phones */
.sheet.wide { width: min(76rem, 100%); }
.sheet-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--hairline); background: var(--cream); }
.sheet-foot .button.ghost:first-child { margin-right: auto; }
.confirm-line { margin: var(--space-4) 0 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-ink); }
.live-preview { margin-top: var(--space-4); }
.compose { display: grid; gap: var(--space-6); }
.sheet.wide .compose { grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 1fr); align-items: start; }
.compose-form { display: grid; gap: var(--space-4); align-content: start; }
.context-line { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
.compose-text { min-height: 9rem; font-size: var(--text-lg); }
.compose-quiet { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1); margin-top: calc(-1 * var(--space-2)); }
.compose-options { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
/* Dictation (voice.mjs, the review overlay's on-device engine and look). While listening: a red edge that breathes
   with your voice, an equalizer under the field, live words in grey that fade to ink as each phrase locks in,
   and dots while the last phrase settles. The mic shows a blue dot until the model is downloaded, a blue ring
   while it downloads, red while recording. */
.dictate-field { display: grid; }
.dictate-box { position: relative; --lv: 0; }
.dictate-box textarea { padding-right: 2.75rem; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color .6s; }
.dictate-box.live textarea { border-color: #ef4444; box-shadow: 0 0 0 2px rgb(239 68 68 / calc(.12 + var(--lv, 0) * .35)); caret-color: transparent; background-color: #fffafa; padding-bottom: 1.6rem; color: transparent; }
.dictate-box.live:not(.heard) textarea::placeholder { color: transparent; }
.dictate-box.live::after { content: ''; position: absolute; right: .7rem; bottom: .55rem; width: 17px; height: 11px; pointer-events: none;
  background: linear-gradient(#ef4444, #ef4444) 0 100% / 3px 40% no-repeat, linear-gradient(#ef4444, #ef4444) 7px 100% / 3px 40% no-repeat, linear-gradient(#ef4444, #ef4444) 14px 100% / 3px 40% no-repeat;
  transform: scaleY(calc(.5 + var(--lv, 0) * .9)); transform-origin: bottom; animation: dictate-eq .9s ease-in-out infinite; }
.dictate-box.live.settling::after { background: radial-gradient(circle, #ef4444 1.6px, transparent 2px) 0 50% / 6px 6px repeat-x; height: 6px; transform: none; animation: dictate-breathe .7s ease-in-out infinite; }
.dictate-mirror { position: absolute; box-sizing: border-box; border-style: solid; border-color: transparent; padding-bottom: 1.6rem !important; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: break-word; overflow: hidden; pointer-events: none; text-align: left; }
.dictate-mirror .tent { color: #a9a3b6; }
.dictate-mirror .fresh { animation: dictate-ink .45s ease-out; }
.dictate-mirror .caret { display: inline-block; width: 2px; height: 1.15em; margin: 0 1px -.2em; background: #ef4444; border-radius: 1px; animation: dictate-blink 1s steps(2, start) infinite; }
.dictate-box.settling .dictate-mirror .caret { display: none; }
.dictate-mic { position: absolute; right: .4rem; top: .4rem; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-muted);
  display: grid; place-items: center; cursor: pointer; --p: 0; --lv: 0; }
.dictate-mic:hover { background: var(--hover-tint); color: var(--ink); }
.dictate-mic:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.dictate-mic.dl::after { content: ''; position: absolute; right: 3px; bottom: 3px; width: 7px; height: 7px; border-radius: 50%; background: #2563eb; border: 1.5px solid #fff; }
.dictate-mic.rec { background: #ef4444; color: #fff; box-shadow: 0 0 0 calc(3px + var(--lv) * 9px) rgb(239 68 68 / .22); transition: box-shadow .08s; }
.dictate-mic.loading::before { content: ''; position: absolute; inset: -3px; border-radius: 50%; background: conic-gradient(#2563eb calc(var(--p) * 360deg), #dfe6f7 0);
  -webkit-mask: radial-gradient(circle, transparent 17px, #000 17.5px); mask: radial-gradient(circle, transparent 17px, #000 17.5px); }
.dictate-mic.busy { color: var(--accent); animation: dictate-breathe .8s ease-in-out infinite; }
.dictate-status { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--text-muted); }
.dictate-status:empty { display: none; }
.dictate-status[data-tone="warn"] { color: var(--ink); }
@keyframes dictate-eq { 0%, 100% { background-size: 3px 35%, 3px 80%, 3px 50%; } 33% { background-size: 3px 90%, 3px 40%, 3px 70%; } 66% { background-size: 3px 55%, 3px 100%, 3px 30%; } }
@keyframes dictate-ink { from { color: #a9a3b6; } }
@keyframes dictate-blink { to { visibility: hidden; } }
@keyframes dictate-breathe { 50% { opacity: .4; } }
@media (hover: none), (pointer: coarse) { .dictate-mic { width: 2.5rem; height: 2.5rem; right: .25rem; top: .25rem; } .dictate-box textarea { padding-right: 3.25rem; } }
.sent { display: grid; justify-items: center; gap: var(--space-3); padding: var(--space-10) 0; text-align: center; }
.sent-mark { width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--agency-bg); border: 2px solid var(--agency-dot); box-shadow: 0 0 0 4px var(--paper), 0 0 0 5.5px rgb(74 46 34 / 0.2); }
.new-button .icon { width: 1rem; height: 1rem; }
.workspace-menu { position: relative; }
.workspace-menu > summary { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 2.25rem; padding: 0 var(--space-3) 0 var(--space-1); border-radius: var(--radius-pill); border: 1.5px solid var(--edge); background: var(--surface); font-size: var(--text-sm); font-weight: 700; list-style: none; color: var(--ink-soft); }
.workspace-menu > summary .monogram { width: 1.5rem; height: 1.5rem; }
.workspace-menu > summary::-webkit-details-marker { display: none; }
.workspace-menu > summary .ws-name { white-space: nowrap; }
.topbar .ws-name { display: none; } /* the monogram stands for it; the name is its label */
.ws-item { display: flex; align-items: center; gap: var(--space-2); }
.ws-item[aria-checked="true"] { color: var(--accent-ink); font-weight: 650; }

/* Staff destinations */
.customer-link { grid-template-columns: minmax(10rem, 1fr) auto 1rem 6rem; }
.counts { display: inline-flex; gap: var(--space-2); }
.count-chip { min-width: 2rem; padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--t-bg, var(--paper-deep)); color: var(--t-fg, var(--ink-soft)); border: 1px solid var(--t-border, var(--hairline)); font-size: var(--text-xs); font-weight: 700; text-align: center; line-height: 1.6rem; font-variant-numeric: tabular-nums; }
.count-chip[data-tone] { --t-bg: var(--neutral-bg); }
.count-chip[data-tone="agency"] { --t-bg: var(--agency-bg); --t-fg: var(--agency-fg); --t-border: var(--agency-border); }
.count-chip[data-tone="you"] { --t-bg: var(--you-bg); --t-fg: var(--you-fg); --t-border: var(--you-border); }
.count-chip[data-tone="waiting"] { --t-bg: var(--waiting-bg); --t-fg: var(--waiting-fg); --t-border: var(--waiting-border); }
.board-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); gap: var(--space-4); margin-bottom: var(--space-10); align-items: start; }
.board-col { padding: var(--space-3); background: var(--surface-soft); border: 1px solid var(--edge); border-radius: var(--radius); min-height: 8rem; }
.deals { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.deal { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3); background: var(--surface); border: 1px solid var(--edge); border-radius: 14px; font-size: var(--text-sm); }
.deal > span { display: grid; min-width: 0; }
.deal .meta { margin: 0; font-size: var(--text-xs); }
.deal-link { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: 0; border: 0; background: none; text-align: left; color: inherit; }
.ops-section,
.account-section { margin-bottom: var(--space-10); }
.ops-link { grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr) auto 3.25rem; }
.pipeline-tools { display: grid; gap: var(--space-5); }

/* Account → Privacy & data: one row per data action (Export everything) */
.data-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); padding: var(--space-5) var(--space-6); margin-bottom: var(--space-3); }
.data-row-main { flex: 1 1 16rem; min-width: 0; }
.data-row-main strong { color: var(--ink); }
.data-row-main .meta { margin: 2px 0 0; }
/* Account → Builds (staff): the checkbox sits with its label, the help under both. */
.builds-row label.check-line { display: flex; align-items: center; gap: var(--space-2); margin: 0; cursor: pointer; }
.builds-row label.check-line input { width: auto; margin: 0; flex: none; }
.builds-row .meta { margin-left: calc(13px + var(--space-2)); }
.data-row-state { display: flex; align-items: center; gap: var(--space-3); }
.data-row-state .row-when { margin: 0; }
.data-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.data-row-actions .button { margin-top: 0; }
.data-hint { margin: calc(-1 * var(--space-1)) 0 var(--space-3); }
.account-section > .form-message { margin: 0 0 var(--space-4); }

/* Confirmation sheets: one sentence of what happens, then Confirm */
.confirm-sheet { width: min(30rem, 100%); }
.confirm-sheet .sheet-body p:last-child { color: var(--text-muted); margin-bottom: 0; }

/* Staff: Getting set up */
.intake-card { display: grid; gap: var(--space-2); max-width: 46rem; }
.intake-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
.intake-card h3 { font-size: var(--text-lg); margin: 0; }
.intake-card h4 { font-size: var(--text-sm); color: var(--ink-soft); margin: var(--space-3) 0 0; }
.objectives { margin: 0; padding-left: var(--space-5); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.fact { display: flex; align-items: flex-start; gap: var(--space-3); }
.fact p { margin: 0; }
.fact-claim { color: var(--ink); overflow-wrap: anywhere; }
.fact-mark { flex: none; width: 1rem; height: 1rem; margin-top: 0.2rem; border-radius: 50%; border: 1.5px dashed var(--hairline-strong); }
.fact.verified .fact-mark { border: 0; background: var(--agency-dot); box-shadow: inset 0 0 0 3px var(--surface); outline: 1.5px solid var(--agency-dot); }
.earlier-intake,
.record-intake { margin-top: var(--space-4); max-width: 46rem; }
.earlier-intake .intake-card { margin-top: var(--space-3); }
.record-intake .panel { margin: var(--space-3) 0 0; }
.setup-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }
.setup-actions .button { margin-top: 0; }
.setup-actions .meta { margin: 0; }

/* Operations → Erasures */
.subsection-title { font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); margin: var(--space-5) 0 var(--space-2); }
.erasure-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.erasure-drain { white-space: nowrap; }
.erasure-row .ops-link { grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr) auto 5.5rem; }
.erasure-row .inbox-age { white-space: nowrap; }
.erasure-detail { padding: var(--space-3) var(--space-5) var(--space-5); display: grid; gap: var(--space-3); }
.erasure-detail h4 { margin: 0; font-size: var(--text-sm); }
.erasure-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-2) var(--space-5); margin: 0; }
.erasure-facts dt { font-size: var(--text-xs); color: var(--text-muted); }
.erasure-facts dd { margin: 0; font-weight: 500; color: var(--ink); }
.erasure-providers { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.erasure-providers li { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: baseline; }
.saved-intent-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); }
.saved-intent-head .inbox-customer { flex: 1; min-width: 10rem; }
.saved-intent .form-message { margin: 0 var(--space-5) var(--space-3); }

/* Operations → Alerts: who gets alert emails; the fallback; tests */
.alerts-lead { margin: calc(-1 * var(--space-2)) 0 var(--space-3); max-width: 62ch; }
.alert-status { margin: 0 0 var(--space-3); }
.alert-status .chip { white-space: normal; text-align: left; }
.alert-note { max-width: 62ch; margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); border: 1px solid #d9b98a; border-radius: var(--radius-sm); background: #fbe9c2; color: #6b4510; font-size: var(--text-sm); line-height: var(--leading-snug); }
.alert-note strong { color: var(--ink); }
.alert-row { display: grid; grid-template-columns: minmax(0, 1fr) 13rem 10.5rem; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-5); }
.alert-row > .chip { justify-self: start; }
.alert-row.fallback { background: var(--surface-soft); }
.alert-who { display: grid; min-width: 0; }
.alert-who strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.alert-who .meta { margin: 0; font-size: var(--text-xs); }
.alert-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); }
.alert-actions:empty { display: none; }
.alert-confirm { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.alert-confirm .terms-confirm { flex: 1 1 16rem; }
.alert-add { margin: var(--space-5) 0 0; max-width: 34rem; }
.page .alert-add label { margin: 0 0 var(--space-1); }
.alert-add-row { display: flex; gap: var(--space-2); }
.alert-add-row input { flex: 1 1 auto; min-width: 0; }
.alert-test { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-top: var(--space-5); }
.alert-test .meta { margin: 0; }
.alert-notice { max-width: 62ch; }
.alert-test-result ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.alert-test-result li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); font-size: var(--text-sm); }
.alert-copy-who { min-width: 12rem; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.alert-test-result .chip { white-space: normal; }
.alert-confirm-page p[role="status"] { color: var(--ink-soft); }

/* Operations → Business: four glances, each a link to where you'd act */
/* Four tiles in a row on wide windows, two on phones, flowing in between. */
.glance { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr)); gap: clamp(0.75rem, 0.5rem + 1vw, 1rem); }
.page a.glance-tile {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  height: 100%;
  padding: clamp(0.75rem, 0.5rem + 1vw, 1rem) clamp(1rem, 0.75rem + 1vw, 1.25rem) clamp(1rem, 0.75rem + 1vw, 1.25rem);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.page a.glance-tile:hover { background: var(--surface-soft); border-color: var(--edge-strong); }
.page a.glance-tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.glance-tile .amount { overflow-wrap: anywhere; margin-bottom: var(--space-1); }
/* The label reads as the link it is (lagoon, underlined like .page a). */
.glance-label {
  color: var(--accent-ink);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgb(35 101 108 / 0.4);
}
.glance-tile:hover .glance-label { text-decoration-color: currentColor; }
.glance-note { margin: 0; }

/* Operations → AI spend: the Business glances' tiles, read-only: a label,
 * the figure, then what it is out of, one to a line. */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); gap: clamp(0.75rem, 0.5rem + 1vw, 1rem); margin: var(--space-4) 0; }
.stat-tile {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  padding: clamp(0.75rem, 0.5rem + 1vw, 1rem) clamp(1rem, 0.75rem + 1vw, 1.25rem) clamp(1rem, 0.75rem + 1vw, 1.25rem);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}
.stat-label { color: var(--ink-soft); font-size: var(--text-sm); font-weight: 700; }
.stat-tile .amount { overflow-wrap: anywhere; }
.stat-tile .meta { margin: 0; }
/* Its tables read like Results: hairline rows, soft headers, figures in
 * columns. Wider than a phone, they scroll inside their own box. */
/* Positioned, so a visually hidden header inside scrolls with the table
 * instead of stretching the page past the phone's edge. */
.table-scroll { position: relative; overflow-x: auto; max-width: 100%; margin-top: var(--space-4); border-radius: var(--radius-sm); }
.table-scroll:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.data-table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
.data-table th, .data-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--edge); text-align: left; white-space: nowrap; vertical-align: middle; }
.data-table th { font-weight: 600; color: var(--ink-soft); }
.data-table td { font-variant-numeric: tabular-nums; }
.data-table td:last-child { text-align: right; }
.data-table .button { margin-top: 0; }

/* Operations → Monthly cost: one figure, one bar, the lines. Segment tones
 * come from the palette, largest line first; the pilot is hatched and dashed
 * because it may go away. The bar is SVG sized by attributes (CSP: no inline
 * styles); each segment's colour is set here by its data-tone. */
.cost-section {
  --cost-1: var(--lagoon);
  --cost-2: var(--marigold);
  --cost-3: var(--done-dot);
  --cost-4: var(--neutral-dot);
  --cost-5: var(--sun);
  --cost-6: var(--face-bg);
  --cost-7: var(--text-faint);
  --cost-edge: rgb(74 46 34 / 0.22);
}
.cost-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); margin-bottom: var(--space-3); }
.cost-figure { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: 0; }
.cost-bar { display: block; width: 100%; height: 56px; overflow: visible; margin-bottom: var(--space-3); }
.cost-track { fill: var(--paper-deep); }
.cost-seg,
.cost-swatch { background: var(--cost-1); box-shadow: inset 0 0 0 1px var(--cost-edge); }
.cost-seg { width: calc(100% - 2px); height: 100%; border-radius: 3px; }
[data-tone="2"].cost-seg, [data-tone="2"].cost-swatch { background: var(--cost-2); }
[data-tone="3"].cost-seg, [data-tone="3"].cost-swatch { background: var(--cost-3); }
[data-tone="4"].cost-seg, [data-tone="4"].cost-swatch { background: var(--cost-4); }
[data-tone="5"].cost-seg, [data-tone="5"].cost-swatch { background: var(--cost-5); }
[data-tone="6"].cost-seg, [data-tone="6"].cost-swatch { background: var(--cost-6); }
[data-tone="7"].cost-seg, [data-tone="7"].cost-swatch { background: var(--cost-7); }
.cost-tick { stroke: var(--ink); stroke-width: 1.5; }
.cost-over { fill: var(--accent); }
/* The ceiling label beside the tick: plain text, or for billing staff a
 * button that opens the inline amount field below the bar. */
.cost-tick-label { display: flex; justify-content: flex-end; align-items: center; height: 100%; padding-right: 6px; color: var(--ink-soft); font-size: var(--text-xs); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.cost-tick-label.start { justify-content: flex-start; padding: 0 0 0 6px; }
.cost-ceiling-edit {
  padding: 1px 2px;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--accent-ink);
  font: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.cost-ceiling-edit:hover { color: var(--ink); text-decoration-style: solid; }
.cost-ceiling-edit:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.cost-ceiling-edit[aria-expanded="true"] { color: var(--ink); text-decoration-style: solid; }
.cost-ceiling-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface-soft); border: 1px solid var(--edge); border-radius: var(--radius); }
.cost-ceiling-form .terms-confirm { flex-basis: auto; flex: 1 1 16rem; }
.page .cost-ceiling-field { display: flex; align-items: center; gap: var(--space-3); margin: 0; color: var(--ink); font-size: var(--text-sm); font-weight: 600; }
.cost-ceiling-input { display: inline-flex; align-items: center; gap: var(--space-1); }
.cost-ceiling-unit { color: var(--ink-soft); font-weight: 700; }
.cost-ceiling-input input { width: 8rem; font-variant-numeric: tabular-nums; }
.cost-ceiling-notice { margin: 0 0 var(--space-3); }
.cost-items { list-style: none; margin: 0 0 var(--space-4); padding: 0; columns: 2 20rem; column-gap: var(--space-10); }
.cost-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--hairline); break-inside: avoid; }
.cost-swatch { width: 0.75rem; height: 0.75rem; border-radius: 3px; align-self: center; }
.cost-what { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); min-width: 0; font-size: var(--text-sm); }
.cost-what strong { color: var(--ink); font-weight: 600; }
.cost-what .meta { margin: 0; font-size: var(--text-xs); }
.cost-amount { color: var(--ink); font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cost-meta { margin: 0; }
.cost-meta + .cost-meta { margin-top: var(--space-1); }

/* Fun mode: painted celebrations (fun.mjs). The layer never takes input. */
.fx-layer { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; pointer-events: none; transition: opacity 600ms var(--ease); }
.fx-layer.fading { opacity: 0; }

/* 12b. Review mode --------------------------------------------------------- */
/* The site fills the screen with the overlay on it; the portal adds one thin
   bar (badge, page, Back to your site, Approve on a preview) and nothing in
   the frame. */
.review-mode { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--paper); }
.review-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: 3rem; padding: var(--space-2) var(--space-4);
  background: var(--topbar-bg); border-bottom: 1px solid var(--hairline-strong);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.6) inset;
}
.review-bar-start, .review-bar-end { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.review-bar-end { flex-wrap: wrap; justify-content: flex-end; }
.review-badge {
  display: inline-flex; align-items: center; gap: var(--space-1); flex: none;
  padding: 0.2rem 0.7rem; border-radius: var(--radius-pill);
  background: var(--accent); color: #fffcf7; font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.02em;
  box-shadow: var(--accent-glow);
}
.review-badge::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #fffcf7; }
.review-where { display: flex; align-items: baseline; gap: var(--space-2); min-width: 0; color: var(--text-muted); font-size: var(--text-sm); }
.review-site { color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 14rem; }
.review-target { white-space: nowrap; }
.review-target[data-target="preview"] { color: var(--you-fg); font-weight: 700; }
.review-page { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink); background: var(--surface-soft); border: 1px solid var(--hairline); border-radius: 6px; padding: 0.1rem 0.4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22rem; }
.review-sending { color: var(--lagoon-ink); font-size: var(--text-xs); font-weight: 700; }
/* Try it (a try-it link, signed out): how many rounds of notes are left. */
.review-rounds { color: var(--text-muted); font-size: var(--text-xs); white-space: nowrap; }
/* The portal is recording for the overlay (dictation runs here, not in the frame): never silent, always stoppable. */
.review-listening {
  display: inline-flex; align-items: center; gap: var(--space-1); flex: none;
  padding: 0.1rem 0.15rem 0.1rem 0.55rem; border-radius: var(--radius-pill);
  background: #fdecec; color: #b42318; font-size: var(--text-xs); font-weight: 800;
}
.review-listening::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #ef4444; animation: dictate-breathe 1.2s ease-in-out infinite; }
.review-listening button {
  border: 0; border-radius: var(--radius-pill); padding: 0.1rem 0.55rem; cursor: pointer;
  background: #ef4444; color: #fff; font: inherit;
}
.review-listening button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.review-confirm { max-width: 30rem; color: var(--ink); font-size: var(--text-xs); line-height: var(--leading-snug); }
.review-approved { color: var(--done-fg); font-weight: 800; font-size: var(--text-sm); }
.review-notice {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm); color: var(--agency-fg); background: var(--agency-bg); border-bottom: 1px solid var(--hairline);
}
.review-notice[data-tone="warn"] { color: var(--you-fg); background: var(--you-bg); }
.review-notice[data-tone="error"] { color: var(--failed-fg); background: var(--failed-bg); }
.review-notice > span { flex: 1; }
.review-notice-close { border: 0; background: none; color: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 var(--space-1); }
.review-stage { position: relative; flex: 1; min-height: 0; background: #fff; }
.review-frame-host, .review-frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.review-frame { border: 0; display: block; background: #fff; }
.review-overlay-state { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); margin: 0; color: var(--text-muted); text-align: center; }
.review-overlay-state.card { display: grid; gap: var(--space-3); justify-items: center; padding: var(--space-5) var(--space-6); max-width: min(26rem, calc(100vw - 2rem)); background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: var(--shadow-pop); color: var(--ink); }
.review-overlay-state.card p { margin: 0; }
.new-version-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.review-on-page { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-3) 0; }
.review-on-page .meta { margin: 0; }

/* Review notes in a thread */
.review-notes { margin-top: var(--space-3); display: grid; gap: var(--space-2); }
.review-notes-title { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
.review-note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.review-note { display: grid; gap: var(--space-2); padding: var(--space-3); background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius-sm); }
.review-note-head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--text-xs); color: var(--text-muted); }
.review-note-n { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 0.35rem; border-radius: var(--radius-pill); background: var(--pin); color: var(--pin-ink); font-weight: 800; font-size: var(--text-2xs); flex: none; }
.review-note[data-kind="summary"] .review-note-n { background: var(--neutral-dot); }
.review-note-kind { font-weight: 800; color: var(--ink); }
.review-note-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-note-page { font-family: var(--font-mono); font-size: var(--text-2xs); margin-left: auto; }
.review-note-text { margin: 0; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.review-figure { margin: 0; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--hairline); background: var(--surface-soft); }
.review-figure svg { display: block; width: 100%; height: auto; max-height: 26rem; }
.review-figure.plain svg { background: #fff; }
.review-figure.composite img { display: block; width: 100%; height: auto; max-height: 26rem; object-fit: contain; object-position: top; background: #fff; }
.review-figure figcaption { padding: var(--space-1) var(--space-2); }
.review-figure-box { fill: var(--changed-fill); stroke: var(--changed-stroke); stroke-width: 3; stroke-dasharray: 8 5; }
.review-note-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-1) var(--space-3); margin: 0; font-size: var(--text-xs); }
.review-note-facts dt { color: var(--text-muted); font-weight: 700; }
.review-note-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.review-note-facts code { font-family: var(--font-mono); font-size: var(--text-2xs); }
.review-note-pictures { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.review-picture { margin: 0; display: grid; gap: var(--space-1); width: 9rem; }
.review-picture img { width: 9rem; height: 6.5rem; object-fit: cover; border-radius: 8px; border: 1px solid var(--hairline); background: var(--surface-soft); }
.review-picture figcaption { font-size: var(--text-2xs); color: var(--text-muted); overflow-wrap: anywhere; }
.review-picture-name { color: var(--ink); }
.review-picture-missing, .review-picture-file { display: grid; place-items: center; width: 9rem; height: 6.5rem; border-radius: 8px; border: 1px dashed var(--edge); color: var(--text-muted); font-size: var(--text-xs); text-align: center; padding: var(--space-2); }

@media (max-width: 640px) {
  .review-bar { flex-wrap: wrap; padding: var(--space-2) var(--space-3); }
  .review-site, .review-target { display: none; }
  .review-page { max-width: 10rem; }
  .review-confirm { flex-basis: 100%; }
  /* Try it on a phone: one row, nothing clipped. The rounds count lives in
     the overlay's panel by Send; the bar keeps only a closed link's words,
     wrapped. */
  .try-it .review-bar { flex-wrap: nowrap; }
  .try-it .review-bar-start { flex: 1 1 auto; }
  .try-it .review-bar-end { flex: none; }
  .try-it .review-page { flex: none; }
  .review-rounds { white-space: normal; min-width: 0; line-height: 1.25; }
  .review-rounds.counted { display: none; }
}

/* Press feedback: anything you can tap answers on the press itself, before
 * the next view arrives (no transition, so it shows on the same frame). */
.dest:not([aria-current="page"]):active,
.strip-tab:not([aria-current="page"]):active,
.row-button:active,
.inbox-link:active,
.deal-link:active,
.menu-item:active,
.jump-result:active,
.choice:active { background-color: var(--paper-deep); transition: none; }
.tab:active .icon { background-color: var(--hover-tint); transition: none; }
.button.ghost:active:not(:disabled) { background: var(--paper-deep); transition: none; }

/* 12c. Lists that fit their slot ---------------------------------------------
 * Row lists change shape by the width they are given, not the window's
 * (container queries), so the same list reads right on a phone, in a narrow
 * column beside a panel, or full width. */
.inbox-rows,
.row-list,
.material-list { container: rows / inline-size; }
@container rows (max-width: 36rem) {
  .inbox-link { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "who face age" "what what thumb"; gap: var(--space-1) var(--space-3); padding: var(--space-3) var(--space-4); }
  .inbox-customer { grid-area: who; font-size: var(--text-xs); }
  .inbox-what { grid-area: what; }
  .inbox-thumb { grid-area: thumb; width: 3.5rem; }
  .inbox-link .face { grid-area: face; }
  .inbox-age { grid-area: age; }
  /* Operations rows: who and when, then what, then the extra (a release's
   * track, an erasure's drain time). */
  .ops-link,
  .erasure-row .ops-link { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who age" "what what" "extra extra"; }
  .ops-link > :nth-child(3) { grid-area: extra; justify-self: start; }
  .ops-link > span:empty { display: none; }
  .customer-link { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who age" "extra dot"; }
  .customer-link .counts { grid-area: extra; }
  .customer-link .live-dot { grid-area: dot; justify-self: end; margin-top: 0; }
  .erasure-chips { flex-wrap: wrap; }
  .alert-row { grid-template-columns: minmax(0, 1fr) auto; padding: var(--space-3) var(--space-4); }
  .alert-actions { grid-column: 1 / -1; justify-content: flex-start; margin-left: calc(-1 * var(--space-3)); }
  .material { grid-template-columns: 3rem minmax(0, 1fr) auto; padding: var(--space-3) var(--space-4); }
  .material-thumb { width: 3rem; height: 3rem; }
  .material .chip { grid-column: 2; justify-self: start; }
  .material > .button { grid-column: 3; grid-row: 1; }
}
/* A Home card narrower than about 26rem puts its title on its own line and
 * the actions under it, instead of squeezing the title into a column. */
.need-card { container: need / inline-size; }
@container need (max-width: 26rem) {
  .need-foot { flex-wrap: wrap; justify-content: flex-end; row-gap: var(--space-2); }
  .need-foot h3 { flex: 1 0 100%; }
}
@container rows (max-width: 26rem) {
  .alert-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
}

/* Loading lines hold roughly the room their content will take, so the page
 * does not jump when the figures arrive. */
.business-section > .state { min-height: 8.5rem; }
.cost-section > .state { min-height: 20rem; }
/* Home: until the workspace has loaded (its count line is still empty), the
 * In progress and Your site columns wait unseen, so they appear in place
 * instead of being pushed down by the cards. */
.home-header:has(> .needs-label:empty) ~ .home-columns { visibility: hidden; }
@media (max-width: 640px) {
  .business-section > .state { min-height: 15.5rem; }
  .cost-section > .state { min-height: 32rem; }
}

/* 13. Responsive ----------------------------------------------------------- */
/* The slim bar (header.mjs) and the phone header share one edge: the three
 * flat stripes, thinner, along the bottom; no S. */
@media (min-width: 861px) {
  :root[data-header="slim"] .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--topbar-h) + var(--ribbon-band-h) * var(--band-scale));
    background: var(--topbar-bg);
    box-shadow: 0 12px 24px -24px rgb(74 46 34 / 0.7);
    animation: slim-in 200ms var(--ease);
  }
  :root[data-header="slim"] .topbar-inner { height: var(--topbar-h); }
  :root[data-header="slim"] .topbar-end { width: auto; margin-left: var(--space-2); }
  :root[data-header="slim"] .app-staff .topbar-end { width: var(--ribbon-end); }
}
@keyframes slim-in { from { transform: translateY(-10px); opacity: 0; } }
@media (min-width: 861px) {
  :root[data-header="slim"] .ribbon-art,
  :root[data-header="slim"] .ribbon::after,
  :root[data-header="slim"] .ribbon-paint { display: none; }
  :root[data-header="slim"] .ribbon::before {
    top: auto;
    bottom: 0;
    right: 0;
    opacity: 1;
    height: calc(var(--ribbon-band-h) * var(--band-scale));
    background-position: left top;
    background-size: calc(var(--ribbon-low-w) * var(--band-scale)) calc(var(--ribbon-band-h) * var(--band-scale));
  }
}

/* In the full desktop staff header, give the stripe's decorative gap
 * flexible space. The search box keeps its size, including while Figtree
 * loads or when a wider fallback font is all the browser has. */
@media (min-width: 861px) {
  :root:not([data-header="slim"]) .app-staff .topbar-end {
    flex: 0 1 calc(var(--ribbon-end) + var(--ribbon-rise) + 32px - var(--space-5));
    min-width: var(--ribbon-end);
    margin-left: 0;
    justify-content: flex-end;
  }
  :root:not([data-header="slim"]) .app-staff .topbar-end .jump { width: var(--ribbon-end); }
}

@media (max-width: 1080px) {
  .topbar-inner { gap: var(--space-3); }
  .jump input[type="search"] { width: 11rem; }
  .dest { padding: 0 0.65rem; }
  .dest .icon,
  .ws-name { display: none; }
}

@media (max-width: 860px) {
  :root { --topbar-h: 3.5rem; }
  /* Phones: the nav is the tab bar and New request is the button by your
   * thumb, so nothing waits under a swoop. The header is the slim bar,
   * sticky, edged with the flat stripes; the S never sits under text. */
  .topbar-slot { display: contents; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: calc(var(--topbar-h) + var(--ribbon-band-h) * var(--band-scale) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--topbar-bg);
  }
  .topbar-inner { height: var(--topbar-h); gap: var(--space-2); }
  .topbar-end { width: auto; margin-left: 0; }
  .topbar-end:empty { display: none; }
  /* Staff: the customer search takes whatever room the bar has left. */
  .app-staff .topbar-end { flex: 1 1 0; min-width: 0; }
  .topbar-end .jump input[type="search"] { min-width: 0; padding-right: 1rem; }
  .topbar-end .jump-key { display: none; }
  .ribbon-art,
  .ribbon::after,
  .ribbon .ribbon-paint.ribbon-paint { display: none; }
  .ribbon::before,
  .ribbon.is-painting::before,
  .topbar:not(.has-end) .ribbon::before {
    top: auto;
    bottom: 0;
    right: 0;
    opacity: 1;
    height: calc(var(--ribbon-band-h) * var(--band-scale));
    background-position: left top;
    background-size: calc(var(--ribbon-low-w) * var(--band-scale)) calc(var(--ribbon-band-h) * var(--band-scale));
  }
  .destinations,
  .ask-button,
  .help-button { display: none; }
  .topbar-actions { gap: var(--space-2); }
  .jump input[type="search"] { width: 9.5rem; }
  .page { padding: var(--page-pad-top) var(--gutter-r) calc(var(--tabbar-h) + 5.5rem + env(safe-area-inset-bottom)) var(--gutter-l); }
  .page-header { margin-bottom: var(--space-6); }
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--tabbar-bg);
    border-top: 1px solid var(--hairline);
  }
  .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: none;
    color: var(--text-muted);
    font-size: var(--text-2xs);
    font-weight: 700;
  }
  .tab .icon { box-sizing: content-box; padding: 3px 14px; border-radius: var(--radius-pill); transition: background-color var(--dur) var(--ease); }
  .tab[aria-current="page"] { color: var(--ink); }
  .tab[aria-current="page"] .icon { stroke-width: 2.2; background: var(--accent); color: #fffcf7; }
  .tab:focus-visible { outline-offset: -4px; border-radius: 10px; }
  .fab {
    position: fixed;
    right: var(--gutter-r);
    bottom: calc(var(--tabbar-h) + var(--space-4) + env(safe-area-inset-bottom));
    z-index: 21;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 3rem;
    padding: 0 var(--space-5) 0 var(--space-4);
    border: 1.5px solid var(--accent-border);
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #fffcf7;
    font-size: var(--text-sm);
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 10px 22px -10px rgb(217 84 47 / 0.9);
  }
  .fab:active { background: var(--accent-press); }
  .staff-strip-inner { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .home-columns { grid-template-columns: 1fr; gap: 0; }
  .need-card { padding: var(--space-5); }
  .inbox-bar { margin-top: 0; justify-content: flex-start; }
  .panel-heading { flex-wrap: wrap; }
  .sheet {
    top: auto;
    left: 0;
    width: auto;
    max-height: 92dvh;
    border-left: 0;
    border-top: 1px solid var(--edge);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: rise-in 220ms var(--ease);
  }
  .sheet-head { padding: var(--space-4); }
  .sheet.wide,
  .confirm-sheet { width: auto; }
  /* Menus drop from the bar as full-width panels inside the gutters, so one
   * opened from the left of the bar never leaves the screen. */
  .topbar .menu {
    position: fixed;
    top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
    left: var(--gutter-l);
    right: var(--gutter-r);
    width: auto;
    max-width: none;
    max-height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - 2rem);
    overflow-y: auto;
  }
  .sheet.wide .compose { grid-template-columns: 1fr; }
  .sheet-foot { flex-direction: column-reverse; align-items: stretch; padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom)); }
  .sheet-foot .button { width: 100%; min-height: 3rem; }
  .sheet-foot .button.ghost:first-child { margin-right: 0; }
  .ws-name { display: none; }
  .new-button { display: none; }
  .row-line { flex-wrap: wrap; row-gap: var(--space-1); }
  .row-line .row-title { white-space: normal; flex-basis: calc(100% - 7rem); }
  .workspace-menu > summary { padding: 0 var(--space-1); }
  .thread.with-panel { grid-template-columns: 1fr; }
  .staff-panel { position: static; }
  .entry.from-customer .bubble { margin-left: var(--space-4); }
  .entry.from-agency .bubble,
  .entry.internal .bubble { margin-right: var(--space-4); }
  .entry .bubble { padding: var(--space-4); }
  .new-version { grid-template-columns: 1fr; }
  .row-reason { padding-left: 0; }
  .title-row { flex-wrap: wrap; }
  .need-card { padding: var(--space-4); }
  .sheet-body { padding: var(--space-4) var(--space-4) calc(var(--space-8) + env(safe-area-inset-bottom)); }
}


/* Touch: every control is at least 44px to hit (phones, tablets, and any
 * window narrow enough for the phone layout). */
@media (pointer: coarse), (max-width: 860px) {
  :root { --control-h: var(--tap); --control-h-sm: var(--tap); }
  .brand,
  .workspace-menu > summary,
  .strip-tab,
  .segmented button,
  .site-choice button,
  .menu-item,
  .menu .logout .nav-item,
  .jump input[type="search"],
  .jump-result { min-height: var(--tap); }
  .menu-item,
  .menu .logout .nav-item { display: flex; align-items: center; }
  .strip-tab { height: var(--tap); }
  .mode-option { width: var(--tap); height: var(--tap); }
  .avatar { width: var(--tap); height: var(--tap); }
  .icon-link { width: var(--tap); height: var(--tap); }
  .link-button { display: inline-flex; align-items: center; min-height: var(--tap); }
  .toggle { min-height: var(--tap); }
  input[type="checkbox"],
  input[type="radio"] { width: 1.25rem; height: 1.25rem; }
  .page summary { min-height: var(--tap); }
  .workspace-menu > summary { min-width: var(--tap); justify-content: center; }
  .deal-link { min-height: var(--tap); }
  .dictate-mic { width: var(--tap); height: var(--tap); right: 0.125rem; top: 0.125rem; }
  .dictate-box textarea { padding-right: 3.25rem; }
}

@media (max-width: 520px) {
  .material-add { padding: var(--space-4); }
  .terms-detail { grid-template-columns: 1fr; }
  .terms-detail dd { margin-bottom: var(--space-1); }
  input:not([type="checkbox"], [type="radio"], [type="file"]),
  select,
  textarea { font-size: var(--text-base); }
  .brand-name { font-size: 1.6rem; }
  .workspace-switch { max-width: 9rem; }
  .region-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-actions .button,
  .form-panel form > .button[type="submit"] { flex: 1 1 auto; justify-self: stretch; }
  .record > .button + .button { margin-left: 0; }
  .need-card .button { align-self: stretch; }
  .alert-copy-who { min-width: 0; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .topbar { animation: none !important; }
  .fx-layer { display: none !important; }
}

/* Sign-in choices and Sign-in and security (portal-experience.md, "Sign-in and security"). */
.sign-in-choices { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3); margin-top: var(--space-6); width: min(100%, 22rem); }
.sign-in-choice { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-2); }
.sign-in .sign-in-choices .button { margin-top: 0; min-width: 0; width: 100%; }
.sign-in-hint { font-size: var(--text-sm); color: var(--text-muted); }
.sign-in-notice { margin: var(--space-4) 0 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--you-soft); border: 1px solid var(--marigold); color: var(--ink); font-size: var(--text-base); max-width: 26rem; }
.staff-gate .logout { margin-top: var(--space-4); }
@media (min-width: 640px) {
  .sign-in-choices { flex-direction: row; align-items: flex-start; width: auto; }
  .sign-in-choice { width: 15rem; }
}
.security-page { max-width: 44rem; }
.security-card { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: var(--space-5) var(--space-6); margin-bottom: var(--space-6); }
.security-card.loading { color: var(--text-muted); }
.security-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-3); }
.security-card-head .section-title { margin: 0; }
.security-card-foot { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.readiness { display: inline-flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--text-sm); font-weight: 600; }
.readiness-mark { width: 1.1rem; height: 1.1rem; border-radius: 50%; flex: none; }
.readiness.set { color: var(--lagoon-ink); }
.readiness.set .readiness-mark { background: var(--lagoon); mask: none; box-shadow: inset 0 0 0 0.3rem var(--lagoon); position: relative; }
.readiness.set .readiness-mark::after { content: ""; display: block; width: 0.32rem; height: 0.58rem; margin: 0.18rem auto 0; border: solid var(--paper); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.readiness.needs { color: var(--ink); }
.readiness.needs .readiness-mark { background: var(--marigold); }
.security-list { list-style: none; margin: 0; padding: 0; }
.security-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--hairline); }
.security-row:first-child { border-top: 0; }
.security-row-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.security-row-text strong { overflow-wrap: anywhere; }
.security-glyph { width: 2.25rem; height: 2.25rem; flex: none; border-radius: var(--radius-sm); background: var(--face-bg) center / 1.25rem no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a2e22' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='M10.8 12.2 20 3m-4 4 3 3m-5-1 2 2'/%3E%3C/svg%3E"); }
.security-glyph.mail { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a2e22' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E"); }
.quiet-remove { color: var(--text-muted); }
.security-empty { color: var(--text-muted); margin: 0; max-width: 52ch; }
.security-warning { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--you-soft); border: 1px solid var(--marigold); color: var(--ink); }
.toast { position: fixed; z-index: 45; left: 50%; bottom: calc(var(--tabbar-h) + var(--space-4)); transform: translateX(-50%); max-width: calc(100vw - 2rem); padding: var(--space-3) var(--space-5); border-radius: var(--radius-pill); background: var(--lagoon-ink); color: var(--paper); font-weight: 600; box-shadow: var(--shadow-pop); animation: fade-in var(--dur) var(--ease); }
.toast.quiet { background: var(--ink-soft); }
@media (min-width: 861px) { .toast { bottom: var(--space-8); } }
@media (max-width: 640px) {
  .security-card { padding: var(--space-4); border-radius: var(--radius-sm); }
  .security-card-foot .button { flex: 1 1 100%; }
}
/* Confirm it's you (security/authentication.md 4.1-4.4): the one sheet every
   sensitive action uses. Calm: a reason line is marigold (attention), never red. */
.confirm-you .sheet-body p { font-size: var(--text-lg); color: var(--ink-soft); margin: 0; }
.confirm-you .sheet-body p + p { margin-top: var(--space-3); }
.confirm-you .sheet-body .confirm-reason { font-size: var(--text-base); color: var(--you-fg); background: var(--you-bg); border-left: 3px solid var(--marigold); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); }
.confirm-toast { position: fixed; z-index: 46; left: 50%; bottom: calc(var(--tabbar-h) + var(--space-4)); transform: translateX(-50%); display: flex; align-items: center; gap: var(--space-3); width: max-content; max-width: calc(100vw - 2rem); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5); border-radius: var(--radius-pill); background: var(--lagoon-ink); color: var(--paper); font-weight: 600; box-shadow: var(--shadow-pop); animation: fade-in var(--dur) var(--ease); }
.confirm-toast .button.ghost { color: var(--paper); border-color: transparent; }
.confirm-toast .button.ghost:hover { background: rgb(255 255 255 / 0.12); }
@media (min-width: 861px) { .confirm-toast { bottom: var(--space-8); } }
@media (max-width: 640px) { .confirm-toast { width: calc(100vw - 2rem); border-radius: var(--radius-sm); padding-left: var(--space-4); } .confirm-toast span { flex: 1; } }

/* Where you're signed in (rules 5.5, 8.1) and staff sign-out (8.2). */
.device-row .security-row-text strong { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.this-device { font-size: var(--text-xs); font-weight: 700; color: var(--agency-fg); background: var(--agency-bg); border-radius: var(--radius-pill); padding: 0.1rem var(--space-2); }
.security-glyph.device-glyph { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a2e22' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8m-4-4v4'/%3E%3C/svg%3E"); }
.sign-out-everywhere { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--hairline); }
.sign-out-everywhere .confirm-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Secrets a customer shared on a support request (staff, rule 4.4). */
.secrets { margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); background: var(--cream); border: 1px solid var(--hairline); border-radius: var(--radius-sm); }
.secrets h4 { margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--ink-soft); }
.secret-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-2) 0; }
.secret-row + .secret-row { border-top: 1px solid var(--hairline); }
.secret-text { display: grid; gap: var(--space-1); min-width: 0; }
.secret-value { font-family: var(--font-mono); font-size: var(--text-sm); background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); overflow-wrap: anywhere; white-space: pre-wrap; }
.secret-row .form-message { flex-basis: 100%; margin: 0; }

/* Getting back in (authentication.md 6.3, 7.2-7.4): the Security page's
   welcome, recovery codes and security emails; Operations → People; and the
   signed-out link pages. Attention is marigold, never red. */
.welcome-card { border-color: var(--marigold); background: var(--you-soft); }
.welcome-card .lede { margin: var(--space-2) 0 0; color: var(--ink-soft); }
.codes-once { margin-top: var(--space-2); }
.codes-once-note { margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border-left: 3px solid var(--marigold); border-radius: var(--radius-sm); background: var(--you-bg); color: var(--you-fg); }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-5); margin: 0; padding: var(--space-4) var(--space-5); list-style-position: inside; background: var(--cream); border: 1px solid var(--hairline); border-radius: var(--radius-sm); }
.recovery-codes code { font-size: var(--text-base); letter-spacing: 0.04em; overflow-wrap: anywhere; }
.meta.waiting { color: var(--you-fg); }
.notify-add { margin: var(--space-5) 0 0; max-width: 34rem; }
.notify-add label { display: block; margin: 0 0 var(--space-1); font-weight: 600; }
.notify-add-row { display: flex; gap: var(--space-2); }
.notify-add-row input { flex: 1 1 auto; min-width: 0; }
.people-section .section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.people-section .section-head .section-title { margin: 0; }
.people-section .readiness { margin: var(--space-3) 0 var(--space-2); }
.person-row .security-row-text strong { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.sheet-body .label { display: block; margin: var(--space-4) 0 var(--space-1); font-weight: 600; }
.sheet-body input:not([type="radio"]):not([type="checkbox"]), .sheet-body select { width: 100%; }
/* A checkbox sits inline before its words, not alone above them. */
.sheet label.check-line { display: flex; align-items: center; gap: var(--space-2); font-weight: 400; }
.sheet label.check-line input { width: auto; margin: 0; flex: none; }
.choice-group { border: 0; margin: var(--space-4) 0 0; padding: 0; }
.choice-group legend { padding: 0; }
.choice-group .check { display: flex; padding: var(--space-1) 0; gap: var(--space-3); min-height: 0; align-items: flex-start; }
/* A choice's name, and under it, when it has one, the help that says when to pick it. The radio sits by the name. */
.choice-group .check input { flex: none; margin: 0.3em 0 0; }
.choice-group .check > span { flex: 1; min-width: 0; }
.choice-group .check > span > .meta { display: block; }
.restore-who { margin: 0 0 var(--space-2); overflow-wrap: anywhere; }
.choice-group .check + .check { border-top: 0; }
.sign-in-recover { display: inline-block; margin-top: var(--space-5); font-size: var(--text-sm); color: var(--lagoon-ink); }
.signed-out-page .button { margin-top: var(--space-4); margin-right: var(--space-2); }
.signed-out-page .meta { max-width: 30rem; }
.recover-form { max-width: 26rem; margin-top: var(--space-4); }
.recover-form label { display: block; margin: 0 0 var(--space-1); font-weight: 600; }
.recover-form .code-input { width: 100%; font-size: var(--text-lg); letter-spacing: 0.08em; text-transform: uppercase; }
@media (max-width: 640px) {
  .recovery-codes { grid-template-columns: 1fr; padding: var(--space-3) var(--space-4); }
  .notify-add-row { flex-direction: column; }
  .address-row { flex-wrap: wrap; }
  .address-row .security-row-text { flex: 1 1 calc(100% - 3.5rem); }
  .address-row .button:first-of-type { margin-left: calc(2.25rem + var(--space-3)); }
  .people-section .section-head .button { width: 100%; }
}

/* Security activity (authentication.md 11.1): the Security page's recent
   activity card and Operations → Security events. A row worth a look gets a
   marigold edge on its glyph, never red. */
.activity-row, .audit-row { align-items: flex-start; }
.activity-row .security-glyph, .audit-row .security-glyph { margin-top: 0.1rem; }
.activity-row.look .security-glyph, .audit-row.look .security-glyph { box-shadow: inset 0 0 0 2px var(--marigold); background-color: var(--you-soft); }
.activity-row .meta, .audit-row .meta { overflow-wrap: anywhere; }
.activity-foot { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.activity-foot .meta { margin: 0; max-width: 60ch; }
.audit-section .section-head { margin-bottom: var(--space-4); }
.audit-section .section-head .section-title { margin: 0 0 var(--space-1); }
.audit-section .section-head .meta { margin: 0; }
.audit-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-4); margin: 0 0 var(--space-4); }
.audit-field { display: flex; flex-direction: column; min-width: 0; }
.audit-field .label { margin: 0 0 var(--space-1); font-weight: 600; font-size: var(--text-sm); }
.audit-field.grow { flex: 1 1 18rem; }
.audit-person-row { display: flex; gap: var(--space-2); }
.audit-person-row input { flex: 1 1 auto; min-width: 0; }
.audit-scope { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); font-size: var(--text-sm); overflow-wrap: anywhere; }
.audit-list { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: 0 var(--space-5); }
.audit-list:empty { display: none; }
.audit-who { flex: none; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: var(--space-2); }
.audit-more { margin-top: var(--space-4); }
@media (max-width: 640px) {
  .audit-filters { flex-direction: column; align-items: stretch; }
  .audit-field.grow { flex: none; }
  .audit-field select { width: 100%; }
  .audit-list { padding: 0 var(--space-4); border-radius: var(--radius-sm); }
  .audit-row { flex-wrap: wrap; }
  .audit-row .security-row-text { flex: 1 1 calc(100% - 3rem); }
  .audit-who { margin-left: calc(2.25rem + var(--space-3)); max-width: calc(100% - 2.25rem - var(--space-3)); }
  /* The person's email starts at the same edge as the title and meta above it, like "No one's account". */
  .button.audit-who { padding-inline: 0; }
}

/* Draft first (docs/draft-first.md): Kevin's pipeline, the draft shown at the
   table, Maya's "Your website is ready", Getting live and Get started. */
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.page-header-row .page-header { margin-bottom: var(--space-6); }
.pipeline-head-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
/* Archive's word back, with Undo, above the board. */
.shelved-note { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: 0 0 var(--space-4); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--surface-soft); font-size: var(--text-sm); }
.pipeline-board .deals { gap: var(--space-3); }
/* Waiting on you: who to get back to, above the board, one line each. */
.waiting-on-you { margin: 0 0 var(--space-6); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--edge); border-radius: 14px; }
.waiting-on-you ul { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.waiting-on-you li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; font-size: var(--text-sm); }
.waiting-on-you .waiting-text { display: grid; min-width: 0; }
.waiting-on-you .waiting-text .meta { margin: 0; }
/* Archived cards sit side by side in their one column. */
.archived-board .deals { grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); align-items: start; }
/* Archive sits apart from the card's other actions, at the end of its row. */
.prospect-actions .prospect-shelf { margin-left: auto; }
/* Results: how far each prospect got, counted above, one row each below. */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.results-funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr)); gap: var(--space-3); margin: 0 0 var(--space-3); }
.results-funnel > div { padding: var(--space-3); background: var(--surface); border: 1px solid var(--edge); border-radius: 14px; }
.results-funnel dt { font-size: var(--text-xs); color: var(--ink-soft, inherit); }
.results-funnel dd { margin: 0; font-size: var(--text-xl, 1.5rem); font-weight: 700; }
.results-scroll { overflow-x: auto; margin-top: var(--space-4); }
.results-table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
.results-table th, .results-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--edge); text-align: left; white-space: nowrap; }
.board-empty { margin: var(--space-2) var(--space-1); }
.prospect-card { display: grid; gap: var(--space-2); align-items: stretch; }
.prospect-head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.prospect-name { min-width: 0; flex: 1; }
.prospect-name h3 { margin: 0; font-size: var(--text-sm); overflow-wrap: anywhere; }
.prospect-card .meta { margin: 0; overflow-wrap: anywhere; }
.came-to-us { --t-bg: var(--you-soft); --t-fg: #6b4510; flex: none; }
.prospect-message { margin: 0; padding: var(--space-2) var(--space-3); border-left: 3px solid var(--marigold); background: var(--surface-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: var(--text-sm); white-space: pre-line; overflow-wrap: anywhere; }
.prospect-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.said-yes-total { margin-top: var(--space-3); }
.pipeline-settings { max-width: 40rem; }
.pipeline-settings summary { cursor: pointer; font-weight: 600; }
.pipeline-settings form { display: grid; gap: var(--space-1); max-width: 24rem; }
.pipeline-settings form .button { margin-top: var(--space-4); justify-self: start; }
.draft-show { position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; background: var(--paper); }
.draft-show-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--hairline); }
.draft-show-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.draft-show-frame { flex: 1; width: 100%; border: 0; background: var(--surface); }
.draft-show-empty, .draft-show .state { margin: var(--space-10) auto; max-width: 32rem; text-align: center; }
/* Show draft's private link: made and shown once, under the bar. */
.share-panel { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--hairline); background: var(--surface-soft); max-height: 60vh; overflow: auto; }
.share-panel > * { max-width: 40rem; }
.share-panel p { margin: 0 0 var(--space-3); }
.share-title { margin: 0 0 var(--space-2); font-size: var(--text-base); }
.share-subtitle { margin: var(--space-5) 0 var(--space-2); font-size: var(--text-sm); }
.share-panel .label { display: block; margin: var(--space-3) 0 var(--space-1); font-weight: 600; }
.copy-row { display: flex; gap: var(--space-2); align-items: center; margin-bottom: var(--space-2); }
.copy-row input { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); font-size: var(--text-sm); }
.copy-row .share-passcode { flex: 0 1 12rem; font-size: var(--text-lg); letter-spacing: 0.08em; }
.share-links { list-style: none; margin: 0; padding: 0; }
.share-links li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-top: 1px solid var(--hairline); }
.share-links .meta { margin: 0; overflow-wrap: anywhere; }
.share-form .notice-error, .share-form .meta { margin: var(--space-3) 0 0; }
.ready-card .need-foot { align-items: flex-end; }
.ready-words h3 { margin: 0 0 var(--space-1); }
.ready-words .amounts { margin: 0; }
.sign-in-new { margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid var(--hairline); max-width: 30rem; }
.sign-in-new p { margin: 0 0 var(--space-3); }
.get-started-form { max-width: 28rem; margin-top: var(--space-4); }
.get-started-form .label { display: block; margin: var(--space-4) 0 var(--space-1); font-weight: 600; }
.get-started-form .input { width: 100%; }
.get-started-form .button { margin-top: var(--space-5); }
/* The honeypot: off screen and out of reach for people (signed_out.rs). */
.honeypot { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 640px) {
  .draft-show-bar { padding: var(--space-2) var(--space-4); }
  .share-panel { padding: var(--space-3) var(--space-4); }
  .copy-row { flex-wrap: wrap; }
  .copy-row input, .copy-row .share-passcode { flex: 1 1 100%; }
  .prospect-actions .button { flex: 1 1 auto; }
}
