/* Dira. Brand: ink, ground and one signal orange (the dot in the logo), light and dark.
   One typeface, Instrument Sans. Surfaces are told apart by tone, not by shadows; the signal
   orange marks what is live (the dot, the working indicator, focus) and little else. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2-variations"),
       url("/static/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
}

/* ---- tokens -------------------------------------------------------------------------------- */

:root {
  color-scheme: light;
  --ground: #f6f6f3;
  --surface: #ffffff;
  --panel: #f6f6f3;
  --raised: #eeeeea;
  --hover: #e9e9e4;
  --active: #e3e3dd;
  --border: #e4e4de;
  --rule: #ecece7;
  --control: #cfcfc8;
  --ink: #111113;
  --muted: #5c5c57;
  --faint: #6b6b66;
  --signal: #ff5b1f;
  --primary: #111113;
  --on-primary: #f6f6f3;
  --negative: #b4232a;
  --neg-bg: #ffedea;
  --neg-ink: #831c1e;
  --pos-bg: #e3f6e9;
  --pos-ink: #14532d;
  --shadow-float: 0 1px 2px rgba(17, 17, 19, .04), 0 8px 24px rgba(17, 17, 19, .06);
  --data: #2a78d6; /* one data hue for charts (dataviz palette, slot 1) */
  --data-2: #1baf7a; /* a second part of a whole (slot 3, aqua: orange reads as a warning) */

  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sheet: 18px;
  --r-panel: 18px;
  --r-card: 14px;
  --r-input: 12px;
  --r-pill: 999px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --rail: 272px;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%235c5c57' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0c0c0d;
  --surface: #141416;
  --panel: #1a1a1d;
  --raised: #1f1f22;
  --hover: #242428;
  --active: #2b2b30;
  --border: #242427;
  --rule: #1f1f22;
  --control: #3b3b40;
  --ink: #ededea;
  --muted: #a8a8a2;
  --faint: #8f8f8a;
  --signal: #ff6a33;
  --primary: #ededea;
  --on-primary: #0c0c0d;
  --negative: #f0707a;
  --neg-bg: #2c1a1c;
  --neg-ink: #f6a4aa;
  --pos-bg: #15261b;
  --pos-ink: #8fe0ad;
  --shadow-float: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  --data: #3987e5;
  --data-2: #199e70;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23a8a8a2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0c0c0d;
    --surface: #141416;
    --panel: #1a1a1d;
    --raised: #1f1f22;
    --hover: #242428;
    --active: #2b2b30;
    --border: #242427;
    --rule: #1f1f22;
    --control: #3b3b40;
    --ink: #ededea;
    --muted: #a8a8a2;
    --faint: #8f8f8a;
    --signal: #ff6a33;
    --primary: #ededea;
    --on-primary: #0c0c0d;
    --negative: #f0707a;
    --neg-bg: #2c1a1c;
    --neg-ink: #f6a4aa;
    --pos-bg: #15261b;
    --pos-ink: #8fe0ad;
    --shadow-float: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  --data: #3987e5;
  --data-2: #199e70;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23a8a8a2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

/* ---- base ---------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  font-feature-settings: "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: color-mix(in srgb, var(--signal) 28%, transparent); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* the boot screen */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-note { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.boot-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--signal); animation: breathe 1.2s var(--ease) infinite alternate; }
.boot-error { margin: 48px auto; max-width: 480px; }

/* ---- the logo ------------------------------------------------------------------------------ */

.brand { display: inline-flex; color: var(--ink); line-height: 0; }
.brand svg { display: block; width: 100%; height: auto; overflow: visible; }
.brand-fallback { font-weight: 700; font-size: 22px; letter-spacing: -0.03em; line-height: 1; }
.mark-dot { fill: var(--signal); }
.mark-route { stroke: none; }
.mark-ping { fill: none; stroke: var(--signal); stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; }
.lockup.is-pinged .mark-ping { animation: ping .95s var(--ease-out); }
.lockup.is-intro .word path { transform: translateY(190px); }
.lockup.is-word-in .word path { transform: none; transition: transform .85s var(--ease-out); }
.lockup.is-word-in .word path:nth-child(2) { transition-delay: .07s; }
.lockup.is-word-in .word path:nth-child(3) { transition-delay: .14s; }
.lockup.is-word-in .word path:nth-child(4) { transition-delay: .21s; }
.lockup.is-word-out .word path { transition: transform .6s cubic-bezier(.7, 0, .84, 0); }
.lockup.is-word-out .word path:nth-child(3) { transition-delay: .05s; }
.lockup.is-word-out .word path:nth-child(2) { transition-delay: .1s; }
.lockup.is-word-out .word path:nth-child(1) { transition-delay: .15s; }
.bar-lockup { width: 84px; }
.brand-symbol { width: 100%; }

/* ---- buttons and fields -------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px; border: 1px solid var(--primary); border-radius: var(--r-pill);
  background: var(--primary); color: var(--on-primary);
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), background-color .2s, border-color .2s, opacity .2s;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--control); }
.btn-quiet:hover { background: var(--hover); opacity: 1; }
.btn-danger { background: transparent; color: var(--negative); border-color: color-mix(in srgb, var(--negative) 45%, transparent); }
.btn-danger:hover { background: var(--neg-bg); opacity: 1; }
.btn-small { min-height: 32px; padding: 0 13px; font-size: 13px; }
.btn-block { width: 100%; }
.linkish {
  padding: 0; border: 0; background: none; color: var(--ink);
  font-size: 14px; text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 3px;
}
.linkish:hover { text-decoration-color: var(--ink); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted);
  transition: background-color .2s, color .2s, transform .15s var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }

.theme-toggle {
  position: fixed; z-index: 50; top: 18px; right: 22px;
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink);
  transition: background-color .2s, transform .2s var(--ease);
}
.theme-toggle:hover { background: var(--hover); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle .icon { width: 17px; height: 17px; animation: spin-in .45s var(--ease-out); }

.field { display: grid; gap: 7px; margin: 0 0 16px; }
.field > label, .field > span:first-child { font-size: 13px; font-weight: 500; color: var(--ink); }
.input, textarea, select {
  width: 100%; min-height: 42px; padding: 9px 13px;
  border: 1px solid var(--control); border-radius: var(--r-input);
  background: var(--surface); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
select.input { appearance: none; padding-right: 38px; background: var(--surface) var(--chevron) no-repeat right 13px center / 16px 16px; }
.input:hover { border-color: var(--faint); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 22%, transparent); }
.input::placeholder, textarea::placeholder { color: var(--faint); }
.hint { font-size: 13px; color: var(--muted); }
.sub { font-size: 14px; color: var(--muted); }
.lede { font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 40em; }
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.form-row .field { margin: 0; }
.row-between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.number-field { display: flex; align-items: center; gap: 10px; }
.number-field .input { max-width: 12rem; font-variant-numeric: tabular-nums; }
.number-field .unit { color: var(--muted); white-space: nowrap; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }
.check {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 12px;
  border: 1px solid var(--control); border-radius: var(--r-pill); background: var(--surface); font-size: 14px; cursor: pointer;
}
.check:has(input:checked) { border-color: var(--ink); }
.check input { accent-color: var(--ink); margin: 0; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--r-input);
  background: var(--raised); color: var(--ink); font-size: 14px; line-height: 1.5;
}
.notice.error { background: var(--neg-bg); color: var(--neg-ink); }
.note-icon { display: inline-grid; padding-top: 2px; color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; margin-left: 8px;
  border-radius: var(--r-pill); background: var(--raised); color: var(--muted);
  font-size: 12px; font-weight: 500; vertical-align: 2px;
}
.badge-warn { background: var(--neg-bg); color: var(--neg-ink); }

/* ---- tiles: one choice (radio) or several (checkbox), as cards ------------------------------ */

.tiles { list-style: none; margin: 28px 0 8px; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.answer-tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tile {
  position: relative; display: grid; gap: 4px; align-content: start; min-height: 64px; height: 100%;
  padding: 16px 44px 16px 16px; border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--surface); color: var(--ink); text-align: left; text-decoration: none; cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .15s var(--ease);
}
.tile:hover { border-color: var(--control); }
.tile:active { transform: scale(.985); }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }
.tile:has(input:checked), .tile.is-picked { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tile-name { font-weight: 600; font-size: 15px; }
.tile-help { font-size: 14px; color: var(--muted); line-height: 1.45; }
.tile-check {
  position: absolute; top: 15px; right: 14px; display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--control); color: transparent;
  transition: background-color .2s, border-color .2s, color .2s, transform .25s var(--ease-out);
}
.tile-check .icon { width: 12px; height: 12px; stroke-width: 2.2; }
.tile:has(input:checked) .tile-check { background: var(--ink); border-color: var(--ink); color: var(--on-primary); transform: scale(1.06); }
.tile-button { width: 100%; font: inherit; }
.tile-dashed { border-style: dashed; background: transparent; }
.role-item { display: grid; gap: 8px; }
.role-card { position: relative; height: 100%; }
.role-card .tile { padding-right: 76px; }
.info-btn {
  position: absolute; top: 11px; right: 42px; display: grid; place-items: center;
  width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted);
  transition: background-color .2s, color .2s;
}
.info-btn:hover, .info-btn[aria-expanded="true"] { background: var(--raised); color: var(--ink); }
.role-details { margin: 0; padding: 12px 16px 12px 32px; border-radius: var(--r-card); background: var(--raised); font-size: 14px; color: var(--muted); animation: rise .25s var(--ease); }
.role-details li + li { margin-top: 4px; }
.role-hint { margin: 4px 0 18px; }

/* ---- landing page -------------------------------------------------------------------------- */

.landing { min-height: 100dvh; display: flex; flex-direction: column; }
.landing-main { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 40px; }
/* The first screen: logo, headline and sign-in, centred in the window as a group, so the role
   example starts on the second screen. */
.landing-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: 0 96px;
  align-items: start; align-content: center; min-height: 100vh; min-height: 100dvh; padding: 72px 0;
  scroll-snap-align: start;
}
.hero-lockup { display: flex; width: clamp(200px, 21vw, 300px); margin: 0 0 64px; cursor: pointer; }
.landing-copy h1 {
  font-size: clamp(44px, 6vw, 88px); line-height: .96; letter-spacing: -0.045em; font-weight: 600;
  max-width: 11ch; text-wrap: balance;
  animation: rise .8s var(--ease-out) .15s both;
}
/* What Dira is, said once and quietly, just above the headline: sentence case, muted, led
   by the logo's dot. It belongs to the headline, so it sits close to it. */
.landing-tagline {
  display: flex; align-items: center; gap: 10px; margin: 0 0 54px;
  font-size: clamp(14px, 1.05vw, 16px); font-weight: 500; letter-spacing: -0.005em; color: var(--muted);
  animation: rise .8s var(--ease-out) .1s both;
}
.tagline-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.hero-lockup + .landing-tagline { margin-top: -38px; }
.landing-sub {
  margin-top: 32px; max-width: 31em; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.5; color: var(--ink);
  animation: rise .8s var(--ease-out) .3s both;
}
.landing-auth {
  align-self: end; padding: 28px; border-radius: 22px; background: var(--surface);
  border: 1px solid var(--border); animation: rise .8s var(--ease-out) .4s both;
}
.landing-auth > .notice { margin-bottom: 16px; }
.auth-form h2 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 20px; }
.auth-form form .btn-block { margin-top: 6px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 16px; }
.auth-note { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }

html.is-landing { scroll-snap-type: y proximity; scroll-behavior: smooth; }

/* The sign-in card lines up with the headline, under the logo. */
/* The sign-in card's top lines up with the top of the logo. */
.landing-hero > .landing-auth { align-self: start; margin-top: 0; }

