/* ==========================================================================
   app.css — Sybo.ai product-specific components
   Phone mockups, conversation-mode cards, workflow diagram, screenshot
   gallery, technology grid, legal prose. Loaded after components.css.
   Reuses tokens from variables.css. Mobile-first.
   ========================================================================== */

/* ==========================================================================
   Brand hero (blue gradient, app dashboard vibe)
   ========================================================================== */
.app-hero {
  position: relative;
  padding-top: calc(var(--header-h) + var(--space-8));
  padding-bottom: var(--space-8);
  overflow: hidden;
}
.app-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(48rem 40rem at 78% -10%, rgba(82, 101, 255, 0.18), transparent 60%),
    radial-gradient(42rem 40rem at 8% 8%, rgba(30, 142, 224, 0.18), transparent 55%);
}
.app-hero__inner {
  display: grid;
  gap: var(--space-8);
  align-items: center;
}
@media (min-width: 940px) {
  .app-hero__inner { grid-template-columns: 1.05fr 0.95fr; }
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  background: #0F172A;
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast) var(--ease-spring), box-shadow var(--t-base);
}
[data-theme='dark'] .store-badge { background: #fff; color: #0F172A; }
.store-badge:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: #fff; }
[data-theme='dark'] .store-badge:hover { color: #0F172A; }
.store-badge svg { width: 26px; height: 26px; }
.store-badge small { display: block; font-size: 0.62rem; opacity: 0.8; letter-spacing: 0.03em; }
.store-badge strong { display: block; font-family: var(--font-display); font-size: var(--fs-base); line-height: 1.1; }

/* ==========================================================================
   Phone device mockup
   ========================================================================== */
.phone {
  position: relative;
  width: min(300px, 78vw);
  aspect-ratio: 300 / 620;
  margin-inline: auto;
  border-radius: 46px;
  background: #0B1120;
  padding: 12px;
  box-shadow: var(--shadow-lg), 0 0 0 2px rgba(148, 163, 184, 0.25);
}
.phone::after {  /* side button */
  content: '';
  position: absolute;
  right: -3px; top: 130px;
  width: 3px; height: 58px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.5);
}
.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
/* Real app screenshot embedded to fill the device screen */
.shot__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.phone__notch {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 34%; height: 22px;
  background: #0B1120;
  border-radius: 0 0 14px 14px;
  z-index: 5;
}
/* Cross-fading stack of screenshots inside a device (hero tour) */
.phone-slider {
  position: absolute;
  inset: 0;
}
.phone-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-slow) var(--ease-in-out), visibility var(--t-slow);
}
.phone-slide.is-active {
  opacity: 1;
  visibility: visible;
}
/* Caption stack: grid-area overlap keeps the box as tall as the longest line,
   so swapping screens never nudges the layout. */
.phone-slider__captions {
  display: grid;
  max-width: 34ch;
  margin-top: var(--space-5);
  text-align: center;
  z-index: 2;
}
.phone-slider__caption {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-slow) var(--ease-in-out), visibility var(--t-slow);
}
.phone-slider__caption.is-active {
  opacity: 1;
  visibility: visible;
}
.phone-slider__caption strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-base);
}
.phone-slider__caption span {
  display: block;
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
}
.phone-slider__dots {
  justify-content: center;
  margin-top: var(--space-4);
  z-index: 2;
}
/* The hero sits on a tinted gradient, so --border is too faint here. */
.phone-slider__dots .slider__dot {
  background: rgba(100, 116, 139, 0.4);
  cursor: pointer;
}
.phone-slider__dots .slider__dot:hover {
  background: rgba(100, 116, 139, 0.65);
}
.phone-slider__dots .slider__dot.is-active,
.phone-slider__dots .slider__dot.is-active:hover {
  background: var(--gradient-primary);
}

.phone--floating { animation: float 6s var(--ease-in-out) infinite; }
.phone--tilt { transform: rotate(-4deg); }
.phone--tilt-r { transform: rotate(4deg); }

/* Status bar inside the mock screen */
.mock-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 6px;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--text);
}
.mock-status .dots { display: flex; gap: 3px; align-items: center; }
.mock-status .dots span { width: 4px; height: 4px; border-radius: 50%; background: var(--text); opacity: .7; }

/* Generic mock app chrome */
.mock {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  font-size: 12px;
}
.mock__sky {
  background: var(--gradient-sky);
  color: #fff;
  padding: 10px 16px 18px;
}
.mock__greeting { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: 16px; }
.mock__sub { font-size: 11px; opacity: 0.9; margin-top: 2px; }
.mock__body { padding: 14px; display: grid; gap: 10px; overflow: hidden; }

