/* =============================================
   wazer.ai — main.css
   Single source of truth for design tokens.
   Loaded by every page including chat.html.
   chat.css inherits all tokens from here.
   ============================================= */

/* -------- 1. Tokens -------- */

:root {
  /* Backgrounds & surfaces */
  --bg-1: #F8F7F5;
  --bg-2: #F1F0EC;
  --bg-3: #E9E7E2;
  --surface: #FDFCFA;
  --surface-warm: #F5F3EE;
  --sidebar-bg: rgba(248, 247, 245, 0.55);
  --nav-bg: rgba(248, 247, 245, 0.82);
  /* Frosted floating discs (saved-files / notes / private toggles over canvas). */
  --floating-disc-bg: rgba(255, 255, 255, 0.55);
  --floating-disc-icon: var(--ink-faint);

  /* Ink (text colours) */
  --ink: #1A1612;
  --ink-soft: #5C5249;
  --ink-faint: #918578;
  --ink-ghost: #C9C0AE;

  /* Borders */
  --border: rgba(26, 22, 18, 0.07);
  --border-strong: rgba(26, 22, 18, 0.14);
  --border-divider: rgba(26, 22, 18, 0.10);

  /* Accent — fountain pen blue.
     --accent          : functional UI (links, focus, hover)
     --accent-bright   : BRAND-MARK ONLY (wordmark + monogram) */
  --accent: #1E3A5F;
  --accent-deep: #142940;
  --accent-bright: #2E5184;
  --accent-soft: rgba(30, 58, 95, 0.10);
  --accent-softer: rgba(30, 58, 95, 0.05);

  /* Chat bubbles — used by the landing hero demo (and any chat preview).
     User message is a filled accent pill; AI message is plain ink text. */
  --bubble-user: var(--accent);
  --bubble-user-text: #fff;
  --bubble-ai-text: var(--ink);

  /* Semantic — calibrated to the warm palette.
     Each : main (dots/icons), -soft (bg @ 10% alpha),
            -text (darker for text on -soft). */
  --success: #5A7A52;
  --success-soft: rgba(90, 122, 82, 0.10);
  --success-text: #3F5638;

  --error: #A8453F;
  --error-soft: rgba(168, 69, 63, 0.10);
  --error-text: #7A3530;

  --warning: #B87C1D;
  --warning-soft: rgba(184, 124, 29, 0.10);
  --warning-text: #8A5A14;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(26, 22, 18, 0.03);
  --shadow-sm: 0 1px 3px rgba(26, 22, 18, 0.05);
  --shadow-md: 0 4px 18px rgba(26, 22, 18, 0.06);
  --shadow-lg: 0 12px 40px rgba(26, 22, 18, 0.08);
  --shadow-panel: -4px 0 24px rgba(26, 22, 18, 0.06);
  --shadow-focus: 0 0 0 3px var(--accent-soft);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Typography — three roles, three families. */
  --font-display: "Newsreader", Georgia, serif;
  --font-ui: "DM Sans", -apple-system, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Layout */
  --nav-height: 64px;
  --content-max: 1200px;
  --content-narrow: 720px;

  color-scheme: light;
}

/* -------- 1b. Dark theme --------
   Warm dark, not pure black — espresso/charcoal backgrounds keep the editorial,
   paper-brand feel; ink inverts to a warm off-white; the fountain-pen blue is
   brightened so it stays legible on dark. Applied via data-theme on <html>
   (set by an inline init script in each page <head>, so there's no flash).
   Every page reads these tokens, so this one block themes the whole app. */
