/* ===========================================================================
   Voice training
   ---------------------------------------------------------------------------
   The screen where somebody's own sent mail is on the glass, and the design
   problem is entirely about what red means.

   Red here is not an error. It is "this will not be sent", and it has to read
   that way at a glance across a body of text somebody is skim-reading — so a
   struck-out span gets the strike, a wash, and a muted colour all three. One
   of them alone reads as emphasis; together they read as removed.

   The unmarked-but-suggested state does not exist. A suggestion arrives struck
   out, because the safe default is that a phone number does not leave the
   browser, and clicking it back in is the deliberate act.
   =========================================================================== */

/* minmax(0, 1fr), not the implicit `auto`: an auto column is at least as wide
   as its min-content, and the min-content of a mail row is the row's own
   nowrap subject plus a sender address that does not break. On a phone that
   made the whole trainer wider than the card holding it, and every row was
   clipped at the card's edge with no ellipsis to say so. */
.vt { display: grid; gap: 18px; margin-top: 18px; grid-template-columns: minmax(0, 1fr) }
.vt .stack { min-width: 0 }

/* Learning, as it happens: a bar, then a line per step that ticks off in
   turn, the current one turning. Ink, not the accent. */
.vt__learn { display: grid; gap: 22px; padding: 4px 0 2px }
.vt__track { height: 6px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden }
.vt__track span { display: block; height: 100%; background: var(--teal); transform-origin: left; transition: transform .5s ease }
.vt__ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px }
.vt__ticks li {
  display: flex; align-items: center; gap: 12px;
  font-size: 15px; font-weight: 500; color: var(--muted); transition: color .2s ease;
}
.vt__ticks li[data-state="done"], .vt__ticks li[data-state="now"] { color: var(--text) }
.vt__ticks li[data-state="now"] { font-weight: 600 }
.vt__ticks .ms { font-size: 22px; flex: 0 0 auto; color: var(--text) }
.vt__ticks li[data-state="todo"] .ms { color: color-mix(in srgb, var(--ink) 25%, transparent) }
.vt__spin {
  width: 18px; height: 18px; margin: 2px; flex: 0 0 auto;
  border-radius: var(--r-pill);
  border: 2.5px solid color-mix(in srgb, var(--ink) 15%, transparent); border-top-color: var(--text);
  animation: cdSpin .8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .vt__spin { animation-duration: 2.4s }
  .vt__track span, .vt__ticks li { transition: none }
}
.vt__note {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
}
.vt__note .ms { font-size: 15px }

/* The trainer always sits inside a container (the onboarding card, the
   profile panel), so its parts sit straight on it: a heading and rows split
   by a hairline, never a bordered box of their own. */
.vt__step { padding: 4px 0 }
.vt__head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; row-gap: 2px;
  margin-bottom: 10px;
}
.vt__head h3 { margin: 0; font-size: 16px; font-weight: var(--weight-strong); letter-spacing: -.02em }
.vt__section + .vt__section { margin-top: 14px }

/* Picking: what to pick, how to keep things out, then the list. */
/* One column held to the card: the subjects don't wrap, and an auto column
   would grow to the longest of them. */
.vt__picking { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px }
/* What Candid picked, and the one thing to do with it. */
.vt__goal { display: grid; gap: 6px }
/* Past the intro this is the screen's own title, so it carries the weight. */
.vt__goal b { font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--text); text-wrap: balance }
.vt__goal span {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
}
.vt__goal span .ms { font-size: 16px }
.vt__goal--row { display: flex; align-items: center; justify-content: space-between; gap: 16px }
.vt__goal--row .vt__steps { margin: 0 }
.vt__goal--row b { white-space: nowrap }
/* Five bars and "Message 5 of 5" on one line at phone width. */
@media (max-width: 480px) { .vt__goal--row .vt__dot { width: 18px } }

.vt__foot--end { justify-content: flex-end }
.vt__foot--split { justify-content: space-between }

