/* 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);

  --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);
  --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);
    --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;
}
.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; justify-content: center; padding: 48px 0;
}
.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; gap: 12px; width: 100%; max-width: 1320px; margin: 0 auto; padding: 96px 40px 40px; font-size: 13px; color: var(--muted); }
.foot-mark { width: 18px; }

/* ---- 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 {
    position: fixed; z-index: 40; 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: 30; 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-copy h1 { order: 2; }
  .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: 64px 16px 32px; }
  .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-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; }
