/* =========================================================
   LUMEN — design tokens
   A "night garden" palette: deep ink ground, warm gold
   growth-light accent, soft parchment text. Mood states
   hue-shift both the ground (ink-1/2/3/bright) and the accent
   together, on the exact same lightness/saturation curve as the
   base palette — so every mood still reads as the same brand,
   just tinted, not a different app.
========================================================= */
:root {
    /* "Mood" source tones — untouched by light/dark mode, exactly the palette a mood
       picks (see body[data-mood="..."] below). Light/dark mode never edits these; it only
       changes how much white or black gets mixed into them on the way to the --ink and
       --paper tokens below, so the underlying hue is always the same "org color". */
    --mood-ink-1: #0B1410;
    --mood-ink-2: #132018;
    --mood-ink-3: #1B2B21;
    --mood-ink-bright: #2F5C40;
    --mood-paper: #F3EFE3;
    --mood-paper-dim: #A9AF9E;

    --accent: #D9A441;
    --accent-glow: #F0C878;
    --accent-soft: rgba(217, 164, 65, 0.16);
    --accent-ink: #1B1406;

    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;

    --font-display: 'Fraunces', serif;
    --font-body: 'Manrope', sans-serif;

    /* R, G, B triplet for the low-opacity "chrome" overlays (card fills, borders, hovers)
       sprinkled through this file as rgba(var(--wash), N) — white on dark, black on light,
       same opacities either way so the surface hierarchy reads identically in both modes. */
    --wash: 255, 255, 255;

    --line: rgba(var(--wash), 0.10);
    --line-soft: rgba(var(--wash), 0.06);
}

@property --accent {
    syntax: '<color>';
    inherits: true;
    initial-value: #D9A441;
}

@property --accent-glow {
    syntax: '<color>';
    inherits: true;
    initial-value: #F0C878;
}

@property --accent-soft {
    syntax: '<color>';
    inherits: true;
    initial-value: rgba(217, 164, 65, 0.16);
}

/* The ground itself (ink-1/2/3/bright) is registered the same way as the accent
   tokens above, so a mood switch can hue-shift the whole background — not just
   text/highlights — and have the browser interpolate it smoothly instead of
   snapping. Each mood below only rotates the hue of these tones; saturation and
   lightness stay on the exact same curve as the base "night garden" palette, so
   every mood still reads as the same brand, just tinted toward its own accent. */
@property --ink-1 {
    syntax: '<color>';
    inherits: true;
    initial-value: #0B1410;
}

@property --ink-2 {
    syntax: '<color>';
    inherits: true;
    initial-value: #132018;
}

@property --ink-3 {
    syntax: '<color>';
    inherits: true;
    initial-value: #1B2B21;
}

@property --ink-bright {
    syntax: '<color>';
    inherits: true;
    initial-value: #2F5C40;
}

body[data-mood="energized"] {
    --accent: #E8A23E;
    --accent-glow: #FFCE7A;
    --accent-soft: rgba(232, 162, 62, 0.24);
    --mood-ink-1: #14100B;
    --mood-ink-2: #201B13;
    --mood-ink-3: #2B241B;
    --mood-ink-bright: #5C492F;
}

body[data-mood="calm"] {
    --accent: #5fa975;
    --accent-glow: #7aa57f;
    --accent-soft: rgba(95, 169, 160, 0.20);
    --mood-ink-1: #0B1413;
    --mood-ink-2: #13201E;
    --mood-ink-3: #1B2B29;
    --mood-ink-bright: #2f5c32;
}

body[data-mood="tired"] {
    --accent: #717a8b;
    --accent-glow: #a1a8b9;
    --accent-soft: rgba(136, 146, 166, 0.14);
    --mood-ink-1: #0B0E14;
    --mood-ink-2: #131720;
    --mood-ink-3: #1B202B;
    --mood-ink-bright: #2F3E5C;
}

body[data-mood="stressed"] {
    --accent: #786bad;
    --accent-glow: #b1a6d5;
    --accent-soft: rgba(139, 124, 199, 0.16);
    --mood-ink-1: #0D0B14;
    --mood-ink-2: #161320;
    --mood-ink-3: #1E1B2B;
    --mood-ink-bright: #382F5C;
}

body[data-mood="creative"] {
    --accent: #c16b51;
    --accent-glow: #db9b80;
    --accent-soft: rgba(217, 122, 92, 0.22);
    --mood-ink-1: #140D0B;
    --mood-ink-2: #201613;
    --mood-ink-3: #2B1F1B;
    --mood-ink-bright: #5C3A2F;
}

/* ---------------- light/dark mode ----------------
   Dark is the default (identity mapping above: --ink-* = --mood-ink-*, --paper = --mood-paper).
   Light mode never introduces new colors — it takes the exact same mood palette and mixes in
   white for the backgrounds / black for the text, so hue and brand identity stay identical,
   only the lightness moves. --wash flips too, so every card/border "chrome" rule written as
   rgba(var(--wash), N) automatically becomes a dark tint on the new light background instead
   of an invisible white-on-white one. */
body[data-theme="light"] {
    /* Tinted from --accent/--accent-glow, not --mood-ink-*. The mood-ink tones are
       deliberately low-saturation near-blacks built for a night background — diluted
       toward white they end up as nearly-identical pale grays, so different moods stopped
       reading as different colors in light mode even though the underlying hex was
       technically different. --accent is already vividly saturated per mood (that's what
       makes the buttons/highlights read as distinct colors already), so mixing it into
       white gives clearly distinguishable pastels instead — still the same "org color"
       per mood, just the other token already defined for it. */
    --ink-1: color-mix(in srgb, var(--accent) 10%, white 90%);
    --ink-2: color-mix(in srgb, var(--accent) 15%, white 85%);
    --ink-3: color-mix(in srgb, var(--accent) 21%, white 79%);
    --ink-bright: color-mix(in srgb, var(--accent-glow) 55%, white 45%);
    --paper: color-mix(in srgb, var(--mood-paper) 12%, black 88%);
    --paper-dim: color-mix(in srgb, var(--mood-paper-dim) 55%, black 45%);
    --wash: 0, 0, 0;
}

