/* SM Platform Hub — design tokens and shell.
 *
 * CONTRAST VALUES ARE CORRECTED, NOT COPIED.
 * The first draft of this system was checked by an independent reviewer and three
 * values failed WCAG AA. Each was recomputed before being replaced:
 *   --muted    #6b7280 on #f5f5f6 = 4.44:1  FAILED  ->  #5d6470 = 5.47:1
 *   white on   #ff6210            = 3.00:1  FAILED  ->  --brand-fill #bf4708 = 5.10:1
 *   --line     #e7e7e7 on white   = 1.21:1  too weak to be the only separator
 * Shadows WERE banned on resting surfaces, which made the hairline the only structure
 * in the product and is why --line was strengthened above. That rule was lifted in the
 * Lead Stack redesign: panels now carry --shadow-card as well as a hairline. The
 * hairline stayed rather than being replaced, because shadow alone disappears in
 * forced-colors mode and on low-contrast panels, and the border is what survives there.
 * So elevation is decoration and the hairline is still the structure.
 */

:root {
  /* ── GoStack brand ──────────────────────────────────────────────────────────
     From the brand guide. The neutrals are the five named greys; the twenty
     stack colours are kept as their own tokens because each stack owns one and
     they must not drift into being "some purple".

     Contrast is checked, not assumed. Indigo #6748D9 is 6.0:1 against white, so
     the one hex works as a button fill AND as link text — which is why there is
     no separate darker "ink" variant fighting it. */

  /* neutrals */
  --gs-navy:   #0D1B3D;
  --gs-slate:  #475569;
  --gs-cool:   #E2E8F0;
  --gs-off:    #F8FAFC;

  /* the twenty stack colours */
  --gs-golden: #FFB700;  --gs-mango:      #FF8F3D;
  --gs-melon:  #FF4F7B;  --gs-raspberry:  #E83E8C;
  --gs-orchid: #B65CFF;  --gs-indigo:     #6748D9;
  --gs-royal:  #3F67F2;  --gs-azure:      #2F9BFF;
  --gs-turq:   #12B8B0;  --gs-teal:       #089C91;
  --gs-seafoam:#42D6A4;  --gs-lime:       #78D64B;
  --gs-chart:  #A8D83E;  --gs-apple:      #59C95B;
  --gs-mustard:#D9A21B;  --gs-plum:       #9B4FCC;

  /* surfaces */
  --bg:            var(--gs-off);
  --surface:       #ffffff;
  --surface-sunk:  #f6f8fb;

  /* separators: two weights, because one was doing a job it could not do */
  --line:          var(--gs-cool);
  --line-strong:   #cbd5e1;

  /* text */
  --ink:           #1e293b;
  --ink-strong:    var(--gs-navy);
  --muted:         var(--gs-slate);   /* 7.4:1 on white */

  /* brand: indigo carries fills and text alike at 6.0:1 on white */
  --brand:         var(--gs-indigo);
  --brand-fill:    var(--gs-indigo);
  --brand-hover:   #563bb8;
  --brand-ink:     #5B3FC4;
  --brand-soft:    #f1edfd;
  /* The logo gradient, used on the mark, the login panel and the footer strip. */
  --gs-gradient:   linear-gradient(90deg, #E83E8C 0%, #6748D9 34%, #2F9BFF 66%, #42D6A4 100%);

  /* status */
  --ok:            #067647;  --ok-bg:      #ecfdf3;
  --warn:          #92610a;  --warn-bg:    #fff6e8;
  --bad:           #b42318;  --bad-bg:     #fef3f2;
  /* the blocked state is NOT --muted. It was, in the first draft, which made the
     product's most novel state invisible against secondary text. */
  --blocked:       #5b6478;  --blocked-bg: #eef0f4;

  /* scale */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-6: 24px; --sp-8: 32px; --sp-12: 48px;
  --radius: 8px; --radius-chip: 5px;
  /* Cards are rounder than controls. One radius for both made a 34px button and a
     600px panel look like the same object at different scales. */
  --radius-card: 14px;
  --control: 44px;
  --row: 36px;
  --sidebar: 244px;

  /* Elevation. See the note at the top of this file: resting surfaces used to carry
     no shadow at all. They do now, and the hairline stayed, because dropping the
     border and leaning on shadow alone is what fails in high-contrast mode and on
     the cheap monitors half of these clients use.
     Both values are navy-tinted rather than black: a neutral black shadow over the
     #F8FAFC page reads as grey dirt, not as depth. */
  --shadow-card: 0 1px 2px rgba(13, 27, 61, .04), 0 2px 8px rgba(13, 27, 61, .05);
  --shadow-lift: 0 1px 2px rgba(13, 27, 61, .05), 0 6px 18px rgba(13, 27, 61, .09);
  --shadow-pop:  0 10px 34px rgba(13, 27, 61, .16);

  /* System typography keeps utility screens readable without a remote font request. */
  --display: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --text:    -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--text);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, th, .btn, .group-label { font-family: var(--display); font-weight: 600; }
h1 { font-size: 24px; margin: 0 0 var(--sp-2); letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0 0 var(--sp-2); }
code, .mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }

a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
/* The visited colour is for plain text links. A link that carries a class is a styled
   control (button, tab, card) and sets its own colour. As a blanket a:visited rule this
   out-ranked every single-class button, so a visited "Continue" turned dark red on purple. */
a:where(:not([class])):visited { color: #7a2e04; }
a:is(.pm-button, .ob-send, .identity-submit) { text-decoration: none; }

/* Focus is 2px --brand-ink, not --brand: orange on the page background is 2.75:1,
   under the 3:1 non-text minimum. The offset keeps the ring from merging with an
   input's own border. */
:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; border-radius: 2px; }

/* ── shell ─────────────────────────────────────────────────────────────────── */
/* minmax(0, 1fr), not 1fr. A grid track sized 1fr carries an implicit
   min-width:auto, so it refuses to shrink below the min-content width of what is in it.
   One wide table therefore pushed this column to 1107px inside a 1036px space and the
   whole page scrolled sideways — which is what cut the Open button off the end of every
   row. minmax(0, ...) lets the track be narrower than its content so the overflow lands
   where it can be handled, on the panel, instead of on the document. */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line-strong);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.switcher {
  padding: var(--sp-4); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--sp-2);
}
.switcher .avatar {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 11px; font-weight: 700; color: #fff;
  background: var(--ink-strong);
}
.switcher .name {
  font-family: var(--display); font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; /* real client names overflow 232px */
}
.switcher .chev { margin-left: auto; color: var(--muted); font-size: 11px; }

.nav { padding: var(--sp-3) 0; flex: 1; }
.group-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); padding: var(--sp-4) var(--sp-4) var(--sp-2);
}
.nav a {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  color: var(--ink); text-decoration: none; font-size: 14px;
  border-left: 2px solid transparent;
}
.nav a:visited { color: var(--ink); }
.nav a:hover { background: var(--surface-sunk); }
.nav a.active { background: var(--brand-soft); border-left-color: var(--brand); font-weight: 600; }
.nav a .ext { margin-left: auto; color: var(--muted); font-size: 11px; }

/* A module that is not mounted is text, not a link. Rendering it as an <a> that 404s
   looks navigable and costs a page load to discover otherwise. */
.nav-soon {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-left: 2px solid transparent;
  color: var(--muted); font-size: 14px; cursor: default;
}
.nav-soon .ext {
  margin-left: auto; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--surface-sunk); border: 1px solid var(--line);
  border-radius: var(--radius-chip); padding: 1px 5px;
}

.switcher .avatar.agency { background: var(--brand-fill); }

.sidebar-foot { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); font-size: 12px; }

/* Seed age is a sidebar chip, not a full-width shell banner. A persistent banner
   above <main> would make a stale-data warning the first thing on every screen,
   pushing the actual content to third place. */
.seed-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.seed-chip.warn { color: var(--warn); }
.seed-chip.bad  { color: var(--bad); }

/* ── main ──────────────────────────────────────────────────────────────────── */
main { padding: var(--sp-6) var(--sp-8); max-width: 1240px; }
.page-head { display: flex; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-6); }
/* The context rule: /a/:slug pages carry a brand underline, /agency pages do not.
   Acting on the wrong client is the expensive mistake in an agency product, so the
   two levels must be unmistakable at a glance. */
.page-head.sub h1 { border-bottom: 3px solid var(--brand); padding-bottom: 2px; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: var(--sp-6); margin-bottom: var(--sp-6);
  box-shadow: var(--shadow-card);
}
.panel.state { text-align: left; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line-strong);
}
td { padding: 0 var(--sp-3); height: var(--row); line-height: 1.4; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: var(--surface-sunk); }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control); padding: 0 var(--sp-4);
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  font-size: 14px; cursor: pointer; text-decoration: none;
}
.btn:visited { color: var(--ink); }
.btn:hover { background: var(--surface-sunk); }
.btn-primary { background: var(--brand-fill); border-color: var(--brand-fill); color: #fff; }
.btn-primary:visited { color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

/* A kindless pill had no background at all, so pill('Tier 3') and pill('Rule Miss')
   rendered as bare bold text in a column where their neighbours were chips — which
   reads as a style that failed to load rather than as a deliberate neutral. The base
   now carries a neutral chip and the kinds override it. */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px var(--sp-2); border-radius: var(--radius-chip);
  font-size: 12px; font-weight: 600;
  background: var(--surface-sunk); color: var(--muted);
  border: 1px solid var(--line);
}
.pill.ok, .pill.warn, .pill.bad, .pill.blocked { border-color: transparent; }
.pill.ok      { background: var(--ok-bg);      color: var(--ok); }
.pill.warn    { background: var(--warn-bg);    color: var(--warn); }
.pill.bad     { background: var(--bad-bg);     color: var(--bad); }
/* Blocked carries a lock glyph as well as colour, because colour alone is not a signal
   and grey reads as "disabled" everywhere else on the internet. */
.pill.blocked { background: var(--blocked-bg); color: var(--blocked); }

/* Empty and error states must never look the same. An empty section says "nothing
   here yet"; a failed one says so and offers a retry. */
.state-empty { color: var(--muted); padding: var(--sp-8) 0; }
.state-error {
  border: 1px solid var(--bad); background: var(--bad-bg); color: var(--bad);
  border-radius: var(--radius); padding: var(--sp-4);
}

/* ── login ─────────────────────────────────────────────────────────────────── */
/* .login-wrap and .login are defined with the sign-in design further down. They used
   to live here as `place-items: center`, which stopped the two halves stretching and
   left the brand panel floating in the middle of a white page. */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; height: var(--control); padding: 0 var(--sp-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-family: var(--text); font-size: 14px; background-color: var(--surface); color: var(--ink);
}

/* Show/hide password. The button sits inside the field's border rather than beside it,
   so the control reads as part of the input and the field keeps its full width. */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 62px; }
.password-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  height: 26px; padding: 0 var(--sp-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius-chip);
  background: var(--surface-sunk); color: var(--muted);
  font-family: var(--text); font-size: 12px; font-weight: 600; cursor: pointer;
}
.password-toggle:hover { color: var(--ink); background: var(--surface); }
.password-toggle:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 1px; }
.password-toggle[aria-pressed="true"] { color: var(--brand-ink); border-color: var(--brand-ink); }

/* forms inside panels */
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4); align-items: end; max-width: 900px; }
.form-row button { height: var(--control); }
.field .hint { font-size: 12px; margin-top: 6px; }
.field code { background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius-chip); padding: 1px 4px; }

/* ── images module ─────────────────────────────────────────────────────────── */

/* The preview is the module's whole safety argument: it shows the exact words that
   will be rendered BEFORE a paid call. So it is a real element with a reserved height,
   not a line of muted text that collapses when empty and shifts the form underneath it. */
.preview {
  display: flex; align-items: baseline; gap: var(--sp-2);
  min-height: 30px; margin: calc(var(--sp-2) * -1) 0 var(--sp-4);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-sunk); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 13px;
}
.preview .preview-label { color: var(--muted); flex: none; }
.preview .preview-value { font-weight: 600; color: var(--ink-strong); }
.image-text-preview:not(:has(.preview-value:not(:empty))) { display: none; }

/* Art direction is deliberately styled as NOT-rendered text, so the difference between
   "words in the image" and "instructions about the image" is visible, not just stated. */
