:root {
  color-scheme: light;
  /* Brand-aligned tokens — single source of truth shared with the magazine landing */
  --ink: #20231f;
  --ink-strong: #1b1f1a;
  --muted: #687066;
  --soft: #8a9387;
  --line: rgba(27, 31, 26, 0.12);
  --line-strong: rgba(27, 31, 26, 0.22);
  --rule: rgba(27, 31, 26, 0.14);
  --paper: #faf7ee;
  --paper-cream: #faf7ee;
  --paper-warm: #f5efe2;
  --paper-edge: #ece4d3;
  --panel: #faf7ee;
  --panel-soft: #f5efe2;
  --charcoal: #15191a;
  --charcoal-2: #1b1f1a;
  --accent: #245f4d;
  --accent-dark: #1c4a3c;
  --accent-mag: #245f4d;
  --accent-warm: #b8742b;
  --danger: #8a3f3f;
  --warn: #b8742b;
  --good: #245f4d;
  --shadow: 0 28px 50px -28px rgba(27, 31, 26, 0.32);
  --shadow-soft: 0 14px 32px -22px rgba(27, 31, 26, 0.22);
  --radius: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --serif: "Fraunces", "GT Sectra", "Newsreader", Georgia, serif;
  --hand: "Caveat", "Reenie Beanie", cursive;
  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
  font-family: Geist, "Geist Sans", "Aptos", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper-cream);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper-cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(27, 31, 26, 0.09) 0.6px, transparent 0.6px);
  background-size: 5px 5px;
  opacity: 0.5;
  z-index: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--ink-strong);
  border-radius: 999px;
  background: var(--ink-strong);
  color: var(--paper-cream);
  padding: 0 18px;
  cursor: pointer;
  font-family: Geist, system-ui, sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  transition: transform 220ms var(--ease), background 220ms var(--ease), border-color 220ms var(--ease), color 220ms var(--ease);
  box-shadow: none;
}

button:hover {
  background: #2c312a;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px) scale(0.99);
}

button.secondary {
  background: transparent;
  color: var(--ink-strong);
  border-color: rgba(27, 31, 26, 0.25);
}

button.secondary:hover {
  background: rgba(27, 31, 26, 0.04);
  border-color: var(--ink-strong);
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff8f3;
}

button.danger:hover {
  background: #6f3232;
  border-color: #6f3232;
}

button.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.accent:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 3px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fffbf2;
  color: var(--ink-strong);
  padding: 11px 13px;
  outline: none;
  font-family: Geist, system-ui, sans-serif;
  font-size: 14px;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: var(--soft);
  font-style: italic;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--ink-strong);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(184, 116, 43, 0.18);
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
}

fieldset {
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin: 0;
  padding: 18px 18px 16px;
  display: grid;
  gap: 14px;
  background: var(--paper-warm);
}

legend {
  padding: 0 8px;
  color: var(--ink-strong);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  max-width: 860px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 360;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

h2 {
  margin-bottom: 7px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--ink-strong);
}

h3 {
  margin: 18px 0 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
}

.lede {
  max-width: 720px;
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.55;
}

.eyebrow,
.rail-label {
  margin: 0 0 10px;
  color: var(--ink-strong);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10.5px;
}

#app {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  min-height: 100dvh;
}

.landing-screen {
  grid-column: 1 / -1;
  min-height: 100dvh;
  width: 100%;
  padding: 22px clamp(18px, 5vw, 84px) 72px;
  display: grid;
  gap: clamp(56px, 8vw, 110px);
}

.landing-screen.auth-screen {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 520px);
  align-items: start;
  gap: clamp(36px, 6vw, 88px);
  padding-top: 22px;
}

.landing-screen.auth-screen > .landing-nav {
  grid-column: 1 / -1;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 4px;
}

.brand,
.product-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  color: inherit;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(160deg, #f0f6ec 0%, #e3ecdd 100%);
  color: var(--charcoal);
  font-weight: 900;
  letter-spacing: -0.01em;
  border: 1px solid rgba(32, 36, 31, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.brand strong {
  display: block;
  letter-spacing: -0.005em;
}

.brand small,
.sidebar-footer small {
  display: block;
  color: var(--soft);
  font-size: 12px;
}

.landing-actions,
.landing-cta,
.button-row,
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
  box-shadow: none;
  padding: 0 12px;
}

button.ghost:hover {
  background: rgba(32, 36, 31, 0.05);
}

/* LANG TOGGLE -------------------------------------------------------- */
.lang-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  background: rgba(32, 36, 31, 0.045);
  border: 1px solid rgba(32, 36, 31, 0.08);
  border-radius: 999px;
  padding: 3px;
  isolation: isolate;
  margin-right: 6px;
}

.lang-toggle button {
  position: relative;
  z-index: 2;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--muted);
  min-height: 28px;
  padding: 0 14px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-radius: 999px;
  cursor: pointer;
  transition: color 240ms var(--ease);
  font-family: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
}

.lang-toggle button:hover {
  color: var(--ink);
  background: transparent;
  transform: none;
}

.lang-toggle button.is-active {
  color: var(--charcoal);
}

.lang-toggle .lang-pill {
  position: absolute;
  z-index: 1;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 12px -6px rgba(32, 36, 31, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 320ms var(--ease);
}

.lang-toggle .lang-pill[data-pos="es"] {
  transform: translateX(100%);
}

/* OUTLINE BUTTON (replaces ambiguous .secondary on landing) ---------- */
button.outline {
  background: transparent;
  color: var(--charcoal);
  border: 1.5px solid rgba(32, 36, 31, 0.42);
  box-shadow: none;
}

button.outline:hover {
  background: rgba(32, 36, 31, 0.05);
  border-color: var(--charcoal);
}

/* HERO V2 ------------------------------------------------------------ */
.hero-v2 {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 0.95fr);
  gap: clamp(36px, 5vw, 88px);
  align-items: center;
  padding-top: clamp(32px, 6vw, 72px);
}

.hero-copy {
  display: grid;
  gap: 22px;
  align-content: center;
  animation: rise 720ms var(--ease) both;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(38px, 4.4vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 720;
  display: grid;
  gap: 4px;
}

.hero-copy h1 .lead-line {
  display: block;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78em;
  letter-spacing: -0.018em;
}

.hero-copy h1 .punch-line {
  display: block;
  color: var(--charcoal);
  max-width: 18ch;
}

.hero-copy .lede {
  font-size: 17px;
  max-width: 54ch;
  color: #3d4339;
  margin: 0;
  line-height: 1.55;
}

.hero-copy .lede em {
  font-style: normal;
  color: var(--accent-dark);
  border-bottom: 1px dashed rgba(36, 95, 77, 0.42);
}

.landing-meta {
  margin: 0;
  font-size: 13px;
  color: var(--soft);
  letter-spacing: -0.005em;
}

/* HERO PLATE (the photo) -------------------------------------------- */
.hero-plate {
  position: relative;
  margin: 0;
  border-radius: 24px;
  overflow: hidden;
  background: #1b1f1a;
  border: 1px solid rgba(32, 36, 31, 0.1);
  box-shadow:
    0 48px 90px -42px rgba(32, 36, 31, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  aspect-ratio: 4 / 5;
  isolation: isolate;
  animation: rise 880ms 120ms var(--ease) both;
}

.hero-plate img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.96) contrast(1.05) brightness(1.04);
}

.hero-plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.55) 75%, rgba(0, 0, 0, 0.78) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-plate .hero-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
  opacity: 0.6;
}

.hero-plate figcaption {
  position: absolute;
  inset: auto 24px 24px 24px;
  z-index: 3;
  color: #f5f8f1;
  display: grid;
  gap: 6px;
  letter-spacing: -0.012em;
}

.hero-plate figcaption .time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-family: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: rgba(245, 248, 241, 0.78);
  padding: 4px 10px;
  border: 1px solid rgba(245, 248, 241, 0.2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
}

.hero-plate figcaption .time::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f0c977;
  box-shadow: 0 0 10px rgba(240, 201, 119, 0.6);
}

.hero-plate figcaption strong {
  font-size: clamp(17px, 1.8vw, 22px);
  font-weight: 660;
  line-height: 1.2;
  color: #ffffff;
  max-width: 26ch;
}

.hero-plate figcaption em {
  font-style: normal;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(245, 248, 241, 0.78);
  max-width: 36ch;
}

/* CHAT STAGE (dark dedicated section) -------------------------------- */
.chat-stage {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(1100px 600px at 22% 0%, rgba(50, 125, 100, 0.18), transparent 60%),
    radial-gradient(800px 500px at 90% 100%, rgba(159, 209, 189, 0.08), transparent 60%),
    var(--charcoal);
  color: #f5f8f1;
  border-radius: 28px;
  padding: clamp(48px, 6vw, 84px) clamp(28px, 5vw, 72px);
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  border: 1px solid rgba(245, 248, 241, 0.08);
  box-shadow: 0 60px 100px -60px rgba(32, 36, 31, 0.55);
}

.stage-header {
  display: grid;
  gap: 12px;
  max-width: 720px;
}

.stage-header .stage-eyebrow {
  color: #c5d4be;
}

.stage-header h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.022em;
  font-weight: 720;
  color: #ffffff;
  line-height: 1.05;
}

.stage-header p {
  margin: 0;
  color: rgba(245, 248, 241, 0.7);
  font-size: 16px;
  line-height: 1.55;
  max-width: 54ch;
}

.conv-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: end;
}

.conv-frame {
  position: relative;
  background: #fbfdf8;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow:
    0 38px 80px -28px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  display: grid;
  gap: 14px;
  max-width: 520px;
  width: 100%;
  transform: rotate(-0.6deg);
}

.conv-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(32, 36, 31, 0.1);
}

.conv-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #d8b48a 0%, #b88a5e 100%);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  border: 1px solid rgba(32, 36, 31, 0.06);
}

[data-lang="en"] .conv-avatar {
  background: linear-gradient(135deg, #b8c0d4 0%, #6e7a93 100%);
}

.conv-header strong {
  display: block;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.conv-header small {
  display: block;
  color: var(--soft);
  font-size: 11px;
}

.conv-status {
  font-size: 10.5px;
  font-weight: 750;
  color: var(--accent-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.conv-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(50, 125, 100, 0.12);
  animation: pulse 2.4s ease-in-out infinite;
}

.conv-thread {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.bubble {
  max-width: 86%;
  padding: 9px 12px 6px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.4;
  position: relative;
  animation: bubble-in 520ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 240ms + 320ms);
}

.bubble p {
  margin: 0;
}

.bubble time {
  display: block;
  text-align: right;
  font-size: 10px;
  color: rgba(32, 36, 31, 0.45);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.bubble.in {
  background: #ffffff;
  border: 1px solid rgba(32, 36, 31, 0.07);
  color: var(--ink);
  border-top-left-radius: 4px;
  margin-right: auto;
}

.bubble.out {
  background: linear-gradient(168deg, #dff1e6 0%, #cfe7d8 100%);
  color: #1f3a2c;
  border: 1px solid rgba(36, 95, 77, 0.18);
  border-top-right-radius: 4px;
  margin-left: auto;
}

.bubble.typing {
  background: #ffffff;
  border: 1px solid rgba(32, 36, 31, 0.07);
  border-top-left-radius: 4px;
  margin-right: auto;
  padding: 12px 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}

.bubble.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(32, 36, 31, 0.32);
  animation: typing-dot 1.2s ease-in-out infinite;
}

.bubble.typing span:nth-child(2) { animation-delay: 0.18s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.36s; }

.bubble.system {
  background: rgba(32, 36, 31, 0.04);
  border: 1px dashed rgba(32, 36, 31, 0.14);
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
  align-self: center;
  margin: 6px auto 0;
  padding: 7px 12px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.005em;
}

.bubble.system .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.stage-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  align-content: end;
}

.stage-tags span {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(245, 248, 241, 0.14);
  background: rgba(245, 248, 241, 0.045);
  color: rgba(245, 248, 241, 0.88);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  width: fit-content;
}

.stage-tags span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9fd1bd;
  margin-right: 10px;
  box-shadow: 0 0 8px rgba(159, 209, 189, 0.5);
}

/* EMPATHY V2 (single column, fixed dead zone) ----------------------- */
.empathy-v2 {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 28px;
}

.empathy-intro {
  display: grid;
  gap: 12px;
  max-width: 36ch;
}

.empathy-intro h2 {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 30px);
  letter-spacing: -0.018em;
  font-weight: 660;
  line-height: 1.18;
  color: var(--charcoal);
}

.empathy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  max-width: 64ch;
  counter-reset: empathy;
}

.empathy-list li {
  counter-increment: empathy;
  position: relative;
  padding: 14px 18px 14px 56px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(32, 36, 31, 0.06);
  transition: transform 320ms var(--ease), background 320ms var(--ease);
}

.empathy-list li:hover {
  background: #ffffff;
  transform: translateX(2px);
}

.empathy-list li::before {
  content: "0" counter(empathy);
  position: absolute;
  left: 18px;
  top: 14px;
  font-family: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--accent-dark);
  letter-spacing: 0.06em;
  font-weight: 800;
}

.empathy-list li strong {
  font-weight: 700;
  color: var(--charcoal);
  font-variant-numeric: tabular-nums;
}

.empathy-list li em {
  font-style: italic;
  color: #6b5544;
}

/* WHY (replaces fabricated founder note) ---------------------------- */
.why-block {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  padding: 0;
}

.why-rule {
  height: 100%;
  min-height: 110px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(50, 125, 100, 0.05) 100%);
  border-radius: 999px;
  width: 3px;
  justify-self: center;
}

.why-copy {
  display: grid;
  gap: 14px;
}

.why-body {
  margin: 0;
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.5;
  letter-spacing: -0.008em;
  color: var(--ink);
  max-width: 62ch;
}

.why-sig {
  margin: 0;
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: var(--muted);
  font-size: 13px;
}

.why-sig strong {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.005em;
}

/* OUTCOMES V2 (darker bodies) ---------------------------------------- */
.outcomes-v2 {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 28px;
}

.outcomes-stack {
  display: grid;
  gap: 4px;
  border-top: 1px solid rgba(32, 36, 31, 0.12);
}

.outcomes-stack article {
  display: grid;
  grid-template-columns: 80px minmax(0, 0.7fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px);
  padding: 36px 8px;
  border-bottom: 1px solid rgba(32, 36, 31, 0.12);
  align-items: start;
  transition: background 320ms var(--ease), padding 320ms var(--ease);
}