/* "Connects to": a quiet band of platform names or logos drifting past, under the hero. */
.platforms {
  grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 32px;
  margin-top: 88px;
  animation: rise .8s var(--ease-out) .6s both;
}
.platforms-label { font-size: 14px; color: var(--muted); white-space: nowrap; }
.platform-window {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.platform-track { display: flex; width: max-content; animation: drift 32s linear infinite; }
.platform-window:hover .platform-track { animation-play-state: paused; }
.platform-list { display: flex; align-items: center; gap: 64px; margin: 0; padding: 0 32px; list-style: none; }
.platform { display: flex; align-items: center; height: 40px; flex: none; }
.platform-name { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; transition: color .2s; }
.platform-any .platform-name { color: var(--muted); font-weight: 500; }
.platform-name:hover { color: var(--signal); }
.platform-logo { display: block; height: 26px; width: auto; max-width: 160px; object-fit: contain; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .platform-track { animation: none; width: auto; }
  .platform-list[aria-hidden="true"] { display: none; }
  .platform-list { flex-wrap: wrap; gap: 16px 40px; padding: 0; }
  .platform-window { -webkit-mask-image: none; mask-image: none; }
}
.tile-logo { display: block; height: 22px; width: auto; max-width: 120px; object-fit: contain; margin-bottom: 8px; }
.scroll-cue {
  display: inline-flex; align-items: center; gap: 14px;
  margin-top: 44px; padding: 0; border: 0; background: none; color: var(--ink); font-size: 15px; font-weight: 500;
  animation: rise .8s var(--ease-out) .45s both; transition: color .2s;
}
.scroll-cue:hover { color: var(--ink); }
.scroll-cue-icon {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--control); background: var(--surface); color: var(--ink);
  animation: nudge 2.2s var(--ease) 1.8s infinite; transition: background-color .2s, transform .2s var(--ease);
}
.scroll-cue:hover .scroll-cue-icon { background: var(--hover); }
.scroll-cue:active .scroll-cue-icon { transform: scale(.92); }
@keyframes nudge { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(6px); } }
/* The second screen: the role example, centred in the window. */
.demo {
  scroll-snap-align: start; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; padding: 40px 0 0;
}
/* The example is centred in the space above the foot; the foot sits on the window's edge. */
.demo > .demo-head { margin-top: auto; }
.demo { margin-top: 0; animation: rise .8s var(--ease-out) .5s both; }
/* The heading sits over the example and the sentence over the role list, on the same two
   columns, so both left edges line up and the sentence ends on the heading's last line. */
