/* Vuto 2 unified design tokens, shared chrome, primitives, and living mascot. */

@font-face {
  font-family: "Host Grotesk";
  src: url("/assets/fonts/host-grotesk-var.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  font-synthesis: none;
  text-rendering: optimizeLegibility;

  /* Typography */
  --v2-font-sans: "Host Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --v2-font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --v2-text-xs: 0.75rem;
  --v2-text-sm: 0.875rem;
  --v2-text-base: 1rem;
  --v2-text-lg: 1.125rem;
  --v2-text-xl: 1.25rem;
  --v2-text-2xl: 1.5rem;
  --v2-text-3xl: clamp(1.875rem, 4vw, 2.5rem);
  --v2-text-display: clamp(2.25rem, 6vw, 3.5rem);

  /* 4px spacing scale */
  --v2-space-1: 0.25rem;
  --v2-space-2: 0.5rem;
  --v2-space-3: 0.75rem;
  --v2-space-4: 1rem;
  --v2-space-5: 1.25rem;
  --v2-space-6: 1.5rem;
  --v2-space-8: 2rem;
  --v2-space-10: 2.5rem;
  --v2-space-12: 3rem;
  --v2-space-16: 4rem;
  --v2-space-20: 5rem;

  /* Radii & elevation */
  --v2-radius-sm: 6px;
  --v2-radius-md: 10px;
  --v2-radius-lg: 16px;
  --v2-radius-xl: 24px;
  --v2-radius-full: 9999px;
  --v2-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --v2-ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --v2-ease-spring: cubic-bezier(0.22, 1.2, 0.36, 1);
  --v2-topbar-h: 60px;

  /* Light theme (lavender-tinted canvas with editorial ambient depth, WCAG AA verified) */
  --v2-bg: #eceaf4;
  --v2-bg-ambient:
    radial-gradient(54rem 32rem at 12% 0rem, rgba(108, 60, 205, 0.14) 0%, rgba(108, 60, 205, 0) 68%),
    radial-gradient(28rem 16rem at 50% 6rem, rgba(45, 204, 134, 0.13) 0%, rgba(45, 204, 134, 0) 70%),
    radial-gradient(48rem 26rem at 92% 28rem, rgba(245, 190, 92, 0.20) 0%, rgba(245, 190, 92, 0) 72%),
    linear-gradient(180deg, #f3f0fb 0%, #ebe8f5 42rem, #e7e4f2 100%);
  --v2-grain-opacity: 0.028;
  --v2-surface: #fcfbfe;
  --v2-surface-2: #f4f2fb;
  --v2-surface-glass: rgba(252, 251, 254, 0.86);
  --v2-ink: #161325;
  --v2-ink-soft: #4d4a5f;
  --v2-ink-muted: #59556d;
  --v2-border: #d4d0e2;
  --v2-border-strong: #7d7a8e;

  --v2-accent: #6c3ccd;
  --v2-accent-hover: #5a2eb8;
  --v2-accent-ink: #fcfbfe;
  --v2-accent-soft: #e3dffc;
  --v2-accent-ring: rgba(108, 60, 205, 0.28);

  --v2-danger: #97182f;
  --v2-danger-bg: #fcecef;
  --v2-danger-border: #c43e54;
  --v2-danger-ink: #fcfbfe;

  --v2-success: #166a45;
  --v2-success-bg: #e6f7ee;
  --v2-warn: #7c4b00;
  --v2-warn-bg: #fef5e4;

  --v2-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --v2-shadow-sm: 0 1px 2px rgba(22, 19, 37, 0.06);
  --v2-shadow-md: 0 1px 2px rgba(22, 19, 37, 0.05), 0 12px 32px -8px rgba(22, 19, 37, 0.12);
  --v2-shadow-lg: 0 2px 4px rgba(22, 19, 37, 0.06), 0 24px 56px -12px rgba(22, 19, 37, 0.18);
  --v2-backdrop: rgba(16, 14, 23, 0.45);
  --v2-skeleton-base: #e2dfee;
  --v2-skeleton-shine: #f3f1fa;
}

:root[data-theme="light"] {
  color-scheme: light;
  --lightningcss-light: initial;
  --lightningcss-dark: ;
}

:root[data-theme="light"] .v2-shell,
:root[data-theme="light"]:has(.v2-shell) body {
  --paper: #eceaf4;
  --card: #fcfbfe;
  --ink: #161325;
  --ink-soft: #4d4a5f;
  --accent: #6c3ccd;
  --accent-ink: #fcfbfe;
  --line: #d1cfdb;
  --line-strong: #7d7a8e;
}

:root[data-theme="dark"] .v2-shell,
:root[data-theme="dark"]:has(.v2-shell) body {
  --paper: #100e17;
  --card: #181524;
  --ink: #f3f2fa;
  --ink-soft: #bab7cc;
  --accent: #9b7dff;
  --accent-ink: #100e17;
  --line: #2e2940;
  --line-strong: #76728c;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --lightningcss-light: ;
  --lightningcss-dark: initial;
  --v2-bg: #100e17;
  --v2-bg-ambient:
    radial-gradient(56rem 34rem at 10% -2rem, rgba(155, 125, 255, 0.22) 0%, rgba(155, 125, 255, 0) 66%),
    radial-gradient(26rem 14rem at 50% 6rem, rgba(70, 227, 155, 0.12) 0%, rgba(70, 227, 155, 0) 70%),
    radial-gradient(48rem 24rem at 94% 30rem, rgba(246, 207, 122, 0.11) 0%, rgba(246, 207, 122, 0) 70%),
    linear-gradient(180deg, #151125 0%, #100e17 38rem, #0d0b14 100%);
  --v2-grain-opacity: 0.036;
  --v2-surface: #181524;
  --v2-surface-2: #211d30;
  --v2-surface-glass: rgba(16, 14, 23, 0.84);
  --v2-ink: #f3f2fa;
  --v2-ink-soft: #bab7cc;
  --v2-ink-muted: #a19db8;
  --v2-border: #2e2940;
  --v2-border-strong: #76728c;

  --v2-accent: #9b7dff;
  --v2-accent-hover: #b29aff;
  --v2-accent-ink: #100e17;
  --v2-accent-soft: #282144;
  --v2-accent-ring: rgba(155, 125, 255, 0.34);

  --v2-danger: #ff9ca6;
  --v2-danger-bg: #2f161f;
  --v2-danger-border: #d46272;
  --v2-danger-ink: #100e17;

  --v2-success: #5de0a0;
  --v2-success-bg: #132c22;
  --v2-warn: #f4c76b;
  --v2-warn-bg: #2c2213;

  --v2-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  --v2-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --v2-shadow-md: 0 1px 2px rgba(0, 0, 0, 0.28), 0 12px 32px -8px rgba(0, 0, 0, 0.5);
  --v2-shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 56px -12px rgba(0, 0, 0, 0.6);
  --v2-backdrop: rgba(6, 5, 10, 0.68);
  --v2-skeleton-base: #221e31;
  --v2-skeleton-shine: #312b46;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .v2-shell,
  :root:not([data-theme="light"]):has(.v2-shell) body {
    --paper: #100e17;
    --card: #181524;
    --ink: #f3f2fa;
    --ink-soft: #bab7cc;
    --accent: #9b7dff;
    --accent-ink: #100e17;
    --line: #2e2940;
    --line-strong: #76728c;
  }
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --lightningcss-light: ;
    --lightningcss-dark: initial;
    --v2-bg: #100e17;
    --v2-bg-ambient:
      radial-gradient(56rem 34rem at 10% -2rem, rgba(155, 125, 255, 0.22) 0%, rgba(155, 125, 255, 0) 66%),
      radial-gradient(26rem 14rem at 50% 6rem, rgba(70, 227, 155, 0.12) 0%, rgba(70, 227, 155, 0) 70%),
      radial-gradient(48rem 24rem at 94% 30rem, rgba(246, 207, 122, 0.11) 0%, rgba(246, 207, 122, 0) 70%),
      linear-gradient(180deg, #151125 0%, #100e17 38rem, #0d0b14 100%);
    --v2-grain-opacity: 0.036;
    --v2-surface: #181524;
    --v2-surface-2: #211d30;
    --v2-surface-glass: rgba(16, 14, 23, 0.84);
    --v2-ink: #f3f2fa;
    --v2-ink-soft: #bab7cc;
    --v2-ink-muted: #a19db8;
    --v2-border: #2e2940;
    --v2-border-strong: #76728c;

    --v2-accent: #9b7dff;
    --v2-accent-hover: #b29aff;
    --v2-accent-ink: #100e17;
    --v2-accent-soft: #282144;
    --v2-accent-ring: rgba(155, 125, 255, 0.34);

    --v2-danger: #ff9ca6;
    --v2-danger-bg: #2f161f;
    --v2-danger-border: #d46272;
    --v2-danger-ink: #100e17;

    --v2-success: #5de0a0;
    --v2-success-bg: #132c22;
    --v2-warn: #f4c76b;
    --v2-warn-bg: #2c2213;

    --v2-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.045);
    --v2-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
    --v2-shadow-md: 0 1px 2px rgba(0, 0, 0, 0.28), 0 12px 32px -8px rgba(0, 0, 0, 0.5);
    --v2-shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 56px -12px rgba(0, 0, 0, 0.6);
    --v2-backdrop: rgba(6, 5, 10, 0.68);
    --v2-skeleton-base: #221e31;
    --v2-skeleton-shine: #312b46;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  font-family: var(--v2-font-sans);
  font-size: 16px;
  background: var(--v2-bg);
  color: var(--v2-ink);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--v2-topbar-h) + var(--v2-space-4));
}

:where(a, button, summary, label, .v2-btn, .v2-chip, .v2-tab) {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  position: relative;
  margin: 0;
  min-height: 100dvh;
  font-family: var(--v2-font-sans);
  font-size: var(--v2-text-base);
  line-height: 1.5;
  background-color: var(--v2-bg);
  background-image: var(--v2-bg-ambient);
  background-repeat: no-repeat;
  color: var(--v2-ink);
  display: flex;
  flex-direction: column;
}

/* Keep Vuto 2 ambient canvas and ink intact even if a dynamic route chunk loads legacy body resets later. */
html body:has(.v2-shell) {
  background-color: var(--v2-bg);
  background-image: var(--v2-bg-ambient);
  background-repeat: no-repeat;
  color: var(--v2-ink);
  font-family: var(--v2-font-sans);
  font-size: var(--v2-text-base);
  line-height: 1.5;
}

body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  background-repeat: repeat;
  mix-blend-mode: soft-light;
  opacity: var(--v2-grain-opacity, 0.045);
}