.outcomes-stack article:hover {
  background: rgba(50, 125, 100, 0.035);
  padding-left: 18px;
}

.outcomes-stack .num {
  font-family: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  color: var(--accent-dark);
  letter-spacing: 0.05em;
  padding-top: 8px;
  font-weight: 800;
}

.outcomes-stack h3 {
  margin: 0;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.018em;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.18;
}

.outcomes-stack p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  max-width: 52ch;
}

.outcomes-stack p em {
  font-style: italic;
  color: #6b5544;
}

/* OBJECTION V2 ------------------------------------------------------- */
.objection-v2 {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
  gap: clamp(24px, 5vw, 72px);
  padding: 40px clamp(24px, 4vw, 44px);
  background: linear-gradient(168deg, #f1f5ee 0%, #e8efe2 100%);
  border-radius: 22px;
  border: 1px solid rgba(32, 36, 31, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.objection-v2 h2 {
  margin: 6px 0 0;
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -0.018em;
  font-weight: 700;
  line-height: 1.2;
  color: var(--charcoal);
}

.objection-v2 p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  max-width: 56ch;
}

.objection-v2 strong {
  color: var(--charcoal);
}

/* FINAL V2 ----------------------------------------------------------- */
.final-v2 {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
}

.final-copy {
  display: grid;
  gap: 18px;
}

.final-copy h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.022em;
  font-weight: 720;
  line-height: 1.05;
  color: var(--charcoal);
  max-width: 18ch;
}

.final-copy p {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  max-width: 58ch;
}

.final-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  margin: 0;
  padding: 26px;
  background: #fbfdf8;
  border: 1px solid rgba(32, 36, 31, 0.08);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.final-facts > div {
  display: grid;
  gap: 4px;
}

.final-facts dt {
  font-size: 11px;
  color: var(--soft);
  margin: 0;
  font-weight: 750;
}

.final-facts dd {
  margin: 0;
  font-size: 16px;
  font-weight: 660;
  color: var(--ink);
  letter-spacing: -0.005em;
}

/* FOOTER ------------------------------------------------------------- */
.landing-footer {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 32px;
  border-top: 1px solid rgba(32, 36, 31, 0.08);
  color: var(--soft);
  font-size: 13px;
}

/* AUTH PANEL --------------------------------------------------------- */
.auth-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  width: min(100%, 520px);
  justify-self: end;
  align-self: start;
  margin-top: 12px;
}

.signup-copy {
  max-width: 540px;
  display: grid;
  gap: 16px;
  padding-top: 16px;
}

.signup-copy h1 {
  font-size: clamp(34px, 3.8vw, 50px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  font-weight: 720;
  margin: 0;
}

.signup-bullets {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 14.5px;
  color: var(--muted);
}

.signup-bullets li {
  padding-left: 18px;
  position: relative;
}

.signup-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 2px;
  background: var(--accent);
}

.signup-card {
  display: grid;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.signup-card h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.012em;
  font-weight: 720;
}

.signup-card label {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.signup-card input {
  font-weight: 500;
}

.signup-card button {
  margin-top: 4px;
}

.signup-fineprint {
  margin: 0;
  font-size: 11.5px;
  color: var(--soft);
  text-align: center;
}

/* MOBILE COLLAPSE ---------------------------------------------------- */
@media (max-width: 900px) {
  .hero-v2,
  .empathy-v2,
  .objection-v2,
  .final-v2,
  .conv-wrap {
    grid-template-columns: 1fr;
    padding-top: 0;
  }
  .landing-screen {
    padding: 18px clamp(16px, 5vw, 32px) 56px;
    gap: clamp(40px, 10vw, 72px);
  }
  .landing-screen.auth-screen {
    grid-template-columns: 1fr;
  }
  .auth-panel {
    width: 100%;
    justify-self: stretch;
  }
  .hero-plate {
    aspect-ratio: 4 / 3;
  }
  .hero-plate figcaption {
    inset: auto 18px 18px 18px;
  }
  .chat-stage {
    padding: clamp(28px, 6vw, 44px) clamp(20px, 5vw, 32px);
    border-radius: 22px;
  }
  .conv-frame {
    transform: rotate(0deg);
    max-width: 100%;
  }
  .stage-tags {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .empathy-list li {
    padding-left: 56px;
  }
  .why-block {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 16px;
  }
  .outcomes-stack article {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 24px 0;
  }
  .outcomes-stack .num {
    padding-top: 0;
  }
  .objection-v2 {
    padding: 28px 22px;
  }
  .final-facts {
    grid-template-columns: 1fr 1fr;
    padding: 20px;
  }
  .landing-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .lang-toggle {
    margin-right: 4px;
  }
  .lang-toggle button {
    padding: 0 10px;
  }
}

/* MOTION PRIMITIVES -------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(50, 125, 100, 0.12); }
  50%      { box-shadow: 0 0 0 6px rgba(50, 125, 100, 0.04); }
}

@keyframes typing-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.32; }
  40%           { transform: translateY(-3px); opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy,
  .hero-plate,
  .bubble,
  .conv-status::before,
  .bubble.typing span,
  .lang-toggle .lang-pill {
    animation: none !important;
    transition: none !important;
  }
}

/* shared utility for chips elsewhere in dashboard ------------------- */
.channel,
.row-meta,
.pill {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eaf0e6;
  color: #4a5449;
  font-size: 12px;
  font-weight: 760;
}

.metrics span,
.kv span,
.activation span,
.usage span,
.item-list span,
.logs span,
.fields dt {
  color: var(--muted);
  font-size: 12px;
}

.alert {
  border: 1px solid rgba(151, 68, 68, 0.34);
  background: #fff4f1;
  color: #84312f;
  border-radius: var(--radius);
  padding: 12px 13px;
  font-weight: 700;
}

/* ===================================================================
   DASHBOARD — editorial chassis (cream paper, serif headings, hairline rules)
   =================================================================== */

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--paper-warm);
  color: var(--ink-strong);
  padding: 28px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid var(--paper-edge);
  z-index: 1;
}

.app-sidebar .brand {
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}

.app-sidebar .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 0;
  background: var(--ink-strong);
  color: var(--paper-cream);
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  font-weight: 500;
  border: 0;
  box-shadow: none;
  letter-spacing: -0.02em;
}

.app-sidebar .brand strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  line-height: 1;
}

.app-sidebar .brand small {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--soft);
  margin-top: 4px;
  display: block;
}

.sidebar-section-label {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--soft);
  margin: 0 0 8px 10px;
}

nav {
  display: grid;
  gap: 1px;
}

nav a {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 36px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 0;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  position: relative;
  transition: color 180ms var(--ease);
}

nav a:hover {
  color: var(--ink-strong);
}

nav a:hover::before {
  opacity: 0.5;
}

nav a::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--ink-strong);
  opacity: 0;
  transition: opacity 200ms var(--ease), width 200ms var(--ease);
}

nav a.active {
  color: var(--ink-strong);
  font-weight: 600;
}

nav a.active::before {
  opacity: 1;
  width: 16px;
  background: var(--accent-warm);
}

.sidebar nav span {
  display: none;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--paper-edge);
}

.sidebar-footer small {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--soft);
}

.sidebar-footer strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.005em;
  color: var(--ink-strong);
  line-height: 1.2;
}

.sidebar-footer button {
  margin-top: 4px;
  min-height: 36px;
  font-size: 12.5px;
}

.main {
  padding: 32px clamp(24px, 4vw, 56px) 56px;
  display: grid;
  gap: 28px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

/* SECTION HEADER (replaces .hero) ----------------------------------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.hero::after { content: none; }

.hero h1 {
  margin: 6px 0 10px;
  font-family: var(--serif);
  font-style: normal;
  font-weight: 380;
  font-size: clamp(32px, 3.6vw, 48px);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  max-width: 22ch;
}

.hero h1::first-letter {
  font-style: italic;
  font-weight: 400;
}

.hero .lede {
  font-size: clamp(15px, 1.15vw, 17px);
  color: var(--muted);
  margin: 0;
  max-width: 58ch;
}

.hero .eyebrow {
  color: var(--accent-warm);
}

.hero-actions {
  align-items: end;
  align-content: end;
  justify-content: flex-end;
}

.hero-strip {
  grid-column: 1 / -1;
  border-top: 0;
  padding: 14px 0 0;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10.5px;
}

.hero-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Compact section header — used everywhere except Overview, where the
   editorial lede actually pays its rent. Other sections get kicker + h1
   only; the global plan/channel status lives in the sidebar footer. */
.hero-compact {
  padding-bottom: 14px;
  margin-bottom: clamp(20px, 2.4vw, 32px);
}

.hero-compact h1 {
  margin: 4px 0 0;
  font-size: clamp(28px, 3vw, 40px);
}

/* Sidebar status strip — single global source of truth for plan and
   channel readiness. Replaces the per-section masthead strip. */
.sidebar-status {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--paper-edge);
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10.5px;
}

.sidebar-status span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dashboard-focus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(28px, 3vw, 44px);
  align-items: start;
}

.dashboard-focus > div {
  display: grid;
  gap: clamp(28px, 3vw, 40px);
  min-width: 0;
}

/* METRICS — editorial number band ----------------------------------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.metrics article {
  min-height: 92px;
  padding: 18px 20px 18px 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--rule);
  position: relative;
}

.metrics article:last-child { border-right: 0; }

.metrics article > span {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--soft);
  order: 2;
}

.metrics strong {
  display: block;
  margin: 0;
  font-family: var(--serif);
  font-weight: 360;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1;
  letter-spacing: -0.012em;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums lining-nums;
  order: 1;
}

/* OPS RAIL — cream sidebar with hairlines, not dark chrome ---------- */
.ops-rail {
  position: sticky;
  top: 32px;
  display: grid;
  gap: 22px;
  padding: 22px 22px 22px;
  background: var(--paper-warm);
  color: var(--ink);
  border: 1px solid var(--paper-edge);
  border-radius: 14px;
  box-shadow: none;
}

.ops-rail::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 22px;
  width: 56px;
  height: 16px;
  background: rgba(184, 116, 43, 0.32);
  transform: rotate(-3deg);
  border-radius: 1px;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(27, 31, 26, 0.08);
}

.ops-rail p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  font-size: 13px;
}

.rail-section {
  display: grid;
  gap: 8px;
}

.rail-section strong {
  display: block;
  font-family: var(--serif);
  font-weight: 380;
  font-style: italic;
  font-size: clamp(20px, 1.7vw, 26px);
  line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--ink-strong);
  margin: 0;
}

.rail-section.compact {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}

.rail-checks {
  display: grid;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  overflow: visible;
}

.rail-checks div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  background: transparent;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}

.rail-checks div:last-child { border-bottom: 0; }

.rail-checks span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  align-self: center;
}

.rail-checks b {
  font-weight: 600;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
  font-family: Geist, system-ui, sans-serif;
  font-size: 13px;
}

.grid {
  display: grid;
  gap: clamp(20px, 2.4vw, 32px);
}

.grid.two {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.grid.two.wide-detail {
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.25fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Single-column section: form-driven pages (WhatsApp, Phone, Connectors,
   Notifications, Billing, Team) read better at editorial line lengths than
   stretched across a 1200px desktop column. */
.single-col {
  display: grid;
  gap: clamp(24px, 2.6vw, 36px);
  max-width: clamp(560px, 60vw, 760px);
}

/* PANEL — cream-on-cream layered surface, not a card ---------------- */
.panel {
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: none;
  padding-top: 22px;
}

.panel > h2 {
  margin-top: 0;
}

.panel > p,
.panel-head p {
  color: var(--muted);
  margin: 4px 0 18px;
  font-size: 14px;
  max-width: 60ch;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.panel.compact { padding-top: 18px; }

.panel-head h2 {
  font-family: var(--serif);
  font-weight: 700;
  margin: 0;
}

.panel-head p {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0 0;
}

/* Most prominent panel per section gets the paper-tape treatment */
.panel.launch-readiness {
  position: relative;
  padding: 28px 26px 22px;
  background: var(--paper-warm);
  border: 1px solid var(--paper-edge);
  border-radius: 14px;
  border-top: 1px solid var(--paper-edge);
}

.panel.launch-readiness::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 32px;
  width: 80px;
  height: 16px;
  background: rgba(184, 116, 43, 0.32);
  transform: rotate(-2deg);
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(27, 31, 26, 0.08);
}

.stack {
  display: grid;
  gap: 14px;
}

.split-top {
  border-top: 1px solid var(--rule);
  padding-top: 22px;
  margin-top: 22px;
}

.activation,
.usage,
.kv,
.fields {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.fields { display: grid; }

.activation div,
.usage div,
.fields div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  font-size: 14px;
}

.kv {
  display: grid;
  grid-template-columns: minmax(160px, 0.5fr) minmax(0, 1fr);
  border-top: 1px solid var(--rule);
}

.kv span,
.kv strong {
  display: block;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}

.kv span {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--soft);
  align-self: center;
  font-weight: 500;
}

.kv strong {
  color: var(--ink-strong);
  font-weight: 500;
  font-family: Geist, system-ui, sans-serif;
}

.kv.compact span,
.kv.compact strong {
  padding: 8px 0;
  font-size: 13px;
}

.fields dt {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--soft);
  font-weight: 500;
}

.fields dd {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-strong);
  text-align: right;
}

.activation strong,
.usage strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 16px;
  color: var(--ink-strong);
}

.usage div {
  flex-wrap: wrap;
}

.usage small {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10.5px;
  width: 100%;
  margin-top: 2px;
}

.readiness {
  display: grid;
  gap: 18px;
  margin-bottom: 0;
}

.readiness-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.readiness-head strong {
  display: block;
  font-family: var(--serif);
  font-weight: 380;
  font-style: italic;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.05;
  margin-top: 4px;
  color: var(--ink-strong);
}

.progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(27, 31, 26, 0.08);
  border: 0;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 460ms var(--ease);
}

.checklist {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.check-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
}

.check-row b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--soft);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0;
  margin-top: 1px;
}

.check-row.complete b {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff8f3;
}

.check-row.blocked b {
  background: transparent;
  border-color: var(--accent-warm);
  color: var(--accent-warm);
}

.check-row strong {
  font-family: Geist, system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-strong);
  letter-spacing: -0.005em;
}