/* The language/mood <select> chevron is a hardcoded-color inline SVG (can't reference a CSS
   var from inside a data: URI), so it needs its own light-mode swap to stay visible. */
body[data-theme="light"] .lang-switcher {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23554F42' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

body {
    /* ---- theme layer (dark = default/identity mapping) ----
       Deliberately declared on `body`, not `:root` — mood overrides live on
       body[data-mood="..."], and :root only matches <html>. If this lived on :root,
       --ink-1 would be computed once from html's own (never-mood-overridden)
       --mood-ink-1 and just inherit down unchanged, never reacting to a mood switch —
       exactly the "background stopped changing with mood" bug this fixes. Body sees
       its own (mood-conditioned) --mood-ink-* values directly, so this re-derives
       correctly every time. body[data-theme="light"] below overrides these same
       properties with the color-mix version, at higher specificity. */
    --ink-1: var(--mood-ink-1);
    --ink-2: var(--mood-ink-2);
    --ink-3: var(--mood-ink-3);
    --ink-bright: var(--mood-ink-bright);
    --paper: var(--mood-paper);
    --paper-dim: var(--mood-paper-dim);

    min-height: 100vh;
    background: var(--ink-1);
    color: var(--paper);
    font-family: var(--font-body);
    overflow-x: hidden;
    transition: background-color 1.1s ease, color 1.1s ease;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

p {
    margin: 0;
}

button {
    font-family: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent-glow);
    outline-offset: 3px;
    border-radius: 8px;
}

code {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    background: rgba(var(--wash), 0.06);
    padding: 0.1em 0.4em;
    border-radius: 5px;
    font-size: 0.88em;
}

.app {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* ---------------- ambient background — a low-opacity night sky, your existing greens ---------------- */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.6;
    background:
        radial-gradient(90% 50% at 50% -8%, var(--accent-soft), transparent 62%),
        linear-gradient(180deg, var(--ink-1) 0%, var(--ink-2) 45%, var(--ink-3) 100%);
    transition: background 1.1s ease;
}

/* A dense tiled dusting of tiny stars — real depth, cheap to render (a handful of tiled
   gradients, not hundreds of elements), drifting almost imperceptibly slowly. */
.ambient-starfield {
    position: absolute;
    inset: -15%;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(243, 239, 227, 0.65), transparent),
        radial-gradient(1px 1px at 75% 15%, rgba(243, 239, 227, 0.5), transparent),
        radial-gradient(1.5px 1.5px at 40% 55%, rgba(243, 239, 227, 0.6), transparent),
        radial-gradient(1px 1px at 90% 65%, rgba(243, 239, 227, 0.4), transparent),
        radial-gradient(1px 1px at 25% 80%, rgba(243, 239, 227, 0.5), transparent),
        radial-gradient(1.5px 1.5px at 60% 35%, rgba(243, 239, 227, 0.45), transparent);
    background-size: 300px 300px, 260px 260px, 380px 380px, 220px 220px, 340px 340px, 420px 420px;
    background-repeat: repeat;
    animation: ambient-starfield-drift 220s linear infinite;
}

@keyframes ambient-starfield-drift {
    from {
        background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    }

    to {
        background-position: -300px 300px, 260px -260px, -380px -380px, 220px 220px, -340px 340px, 420px -420px;
    }
}

/* Soft glowing color clouds for depth, like nebula wisps — big, blurred, barely moving */
.ambient-nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
}

.ambient-nebula-a {
    width: 46vmax;
    height: 46vmax;
    top: -12%;
    left: 52%;
    background: radial-gradient(circle, var(--ink-bright), transparent 70%);
    opacity: 0.4;
    animation: ambient-nebula-pulse 16s ease-in-out infinite;
}

.ambient-nebula-b {
    width: 38vmax;
    height: 38vmax;
    bottom: -8%;
    left: -10%;
    background: radial-gradient(circle, var(--accent-soft), transparent 70%);
    opacity: 0.35;
    animation: ambient-nebula-pulse 20s ease-in-out infinite reverse;
}

@keyframes ambient-nebula-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.32;
    }

    50% {
        transform: scale(1.18);
        opacity: 0.5;
    }
}

/* A soft glowing moon in the corner */
.ambient-moon {
    position: absolute;
    top: 9%;
    right: 11%;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--accent-glow), var(--accent) 60%, transparent 78%);
    box-shadow: 0 0 70px 14px var(--accent-soft);
    opacity: 0.45;
    animation: ambient-moon-glow 10s ease-in-out infinite;
}

@keyframes ambient-moon-glow {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.55;
    }
}

.ambient-star {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--paper);
    animation: ambient-twinkle 4.5s ease-in-out infinite;
}

.ambient-star:nth-child(5) {
    top: 8%;
    left: 15%;
    animation-duration: 4.2s;
}

.ambient-star:nth-child(6) {
    top: 14%;
    left: 46%;
    animation-duration: 5.4s;
    animation-delay: -1.2s;
}

.ambient-star:nth-child(7) {
    top: 10%;
    left: 76%;
    animation-duration: 3.8s;
    animation-delay: -2.4s;
}

