/* components.css - the ONE shared component layer for the portal (2026-10-04).
   Extended by the layout crew (2026-10-04) into the full shell + component set.

   Every buyer-facing page links this sheet, so the shared navigation, buttons,
   cards, forms, the shell (icon rail + top bar + focus mode + mobile bottom
   bar) and the upsell box come from ONE source and cannot drift page to page.

   It uses the existing design tokens (style.css :root) with literal fallbacks
   so it renders correctly even before style.css loads. It keeps the existing
   visual values, so linking it changes no look on its own - JS (shell.js)
   progressively enhances the served nav into the shell.

   Mobile-first, WCAG AA: 48px touch floors (Fitts), strong focus (WCAG),
   real labels supplied by the page markup, colour never the only signal.
   Brand fonts are NOT self-hosted: Georgia display + system sans only.

   SHELL LAYOUT LAW: rail is column one; the top bar is one quiet row; the
   content is the hero. No permanent third column anywhere. The upsell is a
   box that lives in reserved space (rail foot, or a page margin), never an
   overlay and never over the primary action. */

/* ---- shared top navigation (fallback: shown when JS is off) ---- */
.pagenav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 18px;
}
.pagenav a {
  padding: 6px 12px;
  border: 1px solid var(--line, #D7E4E4);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.pagenav a[aria-current="page"] {
  font-weight: 700;
  border-color: var(--brand-accent, #DA7B46);
}
.pagenav .allowance-chip,
.allowance-chip {
  margin-left: auto;
  align-self: center;
  font-size: 0.78rem;
  color: var(--muted, #4C6B7A);
  border: 1px solid var(--line, #D7E4E4);
  background: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .pagenav .allowance-chip,
  .allowance-chip { margin-left: 0; }
}

/* ---- shared cards ---- */
.card {
  border: 1px solid var(--line, #D7E4E4);
  border-radius: var(--radius, 10px);
  padding: 14px;
  margin: 10px 0;
  background: var(--paper, #F6FAFA);
}

/* ---- shared form controls ---- */
input, select, textarea {
  font: inherit;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  margin: 6px 0 14px;
  border: 1px solid var(--line, #D7E4E4);
  border-radius: 8px;
  color: var(--ink, #1F4C5F);
  background: var(--paper, #F6FAFA);
}
label { display: block; font-weight: 600; margin-top: 8px; }
.field-hint { display: block; font-weight: 400; }

/* ---- shared buttons (primary + secondary + ok + danger) ----
   ONE PRIMARY ACTION (owner item 4, 2026-10-12). A bare <button> is
   NEUTRAL: paper fill, ink text, rule border. Only .btn.primary (and a
   bare .btn, which is an explicit commit) takes the loud ink fill, so a
   page shows exactly one thing it wants the reviewer to press. Before
   this, every bare <button> inherited the ink fill, so Try again and
   Refresh shouted as loudly as the real primary action. */
button, .btn {
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  min-width: 48px;
  padding: 10px 18px;
  margin: 6px 6px 6px 0;
  border-radius: 8px;
  border: 1px solid var(--line, #D7E4E4);
  background: var(--paper, #F6FAFA);
  color: var(--ink, #1F4C5F);
  cursor: pointer;
  text-decoration: none;
}
/* a .btn is an explicit, committed action: it takes the ink fill.
   .btn.primary is the ONE loud action on the page. A bare <button>
   stays neutral (above), so incidental controls never compete. */
.btn, .btn.primary {
  background: var(--ink, #1F4C5F);
  color: var(--paper, #F6FAFA);
  border-color: transparent;
}
button:not([class]) {
  /* explicit: a classless button is neutral, never the primary */
  background: var(--paper, #F6FAFA);
  color: var(--ink, #1F4C5F);
  border-color: var(--line, #D7E4E4);
}
/* hover affordance for the neutral button (it had none) */
button:not([class]):hover:not([disabled]) {
  border-color: var(--ink, #1F4C5F);
}
button.secondary, .btn.secondary {
  background: var(--paper, #F6FAFA);
  color: var(--ink, #1F4C5F);
  border-color: var(--line, #D7E4E4);
}
button.danger, .btn.danger {
  background: var(--paper, #F6FAFA);
  color: var(--signal, #9E5424);
  border-color: var(--signal, #9E5424);
}
button.ok, .btn.ok { background: var(--ok, #1A6B3C); color: #fff; }
/* dark mode: --ink flips LIGHT, so the ink-filled .btn would become a
   pale chip with pale text. Pin both surfaces to the tenant brand ink
   (same law as the rail) and let the neutral button follow the theme. */
[data-theme="dark"] .btn,
[data-theme="dark"] .btn.primary,
[data-theme="dark"] button.ok,
[data-theme="dark"] .btn.ok {
  background: var(--brand-ink, #1F4C5F);
  color: var(--brand-paper, #F6FAFA);
  border-color: transparent;
}
button[disabled] { opacity: 0.55; cursor: wait; }

/* ---- shared focus ring (WCAG 2.4.7) ---- */
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--signal, #9E5424);
  outline-offset: 2px;
}

/* ---- thumb-zone action bar (retained as a shared primitive; the six
   per-page bottom action bars are retired - the shell nav replaces them) ---- */
.actionbar {
  position: static;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 0 2px;
  background: transparent;
  border-top: 1px solid var(--line, #D7E4E4);
}
.actionbar button { min-width: 120px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* =====================================================================
   SHARED COMPONENT SET (layout crew, 2026-10-04)
   Fewer components, done properly. Every class here is the ONE definition
   for its role across all pages.
   ===================================================================== */

/* ---- skeleton (loading state) ---- */
.pc-skeleton, .skeleton {
  display: block;
  height: 16px;
  border-radius: 6px;
  margin: 10px 0;
  background: linear-gradient(90deg, #E7ECF1 25%, #F1F4F7 37%, #E7ECF1 63%);
  background-size: 400% 100%;
  animation: pc-shimmer 1.4s ease infinite;
}
.pc-skeleton--kpi { height: 84px; border-radius: 12px; }
@keyframes pc-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---- empty state ---- */
.pc-empty, .empty-box {
  border: 1px dashed var(--line, #D7E4E4);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: var(--muted, #4C6B7A);
  background: #fff;
}

/* ---- error state (never colour alone: it says the words) ---- */
.pc-error, .error-box {
  border: 1px solid var(--signal, #9E5424);
  border-left-width: 6px;
  border-radius: 10px;
  padding: 14px;
  background: #FFF4EC;
  color: var(--ink, #1F4C5F);
}

/* ---- KPI card ---- */
.pc-kpi {
  border: 1px solid var(--line, #D7E4E4);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
}
.pc-kpi b, .pc-kpi .pc-kpi-number {
  display: block;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--ink, #1F4C5F);
  font-family: Georgia, "Times New Roman", serif;
}
.pc-kpi span, .pc-kpi .pc-kpi-label { color: var(--muted, #4C6B7A); font-size: 0.9rem; }
.pc-kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .pc-kpi-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---- list row + table ---- */
.pc-listrow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule, #E3ECEC);
}
.pc-table { width: 100%; border-collapse: collapse; }
.pc-table th, .pc-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule, #E3ECEC);
}

/* ---- badges + chips (colour PLUS text, never colour alone) ---- */
.pc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid var(--rule, #E3ECEC);
  background: #fff;
  color: var(--ink, #1F4C5F);
}
.pc-badge--ok { border-color: var(--ok, #1A6B3C); }
.pc-badge--warn { border-color: var(--signal, #9E5424); }

/* ---- progress bar (one shared meter) ---- */
.pc-progress, .track {
  height: 10px;
  border-radius: 999px;
  background: var(--rule, #E3ECEC);
  overflow: hidden;
}
.pc-progress > .fill, .track > .fill {
  height: 100%;
  background: var(--wire, #3E9CC9);
  width: 0;
  transition: width 200ms ease;
}

/* ---- toast ---- */
.pc-toast, .toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 60;
  background: var(--ink, #1F4C5F);
  /* text follows the token: --ink flips light in dark mode, so #fff here
     would die on the light chip dark mode gives this surface */
  color: var(--paper, #F6FAFA);
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(31, 76, 95, 0.25);
  max-width: 90vw;
}
.pc-toast.err, .toast.err { background: #8A2A00; }

/* ---- modal / sheet (bottom sheet on a phone) ---- */
.pc-modal-backdrop, .modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(31, 76, 95, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 720px) {
  .pc-modal-backdrop, .modal-backdrop { align-items: center; }
}
.pc-modal, .modal {
  background: #fff;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  overflow: auto;
  border-radius: 16px 16px 0 0;
  padding: 18px;
}
@media (min-width: 720px) { .pc-modal, .modal { border-radius: 16px; } }

/* ---- calendar (the ONE calendar grid: reused by Calendar + Review) ---- */
.pc-cal-week:not(table), .cal-week:not(table) {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule, #E3ECEC);
  border: 1px solid var(--rule, #E3ECEC);
  border-radius: 10px;
  overflow: hidden;
}
.pc-cal-day, .cal-day {
  background: #fff;
  min-height: 48px;
  padding: 6px;
  position: relative;
}
.pc-cal-head { background: var(--paper, #F6FAFA); font-weight: 700; }
.pc-cal-post {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--rule, #E3ECEC);
  border-left: 4px solid var(--wire, #3E9CC9);
  border-radius: 6px;
  padding: 4px 6px;
  margin: 3px 0;
  font-size: 0.76rem;
  background: #fff;
  color: var(--ink, #1F4C5F);
  cursor: pointer;
}
.pc-cal-post--draft { border-left-color: var(--signal, #9E5424); }
.pc-cal-post--published { border-left-color: var(--ok, #1A6B3C); }

/* =====================================================================
   THE SHELL
   ===================================================================== */

/* a [hidden] element must really be hidden: an author display rule on the
   element itself (e.g. .bulk-bar { display:flex }) out-ranks the UA
   [hidden] rule, which left the Review page's empty bulk bar on screen. */
[hidden] { display: none !important; }

/* hide the served fallback nav only once JS has built the shell */
.pc-has-shell .pagenav { display: none; }

.pc-rail {
  position: fixed;
  z-index: 40;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  /* THEME-INVARIANT (2026-10-11): brand navy in BOTH light and dark mode.
     --ink flips to light text in dark mode, so following it here would
     strand the white rail text on a white rail. The rail keeps the
     tenant's brand navy in both themes. */
  background: var(--brand-ink, #1F4C5F);
  color: #fff;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
/* the rail list: a GRID on a phone so every destination is on screen at once
   (icon + short label, no sideways scroll). Was unstyled, so the nine items
   fell back to inline-block and WRAPPED into two ragged rows 169px tall. */
.pc-rail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 2px;
  width: 100%;
  margin: 0;
}
/* the wordmark head is a desktop-sidebar thing only (it used to leak into the
   phone bar as a bogus extra "PodControl" destination) */
.pc-rail-head { display: none; }
.pc-rail-item {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 48px;
  padding: 6px 4px;
  border-radius: 10px;
  color: #E8F2F6;
  text-decoration: none;
  flex: 0 0 auto;
  overflow: hidden;
}
/* LOAD-BEARING - the root cause of the blank collapsed rail (2026-10-04).
   An inline <svg> is a flex item, so it inherited the default flex-shrink:1.
   The label span is invisible in the collapsed rail but is STILL LAID OUT, and
   white-space:nowrap makes its min-content far wider than the 68px rail, so
   the icon was the only flexible thing in the row and shrank to ZERO width.
   An icon must never be allowed to shrink. */
.pc-rail-item svg { width: 22px; height: 22px; display: block; flex: 0 0 auto; }
.pc-rail-label {
  font-size: 0.6rem;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  min-width: 0;
}
.pc-rail-item[aria-current="page"] {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 700;
}
.pc-rail-item:focus-visible { outline: 3px solid var(--signal, #DA7B46); outline-offset: -2px; }
/* collapsed tooltip (label is also visible here, so it is never a mystery icon) */
.pc-tip { display: none; }

.pc-rail-foot { display: none; }
.pc-rail-toggle { display: none; }

/* top bar. POSITION FIXED, not sticky (CLS fix, B-14). A sticky bar occupies
   flow, so building it AFTER first paint pushed <main> down by the bar's whole
   height: measured 61px on arrival and then a further jump to 149px when the
   plan chip's sentence wrapped on a phone. That was the single largest layout
   shift on every shell page. Fixed takes no flow space; the space it needs is
   reserved statically below, so it exists BEFORE the first paint. */
.pc-topbar {
  position: fixed;
  left: 0; right: 0;
  /* the unverified-session bar, when present, sets --pc-notice-h to its own
     height; the shell then starts right below the banner instead of under it */
  top: var(--pc-notice-h, 0px);
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--paper, #F6FAFA);
  border-bottom: 1px solid var(--rule, #E3ECEC);
}
.pc-logo {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  color: var(--ink, #1F4C5F);
  text-decoration: none;
  font-size: 1.05rem;
  white-space: nowrap;
}
.pc-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  max-width: 460px;
  border: 1px solid var(--line, #D7E4E4);
  border-radius: 999px;
  padding: 2px 10px;
  background: #fff;
}
.pc-search input {
  border: 0; margin: 0; padding: 6px 0; min-height: 34px;
  background: transparent; width: 100%;
}
.pc-search input:focus { outline: none; }
.pc-search kbd {
  font: inherit; font-size: 0.72rem; color: var(--muted, #4C6B7A);
  border: 1px solid var(--line, #D7E4E4); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 6px; background: var(--paper, #F6FAFA);
}
.pc-utility { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pc-utility a, .pc-utility button {
  background: transparent; color: var(--ink, #1F4C5F);
  border: 1px solid transparent; border-radius: 8px;
  min-height: 40px; padding: 6px 10px; margin: 0;
  text-decoration: none;
}
.pc-utility a:hover, .pc-utility button:hover { border-color: var(--line, #D7E4E4); }
/* ---- the top bar must never push the page sideways on a phone. ----------
   Measured at 390px: .pc-utility was 505px wide, dominated by the plan
   meter #allowance-chip (284.7px, an honest sentence such as "0 of 60 clips
   delivered this month (60 left)" at 0.78rem) plus the Support link (85.3),
   the Focus button (67.7) and the "You" menu (49.6). The wordmark (83.6) and
   that group cannot share a 362px content box, so the bar and the whole page
   scrolled sideways. Fix at the layout level: let BOTH containers wrap. On a
   phone the wordmark keeps the first row and the utility group takes the next
   full row, and the group's own children flow onto the rows that follow. The
   meter's sentence is allowed to shrink and wrap (min-width:0,
   white-space:normal) so even a large cap cannot overflow. Nothing is hidden
   and no control is removed: Support, Focus and the You menu stay in the bar
   and reachable. On a wide screen there is room, so nothing wraps and the
   desktop and tablet layout is unchanged. No em dashes. */
.pc-topbar { flex-wrap: wrap; }
.pc-utility { flex-wrap: wrap; min-width: 0; }
.pc-utility .allowance-chip { min-width: 0; white-space: normal; }
.pc-usermenu { position: relative; }
.pc-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line, #D7E4E4);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(31, 76, 95, 0.18);
  min-width: 180px; padding: 6px; display: none;
}
.pc-menu.open { display: block; }
.pc-menu a, .pc-menu button { display: block; width: 100%; text-align: left; }

/* content sits above the mobile bottom bar; below is the thumb zone */
/* content sits above the mobile bottom bar; the bar's REAL height is
   published as --pc-bar-h by shell.js, so nothing can hide behind it at
   any phone or tablet width (before: a hard 84px against a 99px/169px bar). */
.pc-has-shell main { padding-bottom: calc(var(--pc-bar-h, 84px) + 20px); }

/* Reserve the fixed top bar's space AT FIRST PAINT, so the shell can be built
   after paint with zero movement (B-14). Phone figure 161px = measured 149px
   bar plus main's own 12px top padding; wide figure 81px = measured 57px bar
   plus main's 24px. The shell is built only where a <nav class="pagenav">
   exists, so that is the marker. A chrome-free wizard page (walkthrough) opts
   out with body.pc-wizard and keeps the plain document spacing. */
main:has(.pagenav) { padding-top: 161px; }
/* the served fallback nav is visible at first paint and was hidden only when
   the shell finished building, which moved every element below it by the nav's
   whole height (measured 219px on a phone). Hide it from the FIRST paint on
   the pages whose shell replaces it. The link list stays in the HTML, so the
   shared-nav check still sees it; these pages already render nothing useful
   without JS. */
main:has(.pagenav) .pagenav { display: none; }
.pc-wizard main { padding-top: 12px; }
/* the wizard draws no shell, so hide the served fallback nav from the FIRST
   paint (walkthrough.js used to hide it after paint, which itself moved the
   page by the nav's whole height). */
.pc-wizard .pagenav { display: none; }
@media (min-width: 700px) {
  main:has(.pagenav) { padding-top: 81px; }
  .pc-wizard main { padding-top: 24px; }
}

/* focus mode: collapse ALL chrome; keep a single visible way back */
.pc-has-shell.pc-focus .pc-rail,
.pc-has-shell.pc-focus .pc-topbar { display: none; }
.pc-has-shell.pc-focus main { padding-bottom: 24px; }
.pc-focus-exit {
  position: fixed; right: 12px; top: 12px; z-index: 45;
  background: var(--ink, #1F4C5F); color: var(--paper, #F6FAFA);
  border: 1px solid rgba(255,255,255,0.25);
}
.pc-has-shell:not(.pc-focus) .pc-focus-exit { display: none; }

/* ---- DESKTOP: rail becomes a labelled sidebar; hover/click expands it ---- */
@media (min-width: 860px) {
  .pc-rail {
    top: var(--pc-notice-h, 0px); bottom: 0; right: auto;
    width: 68px;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto; overflow-x: hidden;
    padding: 10px 8px;
    border-top: 0;
    border-right: 1px solid rgba(255,255,255,0.15);
    transition: width 160ms ease;
  }
  .pc-rail:hover, .pc-rail:focus-within, .pc-rail.pc-open { width: 232px; }
  .pc-rail-item {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-height: 48px;
    width: 100%;
  }
  .pc-rail-list { display: flex; flex-direction: column; gap: 2px; width: 100%; }
  .pc-rail-head svg { width: 22px; height: 22px; display: block; flex: 0 0 auto; }
  /* OWNER ORDER 2026-10-13: the mark is 36px and the icon column is 22px
     wide, so matching left edges would leave the logo 7px right of the
     icons' center. The mark carries a -7px margin instead, which lands its
     center exactly on the icon column's center line (rail padding 8px +
     item padding 4px + 22/2 = 23px from the rail's left edge). Expanded,
     the margin resets and the mark's LEFT edge aligns with the icons',
     because with labels visible the rail reads as a list. */
  .pc-rail-head img.pc-rail-mark {
    width: 36px; height: 36px; display: block; flex: 0 0 auto;
    margin-left: -7px;
  }
  .pc-rail-label {
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 120ms ease;
    white-space: nowrap;
  }
  .pc-rail:hover .pc-rail-label,
  .pc-rail:focus-within .pc-rail-label,
  .pc-rail.pc-open .pc-rail-label { opacity: 1; }
  /* head padding-left (4px) matches the item's, so the mark's box starts
     where the icon column starts (owner order 2026-10-13) */
  .pc-rail-head {
    display: flex; align-items: center; gap: 10px;
    color: #fff; font-family: Georgia, serif; font-weight: 700;
    padding: 8px 4px 14px; white-space: nowrap;
  }
  .pc-rail-head .pc-rail-label { opacity: 0; }
  .pc-rail:hover .pc-rail-head .pc-rail-label,
  .pc-rail.pc-open .pc-rail-head .pc-rail-label { opacity: 1; }
  /* expanded: left edges align (the -7px collapse margin is for the
     icon-column geometry only; with labels out, a list reads left) */
  .pc-rail:hover .pc-rail-head img.pc-rail-mark,
  .pc-rail.pc-open .pc-rail-head img.pc-rail-mark,
  .pc-rail:focus-within .pc-rail-head img.pc-rail-mark { margin-left: 0; }
  .pc-rail-foot {
    display: block;
    margin-top: auto;
    padding-top: 10px;
  }
  .pc-rail-signout {
    width: 100%; background: transparent; color: #E8F2F6;
    border: 1px solid rgba(255,255,255,0.25); justify-content: flex-start;
  }
  .pc-rail-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    background: transparent;
    color: #E8F2F6;
    border: 1px solid rgba(255, 255, 255, 0.25);
  }
  .pc-rail-toggle-icon { font-size: 1.05rem; line-height: 1; flex: 0 0 auto; }
  /* THE CONTENT IS THE HERO: use the whole width the rail leaves free. Before,
     main kept style.css's max-width:900px while the shell only added
     margin-left:68px, so margin-right:auto swallowed every spare pixel and the
     content sat pinned left with a ~486px dead band beside it at 1440. */
  .pc-has-shell main { max-width: none; margin-left: 68px; margin-right: 0; padding-bottom: 96px; }
  .pc-has-shell .pc-topbar { margin-left: 68px; }
  .pc-has-shell main,
  .pc-has-shell .pc-topbar { transition: margin-left 160ms ease; }
  /* an EXPANDED rail PUSHES the page; it must never paint over the content.
     Before, a 232px rail sat over content that still had margin-left:68px,
     hiding 164px of it - the owner's "sidebar overlapping the page". */
  .pc-has-shell.pc-rail-expanded main,
  .pc-has-shell.pc-rail-expanded .pc-topbar { margin-left: 232px; }
  .pc-has-shell.pc-focus main,
  .pc-has-shell.pc-focus .pc-topbar { margin-left: 0; }
  /* the foot upsell only has room when the rail is expanded */
  .pc-rail:not(:hover):not(.pc-open):not(:focus-within) .pc-rail-foot { visibility: hidden; }
}

/* ---- the upsell box: a box in reserved space, never an overlay ---- */
.pc-upsell {
  border: 1px solid var(--line, #D7E4E4);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  margin: 10px 0;
}
.pc-upsell h3 { margin: 0 0 4px; font-size: 0.98rem; color: var(--ink, #1F4C5F); }
.pc-upsell p { margin: 0 0 10px; color: var(--muted, #4C6B7A); font-size: 0.86rem; }
.pc-upsell .pc-upsell-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-upsell .pc-upsell-cta { min-height: 40px; padding: 6px 12px; }
.pc-upsell .pc-upsell-dismiss {
  background: transparent; color: var(--muted, #4C6B7A);
  border: 1px solid var(--line, #D7E4E4); min-height: 40px; padding: 6px 12px;
}
.pc-upsell-tag {
  display: inline-block; font-size: 0.68rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted, #4C6B7A); margin-bottom: 4px;
}

/* ---- view switch (List / Calendar) ---- */
.pc-viewswitch {
  display: inline-flex;
  border: 1px solid var(--line, #D7E4E4);
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0;
}
.pc-viewswitch button {
  background: #fff; color: var(--ink, #1F4C5F);
  border: 0; border-radius: 0; margin: 0;
  min-height: 40px; padding: 6px 16px;
}
.pc-viewswitch button[aria-selected="true"] {
  background: var(--ink, #1F4C5F); color: var(--paper, #F6FAFA); font-weight: 700;
}

/* ---- the two headed blocks in the review pop-up ---- */
.pc-block {
  border: 1px solid var(--rule, #E3ECEC);
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
  background: #fff;
}
.pc-block > h4 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink, #1F4C5F);
}
/* the first comment sits on its own tinted panel WITH a border and a heading,
   so it can never be mistaken for the post (never colour alone) */
.pc-block--comment {
  background: #EEF5FB;
  border: 2px solid var(--wire, #3E9CC9);
}
.pc-block .pc-block-text { white-space: pre-wrap; margin: 0; }
.pc-block .pc-block-edit {
  background: transparent; color: var(--ink, #1F4C5F);
  border: 1px solid var(--line, #D7E4E4); min-height: 40px; padding: 4px 12px;
}
/* The editor opens sized to the post (owner 2026-10-05: it used to open about
   two lines tall, so every channel had to be dragged bigger by hand). The row
   count is set by pcEditorRows in approve.js; this caps the growth and keeps
   the box user-resizable. */
.pc-block .pc-block-input {
  min-height: 0; width: 100%; max-height: 46vh; resize: vertical;
  line-height: 1.45; font-family: inherit;
}

/* ---- Settings layout: FULL WIDTH (owner order 2026-10-13) ----
   The page used to run a 210px side column beside the cards: first for the
   Save button, then for a section list that js/settings-nav.js was going to
   build. That script was never loaded by any page, so once Save moved to the
   bottom of the main column the column rendered as an empty strip (the
   operator's screenshot). The column is gone: the cards own the full width
   at every screen size, on a phone and on a desktop alike. The section-list
   styles and the dead script are removed with it. If jump-nav is wanted
   later it comes back as a WIRED component, never an empty shell. */
.pc-settings-layout { display: block; }

/* ---- the support outlet sits at the bottom RIGHT (owner 2026-10-05: that is
   where apps put a floating help control, and on the left it sat in the
   reading path). The old rail-dodge rules that pinned it left are gone: the
   right edge never overlaps the left rail, so no dodge is needed. ---- */
/* and on a phone/tablet it must clear the bottom bar the same way (it used to
   sit on top of the bar, z-index 60 over the rail's 40, and hid destinations) */
@media (max-width: 859px) {
  .pc-has-shell .support-fab {
    bottom: calc(var(--pc-bar-h, 84px) + 16px + env(safe-area-inset-bottom));
    transition: bottom 160ms ease;
  }
}

/* ---- grouped toolbar disclosure (B-04, Miller's law) ---------------------
   Secondary toolbar controls (queue filter/sort, calendar status filter) live
   inside one disclosure so the surface at rest shows the work, not the chrome.
   Nothing is removed: one tap opens the group. */
/* DARK-MODE FIX 2026-10-13 (owner-reported, confirmed): the disclosure
   summary (Review's "Filter and sort", Calendar's filter) hardcoded a
   #fff fill while its label followed --ink; dark flips --ink light, so the
   summary was light text on a white button. The fill now follows the themed
   paper token and flips with the label. The wall_list.css dark rule adjusts
   the LABEL only, so the surface stays the paper token in both themes. */
.wall-adv > summary,
.cal-adv > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink, #1F4C5F);
  border: 1px solid var(--line, #D7E4E4);
  border-radius: 8px;
  padding: 6px 12px;
  background: var(--paper, #fff);
  width: fit-content;
}
.wall-adv > summary:hover,
.cal-adv > summary:hover { border-color: var(--signal, #9E5424); }
.wall-adv > summary:focus-visible,
.cal-adv > summary:focus-visible { outline: 3px solid var(--signal, #9E5424); outline-offset: 2px; }
.wall-adv[open] > summary,
.cal-adv[open] > summary { border-color: var(--ink, #1F4C5F); }
.wall-adv-body { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
/* The review queue paints its rows after the first frame. Grouping the toolbar
   into a disclosure (B-04) made the list panel start shorter, which turned the
   queue's own arrival into a 377 px jump (CLS 0.49 on approve.html). Reserve
   the queue area so the rows land INSIDE space that already exists. */
#pc-list-view { min-height: 430px; }

/* utility: visually hidden but available to assistive tech */
.pc-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;
}

/* Upfront qualification checklist (owner requirement 2026-10-05, from a real
   buyer): one screen, plain sentences, ONE verdict. No wizard, no jargon. */
.qualify-q { padding: 12px 0; border-top: 1px solid var(--line); }
.qualify-q:first-child { border-top: 0; padding-top: 0; }
.qualify-q-text { margin: 0 0 6px; font-weight: 700; }
.qualify-choices { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.qualify-choice[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper, #F6FAFA); }
.qualify-answer { margin: 0 0 4px; }
.qualify-verdict { margin: 0; font-weight: 600; }
.qualify-verdict.is-ready { color: var(--ok); }
.qualify-verdict.is-no { color: #8B2C1F; }
/* DARK-MODE INVISIBLE TEXT (owner walk 2026-10-15). This rule hard-coded
   a light surface (#EFF5F6) and dark mode only overrode the .is-ready
   and .is-no variants below. The bare .qualify-final is the "waiting"
   state - exactly the state a brand-new buyer lands in - so dark mode
   painted light text on this light surface: "Your setup is a fit. Here
   is what happens next." was unreadable. Use the theme-aware token the
   rest of the sheet already uses, so both themes follow automatically. */
.qualify-final { margin-top: 14px; padding: 14px; border-radius: var(--radius); background: var(--tint); }
.qualify-final.is-ready { background: #E4F3EA; }
.qualify-final.is-no { background: #FBE7E1; }
.qualify-final h3 { margin: 0 0 6px; }
.qualify-final ul { margin: 8px 0 0; padding-left: 20px; }
.qualify-final li { margin: 4px 0; }

/* ==========================================================================
   TOUCH TARGET FLOOR (44px) - ONE law in the stylesheet, not per-button patches
   --------------------------------------------------------------------------
   Every interactive control must present a hit area of at least 44x44 CSS px
   on a phone or tablet, or wherever the pointer is coarse (Fitts / WCAG 2.5.5).
   Nothing is shrunk and no control is removed: the boxes GROW, the function is
   unchanged. It lives at the END of the last-loaded shared sheet so it beats
   the older 40px rules by source order, and it is scoped to touch widths so
   the desktop layout is untouched.

   It deliberately overrides these long-standing 40px rules:
     style.css   .compact, .seg button
     components.css .pagenav a, .pc-utility a/button, .pc-upsell-cta,
                    .pc-upsell-dismiss, .pc-viewswitch button, .pc-block-edit
   and adds a floor where none existed: .pc-logo, summary, .legal-foot-links a
   and checkbox / radio inputs.

   EXCEPTION (kept on purpose): a link that flows INSIDE a sentence keeps the
   WCAG 2.5.5 inline-link exception. A 44px-tall inline link would blow the
   paragraph apart, so only controls laid out as boxes are lifted.
   ========================================================================== */
@media (max-width: 859px), (pointer: coarse) {
  button, .btn, [role="button"], [role="link"],
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
  select, textarea,
  .compact, .seg button, .pagenav a,
  .pc-utility a, .pc-utility button,
  .pc-upsell-cta, .pc-upsell-dismiss, .pc-viewswitch button, .pc-block-edit,
  .pc-logo, summary, .legal-foot-links a,
  /* .pc-tap is for a link that is the ONLY content of its own paragraph and
     is a real action, so lifting it cannot disturb running text. The blanket
     inline-link exception below still applies to links inside a sentence.
     Added 2026-10-07 for the run page Open Settings action, measured at
     323x19 on a phone, on the error path a stuck buyer has to tap. */
  .pc-tap {
    min-height: 44px;
  }
  button, .btn, [role="button"], [role="link"],
  .compact, .seg button, .pagenav a,
  .pc-utility a, .pc-utility button,
  .pc-upsell-cta, .pc-upsell-dismiss, .pc-viewswitch button, .pc-block-edit,
  .pc-logo, summary {
    min-width: 44px;
  }
  /* a checkbox / radio: the raw box is often drawn small (13-22px) with the
     pill <label> around it acting as the target. The floor lifts the box
     ITSELF to 44x44 so the measured target matches what a thumb can hit; the
     .pc-has-shell prefix is what lets it beat the older, more specific rules
     (.hb-master input, .day-chip input, .support-kind input). */
  input[type="checkbox"], input[type="radio"],
  .pc-has-shell input[type="checkbox"], .pc-has-shell input[type="radio"] {
    width: 44px; height: 44px; min-width: 44px; min-height: 44px;
    padding: 0; flex: 0 0 auto;
  }
  /* box controls centre their label in the taller box */
  .pc-logo, .pc-utility a, .pc-utility button, .legal-foot-links a,
  .pagenav a, button, .btn, .pc-tap {
    display: inline-flex; align-items: center; justify-content: center;
  }
  /* the wizard's Back/Finish bar is a SECOND fixed bar; the shell's bottom nav
     rail already owns the very bottom. Stack the action bar ABOVE the rail so
     a thumb can reach Finish, and reserve room in main for both bars. */
  .pc-has-shell .actionbar { padding-bottom: 12px; }
  .pc-has-shell main:has(.actionbar) { padding-bottom: calc(var(--pc-bar-h, 84px) + 24px); }
  /* the footer is a SIBLING of <main>, so main's own bottom padding never
     cleared the docked rail: give the document its own clearance so the policy
     links are never trapped under the bottom bar. */
  .pc-has-shell body { padding-bottom: calc(var(--pc-bar-h, 84px) + 16px); }
}

/* ==========================================================================
   DARK MODE (operator order 2026-10-11). The token flip lives in style.css
   (:root[data-theme="dark"]); these are the sheet's own hard-coded light
   surfaces that must follow. Signature: [data-theme="dark"] <selector>.
   ========================================================================== */
[data-theme="dark"] .pc-skeleton, [data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #1A2430 25%, #232F3D 37%, #1A2430 63%);
  background-size: 400% 100%;
}
[data-theme="dark"] .pc-empty, [data-theme="dark"] .empty-box { background: var(--tint); }
[data-theme="dark"] .pc-error, [data-theme="dark"] .error-box {
  background: #3A1B14; color: #F0957F; border-color: #F0957F;
}
[data-theme="dark"] .pc-kpi { background: var(--card); }
[data-theme="dark"] .pc-badge, [data-theme="dark"] .allowance-chip,
[data-theme="dark"] .pagenav .allowance-chip { background: var(--card); }
[data-theme="dark"] .pc-search { background: var(--card); }
[data-theme="dark"] .pc-search kbd { background: var(--tint); }
[data-theme="dark"] .pc-menu { background: var(--card); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
[data-theme="dark"] .pc-topbar { background: var(--paper); border-bottom-color: var(--rule); }
[data-theme="dark"] .pc-modal, [data-theme="dark"] .modal { background: var(--card); }
[data-theme="dark"] .pc-cal-day, [data-theme="dark"] .cal-day { background: var(--card); }
[data-theme="dark"] .pc-cal-head { background: var(--tint); }
[data-theme="dark"] .pc-cal-post { background: var(--card); }
[data-theme="dark"] .pc-cal-week:not(table), [data-theme="dark"] .cal-week:not(table) {
  background: var(--rule);
  border-color: var(--rule);
}
[data-theme="dark"] .pc-upsell { background: var(--card); }
[data-theme="dark"] .pc-viewswitch button { background: var(--card); color: var(--ink); }
[data-theme="dark"] .pc-viewswitch button[aria-selected="true"] { background: var(--ink); color: var(--paper); font-weight: 700; }
[data-theme="dark"] .pc-block { background: var(--card); border-color: var(--rule); }
[data-theme="dark"] .pc-block--comment { background: var(--tint); border-color: var(--wire); }
[data-theme="dark"] .pc-block .pc-block-edit { background: var(--card); }
[data-theme="dark"] .qualify-verdict.is-no { color: #F0957F; }
[data-theme="dark"] .qualify-final.is-ready { background: #12331F; }
[data-theme="dark"] .qualify-final.is-no { background: #3A1B14; }
[data-theme="dark"] .pc-toast.err, [data-theme="dark"] .toast.err { background: #8A2A00; }
[data-theme="dark"] .pc-toast, [data-theme="dark"] .toast {
  background: #2A3644; color: #E8EEF4;
}

/* the theme toggle button in the utility cluster: same quiet chrome as the
   other utility buttons, labelled with the CURRENT mode so the state is
   visible, not a mystery icon */
.pc-theme-btn {
  min-width: 48px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 8px;
}

/* ==========================================================================
   MOBILE DRAWER NAV + PROFILE RAIL ICON (operator order 2026-10-11).
   Phones (<860px) previously had NO hamburger: a permanent 10-item bottom
   grid ate a third of the viewport. Now: the bottom grid retires on phones,
   a Menu button joins the top bar, and tapping it opens the SAME rail
   markup as a full-height drawer (every destination + Sign out). Desktop
   (>=860px) is unchanged: always-visible rail, no Menu button.
   The drawer is the theme-invariant navy rail, correct in light + dark.
   ========================================================================== */

/* the Menu button: hidden on desktop, shown in the phone band. Follows the
   utility-button token chrome so it themes with light/dark. */
.pc-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 12px;
  margin-left: auto;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink, #1F4C5F);
}
.pc-menu-btn .pc-menu-icon { font-size: 1.15rem; line-height: 1; }
.pc-menu-btn .pc-rail-label { font-size: 0.9rem; }

/* phone band: bottom rail retires, Menu appears */
@media (max-width: 859px) {
  .pc-menu-btn { display: inline-flex; }
  .pc-rail { display: none; }
  body.pc-drawer-open .pc-rail {
    display: flex;
    position: fixed;
    inset: 0;
    top: var(--pc-notice-h, 0px);
    bottom: auto;
    left: 0; right: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 12px 14px calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
    z-index: 80;
    box-shadow: 0 10px 40px rgba(31, 76, 95, 0.35);
  }
  body.pc-drawer-open .pc-rail-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
  }
  body.pc-drawer-open .pc-rail-item {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    min-height: 48px;
    width: 100%;
    font-size: 1.05rem;
  }
  body.pc-drawer-open .pc-rail-label { font-size: 0.95rem; opacity: 1; }
  /* the foot (Sign out) is part of the drawer, not just desktop chrome */
  body.pc-drawer-open .pc-rail-foot {
    display: block;
    margin-top: auto;
    padding-top: 14px;
  }
  body.pc-drawer-open .pc-rail-signout {
    width: 100%; background: transparent; color: #E8F2F6;
    border: 1px solid rgba(255,255,255,0.25); justify-content: flex-start;
  }
  /* scroll lock while the drawer is open */
  body.pc-drawer-open { overflow: hidden; }
  /* the scrim behind the drawer: same navy, subtle, no content hidden
     behind an invisible surface (clicks land on it, closing the drawer) */
  .pc-drawer-scrim {
    position: fixed; inset: 0; z-index: 70;
    top: var(--pc-notice-h, 0px);
    background: rgba(31, 76, 95, 0.45);
  }
  body.pc-drawer-open .pc-drawer-scrim { display: block; }
  .pc-drawer-scrim { display: none; }
  /* the support FAB must not float over the drawer */
  body.pc-drawer-open .support-fab { display: none; }
  /* the upsell box is content, the drawer is chrome: drawer wins */
  body.pc-drawer-open .pc-upsell { display: none; }
}

/* dark mode: the Menu button follows tokens (no new rule needed); the
   scrim stays navy in both themes so it never flashes white */
[data-theme="dark"] .pc-drawer-scrim { background: rgba(0, 0, 0, 0.55); }
[data-theme="dark"] .pc-menu-btn { color: var(--ink); }
[data-theme="dark"] .pc-menu-btn:hover { border-color: var(--line); }
.pc-menu-btn:hover { border-color: var(--line, #D7E4E4); }
.pc-menu-btn:focus-visible {
  outline: 3px solid var(--signal, #9E5424);
  outline-offset: 2px;
}


/* A11Y (2026-10-12): visually hidden, still announced. Used by the review
   wall's undo note so a ticking countdown is never re-announced. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* DEEP-LINK FLASH: makes a jump target findable. Without this the buyer lands
   on the right card but cannot tell which one it was. Uses the brand wire
   colour that already carries "attention" elsewhere in the sheet. */
.deep-link-flash {
  outline: 2px solid var(--wire, #3E9CC9);
  outline-offset: 3px;
  border-radius: var(--radius);
  transition: outline-color .3s ease;
}
.deep-link-flash:focus { outline: 2px solid var(--wire, #3E9CC9); }

/* ==========================================================================
   WIZARD FIXES (owner order 2026-10-16, pcfix-20261016)
   ========================================================================== */
/* W2-3: the theme choice is TWO labelled buttons ("Dark" / "Light") and the
   ACTIVE one is marked, so the current mode is readable off the control.
   theme_boot.js stamps data-theme-active on the matching button. */
.theme-switch { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-switch .compact { min-width: 88px; }
.theme-switch [data-theme-active="true"] {
  background: var(--ink, #1F4C5F);
  border-color: var(--ink, #1F4C5F);
  color: var(--paper, #F6FAFA);
}
/* W2-9: the live problem counter rides inside its helper line; over the
   limit its text says only the first 7 are saved. */
#problem-count { font-weight: 600; margin-left: 4px; }
/* W2-10: the one collapsed "Not available yet" section below the list. */
.not-available summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted, #5A6B78);
}
.not-available-line { margin: 6px 0 0; font-size: 0.9rem; }
/* W2-10: the skip box is a checkbox, not a text field. The global form rule
   (style.css: input { width:100%; min-height:48px }) stretched the bare box
   into a full-width slab on desktop. Size the box and let its label own the
   click target; the coarse/narrow floor below keeps the 44px touch target
   on touch screens. */
label.chip-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
label.chip-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  margin: 2px 0 0;
  padding: 0;
  flex: 0 0 auto;
}
@media (max-width: 859px), (pointer: coarse) {
  label.chip-check input[type="checkbox"] {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
  }
}

/* ===================================================================
   W3-2 (2026-10-16): the honest digest indicator, shared by the dashboard
   stage panel and the Settings content source rows. The determinate bar is
   filled from a REAL engine percentage only. The indeterminate variant is
   motion with no number attached, never a fake percent. The
   prefers-reduced-motion rule above freezes the slide for buyers who ask
   for less motion; the bar itself stays visible.
   =================================================================== */
.digest-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--line, #D7E4E4);
  overflow: hidden;
  margin: 0.4rem 0 0;
}
.digest-bar .digest-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand-accent, #DA7B46);
}
.digest-bar.indeterminate::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 40%;
  border-radius: 999px;
  background: var(--brand-accent, #DA7B46);
  animation: pc-digest-slide 1.6s ease-in-out infinite;
}
@keyframes pc-digest-slide {
  0% { left: -40%; }
  100% { left: 100%; }
}
.digest-bar-inline {
  display: inline-block;
  width: 72px;
  height: 5px;
  margin: 0;
  vertical-align: middle;
}
.source-digest .digest-bar-inline {
  margin-left: 8px;
}