/* Mode chips shown inside the dashboard mock */
.mock-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mock-mode {
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}
.mock-mode__icon {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; color: #fff;
}
.mock-mode__label { font-weight: var(--fw-semibold); color: var(--text); }
.mock-mode--text .mock-mode__icon { background: var(--mode-text); }
.mock-mode--voice .mock-mode__icon { background: var(--mode-voice); }
.mock-mode--avatar .mock-mode__icon { background: var(--mode-avatar); }
.mock-mode--assistant .mock-mode__icon { background: var(--mode-assistant); }

/* Chat bubbles inside a mock */
.mock-chat { flex: 1; min-height: 0; align-content: start; display: grid; gap: 8px; padding: 14px; overflow: hidden; }
.bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 16px;
  line-height: 1.4;
  box-shadow: var(--shadow-sm);
}
.bubble--in { background: var(--bg-elevated); color: var(--text); border-bottom-left-radius: 5px; }
.bubble--out {
  justify-self: end;
  background: var(--gradient-primary);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.mock-inputbar {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--chat-input, #F0F4F8);
  border-radius: 22px;
  margin: 12px;
  color: var(--text-faint);
}
[data-theme='dark'] .mock-inputbar { background: var(--bg-muted); }
.mock-inputbar .send {
  margin-left: auto; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-500); color: #fff; display: grid; place-items: center;
}

/* On-screen keyboard shown beneath the chat input bar */
.mock-kbd {
  background: #D3D7DE;
  padding: 6px 3px 8px;
  display: grid;
  gap: 5px;
}
[data-theme='dark'] .mock-kbd { background: #10192B; }
.mock-kbd__row { display: flex; justify-content: center; gap: 4px; }
.mock-kbd__row > span {
  flex: 1;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  font-size: 12px;
  font-weight: var(--fw-medium);
  color: var(--text);
  background: var(--bg-elevated);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.28);
}
.mock-kbd__row .kbd-fn {
  flex: 1.4;
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(140, 152, 170, 0.28);
  box-shadow: none;
}
.mock-kbd__row .kbd-space { flex: 5; }

/* Voice orb / avatar visual inside a mock */
.mock-voice {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(circle at 50% 35%, rgba(34,197,94,0.12), transparent 60%);
}
.voice-orb {
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--gradient-accent);
  display: grid; place-items: center;
  box-shadow: 0 0 0 10px rgba(34, 197, 94, 0.12), 0 0 0 22px rgba(34, 197, 94, 0.06);
  animation: pulse-ring 2.4s var(--ease-in-out) infinite;
}
.voice-orb svg { width: 44px; height: 44px; color: #fff; }
.voice-bars { display: flex; align-items: flex-end; gap: 4px; height: 34px; }
.voice-bars span {
  width: 5px; border-radius: 3px; background: var(--mode-voice);
  animation: eq 1s var(--ease-in-out) infinite;
}
.voice-bars span:nth-child(1){ height: 40%; animation-delay: -0.9s; }
.voice-bars span:nth-child(2){ height: 80%; animation-delay: -0.6s; }
.voice-bars span:nth-child(3){ height: 55%; animation-delay: -0.3s; }
.voice-bars span:nth-child(4){ height: 95%; animation-delay: -0.15s; }
.voice-bars span:nth-child(5){ height: 60%; }
@keyframes eq { 0%,100%{ transform: scaleY(0.5);} 50%{ transform: scaleY(1);} }
@keyframes pulse-ring {
  0%,100% { box-shadow: 0 0 0 8px rgba(34,197,94,0.14), 0 0 0 18px rgba(34,197,94,0.06); }
  50% { box-shadow: 0 0 0 14px rgba(34,197,94,0.10), 0 0 0 30px rgba(34,197,94,0.04); }
}

/* Avatar video mock */
.mock-avatar {
  flex: 1;
  position: relative;
  background: linear-gradient(160deg, #F59E0B22, #1E8EE022), var(--gradient-sky);
  display: flex; align-items: flex-end;
}
.mock-avatar__face {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 45% at 50% 40%, rgba(255,255,255,0.35), transparent 70%);
}
.mock-avatar__person {
  width: 130px; height: 150px; margin: 0 auto;
  border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 38%, #ffe0bd, #f0b98a);
  position: relative; z-index: 2; align-self: center;
  box-shadow: var(--shadow-md);
}
.mock-avatar__bar {
  position: relative; z-index: 3;
  width: 100%; padding: 12px; display: flex; gap: 10px; justify-content: center;
}
.mock-avatar__bar .rbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.rbtn--end { background: #EF4444; } .rbtn--mute { background: rgba(255,255,255,0.25); backdrop-filter: blur(4px); }

/* ==========================================================================
   Conversation-mode feature cards
   ========================================================================== */
.modes-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}
@media (min-width: 620px) { .modes-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .modes-grid--4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1000px) { .modes-grid--3 { grid-template-columns: repeat(3, 1fr); } }

.mode-card {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base);
}
.mode-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.mode-card::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--m, var(--brand-500));
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-base) var(--ease-out);
}
.mode-card:hover::before { transform: scaleX(1); }
.mode-card__icon {
  width: 56px; height: 56px; border-radius: var(--radius-md);
  display: grid; place-items: center; color: #fff;
  background: var(--m, var(--brand-500));
  margin-bottom: var(--space-5);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--m, var(--brand-500)) 35%, transparent);
}
.mode-card__icon svg { width: 28px; height: 28px; }
.mode-card__tag {
  display: inline-block; font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  padding: 0.2rem 0.7rem; border-radius: var(--radius-pill);
  background: var(--mbg, var(--mode-text-bg)); color: var(--m, var(--brand-600));
  margin-bottom: var(--space-3);
}
.mode-card h3 { font-size: var(--fs-lg); margin-bottom: var(--space-2); }
.mode-card p { color: var(--text-muted); }
.mode-card--text { --m: var(--mode-text); --mbg: var(--mode-text-bg); }
.mode-card--voice { --m: var(--mode-voice); --mbg: var(--mode-voice-bg); }
.mode-card--avatar { --m: var(--mode-avatar); --mbg: var(--mode-avatar-bg); }
.mode-card--assistant { --m: var(--mode-assistant); --mbg: var(--mode-assistant-bg); }
.mode-card--twin { --m: var(--mode-twin); --mbg: var(--mode-twin-bg); }
.mode-card--choose { --m: var(--mode-choose); --mbg: var(--mode-choose-bg); }