.check-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* TOOLBAR — search + filters ---------------------------------------- */
.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
  grid-template-areas:
    "search"
    "filters";
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  background: var(--paper-warm);
  border: 1px solid var(--paper-edge);
  border-radius: 12px;
}

.toolbar input:first-child {
  grid-area: search;
  grid-column: 1 / -1;
}

.toolbar select,
.toolbar input[type="date"] {
  font-size: 12px;
}

@supports (selector(:has(*))) {
  .toolbar {
    grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(110px, 1fr));
    grid-template-areas:
      "search status channel urgency"
      "outcome dfrom dto dto";
  }
  .toolbar > select:nth-of-type(1) { grid-area: status; }
  .toolbar > select:nth-of-type(2) { grid-area: channel; }
  .toolbar > select:nth-of-type(3) { grid-area: urgency; }
  .toolbar > select:nth-of-type(4) { grid-area: outcome; }
  .toolbar > input[type="date"]:nth-of-type(1) { grid-area: dfrom; }
  .toolbar > input[type="date"]:nth-of-type(2) { grid-area: dto; }
}

.toolbar input,
.toolbar select {
  background: var(--paper-cream);
  border-color: transparent;
  font-size: 13px;
  padding: 9px 12px;
}

.toolbar input:focus,
.toolbar select:focus {
  background: #fff;
  border-color: var(--ink-strong);
}

.toolbar input:first-child {
  grid-column: span 1;
}

/* CONVERSATION LIST — editorial roll, hairline rows ----------------- */
.conversation-list,
.item-list,
.logs,
.channel-grid {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.conversation-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 4px;
  width: 100%;
  min-height: 0;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 16px 4px;
  box-shadow: none;
  font-family: Geist, system-ui, sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 180ms var(--ease), padding 180ms var(--ease);
  min-height: 42px;
}

.conversation-row:hover {
  background: rgba(27, 31, 26, 0.025);
  padding-left: 12px;
  transform: none;
}

.conversation-row.selected {
  background: var(--paper-warm);
  border-color: var(--paper-edge);
  padding-left: 14px;
}

.conversation-row.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 2px;
  background: var(--accent-warm);
}

.conversation-row { position: relative; }

.conversation-row .channel {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper-warm);
  border: 1px solid var(--paper-edge);
  color: var(--ink-strong);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  padding: 0;
  align-self: center;
}

.conversation-row strong {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.005em;
  color: var(--ink-strong);
  line-height: 1.2;
}

.conversation-row small {
  grid-column: 2;
  grid-row: 2;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  font-family: var(--serif);
  font-weight: 380;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 56ch;
}

.conversation-row .row-meta {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  background: transparent;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  padding: 0;
}

/* PILLS / DOTS -------------------------------------------------- */
.channel,
.row-meta,
.pill {
  width: fit-content;
  border-radius: 4px;
  padding: 4px 8px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.pill.good {
  background: transparent;
  color: var(--accent);
  border-color: rgba(36, 95, 77, 0.32);
}

.pill.bad {
  background: transparent;
  color: var(--accent-warm);
  border-color: rgba(184, 116, 43, 0.42);
}

.pill.warn {
  background: rgba(184, 116, 43, 0.10);
  color: var(--accent-warm, #b8742b);
  border-color: rgba(184, 116, 43, 0.32);
}

.pill.neutral {
  background: var(--paper-warm, #f5efe2);
  color: var(--muted, #687066);
  border-color: var(--line, rgba(27, 31, 26, 0.12));
  font-style: italic;
  font-family: var(--hand, cursive);
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--soft);
  vertical-align: middle;
}

.dot.good {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 95, 77, 0.14);
}

.dot.bad {
  background: var(--accent-warm);
  box-shadow: 0 0 0 3px rgba(184, 116, 43, 0.18);
}

/* SUMMARY / NOTE block (inline editorial callout) ------------------- */
.summary {
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-left: 2px solid var(--accent-warm);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  font-size: 15px;
  line-height: 1.55;
}

.summary p {
  margin: 6px 0 0;
  font-style: normal;
  font-family: Geist, system-ui, sans-serif;
  font-size: 12px;
  color: var(--muted);
}

/* TRANSCRIPT — WhatsApp-style bubbles matching the demo ------------- */
.transcript {
  display: grid;
  gap: 6px;
  margin: 22px 0;
  padding: 22px;
  background: #efeae2;
  border-radius: 12px;
  border: 1px solid var(--paper-edge);
  background-image: radial-gradient(rgba(27, 31, 26, 0.05) 1px, transparent 1px);
  background-size: 7px 7px;
  list-style: none;
}

.bubble {
  position: relative;
  max-width: 78%;
  padding: 8px 10px 6px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  font-family: Geist, system-ui, sans-serif;
  font-weight: 400;
  box-shadow: 0 1px 0.5px rgba(27, 31, 26, 0.13);
  background: #fff;
  color: var(--ink-strong);
  border: 0;
}

.bubble span {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--soft);
  margin-bottom: 4px;
  font-weight: 500;
}

.bubble p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-strong);
}

/* customer (incoming) */
.bubble.customer,
.bubble.user {
  margin-right: auto;
  border-top-left-radius: 2px;
}

/* AI / staff (outgoing) */
.bubble.ai,
.bubble.staff,
.bubble.assistant {
  background: #d9fdd3;
  margin-left: auto;
  border-top-right-radius: 2px;
}

.bubble.ai span,
.bubble.staff span,
.bubble.assistant span {
  color: rgba(27, 31, 26, 0.5);
}

.bubble.system {
  background: rgba(255, 251, 240, 0.85);
  color: var(--muted);
  align-self: center;
  margin: 8px auto;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: none;
  text-align: center;
  border: 1px solid var(--paper-edge);
  box-shadow: none;
  max-width: fit-content;
}

.bubble.system span {
  display: none;
}

.bubble.system p {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

/* ITEM LIST — hairline-divided rows --------------------------------- */
.item-list div,
.logs div,
.channel-grid div {
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 14px 0;
  background: transparent;
  display: grid;
  gap: 4px;
}

.item-list.compact div { padding: 10px 0; }

.item-list span,
.logs span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--soft);
}

.item-list strong,
.logs strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  color: var(--ink-strong);
}

.item-list p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-family: Geist, system-ui, sans-serif;
}

.item-list.compact p { margin: 2px 0 0; }

/* item-list with inline forms (Knowledge, Rules, Connectors edits) - re-enable spacing */
.item-list form.stack {
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
  background: transparent;
  border-radius: 0;
  display: grid;
  gap: 12px;
}

.item-list form.stack > span {
  padding: 0;
  border: 0;
}

.logs div {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.logs div strong {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-strong);
  font-weight: 600;
}

.logs div span {
  flex: 1;
  font-family: Geist, system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.logs div button {
  min-height: 30px;
  padding: 0 12px;
  font-size: 11px;
  margin-left: auto;
}

.channel-grid {
  border-top: 0;
}

/* EMPTY STATE — editorial, not a dashed box ------------------------- */
.empty {
  min-height: 80px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 28px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  font-size: 16px;
  line-height: 1.55;
  text-align: center;
}

.switch input { display: none; }

.switch b {
  display: inline-block;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--paper-edge);
  border: 1px solid var(--rule);
  position: relative;
}

.switch b::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper-cream);
  transition: transform 160ms var(--ease);
  box-shadow: 0 1px 2px rgba(27, 31, 26, 0.18);
}

.switch input:checked + b {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked + b::after { transform: translateX(18px); }

/* BUTTON ROW — soft edge, no SaaS toolbar feel ---------------------- */
.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0 14px;
}

.button-row button {
  min-height: 36px;
  font-size: 12.5px;
  padding: 0 14px;
}

/* PANEL HEAD overrides where heading + pill share a line ------------ */
.detail .panel-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.detail .panel-head p {
  font-family: Geist, system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  margin-top: 4px;
}

/* OPERATION RECORD subsections ------------------------------------- */
.operation-record {
  display: grid;
  gap: 10px;
}

.operation-record h3 {
  margin: 0 0 6px;
}

@media (prefers-reduced-motion: no-preference) {
  .landing-console,
  .panel,
  .metrics,
  .hero,
  .ops-rail,
  .landing-grid article,
  .auth-panel {
    animation: rise-in 520ms var(--ease) both;
  }

  .landing-grid article:nth-child(2),
  .panel:nth-child(2) {
    animation-delay: 70ms;
  }

  .landing-grid article:nth-child(3),
  .panel:nth-child(3) {
    animation-delay: 120ms;
  }

  .dot.good {
    animation: breathe 1800ms var(--ease) infinite;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breathe {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(40, 115, 77, 0.18);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(40, 115, 77, 0);
  }
}

@media (max-width: 1260px) {
  .dashboard-focus {
    grid-template-columns: 1fr;
  }

  .ops-rail {
    position: static;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 0.8fr);
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(132px, 1fr));
  }

  .toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toolbar input:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1120px) {
  #app {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
  }

  nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .grid.two,
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-hero,
  .signup-screen {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .landing-screen {
    padding: 18px 16px 34px;
  }

  .main {
    padding: 14px;
  }

  .landing-nav {
    align-items: start;
    flex-direction: column;
  }

  .landing-hero,
  .landing-grid,
  .hero,
  .metrics,
  .grid.two,
  .grid.two.wide-detail,
  .grid.three,
  .toolbar,
  .channel-grid,
  .ops-rail {
    grid-template-columns: 1fr;
  }

  .toolbar input:first-child {
    grid-column: auto;
  }

  .landing-hero {
    min-height: auto;
    padding: 28px 0 6px;
  }

  .landing-console {
    transform: none;
  }

  .auth-panel {
    justify-self: stretch;
    width: 100%;
  }

  .signup-screen {
    padding: 30px 16px;
  }

  h1 {
    font-size: 36px;
  }

  .hero {
    padding: 22px;
  }

  .panel {
    padding: 16px;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .console-row {
    grid-template-columns: 1fr;
  }
}

/* ===================================================================
   MAGAZINE LANDING — editorial chassis (Fraunces serif + Caveat hand)
   =================================================================== */

:root {
  --serif: "Fraunces", "GT Sectra", "Newsreader", Georgia, serif;
  --hand: "Caveat", "Reenie Beanie", cursive;
  --ink-strong: #1b1f1a;
  --paper-warm: #f5efe2;
  --paper-cream: #faf7ee;
  --paper-edge: #ece4d3;
  --rule: rgba(27, 31, 26, 0.14);
  --accent-mag: #245f4d;
  --accent-warm: #b8742b;
}

.mag-screen {
  grid-column: 1 / -1;
  min-height: 100dvh;
  width: 100%;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(184, 116, 43, 0.06), transparent 60%),
    radial-gradient(700px 600px at 100% 30%, rgba(36, 95, 77, 0.05), transparent 60%),
    var(--paper-cream);
  color: var(--ink-strong);
  padding: 14px clamp(20px, 5vw, 96px) 36px;
  display: grid;
  gap: clamp(56px, 7vw, 112px);
  position: relative;
}

.mag-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(27, 31, 26, 0.075) 0.6px, transparent 0.6px);
  background-size: 4px 4px;
  opacity: 0.55;
  mix-blend-mode: multiply;
}

.mag-screen > * {
  position: relative;
  z-index: 1;
}

/* NAV ---------------------------------------------------------------- */
.mag-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--rule);
}

.mag-nav .brand {
  gap: 10px;
}

.mag-nav .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--ink-strong);
  color: var(--paper-cream);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 18px;
  border: none;
  box-shadow: none;
  letter-spacing: -0.02em;
}

.mag-nav .brand strong {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.012em;
  color: var(--ink-strong);
}

.mag-nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mag-link,
.mag-link-lg {
  color: var(--ink-strong);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: color 200ms var(--ease);
  letter-spacing: -0.005em;
  background: transparent;
  border: none;
}

.mag-link:hover,
.mag-link-lg:hover {
  color: var(--accent-mag);
}

.mag-link-lg {
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mag-cta,
.mag-cta-lg,
.mag-cta-hero {
  background: var(--ink-strong);
  color: var(--paper-cream);
  border: 1px solid var(--ink-strong);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  cursor: pointer;
  min-height: 38px;
  box-shadow: 0 8px 22px -16px rgba(27, 31, 26, 0.6);
  transition: transform 220ms var(--ease), background 220ms var(--ease), box-shadow 220ms var(--ease);
  font-family: inherit;
}

.mag-cta:hover,
.mag-cta-lg:hover,
.mag-cta-hero:hover {
  background: #2c322b;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -16px rgba(27, 31, 26, 0.7);
}

.mag-cta:active,
.mag-cta-lg:active,
.mag-cta-hero:active {
  transform: translateY(1px);
}

.mag-cta-lg {
  font-size: 16px;
  padding: 14px 28px;
  min-height: 50px;
  border-radius: 999px;
}

.mag-cta-hero {
  font-size: 18px;
  padding: 20px 38px 22px;
  min-height: 64px;
  border-radius: 999px;
  letter-spacing: -0.012em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.mag-cta-hero::after {
  content: "→";
  font-size: 22px;
  font-weight: 400;
  transition: transform 280ms var(--ease);
}

.mag-cta-hero:hover::after {
  transform: translateX(4px);
}

.mag-secondary-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(27, 31, 26, 0.55);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: color 200ms var(--ease);
  margin-top: -8px;
}

.mag-secondary-link:hover {
  color: var(--ink-strong);
}

/* Focus styles for keyboard users ----------------------------------- */
.mag-screen :focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 4px;
  border-radius: 4px;
}

.mag-cta:focus-visible,
.mag-cta-lg:focus-visible,
.mag-cta-hero:focus-visible {
  outline-offset: 5px;
}

/* HERO --------------------------------------------------------------- */
.mag-hero {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: clamp(20px, 2.6vw, 36px);
  padding-top: 0;
  margin-top: calc(-1 * clamp(40px, 6vw, 96px));
}

.mag-kicker {
  margin: 0;
  padding-top: clamp(28px, 4vw, 56px);
  font-family: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  color: rgba(27, 31, 26, 0.55);
  display: flex;
  align-items: center;
  gap: 14px;
}

.mag-kicker::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.mag-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.85fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

.mag-hero-copy {
  display: grid;
  gap: 22px;
  align-content: center;
  animation: mag-rise 880ms var(--ease) both;
}