.demo-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 24px; align-items: end; margin-bottom: 40px; }
.demo-head h2 { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.02; letter-spacing: -0.035em; max-width: 13ch; }
.demo-head p { font-size: 17px; line-height: 1.5; max-width: 26em; padding: 0 4px 4px 20px; color: var(--muted); }
.demo-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 24px; align-items: stretch; }
.demo-window { display: flex; flex-direction: column; padding: 28px 32px 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); }
.demo-thread { flex: 1; display: grid; gap: 20px; min-height: 280px; align-content: start; }
.demo-thread .msg { animation: none; }
.demo-note { margin-top: 18px; font-size: 12.5px; color: var(--faint); }
.demo-tabs { display: grid; gap: 8px; align-content: start; }
.demo-tab {
  display: grid; gap: 3px; padding: 16px 20px; border: 1px solid transparent; border-radius: var(--r-card);
  background: var(--raised); color: var(--ink); text-align: left;
  transition: background-color .25s var(--ease), border-color .25s, transform .15s var(--ease);
}
.demo-tab:hover { background: var(--hover); }
.demo-tab:active { transform: scale(.985); }
.demo-tab-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.demo-tab-name::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--control); transition: background-color .25s, transform .3s var(--ease-out); }
.demo-tab-help { font-size: 14px; color: var(--muted); padding-left: 18px; }
.demo-tab[aria-selected="true"] { background: var(--surface); border-color: var(--ink); }
.demo-tab[aria-selected="true"] .demo-tab-name::before { background: var(--signal); transform: scale(1.15); }
.landing-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: auto; padding: 28px 0 24px; font-size: 13px; color: var(--muted);
}
.demo-body + .landing-foot { margin-top: auto; }
.foot-name { display: inline-flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.foot-mark { width: 14px; }
/* Back to the top: the logo's dot on a short route. Hover and it drives up. */
.to-top {
  display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 4px 0 0;
  border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 500;
  transition: color .2s;
}
.to-top:hover, .to-top:focus-visible { color: var(--ink); }
.to-top-route {
  position: relative; width: 2px; height: 24px; border-radius: 1px; background: var(--control);
}
.to-top-dot {
  position: absolute; left: 50%; bottom: -3px; width: 8px; height: 8px; margin-left: -4px;
  border-radius: 50%; background: var(--signal);
  transition: transform .55s cubic-bezier(.65, 0, .25, 1);
}
.to-top:hover .to-top-dot, .to-top:focus-visible .to-top-dot { transform: translateY(-21px); }
.to-top:active .to-top-dot { transform: translateY(-21px) scale(.8); }

/* ---- onboarding ---------------------------------------------------------------------------- */

.onboard-bar { display: flex; align-items: center; height: 72px; padding: 0 80px 0 32px; }
.role-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.onboard { min-height: 100dvh; }
.onboard-inner { max-width: 760px; margin: 0 auto; padding: 24px 24px 80px; }
.onboard-inner.narrow { max-width: 560px; }
.onboard-inner > * { animation: rise .55s var(--ease-out) both; }
.onboard-inner > :nth-child(2) { animation-delay: .05s; }
.onboard-inner > :nth-child(3) { animation-delay: .1s; }
.onboard-inner > :nth-child(4) { animation-delay: .15s; }
.onboard-inner > :nth-child(n+5) { animation-delay: .2s; }
.onboard-inner h1 { font-size: clamp(28px, 3.4vw, 38px); letter-spacing: -0.03em; line-height: 1.1; margin: 28px 0 12px; text-wrap: balance; }
.onboard-inner h1.question { margin-top: 28px; }
.onboard-inner .form-row { margin-top: 20px; }
.onboard-inner form > .btn, .onboard-inner form > .field + .btn { margin-top: 8px; }
.setup-nav { align-items: center; }
.setup-nav .linkish { margin-left: auto; }
.stepper { display: grid; gap: 10px; }
.stepper-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stepper-seg { height: 4px; border-radius: 2px; background: var(--raised); overflow: hidden; }
.stepper-fill { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(var(--fill, 0)); transition: transform .6s var(--ease-out); animation: grow .7s var(--ease-out); }
.stepper-text { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.connect-form, .panel { margin-top: 16px; padding: 20px; border-radius: var(--r-panel); background: var(--panel); }
.connect-form .sub { margin: 4px 0 14px; }
.platform-tiles { margin-top: 24px; }

/* ---- the app: rail + sheet ----------------------------------------------------------------- */

.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); height: 100dvh; }
.rail { display: flex; flex-direction: column; min-height: 0; padding: 14px 12px 12px; background: var(--ground); }
.rail-head { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 8px; margin-bottom: 14px; }
.rail-brand { display: inline-flex; padding: 6px 0; }
.rail-close { display: none; }
.btn-new {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; margin: 0 2px 14px;
  border: 1px solid var(--control); border-radius: var(--r-pill); background: var(--surface);
  color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background-color .2s, transform .15s var(--ease);
}
.btn-new:hover { background: var(--hover); }
.btn-new:active { transform: scale(.98); }
.rail-filter { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 12px; }
.rail-chip {
  height: 28px; padding: 0 11px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: transparent; color: var(--muted); font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.rail-chip:hover { color: var(--ink); }
.rail-chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.rail-label { padding: 6px 10px 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.fleets { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.convos { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.convos a {
  display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px;
  color: var(--ink); text-decoration: none; transition: background-color .15s;
}
.convos a:hover { background: var(--hover); }
.convos a[aria-current="page"] { background: var(--active); }
.convo-icon { display: grid; place-items: center; width: 16px; height: 20px; color: var(--muted); }
.convo-text { display: grid; min-width: 0; }
.convo-title { font-size: 14px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-tags { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convos .empty { padding: 8px 10px; font-size: 13px; color: var(--muted); }
.rail-foot { display: grid; gap: 1px; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--rule); }
.rail-link {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 10px;
  color: var(--ink); font-size: 14px; text-decoration: none; transition: background-color .15s;
}
.rail-link .icon { color: var(--muted); }
.rail-link:hover { background: var(--hover); }
.rail-link[aria-current="page"] { background: var(--active); }
.who-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px 0 6px; margin-top: 4px; }
.avatar {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%;
  background: var(--ink); color: var(--ground); font-size: 13px; font-weight: 600;
}
.who { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scrim { display: none; }

.main {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  margin: 8px 8px 8px 0; border-radius: var(--r-sheet); background: var(--surface); border: 1px solid var(--border);
  overflow: hidden;
}
.topbar { display: flex; align-items: center; gap: 8px; height: 56px; flex: none; padding: 0 72px 0 22px; border-bottom: 1px solid var(--rule); }
.topbar .menu-btn, .topbar-mark { display: none; }
.topbar-mark { width: 22px; }
.topbar-title { min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-area { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.account-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px;
  padding: 10px 24px 0; font-size: 13px; color: var(--muted);
}
.account-strip strong { color: var(--ink); font-weight: 600; }
.account-strip a { color: var(--ink); }
.strip-warn { color: var(--negative) !important; font-weight: 500; }
.setup-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin: 14px auto 0; width: calc(100% - 48px); max-width: 760px; padding: 10px 10px 10px 16px;
  border-radius: var(--r-card); background: var(--panel); font-size: 14px;
}
.email-note { margin: 14px auto 0; width: calc(100% - 48px); max-width: 760px; }

/* ---- chat ---------------------------------------------------------------------------------- */

.thread { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.thread-inner { max-width: 760px; margin: 0 auto; padding: 32px 24px 24px; display: grid; gap: 26px; align-content: start; }
.msg { animation: rise .35s var(--ease-out) both; min-width: 0; }
.msg-user { display: flex; justify-content: flex-end; }
.bubble {
  max-width: min(82%, 560px); padding: 10px 16px; border-radius: 20px 20px 6px 20px;
  background: var(--raised); font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg-agent { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 14px; align-items: start; }
.agent-mark { width: 20px; margin-top: 3px; }
.msg-body { min-width: 0; }
.trigger-note { justify-self: end; font-size: 12.5px; color: var(--muted); padding: 4px 12px; border-radius: var(--r-pill); background: var(--raised); }
.msg-error { margin-top: 10px; padding: 10px 14px; border-radius: var(--r-input); background: var(--neg-bg); color: var(--neg-ink); font-size: 14px; }

.md { font-size: 15.5px; line-height: 1.65; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol { margin: 0 0 .75em; }
.md ul, .md ol { padding-left: 1.25em; }
.md li { margin: .2em 0; padding-left: .2em; }
.md ul > li::marker { color: var(--signal); }
.md strong { font-weight: 600; }
.md h1, .md h2, .md h3 { font-size: 16px; margin: 1em 0 .4em; }
.md a { color: var(--ink); text-decoration-color: var(--control); }
.md a:hover { text-decoration-color: var(--ink); }
.md code { font-size: .9em; padding: .1em .35em; border-radius: 6px; background: var(--raised); }
.md pre { padding: 12px 14px; border-radius: var(--r-input); background: var(--raised); overflow-x: auto; }
.md blockquote { margin: 0 0 .75em; padding-left: 14px; border-left: 2px solid var(--signal); color: var(--muted); }
.md hr { border: 0; height: 1px; background: var(--rule); margin: 1.2em 0; }
.table-wrap { overflow-x: auto; margin: 0 0 .9em; }
.md table { border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 60%; }
.md th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 6px 14px 6px 0; border-bottom: 1px solid var(--border); }
.md td { padding: 7px 14px 7px 0; border-bottom: 1px solid var(--rule); }
.md th[align="right"], .md td[align="right"] { text-align: right; }

.working { display: flex; align-items: center; gap: 12px; height: 26px; font-size: 14px; color: var(--muted); }
.lane { position: relative; width: 34px; height: 2px; border-radius: 1px; background: var(--rule); }
.lane::after {
  content: ""; position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal); animation: drive 1.15s var(--ease) infinite alternate;
}

.welcome { padding-top: clamp(32px, 10vh, 96px); }
.welcome > * { animation: rise .55s var(--ease-out) both; }
.welcome > :nth-child(2) { animation-delay: .06s; }
.welcome > :nth-child(3) { animation-delay: .12s; }
.welcome > :nth-child(4) { animation-delay: .18s; }
.welcome h1 { font-size: clamp(26px, 2.6vw, 32px); letter-spacing: -0.03em; text-wrap: balance; }
.welcome > p { margin-top: -14px; font-size: 16px; color: var(--muted); max-width: 36em; }
.starters { list-style: none; margin: 4px 0 0; padding: 0; border-radius: var(--r-panel); background: var(--panel); overflow: hidden; }
.starters li + li { border-top: 1px solid var(--surface); }
.starters button {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%;
  padding: 14px 18px; border: 0; background: transparent; text-align: left; font-size: 15px;
  transition: background-color .15s;
}
.starters button:hover { background: var(--hover); }
.starters .icon { color: var(--muted); transition: transform .25s var(--ease), color .2s; }
.starters button:hover .icon { transform: translateX(3px); color: var(--ink); }

.composer { flex: none; width: 100%; max-width: 808px; margin: 0 auto; padding: 8px 24px 14px; }
.composer form {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 18px;
  border: 1px solid var(--control); border-radius: 26px; background: var(--surface);
  box-shadow: var(--shadow-float); transition: border-color .2s, box-shadow .2s;
}
.composer form:focus-within { border-color: var(--faint); }
.composer textarea {
  flex: 1; min-height: 40px; max-height: 192px; padding: 9px 0; border: 0; border-radius: 0;
  background: transparent; resize: none; font-size: 15.5px; line-height: 22px;
}
.composer textarea:focus { outline: none; box-shadow: none; }
.send-btn {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%;
  background: var(--raised); color: var(--muted); transition: background-color .2s, color .2s, transform .15s var(--ease);
}
.composer form.has-text .send-btn { background: var(--primary); color: var(--on-primary); }
.send-btn:active { transform: scale(.92); }
.send-btn:disabled { opacity: .5; cursor: not-allowed; }
.send-btn .icon { width: 18px; height: 18px; stroke-width: 1.9; }
.composer .meta { margin-top: 8px; text-align: center; font-size: 12px; color: var(--faint); }

/* cards inside the chat: memories, drafts, connecting a platform */
.memory-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px 10px 14px;
  border-radius: var(--r-card); background: var(--panel); font-size: 14px;
}
.memory-label { font-weight: 600; }
.memory-text { flex: 1; min-width: 12em; color: var(--muted); }
.email-draft, .draft-card {
  padding: 18px 20px; border-radius: var(--r-panel); background: var(--panel); border: 1px solid var(--border);
}
.draft-card h3 { font-size: 16px; margin-bottom: 4px; }
.draft-card .connect-form { background: transparent; padding: 0; }
.draft-label { font-size: 13px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.draft-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }
.email-draft.is-done .draft-label::before { background: var(--faint); }
.draft-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 12px; font-size: 14px; }
.draft-head dt { color: var(--muted); }
.draft-head dd { margin: 0; overflow-wrap: anywhere; }
.draft-body { padding: 14px 16px; border-radius: var(--r-input); background: var(--surface); white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; }
.email-draft .sub { margin: 10px 0 12px; }
.draft-status { font-size: 14px; color: var(--muted); margin-top: 8px; }
.draft-status:empty { display: none; }

/* ---- pages: accounts, settings, review ----------------------------------------------------- */

.page { flex: 1; min-height: 0; overflow-y: auto; }
.page-inner { max-width: 1080px; margin: 0 auto; padding: 40px 40px 96px; }
.page-inner > h1 { font-size: 28px; letter-spacing: -0.03em; animation: rise .5s var(--ease-out) both; }
.page-inner > .lede { margin-top: 10px; font-size: 15.5px; animation: rise .5s var(--ease-out) .05s both; }
.section {
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 16px 48px;
  padding: 32px 0; border-top: 1px solid var(--rule); animation: rise .55s var(--ease-out) both;
}
.page-inner > h1 + .section, .page-inner > .lede + .section { margin-top: 32px; }
.section:nth-of-type(2) { animation-delay: .04s; }
.section:nth-of-type(3) { animation-delay: .08s; }
.section:nth-of-type(n+4) { animation-delay: .12s; }
.section-head h2 { font-size: 16px; }
.section-head p { margin-top: 6px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.section-body { min-width: 0; padding: 20px; border-radius: var(--r-panel); background: var(--panel); }
.section-body > * + * { margin-top: 14px; }
.section-body > .form-row:not(:first-child), .section-body > form + * { margin-top: 14px; }
.section-body .tiles { margin-top: 0; }
.section-body .connect-form { margin-top: 0; padding: 0; background: transparent; }
.section-body .tile { background: var(--surface); }
.section-body form > .btn { margin-top: 14px; }
.email-address, .link-code { font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.link-code { padding: 2px 8px; border-radius: 8px; background: var(--surface); letter-spacing: .04em; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.rows > li:first-child { border-top: 0; padding-top: 0; }
.rows > li:last-child { padding-bottom: 0; }
.account-name { font-weight: 600; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-panel { flex-basis: 100%; }
.row-panel:empty { display: none; }
.row-panel .panel { background: var(--surface); }

.review-card h2 { font-size: 18px; margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0 0 14px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
details summary { cursor: pointer; font-size: 14px; font-weight: 500; }
.guide { margin: 10px 0 14px; padding: 14px; border-radius: var(--r-input); background: var(--surface); font-size: 13px; white-space: pre-wrap; max-height: 320px; overflow: auto; }

/* ---- motion -------------------------------------------------------------------------------- */

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes drive { from { transform: translateX(0); } to { transform: translateX(26px); } }
@keyframes breathe { from { transform: scale(.75); opacity: .6; } to { transform: scale(1.15); opacity: 1; } }
@keyframes ping { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(2.8); } }
@keyframes spin-in { from { transform: rotate(-90deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes reveal {
  from { clip-path: circle(0 at var(--reveal-x, 100%) var(--reveal-y, 0)); }
  to { clip-path: circle(var(--reveal-r, 150vmax) at var(--reveal-x, 100%) var(--reveal-y, 0)); }
}
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: reveal .6s cubic-bezier(.65, 0, .25, 1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* ---- smaller screens ----------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .landing-hero { grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: 0 48px; }
  .demo-body, .demo-head { grid-template-columns: minmax(0, 1fr) 300px; }
  .section { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  :root { --rail: 0px; }
  .shell { display: block; position: relative; }
  .rail {
    /* Above the fixed top buttons (theme, messages, menu: 50-51) once it slides in. */
    position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(320px, 86vw);
    padding-top: max(14px, env(safe-area-inset-top)); background: var(--ground);
    transform: translateX(-102%); transition: transform .35s var(--ease-out);
    box-shadow: var(--shadow-float);
  }
  .rail-open .rail { transform: none; }
  .rail-close { display: inline-grid; }
  .scrim {
    display: block; position: fixed; z-index: 55; inset: 0; background: rgba(0, 0, 0, .32);
    opacity: 0; pointer-events: none; transition: opacity .3s;
  }
  .rail-open .scrim { opacity: 1; pointer-events: auto; }
  .main { height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .topbar { height: 56px; padding: 0 60px 0 8px; padding-top: env(safe-area-inset-top); }
  .topbar .menu-btn, .topbar-mark { display: inline-flex; }
  .theme-toggle { top: max(10px, calc(env(safe-area-inset-top) + 10px)); right: 12px; }
  .thread-inner { padding: 24px 16px 16px; }
  .composer { padding: 6px 12px max(12px, env(safe-area-inset-bottom)); }
  .composer .meta { display: none; }
  .account-strip { padding: 10px 16px 0; justify-content: flex-start; }
  .setup-banner, .email-note { width: calc(100% - 32px); }
  .page-inner { padding: 28px 16px 72px; }
  .section { padding: 24px 0; }
  .section-body { padding: 16px; }

  .onboard-bar { height: 56px; padding: 0 60px 0 16px; }
  .landing-main { display: flex; flex-direction: column; align-items: stretch; padding: 22px 16px 0; }
  .hero-lockup { width: min(190px, 52vw); margin: 0 0 40px; }
  .landing-sub { margin-top: 20px; }
  .landing-hero { display: contents; }
  .landing-hero > .landing-auth { margin-top: 36px; padding: 22px 18px; align-self: stretch; }

  /* On a phone: logo, headline, sign-in, then the way down to the example. */
  .landing-copy { display: contents; }
  .hero-lockup { order: 1; }
  .landing-tagline { order: 2; margin: 0 0 42px; }
  .hero-lockup + .landing-tagline { margin-top: -22px; }
  .landing-copy h1 { order: 3; }
  .landing-sub { order: 3; }
  .landing-hero > .landing-auth { order: 4; }
  .scroll-cue { order: 5; margin-top: 24px; align-self: flex-start; }
  .platforms { order: 6; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 48px; }
  .platform-list { gap: 40px; }
  .platform-name { font-size: 18px; }
  .demo { order: 7; scroll-margin-top: 16px; min-height: 0; display: block; padding: 0; }
  .demo { margin-top: 80px; }
  .demo-head { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 24px; }
  .demo-head p { font-size: 16px; padding: 0; }
  .demo-body { grid-template-columns: minmax(0, 1fr); }
  .demo-tabs { order: -1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .demo-tabs::-webkit-scrollbar { display: none; }
  .demo-tab { flex: none; padding: 10px 14px; border-radius: var(--r-pill); }
  .demo-tab-help { display: none; }
  .demo-window { padding: 20px 16px 16px; }
  .demo-thread { min-height: 320px; }
  .landing-foot { padding: 40px 0 28px; }
  .onboard-inner { padding: 12px 16px 64px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .bubble { max-width: 88%; }
  .msg-agent { grid-template-columns: 20px minmax(0, 1fr); gap: 10px; }
  .agent-mark { width: 17px; }
  .btn, .input, select.input { min-height: 44px; }
  .btn-small { min-height: 36px; }
  .convos a, .rail-link { min-height: 44px; align-items: center; }
}

/* spacing inside settings forms */
.section-body form > * + * { margin-top: 14px; }
.section-body form > .checks { margin: 16px 0 0; }
.section-body form > .form-row + .form-row { margin-top: 18px; }

/* The role demo's heading changes with the role playing; the active role counts down to the
   next one with a thin signal-orange bar. */
.demo-head .demo-title {
  max-width: 21ch; min-height: 2.1em; font-size: clamp(28px, 2.9vw, 42px); line-height: 1.05;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.demo-title.is-leaving { opacity: 0; transform: translateY(-8px); }
.demo-title.is-arriving { opacity: 0; transform: translateY(10px); transition: none; }
.demo-tab { position: relative; overflow: hidden; }
.demo-tab-timer {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: var(--signal);
  transform: scaleX(0); transform-origin: left;
}
.demo-tab.is-counting .demo-tab-timer { animation: countdown 4.5s linear forwards; }
@keyframes countdown { to { transform: scaleX(1); } }

/* ---- organizations: sign-up step, paused service, invite banner ---------------------------- */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.stepper-track:has(> :nth-child(4)) { grid-template-columns: repeat(4, 1fr); }
.stepper-track:has(> :nth-child(5)) { grid-template-columns: repeat(5, 1fr); }
.stepper-one .stepper-track { grid-template-columns: 1fr; }
.aside-note { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 14px; line-height: 1.55; color: var(--muted); }
.aside-note strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.paused { padding-top: clamp(32px, 12vh, 120px); }
.paused .sub { margin-top: 14px; max-width: 34em; line-height: 1.55; }
.paused-dot {
  display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--control);
  box-shadow: 0 0 0 6px var(--raised);
}
.invite-banner { margin: 0 0 18px; padding: 14px 16px; border-radius: var(--r-input); background: var(--pos-bg); color: var(--pos-ink); font-size: 14px; line-height: 1.5; }
.invite-banner.is-error { background: var(--neg-bg); color: var(--neg-ink); }
.invite-banner .invite-title { font-weight: 600; }
.invite-banner strong { overflow-wrap: anywhere; }

/* ---- the rail: home, team, admin, chat menus ----------------------------------------------- */

.rail-top { display: grid; gap: 1px; margin: 0 0 12px; }
.rail-admin {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; margin-bottom: 6px;
  border: 1px solid var(--control); border-radius: 10px; color: var(--ink); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: background-color .15s;
}
.rail-admin:hover { background: var(--hover); }
.convo-group + .convo-group { margin-top: 10px; }
.convo-item { position: relative; }
.convo-item > a { padding-right: 36px; }
.convo-more {
  position: absolute; top: 6px; right: 4px; width: 28px; height: 28px; opacity: 0;
  transition: opacity .15s;
}
.convo-more .icon { stroke-width: 2.6; }
.convo-item:hover .convo-more, .convo-more:focus-visible, .convo-item.menu-open .convo-more,
.convo-item > a[aria-current="page"] + .convo-more { opacity: 1; }
@media (hover: none) { .convo-more { opacity: 1; } }
.convo-menu {
  position: absolute; z-index: 20; top: 36px; right: 4px; min-width: 168px; padding: 6px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-float);
  animation: rise .18s var(--ease-out) both;
}
.convo-menu-item {
  display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink); font-size: 14px; text-align: left;
}
.convo-menu-item:hover, .convo-menu-item:focus-visible { background: var(--hover); outline: none; }
.convo-menu-item.is-danger { color: var(--negative); }
.convo-menu-note { padding: 6px 10px 4px; font-size: 13px; color: var(--muted); }
.convo-item form { padding: 3px 2px; }
.convo-rename { min-height: 36px; padding: 6px 10px; font-size: 14px; }
.convo-error { padding: 2px 10px 6px; font-size: 12.5px; color: var(--negative); }
.who { display: grid; }
.who-email, .who-org { overflow: hidden; text-overflow: ellipsis; }
.who-org { font-size: 12px; color: var(--faint); }

/* ---- home dashboard ------------------------------------------------------------------------- */

.home-inner { max-width: 1120px; }
.home-head h1 { font-size: clamp(26px, 2.6vw, 32px); letter-spacing: -0.03em; line-height: 1.1; animation: rise .5s var(--ease-out) both; }
.home-meta { margin-top: 8px; font-size: 14px; color: var(--muted); }
.home-ask {
  display: flex; align-items: center; gap: 8px; margin: 24px 0 8px; padding: 6px 6px 6px 16px;
  border: 1px solid var(--control); border-radius: var(--r-pill); background: var(--surface);
  animation: rise .5s var(--ease-out) .05s both;
}
.home-ask:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 22%, transparent); }
.home-ask-input { flex: 1; min-width: 0; min-height: 40px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.home-ask-input:focus { box-shadow: none; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0 56px; margin-top: 16px; }
.home-main, .home-side { min-width: 0; }
.home-section { padding: 28px 0; border-top: 1px solid var(--rule); animation: rise .55s var(--ease-out) .08s both; }
.home-main > .home-section:first-child, .home-side > .home-section:first-child { border-top: 0; }
.home-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.home-section-head h2 { font-size: 16px; }
.home-section-aside { font-size: 13px; color: var(--muted); }
a.home-section-aside { color: var(--ink); text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 3px; }
.home-section .count { min-width: 22px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--ink); color: var(--ground); font-size: 12px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.home-empty { font-size: 15px; color: var(--muted); line-height: 1.55; }
.home-empty a { color: var(--ink); }
.home-note { margin-top: 12px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.home-stamp { margin-top: 12px; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.home-fleet .notice { margin-top: 12px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); margin: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.kpis + .kpis { border-top: 0; }
.kpi { padding: 14px 16px 16px; border-left: 1px solid var(--rule); }
.kpi:first-child { border-left: 0; padding-left: 0; }
.kpi dt { font-size: 13px; color: var(--muted); }
.kpi dd { display: grid; gap: 2px; margin: 6px 0 0; }
.kpi-value { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 12.5px; color: var(--faint); }
.kpi.is-good .kpi-value { color: var(--pos-ink); }
.kpi.is-warn .kpi-value { color: var(--signal); }
.kpi.is-bad .kpi-value { color: var(--negative); }

.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--rule); }
.task:first-child { border-top: 0; padding-top: 0; }
.task-text { min-width: 0; }
.task-title { font-size: 15px; font-weight: 500; }
.task-detail { margin-top: 2px; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.task .btn { flex: none; }
.task-email .task-title::before, .task-login .task-title::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 8px 2px 0; border-radius: 50%; background: var(--signal);
}

.brief-card {
  display: grid; gap: 6px; padding: 18px 20px; border-radius: var(--r-card); background: var(--panel);
  color: var(--ink); text-decoration: none; transition: background-color .15s;
}
.brief-card:hover { background: var(--hover); }
.brief-when { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.brief-title { font-size: 16px; font-weight: 600; }
.brief-excerpt { font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.brief-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 14px; font-weight: 500; }
.brief-card:hover .brief-more .icon { transform: translateX(3px); }
.brief-more .icon { transition: transform .25s var(--ease); }

.home-side .home-section { padding: 22px 0; }
.facts-tight { gap: 8px 16px; margin: 0; }
.ask-list, .idea-list, .chat-list { list-style: none; margin: 0; padding: 0; }
.ask-list li + li, .idea-list li + li, .chat-list li + li { border-top: 1px solid var(--rule); }
.ask-list button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 10px 0; border: 0; background: transparent; color: var(--ink); font-size: 14.5px; text-align: left;
}
.ask-list button:disabled { color: var(--faint); cursor: not-allowed; }
.ask-list .icon { flex: none; color: var(--muted); transition: transform .25s var(--ease); }
.ask-list button:not(:disabled):hover .icon { transform: translateX(3px); color: var(--ink); }
.idea-list a { display: grid; gap: 2px; padding: 10px 0; color: var(--ink); text-decoration: none; }
.idea-text { font-size: 14.5px; font-weight: 500; }
.idea-list a:hover .idea-text { text-decoration: underline; text-underline-offset: 3px; }
.idea-detail { font-size: 13px; color: var(--muted); }
.chat-list a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; color: var(--ink); text-decoration: none; font-size: 14px; }
.chat-list a:hover .chat-title { text-decoration: underline; text-underline-offset: 3px; }
.chat-title { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title .icon { flex: none; color: var(--muted); }
.chat-when { flex: none; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---- team, settings and admin tables -------------------------------------------------------- */

.page-inner.wide { max-width: 1160px; }
.set-by-admin { font-size: 15px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.form-grid .field { margin: 0; }
.field.grow { flex: 1; min-width: 200px; }
fieldset.checks { border: 0; padding: 0; min-width: 0; }
fieldset.checks legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 500; }
.link-box { padding: 14px; border-radius: var(--r-input); background: var(--surface); font-size: 14px; line-height: 1.5; }
.link-row { display: flex; gap: 8px; margin-top: 10px; }
.link-input { flex: 1; min-width: 0; font-size: 13px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { padding: 0 14px 8px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 500; color: var(--muted); text-align: left; white-space: nowrap; }
.table td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table a { color: var(--ink); text-decoration-color: var(--control); text-underline-offset: 3px; }
.table a:hover { text-decoration-color: var(--ink); }
.cell-main { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.cell-sub { display: block; font-size: 12.5px; color: var(--muted); }
.cell-actions { text-align: right; white-space: nowrap; }
.tag { padding: 1px 7px; border-radius: var(--r-pill); background: var(--raised); font-size: 11.5px; font-weight: 500; color: var(--muted); }
.row-edit td { padding: 14px 0 18px; }
.row-edit form > * + * { margin-top: 14px; }
.row-edit-title { font-weight: 600; }
.push-right { margin-left: auto; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; vertical-align: middle; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pos-ink); }
.status-suspended { color: var(--negative); }
.status-suspended::before { background: var(--negative); }
h1 .status { margin-left: 10px; font-size: 14px; letter-spacing: 0; }
.quote { margin: 0; padding-left: 14px; border-left: 2px solid var(--control); color: var(--muted); line-height: 1.55; }
.crumb { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 13.5px; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--ink); }
.page-inner > .kpis { margin-top: 28px; }
.page-inner > .facts { margin-top: 20px; }
.page-inner > .facts + .kpis { margin-top: 12px; }
.search-form { display: flex; gap: 8px; margin: 28px 0 16px; max-width: 520px; }
.search-form .input { flex: 1; min-width: 0; }
.admin-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; margin-top: 16px; }
.admin-cols .section { grid-template-columns: minmax(0, 1fr); }
.admin-label { margin-left: 10px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--ink); color: var(--ground); font-size: 11.5px; font-weight: 600; align-self: center; }
.rail-brand { align-items: center; }
.btn-back { font-weight: 500; }
.admin-privacy { padding: 8px 10px 10px; font-size: 12.5px; line-height: 1.45; color: var(--faint); }
.form-row.push { justify-content: flex-start; }

@media (max-width: 1080px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-side { border-top: 1px solid var(--rule); }
  .admin-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding-left: 0; border-left: 0; }
  .kpi:nth-child(2n) { padding-left: 16px; border-left: 1px solid var(--rule); }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .kpi-value { font-size: 28px; }
  .task { flex-wrap: wrap; }
  .table th:nth-child(n+4), .table td:nth-child(n+4):not(.cell-actions) { display: none; }
  .row-edit td { display: table-cell !important; }
  .convo-item > a { padding-right: 40px; }
  .convo-more { top: 8px; width: 32px; height: 32px; }
}
.section-stack { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.section-stack .section-body { padding: 4px 20px 8px; }
.section-stack .section-body > .table-wrap { margin: 0; }
.section-stack .table th { padding-top: 14px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-cols .section { align-content: start; gap: 14px; }
.admin-cols .section-body { padding: 4px 20px 8px; }
.admin-cols .table th { padding-top: 14px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.onboard-inner .lede + form { margin-top: 24px; }
.form-grid { row-gap: 14px; }
.page-inner > .kpis + .kpis { margin-top: 0; }

/* Short windows: tighten the second screen so the example and its foot fit in one. */
@media (min-width: 901px) and (max-height: 780px) {
  .demo { padding-top: 28px; }
  .demo-head { margin-bottom: 24px; }
  .demo-thread { min-height: 240px; }
  .demo-tab { padding: 13px 18px; }
  .landing-foot { padding: 18px 0 16px; }
}

/* A button at work: a small ring turning beside its label. */
.btn.is-busy { gap: 10px; opacity: 1; cursor: progress; }
.btn.is-busy:disabled { opacity: 1; }
.btn:not(.btn-quiet).is-busy { background: color-mix(in srgb, var(--primary) 82%, var(--ground)); }
.spinner {
  flex: none; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: pulse 1.2s ease-in-out infinite alternate !important; animation-duration: 1.2s !important; animation-iteration-count: infinite !important; }
  @keyframes pulse { from { opacity: .35; } to { opacity: 1; } }
}

/* ---- message the Dira team: a quiet button beside the theme toggle, and its panel ---------- */

.support { position: fixed; z-index: 50; top: 18px; right: 66px; }
.support-toggle {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink);
  transition: background-color .2s, transform .2s var(--ease);
}
.support-toggle:hover, .support-toggle[aria-expanded="true"] { background: var(--hover); }
.support-toggle:active { transform: scale(.92); }
.support-toggle .icon { width: 17px; height: 17px; }
.support-panel {
  position: absolute; top: 46px; right: -44px; width: min(360px, calc(100vw - 24px));
  padding: 18px 18px 16px; border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow-float);
  transform-origin: top right; animation: pop .22s var(--ease-out) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.support-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px -6px 6px 0; }
.support-head h2 { font-size: 16px; }
.support-note { font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.support-note strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.support-panel form { margin-top: 14px; }
.support-text { min-height: 112px; resize: vertical; font-size: 14.5px; line-height: 1.5; }
.support-panel form .notice { margin-top: 10px; }
.support-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.support-hint { font-size: 12.5px; color: var(--faint); line-height: 1.4; }
.support-sent { display: grid; gap: 6px; padding: 4px 0 0; }
.support-sent-dot {
  width: 10px; height: 10px; margin-bottom: 6px; border-radius: 50%; background: var(--signal);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--signal) 18%, transparent);
  animation: breathe .9s var(--ease-out) both;
}
.support-sent-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
/* Room for both buttons over the app's top bar. */
.topbar { padding-right: 116px; }

/* ---- admin inbox --------------------------------------------------------------------------- */

.rail-count {
  margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: var(--r-pill);
  background: var(--signal); color: #fff; font-size: 11.5px; font-weight: 600; text-align: center;
  font-variant-numeric: tabular-nums;
}
.segmented { display: inline-flex; gap: 2px; margin: 24px 0 8px; padding: 3px; border-radius: var(--r-pill); background: var(--raised); }
.segmented a {
  padding: 6px 14px; border-radius: var(--r-pill); color: var(--muted); font-size: 13.5px; font-weight: 500;
  text-decoration: none; font-variant-numeric: tabular-nums; transition: background-color .2s, color .2s;
}
.segmented a:hover { color: var(--ink); }
.segmented a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
/* Sign-ups (step 31): one quiet row to send a link to someone new, then the three lists as
   ruled rows: who, and when, on the left; what to do, or where they got to, on the right. */
.signup-new { max-width: 560px; margin: 28px 0 0; }
.signup-new-label { display: block; font-size: 13.5px; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.signup-new-row { display: flex; gap: 8px; }
.signup-new-row .input { flex: 1; min-width: 0; }
.signup-note:not(:empty) { max-width: 560px; margin-top: 12px; }
.seg-count { margin-left: 6px; color: var(--faint); font-variant-numeric: tabular-nums; }
.segmented a[aria-current="page"] .seg-count { color: var(--muted); }
.signups { list-style: none; margin: 16px 0 0; padding: 0; max-width: 820px; border-top: 1px solid var(--rule); }
.signup-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: center;
  padding: 16px 2px; border-bottom: 1px solid var(--rule); animation: rise .4s var(--ease-out) both;
}
.signup-who { min-width: 0; }
.signup-email { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.signup-meta { display: block; margin-top: 3px; font-size: 13.5px; color: var(--muted); }
.signup-side { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.signup-expiry { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.signup-expiry.is-expired { color: var(--negative); }
.signup-org { font-size: 14px; font-weight: 500; }
.signup-org.is-pending { font-weight: 400; color: var(--faint); }
.signup-remove { font-size: 13px; color: var(--faint); }
.signup-remove:hover { color: var(--negative); }
@media (max-width: 640px) {
  .signup-row { grid-template-columns: minmax(0, 1fr); }
  .signup-side { justify-content: flex-start; }
  .signup-new-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .signup-row { animation: none; } }
.inbox-empty { margin-top: 24px; }
.inbox { list-style: none; margin: 16px 0 0; padding: 0; max-width: 820px; }
.inbox-item {
  padding: 20px 0; border-top: 1px solid var(--rule);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.inbox-item:first-child { border-top: 0; }
.inbox-item.is-leaving { opacity: 0; transform: translateX(12px); }
.inbox-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 13.5px; }
.inbox-unread { align-self: center; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.inbox-from { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.inbox-from:hover, .inbox-org:hover { text-decoration: underline; text-underline-offset: 3px; }
.inbox-org { color: var(--muted); text-decoration: none; }
.inbox-when { margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; }
.inbox-text { margin-top: 10px; font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 68ch; }
.inbox-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.inbox-page { margin-right: auto; font-size: 12.5px; color: var(--faint); }
.inbox-page code { font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--raised); color: var(--muted); }
.inbox-item .notice { margin-top: 10px; }

@media (max-width: 900px) {
  .support { top: max(10px, calc(env(safe-area-inset-top) + 10px)); right: 56px; }
  /* On a narrow screen the panel spans the screen (12px each side) under the top buttons,
     whatever the button's place, so none of it is ever off the edge. */
  .support-panel {
    position: fixed; top: calc(max(10px, env(safe-area-inset-top) + 10px) + 46px);
    left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 80px); overflow-y: auto;
  }
  .topbar { padding-right: 104px; }
  .inbox-when { margin-left: 0; }
}

/* Connect another platform: the picker sits beside its Cancel button once opened. */
.connect-head { display: flex; align-items: flex-end; gap: 12px; }
.connect-head .field { flex: 1; margin: 0; }
.connect-head .btn { flex: none; min-height: 42px; }
.connect-body.is-open > * + * { margin-top: 16px; }
.connect-body > .form-row + .sub { margin-top: 12px; }
.connect-body.is-open > div:nth-child(2) { animation: rise .3s var(--ease-out) both; }

/* A sign-in option that isn't on yet: quiet, not clickable, labelled. */
.btn-soon, .btn-soon:disabled {
  justify-content: center; gap: 10px; opacity: 1; cursor: not-allowed;
  background: var(--raised); border-color: var(--border); color: var(--faint);
}
.btn-soon:hover { background: var(--raised); }
.soon-tag {
  padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface);
  border: 1px solid var(--border); color: var(--muted); font-size: 11.5px; font-weight: 500;
}

/* A role's card shows what it always does and the kinds of things to ask it. */
.role-item.has-more .role-card .tile { padding-right: 52px; }
.role-more {
  display: grid; gap: 14px; padding: 16px 18px 18px; border-radius: var(--r-card);
  background: var(--raised); font-size: 14px; line-height: 1.5;
}
.role-more-head { margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.role-always { list-style: none; margin: 0; padding: 0; color: var(--muted); }
.role-always li { position: relative; padding-left: 16px; }
.role-always li + li { margin-top: 5px; }
.role-always li::before {
  content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px;
  border-radius: 50%; background: var(--signal);
}
.role-asks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.role-asks li {
  justify-self: start; max-width: 100%; padding: 6px 12px; border-radius: 12px 12px 12px 4px;
  background: var(--surface); color: var(--ink); font-size: 13.5px;
}
.section-body .role-more { background: var(--surface); }
.section-body .role-asks li { background: var(--panel); }

/* Platform keys: masked text fields, so browsers don't treat them as passwords to save. */
.secret-row { display: flex; gap: 8px; align-items: stretch; }
.secret-row .input { flex: 1; min-width: 0; }
.secret-input { -webkit-text-security: disc; font-family: var(--font); letter-spacing: .04em; }
.secret-input.is-shown { -webkit-text-security: none; letter-spacing: normal; }
.secret-row .reveal { flex: none; min-height: 42px; min-width: 64px; }

/* Your own items on a multi-choice question: typed in, shown as removable chips. */
.own-field { margin-top: 18px; }
.own-row { display: flex; gap: 8px; }
.own-row .input { flex: 1; min-width: 0; }
.own-row .btn { flex: none; min-height: 42px; }
.own-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 0; padding: 0; }
.own-chips:empty { display: none; }
.own-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px;
  border: 1px solid var(--ink); border-radius: var(--r-pill); background: var(--surface);
  font-size: 14px; animation: rise .2s var(--ease-out) both;
}
.own-remove {
  display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted);
}
.own-remove:hover { background: var(--hover); color: var(--ink); }
.own-remove .icon { width: 12px; height: 12px; }
.own-note:empty { display: none; }

/* Time zone: "Follow me" sits above the zone it controls. */
.follow-check { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 14.5px; }
.follow-check input { width: 18px; height: 18px; accent-color: var(--ink); }
.time-input { min-width: 140px; font-variant-numeric: tabular-nums; }

/* ---- step 15 ---------------------------------------------------------------------------- */

/* The second screen's promise: one short line, set as a statement in the role column, its
   left edge on the role names and its baseline on the heading's last line. */
/* Exactly as wide as the role cards below it, set left, starting on their left edge. */
.demo-head .demo-promise {
  justify-self: stretch; width: 100%; max-width: none; padding: 0; text-align: left;
  font-size: clamp(19px, 1.5vw, 22px); line-height: 1.3;
  font-weight: 500; letter-spacing: -0.015em; color: var(--ink); text-wrap: pretty;
}
/* The heading and the promise share their last baseline. */
@media (min-width: 901px) { .demo-head { align-items: last baseline; } }
@media (max-width: 900px) { .demo-head .demo-promise { font-size: 18px; } }

/* What I'm doing while I answer, and for how long. */
.working-text { transition: opacity .2s var(--ease); }
.working-time { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--faint); }
/* Something went wrong and I'm working around it: said once, quietly, above the answer. */
.trouble-notes:empty { display: none; }
.trouble-notes { display: grid; gap: 6px; margin: 2px 0 12px; }
.trouble-note { display: flex; gap: 10px; align-items: baseline; font-size: 14px; line-height: 1.45; color: var(--muted); }
.trouble-note::before {
  content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--signal);
  transform: translateY(-2px);
}
.msg-error p { margin: 0; }
.trouble-offer { margin-top: 12px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--neg-ink) 14%, transparent); color: var(--ink); }
.trouble-offer > p { margin: 0 0 10px; }
.trouble-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-help { display: grid; gap: 10px; margin-top: 12px; }
.platform-help-item { padding: 10px 14px; border-radius: var(--r-input); border: 1px solid var(--border); font-size: 14px; }
.platform-help-item > p { margin: 0 0 8px; }
.platform-help-item .sub { display: block; margin-top: 6px; }

/* Time of day: large figures in a field; a sheet with the hours and minutes to tap. */
.tp { position: relative; }
.tp-trigger {
  display: inline-flex; align-items: baseline; gap: 8px; min-width: 9.5rem; padding-right: 38px;
  text-align: left; cursor: pointer; background: var(--surface) var(--chevron) no-repeat right 13px center / 16px 16px;
}
.tp-figures { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--ink); }
.tp-half { font-size: 13px; font-weight: 500; color: var(--muted); }
.tp-sheet {
  position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: 320px; max-width: calc(100vw - 32px);
  padding: 18px 18px 14px; border-radius: var(--r-panel); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-float);
  animation: rise .25s var(--ease-out) both;
}
.tp-now { display: flex; align-items: center; gap: 2px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.tp-num {
  width: 2.3ch; padding: 2px 0; border: 0; border-bottom: 2px solid transparent; background: transparent;
  font: inherit; font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; color: var(--ink); text-align: center;
}
.tp-num:focus { outline: none; border-bottom-color: var(--signal); }
.tp-colon { font-size: 34px; font-weight: 600; line-height: 1; color: var(--faint); transform: translateY(-2px); }
.tp-halves { display: flex; gap: 4px; margin-left: auto; }
.tp-halves .tp-cell { width: 48px; }
.tp-label { margin: 14px 0 8px; font-size: 13px; color: var(--muted); }
.tp-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.tp-cell {
  height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--ink);
  font: inherit; font-size: 14.5px; font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.tp-grid-24 .tp-cell { height: 32px; font-size: 13.5px; }
.tp-cell:hover { background: var(--hover); }
.tp-cell:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }
.tp-cell[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.tp-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
/* On a phone the sheet opens just under the field, across the whole panel, so it never runs
   off the screen. */
@media (max-width: 640px) {
  .tp { position: static; }
  .tp-sheet { top: auto; left: 8px; right: 8px; width: auto; max-width: none; margin-top: 8px; }
  .tp-cell { height: 42px; }
}
/* An open sheet sits above the sections that follow it. */
.section:has(.tp-sheet:not([hidden])), .section-body:has(.tp-sheet:not([hidden])) { position: relative; z-index: 20; overflow: visible; }

/* ---- step 16 ---------------------------------------------------------------------------- */

/* A running answer: a slim strip on the composer. The orange dot breathes; the figures tick;
   Stop is always one click away, and what's typed meanwhile is added to the work. */
.run-strip {
  display: flex; align-items: center; gap: 10px; margin: 0 6px 8px; padding: 8px 8px 8px 14px;
  border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface);
  font-size: 13.5px; color: var(--muted); animation: rise .3s var(--ease-out) both;
}
.run-strip[hidden] { display: none; }
.run-dot {
  position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--signal);
}
.run-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--signal);
  opacity: 0; animation: breathe 1.8s var(--ease) infinite;
}
@keyframes breathe { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .run-dot::after { animation: none; } }
.run-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.run-time { flex: none; font-variant-numeric: tabular-nums; color: var(--faint); }
.run-stop {
  display: inline-flex; align-items: center; gap: 7px; flex: none; height: 30px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--panel);
  color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.run-stop:hover { background: var(--hover); border-color: var(--control); }