/* ==========================================================================
   Workflow diagram
   ========================================================================== */
.flow {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
  counter-reset: flowstep;
}
@media (min-width: 720px) { .flow { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .flow--4 { grid-template-columns: repeat(4, 1fr); } }
.flow__step {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.flow--4 .flow__step:not(:last-child)::after {
  content: '';
  position: absolute; top: 50%; right: calc(var(--space-5) * -1 + 4px);
  width: var(--space-5); height: 2px;
  background: linear-gradient(90deg, var(--brand-400), transparent);
}
@media (max-width: 1039px) { .flow--4 .flow__step::after { display: none; } }
.flow__num {
  counter-increment: flowstep;
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-md);
  color: #fff; background: var(--gradient-primary);
  box-shadow: var(--shadow-glow);
  margin-bottom: var(--space-5);
}
.flow__num::before { content: counter(flowstep, decimal-leading-zero); }
.flow__step h3 { font-size: var(--fs-md); margin-bottom: var(--space-2); }
.flow__step p { color: var(--text-muted); font-size: var(--fs-sm); }

/* Image and document creation walkthroughs */
.generation-workflows {
  display: grid;
  gap: var(--space-8);
}
.generation-workflow {
  min-width: 0;
}
.generation-workflow__head {
  max-width: 680px;
  margin-bottom: var(--space-5);
}
.generation-workflow__head .mode-label {
  display: inline-flex;
  margin-bottom: var(--space-3);
  padding: .25rem .7rem;
  border-radius: var(--radius-pill);
  background: var(--mbg, var(--mode-text-bg));
  color: var(--m, var(--brand-600));
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}
.generation-workflow__head h3 {
  margin-bottom: var(--space-2);
  font-size: var(--fs-xl);
}
.generation-workflow__head p {
  color: var(--text-muted);
}
.generation-workflow .steps {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.share-video-note {
  max-width: 900px;
  margin: var(--space-6) auto 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid color-mix(in srgb, var(--brand-500) 30%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand-500) 7%, var(--bg-elevated));
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.share-video-note strong {
  color: var(--text);
}

/* Mode chips inside a flow step */
.flow__modes {
  list-style: none; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: var(--space-3);
}
.flow__modes li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 1.4;
  padding: 0.2rem 0.6rem; border-radius: var(--radius-pill);
  background: var(--mbg, var(--mode-text-bg)); color: var(--m, var(--brand-600));
}
.flow__modes li::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--m, var(--brand-500)); flex-shrink: 0;
}
.mtag--text { --m: var(--mode-text); --mbg: var(--mode-text-bg); }
.mtag--voice { --m: var(--mode-voice); --mbg: var(--mode-voice-bg); }
.mtag--avatar { --m: var(--mode-avatar); --mbg: var(--mode-avatar-bg); }
.mtag--assistant { --m: var(--mode-assistant); --mbg: var(--mode-assistant-bg); }
.mtag--twin { --m: var(--mode-twin); --mbg: var(--mode-twin-bg); }
.mtag--choose { --m: var(--mode-choose); --mbg: var(--mode-choose-bg); }

