
  /* =========================================================
     LIGHT THEME (default) — warm parchment + brand teal
     ========================================================= */
  :root,
  body[data-theme="light"] {
    --bg: #EBE4D2;
    --bg-soft: #E4DCC4;
    --bg-warm: #F2EDDB;
    --surface: #FFFFFF;
    --border: #D6CDB6;
    --border-strong: #B5AB91;

    --text: #1A1F1F;
    --text-dim: #5A6363;
    --text-mute: #8B928F;

    --teal: #2BB8B8;            /* brand teal — matches logo */
    --teal-bright: #2BB8B8;
    --teal-dark: #1A8585;
    --teal-deep: #0F5757;
    --teal-soft: #7DD9D9;
    --teal-emphasis: #1A8585;   /* readable on light bg, still on-brand */
    --teal-tint: rgba(43, 184, 184, 0.08);

    --fluid-top: #2BB8B8;
    --fluid-bottom: #0F5757;

    --shadow-soft: 0 1px 2px rgba(15, 23, 23, 0.06), 0 8px 24px rgba(15, 23, 23, 0.05);
    --shadow-lift: 0 4px 12px rgba(15, 23, 23, 0.08), 0 24px 60px rgba(15, 23, 23, 0.1);

    --modal-backdrop-color: rgba(26, 31, 31, 0.38);

    /* atmosphere */
    --atmos-1: rgba(43, 184, 184, 0.06);
    --atmos-2: rgba(20, 75, 75, 0.04);
    --atmos-3: rgba(180, 165, 120, 0.08);
  }

  /* =========================================================
     DARK THEME — deep near-black, brand teal accents
     ========================================================= */
  body[data-theme="dark"] {
    --bg: #0A0F0F;
    --bg-soft: #131A1A;
    --bg-warm: #0E1414;
    --surface: #161D1D;
    --border: #232C2A;
    --border-strong: #3A4441;

    --text: #F0EEE8;
    --text-dim: #B8BCB8;
    --text-mute: #7A827E;

    --teal: #2BB8B8;
    --teal-bright: #34D8D8;
    --teal-dark: #2BB8B8;
    --teal-deep: #1A8585;
    --teal-soft: #7DD9D9;
    --teal-emphasis: #2BB8B8;   /* full brand teal pops on dark */
    --teal-tint: rgba(43, 184, 184, 0.14);

    --fluid-top: #2BB8B8;
    --fluid-bottom: #1A6565;

    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lift: 0 4px 12px rgba(0, 0, 0, 0.5), 0 24px 60px rgba(0, 0, 0, 0.6);

    --modal-backdrop-color: rgba(0, 0, 0, 0.65);

    --atmos-1: rgba(43, 184, 184, 0.08);
    --atmos-2: rgba(43, 184, 184, 0.04);
    --atmos-3: rgba(20, 75, 75, 0.10);
  }

  /* =========================================================
     HYPERMODE — high stimulation, animated gradients, glows
     ========================================================= */
  body[data-theme="hyper"] {
    --bg: #050709;
    --bg-soft: #0B1115;
    --bg-warm: #0E1418;
    --surface: #11181E;
    --border: #2BB8B8;
    --border-strong: #2BB8B8;

    --text: #FFFFFF;
    --text-dim: #DFE6E5;
    --text-mute: #9BAEAB;

    --teal: #2BB8B8;
    --teal-bright: #34F3F3;
    --teal-dark: #2BB8B8;
    --teal-deep: #00E3E3;
    --teal-soft: #7DF6F6;
    --teal-emphasis: #34F3F3;
    --teal-tint: rgba(52, 243, 243, 0.18);

    --hyper-magenta: #FF3D9C;
    --hyper-amber: #FFB82B;

    --fluid-top: #34F3F3;
    --fluid-bottom: #2BB8B8;

    --shadow-soft: 0 0 12px rgba(43, 184, 184, 0.25), 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lift: 0 0 24px rgba(52, 243, 243, 0.3), 0 24px 60px rgba(0, 0, 0, 0.6);

    --modal-backdrop-color: rgba(0, 0, 0, 0.75);

    --atmos-1: rgba(52, 243, 243, 0.20);
    --atmos-2: rgba(255, 61, 156, 0.10);
    --atmos-3: rgba(255, 184, 43, 0.06);
  }

  * { box-sizing: border-box; }

  html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 600ms ease, color 600ms ease;
  }

  /* Atmospheric backdrop — animated subtly in hyper mode */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse 55% 42% at 50% 48%, var(--atmos-1), transparent 70%),
      radial-gradient(ellipse 100% 80% at 50% 100%, var(--atmos-2), transparent 60%),
      radial-gradient(ellipse 80% 60% at 50% 0%, var(--atmos-3), transparent 70%);
    pointer-events: none;
    z-index: 0;
    transition: opacity 600ms ease;
  }
  body[data-theme="hyper"]::before {
    background:
      radial-gradient(ellipse 60% 55% at 28% 30%, var(--atmos-1), transparent 70%),
      radial-gradient(ellipse 60% 55% at 78% 70%, var(--atmos-2), transparent 70%),
      radial-gradient(ellipse 70% 55% at 50% 95%, var(--atmos-3), transparent 70%);
    animation: hyperShift 18s ease-in-out infinite;
  }
  @keyframes hyperShift {
    0%, 100% {
      background:
        radial-gradient(ellipse 60% 55% at 28% 30%, rgba(52, 243, 243, 0.22), transparent 70%),
        radial-gradient(ellipse 60% 55% at 78% 70%, rgba(255, 61, 156, 0.12), transparent 70%),
        radial-gradient(ellipse 70% 55% at 50% 95%, rgba(255, 184, 43, 0.08), transparent 70%);
    }
    33% {
      background:
        radial-gradient(ellipse 60% 55% at 75% 22%, rgba(52, 243, 243, 0.24), transparent 70%),
        radial-gradient(ellipse 60% 55% at 22% 65%, rgba(255, 61, 156, 0.16), transparent 70%),
        radial-gradient(ellipse 70% 55% at 60% 92%, rgba(255, 184, 43, 0.10), transparent 70%);
    }
    66% {
      background:
        radial-gradient(ellipse 60% 55% at 50% 18%, rgba(52, 243, 243, 0.20), transparent 70%),
        radial-gradient(ellipse 60% 55% at 80% 55%, rgba(255, 61, 156, 0.14), transparent 70%),
        radial-gradient(ellipse 70% 55% at 25% 85%, rgba(255, 184, 43, 0.12), transparent 70%);
    }
  }

  /* Paper grain — only in light theme */
  body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.6'/></svg>");
    opacity: 0.05;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: multiply;
  }
  body[data-theme="dark"]::after,
  body[data-theme="hyper"]::after { opacity: 0; }

  .app {
    position: relative;
    height: 100vh;
    display: grid;
    grid-template-rows: 64px 1fr auto;
    grid-template-columns: minmax(0, 1fr);
    z-index: 2;
  }
  /* Grid children must be allowed to shrink — otherwise the hyper-mode
     marquee track at width:max-content stretches the column to ~12000px
     and pushes everything else off-screen. */
  .app > * {
    min-width: 0;
    max-width: 100vw;
  }
  .info-panel { width: 100%; overflow: hidden; }

  /* =========================================================
     Top bar
     ========================================================= */
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    gap: 16px;
  }
  .topbar-left { display: flex; align-items: center; gap: 24px; }
  .logo {
    height: 30px;
    width: auto;
    display: block;
  }
  /* Swap logo image by theme */
  .logo.dark { display: none; }
  body[data-theme="dark"] .logo.light,
  body[data-theme="hyper"] .logo.light { display: none; }
  body[data-theme="dark"] .logo.dark,
  body[data-theme="hyper"] .logo.dark { display: block; }

  /* Theme toggle segmented control */
  .theme-toggle {
    display: inline-flex;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
  }
  .theme-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    height: 32px;
    padding: 0 14px 0 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.015em;
    line-height: 1;
    transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
  }
  .theme-btn:hover { color: var(--text); }
  .theme-btn.active {
    background: var(--text);
    color: var(--bg);
  }
  body[data-theme="hyper"] .theme-btn.active {
    background: var(--teal-bright);
    color: var(--bg);
    box-shadow: 0 0 14px var(--teal-bright);
  }
  .theme-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
  .theme-btn .theme-label { line-height: 1; }
  @media (max-width: 1180px) {
    .theme-btn .theme-label { display: none; }
    .theme-btn { padding: 0 10px; }
  }

  .topbar-actions {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.015em;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
  }
  .topbar-link:hover {
    border-color: var(--teal);
    color: var(--teal-emphasis);
    background: var(--teal-tint);
  }
  .topbar-link .arrow {
    font-size: 13px;
    transition: transform 220ms ease;
  }
  .topbar-link:hover .arrow { transform: translateX(3px); }
  .topbar-link .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 8px rgba(43, 184, 184, 0.5);
  }
  .topbar-link.primary {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
  }
  body[data-theme="light"] .topbar-link.primary {
    background: var(--teal-deep);
    color: var(--bg-warm);
    border-color: var(--teal-deep);
    box-shadow: 0 2px 8px rgba(15, 87, 87, 0.18);
  }
  body[data-theme="light"] .topbar-link.primary:hover {
    background: var(--teal-dark);
    border-color: var(--teal-dark);
  }
  body[data-theme="dark"] .topbar-link.primary {
    background: var(--teal);
    color: #0A0F0F;
    border-color: var(--teal);
  }
  body[data-theme="dark"] .topbar-link.primary:hover {
    background: var(--teal-bright);
    border-color: var(--teal-bright);
  }
  body[data-theme="hyper"] .topbar-link.primary {
    background: var(--teal-bright);
    color: #050709;
    border-color: var(--teal-bright);
    box-shadow: 0 0 14px var(--teal-bright);
  }

  .topbar-link.whatsapp {
    background: #25D366;
    color: #FFFFFF;
    border-color: #25D366;
  }
  .topbar-link.whatsapp:hover {
    background: #1FAA52;
    border-color: #1FAA52;
    color: #FFFFFF;
  }
  .topbar-link.whatsapp .dot { background: #FFFFFF; box-shadow: 0 0 8px rgba(255,255,255,0.5); }
  .topbar-link.whatsapp svg { width: 13px; height: 13px; }

  /* =========================================================
     Stage
     ========================================================= */
  .stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 24px 10px;
    overflow: hidden;
    gap: 12px;
  }

  /* Hero */
  .hero {
    text-align: center;
    max-width: 700px;
    padding-bottom: 0;
  }
  .hero-kicker {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--teal-emphasis);
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
  }
  .hero-kicker::before, .hero-kicker::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 1px;
    background: var(--teal-emphasis);
    opacity: 0.55;
  }
  .hero-title {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 25px;
    line-height: 1.18;
    letter-spacing: -0.018em;
    margin: 0 0 6px 0;
    color: var(--text);
  }
  .hero-title em {
    font-style: normal;
    color: var(--teal-emphasis);
    font-weight: 400;
  }
  body[data-theme="hyper"] .hero-title em {
    color: var(--teal-bright);
    text-shadow: 0 0 18px var(--teal-bright);
  }
  .hero-sub {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-dim);
    margin: 0;
  }
  @media (max-height: 820px) {
    .hero-title { font-size: 21px; }
    .hero-sub { font-size: 13px; }
    .hero-kicker { font-size: 10px; margin-bottom: 6px; }
  }

  /* Duration pills */
  .duration-pills {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
  }
  body[data-theme="hyper"] .duration-pills {
    border-color: var(--teal);
    box-shadow: 0 0 18px rgba(52, 243, 243, 0.2), var(--shadow-soft);
  }
  .pill {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 500;
    font-size: 12.5px;
    letter-spacing: 0.01em;
    padding: 8px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    line-height: 1;
  }
  .pill:hover:not(.active):not(:disabled) {
    color: var(--text);
    background: var(--bg-soft);
  }
  .pill.active {
    background: var(--text);
    color: var(--bg);
    font-weight: 600;
  }
  body[data-theme="hyper"] .pill.active {
    background: var(--teal-bright);
    color: var(--bg);
    box-shadow: 0 0 14px var(--teal-bright);
  }
  .pill:disabled { opacity: 0.4; cursor: not-allowed; }
  .pill .sub {
    font-size: 10px;
    opacity: 0.5;
    margin-left: 5px;
    font-weight: 400;
  }
  .pill.active .sub { opacity: 0.7; }

  /* Timer container */
  .timer-container {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  @media (max-height: 880px) { .timer-container { width: 360px; height: 360px; } }
  @media (max-height: 800px) { .timer-container { width: 320px; height: 320px; } }
  @media (max-height: 720px) { .timer-container { width: 280px; height: 280px; } }

  #fluidCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .timer-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 2;
    /* Halo is now painted on the canvas as a circle — no rectangle here */
  }
  .timer-phase {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 11.5px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--teal-emphasis);
    margin-bottom: 4px;
    transition: color 600ms ease;
    text-shadow: 0 0 14px var(--bg), 0 0 8px var(--bg), 0 0 4px var(--bg);
  }
  .timer-phase.break { color: var(--teal); }
  .timer-time {
    font-family: 'Fraunces', serif;
    font-weight: 200;
    font-size: 60px;
    line-height: 1;
    letter-spacing: -0.045em;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    text-shadow: 0 0 18px var(--bg), 0 0 10px var(--bg), 0 0 4px var(--bg);
  }
  body[data-theme="hyper"] .timer-time {
    text-shadow: 0 0 22px var(--bg), 0 0 12px var(--bg), 0 0 4px var(--bg), 0 0 30px rgba(52, 243, 243, 0.4);
  }
  @media (max-height: 820px) { .timer-time { font-size: 50px; } }
  @media (max-height: 720px) { .timer-time { font-size: 42px; } }

  .timer-meta {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 12.5px;
    color: var(--text-mute);
    margin-top: 6px;
    letter-spacing: 0.01em;
    text-shadow: 0 0 10px var(--bg), 0 0 6px var(--bg);
  }

  /* Controls */
  .controls {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .btn {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    padding: 14px 32px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  .btn:hover { border-color: var(--text); background: var(--bg-soft); }
  .btn-primary {
    background: var(--teal-deep);
    color: var(--bg-warm);
    border-color: var(--teal-deep);
    box-shadow: 0 4px 14px rgba(15, 87, 87, 0.22);
  }
  body[data-theme="dark"] .btn-primary {
    background: var(--teal);
    color: var(--bg);
    border-color: var(--teal);
    box-shadow: 0 4px 18px rgba(43, 184, 184, 0.3);
  }
  body[data-theme="hyper"] .btn-primary {
    background: var(--teal-bright);
    color: var(--bg);
    border-color: var(--teal-bright);
    box-shadow: 0 0 24px var(--teal-bright), 0 4px 18px rgba(52, 243, 243, 0.4);
  }
  .btn-primary:hover { transform: translateY(-1px); }
  .btn-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--text-dim);
  }
  .btn-ghost:hover { color: var(--text); background: var(--bg-soft); }

  .session-count {
    position: absolute;
    top: 84px;
    left: 32px;
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 12.5px;
    color: var(--text-mute);
    z-index: 2;
  }
  .session-count strong {
    font-style: normal;
    font-weight: 500;
    color: var(--teal-emphasis);
    font-variant-numeric: tabular-nums;
  }

  /* =========================================================
     Bottom info panel
     ========================================================= */
  .info-panel {
    border-top: 1px solid var(--border);
    background: var(--bg);
    padding: 18px 32px 22px;
    position: relative;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition:
      opacity 1.6s cubic-bezier(0.4, 0, 0.2, 1),
      transform 1.6s cubic-bezier(0.4, 0, 0.2, 1),
      filter 1.6s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .info-panel.dissolved {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(8px);
    pointer-events: none;
  }

  /* Rotator (light + dark) */
  .info-rotator {
    max-width: 740px;
    width: 100%;
    text-align: center;
    transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.9s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.9s ease;
  }
  .info-rotator.swapping {
    opacity: 0;
    transform: translateY(-4px);
    filter: blur(4px);
  }
  body[data-theme="hyper"] .info-rotator { display: none; }

  /* Marquee (hyper only) */
  .info-marquee {
    display: none;
    width: 100%;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
  }
  body[data-theme="hyper"] .info-marquee { display: block; }
  .marquee-track {
    display: flex;
    gap: 20px;
    width: max-content;
    animation: marqueeScroll 110s linear infinite;
  }
  @keyframes marqueeScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
  }
  .marquee-card {
    flex-shrink: 0;
    width: 340px;
    padding: 14px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-align: left;
    box-shadow: 0 0 18px rgba(52, 243, 243, 0.15);
  }
  .marquee-card .info-kicker { margin-bottom: 6px; font-size: 10px; }
  .marquee-card .info-title { font-size: 16px; margin-bottom: 4px; line-height: 1.22; }
  .marquee-card .info-body { font-size: 12.5px; line-height: 1.45; }

  .info-kicker {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--teal-emphasis);
    margin-bottom: 8px;
  }
  .info-title {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 20px;
    line-height: 1.25;
    letter-spacing: -0.012em;
    margin: 0 0 8px 0;
    color: var(--text);
  }
  .info-body {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 400;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-dim);
    margin: 0;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
  }

  .info-panel::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--teal-emphasis);
    opacity: 0;
    transition: opacity 800ms ease 400ms;
  }
  .info-panel:not(.dissolved)::before { opacity: 1; }
  body[data-theme="hyper"] .info-panel::before { background: var(--teal-bright); box-shadow: 0 0 10px var(--teal-bright); }

  /* Patent / Copyright footer line */
  .credit-line {
    position: fixed;
    bottom: 6px;
    left: 12px;
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 10.5px;
    color: var(--text-mute);
    z-index: 5;
    letter-spacing: 0.02em;
    pointer-events: none;
    user-select: none;
  }
  .credit-line strong {
    font-style: normal;
    font-weight: 400;
    color: inherit;
  }

  /* Tips toggle pill — bottom-right */
  /* Tips toggle — small pill at the top-right of the info panel area */
  .tips-toggle {
    position: fixed;
    bottom: 140px;
    right: 22px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    padding: 4px 9px 4px 7px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    opacity: 0.7;
  }
  .tips-toggle:hover {
    border-color: var(--teal);
    color: var(--text);
    background: var(--surface);
    opacity: 1;
  }
  .tips-toggle svg { width: 11px; height: 11px; flex-shrink: 0; }
  body[data-theme="hyper"] .tips-toggle {
    border-color: var(--teal-bright);
    color: var(--text);
  }

  /* =========================================================
     Celebration overlay
     ========================================================= */
  .celebration {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    pointer-events: none;
  }
  .celebration.active { display: flex; animation: fadeIn 500ms ease; }
  .celebration-card {
    text-align: center;
    padding: 48px;
    animation: rise 900ms cubic-bezier(0.34, 1.2, 0.64, 1);
  }
  .celebration-kicker {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--teal-emphasis);
    margin-bottom: 18px;
  }
  .celebration-title {
    font-family: 'Fraunces', serif;
    font-weight: 200;
    font-size: 88px;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--text);
    margin: 0 0 18px 0;
  }
  .celebration-sub {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 22px;
    color: var(--text-dim);
    margin: 0;
  }
  @media (max-height: 820px) { .celebration-title { font-size: 68px; } .celebration-sub { font-size: 19px; } }
  @keyframes rise { from { opacity: 0; transform: translateY(20px) scale(0.96); filter: blur(8px); } to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  /* =========================================================
     Modal styles
     ========================================================= */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--modal-backdrop-color);
    backdrop-filter: blur(8px);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 280ms ease;
  }
  .modal-backdrop.active { display: flex; }
  .modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lift);
    animation: modalRise 380ms cubic-bezier(0.34, 1.2, 0.64, 1);
  }
  .modal.small { max-width: 480px; }
  @keyframes modalRise { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
  .modal-header {
    padding: 28px 32px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
  }
  .modal-kicker {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--teal-emphasis);
    margin-bottom: 6px;
  }
  .modal-title {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 26px;
    margin: 0 0 8px 0;
    line-height: 1.18;
    letter-spacing: -0.015em;
    color: var(--text);
  }
  .modal-sub {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 13.5px;
    color: var(--text-dim);
    margin: 0;
    line-height: 1.55;
  }
  .modal-close {
    background: transparent; border: none;
    color: var(--text-mute);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 8px;
    transition: all 180ms;
    flex-shrink: 0;
  }
  .modal-close:hover { color: var(--text); background: var(--bg-soft); }
  .modal-body { overflow-y: auto; padding: 4px 32px 20px; flex: 1; }
  .modal-body::-webkit-scrollbar { width: 5px; }
  .modal-body::-webkit-scrollbar-track { background: transparent; }
  .modal-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

  .question { padding: 18px 0; border-bottom: 1px solid var(--border); }
  .question:last-child { border-bottom: none; }
  .question-text {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 500; font-size: 14.5px; line-height: 1.45;
    margin: 0 0 12px 0; color: var(--text);
  }
  .question-num {
    display: inline-block;
    font-family: 'Fraunces', serif;
    font-style: italic;
    color: var(--teal-emphasis);
    margin-right: 8px;
    font-weight: 400;
  }
  .options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .option {
    background: var(--bg-warm);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 11.5px;
    font-weight: 500;
    padding: 10px 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 180ms;
    text-align: center;
  }
  .option:hover:not(.selected) { border-color: var(--text-mute); color: var(--text); }
  .option.selected {
    background: var(--teal-deep);
    border-color: var(--teal-deep);
    color: var(--bg-warm);
    font-weight: 600;
  }
  body[data-theme="dark"] .option.selected,
  body[data-theme="hyper"] .option.selected {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--bg);
  }
  .modal-footer {
    padding: 18px 32px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-warm);
  }
  .progress-text { font-family: 'Fraunces', serif; font-style: italic; font-size: 13px; color: var(--text-dim); }
  .progress-text strong { font-style: normal; color: var(--teal-emphasis); font-variant-numeric: tabular-nums; }
  .btn-primary:disabled { background: var(--bg-warm); color: var(--text-mute); border-color: var(--border); box-shadow: none; cursor: not-allowed; }

  .result-screen { padding: 24px 32px 32px; display: none; }
  .result-screen.active { display: block; }
  .result-screen .result-kicker {
    font-family: 'Fraunces', serif; font-style: italic; font-size: 11px;
    letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 10px;
  }
  .result-screen.positive .result-kicker { color: var(--teal-emphasis); }
  .result-screen.negative .result-kicker { color: var(--text-dim); }
  .result-title {
    font-family: 'Fraunces', serif; font-weight: 300; font-size: 28px;
    line-height: 1.18; margin: 0 0 14px 0; letter-spacing: -0.015em; color: var(--text);
  }
  .result-body {
    font-family: 'Bricolage Grotesque', sans-serif; font-size: 14px;
    line-height: 1.6; color: var(--text-dim); margin: 0 0 20px 0;
  }
  .result-body strong { color: var(--text); font-weight: 600; }
  .result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .result-actions .btn { padding: 12px 22px; font-size: 12px; }
  .result-actions a.btn { text-decoration: none; display: inline-flex; align-items: center; }
  .score-chip {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-warm); border: 1px solid var(--border);
    padding: 6px 14px; border-radius: 999px;
    font-family: 'Bricolage Grotesque', sans-serif; font-size: 12px;
    color: var(--text-dim); margin-bottom: 14px;
  }
  .score-chip strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

  .booking-body { padding: 8px 32px 22px; }
  .booking-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
  .booking-option {
    text-decoration: none;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    text-align: left;
    color: var(--text);
    transition: all 220ms;
    cursor: pointer;
    display: block;
  }
  .booking-option:hover {
    border-color: var(--teal);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
  }
  .booking-option .label {
    font-family: 'Fraunces', serif; font-style: italic; font-size: 10.5px;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--teal-emphasis); margin-bottom: 6px;
  }
  .booking-option .name {
    font-family: 'Fraunces', serif; font-weight: 400; font-size: 17px;
    line-height: 1.25; margin-bottom: 4px;
  }
  .booking-option .desc {
    font-family: 'Bricolage Grotesque', sans-serif; font-size: 12.5px;
    color: var(--text-dim); line-height: 1.45;
  }

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


  /* =========================================================
     MOBILE — full rewrite
     ========================================================= */

  @media (max-width: 640px) {

    /* --- Fix the locked viewport --- */
    html, body {
      height: auto;
      min-height: 100%;
      overflow-x: hidden;
      overflow-y: auto;
    }

    /* --- App layout: drop the rigid 100vh grid, stack naturally --- */
    .app {
      height: auto;
      min-height: 100svh;
      display: flex;
      flex-direction: column;
    }

    /* --- Topbar: 2-row layout --- */
    .topbar {
      height: auto;
      flex-direction: column;
      align-items: stretch;
      padding: 10px 14px 8px;
      gap: 8px;
    }
    .topbar-left {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .topbar-actions {
      display: flex;
      gap: 6px;
      align-items: center;
      justify-content: stretch;
      flex-wrap: wrap;
    }
    .topbar-actions > * {
      flex: 1;
      justify-content: center;
    }
    .logo { height: 22px; }

    /* All topbar buttons smaller */
    .topbar-link {
      font-size: 11px;
      padding: 7px 11px;
      gap: 5px;
    }
    .topbar-link .arrow { display: none; }
    .topbar-link .dot { width: 5px; height: 5px; }

    /* Theme toggle: icons only */
    .theme-btn { padding: 0 8px; height: 28px; }

    /* --- Stage: scrollable, natural height --- */
    .stage {
      flex: 1;
      height: auto;
      padding: 16px 16px 12px;
      gap: 14px;
      justify-content: flex-start;
      overflow: visible;
    }

    /* --- Session count: static position in flow --- */
    .session-count {
      position: static;
      font-size: 11px;
      text-align: center;
      margin-bottom: -6px;
    }

    /* --- Hero --- */
    .hero { max-width: 100%; }
    .hero-kicker { font-size: 9px; letter-spacing: 0.16em; margin-bottom: 4px; }
    .hero-title { font-size: 20px; }
    .hero-sub { font-size: 13px; }

    /* --- Pills --- */
    .duration-pills {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      border-radius: 16px;
      padding: 4px;
      gap: 3px;
      width: 100%;
    }
    .pill { font-size: 11.5px; padding: 8px 13px; }

    /* --- Timer --- */
    .timer-container {
      width: min(260px, 72vw);
      height: min(260px, 72vw);
      flex-shrink: 0;
    }
    .timer-time { font-size: 44px; }
    .timer-phase { font-size: 10px; }
    .timer-meta { font-size: 11px; margin-top: 4px; }

    /* --- Controls --- */
    .controls { gap: 8px; }
    .btn { font-size: 11.5px; padding: 12px 24px; }

    /* --- Info panel: natural height, no fixed bottom elements fighting it --- */
    .info-panel {
      padding: 16px 16px 20px;
      min-height: auto;
    }
    .info-title { font-size: 17px; }
    .info-body { font-size: 12.5px; }

    /* Tips toggle: anchor to bottom of info panel area, not fixed */
    .tips-toggle {
      position: static;
      display: inline-flex;
      margin: 8px auto 0;
      opacity: 1;
    }

    /* Credit line */
    .credit-line {
      position: static;
      display: block;
      text-align: center;
      padding: 6px 0 10px;
      font-size: 9.5px;
      pointer-events: auto;
    }

    /* --- Modals: bottom sheet --- */
    .modal-backdrop {
      padding: 0;
      align-items: flex-end;
    }
    .modal {
      max-width: 100%;
      width: 100%;
      border-radius: 22px 22px 0 0;
      max-height: 92svh;
    }
    .modal-header { padding: 20px 20px 14px; }
    .modal-title { font-size: 20px; }
    .modal-body { padding: 4px 20px 16px; }
    .modal-footer { padding: 14px 20px; }

    /* ASRS options: 3 cols */
    .options { grid-template-columns: repeat(3, 1fr); gap: 5px; }

    /* Booking: single column */
    .booking-options { grid-template-columns: 1fr; }
    .booking-body { padding: 8px 20px 20px; }

    /* Celebration */
    .celebration-card { padding: 32px 20px; }
    .celebration-title { font-size: 56px; }
    .celebration-sub { font-size: 18px; }
  }

  /* --- Tablet portrait --- */
  @media (max-width: 768px) and (min-width: 641px) {
    .topbar { padding: 0 18px; }
    .topbar-link.whatsapp { display: none; }
    .topbar-link.primary span:not(.dot):not(.arrow) { display: none; }
    .topbar-link.primary { padding: 7px 10px; }
    .timer-container {
      width: min(340px, 80vw);
      height: min(340px, 80vw);
    }
  }