body > * {
  position: relative;
  z-index: 1;
}

[hidden] {
  display: none !important;
}

.v2-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

a {
  color: var(--v2-accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--v2-accent-hover);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--v2-accent);
  outline-offset: 2px;
}

code, pre {
  font-family: var(--v2-font-mono);
}

code {
  font-size: 0.9em;
  padding: 0.1em 0.38em;
  border-radius: var(--v2-radius-sm);
  background: var(--v2-surface-2);
  border: 1px solid var(--v2-border);
  color: var(--v2-ink);
}

/* Slim sticky top bar */
.v2-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--v2-topbar-h);
  background: var(--v2-surface-glass);
  border-bottom: 1px solid var(--v2-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: height 200ms var(--v2-ease), opacity 180ms ease, border-color 180ms ease;
}

:root[data-topbar-collapsed="true"] {
  --v2-topbar-h: 0px;
}

:root[data-topbar-collapsed="true"] .v2-topbar {
  height: 0;
  min-height: 0;
  overflow: hidden;
  border-bottom-width: 0;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Connected account robot avatar pill + popover */
.v2-acct-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.v2-acct-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--v2-radius-full);
  border: 1px solid var(--v2-border);
  background: var(--v2-surface);
  color: var(--v2-ink);
  font-family: var(--v2-font-sans);
  font-size: var(--v2-text-sm);
  font-weight: 600;
  line-height: 1;
  box-shadow: var(--v2-shadow-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 180ms var(--v2-ease-out), border-color 180ms var(--v2-ease-out), transform 140ms var(--v2-ease-out);
}