.ambient-star:nth-child(8) {
    top: 24%;
    left: 60%;
    animation-duration: 5s;
    animation-delay: -0.6s;
}

.ambient-star:nth-child(9) {
    top: 30%;
    left: 20%;
    animation-duration: 4.8s;
    animation-delay: -3s;
}

.ambient-star:nth-child(10) {
    top: 20%;
    left: 88%;
    animation-duration: 4s;
    animation-delay: -1.8s;
}

.ambient-star:nth-child(11) {
    top: 38%;
    left: 35%;
    animation-duration: 4.6s;
    animation-delay: -2.9s;
}

.ambient-star:nth-child(12) {
    top: 45%;
    left: 70%;
    animation-duration: 5.2s;
    animation-delay: -0.9s;
}

@keyframes ambient-twinkle {

    0%,
    100% {
        opacity: 0.15;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.8);
    }
}

/* A single shooting star that streaks across, then rests for most of the cycle. It travels
   from top-left toward bottom-right (see the translate(85vw, 60vh) below, roughly a 24°
   downward diagonal on a typical wide viewport) — the tail is pinned to the star's own
   position (transform-origin: left center) and rotated to point back along that same ~24°
   line, so it trails directly behind the star instead of jutting off at a mismatched angle.
   The gradient puts the bright end at the star (the pivot) fading to transparent along the
   tail, like a real trail, rather than the reverse. */
.ambient-comet {
    position: absolute;
    top: 8%;
    left: 6%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--paper);
    box-shadow: 0 0 8px 2px var(--accent-glow);
    animation: ambient-comet 18s linear infinite;
}

.ambient-comet::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 110px;
    height: 1.5px;
    background: linear-gradient(to right, var(--accent-glow), transparent);
    transform: translateY(-50%) rotate(204deg);
    transform-origin: left center;
}

@keyframes ambient-comet {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }

    4% {
        opacity: 1;
    }

    24% {
        transform: translate(85vw, 60vh);
        opacity: 0;
    }

    100% {
        transform: translate(85vw, 60vh);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    .ambient-star,
    .ambient-comet,
    .ambient-starfield,
    .ambient-nebula,
    .ambient-moon {
        animation: none;
        opacity: 0.3;
    }

    .ambient-comet::after {
        display: none;
    }
}

/* ---------------- top bar ---------------- */
.topbar {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(180deg,
            color-mix(in srgb, var(--ink-1) 96%, transparent),
            color-mix(in srgb, var(--ink-1) 86%, transparent));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft);
    transition: background 1.1s ease;
}

.topbar-inner {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    row-gap: 0.6rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.95rem 1.8rem;
}

/* Below ~900px, the brand + full topnav + streak chip + mood/language selects + audio
   toggle + profile button no longer fit on one line. Rather than let them silently
   overflow (body has overflow-x:hidden, so anything that didn't fit was just being
   clipped off-screen — usually the profile button), force a clean two-row header:
   brand on its own row, then the icon/select cluster right-aligned, then the nav pills
   centered underneath. Above 900px this block does nothing and the layout is unchanged. */
@media (max-width:900px) {
    .topbar-right {
        flex: 1 1 100%;
    }

    .topnav {
        order: 3;
        flex: 1 1 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .brand-logo {
        width: 46px;
        height: 46px;
    }
}

@media (max-width:480px) {
    .topbar-inner {
        padding: 0.8rem 1rem;
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0.36rem 0.65rem;
        font-size: 0.68rem;
    }

    .brand-word {
        font-size: 1.02rem;
    }

    .topbar-right {
        gap: 0.45rem;
    }

    main {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }
}

.brand {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem;
}

.brand-word {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--paper-dim);
}

.brand-logo {
    width: 60px;
    height: 60px;
    display: block;
}

.brand-logo img,
.completion-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.topbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    row-gap: 0.5rem;
    gap: 0.7rem;
}

.streak-chip {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(var(--wash), 0.05);
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--paper);
}

.lang-switcher {
    background: rgba(var(--wash), 0.04);
    border: 1px solid var(--line);
    color: var(--paper-dim);
    border-radius: 999px;
    padding: 0.42rem 1.6rem 0.42rem 0.9rem;
    font-size: 0.74rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A9AF9E' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 12px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.lang-switcher:hover {
    color: var(--paper);
    border-color: rgba(var(--wash), 0.3);
}

[dir="rtl"] .lang-switcher {
    padding: 0.42rem 0.9rem 0.42rem 1.6rem;
    background-position: left 0.6rem center;
}

.lang-switcher option {
    background: var(--ink-2);
    color: var(--paper);
}

.profile-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(var(--wash), 0.05);
    border: 1px solid var(--line);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--paper-dim);
    transition: border-color 0.2s ease, color 0.2s ease;
    overflow: hidden;
}

.profile-btn:hover {
    color: var(--paper);
    border-color: rgba(var(--wash), 0.3);
}

.audio-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(var(--wash), 0.05);
    border: 1px solid var(--line);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--paper-dim);
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    flex: none;
}

.audio-toggle-btn:hover {
    color: var(--paper);
    border-color: rgba(var(--wash), 0.3);
}

.audio-toggle-btn[aria-pressed="true"] {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--paper);
}

.audio-toggle-btn svg {
    width: 17px;
    height: 17px;
    transition: transform 0.18s ease;
}

.audio-toggle-btn:hover svg {
    transform: scale(1.1);
}

.topnav {
    display: flex;
    gap: 0.4rem;
}