.field textarea {
  width: 100%; min-height: 76px; padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-family: var(--text); font-size: 14px; line-height: 1.5;
  background-color: var(--surface); color: var(--ink); resize: vertical;
}
.field select {
  width: 100%; height: var(--control); padding: 0 var(--sp-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-family: var(--text); font-size: 14px; background-color: var(--surface); color: var(--ink);
}
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  outline: 2px solid var(--brand-ink); outline-offset: 1px; border-color: var(--brand-ink);
}

/* Gallery. auto-fill (not auto-fit) so a single image stays card-sized instead of
   stretching across the full panel. */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--sp-4); }
.gallery figure { margin: 0; }
.gallery img {
  display: block; width: 100%; aspect-ratio: 1; object-fit: cover;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface-sunk);
}
.gallery figcaption { font-size: 12px; color: var(--muted); margin-top: var(--sp-2); line-height: 1.5; }

/* The thumbnail is a button, not a div with a click handler: it must be reachable by
   keyboard and announce itself, because opening a preview is a real action. */
.gallery .thumb {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: var(--radius);
}
.gallery .thumb:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
.gallery .thumb:hover img { border-color: var(--brand-ink); }
.gallery .dl { display: inline-block; margin-top: 2px; font-size: 12px; font-weight: 600; }

/* ── lightbox ───────────────────────────────────────────────────────────────
   Dark surround on purpose: these are images destined for a dark social feed, and
   judging them against a white page is judging them in the wrong context. */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-3); padding: var(--sp-4);
  background: rgba(10, 10, 12, .92);
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(92vw, 1024px); max-height: 78vh;
  object-fit: contain; border-radius: var(--radius); background: #000;
}
.lightbox-bar {
  display: flex; align-items: center; gap: var(--sp-4);
  width: min(92vw, 1024px); justify-content: space-between;
}
.lightbox-title { color: #fff; font-family: var(--display); font-weight: 600; font-size: 15px; }
.lightbox-actions { display: flex; gap: var(--sp-2); }
.lightbox-hint { color: #9aa0aa; font-size: 12px; margin: 0; }

/* Asset picker. Thumbnails, not filenames: you are choosing what the model will look
   at, so you have to be able to see it. */
.asset-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--sp-3); }
.asset-pick {
  display: block; position: relative; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: var(--sp-2); background: var(--surface); font-size: 12px;
  transition: border-color .12s ease, background .12s ease;
}
.asset-pick:hover { background: var(--surface-sunk); }
.asset-pick:has(input:checked) { border-color: var(--brand-ink); background: var(--brand-soft); }
.asset-pick:has(input:focus-visible) { outline: 2px solid var(--brand-ink); outline-offset: 1px; }
.asset-pick input { position: absolute; top: var(--sp-2); left: var(--sp-2); margin: 0; }
.asset-pick img {
  display: block; width: 100%; aspect-ratio: 1; object-fit: contain;
  background: var(--surface-sunk); border-radius: var(--radius-chip); margin-bottom: var(--sp-2);
}
.asset-pick .asset-name { display: block; font-weight: 600; color: var(--ink); }
.asset-pick .asset-kind { display: block; text-transform: capitalize; }

/* The "no logo set" placeholder is genuinely inert. */
.asset-pick.locked { cursor: default; background: var(--surface-sunk); border-style: dashed; }
.asset-pick.locked:hover { background: var(--surface-sunk); }
.asset-lock { position: absolute; top: var(--sp-2); left: var(--sp-2); font-size: 13px; line-height: 1; }

/* The logo card IS toggleable, but it is not an ordinary material: it defaults on and
   carries the lock. Its own checkbox is hidden because the lock glyph is the control —
   two controls for one decision reads as a bug. */
.logo-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.logo-pick { border-color: var(--brand-ink); background: var(--brand-soft); }
.logo-pick:has(input:not(:checked)) {
  border-color: var(--line-strong); background: var(--surface-sunk); border-style: dashed;
}
.logo-pick:has(input:not(:checked)) img { opacity: .4; filter: grayscale(1); }
.logo-pick:has(input:not(:checked)) .asset-name { color: var(--muted); }
.logo-pick:has(input:focus-visible) { outline: 2px solid var(--brand-ink); outline-offset: 1px; }
/* Its label is a sentence, not a kind name, so it must not inherit the capitalize
   that turns "Off for this image" into "Off For This Image". */
.logo-pick .asset-kind { text-transform: none; }

.logo-note { display: flex; gap: var(--sp-4); align-items: center; }
.logo-note img {
  width: 64px; height: 64px; object-fit: contain; flex: none;
  background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius);
}
.logo-note p { margin: var(--sp-1) 0 0; font-size: 13px; }

.asset-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.asset-actions form { margin: 0; }
.asset-actions .btn { height: 26px; padding: 0 var(--sp-2); font-size: 12px; }

.gallery figcaption .pill { margin-left: var(--sp-1); }

.field input[type="file"] {
  width: 100%; padding: var(--sp-2); font-family: var(--text); font-size: 13px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-sunk);
}

.job-title { font-weight: 500; }
.job-detail { color: var(--muted); font-size: 13px; }

/* A job in flight is the one moment the user is asked to wait 60-90s. The pulse is
   the signal that work is still happening; without it a slow generation is
   indistinguishable from a hang. Motion drives it when available; this keyframe is
   the no-JS fallback. */
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.pill.running { background: var(--warn-bg); color: var(--warn); animation: pulse-soft 1.6s ease-in-out infinite; }

/* NOTE: [data-enter] elements are deliberately NOT hidden in CSS. Entrance animations
   run from a JS keyframe instead, so a failed or blocked script leaves the content
   visible rather than permanently invisible. Animation is an enhancement; the page must
   be fully usable without it. */

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

/* Logo mode: how the mark gets onto the image. Sits under the picker because it is a
   property of the logo card above it, not a separate setting. */
.logo-mode {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3);
  margin-top: var(--sp-3); font-size: 13px;
}
.logo-mode label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.logo-mode input { margin: 0; }
.logo-mode .hint { flex-basis: 100%; margin: 0; }

/* ── carousel ──────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line-strong); margin-bottom: var(--sp-4); }
.tab {
  appearance: none; border: 0; background: none; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--muted);
  padding: var(--sp-2) var(--sp-3); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink-strong); border-bottom-color: var(--brand); }
.tab:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: -2px; }

.slide-row { display: flex; align-items: flex-start; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.slide-n {
  flex: none; width: 24px; height: var(--control);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.slide-fields { flex: 1; display: grid; gap: var(--sp-1); }
.slide-fields input {
  width: 100%; height: var(--control); padding: 0 var(--sp-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-family: var(--text); font-size: 14px; background-color: var(--surface); color: var(--ink);
}
/* The direction field is visibly secondary: it is guidance, never rendered as words. */
.slide-fields input[name="slideDirection"] {
  height: 28px; font-size: 12.5px; color: var(--muted); background: var(--surface-sunk);
}
.slide-fields input:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 1px; }
.slide-remove { flex: none; width: 30px; height: var(--control); padding: 0; font-size: 16px; line-height: 1; }

/* A carousel is a set, so it is boxed as one thing rather than scattered by timestamp. */
.carousel-set {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: var(--sp-4); margin-bottom: var(--sp-4); background: var(--surface-sunk);
}
.carousel-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }

/* ── trends ──────────────────────────────────────────────────────────────────
   A trend is shown as the REAL post, because the operator is judging an actual
   thing before anything gets generated from it. The card therefore leads with
   the cover image and keeps the evidence — why it qualified, how many posts
   back it, how old it is — visible without a hover or a click. */

.pill.info     { background: var(--brand-soft); color: var(--brand-ink); }
.pill.platform { background: var(--surface-sunk); color: var(--muted);
                 border: 1px solid var(--line); }

.trend-grid {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  margin-bottom: var(--sp-6);
}

.trend-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); overflow: hidden;
}

.trend-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block;
               border-bottom: 1px solid var(--line); background: var(--surface-sunk); }
/* Sources with no image still need the card to keep its shape, but a tall empty
   grey block reads as a broken image, so the placeholder is deliberately short. */
.trend-cover-none { aspect-ratio: auto; height: 4px; border-bottom: 0;
                    background: var(--brand-soft); }

.trend-body { display: flex; flex-direction: column; gap: var(--sp-2);
              padding: var(--sp-4); flex: 1; }

.trend-meta  { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.trend-title { font-size: 15px; line-height: 1.4; margin: 0; font-weight: 600; }
.trend-stats { display: flex; flex-wrap: wrap; gap: var(--sp-3);
               font-size: 12px; color: var(--muted); }
.trend-stat  { white-space: nowrap; }

/* Pushed to the bottom so buttons line up across a row of uneven-height cards. */
.trend-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2);
                 margin-top: auto; padding-top: var(--sp-3); }
.trend-actions .inline { display: inline-flex; gap: var(--sp-1); margin: 0; }

.btn-icon { width: var(--control); padding: 0; font-size: 11px; line-height: 1; }
/* The operator's verdict has to survive a page reload visibly, or they cannot tell
   which ones they have already judged. */