:root[data-theme="dark"] {
  /* Backgrounds & surfaces — surfaces LIFT above the page (slightly lighter). */
  --bg-1: #1B1714;
  --bg-2: #211C18;
  --bg-3: #17130F;
  --surface: #242019;
  --surface-warm: #2A251D;
  --sidebar-bg: rgba(33, 28, 24, 0.60);
  --nav-bg: rgba(27, 23, 20, 0.82);
  /* Frosted floating discs — dark surface so the icon doesn't vanish; brighter
     icon tone (the light default blended to a mid-grey that swallowed it). */
  --floating-disc-bg: rgba(36, 32, 25, 0.62);
  --floating-disc-icon: var(--ink-soft);

  /* Ink — warm off-white scale. */
  --ink: #ECE6DC;
  --ink-soft: #B3A899;
  --ink-faint: #897E70;
  --ink-ghost: #574E44;

  /* Borders — now light-on-dark. */
  --border: rgba(236, 230, 220, 0.08);
  --border-strong: rgba(236, 230, 220, 0.16);
  --border-divider: rgba(236, 230, 220, 0.11);

  /* Accent — brightened blue for contrast on dark. */
  --accent: #6F9BD1;
  --accent-deep: #5580B5;
  --accent-bright: #84ABDD;
  --accent-soft: rgba(111, 155, 209, 0.16);
  --accent-softer: rgba(111, 155, 209, 0.08);

  --bubble-user: var(--accent);
  --bubble-user-text: #14110D;
  --bubble-ai-text: var(--ink);

  /* Semantic — lifted for legibility; -text variants now lighter (text sits on
     a dark-tinted -soft background, the inverse of light mode). */
  --success: #84A878;
  --success-soft: rgba(132, 168, 120, 0.14);
  --success-text: #A6C79B;

  --error: #D8807A;
  --error-soft: rgba(216, 128, 122, 0.14);
  --error-text: #E6A7A2;

  --warning: #D7A445;
  --warning-soft: rgba(215, 164, 69, 0.14);
  --warning-text: #E6C078;

  /* Shadows — deeper on dark (black, not warm ink). */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.20);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 4px 18px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-panel: -4px 0 24px rgba(0, 0, 0, 0.40);

  color-scheme: dark;
}

/* -------- 2. Reset & base -------- */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background:
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 60%, var(--bg-3) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-ui);
}
/* background-attachment: fixed jumps/flickers on mobile: as the URL bar shows
   and hides during scroll, the fixed gradient re-anchors to a changing viewport
   and the tone visibly shifts. Let it scroll with the page on small screens. */
@media (max-width: 768px) {
  body { background-attachment: scroll; }
}
body {
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* -------- 3. Layout -------- */

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 32px;
}

.container-narrow {
  max-width: var(--content-narrow);
  margin: 0 auto;
  padding: 0 32px;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1 0 auto;
  padding: 120px 0 80px;
}

.page-main--tight {
  padding: 100px 0 60px;
}

/* -------- 4. Typography -------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 18px;
}

h1 {
  font-size: clamp(36px, 4.5vw, 56px);
  font-variation-settings: "opsz" 60;
}
h2 {
  font-size: clamp(28px, 3vw, 36px);
  font-variation-settings: "opsz" 36;
}
h3 {
  font-size: clamp(20px, 2.2vw, 26px);
  font-variation-settings: "opsz" 24;
}

p { margin: 0 0 16px; }

em, i {
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "opsz" 14;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
}

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.ghost { color: var(--ink-ghost); }
.mono  { font-family: var(--font-mono); }

/* -------- 5. Logo -------- */

.logo {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 36;
  font-size: 30px;
  letter-spacing: -0.025em;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
}

/* View Transitions — persistent chrome elements get named so the browser
   treats them as the same element across page navigations. The nav logo,
   credit badge, and avatar share names with their chat-shell counterparts
   (.wordmark, .credits-pill, .avatar). Footer .logo is intentionally
   excluded — it would conflict with nav .logo on the same page.
   Targets any .logo inside #nav: works for both logged-out nav-strip
   and logged-in floating chrome. */
#nav .logo {
  view-transition-name: wazer-wordmark;
}
.credit-badge {
  view-transition-name: wazer-credits;
}
.user-menu-trigger {
  view-transition-name: wazer-avatar;
}

/* Enable cross-document view transitions site-wide. Modern browsers
   (Chrome 126+, Safari 18+, Edge 126+) animate page navigations with a
   smooth crossfade by default. Unsupported browsers navigate instantly —
   nothing breaks, the polish just doesn't render. */
@view-transition {
  navigation: auto;
}

/* -------- 6. Chrome (logged-in: floating; logged-out: nav strip) -------- */

/* Chrome fades in once auth state is known. During the brief auth check
   (~50ms) the body has .chrome-loading and #nav is invisible — prevents
   the flash of logged-out skeleton before showing logged-in chrome. */
#nav {
  transition: opacity 0.18s ease;
}
body.chrome-loading #nav {
  opacity: 0;
}

/* Footer is the cross-navigation fallback for logged-out users (since
   they don't have an avatar dropdown). For authenticated users, the
   dropdown covers Models / Pricing / Help / Wallet — footer becomes
   redundant noise and is hidden. */
body.is-authenticated .site-footer {
  display: none;
}

/* Logged-in floating chrome — rendered by nav.js when authenticated.
   Two fixed-positioned elements, no <nav> wrapper. Same look on every
   page including chat (chat renders its own equivalent via sidebar +
   topbar-right). Wordmark sits top-left, credits + avatar top-right. */