.nav-link {
    background: rgba(var(--wash), 0.04);
    border: 1px solid var(--line);
    color: var(--paper-dim);
    border-radius: 999px;
    padding: 0.42rem 0.9rem;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover {
    color: var(--paper);
    border-color: rgba(var(--wash), 0.25);
}

.nav-link.nav-active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--paper);
}

/* ---------------- progress dots ---------------- */
.progress-dots {
    display: flex;
    gap: 0.4rem;
    padding: 0.7rem 0 0.1rem;
}

.progress-dots .dot {
    width: 6px;
    height: 6px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(var(--wash), 0.14);
    transition: background 0.3s ease, transform 0.3s ease;
    cursor: default;
}

.progress-dots .dot.reachable {
    cursor: pointer;
}

.progress-dots .dot.reachable:hover {
    background: rgba(var(--wash), 0.3);
}

.progress-dots .dot.done {
    background: var(--accent-glow);
}

.progress-dots .dot.current {
    background: var(--accent);
    transform: scale(1.6);
}

/* ---------------- step back button ---------------- */
.step-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.step-head .eyebrow {
    margin-bottom: 0;
}

.step-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(var(--wash), 0.03);
    color: var(--paper-dim);
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.step-back-btn:hover {
    color: var(--paper);
    border-color: rgba(var(--wash), 0.22);
}

.step-back-btn svg {
    width: 16px;
    height: 16px;
}

main {
    width: 100%;
    max-width: 1180px;
    padding: 0.5rem 1.8rem 3rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    flex-direction: column;
    flex: 1;
}

.screen.active {
    display: flex;
    animation: screenIn 0.45s ease;
}

@keyframes screenIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .screen.active {
        animation: none;
    }
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.68rem;
    color: var(--accent-glow);
    font-weight: 700;
    margin-bottom: 0.6rem;
}

h2 {
    font-size: 1.7rem;
    line-height: 1.25;
    margin-bottom: 0.4rem;
}

.screen-sub {
    color: var(--paper-dim);
    font-size: 0.92rem;
    margin: 0 0 1.5rem;
    max-width: 52ch;
}

.screen-nav {
    margin-top: auto;
    padding-top: 1.6rem;
    display: flex;
    justify-content: center;
}

/* ---------------- welcome ---------------- */
.welcome-inner {
    margin: 2.2rem 0 1rem;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    gap: 1.8rem;
}

@media (min-width:760px) {
    .welcome-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        gap: 3rem;
    }
}

.welcome-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
}

@media (min-width:760px) {
    .welcome-text {
        align-items: flex-start;
        flex: 1 1 0;
    }
}

.welcome-visual {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
}

.welcome-logo {
    width: 230px;
    height: 230px;
}

@media (min-width:760px) {
    .welcome-logo {
        width: 320px;
        height: 320px;
    }
}

.welcome-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    animation: logo-pulse 3.6s ease-in-out infinite;
}

@keyframes logo-pulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 16px rgba(217, 164, 65, 0.35));
    }

    50% {
        transform: scale(1.045);
        filter: drop-shadow(0 0 34px rgba(217, 164, 65, 0.65));
    }
}

@media (prefers-reduced-motion: reduce) {
    .welcome-logo img {
        animation: none;
    }
}

.welcome-inner h1 {
    font-size: clamp(2rem, 6.4vw, 3rem);
    line-height: 1.14;
    letter-spacing: -0.02em;
}

.welcome-inner h1 em {
    font-style: normal;
    color: var(--accent-glow);
}

.welcome-inner .sub {
    color: var(--paper-dim);
    font-size: 1rem;
    max-width: 42ch;
    line-height: 1.65;
    margin: 0.3rem 0 0.4rem;
}

.btn-primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent), var(--accent-glow));
    color: var(--accent-ink);
    border: none;
    border-radius: 999px;
    padding: 0.9rem 1.7rem;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 8px 24px rgba(217, 164, 65, 0.18);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(217, 164, 65, 0.3);
}

/* Shine sweep on hover */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -90%;
    width: 55%;
    height: 100%;
    background: rgba(255, 255, 255, 0.35);
    transform: skewX(-20deg);
    transition: left 0.55s ease;
    pointer-events: none;
}

.btn-primary:hover:not(:disabled)::after {
    left: 135%;
}

.btn-primary .arrow {
    transition: transform 0.2s ease;
}

.btn-primary:hover:not(:disabled) .arrow {
    transform: translateX(3px);
}

.btn-primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(217, 164, 65, 0.28);
}

.btn-primary:not(:disabled):hover .arrow {
    transform: translateX(3px);
}

.btn-ghost {
    background: none;
    border: 1px solid var(--line);
    color: var(--paper-dim);
    border-radius: 999px;
    padding: 0.72rem 1.4rem;
    font-size: 0.86rem;
    cursor: pointer;
    margin-top: 0.7rem;
    font-weight: 600;
}

.btn-ghost:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-ghost:not(:disabled):hover {
    color: var(--paper);
    border-color: rgba(var(--wash), 0.3);
}

.btn-ghost-outline {
    width: 100%;
    background: rgba(var(--wash), 0.03);
    border: 1px solid var(--line);
    color: var(--paper);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.6rem;
}

.btn-ghost-outline:hover {
    border-color: rgba(var(--wash), 0.3);
}

.btn-text {
    background: none;
    border: none;
    color: var(--paper-dim);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 0.5rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(var(--wash), 0.25);
}

.btn-text:hover {
    color: var(--paper);
}

.guest-continue-link {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0.3rem 0 0;
}

.btn-danger {
    color: #E39C8E;
    text-decoration-color: rgba(227, 156, 142, 0.4);
}

.btn-danger:hover {
    color: #F2B3A6;
}