.v2-acct-pill:hover {
  background: var(--v2-surface-2);
  border-color: var(--v2-border-strong);
  color: var(--v2-ink);
}

.v2-acct-pill:active {
  transform: scale(0.97);
}

.v2-acct-avatar-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--v2-radius-full);
  background: var(--v2-surface-2);
  flex: none;
}

.v2-acct-avatar-slot svg {
  display: block;
  width: 24px;
  height: 24px;
}

.v2-acct-dot {
  display: none;
}

.v2-acct-pill-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.v2-acct-label {
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-acct-plan {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--v2-radius-full);
  border: 1px solid var(--v2-border);
  background: var(--v2-surface-2);
  color: var(--v2-ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

.v2-acct-chevron {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--v2-ink-soft);
  flex: none;
  transition: transform 150ms var(--v2-ease);
}

.v2-acct-pill[aria-expanded="true"] .v2-acct-chevron {
  transform: rotate(180deg);
}

.v2-acct-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 65;
  width: min(272px, calc(100vw - 24px));
  padding: var(--v2-space-2);
  border-radius: var(--v2-radius-lg);
  border: 1px solid var(--v2-border);
  background: var(--v2-surface);
  color: var(--v2-ink);
  box-shadow: var(--v2-shadow-lg);
}

.v2-acct-popover-head {
  display: flex;
  align-items: center;
  gap: var(--v2-space-3);
  padding: var(--v2-space-2) var(--v2-space-2) var(--v2-space-3);
}

.v2-acct-popover-avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--v2-border);
  background: var(--v2-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.v2-acct-popover-avatar svg {
  display: block;
  width: 36px;
  height: 36px;
}

.v2-acct-popover-id {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.v2-acct-popover-email {
  margin: 0;
  font-size: var(--v2-text-sm);
  font-weight: 600;
  color: var(--v2-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-acct-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.v2-acct-online-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--v2-radius-full);
  border: 1px solid var(--v2-border);
  background: var(--v2-surface-2);
  color: var(--v2-ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
}

.v2-acct-plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--v2-radius-full);
  border: 1px solid var(--v2-border);
  background: var(--v2-surface-2);
  color: var(--v2-ink);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
}

.v2-acct-divider {
  height: 1px;
  margin: var(--v2-space-2) 0;
  background: var(--v2-border);
  border: 0;
}

.v2-acct-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  padding: 0 var(--v2-space-3);
  border: 0;
  border-radius: var(--v2-radius-md);
  background: transparent;
  color: var(--v2-ink);
  font-family: var(--v2-font-sans);
  font-size: var(--v2-text-sm);
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.v2-acct-menu-item:hover {
  background: var(--v2-surface-2);
  color: var(--v2-ink);
}

.v2-acct-menu-item.v2-acct-signout {
  color: var(--v2-danger);
}

.v2-acct-menu-item.v2-acct-signout:hover {
  background: var(--v2-danger-bg);
  color: var(--v2-danger);
}

/* Floating "Show bar" restore pill when topbar is collapsed */
.v2-topbar-restore {
  position: fixed;
  top: max(4px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--v2-radius-full);
  border: 1px solid var(--v2-border-strong);
  background: var(--v2-surface);
  color: var(--v2-ink);
  font-family: var(--v2-font-sans);
  font-size: var(--v2-text-xs);
  font-weight: 600;
  line-height: 1;
  box-shadow: var(--v2-shadow-md);
  cursor: pointer;
  transition: opacity 160ms ease, transform 180ms var(--v2-ease), border-color 150ms ease;
}

.v2-topbar-restore:hover {
  border-color: var(--v2-accent);
  background: var(--v2-surface-2);
  color: var(--v2-ink);
}

.v2-topbar-restore .v2-acct-avatar-slot {
  width: 26px;
  height: 26px;
}

.v2-topbar-restore .v2-acct-avatar-slot svg {
  width: 22px;
  height: 22px;
}

.v2-topbar-restore-chevron {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-framed] .v2-topbar-restore {
  display: none !important;
}

/* Keep /chat sub-bar controls clear of the floating restore pill when topbar is collapsed */
html[data-topbar-collapsed="true"]:not([data-framed]) .bar-top {
  padding-right: 120px;
}

@media (max-width: 899px) {
  html[data-topbar-collapsed="true"]:not([data-framed]) .v2-topbar-restore {
    right: 8px;
    padding: 4px 8px 4px 6px;
  }

  html[data-topbar-collapsed="true"]:not([data-framed]) .v2-topbar-restore-label {
    display: none;
  }

  html[data-topbar-collapsed="true"]:not([data-framed]) .v2-help-fab {
    right: 76px;
  }

  html[data-topbar-collapsed="true"]:not([data-framed]) .bar-top {
    padding-right: 128px;
  }
}

@media (max-width: 380px) {
  html[data-topbar-collapsed="true"]:not([data-framed]) .v2-help-fab {
    right: 8px;
  }

  html[data-topbar-collapsed="true"]:not([data-framed]):has(.bar-top) .v2-help-fab {
    top: calc(max(4px, env(safe-area-inset-top, 0px)) + 48px);
    right: 8px;
    bottom: auto;
  }

  html[data-topbar-collapsed="true"]:not([data-framed]) .bar-top {
    padding-right: 78px;
  }
}

@media (max-width: 720px) {
  .v2-acct-plan {
    display: none;
  }
}

@media (max-width: 480px) {
  .v2-acct-pill-text {
    display: none;
  }

  .v2-acct-pill {
    padding: 4px 8px 4px 6px;
    gap: 4px;
  }
}

.v2-topbar-inner {
  max-width: 1120px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--v2-space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--v2-space-3);
}