.btn-icon.is-on { background: var(--brand-fill); border-color: var(--brand-fill);
                  color: #fff; }

.run-form { display: flex; align-items: center; justify-content: space-between;
            gap: var(--sp-4); flex-wrap: wrap; margin: 0; }
.run-form .hint { margin: var(--sp-1) 0 0; font-size: 12px; }

.form-grid { display: flex; flex-direction: column; gap: var(--sp-4); }
.form-grid label { display: flex; flex-direction: column; gap: var(--sp-1);
                   font-weight: 600; font-size: 13px; }
.form-grid label small { font-weight: 400; }
.form-grid textarea, .form-grid input[type="number"] {
  font: inherit; padding: var(--sp-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
.form-grid fieldset { border: 1px solid var(--line); border-radius: var(--radius);
                      padding: var(--sp-3); display: flex; flex-direction: column;
                      gap: var(--sp-2); }
.form-grid legend { font-weight: 600; font-size: 13px; padding: 0 var(--sp-1); }

.check { display: flex; flex-direction: row !important; align-items: center;
         gap: var(--sp-2); font-weight: 400 !important; }
.check input { width: auto; }

/* Count beside each trend tab, so where the material is shows without clicking. */
.tab-count {
  display: inline-block; margin-left: var(--sp-1);
  padding: 0 6px; border-radius: 10px;
  background: var(--surface-sunk); border: 1px solid var(--line);
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.tab.active .tab-count { background: var(--brand-soft); border-color: var(--brand-soft);
                         color: var(--brand-ink); }

/* Observations drawn from the operator's own ratings. Deliberately plain: it is a
   prompt to think, not a system announcement. */
.feedback-notes { margin: var(--sp-2) 0 var(--sp-3); padding-left: var(--sp-4); }
.feedback-notes li { margin-bottom: var(--sp-2); line-height: 1.5; }

/* ── narrow screens ───────────────────────────────────────────────────────────
   The layout was a fixed sidebar column plus content with no breakpoint at all,
   so at 375px the page was 626px wide and scrolled sideways. This is a console
   people mostly use on a desktop, but a QA pass on a phone should not be the
   thing that discovers it does not fit. */
@media (max-width: 720px) {
  /* Sidebar above content instead of beside it. */
  .app { grid-template-columns: 1fr; }

  /* A grid child defaults to min-width:auto, so one wide descendant — the jobs
     table, a long select — forces the whole column open and takes the page with
     it. This is what actually made the page 766px wide at a 375px viewport;
     stacking the sidebar alone did not fix it. */
  .app > * { min-width: 0; }
  .sidebar { position: static; height: auto; border-right: 0;
             border-bottom: 1px solid var(--line-strong); }
  .nav { display: flex; flex-wrap: wrap; gap: var(--sp-1); padding: var(--sp-2) var(--sp-3); }
  .nav a { padding: var(--sp-2) var(--sp-3); }
  /* Section headings inside the nav make no sense once it is a wrapped row: as flex
     items they sit BETWEEN the links, so "Delivery" reads as a nav item wedged between
     Overview and Images.

     This rule already existed and targeted `.nav-section`, a class the markup has never
     emitted — the shell writes `.group-label`. So it matched nothing and the headings
     shipped inline on every phone. Same shape as the SEO fix-button bug: a rule keyed on
     a name that does not exist does nothing, and reads as correct. */
  .nav .group-label { display: none; }

  /* .row is a no-wrap flex utility used 23 times across leads, email, seo and utm.
     The leads filter bar puts seven controls in one, which ran to 748px at a 390px
     viewport and scrolled the whole page sideways — the same class of bug the comment
     above says was fixed once already, arriving through a different door.

     Wrapping is forced here rather than by adding `.row.wrap` at each call site: the
     modifier exists but every future .row would have to remember it, and forgetting is
     exactly what happened. Desktop is untouched — this only applies under 720px. */
  .row { flex-wrap: wrap; }

  main { padding: var(--sp-4) var(--sp-3); max-width: 100%; }

  /* One card per row: two columns of trend cards at this width leaves neither
     readable. */
  .trend-grid, .gallery { grid-template-columns: 1fr; }

  /* Tables are the one thing that genuinely cannot reflow, so they scroll inside
     themselves rather than making the whole page scroll. */
  table { display: block; overflow-x: auto; white-space: nowrap; max-width: 100%; }

  /* Anything else that refuses to shrink: media, code, long unbroken strings. */
  img, video, canvas, pre, code { max-width: 100%; }
  .panel, .card, main > section { max-width: 100%; overflow-wrap: anywhere; }

  .page-head { flex-wrap: wrap; }
  .run-form { flex-direction: column; align-items: flex-start; }
}

/* A page's in-body title. It is an h2 because the shell already emits the page h1 —
   two h1s break the document outline for anyone navigating by heading — but it should
   still read as the page heading. */
.page-title { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }

/* ─────────────────────────────────────────────────────────────────────────────
   Blog module surfaces.

   apps/hub/views/blog/ was written against these class names but they were never
   added here, so the module rendered as unstyled markup: the tab strip ran together
   as one word ("QueuePostsKeywordsDesign…"), tables had no rules, and every panel
   sat flat on the page. Everything below uses the existing tokens — this is the
   same light system as the rest of the hub, not a second theme.
   ──────────────────────────────────────────────────────────────────────────── */

/* Section tabs within a module. Distinct from the sidebar: these switch a view,
   they do not navigate the product. */
.subtabs {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin: 0 0 var(--sp-6); padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.subtab {
  display: inline-flex; align-items: center; height: 32px; padding: 0 var(--sp-3);
  border-radius: var(--radius-chip); border: 1px solid transparent;
  font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none;
  white-space: nowrap;
}
.subtab:visited { color: var(--muted); }
.subtab:hover { background: var(--surface-sunk); color: var(--ink); }
/* The current tab is carried by weight + fill + aria-current, never colour alone. */
.subtab.is-on {
  background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink);
}
.subtab.is-on:visited { color: var(--brand-ink); }

/* A panel. Groups one idea; the page is a stack of these. */
.card {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: var(--sp-6); margin: 0 0 var(--sp-6);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

/* Data tables. Left-aligned by default; .right for a trailing actions column. */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
  padding: var(--sp-3) var(--sp-2); text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.table th {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-sunk); }
.right { text-align: right; }
/* Several actions in one cell must sit on one line, not stack into a tower. */
.table td.right { white-space: nowrap; }
.table td.right form { display: inline-block; margin-left: var(--sp-2); }

/* Status and result bars. Errors get role="alert" in the markup. */
.notice {
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface-sunk);
  margin: 0 0 var(--sp-4); font-size: 14px;
}
.notice.ok    { background: var(--ok-bg);   border-color: var(--ok);   color: var(--ok); }
.notice.warn  { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.notice.error { background: var(--bad-bg);  border-color: var(--bad);  color: var(--bad); }
/* An alias, because one route emitted 'bad' - the status-token name rather than the
   notice-kind name - and its emergency-stop confirmation rendered as a plain grey box.
   The route was fixed to say 'warn'; this makes sure the next 'bad' is loud anyway. */
.notice.bad   { background: var(--bad-bg);  border-color: var(--bad);  color: var(--bad); }

/* "Nothing here yet" — deliberately not the same treatment as a failure. */
.empty {
  color: var(--muted); font-size: 14px; padding: var(--sp-8) var(--sp-4);
  text-align: center; background: var(--surface-sunk);
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
}

/* The counts strip above a list: how much work is waiting, at a glance. */
.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px; background: var(--line-strong);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  overflow: hidden; margin: 0 0 var(--sp-6);
}
.stat-cell { background: var(--surface); padding: var(--sp-4); text-align: center; }
.stat-num { display: block; font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--ink-strong); }
.stat-num.ok { color: var(--ok); } .stat-num.warn { color: var(--warn); } .stat-num.bad { color: var(--bad); }
.stat-label {
  display: block; margin-top: var(--sp-1); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}

/* Layout and variant helpers the blog views use. Same omission as the block above:
   the markup referenced them, the stylesheet never defined them. */

/* A horizontal row; `between` pushes the last child to the far edge. */
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row.between { justify-content: space-between; }
/* A vertical stack with consistent rhythm. */
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }

/* Button variants. Without these every button rendered at one size, so a row of
   table actions carried the same visual weight as a page's primary action. */
.btn-sm { height: 28px; padding: 0 var(--sp-3); font-size: 13px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:visited { color: var(--muted); }
.btn-ghost:hover { background: var(--surface-sunk); border-color: var(--line-strong); color: var(--ink); }

/* Secondary text inside a cell — a meta description under an article title. */
.small { font-size: 12px; line-height: 1.45; }

/* A panel holding a destructive action. The red edge is a warning, so it is a border
   and a heading, never colour on its own. */
.card.danger { border-color: var(--bad); }
.card.danger h2, .card.danger h3 { color: var(--bad); }

/* Design tab: the brand colour tokens, shown as a swatch per colour. */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); }
.swatch { display: flex; align-items: center; gap: var(--sp-2); font-size: 13px; }
.swatch code { font-size: 12px; }
/* The colour itself is set inline from the token; the border keeps a white or very
   pale swatch from vanishing into the panel. */
.chip {
  width: 22px; height: 22px; flex: none; border-radius: 5px;
  border: 1px solid var(--line-strong);
}

/* ── Keyword research ───────────────────────────────────────────────────────
   Summary cards, the 12-month trend, and the four idea boxes. Grid rather than
   flex so boxes stay aligned when one bucket is empty and another is long. */
.row.wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--sp-2); }

.kw-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1px; background: var(--line-strong);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  overflow: hidden; margin-top: var(--sp-4);
}
.kw-card { background: var(--surface); padding: var(--sp-4); min-height: 128px; }
.kw-card-h {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: var(--sp-2);
}
.kw-big {
  font-size: 28px; font-weight: 700; line-height: 1.15;
  font-variant-numeric: tabular-nums; color: var(--ink-strong);
}
.kw-big .pill { vertical-align: middle; margin-left: var(--sp-2); }
.kw-intent { font-size: 17px; font-weight: 600; text-transform: capitalize; color: var(--brand-ink); }

.kw-spark { display: block; width: 100%; height: 54px; margin-top: var(--sp-2); }
.kw-spark-fill { fill: var(--brand-soft); stroke: none; }
.kw-spark-line {
  fill: none; stroke: var(--brand); stroke-width: 2;
  stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.kw-spark-axis {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--muted); margin-top: 2px;
}

.kw-ideas {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: var(--sp-4); margin-top: var(--sp-3);
}
.kw-idea-box {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: var(--sp-2); background: var(--surface);
}
.kw-idea-box .table { font-size: 13px; }
.kw-idea-box .table tr:last-child td { border-bottom: 0; }

/* The number leads and the colour supports it, so the column stays scannable
   when every row falls in the same band. */
.kw-diff { font-weight: 700; font-variant-numeric: tabular-nums; }
.kw-diff.ok   { color: var(--ok); }
.kw-diff.warn { color: var(--warn); }
.kw-diff.bad  { color: var(--bad); }

/* ── UTM builder ────────────────────────────────────────────────────────────
   The preview is the whole point of the page: it shows the exact campaign name and
   URL that will be saved, built by the same module the server uses. Stacked rather
   than the single-line .preview used elsewhere, because a tracking URL is long and
   wrapping it beats truncating something somebody is about to paste into an email. */
.utm-preview {
  display: block; margin: 0 0 var(--sp-4);
  padding: var(--sp-3); background: var(--surface-sunk);
  border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px;
}
.utm-preview p { margin: 0 0 var(--sp-1); }
.utm-preview code { font-weight: 600; color: var(--ink-strong); }

/* Long, unbreakable strings. Anywhere a full tracking URL is shown. */
.utm-url {
  display: block; width: 100%; font-family: var(--mono, monospace); font-size: 12px;
  word-break: break-all; overflow-wrap: anywhere; line-height: 1.5;
}
textarea.utm-url {
  padding: var(--sp-2); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-strong); resize: vertical;
}

/* An approved value, with its remove control attached. Not .chip — that is a 22px
   colour swatch belonging to the brand palette. */
.utm-values { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-3) 0; }
.utm-value {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 3px 4px 3px 10px; border: 1px solid var(--line-strong);
  border-radius: 999px; background: var(--surface); font-size: 12.5px;
  font-family: var(--mono, monospace);
}
.utm-value .btn-icon {
  width: 20px; height: 20px; border-radius: 999px; opacity: 0.5;
}
.utm-value .btn-icon:hover { opacity: 1; border-color: var(--bad); color: var(--bad); }

/* A form that sits inside another element's line, e.g. the × on a value. */
.utm-inline { display: inline-flex; margin: 0; }

/* ── Approval cards ───────────────────────────────────────────────────────────
   A review card carries the work itself, so the layout has one job: let a person read
   the thing and decide. Three rules came out of looking at nine of them on one page.

   The title is a heading, not bold body text — with nine cards, the eye needs somewhere
   to land. The meta is one line rather than three stacked grey paragraphs. And Approve
   is the only filled button, because three buttons of equal weight is not a choice, it
   is a puzzle.

   Note the class name: `.preview` was already taken by the Images module, where it is a
   baseline-aligned flex row for a label and a value. Reusing it laid every block element
   out as a flex item, which is how a title came to wrap one word per line beside a 640px
   image. */
.approval {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.approval:last-child { margin-bottom: 0; }

/* Campaign Intelligence and Recommendations use the same card shape (views/email.js).
   Sharing the rules keeps one card design rather than two that drift apart. */
.rec {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.rec:last-child { margin-bottom: 0; }
.rec-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-2);
}
.rec-head strong { font-size: 15px; color: var(--ink-strong); }
.rec p { margin: 0 0 var(--sp-2); }
.rec p:last-child { margin-bottom: 0; }
/* Anything that goes out on its own gets an edge you can find while scrolling. */
.approval.is-timed { border-left: 3px solid var(--warn); }

.approval-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-3); margin-bottom: var(--sp-3);
}
.approval-head h3 {
  margin: 0; font-size: 16px; line-height: 1.35; color: var(--ink-strong);
}
.approval-tags { display: flex; gap: 6px; flex: none; }

.approval-meta-line { margin: var(--sp-3) 0 0; color: var(--muted); }
.approval-meta-line strong { color: var(--ink); }
.approval-meta-line .sep { opacity: 0.5; margin: 0 2px; }
.approval-history { margin: 4px 0 0; }

.approval-actions {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  margin: var(--sp-3) calc(var(--sp-4) * -1) calc(var(--sp-4) * -1);
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--line);
  background: var(--surface-sunk);
  border-radius: 0 0 var(--radius) var(--radius);
}
.approval-note {
  flex: 1 1 240px; min-width: 0; padding: 6px var(--sp-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font: inherit; font-size: 13px; background: var(--surface);
}

.approval-preview {
  display: grid; grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--sp-4); align-items: start;
  margin: var(--sp-3) 0;
}
.approval-preview.is-stacked { grid-template-columns: minmax(0, 1fr); }

/* Capped, cropped and never taller than the text beside it. */
.approval-media img {
  display: block; width: 220px; height: 150px; object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-sunk);
}
/* Social is the exception: there the picture IS the thing being judged. */
.approval-preview.is-media .approval-media img {
  width: 100%; max-width: 420px; height: auto; max-height: 320px; object-fit: contain;
}
.approval-body { min-width: 0; }
.approval-body h3 { margin: 0 0 var(--sp-1); font-size: 15px; line-height: 1.35;
                    color: var(--ink-strong); }
.approval-body p { margin: 0 0 var(--sp-2); }
.approval-body .table { margin-bottom: var(--sp-3); }

