
  :root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --card: #1a1a26;
    --border: rgba(255,255,255,0.07);
    --text: #f0ede8;
    --muted: rgba(240,237,232,0.45);
    --accent: #c9a84c;
    --accent-dim: rgba(201,168,76,0.15);
    --accent-glow: rgba(201,168,76,0.25);
    --radius: 16px;
    --r-sm: 10px;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

  html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    overflow: hidden;
    transition: background 1.2s ease;
  }

  /* ── SCREENS ── */
  .screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    transition: opacity 0.5s ease, transform 0.5s ease;
    will-change: opacity, transform;
    /* iOS: use dynamic viewport height to exclude browser chrome */
    height: 100vh;
    height: 100dvh;
  }

  .screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(24px);
  }

  .screen.exit {
    opacity: 0;
    transform: translateY(-24px);
  }

  /* ── AMBIENT BACKGROUND ── */
  .ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
  }

  .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0;
    transition: opacity 1.2s ease, background 1.2s ease;
  }

  .orb-1 { width: 480px; height: 480px; top: -100px; right: -100px; }
  .orb-2 { width: 360px; height: 360px; bottom: -80px; left: -80px; }

  body.ready .orb { opacity: 1; }

  /* ── SPLASH SCREEN ── */
  #splash {
    gap: 0;
    z-index: 10;
    background: var(--bg);
    padding-left: 24px;
    padding-right: 24px;
  }

  .splash-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--accent-dim);
    border: 1px solid rgba(201,168,76,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 24px;
    animation: breathe 2.5s ease-in-out infinite;
    flex-shrink: 0;
  }

  @keyframes breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { transform: scale(1.04); box-shadow: 0 0 24px 8px var(--accent-glow); }
  }

  .splash-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 7vw, 2.8rem);
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--text);
    line-height: 1;
    margin: 0 0 12px;
  }

  .splash-sub {
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.8;
    margin: 0;
  }

  .splash-line {
    width: 40px;
    height: 1px;
    background: var(--accent);
    opacity: 0.4;
    margin: 14px 0;
  }

  /* ── WELCOME BACK SCREEN ── */
  #welcome {
    z-index: 15;
    background: var(--bg);
    padding: 0 28px;
  }

  .welcome-inner {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .welcome-wordmark {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.32em;
    text-transform: lowercase;
    color: var(--accent);
    opacity: 0.6;
    margin-bottom: 32px;
  }

  .welcome-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
  }

  .welcome-greeting {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 9vw, 2.8rem);
    font-weight: 300;
    color: var(--text);
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.01em;
  }

  .welcome-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 9vw, 2.8rem);
    font-weight: 400;
    font-style: italic;
    color: var(--accent);
    line-height: 1.15;
    margin: 0;
    opacity: 0.9;
  }

  .welcome-hint {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    color: var(--muted);
    opacity: 0.55;
    letter-spacing: 0.03em;
    margin: 0;
  }

  /* ── PICKER SCREEN ── */
  #picker {
    justify-content: flex-start;
    padding-top: max(env(safe-area-inset-top), 32px);
    padding-bottom: max(env(safe-area-inset-bottom), 32px);
    overflow-y: auto;
    z-index: 9;
    gap: 0;
  }

  .picker-inner {
    width: 100%;
    max-width: 480px;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* ── Picker nav bar (back arrow + title) ── */
  .picker-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0 4px;
    min-height: 56px;
  }

  .picker-back {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    opacity: 0;
    pointer-events: none;
  }

  .picker-back.visible {
    opacity: 1;
    pointer-events: all;
  }

  .picker-back:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
  }

  .picker-nav-title {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    flex: 1;
  }

  .picker-breadcrumb {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--accent);
    opacity: 0.7;
    text-align: right;
  }

  /* ── Picker heading ── */
  .picker-head {
    text-align: center;
    padding: 16px 0 24px;
    transition: opacity 0.25s ease;
  }

  .picker-head h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.6rem, 5.5vw, 2rem);
    font-weight: 300;
    letter-spacing: 0.04em;
    line-height: 1.25;
  }

  .picker-head p {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--muted);
    letter-spacing: 0.04em;
  }

  /* ── Parent group cards ── */
  .parent-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
  }

  .parent-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
  }

  .parent-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.2s;
  }

  .parent-btn:hover::before,
  .parent-btn:active::before { opacity: 1; }

  .parent-btn.has-selection {
    border-color: var(--accent);
  }

  .parent-icon {
    font-size: 26px;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
  }

  .parent-info { flex: 1; min-width: 0; }

  .parent-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0.02em;
  }

  .parent-desc {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 3px;
    letter-spacing: 0.02em;
  }

  .parent-badge {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(201,168,76,0.25);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .parent-arrow {
    color: var(--muted);
    font-size: 14px;
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
  }

  .parent-btn:hover .parent-arrow {
    transform: translateX(3px);
    color: var(--accent);
  }

  /* ── Sub-category list ── */
  .category-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
  }

  .cat-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
  }

  .cat-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-dim);
    opacity: 0;
    transition: opacity 0.2s;
  }

  .cat-btn:active::before,
  .cat-btn:hover::before { opacity: 1; }

  .cat-btn.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
  }

  .cat-btn.selected .cat-check { opacity: 1; transform: scale(1); }

  .cat-icon {
    font-size: 22px;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
  }

  .cat-info { flex: 1; min-width: 0; }

  .cat-name {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0.02em;
  }

  .cat-desc {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 2px;
    letter-spacing: 0.02em;
  }

  .cat-check {
    color: var(--accent);
    font-size: 16px;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.2s ease;
  }

  /* ── Bottom CTA ── */
  .picker-bottom {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
  }

  .picker-cta {
    width: 100%;
    padding: 17px;
    background: var(--accent);
    color: #0a0a0f;
    border: none;
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .picker-cta:disabled {
    opacity: 0.35;
    cursor: not-allowed;
  }

  .picker-cta:not(:disabled):hover {
    background: #d4b05a;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(201,168,76,0.3);
  }

  .picker-more {
    width: 100%;
    padding: 13px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    display: none;
  }

  .picker-more.visible { display: block; }

  .picker-more:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
  }

  .picker-note {
    text-align: center;
    font-size: 0.73rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    padding-bottom: 8px;
  }

  /* ── Slide transition ── */
  .picker-slide {
    transition: opacity 0.22s ease, transform 0.22s ease;
  }

  .picker-slide.slide-out-left {
    opacity: 0;
    transform: translateX(-30px);
  }

  .picker-slide.slide-out-right {
    opacity: 0;
    transform: translateX(30px);
  }

  /* ══ ONBOARDING ══════════════════════════════ */
  #onboard {
    z-index: 20;
    justify-content: center;
    align-items: center;
    padding: 0 28px;
  }

  .onboard-inner {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
  }

  .onboard-screen {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 64px 0 max(env(safe-area-inset-bottom), 40px);
    animation: onboardIn 0.35s ease forwards;
  }

  .onboard-screen.active { display: flex; }

  @keyframes onboardIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .onboard-wordmark {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    text-transform: lowercase;
    color: var(--accent);
    opacity: 0.7;
    flex-shrink: 0;
  }

  .onboard-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 40px 0 24px;
  }

  .onboard-body-picker {
    justify-content: flex-start;
    padding-top: 32px;
    gap: 20px;
  }

  .onboard-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 8vw, 2.6rem);
    font-weight: 300;
    color: var(--text);
    line-height: 1.2;
    margin: 0;
  }

  .onboard-title em {
    color: var(--accent);
    font-style: italic;
  }

  .onboard-sub {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.65;
    margin: 0;
    opacity: 0.85;
  }

  .onboard-sub-soft {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
    opacity: 0.5;
  }

  /* "New" button hint on exit screen */
  .onboard-new-hint {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(201,168,76,0.06);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 4px 0;
  }

  .onboard-new-hint-badge {
    flex-shrink: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #0a0a0f;
    background: var(--accent);
    border-radius: 6px;
    padding: 3px 9px;
    margin-top: 1px;
  }

  .onboard-new-hint-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.55;
    margin: 0;
    opacity: 0.85;
  }

  .onboard-new-hint-text strong {
    color: var(--accent);
    font-weight: 600;
  }

  .onboard-name-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    margin-top: 8px;
  }

  .onboard-name-input:focus {
    border-color: rgba(201,168,76,0.5);
  }

  .onboard-name-input::placeholder {
    color: var(--muted);
    opacity: 0.4;
  }

  /* Category grid inside onboarding */
  /* ── ONBOARD CATEGORY LIST ── */
  .onboard-cat-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .onboard-cat-tile {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
  }

  .onboard-cat-tile:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(201,168,76,0.25);
  }

  .onboard-cat-tile.selected {
    border-color: rgba(201,168,76,0.55);
    background: rgba(201,168,76,0.05);
  }

  /* Header row -- always visible */
  .onboard-cat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    width: 100%;
  }

  .onboard-cat-icon {
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
  }

  .onboard-cat-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0.01em;
    flex: 1;
  }

  .onboard-cat-desc { display: none; }

  /* Chevron */
  .onboard-cat-collapse {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: var(--accent);
    opacity: 0.7;
  }

  .onboard-cat-collapse svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent);
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.22s ease;
  }

  .onboard-cat-tile.expanded .onboard-cat-collapse svg {
    transform: rotate(180deg);
  }

  .onboard-cat-tile.expanded {
    border-color: rgba(201,168,76,0.45);
    background: rgba(201,168,76,0.04);
  }

  /* Child chips -- hidden until expanded */
  .onboard-children {
    display: none;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 14px 14px;
  }

  .onboard-cat-tile.expanded .onboard-children {
    display: flex;
  }

  /* Individual child chip */
  .onboard-child-chip {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    padding: 5px 11px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
  }

  .onboard-child-chip:hover {
    border-color: rgba(201,168,76,0.4);
    color: var(--text);
    background: rgba(201,168,76,0.06);
  }

  .onboard-child-chip.selected {
    border-color: rgba(201,168,76,0.75);
    background: rgba(201,168,76,0.15);
    color: var(--accent);
    font-weight: 500;
  }

  /* Actions */
  .onboard-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: max(env(safe-area-inset-bottom), 32px);
    flex-shrink: 0;
  }

  .onboard-cta {
    width: 100%;
    padding: 17px;
    background: var(--accent);
    color: #0a0a0f;
    border: none;
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
  }

  .onboard-cta:hover { background: #d4b05a; transform: translateY(-1px); }
  .onboard-cta:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

  .onboard-skip-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 8px;
    opacity: 0.5;
    transition: opacity 0.2s;
    text-align: center;
  }

  .onboard-skip-btn:hover { opacity: 0.9; }

  /* ── TWO-COLUMN WRAPPERS (transparent on mobile/tablet, active on desktop) ── */
  .quote-col {
    display: contents;
  }
  .context-col {
    display: contents;
  }

  /* ── MAIN SCREEN ── */
  #main {
    z-index: 8;
    gap: 0;
    padding: 0 24px;
    padding-top: max(env(safe-area-inset-top), 16px);
    padding-bottom: max(env(safe-area-inset-bottom), 12px);
    justify-content: space-between;
  }

  .top-bar {
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 4px;
    flex-shrink: 0;
  }

  .top-date {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.7;
  }

  .top-cat {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.85;
    cursor: pointer;
    padding: 4px 10px;
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 20px;
    transition: all 0.2s;
  }

  .top-cat:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
  }

  .quote-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    max-width: 480px;
    width: 100%;
    gap: clamp(12px, 2.5vh, 28px);
    padding: clamp(8px, 2vh, 20px) 0;
    min-height: 0;
  }

  .quote-ornament {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3rem;
    line-height: 1;
    color: var(--accent);
    opacity: 0.2;
    font-weight: 300;
    align-self: flex-start;
    margin-left: 4px;
    margin-bottom: -12px;
  }

  .quote-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.55rem, 5.5vw, 2.1rem);
    font-weight: 300;
    line-height: 1.5;
    text-align: center;
    letter-spacing: 0.01em;
    color: var(--text);
    transition: opacity 0.5s ease, transform 0.5s ease, color 0.8s ease;
  }

  .quote-text.fading {
    opacity: 0;
    transform: translateY(12px);
  }

  /* ── INSIGHT BUTTON ── */
  .insight-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, opacity 0.2s;
    opacity: 0.7;
    align-self: center;
  }
  .insight-btn:hover { opacity: 1; color: var(--accent); border-color: rgba(201,168,76,0.3); }
  .insight-btn .ib-icon { font-size: 0.85rem; }

  /* ── INSIGHT PANEL ── */
  .insight-panel {
    width: 100%;
    max-width: 400px;
    align-self: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 18px 20px;
    display: none;
    flex-direction: column;
    gap: 10px;
    animation: insightIn 0.3s ease forwards;
  }
  .insight-panel.open { display: flex; }

  @keyframes insightIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .insight-context {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    color: var(--accent);
    opacity: 0.65;
    line-height: 1.5;
    font-style: italic;
    margin-bottom: 2px;
    display: none;
  }

  .insight-context.visible { display: block; }

  .insight-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.7;
  }

  .insight-meaning {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 300;
    color: var(--text);
    line-height: 1.65;
    opacity: 0.9;
  }

  .insight-example {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.6;
    font-style: italic;
    border-left: 2px solid rgba(201,168,76,0.25);
    padding-left: 12px;
  }

  .quote-attr {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: var(--accent);
    opacity: 0.7;
    transition: opacity 0.5s ease;
    text-align: right;
    width: 100%;
    font-style: italic;
    margin-top: -8px;
    padding-right: 4px;
    box-sizing: border-box;
  }

  .quote-attr.fading { opacity: 0; }

  .reflect-prompt {
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
    text-align: center;
    letter-spacing: 0.03em;
    line-height: 1.6;
    width: 100%;
    max-width: 300px;
    align-self: center;
  }

  /* ── CONTEXT COL LABEL (desktop only) ── */
  .context-col-label {
    display: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.5;
  }
  .cat-footer {
    width: 100%;
    text-align: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.4;
    flex-shrink: 0;
    padding: 4px 0 max(env(safe-area-inset-bottom), 10px);
  }

  /* ── RATING BUTTONS ── */
  /* ── EVAL BAR ── */
  .eval-bar-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0 2px;
  }

  .eval-bar-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    color: var(--muted);
    opacity: 0.5;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    transition: opacity 0.3s ease;
  }

  .eval-bar-label.highlight {
    opacity: 0.9;
    color: var(--accent);
  }

  .eval-bar-track {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 99px;
    cursor: pointer;
    touch-action: none;
    overflow: hidden;
  }

  .eval-bar-track:active {
    background: rgba(255,255,255,0.09);
  }

  .eval-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, rgba(201,168,76,0.5), var(--accent));
    box-shadow: 0 0 10px rgba(201,168,76,0.3);
    pointer-events: none;
    transition: width 0.08s ease;
    width: 0%;
  }

  @keyframes evalPulse {
    0%   { box-shadow: 0 0 6px rgba(201,168,76,0.4); }
    50%  { box-shadow: 0 0 18px rgba(201,168,76,0.8); }
    100% { box-shadow: 0 0 6px rgba(201,168,76,0.3); }
  }

  .eval-bar-track.pulse {
    animation: evalPulse 0.45s ease forwards;
  }

  .divider {
    width: 32px;
    height: 1px;
    background: var(--accent);
    opacity: 0.25;
  }

  .bottom-bar {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    padding-bottom: 4px;
  }

  .action-row {
    display: flex;
    gap: 10px;
    width: 100%;
  }

  .btn-outline {
    flex: 1;
    padding: 13px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }

  .btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
  }

  .btn-primary {
    flex: 1.4;
    padding: 13px;
    background: var(--accent);
    border: none;
    border-radius: var(--r-sm);
    color: #0a0a0f;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }

  .btn-primary:hover {
    background: #d4b05a;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(201,168,76,0.3);
  }

  .streak-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.06em;
  }

  .streak-pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
  }

  .streak-pip.active { background: var(--accent); }

  /* ── JOURNAL MODAL ── */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 20;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .modal-overlay.open {
    opacity: 1;
    pointer-events: all;
  }

  .modal-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border-radius: 24px 24px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    padding: 24px 24px max(env(safe-area-inset-bottom), 28px);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .modal-overlay.open .modal-sheet { transform: translateY(0); }

  .modal-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto -8px;
  }

  .modal-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 300;
    letter-spacing: 0.04em;
  }

  .modal-sub {
    font-size: 0.78rem;
    color: var(--muted);
    font-style: italic;
    line-height: 1.6;
    margin-top: -8px;
  }

  .journal-input {
    width: 100%;
    min-height: 120px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 14px 16px;
    color: var(--text);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
  }

  .journal-input:focus { border-color: rgba(201,168,76,0.4); }
  .journal-input::placeholder { color: var(--muted); }

  .modal-btns {
    display: flex;
    gap: 10px;
  }

  /* ── SHARE CARD ── */
  .share-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    padding: 24px;
  }

  .share-overlay.open { opacity: 1; pointer-events: all; }

  .share-card {
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 36px 28px;
    position: relative;
    overflow: hidden;
    text-align: center;
  }

  .share-card-quote {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.1rem, 4vw, 1.45rem);
    font-weight: 300;
    line-height: 1.55;
    position: relative;
    z-index: 1;
  }

  .share-card-attr {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.65;
    position: relative;
    z-index: 1;
  }

  .share-card-brand {
    position: absolute;
    bottom: 16px;
    right: 20px;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.4;
    font-family: 'DM Sans', sans-serif;
  }

  .share-close {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    padding: 10px 24px;
    border-radius: 20px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
  }

  .share-close:hover { background: rgba(255,255,255,0.08); }

  .share-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    justify-content: center;
  }

  .share-action-btn {
    flex: 1;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    color: #0a0a0f;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 12px 16px;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: opacity 0.15s ease;
  }

  .share-action-btn:hover { opacity: 0.85; }

  .share-action-btn-outline {
    background: transparent;
    border: 1px solid rgba(201,168,76,0.4);
    color: var(--accent);
  }

  .share-export-nudge {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 14px;
    padding: 16px 20px;
    text-align: center;
  }

  .share-export-nudge.visible { display: flex; }

  .share-export-nudge p {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
  }

  .share-export-nudge button {
    background: transparent;
    border: 1px solid rgba(201,168,76,0.35);
    border-radius: 20px;
    color: var(--accent);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    padding: 7px 18px;
    cursor: pointer;
    transition: background 0.15s ease;
  }

  .share-export-nudge button:hover { background: rgba(201,168,76,0.08); }

  /* ── TOAST ── */
  .toast {
    position: fixed;
    bottom: max(env(safe-area-inset-bottom), 24px);
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--card);
    border: 1px solid var(--accent);
    color: var(--text);
    padding: 11px 20px;
    border-radius: 24px;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    z-index: 99;
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    white-space: nowrap;
  }

  .toast.show { transform: translateX(-50%) translateY(0); }

  /* ── SETTINGS BTN ── */
  .settings-btn {
    position: fixed;
    bottom: max(env(safe-area-inset-bottom), 24px);
    right: 20px;
    z-index: 50;
    background: rgba(10,10,15,0.8);
    border: 1px solid var(--border);
    color: var(--muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
  }

  .settings-btn:hover { border-color: var(--accent); color: var(--accent); }

  /* ── MOOD CHECK-IN OVERLAY ── */
  .mood-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .mood-overlay.open {
    opacity: 1;
    pointer-events: all;
  }
  .mood-sheet {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 28px 28px 0 0;
    padding: 12px 28px max(env(safe-area-inset-bottom), 32px);
    width: 100%;
    max-width: 480px;
    transform: translateY(20px);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .mood-overlay.open .mood-sheet {
    transform: translateY(0);
  }
  .mood-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 20px;
  }
  .mood-greeting {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text);
    text-align: center;
    margin-bottom: 6px;
  }
  .mood-sub {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
    margin-bottom: 28px;
  }
  .mood-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 24px;
  }
  .mood-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--muted);
  }
  .mood-btn:hover, .mood-btn.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--text);
    transform: translateY(-2px);
  }
  .mood-btn .mood-emoji {
    font-size: 1.8rem;
    line-height: 1;
  }
  .mood-btn .mood-label {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'DM Sans', sans-serif;
  }
  .mood-skip {
    display: block;
    text-align: center;
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 100%;
    transition: color 0.2s;
  }
  .mood-skip:hover { color: var(--text); }

  /* ── MOOD INDICATOR on main screen ── */
  .mood-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
    opacity: 0.75;
    cursor: pointer;
    padding: 3px 10px;
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 20px;
    transition: all 0.2s;
    margin-left: 6px;
  }
  .mood-indicator:hover {
    border-color: rgba(201,168,76,0.6);
    opacity: 1;
  }
  .mood-indicator .mi-emoji { font-size: 1rem; }

  /* ── SETTINGS MODAL ── */
  .settings-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(10,10,15,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .settings-modal.open {
    opacity: 1;
    pointer-events: all;
  }
  .settings-sheet {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    width: min(100%, 520px);
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    height: min(calc(100dvh - 48px), 800px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
    z-index: 91;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
  }
  .settings-modal.open .settings-sheet {
    transform: translateX(-50%) translateY(0);
  }
  /* Sticky header -- handle + title */
  .settings-header {
    flex-shrink: 0;
    padding: 12px 28px 0;
    background: var(--card);
  }
  /* Scrollable body -- all rows live here */
  .settings-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    padding: 0 28px 16px;
  }

  .settings-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 12px;
    cursor: pointer;
    user-select: none;
  }

  .settings-section-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.6;
  }

  .settings-chevron {
    font-size: 1rem;
    color: var(--muted);
    opacity: 0.4;
    transition: transform 0.25s ease;
    display: inline-block;
    line-height: 1;
  }

  .settings-collapsible.open .settings-chevron {
    transform: rotate(90deg);
  }

  .settings-section-content {
    display: none;
    padding-bottom: 8px;
  }

  .settings-collapsible.open .settings-section-content {
    display: block;
  }
  /* Sticky footer -- Done button */
  .settings-footer {
    flex-shrink: 0;
    padding: 12px 28px max(env(safe-area-inset-bottom), 20px);
    background: var(--card);
    border-top: 1px solid var(--border);
  }
  .settings-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--text);
    text-align: center;
    padding: 8px 0 18px;
    margin: 0;
  }
  .settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }
  .settings-row:last-of-type { border-bottom: none; }
  .settings-row-label {
    font-size: 0.85rem;
    color: var(--text);
  }
  .settings-row-sub {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 2px;
    letter-spacing: 0.05em;
  }
  .settings-select {
    background: var(--accent-dim);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.75rem;
    padding: 6px 10px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
  }
  .settings-select option {
    background: #1a1a26;
    color: var(--text);
  }
  .settings-btn-cat {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--accent);
    font-size: 0.75rem;
    padding: 6px 14px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
  }
  .settings-btn-cat:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
  }
  .settings-close {
    width: 100%;
    padding: 15px;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    color: #0a0a0f;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.15s ease;
  }
  .settings-close:hover { opacity: 0.88; }

  /* ══════════════════════════════════════════════
     TABLET  640px – 1023px
  ══════════════════════════════════════════════ */
  
  /* ── Small screens (short phones, landscape) ── */
  @media (max-height: 700px) {
    .quote-text {
      font-size: clamp(1.4rem, 5vw, 2rem);
    }
    .quote-area {
      gap: 10px;
      padding: 4px 0;
    }
    .action-bar {
      gap: 8px;
      padding-bottom: 8px;
    }
    .streak-row {
      display: none;
    }
  }

  /* ── Tall phones / normal ── */
  @media (min-height: 700px) and (max-height: 900px) {
    .quote-area {
      justify-content: center;
    }
  }

  /* ── Large phones / small tablets ── */
  @media (min-height: 900px) {
    .quote-area {
      justify-content: center;
      gap: clamp(20px, 3vh, 36px);
    }
  }

  @media (min-width: 640px) {
    .orb-1 { width: 700px; height: 700px; }
    .orb-2 { width: 560px; height: 560px; }

    .picker-inner  { max-width: 600px; padding: 0 40px; }

    #main { padding: 0 48px; padding-top: max(env(safe-area-inset-top), 32px); padding-bottom: max(env(safe-area-inset-bottom), 40px); }

    .top-bar       { max-width: 680px; }
    .top-date      { font-size: 0.78rem; }
    .top-cat       { font-size: 0.78rem; }

    .quote-area    { max-width: 620px; gap: 32px; padding: 32px 0; }
    .quote-ornament { font-size: 6rem; }
    .quote-text    { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
    .reflect-prompt { max-width: 420px; font-size: 0.88rem; }
    .insight-panel { max-width: 560px; padding: 22px 26px; }
    .insight-meaning { font-size: 1.05rem; }
    .insight-example { font-size: 0.82rem; }

    .bottom-bar    { max-width: 620px; gap: 16px; }
    .btn-outline, .btn-primary { font-size: 0.82rem; padding: 15px; }

    .modal-sheet   { max-width: 600px; border-radius: 24px 24px 0 0; }
    .share-card    { max-width: 420px; }

    .settings-btn  { bottom: 36px; right: 36px; }

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

  /* ══════════════════════════════════════════════
     DESKTOP  1024px+
  ══════════════════════════════════════════════ */
  @media (min-width: 1024px) {
    .orb-1 { width: 900px; height: 900px; top: -200px; right: -200px; }
    .orb-2 { width: 700px; height: 700px; bottom: -150px; left: -150px; }

    /* Picker: wider, card grid */
    .picker-inner  { max-width: 860px; padding: 0 60px; }
    .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }

    /* Main screen: true two-column layout */
    #main {
      flex-direction: row;
      align-items: stretch;
      justify-content: center;
      gap: 0;
      padding: 0;
      overflow: hidden;
    }

    /* Top bar: fixed across full width */
    .top-bar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      max-width: 100%;
      padding: 16px 80px;
      background: linear-gradient(to bottom, var(--bg) 70%, transparent);
      z-index: 5;
    }

    /* Left column: quote */
    .quote-col {
      display: flex;
      flex: 1;
      flex-direction: column;
      max-width: 580px;
      align-self: stretch;
      align-items: flex-start;
      justify-content: center;
      padding: 0 60px 0 80px;
    }

    /* Right column: actions */
    .context-col {
      display: flex;
      flex-direction: column;
      width: 280px;
      flex-shrink: 0;
      align-self: stretch;
      justify-content: center;
      align-items: flex-start;
      padding: 0 60px 0 48px;
      gap: 16px;
      border-left: 1px solid rgba(255,255,255,0.06);
    }

    /* Quote area */
    .quote-area {
      max-width: 100%;
      width: 100%;
      gap: 14px;
      padding: 0;
      justify-content: center;
      align-items: flex-start;
      flex: none;
    }

    .context-col-label {
      display: block;
      margin-bottom: 4px;
    }

    .quote-text { font-size: clamp(1.6rem, 2.4vw, 2.4rem); text-align: left; }
    .quote-ornament { font-size: 4rem; align-self: flex-start; }
    .quote-attr { text-align: right; width: 100%; }
    .eval-bar-wrap { max-width: 480px; margin: 0 auto; }
    .insight-btn { align-self: center; width: auto; }
    .insight-panel { max-width: 100%; align-self: center; }
    .reflect-prompt { text-align: center; max-width: 100%; font-size: 0.85rem; align-self: center; }

    /* Right column bottom bar */
    .bottom-bar {
      max-width: 100%;
      width: 100%;
      justify-content: flex-start;
      gap: 12px;
    }

    .action-row { flex-direction: column; gap: 10px; }

    .btn-outline {
      flex: none;
      width: 100%;
      font-size: 0.78rem;
      padding: 14px 18px;
      justify-content: flex-start;
      border-color: rgba(255,255,255,0.1);
      color: var(--text);
      opacity: 0.8;
    }

    .btn-outline:hover { opacity: 1; }

    .btn-primary {
      flex: none;
      width: 100%;
      font-size: 0.78rem;
      padding: 16px 18px;
      justify-content: center;
    }

    .streak-row {
      justify-content: flex-start;
      padding-top: 16px;
      border-top: 1px solid var(--border);
      width: 100%;
    }

    .cat-footer {
      align-self: flex-start;
      text-align: left;
      padding: 8px 0 0;
    }

    /* Mood overlay: centered card */
    .mood-sheet {
      border-radius: 20px;
      margin-bottom: 0;
      max-width: 460px;
      width: 100%;
    }

    /* Modals: centered cards */
    .modal-overlay { align-items: center; }
    .modal-sheet {
      max-width: 520px;
      border-radius: 20px;
      margin-bottom: 0;
    }

    .settings-btn { bottom: 48px; right: 48px; }
    .top-date { font-size: 0.78rem; }
    .settings-modal {
      align-items: center;
    }
    .settings-sheet {
      width: 520px;
      height: min(80vh, 700px);
      border-radius: 20px;
      bottom: auto;
      top: 50%;
      transform: translateX(-50%) translateY(calc(-50% + 30px));
    }
    .settings-modal.open .settings-sheet {
      transform: translateX(-50%) translateY(-50%);
    }
  }

  /* ── GUIDED TOUR ── */
  #tourOverlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
  }

  #tourSpotlight {
    position: absolute;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.72);
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
  }

  #tourTooltip {
    position: absolute;
    background: #1a1a24;
    border: 1px solid rgba(201,168,76,0.35);
    border-radius: 14px;
    padding: 16px 18px 14px;
    width: min(300px, calc(100vw - 40px));
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    pointer-events: all;
    transition: top 0.35s cubic-bezier(0.4,0,0.2,1),
                left 0.35s cubic-bezier(0.4,0,0.2,1),
                opacity 0.2s ease;
  }

  #tourTooltipText {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.55;
    margin: 0 0 12px;
    opacity: 0.9;
  }

  #tourTooltipFooter {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  #tourStep {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.65rem;
    color: var(--muted);
    opacity: 0.45;
    letter-spacing: 0.06em;
  }

  #tourSkipBtn {
    background: none;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.5;
    cursor: pointer;
    padding: 4px 8px;
  }

  #tourSkipBtn:hover { opacity: 0.8; }

  #tourNextBtn {
    background: var(--accent);
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #0a0a0f;
    padding: 7px 16px;
    cursor: pointer;
    transition: opacity 0.15s ease;
  }

  #tourNextBtn:hover { opacity: 0.85; }
  #tourNextBtn.last  { background: var(--accent); }


  /* ══ DEMO WALKTHROUGH ══════════════════════════ */
  #demoScreen {
    z-index: 20;
    background: var(--bg);
    justify-content: flex-start;
    padding: 0;
    overflow: hidden;
  }

  .demo-inner {
    flex: 1;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 28px 120px;
    gap: 0;
  }

  @media (min-width: 768px) {
    .demo-inner {
      max-width: 600px;
      padding: 60px 60px 140px;
    }
    .demo-quote-area {
      gap: 22px;
    }
  }

  .demo-quote-area {
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: opacity 0.3s ease;
  }

  .demo-ornament {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4rem;
    color: var(--accent);
    opacity: 0.15;
    line-height: 0.6;
    margin-bottom: 8px;
    user-select: none;
  }

  /* All demo elements visible from start, dimmed by default */
  .demo-attr {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: var(--accent);
    opacity: 1;
    font-style: italic;
    text-align: right;
    width: 100%;
    padding-right: 4px;
    box-sizing: border-box;
    transition: opacity 0.4s ease;
  }

  .demo-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.4rem, 5vw, 2rem);
    font-weight: 300;
    color: var(--text);
    line-height: 1.5;
    text-align: center;
    letter-spacing: 0.01em;
    opacity: 1;
    transition: opacity 0.4s ease;
  }

  .demo-insight-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 14px;
    align-self: flex-start;
    opacity: 1;
    cursor: pointer;
    transition: opacity 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
  }

  .demo-insight-panel {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 1;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, max-height 0.5s ease;
  }

  .demo-insight-panel.open {
    max-height: 300px;
  }

  .demo-insight-meaning {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.6;
    opacity: 0.85;
  }

  .demo-insight-example {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.6;
    opacity: 0.65;
    font-style: italic;
  }

  .demo-reflect {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-style: italic;
    color: var(--muted);
    opacity: 1;
    line-height: 1.5;
    transition: opacity 0.4s ease;
    padding-top: 4px;
  }

  .demo-actions {
    display: flex;
    gap: 10px;
    opacity: 1;
    transition: opacity 0.4s ease;
    padding-top: 4px;
  }

  /* Active element -- full brightness */
  .demo-active {
    opacity: 1 !important;
  }

  /* Pulse on interactive elements */
  @keyframes demoBtnPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(201,168,76,0.2); }
    50%       { box-shadow: 0 0 20px rgba(201,168,76,0.6); }
  }

  .demo-quote-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  /* Slow pulse variant -- 2 iterations for the insight button cue */
  .demo-insight-btn.pulse-slow {
    border-color: rgba(201,168,76,0.8) !important;
    opacity: 1 !important;
    animation: demoBtnPulse 2s ease 2;
  }

  .demo-insight-btn.pulse,
  #demoNewBtn.pulse {
    border-color: rgba(201,168,76,0.8) !important;
    opacity: 1 !important;
    animation: demoBtnPulse 1.2s ease infinite;
  }

  .demo-btn { flex: 1; font-size: 0.8rem; padding: 12px 8px; }

  /* Demo topbar */
  .demo-topbar {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 16px;
    opacity: 1;
    transition: opacity 0.4s ease;
  }

  .demo-mood-indicator {
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
  }

  /* Demo eval bar */
  .demo-eval {
    display: flex;
    flex-direction: column;
    gap: 7px;
    opacity: 1;
    transition: opacity 0.4s ease;
  }

  .demo-eval-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    transition: color 0.3s ease;
  }

  .demo-eval-track {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 99px;
    overflow: hidden;
    cursor: pointer;
    touch-action: none;
  }

  .demo-eval-fill {
    position: absolute;
    left: 0; top: 0;
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, rgba(201,168,76,0.5), var(--accent));
    box-shadow: 0 0 10px rgba(201,168,76,0.3);
    transition: width 0.15s ease;
    pointer-events: none;
  }

  /* Demo New button -- visible and styled, not greyed out */
  .demo-new-btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 12px 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    cursor: pointer;
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, opacity 0.3s ease;
    opacity: 0.2;
  }

  .demo-new-btn.pulse {
    opacity: 1 !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    animation: demoBtnPulse 1.2s ease infinite;
  }

  /* Dim overlay -- kept for structure but spotlight handles via box-shadow */
  .demo-dim {
    display: none;
  }

  /* Floating tooltip near active element */
  .demo-tooltip {
    position: fixed;
    z-index: 40;
    background: #1e1e2a;
    border: 1px solid rgba(201,168,76,0.45);
    border-radius: 14px;
    padding: 14px 16px;
    width: min(280px, calc(100vw - 40px));
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(201,168,76,0.1);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
  }

  .demo-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
  }

  /* Arrow pointing from tooltip toward the element */
  .demo-tooltip::before {
    content: '';
    position: absolute;
    left: var(--arrow-offset, 20px);
    width: 10px;
    height: 10px;
    background: #1e1e2a;
    border-left: 1px solid rgba(201,168,76,0.45);
    border-top: 1px solid rgba(201,168,76,0.45);
    transform: rotate(45deg);
  }

  .demo-tooltip.arrow-up::before {
    top: -6px;
  }

  .demo-tooltip.arrow-down::before {
    bottom: -6px;
    transform: rotate(225deg);
  }

  .demo-tooltip-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.84rem;
    color: var(--text);
    line-height: 1.55;
    margin: 0 0 12px;
    opacity: 0.92;
  }

  .demo-tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .demo-tooltip-step {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.62rem;
    color: var(--muted);
    opacity: 0.4;
    letter-spacing: 0.08em;
  }

  .demo-label-next {
    background: var(--accent);
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #0a0a0f;
    padding: 8px 18px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s ease;
  }

  .demo-label-next:hover { opacity: 0.85; }
  .demo-label-next.hidden-btn { display: none; }

  /* Active element cut through the dim */
  /* Spotlight: element glows against a dimmed background */
  .demo-active-spotlight {
    position: relative;
    border-radius: 10px;
    outline: 2px solid rgba(201,168,76,0.5);
    outline-offset: 6px;
    box-shadow: 0 0 0 4px rgba(201,168,76,0.12),
                0 0 32px 12px rgba(201,168,76,0.15) !important;
    filter: brightness(1.2);
    transition: outline 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
  }

  /* Dim rules handled by JS via demoSetDim() */

  /* Outro screen */
  #demoOutro {
    z-index: 20;
    background: var(--bg);
    justify-content: center;
    align-items: flex-start;
    padding: 0 28px;
  }

  .demo-outro-inner {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  /* Interests picker */
  #interestsPicker {
    z-index: 20;
    background: var(--bg);
    justify-content: flex-start;
    padding-top: max(env(safe-area-inset-top), 32px);
    padding-bottom: max(env(safe-area-inset-bottom), 32px);
    overflow-y: auto;
  }

  .interests-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
  }

  .interest-tile {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
  }

  .interest-tile:hover { background: rgba(255,255,255,0.05); border-color: rgba(201,168,76,0.25); }
  .interest-tile.selected { border-color: rgba(201,168,76,0.55); background: rgba(201,168,76,0.05); }

  .interest-tile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
  }

  .interest-tile-icon { font-size: 1.15rem; flex-shrink: 0; }

  .interest-tile-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    flex: 1;
  }

  .interest-tile-chevron {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: var(--accent);
    opacity: 0.7;
  }

  .interest-tile-chevron svg {
    width: 20px; height: 20px;
    stroke: var(--accent); stroke-width: 2.5;
    fill: none; stroke-linecap: round; stroke-linejoin: round;
    transition: transform 0.22s ease;
  }

  .interest-tile.expanded .interest-tile-chevron svg { transform: rotate(180deg); }
  .interest-tile.expanded { border-color: rgba(201,168,76,0.45); background: rgba(201,168,76,0.04); }

  .interest-children {
    display: none;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 14px 14px;
  }

  .interest-tile.expanded .interest-children { display: flex; }

  .interest-child-chip {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    padding: 5px 11px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
  }

  .interest-child-chip:hover { border-color: rgba(201,168,76,0.4); color: var(--text); background: rgba(201,168,76,0.06); }
  .interest-child-chip.selected { border-color: rgba(201,168,76,0.75); background: rgba(201,168,76,0.15); color: var(--accent); font-weight: 500; }

  .onboard-demo-tease {
    color: var(--accent);
    opacity: 0.8;
    font-style: italic;
  }


  /* ── LICENSE GATE ── */
  #licenseScreen {
    z-index: 20;
    background: var(--bg);
    justify-content: center;
    padding: 0 28px;
  }

  .license-inner {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: flex-start;
  }

  .license-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }

  .license-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .license-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    letter-spacing: 0.02em;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
  }

  .license-input:focus {
    border-color: rgba(201,168,76,0.5);
  }

  .license-input.error  { border-color: #ef4444; }
  .license-input.success { border-color: #4ade80; }

  .license-status {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    min-height: 20px;
    transition: color 0.2s ease;
    padding-left: 4px;
  }

  .license-status.error   { color: #ef4444; }
  .license-status.success { color: #4ade80; }
  .license-status.loading { color: var(--muted); opacity: 0.7; }

  .license-help {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.55;
    line-height: 1.6;
    margin: 0;
  }

  .license-actions {
    width: 100%;
  }



  /* ── iOS SAFE AREA OVERRIDES ── */
  /* Extra bottom clearance on all full-screen views */
  body.ios .onboard-actions {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.ios .license-inner {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.ios .license-actions {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.ios .onboard-screen {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.ios #main {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.ios #picker {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.ios #demoScreen {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.ios #notifPrompt .license-inner {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  /* ── ANDROID SAFE AREA OVERRIDES ── */
  body.android .onboard-actions {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.android .license-inner {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.android .license-actions {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.android .onboard-screen {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.android #main {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.android #picker {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.android #demoScreen {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.android #notifPrompt .license-inner {
    padding-bottom: max(env(safe-area-inset-bottom), 52px);
  }

  body.android .account-modal-sheet {
    padding-bottom: max(env(safe-area-inset-bottom), 48px);
  }


  /* ── ACCOUNT MODALS ── */
  .account-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 0 env(safe-area-inset-bottom);
    backdrop-filter: blur(4px);
  }

  .account-modal.hidden { display: none; }

  .account-modal-sheet {
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    padding: 28px 24px max(env(safe-area-inset-bottom), 32px);
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .account-modal-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text);
    letter-spacing: 0.02em;
  }

  .account-modal-sub {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
    opacity: 0.8;
  }

  .account-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
  }

  .account-modal-cancel {
    flex: 1;
    padding: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.15s ease;
  }
  .account-modal-cancel:hover { background: rgba(255,255,255,0.1); }

  .account-modal-confirm {
    flex: 1;
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    color: #0a0a0f;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s ease;
  }
  .account-modal-confirm:hover { opacity: 0.88; }
  .account-modal-confirm:disabled { opacity: 0.4; cursor: not-allowed; }

  .account-modal-danger {
    background: #ef4444;
    color: #fff;
  }

  body.ios .account-modal-sheet {
    padding-bottom: max(env(safe-area-inset-bottom), 48px);
  }


  /* ── WELLNESS NUDGE ── */
  #wellnessNudgeScreen {
    z-index: 80;
    background: var(--bg);
    justify-content: center;
    padding: 0 28px;
  }

  .nudge-inner {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: flex-start;
  }

  .nudge-wordmark {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.32em;
    text-transform: lowercase;
    color: var(--accent);
    opacity: 0.6;
  }

  .nudge-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
  }

  .nudge-message {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    font-weight: 300;
    font-style: italic;
    color: var(--text);
    line-height: 1.65;
    margin: 0;
    opacity: 0.92;
  }

  .nudge-tone-row {
    display: flex;
    gap: 8px;
  }

  .nudge-tone-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.6;
  }

  .nudge-tone-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    opacity: 1;
  }

  .nudge-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .nudge-btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--accent);
    border: none;
    border-radius: 14px;
    color: #0a0a0f;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s ease;
  }
  .nudge-btn-primary:hover { opacity: 0.88; }

  .nudge-btn-secondary {
    width: 100%;
    padding: 15px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease;
  }
  .nudge-btn-secondary:hover { background: rgba(255,255,255,0.04); }

  .nudge-btn-ghost {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s ease;
  }
  .nudge-btn-ghost:hover { opacity: 0.8; }

  body.ios .nudge-inner,
  body.android .nudge-inner {
    padding-bottom: max(env(safe-area-inset-bottom), 32px);
  }


  /* ── iOS INSTALL WALKTHROUGH ── */
  .install-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    margin: 4px 0;
  }

  .install-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
  }

  .install-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.8;
  }

  .install-step-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.5;
    opacity: 0.85;
    padding-top: 4px;
  }


  /* ── SUPPORT RESOURCES ── */
  .support-resource {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .support-resource-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
  }

  .support-resource-sub {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--muted);
    opacity: 0.7;
  }

  .support-resource-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 9px 18px;
    background: var(--accent);
    color: #0a0a0f;
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    align-self: flex-start;
    transition: opacity 0.15s ease;
  }
  .support-resource-btn:hover { opacity: 0.85; }

  /* ── NOTIFICATION PROMPT ── */
  #notifPrompt {
    z-index: 20;
    background: var(--bg);
    justify-content: center;
    padding: 0 28px;
  }

  .notif-time-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
  }

  .notif-time-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--muted);
    opacity: 0.7;
    letter-spacing: 0.04em;
  }

  .notif-time-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    color-scheme: dark;
  }

  .notif-time-input:focus {
    border-color: rgba(201,168,76,0.5);
  }

  .notif-sub-note {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.5;
    line-height: 1.6;
    margin: 0;
  }


  /* Persistent skip link on onboarding */
  .onboard-skip-persistent {
    position: absolute;
    top: max(env(safe-area-inset-top), 20px);
    right: 24px;
    z-index: 10;
  }

  .onboard-skip-persistent button {
    background: none;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.45;
    cursor: pointer;
    padding: 8px 0;
    letter-spacing: 0.04em;
    transition: opacity 0.2s ease;
  }

  .onboard-skip-persistent button:hover { opacity: 0.8; }


  /* ── LEGAL MODALS ── */
  .legal-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.6);
    align-items: flex-end;
    justify-content: center;
  }

  .legal-modal.open {
    display: flex;
  }

  .legal-sheet {
    background: #12121a;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0 0 max(env(safe-area-inset-bottom), 20px);
  }

  .legal-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    margin: 12px auto 0;
    flex-shrink: 0;
  }

  .legal-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--text);
    padding: 16px 24px 12px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
  }

  .legal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    -webkit-overflow-scrolling: touch;
  }

  .legal-body p, .legal-body li {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.7;
    opacity: 0.8;
    margin-bottom: 10px;
  }

  .legal-body h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 18px 0 6px;
    opacity: 0.7;
  }

  .legal-body ul {
    padding-left: 16px;
    margin-bottom: 10px;
  }

  .legal-updated {
    font-size: 0.68rem !important;
    opacity: 0.4 !important;
    font-style: italic;
  }

  .legal-close {
    margin: 12px 24px 0;
    flex-shrink: 0;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0a0a0f;
    padding: 13px;
    cursor: pointer;
    width: calc(100% - 48px);
  }

    /* Settings: constrained on tablet */
    .settings-sheet {
      width: min(100%, 520px);
      height: min(calc(100dvh - 48px), 700px);
    }