/* Which email this is: a short bar per email, read ones half filled. */
.vt__steps { display: flex; gap: 6px; margin: 6px 0 4px }
.vt__dot {
  width: 28px; height: 6px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  transition: background .2s ease;
}
.vt__dot[data-state="done"] { background: color-mix(in srgb, var(--teal) 50%, transparent) }
.vt__dot[data-state="now"] { background: var(--teal) }
@media (prefers-reduced-motion: reduce) { .vt__dot { transition: none } }

/* The learning page: their message to correct, full width and roomy. */
.vt__practice { display: grid; gap: 12px }
/* Which channel and situation this message is for, and what to do with it. */
.vt__practicehead { display: grid; gap: 4px }
.vt__practicehead b { font-size: 16px; font-weight: 600; color: var(--text); text-wrap: balance }
.vt__practicehead > span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted) }
.vt__practicehead > span .ms { font-size: 16px }
.vt__practicetitle { display: flex; align-items: center; gap: 8px }
.vt__practicetitle > .ms { font-size: 18px; color: var(--text) }
/* How close a LinkedIn request or a text is to its limit. */
.vt__count { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap }
.vt__count[data-over="1"] { color: var(--bad) }
.vt__draftfield { min-height: 280px; font-size: 14px; line-height: 1.65; resize: vertical }
.vt__draftfield--short { min-height: 140px }
/* The draft tracks their changes as they make them (trackedField): what
   they take out struck through in red, what they write in green, each on a
   faint wash of its colour. Both darkened to read as body text on white. */
.tracked { white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; resize: none }
/* The first email's subject: one line, the message's own type size, the
   field the body sits under. Labelled as its part of the email is. */
.tracked--line { font-size: 14px; line-height: 1.5; font-weight: 500 }
.vt__subject { display: grid; gap: 6px }
.vt__subject > span { font-size: 12.5px; font-weight: 500; color: var(--muted) }
.tracked del, .vt__key del {
  color: color-mix(in srgb, var(--bad) 88%, var(--ink)); text-decoration: line-through;
  background: color-mix(in srgb, var(--bad) 9%, transparent); border-radius: 3px;
}
.tracked ins, .vt__key ins {
  color: color-mix(in srgb, var(--good) 72%, var(--ink)); text-decoration: none;
  background: color-mix(in srgb, var(--good) 12%, transparent); border-radius: 3px;
}
.tracked del { user-select: none; margin-right: 2px }
/* What the two colours mean, beside Try again once there is a change. */
.vt__key { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; font-size: 12.5px; font-weight: 500 }
.vt__key del, .vt__key ins { padding: 1px 4px }
.vt__key[hidden] { display: none }
/* What the last correction taught, before this message was written from it:
   rows straight on the card, each with its Forget. */
.vt__learnt { display: grid; gap: 6px }
.vt__learnthead { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted) }
.vt__learnthead .ms { font-size: 16px }
.vt__learnt ul { margin: 0; padding: 0; list-style: none; display: grid }
.vt__learnt li { display: flex; align-items: center; gap: 12px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--text) }
.vt__learnt li:first-child { border-top: 0 }
.vt__learnt li > span { flex: 1 1 auto; min-width: 0; text-wrap: pretty }
.vt__learnt li b { font-weight: 600 }
.vt__learnt .iconbtn .ms { font-size: 16px }
/* The prospect's message a reply answers, quoted as mail quotes it. */
.vt__incoming { display: grid; gap: 4px; padding-left: 12px; border-left: 2px solid var(--line) }
.vt__incoming span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted) }
.vt__incoming span .ms { font-size: 16px }
.vt__incoming p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text); text-wrap: pretty }
.vt__practicefoot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap }
.vt__practicefoot:not(:has(> :not([hidden]))) { display: none }
.vt__practicefoot .btn[hidden] { display: none }
.vt__error { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--bad) }
.vt__error .ms { font-size: 16px }

/* --- what Candid learnt about how they write (voiceStyle) ---------------- */