/* The rendered body, contained. The sandbox attribute does the safety work; this only
   stops a long article from running down the page forever. */
.approval-frame {
  display: block; width: 100%; height: 260px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.email-body p { margin: 0 0 var(--sp-2); }

.approval-warnings { margin: var(--sp-2) 0 0; padding-left: var(--sp-4); }
.approval-warnings li { color: var(--bad); margin-bottom: 2px; }

@media (max-width: 760px) {
  .approval-preview { grid-template-columns: minmax(0, 1fr); }
  .approval-media img { width: 100%; height: auto; max-height: 220px; }
}

/* The hero watermark is decoration, and at 390px it was taking half the row — the
   sentence that actually says how many stacks are live got squeezed into a column six
   words wide. Decoration does not get to win that trade. */
@media (max-width: 640px) {
  .hero { padding: var(--sp-4) var(--sp-4); }
  .hero-mark { display: none; }
  .hero-title { font-size: 22px; }
}

/* The card head already carries the subject, so the detail rows are the things it does
   not say: what lands in the inbox preview, and where the button actually goes. A table
   for two rows was heavier than the content it held. */
.approval-meta {
  display: grid; grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px var(--sp-3); margin: 0 0 var(--sp-3); font-size: 13px;
}
.approval-meta dt { color: var(--muted); }
.approval-meta dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
/* The body is the thing being approved, so it is set to be read: full size, generous
   leading, and a measure that stops at about 68 characters. At 13px in a 900px column it
   was technically present and practically skipped. */
.email-body {
  border-left: 2px solid var(--line);
  padding-left: var(--sp-3);
  max-width: 68ch;
}
.email-body p { font-size: 14px; line-height: 1.65; color: var(--ink); margin: 0 0 var(--sp-2); }
.email-body p:last-child { margin-bottom: 0; }
.email-body .muted, .email-body em { color: var(--muted); }

/* ── GoStack identity ─────────────────────────────────────────────────────────
   The wordmark is two-tone by definition: "Go" takes the ink of wherever it sits,
   "Stack" is always indigo. That split IS the wordmark, so it is expressed here
   once rather than being re-picked per page. */
.gs-lockup { display: inline-flex; align-items: center; gap: 10px; }
.gs-lockup.is-stacked { flex-direction: column; gap: var(--sp-3); text-align: center; }
.gs-mark { flex: none; display: block; }
.gs-words { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.gs-name {
  font-family: var(--display); font-weight: 700; font-size: 19px;
  letter-spacing: -0.02em; color: var(--gs-navy);
}
.gs-name-accent { color: var(--gs-indigo); }
.gs-tagline {
  font-family: var(--display); font-size: 8.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
  margin-top: 3px; white-space: nowrap;
}
/* On the dark login panel the wordmark inverts, but "Stack" keeps its indigo — it
   is lifted so it stays legible on navy rather than being swapped for white. */
.on-dark .gs-name { color: #fff; }
.on-dark .gs-name-accent { color: #B9A5FF; }
.on-dark .gs-tagline { color: rgba(255,255,255,0.62); }

/* The gradient rule from the brand sheet, used as a hairline rather than a slab. */
.gs-rule { height: 3px; border: 0; margin: 0; background: var(--gs-gradient); }

/* ── Sign in ──────────────────────────────────────────────────────────────────
   The first screen anybody sees, so it is the one place the brand runs at full
   strength: the gradient, the mark at size, the promise. The right half stays a
   plain white form, because a login that is hard to read is not a brand asset. */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--surface);
}
.login-brand {
  display: flex; flex-direction: column; justify-content: center; gap: var(--sp-6);
  padding: var(--sp-12);
  color: #fff;
  background:
    radial-gradient(120% 90% at 12% 8%, rgba(232,62,140,0.42) 0%, rgba(232,62,140,0) 55%),
    radial-gradient(110% 80% at 88% 92%, rgba(47,155,255,0.40) 0%, rgba(47,155,255,0) 58%),
    linear-gradient(155deg, #1a1147 0%, var(--gs-navy) 62%, #071026 100%);
}
.login-pitch {
  font-family: var(--display); font-size: 34px; font-weight: 700;
  line-height: 1.15; letter-spacing: -0.02em; margin: 0; color: #fff;
}
.login-pitch em {
  font-style: normal;
  background: linear-gradient(90deg, #FF4F7B 0%, #B65CFF 52%, #2F9BFF 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-points {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6);
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.86);
}
.login-points li { display: flex; align-items: center; gap: 8px; }
.login-points li::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gs-seafoam); flex: none;
}

.login {
  align-self: center; justify-self: center;
  width: 100%; max-width: 380px; padding: var(--sp-8);
  background: none; border: 0;
}
.login h1 { font-size: 28px; margin-bottom: var(--sp-1); }
.login-sub { margin: 0 0 var(--sp-6); }
.login-mobile-brand { display: none; margin-bottom: var(--sp-6); }
.login-rule { margin-top: var(--sp-6); border-radius: 2px; }
.btn-lg { height: 42px; font-size: 15px; }

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-mobile-brand { display: block; }
}

/* ── Branded sidebar ──────────────────────────────────────────────────────────
   The lockup sits above the client switcher: product first, then which client you
   are inside. The tagline is dropped here — at 244px beside a 26px mark it clipped,
   and a clipped tagline is worse than none. */
.sidebar-brand {
  display: block; padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--line); text-decoration: none;
}
.sidebar-brand:hover { background: var(--surface-sunk); }

.nav-icon { flex: none; opacity: 0.72; }
.nav a, .nav-soon { display: flex; align-items: center; gap: 10px; }
.nav a { color: var(--ink); text-decoration: none; border-radius: var(--radius); }
.nav a:hover { background: var(--surface-sunk); }
/* The active item is a filled indigo pill rather than a left bar: it is the one
   thing on the page that should read as "you are here" at a glance. */
.nav a.active {
  background: var(--brand-fill); color: #fff; font-weight: 600;
  box-shadow: 0 1px 2px rgba(103,72,217,0.28);
}
.nav a.active .nav-icon { opacity: 1; }
.nav a, .nav-soon { margin: 1px var(--sp-2); padding: 7px var(--sp-3); }
.nav-soon .nav-icon { opacity: 0.45; }

/* ── Client dashboard ─────────────────────────────────────────────────────────
   The brand's hero treatment, used once at the top rather than on every panel.
   Below it the page goes quiet on purpose: gradients are for the login, numbers
   are for the dashboard. */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6);
  padding: var(--sp-6) var(--sp-8);
  border-radius: var(--radius); margin-bottom: var(--sp-4);
  color: #fff; overflow: hidden; position: relative;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(232,62,140,0.38) 0%, rgba(232,62,140,0) 60%),
    linear-gradient(120deg, #241a5c 0%, var(--gs-navy) 70%);
}
.hero-title { font-size: 26px; margin: 0 0 6px; color: #fff; letter-spacing: -0.02em; }
.hero-sub { margin: 0; color: rgba(255,255,255,0.82); font-size: 14px; max-width: 62ch; }
.hero-sub strong { color: #fff; }
/* The stacked plates from the mark, blown up as a watermark. */
.hero-mark {
  flex: none; width: 128px; height: 96px; opacity: 0.5;
  background:
    linear-gradient(90deg, transparent 0 8%, var(--gs-turq) 8% 92%, transparent 92%) center 8px/100% 10px no-repeat,
    linear-gradient(90deg, transparent 0 6%, var(--gs-indigo) 6% 94%, transparent 94%) center 30px/100% 10px no-repeat,
    linear-gradient(90deg, transparent 0 4%, var(--gs-azure) 4% 96%, transparent 96%) center 52px/100% 10px no-repeat,
    linear-gradient(90deg, transparent 0 6%, var(--gs-seafoam) 6% 94%, transparent 94%) center 74px/100% 10px no-repeat;
}

.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4); margin-bottom: var(--sp-4);
}
.stat-card {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--sp-4);
}
.stat-card:hover { border-color: var(--brand); }
.stat-card-label { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.stat-card-num {
  font-family: var(--display); font-size: 30px; font-weight: 700;
  color: var(--ink-strong); line-height: 1.1; letter-spacing: -0.02em;
}
.stat-card-hint { font-size: 12px; color: var(--muted); }

.stacks { list-style: none; margin: var(--sp-3) 0 0; padding: 0; }
.stack {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px 0; border-top: 1px solid var(--line);
}
.stack:first-child { border-top: 0; }
.stack-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.stack-name { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.stack-name a { font-weight: 600; text-decoration: none; }
.stack-does { font-size: 12px; color: var(--muted); }

.attention { list-style: none; margin: 0; padding: 0; }
.attention li {
  display: flex; align-items: baseline; gap: var(--sp-2);
  padding: 8px 0; border-top: 1px solid var(--line);
}
.attention li:first-child { border-top: 0; }
.attention a { font-weight: 600; }

/* ── Report figures ───────────────────────────────────────────────────────────
   Every tile carries its source and either its comparison or the reason it has
   none. A figure with no provenance on a client-facing report is a figure nobody
   can defend in the meeting where it gets questioned. */
.metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--sp-3); margin-top: var(--sp-3);
}
.metric {
  display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--sp-3); background: var(--surface);
}
/* A source that could not be read is visibly different from one reporting a zero. */
.metric.is-dark { background: var(--surface-sunk); border-style: dashed; }
.metric-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.metric-value {
  font-family: var(--display); font-size: 26px; font-weight: 700;
  color: var(--ink-strong); line-height: 1.15;
}
.metric.is-dark .metric-value { color: var(--muted); }
.metric-foot { font-size: 12px; color: var(--muted); }
.metric-why { color: var(--bad); }
.metric-source {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-top: 4px;
}

/* An issue with no Fix button says why, so it reads as a considered answer rather
   than as a broken row. */
.issue-why { margin: var(--sp-2) 0 0; padding-left: var(--sp-3);
             border-left: 2px solid var(--line); }

/* The campaign progress bar. views/campaign.js has rendered .bar/.bar-fill since the
   module shipped and neither existed here, so the bar drew as nothing — a progress
   indicator that silently indicated no progress. Same class of defect as the subtab
   above: markup naming one thing, the stylesheet naming another. */
/* Inside a table cell the bar is a second line under the fraction, so it needs a
   width and a little air; everywhere else it fills its container as before. */
td > .bar { max-width: 120px; margin-top: 5px; }
.bar {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: var(--surface-sunk); border: 1px solid var(--line);
}
.bar-fill {
  height: 100%; background: var(--brand-fill); border-radius: 999px;
  transition: width 160ms ease;
}

/* ── Navigation: disclosure, filter, and hit targets ──────────────────────────
   Rebuilt after a design review against Apple's HIG and Google's Material
   research. Three findings drove it:

   1. Thirteen destinations with no way to filter. HIG (search fields): "Include
      search at top of sidebar when filtering content or navigation there."
   2. On a phone the sidebar stacks ABOVE the content, so an always-open list was
      a 440px wall you scrolled past on every page before reaching anything. HIG
      (layout): position the most important items near the top.
   3. Nav rows were ~34px tall. HIG (accessibility) puts the default hit target at
      44x44pt, with 28 the floor. */