.run-stop:disabled { opacity: .6; cursor: default; }
.run-stop-square { width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.composer.is-running form { border-color: color-mix(in srgb, var(--signal) 45%, var(--control)); }
.composer.is-running .send-btn { background: var(--raised); }

/* Heads-ups (neutral) next to problem notes (orange), and the note under added context. */
.notice-note { display: flex; gap: 10px; align-items: baseline; font-size: 14px; line-height: 1.45; color: var(--muted); }
.notice-note::before {
  content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--faint);
  transform: translateY(-2px);
}
.added-note { margin: -6px 0 8px auto; max-width: max-content; font-size: 12.5px; color: var(--faint); }
.added-note.is-error { color: var(--negative); }

/* Monthly allowances on a connection: label and count, a thin meter coloured as it fills. */
.allowances { display: grid; gap: 12px; margin-top: 12px; max-width: 460px; }
.allowance-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.allowance-label { color: var(--muted); }
.allowance-count { font-variant-numeric: tabular-nums; color: var(--muted); }
.allowance-count strong { color: var(--ink); font-weight: 600; }
.allowance-meter { position: relative; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.allowance-fill {
  position: absolute; inset: 0 auto 0 0; width: var(--fill, 0%); border-radius: 2px; background: var(--ink);
  transition: width .6s var(--ease-out);
}
.allowance.is-near .allowance-fill { background: var(--signal); }
.allowance.is-out .allowance-fill { background: var(--negative); }
.allowance.is-near .allowance-count strong { color: var(--signal); }
.allowance.is-out .allowance-count strong { color: var(--negative); }
.allowance-note { margin-top: 6px; font-size: 12.5px; color: var(--faint); }
.allowance.is-near .allowance-note, .allowance.is-out .allowance-note { color: var(--ink); }
.allowance.is-out { padding: 10px 12px; margin: 0 -12px; border-radius: var(--r-input); background: var(--neg-bg); }
.allowance.is-near { padding: 10px 12px; margin: 0 -12px; border-radius: var(--r-input); background: color-mix(in srgb, var(--signal) 9%, transparent); }
.limit-form { display: grid; gap: 6px; margin-top: 8px; font-size: 13px; }
.limit-form .input { max-width: 10rem; font-variant-numeric: tabular-nums; }
.task-allowance .task-title::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 8px 2px 0; border-radius: 50%; background: var(--signal);
}