/* Vertical alternating timeline (how-it-works detailed) */
.timeline-v { position: relative; max-width: 820px; margin-inline: auto; }
.timeline-v::before {
  content: ''; position: absolute; left: 27px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--brand-400), var(--indigo-500));
}
@media (min-width: 780px) { .timeline-v::before { left: 50%; transform: translateX(-1px); } }
.tl-item { position: relative; padding-left: 68px; margin-bottom: var(--space-6); }
@media (min-width: 780px) {
  .tl-item { width: 50%; padding-left: 0; }
  .tl-item:nth-child(odd) { left: 0; padding-right: 56px; text-align: right; }
  .tl-item:nth-child(even) { left: 50%; padding-left: 56px; }
}
.tl-item__dot {
  position: absolute; left: 16px; top: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg); border: 4px solid var(--brand-500);
}
@media (min-width: 780px) {
  .tl-item:nth-child(odd) .tl-item__dot { left: auto; right: -12px; }
  .tl-item:nth-child(even) .tl-item__dot { left: -12px; }
}
.tl-item h3 { font-size: var(--fs-md); margin-bottom: var(--space-2); }
.tl-item p { color: var(--text-muted); }

/* ==========================================================================
   Screenshot gallery
   ========================================================================== */
.shots-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  justify-items: center;
}
.shot { width: 100%; max-width: 260px; }
.shot.is-hidden { display: none; }
.shot__caption { text-align: center; margin-top: var(--space-4); }
.shot__caption strong { display: block; font-family: var(--font-display); }
.shot__caption span { color: var(--text-faint); font-size: var(--fs-sm); }

/* ==========================================================================
   Technology grid
   ========================================================================== */
.tech-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}
.tech-card {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-5);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base), border-color var(--t-base);
}
.tech-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-400); }
.tech-card__logo {
  flex-shrink: 0;
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--mode-text-bg); color: var(--brand-600);
  font-family: var(--font-display); font-weight: var(--fw-bold);
}
.tech-card__logo svg { width: 24px; height: 24px; }
.tech-card h3 { font-size: var(--fs-base); margin-bottom: 2px; }
.tech-card p { color: var(--text-muted); font-size: var(--fs-sm); }

/* Tech category groups */
.tech-cat { margin-bottom: var(--space-7); }
.tech-cat__title {
  display: flex; align-items: center; gap: var(--space-3);
  font-family: var(--font-display); font-size: var(--fs-lg);
  margin-bottom: var(--space-5);
}
.tech-cat__title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ==========================================================================
   Benefit / value cards with real app icons
   ========================================================================== */
.benefit { text-align: left; }
.benefit__icon {
  width: 54px; height: 54px; border-radius: var(--radius-md);
  padding: 11px; margin-bottom: var(--space-4);
  background: var(--mode-text-bg);
  display: grid; place-items: center;
}
.benefit__icon img { width: 100%; height: 100%; object-fit: contain; }

/* ==========================================================================
   App-store style rating row / logos
   ========================================================================== */
.rating-row {
  display: flex; flex-wrap: wrap; gap: var(--space-6);
  align-items: center; justify-content: center;
}
.rating {
  display: flex; align-items: center; gap: var(--space-3);
  font-weight: var(--fw-medium); color: var(--text-muted);
}
.rating .stars { color: #FBBF24; letter-spacing: 2px; }
.rating strong { color: var(--text); font-family: var(--font-display); }

/* ==========================================================================
   Legal / prose (privacy, terms)
   ========================================================================== */
.prose {
  max-width: 780px;
  margin-inline: auto;
  color: var(--text-muted);
  line-height: var(--lh-normal);
}
.prose h2 {
  font-size: var(--fs-xl);
  color: var(--text);
  margin: var(--space-7) 0 var(--space-3);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.prose h3 { font-size: var(--fs-md); color: var(--text); margin: var(--space-5) 0 var(--space-2); }
.prose p { margin-bottom: var(--space-4); }
.prose ul { margin: 0 0 var(--space-4) var(--space-5); list-style: disc; display: grid; gap: var(--space-2); }
.prose li { padding-left: var(--space-1); }
.prose a { color: var(--brand-600); text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--text); }
.legal-meta {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-6);
}