.fixed-chrome-right {
  position: fixed;
  top: 14px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* When nav.js renders the logo — whether logged-in floating or logged-out
   marketing nav-strip — pin it to fixed viewport coordinates. Without this,
   the logged-out logo's position varies with viewport width (centered
   nav-inner pushes it inward on wide screens), causing a horizontal jump
   during View Transitions between pages. */
#nav .logo {
  position: fixed;
  top: 18px;
  left: 32px;
  z-index: 110;
  line-height: 1;
}

/* Right-side counterpart to the pinned logo. On authenticated service pages the
   right chrome (credits + avatar) sits in the centered, max-width .nav-inner, so
   on wide screens it lands inset from the viewport edge — jumping inward when you
   come from chat (whose .fixed-chrome-right hugs right: 20px). Drop the centering
   for the authenticated strip so the chrome rides the viewport edge too, matching
   chat. .nav-cta stays in flow, so the strip keeps its height. */
body.is-authenticated nav.site-nav .nav-inner {
  max-width: none;
  padding-right: 20px;
}

/* -------- 6a. Logged-out marketing nav (fixed strip) -------- */

nav.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  position: relative;
}

.nav-links {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 32px;
  align-items: center;
  list-style: none;
}

.nav-link {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 400;
  transition: color 0.2s;
  position: relative;
  padding: 4px 0;
}

.nav-link:hover { color: var(--ink); }

.nav-link--active {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  cursor: default;
  pointer-events: none;
}

.nav-cta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.credit-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color 0.15s ease;
}

a.credit-badge { text-decoration: none; }

a.credit-badge:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

/* -------- 6b. User menu -------- */

.user-menu { position: relative; }

.user-menu-trigger {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  padding: 0;
}
.user-menu-trigger:hover {
  transform: scale(1.05);
  background: var(--accent-deep);
}

.user-avatar {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--surface);
  line-height: 1;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 240px;
  max-width: 320px;
  padding: 6px;
  z-index: 200;
}

.user-menu-email {
  padding: 10px 12px 8px;
  font-size: 12px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.user-menu-admin-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  vertical-align: middle;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  font-size: 14px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s ease;
}
.user-menu-item:hover {
  background: var(--surface-warm);
}
/* Leading icons in the account dropdown — muted so the label leads. */
.user-menu-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--ink-faint);
}

.user-menu-logout {
  color: var(--ink-faint);
}

.user-menu-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 4px;
}

/* -------- 6c. Mobile menu -------- */

.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  transition: border-color 0.15s ease;
}
.nav-mobile-toggle:hover { border-color: var(--border-strong); }

.nav-mobile-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-mobile-toggle.open .nav-mobile-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-mobile-toggle.open .nav-mobile-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-mobile-toggle.open .nav-mobile-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-mobile-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 20px;
  right: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* The toggle opens/closes the menu via the `hidden` attribute, but the
   display:flex above overrode it — so the menu showed expanded on load,
   covering the hero. This higher-specificity rule lets `hidden` win. */
.nav-mobile-menu[hidden] { display: none; }

/* Theme toggle — dropdown item (nav + chat) shows a label + icon in a row;
   the logged-out nav shows a compact icon button. */