.v2-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--v2-space-2);
  min-height: 44px;
  padding: 0 var(--v2-space-1);
  color: var(--v2-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--v2-text-lg);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.v2-brand:hover {
  color: var(--v2-ink);
}

.v2-nav {
  display: flex;
  align-items: center;
  gap: var(--v2-space-1);
}

.v2-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--v2-space-3);
  border-radius: var(--v2-radius-md);
  color: var(--v2-ink-soft);
  text-decoration: none;
  font-size: var(--v2-text-sm);
  font-weight: 500;
  white-space: nowrap;
}

.v2-nav-link:hover {
  color: var(--v2-ink);
  background: var(--v2-surface-2);
}

.v2-nav-link[aria-current="page"] {
  color: var(--v2-ink);
  font-weight: 600;
  background: var(--v2-accent-soft);
}

.v2-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--v2-space-2);
  flex-shrink: 0;
}

.v2-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--v2-space-2);
  border-radius: var(--v2-radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--v2-ink-soft);
  cursor: pointer;
  font: inherit;
  transition: background-color 180ms var(--v2-ease-out), border-color 180ms var(--v2-ease-out), color 180ms var(--v2-ease-out), transform 140ms var(--v2-ease-out);
}

.v2-icon-btn:hover {
  color: var(--v2-ink);
  background: var(--v2-surface-2);
  border-color: var(--v2-border);
}

.v2-icon-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.v2-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v2-icon-btn [hidden] {
  display: none !important;
}

.v2-menu-btn {
  display: none;
}

.v2-mobile-nav {
  position: fixed;
  top: var(--v2-topbar-h);
  left: 0;
  right: 0;
  z-index: 48;
  background: var(--v2-surface);
  border-bottom: 1px solid var(--v2-border);
  box-shadow: var(--v2-shadow-md);
  padding: var(--v2-space-3) var(--v2-space-4) var(--v2-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--v2-space-1);
}

.v2-mobile-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--v2-space-3);
  border-radius: var(--v2-radius-md);
  color: var(--v2-ink);
  text-decoration: none;
  font-weight: 500;
}

.v2-mobile-nav a[aria-current="page"] {
  background: var(--v2-accent-soft);
  font-weight: 600;
}

.v2-mobile-nav .v2-mobile-cta {
  margin-top: var(--v2-space-2);
  justify-content: center;
  background: var(--v2-accent);
  color: var(--v2-accent-ink);
  font-weight: 600;
}

@media (pointer: fine) and (min-width: 721px) {
  header.v2-topbar .v2-brand {
    min-height: 36px;
  }

  header.v2-topbar .v2-nav .v2-nav-link {
    min-height: 36px;
    padding: 0 var(--v2-space-3);
  }

  header.v2-topbar .v2-topbar-actions {
    gap: var(--v2-space-1);
  }

  header.v2-topbar .v2-topbar-actions .v2-icon-btn {
    min-width: 36px;
    min-height: 36px;
    padding: 0;
  }

  header.v2-topbar .v2-topbar-actions .v2-btn.v2-topbar-cta {
    min-height: 36px;
    padding: 0 var(--v2-space-4);
    margin-left: var(--v2-space-2);
    border-radius: var(--v2-radius-md);
  }

  header.v2-topbar .v2-topbar-actions .v2-acct-menu-wrap {
    margin-left: var(--v2-space-2);
  }

  header.v2-topbar .v2-topbar-actions .v2-acct-pill {
    min-width: 36px;
    min-height: 36px;
    padding: 3px 10px 3px 5px;
  }

  header.v2-topbar .v2-topbar-actions .v2-acct-avatar-slot {
    width: 26px;
    height: 26px;
  }

  header.v2-topbar .v2-topbar-actions .v2-acct-avatar-slot svg {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 720px) {
  .v2-nav,
  .v2-topbar-cta {
    display: none;
  }

  .v2-menu-btn {
    display: inline-flex;
  }
}

/* Minimal shared footer */
.v2-footer {
  margin-top: auto;
  border-top: 1px solid var(--v2-border);
  padding: var(--v2-space-6) var(--v2-space-4);
}

.v2-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--v2-space-3);
}

.v2-footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--v2-space-1) var(--v2-space-4);
}

.v2-footer-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--v2-ink-soft);
  font-size: var(--v2-text-sm);
  text-decoration: none;
}