.feature-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.6rem 1rem;
    margin: 2.2rem 0 1rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--line-soft);
}

@media (min-width:640px) {
    .feature-strip {
        grid-template-columns: repeat(4, 1fr);
    }
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.feature-icon {
    width: 26px;
    height: 26px;
    color: var(--accent-glow);
}

.feature-item h3 {
    font-size: 0.9rem;
    margin: 0;
}

.feature-item p {
    color: var(--paper-dim);
    font-size: 0.78rem;
    line-height: 1.5;
    margin: 0;
}

/* ---------------- option grids ---------------- */
.option-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.4rem;
}

.goals-grid {
    grid-template-columns: 1fr 1fr;
}

@media (min-width:900px) {
    .goals-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.mood-grid {
    grid-template-columns: 1fr 1fr;
}

@media (min-width:900px) {
    .mood-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.mood-grid .option-card {
    align-items: center;
    text-align: center;
    flex-direction: row;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
}

.mood-grid .option-card .opt-icon {
    font-size: 1.5rem;
}

.language-grid {
    grid-template-columns: 1fr 1fr;
}

@media (min-width:900px) {
    .language-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width:560px) {
    .option-grid:not(.goals-grid):not(.mood-grid) {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width:900px) {
    .option-grid:not(.goals-grid):not(.mood-grid) {
        grid-template-columns: repeat(3, 1fr);
    }
}

.option-card {
    background: rgba(var(--wash), 0.025);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
    animation: card-enter 0.4s ease both;
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option-card:nth-child(1) {
    animation-delay: 0ms;
}

.option-card:nth-child(2) {
    animation-delay: 40ms;
}

.option-card:nth-child(3) {
    animation-delay: 80ms;
}

.option-card:nth-child(4) {
    animation-delay: 120ms;
}

.option-card:nth-child(5) {
    animation-delay: 160ms;
}

.option-card:nth-child(6) {
    animation-delay: 200ms;
}

.option-card:nth-child(7) {
    animation-delay: 240ms;
}

.option-card:nth-child(8) {
    animation-delay: 280ms;
}

@media (prefers-reduced-motion: reduce) {
    .option-card {
        animation: none;
    }
}

.option-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--wash), 0.22);
}

.option-card .opt-icon {
    font-size: 1.3rem;
}

.option-card .opt-label {
    font-weight: 700;
    font-size: 0.92rem;
}

.option-card .opt-desc {
    color: var(--paper-dim);
    font-size: 0.74rem;
    line-height: 1.4;
}

.identity-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.identity-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--goal-color, var(--accent)) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--goal-color, var(--accent)) 35%, transparent);
    color: var(--paper);
}

.option-card.selected {
    border-color: var(--goal-color, var(--accent));
    background: color-mix(in srgb, var(--goal-color, var(--accent)) 14%, transparent);
    transform: translateY(-3px);
    box-shadow: 0 10px 26px color-mix(in srgb, var(--goal-color, var(--accent)) 22%, transparent);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.chip {
    background: rgba(var(--wash), 0.04);
    border: 1px solid var(--line);
    color: var(--paper-dim);
    border-radius: 999px;
    padding: 0.5rem 0.95rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.chip:hover {
    color: var(--paper);
    border-color: rgba(var(--wash), 0.3);
}

.chip.selected {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--paper);
}

/* ---------------- time slider ---------------- */
.time-slider-card {
    background: rgba(var(--wash), 0.03);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.4rem 1.3rem 1.1rem;
    margin-bottom: 1rem;
}

.time-slider-value {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    justify-content: center;
    margin-bottom: 0.9rem;
    font-family: var(--font-display);
}

#timeValueNum {
    font-size: 2.6rem;
    color: var(--accent-glow);
    font-weight: 600;
    line-height: 1;
}

.time-slider-unit {
    color: var(--paper-dim);
    font-size: 0.95rem;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-glow) var(--fill, 15%), rgba(var(--wash), 0.08) var(--fill, 15%));
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--paper);
    border: 3px solid var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--paper);
    border: 3px solid var(--accent);
    cursor: pointer;
}

.time-slider-ticks {
    display: flex;
    justify-content: space-between;
    color: var(--paper-dim);
    font-size: 0.72rem;
    margin-top: 0.5rem;
}

/* ---------------- path screen ---------------- */
.nova-card {
    background: rgba(var(--wash), 0.035);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
    line-height: 1.6;
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    animation: nova-float 5.5s ease-in-out infinite;
}

@keyframes nova-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nova-card {
        animation: none;
    }
}

.nova-card::before {
    content: '✦';
    color: var(--accent-glow);
    font-size: 1.1rem;
    flex: none;
    margin-top: 0.1rem;
}

.nova-note {
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-size: 0.84rem;
    line-height: 1.55;
    margin-bottom: 1.2rem;
    display: none;
    flex-direction: column;
    gap: 0.6rem;
}

.nova-note.visible {
    display: flex;
}

.nova-note button {
    align-self: flex-start;
    background: none;
    border: 1px solid var(--accent);
    color: var(--accent-glow);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.76rem;
    cursor: pointer;
    font-weight: 700;
}

.path-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.path-head h2 {
    flex: 1;
}

.path-count {
    color: var(--paper-dim);
    font-size: 0.8rem;
}

.path-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 1.2rem;
}

.activity-card {
    background: rgba(var(--wash), 0.03);
    border: 1px solid var(--line);
    border-left: 3px solid var(--goal-color);
    border-radius: 14px;
    padding: 0.95rem 1.05rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: opacity 0.3s ease;
}

.activity-card.completed {
    opacity: 0.55;
}