.user-menu-item.user-menu-theme,
.topbar-user-item.topbar-user-theme {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-menu-theme-icon,
.topbar-user-theme-icon {
  display: inline-flex;
  color: var(--ink-faint);
}
.nav-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-theme-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-mobile-menu a,
.nav-mobile-menu button {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--ink-soft);
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.nav-mobile-menu a:hover,
.nav-mobile-menu button:hover {
  background: var(--surface-warm);
  color: var(--ink);
}

.nav-mobile-menu a.nav-link--active {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.nav-mobile-cta {
  margin-top: 6px;
  background: var(--ink) !important;
  color: var(--surface) !important;
  text-align: center !important;
  font-weight: 500;
}
.nav-mobile-cta:hover { background: #000 !important; }

.nav-mobile-logout {
  color: var(--ink-faint) !important;
  border-top: 1px solid var(--border) !important;
  margin-top: 6px;
}

/* -------- 6d. Skeleton -------- */

@keyframes nav-skeleton-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

.nav-skeleton {
  display: inline-block;
  background: var(--border);
  border-radius: var(--radius-pill);
  animation: nav-skeleton-pulse 1.4s ease-in-out infinite;
}

.nav-skeleton--link {
  width: 60px;
  height: 14px;
  border-radius: var(--radius-sm);
}

.nav-skeleton--btn { width: 120px; height: 34px; }

.nav-skeleton--pill { width: 80px; height: 28px; }

/* -------- 7. Buttons -------- */

.btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.btn-ghost {
  color: var(--ink-soft);
  background: transparent;
}
.btn-ghost:hover {
  color: var(--ink);
  background: var(--surface-warm);
}

.btn-primary {
  background: var(--ink);
  color: var(--surface);
  font-weight: 500;
}
.btn-primary:hover {
  background: #000;
  transform: translateY(-1px);
}

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

.btn-accent {
  background: var(--accent);
  color: var(--surface);
}
.btn-accent:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 13px 24px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.btn-block { width: 100%; }

/* -------- 8. Forms -------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.field-input {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.field-input.field-input--error {
  border-color: var(--error);
}
.field-input.field-input--error:focus {
  box-shadow: 0 0 0 3px var(--error-soft);
}

.field-help {
  font-size: 13px;
  color: var(--ink-faint);
}

/* -------- 8b. Inline notices (success / error / warning) -------- */

.notice {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.notice-success {
  background: var(--success-soft);
  border-color: rgba(90, 122, 82, 0.25);
  color: var(--success-text);
}
.notice-error {
  background: var(--error-soft);
  border-color: rgba(168, 69, 63, 0.25);
  color: var(--error-text);
}
.notice-warning {
  background: var(--warning-soft);
  border-color: rgba(184, 124, 29, 0.25);
  color: var(--warning-text);
}

/* -------- 9. Cards -------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.card-highlighted {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* -------- 10. Footer -------- */

footer.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 13px;
  color: var(--ink-faint);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--ink); }

.footer-meta {
  font-size: 13px;
  color: var(--ink-ghost);
}

/* -------- 11. Utilities -------- */

.center { text-align: center; }
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stack { display: flex; flex-direction: column; }
.stack-2 > * + * { margin-top: 8px; }
.stack-3 > * + * { margin-top: 12px; }
.stack-4 > * + * { margin-top: 16px; }
.stack-5 > * + * { margin-top: 24px; }
.stack-6 > * + * { margin-top: 32px; }

.row { display: flex; }
.row-between { justify-content: space-between; }
.row-gap-3 { gap: 12px; }
.row-gap-4 { gap: 16px; }
.row-gap-5 { gap: 24px; }

/* -------- 12. Mobile -------- */

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: flex; }
  /* Marketing CTAs (Log in / Sign up) live in the hamburger menu on mobile;
     leaving them in the bar made them overlap the fixed logo. Hide them here.
     Logged-in chrome (credit badge + avatar) has no .btn-* class, so it stays. */
  .nav-cta .btn-ghost,
  .nav-cta .btn-primary { display: none; }

  .container, .container-narrow { padding: 0 20px; }
  .page-main { padding: 100px 0 60px; }

  .nav-inner { padding: 14px 20px; }

  /* Settings rows (account + wallet) breathe a little more on phones. */
  .acc-row { padding: 20px 0; }
}

@media (min-width: 769px) {
  .nav-mobile-menu { display: none !important; }
}

/* =============================================
   Settings rows — shared by /account and /wallet.
   The row / control / button / input / select / toggle patterns used to
   be duplicated (and had drifted) in both pages' inline <style>. They
   live here now. Page-specific variants stay local to each page:
   account keeps .acc-btn.is-* / .acc-row-label.is-danger / .acc-avatar /
   .acc-modal*; wallet keeps .acc-row-desc--alert / textarea.acc-input.
   Each page still owns its own mobile overrides (width: 100%, etc.).
   ============================================= */
.acc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.acc-row:last-child { border-bottom: none; }
.acc-row-text { flex: 1; min-width: 0; }
.acc-row-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}
.acc-row-desc {
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 4px;
  line-height: 1.5;
}
.acc-row-control {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.acc-row-value {
  font-size: 14px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}

.acc-btn {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.acc-btn:hover:not(:disabled) {
  background: var(--bg-2);
  border-color: var(--ink-faint);
}
.acc-btn:disabled {
  cursor: not-allowed;
  color: var(--ink-ghost);
  border-color: var(--border);
}

.acc-input, .acc-select {
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 7px 12px;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.acc-input:focus, .acc-select:focus { outline: none; border-color: var(--ink); }
.acc-select {
  padding-right: 30px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

.acc-toggle {
  width: 40px;
  height: 22px;
  background: #d6d3cd;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease;
  padding: 0;
  box-sizing: border-box;
}
.acc-toggle::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: left 0.18s ease;
}
.acc-toggle.is-on { background: var(--accent); border-color: var(--accent); }
.acc-toggle.is-on::after { left: 19px; }
.acc-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acc-toggle:disabled { opacity: 0.45; cursor: not-allowed; }