.mag-h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 360;
  font-size: clamp(46px, 6.4vw, 92px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  color: var(--ink-strong);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  max-width: 14ch;
}

.mag-h1::first-letter {
  font-style: italic;
}

.mag-lede {
  margin: 0;
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: rgba(27, 31, 26, 0.78);
  max-width: 44ch;
  font-variation-settings: "opsz" 36;
}

.mag-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.mag-handwritten {
  font-family: var(--hand);
  font-weight: 600;
  color: rgba(27, 31, 26, 0.62);
  letter-spacing: 0.01em;
}

.mag-margin-note {
  margin: 4px 0 0;
  font-size: 22px;
  transform: rotate(-2deg);
  display: inline-block;
}

.mag-margin-note::before {
  content: "↳ ";
  font-family: var(--hand);
  margin-right: 4px;
  color: var(--accent-warm);
}

/* PHOTO (polaroid feel) --------------------------------------------- */
.mag-photo {
  position: relative;
  margin: 0;
  background: #fffdf6;
  padding: 16px 16px 56px;
  box-shadow:
    0 32px 60px -36px rgba(27, 31, 26, 0.45),
    0 1px 0 rgba(27, 31, 26, 0.05);
  transform: rotate(-1.2deg);
  border: 1px solid rgba(27, 31, 26, 0.05);
  isolation: isolate;
  animation: mag-rise 920ms 120ms var(--ease) both;
}

.mag-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: saturate(0.95) contrast(1.04);
}

.mag-photo-tape {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 110px;
  height: 28px;
  background: rgba(184, 116, 43, 0.32);
  border-radius: 2px;
  z-index: 2;
  box-shadow: 0 2px 8px -4px rgba(27, 31, 26, 0.18);
}

.mag-photo figcaption {
  margin-top: 14px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 0 4px;
}

.mag-photo-stamp {
  font-family: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-warm);
  border: 1px solid var(--accent-warm);
  padding: 2px 6px;
  border-radius: 3px;
  flex: none;
}

.mag-photo-cap {
  font-family: var(--hand);
  font-size: 19px;
  color: var(--ink-strong);
  line-height: 1.1;
}

/* DEMO --------------------------------------------------------------- */
.mag-demo {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  background: #15191a;
  color: #f5f0e1;
  border-radius: 28px;
  padding: clamp(40px, 5vw, 64px) clamp(24px, 5vw, 56px);
  display: grid;
  gap: clamp(20px, 3vw, 32px);
  border: 1px solid rgba(245, 240, 225, 0.08);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.mag-demo::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(245, 240, 225, 0.06) 0.6px, transparent 0.6px);
  background-size: 4px 4px;
  pointer-events: none;
  opacity: 0.4;
}

.mag-demo-intro {
  display: grid;
  gap: 14px;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.mag-demo-intro .mag-demo-label {
  justify-content: center;
}

.mag-demo-intro .mag-demo-sub {
  margin-left: auto;
  margin-right: auto;
}

.mag-demo-label {
  font-family: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  color: rgba(245, 240, 225, 0.55);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.mag-demo-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f0c977;
  box-shadow: 0 0 10px rgba(240, 201, 119, 0.6);
  animation: mag-pulse 2.4s ease-in-out infinite;
}

.mag-demo-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 360;
  font-style: italic;
  font-size: clamp(36px, 4.5vw, 64px);
  line-height: 1;
  letter-spacing: -0.025em;
  color: #fffdf6;
  font-variation-settings: "opsz" 144;
}

.mag-demo-sub {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
  color: rgba(245, 240, 225, 0.72);
  max-width: 52ch;
  letter-spacing: -0.008em;
}

.mag-demo-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 16px;
  margin-top: 8px;
}

.mag-arrow-note {
  display: block;
  margin-top: 18px;
  font-size: 22px;
  color: rgba(245, 240, 225, 0.72);
  transform: rotate(-1.5deg);
  font-family: var(--hand);
  text-align: center;
}

/* PHONE FRAME -------------------------------------------------------- */
.mag-phone {
  position: relative;
  width: min(100%, 420px);
  background: #ece5d7;
  border-radius: 36px;
  padding: 14px;
  box-shadow:
    0 60px 90px -50px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.mag-phone-bar {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(27, 31, 26, 0.08);
  background: #128c7e;
  color: #fff;
  border-radius: 24px 24px 0 0;
  margin: -2px -2px 0;
}

.mag-phone-back {
  font-size: 22px;
  font-weight: 300;
  padding: 0 4px;
  opacity: 0.85;
}

.mag-phone-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d8b48a 0%, #b88a5e 100%);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
}

[data-lang="en"] .mag-phone-avatar {
  background: linear-gradient(135deg, #b8c0d4 0%, #6e7a93 100%);
}

.mag-phone-id strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #fff;
}

.mag-phone-id small {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  font-style: italic;
  transition: color 200ms var(--ease);
}

.mag-phone-icons {
  display: inline-flex;
  gap: 14px;
  color: rgba(255, 255, 255, 0.85);
  padding: 0 4px;
}

.mag-phone-thread {
  list-style: none;
  margin: 0;
  padding: 18px 14px;
  display: grid;
  gap: 6px;
  background: #efeae2;
  background-image:
    radial-gradient(rgba(0, 0, 0, 0.04) 0.5px, transparent 0.5px),
    radial-gradient(rgba(0, 0, 0, 0.03) 0.5px, transparent 0.5px);
  background-size: 18px 18px, 9px 9px;
  background-position: 0 0, 9px 9px;
  min-height: 380px;
  align-content: end;
}

.mag-bubble {
  max-width: 86%;
  padding: 8px 11px 5px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 320ms var(--ease), transform 380ms var(--ease);
  font-family: -apple-system, "Helvetica Neue", sans-serif;
}

.mag-bubble.is-shown {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* First bubble is visible immediately — no scroll-trigger needed */
.mag-bubble:nth-child(1) {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mag-bubble p {
  margin: 0;
  color: #1f1f1f;
}

.mag-bubble time {
  display: block;
  text-align: right;
  font-size: 10px;
  color: rgba(0, 0, 0, 0.4);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.mag-bubble-in {
  background: #ffffff;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
  margin-right: auto;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.mag-bubble-out {
  background: #d9fdd3;
  border-bottom-right-radius: 3px;
  align-self: flex-end;
  margin-left: auto;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.mag-bubble-typing {
  background: #ffffff;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
  margin-right: auto;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
  width: fit-content;
  padding: 11px 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
}

.mag-bubble-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  animation: mag-typing 1.2s ease-in-out infinite;
}

.mag-bubble-typing span:nth-child(2) { animation-delay: 0.18s; }
.mag-bubble-typing span:nth-child(3) { animation-delay: 0.36s; }

.mag-system {
  align-self: center;
  margin: 8px auto 0;
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 320ms var(--ease), transform 380ms var(--ease);
  font-family: "Geist", sans-serif;
}

.mag-system.is-shown {
  opacity: 1;
  transform: translateY(0);
}

.mag-system .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-mag);
  flex: none;
}

.mag-phone-input {
  display: flex;
  align-items: center;
  background: #f5f0e1;
  margin: 0 -2px -2px;
  padding: 12px 16px;
  border-radius: 0 0 24px 24px;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  font-family: -apple-system, sans-serif;
}

.mag-phone-input-fake {
  font-style: italic;
  opacity: 0.7;
}

.mag-demo-caption {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: rgba(245, 240, 225, 0.55);
  letter-spacing: -0.005em;
  max-width: 50ch;
  text-align: center;
}

/* SPREAD (magazine bento) ------------------------------------------- */
.mag-spread {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.mag-spread-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto;
  gap: clamp(36px, 4vw, 64px) clamp(20px, 3vw, 48px);
  align-items: start;
}

.mag-pull {
  margin: 0;
  grid-column: 1 / span 7;
  display: grid;
  gap: 16px;
  align-self: start;
}

.mag-pull p {
  margin: 0;
  font-family: var(--serif);
  font-weight: 360;
  font-style: italic;
  font-size: clamp(34px, 4.4vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.024em;
  color: var(--ink-strong);
  font-variation-settings: "opsz" 144;
  position: relative;
  padding-left: 32px;
}

.mag-pull p::before {
  content: "“";
  position: absolute;
  left: -8px;
  top: -16px;
  font-size: 1.6em;
  color: var(--accent-warm);
  font-style: normal;
  line-height: 1;
}

.mag-pull footer {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: rgba(27, 31, 26, 0.6);
  padding-left: 24px;
}

.mag-polaroid {
  margin: 0;
  background: #fffdf6;
  padding: 14px 14px 44px;
  box-shadow: 0 28px 50px -28px rgba(27, 31, 26, 0.5);
  border: 1px solid rgba(27, 31, 26, 0.05);
  position: relative;
}

.mag-polaroid-hero {
  grid-column: 8 / -1;
  grid-row: 1 / span 2;
  align-self: start;
  transform: rotate(2deg);
  position: relative;
}

.mag-polaroid-hero::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 28px;
  width: 90px;
  height: 26px;
  background: rgba(184, 116, 43, 0.32);
  border-radius: 2px;
  transform: rotate(-4deg);
  z-index: 2;
  box-shadow: 0 2px 8px -4px rgba(27, 31, 26, 0.18);
}

.mag-polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.04);
}

.mag-polaroid-hero img {
  aspect-ratio: 1 / 1;
}

.mag-polaroid figcaption {
  margin-top: 8px;
  padding: 0 4px;
  display: grid;
  gap: 2px;
}

.mag-pol-cap {
  font-family: var(--hand);
  font-size: 22px;
  color: var(--ink-strong);
  line-height: 1.1;
}

.mag-pol-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: rgba(27, 31, 26, 0.6);
  line-height: 1.4;
  max-width: 32ch;
}

.mag-body {
  grid-column: 1 / span 7;
  padding-top: 8px;
}

.mag-body p {
  margin: 0;
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.55;
  letter-spacing: -0.008em;
  color: var(--ink-strong);
  max-width: 60ch;
}

.mag-objection {
  grid-column: 1 / span 7;
  display: grid;
  gap: 12px;
  padding: 24px 0 0;
  border-top: 1px solid var(--rule);
}

.mag-obj-label {
  font-size: 22px;
  transform: rotate(-1.2deg);
  display: inline-block;
  width: fit-content;
  color: var(--accent-warm);
}

.mag-obj-quote {
  margin: 0;
  font-family: var(--serif);
  font-weight: 360;
  font-style: italic;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.018em;
  color: var(--ink-strong);
  font-variation-settings: "opsz" 144;
}

.mag-obj-answer {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  color: rgba(27, 31, 26, 0.78);
  max-width: 56ch;
  letter-spacing: -0.008em;
}

.mag-obj-answer em {
  font-style: italic;
}

.mag-empathy-line {
  grid-column: 8 / -1;
  align-self: start;
  padding: 24px 0 0;
  border-top: 1px solid var(--rule);
}

.mag-empathy-line p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.4;
  color: rgba(27, 31, 26, 0.7);
  letter-spacing: -0.012em;
}

.mag-empathy-line strong {
  font-family: var(--serif);
  font-style: normal;
  font-weight: 600;
  color: var(--ink-strong);
  background: linear-gradient(180deg, transparent 60%, rgba(184, 116, 43, 0.25) 60%);
  padding: 0 4px;
}

/* SIGNOFF ------------------------------------------------------------ */
.mag-signoff {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 22px;
  padding: 56px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.mag-signoff-label {
  font-size: 38px;
  color: var(--accent-warm);
  font-weight: 700;
  transform: rotate(-2deg);
  display: inline-block;
  width: fit-content;
}

.mag-signoff-body {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: var(--ink-strong);
  max-width: 56ch;
}

.mag-signoff-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.mag-signoff-meta {
  margin: 12px 0 0;
  display: flex;
  gap: 16px;
  align-items: baseline;
  flex-wrap: wrap;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: rgba(27, 31, 26, 0.6);
}

.mag-mailto {
  font-family: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  font-style: normal;
  color: var(--ink-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  letter-spacing: -0.005em;
}

.mag-mailto:hover {
  color: var(--accent-mag);
}

/* FOOTER ------------------------------------------------------------- */
.mag-footer {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 0 0;
  font-family: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  color: rgba(27, 31, 26, 0.5);
}

.mag-footer-mark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink-strong);
  text-transform: none;
  letter-spacing: -0.02em;
}

/* AUTH SCREEN within mag chassis ------------------------------------ */
.mag-screen.auth-screen {
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 520px);
  align-items: start;
  gap: clamp(36px, 6vw, 88px);
  padding: 22px clamp(20px, 5vw, 96px) 56px;
}

.mag-screen.auth-screen .alert {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  letter-spacing: -0.005em;
  background: rgba(184, 116, 43, 0.08);
  border: 1px solid rgba(184, 116, 43, 0.32);
  color: #6b3a14;
  border-radius: 8px;
  padding: 12px 16px;
}

.mag-screen.auth-screen > .mag-nav {
  grid-column: 1 / -1;
}

.mag-screen.auth-screen .signup-copy h1 {
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(38px, 4.4vw, 60px);
  letter-spacing: -0.025em;
  line-height: 1;
}

.mag-screen.auth-screen .signup-copy h1::first-letter {
  font-style: italic;
}

/* MOBILE COLLAPSE ---------------------------------------------------- */
@media (max-width: 920px) {
  .mag-screen {
    padding: 18px clamp(16px, 5vw, 28px) 40px;
    gap: clamp(56px, 12vw, 88px);
  }
  .mag-nav {
    flex-wrap: wrap;
  }
  .mag-hero-grid {
    grid-template-columns: 1fr;
    gap: clamp(28px, 6vw, 48px);
  }
  .mag-h1 {
    max-width: 100%;
  }
  .mag-photo {
    max-width: 360px;
    margin: 0 auto;
    transform: rotate(-1deg);
  }
  .mag-spread-grid {
    grid-template-columns: 1fr;
  }
  .mag-pull,
  .mag-polaroid-hero,
  .mag-body,
  .mag-objection,
  .mag-empathy-line {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .mag-polaroid-hero {
    transform: rotate(1.2deg);
    max-width: 360px;
    margin: 0 auto;
  }
  .mag-pull p {
    font-size: clamp(28px, 8vw, 38px);
    padding-left: 18px;
  }
  .mag-screen.auth-screen {
    grid-template-columns: 1fr;
  }
  .mag-arrow-note {
    right: 4%;
    font-size: 18px;
  }
  .mag-demo {
    padding: 36px 20px;
    border-radius: 22px;
  }
  .mag-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .mag-footer-mark { order: -1; }
  .mag-actions { gap: 14px; }
}

/* MOTION PRIMITIVES -------------------------------------------------- */
@keyframes mag-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes mag-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 201, 119, 0.4); }
  50%      { box-shadow: 0 0 0 10px rgba(240, 201, 119, 0); }
}

