/* =========================================================================
   Capcon Field Ops — design system + components (single stylesheet)
   System fonts only (zero web-font fetch → instant offline render).
   ========================================================================= */

:root {
  /* Surfaces & ink */
  --canvas: #F6F7F9;
  --surface: #FFFFFF;
  --surface-sunk: #EEF1F5;
  --hairline: #E3E7ED;
  --ink: #111315;
  --ink-2: #566173;
  --ink-3: #8A94A4;

  /* Brand / structure — Capcon: red + black lead */
  --brand: #000000;        /* primary dark — top bar, dark cards */
  --brand-700: #1A1A1A;    /* pressed/active dark; preview backdrop */
  --on-brand: #FFFFFF;

  /* The single action color — Capcon Red */
  --action: #C8102E;
  --action-press: #A30D26;
  --action-tint: #FBE3E7;

  /* Rexo — used ONLY in the "Powered by Rexo Systems" mark */
  --rexo: #0F2A47;

  /* Rexo Rail platform blue — the "RAIL" accent from the wordmark (#428DCC, pulled from the logo PNG, NOT
     the #091C38 navy which has no contrast on near-black). Used where the PLATFORM speaks for itself — the
     shared login front door every tenant lands on — instead of Capcon red. */
  --rr-blue: #428DCC;
  --rr-blue-press: #3878AD;

  /* Status */
  --draft: #6F7E89;        --draft-tint: #EEF1F5;
  --submitted: #1E73BE;    --submitted-tint: #E3F0FB;
  --approved: #1F9D55;     --approved-tint: #E1F4EA;
  --sentback: #C2410C;     --sentback-tint: #FBEBE2;
  --billable: #7C3AED;     --billable-tint: #F1EAFB;
  --danger: #D7263D;       --danger-tint: #FBE7EA;
  /* COLOR GRAMMAR (Conner ruling 2026-08-24): solid red = ACT (primary buttons + brand marks ONLY).
     Trouble (overdue/blocked/failed) = the --warn orange family + a glyph — never red, so red keeps its
     command value. "You are here" (active nav) = ink/black — presence is not an action. Count badges =
     ink chips. The nuclear money state (--danger) renders OUTLINED + glyph, never a solid fill.
     Crew mnemonic: "Red I tap. Orange needs me. Black is where I am." Rexo platform blue stays in the
     frame (rail banner / login / powered-by) and NEVER inside the tenant workspace. */
  --warn: #B45309;         --warn-tint: #FDF0E3;    --warn-ink: #92400E;

  /* ===== S29 · ONE COLOUR, ONE MEANING — the two named palettes ======================
     GREYSCALE RULE — the only test a colour has to pass before it is added here:
       Desaturate a screenshot of the screen it lands on, then check two things.
       (1) Every status still reads from its WORD + GLYPH + POSITION, never hue alone.
       (2) Nothing purely INFORMATIONAL (a name, a label) sits at the same grey value as
           something ACTIONABLE (a button, a live link).
       If two things are indistinguishable in grey they were never truly distinguishable
       in colour — they had simply not collided yet. A colour that fails this does not
       ship, however good it looks. Owner: Walker (docs/REXO-STANDARD.md design
       authority); Conner signs any new palette entry.

     WHY TWO PALETTES AND NOT ONE. A sub's NAME rendered in the action red on the
     compliance board, and all 46 subs read as problems — including the 9 the header
     correctly called "Compliant". Every query and every count on that page was right;
     it lied for two weeks anyway. One token meant "tap me" here and "something is
     wrong" there. So: status and action may never share a token again.

     THREE AXES. Never borrow one for another — that was the second half of the same bug
     (severity rendered through the workflow-stage chips, so "amber" came out blue):
       ACTION   — primary / secondary / destructive.   Is this thing interactive?
       SEVERITY — ok / warn / late / blocked.          How bad is this, right now?
       STAGE    — draft / submitted / approved / sentback / billable (above).
                  Where is this document in its life? A stage is NOT a severity.
     Every name below resolves to an EXISTING hex via var(): one colour value, one place
     it is defined, no second source of truth.

     This encodes Conner's 2026-08-24 grammar rather than replacing it — solid red is ACT
     only, trouble is the orange family, and the nuclear money state renders OUTLINED. */

  /* ACTION — interactive only. Never a status. */
  --action-primary: var(--action);
  --action-primary-press: var(--action-press);
  --action-primary-tint: var(--action-tint);
  --action-secondary: var(--ink-2);
  --action-secondary-tint: var(--surface-sunk);
  /* A destructive action is still an ACTION: brand red, outlined so it reads "careful" rather
     than "primary". #D7263D (--danger) is the SEVERITY axis's nuclear money state per Conner
     2026-08-24 — after S29 an action may not borrow it. (Bugsy-3 TASK-810) */
  --action-destructive: var(--action);

  /* SEVERITY — status only. Never interactive. Always word + glyph; colour is the last layer. */
  --status-ok: var(--approved);        --status-ok-tint: var(--approved-tint);
  --status-warn: var(--warn-ink);      --status-warn-tint: var(--warn-tint);
  --status-late: var(--sentback);      --status-late-tint: var(--sentback-tint);
  --status-blocked: var(--danger);     --status-blocked-tint: var(--danger-tint);

  /* Elevation */
  --shadow-card: 0 1px 2px rgba(22,32,42,.06), 0 4px 12px rgba(22,32,42,.08);
  --shadow-pop: 0 10px 30px rgba(22,32,42,.16);
  --shadow-sheet: 0 -8px 28px rgba(22,32,42,.18);

  /* Spacing */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 28px; --s8: 32px; --s10: 40px; --s12: 48px;

  /* Radius */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px; --r-pill: 999px;

  /* Touch sizing */
  --tap: 48px; --btn: 56px; --input: 52px; --stepper: 56px;

  /* Bars */
  --topbar-h: 73px; --banner-h: 38px; --rr-track-h: 7px; --ribbon-h: 0px; /* read-only ribbon height; 0 unless it renders (measured in app.js) */
  --bottomnav-h: 64px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --maxw: 1040px;

  /* Type scale — the only font sizes screens may use (Conner 2026-10-30). */
  --fs-12: 12px; --fs-14: 14px; --fs-15: 15px; --fs-17: 17px;
  --fs-20: 20px; --fs-24: 24px; --fs-32: 32px;

  /* Line-heights — the only line-heights screens may use (Conner 2026-10-30). */
  --lh-tight: 1.25; --lh-body: 1.5;

  /* Spacing scale — the only spacing sizes screens may use (Conner 2026-10-30). */
  --sp-4: 4px; --sp-8: 8px; --sp-12: 12px; --sp-16: 16px; --sp-24: 24px; --sp-32: 32px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
.num, .hours, .total, time, .stat-tile b { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--submitted); outline-offset: 2px; border-radius: 6px; }

.boot {
  display: grid; place-items: center; height: 100vh; color: var(--ink-3);
  font-size: 15px;
}

/* ---- Type scale --------------------------------------------------------- */
.t-display { font-size: 30px; line-height: 36px; font-weight: 800; letter-spacing: -0.01em; }
.t-h1 { font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.01em; }
.t-h2 { font-size: 20px; line-height: 26px; font-weight: 700; }
.t-body { font-size: 16px; line-height: 24px; font-weight: 450; }
.t-label { font-size: 13px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.t-meta { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-2); }
.muted { color: var(--ink-3); }

/* =========================================================================
   App shell
   ========================================================================= */
.app-root { min-height: 100%; }
.app {
  display: flex; flex-direction: column; min-height: 100vh;
}

/* Top-of-app stack: Rexo Rail platform banner (light) + Capcon workspace header (dark), stuck together.
   The stack owns the sticky; the header no longer sticks on its own. Safe-area (notch) sits above the
   light banner and is filled white so the platform strip reads to the very top edge. */
.topstack {
  position: sticky; top: 0; z-index: 40;
  background: #F4F8FD; /* matches the banner gradient's top so the notch blends seamlessly */
  padding-top: env(safe-area-inset-top);
}
/* Rexo Rail platform strip — a soft blue-tinted gradient; blue logo centered to the page. The bottom edge
   is a subtle railroad track (two thin RAIL-blue rails + faint ties) — a refined nod to "Rexo Rail". */
.rr-banner {
  position: relative;
  height: var(--banner-h);
  display: flex; align-items: center; justify-content: center;
  /* bottom pad = track height, so the centered logo sits in the clear band ABOVE the track (equal
     breathing room top ↔ bottom) instead of crowding/overlapping the top rail. */
  padding: 0 var(--s4) var(--rr-track-h);
  background: linear-gradient(180deg, #F4F8FD 0%, #E6EDF8 100%);
}
.rr-banner::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: var(--rr-track-h);
  background:
    linear-gradient(#3E86CC, #3E86CC) top / 100% 2px no-repeat,      /* top rail */
    linear-gradient(#3E86CC, #3E86CC) bottom / 100% 2px no-repeat,   /* bottom rail (banner↔header edge) */
    repeating-linear-gradient(90deg, rgba(62,134,204,.38) 0 2px, transparent 2px 15px); /* ties */
}

/* Read-only preview ribbon — a calm, always-visible "working as designed, editing off" sign, not an alarm.
   Amber (informational), never red: read-only is a deliberate state, not a failure. */
.ro-ribbon {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 6px var(--s4); font-size: 13px; line-height: 1.25;
  background: #FEF6E7; color: #7A5A12; border-bottom: 1px solid #F0DDB0;
}
.ro-ribbon b { font-weight: 700; }
.ro-ribbon-ic { color: #B7860B; flex: none; }
.rr-logo { height: 20px; width: auto; display: block; }

/* Capcon workspace header — unchanged look; just no longer owns its own sticky (the stack does) */
.topbar {
  height: var(--topbar-h);
  background: var(--brand); color: var(--on-brand);
  display: flex; align-items: center; gap: var(--s3);
  padding: 0 var(--s4);
}
.brandmark { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }

/* Capcon logo slot — swappable image with a styled red/black text placeholder */
.capcon-logo { display: flex; align-items: center; min-width: 0; }
.capcon-logo img.brand-img { height: 49px; width: auto; max-width: 240px; display: none; object-fit: contain; border-radius: 7px; }
/* invoice_logo.png already carries its own white background, so render it as-is —
   a sharp-cornered rectangle like the source file (no rounded plate). If the source
   is ever re-exported transparent, it'll sit directly on the black header. */
.capcon-logo.has-img { display: inline-flex; align-items: center; }
.capcon-logo.has-img img.brand-img { display: block; }
.capcon-logo.has-img .capcon-fallback { display: none; }
.capcon-fallback { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cc-chip { width: 38px; height: 38px; border-radius: 9px; background: var(--action); color: #fff; font-weight: 800; font-size: 21px; display: grid; place-items: center; flex: none; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.cc-word { font-size: 20px; font-weight: 800; letter-spacing: .06em; color: #fff; line-height: 1; white-space: nowrap; }
.cc-word .sub { font-weight: 700; font-size: 12px; letter-spacing: .18em; color: var(--action); margin-left: 5px; }

/* Rexo "Powered by" mark — navy, used only here */
.rexo-mark { display: flex; align-items: center; justify-content: center; gap: 8px; padding: var(--s5) 0; }
.rexo-mark .pre { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.rexo-mark img.rexo-img { height: 36px; width: auto; display: none; object-fit: contain; }
.rexo-mark.has-img img.rexo-img { display: inline-block; }
.rexo-mark.has-img .rexo-word { display: none; }
.rexo-word { font-weight: 800; color: var(--rexo); font-size: 14px; letter-spacing: .01em; }
.railnav .rexo-mark { margin-top: auto; border-top: 1px solid var(--hairline); }
.topbar .context {
  display: none; margin-left: 14px;
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.08); padding: 6px 12px; border-radius: var(--r-pill);
  white-space: nowrap;
}
.topbar .spacer { margin-left: auto; }
.topbar .context.saving::after {
  content: "saving…"; margin-left: 8px; font-weight: 600; color: var(--action);
}
.syncdot {
  width: 9px; height: 9px; border-radius: 50%; background: #5ee0a0; flex: none;
  box-shadow: 0 0 0 0 rgba(94,224,160,.5);
}
.syncdot.saving { background: var(--action); animation: syncpulse .7s ease; }
@keyframes syncpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--action) 50%, transparent); } 100% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--action) 0%, transparent); } }
.phone-hide-name { white-space: nowrap; }
/* Phones: compact header. The Capcon logo (invoice_logo.png, ~172px wide) + the "Search ⌘K" label +
   the "Name · Role" pill all crowd/overflow one row on a 375–430px screen. Shrink the logo and collapse
   the desktop-only labels to icons so the header fits without spilling. */
@media (max-width: 600px) {
  :root { --topbar-h: 60px; } /* was 73 — a phone header shouldn't be a tall black void around a small logo */
  .phone-hide-name { display: none !important; } /* P1: beat the later, equal-specificity `.acting-id{display:flex}` (matches the `.desktop-only` pattern) so the pill is avatar-only on phones — a long unbound-login email can't overflow the bar */
  .topbar { gap: 10px; padding: 0 14px; }
  /* size the logo to sit balanced in the slimmer bar; the rounded corners (base rule) make the white plate read as intentional */
  .capcon-logo img.brand-img { height: 38px; max-width: 172px; }
  .cc-chip { width: 32px; height: 32px; font-size: 18px; border-radius: 8px; }
  /* stacked lockup — "COMMERCIAL" reads as a clean tagline UNDER the wordmark, not crammed beside it */
  .cc-word { display: flex; flex-direction: column; justify-content: center; font-size: 17px; line-height: 1.05; }
  .cc-word .sub { display: block; font-size: 9px; letter-spacing: .22em; margin-left: 0; margin-top: 1px; }
  .brandmark { overflow: hidden; } /* backstop: a too-wide logo can never push the pill off-screen */
}

/* Acting-as pill */
.acting-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.10); border: 0; color: var(--on-brand);
  height: 40px; padding: 0 10px 0 6px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 14px;
}
.acting-pill:hover { background: rgba(255,255,255,.16); }
.acting-pill .caret { opacity: .7; }
/* name over a small role label inside the pill */
.acting-id { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.acting-id .acting-role { font-size: 11px; font-weight: 600; opacity: .72; letter-spacing: .01em; }
/* P1 defense-in-depth: if the pill name IS shown (601–720px band, above the phone hide), cap + ellipsize it so
   a long value (e.g. an unbound login's email) truncates instead of spilling off the black bar. min-width:0 lets
   the flex child shrink below its content width; the cap + ellipsis do the truncation. */
.acting-pill, .acting-id { min-width: 0; }
.acting-pill { max-width: 60vw; }
.acting-name { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* role icon chip in the Preview-as-role switcher */
.role-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--action-tint, color-mix(in srgb, var(--action) 10%, transparent)); color: var(--action); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--action); color: #fff; letter-spacing: .02em;
}
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.acting-pill .avatar.owner::after,
.acting-pill.is-approver .ownerdot {
  content: "";
}
.acting-pill .ownerdot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--action);
  box-shadow: 0 0 0 2px var(--brand);
  position: absolute; top: 4px; right: 4px;
}

/* Content outlet */
.content {
  flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: var(--s4) var(--s4) calc(var(--bottomnav-h) + 96px);
}
@media (min-width: 960px) {
  .content { padding-bottom: var(--s10); }
}

.screen-head { margin: var(--s2) 0 var(--s4); }
.screen-head .title-row { display: flex; align-items: center; gap: var(--s3); }
.screen-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.screen-head .sub { color: var(--ink-2); margin-top: 2px; }