.vs { display: grid; gap: 28px }
/* Three figures, each with its label, split by hairlines. */
.vs__figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) }
.vs__fig { display: grid; gap: 4px; padding: 0 16px; border-left: 1px solid var(--line) }
.vs__fig:first-child { padding-left: 0; border-left: 0 }
.vs__fig b { font-size: 26px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums }
.vs__fig span { font-size: 12.5px; font-weight: 500; color: var(--muted) }
.vs__sec { display: grid; gap: 10px; padding-top: 24px; border-top: 1px solid var(--line) }
.vs__sec h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; color: var(--text) }
.vs__tone { margin: 0; font-size: 13px; font-weight: 600; color: var(--text) }
.vs__notes { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-wrap; max-width: 68ch; text-wrap: pretty }
.vs__rows { display: grid }
.vs__row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px }
.vs__row:first-child { border-top: 0; padding-top: 0 }
.vs__row span { color: var(--muted); font-weight: 500 }
.vs__row b { font-weight: 600; color: var(--text); text-align: right }
.vs__list { margin: 0; padding: 0 0 0 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--text) }
.vs__none { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted) }
.vs__none .ms { font-size: 16px }
.vs__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap }
.vs__form { display: grid; gap: 18px }
.vs__field { display: grid; gap: 6px }
.vs__field > span { font-size: 12.5px; font-weight: 600; color: var(--text) }
@media (max-width: 640px) {
  .vs__fig { padding: 0 10px }
  .vs__fig b { font-size: 22px }
}

/* --- the promises --------------------------------------------------------- */


/* --- the footer, and the calibration drafts ------------------------------ */

.vt__foot {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 4px;
}


/* Touch targets: 44px is the smallest reliably hittable control. Tied to a
   touch screen, not a narrow window, so with a mouse a narrow window keeps
   buttons the height of the chips and fields beside them (--control-h does the
   same for those on touch). */
@media (pointer: coarse) {
  .btn, .provider, .ob__provider, .ob__cta { min-height: 44px }
}

