/* ============================================================================
   brand.css — The Comstock Agency shared design system
   Vendored verbatim into connect/public/, cqf/public/, guides/public/.
   Change this source first, then propagate. Never edit a vendored copy.
   Spec: docs/superpowers/specs/2026-08-25-shared-design-system-design.md

   v0.4 — follows the system light/dark setting only, via light-dark().
   No theme switch (2026-10-26).
   ========================================================================== */

@font-face { font-family: Outfit;  src: url(/fonts/outfit-var.woff2)  format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Manrope; src: url(/fonts/manrope-var.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }

/* ---------------------------------------------------------------------------
   Colour. Every themed token is declared ONCE with light-dark(); which half
   resolves is decided by `color-scheme` on :root, which follows the system
   setting. That is what makes the print rule at the bottom of this file able
   to force the whole palette light with a single declaration.
   Light is primary (spec §2.2). v0.3 (Josh, 2026-10-03): SLATE, both modes.
   The harbor teal is gone — Josh picked slate over black and charcoal from
   side-by-side renders of every site. Light keeps its warm ground and gold
   and swaps the teal inks for slate; dark is a cool blue-grey slate. Every
   text pair clears WCAG AA (lowest: 5.06:1, deep gold on the light ground).
   --------------------------------------------------------------------------- */
/* The note colours are read INSIDE a `color-scheme: light` card, where an
   unregistered light-dark() would resolve to its light half even in dark mode.
   Registered as <color>, they resolve once, here at :root, in the page's real
   scheme. */
@property --note-bg   { syntax: "<color>"; inherits: true; initial-value: #e4e9ef; }
@property --note-line { syntax: "<color>"; inherits: true; initial-value: #a3afbd; }
@property --note-icon { syntax: "<color>"; inherits: true; initial-value: #2c3846; }

:root {
  color-scheme: light dark;

  --bg:            light-dark(#f3f3f1, #1c2129);
  --surface:       light-dark(#fdfdfc, #283039);
  --surface-2:     light-dark(#e6e7e8, #13171c);
  --text:          light-dark(#1f2a37, #f4f2ee);
  --text-muted:    light-dark(#4f5a68, #cbccd0);
  --line:          light-dark(#d3d6da, #4e5866);
  --brand:         light-dark(#2c3846, #3b4656);
  --brand-deep:    light-dark(#1f2a37, #11151a);
  --on-brand:      #f4f2ee;
  --on-brand-mut:  light-dark(#b9c2cd, #cbccd0);
  --accent:        light-dark(#c9954a, #e0b473);
  --accent-strong: light-dark(#8a5f20, #e0b473);
  --on-accent:     #1f2a37;
  /* Section bars and info notes (CQF, 2026-10-03). In dark mode both are
     LIGHT cards with slate ink -- a dark bar on a dark page was the thin-line
     problem again -- a shade apart so a note never reads as a heading. */
  /* Dark bars are a RAISED SLATE with the gold rule under them (Josh,
     2026-10-08: "Raised slate + gold rule"). The near-white bar of 10-03
     fixed the thin dark-on-dark line but glared; the rule now carries the
     edge. Light mode is unchanged and has no rule. */
  --bar:           light-dark(#2c3846, #3a4656);
  --on-bar:        light-dark(#f4f2ee, #f4f2ee);
  /* --warn on a dark plate (the bars, the CQF's call dock), which is dark in
     both themes: --warn's light half is 2.6:1 there. 4.77:1 on the dark
     --bar, 7.2:1 on --brand-deep. */
  --on-bar-warn:   #f2a66a;
  /* --danger on the same dark plates, one value in both themes because the
     plates are dark in both: 8.6:1 on --brand-deep in Light, 10.8:1 in
     Dark, 7.0:1 on --bar. Was a light-dark() with the same colour twice. */
  --on-bar-danger: #ffb4a8;
  --bar-rule:      light-dark(transparent, #e0b473);
  --note-bg:       light-dark(#e4e9ef, #dcd9d3);
  --note-line:     light-dark(#a3afbd, #a8a195);
  --note-icon:     light-dark(#2c3846, #1f2a37);
  /* Red stays red in Dark (Josh, 2026-11-17: "keep red not pink"): #ff6155 is
     4.5:1 on --surface and 5.4:1 on --bg in Dark; it was a salmon #ff9f92. */
  --error:         light-dark(#a33526, #ff6155);
  /* Status (Ive review, 2026-10-08): one set for every app, each AA on
     --bg, --surface and --surface-2 in both themes. --danger is --error. */
  --ok:            light-dark(#2f6b3b, #8fd19e);
  --warn:          light-dark(#8f430f, #f2a66a);   /* orange: never the gold, which means "met" */
  --danger:        var(--error);
  /* A solid red with white words (Hang Up, a destructive Primary): the text
     red is too light to carry white words in Dark. */
  --danger-fill:   light-dark(#a33526, #c62f24);
  /* Script inks: the four colours the script editor offers (Josh,
     2026-10-08: "Four named inks"). Stored as their light hex; painted
     through these so each reads in both themes. */
  --ink-brick:     light-dark(#a33526, #ff9f92);
  --ink-gold:      light-dark(#8a5f20, #e0b473);
  --ink-blue:      light-dark(#1f5c99, #86bdf2);
  --ink-green:     light-dark(#2f6b3b, #8fd19e);
  /* Elevation. Dark mode lifts by a hairline as well as a shadow, because a
     black shadow on a near-black page is invisible. */
  --shadow-1: 0 1px 2px light-dark(rgb(0 0 0 / 0.08), rgb(0 0 0 / 0.4)),
              0 0 0 1px light-dark(transparent, rgb(255 255 255 / 0.05));
  --shadow-2: 0 4px 12px light-dark(rgb(0 0 0 / 0.12), rgb(0 0 0 / 0.5)),
              0 0 0 1px light-dark(transparent, rgb(255 255 255 / 0.06));
  --shadow-3: 0 12px 32px light-dark(rgb(0 0 0 / 0.18), rgb(0 0 0 / 0.6)),
              0 0 0 1px light-dark(transparent, rgb(255 255 255 / 0.08));
  /* The dim layer behind a dialog or a drawer (Ive review, 2026-10-09): one
     value, not black 55% here and slate 45% there. Slate-tinted in Light;
     deeper in Dark, where the page is already dark. */
  --scrim:    light-dark(rgb(17 21 26 / 0.5), rgb(0 0 0 / 0.62));
  /* The focus ring. Deep gold reads on the light page (5:1) but is 2.6:1 on
     a dark slate bar in Light, so a dark surface sets --ring: var(--accent)
     (5.5:1 on --brand-deep, 4.5:1 on --bar). */
  --ring:     var(--accent-strong);
  /* Tonality (CQF scripts, 2026-09-28): the five call tones, each clear of
     brick (cues), green (Keep Going) and brass (buttons). Light inks hold
     5:1 on their own 14% chip tint; dark inks 5.5:1. */
  --tone-curious:     light-dark(#1f5c99, #86bdf2);
  --tone-concerned:   light-dark(#962d58, #f39cbf);
  --tone-confused:    light-dark(#5f41a8, #bba7f5);
  --tone-challenging: light-dark(#8f430f, #f2a66a);
  --tone-playful:     light-dark(#15645e, #79d4cc);

  /* ---- Type families ---------------------------------------------------- */
  --font-display: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* ---- Fluid scale — 1.2 ratio at 320px → 1.25 at 1240px ----------------
     --step--2 is the floor for badges, counts and micro-labels: 12px on a
     phone, never below 11px, and nothing in the apps goes under it. */
  --step--2: clamp(0.750rem, 0.733rem + 0.087vw, 0.800rem);
  --step--1: clamp(0.833rem, 0.810rem + 0.116vw, 0.900rem);
  --step-0:  clamp(1.000rem, 0.957rem + 0.217vw, 1.125rem);
  --step-1:  clamp(1.200rem, 1.128rem + 0.359vw, 1.406rem);
  --step-2:  clamp(1.440rem, 1.329rem + 0.553vw, 1.758rem);
  --step-3:  clamp(1.728rem, 1.565rem + 0.816vw, 2.197rem);
  --step-4:  clamp(2.074rem, 1.839rem + 1.170vw, 2.747rem);
  --step-5:  clamp(2.488rem, 2.160rem + 1.643vw, 3.433rem);

  /* ---- Tracking — never negative; scales inversely with size (§3.1) ------
     Capitals need MORE tracking than lowercase, not less. Under ~0.1em caps
     run together, which is why --track-label exists at 0.12em. */
  --track-display: 0.005em;
  --track-heading: 0.01em;
  --track-body:    0.011em;
  --track-small:   0.02em;
  --track-label:   0.12em;
  --track-eyebrow: 0.28em;

  /* ---- Leading — a ladder, not one value (§3.2) -------------------------
     --leading-tight is load-bearing: a blanket 1.65 would add pages to the
     CQF's ~90-field sheet. Prose gets 1.65; density gets 1.4. */
  --leading-display: 1.15;
  --leading-heading: 1.3;
  --leading-body:    1.65;
  --leading-tight:   1.4;

  /* ---- Radii — ten values collapsed to four (§4.1) ---------------------- */
  --radius-sm:   0.375rem;
  --radius:      0.625rem;
  --radius-lg:   1rem;
  --radius-pill: 999px;

  /* ---- The signature: sand hairlines (§4) ------------------------------- */
  --rule: 1px solid var(--line);

  /* ---- Layout ----------------------------------------------------------- */
  --wrap:        72rem;
  --wrap-narrow: 46rem;
  --bp-sm: 30rem;
  --bp-md: 48rem;
  --bp-lg: 64rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Motion: one curve, three durations (Ive review, 2026-10-08; --dur-slow
     2026-10-10). --dur-fast answers a press, --dur changes a state in place,
     --dur-slow is for things that cross the screen (drawers, sheets, a view
     changing). No literal durations anywhere; all collapse under reduced
     motion below. */
  --dur-fast: 120ms;
  --dur:      160ms;
  --dur-slow: 320ms;

  /* ---- Spacing — eighths of a rem (Josh, 2026-10-08: "Convert everything
     now"). Named by eighths: --sp-4 is 4/8 = 0.5rem. Every padding, margin
     and gap in the apps' own CSS uses these; em and px values, negatives and
     calc() arithmetic stay literal on purpose. */
  --sp-1:  0.125rem;
  --sp-2:  0.25rem;
  --sp-3:  0.375rem;
  --sp-4:  0.5rem;
  --sp-5:  0.625rem;
  --sp-6:  0.75rem;
  --sp-7:  0.875rem;
  --sp-8:  1rem;
  --sp-10: 1.25rem;
  --sp-12: 1.5rem;
  --sp-14: 1.75rem;
  --sp-16: 2rem;
  --sp-18: 2.25rem;
  --sp-20: 2.5rem;
  --sp-24: 3rem;
  --sp-32: 4rem;
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: var(--leading-body);
  letter-spacing: var(--track-body);
  -webkit-text-size-adjust: 100%;
}

/* ---- Headings — Title Case, relaxed, never uppercase (§3.3) -------------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: 500;
  text-wrap: balance;
}
h1, h2 { line-height: var(--leading-display); letter-spacing: var(--track-display); }
h3, h4, h5, h6 { line-height: var(--leading-heading); letter-spacing: var(--track-heading); }

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

.display { font-size: var(--step-5); line-height: var(--leading-display); letter-spacing: var(--track-display); }
.lede { font-size: var(--step-1); line-height: var(--leading-body); color: var(--text-muted); text-wrap: pretty; }
.small { font-size: var(--step--1); letter-spacing: var(--track-small); }

/* ---- Eyebrow + label: the two places caps are correct -------------------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-eyebrow);
  color: var(--accent-strong);
}
.label {
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track-label);
  color: var(--text-muted);
}

/* ---- The hairline device — the brand's own signature (§4) ---------------
   docs/brand.md: "The rules are the system's signature, not decoration —
   they recur as section dividers, card edges, and in the marks." */
.rule { border: 0; border-block-start: var(--rule); margin: 0; }
.rule--twin {
  border: 0;
  border-block-start: var(--rule);
  border-block-end: var(--rule);
  block-size: 0.32rem;
  margin: 0;
}
.ruled-head { padding-block-end: var(--sp-4); border-block-end: var(--rule); margin-block-end: var(--sp-8); }

/* ---- Surfaces ------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-10);
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  min-block-size: 2.75rem;           /* 44px tap-target floor */
  padding: var(--sp-5) var(--sp-10);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: var(--track-heading);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text); }
/* A press you can feel (Ive review, 2026-10-08): the touched control gave no
   answer to a finger. Hover is for a mouse only, so a tap leaves nothing
   behind that reads as "selected". */
/* `button:not(:disabled):active` below answers the press for every button,
   .btn included; a second scale here pressed a .btn twice (Stage 4 audit). */
/* ONE HOVER FOR EVERY BUTTON (Josh, 2026-10-10: "the button hover … should
   work on all buttons throughout the CQF/Guides/Tracking system … make them
   all the same, including the sidebar tabs"), and it REVERSES (Josh, same
   day, over a muddy Sign In With a Passkey: "when hovered text and animated
   colors should have a reverse affect"). A filled button — gold with slate
   words (a picked chip, the Objections / Calendar / Notes tabs) — turns slate
   with gold words and a gold edge; an outline button (and an unpicked chip or
   choice) fills gold with slate words. Words and fill trade places; nothing
   goes to a half-shade, which is what made the passkey button unreadable
   (the old filled hover darkened the gold behind a page's own gold text).
   The colours cross-fade at --dur (stilled by reduced motion with the rest).
   --accent is per theme; --on-accent is the one slate in both, so in Dark
   the reversed button is the gold edge and gold words on a slate plate.
   The edge tabs have no border, so theirs is an inset gold ring, and their
   slate count disc turns gold (it is the same slate as the reversed tab).
   A tone chip reverses in its own tone. Not here: underline text controls
   (login's .linkish), the Guides menu's filter rail (#bar-actions .chip —
   a gold pill on that plate is the failure its own rule names), and the
   controls that are WORDS, not buttons (Josh, 2026-10-10: "the non-button
   'button' … should not be affected by the actual button styling"): any
   [role="tab"] (Login's Sign In / Request Access, Tracking's Log Today and
   Weeks), a table's sort header (th button) and the CQF's step list
   (#wizard-progress button). Their hover only changes the words, never
   fills. Every fill rule below carries that same exclusion, and
   check_shared.py's check_text_controls_skip_button_hover fails if one
   drops it.
   !important because several sites pin a button's resting colours by id
   (#my-leads-pager .quiet, #agent-avatar-clear …), which would otherwise
   outrank a hover; it is mouse-only and never touches a disabled button or an
   open tab. Text links styled as buttons (.linklike, .nav-link), icon
   buttons and menu rows keep their own hover. */
:is(.btn, button:not([class]), button.quiet, .detail-edit .linkish, .book-btn, .chip, .tone-chip,
    .feedback-kind-option, .present-tab, .button) {
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease),
              scale var(--dur-fast) var(--ease);
}
@media (hover: hover) {
  :is(.btn, button:not([class]), .detail-edit .linkish, .book-btn, button.ob-first-only,
      .chip[aria-pressed="true"], .feedback-kind-option[aria-pressed="true"],
      .obj-tab:not([aria-expanded="true"]), .cal-tab:not([aria-expanded="true"]),
      body:not(.notes-drawer-open) .notes-tab,
      .button:not(.button-quiet)):not(.btn--ghost, .btn--pk, .quiet, #bar-actions .chip, [role="tab"], th button, #wizard-progress button, :disabled, [aria-disabled="true"]):hover {
    background: var(--on-accent) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
  }
  :is(button.quiet, .btn--ghost, .btn--pk, .present-tab, .chip:not([aria-pressed="true"]),
      .feedback-kind-option:not([aria-pressed="true"]), .button-quiet,
      .book-type:has(.book-btn[aria-pressed="true"]) .book-btn[aria-pressed="false"]):not(#bar-actions .chip, [role="tab"], th button, #wizard-progress button, :disabled, [aria-disabled="true"]):hover {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--on-accent) !important;
  }
  :is(.obj-tab:not([aria-expanded="true"]), .cal-tab:not([aria-expanded="true"]),
      body:not(.notes-drawer-open) .notes-tab):not([role="tab"], th button, #wizard-progress button):hover {
    box-shadow: inset 0 0 0 2px var(--accent) !important;
  }
  :is(.obj-tab, .cal-tab, .notes-tab):hover :is(.obj-tab-n, .cal-tab-n) {
    background: var(--accent) !important;
    color: var(--on-accent) !important;
  }
  .tone-chip:not([role="tab"], th button, #wizard-progress button, :disabled):hover {
    background: var(--tone) !important;
    border-color: var(--tone) !important;
    color: var(--surface) !important;
  }
}

a { color: var(--accent-strong); text-underline-offset: 0.18em; }

/* The ring only: a `border-radius` here reshaped the ELEMENT, so a pill
   button squared to 6px the moment it took keyboard focus (Stage 4 audit). */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
/* Every masthead is a dark plate in both themes. */
.bar { --ring: var(--accent); }

/* ---- Dialogs: one edge and one dim layer for every app ------------------
   A dialog with no shadow had no edge in Dark, where its surface sits a
   shade off the page. */
/* One shell too (Stage 4 audit): the CQF set it on `dialog`, Guides on
   `#bell-dialog`, Tracking nowhere, so the one shared bell opened a
   browser-default box there. Widths stay each dialog's own. */
dialog {
  border: 0;
  border-radius: var(--radius);
  padding: var(--sp-12);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-3);
}
dialog::backdrop { background: var(--scrim); }

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0.01ms; --dur: 0.01ms; --dur-slow: 0.01ms; }
  /* The fleet standard (toolbox/surveyor SPEC, "The reduced-motion
     standard"): one short iteration, so a looping animation stops instead of
     flickering, and no smooth scrolling. */
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* ---- The bell (bell.mjs) ------------------------------------------------
   One bell across the CQF apps (spec 2026-10-05-one-bell). Row layout is
   keyed on [data-kind], which bell.mjs sets, so a site still drawing its own
   rows (Tracking, until it joins) keeps them. */
/* The bell sits directly before the hamburger and TAKES its auto margin: of
   the controls at the end of the bar, the first one carries `auto` and the
   rest follow it. The sibling rule outranks every later `.menu-toggle` margin
   on purpose, so the hamburger cannot drift away from the bell at any width.
   That is also why the bell is never display:none on screen. */
.bar-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-inline-size: 2.75rem;
  min-block-size: 2.75rem;
  padding: var(--sp-3);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: inherit;
  cursor: pointer;
  margin-inline-start: auto;
  transition: border-color var(--dur) var(--ease);
}
@media (hover: hover) { .bar-bell:hover { border-color: currentColor; } }
.bar-bell:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.bar-bell__icon { inline-size: 1.4em; block-size: 1.4em; flex: none; }
.bar-bell__count {
  position: absolute;
  inset-block-start: 0.2rem;
  inset-inline-end: 0.15rem;
  min-inline-size: 1.15rem;
  block-size: 1.15rem;
  padding-inline: var(--sp-2);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font: 700 var(--step--2)/1.15rem var(--font-body);
  text-align: center;
}
/* ONE EVEN GAP across inbox icon, bell and menu (Josh, 2026-11-08, from a
   phone screenshot: the icons bunched and the bell's count disc touched the
   hamburger ring). The -0.6rem that used to pull the hamburger toward the
   bell made the gap negative under a phone's tight column-gap; now every
   control in the right-hand group sits one column-gap from the next, and the
   disc (inset 0.15rem inside the bell) is always that gap clear of the ring. */
.bar .bar-bell ~ .menu-toggle { margin-inline-start: 0; }
/* The hamburger, shared: every app drew the same 44px ring and none gave it a
   hover while the bell beside it gained one (Stage 4). The ring thickens. */
.bar .menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-inline-size: 2.75rem;
  min-block-size: 2.75rem;
  padding: var(--sp-3);
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: box-shadow var(--dur) var(--ease);
}
@media (hover: hover) { .bar .menu-toggle:not([role="tab"], th button, #wizard-progress button):hover { box-shadow: inset 0 0 0 1px currentColor; } }
/* The role tags (Josh, 2026-10-31, mockup D; split 2026-11-13; brand.js
   cqfRoleTag): an Agency Owner's header carries a gold edge and a gold AO tag
   (outline) or AO+ tag (solid, an Agency Director or higher); an Admin or
   Super Admin gets a quiet CQF Admin tag after it, with no gold edge of its
   own. Hover (or focus) shows My Agency / Admin Panel and the tag opens it;
   on a touch screen the first tap shows My Agency and the second opens it.
   My Agency is laid OVER the tag, growing to its left, so the bar never
   reflows when it appears: a phone header has no room to give. The tag
   takes the bell's auto margin and the bell sits beside it. */
.bar.has-role-tag { box-shadow: inset 6px 0 0 0 var(--accent); }
.role-tag {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  min-block-size: 2rem;
  min-inline-size: 2.75rem;
  padding: 0 var(--sp-4);
  margin-inline-start: auto;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-pill);
  color: var(--accent);
  font: 700 var(--step--1)/1 var(--font-body);
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
/* A 44px target around the 32px pill. */
.role-tag::before { content: ""; position: absolute; inset: -6px -4px; }
/* `~`, not `+`: the voicemail and text icons sit between the tag and the bell
   (hidden on an account without the Dialer). Two auto margins would split the
   free room and leave the tag mid-bar, over the title (Josh, 2026-11-06). */
.bar .role-tag ~ .bar-inbox, .bar .role-tag ~ .bar-bell { margin-inline-start: var(--sp-2); }
.role-tag__go {
  position: absolute;
  inset-block: -1.5px;
  inset-inline-end: -1.5px;
  z-index: 1;
  display: none;
  align-items: center;
  padding: 0 var(--sp-5);
  border-radius: inherit;
  background: var(--accent);
  color: var(--on-accent);
  letter-spacing: 0;
}
@media (hover: hover) and (pointer: fine) { .role-tag:hover .role-tag__go { display: flex; } }
.role-tag:focus-visible .role-tag__go,
.role-tag[data-open] .role-tag__go { display: flex; }
.role-tag:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
/* The open (or hovered) tag paints over its neighbour's reveal. */
.role-tag:is(:hover, :focus-visible, [data-open]) { z-index: 3; }
/* AO+: solid gold. Its reveal turns slate with gold words, so the hover still
   reads as a change on a pill that is already gold (Ive lens, 2026-11-13). */
.role-tag--plus { background: var(--accent); color: var(--on-accent); }
.role-tag--plus .role-tag__go { background: var(--brand-deep); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
/* CQF Admin: a job, not a rank. A soft filled tag with no border, so it never
   reads as the menu button or as outranking the gold (Ive and Mylett lenses);
   always after the rank tag, a 44px target's width apart. */
.role-tag--admin {
  margin-inline-start: auto;
  border-color: transparent;
  background: color-mix(in oklch, var(--on-brand) 14%, transparent);
  color: var(--on-brand);
  font-weight: 600;
  letter-spacing: 0;
}
.role-tag--rank + .role-tag--admin { margin-inline-start: var(--sp-4); }
.role-tag--admin .role-tag__go { background: color-mix(in oklch, var(--on-brand) 26%, var(--brand-deep)); color: var(--on-brand); }
/* Never on a screen share: a family or a recruit has no use for either word
   (Producer lens, 2026-11-13). */
body.showtime-live .role-tag { display: none !important; }
/* Your Agency in the menu (brand.js cqfAgencyMenu; mockup B): the section
   label and its rules in gold, and a gold edge on each row. The rows are
   inside #menu-account, so each app's own row styling does the rest. */
.menu-agency { display: contents; }
body.menu-open #bar-actions .menu-label.agency-label { color: var(--accent); }
body.menu-open #bar-actions .menu-label.agency-label::before,
body.menu-open #bar-actions .menu-label.agency-label::after { border-block-start-color: var(--accent); }
body.menu-open #bar-actions #menu-account a.agency-menu-row { box-shadow: inset 3px 0 0 var(--accent); }
body.menu-open #bar-actions #menu-account .agency-label + a.agency-menu-row { border-block-start: 0; }
.agency-menu-count {
  margin-inline-start: auto;
  min-inline-size: 1.5rem;
  padding: 0 var(--sp-2);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font: 700 var(--step--1)/1.5rem var(--font-body);
  text-align: center;
}
.agency-menu-count[hidden] { display: none; }
/* Phones and small tablets: the title is centred over the whole bar, so the
   only free room is beside Home. The tag sits there (above the title's box),
   the bell takes the auto margin back, and My Agency opens to the right. */
@media (max-width: 48rem) {
  .role-tag, .role-tag--admin { margin-inline-start: 0; z-index: 2; }
  .bar .role-tag ~ .bar-bell { margin-inline-start: auto; }
  .role-tag__go { inset-inline-end: auto; inset-inline-start: -1.5px; }
}
/* The inbox icon (inbox.mjs): one icon for voicemails and texts since
   2026-11-08 (two left a phone title 12px wide), the bell's own size, so the
   three controls on the right read as one group at one gap. */
.bar-inbox { display: inline-flex; flex: none; margin-inline-start: auto; }
.bar-inbox[hidden] { display: none; }
.bar-inbox .bar-bell { margin-inline-start: 0; }
.bar .bar-inbox:not([hidden]) + .bar-bell { margin-inline-start: 0; }
.inbox-section { display: grid; gap: 0; }
.inbox-section + .inbox-section { margin-block-start: var(--sp-8); }
.inbox-section-title {
  margin: 0 0 var(--sp-2);
  font: 600 var(--step--1)/1.2 var(--font-body);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-muted);
}
.inbox-row { padding-block: var(--sp-3); border-block-end: var(--rule, 1px solid var(--line)); }
.inbox-row:last-child { border-block-end: 0; }
.inbox-row.is-new { font-weight: 600; }
.inbox-link { display: grid; gap: 2px; color: inherit; text-decoration: none; }
.inbox-link time { font-size: 0.85em; font-weight: 400; color: var(--text-muted); }
.inbox-link span { font-weight: 400; }
@media (max-width: 48rem) {
  /* Three icons and the menu can't sit around a centred title, so the title
     takes the gap between them and centres in it. It is the title LINK that
     each app centres absolutely (a.home), not the h1: the rule used to move the
     h1, so the link stayed put and sat over the icons (Josh, 2026-11-06). The
     gaps tighten so the title keeps room, and the tag reads before it. */
  body.has-inbox .bar a.home {
    position: static; inset: auto; transform: none; translate: none;
    inline-size: auto; max-inline-size: none; flex: 1 1 0; min-inline-size: 0; padding-inline: 0;
  }
  body.has-inbox .bar a.home h1 { text-align: center; justify-content: center; }
  body.has-inbox .bar a.home .lockup { margin-inline: auto; }
  body.has-inbox .bar, body.has-inbox .bar .bar-mast { column-gap: var(--sp-3); }
  body.has-inbox .bar .go-home { order: -2; }
  body.has-inbox .bar .role-tag { order: -1; }
  .bar .role-tag + .bar-inbox:not([hidden]) { margin-inline-start: auto; }
}
/* A narrow phone with the tag AND the inbox icon: the title would be left a
   few pixels ("CQF TRACKING" at 6px, measured 2026-11-06 at 360). The tag
   gives way: the gold edge still marks the account, and My Agency is in the
   menu under Your Agency. */
@media (max-width: 26rem) {
  body.has-inbox .bar :is(.role-tag) { display: none; }
}
/* Two tags on a phone: the rank stays, CQF Admin gives way (it is in the
   menu as Admin). */
@media (max-width: 30rem) {
  .bar .role-tag--rank ~ .role-tag--admin { display: none; }
}
/* THE PHONE TITLE IS ONE SIZE ON EVERY APP (Josh, 2026-11-08). Each app sizes
   its title link as a container (the gap between the icon groups) and used
   to size the mark by its own lockup's width — "CQF" alone 27cqi on the CQF,
   CQF / GUIDES 10.5cqi, CQF / TRACKING 8.6cqi — so the same phone read the
   mark at 24px in one app and 12px in the next, and Tracking had no floor
   (5.6px at 320). One formula, the longest lockup's, so an equal gap gives an
   equal mark; the 11px floor THE and APP already keep; ellipsis stays the
   backstop. After each app's own container rules, which it relies on. */
@media (max-width: 48rem) {
  .bar a.home .mast-title, .bar a.home.home-title h1 { font-size: max(11px, min(8.6cqi, 1.5rem)); }
}
/* 26rem on every app (Josh, 2026-10-14): the CQF and Guides capped it there
   by hand and Tracking widened it to 36rem. The inbox dialog is the bell's
   twin in every measure (family audit 2026-11-08, Stage 4 M2, M3, M12): same
   width, same height cap, same title size, same drawn close in a ringed pill.
   The title is set here because the shared dialog used to inherit each app's
   h2 — 19px on the CQF, 28px on Guides and Tracking. */
#bell-dialog, #inbox-dialog {
  width: min(26rem, calc(100vw - 2rem));
  max-width: 26rem;
  max-height: min(34rem, calc(100dvb - 4rem));
  overflow-y: auto;
}
#bell-dialog .bell-head, #inbox-dialog .bell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  margin-block-end: var(--sp-6);
}
#bell-dialog .bell-head h2, #inbox-dialog .bell-head h2 {
  margin: 0;
  font: 500 var(--step-1)/var(--leading-heading) var(--font-display);
  letter-spacing: var(--track-heading);
}
/* The row buttons (bell.mjs `control`): one 44px pill in every app. Each app's
   `.quiet` used to decide — a 34px pill on Guides, an underlined link in a
   29px box on Tracking (Stage 4 M11). The id outranks any app's class rule. */
#bell-dialog .bell-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-block-size: 2.75rem;
  padding: var(--sp-3) var(--sp-8);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font: 500 var(--step--1)/1 var(--font-body);
  letter-spacing: var(--track-small);
  text-decoration: none;
  cursor: pointer;
}
#bell-dialog .bell-act:disabled { color: color-mix(in oklch, var(--text) 48%, var(--bg)); cursor: not-allowed; }
.bell-empty { margin: 0; color: var(--text-muted); }
/* Clear Notifications (bell.mjs, Josh 2026-11-12): a quiet link under the
   rows, 44px tall to tap, coloured like every link. */
#bell-dialog .bell-clear {
  display: block;
  margin: var(--sp-4) 0 0 auto;
  min-block-size: 2.75rem;
  padding: 0 var(--sp-2);
  border: 0;
  background: none;
  color: var(--accent-strong);
  font: 500 var(--step--1)/1 var(--font-body);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
#bell-dialog .bell-clear:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-sm); }
#bell-dialog .bell-x, #inbox-dialog .bell-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  padding: 0;
  border: 1px solid var(--text-muted);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
#bell-dialog .bell-x svg, #inbox-dialog .bell-x svg { inline-size: 1.2rem; block-size: 1.2rem; }
#bell-dialog .bell-x:focus-visible, #inbox-dialog .bell-x:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
#bell-list { display: grid; gap: var(--sp-5); text-align: start; }
#bell-list .bell-row[data-kind] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4) var(--sp-8);
  padding-block-end: var(--sp-5);
  border-block-end: 1px solid var(--line);
}
#bell-list .bell-row[data-kind]:last-child { border-block-end: 0; padding-block-end: 0; }
#bell-list .bell-row[data-kind] p { margin: 0; flex: 1 1 14rem; }


/* ---- Dialogs open with a short fade and rise (Josh, 2026-10-08) ---------- */
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: dialog-in var(--dur) var(--ease); }
  dialog[open]::backdrop { animation: backdrop-in var(--dur) var(--ease); }
}
@keyframes dialog-in {
  from { opacity: 0; translate: 0 0.375rem; }
}
@keyframes backdrop-in {
  from { opacity: 0; }
}
/* Every button answers a press, not only .btn (Ive round 2): `scale`, the
   individual property, so a button already carrying a transform keeps it. */
button:not(:disabled):active { scale: 0.98; }
/* ONE DISABLED LOOK (family audit 2026-11-08, Stage 4 M18; Josh: flat outline,
   muted words). Before this rule each app had its own: Guides' disabled .btn
   was pixel-identical to a live one; the CQF's and Tracking's in Dark were a
   #13171c plate under #cbccd0 words, the reversed-hover look of a LIVE
   button; Login and Survey dimmed to 0.6. Here: no fill, the hairline edge,
   words dimmed toward the ground (about 3:1 in both themes), the cursor says
   so. Colour AND cursor: forced-colors discards the fill, the cursor survives.
   Not a fill rule, so the hover block above never reaches it (it excludes
   :disabled). The bar's own quiet buttons keep their on-brand colours. */
:is(button, .btn, .button):disabled, :is(button, .btn, .button)[aria-disabled="true"] {
  background: transparent;
  border-color: var(--line);
  color: color-mix(in oklch, var(--text) 48%, var(--bg));
  cursor: not-allowed;
  opacity: 1;
}


/* ---------------------------------------------------------------------------
   SHOW ME AROUND (tour.mjs; spec 2026-10-10-onboarding-tours-design). One dim
   for the whole tour: a clear window over the lit part, the ring drawn on that
   window in --ring (never by restyling the part, which squared pills and was
   clipped by overflow parents), closing to nothing for a centred step. The
   card sits beside the part with a small tail in its own surface.
   --------------------------------------------------------------------------- */
.tour-dim {
  position: fixed;
  z-index: 59;
  pointer-events: none;
  border-radius: var(--radius-lg);
  outline: 2px solid var(--ring);
  outline-offset: 0;
  box-shadow: 0 0 0 200vmax var(--scrim);
}
.tour-dim--centre {
  top: 50% !important; left: 50% !important;
  width: 0 !important; height: 0 !important;
  outline-color: transparent;
}
.tour-dim--glide {
  transition: top var(--dur-slow) var(--ease), left var(--dur-slow) var(--ease),
              width var(--dur-slow) var(--ease), height var(--dur-slow) var(--ease),
              outline-color var(--dur-slow) var(--ease);
}
.tour {
  position: fixed;
  z-index: 60;
  inset: auto;
  margin: 0;
  box-sizing: border-box;
  width: min(34rem, 100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: var(--sp-8) var(--sp-10);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-3);
}
.tour.tour-center { inset: 0; margin: auto; height: fit-content; }
.tour.tour-tail-up, .tour.tour-tail-down { overflow: visible; }
/* The tail: a small wedge in the card's own surface, the hairline along it. */
.tour.tour-tail-up::before, .tour.tour-tail-down::before {
  content: "";
  position: absolute;
  left: var(--tail-x);
  inline-size: 0.875rem;
  block-size: 0.875rem;
  background: var(--surface);
  border: 1px solid var(--line);
  translate: -50% 0;
  rotate: 45deg;
  pointer-events: none;
}
.tour.tour-tail-up::before { top: -0.47rem; border-inline-end: 0; border-block-end: 0; }
.tour.tour-tail-down::before { bottom: -0.47rem; border-inline-start: 0; border-block-start: 0; }
.tour-eyebrow {
  margin: 0 0 var(--sp-2);
  font: 600 var(--step--2)/1.2 var(--font-body);
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--accent-strong);
}
.tour #tour-title {
  margin: 0 0 var(--sp-3);
  font: 600 var(--step-2)/var(--leading-heading) var(--font-display);
  letter-spacing: var(--track-heading);
  text-wrap: balance;
}
.tour-body { margin: 0; line-height: var(--leading-body); text-wrap: pretty; }
.tour-art:empty, .tour-extra[hidden], .tour-links[hidden], .tour-eyebrow[hidden] { display: none; }
.tour-links { display: flex; flex-wrap: wrap; column-gap: var(--sp-6); margin: var(--sp-2) 0 0; }
/* The three apps (HTML, so it reads on a phone): stacked on a phone, side by
   side from 40rem, the app you are in filled. */
.tour-pic { margin: var(--sp-4) 0 var(--sp-6); }
.tour-apps {
  display: grid;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
@media (min-width: 40rem) { .tour-apps { grid-template-columns: repeat(3, 1fr); } }
.tour-app-box {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  block-size: 100%;
  box-sizing: border-box;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}
.tour-app-box strong { font: 600 var(--step-0)/1.2 var(--font-display); }
.tour-app-box span { font-size: var(--step--1); color: var(--text-muted); }
a.tour-app-box { transition: border-color var(--dur) var(--ease); }
@media (hover: hover) { a.tour-app-box:hover { border-color: var(--accent); } }
a.tour-app-box:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
/* The app you are in: the masthead's own slate (--bar), which Dark raises
   above the card where --brand-deep sank it to 1.37:1 (Stage 4 M17). */
.tour-app--here .tour-app-box {
  background: var(--bar);
  border-color: var(--bar);
  border-block-end: 2px solid var(--bar-rule);
}
.tour-app--here .tour-app-box strong { color: var(--on-bar); }
.tour-app--here .tour-app-box span { color: var(--on-brand-mut); }
.tour-loop {
  margin: var(--sp-3) 0 0;
  font-size: var(--step--1);
  color: var(--text-muted);
}
.tour-loop::before { content: "\21BB\00A0"; color: var(--accent-strong); }
.tour-extra { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); margin-top: var(--sp-6); }
.tour-link {
  font: inherit;
  font-size: var(--step--1);
  color: var(--text);
  background: none;
  border: 0;
  padding: var(--sp-3) 0;
  min-block-size: 2.75rem;
  display: inline-flex;
  align-items: center;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.tour-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}
.tour-skip {
  margin-inline-end: auto;
  font: inherit;
  font-size: var(--step--1);
  color: var(--text-muted);
  background: none;
  border: 0;
  padding: var(--sp-3) 0;
  min-block-size: 2.75rem;
  display: inline-flex;
  align-items: center;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.tour-skip[hidden] + .tour-dots { margin-inline-end: auto; }
.tour-skip:focus-visible, .tour-link:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.tour-dots { display: flex; gap: 0.375rem; margin: 0; padding: 0; list-style: none; }
.tour-dots[hidden] { display: none; }
.tour-dots li {
  inline-size: 0.4375rem;
  block-size: 0.4375rem;
  border-radius: 50%;
  background: var(--line);
  transition: background var(--dur) var(--ease);
}
.tour-dots li.on { background: var(--accent-strong); }
/* A step acting itself out (tour.mjs: tap, typeInto, beat): the field being
   typed in wears the focus ring, a part it reads lights in turn, and a tap
   spreads a ring from where it landed, above the dim and never in the way. */
.tour-typing { outline: 2px solid var(--ring); outline-offset: 2px; }
.tour-beat { animation: tour-beat 1.4s var(--ease); border-radius: var(--radius-sm); }
@keyframes tour-beat {
  20%, 60% { background-color: color-mix(in oklch, var(--accent) 24%, transparent); }
}
.tour-tap {
  position: fixed;
  z-index: 61;
  width: 2.75rem;
  height: 2.75rem;
  margin: -1.375rem 0 0 -1.375rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  animation: tour-tap 0.65s var(--ease) forwards;
}
@keyframes tour-tap {
  from { transform: scale(0.4); opacity: 1; }
  to { transform: scale(1.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-tap { display: none; }
  .tour-beat { animation: none; outline: 2px solid var(--ring); outline-offset: 2px; }
}
.tour .btn[hidden] { display: none; }
@media (max-width: 30rem) {
  .tour { padding: var(--sp-7) var(--sp-7); }
  .tour-dots { order: -1; inline-size: 100%; }
}

/* ---- Achievement coins, shared (Tracking v7.0.0) --------------------------
   coin.mjs paints the coin; these keep its light effects still until asked
   and set its lettering, and put an agent's newest coin on the lower right of
   their avatar in every app (Josh, 2026-10-13: "they should sync"). */
.coin-svg text { font-family: var(--font-display), sans-serif; font-weight: 800; font-variant-numeric: tabular-nums; }
.coin-svg .coin-date { font-weight: 750; }
.coin-shine { transform-box: view-box; translate: -110px 0; }
.coin-rimrun, .coin-glint { opacity: 0; }
.avatar-face { position: relative; display: inline-block; flex: none; vertical-align: middle; }
.avatar-coin { position: absolute; inline-size: 42%; aspect-ratio: 1; inset: auto -6% -6% auto; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--brand-deep), 0 2px 5px rgb(0 0 0 / 0.45); pointer-events: none; }
.avatar-coin .coin-svg { display: block; inline-size: 100%; block-size: 100%; }


/* THE SIGNED-OUT BANNER (brand.js cqfSignedOut; the CQF's since 2026-10-07,
   every app's since 2026-11-08). Over everything, so it is seen on the call
   screen too; the link is the one way back. */
.signed-out {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4) var(--sp-8);
  padding: var(--sp-6) var(--sp-8);
  padding-top: max(var(--sp-6), env(safe-area-inset-top));
  background: var(--surface);
  color: var(--text);
  border-bottom: 2px solid var(--warn);
  box-shadow: var(--shadow-3);
}
.signed-out[hidden] { display: none; }
/* Shown as a popover so it sits over an open dialog; undo the browser's
   centred popover box. */
.signed-out[popover] { margin: 0; border: 0; border-bottom: 2px solid var(--warn); inline-size: auto; block-size: auto; max-inline-size: none; overflow: visible; }
.signed-out p { margin: 0; font-weight: 600; }
.signed-out-go {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 var(--sp-8);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  text-decoration: none;
}
@media (hover: hover) { .signed-out-go:not([role="tab"], th button, #wizard-progress button):hover { background: var(--on-accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); } }

/* A NEW VERSION IS OUT (brand.js, 2026-11-10). The signed-out banner's shape
   with a gold rule instead of the warning one: news, not a fault. Top of the
   screen, over the header, never over the call controls at the bottom. */
.new-version {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 999;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4) var(--sp-6);
  padding: var(--sp-5) var(--sp-8);
  padding-top: max(var(--sp-5), env(safe-area-inset-top));
  background: var(--surface);
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  box-shadow: var(--shadow-3);
}
.new-version[hidden] { display: none; }
.new-version[popover] { margin: 0; border: 0; border-bottom: 2px solid var(--accent); inline-size: auto; block-size: auto; max-inline-size: none; overflow: visible; }
.new-version p { margin: 0; font-weight: 600; text-wrap: balance; text-align: center; }
.new-version button { min-height: 2.75rem; padding: 0 var(--sp-8); border-radius: var(--radius-pill); font: inherit; font-weight: 650; cursor: pointer; }
.new-version-go { border: 0; background: var(--accent); color: var(--on-accent); }
.new-version-keep { border: 1px solid var(--line-strong, var(--text-muted)); background: transparent; color: var(--text); }
@media (hover: hover) {
  .new-version-go:not([role="tab"], th button, #wizard-progress button):hover { background: var(--on-accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
  .new-version-keep:hover { border-color: var(--text); }
}

/* Screenshots on a bug report (brand.js cqfBugShots, 2026-11-10). */
.bug-shots { display: grid; gap: var(--sp-3); justify-items: start; margin-block: var(--sp-4); }
.bug-shot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); inline-size: 100%; }
.bug-shot-list:empty { display: none; }
/* A picture being dragged over Send Feedback (brand.js). */
#bug-dialog.is-drop { outline: 2px dashed var(--accent-strong); outline-offset: -6px; }
.bug-shot-list li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-4); font-size: var(--step--1); }
.bug-shot-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-inline-size: 0; }
.bug-shot-hint { margin: 0; color: var(--text-muted); font-size: var(--step--1); }

/* "Saved." under the field that saved (brand.js fieldSaved). */
.field-saved {
  position: fixed;
  z-index: 70;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface, Canvas);
  color: var(--ok, var(--text-muted));
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.18);
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}
.field-saved.is-on { opacity: 1; }
.field-saved.is-error { color: var(--error, var(--text)); }
@media (prefers-reduced-motion: reduce) { .field-saved { transition: none; } }

/* ---------------------------------------------------------------------------
   PRINT. Forcing color-scheme light here resolves EVERY light-dark() token to
   its light half on paper, whatever the OS preference is. This is the
   general fix for the bug class the CQF documents in its own print block: a
   dark-mode token once printed near-white on white paper.
   Site-level print rules and hardcoded print inks still apply on top.
   --------------------------------------------------------------------------- */
@media print {
  .field-saved { display: none; }
  :root { color-scheme: light; }
  .role-tag { display: none !important; }
  .bar.has-role-tag { box-shadow: none; }
  /* v9.4 had no text-wrap; `balance` / `pretty` change where lines break
     and so are pagination levers. wrap is the initial value. */
  h1, h2, h3, h4, h5, h6 { text-wrap: wrap; }
  .lede { text-wrap: wrap; }
  /* The bell and inbox dialogs are screen things too. */
  #bell-dialog, #inbox-dialog, .bell-act, .inbox-section-title, .signed-out, .new-version, .bug-shots, .bug-shot-list { display: none !important; }
  /* Show Me Around is a screen thing; nothing of it reaches paper. */
  .tour, .tour-dim, .tour-pic, .tour-app-box, .tour-extra, .tour-links, .tour-actions, .tour-tap { display: none !important; }
  .tour-typing, .tour-beat { outline: none !important; animation: none !important; }
}