/* Segmented control (sub-nav) */
.segmented {
  display: inline-flex; background: var(--surface-sunk); border-radius: var(--r-pill);
  padding: 4px; gap: 2px; position: sticky; top: calc(env(safe-area-inset-top) + var(--banner-h) + var(--ribbon-h) + var(--topbar-h));
  z-index: 20; margin-bottom: var(--s4);
}
.segmented button {
  border: 0; background: transparent; color: var(--ink-2);
  font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: var(--r-pill);
  min-height: 40px; white-space: nowrap;
}
.segmented button[aria-selected="true"] {
  background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(22,32,42,.12);
}
.seg-wrap { display: flex; justify-content: flex-start; }

/* Bottom nav (phone) → left rail (desktop) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--hairline);
  display: flex;
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-decoration: none; color: var(--ink-2); position: relative;
  font-size: 12px; font-weight: 600;
}
.bottomnav a .icon { width: 24px; height: 24px; }
.bottomnav a[aria-current="page"] { color: var(--ink); }
.bottomnav a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 40px; height: 3px; background: var(--ink); border-radius: 0 0 3px 3px;
}

.footer {
  text-align: center; color: var(--ink-3); font-size: 12px; padding: var(--s6) 0 var(--s4);
}
.footer button { background: none; border: 0; color: var(--ink-3); text-decoration: underline; font-size: 12px; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: var(--r);
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink);
  font-weight: 650; font-size: 15px; transition: transform .04s ease, background .15s ease;
}
.btn:active { transform: scale(.985); }
.btn .icon { width: 20px; height: 20px; }
.btn-primary { background: var(--action); border-color: var(--action); color: var(--on-brand); }
.btn-primary:hover { background: var(--action-press); }
.btn-primary:active { background: var(--action-press); }
.btn-approve { background: var(--approved); border-color: var(--approved); color: #fff; }
.btn-approve:hover { filter: brightness(.96); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-sunk); }
.btn-danger { background: transparent; border-color: var(--action-destructive); color: var(--action-destructive); }
.btn-danger:hover { background: var(--action-primary-tint); }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: var(--btn); font-size: 16px; border-radius: var(--r-lg); }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-dashed {
  border: 1.5px dashed var(--hairline); background: transparent; color: var(--ink-2);
  width: 100%; min-height: var(--btn);
}
.btn-dashed:hover { border-color: var(--action); color: var(--action); background: var(--action-tint); }

.iconbtn {
  width: var(--tap); height: var(--tap); border-radius: var(--r); border: 1px solid var(--hairline);
  background: var(--surface); display: grid; place-items: center; color: var(--ink-2);
}
.iconbtn:hover { background: var(--surface-sunk); color: var(--ink); }
.iconbtn.borderless { border-color: transparent; background: transparent; }

/* Sticky bottom action bar (within content area) */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  z-index: 35; padding: var(--s3) var(--s4) calc(var(--s3));
  background: linear-gradient(to top, var(--canvas) 70%, rgba(246,247,249,0));
  display: flex; gap: var(--s3);
}
.action-bar .inner { max-width: var(--maxw); margin: 0 auto; width: 100%; display: flex; gap: var(--s3); }
@media (min-width: 960px) {
  .action-bar { bottom: 0; }
}

/* =========================================================================
   Cards & layout bits
   ========================================================================= */
.card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); padding: var(--s4);
}
.card + .card { margin-top: var(--s3); }
/* Inset/nested card (a card sitting inside a sheet or another card): flatten the shadow + sink the fill so it
   reads as a sub-panel, not a floating card. Used by the cost-class editor rows. */
.card.sunk { box-shadow: none; background: var(--surface-sunk); }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s2); }
.row { display: flex; align-items: center; gap: var(--s3); }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Date / week stepper */
.stepper-bar {
  display: flex; align-items: center; gap: var(--s2); background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 6px; box-shadow: var(--shadow-card);
}
.stepper-bar .nav { width: var(--tap); height: var(--tap); border-radius: var(--r); border: 0; background: var(--surface-sunk); display: grid; place-items: center; color: var(--ink); }
.stepper-bar .nav:hover { background: var(--hairline); }
.stepper-bar .label { flex: 1; text-align: center; border: 0; background: transparent; }
.stepper-bar .label .big { font-size: 17px; font-weight: 700; }
.stepper-bar .label .rel { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--action); text-transform: uppercase; letter-spacing: .04em; }
.stepper-bar .label .dot { display:inline-block; width:6px; height:6px; border-radius:50%; background: var(--action); margin-left: 6px; vertical-align: middle; }
/* The native date input the label opens. These two rules re-state, in CSS, exactly the inline styles the input
   used to carry in bits.js — a 1px invisible ghost that never takes a pointer — so DESKTOP RENDERS AS IT DID.
   The phone breakpoint is the only place that changes them. Same for the calendar glyph: in the DOM always,
   shown only under a thumb. */
.stepper-bar .label .cal { display: none; }
.stepper-bar .label .pick { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; border: 0; padding: 0; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border-radius: var(--r-pill); border: 1px solid var(--hairline); background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.chip.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.chip.selectable:hover { border-color: var(--ink-3); }
.chip.selected { background: var(--action-tint); border-color: var(--action); color: var(--action-press); }
.chip .avatar.sm { margin-left: -4px; }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* Crew avatar chips (read-only display) */
.crew { display: flex; flex-wrap: wrap; gap: 6px; }
.crew .person { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-sunk); border-radius: var(--r-pill); padding: 3px 10px 3px 3px; font-size: 13px; font-weight: 600; }

/* Entity page back control — returns to the originating list WITH its filter (?back=).
   Thumb-comfortable at 390 without growing the header; same token grammar as the rest. */
.entity-back {
  display: inline-flex; align-items: center; gap: 4px; margin-bottom: var(--s3);
  color: var(--ink-2); font-size: 13.5px; font-weight: 600; text-decoration: none;
  min-height: 32px;
}
.entity-back .glyph { width: 16px; height: 16px; }
.entity-back:active { color: var(--ink); }

/* Chip-link — a MENTION of an entity, tappable through to its page. Reads as a name, not a button,
   but is visibly interactive: it borrows the SELECTED-chip grammar already in this file
   (--action-tint / --action-press) rather than inventing a second interactive-pill look. */