/* Settings: plain-text emails. */
.email-format { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.sub.block { display: block; margin-top: 2px; font-weight: 400; }

/* Staff inbox: who has each message. */
.inbox-status { display: flex; align-items: center; gap: 6px; margin: 8px 0 2px; font-size: 13px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 500; background: var(--raised); color: var(--muted);
}
.status-pill.is-progress { background: color-mix(in srgb, var(--signal) 12%, transparent); color: var(--ink); }
.status-pill.is-done { background: var(--pos-bg); color: var(--pos-ink); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.inbox-item.is-mine { padding-left: 14px; box-shadow: inset 3px 0 0 var(--signal); }
@media (max-width: 640px) {
  .run-strip { margin: 0 0 8px; }
  .allowance.is-out, .allowance.is-near { margin: 0; }
}
@media (max-width: 640px) {
  .account-row { flex-wrap: wrap; }
  .account-row > .grow { flex-basis: 100%; }
  .allowances { max-width: none; }
}

/* ---- step 23: plans, the account menu, grouped settings, roles of your own, usage ---------- */

/* Plans: a ruled list, the number of agents as the figure. */
.plans { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--border); }
.plans > li { border-bottom: 1px solid var(--border); }
.plan {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 20px;
  align-items: center; gap: 4px 16px; padding: 18px 4px; cursor: pointer;
  transition: background-color .2s;
}
.plan:hover { background: color-mix(in srgb, var(--hover) 50%, transparent); }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: -2px; border-radius: 6px; }
.plan-figure {
  font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums; color: var(--faint); transition: color .25s var(--ease);
}
.plan:has(input:checked) .plan-figure { color: var(--ink); }
.plan-text { display: grid; gap: 3px; min-width: 0; }
.plan-name { font-weight: 600; font-size: 15px; }
.plan-line { font-size: 14px; color: var(--muted); line-height: 1.45; }
.plan-current {
  margin-left: 8px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--raised);
  color: var(--muted); font-size: 12px; font-weight: 500; vertical-align: 1px;
}
.plan-price { font-size: 13px; color: var(--faint); white-space: nowrap; }
.plan-dot {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--control);
  transition: border-color .2s, box-shadow .25s var(--ease-out);
}
.plan:has(input:checked) .plan-dot { border-color: var(--ink); box-shadow: inset 0 0 0 5px var(--ink); }
.plan-note { margin-top: 14px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.plan-actions { margin-top: 24px; }
.section-body .plans { margin-top: 0; }
@media (max-width: 560px) {
  .plan { grid-template-columns: 48px minmax(0, 1fr) 20px; }
  .plan-figure { font-size: 36px; }
  .plan-price { grid-column: 2; grid-row: 2; }
  .plan-dot { grid-column: 3; grid-row: 1 / span 2; }
}

/* The account menu: rightmost at the top, the theme button and messages to its left. */
.menu { position: fixed; z-index: 51; top: 18px; right: 22px; }
:root.has-menu .theme-toggle { right: 66px; }
:root.has-menu .support { right: 110px; }
:root.has-menu .topbar { padding-right: 160px; }
.menu-toggle {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font: inherit;
  transition: background-color .2s, border-color .2s, transform .2s var(--ease);
}
.menu-toggle:hover, .menu-toggle[aria-expanded="true"] { background: var(--hover); }
.menu-toggle[aria-expanded="true"] { border-color: var(--control); }
.menu-toggle:active { transform: scale(.92); }
.menu-initial { font-size: 14px; font-weight: 600; }
.menu-panel {
  position: absolute; top: 46px; right: 0; width: 248px; padding: 6px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  box-shadow: var(--shadow-float); transform-origin: top right; animation: pop .2s var(--ease-out) both;
}
.menu-who { display: grid; gap: 2px; padding: 10px 10px 12px; border-bottom: 1px solid var(--rule); }
.menu-email { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.menu-org { font-size: 12.5px; color: var(--muted); }
.menu-group { padding: 4px 0; }
.menu-group + .menu-group { border-top: 1px solid var(--rule); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer;
  transition: background-color .15s;
}
.menu-item .icon { color: var(--muted); }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); outline: none; }
.menu-item[aria-current="page"] { background: var(--raised); }
@media (max-width: 900px) {
  .menu { top: max(10px, calc(env(safe-area-inset-top) + 10px)); right: 12px; }
  :root.has-menu .theme-toggle { right: 54px; }
  :root.has-menu .support { right: 96px; }
  :root.has-menu .topbar { padding-right: 140px; }
}