.v2-footer-nav a:hover,
.v2-footer-nav a[aria-current="page"] {
  color: var(--v2-ink);
  text-decoration: underline;
}

@media (pointer: fine) and (min-width: 721px) {
  .v2-footer-nav {
    gap: var(--v2-space-1) var(--v2-space-5);
  }

  .v2-footer-nav a {
    min-width: 0;
    min-height: 36px;
    justify-content: flex-start;
  }
}

/* Buttons */
.v2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--v2-space-2);
  min-height: 44px;
  padding: 0 var(--v2-space-4);
  border-radius: var(--v2-radius-md);
  border: 1px solid transparent;
  font-family: var(--v2-font-sans);
  font-size: var(--v2-text-sm);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 180ms var(--v2-ease-out), background-color 180ms var(--v2-ease-out), border-color 180ms var(--v2-ease-out), color 180ms var(--v2-ease-out), box-shadow 180ms var(--v2-ease-out);
}

.v2-btn:active:not(:disabled):not([aria-disabled="true"]) {
  transform: scale(0.97);
  transition-duration: 90ms;
}

.v2-btn-sm {
  min-height: 36px;
  padding: 0 var(--v2-space-3);
  font-size: var(--v2-text-xs);
}

@media (pointer: coarse) {
  .v2-btn-sm {
    min-height: 44px;
  }
}

.v2-btn-primary {
  background: var(--v2-accent);
  border-color: var(--v2-accent);
  color: var(--v2-accent-ink);
}

.v2-btn-primary:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--v2-accent-hover);
  border-color: var(--v2-accent-hover);
  color: var(--v2-accent-ink);
}

.v2-btn-secondary {
  background: var(--v2-surface);
  border-color: var(--v2-border-strong);
  color: var(--v2-ink);
}

.v2-btn-secondary:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--v2-surface-2);
  border-color: var(--v2-ink);
  color: var(--v2-ink);
}

/* Hover keeps calm color transitions without layout-edge translateY flicker. */

.v2-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--v2-ink-soft);
}

.v2-btn-ghost:hover:not(:disabled) {
  background: var(--v2-surface-2);
  color: var(--v2-ink);
}

.v2-btn-danger {
  background: var(--v2-danger);
  border-color: var(--v2-danger);
  color: var(--v2-danger-ink);
}

.v2-btn-danger:hover:not(:disabled) {
  opacity: 0.92;
  color: var(--v2-danger-ink);
}

.v2-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.v2-copied {
  border-color: var(--v2-success) !important;
  color: var(--v2-success) !important;
  background: var(--v2-success-bg) !important;
}

/* Cards, tabs, chips, inputs */
.v2-card {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-lg);
  padding: var(--v2-space-5);
  box-shadow: var(--v2-highlight, none), var(--v2-shadow-sm);
}

.v2-tabs {
  display: inline-flex;
  align-items: center;
  gap: var(--v2-space-1);
  padding: var(--v2-space-1);
  border-radius: var(--v2-radius-md);
  background: var(--v2-surface-2);
  border: 1px solid var(--v2-border);
}

.v2-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--v2-space-4);
  border: 0;
  border-radius: var(--v2-radius-sm);
  background: transparent;
  color: var(--v2-ink-soft);
  font: inherit;
  font-size: var(--v2-text-sm);
  font-weight: 500;
  cursor: pointer;
}

.v2-tab[aria-selected="true"],
.v2-tab[aria-pressed="true"] {
  background: var(--v2-surface);
  color: var(--v2-ink);
  font-weight: 600;
  box-shadow: var(--v2-shadow-sm);
}

.v2-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--v2-space-1);
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--v2-space-3);
  border-radius: var(--v2-radius-full);
  border: 1px solid var(--v2-border-strong);
  background: var(--v2-surface);
  color: var(--v2-ink-soft);
  font: inherit;
  font-size: var(--v2-text-sm);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 180ms var(--v2-ease-out), border-color 180ms var(--v2-ease-out), background-color 180ms var(--v2-ease-out), color 180ms var(--v2-ease-out);
}

.v2-chip:hover {
  border-color: var(--v2-accent);
  color: var(--v2-ink);
}

.v2-chip:active:not(:disabled) {
  transform: scale(0.97);
}

.v2-chip[aria-pressed="true"] {
  background: var(--v2-accent);
  border-color: var(--v2-accent);
  color: var(--v2-accent-ink);
}

.v2-input {
  width: 100%;
  min-height: 44px;
  padding: var(--v2-space-2) var(--v2-space-3);
  border-radius: var(--v2-radius-md);
  border: 1px solid var(--v2-border-strong);
  background: var(--v2-surface);
  color: var(--v2-ink);
  font-family: var(--v2-font-sans);
  font-size: var(--v2-text-base);
}

.v2-input::placeholder {
  color: var(--v2-ink-muted);
}

/* Shimmer loading skeleton */
.v2-skeleton {
  display: block;
  border-radius: var(--v2-radius-sm);
  background: linear-gradient(
    90deg,
    var(--v2-skeleton-base) 25%,
    var(--v2-skeleton-shine) 50%,
    var(--v2-skeleton-base) 75%
  );
  background-size: 200% 100%;
  animation: v2-shimmer 1.4s ease-in-out infinite;
}

@keyframes v2-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Soft message-send entrance animation */
.v2-msg-enter {
  animation: v2-msg-in 140ms var(--v2-ease) both;
}

@keyframes v2-msg-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Accessible confirm dialog */
.v2-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--v2-backdrop);
  display: grid;
  place-items: center;
  padding: var(--v2-space-4);
}