.activity-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.activity-icon {
    font-size: 1.35rem;
    flex: none;
}

.activity-body {
    flex: 1;
    min-width: 0;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--paper-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.activity-title {
    font-size: 0.94rem;
    font-weight: 700;
    margin-top: 0.15rem;
}

.activity-preview {
    font-size: 0.78rem;
    color: var(--paper-dim);
    margin-top: 0.3rem;
    line-height: 1.4;
}

.activity-actions {
    display: flex;
    gap: 0.5rem;
    flex: none;
}

.open-btn,
.complete-btn {
    flex: none;
    border-radius: 999px;
    padding: 0.42rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.open-btn {
    background: none;
    border: 1px solid var(--line);
    color: var(--paper-dim);
}

.swap-btn {
    background: none;
    border: 1px solid var(--line);
    color: var(--paper-dim);
    border-radius: 999px;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    font-size: 0.9rem;
    cursor: pointer;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .18s ease, transform .18s ease;
}

.swap-btn:hover {
    border-color: rgba(var(--wash), 0.3);
    transform: rotate(80deg);
}

.open-btn:hover {
    color: var(--paper);
    border-color: rgba(var(--wash), 0.3);
}

.complete-btn {
    background: none;
    border: 1px solid var(--goal-color);
    color: var(--goal-color);
}

.complete-btn:hover {
    background: var(--goal-color);
    color: var(--ink-1);
}

.complete-btn:disabled {
    opacity: 0.7;
    cursor: default;
    background: var(--goal-color);
    color: var(--ink-1);
}

/* ---------------- daily note (path screen) ---------------- */
.day-note-card {
    background: rgba(var(--wash), 0.03);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.2rem;
}

.day-note-card .profile-label {
    margin-top: 0;
    margin-bottom: 0.6rem;
}

.day-note-textarea {
    min-height: 80px;
}

/* ---------------- completion ---------------- */
.completion-inner {
    margin: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 2rem 0;
}

/* Brief celebration burst — fires once when a path is finished, then removes itself */
.celebrate-burst {
    position: fixed;
    top: 32%;
    left: 50%;
    z-index: 60;
    pointer-events: none;
}

.celebrate-particle {
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    opacity: 0;
    animation: celebrate-fly 1.1s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes celebrate-fly {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(var(--dx), var(--dy)) scale(0.4) rotate(200deg);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .celebrate-burst {
        display: none;
    }
}

.completion-logo {
    width: 46px;
    height: 46px;
    margin-bottom: 0.5rem;
}

.completion-inner h2 {
    font-size: 1.7rem;
}

.sub-italic {
    color: var(--paper-dim);
    font-style: italic;
    margin: 0.3rem 0 1rem;
}

.completion-stats {
    display: flex;
    gap: 1.4rem;
    margin-bottom: 1rem;
}

.completion-stats div {
    text-align: center;
}

.completion-stats .stat-num {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--accent-glow);
    display: block;
}

.completion-stats .stat-label {
    font-size: 0.7rem;
    color: var(--paper-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.finite-note {
    color: var(--paper-dim);
    font-size: 0.76rem;
    margin-top: 1.3rem;
    opacity: 0.75;
    max-width: 34ch;
}

/* ---------------- progress / dashboard ---------------- */
.growth-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.7rem;
    margin: 1rem 0 1.6rem;
}

.growth-stat {
    background: rgba(var(--wash), 0.03);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.85rem 0.6rem;
    text-align: center;
}

.growth-stat .num {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--accent-glow);
    display: block;
}

.growth-stat .lbl {
    font-size: 0.68rem;
    color: var(--paper-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.2rem;
}

.section-heading {
    font-size: 1.05rem;
    margin: 1.4rem 0 0.8rem;
}

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.4rem;
}

.dash-row {
    display: grid;
    grid-template-columns: 120px 1fr 60px;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
}

.dash-label {
    color: var(--paper-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-bar-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(var(--wash), 0.06);
    overflow: hidden;
}

.dash-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
}

.dash-value {
    text-align: right;
    color: var(--paper-dim);
    font-family: var(--font-display);
    font-size: 0.78rem;
}

.empty-note {
    color: var(--paper-dim);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem 0;
}

.tree-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

@media (min-width:560px) {
    .tree-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tree-card {
    background: rgba(var(--wash), 0.03);
    border: 1px solid var(--line);
    border-top: 3px solid var(--goal-color);
    border-radius: 14px;
    padding: 0.95rem 0.7rem;
    text-align: center;
}

.tree-emoji {
    font-size: 1.8rem;
}

.tree-goal {
    font-weight: 700;
    font-size: 0.82rem;
    margin-top: 0.35rem;
}

.tree-level {
    color: var(--paper-dim);
    font-size: 0.7rem;
    margin-top: 0.2rem;
}

.tree-identity {
    color: var(--paper-dim);
    opacity: 0.6;
    font-size: 0.64rem;
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid var(--line-soft);
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.badge-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--paper);
}

.progress-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin-top: 1.6rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line-soft);
}

/* ---------------- profile / account ---------------- */
#screen-profile {
    align-items: center;
    text-align: center;
}

.profile-logo {
    width: 120px;
    height: 120px;
    margin: 0.4rem auto 0.6rem;
}

.profile-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

#profileWelcomeBlock {
    margin-bottom: 2.9rem;
}

.profile-welcome-heading {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin: 0 0 0.35rem;
}

.profile-welcome-sub {
    color: var(--paper-dim);
    font-size: 0.82rem;
    max-width: 34ch;
    line-height: 1.5;
    margin: 0 auto;
}