/* Settings, grouped: only the group's name until it's opened. */
.settings-groups { margin-top: 28px; border-top: 1px solid var(--border); }
.settings-group { border-bottom: 1px solid var(--border); }
.settings-group > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 2px; list-style: none; cursor: pointer;
}
.settings-group > summary::-webkit-details-marker { display: none; }
.settings-group > summary:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 6px; }
.settings-group-name { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.settings-group > summary .icon { color: var(--muted); transition: transform .3s var(--ease-out); }
.settings-group[open] > summary .icon { transform: rotate(180deg); }
.settings-group > summary:hover .settings-group-name { color: var(--ink); }
.settings-group-body { padding: 0 0 12px; animation: rise .35s var(--ease-out) both; }
.settings-group-body > .section { padding: 24px 0; animation: none; }
.settings-group-body > .section:first-child { border-top: 0; padding-top: 4px; }

/* Roles: the job in detail behind one quiet disclosure. */
.role-tiles { align-items: start; }
.role-item { display: grid; gap: 0; align-content: start; }
.role-tile { padding-right: 44px; }
.role-item.is-custom .tile-help {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.role-own {
  margin-left: 8px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--raised);
  color: var(--muted); font-size: 11.5px; font-weight: 500; vertical-align: 1px;
}
.role-job > summary {
  display: inline-flex; align-items: center; gap: 4px; margin: 6px 0 0 4px; padding: 6px 4px;
  font-size: 13px; font-weight: 500; color: var(--muted); list-style: none; cursor: pointer;
}
.role-job > summary::-webkit-details-marker { display: none; }
.role-job > summary:hover { color: var(--ink); }
.role-job > summary .icon { width: 14px; height: 14px; transition: transform .3s var(--ease-out); }
.role-job[open] > summary .icon { transform: rotate(180deg); }
.role-job-body {
  display: grid; gap: 16px; margin-top: 6px; padding: 16px 18px 18px; border-radius: var(--r-card);
  background: var(--raised); font-size: 14px; line-height: 1.5; animation: rise .3s var(--ease-out) both;
}
.section-body .role-job-body { background: var(--surface); }
.role-duties { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; }
.role-duties dt { padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--ink); }
.role-duties dt:first-child { padding-top: 0; border-top: 0; }
.role-duties dd { margin: 4px 0 12px; }
.role-duties dd:last-child { margin-bottom: 0; }
.role-duties ul { list-style: none; margin: 0; padding: 0; color: var(--muted); }
.role-duties li + li { margin-top: 4px; }
.role-job-body .role-more { padding: 14px 0 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.section-body .role-job-body .role-more { background: transparent; }
.role-job-body .role-details { padding: 0 0 0 16px; background: transparent; animation: none; }
.role-job-source { font-size: 12.5px; color: var(--faint); }
.role-job-text { white-space: pre-wrap; color: var(--muted); max-height: 320px; overflow: auto; }
.tile.is-capped { opacity: .5; cursor: not-allowed; }
.tile.is-capped:hover { border-color: var(--border); }
.role-add { align-content: center; min-height: 96px; }
.role-add-plus {
  display: grid; place-items: center; width: 24px; height: 24px; margin-bottom: 4px;
  border-radius: 50%; border: 1px solid var(--control); color: var(--muted);
}
.role-add:hover .role-add-plus { border-color: var(--ink); color: var(--ink); }
.role-count { margin: 4px 0 18px; font-size: 14px; color: var(--muted); display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.role-count-figure { font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.role-count-more { margin-left: 8px; color: var(--ink); text-underline-offset: 3px; }
.role-step > .btn { margin-top: 8px; }
.own-roles-head { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.own-roles:empty { display: none; }
.section-body > .own-roles { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }

/* A role of your own: name, then the description typed or read from a PDF. */
.custom-editor {
  margin: 8px 0 20px; padding: 22px; border: 1px solid var(--border); border-radius: var(--r-panel);
  background: var(--surface); animation: rise .35s var(--ease-out) both;
}
.custom-head { margin-bottom: 18px; }
.custom-head h3 { font-size: 17px; letter-spacing: -0.015em; }
.custom-head .sub { margin-top: 4px; line-height: 1.5; }
.custom-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.custom-label-row label { font-size: 13px; font-weight: 500; }
.custom-counter { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; transition: color .2s; }
.custom-counter[data-state="near"] { color: var(--signal); }
.custom-counter[data-state="over"] { color: var(--negative); font-weight: 500; }
.custom-upload {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  border: 1px dashed var(--control); border-radius: var(--r-input); color: var(--ink);
  transition: border-color .2s, background-color .2s;
}
.custom-upload:hover { border-color: var(--ink); background: var(--panel); }
.custom-upload .icon { flex: none; color: var(--muted); }
.custom-upload strong { font-weight: 600; font-size: 14px; }
.custom-upload .sub { font-size: 13.5px; }
.custom-upload.is-reading { pointer-events: none; border-style: solid; }
.custom-upload.is-reading .icon { color: var(--signal); animation: breathe .8s ease-in-out infinite alternate; }
.custom-editor input[type="file"]:focus-visible + .custom-upload { outline: 2px solid var(--signal); outline-offset: 2px; }
.custom-pdf-note { font-size: 13px; color: var(--muted); }
.custom-text { min-height: 180px; resize: vertical; line-height: 1.55; font-size: 14.5px; }
.custom-editor .form-row { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) {
  .custom-upload.is-reading .icon { animation: none; }
}

/* Setup: a connected platform's allowances, with the plan's own limit or none. */
.setup-limits:empty { display: none; }
.setup-limits { margin: 14px 0; padding-top: 14px; border-top: 1px solid var(--border); }
.setup-limits-head { font-size: 14px; color: var(--muted); margin-bottom: 8px; line-height: 1.5; }

/* Staff: tokens per day and the ranked lists. */
.usage-chart-block { margin-top: 32px; }
.usage-chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
.usage-chart-head h2 { font-size: 16px; }
.usage-chart-wrap { position: relative; }
.usage-chart { display: block; width: 100%; height: auto; overflow: visible; }
.usage-chart .grid { stroke: var(--rule); stroke-width: 1; }
.usage-chart .baseline { stroke: var(--control); stroke-width: 1; }
.usage-chart .tick { fill: var(--faint); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.usage-chart .hit { fill: transparent; }
.usage-chart .mark { fill: var(--data); transition: opacity .15s; }
.usage-chart .bar { outline: none; cursor: default; }
.usage-chart:has(.bar:hover, .bar:focus-visible) .mark { opacity: .45; }
.usage-chart .bar:hover .mark, .usage-chart .bar:focus-visible .mark { opacity: 1; }
.chart-tip {
  position: absolute; top: 0; left: var(--x, 50%); transform: translateX(-50%);
  display: grid; gap: 2px; min-width: 150px; padding: 10px 12px; pointer-events: none;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  box-shadow: var(--shadow-float); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.chart-tip[data-side="end"] { transform: translateX(-100%); }
.chart-tip[data-side="start"] { transform: none; }
.chart-tip strong { font-size: 16px; color: var(--ink); }
.chart-tip > span { white-space: nowrap; }
.chart-tip .tip-day { color: var(--ink); font-weight: 500; }
.usage-table { margin-top: 12px; }
.usage-table > summary { color: var(--muted); font-size: 13px; padding: 6px 0; }
.share-list { list-style: none; margin: 0; padding: 0; }
.share-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 12px 0 14px;
  border-bottom: 1px solid var(--rule);
}
.share-row:last-child { border-bottom: 0; }
.share-main { display: grid; gap: 2px; min-width: 0; }
.share-name { font-weight: 500; overflow-wrap: anywhere; }
.share-name a { color: var(--ink); text-decoration: none; }
.share-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.share-sub { font-size: 12.5px; color: var(--faint); }
.share-figs { display: grid; justify-items: end; gap: 2px; font-variant-numeric: tabular-nums; }
.share-value { font-weight: 600; }
.share-pct { font-size: 12.5px; color: var(--faint); }
.share-bar { grid-column: 1 / -1; height: 4px; margin-top: 8px; border-radius: 2px; background: var(--raised); overflow: hidden; }
.share-fill {
  display: block; width: var(--w, 0); height: 100%; border-radius: 2px; background: var(--data);
  transform-origin: left; animation: grow .6s var(--ease-out) both;
}
@media (prefers-reduced-motion: reduce) {
  .share-fill, .settings-group-body, .role-job-body, .custom-editor { animation: none; }
}

/* Usage page: the cost/tokens switch and the notes on how costs are estimated. */
.usage-chart-head .segmented { margin: 0; }
.segmented-small button {
  padding: 5px 12px; border: 0; border-radius: var(--r-pill); background: transparent;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.segmented-small button:hover { color: var(--ink); }
.segmented-small button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.usage-note { margin-top: 12px; max-width: 72ch; font-size: 13px; line-height: 1.5; color: var(--faint); }

/* Billing: how many users the admin pays for. */
.seats { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 20px 4px; border-bottom: 1px solid var(--border); }
.seats-label { display: grid; gap: 3px; }
.seats-label > span:first-child { font-weight: 600; font-size: 15px; }
.seats-label .sub { font-size: 13.5px; }
.seats-control { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); }
.seats-step {
  display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink); font: inherit; font-size: 18px; cursor: pointer;
  transition: background-color .15s;
}
.seats-step:hover:not(:disabled) { background: var(--hover); }
.seats-step:disabled { color: var(--faint); cursor: not-allowed; }
.seats-input {
  width: 64px; padding: 6px 4px; border: 0; background: transparent; text-align: center;
  font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.seats-input::-webkit-outer-spin-button, .seats-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.seats-input:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 8px; }
.section-body .seats { padding-left: 0; padding-right: 0; }
.plan-price { line-height: 1.35; text-align: right; }
.invite-blocked { display: grid; gap: 12px; justify-items: start; }
.invite-blocked p { font-size: 14.5px; line-height: 1.5; color: var(--ink); }
@media (max-width: 560px) { .plan-price { text-align: left; } }

/* Confirmation popup (deleting the account). */
.confirm-dialog {
  width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border);
  border-radius: var(--r-panel); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-float); animation: dialog-in .22s var(--ease-out) both;
}
.confirm-dialog::backdrop { background: rgba(12, 12, 13, .42); animation: fade-in .2s ease both; }
.confirm-dialog.is-closing { animation: dialog-out .16s ease both; }
.confirm-dialog.is-closing::backdrop { animation: fade-out .16s ease both; }
.confirm-inner { padding: 24px 24px 20px; }
.confirm-inner h2 { font-size: 19px; letter-spacing: -0.02em; }
.confirm-body { margin-top: 10px; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.btn-danger-solid { background: var(--negative); border-color: var(--negative); color: #fff; }
.btn-danger-solid:hover { opacity: .9; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(4px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .confirm-dialog, .confirm-dialog::backdrop, .confirm-dialog.is-closing, .confirm-dialog.is-closing::backdrop { animation: none; }
}

/* ---- landing, third screen: pricing ---------------------------------------------------------- */

/* The second screen ends where its example does; the foot now closes the third. */
.demo { padding-bottom: 72px; }
.demo > .demo-body { margin-bottom: auto; }

.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.pricing-cue {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 44px; padding: 10px 2px;
  border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; font-weight: 500;
  animation: rise .8s var(--ease-out) .5s both; transition: color .2s;
}
.pricing-cue .icon { transition: transform .35s var(--ease-out); }
.pricing-cue:hover, .pricing-cue:focus-visible { color: var(--ink); }
.pricing-cue:hover .icon, .pricing-cue:focus-visible .icon { transform: translateX(4px); }

.pricing {
  scroll-snap-align: start; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; padding: 40px 0 0;
}
.pricing-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 24px;
  align-items: end; margin: auto 0 48px;
}
.pricing-head h2 { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.02; letter-spacing: -0.035em; max-width: 13ch; }
.pricing-head p { font-size: 17px; line-height: 1.5; max-width: 26em; padding: 0 4px 4px 20px; color: var(--muted); }

/* Three cards on the landing page's card language (the sign-in card, the example window):
   surface, hairline border, 22px corners. The number of roles is the figure; the middle plan
   carries the ink border and the signal dot. */
.tiers {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch;
}
.tier {
  position: relative; display: flex; flex-direction: column; gap: 20px; padding: 28px;
  border: 1px solid var(--border); border-radius: 22px; background: var(--surface);
  transition: transform .45s var(--ease-out), border-color .3s, box-shadow .45s var(--ease-out);
}
.tier:hover, .tier:focus-within {
  transform: translateY(-4px); border-color: var(--control); box-shadow: var(--shadow-float);
}
.tier.is-middle { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tier.is-middle:hover, .tier.is-middle:focus-within { box-shadow: inset 0 0 0 1px var(--ink), var(--shadow-float); }
.tier-flag {
  position: absolute; top: 28px; right: 28px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
}
.tier-flag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.tier-top { display: flex; align-items: baseline; gap: 14px; }
.tier-figure {
  font-size: clamp(64px, 6.4vw, 96px); font-weight: 600; line-height: .85; letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}
.tier-unit { display: grid; gap: 2px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.tier-unit .sub { font-size: 14px; font-weight: 400; letter-spacing: 0; }
.tier-price { display: grid; gap: 2px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.tier-price strong { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.tier-price .tier-soon { color: var(--ink); }
.tier-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; font-size: 14.5px; color: var(--muted); flex: 1; }
.tier-points li { position: relative; padding-left: 16px; }
.tier-points li::before {
  content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--control);
}
.tier.is-middle .tier-points li::before { background: var(--signal); }
.tier .btn { margin-top: 4px; }
.pricing-all { display: flex; align-items: center; gap: 10px; margin-top: 24px; font-size: 14px; color: var(--muted); }
.pricing-all .tagline-dot { flex: none; }

/* The cards rise in one after another the first time the screen is seen. A keyframe (filled
   backwards only), so it never holds a transform that would block the hover lift. */
.pricing:not(.is-in) .tier, .pricing:not(.is-in) .pricing-head, .pricing:not(.is-in) .pricing-all { opacity: 0; }
.pricing.is-in .tier, .pricing.is-in .pricing-head, .pricing.is-in .pricing-all { animation: tier-in .7s var(--ease-out) backwards; }
.pricing.is-in .tier:nth-child(1) { animation-delay: .06s; }
.pricing.is-in .tier:nth-child(2) { animation-delay: .14s; }
.pricing.is-in .tier:nth-child(3) { animation-delay: .22s; }
.pricing.is-in .pricing-all { animation-delay: .32s; }
@keyframes tier-in { from { opacity: 0; transform: translateY(18px); } }

@media (max-width: 900px) {
  .pricing-head { grid-template-columns: minmax(0, 1fr); margin-top: 32px; }
  .pricing-head p { padding-left: 0; }
  .tiers { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tier { padding: 22px 20px; }
  .tier-flag { top: 22px; right: 20px; }
  .tier:hover, .tier:focus-within { transform: none; }
  .pricing-all { align-items: flex-start; }
  .pricing-all .tagline-dot { margin-top: .5em; }
  .hero-links { order: 5; align-self: flex-start; gap: 4px 24px; }
  .hero-links .scroll-cue { margin-top: 24px; }
  .pricing-cue { margin-top: 24px; }
  .demo { padding-bottom: 0; }
  .pricing { order: 8; scroll-margin-top: 16px; min-height: 0; display: block; margin-top: 80px; padding: 0; }
  .pricing-head { margin: 0 0 28px; gap: 14px; }
  .pricing-head p { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .pricing .tier, .pricing .pricing-head, .pricing .pricing-all { opacity: 1 !important; animation: none !important; }
  .tier, .tier:hover, .tier:focus-within { transition: none; transform: none; }
}
.usage-rates-head { margin-top: 20px; font-size: 13px; font-weight: 600; color: var(--ink); }

/* Pricing, fewer words: per user / per month as icons, own roles as dots, what every plan
   includes as an icon row; and quiet arrows between the second and third screens. */
.pricing-head { grid-template-columns: minmax(0, 1fr); }
.tier-unit { align-self: end; padding-bottom: 6px; color: var(--muted); font-weight: 500; }
.per {
  display: inline-flex; align-items: center; gap: 4px; width: max-content; margin-top: 6px;
  padding: 4px 9px; border-radius: var(--r-pill); background: var(--raised); color: var(--muted);
}
.per .icon { width: 14px; height: 14px; }
.per-slash { font-size: 12px; color: var(--faint); }
.tier-own { display: grid; gap: 10px; flex: 1; align-content: start; font-size: 14px; color: var(--muted); }
.tier-own-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.tier-own-dots > span {
  width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--control);
}
.tier-own-dots > span.is-built-in { border-color: var(--ink); background: var(--ink); }
.tier.is-middle .tier-own-dots > span:not(.is-built-in) { border-color: var(--signal); }
.pricing.is-in .tier-own-dots > span { animation: dot-in .4s var(--ease-out) backwards; }
.pricing.is-in .tier-own-dots > span:nth-child(n+3) { animation-delay: .45s; }
.pricing.is-in .tier-own-dots > span:nth-child(n+5) { animation-delay: .55s; }
.pricing.is-in .tier-own-dots > span:nth-child(n+7) { animation-delay: .65s; }
@keyframes dot-in { from { opacity: 0; transform: scale(.4); } }
.pricing-all {
  list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px;
  align-items: center; justify-content: center;
}
.pricing-all li { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.pricing-all .icon { width: 16px; height: 16px; color: var(--ink); }

.screen-nav {
  display: inline-flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none;
  color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; transition: color .2s;
}
.screen-nav:hover, .screen-nav:focus-visible { color: var(--ink); }
.screen-nav-icon {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--control); background: var(--surface); color: var(--ink);
  transition: background-color .2s, transform .35s var(--ease-out);
}
.screen-nav:hover .screen-nav-icon { background: var(--hover); }
.screen-nav-up:hover .screen-nav-icon { transform: translateY(-3px); }
.screen-nav-down:hover .screen-nav-icon { transform: translateY(3px); }
.screen-nav:active .screen-nav-icon { transform: scale(.92); }
.pricing-head .screen-nav, .demo-head .screen-nav { margin-bottom: 28px; }
.demo-next { display: flex; justify-content: flex-end; margin-top: 24px; }
@media (max-width: 900px) {
  .demo-next { justify-content: flex-start; margin-top: 20px; }
  .pricing-head .screen-nav, .demo-head .screen-nav { margin-bottom: 20px; }
  .pricing-all { justify-content: flex-start; gap: 10px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .tier-own-dots > span { animation: none !important; }
  .screen-nav-icon { transition: none; }
}
.pricing-all { margin: 28px 0 0; }

/* Usage page (step 25): one headline total, its two parts, then detail on demand. */
.usage-hero { margin-top: 28px; padding: 28px 0 24px; border-top: 1px solid var(--border); }
.usage-hero-label { margin: 0; font-size: 13px; color: var(--muted); }
.usage-total { margin: 4px 0 0; font-size: clamp(40px, 7vw, 56px); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.usage-hero-note { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.usage-split { margin-top: 24px; max-width: 640px; }
.split-bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--raised); }
.split-seg { display: block; width: var(--w, 0); min-width: 0; height: 100%; transform-origin: left; animation: grow .6s var(--ease-out) both; }
.split-ai { background: var(--data); }
.split-msg { background: var(--data-2); }
.split-legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.split-legend li { display: grid; grid-template-columns: 10px 1fr auto 3.5em; align-items: center; gap: 10px; font-size: 14px; }
.split-key { width: 10px; height: 10px; border-radius: 3px; }
.split-label { color: var(--muted); min-width: 0; }
.split-value { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.split-pct { text-align: right; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.usage-hero + .kpis { margin-top: 0; }
.usage-details { margin-top: 40px; border-top: 1px solid var(--border); }
.usage-details > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 18px 0; list-style: none; }
.usage-details > summary::-webkit-details-marker { display: none; }
.usage-details > summary > span:first-child { font-size: 16px; font-weight: 600; color: var(--ink); }
.usage-details > summary > span:first-child::after { content: " +"; color: var(--faint); font-weight: 400; }
.usage-details[open] > summary > span:first-child::after { content: " \2212"; }
.usage-details > summary:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 6px; }
.usage-details-body > .usage-note { margin-top: 0; }
.usage-details-body > .kpis { margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { .split-seg { animation: none; } }
.usage-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin: 24px 0 8px; }
.usage-controls .segmented { margin: 0; }

/* Staff flags (step 26): messages the screen stopped, read here and nowhere else. */
.rail-count.is-alert { background: var(--negative); }
.flags { list-style: none; margin: 16px 0 0; padding: 0; max-width: 820px; }
.flag-item { padding: 22px 0; border-top: 1px solid var(--rule); }
.flag-item:first-child { border-top: 0; }
.status-pill.is-alert { background: var(--neg-bg); color: var(--neg-ink); }
.status-pill.is-alert .status-dot { background: var(--negative); }
.flag-where { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.flag-kinds { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; }
.flag-kinds li { padding: 2px 9px; border: 1px solid var(--border); border-radius: var(--r-pill); font-size: 12.5px; color: var(--ink); }
.flag-text {
  margin: 14px 0 0; padding: 12px 14px; max-width: 68ch; max-height: 320px; overflow: auto;
  border-left: 3px solid var(--negative); border-radius: 0 10px 10px 0; background: var(--raised);
  font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink);
}
.flag-note { margin-top: 14px; max-width: 68ch; }
.flag-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.flag-item .notice { margin-top: 10px; }

/* Briefings several times a day (step 27): a row of times, each removable, and a quiet add. */
.brief-times-field { margin-top: 14px; }
.brief-times { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.brief-time { display: inline-flex; align-items: center; gap: 2px; animation: rise .3s var(--ease-out) both; }
.brief-remove {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--faint); cursor: pointer; transition: background-color .2s, color .2s;
}
.brief-remove .icon { width: 14px; height: 14px; }
.brief-remove:hover, .brief-remove:focus-visible { background: var(--hover); color: var(--ink); }
.brief-add {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
  border: 1px dashed var(--control); border-radius: var(--r-pill); background: none;
  color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: border-color .2s, color .2s, background-color .2s;
}
.brief-add .icon { width: 14px; height: 14px; }
.brief-add:hover, .brief-add:focus-visible { border-style: solid; border-color: var(--ink); color: var(--ink); }
.brief-note { margin: 8px 0 0; max-width: 56ch; font-size: 12.5px; line-height: 1.5; color: var(--faint); }
@media (prefers-reduced-motion: reduce) { .brief-time { animation: none; } }

/* Admin overview (step 28): flagged messages lead the page as one ruled line, only when there
   are any. */
.attention {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  margin-top: 28px; padding: 16px 4px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  color: var(--ink); text-decoration: none;
}
.attention + .kpis { margin-top: 0; border-top: 0; }
.attention-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--negative);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--negative) 14%, transparent);
}
.attention-text { display: grid; gap: 2px; min-width: 0; }
.attention-text strong { font-size: 15px; font-weight: 600; }
.attention-sub { font-size: 13px; color: var(--muted); }
.attention-go { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--muted); transition: color .2s, gap .2s; }
.attention-go .icon { width: 14px; height: 14px; }
.attention:hover .attention-go, .attention:focus-visible .attention-go { color: var(--ink); gap: 9px; }
@media (max-width: 640px) { .attention-go span, .attention-go { font-size: 0; } .attention-go .icon { width: 16px; height: 16px; } }

/* ---- Phones (step 28): one thing per screen -----------------------------------------------
   Phone-only controls are hidden everywhere else. On a phone the landing page is a run of
   full-height pages that snap into place (the pitch, signing in, the example, the plans), the
   plans swipe sideways one at a time, and every sign-up step keeps its action at the bottom of
   the screen, so a step never needs scrolling to find its button. */
.m-only { display: none; }
.step-actions { margin-top: 8px; }

@media (max-width: 640px) {
  .m-only { display: revert; }
  .step-actions.m-only, .step-actions:not(.m-only) { display: flex; }
  html.is-landing { scroll-snap-type: y mandatory; }

  /* Always there: "Sign in" at the top beside the theme button, for people with an account,
     and "Get started" floating at the foot of every page. Each page keeps clear of it
     (--float, the button's height and its gap). */
  .landing { --float: calc(52px + 32px + env(safe-area-inset-bottom)); }
  .m-signin {
    position: fixed; z-index: 50; top: max(10px, calc(env(safe-area-inset-top) + 10px)); right: 56px;
    height: 36px; min-height: 0;
    padding: 0 16px; font-size: 14px; border-radius: var(--r-pill);
    background: var(--surface); border: 1px solid var(--border);
  }
  /* The bar at the foot: the page arrow (down to the next page; up to the start from the
     last) and "Get started". The pages' own next and top links live here on a phone, so
     nothing can sit under it. */
  .m-dock {
    position: fixed; z-index: 50; left: 20px; right: 20px; bottom: max(16px, env(safe-area-inset-bottom));
    display: flex; gap: 10px;
  }
  /* A strip of the page's own colour behind the bar, so what scrolls under it is hidden
     cleanly rather than showing between the buttons. */
  .m-dock::before {
    content: ""; position: absolute; z-index: -1; left: -20px; right: -20px; top: -12px;
    bottom: calc(-1 * max(16px, env(safe-area-inset-bottom))); background: var(--ground);
  }
  .m-dock .m-start {
    flex: 1; min-height: 52px; font-size: 16px; border-radius: var(--r-pill); box-shadow: var(--shadow-float);
  }
  .m-page {
    flex: none; width: 52px; height: 52px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-float);
  }
  .m-page .icon { width: 18px; height: 18px; transition: transform .35s var(--ease-out); }
  .m-page.is-up .icon { transform: rotate(180deg); }
  .m-page:active { transform: scale(.94); }
  .demo-next, .landing-foot .to-top { display: none; }
  html.auth-open .m-dock, html.auth-open .m-signin { display: none; }

  /* Page 1: the pitch, with the platforms along the foot of the screen. */
  .landing-main { padding: 0 20px; }
  .landing-copy {
    display: flex; flex-direction: column; order: 1; scroll-snap-align: start;
    min-height: calc(100svh - 92px - var(--float)); padding: max(22px, env(safe-area-inset-top)) 0 20px;
  }
  .landing-copy .hero-lockup { order: 0; width: min(150px, 42vw); margin: 0; }
  .landing-copy .landing-tagline { order: 0; margin: 18px 0 0; }
  .landing-copy h1 { order: 0; margin-top: auto; font-size: clamp(44px, 13vw, 56px); line-height: .98; }
  .landing-copy .landing-sub { order: 0; margin-top: 18px; font-size: 16px; line-height: 1.55; }
  .landing-copy .hero-links {
    order: 0; display: flex; justify-content: space-between; gap: 12px; margin-top: 28px;
  }
  .landing-copy .scroll-cue, .landing-copy .pricing-cue { order: 0; margin: 0; }
  .landing-copy .scroll-cue { font-size: 14px; gap: 10px; }
  .landing-copy .scroll-cue-icon { width: 34px; height: 34px; }
  .platforms { order: 2; height: 92px; margin: 0 0 var(--float); align-content: center; border-top: 1px solid var(--rule); }
  .platforms-label { font-size: 12.5px; }

  /* Signing in: a sheet over the page, opened by either button, with a close button. */
  .landing-hero > .landing-auth { display: none; }
  html.auth-open { overflow: hidden; }
  html.auth-open .landing-hero > .landing-auth {
    position: fixed; z-index: 70; inset: 0; display: flex; flex-direction: column; justify-content: center;
    margin: 0; padding: max(64px, env(safe-area-inset-top) + 56px) 20px max(24px, env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain;
    border: 0; border-radius: 0; background: var(--ground); box-shadow: none;
    animation: sheet-in .28s var(--ease-out) both;
  }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(16px); } }
  .auth-close { position: absolute; top: max(14px, env(safe-area-inset-top) + 8px); right: 16px; }
  .landing-auth .auth-form { padding: 24px 20px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); }
  .landing-auth .auth-form .auth-form { padding: 0; border: 0; background: none; }
  .landing-auth .auth-note { margin-top: 16px; padding: 0 4px; }

  /* Page 2: the example. */
  /* Exactly one screen: the conversation takes what's left and scrolls inside, so a long
     answer never pushes anything off the page. */
  .demo {
    order: 4; scroll-snap-align: start; scroll-margin-top: 0; height: 100svh; min-height: 0; margin: 0;
    padding: max(20px, calc(env(safe-area-inset-top) + 12px)) 0 var(--float);
    display: flex; flex-direction: column;
  }
  .demo > .demo-head { margin-top: 0; flex: none; }
  .demo > .demo-body { flex: 1; min-height: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
  .demo-tabs { flex: none; }
  .demo-window { flex: 1; min-height: 0; }
  .demo-head { margin-bottom: 16px; gap: 8px; }
  .demo-head h2 { font-size: 30px; }
  .demo-head p { font-size: 15px; }
  .demo-thread { flex: 1; min-height: 0; height: auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  .demo-thread::-webkit-scrollbar { display: none; }
  .demo-note { flex: none; margin-top: 12px; }

  /* Page 3: the plans, one card at a time, swiped sideways. */
  .pricing { order: 5; scroll-snap-align: start; min-height: 100svh; padding: 24px 0 0; justify-content: center; }
  .pricing-head { grid-template-columns: minmax(0, 1fr); margin: 0 0 20px; gap: 8px; }
  .pricing-head h2 { font-size: 30px; }
  .tiers {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin: 0 -20px; padding: 6px 20px 10px; scrollbar-width: none;
  }
  .tiers::-webkit-scrollbar { display: none; }
  .tier { flex: 0 0 84%; scroll-snap-align: center; padding: 24px; gap: 16px; }
  .tier:hover, .tier:focus-within { transform: none; }
  .tier-flag { top: 24px; right: 24px; }
  .tier-figure { font-size: 72px; }
  .pricing-all { flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
  .landing-foot { padding: 28px 0 var(--float); }

  /* Sign-up steps: a title, the choice, and the action pinned to the bottom of the screen. */
  .onboard-bar { height: 52px; }
  .onboard-inner { padding: 8px 20px 0; min-height: calc(100svh - 52px); display: flex; flex-direction: column; }
  .onboard-inner > form, .onboard-inner > .role-step, .onboard-inner > .bill-plans,
  .onboard-inner > .bill-users { display: flex; flex-direction: column; flex: 1; }
  .onboard-inner h1 { font-size: 27px; margin: 20px 0 8px; }
  .onboard-inner .lede { font-size: 15px; line-height: 1.5; }
  .onboard-inner .lede + form { margin-top: 18px; }
  .step-actions {
    position: sticky; bottom: 0; z-index: 5; margin: auto -20px 0; padding: 14px 20px max(14px, env(safe-area-inset-bottom));
    flex-wrap: wrap; align-items: center; gap: 10px;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--ground) 0%, transparent), var(--ground) 18px);
  }
  .step-actions > .btn:first-child, .step-actions > .btn[type=submit] { flex: 1 1 auto; min-height: 50px; }
  .step-actions .linkish { margin-left: auto; }
  .onboard-inner form > .step-actions, .role-step > .step-actions { margin-top: auto; padding-top: 22px; }
  .tile { padding: 14px 16px; }
  .role-hint { margin-top: 10px; }
  .aside-note { font-size: 13px; }

  /* Billing: the plan, then (a page of its own) how many people. */
  .billing-step:not(.on-users) .bill-users { display: none; }
  .billing-step.on-users .bill-plans { display: none; }
  .billing-step .bill-users { padding-top: 12px; }
  .bill-users-title { font-size: 24px; letter-spacing: -0.02em; margin: 6px 0 16px; }
  .bill-users > .connect-back { align-self: flex-start; }
  .billing-step .plans { margin-top: 18px; }
  .billing-step .plan-actions { margin-top: auto; }

  /* Connecting a platform: the list gives way to the chosen one's form. */
  .is-connecting .platform-tiles { display: none; }
  .connect-back { display: inline-flex; align-items: center; gap: 6px; margin: 12px 0 14px; }
  .connect-back .icon { width: 16px; height: 16px; }
}
@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  html.is-landing { scroll-snap-type: y proximity; }
  html.auth-open .landing-hero > .landing-auth { animation: none; }
}

/* Asking for a sign-up link (step 31): the sign-in card's other face, one field. */
.request-form .request-lede { margin: -4px 0 18px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.request-form .request-aside { margin-top: 14px; font-size: 13px; line-height: 1.45; color: var(--faint); }
.request-sent { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 8px; font-size: 14.5px; line-height: 1.45; }
.request-sent .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--pos-ink); }
.need-link .request-sent { margin-top: 12px; }
