/* ════════════════════════════════════════════════════════════════════════
   Desktop workspace — the tab bar and the destination panels.
   Loaded only by app.html. Everything here is `.cf-tab` / `.cfw-` prefixed.

   🔴 WHY THE PREFIX IS NOT OPTIONAL. portal-mobile.css already defines bare
   `.task-row` and `.appt-row__jobstatus--*`, and so does styles.css, with
   different values. They never collide today only because no page loads both.
   A bare selector added here would silently restyle the contact card's own
   Tasks and Appointments panels.

   Desktop-only by design: below 1024px the phone portal IS the answer, and
   mobile bytes stay untouched.
   ════════════════════════════════════════════════════════════════════════ */

/* Hidden everywhere by default; the media query below is the only thing that
   turns the shell on. Two gates, because the CSS one cannot see the difference
   between a wide desktop and a tablet in landscape inside the portal's own
   /app.html overlay — workspace.js adds .cf-embedded for that. */
.cf-tabs { display: none; }
.cfw-root { display: none; }
.cfw-panel { display: none; }

@media (min-width: 1024px) {
  body:not(.cf-embedded) .cf-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: stretch;
    margin: 0 0 18px;
    border-bottom: 1.5px solid var(--line);
  }
  /* workspace.js renders nothing when Clients is the only destination. Without
     this the "empty" bar still paints its border and margin — 19px of chrome
     announcing a navigation that isn't there. Measured, not assumed.
     The `body:not(...)` prefix is required, not decoration: the show rule above
     is (0,3,0) and a bare `.cf-tabs:empty` is (0,2,0), so it loses and the bar
     stays visible. Keep the two selectors in step. */
  body:not(.cf-embedded) .cf-tabs:empty { display: none; }

  /* 🪤 .cf-grid and .cfw-root carry an explicit `display`, and an author rule
     BEATS the [hidden] attribute's UA `display:none`. Setting .hidden on them
     would do nothing at all. Visibility is driven off the body attribute
     instead, which cannot be got wrong the same way. */
  body:not(.cf-embedded)[data-cf-tab]:not([data-cf-tab="clients"]) .cf-grid { display: none; }
  body:not(.cf-embedded)[data-cf-tab]:not([data-cf-tab="clients"]) .cfw-root { display: block; }

  /* 1180px is right for two panes and too narrow for a five-stage board or a
     wide chart — measured: the board scrolled sideways with 400px of empty
     page beside it. Widened only on the tabs that need it, so the Clients
     layout is untouched. */
  body:not(.cf-embedded)[data-cf-tab="opportunities"] .wrap,
  body:not(.cf-embedded)[data-cf-tab="reports"] .wrap { max-width: min(1560px, 96vw); }

  .cfw-panel.is-on { display: grid; gap: 24px; align-items: start; }
  /* List beside detail — the same shape as the contact CRM, so the two halves
     of the app feel like one app. */
  .cfw-panel--split.is-on { grid-template-columns: minmax(360px, 460px) minmax(0, 1fr); }
  .cfw-panel--wide.is-on  { grid-template-columns: minmax(380px, 520px) minmax(0, 1fr); }
  /* A kanban or a wide chart wants the whole width, not two columns. */
  .cfw-panel--full.is-on  { grid-template-columns: minmax(0, 1fr); }

  /* ── Tabs ───────────────────────────────────────────────────────────── */
  .cf-tab {
    position: relative;
    font: inherit;
    font-size: clamp(14px, 1.1vw, 15px);
    font-weight: 600;
    /* 40px tall. Below the 48px touch floor deliberately: this bar exists only
       at >=1024px with a pointer, and a row of 48px tabs eats height that the
       GHL iframe does not have to spare. */
    padding: 10px 16px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    color: var(--ink-soft);
    cursor: pointer;
    white-space: nowrap;
  }
  .cf-tab:hover { color: var(--ink); background: #f0f6fb; }
  .cf-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }
  /* The selected tab is marked THREE ways — weight, colour and a 3px underline
     — because colour alone is not a signal anyone should have to rely on. */
  .cf-tab.is-on {
    color: var(--accent);
    font-weight: 700;
    border-bottom-color: var(--accent);
  }
  .cf-tab.is-locked { color: var(--ink-soft); }
  .cf-tab.is-locked .cf-tab__lock {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-soft);
  }

  /* ── Toolbar ────────────────────────────────────────────────────────── */
  .cfw-toolbar { margin: 0 0 14px; }
  .cfw-toolbar__row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }

  .cfw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
  /* Same visual language as .recent-action in styles.css, so the filter chips
     over here read as the same kind of control as the ones next door. */
  .cfw-chip {
    display: inline-flex; align-items: center; gap: 7px;
    font: inherit; font-size: 13px; font-weight: 600;
    padding: 7px 12px;
    border: 1.5px solid var(--line); border-radius: 8px;
    background: var(--card); color: var(--ink);
    cursor: pointer;
  }
  .cfw-chip:hover { border-color: var(--accent); color: var(--accent); }
  /* Selected chip: filled AND bold AND a darker count badge — three signals,
     because Allan is colourblind and colour alone is never the marker. */
  .cfw-chip.is-on {
    background: var(--accent); border-color: var(--accent);
    color: var(--accent-ink); font-weight: 700;
  }
  .cfw-chip__n {
    font-size: 11px; font-weight: 700;
    padding: 1px 6px; border-radius: 999px;
    background: var(--pill); color: var(--pill-ink);
  }
  .cfw-chip.is-on .cfw-chip__n { background: rgba(255, 255, 255, .22); color: var(--accent-ink); }

  /* Sits on the filter row rather than in the chip group — it is an action,
     not a filter, and should not read as a fifth thing you can select. */
  .cfw-refresh { align-self: flex-end; }
  .cfw-field { display: flex; flex-direction: column; gap: 4px; }
  .cfw-field--grow { flex: 1 1 180px; min-width: 0; }
  .cfw-field > span {
    font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--ink-soft);
  }
  .cfw-input, .cfw-select {
    font: inherit; font-size: 14px;
    padding: 8px 10px; min-height: 38px;
    border: 1.5px solid var(--line); border-radius: 8px;
    background: var(--card); color: var(--ink);
  }
  .cfw-input:focus, .cfw-select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
  }
  .cfw-note { margin: 6px 0 0; font-size: 12px; color: var(--ink-soft); }
  .cfw-note--inline { align-self: center; }
  .cfw-link {
    font: inherit; font-weight: 600; padding: 0;
    border: 0; background: none; color: var(--accent);
    text-decoration: underline; cursor: pointer;
  }

  /* The detail half of every master-detail tab.
     🔴 Sticky, because a list is long and the detail is not. Clicking the
     thirtieth task opened it at the TOP of the page, off-screen — you picked
     something and nothing appeared to happen. Allan hit exactly that.
     Scrolling the detail into view instead would yank the page under the
     cursor mid-click; keeping it beside the row you clicked is what a
     master-detail layout is FOR. It scrolls inside itself when the content is
     taller than the screen, the same rule the Reports summary and the Sales
     columns already follow. */
  .cfw-detail {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    /* Room for the pane's own focus rings and shadows, which a scroll
       container would otherwise clip. */
    padding: 2px;
    margin: -2px;
  }

  /* ── The list ───────────────────────────────────────────────────────── */
  .cfw-rows { list-style: none; margin: 0; padding: 0; border-radius: var(--radius); overflow: hidden; border: 1.5px solid var(--line); }
  .cfw-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 10px; align-items: center;
    /* 44px, not the 48px touch floor styles.css sets for phones: this list only
       exists at >=1024px with a pointer, and four extra pixels across thirty
       rows is a screenful of scrolling for nothing. */
    min-height: 44px; padding: 8px 12px 8px 9px;
    background: var(--card);
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
  }
  .cfw-row:last-child { border-bottom: 0; }
  .cfw-row:hover { background: #f7f9fb; }
  /* Selection is a 3px bar plus a tint plus bold — shape first, colour second. */
  .cfw-row.is-selected { background: #f0f6fb; border-left-color: var(--accent); }
  .cfw-row.is-selected .cfw-row__title { font-weight: 700; }
  .cfw-row__tick { width: 18px; height: 18px; cursor: pointer; }
  /* A task with no contact cannot be completed through the API at all, so its
     tick is disabled rather than live-but-doomed — the control has to tell the
     truth before it is clicked, not after. */
  .cfw-row__tick:disabled { cursor: not-allowed; opacity: .35; }
  .cfw-row__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .cfw-row__title { display: flex; flex-direction: column; gap: 1px; }
  .cfw-row__sub { font-size: 12px; font-weight: 400; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; }
  /* Ticking one off fades it on the way out, so the row you just cleared is
     visibly the one that left rather than the list silently reshuffling. */
  .cfw-row.is-completing { opacity: .4; }
  .cfw-row.is-completing .cfw-row__title { text-decoration: line-through; }

  .cfw-due { font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--ink-soft); }
  .cfw-due--overdue { color: var(--warn); font-weight: 700; }
  .cfw-due--today { color: var(--accent); font-weight: 700; }
  .cfw-who {
    font-size: 11px; font-weight: 700; letter-spacing: .02em;
    min-width: 26px; padding: 3px 5px; border-radius: 999px; text-align: center;
    background: var(--pill); color: var(--pill-ink);
  }

  /* Waiting.
     .card-skel gets its BOX from the .card it is paired with on the search
     page (app.js: `skel.className = 'card card-skel'`). Here there is no card,
     so without this the shimmer bars floated on the panel background — six
     unhoused grey stripes, which Allan read as a failed load rather than a
     pending one. Same footprint as a real row, so nothing jumps when the data
     lands. `.short` was never defined at all; both bars came out full width. */
  /* A task that also has a bar on the diary. Glyph plus a tooltip, never
     colour — and nothing in GHL can tell you this, so the badge is the only
     way to scan a list for what is actually scheduled. */
  .cfw-ondiary { font-size: 13px; }

  /* Ticked off from the card, still on screen until the next refresh. Struck
     through AND faded — the strike is the part that survives being colourblind. */
  .cfw-row.is-done .cfw-row__title { text-decoration: line-through; opacity: .6; }

  /* Something is missing and we know why. Glyph AND words AND a bar — this
     one has to survive being skimmed. */
  .cfw-note--warn {
    padding: 6px 8px;
    color: #7c2d12;
    background: #fff7ed;
    border-left: 3px solid #ea580c;
    border-radius: 6px;
  }

  .cfw-skels { display: grid; gap: 8px; }
  .cfw-skels__say {
    margin: 0 0 4px; font-size: 13px; color: var(--ink-soft);
  }
  .cfw-skels .card-skel {
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--card);
  }
  .cfw-skels .card-skel .skel-line { margin: 0 0 8px; width: 70%; }
  .cfw-skels .card-skel .skel-line.short { width: 40%; height: 11px; margin-bottom: 0; }

  /* ── The detail pane ────────────────────────────────────────────────── */
  .cfw-placeholder {
    display: flex; align-items: center; justify-content: center; text-align: center;
    min-height: 220px; padding: 24px;
    color: var(--ink-soft); background: var(--card);
    border: 1.5px dashed var(--line); border-radius: var(--radius);
    font-size: 15px;
  }
  .cfw-detailcard { padding: 20px; }
  .cfw-detailcard .name { margin: 0 0 10px; }
  .cfw-flag { margin: 0 0 12px; font-weight: 700; font-size: 14px; }
  .cfw-flag--warn { color: var(--warn); }
  .cfw-body { margin: 14px 0; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
  .cfw-body--empty { color: var(--ink-soft); font-style: italic; }
  .cfw-body a { color: var(--accent); }

  /* ── My Day (appointments) ──────────────────────────────────────────── */
  .cfw-arows { list-style: none; margin: 0; padding: 0; border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  /* Sticky day bar: a column of times with no days is unreadable the moment
     it crosses midnight. */
  .cfw-daybar {
    position: sticky; top: 0; z-index: 1;
    padding: 6px 12px;
    font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    color: var(--ink-soft); background: var(--pill);
    border-bottom: 1px solid var(--line);
  }
  .cfw-arow {
    display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px;
    min-height: 44px; padding: 9px 12px 9px 9px;
    background: var(--card);
    /* The left bar means SELECTED, and nothing else. The marker gets its own
       dot on the title line — one 3px strip cannot carry two meanings. */
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
  }
  .cfw-mk {
    display: inline-block; width: 9px; height: 9px; margin-right: 6px;
    border-radius: 50%; vertical-align: baseline;
    box-shadow: 0 0 0 1px rgba(17, 20, 26, .18);   /* keeps a pale marker visible */
  }
  .cfw-arow:last-child { border-bottom: 0; }
  .cfw-arow:hover { background: #f7f9fb; }
  .cfw-arow.is-selected { background: #f0f6fb; border-left-color: var(--accent); }
  .cfw-arow.is-selected .cfw-arow__title { font-weight: 700; }
  .cfw-arow__time {
    font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
    display: flex; flex-direction: column;
  }
  .cfw-arow__time small { font-size: 11px; font-weight: 600; color: var(--ink-soft); }
  .cfw-arow__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  .cfw-arow__title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cfw-arow__addr { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Every tag is glyph + word. The marker's colour is a left bar on the row,
     never the only thing telling you which marker it is. */
  .cfw-tags { display: flex; flex-wrap: wrap; gap: 5px; }
  .cfw-tag {
    font-size: 11px; font-weight: 700;
    padding: 2px 7px; border-radius: 999px;
    background: var(--pill); color: var(--pill-ink);
  }
  .cfw-tag--job { background: #dbeafe; color: #1e40af; }
  .cfw-tag--tos { background: #e7f5ec; color: var(--good); }
  .cfw-tag--signed { background: #e7f5ec; color: var(--good); }
  .cfw-tag--block { background: #f1f0ee; color: var(--ink-soft); }
  .cfw-tag--fixed { background: #fff2e2; color: var(--warn); }

  /* Detail sub-sections — job scope, company, and (next chunk) time on site. */
  .cfw-sub { margin: 16px 0; padding-top: 14px; border-top: 1.5px solid var(--line); }
  .cfw-sub h3 {
    margin: 0 0 8px; font-size: 11px; font-weight: 800;
    letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft);
  }
  .cfw-scopeline { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
  /* The breakdown saved on the job at booking, shown when the live quote lines
     can't be read — one item per line, as it was written. */
  .cfw-scopesaved { margin: 0 0 8px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .cfw-coname { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
  .cfw-sites { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .cfw-sites li { padding: 8px 10px; background: var(--bg); border-radius: 8px; font-size: 13px; }
  .cfw-sites strong { display: block; }
  .cfw-sites span { color: var(--ink-soft); }
  .cfw-statusrow { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 14px 0; }
  .cfw-tosline { margin: 0 0 8px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .cfw-flag--good { color: var(--good); }
  .cfw-field--block { display: block; margin: 12px 0 8px; }
  .cfw-field--block > span { display: block; margin-bottom: 4px; }
  .cfw-textarea { width: 100%; min-height: 68px; resize: vertical; font: inherit; font-size: 14px; }
  .cfw-table--tight th, .cfw-table--tight td { padding: 6px 10px; }

  /* The "whose diary" chooser, shown when the session has no named user. */
  .cfw-chooser {
    padding: 24px; background: var(--card);
    border: 1.5px solid var(--line); border-radius: var(--radius);
  }
  .cfw-chooser h2 { margin: 0 0 6px; font-size: 18px; }
  .cfw-chooser p { margin: 0 0 14px; color: var(--ink-soft); font-size: 14px; }
  .cfw-chooser__list { display: grid; gap: 8px; }

  /* ── Sales (the pipeline board) ─────────────────────────────────────── */
  .cfw-pipetotal { margin: 10px 0 0; font-size: 14px; font-weight: 700; color: var(--ink); }
  .cfw-newbtn { align-self: flex-end; }

  .cfw-kanban {
    display: grid; grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 290px);
    gap: 14px; margin-top: 16px;
    overflow-x: auto; padding-bottom: 8px;
  }
  .cfw-col {
    display: flex; flex-direction: column; min-width: 0;
    background: var(--bg);
    border: 1.5px solid var(--line); border-radius: var(--radius);
    /* The hue is a rule on top and nothing else. The NUMBER in the head is
       what says which stage comes first, so the board reads in greyscale. */
    border-top: 3px solid var(--cfw-col, var(--accent));
  }
  .cfw-col__head { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .cfw-col__name { display: block; font-size: 13px; font-weight: 700; }
  .cfw-col__name b { color: var(--cfw-col, var(--accent)); }
  .cfw-col__sum { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .cfw-col__cards {
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px; overflow-y: auto;
    /* Tall columns scroll inside themselves, so the board keeps one horizon
       instead of the page growing to the tallest stage. */
    max-height: calc(100vh - 300px);
  }
  .cfw-col__empty { margin: 4px 0; font-size: 12px; color: var(--ink-soft); font-style: italic; }

  .cfw-deal {
    padding: 10px; background: var(--card);
    border: 1.5px solid var(--line); border-radius: 8px;
    cursor: pointer;
  }
  .cfw-deal:hover { border-color: var(--accent); background: #f7f9fb; }
  .cfw-deal:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .cfw-deal__name { margin: 0; font-size: 14px; font-weight: 700; }
  .cfw-deal__who { margin: 2px 0 0; font-size: 12px; color: var(--ink-soft); }
  .cfw-deal__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 0; }
  .cfw-deal__val { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .cfw-deal__age { margin: 4px 0 0; font-size: 11px; color: var(--ink-soft); }
  .cfw-deal[draggable="true"] { cursor: grab; }
  .cfw-deal.is-dragging { opacity: .45; cursor: grabbing; }
  /* The target column is marked by a dashed outline AND a tint — the outline
     is the part that works without colour. */
  .cfw-col.is-dropzone {
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
    background: #eef5fa;
  }

  /* The deal dialog — centred, reusing .form-embed-modal. Not a bottom sheet:
     that is a phone gesture, and reusing this class means app.js's keyboard
     stand-down already knows to leave the page alone while it is open. */
  .cfw-dialog { max-width: 560px; width: min(560px, 92vw); }
  .cfw-dialog__body { padding: 16px; display: grid; gap: 12px; }
  .cfw-dialog__row { display: flex; gap: 12px; align-items: flex-end; }
  .cfw-dialog__foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 16px; border-top: 1.5px solid var(--line);
  }
  .cfw-picklist {
    margin-top: 6px; max-height: 210px; overflow-y: auto;
    border: 1.5px solid var(--line); border-radius: 8px; background: var(--card);
  }
  .cfw-pick {
    display: block; width: 100%; text-align: left;
    font: inherit; font-size: 14px; padding: 9px 12px;
    border: 0; border-bottom: 1px solid var(--line);
    background: none; cursor: pointer;
  }
  .cfw-pick:last-child { border-bottom: 0; }
  .cfw-pick:hover { background: #f0f6fb; }
  .cfw-pick small { display: block; font-size: 12px; color: var(--ink-soft); }

  /* ── Reports ────────────────────────────────────────────────────────── */
  /* Chart and table on the left, a sticky summary rail on the right. The
     phone stacks these because it has one column; the point of running this
     at a desk is seeing the shape of the month and the rows together. */
  .cfw-repgrid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
  .cfw-repmain { min-width: 0; }
  .cfw-chart { width: 100%; height: auto; display: block; margin: 0 0 18px; }
  .cfw-bar { fill: var(--accent); }
  .cfw-axis { stroke: var(--line); stroke-width: 1.5; }
  .cfw-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
  .cfw-ytick { font-size: 11px; fill: var(--ink-soft); text-anchor: end; }
  .cfw-barval { font-size: 11px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
  .cfw-barlbl { font-size: 11px; fill: var(--ink-soft); text-anchor: middle; }

  .cfw-summary {
    position: sticky; top: 16px;
    padding: 18px; background: var(--card);
    border: 1.5px solid var(--line); border-radius: var(--radius);
  }
  .cfw-summary__range { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
  .cfw-summary__total { margin: 6px 0 2px; font-size: 34px; font-weight: 800; line-height: 1.1; color: var(--ink); }
  .cfw-summary__count { margin: 0 0 14px; font-size: 13px; color: var(--ink-soft); }
  .cfw-summary__actions { display: grid; gap: 8px; }
  .cfw-warnbox {
    margin: 0 0 14px; padding: 10px 12px;
    font-size: 13px; line-height: 1.45; color: var(--warn);
    background: #fff8f0; border: 1.5px solid var(--warn); border-radius: 8px;
  }

  .cfw-tablewrap { overflow-x: auto; border: 1.5px solid var(--line); border-radius: var(--radius); }
  .cfw-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); }
  .cfw-table th, .cfw-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
  .cfw-table th { background: var(--pill); font-size: 12px; }
  .cfw-table td.num, .cfw-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
  .cfw-table tbody tr:hover { background: #f7f9fb; }
  .cfw-table tfoot td { font-weight: 800; border-bottom: 0; background: var(--pill); }
  .cfw-noprice { color: var(--ink-soft); font-style: italic; }
  /* Sortable headers — an affordance the phone cannot offer. The arrow is a
     glyph, so the sorted column is readable without relying on colour. */
  .cfw-sort {
    display: inline-flex; align-items: center; gap: 6px;
    font: inherit; font-size: 12px; font-weight: 700;
    padding: 0; border: 0; background: none; color: var(--ink-soft); cursor: pointer;
  }
  .cfw-sort:hover { color: var(--accent); }
  .cfw-sort.is-on { color: var(--accent); }
  .cfw-sort__a { font-size: 10px; }

  /* ── Suggested companies ────────────────────────────────────────────── */
  /* One calm column rather than the full width: this is plain English the
     owner reads and answers, and very long lines are harder to follow. */
  .cfw-sc { max-width: 860px; }
  /* 🪤 Several regions below carry an explicit display, and an author rule
     beats the [hidden] attribute's UA display:none. */
  .cfw-sc [hidden] { display: none !important; }
  .cfw-sc__intro { margin: 0 0 22px; }
  .cfw-sc__title { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
  /* The Refresh button + "read at" time, beside the title rather than
     default block flow underneath it. */
  .cfw-sc__introhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
  .cfw-sc__refresh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .cfw-sc__refreshwhen { font-size: 13px; color: var(--ink-soft); }
  .cfw-sc__lead { margin: 0 0 12px; font-size: 15px; line-height: 1.5; color: var(--ink); }
  .cfw-sc__step { margin: 0 0 30px; }
  .cfw-sc__h { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
  .cfw-sc__headrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
  .cfw-sc__count { font-size: 14px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .cfw-sc__warn, .cfw-sc__phonewarn { margin: 0 0 12px; font-size: 14px; font-weight: 600; }

  /* A programmatic focus (after Skip, Undo, a convert) shows a ring only to
     keyboard users; a mouse user does not get a blue box round the name. */
  .cfw-sc [tabindex="-1"]:focus { outline: none; }
  .cfw-sc [tabindex="-1"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

  /* Loading says so in WORDS; the spinner is decoration. */
  .cfw-sc__loading {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 12px; padding: 14px 16px;
    font-size: 15px; color: var(--ink-soft);
    background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius);
  }
  .cfw-sc__spin {
    flex: none; width: 18px; height: 18px;
    border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
    animation: cfw-sc-spin .9s linear infinite;
  }

  .cfw-sc__card, .cfw-sc__pair {
    padding: 18px 20px; background: var(--card);
    border: 1.5px solid var(--line); border-radius: var(--radius);
  }
  .cfw-sc__pairs { display: grid; gap: 12px; margin: 0 0 12px; padding: 0; list-style: none; }
  .cfw-sc__pair.is-skipped {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 4px 16px; font-size: 14px; color: var(--ink-soft);
  }
  .cfw-sc__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
  .cfw-sc__col { min-width: 0; padding: 12px 14px; background: var(--bg); border-radius: 10px; }
  .cfw-sc__colh {
    margin: 0 0 8px; font-size: 12px; font-weight: 800;
    letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft);
  }
  .cfw-sc__facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 14px; }
  .cfw-sc__facts dt { font-weight: 600; color: var(--ink-soft); }
  .cfw-sc__facts dd { margin: 0; overflow-wrap: anywhere; }
  .cfw-sc__meta { margin: 10px 0 0; font-size: 14px; font-weight: 700; }
  .cfw-sc__col .cfw-sc__btn { margin-top: 10px; }
  .cfw-sc__gone { margin: 0; font-size: 14px; font-weight: 700; color: var(--warn); }
  .cfw-sc__decided { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 0; font-size: 15px; }
  .cfw-sc__why { margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); }
  .cfw-sc__after { margin: 0; font-size: 14px; color: var(--ink-soft); }

  .cfw-sc__name { margin: 0 0 4px; font-size: 24px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
  .cfw-sc__co { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
  .cfw-sc__card > .cfw-sc__facts { margin: 8px 0 0; }

  .cfw-sc__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 0; }
  /* styles.css makes .btn 52px and 17px for phones; a desk wants less, but
     never under the 44px tap floor. */
  /* Targets .cfw-sc__btn, never .btn: a bare .btn here would restyle the
     contact card's buttons (workspace-shell.test.js pins that). */
  .cfw-sc .cfw-sc__btn { min-height: 44px; padding: 8px 16px; font-size: 15px; border-radius: 10px; }
  .cfw-sc .cfw-sc__btn:disabled,
  .cfw-sc .cfw-sc__btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
  .cfw-sc .cfw-sc__linkbtn { min-height: 44px; padding: 0 6px; }
  .cfw-sc .cfw-sc__linkbtn:disabled { color: var(--ink-soft); cursor: not-allowed; }
  .cfw-sc__help { font-size: 14px; font-weight: 600; color: var(--ink-soft); }

  .cfw-sc__form { margin: 16px 0 0; padding: 16px 0 0; border-top: 1.5px solid var(--line); }
  .cfw-sc__qtext { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
  .cfw-sc__q { display: grid; gap: 6px; }
  .cfw-sc__opt {
    display: flex; align-items: center; gap: 10px;
    min-height: 44px; padding: 6px 12px;
    font-size: 15px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer;
  }
  /* Chosen = the filled radio AND bold AND a border. Colour is the last of the three. */
  .cfw-sc__opt:has(input:checked) { font-weight: 700; border-color: var(--accent); background: #f0f6fb; }
  .cfw-sc__opt input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
  /* "Did you mean one of these?" — a similar company's own address, under its
     name inside the same radio label. Muted and its own line, never colour
     alone as the only difference from the label above it. */
  .cfw-sc__optlabel { display: flex; flex-direction: column; gap: 2px; }
  .cfw-sc__optsub { display: block; font-size: 13px; font-weight: 400; color: var(--ink-soft); }
  /* 📍 "Also add <business> as the site" — belongs to the person option above it. */
  .cfw-sc__indent { margin-left: 30px; }
  p.cfw-sc__indent { margin-top: 0; margin-bottom: 0; }
  .cfw-sc__opt[disabled], .cfw-sc__opt:has(input:disabled) { cursor: not-allowed; opacity: .75; }
  /* 🏢 "What this sets up" — the company, its site, the contact and who pays,
     before anything is made (2026-10-10). Icons AND words carry it; the border
     is the last signal, never the only one. */
  .cfw-sc__tree {
    margin: 12px 0 4px; padding: 10px 14px;
    border: 1.5px solid var(--line); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0;
    background: #f6f9fc;
  }
  .cfw-sc__treeh { margin: 0 0 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); }
  .cfw-sc__tree ul { margin: 0; padding-left: 4px; list-style: none; display: grid; gap: 4px; font-size: 14px; line-height: 1.45; }
  .cfw-sc__joinnote { font-size: 14px; color: var(--ink-soft); }
  .cfw-sc__result { margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--good); }
  .cfw-sc__errrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .cfw-sc__err {
    margin: 12px 0 0; padding: 8px 12px;
    font-size: 14px; font-weight: 600; color: var(--warn);
    background: #fff8f0; border-left: 3px solid var(--warn); border-radius: 6px;
  }
  .cfw-sc__errrow .cfw-sc__btn { margin-top: 12px; }
  .cfw-sc__sites { display: grid; gap: 4px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 14px; font-weight: 600; }
  .cfw-sc__addr { margin: 12px 0 0; padding: 14px; background: var(--bg); border-radius: 10px; }
  .cfw-sc__sub { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
  .cfw-sc__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; }
  .cfw-sc__field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
  .cfw-sc__field:first-child { grid-column: 1 / -1; }
  .cfw-sc__input { min-height: 44px; font-size: 15px; }

  .cfw-sc__flash { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
  .cfw-sc__flash:empty { display: none; }
  .cfw-sc__toast {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 10px; padding: 6px 6px 6px 14px;
    font-size: 14px; font-weight: 600; background: var(--pill); border-radius: 10px;
  }
  .cfw-sc__empty {
    padding: 20px; font-size: 16px;
    background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius);
  }
  .cfw-sc__empty p { margin: 0 0 10px; }
  .cfw-sc__done { margin: 0; font-weight: 700; color: var(--good); }

  .cfw-sc__find { margin: 18px 0 0; }
  .cfw-sc__findlabel { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 700; }
  .cfw-sc__find .cfw-sc__input { width: 100%; max-width: 420px; }
  /* The find-existing-contact search box lives inside .cfw-sc__addr (shared
     with the address form), which the rule above does not reach — without
     this it renders at the browser's ~20-character default.
     🪤 Direct-child combinator ONLY: a bare descendant selector here also
     matches the 5 address-grid inputs two levels down (.cfw-sc__addr >
     .cfw-sc__grid > label > input), capping the Site name box at 420px even
     though its <label> spans both grid columns. The search input alone sits
     as a direct child of .cfw-sc__addr. */
  .cfw-sc__addr > .cfw-sc__input { width: 100%; max-width: 420px; }
  .cfw-sc__hits { display: grid; gap: 6px; max-width: 560px; margin: 8px 0 0; padding: 0; list-style: none; }
  .cfw-sc__hit {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    width: 100%; min-height: 44px; padding: 8px 12px;
    font: inherit; font-size: 14px; text-align: left;
    color: var(--ink); background: var(--card);
    border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer;
  }
  .cfw-sc__hit:hover:not(:disabled) { border-color: var(--accent); background: #f0f6fb; }
  /* Not faded to near-invisible: the reason on a disabled row must stay readable. */
  .cfw-sc__hit:disabled { cursor: not-allowed; color: var(--ink-soft); background: var(--bg); }
  .cfw-sc__hit .cfw-sc__why { margin: 0; font-weight: 600; }
  .cfw-sc__hitnote { padding: 4px 2px; font-size: 14px; color: var(--ink-soft); }
}

@keyframes cfw-sc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .cfw-sc__spin { animation-duration: 2.4s; }
}

/* ════════════════════════════════════════════════════════════════════════
   PRINT.
   🔴 styles.css:2825 blanks everything except .card.is-selected, so without
   this a workspace tab prints a blank page — which is exactly what Reports'
   own Print button would have produced. Show the active panel, hide the
   chrome around it, and let the table break across pages.
   ════════════════════════════════════════════════════════════════════════ */
@media print {
  /* 🔴 TWO separate things have to be undone, and missing either prints blank.
     1. styles.css blanks the page with `body * { visibility: hidden }` — NOT
        display — so restoring `display` alone changes nothing. Measured: the
        first version of this block did exactly that and still printed nothing.
     2. Every workspace rule lives inside @media (min-width: 1024px), and a
        sheet of A4 is ~816px, so none of it applies on paper. Display has to
        be set explicitly here too. */
  body[data-cf-tab]:not([data-cf-tab="clients"]) .cfw-root,
  body[data-cf-tab]:not([data-cf-tab="clients"]) .cfw-root * {
    visibility: visible !important;
  }
  body[data-cf-tab]:not([data-cf-tab="clients"]) .cfw-root {
    display: block !important;
    position: absolute; left: 0; top: 0; width: 100%;
  }
  body[data-cf-tab]:not([data-cf-tab="clients"]) .cfw-panel.is-on { display: block !important; }

  /* Chrome stays out. display:none wins over the visibility rule above,
     because a box that is not generated cannot be made visible. */
  body[data-cf-tab]:not([data-cf-tab="clients"]) .cf-tabs,
  body[data-cf-tab]:not([data-cf-tab="clients"]) .cf-grid,
  body[data-cf-tab]:not([data-cf-tab="clients"]) .pill-row,
  body[data-cf-tab]:not([data-cf-tab="clients"]) .back-to-top,
  body[data-cf-tab]:not([data-cf-tab="clients"]) .cfw-toolbar,
  body[data-cf-tab]:not([data-cf-tab="clients"]) .cfw-summary__actions {
    display: none !important;
  }
  /* Summary FIRST on paper. It carries the date range and the total, which is
     what the sheet is for — and it is last in source order, so this needs the
     reorder, not just a switch to block flow. */
  /* align-items:stretch is NOT redundant. The screen rule sets `start`, which
     on a COLUMN flex container governs the horizontal axis — so the chart and
     table shrink-to-fit and print at 304px on a 1425px page. Measured. */
  .cfw-repgrid { display: flex; flex-direction: column; align-items: stretch; }
  .cfw-summary {
    order: -1;
    position: static; border: 0; padding: 0 0 14px;
    border-bottom: 1.5px solid #ccc; margin-bottom: 16px;
  }
  .cfw-summary__total { font-size: 28px; }
  .cfw-tablewrap { overflow: visible; border: 0; }
  .cfw-table { font-size: 11px; }
  .cfw-table thead { display: table-header-group; }   /* repeat on every page */
  .cfw-table tr { break-inside: avoid; }
}

/* ── Outstanding Invoices report (2026-09-17) ──────────────────────────
   Spec: docs/superpowers/specs/2026-09-17-outstanding-invoices-report-design.md
   Status is always icon + words (never colour alone). The row buttons drop to
   their own line when the report is narrow, so a customer's name never breaks
   word by word under the due date. */
.cfw-reportpick { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.cfw-subpick { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; margin: 0 0 14px; }
/* 🧰 The sub-tab strip of a grouped tab (Tools). The same chips as Reports'
   picker. Emptied, not [hidden], off a group: an author display rule beats the
   [hidden] attribute, so :empty is what takes it away. */
.cfw-subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.cfw-subtabs:empty { display: none; }
/* 📮 Tools › Postcode Clean. States carry an icon AND words; colour only adds. */
.pcc { max-width: 1100px; }
.pcc-title { display: flex; align-items: baseline; gap: 10px; font-size: 20px; margin: 0 0 4px; }
.pcc-why { font-size: 14px; font-weight: 600; }
.pcc-sub, .pcc-note { margin: 0 0 10px; color: var(--ink-soft, #4b5563); }
.pcc-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.pcc-summary { margin: 0; font-weight: 600; }
/* Blocks (2026-10-14): the count line, the size picker, this block's bar, Done. */
.pcc-status { margin: 0 0 10px; font-weight: 600; }
.pcc-size { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.pcc-size select { min-height: 40px; padding: 4px 8px; }
.pcc-blockbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.pcc-done { margin: 8px 0 24px; }
.pcc-warn { color: var(--warn, #b54708); font-weight: 600; }
.pcc-sec { margin: 0 0 24px; }
.pcc-sechead { display: flex; align-items: center; gap: 16px; }
.pcc-sec h3 { font-size: 16px; margin: 0 0 8px; }
.pcc-all { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.pcc-table { width: 100%; border-collapse: collapse; }
.pcc-table th, .pcc-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line, #dbe2ea); vertical-align: middle; }
.pcc-table input[type="checkbox"], .pcc-all input { width: 20px; height: 20px; }
.pcc-addr { color: var(--ink-soft, #4b5563); margin-left: 6px; }
.pcc-res { font-weight: 600; }
.pcc-res--ok { color: var(--ok, #067647); }
.pcc-res--warn { color: var(--warn, #b54708); }
.pcc-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.pcc-hands { list-style: none; margin: 0; padding: 0; }
.pcc-hand { padding: 10px 0; border-bottom: 1px solid var(--line, #dbe2ea); }
.pcc-fix { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.pcc-box { width: 12ch; }
.pcc-msg { margin: 6px 0 0; font-weight: 600; }
.pcc-msg:empty { display: none; }
/* A disabled Save looked exactly like a live one (seen in the browser check),
   so a click that does nothing read as broken. The house 0.6 fade. */
.pcc button:disabled { opacity: 0.6; cursor: default; }
.pcc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Jobs Not Invoiced (ws-report-uninvoiced.js) — reuses the Jobs by Date table
   and rail; only what is new lives here. Invoice state is icon + word, the
   colour is only a second signal. */
.cfw-uj-intro { margin: 0 0 10px; opacity: .85; }
.cfw-uj-filters { align-items: flex-end; }
.cfw-uj-tick { display: inline-flex; gap: 8px; align-items: center; min-height: 40px; cursor: pointer; }
.cfw-uj-tick input { width: 18px; height: 18px; }
.cfw-uj-table td { vertical-align: middle; }
.cfw-uj-inv { white-space: nowrap; font-weight: 600; }
/* 🏢 Left for the office (23 Nov 2026): an icon and words under the job, never colour alone. */
.cfw-uj-left { margin-top: 2px; font-size: 12px; font-weight: 600; color: #1f3347; }
.cfw-uj-inv.is-void { color: #9f1c14; }
.cfw-uj-inv.is-draft { color: #8a5a00; }
.cfw-uj-acts { white-space: normal; }
.cfw-uj-btns { display: inline-flex; gap: 4px; white-space: nowrap; }
/* Diary + Contact side by side, the quiet Hide on its own line underneath —
   with all three on one line the table outgrew a 1440px screen and clipped Hide. */
.cfw-uj-acts .cfw-oi-act { white-space: nowrap; }
.cfw-uj-acts .cfw-uj-hide, .cfw-uj-acts .cfw-uj-hiddenby { display: block; }
/* "Hide" is quiet on purpose — see rowActions() in ws-report-uninvoiced.js. */
.cfw-uj-hide { border: 0; background: none; padding: 4px 2px; margin-left: 0; color: var(--ink-soft, #6b7785); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.cfw-uj-hide:hover { color: var(--accent); }
.cfw-uj-hiddenby { font-size: 13px; opacity: .75; margin: 2px 0 0; }
.cfw-uj-hiddenlink { margin: 10px 2px 0; font-size: 14px; }
.cfw-uj-undo { margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--line, #dbe2ea); border-radius: 8px; background: #f6f8fb; }
/* 🔁 Reports → Maintenance Plans (17 Oct 2026) — three sections; words, never colour alone. */
.cfw-mp-toolbar .cfw-toolbar__row { gap: 8px; flex-wrap: wrap; align-items: center; }
.cfw-mp-sec { margin: 18px 0 0; }
.cfw-mp-h { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--ink); }
.cfw-mp-count { font-weight: 400; color: var(--ink-soft); }
.cfw-mp-go { min-height: 36px; padding: 6px 12px; white-space: nowrap; }
.cfw-mp-help, .cfw-qc-help { margin: 10px 0 0; padding: 10px 14px; border: 1px solid var(--line, #dbe2ea); border-radius: 10px; background: #f6f8fb; font-size: 14px; color: var(--ink); }
.cfw-mp-help p, .cfw-qc-help p { margin: 4px 0; }
.cfw-mp-help-list, .cfw-qc-help-list { margin: 2px 0 6px; padding-left: 20px; }
.cfw-mp-help-list li, .cfw-qc-help-list li { margin: 2px 0; }
/* The plan the diary's "↗ Go to Maintenance Plan" sent us to — a band AND words. */
.cfw-mp-table tr.cfw-mp-focus td { background: #fff7d6; }
.cfw-mp-table tr.cfw-mp-focus td:first-child { box-shadow: inset 4px 0 0 #006aac; }
.cfw-mp-fromdiary { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; border: 1px solid #006aac; color: #006aac; font-size: 12px; font-weight: 600; white-space: nowrap; }
.cfw-mp-help .cfw-mp-help-foot, .cfw-qc-help .cfw-qc-help-foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line, #dbe2ea); font-size: 13px; color: var(--muted, #475569); }
.cfw-mp-lag { margin: 14px 2px 0; font-size: 12px; color: var(--ink-soft); }
.cfw-mp-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line, #dbe2ea); background: #fff; color: var(--ink); white-space: nowrap; }
.cfw-mp-status.is-part-booked, .cfw-mp-status.is-needs-pattern { border-color: #e6b94d; background: #fff8e6; }
.cfw-mp-status.is-ending-soon { border-color: var(--accent); background: #eef6fb; }
.cfw-mp-status.is-ended, .cfw-mp-status.is-unreadable { color: var(--ink-soft); }
/* 📨 Sign-off requests: each status is an icon AND words, the colour only backs it up. */
.cfw-so-count { margin: 0 2px 8px; font-size: 13px; color: var(--ink-soft); }
.cfw-so-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line, #dbe2ea); background: #fff; color: var(--ink); white-space: nowrap; }
.cfw-so-status.is-query { border-color: #e6b94d; background: #fff8e6; }
.cfw-so-status.is-sent, .cfw-so-status.is-opened { border-color: var(--accent); background: #eef6fb; }
.cfw-so-status.is-expired, .cfw-so-status.is-cancelled, .cfw-so-status.is-signed { color: var(--ink-soft); }
.cfw-so-off { display: inline-flex; flex-direction: column; gap: 2px; max-width: 190px; }
.cfw-so-why { font-size: 11px; color: var(--ink-soft); }
.cfw-oi { display: grid; gap: 12px; position: relative; container-type: inline-size; container-name: oi; }
.cfw-oi-top { display: flex; justify-content: flex-end; }
.cfw-oi-help { border: 1px solid var(--accent); color: var(--accent); background: #fff; border-radius: 999px; padding: 8px 14px; min-height: 40px; font-weight: 600; cursor: pointer; }
.cfw-oi-help[aria-pressed="true"] { background: var(--accent); color: #fff; }
.cfw-oi-samplebar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; background: #fff8d6; border: 1px solid #e6d27a; border-radius: 10px; padding: 10px 14px; margin: 8px 0; }
.cfw-oi.is-sample::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='460' height='300'%3E%3Ctext x='150' y='170' transform='rotate(-20 230 150)' font-family='Arial, sans-serif' font-size='34' font-weight='700' letter-spacing='6' fill='rgba(128,138,150,0.09)'%3ESAMPLE%3C/text%3E%3C/svg%3E"); }
.cfw-oi-summary, .cfw-oi-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cfw-oi-tile { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--line, #dbe2ea); border-radius: 10px; min-width: 190px; background: #fff; }
.cfw-oi-tile span { font-size: 13px; opacity: .8; }
.cfw-oi-tile b { font-size: 26px; font-variant-numeric: tabular-nums; }
.cfw-oi-tile.is-over b { color: #9f1c14; }
.cfw-oi-asat, .cfw-oi-push { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.cfw-oi-seg { display: inline-flex; border: 1px solid var(--line, #dbe2ea); border-radius: 9px; overflow: hidden; }
.cfw-oi-seg button { border: 0; background: #fff; padding: 9px 14px; min-height: 40px; font-weight: 600; cursor: pointer; }
.cfw-oi-seg button + button { border-left: 1px solid var(--line, #dbe2ea); }
.cfw-oi-seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.cfw-oi-group { border: 1px solid var(--line, #dbe2ea); border-radius: 10px; overflow: hidden; }
.cfw-oi-group > summary { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 12px 14px; background: #f6f8fb; cursor: pointer; font-weight: 600; }
.cfw-oi-gstats { margin-left: auto; display: flex; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; }
.cfw-oi-empty { padding: 12px 14px; opacity: .7; }
.cfw-oi-row { display: grid; grid-template-columns: 110px minmax(170px, 1fr) 120px 190px auto; gap: 8px 14px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line, #dbe2ea); }
.cfw-oi-inv { font-weight: 600; font-variant-numeric: tabular-nums; }
/* 🧾 The Reference / PO under the number — the same quiet line as "of £…",
   on Outstanding and on Not Sent to Xero alike. */
.cfw-oi-inv small,
.cfw-uj-po { display: block; font-weight: 500; opacity: .75; }
.cfw-oi-who { display: grid; gap: 1px; min-width: 0; }
.cfw-oi-who strong { overflow-wrap: anywhere; }
.cfw-oi-due { font-size: 14px; opacity: .75; }
.cfw-oi-amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.cfw-oi-amt small { display: block; font-weight: 500; opacity: .75; }
.cfw-oi-status, .cfw-oi-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cfw-oi-acts { justify-content: flex-end; }
.cfw-oi-act { border: 1px solid var(--line, #dbe2ea); background: #fff; border-radius: 8px; padding: 7px 10px; min-height: 44px; cursor: pointer; white-space: nowrap; }
.cfw-oi-act:hover { border-color: var(--accent); color: var(--accent); }
/* 👁 Statement run › Preview: the Company Record's own statement in a frame over
   the list (1 Nov 2026). The frame is see-through; its statement window brings
   its own backdrop. Ours shows only until that window is up (.is-open). */
.cfw-stmt-preview { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 37, 64, .45); }
.cfw-stmt-preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }
.cfw-stmt-preview__wait { position: absolute; top: 38%; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); background: #fff; color: #1d2733; padding: 14px 18px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 24px rgba(15, 37, 64, .25); }
.cfw-stmt-preview__close { position: absolute; top: 12px; right: 12px; z-index: 1; min-width: 44px; min-height: 44px; border-radius: 22px; border: 1px solid var(--line, #dbe2ea); background: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.cfw-stmt-preview.is-open { background: transparent; }
.cfw-stmt-preview.is-open .cfw-stmt-preview__wait, .cfw-stmt-preview.is-open .cfw-stmt-preview__close { display: none; }
.cfw-oi-flag { grid-column: 2 / -1; font-size: 14px; background: #fff1cc; color: #7a4f00; border-radius: 7px; padding: 6px 10px; justify-self: start; }
/* The lapsed-subscription note — same box shape as .cfw-warnbox, but this one
   is not a warning: chasing was deliberately left switched on, and it says so
   warmly. Its own class because reusing the warning colour here would read as
   a problem, not a kindness. */
.cfw-oi-kindbox { margin: 0 0 14px; padding: 10px 12px; font-size: 13px; line-height: 1.45; color: var(--good); background: #eaf7ee; border: 1.5px solid var(--good); border-radius: 8px; }
.cfw-oi-kindbox b { display: block; font-size: 14px; margin-bottom: 4px; }
.cfw-oi-kindbox p { margin: 4px 0 0; }
.cfw-oi-pill { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.cfw-oi-pill.is-over { background: #fde9e7; color: #9f1c14; }
.cfw-oi-pill.is-soon { background: #fff1cc; color: #7a4f00; }
.cfw-oi-apart { font-size: 14px; font-weight: 600; letter-spacing: .03em; opacity: .75; display: flex; gap: 8px; align-items: center; }
.cfw-oi-note { font-size: 14px; opacity: .8; }
/* ⓘ The statement run's How it works — a link to its part of the Companies guide (1 Nov 2026). */
.cfw-oi-guide { display: inline-block; margin-left: 6px; color: var(--accent, #006aac); font-weight: 600; white-space: nowrap; }
/* ✅ Update GoHighLevel from Xero (2026-10-04). Blue, because it asks for an
   action; the tick and the words carry the meaning, never colour alone. */
.cfw-oi-xerobar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; padding: 10px 12px; font-size: 14px; line-height: 1.45; background: #eef6fb; border: 1.5px solid #006aac; border-radius: 8px; }
.cfw-oi-xerobar span { flex: 1 1 260px; }
.cfw-oi-xerobtn { min-height: 44px; }
.cfw-oi-marker { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #1c2631; color: #fff8d6; font-size: 13px; font-weight: 700; flex: none; }
.cfw-oi-notes { display: grid; gap: 8px; position: relative; z-index: 3; }
.cfw-oi-noteitem { display: grid; grid-template-columns: 24px 1fr; gap: 10px; background: #fff8d6; border: 1px solid #e6d27a; border-radius: 10px; padding: 10px 12px; }
.cfw-oi-noteitem b { display: block; }
@container oi (max-width: 980px) {
  .cfw-oi-row { grid-template-columns: 110px minmax(0, 1fr) 120px 190px; }
  .cfw-oi-acts { grid-column: 2 / -1; justify-content: flex-start; }
}

/* ════════════════════════════════════════════════════════════════════════
   In-app help panel (public/help-panel.js) — a reusable "How to use this"
   slide-over, first wired into Suggested companies 2026-09-18. This is the
   ONLY branch appending to workspace.css today, so there is nothing else to
   merge around here. Every control keeps the 44px touch floor, and the one
   warning style (.cfw-help__note) always carries ⚠ AND words — never colour
   alone, per the colourblind owner's own screens elsewhere in this file.
   ════════════════════════════════════════════════════════════════════════ */
.cfw-help { position: fixed; inset: 0; z-index: 60; }
.cfw-help__backdrop { position: absolute; inset: 0; background: rgba(17, 20, 26, 0.45); }
.cfw-help__dialog {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 100%;
  background: #fff;
  box-shadow: -4px 0 24px rgba(17, 20, 26, 0.18);
  display: flex; flex-direction: column;
}
.cfw-help__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 16px 12px; border-bottom: 1px solid var(--line, #dbe2ea);
}
.cfw-help__title { margin: 0; font-size: 18px; line-height: 1.3; }
/* Focused programmatically on open, not by keyboard nav — no ring needed on
   a heading with nothing on it to activate. */
.cfw-help__title:focus { outline: none; }
.cfw-help__close {
  min-height: 44px; min-width: 44px;
  border: 1px solid var(--line, #dbe2ea); background: #fff; border-radius: 8px;
  padding: 0 12px; font-weight: 600; cursor: pointer; flex: none;
}
.cfw-help__close:hover { border-color: var(--accent); color: var(--accent); }
.cfw-help__body { flex: 1 1 auto; overflow-y: auto; padding: 12px 16px 20px; }
.cfw-help__section + .cfw-help__section { margin-top: 20px; }
.cfw-help__h3 { margin: 0 0 8px; font-size: 15px; }
.cfw-help__p { margin: 0 0 10px; line-height: 1.5; }
.cfw-help__ul { margin: 0 0 10px; padding-left: 20px; line-height: 1.5; }
.cfw-help__table { width: 100%; border-collapse: collapse; margin: 0 0 10px; font-size: 14px; }
.cfw-help__table th, .cfw-help__table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line, #dbe2ea); vertical-align: top; }
.cfw-help__table th { font-weight: 700; }
/* Glyph AND words AND a bar — the same warning shape as .cfw-note--warn
   above, never colour alone (the owner is colourblind). */
.cfw-help__note {
  margin: 0 0 10px; padding: 6px 8px;
  color: #7c2d12; background: #fff7ed; border-left: 3px solid #ea580c; border-radius: 6px;
}
/* The trigger button a host tab drops into its own header — sized to the
   44px floor explicitly, rather than relying on .btn's own min-height. */
.cfw-help__btn { min-height: 44px; }
@media (max-width: 480px) {
  .cfw-help__dialog { width: 100%; }
}

/* ── Quote Reports → Quote Conversion (2026-09-29) ──────────────────────
   Each route has its own tint, but is ALWAYS named in words with an icon
   (🏠 Visit · 📞 Direct · 🌐 Online form) — never colour alone. */
.cfw-qc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.cfw-qc-tile { border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.cfw-qc-tile.is-visit { background: #e1f3ec; } .cfw-qc-tile.is-visit .cfw-qc-tile__k { color: #0b6e4f; }
.cfw-qc-tile.is-direct { background: #fbefe0; } .cfw-qc-tile.is-direct .cfw-qc-tile__k { color: #8a4b00; }
.cfw-qc-tile.is-online { background: #efeaf9; } .cfw-qc-tile.is-online .cfw-qc-tile__k { color: #5b3fa0; }
.cfw-qc-tile__k { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.cfw-qc-tile__v { font-size: 24px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.cfw-qc-tile__s { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cfw-qc-table { font-variant-numeric: tabular-nums; font-size: 13px; }
.cfw-qc-table th, .cfw-qc-table td { padding: 8px 8px; }
.cfw-qc-table td, .cfw-qc-table thead tr:last-child th { text-align: right; white-space: nowrap; }
.cfw-qc-table tbody th { text-align: left; font-weight: 600; white-space: nowrap; }
.cfw-qc-grp th { text-align: center; }
.cfw-qc-grp th.is-all { box-shadow: inset 0 3px 0 var(--accent); }
.cfw-qc-grp th.is-visit { box-shadow: inset 0 3px 0 #0b6e4f; }
.cfw-qc-grp th.is-direct { box-shadow: inset 0 3px 0 #8a4b00; }
.cfw-qc-grp th.is-online { box-shadow: inset 0 3px 0 #5b3fa0; }
.cfw-qc-sep { border-left: 1px solid var(--line); }
.cfw-qc-total th, .cfw-qc-total td { font-weight: 700; border-top: 2px solid var(--line); }
.cfw-qc-pct { font-weight: 600; }
.cfw-qc-pct.is-hi { color: #11703f; }
.cfw-qc-pct.is-lo { color: #9a4a00; }
.cfw-qc-dash { color: var(--ink-soft); }
.cfw-qc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.cfw-qc-key { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 18px; font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.cfw-qc-key p { margin: 0; }
.cfw-qc-key b { color: var(--ink); }
/* Click a figure or a coloured box → the quotes behind it (17 Oct 2026).
   Underlined like a link, and the open one is FILLED — never colour alone. */
.cfw-qc-num { font: inherit; color: var(--accent); background: none; border: 0; padding: 3px 6px; margin: -3px -6px; border-radius: 6px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.cfw-qc-num:hover { background: #e8f1f8; }
.cfw-qc-num[aria-pressed="true"] { background: var(--accent); color: #fff; text-decoration: none; }
button.cfw-qc-tile { border: 0; font: inherit; text-align: left; cursor: pointer; width: 100%; }
button.cfw-qc-tile:hover, button.cfw-qc-tile[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.cfw-qc-tile__go { font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 2px; }
.cfw-qc-list { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 12px 0; }
.cfw-qc-list__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cfw-qc-list__title { font-size: 15px; font-weight: 700; margin: 0; }
.cfw-qc-listtable { font-size: 13px; font-variant-numeric: tabular-nums; }
.cfw-qc-listtable th, .cfw-qc-listtable td { padding: 6px 8px; vertical-align: middle; }
.cfw-qc-listtable .is-num { text-align: right; white-space: nowrap; }
.cfw-qc-listtable td:first-child, .cfw-qc-listtable td:nth-child(2) { white-space: nowrap; }
@media print { .cfw-qc-list [data-qc-close], .cfw-qc-list [data-qc-contact], .cfw-qc-tile__go { display: none; } }