.chip-link {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; vertical-align: middle;
  padding: 2px 9px 2px 7px; border-radius: var(--r-pill);
  background: var(--action-tint); color: var(--action-press);
  font-weight: 700; text-decoration: none; white-space: nowrap; min-height: 26px;
}
.chip-link .glyph { width: 13px; height: 13px; flex: none; }
.chip-link > span { overflow: hidden; text-overflow: ellipsis; }
.chip-link:active { background: var(--action); color: #fff; }

/* PLAIN chip-link — the SAME component, no red. On a board where RED MEANS SOMETHING IS WRONG (the
   compliance board) the action tint made all 46 sub names read as 46 problems, including the 9 whose
   status chip said "Compliant" in green. A name is not a status: the name goes back to ink, and the
   STATUS CHIP is left as the only thing on the row carrying colour.
   Still obviously tappable, and never by colour alone — the hard-hat glyph, the underline and the
   row's own chevron all survive colourblindness and greyscale. */
.chip-link.plain {
  background: transparent; color: var(--ink); padding: 2px 0; min-height: 22px;
  text-decoration: underline; text-decoration-color: var(--ink-3);
  text-underline-offset: 2px; text-decoration-thickness: 1px;
}
.chip-link.plain .glyph { color: var(--ink-3); }
.chip-link.plain:active { background: transparent; color: var(--action-press); }

/* Status chip (glyph + word, never color-only) */
.status {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px;
  border-radius: var(--r-pill); font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.status .glyph { width: 14px; height: 14px; }
.status.draft { background: var(--draft-tint); color: var(--draft); }
.status.submitted { background: var(--submitted-tint); color: var(--submitted); }
.status.approved { background: var(--approved-tint); color: var(--approved); }
.status.sentback { background: var(--sentback-tint); color: var(--sentback); }
.status.notstarted { background: var(--surface-sunk); color: var(--ink-3); }
/* S29 · SEVERITY chips — "how bad is this, right now". Same shape and same glyph grammar as the
   stage chips above, deliberately its OWN tokens: a stage chip ("submitted") answers a different
   question to a severity chip ("expiring soon"), and because they looked alike they got borrowed
   for each other — which is how an amber warning came out rendering blue. Word + glyph carry the
   meaning; these colours only reinforce it, so the row survives greyscale.
   'blocked' is the nuclear money state (a payment is shut off): per Conner's 2026-08-24 grammar it
   renders OUTLINED + glyph, never a solid red fill, so solid red keeps its "tap me" command value. */
.status.sev-ok      { background: var(--status-ok-tint);      color: var(--status-ok); }
.status.sev-warn    { background: var(--status-warn-tint);    color: var(--status-warn); }
.status.sev-late    { background: var(--status-late-tint);    color: var(--status-late); }
.status.sev-blocked { background: var(--status-blocked-tint); color: var(--status-blocked);
  box-shadow: inset 0 0 0 1px var(--status-blocked); }
/* UIA-01: Void is a TERMINAL/cancelled state — a struck, greyed chip, never a benign neutral.
   Distinct from 'notstarted' (also grey) by the line-through so a voided invoice can't read as live. */
/* Jobs list rows + job page header: the stage/severity inks above sit under 4.5:1 on their tints at this 12.5px
   size (WCAG 1.4.3). Here the word moves onto the darker existing ink — never a new grey, and the tints stay. */
.list-row .status.draft, .list-row .status.notstarted,
.job-head .status.draft, .job-head .status.notstarted { color: var(--ink-2); }
.list-row .status.submitted, .job-head .status.submitted { color: var(--rexo); }
.list-row .status.approved, .list-row .status.sev-ok,
.job-head .status.approved, .job-head .status.sev-ok { color: var(--ink); }
.list-row .status.sentback, .list-row .status.sev-late,
.job-head .status.sentback, .job-head .status.sev-late { color: var(--warn-ink); }
.callout.enh-banner.sentback { color: var(--warn-ink); }
.status.void { background: var(--surface-sunk); color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
/* QuickBooks POST axis (Bugsy-2 0494b item 6) — amber "Not posted yet". Deliberately its OWN tint, not `sentback`:
   sentback/Overdue means something WENT WRONG, while "not posted yet" is a neutral not-there-yet fact. Amber
   (--warn) reads as "worth a look", which is exactly the weight a silently-unbilled staff-aug week should carry. */
.status.qbo-unposted { background: var(--warn-tint); color: var(--warn-ink); }
/* A voided invoice's dollar figure is struck + muted so it can't be misread as real/countable money. */
.amt-void { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--ink-3); opacity: .7; }
/* UIA-05: an unreadable/uncoded receipt amount — a muted em-dash, never a fake "$0.00". The amber tint
   flags "we don't know this yet", distinct from a real figure. */
/* An unreadable amount is an UNKNOWN, not a failure and not a workflow stage: severity axis, warn tier.
   (S29 — was var(--sentback), the "document sent back" stage token.) The word "— unreadable" carries the
   meaning in greyscale; colour only reinforces it. */
.amt-unreadable { color: var(--status-warn); font-weight: 700; font-variant-numeric: tabular-nums; }
/* 5.2: graceful broken-image placeholder — a muted box + label where a photo failed to load, sized by
   whatever wrapper class it inherits (.thumb/.fc-thumb/tile). Never a broken-image glyph or blank gap. */
.img-failed { display: inline-grid; place-items: center; gap: 3px; background: var(--surface-sunk); color: var(--ink-3); border-radius: 10px; min-width: 44px; min-height: 44px; padding: 8px; text-align: center; box-sizing: border-box; }
.img-failed-label { font-size: 11px; font-weight: 600; line-height: 1.15; }
/* Auth front door (login + invite acceptance) — the app's own origin, mobile-first, centered card. */
.auth-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px; background: var(--surface-sunk); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 18px; padding: 28px 22px; box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-logo { height: 30px; width: auto; display: block; }
.auth-logo-word { font-weight: 800; letter-spacing: 2px; font-size: 18px; color: #fff; }
.auth-h1 { font-size: 24px; font-weight: 800; margin: 2px 0 4px; }
.auth-form { margin-top: 14px; display: grid; gap: 8px; }
.auth-form .input { margin-bottom: 4px; }
.btn-block { width: 100%; justify-content: center; }
.auth-sent { text-align: center; padding: 8px 0; }
.auth-check { width: 68px; height: 68px; margin: 6px auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--approved-tint); color: var(--approved); }
.auth-queued { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--surface-sunk); color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
/* Cross-device keynote — the ONLY guidance for a stuck desktop user now that there's no password path. Loud. */
.auth-keynote { display: flex; gap: 11px; align-items: flex-start; text-align: left; margin-top: 16px; padding: 13px 14px; border-radius: 12px; background: rgba(66,141,204,.13); border: 1px solid rgba(66,141,204,.42); }
.auth-keynote .glyph { color: var(--rr-blue); flex: none; margin-top: 1px; }
.auth-keynote-h { font-weight: 800; font-size: 14px; margin-bottom: 3px; }
.auth-keynote-p { font-size: 12.5px; line-height: 1.45; }

/* DARK Rexo Rail login theme — the front door reads as the platform, not the Capcon workspace. */
.auth-screen.auth-dark { background: radial-gradient(130% 90% at 50% -10%, #191B1F 0%, #0B0C0E 72%); }
.auth-dark .auth-card { background: #1B1D21; border-color: rgba(255,255,255,.09); box-shadow: 0 24px 70px rgba(0,0,0,.55); color: #E8EBF0; }
.auth-dark .auth-h1 { color: #fff; }
.auth-dark .auth-sent h2 { color: #fff; }
.auth-dark .help, .auth-dark .t-label { color: #9AA3B2; }
.auth-dark .input { background: #101215; border-color: rgba(255,255,255,.13); color: #F0F2F5; }
.auth-dark .input::placeholder { color: #6B7480; }
.auth-dark .btn-ghost { color: #B7BEC9; }
.auth-dark .auth-keynote-p { color: #B7BEC9; }
.auth-dark .auth-keynote-h { color: #fff; }
.auth-dark .auth-check { background: rgba(66,141,204,.15); color: var(--rr-blue); }
/* The front door is the PLATFORM speaking — its one action is Rexo Rail blue, never Capcon red (--action). */
.auth-screen .btn-primary { background: var(--rr-blue); border-color: var(--rr-blue); }
.auth-screen .btn-primary:hover { background: var(--rr-blue-press); border-color: var(--rr-blue-press); }
.auth-screen .btn-primary:active { background: var(--rr-blue-press); border-color: var(--rr-blue-press); }
.auth-dark .auth-queued { background: rgba(255,255,255,.05); color: #9AA3B2; }

/* Billing tag */
.billtag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; }
.billtag.billable { background: var(--billable-tint); color: var(--billable); }
.billtag.internal { background: transparent; color: var(--ink-3); border: 1px solid var(--hairline); font-weight: 600; }
.billtag .glyph { width: 13px; height: 13px; }

/* Type tag for jobs */
.typetag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 7px; border-radius: 6px; background: var(--surface-sunk); color: var(--ink-2); }
.typetag.staffaug { background: var(--billable-tint); color: var(--billable); }

/* =========================================================================
   Inputs
   ========================================================================= */
.field { display: block; }
.field > .lbl { display: block; margin-bottom: 6px; }
.input, .select, textarea.input {
  width: 100%; min-height: var(--input); padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--hairline); background: var(--surface); font-size: 16px;
}
textarea.input { padding: 12px 14px; min-height: 88px; line-height: 1.45; resize: vertical; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--submitted); outline: none; box-shadow: 0 0 0 3px var(--submitted-tint); }
.input.invalid, .select.invalid { border-color: var(--sentback); box-shadow: 0 0 0 3px var(--sentback-tint); }

/* Searchable dropdown (inline combobox) — a search bar that drops a filtered list; scales past a plain <select>. */
.search-select { position: relative; }
.search-select .ss-menu {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  max-height: 288px; overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
}
.search-select.open .ss-menu { display: block; }
.ss-opt { display: flex; align-items: baseline; gap: 8px; padding: 9px 11px; border-radius: 8px; cursor: pointer; }
.ss-opt.sel { background: var(--action-tint); }
.ss-opt .ss-lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-opt .ss-sub { margin-left: auto; color: var(--ink-3); font-size: 13px; white-space: nowrap; flex: none; }
.ss-empty { padding: 10px 11px; color: var(--ink-3); }
/* the hidden <select> mirror built by searchSelect({ native }) — the combobox is the visible control, this
   only holds the same pick for a programmatic driver. Never a second dropdown on screen. */
.search-select .ss-native { display: none; }
/* multi-select: removable tags above the search box */
.msel-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.msel-tag { cursor: pointer; }
select.select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23566173' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.field-err { color: var(--sentback); font-size: 13px; font-weight: 600; margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.help { color: var(--ink-3); font-size: 13px; margin-top: 6px; }

/* Hours / number stepper */
.numstep { display: flex; align-items: center; gap: var(--s2); }
.numstep button { width: var(--stepper); height: var(--stepper); border-radius: var(--r); border: 1px solid var(--hairline); background: var(--surface); font-size: 24px; font-weight: 600; display: grid; place-items: center; color: var(--ink); }
.numstep button:hover { background: var(--surface-sunk); }
.numstep input { width: 96px; height: var(--stepper); text-align: center; font-size: 22px; font-weight: 700; border-radius: var(--r); border: 1px solid var(--hairline); }
.numstep .unit { color: var(--ink-2); font-weight: 600; }

/* =========================================================================
   Bottom sheet / modal / toast
   ========================================================================= */
.scrim { position: fixed; inset: 0; background: rgba(15,23,34,.45); z-index: 50; opacity: 0; transition: opacity .18s ease; }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-sheet); padding: var(--s4) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom));
  max-height: 92vh; overflow-y: auto; transform: translateY(100%); transition: transform .22s cubic-bezier(.2,.8,.2,1);
  max-width: 560px; margin: 0 auto;
}
.sheet.show { transform: translateY(0); }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--hairline); margin: 2px auto 14px; }
.sheet .sheet-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.sheet .sheet-head h2 { font-size: 20px; font-weight: 700; }
.sheet .sheet-body { display: flex; flex-direction: column; gap: var(--s4); }
.sheet .sheet-foot { margin-top: var(--s5); display: flex; flex-direction: column; gap: var(--s2); }

@media (min-width: 720px) {
  .sheet.as-modal { top: 50%; bottom: auto; transform: translate(0,-46%) scale(.98); border-radius: var(--r-xl); max-height: 86vh; }
  .sheet.as-modal.show { transform: translate(0,-50%) scale(1); }
}
/* PUNCH 3 (R2): roomier edit window (the job-enhancement form). Wider centered modal on desktop; the mobile
   bottom-sheet is already full-width, so open it taller for breathing room during data-heavy enrichment. */
.sheet.roomy { max-width: 860px; min-height: 72vh; }
@media (min-width: 720px) { .sheet.roomy.as-modal { max-height: 92vh; min-height: 0; } }

.toast-host { position: fixed; left: 0; right: 0; bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
@media (min-width: 960px) { .toast-host { bottom: 24px; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 92vw;
  background: var(--brand); color: #fff; padding: 12px 14px; border-radius: var(--r); box-shadow: var(--shadow-pop);
  font-size: 14px; font-weight: 600; transform: translateY(8px); opacity: 0; transition: all .18s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.ok .icon { color: #5ee0a0; }
.toast .undo { background: rgba(255,255,255,.16); border: 0; color: #fff; font-weight: 700; padding: 6px 12px; border-radius: var(--r-pill); }
.toast .icon { width: 20px; height: 20px; flex: none; }

/* =========================================================================
   Empty / skeleton
   ========================================================================= */
.empty { text-align: center; padding: var(--s10) var(--s4); color: var(--ink-2); }
.empty .art { width: 72px; height: 72px; margin: 0 auto var(--s4); color: var(--ink-3); opacity: .7; }
.empty h3 { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.empty p { max-width: 320px; margin: 0 auto var(--s5); }

.skel { background: linear-gradient(90deg, var(--surface-sunk) 25%, #f3f5f8 37%, var(--surface-sunk) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* =========================================================================
   Scheduler-specific
   ========================================================================= */
.job-card { display: flex; flex-direction: column; gap: var(--s3); }
.job-card .head { display: flex; align-items: flex-start; gap: var(--s3); }
.job-card .head .loc { font-size: 18px; font-weight: 700; }
.job-card .head .addr { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.job-card .timepill { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-sunk); border-radius: var(--r-pill); padding: 6px 12px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.job-card .note { display: flex; gap: 8px; color: var(--ink-2); font-size: 14px; background: var(--surface-sunk); padding: 10px 12px; border-radius: var(--r); }
.shortcut-row { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }

/* SMS preview bubble */
.sms-card { background: var(--brand-700); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-card); }
.sms-card .bubble { background: #222426; border-radius: 14px; padding: 14px 16px; }
.sms-card pre { margin: 0; font-family: var(--mono); font-size: 13px; line-height: 1.5; color: #e9eef3; white-space: pre-wrap; word-break: break-word; }
.sms-meta { display: flex; justify-content: space-between; color: rgba(255,255,255,.6); font-size: 12px; margin-top: 10px; font-weight: 500; }
.preview-toggles { display: flex; gap: var(--s2); margin: var(--s4) 0; flex-wrap: wrap; }

/* History */
.hist-card { display: flex; align-items: center; gap: var(--s3); }
.hist-card .day { font-weight: 700; font-size: 16px; }
.group-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin: var(--s5) 0 var(--s2); }

/* =========================================================================
   Timesheet-specific
   ========================================================================= */
.subject-bar { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.statusbar { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s3); }

.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: var(--s4) 0; }
.weekstrip .day { background: var(--surface-sunk); border: 1px solid transparent; border-radius: var(--r); padding: 8px 4px; text-align: center; }
.weekstrip .day .dow { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--ink-3); }
.weekstrip .day .dnum { font-size: 16px; font-weight: 700; }
.weekstrip .day .dh { font-size: 12px; font-weight: 700; color: var(--ink-2); min-height: 16px; }
.weekstrip .day.has { background: var(--surface); border-color: var(--hairline); box-shadow: var(--shadow-card); }
.weekstrip .day { min-height: 60px; cursor: pointer; transition: transform .06s ease, border-color .12s ease; }
.weekstrip .day:active { transform: scale(.96); }
.weekstrip .day.active { border-color: var(--action); box-shadow: 0 0 0 2px var(--action-tint); }
.weekstrip .day.active .dnum { color: var(--action-press); }
.weekstrip .day.today { box-shadow: inset 0 0 0 2px var(--action); }
.weekstrip .day.today .dow { color: var(--action); }
.weekstrip .day.has .dh { color: var(--approved); font-weight: 700; }
.weekstrip .day.missing { border-style: dashed; border-color: var(--hairline); }
.weekstrip .day.missing .dh { color: var(--ink-3); }

/* Tap-first pickers (time entry, fill-week) */
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  min-height: 46px; padding: 7px 14px; border-radius: 12px; border: 1px solid var(--hairline);
  background: var(--surface); color: var(--ink); font-weight: 650; font-size: 14px;
  display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
  transition: transform .06s ease, border-color .12s ease, background .12s ease;
}
.pick:hover { border-color: var(--ink-3); }
.pick:active { transform: scale(.97); }
.pick .sub { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.pick.selected { background: var(--action-tint); border-color: var(--action); color: var(--action-press); }
.pick.selected .sub { color: var(--action-press); }
.pick.day { min-width: 52px; align-items: center; }

.daygroup { margin-bottom: var(--s3); }
.daygroup .dhead { display: flex; align-items: baseline; gap: var(--s2); margin: var(--s4) 0 var(--s2); }
.daygroup .dhead .dname { font-size: 16px; font-weight: 700; }
.daygroup .dhead .dtot { margin-left: auto; font-weight: 700; color: var(--ink-2); }

.entry-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--hairline); }
/* Crew rows: assignment stays intact and drops below the name on phones (never overlaps). */
.entry-row .entry-end { flex-shrink: 0; }
@media (max-width: 600px) {
  .entry-row.entry-row-2line { flex-wrap: wrap; }
  .entry-row.entry-row-2line > .grow { min-width: 0; }
  .entry-row.entry-row-2line > .entry-end { flex-basis: 100%; text-align: right; margin-top: 2px; }
}
.entry-row:first-child { border-top: 0; }
.entry-row .job { font-weight: 650; }
.entry-row .act { color: var(--ink-2); font-size: 14px; }
.entry-row .hrs { font-weight: 800; font-size: 17px; margin-left: auto; }

.stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-bottom: var(--s4); }
.stat-tile { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-card); }
.stat-tile .k { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.stat-tile .v { font-size: 30px; font-weight: 800; margin-top: 6px; }
.stat-tile.billable { border-top: 3px solid var(--billable); }
.stat-tile.billable .k { color: var(--billable); }
.stat-tile.internal .k { color: var(--ink-2); }
.stat-tile.total { grid-column: 1 / -1; background: var(--brand); color: #fff; border: 0; }
.stat-tile.total .k { color: rgba(255,255,255,.75); }

.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); font-size: 14px; }
.callout.sentback { background: var(--sentback-tint); color: var(--sentback); }
.callout.info { background: var(--submitted-tint); color: var(--submitted); }
.callout .icon { width: 20px; height: 20px; flex: none; }

/* Approver */
.roster-strip { display: flex; align-items: center; gap: var(--s3); overflow-x: auto; padding-bottom: 4px; }
.roster-stat { font-weight: 800; font-size: 18px; white-space: nowrap; }
.approval-card { display: flex; flex-direction: column; gap: var(--s3); }
.approval-card .figure { font-size: 13px; color: var(--ink-2); }
.approval-card .figure b { color: var(--billable); font-size: 16px; }
.locked { position: relative; }
.lock-ribbon { display: inline-flex; align-items: center; gap: 6px; color: var(--approved); font-weight: 700; font-size: 13px; }

.byjob-row { display: flex; align-items: center; gap: var(--s3); padding: 10px 0; border-top: 1px solid var(--hairline); }
.byjob-row .val { margin-left: auto; font-weight: 700; }
.estval { color: var(--ink-3); font-size: 12px; font-weight: 600; }

/* =========================================================================
   Desktop: left rail + dock
   ========================================================================= */
/* Desktop left rail (grouped) */
.railnav {
  position: fixed; left: 0; top: calc(env(safe-area-inset-top) + var(--banner-h) + var(--ribbon-h) + var(--topbar-h)); bottom: 0;
  width: 248px; background: var(--surface); border-right: 1px solid var(--hairline);
  overflow-y: auto; padding: var(--s6) var(--s3) var(--s4); z-index: 30;
  display: flex; flex-direction: column;
}
.rail-group { margin-bottom: var(--s5); }
.rail-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 0 var(--s3) 6px; }
.railnav a {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 var(--s3);
  border-radius: var(--r); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14.5px;
}
.railnav a:hover { background: var(--surface-sunk); color: var(--ink); }
.railnav a[aria-current="page"] { background: var(--ink); color: #fff; }
.railnav a[aria-current="page"] .icon { color: #fff; }

/* Menu hub (mobile) */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.menu-card {
  display: flex; flex-direction: column; gap: 10px; padding: var(--s4); border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--shadow-card);
  text-decoration: none; color: var(--ink); font-weight: 650; min-height: 92px;
}
.menu-card .menu-ic { width: 44px; height: 44px; border-radius: var(--r); background: var(--action-tint); color: var(--action-press); display: grid; place-items: center; }

@media (min-width: 960px) {
  .topbar .context { display: inline-flex; }
  .topsearch-txt, .topsearch-kbd { display: inline-flex; } /* room for the "Search ⌘K" label on desktop */
  .app { padding-left: 248px; }
  /* full-bleed black header: break out of the rail inset so it spans edge-to-edge
     with the logo at the far left, sitting above the sidebar (no white corner gap).
     padding-left 24px = rail padding (12) + nav-link padding (12), so the logo's
     left edge lines up pixel-perfect with the sidebar icons below it. */
  /* the light banner + dark header span edge-to-edge over the sidebar, logos aligned at the same 24px inset */
  :root { --banner-h: 44px; }
  .topstack { margin-left: -248px; width: calc(100% + 248px); }
  .topbar { padding-left: 24px; }
  .rr-logo { height: 26px; }
  .action-bar { left: 248px; }
  .content { padding-top: var(--s5); padding-bottom: var(--s10); }
  .stat-tiles { grid-template-columns: 1fr 1fr 1fr; }
  .stat-tile.total { grid-column: auto; }
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Phone: hide rail-only label */
@media (max-width: 959px) {
  .desktop-only { display: none !important; }
}
@media (min-width: 960px) {
  .phone-only { display: none !important; }
}

/* =========================================================================
   Shared CRUD / list / detail
   ========================================================================= */
.list-row { display: flex; align-items: center; gap: var(--s3); cursor: pointer; margin-top: 10px; }
.list-row:hover { border-color: var(--ink-3); }
/* Rows with many trailing controls (PDF/amount/status/chevron) opt into `.lr-2line`
   and group those controls in `.lr-end`. Desktop = one row; phone = the controls drop
   to their own line so the primary identifier keeps full width and never collides.
   Scoped to `.lr-2line` so every other list row is unchanged. */
.lr-end { display: flex; align-items: center; gap: var(--s3); flex-shrink: 0; }
.list-row.lr-2line > .grow { overflow: hidden; }
.list-row.lr-2line > .grow .row { min-width: 0; }
.list-row.lr-2line > .grow .lr-primary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row.lr-2line > .grow .t-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) {
  .list-row.lr-2line { flex-wrap: wrap; }
  .list-row.lr-2line > .grow { flex-basis: 100%; }
  .list-row.lr-2line > .lr-end { flex-basis: 100%; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; row-gap: 6px; }
}
.lr-primary { font-weight: 650; font-size: 15px; }
.detail-grid { display: grid; gap: 10px; }
.detail-row { display: flex; justify-content: space-between; gap: var(--s4); border-bottom: 1px solid var(--hairline); padding-bottom: 8px; }
.detail-row span:last-child { text-align: right; font-weight: 600; }

/* =========================================================================
   Dashboard (Command Center)
   ========================================================================= */
/* minmax(0,1fr) lets cells shrink below a wide currency value so a big number
   never forces the grid (and the whole page) wider than the viewport. */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
/* A KPI grid directly after a card (e.g. job hub: "Budget vs actual" card → Contract/Cost-to-date KPIs) had NO
   top gap — the .card + .card rule doesn't match a grid — so the two blocks butted together and read as overlapping.
   Give it the same card-to-card rhythm. */
.card + .kpi-grid { margin-top: var(--s3); }
/* 3-up KPI rows (Estimates, Client Invoices, 1099, Health) fill the row instead of orphaning a lopsided
   half-cell once past phone-stack width. Scoped via .k3 so the 2-up and 4-up (2×2) grids are untouched.
   Below 600px the single-column phone rule still wins (it targets .kpi-grid at the same-or-lower specificity
   inside a max-width query that this min-width query can't match simultaneously). */
@media (min-width: 600px) { .kpi-grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { min-width: 0; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-card); }
.kpi .k { font-size: 12.5px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -0.01em; overflow-wrap: break-word; }
.kpi .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; font-weight: 500; }
.kpi.hero { background: var(--brand); color: #fff; border: 0; }
.kpi.hero .k { color: rgba(255,255,255,.72); }
.kpi.hero .sub { color: rgba(255,255,255,.6); }
@media (max-width: 600px) {
  /* On phones, KPI cards go single-column so a 7-figure figure gets the full width and
     stays big + readable, instead of wrapping mid-number in a cramped 2-up cell. (Applies
     to every .kpi-grid — Command Center, Client Invoices, Estimates, overhead, etc.; the
     .pl-grid label/value list below overrides this for the Portfolio P&L.) */
  .kpi-grid { grid-template-columns: 1fr; }
  /* Portfolio P&L → a clean label-left / value-right list on mobile. The 2×2 grid
     crammed 8-figure numbers edge-to-edge (they tipped into overlap on real phones);
     a list gives each number roughly double the room, so it can never collide. */
  .pl-grid { grid-template-columns: 1fr; gap: 0; }
  .pl-grid > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--hairline); }
  .pl-grid > div:first-child { border-top: 0; }
  .pl-grid .t-label { flex: 1; min-width: 0; margin: 0; }
  .pl-grid .bignum { flex: none; white-space: nowrap; font-size: clamp(17px, 5vw, 22px); }
}
.money-pos { color: var(--approved); }
.money-neg { color: var(--danger); }
.money-in { color: var(--approved); }
.money-out { color: var(--sentback); }

.progress { height: 8px; background: var(--surface-sunk); border-radius: var(--r-pill); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--action); border-radius: var(--r-pill); }
.progress.over > i { background: var(--danger); }
/* Revenue and cost: a bar or the profit line that opens the money card is a full-size target. */
.rc-bar[role="button"], .rc-profit[role="button"] { min-height: var(--tap); cursor: pointer; }
.rc-bar[role="button"]:focus-visible, .rc-profit[role="button"]:focus-visible { outline: 3px solid var(--submitted); outline-offset: 2px; border-radius: 6px; }
/* Revenue and cost: the cost bar's key. Each swatch is the same ink at its segment's weight in the bar. */
.rc-key { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); margin-top: var(--s1); min-width: 0; }
.rc-key span { display: inline-flex; align-items: center; gap: var(--s1); }
.rc-key span::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--ink-2); }
.rc-key [data-key-seg="labor"]::before { opacity: 0.9; }
.rc-key [data-key-seg="invoices"]::before { opacity: 0.68; }
.rc-key [data-key-seg="cards"]::before { opacity: 0.5; }
.rc-key [data-key-seg="ap"]::before { opacity: 0.6; }
.rc-key [data-key-seg="overhead"]::before { opacity: 0.3; }

.pnl-row { display: flex; align-items: center; gap: var(--s3); padding: 12px 0; border-top: 1px solid var(--hairline); }
.pnl-row:first-child { border-top: 0; }
.pnl-row .name { font-weight: 650; }
.pnl-row .nums { margin-left: auto; text-align: right; }
.pnl-row .margin { font-weight: 800; font-variant-numeric: tabular-nums; }

/* Job hub header figures (direction A): four up on a desk, two up at 390px. minmax(0, …) lets a
   six-figure amount shrink its track instead of pushing the row past the screen. */
.job-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.job-fig { display: flex; flex-direction: column; justify-content: center; min-width: 0; min-height: 44px; cursor: pointer; }
.job-fig b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .job-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Job hub slice 2: one primary + "More" beside the name, 44px+ tabs, and on a laptop a main column with
   the job's properties in a side column (Stripe customer page / Linear properties). Phone: one column. */
.job-actions { display: flex; align-items: center; gap: var(--s2); flex-shrink: 0; }
.job-actions button { min-height: var(--tap); }
.job-more { display: flex; flex-direction: column; gap: var(--s2); }
.job-more button { min-height: var(--tap); }
.job-card-title { margin-bottom: var(--s2); }
#job-tabs .segmented button { min-height: var(--tap); }
.job-main { min-width: 0; }
/* The Details column never grows past its track; each value wraps inside it, nothing clipped. */
.job-props { min-width: 0; }
.job-props .detail-row span:last-child { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 1024px) {
  .job-hub { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s6); align-items: start; }
  .job-props { margin-top: var(--s2); }
}
/* Phone: the job name gets the full width on its own line; Generate invoice + More sit on the line below. */
@media (max-width: 600px) {
  .job-head { flex-wrap: wrap; }
  .job-head .job-name { flex-basis: 100%; }
}