.nav-wrap { border: 0; }
.nav-wrap > summary {
  display: none;                       /* desktop: the list is simply always there */
  align-items: center; gap: 10px;
  padding: var(--sp-3) var(--sp-4);
  font-weight: 600; cursor: pointer;
  border-bottom: 1px solid var(--line);
  list-style: none; min-height: 44px;
}
.nav-wrap > summary::-webkit-details-marker { display: none; }
.nav-wrap > summary:hover { background: var(--surface-sunk); }
.burger {
  width: 16px; height: 2px; background: currentColor; border-radius: 2px;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

.nav-filter { padding: var(--sp-2) var(--sp-3) 0; }
.nav-filter input {
  width: 100%; min-height: 36px; padding: 6px var(--sp-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13px;
}
.nav-filter input::placeholder { color: var(--muted); }

/* Screen-reader-only, for the filter's label. A placeholder is not a label. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* HIG default hit target. 7px padding on a 20px line came to ~34px. */
.nav a, .nav-soon { min-height: 44px; padding: 10px var(--sp-3); }
.nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Structural links vs prose links ──────────────────────────────────────────
   A client name in a table and a word in a sentence are not the same object, and
   styling both as underlined browser-blue made every list read like a 1998
   document. Rows, cards and list items are already identifiable as targets by
   their position; they underline on hover, which keeps the affordance without
   the noise. Prose links keep their underline, because there position tells you
   nothing.

   :visited is reset here too. The default rule recoloured client names a muddy
   brown once opened, which read as a state the product does not have. */
/* Keyed on td rather than .table: half the tables in this hub are plain <table>
   with no class, so a .table-only rule left client names underlined browser-blue on
   the one page an operator opens first. */
td a, .stacks a, .attention a, .stat-card, .nav a, .sidebar-brand {
  text-decoration: none;
}
td a:hover, .stacks a:hover, .attention a:hover { text-decoration: underline; }
td a:visited, .stacks a:visited, .attention a:visited { color: var(--brand-ink); }

/* ── Stack state ─────────────────────────────────────────────────────────────
   The dot was the stack's own brand colour — ten hues down the list, carrying no
   information while looking exactly like a status light. Now it is one, and it
   agrees with the badge. The badge keeps its words: colour is never the only
   carrier of meaning (HIG, accessibility). */
.stack.is-live    .stack-dot { background: var(--ok); }
.stack.is-standby .stack-dot { background: var(--warn); }
.stack.is-missing .stack-dot { background: var(--line-strong); }
.stack-unbuilt { font-weight: 600; color: var(--muted); }
.stack.is-missing .stack-does { color: var(--line-strong); }

/* The label above a headline number is a caption, not a highlight. It used to be
   printed in one of four unrelated brand colours. */
.stat-card-label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

@media (max-width: 720px) {
  /* The disclosure does the compacting now, so the open list can be a normal
     vertical menu again — which is what it should always have been. The previous
     wrapped-row treatment existed only to make an always-open list shorter, and it
     cost the group headings (they became flex items reading as nav entries). */
  .nav-wrap > summary { display: flex; }
  .nav { display: block; padding: var(--sp-2) 0 var(--sp-3); }
  .nav .group-label { display: block; }
  .nav a, .nav-soon { margin: 1px var(--sp-2); }
}

/* An unbuilt stack still has to fit in the sidebar.
   "Press Stack" plus a NOT BUILT badge overflowed a 200px column: the label
   truncated to "Press Engi…" and the badge wrapped onto two lines, which made the
   one item nobody can click the tallest thing in the menu.
   The nav icon goes — it was the generic fallback glyph on all three unbuilt items,
   so it carried nothing — and a small muted dot takes its place, which also reads
   the three as a set. The badge keeps its words: dimming alone is not a label. */
.nav-soon { color: var(--muted); }
.nav-soon .nav-icon { display: none; }
.nav-soon::before {
  content: ''; flex: none; width: 8px; height: 8px; margin: 0 4px;
  border-radius: 50%; background: var(--line-strong);
}
.nav-soon .nav-text { flex: 1 1 auto; }
.nav-soon .ext {
  flex: none; margin-left: auto; white-space: nowrap;
  font-size: 10px; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--muted);
}

/* The status dot is a graphic, not text, so it needs 3:1 rather than 4.5:1 — but
   --warn is #92610a, picked to be readable as TEXT on white, and at 10px square it
   reads olive-brown rather than amber. A dot that does not look like the state it
   names is a dot doing nothing. */
:root { --dot-standby: #D97706; }   /* 3.4:1 on white — amber, and legibly so */
.stack.is-standby .stack-dot { background: var(--dot-standby); }

/* On a phone the sidebar footer was still above the fold on every page: the back
   link, the seed chip, the signed-in address and a full-width Sign out button, all
   stacked between the menu and the actual content. Collapsing the nav alone got the
   content from 440px down to 336px; folding the footer into the same disclosure gets
   it to roughly the height of the header, which is where it belongs.
   These are siblings of .nav-wrap in the DOM, so [open] ~ reaches them without any
   extra markup or script. */
@media (max-width: 720px) {
  .sidebar-foot { display: none; }
  .nav-wrap[open] ~ .sidebar-foot { display: block; }
}

/* Standing status, not an alert. Separated from the attention heading because the
   two answer different questions and read as a contradiction when stacked. */
.outbound-status {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  margin-top: var(--sp-3); padding-top: var(--sp-3);
  border-top: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.outbound-status .pill { flex: none; }

/* ── Article design preview ───────────────────────────────────────────────────
   The window you judge a client's article design in, so it has to be big enough
   to actually judge one.

   It used to carry class="preview", which belongs to the Images module and styles
   a single-line text row: display:flex, min-height:30px, 13px font. An iframe
   given that inherits a flex context it cannot use and no dimensions at all, so it
   fell back to the browser's default replaced-element size — 300x150. Rendered:
   326x168 inside a 972px panel, showing the hero badge and half a headline before
   clipping mid-word.

   Height is explicit because an iframe has no content-driven height; `resize`
   lets somebody drag it taller, since articles differ in length and a fixed
   porthole is the problem this is fixing. */
.article-preview {
  display: block;
  width: 100%;
  height: 760px;
  min-height: 320px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;        /* the article paints its own surface; this is the gutter */
}

@media (max-width: 720px) {
  /* Shorter on a phone so the preview does not become the whole page, but still
     several times the 168px it was. */
  .article-preview { height: 520px; }
}

/* ── dialog ─────────────────────────────────────────────────────────────────
   Native <dialog>, used by the Add-an-ICP flow. Chosen over the .lightbox
   pattern above because showModal() brings focus trapping, Escape-to-close and
   a backdrop for free; the lightbox exists to show pictures and predates
   <dialog> being safe to rely on. */
dialog.dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 1.25rem 1.5rem;
  width: min(46rem, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}
dialog.dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog.dialog h2 { margin-top: 0; }
dialog.dialog label { display: block; margin: 0.75rem 0 0.25rem; }
dialog.dialog input[type="text"],
dialog.dialog textarea { width: 100%; }

/* ── form controls ───────────────────────────────────────────────────────────
   Base rules for bare input / select / textarea.

   The stylesheet styled .btn and it styled controls inside .field, and nothing
   else. Of the 165 form controls across the views, 45 sat in a .field. The other
   120 rendered as raw browser chrome: monospace textareas at their default
   2-row size, native select arrows, and heights that did not line up with the
   button standing next to them. On a filter bar that put four different box
   shapes in one row.

   These use the same tokens as .btn — --control for height, --radius, and
   --line-strong for the border — so a control and a button in the same row are
   the same object. .field's own rules are more specific and still win, so the
   image and blog modules are untouched. */

input, select, textarea { font-family: var(--text); font-size: 14px; color: var(--ink); }

/* Everything that is a box you type or choose in. Checkboxes, radios and file
   inputs are not: they are listed out because giving a checkbox a 34px height
   and a text padding turns it into a grey rectangle. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
select,
textarea {
  height: var(--control);
  padding: 0 var(--sp-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  max-width: 100%;
}

textarea {
  display: block;
  width: 100%;
  height: auto;
  min-height: 96px;
  padding: var(--sp-2) var(--sp-3);
  line-height: 1.5;
  resize: vertical;
}

/* The native arrow is drawn by the platform, at a size and inset the border-box
   knows nothing about, which is why an unstyled select never sits level with the
   input beside it. Replaced with one chevron that is the same everywhere. */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: calc(var(--sp-3) + 16px);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%235d6470' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  cursor: pointer;
  /* A select is as wide as its longest option, so one long ICP name stretched a
     filter bar across the page. Capped, not truncated: .field select opts out. */
  max-width: 18rem;
}
.field select, .form-grid select { max-width: none; }

::placeholder { color: var(--muted); opacity: 1; }

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 1px;
  border-color: var(--brand-ink);
}

input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-sunk); color: var(--muted); cursor: not-allowed;
}

input[type="checkbox"], input[type="radio"] {
  width: 15px; height: 15px; margin: 0;
  accent-color: var(--brand-fill); cursor: pointer; flex: none;
}

/* Same treatment .field already gave file inputs: a dashed drop-target rather
   than a bare OS button floating with no box around it. */
input[type="file"] {
  padding: var(--sp-2);
  font-size: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-sunk);
  max-width: 100%;
}

/* A label wrapping its own control — "Find up to [ 1000 ] people" — was laying
   out as inline text, so the box sat on the text baseline instead of centred on
   it. Scoped to labels that are NOT inside .field, where the label is a block
   heading above its control and must stay that way. */
label:has(input, select, textarea) {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: 14px; color: var(--muted); white-space: nowrap;
}
label:has(input, select, textarea) input,
label:has(input, select, textarea) select { white-space: normal; }
.field label:has(input, select, textarea) { display: block; white-space: normal; }
dialog.dialog label:has(input, select, textarea) { display: block; white-space: normal; }

/* A form with no layout of its own — the Add an ICP form was an input, a
   textarea and a button as three inline-blocks, so they queued up on one line
   and the textarea kept its 2-row default size. */
.panel > form:not(.row):not(.inline) > input:not([type="hidden"]),
.panel > form:not(.row):not(.inline) > textarea,
.panel > form:not(.row):not(.inline) > select {
  display: block; width: 100%; margin-bottom: var(--sp-3);
}

/* Filter bars are the densest rows in the app and the ones most likely to run
   off a phone. 8acc20e was a QA fix for exactly that on the leads bar; wrapping
   by default fixes the class rather than the instance. */
.row { flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }

/* A placeholder that does not fit its box reads as a broken control. These are the
   widths the filter bars actually need: "Name, company or email" was rendering as
   "Name, company or em" and "Min score" as "Min sc". Scoped to .row so a .field
   control in a narrow column is not forced wider than its container. */
.row input[type="search"],
.row input[type="text"],
.row input[type="email"],
.row input[type="url"] { min-width: 15rem; }
.row input[type="number"],
.row input[type="date"],
.row input[type="month"] { min-width: 8.5rem; }

/* A table wider than its panel was being clipped, so the last column — which is where
   every row's action button lives — was cut in half at the panel edge. The stylesheet
   already solved this at line ~596, but only inside the mobile media query, as though
   a desktop table could not overflow. It can: eight columns of real client data do it
   at 1280px.

   The panel scrolls rather than the table, so the table keeps its layout algorithm and
   the columns still size against each other. Making the TABLE the scroll container
   needs display:block, which is what the mobile rule does and why columns stop lining
   up there. */
.panel:has(> table) { overflow-x: auto; }

/* When a table is wider than its panel, the column that gets clipped first is the last
   one — which is where every row's action button lives. So the one thing you cannot
   reach is the one thing you came to click. Pinned to the right edge so it survives the
   scroll, with an opaque background and a hairline so the rows underneath do not show
   through as it passes.

   Scoped to tables whose last column actually holds a control. A table whose final
   column is data has nothing to pin, and pinning it would just freeze a column of text. */
.panel:has(> table) > table th:last-child,
.panel:has(> table) > table td:last-child:has(.btn, form) {
  position: sticky; right: 0;
  background: var(--surface);
  box-shadow: inset 1px 0 0 var(--line);
}
.panel:has(> table) > table th:last-child { z-index: 1; }

/* .field select sets its own padding, which was narrower than the space the chevron
   needs, so a long option ran underneath the arrow. Stated here rather than edited into
   the .field block above, because the reason belongs with the chevron that causes it. */
.field select, .form-grid select { padding-right: calc(var(--sp-3) + 16px); }

/* A form that is working. The disabled state alone reads as "broken", not "busy", so the
   submitting button keeps brand colour at reduced strength and takes a wait cursor —
   the page is doing something, it has not died. */
form[aria-busy="true"] { cursor: progress; }
form[aria-busy="true"] .btn:disabled { opacity: .7; cursor: progress; }
form[aria-busy="true"] .btn-primary:disabled {
  background: var(--brand-fill); border-color: var(--brand-fill); color: #fff;
}

/* ── Lead Stack ──────────────────────────────────────────────────────────────
   The redesign. Three rules held throughout, because the concept mockups broke all
   three and the point of the rebuild was polish WITHOUT losing capability:

   1. Nothing here invents a number. The mockups drew a five-bar score breakdown
      (Job Title Fit 25/25, Recent Activity 14/15) and four verification states.
      The scorer emits two scores — fit_score and likelihood_to_act — and the
      enrichment verifies two things, email and LinkedIn. Only those are rendered.
   2. All 37 columns stay reachable. The pretty panel is a summary OF the record,
      never a replacement FOR it, so .dossier is always followed by .allfields.
   3. No supplier name and no unit cost reaches a client screen. Nothing in this
      section prints either; the views gate both on caps.
*/