.v2-dialog {
  width: min(420px, 100%);
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-lg);
  padding: var(--v2-space-6);
  box-shadow: var(--v2-shadow-lg);
}

.v2-dialog h2 {
  margin: 0 0 var(--v2-space-2);
  font-size: var(--v2-text-xl);
  line-height: 1.25;
}

.v2-dialog p {
  margin: 0 0 var(--v2-space-5);
  color: var(--v2-ink-soft);
  font-size: var(--v2-text-sm);
}

.v2-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--v2-space-2);
}

/* Slide-over Help drawer */
.v2-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: var(--v2-backdrop);
  display: flex;
  justify-content: flex-end;
}

.v2-drawer {
  width: min(440px, 100vw);
  height: 100dvh;
  background: var(--v2-surface);
  border-left: 1px solid var(--v2-border);
  box-shadow: var(--v2-shadow-lg);
  display: flex;
  flex-direction: column;
}

.v2-drawer-head {
  padding: var(--v2-space-4) var(--v2-space-5);
  border-bottom: 1px solid var(--v2-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--v2-space-2);
}

.v2-drawer-head h2 {
  margin: 0;
  font-size: var(--v2-text-lg);
}

.v2-drawer-search {
  padding: var(--v2-space-3) var(--v2-space-5);
  border-bottom: 1px solid var(--v2-border);
}

.v2-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--v2-space-4) var(--v2-space-5);
  display: flex;
  flex-direction: column;
  gap: var(--v2-space-3);
}

.v2-drawer-foot {
  padding: var(--v2-space-3) var(--v2-space-5);
  border-top: 1px solid var(--v2-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--v2-space-2);
}

/* Cmd/Ctrl+K command palette */
.v2-cmdk-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: var(--v2-backdrop);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(12vh, 96px) var(--v2-space-4) var(--v2-space-4);
}

.v2-cmdk {
  width: min(560px, 100%);
  max-height: min(74vh, 560px);
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-lg);
  box-shadow: var(--v2-shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.v2-cmdk-input-wrap {
  padding: var(--v2-space-3) var(--v2-space-4);
  border-bottom: 1px solid var(--v2-border);
  display: flex;
  align-items: center;
  gap: var(--v2-space-2);
}

.v2-cmdk-input {
  flex: 1;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--v2-ink);
  font-family: var(--v2-font-sans);
  font-size: var(--v2-text-base);
}

.v2-cmdk-input:focus {
  outline: 2px solid transparent;
  outline-offset: -2px;
}

.v2-cmdk-list {
  overflow-y: auto;
  padding: var(--v2-space-2);
  margin: 0;
  list-style: none;
}

.v2-cmdk-group {
  padding: var(--v2-space-2) var(--v2-space-3) var(--v2-space-1);
  font-size: var(--v2-text-xs);
  font-weight: 600;
  color: var(--v2-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.v2-cmdk-item {
  width: 100%;
  min-height: 44px;
  padding: var(--v2-space-2) var(--v2-space-3);
  border: 0;
  border-radius: var(--v2-radius-md);
  background: transparent;
  color: var(--v2-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.v2-cmdk-item:hover,
.v2-cmdk-item[aria-selected="true"] {
  background: var(--v2-accent-soft);
}

.v2-cmdk-item-title {
  font-size: var(--v2-text-sm);
  font-weight: 600;
}

.v2-cmdk-item-sub {
  font-size: var(--v2-text-xs);
  color: var(--v2-ink-soft);
}

.v2-cmdk-empty {
  padding: var(--v2-space-6) var(--v2-space-4);
  text-align: center;
  color: var(--v2-ink-soft);
  font-size: var(--v2-text-sm);
}

/* Toast */
.v2-toast {
  position: fixed;
  left: 50%;
  bottom: var(--v2-space-6);
  transform: translateX(-50%);
  z-index: 95;
  padding: var(--v2-space-3) var(--v2-space-4);
  border-radius: var(--v2-radius-full);
  background: var(--v2-ink);
  color: var(--v2-surface);
  font-size: var(--v2-text-sm);
  font-weight: 500;
  box-shadow: var(--v2-shadow-md);
}

/* Corner ? Help FAB */
.v2-help-fab {
  position: fixed;
  right: max(var(--v2-space-4), env(safe-area-inset-right, 0px));
  bottom: max(var(--v2-space-4), env(safe-area-inset-bottom, 0px));
  z-index: 50;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--v2-radius-full);
  border: 1px solid var(--v2-border-strong);
  background: var(--v2-surface);
  color: var(--v2-ink);
  font-family: var(--v2-font-sans);
  font-size: var(--v2-text-lg);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--v2-shadow-md);
  cursor: pointer;
}

.v2-help-fab:hover {
  border-color: var(--v2-accent);
  color: var(--v2-accent);
}

/* Living 4-State Vuto Mascot */
.v2-mascot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--v2-radius-lg);
}

.v2-mascot svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.v2-mascot .v2-m-eye-happy,
.v2-mascot .v2-m-think {
  opacity: 0;
}

.v2-mascot .v2-m-eyes {
  transform-box: fill-box;
  transform-origin: center;
}

/* Idle: gentle blink every ~4.5s */
.v2-mascot[data-state="idle"] .v2-m-eyes {
  animation: v2-mascot-blink 4.5s ease-in-out infinite;
}

/* Listening: attentive wider eyes + subtle purple ring glow */
.v2-mascot .v2-m-eyes {
  transition: transform 160ms var(--v2-ease-out);
}

.v2-mascot[data-state="listening"] .v2-m-eyes {
  transform: scale(1.12);
}