#screen-profile .account-card,
#screen-profile .profile-form {
    width: 100%;
    max-width: 420px;
    text-align: left;
}

.account-card {
    background: rgba(var(--wash), 0.03);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1rem;
}

.google-btn-slot {
    min-height: 44px;
    display: flex;
    justify-content: center;
    margin-bottom: 0.3rem;
}

.password-field {
    position: relative;
    display: flex;
}

.password-field .profile-input {
    width: 100%;
    padding-right: 2.6rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--paper-dim);
    padding: 0.3rem;
    display: flex;
}

.password-toggle-btn:hover {
    color: var(--paper);
}

.password-toggle-btn svg {
    width: 18px;
    height: 18px;
}

.form-note {
    color: var(--paper-dim);
    font-size: 0.78rem;
    line-height: 1.55;
    margin: -0.2rem 0 0;
}

.form-note.form-error {
    color: #E39C8E;
}

.forgot-password-link {
    background: none;
    border: none;
    color: var(--paper-dim);
    font-size: 0.78rem;
    text-decoration: underline;
    text-decoration-color: rgba(169, 175, 158, 0.4);
    cursor: pointer;
    align-self: flex-end;
    padding: 0;
    margin-top: -0.2rem;
}

.forgot-password-link:hover {
    color: var(--paper);
}

.account-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--paper-dim);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1rem 0;
}

.account-divider::before,
.account-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.email-signin-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.email-signin-form .btn-primary {
    justify-content: center;
    margin-top: 0.3rem;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.profile-label {
    font-size: 0.72rem;
    color: var(--paper-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.7rem;
}

.profile-input {
    background: rgba(var(--wash), 0.04);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem 0.95rem;
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 0.92rem;
}

.profile-input:focus {
    outline: none;
    border-color: var(--accent);
}

.avatar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.avatar-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(var(--wash), 0.04);
    border: 1px solid var(--line);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.avatar-btn.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
}

.avatar-more-btn {
    height: 42px;
    padding: 0 0.85rem;
    border-radius: 12px;
    background: rgba(var(--wash), 0.03);
    border: 1px dashed var(--line);
    color: var(--paper-dim);
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.avatar-more-btn:hover {
    color: var(--paper);
    border-color: rgba(var(--wash), 0.3);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    margin-bottom: 1.1rem;
}

.avatar-upload-btn {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex: none;
    cursor: pointer;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    overflow: hidden;
    padding: 0;
}

.avatar-upload-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-edit-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--ink-1);
    font-size: 0.68rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--ink-2);
}

.profile-header-text {
    min-width: 0;
}

.change-photo-link {
    display: block;
    background: none;
    border: none;
    color: var(--accent-glow);
    font-size: 0.76rem;
    text-decoration: underline;
    text-decoration-color: rgba(240, 200, 120, 0.4);
    cursor: pointer;
    padding: 0;
    margin-top: 0.3rem;
}

.change-photo-link:hover {
    color: var(--paper);
}

.profile-name-display {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-email-display {
    color: var(--paper-dim);
    font-size: 0.78rem;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.growth-preview-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    text-align: left;
    background: linear-gradient(135deg, var(--accent-soft), rgba(var(--wash), 0.02));
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.2rem;
    cursor: pointer;
    color: var(--paper);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.45;
    transition: transform 0.18s ease;
}

.growth-preview-card:hover {
    transform: translateY(-2px);
}

.growth-preview-arrow {
    flex: none;
    color: var(--accent-glow);
    font-size: 1.1rem;
}

.profile-stats-row {
    margin: 0 0 1.1rem;
}

.profile-section-heading {
    margin-top: 0.4rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
}

.profile-account-card {
    margin-top: 1.1rem;
    margin-bottom: 0;
}

.profile-account-label {
    margin-top: 0;
}

.profile-account-card .profile-email-display {
    margin-bottom: 0.7rem;
}

.profile-account-card .btn-danger {
    padding-left: 0;
}

.profile-btn-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-stats {
    background: rgba(var(--wash), 0.03);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin: 0.6rem 0 0.2rem;
    font-size: 0.85rem;
    color: var(--paper-dim);
    line-height: 1.6;
}

.profile-stats b {
    color: var(--paper);
}

/* ---------------- growth calendar + milestone ---------------- */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(14, 1fr);
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}

@media (max-width:420px) {
    .cal-grid {
        grid-template-columns: repeat(10, 1fr);
    }
}

.cal-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    background: rgba(var(--wash), 0.06);
    display: block;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
}

.cal-cell.active {
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cal-cell.active:hover,
.cal-cell.active:focus-visible {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px var(--accent-glow);
    outline: none;
}

.milestone-note {
    color: var(--paper-dim);
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 0.9rem 0 0.3rem;
    padding-left: 0.9rem;
    border-left: 2px solid var(--accent);
}

/* ---------------- activity overlay ---------------- */
.overlay {
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--ink-1) 88%, transparent);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 50;
    padding: 0;
}

@media (min-width:640px) {
    .overlay {
        align-items: center;
        padding: 2rem;
    }
}

.overlay-panel {
    background: var(--ink-2);
    border: 1px solid var(--line);
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 22px 22px 0 0;
    padding: 1.6rem 1.5rem 2rem;
    position: relative;
    animation: panelIn 0.3s ease;
    transition: background-color 1.1s ease;
}

@media (min-width:640px) {
    .overlay-panel {
        border-radius: 22px;
    }
}