/* =========================================================================
   Compliance grid
   ========================================================================= */
.comp-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 8px; align-items: center; padding: 12px 0; border-top: 1px solid var(--hairline); }
.comp-row.head { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--ink-3); letter-spacing: .04em; }
.comp-row:first-child { border-top: 0; }
.comp-cell { text-align: center; }
.comp-cell.name { text-align: left; }
@media (max-width: 600px) {
  .comp-row { grid-template-columns: 1fr; gap: 6px; }
  .comp-row.head { display: none; }
  .comp-cell { text-align: left; display: flex; justify-content: space-between; }
  .comp-cell::before { content: attr(data-label); color: var(--ink-3); font-size: 12px; font-weight: 600; }
  .comp-cell.name::before { content: ''; }
  .comp-cell.name { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
}

/* =========================================================================
   Photos (receipts / site updates)
   ========================================================================= */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-tile { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--surface-sunk); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-add { border: 1.5px dashed var(--hairline); border-radius: var(--r); display: grid; place-items: center; aspect-ratio: 4 / 3; color: var(--ink-2); gap: 4px; cursor: pointer; }
.photo-add:hover { border-color: var(--action); color: var(--action); }
.photo-add input { display: none; }
.thumb { width: 56px; height: 56px; border-radius: var(--r-sm); object-fit: cover; flex: none; background: var(--surface-sunk); }

.feed-item { display: flex; gap: var(--s3); }
.feed-item .when { color: var(--ink-3); font-size: 12px; }

/* big-number summary line */
/* Shrinks on narrow phones so side-by-side pairs (e.g. Budgeted / Contract value)
   don't clip; caps at 30px on wider screens. */
.bignum { font-size: clamp(20px, 6vw, 30px); font-weight: 800; letter-spacing: -0.01em; }

/* =========================================================================
   Micro-interactions & cross-app polish
   ========================================================================= */
#view { animation: viewIn .2s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.card { transition: box-shadow .15s ease, transform .08s ease, border-color .15s ease; }
.list-row:hover, .menu-card:hover, .job-card:hover, .hist-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-pop); }
.kpi { transition: box-shadow .15s ease, border-color .15s ease; }
.kpi[style*="pointer"]:hover { box-shadow: var(--shadow-pop); }
/* Job hub — a tapped KPI scrolls to the card holding the rows that make it true. scroll-margin keeps that
   card's TITLE clear of the sticky top stack, so you land on the heading that names what you tapped instead
   of halfway down its rows. */
[data-kpi-dest] { scroll-margin-top: calc(env(safe-area-inset-top) + var(--banner-h) + var(--ribbon-h) + var(--topbar-h) + 10px); }
/* "You landed here" — deliberately the SAME ring :focus-visible already draws (line 139), not a new colour:
   it already means exactly this (your attention is here) and it borrows no status or action token, so no
   colour on this screen gains a second meaning (ux-craft §2). It STAYS while you read that card — the same
   lifetime as the focus ring it borrows — and moves when you tap another KPI, so "which card did I land on?"
   is still answerable after a scroll or a re-render. It was a 1.4s flash, which meant a reader who looked up
   a second later, and every checker, saw nothing at all. */
[data-kpi-dest].just-landed { outline: 3px solid var(--submitted); outline-offset: 2px; }
/* No :focus override here on purpose: tabindex=-1 means the card is never a tab stop, and when the KPI was
   activated by the keyboard :focus-visible SHOULD draw on the destination — that is the right behaviour. */