@keyframes mag-typing {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.32; }
  40%           { transform: translateY(-3px); opacity: 0.9; }
}

@keyframes mag-typing-hide {
  to { opacity: 0; visibility: hidden; }
}

/* Typing indicator auto-hides after the last bubble has landed (~3s) */
.mag-bubble-typing.is-final-hide {
  animation: mag-typing-hide 0.3s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .mag-hero-copy,
  .mag-photo,
  .mag-bubble,
  .mag-system,
  .mag-bubble-typing span,
  .mag-demo-label::before {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ONBOARDING WIZARD ---------------------------------------------------- */
.onboarding-wizard {
  position: relative;
}
.onboarding-wizard .wizard-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 22px;
}
.onboarding-wizard .wizard-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 360;
  font-variation-settings: "opsz" 96, "SOFT" 30;
  font-size: clamp(1.85rem, 2.6vw, 2.4rem);
  line-height: 1.05;
  color: var(--ink-strong);
}
.onboarding-wizard .wizard-head h2::first-letter {
  font-style: italic;
}
.onboarding-wizard .wizard-head .lede {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  color: var(--ink-soft, #4a4f47);
}
.wizard-rail {
  margin: 0 0 22px;
  padding: 0;
}
.wizard-rail-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--soft, #8a9387);
  margin-bottom: 10px;
}
.wizard-rail-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  align-items: center;
}
.wizard-rail-steps li {
  position: relative;
}
.wizard-rail-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 8px;
  height: 1px;
  background: var(--rule);
  transform: translateY(-50%);
}
.wizard-rail-steps button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted, #687066);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.wizard-rail-steps button:hover {
  border-color: var(--accent-warm);
  color: var(--ink-strong);
}
.wizard-rail-steps .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper-edge, #ece4d3);
}
.wizard-rail-steps li.is-done .dot {
  background: var(--accent-mag, #245f4d);
}
.wizard-rail-steps li.is-current button {
  border-color: var(--ink-strong);
  background: var(--paper-cream, #faf7ee);
  color: var(--ink-strong);
}
.wizard-rail-steps li.is-current .dot {
  background: var(--accent-warm, #b8742b);
  box-shadow: 0 0 0 3px rgba(184, 116, 43, 0.12);
}
.wizard-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wizard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: clamp(20px, 3vw, 32px);
}
.wizard-fields {
  min-width: 0;
}
@media (max-width: 920px) {
  .wizard-grid { grid-template-columns: 1fr; }
}
.wizard-actions {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wizard-actions-right {
  display: flex;
  gap: 10px;
}
.wizard-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--hand, "Caveat", cursive);
  font-size: 1.15rem;
  color: var(--muted, #687066);
}
.wizard-autosave {
  font-family: var(--hand, "Caveat", cursive);
  transform: rotate(-1.5deg);
  transform-origin: left center;
}
.wizard-readiness-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted, #687066);
}

/* WIZARD WELCOME ------------------------------------------------------- */
.wizard-welcome { gap: 18px; }
.wizard-welcome-greeting {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 30px);
  color: var(--ink-strong);
}
.wizard-welcome-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.wizard-welcome-list li {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 2fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.wizard-welcome-list strong {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink-strong);
}
.wizard-welcome-list p {
  margin: 0;
  color: var(--muted, #687066);
}
@media (max-width: 700px) {
  .wizard-welcome-list li { grid-template-columns: 1fr; gap: 4px; }
}

/* WIZARD PREVIEW ------------------------------------------------------- */
.wizard-preview {
  align-self: start;
  background: var(--paper-warm, #f5efe2);
  border: 1px solid var(--paper-edge, #ece4d3);
  border-radius: 16px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.wizard-preview::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 22px;
  width: 60px;
  height: 14px;
  background: rgba(184, 116, 43, 0.32);
  transform: rotate(-3deg);
  box-shadow: 0 1px 2px rgba(27, 31, 26, 0.06);
}
.wizard-preview .rail-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted, #687066);
}
.wizard-preview blockquote {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink-strong);
}
.wizard-preview.is-empty blockquote { display: none; }
.wizard-preview.is-empty p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted, #687066);
}
.wizard-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wizard-preview-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted, #687066);
  border: 1px solid var(--rule);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--paper-cream, #faf7ee);
}