@media (max-width: 900px) {
  /* iOS zooms the page in when a focused field is under 16px. Every input in
     the app is 13.5px, so without this every tap on a form jumps the viewport
     and does not jump back. */
  .input, .textarea, .select, input, textarea, select { font-size: 16px }

  /* The icon carries the verb on a phone; the label only has to say what. */
  .btn__full { display: none }
  .btn__short { display: inline }
  .input, .select { min-height: 44px }

  /* The app is a full-bleed surface on a phone; native scrollbars over it read
     as a rendering artefact rather than a control. */
  * { scrollbar-width: none; -ms-overflow-style: none }
  ::-webkit-scrollbar { width: 0; height: 0; display: none }

  html, body { overscroll-behavior-y: none }
  body { touch-action: manipulation; -webkit-text-size-adjust: 100% }
  * { -webkit-tap-highlight-color: transparent }

  .auth { grid-template-columns: 1fr; display: flex; flex-direction: column; overflow-y: auto }
  /* The art panel collapses to a branded strip rather than disappearing — it is
     the only thing on the screen that says whose product this is. */
  .auth__art {
    flex: 0 0 auto; min-height: 74px; max-height: 74px;
    padding: 16px 20px; justify-content: center; overflow: hidden;
  }
  .auth__pitch { display: none }
  .auth__logo { position: relative; top: auto; left: auto }
  /* No footage on a phone. At 74px tall the strip crops it to a sliver behind
     the wordmark, and authFilm() never loads it here. Plain ink, logo on top. */
  .auth__scene { display: none }
  .auth__pane { flex: 0 0 auto; padding: 26px 18px calc(28px + env(safe-area-inset-bottom)); align-items: flex-start }

  .aside { display: none }
  .shell, .col { height: 100dvh }

  /* The status bar sits over the top of a standalone web app, so the header has
     to be pushed clear of it or the title renders under the clock. */
  /* The sidebar is what carries the brand colour on a desktop, and it is gone
     here — so the header takes it on. That also closes a seam: applyBrand()
     already paints the browser's own chrome with the main colour, so a white
     bar left a band of card between the address bar and the app. Ink to ink,
     through to the ink tab bar at the far end of the screen. */
  .topbar {
    height: calc(58px + env(safe-area-inset-top));
    flex-basis: calc(58px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 14px 0; gap: 10px;
    background: var(--ink);
    color: var(--on-ink);
    border-bottom-color: color-mix(in srgb, var(--on-ink) 8%, transparent);
  }
  /* The wordmark takes the title's place. The page name stays in the document
     for assistive tech — it is clipped, not removed — so the heading still
     announces the screen. */
  .topbar h1 { font-size: 17px }
  /* Same knockout the sidebar gives it: the mark is solid black artwork, which
     is why it needs inverting to sit on ink. --logo-filter is none once a
     customer uploads their own, so their artwork is never recoloured. */
  .topbar__logo {
    display: block; height: calc(22px * var(--logo-scale)); width: auto;
    max-width: 44vw; flex: 0 0 auto; filter: var(--logo-filter);
  }
  .topbar__name {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .search { flex: 1 1 auto; min-width: 0 }
  .mavatar { display: block }
  /* On the ink bar the gear takes the search key's wash of the foreground
     colour, at the 40px of the row, and a wide customer logo shrinks to make
     the room. A tap can leave hover stuck on a touch screen, so it does not
     change on hover here. */
  .gearbtn, .gearbtn:hover {
    width: 40px; height: 40px;
    background: color-mix(in srgb, var(--on-ink) 12%, transparent);
    border-color: color-mix(in srgb, var(--on-ink) 18%, transparent);
    color: var(--on-ink);
  }
  .gearbtn:hover .ms { transform: none }
  .gearbtn[aria-current="page"] { background: color-mix(in srgb, var(--on-ink) 24%, transparent); color: var(--on-ink) }
  .topbar__title { flex: 0 1 auto }
  .topbar__logo { flex-shrink: 1; min-width: 0; object-fit: contain; object-position: left center }

  .main { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)) }

  .grid--4, .grid--3, .grid--2 { grid-template-columns: minmax(0, 1fr) }

  /* ---- page headers on a phone ------------------------------------------
     All three of these headers are a title, a count and one or two controls
     laid out in a row that wraps. On a phone the wrap left them ragged: a
     right-aligned button orphaned on its own line, a switch under it aligned
     left, a divider stranded at the start of a wrapped row. Full-width
     controls stacked under the heading read as deliberate rows instead. */

  .stage__head { gap: 10px 12px }

  /* ---- the companies table on a phone ------------------------------------
     Six columns of real data will not fit 347px, and squeezing them to fr
     units is what turned the company name into "Stonega…". So the columns
     keep widths that fit their content and the table scrolls sideways
     instead, with the head and the rows inside one scroller so they cannot
     drift apart.

     A frozen company column was tried and taken out again: a grid item's
     containing block is its own grid area, so it unpins the moment the
     scroll passes that column's width. Freezing one properly needs a real
     <table>, which is a bigger change than this screen justifies. */
  .table__scroll {
    overflow-x: auto; overscroll-behavior-x: contain;
    /* Scrollbars are hidden on a phone (see the top of this block), so the
       edge has to say "there is more" by itself. The first layer is an opaque
       patch attached to the content, so it slides over the shadow exactly
       when the last column arrives; the second is the shadow, pinned to the
       viewport's edge. It is the fallback: where scroll-driven animations
       run, both ends fade instead (the sideways fade at the end of this
       file). */
    background:
      linear-gradient(var(--card), var(--card)) right center / 18px 100% no-repeat local,
      linear-gradient(to right, transparent, rgba(16, 33, 31, .11)) right center / 18px 100% no-repeat scroll;
  }
  .corow {
    /* The last column (current deal value) takes any slack rather than leaving it stranded at the
       right edge — between about 690px and the breakpoint the fixed columns
       come to less than the card, and the gap landed after the last one.
       The fit column holds a word beside the ring while a company is being
       researched or waits its turn ("Researching", "No website"). */
    grid-template-columns: 180px 84px 84px 120px 136px 96px minmax(112px, 1fr);
    gap: 12px; padding: 14px 16px;
    /* The row has to be as wide as its columns, not as wide as the window.
       It inherits width:100% from the rule above, which inside a scroller
       resolves against the visible 360px rather than the 672px of content —
       so the painted box stopped a third of the way along: the head's grey
       band and every row's hairline ended in mid-table, and the row's own
       right padding sat inside the visible area instead of after the last
       column, leaving the values jammed against the edge with nothing to
       scroll into. min-width keeps it filling a tablet, where the fixed
       columns come to less than the screen. */
    width: max-content; min-width: 100%;
  }
  .corow--head { padding: 12px 16px }
  /* The page's top padding is 16px here. */
  .table__head { top: -16px }

  /* A stage name longer than its column would otherwise push the pill into
     the next one. */
  .corow .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }

  /* ---- the companies toolbar and filters ---------------------------------
     All five controls share one row, which takes some doing: at the desktop
     sizes they came to 382px against about 300px of usable width. The gutter
     drops from 26px to 12px and the gaps from 10px to 6px; the two buttons
     keep the small button size (below). The three utility buttons come down
     from 42px to 38px — the one real concession, and it is spent on import,
     export and filters rather than on the two buttons that add something.

     That lands at 318px against 325px of room on a 375px screen — the card's
     own 1px borders are part of that sum, and forgetting them was worth two
     pixels and a wrapped row. The row holds from about 368px up. Narrower
     than that it splits in two on purpose; see the block below. */
  /* The sides are counted to the pixel (above), so the top and bottom come
     down to match them rather than the sides going up. */
  .table__toolbar { padding: 10px; gap: 5px }
  .table__tools { display: contents }
  .table__toolbar .iconbtn, .table__toolbar .filterbtn { width: var(--control-h); height: var(--control-h); flex: 0 0 var(--control-h) }
  .table__toolbar .iconbtn--word, .table__toolbar .filterbtn--word { width: auto; flex: 0 0 auto; padding: 0 12px 0 8px }
  /* Every control here keeps the tighter 12 / 8 sides so the row fits a
     phone (design/corners-and-spacing.md, "Buttons"); type, icon and gap
     stay the small size's. */
  .table__toolbar .btn { gap: 6px; padding: 0 12px; font-size: 12.5px }
  .table__toolbar .btn:has(> .ms:first-child) { padding-left: 8px }
  .table__toolbar .chip.table__toggle { padding: 0 12px }
  .table__toolbar .chip.table__toggle:has(> .ms:first-child) { padding-left: 8px }
  .table__toolbar .filterbtn--word:first-child { margin-left: -8px }
  .table__toolbar .btn .ms { font-size: 16px }
  /* Pushes the two buttons to the far end, away from the utilities. */
  .table__toolbar .btn--ghost { margin-left: auto }
  .table__filters { padding: 14px 16px; gap: 10px }
  /* Each filter takes a full row. A 150px minimum on a wrapping flex row was
     what left "Any stage" and "Any score" side by side and the order control
     stranded on a line of its own, half a screen from either. */
  .table__filters .select { flex: 1 1 100%; width: 100%; min-width: 0 }
  .table__order { margin-left: 0; width: 100%; gap: 10px }
  .table__order .select { flex: 1 1 auto; width: auto }

  /* Team — a 220px dashed box is most of a phone screen for one button, and it
     pushed the people underneath it off the bottom. And auto-fill at a 320px
     minimum overflows any viewport narrower than that, so the track loses its
     floor here too. */
  .members { grid-template-columns: minmax(0, 1fr) }
  .member--add { min-height: 112px; flex-direction: row; gap: 12px }
  .member--add .ms { font-size: 22px }

  /* Your profile and the settings tabs. The panels give up the desktop padding
     so the fields get the width back — at 375px, 28px a side was a tenth of
     the screen spent on nothing. */
  .fpanel { padding: 18px }
  .fpanel__head { gap: 12px; margin-bottom: 18px; flex-wrap: wrap }
  /* An account's state and its one button share the line under its name. */
  .fpanel .acct__acts { width: auto; margin-left: auto }

  /* A phone conversation gives the bubbles more of the width. */
  .msg--them { padding-inline-end: 6% }
  .msg--you { padding-inline-start: 10% }
  .msg { grid-template-columns: 28px minmax(0, 1fr); column-gap: 8px }
  .msg--you { grid-template-columns: minmax(0, 1fr) 28px }
  .msg__face, .msg__gap, .msg__facewrap { width: 28px; height: 28px; flex-basis: 28px }

  /* One column, and the panels lose the generous desktop padding. */
  .dash { grid-template-columns: minmax(0, 1fr); gap: 12px }
  .sp12, .sp7, .sp6, .sp5 { grid-column: span 1 }
  .panel { padding: 18px }
  .barrow__name { flex-basis: 96px; min-width: 96px; font-size: 13px }
  /* The period buttons wrap onto a second line rather than scroll into the
     panel's edge. */
  .perf__periods { margin-left: 0; width: 100%; flex-wrap: wrap }
  .perf__periods .chip, .perfrange__wrap { flex: 0 0 auto }
  /* Two by two, not a single column. Each tile still clears 165px at 375px —
     more than the longest value needs — and four stacked cards would push the
     panels underneath them off the first screen entirely. */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
  .kpi { padding: 16px 14px; border-radius: 18px }
  .kpi__value { font-size: 26px }
  .kpi__label { margin-bottom: 8px }
  .kpi__delta { font-size: 11.5px; line-height: 1.35 }

  .hero { padding: 24px 20px; border-radius: 22px }
  .hero--dash { padding: 22px 18px 20px; border-radius: 16px }
  .hero__big { font-size: 42px }
  .hero__win .ring { width: 60px !important; height: 60px !important }
  .hero__win .ring__mid { font-size: 15px }
  /* On a phone the deals' node is too close to the companies' for a head
     over each, so the two heads sit in a row over the chart. */
  .heroflow__canvas { display: flex; flex-wrap: wrap; gap: 10px 12px }
  .heroflow__head { position: static; transform: none; gap: 6px }
  .heroflow__stage { flex: 1 0 100% }
  .heroflow__head .heroflow__n { font-size: 18px }
  .heroflow__name { font-size: 11.5px }
  .heroflow__name .ms { display: none }
  .heroflow__n { font-size: 18px }
  .heroflow__end { gap: 5px }
  .heroflow__val { font-size: 11.5px; margin-left: 2px }
  /* Three to a row on a phone, so the key stays a short block above the chart.
     The sample and icon sit on a line of their own and the name under them,
     so a word as long as "Connected" has the whole third; a longer name wraps
     ("LinkedIn requests"), and the figures in a row stay level at the foot. */
  .wchart__key { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 16px }
  .wchart__chip { min-width: 0; justify-content: space-between }
  .wchart__name { max-width: 100%; flex-wrap: wrap; gap: 4px 6px }
  .wchart__label { flex: 1 0 100%; min-width: 0; white-space: normal; line-height: 1.25 }
  .wchart__n { font-size: 20px }
  .wchart__plot { height: 180px; margin-top: 36px; margin-left: 28px }
  .wchart__days { margin-left: 28px }

  .tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 12;
    align-items: stretch; gap: 2px;
    padding: 5px 6px calc(6px + env(safe-area-inset-bottom));
    /* Was Candid's ink written out in full, which meant a branded customer got
       a header in their colour and a tab bar in ours. Same colour, brandable. */
    background: color-mix(in srgb, var(--ink) 92%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid color-mix(in srgb, var(--on-ink) 10%, transparent);
  }
  .tabbar__item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 4px; border-radius: 12px;
    color: color-mix(in srgb, var(--on-ink) 60%, transparent);
    font-size: 10.5px; font-weight: 500;
    cursor: pointer;
    transition: transform .16s cubic-bezier(.32, .72, 0, 1), background .2s ease, color .2s ease;
  }
  .tabbar__item .ms { font-size: 22px }
  .tabbar__item[aria-current="page"] { color: var(--on-ink) }
  .tabbar__item:active { transform: scale(.9) }

  /* ---- Sent, on a phone ---------------------------------------------------
     Three desktop columns across 375px gave the company 90px to wrap a name
     down five lines, overlapped the five step labels into each other, and cut
     the sender's address to "robert...". Each row becomes a stacked card
     instead: who it went to, the sequence across the full width, then who it
     was sent from. The column header goes with the columns — a stack has no
     columns to name — so the sender row grows its own label. */
  .senttable { border-radius: 22px }
  .sentrow--head { display: none }
  .sentrow--head + .sentrow { border-top: none }
  .sentrow {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px; padding: 16px;
  }
  .sentrow__from { padding-top: 12px; border-top: 1px solid var(--hair) }
  .sentrow__from::before {
    content: "Sent from"; flex: 0 0 auto;
    font-size: 11px; font-weight: var(--weight-strong); color: var(--muted);
  }

  /* Five steps still fit across the width once the labels are allowed to wrap.
     They are held to a fixed two-line box so that a one-line "Initial" and a
     wrapped "Follow-up 1" still hang their dots on the same line — otherwise
     the rail between them runs diagonally. */
  .pip { gap: 4px }
  .pip__label {
    white-space: normal; text-align: center;
    font-size: 9.5px; line-height: 1.25; min-height: 24px;
    /* The padding is the gutter. Without it a 320px screen leaves the five
       labels exactly column-wide and touching each other. */
    padding: 0 2px;
  }
  .pip__dot { width: 20px; height: 20px; font-size: 12px }
  .pip__rail { top: 9px }
  .pip__date { font-size: 9.5px }

  table.tbl th { display: none }
  table.tbl td { display: block; padding: 4px 16px; border: none }
  table.tbl tbody tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--hair) }

  /* A phone gives it the full width rather than sizing it to its longest
     line, which is what left a two-line message looking wedged to one side.
     Centred by its own insets now, so there is no translate to preserve and
     the plain rise is the right animation. A 99px pill radius on a box that
     wraps to two lines reads as a bubble, so it softens to a corner. */
  .toast {
    left: 14px; right: 14px; transform: none; max-width: none;
    padding: 8px; border-radius: 18px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    animation-name: cdRise;
  }
  .toast--out { animation-name: cdFallPlain }

  /* The drawer on a phone. It stops short of the left edge so a sliver of the
     page it came from stays showing. That sliver is doing the explaining: it
     says this is a thing lying on top of something rather than a new screen,
     and it leaves an obvious place to reach for. Tapping it closes, because
     it is scrim; dragging the panel off the side closes too.

     The X in the corner goes with it. A sheet you can throw off the side does
     not need a second way out, and the top-right corner is the furthest part
     of a phone screen from the thumb holding it. */
  .drawer {
    left: 28px; right: 0; width: auto;
    /* Square corners, as the design has every full-height surface. The edge is
       drawn by the border and the shadow; rounding it as well made the panel
       read as a card floating on the page rather than a side that has been
       pulled across it. */
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow-top);
  }
  /* The browser keeps the vertical axis and the drag takes the horizontal one.
     Declaring it means the first sideways frame is ours rather than arriving
     after the browser has waited to see which way the finger was going.

     It goes on the two panes rather than on .drawer itself. A browser works
     out what a touch is allowed to do by intersecting the rules along the
     whole ancestor chain, so pan-y on the drawer and pan-x on the tab strip
     inside it left the strip with the intersection of the two — nothing — and
     it could not be scrolled by finger at all. Siblings do not intersect. */
  .drawer__head, .drawer__body { touch-action: pan-y }
  /* The grip. It sits in a gutter the head, the tabs and the body all widen
     to leave for it, so it never lands on top of anything. */
  .drawer::before {
    content: ""; position: absolute; z-index: 2; pointer-events: none;
    left: 6px; top: 50%; margin-top: -26px; width: 4px; height: 52px;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--text) 26%, transparent);
  }
  /* Mid-drag the panel is being moved, not read. */
  .drawer--dragging { user-select: none; -webkit-user-select: none }
  .drawer__head .closer { display: none }

  .drawer__head { height: 62px; flex-basis: 62px; padding: 0 16px 0 20px }
  .drawer__head:has(+ * > .drawer__tabs),
  .drawer__head:has(+ * > [data-skeleton] > .drawer__tabs) { height: auto; flex-basis: auto; padding-top: 12px }
  .drawer__tabs {
    padding: 4px 16px 0 8px; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none; touch-action: pan-x;
  }
  .drawer__tabs::-webkit-scrollbar { width: 0; height: 0 }
  .drawer__tabs > * { flex: 0 0 auto }
  .drawer__body { padding: 16px 14px calc(40px + env(safe-area-inset-bottom)) 20px }

  /* A dialog stays a dialog on a phone: same centred window, same corners, same
     entrance as the desktop. It used to anchor to the bottom and rise as a
     sheet with a grab handle, which made the same dialog look like two
     different components depending on the width of the screen.

     Only the measurements change — margin off the edges, and a height bounded
     by dvh so the mobile browser's own chrome cannot push the footer buttons
     out of reach. */
  .modal {
    --mpad: 20px;
    width: min(600px, calc(100vw - 24px));
    max-height: min(88vh, calc(100dvh - 32px));
  }
  .modal > .row:last-child, .modal > .csvflow > .row:last-child { padding-bottom: calc(var(--mpad) + env(safe-area-inset-bottom)) }
  /* Side by side when both fit, one above the other when they do not: two
     large buttons with long labels ("Keep it connected") ran past the edge. */
  .modal > .row:last-child, .modal > .csvflow > .row:last-child { flex-wrap: wrap }
  .modal > .row:last-child > .btn, .modal > .csvflow > .row:last-child > .btn { flex: 1 1 auto; justify-content: center }

  /* Search collapses to an icon and expands over the bar when tapped, because
     a permanent field leaves no room for the title on a 375px screen. */
  /* On ink, the button's card fill and grey border read as a hole punched in
     the bar. It takes the sidebar's treatment instead — a wash of the
     foreground colour, which follows a customer's palette either way. */
  .searchbtn {
    display: grid;
    background: color-mix(in srgb, var(--on-ink) 12%, transparent);
    border-color: color-mix(in srgb, var(--on-ink) 18%, transparent);
    color: var(--on-ink);
  }
  .topbar .search { display: none }
  .topbar .search[data-open="1"] {
    display: flex; position: absolute; left: 12px; right: 12px;
    top: calc(env(safe-area-inset-top) + 8px); z-index: 22;
  }
  .topbar .search[data-open="1"] { right: 62px }
  .topbar .search[data-open="1"] ~ .mavatar,
  .topbar .search[data-open="1"] ~ .gearbtn { display: none }
  .searchbtn { position: relative; z-index: 26 }

  /* Three columns of mapping do not fit; stack them and label the sample. */
  .maprow { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 4px }
  .maprow__head { display: none }
  .maprow__sample::before { content: "First row: "; font-weight: var(--weight-strong) }
  /* Stage matching stacks too; its count is not a first row. */
  .maprow.stagematch { grid-template-columns: minmax(0, 1fr) }
  .stagematch .maprow__sample::before { content: none }
  .stagematch__arrow { display: none }

  /* Onboarding. The bar becomes fixed and translucent so the card can scroll
     under it, and it inherits the shell's colour so it stays branded through
     the reveal rather than reverting to ink. No shadow under it: the bar and
     the page behind it are the same colour, so the only thing the shadow
     drew was a seam across the top of the screen. */
  .ob__bar {
    position: fixed; background: inherit;
    padding: calc(12px + env(safe-area-inset-top)) 18px 14px;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .ob__bar img { height: 21px }
  .ob__scroll { padding: 70px 14px calc(40px + env(safe-area-inset-bottom)) }
  .ob__card { padding: 22px 18px; border-radius: 22px }
  .ob__card h1 { font-size: 24px }
  .ob__providers { grid-template-columns: minmax(0, 1fr) }
  /* Five progress panels will not fit across a phone; they scroll instead of
     shrinking to unreadable. */
  .ob__cta { margin-left: 0; width: 100%; justify-content: center }
  .ob__foot { gap: 12px }
  .ob__hex { width: 100px; flex-basis: 100px }
}