/* ── KPI row ───────────────────────────────────────────────────────────────── */
/* Distinct from .stat-cards (dashboard) and .metric (reports) on purpose: this one
   carries a tinted icon tile, which is the single element that makes the header of
   these screens read as designed rather than as a row of numbers. */
.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
  gap: var(--sp-4); margin-bottom: var(--sp-4);
}
.kpi {
  display: flex; align-items: center; gap: var(--sp-4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: var(--sp-4) var(--sp-6);
  box-shadow: var(--shadow-card);
}
.kpi-tile {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink);
  font-size: 19px; line-height: 1;
}
.kpi-tile.ok   { background: var(--ok-bg);   color: var(--ok); }
.kpi-tile.warn { background: var(--warn-bg); color: var(--warn); }
.kpi-tile.bad  { background: var(--bad-bg);  color: var(--bad); }
.kpi-body { min-width: 0; }
.kpi-num {
  font-family: var(--display); font-size: 28px; font-weight: 700;
  color: var(--ink-strong); line-height: 1.1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.kpi-label { font-size: 13px; color: var(--muted); }
/* A delta with no comparison period is a decoration. The views pass the period in. */
.kpi-delta { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi-delta.up   { color: var(--ok); }
.kpi-delta.down { color: var(--bad); }

/* ── the four-step strip ───────────────────────────────────────────────────── */
/* pool.js already stated the four steps as four stacked panels. Same four steps,
   same order, same words — laid out as a strip so the sequence is visible at a
   glance instead of being discovered by scrolling. */
.steps {
  display: flex; align-items: stretch; gap: var(--sp-2);
  background: var(--surface-sunk); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: var(--sp-4);
  margin-bottom: var(--sp-6); overflow-x: auto;
}
.step { display: flex; align-items: flex-start; gap: var(--sp-3); flex: 1 1 0; min-width: 180px; }
.step-n {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 13px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted);
}
.step.is-on .step-n { background: var(--brand-fill); border-color: var(--brand-fill); color: #fff; }
/* The two lines are two lines. Left inline they rendered as
   "Add an ICP Describe who you want to reach." — one run-on string. */
.step-lines { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.step-name { font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--muted); }
.step.is-on .step-name { color: var(--brand-ink); }
.step-does { font-size: 12px; color: var(--muted); line-height: 1.45; }
.step-sep { flex: none; align-self: center; color: var(--line-strong); font-size: 15px; }

/* ── score, tier, verification ─────────────────────────────────────────────── */
/* The ring is drawn with conic-gradient, not an SVG and not an image: the value is
   already in the markup as text, so the ring is presentation and stays out of the
   accessibility tree. --pct is set inline by the view. */
.ring {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--ring-c, var(--brand)) calc(var(--pct, 0) * 1%), var(--gs-cool) 0);
}
.ring::before {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface);
}
.ring-n {
  position: relative; font-family: var(--display); font-weight: 700; font-size: 15px;
  color: var(--ink-strong); font-variant-numeric: tabular-nums;
}
.ring.sm { width: 34px; height: 34px; }
.ring.sm .ring-n { font-size: 12px; }
/* An unscored lead gets a dash and a grey track, never a zero ring. Zero is a score. */
.ring.none { background: var(--gs-cool); }
.ring.none .ring-n { color: var(--muted); font-weight: 600; }

/* Verification is two states plus "not checked", and the third is not a failure.
   Rendering "not checked" as a red cross told clients their data was bad when the
   truth was that they had not bought the check. */
.verify { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.verify-mark { width: 15px; text-align: center; flex: none; font-size: 12px; }
.verify.yes .verify-mark { color: var(--ok); }
.verify.no  .verify-mark { color: var(--bad); }
.verify.unknown { color: var(--muted); }

/* ── the dossier ───────────────────────────────────────────────────────────── */
/* One lead, presented. The layout is the concept's: verdict header, then a two-column
   body of small titled cards. What is NOT the concept's is .allfields underneath it. */
.dossier-head {
  display: flex; align-items: flex-start; gap: var(--sp-4);
  padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-4);
}
.dossier-id { flex: 1; min-width: 0; }
.dossier-name { font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--ink-strong); }
.dossier-role { color: var(--muted); font-size: 14px; }
.dossier-verdict { display: flex; align-items: center; gap: var(--sp-4); flex: none; flex-wrap: wrap; }
.dossier-scores { display: flex; gap: var(--sp-6); }
.dossier-scores > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dossier-score-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.dossier-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-4);
  /* Without this every card in a row stretches to the tallest one, which left
     Provenance as a four-line card standing as tall as LinkedIn Intelligence. */
  align-items: start;
}
.card {
  background: var(--surface-sunk); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--sp-4);
}
/* The case for the lead is the most expensive thing on the page and gets the width. */
.card.wide { grid-column: 1 / -1; }
.card h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 0 0 var(--sp-3);
}
.card p { margin: 0 0 var(--sp-2); line-height: 1.55; }
.card p:last-child { margin-bottom: 0; }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--sp-3); margin: 0; }
.card dt { font-size: 13px; color: var(--muted); }
.card dd { margin: 0; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
/* Signals and risks are lists in the data and were being printed as run-on prose. */
/* A wide card's fields in two columns, so six of them do not make a 700px ribbon.
   break-inside on .note is what keeps a label with its value across the break. */
.notecols { columns: 2 260px; column-gap: var(--sp-6); }
.notecols .note { break-inside: avoid; margin-bottom: var(--sp-3); }
.notecols .note:first-child .sub { margin-top: 0; }

.card ul.tight { margin: 0; padding-left: 18px; }
.card ul.tight li { margin-bottom: 4px; line-height: 1.5; }

/* ── all 37 fields ─────────────────────────────────────────────────────────── */
/* The concept hid every field it had not drawn. This is the disclosure that keeps
   them: closed by default so the page reads as designed, one click from complete. */
.allfields { border-top: 1px solid var(--line); margin-top: var(--sp-6); padding-top: var(--sp-4); }
.allfields > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--brand-ink);
}
.allfields > summary::-webkit-details-marker { display: none; }
.allfields > summary::before { content: '\25B8'; font-size: 11px; }
.allfields[open] > summary::before { content: '\25BE'; }
.allfields > summary:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 3px; }
.allfields .count { font-weight: 400; color: var(--muted); }
.allfields table { margin-top: var(--sp-4); }
.allfields th { width: 210px; text-transform: none; letter-spacing: 0; font-size: 13px; }

/* A row link that carries a whole identity block rather than a word: the underline
   and link colour belong on the name inside it, not around the avatar. */
a.plain { text-decoration: none; color: inherit; display: block; }
a.plain:visited { color: inherit; }
a.plain .who-name { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
a.plain:hover .who-name { color: var(--brand-hover); }
a.plain:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; border-radius: var(--radius-chip); }

/* Folder housekeeping reuses the disclosure, at panel weight rather than page weight. */
.sub-admin { border-top: 0; margin-top: var(--sp-3); padding-top: 0; }
.sub-admin > summary { font-size: 13px; }

/* ── list rows ─────────────────────────────────────────────────────────────── */
/* A named person is easier to find again by their initials than by re-reading a
   column of similar names. This is the only ornament added to the table. */
.who { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.who-av.lg { width: 44px; height: 44px; font-size: 15px; }
.who-av {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink);
  font-family: var(--display); font-size: 11px; font-weight: 700;
}
.who-lines { min-width: 0; display: flex; flex-direction: column; justify-content: center; line-height: 1.35; }
.who-name { font-weight: 600; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The rows got taller to fit two lines. 36px was set for one. */
.table-rich td { height: 52px; }

/* A CAP, NOT A PREFERENCE.
   .who-name and .who-sub are nowrap so a name never wraps mid-word, and in a table cell
   nowrap means the CELL grows to the longest string in the column instead of the text
   ellipsizing. Against real client data that made Company 430px wide — "Northrop Grumman
   Corporation" over "Defense & Space" — and pushed an eight-column table to 1321px inside
   an 1174px panel, so Status and Reviewed were only reachable by scrolling sideways.
   ellipsis needs a bounded width to have anything to clip against; this is that bound. */
.table-rich .who-lines { max-width: 220px; }
.table-rich .who { max-width: 100%; }

/* ── selection action bar ──────────────────────────────────────────────────── */
/* Sticks to the foot of the panel so the count and the spend button stay together
   while scrolling 9,000 rows. Spending money should never require scrolling to find
   out how much is selected. */
.actionbar {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  margin: var(--sp-4) calc(var(--sp-6) * -1) calc(var(--sp-6) * -1);
  padding: var(--sp-4) var(--sp-6);
  background: var(--surface); border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  box-shadow: 0 -6px 18px rgba(13, 27, 61, .06);
}
.actionbar .spacer { margin-left: auto; }
.actionbar .selected { font-weight: 600; color: var(--ink-strong); }

/* ── narrow ────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .steps { flex-direction: column; }
  .step-sep { display: none; }
  .dossier-head { flex-direction: column; }
  .allfields th { width: auto; }
}

/* Elevation is decoration; in forced-colors it is dropped and the hairline carries
   the structure on its own, which is why the border was never removed. */
@media (forced-colors: active) {
  .panel, .kpi, .actionbar { box-shadow: none; }
  .ring { background: none; border: 2px solid; }
}

/* A labelled block inside a card. Not an <h4>: these are field labels, and a heading
   level per field would put twenty headings in the page outline for one lead. */
.card .sub {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; color: var(--muted); margin: var(--sp-4) 0 4px;
}
.card .sub:first-child { margin-top: 0; }
.card .verify + .verify, .card > div + .verify { margin-top: 4px; }
.card a { overflow-wrap: anywhere; }

/* The review controls are the only thing on the detail page you can change, so they
   are boxed rather than left floating between the record and the disclosure. */
.review-form {
  margin-top: var(--sp-6); padding: var(--sp-4);
  background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius);
}
/* .field textarea is scoped to .field, and this textarea never was in one — so the
   notes box on the lead page has been rendering as a raw browser default since it was
   written, monospace and all. Styled explicitly rather than by wrapping it in a .field
   it does not belong to. */
.review-form textarea {
  display: block; width: 100%; max-width: 640px; min-height: 76px;
  margin: var(--sp-2) 0; padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-family: var(--text); font-size: 14px; line-height: 1.5;
  background-color: var(--surface); color: var(--ink); resize: vertical;
}
.review-form textarea:focus-visible {
  outline: 2px solid var(--brand-ink); outline-offset: 1px; border-color: var(--brand-ink);
}
.review-form .check { font-weight: 600; }

/* ── the split: list beside one open lead ─────────────────────────────────────
   The concept's Leads screen is a table with a detail panel beside it, and the panel
   is the point: you read the case for a lead without losing the list you were working
   through. Rendered from ?selected= server-side, so it survives a reload and is a URL
   somebody can send. */
.leads-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
.leads-split.is-open { grid-template-columns: minmax(0, 1fr) 400px; }
/* minmax(0, …) and min-width:0 for the same reason the app shell needs them: a grid
   track sized 1fr carries an implicit min-width:auto and refuses to shrink below the
   min-content width of a wide table, which pushes the drawer off the page instead of
   letting the table scroll. */
.leads-main { min-width: 0; }

/* With 400px gone to the drawer the table no longer fits, so it scrolls inside its own
   column rather than pushing the page sideways. The pinned action column is restated
   here because .panel:has(> table) matches a DIRECT child and the table is wrapped now. */
.table-scroll { overflow-x: auto; }
.table-scroll > table th:last-child,
.table-scroll > table td:last-child:has(.btn, form) {
  position: sticky; right: 0;
  background: var(--surface);
  box-shadow: inset 1px 0 0 var(--line);
}
.table-scroll > table th:last-child { z-index: 1; }
/* The open row keeps its highlight under the hover rule, or the row you are reading
   loses its marker the moment the pointer crosses the table. */
.table-rich tr.is-selected > td,
.table-rich tbody tr.is-selected:hover > td { background: var(--brand-soft); }
.table-rich tr.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--brand); }
.table-scroll > table tr.is-selected td:last-child { background: var(--brand-soft); }