/* WIZARD REVIEW -------------------------------------------------------- */
.wizard-review { gap: 18px; }
.wizard-review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.wizard-review-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.wizard-review-list .review-row-text strong {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted, #687066);
  margin-bottom: 4px;
}
.wizard-review-list .review-row-text p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--ink-strong);
  line-height: 1.45;
}
.wizard-review-list small { color: var(--muted, #687066); font-family: var(--sans); }
.wizard-review-note {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink, #20231f);
}

/* PLAN CARD (Billing) -------------------------------------------------- */
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.plan-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.plan-head-text { display: flex; flex-direction: column; gap: 4px; }
.plan-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 360;
  font-variation-settings: "opsz" 96, "SOFT" 30;
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1;
  color: var(--ink-strong);
}
.plan-pitch {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  color: var(--ink, #20231f);
}
.plan-price {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.plan-price strong {
  font-family: var(--serif);
  font-weight: 360;
  font-variation-settings: "opsz" 96;
  font-size: clamp(2.6rem, 4vw, 3.6rem);
  line-height: 1;
  color: var(--ink-strong);
}
.plan-price span {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted, #687066);
  margin-top: 2px;
}
.plan-price small {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted, #687066);
  margin-top: 6px;
  max-width: 200px;
  text-align: right;
}
@media (max-width: 720px) {
  .plan-head { grid-template-columns: 1fr; }
  .plan-price { text-align: left; align-items: flex-start; }
  .plan-price small { text-align: left; }
}
.plan-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.plan-bullets li {
  position: relative;
  padding-left: 22px;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink, #20231f);
}
.plan-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 12px;
  height: 1px;
  background: var(--accent-mag, #245f4d);
}
.plan-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.plan-status { display: flex; flex-direction: column; gap: 4px; }
.plan-status .rail-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted, #687066);
}
.plan-status p { margin: 0; color: var(--muted, #687066); font-size: 0.92rem; }
.plan-status-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper-warm, #f5efe2);
  color: var(--ink-strong);
  border: 1px solid var(--rule);
  width: fit-content;
}
.plan-status-pill.is-active { background: var(--accent-mag, #245f4d); color: var(--paper-cream, #faf7ee); border-color: transparent; }
.plan-status-pill.is-trialing { background: var(--accent-warm, #b8742b); color: var(--paper-cream, #faf7ee); border-color: transparent; }
.plan-status-pill.is-past_due { background: #b14b3a; color: var(--paper-cream, #faf7ee); border-color: transparent; }
.plan-status-pill.is-canceled { background: var(--paper-edge, #ece4d3); color: var(--ink-strong); }
.plan-status-pill.is-pending { background: var(--paper-warm, #f5efe2); color: var(--ink-strong); }
.plan-status-pill.is-override { background: var(--paper-cream, #faf7ee); color: var(--accent-warm, #b8742b); border-color: var(--accent-warm, #b8742b); }
.plan-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.plan-actions .accent {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.plan-secondary {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted, #687066);
  text-decoration: none;
}
.plan-secondary:hover { color: var(--ink-strong); }
@media (max-width: 720px) {
  .plan-status-row { grid-template-columns: 1fr; }
  .plan-actions { align-items: flex-start; }
}
.plan-usage h3,
.plan-invoices h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--ink-strong);
}
.plan-usage ul,
.invoice-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.plan-usage-item { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.plan-usage-item:last-child { border-bottom: none; }
.plan-usage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.plan-usage-head strong { font-family: var(--mono); font-size: 0.9rem; color: var(--ink-strong); }
.plan-usage-track { width: 100%; height: 4px; background: var(--paper-edge, #ece4d3); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.plan-usage-track span { display: block; height: 100%; background: var(--accent-mag, #245f4d); border-radius: 2px; transition: width 320ms var(--ease, cubic-bezier(0.16, 1, 0.3, 1)); }
.plan-usage-track .is-warning { background: var(--accent-warm, #b8742b); }
.plan-usage-track .is-over { background: #b14b3a; }
.invoice-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.invoice-list li:last-child { border-bottom: none; }
.invoice-meta { display: flex; flex-direction: column; gap: 2px; }
.invoice-meta strong { font-family: var(--mono); font-size: 0.95rem; color: var(--ink-strong); }
.invoice-meta small { color: var(--muted, #687066); }
.invoice-list a.ghost { font-family: var(--sans); font-size: 0.85rem; }
.plan-pilot summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted, #687066);
  list-style: none;
}
.plan-pilot summary::-webkit-details-marker { display: none; }
.plan-pilot[open] summary { color: var(--ink-strong); }
.plan-pilot p { margin: 8px 0 12px; }

/* VERTICAL TEMPLATE GRID ------------------------------------------------ */
.vertical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.vertical-card {
  text-align: left;
  background: var(--paper-cream, #faf7ee);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 160ms ease, transform 120ms ease;
  font-family: var(--sans);
}
.vertical-card:hover {
  border-color: var(--accent-warm);
  transform: translateY(-1px);
}
.vertical-card.is-applied {
  border-color: var(--accent);
  background: rgba(36, 95, 77, 0.05);
}
.vertical-card strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--ink-strong);
}
.vertical-card p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  font-size: 0.92rem;
  color: var(--ink-soft, #555a51);
}
.vertical-card small {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft, #6a6f67);
}

/* HOURS GRID ----------------------------------------------------------- */
.hours-grid {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.hours-grid-head {
  display: grid;
  grid-template-columns: 60px 1fr 1fr 80px;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-soft, #6a6f67);
}
.hours-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr 80px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--rule);
}
.hours-row:last-child { border-bottom: none; }
.hours-day {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-strong);
}
.hours-row input[type="time"] {
  background: #fffbf2;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.hours-row input[type="time"]:disabled {
  opacity: 0.4;
}
.hours-row input[type="checkbox"] {
  justify-self: center;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* STAFF LIST ----------------------------------------------------------- */
.staff-list {
  display: grid;
  gap: 14px;
}
.staff-row {
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}
.staff-row legend {
  grid-column: 1 / -1;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-soft, #6a6f67);
  padding: 0 6px;
}
.staff-row [data-action="remove-staff-row"] {
  grid-column: 1 / -1;
  justify-self: end;
}

/* CONNECTION STEPS ----------------------------------------------------- */
.connection-steps {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 0;
}
.connection-steps li {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.connection-steps li:last-child { border-bottom: none; }
.connection-steps li b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--paper-warm, #f5efe2);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft, #6a6f67);
}
.connection-steps li.is-complete b {
  background: var(--accent);
  color: #faf7ee;
}
.connection-steps li strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink-strong);
}
.connection-steps li .muted {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  color: var(--ink-soft, #6a6f67);
}

/* SETUP LINK ----------------------------------------------------------- */
.setup-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(184, 116, 43, 0.06);
  border: 1px dashed var(--accent-warm);
  border-radius: 14px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.setup-link .rail-label {
  flex-basis: 100%;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft, #6a6f67);
}
.setup-link code {
  flex: 1 1 auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--ink-strong);
}

/* CHANNEL DETAIL FIELDSETS --------------------------------------------- */
.wizard-channel-detail {
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wizard-channel-detail legend {
  padding: 0 6px;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-soft, #6a6f67);
}

/* SANDBOX BANNER ------------------------------------------------------- */
.sandbox-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 18px;
  margin: 0 0 18px;
  background: rgba(184, 116, 43, 0.1);
  border: 1px solid var(--accent-warm);
  border-left-width: 4px;
  border-radius: 12px;
}
.sandbox-banner strong {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent-warm);
}
.sandbox-banner p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  color: var(--ink-strong);
  font-size: 0.95rem;
}
.sandbox-banner small {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft, #6a6f67);
}

/* MINE-ONLY TOGGLE ----------------------------------------------------- */
.mine-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-soft, #5a5f57);
  cursor: pointer;
}
.mine-toggle input { accent-color: var(--accent); }
.mine-toggle:has(input:checked) {
  border-color: var(--accent);
  color: var(--ink-strong);
}

/* ASSIGNEE CHIP -------------------------------------------------------- */
.assignee-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #faf7ee;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  margin-right: 6px;
  vertical-align: middle;
}

/* PAUSED BANNER + TAG -------------------------------------------------- */
.paused-banner {
  margin: 14px 0;
  padding: 16px 18px;
  background: rgba(184, 116, 43, 0.08);
  border: 1px solid var(--accent-warm);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.paused-banner strong {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--ink-strong);
}
.paused-banner p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  color: var(--ink-soft, #5a5f57);
}
.paused-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  background: var(--accent-warm);
  color: #faf7ee;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-style: normal;
  vertical-align: middle;
}

/* a-as-button ---------------------------------------------------------- */
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
}

/* RECEPTION DESK ------------------------------------------------------- */
.reception-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.row-meta.urgent {
  color: var(--accent-warm);
  font-weight: 600;
}

/* GHOST BUTTON --------------------------------------------------------- */
.button.ghost,
button.ghost {
  background: transparent;
  border: 1px dashed var(--rule);
  color: var(--ink-soft, #6a6f67);
}
button.ghost:hover {
  border-color: var(--ink-strong);
  color: var(--ink-strong);
}

/* BUBBLE CITATION ------------------------------------------------------ */
.bubble-citation {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  background: rgba(184, 116, 43, 0.12);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--accent-warm);
}
.bubble-citation a {
  color: var(--accent-warm);
  text-decoration: underline;
}

/* KNOWLEDGE BASE LIST -------------------------------------------------- */
.kb-search {
  width: 100%;
  background: #fffbf2;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 0.95rem;
  margin-top: 8px;
}
.kb-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft, #6a6f67);
  margin-bottom: 4px;
}
.kb-type {
  background: var(--paper-warm, #f5efe2);
  padding: 3px 8px;
  border-radius: 6px;
}
.kb-source {
  color: var(--accent-warm);
  text-decoration: none;
  word-break: break-all;
}
.kb-source:hover { text-decoration: underline; }

/* ACTIVITY FEED -------------------------------------------------------- */
.activity-feed {
  display: flex;
  flex-direction: column;
}
.activity-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 8px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.activity-row:last-child { border-bottom: none; }
.activity-row time {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft, #6a6f67);
}
.activity-row strong {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-strong);
}
.activity-row small {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft, #6a6f67);
}
.activity-row p {
  grid-column: 2 / -1;
  margin: 4px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  font-size: 0.88rem;
  color: var(--ink-soft, #5a5f57);
}

/* USAGE BARS ----------------------------------------------------------- */
.usage-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.usage-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.usage-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-strong);
}
.usage-bar-head strong {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  font-size: 1.1rem;
  color: var(--ink-strong);
}
.usage-bar-head small {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-soft, #6a6f67);
}
.usage-bar-track {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--paper-warm, #f5efe2);
  border-radius: 999px;
  overflow: hidden;
}
.usage-bar-track span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.usage-bar-track span.is-warning { background: var(--accent-warm); }
.usage-bar-track span.is-over { background: #b65042; }
.usage-bar small.muted {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft, #6a6f67);
}

/* TRIGGER GRID --------------------------------------------------------- */
.trigger-grid {
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 14px;
}
.trigger-grid legend {
  padding: 0 6px;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-soft, #6a6f67);
}
.trigger-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink-strong);
}
.trigger-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

/* PAYLOAD PREVIEW ------------------------------------------------------ */
.payload-preview {
  border: 1px dashed var(--rule);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 0;
  font-family: var(--mono);
}
.payload-preview summary {
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--ink-soft, #6a6f67);
  list-style: none;
}
.payload-preview summary::before {
  content: "▸ ";
  color: var(--accent-warm);
}
.payload-preview[open] summary::before {
  content: "▾ ";
}
.payload-preview pre {
  margin: 10px 0 0;
  padding: 12px;
  background: var(--paper-warm, #f5efe2);
  border-radius: 10px;
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-x: auto;
  color: var(--ink-strong);
}

/* VERTICAL PACK FIELDSET ----------------------------------------------- */
.vertical-pack {
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 14px;
}
.vertical-pack legend {
  padding: 0 6px;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-soft, #6a6f67);
}
.vertical-pack legend small {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
  color: var(--ink-soft, #6a6f67);
}

/* === BRAIN SURFACE ====================================================
   Knowledge + Rules merged into one surface with two tabs and a sticky
   right-side test-message panel. P4.
*/
.brain-surface {
  display: grid;
  gap: 18px;
}

.brain-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  padding: 0 0 0 4px;
}

.brain-tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 10px 16px 12px;
  margin-bottom: -1px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}

.brain-tab:hover { color: var(--ink-strong); }

.brain-tab.is-active {
  color: var(--ink-strong);
  border-bottom-color: var(--accent-warm, #b8742b);
}

.brain-tab:focus-visible {
  outline: 2px solid var(--accent-warm, #b8742b);
  outline-offset: 2px;
  border-radius: 4px;
}

.brain-content {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 22px;
  align-items: flex-start;
}

.brain-main { min-width: 0; }

.brain-panel { margin: 0; }

.brain-test {
  position: sticky;
  top: 32px;
  display: grid;
  gap: 14px;
  padding: 22px 22px 24px;
  background: var(--paper-warm, #f5efe2);
  color: var(--ink);
  border: 1px solid var(--paper-edge, #ece4d3);
  border-radius: 14px;
  box-shadow: none;
  align-self: start;
}

.brain-test h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 380;
  font-style: italic;
  font-size: clamp(20px, 1.7vw, 26px);
  line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--ink-strong);
}

.brain-test-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.brain-test textarea {
  resize: vertical;
  min-height: 72px;
}

.brain-test button.accent { width: auto; align-self: flex-start; }

.brain-test-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.brain-test-bubble-wrap {
  display: flex;
  justify-content: flex-end;
}

.brain-test-bubble {
  max-width: 92%;
  background: #d9fdd3; /* WhatsApp-out cream-green */
  color: #111b21;
  padding: 9px 12px 11px;
  border-radius: 8px 8px 2px 8px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.08);
  white-space: pre-wrap;
  word-break: break-word;
}

.brain-test-citation,
.brain-test-handoff {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 8px;
}

.brain-test-handoff { color: var(--accent-warm, #b8742b); }

.brain-form-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.brain-form-footer button.accent { margin-right: auto; }

.archive-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border: 0;
  background: transparent;
  padding: 0;
  line-height: 1;
}

.archive-link:hover {
  color: var(--ink-strong);
  text-decoration: underline;
}

.brain-ghost-link {
  align-self: flex-start;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  margin-top: -4px;
}

.brain-ghost-link:hover {
  color: var(--ink-strong);
  text-decoration: underline;
}

.brain-website-import[hidden] { display: none; }

@media (max-width: 920px) {
  .brain-content {
    grid-template-columns: minmax(0, 1fr);
  }
  .brain-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .brain-test {
    position: sticky;
    bottom: 0;
    top: auto;
    margin-top: 8px;
  }
}

/* === CHANNELS SURFACE ==================================================
   WhatsApp + Phone + Forward-leads merged into one tabbed surface. Mirrors
   the Brain-tabs pattern (active amber underline, mono sentence-case labels).
   Each tab is a single card with one primary sage CTA.
*/
.channels-surface {
  display: grid;
  gap: 18px;
}

.channels-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  padding: 0 0 0 4px;
}

.channels-tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 10px 16px 12px;
  margin-bottom: -1px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}

.channels-tab:hover { color: var(--ink-strong); }

.channels-tab.is-active {
  color: var(--ink-strong);
  border-bottom-color: var(--accent-warm, #b8742b);
}

.channels-tab:focus-visible {
  outline: 2px solid var(--accent-warm, #b8742b);
  outline-offset: 2px;
  border-radius: 4px;
}

.channels-content { display: grid; gap: 18px; }

.channel-card {
  margin: 0;
  padding: 24px 26px 26px;
  background: var(--paper-warm, #f5efe2);
  color: var(--ink);
  border: 1px solid var(--paper-edge, #ece4d3);
  border-radius: 14px;
}

.channel-card-head { margin-bottom: 16px; }
.channel-card-head h2 { margin: 0 0 6px; }
.channel-card-head .lede { margin: 0; }

.channel-state {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.channel-state.is-pending strong { display: block; margin-bottom: 4px; }
.channel-state.is-pending p { margin: 0 0 8px; color: var(--muted); }

.channel-state-label { font-size: 14px; }

.channel-cta { font-size: 14px; }

.channel-text-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.channel-text-link:hover { color: var(--ink-strong); text-decoration: underline; }

.channel-ghost-link {
  font-size: 14px;
  color: var(--accent-warm, #b8742b);
  text-decoration: none;
}
.channel-ghost-link:hover { text-decoration: underline; }

.phone-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.phone-option {
  padding: 18px 20px 20px;
  background: var(--paper, #fefaf1);
  border: 1px solid var(--paper-edge, #ece4d3);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phone-option h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.2;
}

.phone-option p { margin: 0; color: var(--muted); font-size: 14px; }

.phone-option-status { margin: 4px 0 0; font-family: var(--mono); font-size: 12px; }

.forward-card-list { display: grid; gap: 10px; }

.forward-row {
  background: var(--paper, #fefaf1);
  border: 1px solid var(--paper-edge, #ece4d3);
  border-radius: 12px;
  overflow: hidden;
}

.forward-row.is-expanded { border-color: var(--accent-warm, #b8742b); }

.forward-row-head {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr auto 22px;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
}

.forward-row-head:hover { background: rgba(184, 116, 43, 0.04); }

.forward-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-warm, #f5efe2);
  border: 1px solid var(--paper-edge, #ece4d3);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-strong);
}

.forward-row-name { display: grid; gap: 2px; min-width: 0; }
.forward-row-name strong { font-size: 15px; }
.forward-row-name small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }

.forward-row-status {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--paper-warm, #f5efe2);
  color: var(--muted);
  border: 1px solid var(--paper-edge, #ece4d3);
}

.forward-row-status.status-active {
  color: #2f6f3b;
  background: #eaf5ed;
  border-color: #d3e8d8;
}

.forward-row-status.status-failed {
  color: #a8412a;
  background: #faeae3;
  border-color: #efd2c5;
}

.forward-row-chevron {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 13px;
}

.forward-row-body {
  padding: 4px 18px 18px;
  border-top: 1px solid var(--paper-edge, #ece4d3);
  display: grid;
  gap: 14px;
}

.forward-edit-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.forward-payload {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 12px;
}

.forward-payload summary {
  cursor: pointer;
  color: var(--muted);
  list-style: revert;
}

.forward-payload[open] summary { color: var(--ink-strong); }

.forward-payload pre {
  margin: 10px 0 0;
  padding: 12px 14px;
  background: var(--paper, #fefaf1);
  border: 1px solid var(--paper-edge, #ece4d3);
  border-radius: 8px;
  overflow-x: auto;
  font-size: 11.5px;
  line-height: 1.5;
}

.forward-deliveries h3 {
  margin: 12px 0 8px;
  font-family: var(--serif);
  font-weight: 380;
  font-size: 18px;
}

/* QR / phone-forward modal --------------------------------------------- */
.qr-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 24px;
}

.qr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 14, 0.55);
}

.qr-modal-card {
  position: relative;
  z-index: 1;
  background: var(--paper, #fefaf1);
  color: var(--ink);
  border: 1px solid var(--paper-edge, #ece4d3);
  border-radius: 14px;
  padding: 26px 28px 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 18px 40px -18px rgba(20, 18, 14, 0.4);
  display: grid;
  gap: 14px;
}

.qr-modal-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(20px, 1.7vw, 26px);
  line-height: 1.2;
}

.qr-modal-card p { margin: 0; color: var(--muted); font-size: 14px; }

.qr-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
}

.qr-modal-close:hover { color: var(--ink-strong); }

.qr-modal-image {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.qr-modal-image img {
  width: 240px;
  height: 240px;
  display: block;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  border: 1px solid var(--paper-edge, #ece4d3);
  /* On very narrow viewports the 240px QR plus 16px padding plus the
     28px card padding plus 24px backdrop padding overflows. Clamp to
     the available column on small screens. */
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

@media (max-width: 380px) {
  .qr-modal { padding: 16px; }
  .qr-modal-card { padding: 22px 18px 22px; }
  .qr-modal-image img { width: 200px; }
}

.qr-modal-link {
  display: grid;
  gap: 6px;
}

.qr-modal-link code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--paper-warm, #f5efe2);
  padding: 8px 10px;
  border-radius: 6px;
  word-break: break-all;
}

@media (max-width: 920px) {
  .channels-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .phone-options { grid-template-columns: 1fr; }
  .forward-row-head { grid-template-columns: 36px 1fr; row-gap: 6px; }
  .forward-row-status { grid-column: 1 / -1; justify-self: start; }
  .forward-row-chevron { position: absolute; right: 18px; top: 18px; }
  .forward-row { position: relative; }
}

/* PLAN SURFACE — outgoing message log ----------------------------------- */
.plan-surface .plan-outgoing .outgoing-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.plan-surface .plan-outgoing .outgoing-log li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.plan-surface .plan-outgoing .outgoing-log li:last-child {
  border-bottom: 0;
}
.plan-surface .plan-outgoing .outgoing-log time {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.plan-surface .plan-outgoing .outgoing-log span {
  color: var(--ink);
}

/* SETTINGS DRAWER — left rail tabs + content ---------------------------- */
.settings-surface {
  max-width: clamp(640px, 78vw, 940px);
}
.settings-drawer {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
  border-right: 1px solid var(--rule);
  position: sticky;
  top: 24px;
}
.settings-tabs .settings-tab {
  position: relative;
  background: transparent;
  border: 0;
  padding: 10px 18px 10px 22px;
  margin: 0;
  text-align: left;
  font: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
  border-radius: 0;
  transition: color 200ms var(--ease);
}
.settings-tabs .settings-tab:hover {
  color: var(--ink-strong);
}
.settings-tabs .settings-tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 16px;
  background: var(--accent-warm);
  opacity: 0;
  transition: opacity 200ms var(--ease), width 200ms var(--ease);
}
.settings-tabs .settings-tab.active {
  color: var(--ink-strong);
  font-weight: 600;
}
.settings-tabs .settings-tab.active::before {
  opacity: 1;
  width: 3px;
}
.settings-content {
  min-width: 0;
}
.settings-section {
  display: grid;
  gap: 24px;
  max-width: 640px;
}
.settings-section .panel + .panel {
  margin-top: 0;
}

/* Editorial form chrome for time-of-day pickers ------------------------- */
.time-pick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--paper-cream, #f5efe4);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.time-pick .time-pick-sep {
  font-family: var(--mono);
  color: var(--muted);
  user-select: none;
}
.time-pick .time-pick-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 2px 4px;
  margin: 0;
  font: inherit;
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--ink-strong);
  cursor: pointer;
  outline: none;
  min-width: 36px;
  text-align: center;
}
.time-pick .time-pick-select:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 2px;
  border-radius: 4px;
}
.time-pick .time-pick-ampm {
  margin-left: 6px;
  border-left: 1px solid var(--rule);
  padding-left: 8px;
  min-width: 44px;
}
.time-pick .time-pick-select[disabled] {
  color: var(--muted);
  cursor: not-allowed;
}

/* Quieter destructive link inside team form (replaces the red full-width
   pill from the legacy design) -------------------------------------------- */
.team-row-actions {
  align-items: center;
}
.text-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
}
.text-link.danger-link {
  color: var(--danger, #a8493a);
}
.text-link.sage-link {
  color: var(--accent);
}
.text-link:hover {
  text-decoration-thickness: 2px;
}

.workspace-actions {
  display: grid;
  gap: 12px;
  align-items: start;
  justify-items: start;
}
.workspace-actions .muted {
  margin: -4px 0 0;
}

/* Mobile: tabs collapse into a horizontal scroller above content -------- */
@media (max-width: 920px) {
  .settings-drawer {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .settings-tabs {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 0 0 4px;
    gap: 0;
    scrollbar-width: none;
  }
  .settings-tabs::-webkit-scrollbar { display: none; }
  .settings-tabs .settings-tab {
    flex: 0 0 auto;
    padding: 10px 14px;
  }
  .settings-tabs .settings-tab::before {
    left: 50%;
    top: auto;
    bottom: -4px;
    transform: translateX(-50%) translateY(0);
    width: 0;
    height: 3px;
  }
  .settings-tabs .settings-tab.active::before {
    width: 18px;
  }
  .settings-section {
    max-width: 100%;
  }
}

/* === INBOX SURFACE ===================================================
   Owned by P3 (docs/superpowers/plans/2026-05-03-dashboard-redesign.md).
   WhatsApp Business chrome inspires the bubble thread; the list+detail
   layout mirrors the legacy `.grid.two.wide-detail` proportions but with
   a denser, more editorial row chrome (avatar + serif name + muted
   preview + mono time). Mobile collapses to single-column with a list
   pane and a detail pane, where the URL `data-conversation-id` decides
   which is visible.
   ----------------------------------------------------------------- */

.inbox {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.inbox-grid,
.inbox > .inbox-list,
.inbox > .inbox-detail {
  /* container queries available via the parent grid */
}

.inbox {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(420px, 1.25fr);
  gap: 24px;
  align-items: start;
}

.inbox-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.inbox-segments {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.inbox-segment {
  background: var(--paper-cream);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}

.inbox-segment em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.inbox-segment:hover {
  border-color: var(--line-strong);
}

.inbox-segment.is-active,
.inbox-segment[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper-cream);
}

.inbox-segment.is-active em,
.inbox-segment[aria-pressed="true"] em {
  color: var(--paper-cream);
}

.inbox-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--paper-cream);
  color: var(--ink);
  font-size: 14px;
}

.inbox-search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread-row {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  min-height: 56px;
  transition: background 140ms var(--ease);
}

.thread-row:hover {
  background: var(--paper-warm);
}

.thread-row.is-selected {
  background: var(--paper-warm);
}

.thread-row.is-selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 4px;
  background: var(--accent-warm);
}

.thread-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--paper-cream);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.thread-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.thread-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.thread-name {
  font-family: var(--serif);
  font-weight: 380;
  font-size: 16px;
  color: var(--ink-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.thread-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  flex: 0 0 auto;
  letter-spacing: 0.01em;
}

.thread-preview {
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.thread-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.thread-demo-pill {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 600;
}

.thread-demo-pill-detail {
  margin-left: 6px;
}

.thread-row .paused-tag {
  font-style: normal;
  font-size: 11px;
  color: var(--accent-warm);
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

.inbox-empty {
  margin: 8px 4px 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Detail pane ----------------------------------------------------- */

.inbox-detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.inbox-detail.is-empty {
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 200px;
}

.inbox-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.inbox-back {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0 12px;
  border-radius: 999px;
  min-height: 34px;
  font-size: 13px;
}

.inbox-detail-id h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 420;
  font-size: 22px;
  color: var(--ink-strong);
}

.inbox-detail-meta {
  margin: 4px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.inbox-detail-meta .pill {
  font-family: var(--mono);
  font-size: 10.5px;
}

.inbox-detail-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inbox-detail-actions button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  min-height: 34px;
  padding: 0 14px;
  font-weight: 500;
  font-size: 13px;
}

.inbox-detail-actions button.ghost:hover {
  border-color: var(--line-strong);
  background: var(--paper-warm);
}

/* WhatsApp-Business-style bubble thread, namespaced under .inbox-thread
   so updates don't leak into the landing-page demo's `.mag-bubble*`
   chrome. */
.inbox-thread {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: #efe7d8;
  border-radius: 12px;
  border: 1px solid var(--line);
  min-height: 80px;
  max-height: 60vh;
  overflow-y: auto;
}

.inbox-thread .bubble {
  max-width: 78%;
  padding: 8px 11px 5px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  position: relative;
  font-family: -apple-system, "Helvetica Neue", sans-serif;
}

.inbox-thread .bubble p {
  margin: 0;
  color: #1f1f1f;
}

.inbox-thread .bubble time {
  display: block;
  text-align: right;
  font-size: 10px;
  color: rgba(0, 0, 0, 0.4);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.inbox-thread .bubble-in {
  background: #ffffff;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
  margin-right: auto;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.inbox-thread .bubble-out {
  background: #d9fdd3;
  border-bottom-right-radius: 3px;
  align-self: flex-end;
  margin-left: auto;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.inbox-thread .bubble-citation {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.55);
}

.inbox-composer,
.inbox-note-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.inbox-composer textarea,
.inbox-note-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 44px;
  background: var(--paper-cream);
  color: var(--ink);
  font-family: Geist, system-ui, sans-serif;
  font-size: 14px;
}

.inbox-composer button,
.inbox-note-form button {
  min-height: 44px;
}

.inbox-composer button.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper-cream);
}

.inbox-notes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inbox-notes li {
  border-left: 2px solid var(--line-strong);
  padding: 4px 12px;
  background: var(--paper-warm);
  border-radius: 4px;
}

.inbox-note-author {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.inbox-notes-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.inbox-events {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.inbox-events ul {
  list-style: none;
  padding: 6px 0 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.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;
}

/* Mobile inbox: list-only by default; when a thread is selected the
   detail fills the screen and the list is hidden. The router emits the
   `data-inbox-has-detail="true"` attribute on the surface when the URL
   carries a conversation id, which drives the breakpoint swap. */
@media (max-width: 920px) {
  .inbox {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .inbox-back {
    display: inline-flex;
    align-items: center;
  }

  .inbox[data-inbox-has-detail="true"] > .inbox-list {
    display: none;
  }

  .inbox:not([data-inbox-has-detail="true"]) > .inbox-detail {
    display: none;
  }

  .inbox-detail {
    padding: 16px 14px 18px;
  }

  .inbox-thread {
    max-height: none;
  }

  /* Composer + reply box are two stacked rows on mobile (textarea then
     button) so the send button can stretch full-width and not cramp the
     textarea. They sit at the natural end of the page; the page-level
     padding-bottom (set by the mobile shell block) keeps them clear of
     the bottom tab-bar. */
  .inbox-composer,
  .inbox-note-form {
    grid-template-columns: 1fr;
  }
  .inbox-composer button,
  .inbox-note-form button {
    width: 100%;
  }
}

/* === WIZARD-AS-APP SURFACE ============================================== */
/* Pre-launch (appPhase=prelaunch) the wizard fills the whole window. The
   shell is full-bleed: no sidebar, no per-section masthead. The top bar
   carries the brand + step indicator; the stage is a 2-column grid on
   desktop with the question on the left and a live "preview reply"
   WhatsApp Business card on the right. Mobile drops the preview off-stage
   (P8 polishes the sticky-bottom sheet). */
.wizard-app {
  /* The wizard surface owns the entire viewport in pre-launch. The
     parent #app uses a 2-col grid (284px sidebar + content) so the
     wizard-app must span both tracks to render full-bleed; without
     this, the surface auto-places into the 284px sidebar track and
     gets squeezed at desktop. */
  grid-column: 1 / -1;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 56px 1fr;
  background: var(--paper-cream);
  color: var(--ink);
}
.wizard-app-alert {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  max-width: 480px;
}
.wizard-topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--rule);
  background: var(--paper-cream);
}
.wizard-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-strong);
}
.wizard-brand .brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--ink-strong);
  color: var(--paper-cream);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.wizard-brand strong {
  font-family: var(--serif);
  font-weight: 480;
  font-size: 1.05rem;
  letter-spacing: -0.005em;
}
.wizard-topbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted, #687066);
}
.wizard-section-label,
.wizard-step-count {
  white-space: nowrap;
}
.wizard-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wizard-dot {
  width: 16px;
  height: 16px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.wizard-dot[disabled] { cursor: default; }
.wizard-dot span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--ink-strong);
  background: transparent;
  transition: background 160ms ease, transform 160ms ease;
}
.wizard-dot.is-done span { background: var(--accent-mag, #245f4d); border-color: var(--accent-mag, #245f4d); }
.wizard-dot.is-current span { background: var(--accent-warm, #b8742b); border-color: var(--accent-warm, #b8742b); transform: scale(1.25); }
.wizard-dot.is-coming span { background: transparent; opacity: 0.55; }
.wizard-logout {
  background: transparent;
  border: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted, #687066);
  cursor: pointer;
  padding: 4px 6px;
}
.wizard-logout:hover { color: var(--ink-strong); }

.wizard-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(40px, 5vw, 80px);
  padding: clamp(40px, 6vw, 96px) clamp(20px, 5vw, 96px);
  align-items: start;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.wizard-question-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.wizard-question-col--center { align-items: flex-start; }
.wizard-question {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 360;
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1.05;
  max-width: 22ch;
  color: var(--ink-strong);
  letter-spacing: -0.012em;
}
.wizard-lede {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  color: var(--ink-soft, #4a4f47);
  max-width: 38ch;
  font-size: clamp(15px, 1.2vw, 17px);
}
.wizard-subheading {
  margin: 18px 0 6px;
  font-family: var(--serif);
  font-weight: 480;
  font-size: 1.1rem;
  color: var(--ink-strong);
}
.wizard-empty {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted, #687066);
}

.wizard-cta {
  appearance: none;
  border: 1px solid var(--accent-mag, #245f4d);
  background: var(--accent-mag, #245f4d);
  color: var(--paper-cream);
  font-family: var(--sans);
  font-size: 0.78rem;
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease;
}
.wizard-cta:hover { filter: brightness(1.06); }
.wizard-cta:disabled { opacity: 0.45; cursor: not-allowed; }
.wizard-cta-secondary {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
}
.wizard-cta-secondary:hover {
  background: var(--ink);
  color: var(--paper-cream);
}
.wizard-secondary {
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-strong);
  font-family: var(--sans);
  font-size: 0.7rem;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.wizard-secondary:hover { border-color: var(--ink-strong); }
.wizard-skip-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--muted, #687066);
  font-family: var(--sans, "Geist", system-ui, sans-serif);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  padding-bottom: 1px;
}
.wizard-skip-link:hover { color: var(--ink-strong); }
.wizard-actions-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}
.wizard-final-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}
.wizard-ghost-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--accent-mag, #245f4d);
  font-family: var(--sans, "Geist", system-ui, sans-serif);
  font-size: 14px;
  cursor: pointer;
  align-self: flex-start;
  padding: 4px 0;
  border-bottom: 1px dotted currentColor;
}
.wizard-ghost-link:hover { color: var(--ink-strong); }

.wizard-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.wizard-field span {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--muted, #687066);
}
.wizard-field textarea,
.wizard-field input[type="text"] {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper-cream);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink-strong);
  resize: vertical;
}
.wizard-field textarea:focus,
.wizard-field input[type="text"]:focus {
  outline: 2px solid var(--accent-warm, #b8742b);
  outline-offset: 1px;
}

/* Step 1 — pack cards */
.wizard-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 6px;
}
.wizard-pack-card {
  appearance: none;
  text-align: left;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.wizard-pack-card:hover {
  border-color: var(--ink-strong);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -16px rgba(27, 31, 26, 0.4);
}
.wizard-pack-card.is-applied {
  border-color: var(--accent-mag, #245f4d);
  box-shadow: 0 0 0 2px rgba(36, 95, 77, 0.15);
}
.wizard-pack-card strong {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 480;
  color: var(--ink-strong);
}
.wizard-pack-card p {
  margin: 0;
  font-family: var(--sans, "Geist", system-ui, sans-serif);
  font-size: 14px;
  color: var(--muted, #687066);
  line-height: 1.4;
}
.wizard-pack-card small {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted, #687066);
  margin-top: 4px;
}

/* Step 2 — services rows */
.wizard-services-form,
.wizard-tone-form,
.wizard-hours-form,
.wizard-test-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
.wizard-services-list,
.wizard-locations-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wizard-service-row,
.wizard-location-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wizard-service-row input,
.wizard-location-row input {
  flex: 1;
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper-cream);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink-strong);
}
.wizard-service-row input:focus,
.wizard-location-row input:focus {
  outline: 2px solid var(--accent-warm, #b8742b);
  outline-offset: 1px;
}
.wizard-row-remove {
  appearance: none;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--muted, #687066);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.wizard-row-remove:hover { border-color: var(--ink-strong); color: var(--ink-strong); }

/* Step 3 — tone radios */
.wizard-tone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.wizard-tone-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.wizard-tone-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.wizard-tone-card strong {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 480;
  color: var(--ink-strong);
}
.wizard-tone-example {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft, #4a4f47);
}
.wizard-tone-card.is-selected {
  border-color: var(--accent-mag, #245f4d);
  background: var(--paper-cream);
  box-shadow: 0 0 0 2px rgba(36, 95, 77, 0.12);
}

/* Step 4 — hours */
.wizard-hours-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--rule);
}
.wizard-hours-row {
  display: grid;
  grid-template-columns: 96px 1fr 16px 1fr 120px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.wizard-hours-day {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-strong);
}
.wizard-hours-sep {
  text-align: center;
  color: var(--muted, #687066);
}
.wizard-time-pick input {
  appearance: none;
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--paper-cream);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
}
.wizard-time-pick.is-disabled input { opacity: 0.45; }
.wizard-hours-closed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted, #687066);
}

/* Step 5 — connect card */
.wizard-connect-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 24px;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 16px;
  max-width: 380px;
  margin-top: 12px;
}
.wizard-connect-state {
  font-family: var(--serif);
}
.wizard-connect-state strong {
  display: block;
  font-size: 1rem;
  color: var(--ink-strong);
}
.wizard-connect-state p {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted, #687066);
}
.wizard-connect-state.is-good strong { color: var(--accent-mag, #245f4d); }

/* QR modal */
.wizard-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 14, 0.55);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 24px;
}
.wizard-modal {
  background: var(--paper-cream);
  border-radius: 18px;
  padding: 32px clamp(20px, 4vw, 40px);
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  position: relative;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.4);
}
.wizard-modal h2 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  font-weight: 420;
  color: var(--ink-strong);
}
.wizard-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  appearance: none;
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--muted, #687066);
  cursor: pointer;
}
.wizard-modal-close:hover { color: var(--ink-strong); }
.wizard-qr-img {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}
.wizard-modal-link-label {
  margin: 4px 0 0;
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--muted, #687066);
}
.wizard-modal-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.wizard-modal-link-row code {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--paper-warm);
  padding: 6px 10px;
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Preview pane (right column) */
.wizard-preview-pane {
  position: sticky;
  top: 80px;
  align-self: start;
}
.wizard-preview-card {
  background: #ece5d7;
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 24px;
  padding: 12px;
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.4);
}
.wizard-preview-head {
  padding: 8px 4px 10px;
  border-bottom: 1px solid rgba(27, 31, 26, 0.08);
  text-align: center;
}
.wizard-preview-eyebrow {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: rgba(27, 31, 26, 0.6);
}
.wizard-bubble-thread {
  list-style: none;
  margin: 0;
  padding: 14px 10px;
  display: grid;
  gap: 6px;
  background: #efeae2;
  background-image:
    radial-gradient(rgba(0, 0, 0, 0.04) 0.5px, transparent 0.5px),
    radial-gradient(rgba(0, 0, 0, 0.03) 0.5px, transparent 0.5px);
  background-size: 18px 18px, 9px 9px;
  background-position: 0 0, 9px 9px;
  border-radius: 14px;
  min-height: 220px;
  align-content: end;
}
.wizard-bubble {
  max-width: 86%;
  padding: 8px 11px 5px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  font-family: -apple-system, "Helvetica Neue", sans-serif;
}
.wizard-bubble p { margin: 0; color: #1f1f1f; }
.wizard-bubble-in {
  background: #ffffff;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
  margin-right: auto;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}
.wizard-bubble-out {
  background: #d9fdd3;
  border-bottom-right-radius: 3px;
  align-self: flex-end;
  margin-left: auto;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}
.wizard-bubble-typing {
  background: #ffffff;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
  margin-right: auto;
  width: fit-content;
  padding: 11px 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}
.wizard-bubble-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  animation: mag-typing 1.2s ease-in-out infinite;
}
.wizard-bubble-typing span:nth-child(2) { animation-delay: 0.18s; }
.wizard-bubble-typing span:nth-child(3) { animation-delay: 0.36s; }
.wizard-preview-empty {
  margin: 12px 14px;
  font-family: var(--serif);
  font-style: italic;
  color: rgba(27, 31, 26, 0.55);
  font-size: 14px;
}

.wizard-test-reply {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 12px;
}

/* Desktop: the toggle and the close button are mobile-only chrome and
   default to hidden. The mobile @media block below re-enables them. */
.wizard-preview-toggle { display: none; }
.wizard-preview-close { display: none; }

@media (max-width: 920px) {
  .wizard-stage {
    grid-template-columns: 1fr;
    padding: clamp(20px, 5vw, 32px);
    gap: 24px;
    /* Reserve room for the sticky-bottom preview CTA so the last form
       row isn't covered by the floating button. */
    padding-bottom: 96px;
  }
  /* Mobile: the live-reply preview is hidden by default and slides up
     as a sheet when the sticky-bottom CTA is tapped (P8 polish). */
  .wizard-preview-pane {
    position: fixed;
    inset: auto 0 0 0;
    order: 2;
    z-index: 70;
    background: var(--paper-cream);
    border-top: 1px solid var(--rule);
    box-shadow: 0 -16px 40px -22px rgba(20, 18, 14, 0.25);
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 220ms var(--ease);
    max-height: 80vh;
    overflow-y: auto;
  }
  .wizard-preview-pane.is-sheet-open {
    transform: translateY(0);
  }
  .wizard-preview-card {
    margin: 0 auto;
    max-width: 480px;
  }
  .wizard-preview-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: center;
  }
  .wizard-preview-close {
    display: inline-grid;
    place-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--ink-strong);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
  }
  .wizard-preview-toggle {
    display: block;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 65;
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 14px 20px;
    background: var(--ink-strong);
    color: var(--paper-cream);
    font-family: var(--sans);
    font-size: 12px;
    box-shadow: 0 22px 36px -22px rgba(20, 18, 14, 0.45);
    cursor: pointer;
    min-height: 48px;
  }
  .wizard-preview-toggle:focus-visible {
    outline: 2px solid var(--accent-warm);
    outline-offset: 3px;
  }
  .wizard-question {
    font-size: clamp(28px, 7vw, 36px);
  }
  .wizard-hours-row {
    grid-template-columns: 80px 1fr 12px 1fr;
    gap: 8px;
  }
  .wizard-hours-closed {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}
@media (max-width: 600px) {
  .wizard-topbar { padding: 0 12px; }
  .wizard-section-label { display: none; }
  .wizard-pack-grid { grid-template-columns: 1fr; }
  .wizard-tone-grid { grid-template-columns: 1fr; }
}

/* ===================================================================
   MOBILE SHELL — top app-bar + bottom tab-bar (P8)
   ===================================================================
   At <920px the desktop sidebar is hidden and replaced with:
   - a fixed top app-bar (≤56px) with hamburger + section + tenant
   - a fixed bottom tab-bar (≤56px + safe-area) with 5 tabs
   - a slide-in nav sheet (hamburger target) with tenant + status + logout

   Mobile chrome is always rendered in the DOM (Approach A) but
   `display: none` at desktop. This keeps the desktop layout identical
   to pre-P8 and avoids JS-driven re-renders on viewport changes. */

.mobile-app-bar,
.mobile-tab-bar,
.mobile-nav-sheet,
.mobile-nav-backdrop {
  display: none;
}

@media (max-width: 920px) {
  /* Desktop sidebar disappears; mobile chrome takes over. */
  #app {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    display: none;
  }

  /* Reclaim the column-of-5 nav rule from the 1120px block — at
     <920px the sidebar is hidden and `nav` would otherwise still try
     to grid itself horizontally inside whatever surface uses it. */
  body > #app > .main nav,
  .main nav {
    grid-template-columns: none;
  }

  /* The page body now scrolls under fixed chrome — pad for it. */
  .main {
    padding-top: calc(56px + 14px);
    padding-bottom: calc(64px + env(safe-area-inset-bottom) + 8px);
  }

  /* TOP APP-BAR ------------------------------------------------------ */
  .mobile-app-bar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding: 0 12px;
    background: var(--paper-cream);
    border-bottom: 1px solid var(--rule);
    z-index: 100;
  }
  .mobile-app-bar-menu {
    appearance: none;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: var(--ink-strong);
    font-size: 22px;
    line-height: 1;
    border-radius: 8px;
    cursor: pointer;
  }
  .mobile-app-bar-menu:focus-visible {
    outline: 2px solid var(--accent-warm);
    outline-offset: 2px;
  }
  .mobile-app-bar-titles {
    display: grid;
    gap: 1px;
    min-width: 0;
  }
  .mobile-app-bar-section {
    font-family: var(--serif);
    font-weight: 480;
    font-size: 18px;
    letter-spacing: -0.005em;
    color: var(--ink-strong);
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-app-bar-tenant {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-app-bar-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--ink-strong);
    color: var(--paper-cream);
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    letter-spacing: -0.02em;
  }

  /* BOTTOM TAB-BAR --------------------------------------------------- */
  .mobile-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--paper-cream);
    border-top: 1px solid var(--rule);
    z-index: 100;
  }
  .mobile-tab {
    flex: 1 1 0;
    min-width: 0;
    display: grid;
    place-items: center;
    align-content: center;
    padding: 8px 4px;
    text-decoration: none;
    color: var(--soft);
    border-top: 2px solid transparent;
    transition: color 120ms ease, border-color 120ms ease;
  }
  .mobile-tab:hover {
    color: var(--muted);
  }
  .mobile-tab.is-active {
    color: var(--ink-strong);
    border-top-color: var(--accent-warm);
  }
  .mobile-tab-label {
    font-family: var(--font-sans, var(--sans));
    font-size: 12px;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .mobile-tab.is-active .mobile-tab-label {
    color: var(--accent-warm);
    font-weight: 600;
  }
  .mobile-tab:focus-visible {
    outline: 2px solid var(--accent-warm);
    outline-offset: -2px;
  }

  /* NAV SHEET (slide-in from left) ----------------------------------- */
  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(27, 31, 26, 0.32);
    z-index: 110;
    transition: opacity 200ms var(--ease);
  }
  .mobile-nav-backdrop[inert] {
    opacity: 0;
    pointer-events: none;
  }
  .mobile-nav-backdrop:not([inert]) {
    opacity: 1;
    pointer-events: auto;
  }
  .mobile-nav-sheet {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 320px);
    background: var(--paper-warm);
    border-right: 1px solid var(--paper-edge);
    padding: 18px 20px calc(20px + env(safe-area-inset-bottom));
    z-index: 120;
    transform: translateX(-100%);
    transition: transform 200ms var(--ease);
    overflow-y: auto;
    pointer-events: none;
  }
  .mobile-nav-sheet.is-open {
    transform: translateX(0);
    pointer-events: auto;
  }
  .mobile-nav-sheet-head {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 10px;
    align-items: center;
  }
  .mobile-nav-sheet-head .brand-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--ink-strong);
    color: var(--paper-cream);
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
  }
  .mobile-nav-sheet-brand {
    display: grid;
    gap: 1px;
    min-width: 0;
  }
  .mobile-nav-sheet-brand strong {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 18px;
    letter-spacing: -0.005em;
    color: var(--ink-strong);
    line-height: 1;
  }
  .mobile-nav-sheet-brand small {
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--soft);
  }
  .mobile-nav-sheet-close {
    appearance: none;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--ink-strong);
    font-size: 22px;
    line-height: 1;
    border-radius: 6px;
    cursor: pointer;
  }
  .mobile-nav-sheet-tenant {
    display: grid;
    gap: 4px;
    padding: 14px 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
  }
  .mobile-nav-sheet-tenant small {
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--soft);
  }
  .mobile-nav-sheet-tenant strong {
    font-family: var(--serif);
    font-size: 18px;
    color: var(--ink-strong);
    line-height: 1.2;
  }
  .mobile-nav-sheet-tenant .pill {
    justify-self: start;
  }
  .mobile-nav-sheet-status {
    display: grid;
    gap: 6px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--muted);
  }
  .mobile-nav-sheet-status .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: baseline;
  }
  .mobile-nav-sheet-status .dot.good { background: var(--good); }
  .mobile-nav-sheet-status .dot.bad { background: var(--danger); }
  .mobile-nav-sheet-logout {
    margin-top: auto;
    align-self: stretch;
    min-height: 44px;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  /* SURFACE z-INDEX SAFETY ------------------------------------------- */
  /* Sticky elements inside surfaces (Brain test panel, Inbox composer)
     must sit BELOW the bottom tab-bar so the tab-bar always wins. */
  .brain-test {
    z-index: 50;
  }
  .inbox-composer {
    /* On mobile only: when a thread is open, the composer sits at the
       very bottom of its column; the page padding-bottom already
       accounts for the tab-bar height. */
    position: relative;
    z-index: 50;
    background: var(--paper-cream);
  }

  /* WIZARD coexistence ---------------------------------------------- */
  /* The wizard surface renders OUTSIDE the dashboard sidebar+main shell
     (see render() in app.mjs — pre-launch returns early into <main
     class="wizard-app">). The mobile chrome is therefore not present
     during the wizard, but defensively hide it should both surfaces
     ever co-exist. */
  .wizard-app ~ .mobile-app-bar,
  .wizard-app ~ .mobile-tab-bar,
  .wizard-app ~ .mobile-nav-sheet,
  .wizard-app ~ .mobile-nav-backdrop {
    display: none;
  }
}