/* Thinking: rhythmic eye dots scan */
.v2-mascot[data-state="thinking"] .v2-m-eyes {
  opacity: 0;
}

.v2-mascot[data-state="thinking"] .v2-m-think {
  opacity: 1;
}

.v2-mascot[data-state="thinking"] .v2-m-dot-1 {
  animation: v2-mascot-dot 1.1s ease-in-out infinite;
}

.v2-mascot[data-state="thinking"] .v2-m-dot-2 {
  animation: v2-mascot-dot 1.1s ease-in-out 0.18s infinite;
}

.v2-mascot[data-state="thinking"] .v2-m-dot-3 {
  animation: v2-mascot-dot 1.1s ease-in-out 0.36s infinite;
}

/* Happy: smiling crescent eyes + playful spring hop */
.v2-mascot[data-state="happy"] .v2-m-eyes {
  opacity: 0;
}

.v2-mascot[data-state="happy"] .v2-m-eye-happy {
  opacity: 1;
}

.v2-mascot[data-state="happy"] svg {
  animation: v2-mascot-hop 520ms var(--v2-ease-out) 1;
}

@keyframes v2-mascot-blink {
  0%, 91%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.12); }
}

@keyframes v2-mascot-dot {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  45% { opacity: 1; transform: translateY(-1.5px); }
}

@keyframes v2-mascot-hop {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-5px) scale(1.04) rotate(-2deg); }
  68% { transform: translateY(1px) scale(0.98) rotate(1.5deg); }
  100% { transform: translateY(0) scale(1) rotate(0); }
}

/* Shared page container, Help page, and 404 layout */
.v2-page {
  width: min(820px, 100% - 32px);
  margin: 0 auto;
  padding: var(--v2-space-10) 0 var(--v2-space-16);
  flex: 1;
}

.v2-help-hero {
  margin-bottom: var(--v2-space-6);
}

.v2-help-hero h1 {
  margin: 0 0 var(--v2-space-2);
  font-size: var(--v2-text-3xl);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.v2-help-sub {
  margin: 0 0 var(--v2-space-5);
  color: var(--v2-ink-soft);
  font-size: var(--v2-text-lg);
  max-width: 56ch;
}

.v2-help-controls {
  display: flex;
  flex-direction: column;
  gap: var(--v2-space-3);
}

.v2-help-cats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--v2-space-2);
}

.v2-help-rules {
  margin: var(--v2-space-6) 0;
  padding: var(--v2-space-5);
  border-radius: var(--v2-radius-lg);
  background: var(--v2-surface);
  border: 1px solid var(--v2-border-strong);
  border-left: 4px solid var(--v2-accent);
}

.v2-help-rules-tag {
  margin: 0 0 var(--v2-space-1);
  font-size: var(--v2-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--v2-accent);
}

.v2-help-rules h2 {
  margin: 0 0 var(--v2-space-2);
  font-size: var(--v2-text-xl);
  line-height: 1.25;
}

.v2-help-rules p {
  margin: 0 0 var(--v2-space-2);
  color: var(--v2-ink);
  max-width: 66ch;
}

.v2-help-rules p:last-child {
  margin-bottom: 0;
}

.v2-help-list {
  display: flex;
  flex-direction: column;
  gap: var(--v2-space-3);
}

.v2-help-item {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-lg);
  padding: var(--v2-space-5);
}

.v2-help-item-cat {
  margin: 0 0 var(--v2-space-1);
  font-size: var(--v2-text-xs);
  font-weight: 600;
  color: var(--v2-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.v2-help-item h2,
.v2-help-item h3 {
  margin: 0 0 var(--v2-space-2);
  font-size: var(--v2-text-lg);
  line-height: 1.3;
}

.v2-help-short {
  margin: 0;
  color: var(--v2-ink-soft);
  max-width: 66ch;
}

.v2-help-details {
  margin-top: var(--v2-space-3);
  border-top: 1px solid var(--v2-border);
  padding-top: var(--v2-space-2);
}

.v2-help-details > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--v2-text-sm);
  font-weight: 600;
  color: var(--v2-accent);
  cursor: pointer;
  list-style: none;
}

.v2-help-details > summary::-webkit-details-marker {
  display: none;
}

.v2-help-details > summary::before {
  content: "+";
  display: inline-block;
  width: 1.25em;
  font-weight: 700;
}

.v2-help-details[open] > summary::before {
  content: "-";
}

.v2-help-detail-body {
  padding-top: var(--v2-space-2);
  color: var(--v2-ink);
  font-size: var(--v2-text-sm);
  line-height: 1.65;
  max-width: 66ch;
}

.v2-help-detail-body p {
  margin: 0 0 var(--v2-space-2);
}

.v2-help-detail-body p:last-child {
  margin-bottom: 0;
}

/* Harmonize /help accordion & callout rhythm with site-wide 20px card padding */
main.v2-page .v2-help-rules {
  margin: var(--v2-space-5) 0;
  padding: var(--v2-space-4) var(--v2-space-5);
}

main.v2-page .v2-help-list {
  margin-top: var(--v2-space-5);
}

main.v2-page details.v2-help-item > summary.v2-help-q {
  min-height: 52px;
  padding: var(--v2-space-3) var(--v2-space-5);
}

main.v2-page details.v2-help-item[open] > summary.v2-help-q::after {
  content: "\2212";
}

main.v2-page details.v2-help-item > .v2-help-detail-body {
  padding: var(--v2-space-1) var(--v2-space-5) var(--v2-space-5);
}