.drawer {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: var(--shadow-lift);
  display: flex; flex-direction: column;
  /* Sticky, so scrolling a page of fifty leads does not scroll the open one away. */
  position: sticky; top: var(--sp-4); align-self: start;
  max-height: calc(100vh - var(--sp-8));
  min-width: 0;
}
.drawer-head {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--line); flex: none;
}
.drawer-title { flex: 1; min-width: 0; }
.drawer-name {
  font-family: var(--display); font-size: 17px; font-weight: 700;
  color: var(--ink-strong); line-height: 1.25; overflow-wrap: anywhere;
}
.drawer-close {
  flex: none; width: 28px; height: 28px; border-radius: var(--radius-chip);
  display: grid; place-items: center; text-decoration: none;
  color: var(--muted); font-size: 13px; border: 1px solid transparent;
}
.drawer-close:hover { background: var(--surface-sunk); color: var(--ink); border-color: var(--line); }
.drawer-close:visited { color: var(--muted); }

.drawer-body { overflow-y: auto; padding: var(--sp-4); display: grid; gap: var(--sp-4); }
.drawer-icp { font-size: 13px; color: var(--muted); }

/* The concept's three boxes. Score, priority, status — the answer, before the argument. */
.verdict-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.vbox {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: var(--sp-3) var(--sp-2); text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-sunk);
}
.vbox-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700;
}

.drawer-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.drawer-cards { display: grid; gap: var(--sp-3); }
/* In a 400px rail every card is full width, so .wide means nothing and the two-column
   note layout would be two 160px columns. Both are neutralised here rather than by
   giving the drawer its own card markup. */
.drawer-cards .card.wide { grid-column: auto; }
.drawer .notecols { columns: 1; }
.drawer .allfields th { width: auto; }
.drawer .review-form textarea { max-width: none; }

/* With the panel open the list has roughly 740px. Status is dropped because the active
   tab already answers it, and Reviewed because it is a flag rather than a fact you sort
   on — which leaves the score and the tier, the two columns the list is actually ordered
   by, on screen instead of behind the pinned Open button. Job title is capped rather
   than dropped: it is how you tell two people at one company apart. */
.leads-split.is-open .col-status,
.leads-split.is-open .col-reviewed { display: none; }
.leads-split.is-open .col-title {
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The identity columns are capped harder here than in the full-width table. 220px each
   was measured against an 1174px panel; beside a 400px drawer the list has 710px, and
   at 220 the score and the tier still landed behind the pinned Open button — which is
   the whole thing this rule exists to prevent. 140 + 140 + 120 + score + tier + button
   comes to 686. */
.leads-split.is-open .table-rich .who-lines { max-width: 140px; }

@media (max-width: 1100px) {
  /* Below this the two columns leave the table unreadably narrow, so the panel goes
     under the list rather than beside it. */
  .leads-split.is-open { grid-template-columns: minmax(0, 1fr); }
  .drawer { position: static; max-height: none; }
  .leads-split.is-open .col-status,
  .leads-split.is-open .col-reviewed { display: table-cell; }
  .leads-split.is-open .col-title { max-width: none; white-space: normal; }
}

/* ── ICPs: pick, read, understand ─────────────────────────────────────────────
   Three panes. The table this replaced listed nine names beside twenty-seven
   identical buttons and showed the criteria — the actual content of an ICP, and the
   only thing that decides which leads it will find — nowhere at all. */
/* THE THREE PANES SHARE ONE HEIGHT AND SCROLL INSIDE THEMSELVES.
   A real ICP carries seven criteria groups and about sixty values, which ran to 1,547px
   of chips and made the detail pane 1,794px tall beside a 533px list — the page reached
   2,472px in a 900px window, so reading one ICP meant scrolling past everything else.

   Capping the criteria alone was not enough: the cap is a guess at where the box starts,
   and the box's own bottom edge landed 129px below the fold, which means scrolling the
   PAGE to reach a scroll region. Bounding the split instead and letting each pane's
   scrollable child take the remaining space with flex:1 means the box always ends where
   the panes end, whatever the ICP name wraps to. */
.icp-split {
  display: grid; gap: var(--sp-4);
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr) minmax(0, 280px);
  max-height: calc(100vh - 290px);
  /* minmax(0, 1fr), and NOT align-items:start. With align-items:start every pane is
     content-sized, so `max-height: 100%` on a pane resolves against an indefinite
     height and is ignored — which is why capping the container alone did nothing and
     the detail pane stayed at 1,812px. An explicit row that is allowed to shrink below
     its content is what actually bounds them. */
  grid-template-rows: minmax(0, 1fr);
}
.icp-split > .panel {
  margin-bottom: 0;
  max-height: 100%; min-height: 0;
  display: flex; flex-direction: column;
}

.icp-list { padding: 0; overflow: hidden; }
.icp-list-head { padding: var(--sp-4); border-bottom: 1px solid var(--line); }
.icp-list-head h2 { margin-bottom: 4px; }
.icp-list-head input[type="search"] {
  width: 100%; height: var(--control); margin-top: var(--sp-3); padding: 0 var(--sp-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-family: var(--text); font-size: 14px; background: var(--surface); color: var(--ink);
}
/* flex:1 + min-height:0 is the pair that lets a flex child actually shrink and scroll;
   without min-height:0 it refuses to go below its content height and the pane grows. */
.icp-rows { flex: 1; min-height: 0; overflow-y: auto; }

.icp-row {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
  border-left: 3px solid transparent;
}
.icp-row:visited { color: inherit; }
.icp-row:hover { background: var(--surface-sunk); }
.icp-row.is-on { background: var(--brand-soft); border-left-color: var(--brand); }
.icp-row:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: -2px; }
.icp-row-body { flex: 1; min-width: 0; }
.icp-row-name {
  display: block; font-weight: 600; color: var(--ink-strong); line-height: 1.35;
  /* Real ICP names run to sixty characters ("SM Services — ICP — Specialty Food
     Beverage Spirits Brands"), so they wrap rather than being cut at a word nobody
     can guess the rest of. Two lines, then ellipsis. */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.icp-row-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.icp-row-state { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.icp-row-chev { color: var(--muted); flex: none; }

.icp-detail-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-4);
}
.icp-detail-title { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.icp-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.icp-actions form { margin: 0; }

/* A BOX THAT SCROLLS, NOT A PAGE THAT GROWS.
   A real ICP carries seven criteria groups and about sixty values between them, which
   ran to 1,547px of chips and made the detail pane 1,794px tall beside a 533px list —
   the page went to 2,472px in a 900px window, so reading one ICP meant scrolling past
   the other two panes and the Add form. The criteria get their own scroll region and
   the pane stops setting the height of the page.

   Capped against the viewport rather than a flat number so a tall window shows more,
   and floored at 260px so a short one still shows something worth reading. The header
   and the action buttons sit OUTSIDE this box on purpose: Delete and Deactivate must
   not scroll away from the ICP name they act on. */
.icp-criteria {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3);
  flex: 1; min-height: 0; overflow-y: auto;
  /* Room for the scrollbar so it never sits on top of a chip's border. */
  padding-right: var(--sp-2);

  /* A CUE THAT THERE IS MORE.
     Bounded and silent, this region read as "Industries is the last group" while five
     more sat below it — hidden content with no affordance is worse than a long page,
     because a long page at least tells you it is long.

     The two layers are the local-attachment trick: the white cover scrolls WITH the
     content, so it sits over the shadow at the end of the list and lifts off it as soon
     as there is something below. The fade is therefore only ever shown when there
     genuinely IS more, which a permanently-drawn gradient could not promise. */
  background:
    linear-gradient(to top, #fff 38%, rgba(255, 255, 255, 0)) center bottom / 100% 30px no-repeat local,
    radial-gradient(farthest-side at 50% 100%, rgba(13, 27, 61, .16), rgba(13, 27, 61, 0)) center bottom / 100% 12px no-repeat scroll;

  /* And a scrollbar you can actually see. Firefox and the modern standard first. */
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  /* Aligned to the top of its own box: the grid's align-items:start would otherwise
     centre short criteria against a tall pane. */
  align-content: start;
}
.icp-criteria::-webkit-scrollbar { width: 9px; }
.icp-criteria::-webkit-scrollbar-track { background: transparent; }
.icp-criteria::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: 999px;
  border: 2px solid var(--surface);
}
.icp-criteria::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.icp-tips ol.tips { overflow-y: auto; min-height: 0; }
.icp-criteria .card h3 { display: flex; align-items: center; gap: 6px; }
.icp-criteria .count {
  font-weight: 700; color: var(--brand-ink); background: var(--brand-soft);
  border-radius: 999px; padding: 0 6px; font-size: 11px; letter-spacing: 0;
}

/* Criteria are values, not prose. Chips make "eleven industries" countable at a glance,
   which is the question somebody opens this pane to answer.
   NOT .chip — that name is a 22px colour swatch in the brand palette section above, and
   the warning beside .utm-value says so. Written as .chip first, and the swatch's
   width:22px came through and rendered "Principal Investigator" as a column of single
   letters. Prefixed, like every other module's own components. */
.icp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.icp-chip {
  /* flex:none matters too: a flex item shrinks to min-content, and overflow-wrap:anywhere
     makes min-content one character. Whole chips wrap; the words inside them do not. */
  flex: 0 0 auto; max-width: 100%;
  font-size: 12px; line-height: 1.5;
  padding: 2px var(--sp-2); border-radius: var(--radius-chip);
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
  overflow-wrap: anywhere;
}

.icp-tips ol.tips { margin: 0; padding-left: 18px; }
.icp-tips ol.tips li { margin-bottom: var(--sp-3); font-size: 13px; line-height: 1.5; color: var(--muted); }
.icp-tips ol.tips strong { color: var(--ink); }
.icp-tips ol.tips li::marker { color: var(--brand-ink); font-weight: 700; }

@media (max-width: 1240px) {
  /* The tips are the first thing to go: they are read once and the other two panes are
     the work. Below that the list stacks above the detail. */
  .icp-split { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
  .icp-tips { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  /* Stacked, the panes are the page: a viewport cap here would put three scroll regions
     inside one scrolling column, which is worse than a long page. */
  .icp-split { grid-template-columns: minmax(0, 1fr); max-height: none; }
  .icp-split > .panel { max-height: none; display: block; }
  .icp-rows { max-height: 320px; }
  .icp-criteria { max-height: none; overflow-y: visible; padding-right: 0; }
}

/* ── Jobs: the table, and the same runs read as a story ─────────────────────── */
.jobs-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.jobs-split.has-rail { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
.jobs-split > .panel { margin-bottom: 0; }
.jobs-main { min-width: 0; overflow-x: auto; }

.acts { list-style: none; margin: 0; padding: 0; }
.act { display: flex; gap: var(--sp-3); padding: 10px 0; border-top: 1px solid var(--line); }
.act:first-child { border-top: 0; }
.act-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 6px;
  background: var(--blocked);
}
.act-dot.ok { background: var(--ok); }
.act-dot.warn { background: var(--warn); }
.act-dot.bad { background: var(--bad); }
.act-body { flex: 1; min-width: 0; }
.act-line { display: block; font-weight: 600; font-size: 13px; color: var(--ink-strong); }
.act-detail { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; }
.act-when { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }

@media (max-width: 1100px) {
  .jobs-split.has-rail { grid-template-columns: minmax(0, 1fr); }
}

/* ── Email: the Sequences workspace ───────────────────────────────────────────
   Three panes: the steps, the step being edited, and what one real lead will see.
   Same bounded-row pattern as the ICP panes — the split takes one viewport-sized row
   and each pane's scroll region takes the leftover — so a ten-step sequence and a long
   preview never make the page 3,000px tall. */
.seq-split {
  display: grid; gap: var(--sp-4);
  grid-template-columns: minmax(0, 290px) minmax(0, 1fr) minmax(0, 380px);
  grid-template-rows: minmax(0, 1fr);
  max-height: calc(100vh - 250px);
}
.seq-split > .panel {
  margin-bottom: 0; max-height: 100%; min-height: 0;
  display: flex; flex-direction: column;
}
.seq-pane-head {
  display: flex; align-items: center; gap: var(--sp-2);
  padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-3);
  flex: none;
}
.seq-pane-head h2 { margin: 0; flex: 1; font-size: 16px; }
.seq-pane-body { flex: 1; min-height: 0; overflow-y: auto; padding-right: var(--sp-1); }

/* ── the timeline ──────────────────────────────────────────────────────────── */
/* Email, wait, email — read top to bottom, joined by a rail, so the shape of the
   sequence is visible before a single subject line is. */
.seq-steps { list-style: none; margin: 0; padding: 0; position: relative; }
.seq-steps::before {
  content: ''; position: absolute; left: 19px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line);
}
.seq-steps > li { position: relative; padding-left: 48px; margin-bottom: var(--sp-3); }
.seq-node {
  position: absolute; left: 8px; top: 10px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface);
  border: 2px solid var(--line-strong); color: var(--muted);
  font-family: var(--display); font-size: 11px; font-weight: 700;
}
.seq-step {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--sp-3);
}
.seq-step:visited { color: inherit; }
.seq-step:hover { border-color: var(--line-strong); background: var(--surface-sunk); }
.seq-step.is-on { border-color: var(--brand); background: var(--brand-soft); }
.seq-step.is-on + .seq-node, li.is-on .seq-node {
  border-color: var(--brand); background: var(--brand-fill); color: #fff;
}
.seq-step-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.seq-step-title {
  display: block; font-weight: 600; color: var(--ink-strong); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seq-step-meta { display: flex; gap: var(--sp-2); align-items: center; margin-top: 6px; flex-wrap: wrap; }

/* A wait is a small inline form, not a card: it is a number and a condition, and it
   sits BETWEEN two emails rather than being a thing in its own right. */
.seq-wait {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); padding: 2px 0;
}
.seq-wait input[type="number"] { width: 64px; height: 28px; padding: 0 6px; font-size: 13px; }
.seq-wait select { height: 28px; padding: 0 4px; font-size: 13px; }
.seq-wait .btn { height: 28px; padding: 0 8px; font-size: 12px; }
.seq-wait form { display: contents; }