/* Table of contents for legal pages */
.toc {
  position: sticky; top: calc(var(--header-h) + 1rem);
  align-self: start;
  /* Stay pinned while the policy text scrolls; long lists scroll inside. */
  max-height: calc(100vh - var(--header-h) - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-5);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
}
.toc h4 { font-family: var(--font-display); margin-bottom: var(--space-3); }
.toc a { display: block; padding: var(--space-1) 0; color: var(--text-muted); }
.toc a:hover { color: var(--brand-600); }
.legal-layout { display: grid; gap: var(--space-6); }
@media (min-width: 900px) { .legal-layout { grid-template-columns: 240px 1fr; } }
@media (max-width: 899px) { .toc { display: none; } }

/* Keep nav labels + CTA on one line */
.nav__link { white-space: nowrap; }
.nav__cta { white-space: nowrap; }

/* ==========================================================================
   Pricing helpers
   ========================================================================== */
.price-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--mode-avatar-bg);
  color: #B45309;
  margin-bottom: var(--space-3);
}
.price-card.is-featured .price-badge { background: rgba(255,255,255,0.22); color: #fff; }
.price-note { font-size: var(--fs-sm); color: var(--text-faint); margin-top: -0.25rem; margin-bottom: var(--space-4); }
.price-card.is-featured .price-note { color: rgba(255,255,255,0.85); }
.price-platform { font-size: var(--fs-xs); color: var(--text-faint); margin-top: var(--space-3); text-align: center; }

/* Comparison table */
.compare { width: 100%; overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); background: var(--bg-elevated); }
.compare table { width: 100%; border-collapse: collapse; min-width: 560px; }
.compare th, .compare td { padding: var(--space-4) var(--space-5); text-align: left; border-bottom: 1px solid var(--border); }
.compare tbody tr:last-child td { border-bottom: 0; }
.compare thead th { font-family: var(--font-display); font-size: var(--fs-sm); }
.compare thead th.center, .compare td.center { text-align: center; }
.compare thead th.featured { color: var(--brand-600); }
.compare tbody tr:hover { background: var(--bg-muted); }
.compare td:first-child { color: var(--text); font-weight: var(--fw-medium); }
.compare .yes { color: var(--mode-voice); font-weight: var(--fw-bold); }
.compare .no { color: var(--text-faint); }
.compare .val { color: var(--text-muted); font-size: var(--fs-sm); }
.compare .group th { background: var(--bg-muted); font-family: var(--font-display); font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding-top: var(--space-3); padding-bottom: var(--space-3); }
.compare tbody tr.group:hover { background: var(--bg-muted); }
/* Phones: fit all four columns instead of hiding Plus/Pro behind a sideways
   scroll nobody notices (the table used to be 560px wide in a ~330px box). */
@media (max-width: 599px) {
  .compare table { min-width: 0; table-layout: fixed; }
  .compare th, .compare td { padding: var(--space-3) var(--space-2); font-size: var(--fs-xs); }
  .compare th:first-child, .compare td:first-child { width: 34%; padding-left: var(--space-3); }
  .compare thead th { font-size: var(--fs-xs); }
  .compare .val { font-size: var(--fs-xs); }
  .compare .group th { letter-spacing: .03em; padding-left: var(--space-3); }
}
/* Narrowest phones: give the plan columns room for "Standard" / "Premium"
   so words wrap between words, never mid-word. */
@media (max-width: 359px) {
  .compare th, .compare td { padding-inline: var(--space-1); }
  .compare th:first-child, .compare td:first-child { width: 30%; padding-left: var(--space-2); }
}