@keyframes panelIn {
    from {
        transform: translateY(24px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.overlay-close {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    background: rgba(var(--wash), 0.06);
    border: 1px solid var(--line);
    color: var(--paper-dim);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
}

.overlay-close:hover {
    color: var(--paper);
}

.od-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.68rem;
    color: var(--goal-color, var(--accent-glow));
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.od-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin-bottom: 0.7rem;
    padding-right: 2rem;
    line-height: 1.3;
}

.od-swap-btn {
    background: none;
    border: 1px solid var(--line);
    color: var(--paper-dim);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: border-color .18s ease, color .18s ease;
}

.od-swap-btn:hover {
    border-color: var(--goal-color, var(--accent));
    color: var(--paper);
}

.od-body {
    font-size: 0.92rem;
    line-height: 1.75;
    color: var(--paper);
}

.od-body p {
    margin-bottom: 0.9rem;
}

.od-body .od-source {
    color: var(--paper-dim);
    font-size: 0.78rem;
    font-style: italic;
}

.od-block {
    background: rgba(var(--wash), 0.03);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.od-block h4 {
    font-family: var(--font-body);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--paper-dim);
    margin: 0 0 0.6rem;
}

.od-ingredients {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.86rem;
}

.lang-word-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.lang-speak-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    margin-top: 0.1rem;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(var(--wash), 0.03);
    color: var(--accent-glow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.lang-speak-btn:hover {
    color: var(--paper);
    border-color: rgba(var(--wash), 0.3);
    transform: scale(1.08);
}

.lang-speak-btn svg {
    width: 15px;
    height: 15px;
}

.od-steps {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-size: 0.88rem;
    padding-left: 1.1rem;
    margin: 0;
}

.od-steps li {
    line-height: 1.55;
}

.od-embed-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 0.9rem;
    background: #000;
    border: 1px solid var(--line);
}

.od-embed-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.od-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    color: var(--paper);
    border-radius: 999px;
    padding: 0.6rem 1.1rem;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    margin: 0.2rem 0.4rem 0.2rem 0;
}

.od-link-btn:hover {
    background: var(--accent);
    color: var(--ink-1);
}

textarea.od-textarea {
    width: 100%;
    min-height: 100px;
    background: rgba(var(--wash), 0.04);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 0.88rem;
    padding: 0.8rem 0.9rem;
    resize: vertical;
}

textarea.od-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.od-palette {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.od-swatch {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    border: 1px solid rgba(var(--wash), 0.15);
    position: relative;
    cursor: pointer;
}

.od-swatch .hex {
    position: absolute;
    bottom: -1.3rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: var(--paper-dim);
    white-space: nowrap;
}

.od-code-box {
    width: 100%;
    min-height: 90px;
    background: #0A0E0A;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: #D9E8D5;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    padding: 0.9rem;
    resize: vertical;
}

.od-run-btn {
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 0.7rem;
}

.od-check-result {
    margin-top: 0.7rem;
    font-size: 0.85rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    display: none;
}

.od-check-result.pass {
    display: block;
    background: rgba(95, 169, 160, 0.14);
    border: 1px solid #5FA9A0;
    color: #B9E4DD;
}

.od-check-result.fail {
    display: block;
    background: rgba(217, 122, 92, 0.12);
    border: 1px solid #D97A5C;
    color: #F2C6B8;
}

.od-feedback-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-glow));
    color: var(--accent-ink);
    border: none;
    border-radius: 999px;
    padding: 0.7rem 1.3rem;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 0.7rem;
}

.od-feedback-out {
    margin-top: 0.9rem;
}

.od-feedback-out ul {
    margin: 0.4rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.85rem;
    line-height: 1.6;
}

.od-complete-btn {
    width: 100%;
    margin-top: 1rem;
    background: none;
    border: 1.5px solid var(--goal-color, var(--accent));
    color: var(--paper);
    border-radius: 999px;
    padding: 0.85rem;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
}

.od-complete-btn:hover {
    background: var(--goal-color, var(--accent));
    color: var(--ink-1);
}

.od-complete-btn:disabled {
    background: var(--goal-color, var(--accent));
    color: var(--ink-1);
    opacity: 0.8;
    cursor: default;
}

/* ---------------- footer ---------------- */
.site-footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--paper-dim);
    font-size: 0.75rem;
    padding: 1.4rem;
    border-top: 1px solid var(--line-soft);
}

.site-footer img {
    width: 16px;
    height: 16px;
    display: block;
    object-fit: contain;
}

::selection {
    background: var(--accent-soft);
}

/* =========================================================
   RTL (Arabic) — scoped entirely to [dir="rtl"], set only when
   Arabic is the active language. English/Spanish/French are
   untouched by anything below. Flexbox rows already reverse
   automatically under dir="rtl" (native browser behavior), so
   this only needs to override the handful of rules that set a
   literal text-align:left or a directional icon, neither of
   which flips on their own.
========================================================= */
[dir="rtl"] {
    text-align: right;
}

@media (min-width:760px) {
    [dir="rtl"] .welcome-inner {
        text-align: right;
    }
}

[dir="rtl"] .option-card {
    text-align: right;
}

[dir="rtl"] #screen-profile .account-card,
[dir="rtl"] #screen-profile .profile-form {
    text-align: right;
}

[dir="rtl"] .growth-preview-card {
    text-align: right;
}

[dir="rtl"] .profile-account-card .btn-danger {
    padding-left: 0.5rem;
    padding-right: 0;
}

/* Back-chevron points the other way — "back" reads toward the right in RTL */
[dir="rtl"] .step-back-btn svg {
    transform: scaleX(-1);
}

/* Forward-motion arrows (→) flip so they still point toward "next" */
[dir="rtl"] .btn-primary .arrow,
[dir="rtl"] .growth-preview-arrow {
    display: inline-block;
    transform: scaleX(-1);
}