.v2-help-detail-body code,
main.v2-page .v2-help-detail-body code {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

@media (pointer: fine) and (min-width: 721px) {
  main.v2-page .v2-help-cats .v2-chip {
    min-height: 36px;
  }
}

@media (max-width: 480px) {
  main.v2-page .v2-help-rules {
    padding: var(--v2-space-3) var(--v2-space-4);
  }

  main.v2-page details.v2-help-item > summary.v2-help-q {
    padding: var(--v2-space-3) var(--v2-space-4);
  }

  main.v2-page details.v2-help-item > .v2-help-detail-body {
    padding: var(--v2-space-1) var(--v2-space-4) var(--v2-space-4);
  }
}

/* Balance bottom inset inside /signin card footer divider */
.v2-signin-card .legal-foot {
  padding-top: var(--v2-space-3);
  margin-bottom: calc(-1 * var(--v2-space-3));
}

.v2-notfound {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--v2-space-10) var(--v2-space-4);
}

.v2-notfound-card {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--v2-space-4);
}

.v2-notfound-card h1 {
  margin: 0;
  font-size: var(--v2-text-3xl);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.v2-notfound-copy {
  margin: 0;
  color: var(--v2-ink-soft);
  font-size: var(--v2-text-lg);
}

.v2-notfound-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--v2-space-3);
  margin-top: var(--v2-space-2);
}

@media (prefers-reduced-motion: reduce) {
  .v2-topbar,
  .v2-topbar-restore,
  .v2-acct-pill,
  .v2-acct-chevron,
  .v2-btn,
  .v2-icon-btn,
  .v2-chip,
  .v2-skeleton,
  .v2-msg-enter,
  .v2-mascot[data-state="idle"] .v2-m-eyes,
  .v2-mascot[data-state="thinking"] .v2-m-dot-1,
  .v2-mascot[data-state="thinking"] .v2-m-dot-2,
  .v2-mascot[data-state="thinking"] .v2-m-dot-3,
  .v2-mascot[data-state="happy"] svg {
    animation: none !important;
    transition: none !important;
  }

  .v2-btn:hover,
  .v2-btn:active,
  .v2-icon-btn:active,
  .v2-chip:active,
  .v2-acct-pill:active {
    transform: none !important;
  }

  .v2-mascot[data-state="thinking"] .v2-m-think circle {
    opacity: 0.9;
  }
}

/* Safe-area insets, scrollable mobile drawer, and ultra-narrow popover containment */
.v2-toast {
  bottom: calc(var(--v2-space-6) + env(safe-area-inset-bottom, 0px));
}

.v2-help-fab {
  right: max(var(--v2-space-4), env(safe-area-inset-right, 0px));
  bottom: max(var(--v2-space-4), env(safe-area-inset-bottom, 0px));
}

.v2-drawer-foot {
  padding-bottom: max(var(--v2-space-3), env(safe-area-inset-bottom, 0px));
}

.v2-drawer-body,
.v2-cmdk-list {
  overscroll-behavior: contain;
}

.v2-mobile-nav {
  max-height: calc(100dvh - var(--v2-topbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: max(var(--v2-space-4), env(safe-area-inset-bottom, 0px));
}

@media (max-width: 480px) {
  .v2-topbar-inner {
    padding-inline: var(--v2-space-3);
    gap: var(--v2-space-2);
  }
  .v2-topbar-actions {
    gap: var(--v2-space-1);
  }
  .v2-topbar-actions:has(.v2-topbar-collapse-btn) .v2-btn.v2-topbar-cta {
    display: none;
  }
  .v2-topbar-inner .v2-btn.v2-topbar-cta {
    padding-inline: var(--v2-space-3);
  }
}

@media (max-width: 380px) {
  .v2-topbar-actions:has(.v2-topbar-collapse-btn) [data-v2-cmdk-open] {
    display: none;
  }
  .v2-acct-popover {
    position: fixed;
    top: calc(var(--v2-topbar-h) + var(--v2-space-2));
    left: var(--v2-space-3);
    right: var(--v2-space-3);
    width: auto;
  }
}

@media (max-width: 360px) {
  .v2-topbar-inner .v2-btn.v2-topbar-cta {
    display: none;
  }
}

/* Mobile & coarse-pointer tap-target compliance (>= 44x44px) on /developers and /help */
@media (max-width: 768px), (pointer: coarse) {
  body.docs-page main.docs-main p a,
  body.docs-page main.docs-main li a:not(.button):not(.qs-jump),
  body.docs-page main.docs-main .table-scroll td a,
  main.v2-page .v2-help-rules a,
  main.v2-page .v2-help-detail-body a,
  main.v2-page .v2-help-list a {
    display: inline;
    padding-block: 15px;
    padding-inline: 5px;
    margin-inline: -5px;
  }

  body.docs-page main.docs-main .hero-ai-link a,
  body.docs-page main.docs-main .access-facts dd a {
    display: inline-flex;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
    padding-block: 0;
    padding-inline: 0;
    margin-inline: 0;
  }

  body.docs-page .docs-mobile-bar .nav-toggle,
  body.docs-page .docs-mobile-bar .docs-mobile-key,
  body.docs-page main.docs-main .code-heading .copy-button,
  body.docs-page main.docs-main .table-scroll .example-copy,
  body.docs-page main.docs-main .tab-list [role="tab"],
  body.docs-page main.docs-main .qs-jump,
  body.docs-page main.docs-main .button,
  body.docs-page .docs-sidebar .nav-group a,
  body.docs-page .docs-sidebar .nav-search input {
    min-width: 44px;
    min-height: 44px;
  }
}

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