/* Top-up minutes callout */
.topup {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--mode-voice-bg);
  border: 1px solid color-mix(in srgb, var(--mode-voice) 25%, transparent);
}
.topup__icon { width: 56px; height: 56px; border-radius: var(--radius-md); background: var(--mode-voice); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.topup__icon svg { width: 28px; height: 28px; }
.topup__body { flex: 1 1 260px; }
.topup__body h3 { font-size: var(--fs-md); margin-bottom: var(--space-1); }
.topup__body p { color: var(--text-muted); font-size: var(--fs-sm); }
.topup__price { font-family: var(--font-display); font-weight: var(--fw-extrabold); font-size: var(--fs-xl); color: var(--text); white-space: nowrap; }
.topup__price small { font-size: var(--fs-sm); color: var(--text-faint); font-weight: var(--fw-medium); }
.topup-packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); margin-top: var(--space-5); }
.topup-pack {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-1);
  padding: var(--space-5) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  transition: border-color .2s, box-shadow .2s;
}
.topup-pack:hover { border-color: var(--brand-400); box-shadow: 0 0 0 1px var(--brand-400); }
.topup-pack__badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  padding: 2px 12px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.topup-pack--popular { border-color: var(--brand-400); }
.topup-pack--popular .topup-pack__badge { background: var(--brand-500); color: #fff; }
.topup-pack--best .topup-pack__badge { background: var(--mode-voice); color: #fff; }
.topup-pack__credits { font-family: var(--font-display); font-weight: var(--fw-extrabold); font-size: var(--fs-2xl); color: var(--text); line-height: 1.1; }
.topup-pack__label { font-size: var(--fs-sm); color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.topup-pack__price { font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-lg); color: var(--brand-500); margin-top: var(--space-2); }
@media (max-width: 600px) { .topup-packs { grid-template-columns: 1fr; max-width: 280px; margin-inline: auto; } }

/* Brand logo image in header/footer */
.brand-logo { height: 30px; width: auto; display: block; }
.brand-logo--footer { height: 34px; }
/* Header and footer both keep the full-colour logo in dark mode. */

/* Comparison table (pricing / plans) */
.billing-toggles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.billing-toggles .billing-toggle { margin: 0; }
.billing-toggle {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin: 0 auto var(--space-6);
  padding: var(--space-1);
  gap: var(--space-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
}
.billing-toggle__option {
  padding: var(--space-3) var(--space-5);
  white-space: nowrap; /* "Yearly Save 20%" must not wrap into a tall oval */
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  transition: color var(--t-fast), background var(--t-base), box-shadow var(--t-base);
}
.billing-toggle__option span {
  margin-left: var(--space-1);
  color: var(--success, #16835f);
  font-size: var(--fs-xs);
}
.billing-toggle__option.is-active {
  color: var(--text);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}
.billing-toggle__option.is-active span { color: var(--brand-600); }
@media (max-width: 420px) {
  .billing-toggle__option { padding-inline: var(--space-4); }
}

.plan-grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 860px) { .plan-grid { grid-template-columns: repeat(3, 1fr); } }

/* ==========================================================================
   Tabs (mode / feature switcher)
   ========================================================================== */
.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  padding: var(--space-2);
  /* xl, not pill: one row still reads as a pill, but once the tabs wrap the
     box stays a rounded rectangle instead of ballooning into an oval. */
  border-radius: var(--radius-xl);
  background: var(--bg-muted);
  max-width: max-content;
  margin: 0 auto var(--space-7);
}
/* Phones: an even two-column grid instead of ragged centred rows. */
@media (max-width: 599px) {
  .tabs__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
    border-radius: var(--radius-lg);
  }
  .tabs__list .tab {
    justify-content: flex-start; /* dot + label line up like a list, even when a label wraps */
    text-align: left;
    padding-inline: var(--space-3);
  }
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  transition: color var(--t-fast), background var(--t-base), box-shadow var(--t-base);
}
.tab .tab__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--m, var(--brand-500)); }
.tab:hover { color: var(--text); }
.tab.is-active {
  color: var(--text);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}
.tab--text { --m: var(--mode-text); }
.tab--voice { --m: var(--mode-voice); }
.tab--avatar { --m: var(--mode-avatar); }
.tab--assistant { --m: var(--mode-assistant); }
.tab--twin { --m: var(--mode-twin); }
.tab--choose { --m: var(--mode-choose); }
.tab--image { --m: var(--mode-image); }
.tab--share { --m: var(--mode-share); }
.tab--memory { --m: var(--memory-violet); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fade-in-up 0.45s var(--ease-out); }

/* Feature detail split rows use existing .split; add media chrome */
.device-stack { position: relative; display: grid; place-items: center; }
.device-stack .phone { z-index: 2; }
.device-stack__glow {
  position: absolute; inset: 10% 15%;
  background: var(--gradient-primary);
  filter: blur(60px); opacity: 0.35; border-radius: 50%;
  z-index: 1;
}