.pnl-job:hover { background: var(--surface-sunk); }
.btn { transition: transform .05s ease, background .15s ease, border-color .15s ease, color .15s ease; }
.chip { transition: background .12s ease, border-color .12s ease, transform .06s ease; }
.chip:active { transform: scale(.96); }
.iconbtn { transition: background .12s ease, color .12s ease; }
/* ---- Estimate Cockpit — funnel bar + prioritized action list ---- */
.funnel { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; scroll-snap-type: x proximity; }
.fseg { flex: 1; min-width: 96px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); padding: 10px; cursor: pointer; transition: .12s; text-align: left; scroll-snap-align: start; color: var(--ink); font-family: inherit; }
.fseg:hover { border-color: var(--ink-3); }
.fseg.on { border-color: var(--action); box-shadow: 0 0 0 2px var(--action-tint); }
.fnm { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-2); display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.fct { font-size: 22px; font-weight: 800; line-height: 1.15; }
.fval { font-size: 12px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fbar { height: 6px; border-radius: var(--r-pill); background: var(--surface-sunk); margin-top: 7px; overflow: hidden; }
.fbar i { display: block; height: 100%; border-radius: var(--r-pill); }
.cock-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 2px 10px; }
.cock-head .ch-ttl { font-size: 15px; font-weight: 800; }
.cock-list { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.crow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--hairline); cursor: pointer; }
.crow:last-child { border-bottom: 0; }
.crow:hover { background: var(--surface-sunk); }
.crow-why { width: 132px; flex: none; }
.crow-mid { flex: 1; min-width: 0; }
.crow-t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow-end { display: flex; align-items: center; gap: 12px; flex: none; }
.crow-amt { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cpill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap; }
.cpill.red { background: var(--danger-tint); color: var(--danger); }
.cpill.amber { background: var(--sentback-tint); color: var(--sentback); }
.cpill.green { background: var(--approved-tint); color: var(--approved); }
.cpill.grey { background: var(--surface-sunk); color: var(--ink-2); }
/* stage-picker: a colored stage chip + a clean dropdown menu (position:fixed → not clipped by the list) */
.stagepick { position: relative; }
.stagepick-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--hairline); background: var(--surface); border-radius: var(--r-pill); padding: 5px 8px 5px 10px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--ink); font-family: inherit; white-space: nowrap; }
.stagepick-btn:hover { border-color: var(--ink-3); background: var(--surface-sunk); }
.sp-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sp-cur { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.sp-chev { color: var(--ink-3); transition: transform .12s; }
.stagepick.open .sp-chev { transform: rotate(180deg); }
.stagepick-menu { position: fixed; z-index: 60; display: none; min-width: 192px; max-height: calc(100vh - 16px); overflow-y: auto; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 5px; -webkit-overflow-scrolling: touch; }
.sp-opt:focus-visible { outline: none; background: var(--surface-sunk); box-shadow: inset 0 0 0 2px var(--submitted); }
.stagepick.open .stagepick-menu { display: block; }
.sp-opt { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0; background: transparent; border-radius: var(--r-sm); padding: 9px 10px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); font-family: inherit; }
.sp-opt:hover { background: var(--surface-sunk); }
.sp-opt.sel { font-weight: 800; }
.sp-opt .grow { flex: 1; }
.sp-ck { color: var(--action); flex: none; }
@media (max-width: 600px) {
  .fseg { min-width: 82px; }
  /* Cockpit rows reflow on phones (Conner P0 2026-09-07): was ONE flex row (why + title + amount + "edited
     since sent" + stage picker) that overflowed/cramped at 375 — stack to a glanceable card: status + $ + stage
     on the top line, the title + customer wrapping full-width below. Pure CSS; no JS/structure change. */
  .crow { flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; padding: 13px 14px; }
  .crow-why { width: auto; order: 1; flex: none; }
  .crow-end { order: 2; margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px 8px; }
  .crow-mid { order: 3; flex-basis: 100%; min-width: 0; }
  .crow-t { white-space: normal; }
  .crow-amt { font-size: 15px; }
  .sp-cur { max-width: 74px; }
}
/* sort/filter bar */
.toolbar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.toolbar .select { width: auto; min-width: 140px; min-height: 40px; }
.toolbar .spacer { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  *, #view { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---- Proposal preview: a PDF-like document with inline-editable fields ---- */
/* ============================================================================
   Proposal document — a faithful on-screen replica of Capcon's real PDF proposal.
   Matches assets/proposal_bakedin.pdf and proposal_costplus.pdf 1:1.
   ========================================================================== */
.proposal-doc { background: #fff; color: #1a1a1a; border: 1px solid var(--hairline); border-radius: 8px; box-shadow: var(--shadow-card); padding: 34px 34px 26px; line-height: 1.45; }
.proposal-doc .pp-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #9aa0a6; }
.proposal-doc .pp-line { font-size: 13px; color: #3c4043; padding: 1px 0; }
.proposal-doc .pp-party { font-size: 15.5px; font-weight: 800; color: #1a1a1a; margin: 4px 0 3px; }
/* Letterhead */
.proposal-doc .pp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.proposal-doc .pp-logo-img { max-height: 54px; max-width: 260px; width: auto; object-fit: contain; }
.proposal-doc .pp-logo-word { font-size: 22px; font-weight: 800; color: var(--action); letter-spacing: .5px; }
.proposal-doc .pp-logo-word span { color: #1a1a1a; font-weight: 700; }
.proposal-doc .pp-head-r { text-align: right; }
.proposal-doc .pp-title { font-size: 40px; font-weight: 800; letter-spacing: 1px; line-height: 1; color: #1a1a1a; }
.proposal-doc .pp-kv { margin-top: 6px; font-size: 12px; }
.proposal-doc .pp-kv .pp-k { color: #9aa0a6; font-weight: 700; letter-spacing: .5px; margin-right: 10px; }
.proposal-doc .pp-kv .pp-v { font-weight: 700; color: #1a1a1a; font-variant-numeric: tabular-nums; }
.proposal-doc .pp-rule-heavy { border-top: 3px solid #1a1a1a; margin: 10px 0 18px; }
.proposal-doc .pp-rule-thin { border-top: 1px solid var(--hairline); margin: 10px 0; }
/* FROM / TO */
.proposal-doc .pp-fromto { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px; }
/* Project / Site band */
.proposal-doc .pp-projbar { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; background: #f4f5f7; border-radius: 6px; padding: 12px 16px; margin-bottom: 18px; }
.proposal-doc .pp-projval { font-size: 14px; color: #1a1a1a; margin-top: 2px; }
/* Scope of Work table */
.proposal-doc .pp-scope-title { margin: 2px 0 8px; }
.proposal-doc .pp-scope-head { display: grid; grid-template-columns: 28px 1fr 130px; gap: 10px; align-items: end; font-size: 10.5px; font-weight: 700; letter-spacing: .6px; color: #9aa0a6; padding-bottom: 6px; border-bottom: 1px solid var(--hairline); }
.proposal-doc .pp-item { display: grid; grid-template-columns: 28px 1fr 130px; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--hairline); }
.proposal-doc .pp-num { color: #9aa0a6; font-size: 13px; font-weight: 600; }
.proposal-doc .pp-tname { font-size: 14.5px; font-weight: 800; color: #1a1a1a; }
.proposal-doc .pp-tscope { font-size: 13px; color: #3c4043; margin-top: 2px; }
.proposal-doc .pp-tdetail { font-size: 12.5px; color: #9aa0a6; margin-top: 2px; white-space: pre-wrap; }
.proposal-doc .pp-price { text-align: right; font-variant-numeric: tabular-nums; }
.proposal-doc .pp-amt { font-size: 14.5px; font-weight: 800; color: #1a1a1a; }
.proposal-doc .pp-flag { font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #9aa0a6; }
.proposal-doc .pp-muted { font-size: 13px; color: #9aa0a6; padding: 12px 0; }
/* Exclusions + memo */
.proposal-doc .pp-excl { font-size: 13px; color: #3c4043; line-height: 1.55; margin: 6px 0 0; }
.proposal-doc .pp-memo { background: #f4f5f7; border-radius: 6px; padding: 14px 16px; font-size: 13px; color: #3c4043; line-height: 1.55; margin: 18px 0; white-space: pre-wrap; }
/* Totals — right-aligned; cost-plus adds subtotal + markup above the black band */
.proposal-doc .pp-totals { margin: 18px 0 6px; }
.proposal-doc .pp-subrows { width: 62%; margin-left: auto; }
.proposal-doc .pp-subrow { display: flex; justify-content: space-between; font-size: 13.5px; color: #3c4043; padding: 5px 4px; }
.proposal-doc .pp-subrow span:last-child { font-variant-numeric: tabular-nums; }
.proposal-doc .pp-total-band { width: 62%; margin-left: auto; margin-top: 6px; display: flex; justify-content: space-between; align-items: center; background: #1a1a1a; color: #fff; border-radius: 4px; padding: 14px 18px; }
.proposal-doc .pp-total-band > span:first-child { font-size: 14px; font-weight: 700; letter-spacing: .6px; }
.proposal-doc .pp-total-amt { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* Footer */
.proposal-doc .pp-foot { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 8px; }
.proposal-doc .pp-foot-l { font-size: 11px; color: #9aa0a6; }
.proposal-doc .pp-foot-r { text-align: right; }
.proposal-doc .pp-foot-r .pp-line { font-size: 12px; }
/* --- Full-screen proposal editor: the document IS the editor, given room to breathe --- */
.sheet.as-doc { left: 0; right: 0; top: 0; bottom: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border-radius: 0; overflow: hidden; }
.sheet.as-doc .grab { display: none; }
.sheet.as-doc .sheet-body { display: block; height: 100%; gap: 0; }
.pp-shell { display: flex; flex-direction: column; height: 100%; background: #eceef1; }
.pp-toolbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--hairline); z-index: 2; }
.pp-tbar-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pp-tbar-title { font-size: 16px; font-weight: 700; line-height: 1.1; }
.pp-tbar-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-tbar-r { display: flex; align-items: center; gap: 8px; flex: none; }
.pp-canvas { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 26px 16px 56px; -webkit-overflow-scrolling: touch; }
.proposal-doc.pp-editable { max-width: 850px; margin: 0 auto; }
@media (min-width: 720px) {
  .sheet.as-doc { left: 50%; right: auto; top: 50%; bottom: auto; width: min(1080px, 96vw); height: 94vh; border-radius: 16px; transform: translate(-50%, -46%) scale(.98); }
  .sheet.as-doc.show { transform: translate(-50%, -50%) scale(1); }
}
/* Inline editable fields — blend into the document, reveal an edit box on hover/focus */
.proposal-doc .pp-edit { font: inherit; color: inherit; box-sizing: border-box; width: calc(100% + 12px); margin: 0 -6px; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 3px 6px; transition: background .12s ease, border-color .12s ease, box-shadow .12s ease; }
.proposal-doc .pp-edit::placeholder { color: #b8bec5; font-style: italic; font-weight: 400; }
.proposal-doc .pp-edit:hover { background: #e6eaef; }
.proposal-doc .pp-edit:focus { outline: 0; background: #fff; border-color: var(--action); box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 14%, transparent); }
.proposal-doc textarea.pp-edit { display: block; resize: none; overflow: hidden; min-height: 1.6em; line-height: 1.5; }
.proposal-doc .pp-projval-edit { font-size: 14px; color: #1a1a1a; margin-top: 2px; }
.proposal-doc .pp-name-edit { font-size: 14.5px; font-weight: 800; color: #1a1a1a; }
.proposal-doc .pp-scope-edit { font-size: 13px; color: #3c4043; }
.proposal-doc .pp-detail-edit { font-size: 12.5px; color: #9aa0a6; }
.proposal-doc .pp-excl-edit { font-size: 13px; color: #3c4043; line-height: 1.55; }
.proposal-doc .pp-memo-edit { font-size: 13px; color: #3c4043; line-height: 1.55; }
.proposal-doc .pp-amt-edit { font-size: 14.5px; font-weight: 800; color: #1a1a1a; text-align: right; font-variant-numeric: tabular-nums; align-self: start; }
/* Edit-form read-only price chip */
.pd-readonly-price { color: var(--ink-3); font-style: italic; background: var(--surface-sunk); }
/* (Client print-to-PDF @media block removed — Conner ruling A 2026-08-21: the proposal PDF is rendered
   SERVER-SIDE by proposal-pdf/proposal.html. No client render, no forked FE template. See data/document-export.js.) */

/* --- Field Receipt Capture — mobile-first, thumb-friendly one-screen flow --- */
.field-capture { max-width: 520px; margin: 0 auto; }
.fc-screen { display: flex; flex-direction: column; gap: 14px; padding: 8px 2px 32px; }
.fc-hello { font-size: 22px; font-weight: 800; text-align: center; margin-top: 6px; }
/* the big snap button — the whole job is "tap here" */
.fc-camera { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; aspect-ratio: 1 / 1; max-height: 62vh; border: 0; border-radius: 22px; background: var(--action); color: #fff; font-size: 21px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow-pop, 0 12px 32px color-mix(in srgb, var(--action) 28%, transparent)); transition: transform .08s ease; }
.fc-camera:active { transform: scale(.98); }
/* "who's capturing" attribution chip — sits above the snap button (replaces the old not-linked dead-end) */
.fc-whochip { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--hairline); border-radius: 999px; background: var(--surface); color: var(--ink); padding: 8px 14px; font-size: 15px; font-weight: 600; cursor: pointer; }
.fc-whochip .grow { text-align: left; }
.fc-whochip-warn { border-color: var(--action); color: var(--action); background: color-mix(in srgb, var(--action) 7%, transparent); font-weight: 700; }
.fc-camera-off { background: var(--surface-sunk); color: var(--ink-3); box-shadow: none; cursor: pointer; }
.fc-hint { text-align: center; color: var(--ink-2); font-size: 14px; margin: 2px 0 0; }
.fc-pending { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); background: var(--surface-sunk); border-radius: 999px; padding: 8px 12px; }
/* reading */
.fc-reading { align-items: center; text-align: center; padding-top: 20vh; }
.fc-spinner { color: var(--action); animation: fc-spin 1s linear infinite; }
.fc-readtitle { font-size: 18px; font-weight: 700; }
@keyframes fc-spin { to { transform: rotate(360deg); } }
/* confirm */
.fc-readhead { display: flex; align-items: center; gap: 7px; font-weight: 700; color: var(--approved, #1a7f37); font-size: 14px; }
.fc-readhead-warn { color: var(--warn, #b25b00); }
.fc-thumb { width: 100%; max-height: 240px; object-fit: contain; border-radius: 12px; border: 1px solid var(--hairline); background: var(--surface-sunk); }
/* PDF receipt: no thumbnail exists (nothing renders a PDF client-side), so an honest "attached" chip instead */
.fc-filechip { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--surface-sunk); }
.fc-filechip svg { flex: none; color: var(--muted, #6b7280); }
.fc-filechip-name { font-weight: 700; font-size: 14px; word-break: break-all; }
.fc-filechip-sub { font-size: 12.5px; color: var(--muted, #6b7280); margin-top: 2px; }
/* bad-photo callout — about the RECEIPT, not just the amount; the guy fills what Claude missed */
.fc-badphoto { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: 11px; font-size: 13.5px; line-height: 1.35; color: var(--warn-ink, #7a3e00); background: var(--warn-bg, #fff5e6); border: 1px solid var(--warn-line, #f0d199); }
.fc-badphoto svg { flex: none; margin-top: 1px; color: var(--warn, #b25b00); }
/* editable vendor/amount/date — a field Claude couldn't read gets flagged until the guy fills it */
.fc-unread { border-color: var(--warn, #b25b00) !important; background: var(--warn-bg, #fff5e6); }
.fc-amount-wrap { display: flex; flex-direction: column; gap: 5px; }
.fc-credit-hint { font-size: 12.5px; font-weight: 700; color: var(--approved, #1a7f37); }
/* RETURN / CREDIT — the amount's SIGN gets its own control, because a phone number keypad has no minus key
   (Conner 2026-10-22, from prod). Full width at --btn so it is one gloved thumb, and left-aligned with the
   glyph so it reads as a statement being switched on rather than a submit button. The ON state is the
   ACTION/SELECTION tint — "this control is turned on" — never a status colour and never bare red, which on a
   money screen means something is wrong. Colour is reinforcement only: the glyph and aria-checked carry it. */
/* Spacing is the grouping: 5px above — the SAME gap .fc-amount-wrap uses between its own stacked children —
   binds the toggle to the amount box it signs, and 10px below separates that pair from the next field. The
   old -2px pulled the toggle's border 2px ON TOP of the input's bottom border (measured: toggle top 333,
   input bottom 335), which on a money field is two tap targets with no boundary between them. */
.fc-return-row { display: flex; flex-direction: column; gap: 5px; margin: 5px 0 10px; }
.fc-return-toggle { width: 100%; justify-content: flex-start; gap: 10px; color: var(--ink-2); }
.fc-return-toggle .rt-glyph { display: inline-flex; flex: none; color: var(--ink-3); }
.fc-return-toggle.on { background: var(--action-tint); border-color: var(--action); color: var(--action-press); }
.fc-return-toggle.on .rt-glyph { color: var(--action); }
.fc-approve { min-height: 58px; font-size: 19px; margin-top: 6px; }
.fc-retake { color: var(--ink-2); }
.fc-reviewlink { color: var(--ink-2); font-weight: 650; gap: 7px; margin-top: 2px; }
/* quiet on-behalf link (office roles, self-capture default) — a text line, deliberately not a field */
.fc-behalflink { border: 0; background: none; color: var(--ink-2); font-size: 13.5px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 2px 0; align-self: center; }
/* reader down — connection failure, NOT a bad photo: paged Conner, nothing for the guy to fix */
.fc-readerdown { align-items: center; text-align: center; padding-top: 12vh; gap: 12px; }
.fc-rd-icon { color: var(--warn, #b25b00); }
.fc-rd-title { font-size: 22px; font-weight: 800; }
.fc-rd-sub { color: var(--ink-2); font-size: 14.5px; line-height: 1.4; max-width: 340px; }
.fc-readerdown .btn { margin-top: 14px; }
/* done */
.fc-done { align-items: center; text-align: center; padding-top: 12vh; gap: 10px; }
.fc-check { color: var(--approved, #1a7f37); }
.fc-donetitle { font-size: 30px; font-weight: 800; }
.fc-donesub { color: var(--ink-2); font-size: 15px; max-width: 320px; }
.fc-done .btn { margin-top: 18px; }
/* honest submit outcomes: pending (queued) + failed (dead-lettered) */
.fc-pending-done .fc-clock { color: var(--submitted, #b25b00); }
.fc-failed { align-items: center; text-align: center; padding-top: 11vh; gap: 10px; }
.fc-failed .fc-fail-icon { color: var(--sentback, #C2410C); }
.fc-failed .fc-donetitle { font-size: 26px; }
.fc-fail-reason { font-size: 12px; color: var(--ink-3); background: var(--surface-sunk); border-radius: 8px; padding: 8px 12px; max-width: 340px; word-break: break-word; }
.fc-failed .btn { margin-top: 12px; }
/* dead-letter surface on the snap screen */
.fc-deadbanner { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
  padding: 10px 12px; border-radius: 999px; border: 1px solid var(--sentback, #C2410C); background: var(--sentback-tint, #fdecee);
  color: var(--sentback, #C2410C); font-size: 12.5px; font-weight: 700; cursor: pointer; }

/* Command palette (⌘K) — the "jump anywhere" surface (Linear/Stripe) */
.cmdp-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(15,20,30,.44); display: flex; justify-content: center; align-items: flex-start; padding: 8vh 16px 16px; }
/* Short viewports (phone with the on-screen keyboard up, or landscape): center + tighten so results stay visible. */
@media (max-height: 680px) { .cmdp-overlay { align-items: center; padding: 12px; } .cmdp-panel { max-height: 88vh; } }
.cmdp-panel { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.35); overflow: hidden; display: flex; flex-direction: column; max-height: 72vh; }
.cmdp-inputrow { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--hairline); }
.cmdp-searchic { color: var(--ink-3); flex: none; }
.cmdp-input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 17px; color: var(--ink); font-weight: 600; }
.cmdp-esc { flex: none; font-size: 11px; color: var(--ink-3); border: 1px solid var(--hairline); border-radius: 6px; padding: 2px 6px; font-family: inherit; }
.cmdp-list { overflow-y: auto; padding: 6px; }
.cmdp-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.cmdp-row.sel { background: var(--action-tint); }
.cmdp-row.sel .cmdp-ic { color: var(--action); }
.cmdp-ic { color: var(--ink-3); flex: none; display: grid; place-items: center; }
.cmdp-lbl { font-weight: 650; font-size: 15px; color: var(--ink); }
.cmdp-sub { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.cmdp-empty { padding: 24px; text-align: center; color: var(--ink-3); font-size: 14px; }
.cmdp-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--hairline); font-size: 11px; color: var(--ink-3); }
.cmdp-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* Live count badges — nav items, launchpad tiles, palette rows (office-only: needs-attention queues) */
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; flex: none; }
.railnav a .nav-count { margin-left: auto; }
.fh-tile { position: relative; }
.fh-tile .nav-count { position: absolute; top: 12px; right: 12px; }
.cmdp-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 800; margin-left: 8px; flex: none; }

/* Topbar search button */
.topsearch { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 var(--s3); border-radius: var(--r);
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: var(--on-brand, #fff); cursor: pointer; }
/* Mobile: the top search is ICON-ONLY (the label + ⌘K would crowd the bar and collide with the logo);
   the label is restored on desktop below, where there's room. */
.topsearch-txt, .topsearch-kbd { display: none; }
.topsearch-txt { font-size: 13px; font-weight: 600; opacity: .85; }
.topsearch-kbd { font-size: 11px; border: 1px solid rgba(255,255,255,.28); border-radius: 5px; padding: 1px 5px; opacity: .82; font-family: inherit; }

/* Rail search box + collapsible Setup/Manage groups */
/* Belongs to the same system as the nav below it: same horizontal padding (icon lines up with the nav icons),
   same pill radius + row height, a muted placeholder look — a considered search pill, not a raw input field. */
.rail-search { display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 var(--s3); margin: var(--s3) 0 var(--s5);
  border-radius: var(--r); border: 1px solid transparent; background: var(--surface-sunk); color: var(--ink-3);
  cursor: pointer; font-weight: 600; font-size: 14px; transition: border-color .12s ease, color .12s ease; }
.rail-search:hover { border-color: var(--hairline); color: var(--ink-2); }
.rail-search .grow { text-align: left; }
.rail-kbd { flex: none; font-size: 11px; border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 1px 6px; color: var(--ink-3); background: var(--surface); }
.rail-sum { list-style: none; }
.rail-sum::-webkit-details-marker { display: none; }
.rail-chev { transition: transform .15s ease; }
.rail-collapsible[open] .rail-chev { transform: rotate(90deg); }

/* Field Home — phone-first launchpad for Field Super + Crew (Material 3 big-tile field UI) */
.fieldhome { padding-top: 6px; }
.fh-head { margin: 2px 2px 16px; }
.fh-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--action); }
.fh-title { font-size: 24px; font-weight: 800; margin-top: 3px; }
.fh-hero { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r-lg);
  background: var(--action); color: #fff; text-decoration: none; box-shadow: var(--shadow-pop, 0 12px 32px color-mix(in srgb, var(--action) 28%, transparent)); margin-bottom: 16px; }
.fh-hero:active { transform: scale(.99); }
.fh-hero-ic { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 14px; background: rgba(255,255,255,.16); }
.fh-hero-t { display: block; font-size: 19px; font-weight: 800; }
.fh-hero-s { display: block; font-size: 13px; opacity: .9; margin-top: 1px; }
.fh-section { margin-top: 14px; }
.fh-section .group-label { margin-bottom: 8px; }
.fh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fh-tile { display: flex; flex-direction: column; gap: 12px; min-height: 104px; padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--shadow-card); text-decoration: none; color: var(--ink); font-weight: 700; }
.fh-tile:active { transform: scale(.99); }
.fh-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; background: var(--action-tint); color: var(--action-press); }
.fh-lbl { font-size: 15px; line-height: 1.2; }
@media (min-width: 700px) { .fh-grid { grid-template-columns: repeat(3, 1fr); } }

/* Command Center launchpad: "Needs you today" strip + tool launcher (SAP Fiori / Oracle patterns) */
.needs-block { margin-bottom: var(--s4); }
.needs-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.need-tile { display: flex; flex-direction: column; gap: 5px; padding: 13px 15px; min-height: 88px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--shadow-card); text-decoration: none; color: var(--ink); }
.need-tile.urgent { border-color: var(--sentback); }
.need-tile .need-ic { color: var(--action); }
.need-tile.urgent .need-ic { color: var(--sentback); }
.need-n { font-size: 27px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.need-l { font-size: 12.5px; color: var(--ink-2); font-weight: 600; line-height: 1.25; }
.kpi-asof { font-size: 12px; color: var(--ink-3); margin: -8px 0 14px; }
.launch-wrap { margin-top: var(--s5); }
.launch-sec { border-top: 1px solid var(--hairline); }
.launch-sum { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 12px 2px; list-style: none;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.launch-sum::-webkit-details-marker { display: none; }
.launch-chev { transition: transform .15s ease; color: var(--ink-3); }
.launch-sec[open] .launch-chev { transform: rotate(90deg); }
.launch-sec .menu-grid { margin: 2px 0 14px; }

/* Job Hub — "Codeable classes" (job_class_options / 0097) assignment checkboxes */
.jc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 6px 0 2px; }
.jc-check { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 9px; background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; }
.jc-check input { width: 18px; height: 18px; flex: none; accent-color: var(--action); }
.jc-check.jc-locked { opacity: .75; cursor: default; }
.jc-hint { font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--approved, #1a7f37); flex: none; }
@media (max-width: 460px) { .jc-grid { grid-template-columns: 1fr; } }

/* --- Command Center: per-invoice two-axis status (QuickBooks sync · settlement) --- */
.inv-axis-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 0; border-top: 1px solid var(--hairline); }
.inv-axis-head { border-top: 0; padding: 0 0 2px; }
.inv-axis-head .inv-ax { font-size: 10px; letter-spacing: .6px; font-weight: 700; color: var(--ink-3); }
.inv-ax { flex: none; min-width: 122px; display: flex; justify-content: flex-end; }
/* Settlement pill — three-state MONEY axis. Outlined + colored dot, deliberately distinct
   from the solid `.status` sync flags so the two axes never read as one thing. */
.settle-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1.5px solid; background: var(--surface); white-space: nowrap; }
.settle-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.settle-paid { color: #1a7f37; border-color: #9ad5ac; }
.settle-partial { color: #b45309; border-color: #f0c68a; }
.settle-open { color: #1d4ed8; border-color: #bfdbfe; }
.settle-void { color: #6b7280; border-color: #d8dce1; }
.settle-void .settle-dot { background: transparent; border: 1.5px solid currentColor; }
.settle-none { color: var(--ink-3); font-weight: 700; }
@media (max-width: 560px) {
  .inv-axis-head { display: none; }
  .inv-ax { min-width: 0; justify-content: flex-start; }
  .inv-axis-row > .grow { flex-basis: 100%; }
}
@media (max-width: 600px) {
  .proposal-doc { padding: 20px 16px; }
  /* Stack the letterhead so nothing clips on a phone: logo, then PROPOSAL block, left-aligned. */
  .proposal-doc .pp-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .proposal-doc .pp-head-r { text-align: left; }
  .proposal-doc .pp-title { font-size: 28px; }
  .proposal-doc .pp-fromto, .proposal-doc .pp-projbar { grid-template-columns: 1fr; gap: 12px; }
  .proposal-doc .pp-subrows, .proposal-doc .pp-total-band { width: 100%; }
  .proposal-doc .pp-total-amt { font-size: 20px; }
  .pp-toolbar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
  .pp-tbar-sub { display: none; }
  .pp-tbar-r { justify-content: stretch; }
  .pp-tbar-r .btn { flex: 1; justify-content: center; }
  .pp-canvas { padding: 14px 10px 40px; }
}

/* Demo Foundation (Program 1) — the unmissable DEMO ribbon + the in-app tenant switcher. Demo uses --billable
   violet (distinct from --action red = act and --warn orange = trouble) so a demo marker never reads as either. */
.demo-ribbon { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 4px 12px;
  background: var(--billable, #7C3AED); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.demo-ribbon-tag { background: rgba(255,255,255,.24); border-radius: 4px; padding: 1px 7px; }
.demo-ribbon-sub { font-weight: 700; letter-spacing: .01em; opacity: .96; }
.tenant-switch { display: inline-flex; align-items: center; gap: 7px; max-width: 220px; padding: 5px 10px;
  border: 1px solid var(--hairline, #e2e6ec); border-radius: 9px; background: var(--surface, #fff);
  font-weight: 700; font-size: 13px; cursor: pointer; }
.tenant-switch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-tag { background: var(--billable-tint, #F1EAFB); color: var(--billable, #7C3AED); border-radius: 5px;
  padding: 1px 6px; font-size: 10px; font-weight: 800; letter-spacing: .05em; }
.tenant-picker { max-width: 460px; margin: 0 auto; padding: 24px 16px 40px; }
.tenant-picker-title { font-size: 22px; font-weight: 800; margin: 0; }
.tenant-picker-row { text-align: left; }

/* Field-cache update banner (version-check, 2026-08-28). Unmissable one-tap reload; red = ACTIONABLE (a reload IS
   an action → color-grammar correct). Floats above the mobile bottom-nav. */
.rr-update-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 12px);
  z-index: 60; display: inline-flex; align-items: center; gap: 10px;
  max-width: calc(100% - 24px); padding: 12px 18px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: var(--action); color: #fff; font-family: var(--font); font-size: 15px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0,0,0,.22); animation: rr-update-in .18s ease;
}
.rr-update-banner .icon { color: #fff; }
.rr-update-banner .rr-update-text { font-weight: 600; }
.rr-update-banner .rr-update-text b { font-weight: 800; }
.rr-update-banner:active { transform: translateX(-50%) scale(.98); }
@keyframes rr-update-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* Proposal-flow world-class pass (Emil craft, 2026-08-27) — inline bid entry + press feedback. */
.inline-bid-wrap { flex: none; width: 118px; }
.inline-bid-amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; padding: 8px 10px; }
.inline-bid-amt:focus { border-color: var(--action); box-shadow: 0 0 0 3px var(--action-tint); }
/* <180ms tactile press feedback — purposeful, not decorative: a control acknowledges the tap instantly. */
.btn, .iconbtn, .chip, .inline-bid-amt { transition: transform .12s ease, background-color .12s ease, border-color .12s ease, box-shadow .12s ease; }
.btn:active, .iconbtn:active, .chip:active { transform: scale(.97); }

/* ── Job Site Updates — grouped post card + photo grid + lightbox (Conner P0 2026-09-07) ────────────────── */
.su-card { gap: 12px; }
.su-head { display: flex; align-items: center; gap: 11px; }
.su-job { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-meta { color: var(--ink-3); font-size: 13px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-tag { flex: none; font-size: 11px; }
.su-note { font-size: 15px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.su-photos { display: grid; gap: 6px; }
.su-photos.n1 { grid-template-columns: 1fr; }
.su-photos.n2 { grid-template-columns: 1fr 1fr; }
.su-photos.n3 { grid-template-columns: repeat(3, 1fr); }
.su-photo { position: relative; padding: 0; border: 0; background: var(--surface-sunk); border-radius: 12px; overflow: hidden; cursor: pointer; aspect-ratio: 4 / 3; display: block; width: 100%; }
.su-photos.n1 .su-photo { aspect-ratio: 16 / 10; max-height: 360px; }
.su-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.su-photo:active { opacity: .9; }
.su-photo-zoom { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; pointer-events: none; }
.su-actions { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.su-spacer { flex: 1; }
.su-linkbtn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; padding: 8px 6px; min-height: 40px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; border-radius: 8px; }
.su-linkbtn:hover { background: var(--surface-sunk); color: var(--ink); }

/* "Tap to zoom" wrapper — any inline image that opens in the full-screen lightbox (receipt library sheet,
   the receipt photo on the coding sheet). A BUTTON, so it's keyboard-reachable and reads as pressable;
   the hint pill is pointer-events:none so the tap always lands on the button itself. */
.img-zoom { position: relative; display: block; width: 100%; padding: 0; border: 0; background: transparent; font: inherit; color: inherit; cursor: zoom-in; border-radius: 10px; }
.img-zoom img { display: block; width: 100%; }
.img-zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.img-zoom-hint { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; pointer-events: none; }

/* Full-screen photo lightbox */
.lb-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8,10,14,.94); display: flex; flex-direction: column; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; color: #fff; flex: none; }
.lb-counter { font-size: 14px; font-weight: 600; color: rgba(255,255,255,.85); }
.lb-bar-actions { display: flex; align-items: center; gap: 8px; }
.lb-btn { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.14); border: 0; color: #fff; font: inherit; font-size: 14px; font-weight: 600; padding: 9px 14px; min-height: 44px; border-radius: 999px; cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,.24); }
.lb-close { padding: 9px; width: 44px; justify-content: center; }
/* Zoom controls (+ / level-and-reset / −). Icon-only at 44px so they're thumb targets on a phone; the
   middle one shows the current level ("1×", "2.5×") AND is the reset — one control, not two. */
.lb-zoom { padding: 9px; width: 44px; justify-content: center; }
.lb-zoom-level { font-size: 13px; font-variant-numeric: tabular-nums; }
.lb-btn[disabled] { opacity: .4; cursor: default; }
.lb-btn[disabled]:hover { background: rgba(255,255,255,.14); }
/* In-app PDF viewer (components/pdf-viewer.js): every page stacked and scrollable, Download + Share under it. */
.pdfv-pages { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 4px 8px 12px; }
.pdfv-page { display: block; max-width: 100%; height: auto; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.4); }
.pdfv-status { color: rgba(255,255,255,.85); font-size: 15px; padding: 32px 16px; text-align: center; max-width: 36ch; }
.pdfv-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdfv-foot { flex: none; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
.pdfv-foot .lb-btn { flex: 1; max-width: 220px; justify-content: center; }
.pdfv-msg { flex-basis: 100%; text-align: center; color: #ffd28a; font-weight: 600; }
.pdfv-msg:empty { display: none; }
.pdfv-pages:focus-visible { outline: 2px solid #8ab4ff; outline-offset: -2px; }
/* overflow:hidden keeps a panned photo inside the stage (it must never slide up under the bar);
   touch-action:none hands pinch + drag to us instead of to the browser's page zoom/scroll. */
.lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; touch-action: none; overscroll-behavior: contain; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
.lb-imgwrap { max-width: 100%; max-height: 100%; display: flex; align-items: center; justify-content: center; touch-action: none; }
.lb-imgwrap img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 8px; transform-origin: center center; will-change: transform; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
/* Zoomed in, the image is bigger than the stage and the corners square off — the rounded card look is for
   the fitted state. `grab` on the wrapper tells a desktop user it can be dragged. */
.lb-imgwrap.is-zoomed img { border-radius: 0; }
.lb-imgwrap.is-zoomed { cursor: grab; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 999px; background: rgba(255,255,255,.14); border: 0; color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 101; }
.lb-nav:hover { background: rgba(255,255,255,.26); }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
@media (max-width: 460px) { .lb-btn .lb-btn-txt { display: none; } .lb-btn { padding: 9px; width: 44px; justify-content: center; } .lb-nav { width: 40px; height: 40px; } }

/* Touch tap targets — WCAG 2.5.5 ≥44px (Bugsy-1 proposals-mobile review 2026-09-07). The estimates DETAIL
   actions (Log follow-up / Log re-send / Add subs / Record bids / Edit & regenerate = .btn-sm 38px) + the cockpit
   stage-picker pill (.stagepick-btn 30px) were sub-44. Bump on touch (coarse pointer) OR narrow viewport so both
   the phone re-gate and real devices clear it; desktop/mouse density is unchanged. */
@media (pointer: coarse), (max-width: 600px) {
  .btn-sm { min-height: 44px; }
  .stagepick-btn { min-height: 44px; }
}

/* ── Proposals mobile pass 2 (Conner P0 2026-09-08) — estimates flow redesigned for a phone ─────────────────── */
/* Sticky bottom action bar inside a sheet — the primary actions stay reachable on a phone (spans the sheet pad). */
.sheet-actionbar { position: sticky; bottom: 0; z-index: 3; display: flex; gap: 10px; margin: 10px calc(-1 * var(--s4)) calc(-1 * var(--s4)); padding: 12px var(--s4) calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--hairline); }
.sheet-actionbar .btn { flex: 1; justify-content: center; min-height: 48px; }
.fval { white-space: nowrap; }
@media (max-width: 600px) {
  /* Conner's #1 — the stage-box dollar amount ran OVER the box. Chips now size to content (no clip/overflow), the
     value is abbreviated ($1.23M via formatMoneyShort) so it always fits, the full stage word shows, strip scrolls. */
  .fseg { flex: 0 0 auto; }
  .fnm { overflow: visible; text-overflow: clip; }
  /* Right-edge fade so a scrolled peek reads as "more →", never a sliced chip (the active chip scrolls into view via JS). */
  .funnel { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); }
  /* 3 tall KPI cards → a compact 3-up strip that FITS (no sliced number). Value abbreviated ($1.23M) — Partner-approved for the KPI. */
  .kpi-grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .kpi-grid.k3 > .kpi { padding: 12px 10px; min-width: 0; }
  .kpi-grid.k3 > .kpi .k { font-size: 10.5px; gap: 4px; }
  .kpi-grid.k3 > .kpi .v { font-size: 19px; margin-top: 4px; }
  .kpi-grid.k3 > .kpi .sub { font-size: 10px; }
  /* Sub Compliance: 2 KPI cards → a compact 2-up strip (were stacked full-height, pushing search a screen down). */
  .kpi-grid.k2 { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
  .kpi-grid.k2 > .kpi { padding: 12px 12px; min-width: 0; }
  .kpi-grid.k2 > .kpi .k { font-size: 11px; gap: 4px; }
  .kpi-grid.k2 > .kpi .v { font-size: 22px; margin-top: 2px; }
  /* Search full-width; the two filters share ONE row (were three stacked full-width rows). */
  .toolbar > input.input { flex: 1 0 100%; }
  .toolbar > .select { flex: 1 1 0; min-width: 0; }
  /* Detail: full-height sheet covers the app chrome; fields stack label-over-value, left-aligned + lighter weight. */
  .sheet.as-tall { top: 0; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .sheet.as-tall .grab { display: none; }
  .detail-row { flex-direction: column; align-items: stretch; gap: 3px; }
  .detail-row span:last-child { text-align: left; font-weight: 600; }
  /* Section header: stack the title (stage · count · full total on ONE line, tabular nums) over the muted note (was wrapping into it). */
  .cock-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .cock-head .ch-ttl { white-space: nowrap; font-variant-numeric: tabular-nums; }
}

/* =========================================================================
   CR Paint weekly bill tab (#/timesheet/crpaint) — mobile-first pass
   Conner 2026-09-16: "make sure the new CR Paint screen is world class on mobile too."
   The screen shipped desktop-first (#189/#193). This block is the ONLY place its phone
   layout lives: every phone rule is inside the one `max-width: 899px` query, so the
   DESKTOP rendering at >= 900px is unchanged — the base rules here just re-state,
   declaration for declaration, the inline styles the module used to set on its two
   tables. (`var(--line)` is kept deliberately: that token has never been defined, so
   those row borders did not paint before and must not start now. Defining it is a
   one-line follow-up, not part of a "desktop unchanged" pass.)
   ========================================================================= */
.cp-tablewrap { overflow-x: auto; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cp-table th, .cp-table td { padding: 8px 10px; text-align: left; }
.cp-table th.num, .cp-table td.num { text-align: right; white-space: nowrap; }
.cp-table thead tr, .cp-table tbody tr { border-bottom: 1px solid var(--line); }
.cp-table tfoot tr { font-weight: 700; }
/* ONE Send button, two placements, no duplicated DOM: `display: contents` means the
   wrapper generates no box on desktop, so the button sits inside the card's row exactly
   where it always did — and the phone-only amount readout is hidden along with it. The
   `position`/`background`/`padding` resets are belt-and-braces: a wrapper that generates
   no box cannot paint, but the screen also puts `.action-bar` on this element, and this
   guarantees none of that bar's fixed positioning or gradient can reach the desktop row. */
.cp-sendbar { display: contents; position: static; background: none; padding: 0; }
.cp-sendbar-amt { display: none; }

@media (max-width: 899px) {
  /* --- the money line. The week TOTAL is the hero and sits above the fold; Labor and
     Extras share the row under it. Same three cards, same DOM order — CSS does the
     promoting, so nothing renders twice and no figure can disagree with itself. */
  .kpi-grid.cp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cp-kpis > .kpi { padding: 12px; }
  .cp-kpis > .cp-kpi-total { grid-column: 1 / -1; order: -1; }
  .cp-kpis > .cp-kpi-total .v { font-size: 28px; line-height: 1.15; }
  /* The status chip's "ready" sentence runs ~55 characters — a nowrap pill that long is
     exactly what pushes a page sideways. Let it wrap, under the sub's name. */
  .cp-subhead { flex-direction: column; align-items: flex-start; }
  .status.cp-chip { white-space: normal; text-align: left; }
  /* Sub select over week stepper, both full width, both thumb-height. */
  .cp-picker { flex-direction: column; align-items: stretch; }
  .cp-picker > * { width: 100%; }
  .cp-picker .select { min-height: 48px; }
  /* The week picker was the ONE control still under a thumb (Bugsy-1, 390x844): the label read 27.5px tall
     and the date input behind it was a 1px ghost — nothing there to hit. On a phone the label IS the control:
     full width, 48px, with a calendar glyph so it reads as tappable; and the SAME native input stretches
     invisibly across all of it, so one tap opens the OS date picker instead of a 5x4 target. The prev/next
     .nav buttons were already 48px and are untouched. */
  .stepper-bar .label { min-height: var(--tap); display: flex; align-items: center; justify-content: center; gap: 8px; }
  .stepper-bar .label .cal { display: inline-grid; place-items: center; color: var(--ink-3); }
  .stepper-bar .label .pick { inset: 0; width: 100%; height: 100%; pointer-events: auto; -webkit-appearance: none; appearance: none; }

  /* --- the two wide tables become CARDS. Same markup; each number carries its own
     `data-label`, the app's existing `.comp-row` label-per-cell pattern. A phone never
     gets a 5-column table, so the tab never scrolls sideways. */
  .cp-tablewrap { overflow-x: visible; }
  .cp-table, .cp-table thead, .cp-table tbody, .cp-table tfoot,
  .cp-table tr, .cp-table th, .cp-table td { display: block; }
  .cp-table thead { display: none; }
  .cp-table tr { border: 1px solid var(--hairline); border-radius: var(--r); padding: 10px 12px; margin-top: 8px; }
  .cp-table td { padding: 3px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-variant-numeric: tabular-nums; }
  .cp-table td::before { content: attr(data-label); color: var(--ink-3); font-size: 12px; font-weight: 600; }
  .cp-table td.cp-lead, .cp-table td.cp-sub { display: block; }
  .cp-table td.cp-lead { font-weight: 700; font-size: 15px; padding-bottom: 4px; }
  .cp-table td.cp-sub { color: var(--ink-2); padding: 0 0 6px; }
  .cp-table td.cp-lead::before, .cp-table td.cp-sub::before { content: ''; }
  .cp-table td.cp-rowtotal { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--hairline); font-weight: 700; }
  .cp-table tfoot tr { background: var(--surface-sunk); }

  /* --- extras rows: the amount reads big next to a real 44px Remove target. */
  .cp-xamt { font-weight: 700; font-variant-numeric: tabular-nums; }

  /* --- Send becomes the app's own sticky bottom bar (`.action-bar` already clears the
     phone nav and the safe-area inset) and restates the amount beside the button. */
  /* `.action-bar` is present ONLY on a week that can actually be sent (see crpaint.js) — a week that
     can't keeps the disabled button inside the card beside the server's reason, rather than pinning a
     dead button across the bottom of the screen. Every sticky rule hangs off that class. */
  .cp-sendbar.action-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .cp-sendbar.action-bar .cp-sendbar-amt { display: block; }
  .cp-sendbar-v { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
  .cp-sendbar.action-bar .cp-sendbtn { flex: 0 1 auto; min-height: 48px; }
  .cp-sendcard .list-row { flex-wrap: wrap; }
  /* room under the last card so the fixed bar never covers the send explanation */
  .cp-sendcard.cp-sendcard-pad { margin-bottom: 96px; }
}

/* --- the add-an-extra sheet. Full-width controls, 48px targets, and four fat segmented
   buttons for the category. `.cp-seg` is a radiogroup, so it stays keyboard- and
   screen-reader-operable exactly like the <select> it replaces. */
.cp-form .input, .cp-form .select, .cp-form textarea, .cp-form .ss-input { width: 100%; min-height: 48px; }
.cp-form textarea { min-height: 88px; }
.cp-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cp-segbtn {
  min-height: 48px; padding: 10px 6px; border-radius: var(--r); cursor: pointer;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink-2);
  font: inherit; font-weight: 650; font-size: 14px;
}
.cp-segbtn:hover { background: var(--surface-sunk); }
.cp-segbtn.on { border-color: var(--action); background: var(--action-tint); color: var(--action-press); }
@media (max-width: 460px) { .cp-seg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Setup → Integrations: config tables that COLLAPSE TO ROWS on a phone -------------------
   A real <table> on desktop (a map is genuinely tabular — you read down the left column looking
   for your cost code), and stacked label/value rows at 390 wide. NO horizontal scroll, ever:
   under 600px the header row is hidden and each cell prints its own label from data-label. */
.intbl-wrap { margin-top: var(--s2); }
.intbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.intbl th {
  text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-3); padding: 0 0 8px; border-bottom: 1px solid var(--hairline);
}
.intbl td {
  padding: 12px 0; border-top: 1px solid var(--hairline); vertical-align: middle;
  overflow-wrap: anywhere;
}
.intbl tbody tr:first-child td { border-top: 0; }
.intbl th + th, .intbl td + td { padding-left: var(--s3); }
.intbl-empty-row td { color: var(--ink-2); font-size: 14px; padding: var(--s5) 0; }

@media (max-width: 600px) {
  /* thead is visually hidden, not removed — screen readers keep the column names. */
  .intbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .intbl, .intbl tbody, .intbl tr, .intbl td { display: block; width: auto; }
  .intbl tr { padding: 12px 0; border-top: 1px solid var(--hairline); }
  .intbl tbody tr:first-child { border-top: 0; }
  .intbl td, .intbl tbody tr:first-child td { border-top: 0; padding: 3px 0; }
  .intbl th + th, .intbl td + td { padding-left: 0; }
  .intbl td::before {
    content: attr(data-label); display: block;
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3);
  }
  .intbl-empty-row td::before { content: none; }
  .intbl-empty-row td { padding: var(--s3) 0; }
  /* A setting cell wraps instead of pushing the row wide — 390 must never scroll sideways. */
  .int-cell { align-items: flex-start; }
}

/* A setting cell: what it points at now + Change. `int-unset` is the "nothing picked / uses default"
   state — muted and italic so an empty setting never reads as a real QuickBooks name. */
.int-cell { align-items: center; }
.int-unset { color: var(--ink-3); font-style: italic; }
.int-saved { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--approved); }
.int-msg { margin-top: 8px; }
/* TASK-1130 · An UNSET setting that STOPS MONEY reads as an amber "Not set" chip, not as grey italic
   text and never as red. Red is the ACTION tint on this app and "bad" belongs to things that went
   wrong; a blank that nobody has filled in yet is neither. The word carries the meaning, so the cell
   still reads correctly in greyscale and in sunlight (solid tint, not a hairline). */
.int-notset { font-style: normal; }
/* The "Needs attention" group — the primary element on the page. It is a LIST OF LINKS to the real
   rows below, never a second copy of the editable cell: one setting, one control, anywhere on screen. */
.int-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.int-attention-list:not(:empty) { margin-top: var(--s3); }
.int-attention-row {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: var(--s2) 0;
  border-top: 1px solid var(--hairline); cursor: pointer; color: var(--ink);
}
.int-attention-row:first-child { border-top: 0; }
.int-attention-row:hover, .int-attention-row:focus-visible { color: var(--action); }
.int-attention-where { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 560px) {
  /* 390: the consequence is the sentence that matters, so it keeps the full width and the section
     label drops out rather than squeezing the sentence into two words per line. */
  .int-attention-where { display: none; }
}
/* An item/account QuickBooks has marked inactive: still pickable, amber, and it says why. */
.ss-opt.ss-inactive .ss-lbl { color: var(--warn-ink); }
.ss-opt.ss-inactive .ss-sub { color: var(--warn); font-weight: 650; }

/* ── /reconcile (S17) — one card per disagreement ──────────────────────────────
   The comparison IS the finding, so the two sides sit SIDE BY SIDE and stay side by
   side on a phone: stacking them turns a comparison into two facts and the operator
   has to hold one in their head. They are never subtracted (0535b: observation text,
   "never money for arithmetic"). Values wrap rather than scroll — 390 never scrolls
   sideways. NO COLOUR IS SPENT HERE: rank is carried by size, weight and whitespace,
   so the only coloured thing on a card is its status chip (ux-craft §2). */
.rec-compare {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s2) var(--s3); margin-top: 10px;
  padding: 10px 12px; border-radius: var(--r); background: var(--surface-sunk);
}
.rec-side { min-width: 0; }
.rec-value {
  font-size: 18px; font-weight: 700; line-height: 24px; margin-top: 2px;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.rec-meta { margin-top: 8px; }
.rec-note {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 8px;
  font-size: 14px; line-height: 20px; color: var(--ink-2);
}
.rec-note .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
/* "The sweep won't raise this again" — said in grey and in WORDS, never as an alarm.
   A muted line is a decided line, not a failing one. */
.rec-muted { display: flex; gap: 6px; align-items: center; margin-top: 6px; color: var(--ink-3); }
.rec-muted .glyph { width: 14px; height: 14px; flex: none; }

/* Every row has an exit, and on a phone the exits are FULL WIDTH and stacked: three
   money verdicts a thumb's width apart is a mis-tap waiting to happen, and a mis-tap
   here mutes a detector. 44px minimum, 8px apart (ux-craft §3). */
.rec-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rec-actions .btn { min-height: 44px; width: 100%; justify-content: center; }
.rec-actions .btn:disabled { opacity: .5; }
@media (min-width: 560px) {
  .rec-actions { flex-direction: row; flex-wrap: wrap; }
  .rec-actions .btn { width: auto; flex: 1 1 auto; }
}

/* =========================================================================
   Manage → Card review (month-end, on QuickBooks actuals)
   Designed at 390px first; the desk layout is the one with extra room.
   NOT ONE COLOUR IN HERE IS --action. Brand red means "tap me" and only that; every
   status on this screen is carried by a word + a glyph and merely TINTED (ux-craft §2).
   ========================================================================= */

/* ---- THE CARD TOGGLE: four cards, one month (Conner's ruling 2026-10-26 §1) ----
   A grid of two-line TILES, not the shipped .segmented pill row, for two reasons that were both
   measured on a phone. Four card names ("Sherwin-Williams ···5518") overflow a nowrap pill row
   sideways, which is the one thing a 390px screen may never do (ux-craft §4) — and a pill has no
   room for the second line, which is the whole point of these tiles: each one says in WORDS
   whether that card still needs Craig this month, so "which card do I open next" is answered
   before he opens one.
   The name WRAPS and is never clipped or ellipsised. The last four digits ARE how Craig tells one
   card from another, and the shipped <select> picker silently rendered "···100" for "···1007" —
   a different card, which the screen never admitted (fixed in c4888a6, not repeatable here). */
.cr-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); margin-bottom: var(--s3); }
@media (min-width: 720px) { .cr-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cr-cardtile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-height: 62px; padding: 10px var(--s3); text-align: left;
  background: var(--surface-sunk); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  color: var(--ink-2); cursor: pointer;
}
/* "YOU ARE HERE" IS INK, NOT RED — Conner's colour grammar (2026-08-24): solid red = ACT, black =
   where I am. The selected tile is carried by THREE non-chromatic signals at once — a 2px ink
   border, a lift off the sunk fill onto white, and the name at full ink — so the selection survives
   greyscale and direct sunlight, and never borrows the tint a button owns (ux-craft §2/§3). */
.cr-cardtile.is-on { background: var(--surface); border: 2px solid var(--ink); padding: 9px calc(var(--s3) - 1px); color: var(--ink); box-shadow: var(--shadow-card); }
.cr-cardtile:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
.cr-cardname { font-size: 14px; line-height: 18px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.cr-cardstate { display: inline-flex; align-items: flex-start; gap: 5px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-2); }
.cr-cardstate .glyph { width: 13px; height: 13px; flex: none; margin-top: 1px; color: var(--ink-3); }
/* Amber ONLY where there is genuinely something to look at. "All clear" and "No charges this
   month" both stay grey — nothing on this screen defaults to alarm (ux-craft §2 rule 3). */
.cr-cardstate-ex { color: var(--sentback); }
.cr-cardstate-ex .glyph { color: var(--sentback); }

/* HOW MANY CARDS THIS TAB ADDS UP — count only, on the tile. One GL card account can carry several
   physical cards, and then the tile's name is the account's, not a card's. Grey and 12px: it is
   reference rank, it must not compete with the status word below it, and it is NOT a warning —
   sharing an account is normal, it is only a thing to KNOW (ux-craft §2 rule 3). --ink-2, the same
   contrast tier as the status word, because a fainter grey is simply gone in direct sun (§4). */
.cr-cardon { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-2); overflow-wrap: anywhere; }

/* THE TWO QUIET NOTES UNDER THE TAB STRIP — ONE declaration block, two honest names, because they are
   the same component doing the same job (a full-width grey info line about the strip above it) and a
   second drifted copy of a style is how two things that should match stop matching.
     .cr-unpulled — a card that is NOT on this screen, and the account it really sits on. An absent tab is
                    not a way of saying "nothing has ever been pulled for that card". (Said "a card on this
                    account" until 2026-10-26 — the same false claim the rendered sentence made, D7.)
     .cr-sharing  — the cards the OPEN tab is adding together, named, so a multi-card total cannot be
                    misread as one card's spend. */
.cr-unpulled, .cr-sharing { display: flex; align-items: flex-start; gap: 6px; margin: -4px 0 var(--s3); font-size: 12.5px; line-height: 17px; color: var(--ink-2); }
.cr-unpulled .glyph, .cr-sharing .glyph { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--ink-3); }

/* The MONTH, now the only select here — the card moved up into the tiles. So it takes exactly the
   room its own (bounded) label needs and no more, instead of stretching "Sep 2026" across half a
   phone the way the old 1fr card/month grid did. */
.cr-pickers { display: flex; margin-bottom: var(--s3); }
.cr-pickers .select { width: auto; min-width: 150px; max-width: 100%; }

/* THE primary element. Rank is size + weight + position, never colour. */
.cr-head { margin-bottom: var(--s2); }
.cr-need { font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.cr-need-sub { margin-top: 4px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink-2); }
/* The breakdown is counted off the same rows below it, so tapping is unnecessary — the
   promise is kept by proximity. Grey: it explains the number, it isn't a second alarm. */
.cr-tally { display: flex; flex-wrap: wrap; gap: 4px var(--s4); margin-top: var(--s3); }
.cr-tally-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--ink-2); }
.cr-tally-item .glyph { width: 13px; height: 13px; flex: none; color: var(--ink-3); }
.cr-stamp { display: flex; align-items: flex-start; gap: 6px; margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--hairline); font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-2); }
.cr-stamp .glyph { width: 15px; height: 15px; flex: none; margin-top: 1px; }
@media (min-width: 720px) { .cr-need { font-size: 40px; } }

/* ---- "QuickBooks as of <last pull>" + the pull (ruling §2, and §5's exact label) ----
   The truth on this screen is QuickBooks AFTER the CSV upload, so the one thing it may never do is
   let Craig review a stale grid believing it is fresh. The stamp therefore sits directly above the
   headline, in the same sunk panel as the button that refreshes it — and when we do not know when
   the pull last ran it SAYS so, rather than printing a time it made up. */
.cr-asof { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s2); padding: var(--s3) var(--s4); }
.cr-asof-txt { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-2); }
.cr-asof-txt .glyph { width: 15px; height: 15px; flex: none; color: var(--ink-3); }
.cr-pullwrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); flex: 1 1 100%; min-width: 0; }
.cr-pull { width: 100%; min-height: 44px; justify-content: center; }
/* NOTHING IS WRITTEN UNDER THIS BUTTON, in any state (Conner 2026-10-26 02:0xZ): when there is
   nothing to pull from it is simply disabled. So the disabled look has to carry the whole message on
   its own — it goes flat and sunk at FULL opacity rather than 50%-faded, because a faded label is
   unreadable in sunlight and "I can't read it" is not the same message as "this is off". The reason
   still rides on the control as `title`, so a screen reader and a hover can both say why; it just
   takes no pixels. That is a deliberate departure from ux-craft §5, logged in the FILE. */
.cr-pull:disabled { opacity: 1; background: var(--surface-sunk); color: var(--ink-3); border-color: var(--hairline); cursor: default; }
/* THE SPINNER. One keyframe set for the whole app — this reuses the shipped `fc-spin` rather than
   declaring a second identical rotation (world-class-bar §3). Motion is never the only signal: the
   label itself changes to "Pulling from QuickBooks…" and the control is disabled, so a person with
   reduced motion on loses nothing but the rotation (ux-craft §3). */
.cr-spin { animation: fc-spin 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .cr-spin { animation: none; } }

/* ---- THE OUTCOME OF A PRESS — one line, and only after a press said something ----
   This is NOT helper copy: it is what the read produced. Success is the ruling's own sentence
   ("Pulled 142 charges · 3 new · 2 changed · 0 removed · 4.2 s"); failure is plain English plus the
   one or two things left to try. Grey for success — a finished read is not an alarm — and the
   failure tint is --warn, which is a STATUS token and never the brand action red (ux-craft §2). */
.cr-pullout { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); flex: 1 1 100%; min-width: 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-2); }
.cr-pullout .glyph { width: 15px; height: 15px; flex: none; color: var(--ink-3); }
.cr-pullout-txt { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.cr-pullout-bad { color: var(--warn-ink); }
.cr-pullout-bad .glyph { color: var(--warn); }
/* The things left to try are real thumb targets, not 38px fine print: this is the state where a
   person has already been told something went wrong, and mis-tapping it costs them another wait. */
.cr-pullacts { display: flex; flex-wrap: wrap; gap: var(--s2); flex: 1 1 100%; }
.cr-pullact { min-height: 44px; flex: 1 1 auto; justify-content: center; }
/* From a tablet up the button sits beside the stamp instead of under it, and the actions sit beside
   the sentence. The button stops being full-width there for the same reason it is full-width on a
   phone: a thumb needs the width, a mouse does not, and a 1000px-wide secondary button reads as the
   primary one. */
@media (min-width: 720px) {
  /* `.cr-pullwrap` carries `flex: 1 1 100%` so a phone gets the button on its own full-width line in
     thumb reach. Releasing only `.cr-pull` left the WRAPPER still claiming the whole row, so at 1280
     the button sat UNDER the stamp while the comment above said it sat beside it — and the ruling says
     beside: "in that card's header beside `QuickBooks as of <time> · by <name>`". The comment was
     right about the intent and wrong about the render for as long as nobody looked at the screenshot. */
  .cr-pullwrap { flex: 0 0 auto; }
  .cr-pull { width: auto; flex: 0 0 auto; }
  .cr-pullacts { flex: 0 0 auto; }
  .cr-pullact { flex: 0 0 auto; }
}

/* ---- one row ------------------------------------------------------------ */
/* The receipt thumbnail is its OWN target, 44px, and it sits a full row-width away
   from the chevron so a gloved thumb cannot hit the wrong one (ux-craft §3). */
.cr-thumb { width: 44px; height: 44px; flex: none; border-radius: 10px; border: 1px solid var(--hairline); background: var(--surface-sunk); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; padding: 0; cursor: pointer; }
.cr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-thumb:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
/* No receipt: a flat grey slot that is NOT a button. An affordance you cannot use is
   worse than no affordance (ux-craft §5, read-only). */
.cr-thumb-none { color: var(--ink-3); border-style: dashed; cursor: default; }

/* ---- THE EIGHT COLUMNS, ONE DOM, BOTH WIDTHS (Conner's ruling §3) -------------
   date · vendor · amount · Receipt · QuickBooks account · QuickBooks job · Rexo class · flag,
   in that order. ONE set of cells renders both layouts: at 390px they stack, from 960px the
   identical cells fall into real aligned columns under a header. There is no second markup, so
   the phone and the desk cannot drift apart (world-class-bar §3), and the ruled ORDER is the DOM
   order at both widths — nothing is moved by CSS, so what a screen reader reads is what the eye
   sees. A phone gets no table and no sideways scroll (ux-craft §4): that is the one place the
   word "columns" and a 390px screen cannot both be taken literally, so the ruling is honoured
   where it actually matters — in WHICH eight facts, and in WHAT ORDER. */
.cr-colhead { display: none; }                    /* a phone has no room for a header; see .cr-lab */

.cr-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  column-gap: var(--s3); row-gap: 6px; align-items: baseline;
  padding: var(--s3) var(--s4);
}
.cr-row + .cr-row { margin-top: var(--s2); }
/* LINE ONE IS THE GLANCE — when, who, how much. Those three answer "do I care about this charge
   at all", and they are exactly the three that need no label: "$1,840.00" does not need the word
   Amount over it. The five comparison facts below DO need one, because "5000 · Job materials"
   says nothing on its own about WHICH system put it there, and that is the entire question this
   screen exists to answer (ux-craft §6 — three facts, chosen; the rest in the ruled order). */
.cr-c-date { grid-column: 1; }
.cr-c-vendor { grid-column: 2; }
.cr-c-amt { grid-column: 3; justify-self: end; }
.cr-c-rcpt, .cr-c-acct, .cr-c-job, .cr-c-cls { grid-column: 1 / -1; justify-content: space-between; }
.cr-c-flag { grid-column: 1 / 3; }
.cr-c-date .cr-lab, .cr-c-vendor .cr-lab, .cr-c-amt .cr-lab, .cr-c-flag .cr-lab { display: none; }
.cr-c { display: flex; align-items: baseline; gap: var(--s3); min-width: 0; }
.cr-c-rcpt { align-items: center; }
.cr-lab { flex: none; font-size: 12px; line-height: 17px; font-weight: 600; color: var(--ink-3); }
/* A value WRAPS; it is never ellipsised away. The account and the project ARE the fact being
   reviewed, so losing their tails to "…" would hide the thing Craig came to check. */
.cr-v { min-width: 0; font-size: 14px; line-height: 19px; font-weight: 500; color: var(--ink); text-align: right; overflow-wrap: anywhere; }
/* An absent value is said in WORDS at body contrast — a blank is read as "fine". It is not an
   alarm either: no job on a charge is a coding gap, not an overrun, so it never takes a status
   colour. The row's chip carries severity; these cells carry facts. */
.cr-v-none { font-weight: 650; color: var(--ink-2); }
/* "Not in QuickBooks" is a different answer from "no account on it": a NOT POSTED row has no
   QuickBooks side at all, so a missing-value word there would assert that QuickBooks HAS the
   charge and coded it nowhere. Unknown ≠ missing, and it reads quieter than both (ux-craft §2). */
.cr-v-na { color: var(--ink-3); font-weight: 600; }
.cr-date { text-align: left; white-space: nowrap; font-weight: 650; color: var(--ink-2); }
.cr-vendor { text-align: left; font-size: 15px; line-height: 20px; font-weight: 700; color: var(--ink); }
.cr-amt { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* RECEIPT Y/N, and the Y is a DOOR. The whole cell is one 44px target that opens the photo, so a
   gloved thumb hits the picture rather than a 4-character link inside a row (ux-craft §3). */
.cr-rcpt { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; }
.cr-rcpt .cr-v { text-align: left; }
.cr-rcpt:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 12px; }
/* YES is a door; NO is not. The two states therefore differ in more than a word: only the Yes
   carries a pointer and a hover, so the affordance itself tells the truth before the tap does
   (ux-craft §5 — an affordance you cannot use is worse than no affordance). */
.cr-rcpt-yes { cursor: pointer; }
.cr-rcpt-yes:hover .cr-thumb { border-color: var(--ink-3); }
.cr-rcpt-no { cursor: default; }
.cr-go { grid-column: 3; justify-self: end; align-self: center; display: inline-flex; }

/* The exception rows get a solid left edge, not a fill: a tint behind a money row makes
   the amount harder to read in sunlight, and the edge survives greyscale as position.
   The 3px it steals back out of the padding keeps the flagged rows' columns aligned with
   the clean rows' and with the header above them — a 3px stagger between the two groups is
   exactly the kind of thing nothing tests and everyone sees. */
.cr-row-ex { border-left: 4px solid var(--sentback); padding-left: calc(var(--s4) - 3px); }
.cr-row:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }

/* ---- THE ROWS A PULL ACTUALLY MOVED, flashed ONCE (ruling §5) ------------------
   "3 new · 2 changed" is a count, and a count on a Rexo screen is a promise you can point at
   (ux-craft §2) — so the five rows it names say so themselves instead of leaving Craig to find
   them. It is a neutral grey wash, NOT a status colour: a row that changed is not a row that is
   wrong, and borrowing amber here would mean "the pull moved this" and "this needs you" rendered
   identically, which is the Sub Compliance collision with new paint on it.
   It fires once, on the paint that follows the read, and the class is never re-applied. Meaning is
   never in the motion alone: the result line states the same counts in words, so reduced-motion
   loses the animation and no information. */
@keyframes cr-flash { from { background: var(--surface-sunk); } to { background: var(--surface); } }
.cr-row-flash { animation: cr-flash 1.6s ease-out 1; }
@media (prefers-reduced-motion: reduce) { .cr-row-flash { animation: none; } }

/* ---- DESK (≥960px): the same cells become real aligned columns ----------------
   ONE declaration of the geometry, --cr-cols, shared by the header row and every data row — so a
   header can never sit over the wrong column, which is what a second template would eventually do.
   Mostly fr units, so it cannot overflow the 1040px content column at any zoom; fixed widths only
   where the content is genuinely bounded (a short date, a Y/N, a nowrap status chip). The ninth
   track is the chevron. */
@media (min-width: 960px) {
  .cr-colhead, .cr-row {
    /* The VENDOR gets the widest share. It is the "who" of the one-line glance, it is user data of
       unbounded length, and driving it at 1280 showed "Cornerstone Lumber" wrapping to two lines on
       five of eight rows — which doubles the height of the grid to save 30px of width. */
    --cr-cols: 84px minmax(0, 1.9fr) 96px 92px minmax(0, 1.4fr) minmax(0, 1.3fr) minmax(0, 1fr) 170px 18px;
    display: grid; grid-template-columns: var(--cr-cols);
    column-gap: var(--s3); row-gap: 0; align-items: center;
  }
  /* +1px for the row's own border, so the header sits over its columns and not 1px left of them. */
  .cr-colhead { display: grid; padding: 0 calc(var(--s4) + 1px) 6px; }
  .cr-ch { font-size: 11.5px; line-height: 15px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); }
  .cr-ch-amt { text-align: right; }
  /* The header names the columns once per group, so the per-cell labels a phone needs are exactly
     what a desk must not repeat. Same eight strings either way — one declaration, two renderings. */
  .cr-row .cr-lab { display: none; }
  .cr-row .cr-c { grid-column: auto; display: block; }
  .cr-row .cr-c-amt { justify-self: stretch; }
  .cr-row .cr-v { text-align: left; }
  .cr-row .cr-amt { display: block; text-align: right; }
  .cr-row .cr-go { grid-column: auto; }
}

/* A setting, used once a month — it belongs with the rows it governs, not competing with
   the headline. */
.cr-threshold { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s5); }
.cr-threshold .select { width: auto; min-width: 120px; }

/* THE VERB, last and full-width — Craig scrolls the charges and then signs them off, so the
   action sits at the end of that scroll where a thumb already is, not in a top-right corner
   (ux-craft §4). btn-lg + btn-block are the shipped classes; nothing new is invented for size,
   so the 44px floor is the app's own and cannot drift from it. */
.cr-sign { margin-top: var(--s3); }
.cr-sign-note { display: flex; align-items: flex-start; gap: 8px; margin-top: var(--s3); font-size: 13px; line-height: 18px; color: var(--ink-2); }
.cr-sign-note .glyph { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--ink-3); }

/* The detail sheet: the two sides, QuickBooks first. */
.cr-photo { margin-top: var(--s4); }
.cr-fix { display: flex; align-items: flex-start; gap: 8px; margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--hairline); font-size: 13px; line-height: 18px; color: var(--ink-2); }
.cr-fix .glyph { width: 15px; height: 15px; flex: none; margin-top: 1px; }

/* Loading: the shape of what is coming, so nothing jumps when it arrives. Two of these
   carry their own geometry because the head card and the pickers are the parts that MOVE
   if the skeleton is the wrong height — the pickers sit above the one number Craig came
   for, so a missing picker placeholder shoves the headline down the moment data lands. */
.cr-head-skel { margin-bottom: var(--s2); }
/* Same height and same radius as a real card tile, four of them in the same grid — so the toggle
   does not grow or shrink under Craig's thumb at the moment the rows land. */
.skel-cardtile { height: 62px; border-radius: var(--r-lg); }
.skel-picker { height: var(--input, 52px); }
.skel-xl { height: 38px; width: 62%; }
.skel-md { height: 16px; width: 54%; margin-bottom: 8px; }
.skel-sm { height: 13px; width: 38%; margin-top: 8px; }
.skel-thumb { width: 44px; height: 44px; flex: none; border-radius: 10px; }
/* The three cross-system disagreements read amber in the breakdown too; the three coding
   notes stay grey. "8 need you" must not look like eight alarms when five are notes. */
.cr-tally-ex { color: var(--sentback); }
.cr-tally-ex .glyph { color: var(--sentback); }