.seq-add { margin-top: var(--sp-2); padding-left: 48px; }
.seq-add form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ── the step editor ───────────────────────────────────────────────────────── */
.seq-editor label { display: block; font-size: 13px; font-weight: 600; margin: var(--sp-3) 0 4px; }
.seq-editor label:first-child { margin-top: 0; }
.seq-editor .hint { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.seq-editor input[type="text"], .seq-editor textarea {
  width: 100%; padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-family: var(--text); font-size: 14px; line-height: 1.5;
  background: var(--surface); color: var(--ink);
}
.seq-editor input[type="text"] { height: var(--control); }
.seq-editor textarea { min-height: 220px; resize: vertical; }
.seq-editor textarea.short { min-height: 64px; }
.seq-editor input:focus-visible, .seq-editor textarea:focus-visible {
  outline: 2px solid var(--brand-ink); outline-offset: 1px; border-color: var(--brand-ink);
}
.seq-editor .actions { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-3); flex-wrap: wrap; }

/* The slots. Grouped by where the value comes from, because "Research" is the group
   that makes this different from mail merge and it should look like it. */
.slots { margin-bottom: var(--sp-3); }
.slots-group { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: 6px; }
.slots-label {
  flex: none; width: 72px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700;
}
.slot {
  flex: 0 0 auto; font-family: var(--mono); font-size: 12px; line-height: 1.5;
  padding: 1px var(--sp-2); border-radius: var(--radius-chip); cursor: pointer;
  background: var(--brand-soft); color: var(--brand-ink); border: 1px solid transparent;
}
.slot:hover { border-color: var(--brand); }
.slot:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 1px; }
.slot.research { background: var(--ok-bg); color: var(--ok); }

/* ── the preview ───────────────────────────────────────────────────────────── */
.seq-preview-pick { display: flex; gap: 6px; align-items: center; margin-bottom: var(--sp-3); }
.seq-preview-pick select { flex: 1; min-width: 0; height: var(--control); }
.seq-mail {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-sunk); padding: var(--sp-4);
}
.seq-mail-head { font-size: 13px; color: var(--muted); margin-bottom: var(--sp-3); }
.seq-mail-head div { margin-bottom: 2px; }
.seq-mail-head strong { color: var(--ink-strong); }
.seq-mail-body {
  white-space: pre-wrap; font-family: var(--text); font-size: 14px; line-height: 1.6;
  color: var(--ink); margin: 0;
}
/* An unresolved slot in the preview is the one thing a preview exists to show. It is
   marked in the body itself, not only in the notice above it. */
.seq-mail-body mark.unresolved {
  background: var(--bad-bg); color: var(--bad); padding: 0 3px; border-radius: 3px;
  font-family: var(--mono); font-size: 12px;
}

@media (max-width: 1240px) {
  .seq-split { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
  .seq-split > .seq-preview-pane { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .seq-split { grid-template-columns: minmax(0, 1fr); max-height: none; }
  .seq-split > .panel { max-height: none; display: block; }
  .seq-pane-body { overflow: visible; }
}

/* ── Preformatted text you are meant to read ──────────────────────────────────
   An email body, an HTML source dump, a recipient JSON blob.

   These used to carry class="preview", which belongs to the Images module where it
   is a single-line flex text row (display:flex, min-height:30px, 13px). A <pre>
   given display:flex cannot wrap, and <pre> already defaults to white-space:pre,
   so an email body became one horizontal ribbon: the detail page measured 2308px
   inside a 1440px window and the whole page scrolled sideways. The body was
   unreadable.

   pre-wrap is the fix — it keeps the newlines a <pre> exists for AND wraps long
   lines. overflow-wrap catches the pathological case of an unbroken 2,000-char
   token (a tracking URL, a base64 blob) that pre-wrap alone would still push out.
   max-height keeps a 4,000-word email from making the page endless; it scrolls in
   its own box rather than taking the page with it. */
.textblock {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-3);
  max-height: 30rem;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}

/* The History table's Reason column carries a full sentence now that it is no longer
   cut at 200 characters, so give it room to wrap rather than stretching the table. */
.table td.small { white-space: normal; overflow-wrap: anywhere; }

/* Email authoring forms: labels above their controls on every viewport. */
.email-authoring label, .email-copy-form label {
  display: block;
  margin: 16px 0;
  font-weight: 500;
}
.email-authoring label > input:not([type="checkbox"]):not([type="hidden"]),
.email-authoring label > textarea, .email-authoring label > select,
.email-copy-form label > input, .email-copy-form label > textarea {
  display: block;
  width: 100%;
  max-width: 820px;
  margin-top: 8px;
  box-sizing: border-box;
}
.email-authoring textarea, .email-copy-form textarea { min-height: 140px; resize: vertical; }
.email-authoring label > input[type="checkbox"] { margin-right: 8px; }
.email-authoring form { margin: 16px 0; }
.email-authoring button:disabled { opacity: .45; cursor: not-allowed; }
.email-authoring td { overflow-wrap: anywhere; }
.email-authoring td > input { width: 100%; box-sizing: border-box; }
.email-authoring details > summary { cursor: pointer; }
.email-copy-form { margin-bottom: 24px; }

/* Keep video charge consent readable beside its checkbox on small screens. */
.email-easy label.social-video-charge { display: flex; align-items: flex-start; gap: .65rem; white-space: normal; }
.social-video-charge span { min-width: 0; }
.social-video-charge input { flex: 0 0 auto; margin-top: .2rem; }

/* Debrief improvements: readable reference editing and original layout previews. */
.company-library{max-width:1040px}.company-library label{display:block;white-space:normal;margin:18px 0 8px}.company-library textarea{display:block;width:100%;box-sizing:border-box;margin-top:8px;resize:vertical;font:inherit;line-height:1.6}.company-library form{margin:24px 0}.company-library article{padding:20px 0;border-bottom:1px solid var(--border)}.library-text{white-space:pre-wrap;overflow-wrap:anywhere;max-height:340px;overflow:auto;background:var(--surface-sunk);padding:16px}.company-library details{margin-top:20px}.company-library summary{cursor:pointer}.company-library input[type=checkbox]{margin-right:8px}
.company-switch-link{text-decoration:none;color:inherit}.company-switch-link:hover{background:var(--surface-sunk)}.company-switch-link .chev{font-size:11px}.company-search{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:18px 0}.company-search input{flex:1;min-width:160px;max-width:420px}
.workspace-deletion { max-width: 48rem; overflow-wrap: anywhere; }
.workspace-deletion form { margin-top: var(--sp-6); }
.workspace-deletion .field { max-width: 20rem; }
.workspace-deletion .deletion-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.workspace-deletion .btn.delete-workspace { background: var(--bad); border-color: var(--bad); color: white; }
.creative-directions{border:0;padding:0;margin:24px 0;min-width:0}.creative-directions legend{font-size:1rem;font-weight:700}.creative-direction-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:14px}.creative-directions label.creative-direction{display:flex;flex-direction:column;align-items:stretch;gap:8px;white-space:normal;border:1px solid #ddd5ed;border-radius:12px;padding:12px;cursor:pointer;min-width:0;font-size:13px}.creative-directions label.creative-auto{display:flex;align-items:center;gap:8px;flex-wrap:wrap;white-space:normal}.creative-direction:has(:checked){outline:2px solid var(--gs-indigo);background:#f7f3ff}.creative-direction input{align-self:flex-start;width:auto!important}.creative-direction>span:last-child{font-weight:400;line-height:1.5}.creative-layout{display:flex;position:relative;align-items:center;justify-content:center;gap:6px;height:80px;background:#f2eff9;border-radius:8px;overflow:hidden}.creative-layout i{display:block;background:#8a66d7;border-radius:5px;width:22px;height:35px}.creative-layout-product i:first-child{width:32px;height:54px}.creative-layout-product i:not(:first-child){width:20px;height:5px;background:#c4b5e4}.creative-layout-founder i:first-child{width:40px;height:40px;border-radius:50%;background:#d6bae8}.creative-layout-founder i:nth-child(2){width:38px;height:8px}.creative-layout-founder i:last-child{display:none}.creative-layout-educational{flex-direction:column}.creative-layout-educational i{width:70%;height:10px}.creative-layout-educational i:nth-child(2){width:55%;background:#ab8ddd}.creative-layout-educational i:last-child{width:40%;background:#cbb7e8}.creative-layout-minimal i:first-child{width:34px;height:34px;transform:rotate(25deg);border-radius:10px}.creative-layout-minimal i:not(:first-child){display:none}
@media(max-width:900px){.creative-direction-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:450px){.company-search>*{width:100%}.creative-direction-grid{gap:8px}}
.company-library label.library-review-confirm{display:flex;align-items:flex-start;gap:10px}.company-library .library-review-confirm input{width:20px;height:20px;min-height:20px;flex:0 0 20px;margin:2px 0 0;padding:0}.company-library .library-review-confirm span{min-width:0}

/* Shortcuts reuse the permitted company navigation and its existing stack emoji. */
.workspace-quick-links{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 22px;padding:12px 0;border-bottom:1px solid var(--line,#e3e7ee)}
.workspace-quick-links>span{margin-right:6px;color:var(--muted,#617088);font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.workspace-quick-links>a{display:inline-flex;align-items:center;gap:7px;min-height:40px;box-sizing:border-box;padding:8px 12px;border:1px solid var(--line,#e1e5ed);border-radius:9px;background:var(--surface,#fff);color:var(--ink,#25354e);font-size:13px;font-weight:600;text-decoration:none}
.workspace-quick-links>a:hover{border-color:var(--gs-teal,#089c91);background:#f2faf9}
.workspace-quick-links>a:focus-visible{outline:3px solid #176d93;outline-offset:2px}
@media(max-width:600px){.workspace-quick-links{gap:6px}.workspace-quick-links>span{flex-basis:100%}.workspace-quick-links>a{min-height:44px;font-size:12px}}

/* Shared Recall credit warnings: administrator-only, never hidden in badge totals. */
.meeting-service-warning { margin:16px 0; padding:16px 20px; border:1px solid #dba73a; border-radius:12px; background:#fff6db; color:#683e00; overflow-wrap:anywhere; }
.meeting-service-warning[hidden] { display:none!important; }
.meeting-service-warning strong { display:block; font-size:1rem; }
.meeting-service-warning p { margin:6px 0 10px; }
.meeting-service-warning a { color:inherit; font-weight:700; text-decoration:underline; }
.meeting-service-warning[data-state="critical"], .meeting-service-warning[data-state="empty"] { border-color:#af3540; background:#fff0f0; color:#842b30; }