/* iPhone SE / smallest-target safety net (320px) ------------------- */
@media (max-width: 380px) {
  .mobile-tab {
    padding: 6px 2px;
    font-size: 9px;
  }
  .mobile-tab-label {
    font-size: 10px;
  }
  .mobile-app-bar-section {
    font-size: 16px;
  }
  .mobile-app-bar {
    padding: 0 8px;
    grid-template-columns: 40px minmax(0, 1fr) 28px;
  }
  .mobile-app-bar-mark {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .main {
    padding-left: 12px;
    padding-right: 12px;
  }
  /* Settings → Hours grid: at 320px the four columns (60+1fr+1fr+80px
     plus 10px gaps) overflow. Drop the last column's 80px to 50px and
     tighten the gap. The 'closed' checkbox still has clear hit area. */
  .hours-grid-head,
  .hours-row {
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) 32px;
    gap: 6px;
  }
  .time-pick {
    padding: 4px 6px;
    gap: 2px;
  }
  .time-pick .time-pick-select {
    min-width: 28px;
    font-size: 0.82rem;
  }
  .time-pick .time-pick-ampm {
    min-width: 32px;
    padding-left: 4px;
    margin-left: 2px;
  }
}

/* === B4.1: INBOX BOTTOM-BAR CLEARANCE ======================================
   On small screens the 56px bottom tab bar covers the reply composer.
   Apply extra padding-bottom to every main surface and to the inbox
   composer itself so the send controls are always reachable.
*/
@media (max-width: 920px) {
  body.has-mobile-shell .surface,
  body.has-mobile-shell .wizard-stage,
  body.has-mobile-shell .inbox,
  body.has-mobile-shell .brain-surface,
  body.has-mobile-shell .channels-surface,
  body.has-mobile-shell .plan-surface,
  body.has-mobile-shell .settings-surface {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 64px);
  }
  .inbox-composer,
  .inbox-note-form {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  }
}

/* === B4.2: BRAIN TEST PANEL MOBILE ORDER ===================================
   On desktop .brain-test is position:sticky in the right column.
   On mobile .brain-content collapses to one column (see line ~5157) but
   the test panel still renders between the tab nav and the form.
   Force it to natural-flow bottom by switching .brain-content to flex
   and giving .brain-test a high order value.
*/
@media (max-width: 920px) {
  .brain-content {
    display: flex;
    flex-direction: column;
  }
  .brain-test {
    order: 99;
    position: static;
    margin-top: 24px;
  }
}

/* === B4.3: SETTINGS TABS SCROLL-SNAP + FADE AFFORDANCE ====================
   The existing mobile block (line ~5702) already makes .settings-tabs
   scroll horizontally, but lacks scroll-snap and a right-edge fade hint.
   These additions layer on top without duplicating existing declarations.
*/
@media (max-width: 920px) {
  .settings-tabs {
    scroll-snap-type: x mandatory;
    mask-image: linear-gradient(to right, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
  }
  .settings-tabs .settings-tab {
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav-sheet {
    transition: none;
  }
}
