/* ============================================================================
   AIAY web app (/<lang>/app/) - web version of the mobile screens
   AR_04 Today's sign, AR_05 Explore, AR_06 Nature sound player.
   Mobile-first; on wide screens the app sits in a centred phone-width column.

   Colours: every value reads a variable. Defaults are the mobile app's
   AiAY Original light tokens (aiay_mobile constants/MoodThemes.ts), so the
   web looks like the app; a chosen mood (api/themes.py ->
   partials/mood_theme.html) overrides the --color-* / --aiay-* variables
   these fall back from.
   ============================================================================ */

:root {
    --app-canvas: var(--color-canvas, #FAF8F5);            /* background */
    --app-ink: var(--color-text-dark, #311E13);            /* text */
    --app-muted: var(--color-text-light, #8B7569);         /* textMuted */
    --app-accent: var(--color-primary, #C96F4A);           /* primary (accent role) */
    --app-deep: var(--aiay-button-primary, #53321D);       /* buttonPrimary */
    --app-on-deep: var(--aiay-on-button-primary, #FFFFFF);
    --app-soft: var(--aiay-topic-card-selected, #FBE8DB);  /* topicCardSelected */
    --app-search: var(--color-accent-soft, #F7EFE7);       /* highlight on background */
    --app-track: var(--color-bg-light, #E7DDD6);           /* border */
    --app-surface: var(--color-surface, #FFFFFF);          /* surface */
    --app-accent-dark: var(--color-accent-dark, #53321D);  /* accentDark */
    --app-sand: var(--aiay-button-secondary, #F4E8D4);     /* buttonSecondary */
    --app-on-sand: var(--aiay-on-button-secondary, #53321D);
    --app-on-soft: var(--aiay-on-topic-card, #53321D);
    --app-gold: var(--color-accent, #F4E8D4);              /* highlight / heroAccent */
    --app-shade: rgba(15, 14, 12, 0.2);
    --app-photo-label: rgba(49, 30, 19, 0.68);
    --app-photo-tint: rgba(49, 30, 19, 0.17);
    --app-on-photo: #FFFFFF;
    --app-nav-h: 86px;
    --app-page-top: calc(16px + env(safe-area-inset-top));
    --app-ease: cubic-bezier(.2, .8, .2, 1);
    /* Glyphs use the app's AiAY Original tokens (components/AiAYGlyphs.tsx:
       buttonPrimary, primary, buttonSecondary, border, accent), so icons look
       the same on web and mobile; other moods set these in api/themes.py. */
    --glyph-deep: #53321D;
    --glyph-accent: #C96F4A;
    --glyph-inlay: #F4E8D4;
    --glyph-rim: #E7DDD6;
    --glyph-gold: #C96F4A;
    /* Figma icon set (templates/app/_icon.html), same roles as the mobile
       components/AiAYIcon.tsx; moods override the --glyph-* they read. */
    --icon-deep: var(--glyph-deep);
    --icon-accent: var(--glyph-accent);
    --icon-canvas: var(--app-canvas);
    --icon-cream: var(--glyph-inlay);
    --icon-gold: var(--icon-gold-tone, #E8CE80);
    --icon-rim: var(--glyph-rim);
    --icon-soft: var(--app-search);
    --icon-on-photo: var(--app-on-photo);
    --icon-ink: var(--app-ink);
    --icon-muted: var(--app-muted);
}
.aiay-icon { display: inline-block; flex: none; vertical-align: middle; }
.mood-card.is-selected .aiay-icon { --icon-deep: var(--app-accent); }
.aiay-icon--photo { --icon-deep: var(--app-on-photo); --icon-accent: var(--app-on-photo); }

/* The shared components (static/css/components.css) default to the staff
   dashboard's palette; web app pages use the app's AiAY Original instead.
   html:root outranks that file's :root and still yields to a mood's :root:root. */
/* Dark appearance (AR_52's switch): the colours come from api/themes.py dark_css_vars() */
html[data-theme='dark'] { color-scheme: dark; }

html:root {
    --aiay-button-primary: #53321D;
    --aiay-on-button-primary: #FFFFFF;
    --aiay-button-secondary: #F4E8D4;
    --aiay-on-button-secondary: #53321D;
    --aiay-topic-card: #FFFFFF;
    --aiay-topic-card-selected: #FBE8DB;
    --aiay-on-topic-card: #53321D;
    --aiay-focus-ring: rgba(83, 50, 29, 0.35);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body.app {
    background: var(--app-canvas);
    color: var(--app-ink);
    font-family: var(--app-font);
    -webkit-font-smoothing: antialiased;
}

html[dir='rtl'] body.app { font-family: var(--app-font-ar); }

/* Bold display text uses Alexandria in Arabic, as the AR frames do */
html[dir='rtl'] .page-title,
html[dir='rtl'] .sign-headline,
html[dir='rtl'] .track-title,
html[dir='rtl'] .eyebrow,
html[dir='rtl'] .tile__label,
html[dir='rtl'] .ar-screen,
html[dir='rtl'] .ar-nav__item.is-active { font-family: var(--app-font-ar); }

a { color: inherit; }

.app-shell {
    position: relative;
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--app-canvas);
    padding-bottom: calc(var(--app-nav-h) + env(safe-area-inset-bottom));
    /* Height left for a page once the shell has reserved the bottom nav:
       "fill the screen" rules use this instead of 100vh, so no page scrolls
       into empty canvas below its content. */
    --app-free-h: calc(100vh - var(--app-nav-h) - env(safe-area-inset-bottom));
}
@supports (height: 100dvh) {
    .app-shell { --app-free-h: calc(100dvh - var(--app-nav-h) - env(safe-area-inset-bottom)); }
}
/* No bottom nav on the page (sign-in, setup, player...): nothing to reserve. */
.app-shell:not(:has(> .ar-nav)), .page-player .app-shell { padding-bottom: 0; --app-free-h: 100vh; }
@supports (height: 100dvh) {
    .app-shell:not(:has(> .ar-nav)), .page-player .app-shell { --app-free-h: 100dvh; }
}

@media (min-width: 600px) {
    body.app { background: var(--app-track); }
    .app-shell { box-shadow: 0 0 60px rgba(0, 0, 0, 0.08); }
}

/* ------------------------------------------------------------- page bits */
.page { padding: var(--app-page-top) 18px 18px; }

.page-title { margin: 0; font-size: 31px; line-height: 1.32; font-weight: 700; color: var(--app-ink); }

.page-lead { margin: 6px 0 0; font-size: 13px; line-height: 1.32; color: var(--app-muted); }

.section-label {
    margin: 28px 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--app-accent);
}

.empty { margin: 8px 0 0; font-size: 13px; color: var(--app-muted); }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--app-muted);
    text-decoration: none;
}
.back-link svg { width: 20px; height: 20px; }

html[dir='rtl'] .flip-rtl { transform: scaleX(-1); }

/* -------------------------------------------------------------- icons */
.stroke { fill: none; stroke: var(--app-deep); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stroke--thick { stroke-width: 2.2; }
.fill { fill: var(--app-deep); }
.accent-dot { fill: var(--app-accent); }
.heart { fill: var(--app-deep); }

/* ------------------------------------------------------- photo hero */
.hero {
    position: relative;
    height: 480px;
    overflow: hidden;
    background: var(--app-track);
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--hero) center / cover no-repeat;
    animation: hero-drift 24s ease-in-out infinite alternate;
}
.hero--player { height: 520px; }

/* Soft scrim behind the back / heart icons: fades out under them instead of
   ending in a hard band edge (the web has no status bar for a band to cover). */
.hero__tint {
    position: absolute;
    inset: 0 0 auto;
    height: calc(104px + env(safe-area-inset-top));
    background: linear-gradient(to bottom, rgba(49, 30, 19, 0.30), rgba(49, 30, 19, 0.12) 55%, transparent);
    pointer-events: none;
}
.hero__tint--dark { background: linear-gradient(to bottom, rgba(15, 14, 12, 0.42), var(--app-photo-tint) 55%, transparent); }

.hero__bar {
    position: absolute;
    top: calc(18px + env(safe-area-inset-top));
    left: 18px;
    right: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: ltr; /* back on the left, heart on the right in both languages (AR frames) */
}
.hero__bar form { margin: 0; }
.hero__bar--mirror { direction: inherit; }

.icon-btn {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
}
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn--on-photo { color: var(--app-on-photo); filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25)); }
.icon-btn:active svg { transform: scale(0.88); }

/* ---------------------------------------------------- rounded sheet */
.sheet {
    position: relative;
    margin-top: -33px;
    padding: 30px 28px 32px;
    background: var(--app-canvas);
    border-radius: 25px 25px 0 0;
    text-align: center;
    animation: sheet-rise 520ms var(--app-ease) both;
}
.sheet--cream { background: var(--app-gold); border-radius: 26px 26px 0 0; }
.sheet--player { margin-top: -40px; padding-top: 22px; border-radius: 26px 26px 0 0; }

.sparkle { display: inline-flex; width: 28px; height: 28px; }
.sparkle__outer { fill: var(--app-deep); }
.sparkle__inner { fill: var(--app-canvas); }
.sparkle__dot { fill: var(--app-accent); }
.sparkle { animation: twinkle 3.6s ease-in-out infinite; }

.eyebrow { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--app-accent); }
.sheet--player .eyebrow { font-size: 12px; margin-top: 0; }

.sign-headline { margin: 14px 0 0; font-size: 25px; line-height: 1.32; font-weight: 700; color: var(--app-ink); }
.sign-headline--today { margin-top: 17px; font-family: var(--app-font-serif); font-weight: 500; font-size: 30px; line-height: 36px; }
html[dir='rtl'] .sign-headline--today { font-family: var(--app-font-ar); font-weight: 700; font-size: 28px; }
.sign-headline--today + .sign-body { margin-top: 10px; line-height: 19px; }
.track-title { margin: 6px 0 0; font-size: 27px; line-height: 1.32; font-weight: 700; color: var(--app-ink); }
.sign-body { margin: 14px 0 0; font-size: 14px; line-height: 1.5; color: var(--app-muted); }

.why { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 32px auto 0; max-width: 310px; font-size: 13px; color: var(--app-muted); }
.why a { color: var(--app-accent); font-weight: 500; text-decoration: none; }
.why a:hover, .why a:focus-visible { text-decoration: underline; }

.actions { display: flex; justify-content: center; gap: 4px; margin-top: 30px; }
.actions form, .player-extras form { margin: 0; }

.action {
    display: inline-flex;
    width: 80px;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: var(--app-deep);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 160ms var(--app-ease);
}
.action svg { width: 23px; height: 23px; }
.action:active { transform: scale(0.94); }
.action:disabled { opacity: 0.45; cursor: not-allowed; }
/* Favourite (like / unlike) hearts: the Figma outline until saved, then Figma favourite-active pops in */
.fav-ico { display: inline-flex; }
.fav-ico--on, .is-on .fav-ico--off { display: none; }
.is-on .fav-ico--on { display: inline-flex; animation: pop 320ms var(--app-ease); }
.action.is-on { color: var(--app-deep); }
#timer.is-on, #listen-btn[aria-pressed='true'] { color: var(--app-accent); }
#timer.is-on .g-ds, #listen-btn[aria-pressed='true'] .g-ds { stroke: var(--glyph-accent); }
#listen-btn[aria-pressed='true'] .g-d { fill: var(--glyph-accent); }
#listen-btn[aria-pressed='true'] svg { animation: pulse 1.4s ease-in-out infinite; }

/* -------------------------------------------------------- explore */
.search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    height: 49px;
    padding: 0 15px;
    border-radius: 14px;
    background: var(--app-search);
}
.search svg { flex: 0 0 20px; width: 20px; height: 20px; }
.search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    color: var(--app-ink);
    outline: none;
}
.search input::placeholder { color: var(--app-muted); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 10px; margin-top: 23px; direction: ltr; } /* Nature stays top-left (AR_05) */
.tile__label { direction: rtl; }
html[dir='ltr'] .tile__label { direction: ltr; }

.tile {
    position: relative;
    display: block;
    height: 142px;
    overflow: hidden;
    border-radius: 16px;
    background: var(--app-track) var(--cover) center / cover no-repeat;
    text-decoration: none;
    transform: translateZ(0);
}
.tile::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0); transition: background 200ms ease; }
.tile:hover::after { background: rgba(0, 0, 0, 0.06); }
.tile:active { transform: scale(0.97); transition: transform 120ms ease; }
.tile--in { animation: fade-up 480ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 60ms + 120ms); }

.tile__label {
    position: absolute;
    inset: auto 0 0;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    background: var(--app-photo-label);
    color: var(--app-on-photo);
    font-size: 13px;
    font-weight: 700;
}

/* ------------------------------------------------------- sound list */
.sound-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.sound-list li { animation: fade-up 420ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 50ms); }

.sound-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border-radius: 16px;
    background: var(--app-surface);
    text-decoration: none;
    transition: transform 140ms ease;
}
.sound-row:active { transform: scale(0.98); }
.sound-row__cover { flex: 0 0 64px; height: 64px; border-radius: 12px; background: var(--app-track) var(--cover) center / cover; }
.sound-row__text { flex: 1; min-width: 0; display: grid; gap: 4px; }
.sound-row__title { font-size: 15px; font-weight: 700; color: var(--app-ink); }
.sound-row__meta { font-size: 12px; color: var(--app-muted); }
.sound-row__play { flex: 0 0 22px; width: 22px; height: 22px; color: var(--app-accent); }

/* ----------------------------------------------------------- player */
.progress { margin: 34px 12px 0; direction: ltr; } /* fills left to right in both languages (AR_06) */
.progress input[type='range'] {
    --pct: 0%;
    width: 100%;
    height: 14px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.progress input[type='range']::-webkit-slider-runnable-track {
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(to right, var(--app-accent) var(--pct), var(--app-track) var(--pct));
}
html[dir='rtl'] .progress input[type='range']::-webkit-slider-runnable-track {
    background: linear-gradient(to left, var(--app-accent) var(--pct), var(--app-track) var(--pct));
}
.progress input[type='range']::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -5.5px;
    border-radius: 50%;
    background: var(--app-accent);
    transition: transform 160ms ease;
}
.progress input[type='range']:active::-webkit-slider-thumb { transform: scale(1.25); }
.progress input[type='range']::-moz-range-track { height: 3px; border-radius: 2px; background: var(--app-track); }
.progress input[type='range']::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--app-accent); }
.progress input[type='range']::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--app-accent); }
.progress input[type='range']:disabled { cursor: not-allowed; opacity: 0.6; }
.progress__times { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; font-weight: 500; color: var(--app-muted); direction: ltr; }

.transport { display: flex; align-items: center; justify-content: center; gap: 38px; margin-top: 18px; direction: ltr; }
.transport__btn { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; text-decoration: none; }
.transport__btn svg { width: 28px; height: 28px; }
.transport__btn.is-disabled { opacity: 0.3; }

.play {
    position: relative;
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 32px;
    background: var(--app-deep);
    color: var(--app-on-deep);
    cursor: pointer;
    transition: transform 160ms var(--app-ease), box-shadow 200ms ease;
}
.play:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16); }
.play:active { transform: scale(0.94); }
.play:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.play__icon { position: absolute; inset: 0; display: block; margin: auto; width: 25px; height: 25px; transition: opacity 180ms ease, transform 180ms ease; }
.play__icon--pause { opacity: 0; transform: scale(0.7); }
.play.is-playing .play__icon--play { opacity: 0; transform: scale(0.7); }
.play.is-playing .play__icon--pause { opacity: 1; transform: scale(1); }
.play.is-playing::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--app-deep);
    opacity: 0;
    animation: ripple 2.4s ease-out infinite;
}

.note { margin: 14px 0 0; font-size: 12px; color: var(--app-muted); }

.player-extras { display: flex; justify-content: space-between; gap: 0; margin: 24px -10px 0; direction: ltr; } /* Timer, Mix, Download, More in both languages (frames) */
.player-extras .action span { direction: rtl; }
html[dir='ltr'] .player-extras .action span { direction: ltr; }
.player-extras .action { width: 85px; gap: 8px; font-size: 12px; color: var(--app-ink); text-decoration: none; }
.player-extras .action svg { width: 23px; height: 23px; }
.player-extras .action.is-on { color: var(--app-accent); }

/* ------------------------------------------------- favourites / me */
.saved-signs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.saved-sign {
    padding: 16px;
    border-radius: 16px;
    background: var(--app-surface);
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 50ms);
}
.saved-sign__headline { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--app-ink); }
.saved-sign__body { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--app-muted); }
.saved-sign__meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 11px; color: var(--app-muted); }
.saved-sign__meta form { margin: 0; }
.link-btn { padding: 0; border: 0; background: none; font: inherit; color: var(--app-accent); cursor: pointer; }

.profile-card { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 16px; border-radius: 18px; background: var(--app-surface); }
.profile-card__avatar {
    display: inline-flex;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--app-soft);
    color: var(--app-deep);
    font-size: 20px;
    font-weight: 700;
}
.profile-card__name { margin: 0; font-size: 16px; font-weight: 700; }
.profile-card__email { margin: 2px 0 0; font-size: 12px; color: var(--app-muted); }
/* Guests: "Create account" on Me and Saved (mobile ConvertGuestScreen) */
.guest-link-action { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--app-deep); text-decoration: underline; }
.guest-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 18px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--app-soft); font-size: 13px; line-height: 18px; color: var(--app-on-soft); }
.guest-note .guest-link-action { margin-top: 0; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 14px; background: var(--app-search); }
.segmented__item {
    padding: 10px;
    border-radius: 11px;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--app-muted);
    transition: background 200ms ease, color 200ms ease;
}
.segmented__item.is-active { background: var(--app-surface); color: var(--app-deep); }

.stack { display: grid; gap: 12px; margin-top: 28px; }

/* ------------------------------------------------------- mini player (mobile AiAYMiniPlayer) */
.mini-player {
    position: fixed;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 11;
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 32px);
    max-width: 398px;
    padding: 8px 10px;
    border: 1px solid var(--app-track);
    border-radius: 16px;
    background: var(--app-surface);
    box-shadow: 0 4px 14px var(--app-shade);
    transform: translateX(-50%);
    animation: mini-rise 320ms var(--app-ease) both;
}
.mini-player[hidden] { display: none; }
/* Room for the bar under the last section */
/* The shell already reserves the nav; the main only adds the mini player's bar. */
.has-mini-player .app-main { padding-bottom: 72px; }
.has-mini-player .app-shell { --app-free-h: calc(100dvh - var(--app-nav-h) - env(safe-area-inset-bottom) - 72px); }
.has-mini-player .app-shell:not(:has(> .ar-nav)) { --app-free-h: calc(100dvh - 72px); }
.mini-player--over-nav { bottom: calc(var(--app-nav-h) + 10px + env(safe-area-inset-bottom)); }
.mini-player__open { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; color: var(--app-ink); text-decoration: none; }
.mini-player__logo { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--app-accent-dark); overflow: hidden; }
.mini-player__logo img { width: 30px; height: 30px; object-fit: contain; }
.mini-player__title { overflow: hidden; font-size: 15px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.mini-player__play {
    position: relative;
    flex: none;
    width: 36px;
    height: 36px;
    border: 2px solid var(--app-track);
    border-radius: 18px;
    background: var(--app-deep);
    color: var(--app-on-deep);
    cursor: pointer;
}
.mini-player__play .play__icon { width: 16px; height: 16px; }
.mini-player__play.is-playing .play__icon--play { opacity: 0; transform: scale(0.7); }
.mini-player__play.is-playing .play__icon--pause { opacity: 1; transform: scale(1); }
.mini-player__close { display: grid; flex: none; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: none; color: var(--app-muted); cursor: pointer; }
.mini-player__play:active, .mini-player__close:active { transform: scale(0.94); }
@keyframes mini-rise { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
.mini-player--steady { animation: none; }
@media (prefers-reduced-motion: reduce) { .mini-player { animation: none; } }

/* ------------------------------------------------------- bottom nav (AR_03) */
.ar-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    max-width: 430px;
    height: calc(var(--app-nav-h) + env(safe-area-inset-bottom));
    padding: 12px 17px env(safe-area-inset-bottom);
    background: var(--app-surface);
    border-top: 1px solid var(--app-track);
    transform: translateX(-50%);
    direction: ltr; /* Home stays on the left in Arabic too (AR frames) */
}
.ar-nav__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: start;
    justify-self: center;
    gap: 7px;
    width: 60px;
    height: 57px;
    padding-top: 8px;
    border-radius: 14px;
    font-size: 10px;
    line-height: 13px;
    color: var(--app-muted);
    text-decoration: none;
    transition: background 240ms ease, color 240ms ease, transform 240ms var(--app-ease);
}
.ar-nav__item.is-active { background: var(--app-soft); color: var(--app-deep); font-weight: 700; }
.ar-nav__item.is-active .g-home { fill: var(--glyph-accent); }
.nav-ico { display: inline-flex; }
.nav-ico--on, .ar-nav__item.is-active .nav-ico--off { display: none; }
.ar-nav__item.is-active .nav-ico--on { display: inline-flex; }
.ar-nav__item.is-active .glyph--nav-explore .g-ds { stroke: var(--glyph-accent); }
.ar-nav__item.is-active .glyph--nav-explore .g-d { fill: var(--glyph-accent); }
.ar-nav__item.is-active .glyph--nav-explore .g-a { fill: var(--glyph-gold); }
.ar-nav__item:active { transform: scale(0.94); }

/* ------------------------------------------------------- motion */
.fade-up { animation: fade-up 480ms var(--app-ease) both; }
.fade-up--2 { animation-delay: 80ms; }
.fade-up--3 { animation-delay: 160ms; }
.fade-up--4 { animation-delay: 240ms; }

@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-rise { from { transform: translateY(40px); } to { transform: none; } }
@keyframes hero-drift { from { transform: scale(1.02); } to { transform: scale(1.09); } }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.08) rotate(8deg); } }
@keyframes pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes ripple { 0% { opacity: 0.35; transform: scale(1); } 100% { opacity: 0; transform: scale(1.35); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------- first-run setup (AR_07-10) */
.setup { padding-top: var(--app-page-top); padding-bottom: 32px; min-height: var(--app-free-h); display: flex; flex-direction: column; }
.back-link--icon { width: 36px; height: 36px; margin: 0 -8px 0; justify-content: center; color: var(--app-deep); }
.back-link--icon svg { width: 21px; height: 21px; }
.back-spacer { display: block; height: 36px; }

.steps-dots { display: flex; gap: 6px; margin-top: 18px; }
.steps-dots span { width: 18px; height: 4px; border-radius: 2px; background: var(--app-track); transition: background 300ms ease, width 300ms var(--app-ease); }
.steps-dots span.is-done { width: 28px; background: var(--app-accent); }

.setup-heading { margin: 10px 0 0; font-size: 25px; line-height: 1.33; font-weight: 700; color: var(--app-ink); }
html[dir='rtl'] .setup-heading { font-family: var(--app-font-ar); }
.setup-sub { margin: 10px 0 0; font-size: 13px; line-height: 1.33; color: var(--app-muted); }
.setup .setup-heading { margin-top: 22px; }
.setup .setup-sub { margin-top: 38px; line-height: 18px; }
.setup-skip { position: absolute; top: calc(var(--app-page-top) + 4px); inset-inline-end: 24px; min-width: 66px; padding: 4px 0; border: 0; background: none; font: inherit; font-size: 13px; line-height: 20px; color: var(--app-deep); cursor: pointer; }
.setup { position: relative; }

.choices { display: flex; flex-direction: column; gap: 26px; margin-top: 53px; }

.choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    padding: 0 14px;
    border: 1px solid var(--app-track);
    border-radius: 20px;
    background: var(--app-gold);
    cursor: pointer;
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 60ms + 120ms);
    transition: background 220ms ease, border-color 220ms ease, transform 160ms ease;
}
.choice:active { transform: scale(0.985); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:focus-within { box-shadow: 0 0 0 3px var(--aiay-focus-ring); }
.choice.is-selected { background: var(--app-gold); }
.choice.is-selected .aiay-icon--todays-sign-default { --icon-deep: var(--glyph-accent); --icon-accent: var(--glyph-deep); }

.choice__icon {
    display: inline-flex;
    flex: 0 0 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--app-search);
    transition: background 220ms ease;
}
.choice.is-selected .choice__icon { background: var(--app-surface); animation: pop 320ms var(--app-ease); }
.choice__icon svg { width: 20px; height: 20px; }

.choice__title { flex: 1; font-size: 15px; line-height: 1.33; font-weight: 500; color: var(--app-deep); }
.choice.is-selected .choice__title { font-weight: 700; }
html[dir='rtl'] .choice__title { font-family: var(--app-font-ar); }

.choice__dot {
    position: absolute;
    top: 9px;
    inset-inline-end: 15px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--app-accent);
    transform: scale(0);
    transition: transform 260ms var(--app-ease);
}
.choice.is-selected .choice__dot { transform: scale(1); }

/* row icons: default / selected (the sparkle swaps to the accent fill) */
.ic-line { fill: none; stroke: var(--app-deep); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ic-fill { fill: var(--app-deep); }
.ic-accent { fill: var(--app-accent); }
.ic-ring { fill: none; stroke: var(--app-accent); stroke-width: 1.6; }
.ic-star { fill: var(--app-deep); transition: fill 220ms ease; }
.ic-star-inner { fill: var(--app-canvas); }
.ic-star-dot { fill: var(--app-accent); transition: fill 220ms ease; }
.choice.is-selected .ic-star { fill: var(--app-accent); }
.choice.is-selected .ic-star-dot { fill: var(--app-deep); }

.setup-note { margin: 0; padding-top: 24px; font-size: 12px; line-height: 1.33; color: var(--app-muted); text-align: center; }
.breath-finish { display: block; margin: 14px auto 0; padding: 4px; font-size: 13px; color: var(--app-deep); }
.setup-cta { margin-top: 28px; height: 52px; border-radius: 26px; font-size: 15px; }

/* Gender: three tall photo cards (Figma 03 Gender Optional) */
.choices--cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 88px; }
.choices--cards .setup-note, .choices--cards .setup-cta { grid-column: 1 / -1; }
.choices--cards .choice { flex-direction: column; justify-content: flex-start; height: 268px; padding: 102px 6px 0; gap: 14px; overflow: hidden;
    background: var(--card-photo) center / cover; }
.choices--cards .choice::before { content: ''; position: absolute; inset: 0; background: color-mix(in srgb, var(--app-canvas) 60%, transparent); }
.choices--cards .choice > * { position: relative; }
.choices--cards .choice.is-selected { background: var(--card-photo) center / cover; border: 1.5px solid var(--app-deep); }
.choices--cards .choice__icon, .choices--cards .choice.is-selected .choice__icon { flex: none; width: 40px; height: 40px; background: none; animation: none; }
.choices--cards .choice__icon svg { width: 40px; height: 40px; }
.choices--cards .choice__title { flex: none; font-family: var(--app-font-serif); font-weight: 500; font-size: 21px; line-height: 27px; text-align: center; }
html[dir='rtl'] .choices--cards .choice__title { font-family: var(--app-font-ar); font-size: 15px; line-height: 24px; }
.choices--cards .choice__dot { position: absolute; top: 14px; inset-inline-end: 12px; }

/* AR_10 first sign */
.hero--first { height: 533px; }
.hero__tint--light { background: linear-gradient(to bottom, color-mix(in srgb, var(--app-sand) 35%, transparent), transparent); }
.sheet--first { margin-top: -18px; padding: 21px 24px 32px; border-radius: 24px 24px 0 0; }
.first-title { margin-top: 17px; font-size: 26px; }
.first-desc { margin-top: 18px; font-size: 15px; }
.first-secondary { margin: 34px 0 0; font-size: 14px; color: var(--app-deep); }
.first-cta { margin-top: 30px; height: 52px; border-radius: 17px; }

.pref-list { display: grid; gap: 8px; }
.pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 0 16px;
    border-radius: 15px;
    background: var(--app-surface);
    color: var(--app-deep);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: transform 140ms ease;
}
.pref-row:active { transform: scale(0.985); }
.pref-row svg { width: 18px; height: 18px; color: var(--app-muted); }

/* EN: icon tile left, dot top-right; the AR frames mirror it (the page's
   direction does that: icon at the start, dot at the inline end). */
html[dir='rtl'] .choice { text-align: right; }
html[dir='ltr'] .choice__dot { inset-inline-end: auto; left: 15px; }
.setup .back-link--icon,
.setup .back-spacer { align-self: flex-start; }
html[dir='rtl'] .setup .back-link--icon,
html[dir='rtl'] .setup .back-spacer { align-self: flex-end; }

/* =========================================================== home & flow */
.wordmark { display: inline-flex; align-items: center; gap: 6px; color: var(--app-ink); font-weight: 800; font-size: 20px; letter-spacing: 2.5px; }
.wordmark svg { width: 18px; height: 18px; fill: var(--app-accent); }

/* 03.02 Welcome */
.welcome { display: flex; flex-direction: column; min-height: var(--app-free-h); padding-top: var(--app-page-top); }
.editorial-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    min-height: 260px;
    max-height: 340px;
    flex: 1;
    overflow: hidden;
    border-radius: 28px;
    background: var(--color-accent, #D9C28A);
}
.editorial-star { width: 38px; height: 38px; fill: var(--app-accent); animation: breathe-spin 6s ease-in-out infinite; }
.twinkle { position: absolute; fill: var(--app-accent); animation: twinkle-fade 3.6s ease-in-out infinite; }
.twinkle--top { width: 11px; height: 11px; top: calc(50% - 44px); inset-inline-end: calc(50% - 44px); }
.twinkle--bottom { width: 8px; height: 8px; bottom: calc(50% - 38px); inset-inline-start: calc(50% - 38px); animation-delay: 1.8s; }
.ripple {
    position: absolute;
    width: 56px;
    height: 56px;
    border: 1.5px solid var(--app-accent);
    border-radius: 50%;
    opacity: 0;
    animation: ripple-out 3.6s ease-out infinite;
}
.ripple--late { animation-delay: 1.8s; }
.welcome-heading { margin: 28px 0 0; font-size: 30px; line-height: 41px; font-weight: 600; letter-spacing: -0.3px; color: var(--app-ink); }
.welcome-lead { margin: 12px 0 0; font-size: 15px; line-height: 20px; color: var(--app-muted); }
.welcome-actions { display: grid; gap: 16px; margin-top: 24px; }
.signin-prompt { margin: 0; font-size: 13px; font-weight: 700; color: var(--app-muted); }
.signin-prompt a { color: var(--app-deep); text-decoration: none; }

/* Topics */
.topics-form { display: flex; flex: 1; flex-direction: column; margin-top: 28px; }
.topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.topic-choice { animation: fade-up 420ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 45ms + 120ms); }
.topic-choice input { position: absolute; opacity: 0; pointer-events: none; }
.topic-choice:focus-within { box-shadow: 0 0 0 3px var(--aiay-focus-ring); }
.topic-choice.is-selected { background: var(--aiay-topic-card-selected); }
.ti-line { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ti-fill { fill: currentColor; }
.aiay-topic-card__icon svg { width: 28px; height: 28px; }
.topics-count { margin: 18px 0 0; font-size: 12px; font-weight: 700; color: var(--app-accent); }
.setup-cta:disabled { opacity: 0.45; cursor: not-allowed; }

/* Account / sign in / register */
.account-mark { display: inline-flex; width: 56px; height: 56px; margin-top: 24px; align-items: center; justify-content: center; border-radius: 18px; background: var(--app-soft); }
.account-mark svg { width: 26px; height: 26px; fill: var(--app-accent); animation: breathe-spin 6s ease-in-out infinite; }
.account-actions { display: grid; gap: 12px; padding-top: 24px; }
.guest-link { display: block; width: 100%; padding: 10px; font-weight: 700; color: var(--app-muted); text-align: center; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--app-deep); }
.field input, .field textarea {
    width: 100%;
    min-height: 52px;
    padding: 12px 16px;
    border: 1px solid var(--app-track);
    border-radius: 14px;
    background: var(--app-surface);
    font: inherit;
    font-weight: 400;
    font-size: 15px;
    color: var(--app-ink);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus { border-color: var(--app-accent); box-shadow: 0 0 0 3px var(--aiay-focus-ring); }
.field-hint { font-weight: 400; color: var(--app-muted); }
.field-error, .form-error { color: var(--color-danger, #B3261E); font-weight: 500; font-size: 12px; }
.form-error { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--app-soft); }

/* AR_11 Create account / AR_12 Login / forgot password (app/_auth_base.html,
   mobile components/AiAYAuthForm.tsx) */
.auth-form { display: flex; flex: 1; flex-direction: column; margin-top: 7px; }
.auth .setup-sub { margin-top: 10px; }
.auth-form .form-error, .form-notice { animation: fade-up 260ms var(--app-ease) both; }
.form-notice { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--app-soft); color: var(--app-deep); font-size: 12px; font-weight: 500; }
.auth-fields { display: grid; gap: 14px; margin-top: 36px; }
.auth-field { display: grid; gap: 8px; animation: fade-up 420ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 70ms + 120ms); }
.auth-field > span { padding: 0 4px; font-size: 13px; line-height: 1.33; font-weight: 700; color: var(--app-deep); }
html[dir='rtl'] .auth-field > span { font-family: var(--app-font-ar); }
.auth-field input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--app-search);
    font: inherit;
    font-size: 15px;
    color: var(--app-ink);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
.auth-field input:focus { border-color: var(--app-accent); background: var(--app-surface); box-shadow: 0 0 0 3px var(--aiay-focus-ring); }
.auth-field.has-error input { border-color: var(--color-danger, #B3261E); }
.auth-field .field-error, .auth-field .field-hint { padding: 0 4px; font-size: 12px; }
.auth-field input.auth-field__code { height: 65px; font-size: 24px; font-weight: 700; letter-spacing: 10px; text-align: center; direction: ltr; }
/* AR_14: dashes in the label's place light up as digits go in. */
.code-slots { display: flex; height: 17px; align-items: center; gap: 10px; }
.code-slots i { width: 9px; height: 2px; border-radius: 1px; background: var(--app-deep); transition: width 200ms var(--app-ease), height 200ms var(--app-ease), background-color 200ms ease; }
.code-slots i.is-filled { width: 12px; height: 3px; background: var(--app-accent); }
.auth-note .link-btn { color: inherit; font-size: inherit; transition: color 160ms ease; }
.auth-note .link-btn:hover, .auth-note .link-btn:focus-visible { color: var(--app-deep); }
.auth-footer { display: flex; flex-direction: column; }
.auth-note { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding-top: 16px; }
.auth-note a { color: inherit; text-decoration: none; transition: color 160ms ease; }
.auth-note a:hover, .auth-note a:focus-visible { color: var(--app-deep); }
.auth-note__gap { width: 32px; }
.auth .setup-cta { margin-top: 20px; }

/* Home (mobile DashboardScreen) */
.home { padding-top: var(--app-page-top); }
.home-header { display: flex; align-items: center; justify-content: space-between; }
.ar-home__inbox { position: absolute; top: calc(14px + env(safe-area-inset-top)); inset-inline-end: 14px; z-index: 2; background: rgba(0, 0, 0, 0.22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade-in 500ms 300ms both; }
.ar-home__badge { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--app-deep); color: var(--app-on-photo); font-size: 9px; font-weight: 700; line-height: 16px; text-align: center; }
.avatar {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-accent, #D9C28A);
    color: var(--app-ink);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: transform 160ms ease;
}
.avatar:active { transform: scale(0.94); }
.date-kicker { margin: 28px 0 0; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--app-accent); }
html[dir='rtl'] .date-kicker { letter-spacing: 0; }
.home-heading { margin: 8px 0 0; font-size: 26px; line-height: 1.32; font-weight: 600; color: var(--app-ink); }

.sign-card {
    position: relative;
    margin-top: 22px;
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--app-deep), var(--color-secondary, #936036));
    color: var(--app-on-deep);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}
.sign-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sign-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 99px;
    background: var(--app-soft);
    color: var(--app-deep);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
}
.sign-pill svg { width: 12px; height: 12px; fill: currentColor; }
.sign-card__spark { display: inline-flex; padding: 4px; border: 0; background: none; cursor: pointer; }
.sign-card__spark svg { width: 26px; height: 26px; fill: var(--app-on-deep); animation: soft-pulse 3.4s ease-in-out infinite; }
.sign-card__text { margin: 18px 0 0; font-size: 22px; line-height: 1.45; font-weight: 600; white-space: pre-line; }
.sign-card__text.is-long { font-size: 17px; }
.sign-card__sub { margin: 14px 0 0; font-size: 13px; line-height: 1.5; opacity: 0.82; }
.sign-card__why { display: inline-block; margin-top: 14px; font-size: 11px; font-weight: 700; letter-spacing: 0.6px; color: var(--app-gold); text-decoration: none; }
.sign-card__why:hover { text-decoration: underline; }
.sign-feedback { margin-top: 16px; animation: fade-in 260ms ease both; }
.sign-feedback p { margin: 0; font-size: 12px; font-weight: 500; }
.sign-feedback__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sign-feedback__chips form { margin: 0; }
.chip {
    height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 17px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease;
}
.chip.is-on { background: var(--app-canvas); color: var(--app-deep); font-weight: 700; border-color: transparent; }

.sign-card--loading { display: flex; min-height: 200px; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.sign-card--loading p { margin: 0; font-size: 14px; opacity: 0.9; }
.spinner { width: 32px; height: 32px; border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: var(--app-on-deep); border-radius: 50%; animation: aiay-spin 0.9s linear infinite; }
.sign-card--loading.is-failed .spinner { display: none; }

.empty-card { margin-top: 22px; padding: 24px; border-radius: 20px; background: var(--app-surface); text-align: center; }
.empty-card__title { margin: 0; font-size: 18px; font-weight: 700; color: var(--app-ink); }
.empty-card__body { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--app-muted); }

.home-actions { display: flex; gap: 10px; margin-top: 16px; }
.home-actions form { flex: 0 0 auto; margin: 0; }
.home-action {
    display: inline-flex;
    height: 50px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 0;
    border-radius: 16px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms var(--app-ease), filter 160ms ease;
}
.home-action:active { transform: scale(0.96); }
.home-action--primary { flex: 1; background: var(--app-deep); color: var(--app-on-deep); }
.home-action--secondary { background: var(--aiay-button-secondary); color: var(--aiay-on-button-secondary); }
.home-action svg { width: 18px; height: 18px; }
.home-action .heart { fill: transparent; stroke: currentColor; stroke-width: 1.8; transition: fill 220ms ease; }
.home-action.is-on .heart { fill: var(--app-accent); stroke: var(--app-accent); animation: pop 320ms var(--app-ease); }

.check-in-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 65px;
    margin-top: 22px;
    padding: 16px;
    border-radius: 20px;
    background: var(--color-accent, #D9C28A);
    text-decoration: none;
    transition: transform 160ms ease;
}
.check-in-row:active { transform: scale(0.985); }
.check-in-row > span:first-child { display: grid; gap: 3px; }
.check-in-row__title { font-size: 14px; font-weight: 700; color: var(--app-ink); }
.check-in-row__sub { font-size: 11px; color: var(--app-deep); opacity: 0.8; }
.check-in-row__mood { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--app-deep); }
.check-in-row__mood svg { width: 16px; height: 16px; }

/* AR_16 Daily check-in (mobile screens/DailyCheckInScreen.tsx) */
.check-in { padding-inline: 20px; }
.check-in .back-link--icon, .check-in .setup-heading, .check-in .setup-sub { margin-inline: 4px; }
.mood-form { display: flex; flex: 1; flex-direction: column; margin-top: 48px; }
/* The AR frame keeps calm top-left in both languages. */
.mood-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 23px 15px; direction: ltr; }
.mood-card {
    position: relative;
    display: flex;
    height: 123px;
    flex-direction: column;
    align-items: center;
    padding-top: 23px;
    border-radius: 20px;
    background: var(--app-search);
    color: var(--app-deep);
    cursor: pointer;
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 60ms + 120ms);
    transition: background-color 220ms ease, transform 160ms ease;
}
.mood-card input { position: absolute; opacity: 0; pointer-events: none; }
.mood-card:active { transform: scale(0.96); }
.mood-card:focus-within { box-shadow: 0 0 0 3px var(--aiay-focus-ring); }
.mood-card.is-selected { background: var(--app-soft); }
.mood-card.is-selected .mood-face { color: var(--app-accent); animation: pop 360ms var(--app-ease); }
.mood-face { width: 34px; height: 34px; transition: color 220ms ease; }
.mood-card__name { margin-top: 27px; padding: 0 6px; font-size: 13px; line-height: 1.33; font-weight: 700; color: var(--app-on-soft); text-align: center; }
html[dir='rtl'] .mood-card__name, html[dir='rtl'] .mood-context { font-family: var(--app-font-ar); direction: rtl; }
.mood-context {
    min-height: 100px;
    margin: 51px 4px 40px;
    padding: 20px 22px;
    border-radius: 18px;
    background: var(--app-sand);
    color: var(--app-on-sand);
    font-size: 14px;
    line-height: 1.33;
    text-align: center;
}
.mood-cta { margin: 24px 4px 0; }
.mood-cta:disabled { opacity: 0.45; cursor: not-allowed; }
/* AR_30 "My feeling today": 24px gutters, outlined white cards, a privacy card. */
.check-in--mood { padding-inline: 24px; }
.check-in--mood .back-link--icon, .check-in--mood .setup-heading, .check-in--mood .setup-sub,
.check-in--mood .mood-context, .check-in--mood .mood-cta { margin-inline: 0; }
.check-in--mood .setup-sub { margin-top: 12px; }
.check-in--mood .mood-form { margin-top: 69px; }
.check-in--mood .mood-grid { gap: 18px 11px; }
.check-in--mood .mood-card { height: 122px; padding-top: 21px; border: 1px solid var(--app-track); border-radius: 16px; background: var(--app-surface); }
.check-in--mood .mood-card.is-selected { background: var(--app-soft); }
.check-in--mood .mood-card.is-selected .mood-face { color: var(--app-deep); }
.check-in--mood .mood-face { width: 31px; height: 31px; }
.check-in--mood .mood-card__name { margin-top: 32px; color: var(--app-deep); }
.check-in--mood .mood-context { min-height: 103px; padding: 26px 24px 20px; border: 1px solid var(--app-track); border-radius: 16px; background: var(--app-surface); color: var(--app-muted); font-size: 13px; }

/* AR_15 Account ready (mobile screens/AccountReadyScreen.tsx) */
.hero--ready { height: 450px; }
.sheet--ready { display: flex; min-height: calc(var(--app-free-h) - 422px); flex-direction: column; align-items: center; margin-top: -28px; padding: 18px 24px 32px; border-radius: 24px 24px 0 0; }
.ready-mark { display: inline-flex; width: 56px; height: 56px; align-items: center; justify-content: center; border-radius: 50%; background: var(--app-accent); animation: pop 520ms var(--app-ease) 360ms both; }
.ready-title { margin-top: 21px; font-size: 26px; }
.ready-desc { margin-top: 12px; font-size: 15px; line-height: 1.33; }
.ready-items { display: grid; gap: 21px; width: 100%; margin: 40px 0 32px; padding: 0 19px; list-style: none; }
.ready-items li { display: flex; align-items: center; gap: 12px; animation: fade-up 420ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 90ms + 560ms); }
/* Tick on the left in both languages (EN/AR frames). */
html[dir='rtl'] .ready-items li { flex-direction: row-reverse; }
.ready-items li span { flex: 1; }
.ready-items li span { font-size: 13px; line-height: 1.33; font-weight: 500; color: var(--app-deep); text-align: start; }
.ready-cta { margin-top: 24px; height: 52px; border-radius: 17px; font-size: 15px; }

@keyframes breathe-spin { 0%, 100% { transform: scale(0.9) rotate(0); } 50% { transform: scale(1.12) rotate(45deg); } }
@keyframes twinkle-fade { 0%, 100% { opacity: 0.25; transform: scale(0.7); } 50% { opacity: 0.9; transform: scale(1.1); } }
@keyframes ripple-out { 0% { opacity: 0; transform: scale(0.5); } 15% { opacity: 0.45; } 100% { opacity: 0; transform: scale(2.6); } }
@keyframes soft-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* ============================================================================
   AR_01 Welcome, AR_02 Life areas, AR_03 Home - web mirrors of the mobile
   WelcomeScreen / TopicsScreen / DashboardScreen. Every colour is a variable.
   ============================================================================ */

/* two-tone glyphs (templates/app/_glyph.html) */
.glyph { flex: none; display: block; }
.glyph .g-d { fill: var(--glyph-deep); }
.glyph .g-a { fill: var(--glyph-accent); }
.glyph .g-c { fill: var(--app-canvas); }
.glyph .g-s { fill: var(--glyph-inlay); }
.glyph .g-gold { fill: var(--glyph-gold); }
.glyph .g-rim { stroke: var(--glyph-rim); }
.glyph .g-ds, .glyph .g-as, .glyph .g-on { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.glyph .g-ds { stroke: var(--glyph-deep); }
.glyph .g-as { stroke: var(--glyph-accent); }
.glyph .g-on { stroke: var(--app-on-deep); }
.glyph .g-on-fill { fill: var(--app-on-deep); }
.glyph--photo .g-d, .glyph--photo .g-a { fill: var(--app-on-photo); }
.glyph--photo .g-ds, .glyph--photo .g-as { stroke: var(--app-on-photo); }
html[dir='ltr'] .flip-ltr { transform: scaleX(-1); }

.ar-screen { position: relative; min-height: var(--app-free-h); text-align: start; }
.ar-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: photo-drift 2400ms cubic-bezier(.2, .7, .2, 1) both;
}
.ar-breathe { display: inline-flex; animation: soft-pulse 3.4s ease-in-out infinite; }

/* Button / Primary as drawn in the AR frames */
.ar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 16px;
    background: var(--app-deep);
    color: var(--app-on-deep);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms var(--app-ease), opacity 160ms ease;
}
.ar-btn:active { transform: scale(0.98); }
.ar-btn:disabled { opacity: 0.45; cursor: default; }
.ar-btn--compact { height: 44px; border-radius: 13px; }
.ar-btn:focus-visible, .ar-area-card:focus-within, .ar-nav__item:focus-visible { outline: 3px solid var(--aiay-focus-ring, var(--app-accent)); outline-offset: 2px; }

/* ------------------------------------------------- 02 Splash (SplashScreen.tsx) */
/* Reuses the AR_01 Welcome layout; the CTA follows the title */
.ar-splash { min-height: 100vh; min-height: 100dvh; }
.ar-splash__cta { width: 100%; max-width: 342px; padding-top: 32px; }

/* ----------------------------------------------------------- AR_01 */
.page-ar-welcome .app-shell { padding-bottom: 0; --app-free-h: 100vh; }
.ar-welcome { display: flex; flex-direction: column; }
.ar-welcome__hero { position: relative; height: min(64vh, 536px); overflow: hidden; }
.ar-welcome__overlay {
    position: absolute;
    inset: 0 0 auto;
    height: 110px;
    background: color-mix(in srgb, var(--app-sand) 20%, transparent);
}
.ar-welcome__brand {
    position: absolute;
    top: 140px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: fade-up 650ms var(--app-ease) both;
}
.ar-welcome__wordmark {
    font-family: var(--app-font-serif);
    font-weight: 500;
    font-size: 32px;
    line-height: 39px;
    color: var(--app-deep);
}
.ar-welcome__panel {
    position: relative;
    flex: 1;
    margin-top: -22px;
    padding: 35px 24px calc(28px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 26px 26px 0 0;
    background: var(--app-gold);
    text-align: center;
    animation: panel-rise 650ms 150ms var(--app-ease) both;
}
.ar-welcome__title { max-width: 322px; margin: 0; font-family: var(--app-font-serif); font-size: 30px; line-height: 36px; font-weight: 500; color: var(--app-ink); white-space: pre-line; }
html[dir='rtl'] .ar-welcome__title { font-family: var(--app-font-ar); font-weight: 700; line-height: 34px; }
.ar-welcome__body { max-width: 316px; margin: 35px 0 0; font-size: 14px; line-height: 19px; color: var(--app-muted); }
html[dir='rtl'] .ar-welcome__body { line-height: 24px; }
.ar-dots { display: flex; gap: 7px; margin: 24px 0 19px; }
.ar-dots span { width: 7px; height: 5px; border-radius: 4px; background: var(--app-track); }
.ar-dots .ar-dots__active { width: 24px; background: var(--app-accent); animation: dot-grow 500ms 650ms var(--app-ease) both; }
.ar-welcome__sign-in { margin: 14px 0 0; font-size: 13px; color: var(--app-muted); }
.ar-welcome__sign-in a { font-weight: 700; color: var(--app-deep); }

/* ----------------------------------------------------------- AR_02 */
.page-ar-areas .app-shell { padding-bottom: 0; --app-free-h: 100vh; }
.ar-areas { display: flex; flex-direction: column; padding: var(--app-page-top) 18px calc(24px + env(safe-area-inset-bottom)); }
.ar-back { display: inline-flex; align-self: flex-start; color: var(--app-deep); }
.ar-areas__title { margin: 16px 0 0; font-size: 26px; line-height: 34px; font-weight: 700; color: var(--app-ink); }
.ar-areas__sub { margin: 7px 0 0; font-size: 14px; line-height: 19px; color: var(--app-muted); }
.ar-areas__form { display: flex; flex: 1; flex-direction: column; }
.ar-areas__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px 12px; margin-top: 35px; }
.ar-area-card {
    position: relative;
    height: 113px;
    border: 1px solid var(--app-track);
    border-radius: 17px;
    background: var(--app-surface);
    cursor: pointer;
    user-select: none;
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 60ms + 120ms);
    transition: background 220ms ease, transform 160ms var(--app-ease);
}
.ar-area-card:active { transform: scale(0.97); }
.ar-area-card.is-selected { background: var(--app-soft); }
.ar-area-card input { position: absolute; opacity: 0; pointer-events: none; }
.ar-area-card__icon { position: absolute; top: 17px; left: 50%; transform: translateX(-50%); }
.ar-area-card__text {
    position: absolute;
    top: 69px;
    left: 9px;
    right: 9px;
    font-size: 14px;
    line-height: 18px;
    font-weight: 700;
    text-align: center;
    color: var(--app-on-soft);
}
/* The AR frame puts the check top-right; English mirrors it. */
.ar-area-card__check {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 200ms ease, transform 320ms cubic-bezier(.3, 1.6, .5, 1);
}
html[dir='rtl'] .ar-area-card__check { left: auto; right: 10px; }
.ar-area-card.is-selected .ar-area-card__check { opacity: 1; transform: none; }
.ar-areas__note { margin: 0; padding-top: 24px; font-size: 12px; line-height: 16px; text-align: center; color: var(--app-muted); }
.ar-areas .ar-btn { margin-top: 52px; }

/* ----------------------------------------------------------- AR_03 */
.ar-home__hero { position: relative; height: 344px; overflow: hidden; }
.ar-home__tint { position: absolute; inset: 0 0 auto; height: 100px; background: color-mix(in srgb, var(--app-sand) 13%, transparent); }
.ar-home__body { position: relative; margin-top: -65px; padding: 0 23px 24px; }

.ar-sign-card {
    display: flex;
    flex-direction: column;
    padding: 14px 19px 16px;
    border: 1px solid var(--app-track);
    border-radius: 22px;
    background: var(--app-surface);
}
.ar-sign-card__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ar-sign-card__eyebrow { font-size: 12px; line-height: 16px; font-weight: 700; color: var(--app-accent); }
.ar-sign-card__headline { margin: 14px 0 18px; font-size: 21px; line-height: 28px; font-weight: 700; color: var(--app-ink); }
/* English sign headline: Cormorant 27/30; Arabic keeps Alexandria Bold 21/28 */
html:not([dir='rtl']) .t-serif-sign { font-family: var(--app-font-serif); font-weight: 500; font-size: 27px; line-height: 30px; }
.ar-sign-card__note { margin: -12px 0 18px; font-size: 13px; line-height: 18px; color: var(--app-muted); }
.ar-sign-card .ar-btn { margin-top: -2px; }
#sign-loading { display: inline-block; animation: soft-pulse 1.6s var(--app-ease) infinite; }

.ar-mood-card {
    display: flex;
    align-items: flex-start;
    gap: 17px;
    margin-top: 17px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--app-search);
    text-decoration: none;
    transition: transform 160ms var(--app-ease);
}
.ar-mood-card:active { transform: scale(0.98); }
.ar-mood-card__icon { flex: none; padding-top: 7px; }
html[dir='rtl'] .ar-mood-card { flex-direction: row-reverse; }
.ar-mood-card__text { flex: 1; display: flex; flex-direction: column; gap: 13px; }
.ar-mood-card__title { font-size: 17px; line-height: 22px; font-weight: 700; color: var(--app-ink); }
.ar-mood-card__desc { font-size: 12px; line-height: 16px; color: var(--app-muted); }
.ar-mood-card__mood { font-size: 13px; line-height: 17px; font-weight: 700; color: var(--app-accent); }

.ar-quick-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 12px; }
.ar-quick-title { margin: 0; font-size: 17px; line-height: 22px; font-weight: 700; color: var(--app-ink); }
.ar-quick-link { flex: none; font-size: 11.5px; line-height: 14px; font-weight: 700; color: var(--app-accent); text-decoration: none; }
.ar-quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; direction: ltr; }
html[dir='rtl'] .ar-quick-card__label { direction: rtl; text-align: right; }
.ar-quick-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 63px;
    padding: 14px 16px;
    border-radius: 14px;
    text-decoration: none;
    transition: transform 160ms var(--app-ease);
}
.ar-quick-card:active { transform: scale(0.97); }
.ar-quick-card__label { flex: 1; align-self: flex-start; font-size: 12px; line-height: 16px; font-weight: 700; }
.ar-quick-card--nature { background: var(--app-sand); color: var(--app-on-sand); }
.ar-quick-card--reflect { background: var(--app-soft); color: var(--app-on-soft); }

.fade-up--5 { animation-delay: 320ms; }

@keyframes photo-drift { from { transform: scale(1.07); } to { transform: none; } }
@keyframes panel-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes dot-grow { from { width: 7px; } to { width: 24px; } }

@media (prefers-reduced-motion: reduce) {
    .ar-photo, .ar-breathe, .ar-welcome__brand, .ar-welcome__panel, .ar-dots__active,
    .ar-area-card, #sign-loading { animation: none; }
}

/* AR_17 Why did this sign appear? (mobile screens/WhySignScreen.tsx) */
.hero--why { height: 273px; }
.hero__back { position: absolute; top: 56px; left: 18px; z-index: 1; }
.sheet--why { display: flex; min-height: calc(var(--app-free-h) - 251px); flex-direction: column; margin-top: -22px; padding: 26px 24px 32px; border-radius: 22px 22px 0 0; text-align: start; }
.why-title { margin: 0; font-size: 25px; line-height: 1.33; font-weight: 700; color: var(--app-ink); }
.why-lead { margin: 25px 0 0; font-size: 13px; line-height: 18px; color: var(--app-muted); }
.why-items { display: grid; gap: 13px; margin: 55px 0 0; padding: 0; list-style: none; }
.why-item {
    display: flex;
    align-items: flex-start; /* icon on the left in both languages (EN/AR frames) */
    gap: 12px;
    min-height: 93px;
    padding: 19px 17px 16px 16px;
    border-radius: 16px;
    background: var(--app-search);
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 90ms + 300ms);
}
html[dir='rtl'] .why-item { flex-direction: row-reverse; }
.why-item--plain { background: var(--app-surface); }
.why-item .glyph, .why-item .aiay-icon { flex: none; margin-top: 1px; }
.why-item__body { flex: 1; }
.why-item__text { margin: 0; font-size: 14px; line-height: 1.33; font-weight: 500; color: var(--app-deep); }
.why-item__detail { margin: 8px 0 0; font-size: 12px; line-height: 1.33; color: var(--app-muted); }
.why-footer { padding-top: 15px; }
.why-note { margin: 0; font-size: 12px; line-height: 1.33; color: var(--app-muted); text-align: center; }
.why-cta { margin-top: 22px; height: 52px; border-radius: 17px; font-size: 15px; }

/* AR_18 More signs like this (mobile screens/MoreSignsScreen.tsx) */
.more-list { display: grid; gap: 11px; margin: 43px 0 32px; padding: 0; list-style: none; }
.more-row {
    display: flex;
    gap: 11px; /* photo on the left in both languages (EN/AR frames) */
    min-height: 105px;
    padding: 8px;
    border: 1px solid var(--app-track);
    border-radius: 16px;
    background: var(--app-canvas);
    color: inherit;
    text-decoration: none;
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 70ms + 120ms);
    transition: transform 160ms ease, border-color 200ms ease;
}
.more-row:hover { border-color: var(--app-accent); }
html[dir='rtl'] .more-row { flex-direction: row-reverse; }
.more-row:active { transform: scale(0.98); }
.more-row img { width: 96px; height: 87px; flex: none; border-radius: 11px; object-fit: cover; background: var(--app-track); transition: transform 300ms var(--app-ease); }
.more-row:hover img { transform: scale(1.03); }
.more-row__text { display: flex; flex: 1; flex-direction: column; justify-content: space-between; padding: 10px 8px 4px; }
.more-row__title { margin: 0; font-size: 14px; line-height: 1.33; font-weight: 700; color: var(--app-deep); }
.more-row__meta { margin: 12px 0 0; font-size: 11px; line-height: 1.33; color: var(--app-muted); }
.more-empty { margin: 43px 0 32px; font-size: 13px; line-height: 1.5; color: var(--app-muted); text-align: center; }
.more-list + .setup-cta, .more-empty + .setup-cta { margin-top: 24px; }
html[dir='rtl'] .why-title, html[dir='rtl'] .more-row__title { font-family: var(--app-font-ar); }

/* AR_20 My sign preferences (mobile screens/SignPreferencesScreen.tsx) */
.prefs-form { display: flex; flex: 1; flex-direction: column; }
.prefs-rows { display: grid; gap: 16px; margin-top: 44px; }
.prefs-row {
    display: block;
    border: 1px solid var(--app-track);
    border-radius: 15px;
    background: var(--app-surface);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 60ms + 120ms);
    transition: transform 160ms ease, border-color 200ms ease;
}
.prefs-row:active { transform: scale(0.985); }
.prefs-row:hover, .prefs-row:focus-within { border-color: var(--app-accent); }
a.prefs-row, .prefs-row > summary, .prefs-row--toggle {
    display: flex;
    align-items: center; /* icon tile on the left in both languages (EN/AR frames) */
    gap: 12px;
    padding: 13px 16px 13px 14px;
}
html[dir='rtl'] a.prefs-row, html[dir='rtl'] .prefs-row > summary, html[dir='rtl'] .prefs-row--toggle { flex-direction: row-reverse; }
.prefs-row > summary { list-style: none; }
.prefs-row > summary::-webkit-details-marker { display: none; }
.prefs-row--toggle input { position: absolute; opacity: 0; pointer-events: none; }
.prefs-row__icon { display: inline-flex; width: 38px; height: 38px; flex: none; align-items: center; justify-content: center; border-radius: 12px; background: var(--app-search); transition: background-color 200ms ease; }
.prefs-row--toggle input:checked ~ .prefs-row__icon { background: var(--app-soft); }
.prefs-row__text { display: flex; flex: 1; flex-direction: column; gap: 2px; }
.prefs-row__title { font-size: 15px; line-height: 1.33; font-weight: 500; color: var(--app-deep); }
.prefs-row__detail { font-size: 12px; line-height: 1.33; color: var(--app-muted); }
.prefs-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 14px; animation: fade-up 260ms var(--app-ease) both; }
.prefs-chip { position: relative; cursor: pointer; }
.prefs-chip input { position: absolute; opacity: 0; pointer-events: none; }
.prefs-chip span { display: inline-block; padding: 8px 14px; border: 1px solid var(--app-track); border-radius: 18px; background: var(--app-canvas); font-size: 13px; font-weight: 500; color: var(--app-deep); transition: background-color 200ms ease, border-color 200ms ease; }
.prefs-chip input:checked + span { border-color: var(--app-accent); background: var(--app-soft); font-weight: 700; }
.prefs-chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--aiay-focus-ring); }
.prefs-footer { padding-top: 22px; }
.prefs-cta { margin-top: 27px; }
html[dir='rtl'] .prefs-row__title { font-family: var(--app-font-ar); }

/* AR_21 A moment of reflection (mobile screens/GuidedReflectionScreen.tsx) */
.reflection-form { display: flex; flex: 1; flex-direction: column; }
.reflection-prompt { display: flex; min-height: 135px; flex-direction: column; margin-top: 49px; padding: 20px 16px 22px; border-radius: 19px; background: var(--app-sand); }
.reflection-prompt__icon { align-self: flex-start; animation: twinkle 3.6s ease-in-out infinite; } /* top-left in both languages (EN/AR frames) */
html[dir='rtl'] .reflection-prompt__icon { align-self: flex-end; } /* flex-end is the left edge in RTL */
/* 02 Reflection prompt: bordered prompt and field, pill button (03 My journal keeps soft fills) */
.setup .setup-heading.t-serif + .setup-sub { margin-top: 38px; }
.reflection-form--reflection .reflection-prompt { border: 1px solid var(--app-track); border-radius: 20px; }
.reflection-form--reflection .reflection-entry { border-color: var(--app-track); border-radius: 20px; background: var(--app-canvas); }
.reflection-form--reflection .setup-cta { border-radius: 26px; }
.reflection-form--journal .setup-cta { border-radius: 17px; }
.reflection-prompt__question { margin: 20px 0 0; font-size: 18px; line-height: 1.33; font-weight: 700; color: var(--app-ink); transition: opacity 140ms ease; }
.reflection-prompt__question.is-swapping { opacity: 0; }
html[dir='rtl'] .reflection-prompt__question { font-family: var(--app-font-ar); }
.reflection-form .form-error { margin-top: 16px; }
.reflection-entry {
    height: 237px;
    margin-top: 20px;
    padding: 20px 19px 16px;
    border: 1px solid transparent;
    border-radius: 19px;
    background: var(--app-search);
    font: inherit;
    font-size: 14px;
    line-height: 1.36;
    color: var(--app-ink);
    resize: none;
    outline: none;
    transition: border-color 200ms ease, background-color 200ms ease;
}
.reflection-entry::placeholder { color: var(--app-muted); }
.reflection-entry:focus { border-color: var(--app-accent); }
.reflection-helpers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 21px 6px 0; font-size: 12px; line-height: 1.33; color: var(--app-muted); text-align: center; }
.reflection-helper { color: var(--app-muted); font-weight: 500; font-size: 12px; transition: color 160ms ease; }
.reflection-helper:hover, .reflection-helper.is-active { color: var(--app-deep); }
.reflection-helpers { margin-bottom: 20px; }
/* The CTA follows the helpers instead of sinking to the bottom of the page. */
.reflection-cta { margin-top: 0; }

/* AR_22 My reflections - earlier entries under the composer */
.reflection-form .form-notice { margin-top: 16px; }
.journal-list { display: grid; gap: 11px; margin-top: 36px; }
.journal-list__title { margin: 0; font-size: 15px; line-height: 1.33; font-weight: 700; color: var(--app-ink); }
.journal-item {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--app-track);
    border-radius: 16px;
    color: inherit;
    text-decoration: none;
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(min(var(--i, 0), 6) * 60ms + 300ms);
    transition: transform 160ms ease, border-color 200ms ease;
}
.journal-item:hover { border-color: var(--app-accent); }
.journal-item:active { transform: scale(0.985); }
.journal-item__question { overflow: hidden; font-size: 14px; font-weight: 700; color: var(--app-deep); white-space: nowrap; text-overflow: ellipsis; }
.journal-item__text { display: -webkit-box; overflow: hidden; font-size: 13px; line-height: 1.4; color: var(--app-ink); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.journal-item__date { font-size: 11px; color: var(--app-muted); }
html[dir='rtl'] .journal-list__title, html[dir='rtl'] .journal-item__question { font-family: var(--app-font-ar); }

/* AR_23 Journal entry - delete / export under the note */
.entry-links { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--app-muted); }
.entry-links form { margin: 0; }
.entry-links .link-btn { color: var(--app-deep); font-size: 12px; text-decoration: underline; }

/* AR_24 A small step today (mobile screens/SmallActionScreen.tsx) */
.small-action-form { display: flex; flex: 1; flex-direction: column; }
.small-action-photo { height: 170px; margin-top: 33px; overflow: hidden; border-radius: 18px; background: var(--app-track); }
.small-action-photo img { width: 100%; height: 100%; object-fit: cover; animation: photo-drift 1.2s var(--app-ease) both; }
.small-action-form .form-error { margin-top: 16px; }
.small-steps { display: grid; gap: 12px; margin-top: 17px; }
.small-step {
    position: relative;
    display: flex;
    align-items: center; /* ring on the left in both languages (EN/AR frames) */
    gap: 13px;
    min-height: 68px;
    padding: 14px 17px 14px 14px;
    border: 1px solid var(--app-track);
    border-radius: 20px;
    background: var(--app-gold);
    cursor: pointer;
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 70ms + 220ms);
    transition: background-color 220ms ease, transform 160ms ease;
}
html[dir='rtl'] .small-step { flex-direction: row-reverse; }
.small-step:active { transform: scale(0.985); }
.small-step:focus-within { box-shadow: 0 0 0 3px var(--aiay-focus-ring); }
.small-step input { position: absolute; opacity: 0; pointer-events: none; }
.small-step__ring { display: inline-flex; width: 23px; height: 23px; flex: none; align-items: center; justify-content: center; border-radius: 50%; background: var(--app-track); transition: background-color 220ms ease; }
.small-step__ring .glyph { opacity: 0; transform: scale(0.6); transition: opacity 200ms ease, transform 260ms var(--app-ease); }
.small-step__label { flex: 1; font-size: 14px; line-height: 1.33; font-weight: 500; color: var(--app-deep); }
.small-step.is-checked { background: var(--app-gold); }
.small-step.is-checked .small-step__ring { background: var(--app-accent); animation: pop 360ms var(--app-ease); }
.small-step.is-checked .small-step__ring .glyph { opacity: 1; transform: none; }
html[dir='rtl'] .small-step__label { font-family: var(--app-font-ar); }
.small-action-footer { padding-top: 24px; }
.small-action-cta { margin-top: 24px; }
.small-action-cta:disabled { opacity: 0.45; cursor: not-allowed; }

/* AR_25 My progress (mobile screens/MyProgressScreen.tsx) */
.progress-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 10px; margin-top: 60px; direction: ltr; }
.progress-metric {
    display: flex;
    flex-direction: column;
    min-height: 100px;
    padding: 14px 16px 16px;
    border: 1px solid var(--app-track);
    border-radius: 16px;
    background: var(--app-surface);
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 70ms + 120ms);
}
.progress-metric--first { background: var(--app-soft); }
html[dir='rtl'] .progress-metric { direction: rtl; }
.progress-metric .glyph, .progress-metric__mark { align-self: flex-start; } /* top-left in both languages (EN/AR frames) */
html[dir='rtl'] .progress-metric .glyph, html[dir='rtl'] .progress-metric__mark { align-self: flex-end; }
.progress-metric__mark .glyph { align-self: auto; }
.progress-metric__text { margin: 16px 0 0; font-size: 14px; line-height: 1.31; font-weight: 700; color: var(--app-deep); }
.progress-chart__title { margin: 44px 0 0; font-size: 18px; line-height: 1.31; font-weight: 700; color: var(--app-ink); }
.progress-chart { display: flex; height: 130px; margin: 12px 0 44px; padding: 23px 5px 3px 18px; flex-direction: column; border-radius: 17px; background: var(--app-search); }
/* 7 x 20px bars, 23px apart in the frame, kept at the left in both languages; narrower screens close the gaps */
.progress-chart__bars { display: flex; width: 100%; max-width: 278px; height: 76px; margin-right: auto; align-items: flex-end; justify-content: space-between; }
.progress-chart__axis { margin: 15px 0 0; font-size: 11px; line-height: 14px; color: var(--app-muted); text-align: start; white-space: nowrap; }
.progress-chart__bar { display: block; width: 20px; height: var(--h); border-radius: 5px; background: var(--app-accent); transform-origin: bottom; animation: bar-grow 520ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 60ms + 500ms); }
.progress-page .setup-sub { margin-top: 12px; }
.progress-cta { margin-top: 24px; }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: none; } }
html[dir='rtl'] .progress-metric__text, html[dir='rtl'] .progress-chart__title { font-family: var(--app-font-ar); }

/* AR_26 My life areas (mobile screens/LifeAreasScreen.tsx) */
.explore-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.explore-links .areas-link { margin-top: 0; }
.areas-link { display: inline-block; margin-top: 10px; padding: 7px 14px; border-radius: 16px; background: var(--app-soft); color: var(--app-on-soft); font-size: 12px; font-weight: 700; text-decoration: none; }
.area-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 10px; margin-top: 33px; direction: ltr; }
.area-tile {
    display: flex;
    flex-direction: column;
    height: 155px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: var(--app-track);
    text-decoration: none;
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 60ms + 100ms);
    transition: transform 160ms ease;
}
.area-tile:active { transform: scale(0.96); }
.area-tile__photo { display: block; height: 109px; overflow: hidden; }
.area-tile__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--app-ease); }
.area-tile:hover .area-tile__photo img { transform: scale(1.05); }
.area-tile__name { display: flex; height: 46px; align-items: center; justify-content: center; padding: 0 8px; background: var(--app-deep); color: var(--app-on-deep); font-size: 13px; font-weight: 700; text-align: center; }
html[dir='rtl'] .area-tile__name { direction: rtl; font-family: var(--app-font-ar); }

/* AR_27 One life area (mobile screens/LifeAreaScreen.tsx) */
.hero--area { height: 343px; }
.sheet--area { display: flex; min-height: calc(var(--app-free-h) - 318px); flex-direction: column; margin-top: -25px; padding: 21px 24px 32px; border-radius: 24px 24px 0 0; text-align: start; }
.area-lead { margin: 24px 0 0; font-size: 14px; line-height: 1.31; color: var(--app-muted); }
.area-rows { display: grid; gap: 16px; margin-top: 69px; }
.area-row {
    display: flex; /* icon tile at the start: left in English, right in the AR frames */
    align-items: center;
    gap: 14px;
    min-height: 75px;
    padding-block: 12px;
    padding-inline: 14px 18px;
    border: 1px solid var(--app-track);
    border-radius: 16px;
    background: var(--app-surface);
    color: inherit;
    text-decoration: none;
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 80ms + 300ms);
    transition: transform 160ms ease, border-color 200ms ease;
}
.area-row:hover { border-color: var(--app-accent); }
.area-row:active { transform: scale(0.985); }
.area-row__icon { display: inline-flex; width: 38px; height: 38px; flex: none; align-items: center; justify-content: center; border-radius: 12px; background: var(--app-search); }
.area-row__icon--tinted { background: var(--app-soft); }
.area-row__text { flex: 1; font-size: 14px; line-height: 1.31; font-weight: 700; color: var(--app-deep); }
html[dir='rtl'] .area-row__text { font-family: var(--app-font-ar); }
.area-footer { padding-top: 21px; }
.area-note { margin: 0; font-size: 11px; line-height: 1.31; color: var(--app-muted); text-align: center; }
.area-cta { margin-top: 8px; }

/* AR_31 / AR_34 sound list: pick a row, then the CTA plays it. */
.sound-page .setup-sub { margin-top: 12px; }
.sound-pick { display: flex; flex: 1; flex-direction: column; gap: 22px; margin-top: 50px; }
.sound-rows { display: grid; gap: 8px; }
.sound-pick-row {
    position: relative;
    display: flex;
    height: 88px;
    align-items: center;
    padding: 0 7px;
    border: 1px solid var(--app-track);
    border-radius: 16px;
    background: var(--app-surface);
    cursor: pointer;
    direction: ltr; /* AR frame: cover on the left, text on the right */
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 60ms + 100ms);
    transition: background-color 220ms ease, transform 160ms ease;
}
/* Cover on the left in both languages (Figma 09 / 02 Nature sounds) */
html[dir='rtl'] .sound-pick-row { flex-direction: row-reverse; }
.sound-pick-row input { position: absolute; opacity: 0; pointer-events: none; }
.sound-pick-row:active { transform: scale(0.985); }
.sound-pick-row:focus-within { box-shadow: 0 0 0 3px var(--aiay-focus-ring); }
.sound-pick-row.is-selected { background: var(--app-soft); }
.sound-pick-row__cover { width: 80px; height: 74px; flex: none; border-radius: 11px; object-fit: cover; background: var(--app-track); }
.sound-pick-row__text { display: flex; flex: 1; min-width: 0; flex-direction: column; justify-content: center; align-self: stretch; padding: 0 16px 0 14px; align-items: flex-end; }
html[dir='ltr'] .sound-pick-row__text { padding: 0 14px 0 16px; align-items: flex-start; }
/* Title with the volume mark beside it (after the title in reading order). */
.sound-pick-row__head { display: flex; max-width: 100%; align-items: center; gap: 6px; flex-direction: row-reverse; }
html[dir='ltr'] .sound-pick-row__head { flex-direction: row; }
.sound-pick-row__title { min-width: 0; overflow: hidden; font-size: 14px; line-height: 1.31; font-weight: 700; color: var(--app-deep); text-overflow: ellipsis; white-space: nowrap; }
html[dir='rtl'] .sound-pick-row__title, html[dir='rtl'] .sound-pick-row__meta { direction: rtl; text-align: right; font-family: var(--app-font-ar); }
.sound-pick-row__volume { display: inline-flex; flex: none; }
.sound-pick-row.is-selected .sound-pick-row__volume { animation: soft-pulse 1800ms ease-in-out infinite; }
.sound-pick-row__meta { margin-top: 6px; font-size: 11px; line-height: 1.31; color: var(--app-muted); white-space: nowrap; }
.sound-empty { margin: 0; }
/* The CTA follows the list instead of sinking to the bottom of the page. */
.sound-cta { margin-top: 2px; }

/* 09 Sounds / 11 Set a timer and 13 My sound mix: full sheets over the player (mobile SleepTimerScreen / SoundMixScreen). */
.timer-sheet {
    width: min(100%, 480px);
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0 auto;
    padding: 0;
    border: 0;
    background: var(--app-canvas);
    color: var(--app-ink);
    overflow-y: auto;
}
.timer-sheet::backdrop, .more-sheet::backdrop { background: var(--app-shade); animation: fade-in 220ms ease both; }
.timer-sheet[open] { display: flex; flex-direction: column; animation: fade-in 220ms ease both; }
.timer-sheet__body { position: relative; display: flex; flex: 1; flex-direction: column; padding: calc(14px + env(safe-area-inset-top)) 24px 24px; background: var(--app-canvas); animation: fade-up 420ms var(--app-ease) both; }
.timer-sheet__back { align-self: flex-start; }
.timer-sheet__title { margin: 73px 0 0; font-size: 30px; line-height: 40px; font-weight: 700; color: var(--app-ink); text-align: center; }
.timer-sheet__lead { margin: 11px 0 0; font-size: 14px; line-height: 19px; color: var(--app-ink); text-align: center; }
html[dir='rtl'] .timer-sheet__title, html[dir='rtl'] .timer-sheet__lead { font-family: var(--app-font-ar); }
.timer-options { display: grid; gap: 2px; margin: 56px 18px 0; padding: 2px 3px; border-radius: 24px; background: var(--app-surface); }
.timer-option {
    position: relative;
    display: flex;
    height: 58px;
    align-items: center;
    justify-content: center;
    border-radius: 26px;
    color: var(--app-ink);
    font-size: 16px;
    cursor: pointer;
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 60ms + 140ms);
    transition: background-color 220ms ease, transform 160ms ease;
}
html[dir='rtl'] .timer-option { font-family: var(--app-font-ar); }
.timer-option input { position: absolute; opacity: 0; pointer-events: none; }
.timer-option:active { transform: scale(0.985); }
.timer-option:focus-within { box-shadow: 0 0 0 3px var(--aiay-focus-ring); }
.timer-option:has(input:checked) { background: var(--app-sand); font-weight: 700; }
.timer-custom { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 18px; }
.timer-custom[hidden] { display: none; }
.timer-custom__btn { width: 44px; height: 44px; border: 1px solid var(--app-track); border-radius: 50%; background: var(--app-surface); color: var(--app-deep); font: inherit; font-size: 22px; font-weight: 700; cursor: pointer; }
.timer-custom__btn:disabled { opacity: 0.35; cursor: not-allowed; }
.timer-custom__value { min-width: 120px; font-size: 16px; font-weight: 700; text-align: center; color: var(--app-ink); }
.timer-sheet__cta { margin-top: auto; height: 53px; border-radius: 16px; font-size: 15px; }
.timer-options, .timer-custom { margin-bottom: 30px; }
.timer-sheet__off { align-self: center; margin-top: 12px; color: var(--app-accent); font-weight: 700; }

.mix-sheet__title { margin: 27px 0 0; font-size: 27px; line-height: 36px; font-weight: 700; color: var(--app-ink); text-align: center; }
.mix-sheet__lead { margin: 15px 0 0; font-size: 14px; line-height: 19px; color: var(--app-muted); text-align: center; }
html[dir='rtl'] .mix-sheet__title, html[dir='rtl'] .mix-sheet__lead { font-family: var(--app-font-ar); text-align: right; }
.mix-rows { display: grid; gap: 32px; margin: 60px 0 0; padding: 0; list-style: none; }
.mix-row { display: flex; align-items: flex-start; gap: 18px; direction: ltr; animation: fade-up 420ms var(--app-ease) both; } /* photo left, delete right in both languages (AR frame) */
.mix-row__photo { width: 79px; height: 82px; flex: none; border-radius: 14px; object-fit: cover; background: var(--app-track); }
.mix-row__body { display: flex; flex: 1; flex-direction: column; min-width: 0; padding-top: 5px; }
.mix-row__head { display: flex; align-items: center; gap: 10px; min-height: 21px; }
.mix-row__title { flex: 1; overflow: hidden; font-size: 16px; line-height: 21px; font-weight: 700; color: var(--app-ink); text-overflow: ellipsis; white-space: nowrap; }
html[dir='rtl'] .mix-row__title { direction: rtl; font-family: var(--app-font-ar); text-align: right; }
.mix-row__delete { display: inline-flex; padding: 0; border: 0; background: none; cursor: pointer; }
.mix-row__range { width: calc(100% - 36px); height: 24px; margin: 14px 0 0; accent-color: var(--app-deep); background: transparent; cursor: pointer;
    -webkit-appearance: none; appearance: none; }
.mix-row__range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--app-deep) var(--pct, 50%), var(--app-track) var(--pct, 50%)); }
.mix-row__range::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--app-deep); -webkit-appearance: none; appearance: none; }
.mix-row__range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--app-track); }
.mix-row__range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--app-deep); }
.mix-row__range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--app-deep); }
.mix-row__pct { align-self: flex-end; font-size: 13px; line-height: 17px; color: var(--app-muted); }
.mix-add { display: flex; align-items: center; justify-content: center; gap: 4px; height: 53px; margin-top: 50px; border: 1px solid var(--app-track); border-radius: 19px;
    background: var(--app-surface); color: var(--app-deep); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.mix-add:disabled { opacity: 0.45; cursor: not-allowed; }
.mix-hint { margin: 10px 0 0; font-size: 12px; text-align: center; color: var(--app-muted); }
.mix-picker { margin-top: 12px; padding: 14px; border: 1px solid var(--app-track); border-radius: 19px; background: var(--app-surface); animation: fade-up 300ms var(--app-ease) both; }
.mix-picker__title { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--app-ink); }
.mix-picker__list { display: grid; margin: 0; padding: 0; list-style: none; }
.mix-pick { display: flex; width: 100%; align-items: center; gap: 12px; padding: 6px 0; border: 0; background: none; font: inherit; text-align: start; cursor: pointer; }
.mix-pick__photo { width: 40px; height: 40px; flex: none; border-radius: 10px; object-fit: cover; background: var(--app-track); }
.mix-pick__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.mix-pick__title { font-size: 14px; font-weight: 500; color: var(--app-deep); }
.mix-pick__meta { font-size: 11px; color: var(--app-muted); }
.mix-save { margin-top: auto; height: 53px; border-radius: 16px; font-size: 15px; }
.mix-add, .mix-picker { margin-bottom: 34px; }
.mix-hint { margin-top: -24px; margin-bottom: 34px; }

/* More: a small actions sheet (mobile SoundPlayerScreen More). */
.more-sheet { width: min(100%, 480px); max-width: none; margin: auto auto 0; padding: 22px 24px calc(18px + env(safe-area-inset-bottom)); border: 0;
    border-radius: 24px 24px 0 0; background: var(--app-canvas); color: var(--app-ink); }
.more-sheet[open] { display: flex; flex-direction: column; animation: sheet-rise 320ms var(--app-ease) both; }
.more-sheet__title { margin: 0 0 10px; font-size: 17px; line-height: 23px; font-weight: 700; text-align: center; }
.more-sheet form { margin: 0; }
.more-row { display: flex; width: 100%; min-height: 54px; align-items: center; gap: 14px; padding: 0; border: 0; border-bottom: 1px solid var(--app-track);
    background: none; color: var(--app-deep); font: inherit; font-size: 15px; font-weight: 500; text-align: start; text-decoration: none; cursor: pointer; }
html[dir='rtl'] .more-row { font-family: var(--app-font-ar); }
.more-row .glyph { flex: none; }
.more-row .more-row__remove, .more-row.is-on .more-row__add { display: none; }
.more-row.is-on .more-row__remove { display: inline; }
.more-sheet__close { align-self: center; margin-top: 14px; color: var(--app-accent); font-weight: 700; }
.player-toast { margin: 16px auto 0; padding: 10px 16px; border-radius: 14px; background: var(--app-sand); color: var(--app-on-sand); font-size: 13px; text-align: center; animation: fade-up 300ms var(--app-ease) both; }

/* AR_35 / AR_36 A space to breathe (script in templates/app/breathing.html). */
.breath-page { position: relative; isolation: isolate; }
.breath-page::before { content: ''; position: fixed; inset: 0; z-index: -1; background: linear-gradient(color-mix(in srgb, var(--app-canvas) 95%, transparent), color-mix(in srgb, var(--app-canvas) 95%, transparent)), url('../images/photos/final/breathing-exercise-breath-bg.jpg') center / cover; }
.breath-title { margin: 32px 0 0; font-size: 28px; line-height: 1.31; font-weight: 700; color: var(--app-ink); text-align: center; }
.breath-lead { margin: 27px 0 0; font-size: 14px; line-height: 1.31; color: var(--app-muted); text-align: center; }
html[dir='rtl'] .breath-title, html[dir='rtl'] .breath-lead, html[dir='rtl'] .breath-guide,
html[dir='rtl'] .breath-ring__label, html[dir='rtl'] .breath-phase { font-family: var(--app-font-ar); }
.breath-ring { position: relative; display: flex; width: 278px; height: 278px; flex: none; flex-direction: column; align-items: center; align-self: center; margin-top: 85px; border-radius: 50%; background: var(--app-sand); }
.breath-page:not(.is-started) .breath-ring { animation: breath-idle 6400ms ease-in-out infinite; }
.breath-ring__inner { position: absolute; top: 20.5px; left: 20.5px; width: 237px; height: 237px; border-radius: 50%; background: var(--app-soft); transform: scale(.94); }
.breath-page:not(.is-started) .breath-ring__inner { transform: none; }
.breath-ring__arc { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); opacity: 0; transition: opacity 300ms ease; }
.breath-ring__arc circle { fill: none; stroke: var(--app-accent); stroke-opacity: .82; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.breath-page.is-started .breath-ring__arc { opacity: 1; }
.breath-ring__lungs { position: relative; display: inline-flex; margin-top: 70px; }
.breath-ring__lungs .glyph { width: 50px; height: 50px; }
.breath-ring__label { position: absolute; top: 161px; width: 237px; font-size: 24px; line-height: 1.31; font-weight: 700; color: var(--app-deep); text-align: center; }
.breath-guide { margin: 19px 0 0; font-size: 16px; line-height: 19px; color: var(--app-muted); text-align: center; }
.breath-phases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 13px; direction: ltr; }
.breath-phase { display: flex; height: 88px; flex-direction: column; align-items: center; padding-top: 7px; border: .8px solid color-mix(in srgb, var(--app-track) 60%, var(--app-canvas)); border-radius: 17px; background: color-mix(in srgb, var(--app-search) 70%, var(--app-canvas)); transition: background-color 400ms ease, border-color 400ms ease; }
.breath-phase.is-lit { border-color: color-mix(in srgb, var(--app-accent) 30%, var(--app-soft)); background: var(--app-soft); }
.breath-phase .glyph { width: 22px; height: 22px; }
.g-breath path { fill: none; stroke: var(--glyph-deep); stroke-linecap: round; stroke-linejoin: round; transition: stroke 400ms ease; }
.breath-phase.is-lit .g-breath path { stroke: var(--glyph-accent); }
.breath-phase__label { margin-top: 8px; font-size: 15px; line-height: 18px; font-weight: 700; color: var(--app-deep); }
.breath-phase__time { margin-top: 6px; font-size: 13px; line-height: 16px; color: var(--app-muted); }
.breath-cta { margin-top: 24px; }
.breath-phases { margin-bottom: 44px; }
@keyframes breath-idle { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }

/* AR_38 Gentle movement: the AR_27 area page layout with bare icons. */
.hero--movement { height: 368px; }
.sheet--movement { min-height: calc(var(--app-free-h) - 345px); margin-top: -23px; padding-top: 18px; }
.movement-title { margin: 0; font-size: 24px; line-height: 1.31; font-weight: 700; color: var(--app-ink); }
.movement-lead { margin: 20px 0 0; font-size: 13px; line-height: 1.31; color: var(--app-muted); }
html[dir='rtl'] .movement-title, html[dir='rtl'] .movement-lead { font-family: var(--app-font-ar); }
.movement-rows { gap: 11px; margin-top: 65px; }
.movement-row { min-height: 80px; gap: 19px; padding: 0 17px 0 11px; }
/* Icon on the left in both languages (EN/AR frames), unlike the area rows. */
html[dir='rtl'] .movement-row { flex-direction: row-reverse; }
.movement-row .glyph { width: 24px; height: 24px; flex: none; }
.movement-footer { padding-top: 8px; }
.movement-cta { margin-top: 15px; }

/* AR_37 Breathing complete. */
.hero--done { height: 447px; }
.sheet--done { display: flex; min-height: calc(var(--app-free-h) - 419px); flex-direction: column; align-items: stretch; margin-top: -28px; padding: 25px 24px 32px; border-radius: 25px 25px 0 0; text-align: center; }
.done-check { position: relative; display: inline-flex; width: 58px; height: 58px; align-items: center; justify-content: center; align-self: center; border-radius: 50%; background: var(--app-accent); animation: pop 520ms var(--app-ease) 300ms both; }
.done-check::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--app-accent); animation: ripple 900ms ease-out 450ms both; }
.done-check .glyph { position: relative; z-index: 1; width: 28px; height: 28px; }
.done-title { margin: 16px 0 0; font-size: 24px; line-height: 1.31; font-weight: 700; color: var(--app-ink); }
.done-lead { margin: 28px 0 0; font-size: 15px; line-height: 1.31; color: var(--app-muted); }
html[dir='rtl'] .done-title, html[dir='rtl'] .done-lead, html[dir='rtl'] .done-bullets span { font-family: var(--app-font-ar); }
.done-bullets { display: grid; gap: 16px; margin: 60px 0 0; padding: 0 5px 0 11px; list-style: none; }
.done-bullets li { display: flex; align-items: center; gap: 16px; direction: ltr; animation: fade-up 420ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 90ms + 560ms); }
/* Tick on the left in both languages (EN/AR frames): direction ltr above keeps it there. */
.done-bullets .glyph { width: 18px; height: 18px; flex: none; }
.done-bullets span { flex: 1; font-size: 12px; line-height: 1.31; color: var(--app-deep); text-align: right; }
html[dir='rtl'] .done-bullets span { direction: rtl; }
html[dir='ltr'] .done-bullets span { text-align: left; }
.done-cta { margin-top: 24px; }
.done-bullets { margin-bottom: 32px; }

/* AR_39 movement routine: steps run in turn (script in templates/app/movement_routine.html). */
.routine-step { position: relative; width: 100%; overflow: hidden; font: inherit; text-align: inherit; cursor: default; transition: background-color 300ms ease, opacity 300ms ease, transform 160ms ease; }
#routine.is-started .routine-step { cursor: pointer; }
.routine-step__icon, .routine-step__tick { display: inline-flex; flex: none; }
.routine-step__tick { display: none; }
.routine-step__text { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.routine-step__time { font-size: 12px; line-height: 16px; color: var(--app-muted); }
.routine-step__time:empty { display: none; }
.routine-step__bar { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--app-track); opacity: 0; }
.routine-step__bar::after { content: ''; position: absolute; inset: 0; background: var(--app-accent); transform: scaleX(var(--progress, 0)); transform-origin: right; }
html[dir='ltr'] .routine-step__bar::after { transform-origin: left; }
.routine-step.is-current { background: var(--app-soft); }
.routine-step.is-current .routine-step__bar { opacity: 1; }
.routine-step.is-done { opacity: .7; }
.routine-step.is-done .routine-step__icon { display: none; }
.routine-step.is-done .routine-step__tick { display: inline-flex; animation: pop 360ms var(--app-ease); }
html[dir='rtl'] .routine-step__time { font-family: var(--app-font-ar); }

/* AR_41 AI companion intro: the AR_38 movement layout with plain promise rows. */
/* FINAL 13 AI companion intro: no photo, the sheet starts under the back button. */
.hero--plain { height: calc(80px + env(safe-area-inset-top)); background: var(--app-canvas); }
.hero--plain::before, .hero--plain::after { content: none; }
.sheet--companion { min-height: calc(var(--app-free-h) - 80px); margin-top: 0; padding-top: 22px; }
.companion-title { margin: 0; font-size: 25px; line-height: 1.31; font-weight: 700; color: var(--app-ink); }
.companion-lead { margin: 25px 0 0; font-size: 14px; line-height: 1.31; color: var(--app-muted); }
html[dir='rtl'] .companion-title, html[dir='rtl'] .companion-lead, html[dir='rtl'] .companion-note { font-family: var(--app-font-ar); }
.companion-promises { gap: 10px; margin: 54px 0 0; padding: 0; list-style: none; }
.companion-promise { min-height: 67px; padding: 0 23px 0 18px; }
html[dir='ltr'] .companion-promise { padding: 0 18px 0 23px; }
.companion-promise:hover { border-color: var(--app-track); }
.companion-promise .glyph { width: 21px; height: 21px; flex: none; }
.companion-promise:first-child .glyph { animation: heart-beat 1.8s ease-in-out 1.4s infinite; }
.companion-footer { padding-top: 24px; }
.companion-note { font-size: 12px; }
.companion-cta { margin-top: 23px; }
@keyframes heart-beat { 0%, 50%, 100% { transform: scale(1); } 25% { transform: scale(1.12); } }

/* AR_42 My AI companion: header, the conversation, note, field and "Show suggestions". */
.page-chat .app-shell { padding-bottom: 0; --app-free-h: 100vh; }
.chat { display: flex; height: 100vh; height: 100dvh; flex-direction: column; }
.chat-head { padding: var(--app-page-top) 18px 10px; border-bottom: 1px solid var(--app-track); }
.chat-head__row { display: flex; align-items: center; gap: 8px; }
.chat-head .back-link--icon { margin: 0; flex: none; }
.chat-title { flex: 1; margin: 0; font-size: 23px; line-height: 1.31; font-weight: 700; color: var(--app-ink); }
.chat-lead { margin: 10px 0 0; font-size: 12px; line-height: 1.31; color: var(--app-muted); }
html[dir='rtl'] .chat-title, html[dir='rtl'] .chat-lead, html[dir='rtl'] .chat-note, html[dir='rtl'] .chat-bubble, html[dir='rtl'] .chat-field textarea { font-family: var(--app-font-ar); }
.chat-thread { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 21px; padding: 30px 23px 12px; overflow-y: auto; direction: ltr; }
.chat-bubble { max-width: 76%; min-width: 120px; margin: 0; padding: 16px 18px; border-radius: 18px; font-size: 14px; line-height: 1.31; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--app-on-soft); }
html[dir='rtl'] .chat-bubble { direction: rtl; text-align: right; }
html[dir='ltr'] .chat-bubble { text-align: left; }
.chat-bubble--mine { align-self: flex-end; background: var(--app-soft); transform-origin: right bottom; }
.chat-bubble--theirs { align-self: flex-start; background: var(--app-search); transform-origin: left bottom; }
.chat-bubble--error { color: var(--app-muted); }
.chat-bubble--in.chat-bubble--mine { animation: bubble-in-right 420ms var(--app-ease) both; }
.chat-bubble--in.chat-bubble--theirs { animation: bubble-in-left 420ms var(--app-ease) both; }
.chat-typing { display: flex; min-width: 0; gap: 5px; padding: 18px; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--app-deep); animation: typing-dot 1.1s ease-in-out infinite; }
.chat-typing span:nth-child(2) { animation-delay: 140ms; }
.chat-typing span:nth-child(3) { animation-delay: 280ms; }
.chat-footer { padding: 0 22px calc(24px + env(safe-area-inset-bottom)); }
.chat-note { margin: 0 3px; font-size: 11px; line-height: 1.31; color: var(--app-muted); text-align: center; }
.chat-field { display: flex; min-height: 53px; align-items: center; gap: 12px; margin: 12px 0 0; padding: 0 14px 0 16px; border-radius: 15px; background: var(--app-surface); direction: ltr; transition: box-shadow 200ms ease; }
.chat-field:focus-within { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--app-accent) 45%, transparent); }
.chat-field textarea { flex: 1; min-width: 0; padding: 14px 0; border: 0; outline: 0; background: transparent; resize: none; font: inherit; font-size: 13px; line-height: 1.31; color: var(--app-ink); }
html[dir='rtl'] .chat-field textarea { direction: rtl; text-align: right; }
.chat-field textarea::placeholder { color: var(--app-muted); }
.chat-send { display: inline-flex; width: 30px; height: 30px; flex: none; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; cursor: pointer; transition: opacity 200ms ease, transform 160ms ease; }
.chat-send:disabled { opacity: 0.45; cursor: default; }
.chat-send:active:not(:disabled) { transform: scale(0.88); }
.chat-send .glyph { width: 22px; height: 22px; }
.chat-send.is-nudged .glyph { animation: send-nudge 360ms var(--app-ease); }
html[dir='ltr'] .chat-send.is-nudged .glyph { animation-name: send-nudge-ltr; }
.chat-cta { margin-top: 23px; }
.chat-cta:disabled { opacity: 0.7; cursor: default; }

/* AR_42 extras: new conversation, starter prompts, retry, suggested steps, safety reply */
.chat-new { flex: none; padding: 7px 12px; border: 1px solid var(--app-track); border-radius: 999px; background: var(--app-surface); font: inherit; font-size: 12px; font-weight: 700; color: var(--app-on-sand); cursor: pointer; transition: background 160ms ease; }
.chat-new:hover { background: var(--app-sand); }
.chat-starters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -9px; direction: inherit; }
.chat-starters[hidden], .chat-new[hidden] { display: none; }
html[dir='rtl'] .chat-starters { direction: rtl; }
.chat-starter { padding: 9px 14px; border: 1px solid var(--app-track); border-radius: 999px; background: var(--app-surface); font: inherit; font-size: 13px; line-height: 1.3; color: var(--app-ink); cursor: pointer; animation: fade-up 420ms calc(var(--i, 0) * 70ms + 200ms) var(--app-ease) both; transition: background 160ms ease, border-color 160ms ease; }
.chat-starter:hover { background: var(--app-soft); border-color: var(--app-soft); }
html[dir='rtl'] .chat-starter { font-family: var(--app-font-ar); }
.chat-retry { margin-top: 8px; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--app-deep); color: var(--app-on-deep); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.chat-bubble--safety { background: var(--app-surface); border: 1.5px solid var(--app-gold); color: var(--app-ink); }
.chat-steps { display: flex; flex-direction: column; gap: 10px; max-width: 86%; white-space: normal; }
.chat-steps__title { margin: 0; font-size: 12px; font-weight: 700; color: var(--app-accent); }
.chat-steps__list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chat-step { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border-radius: 14px; background: var(--app-surface); }
.chat-step__text { font-size: 14px; line-height: 1.35; color: var(--app-ink); }
.chat-step__add { padding: 6px 12px; border: 0; border-radius: 999px; background: var(--app-sand); color: var(--app-on-sand); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: background 160ms ease; }
.chat-step__add:disabled { cursor: default; }
.chat-step__add.is-done { background: var(--app-soft); color: var(--app-on-soft); }
.chat-steps__link { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--app-accent); }
@keyframes bubble-in-right { from { opacity: 0; transform: translateX(18px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes bubble-in-left { from { opacity: 0; transform: translateX(-18px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes typing-dot { 0%, 60%, 100% { opacity: 0.4; transform: none; } 30% { opacity: 1; transform: translateY(-4px); } }
@keyframes send-nudge { 40% { transform: translateX(-5px); } }
@keyframes send-nudge-ltr { 40% { transform: scaleX(-1) translateX(-5px); } }

/* AR_43-45 ideas for today / my mini plan / my goals (templates/app/mini_plan.html). */
.plan-page .setup-sub { margin-top: 12px; }
.plan-form { display: flex; flex: 1; flex-direction: column; margin-top: 50px; }
.plan-options { display: grid; gap: 11px; }
.plan-option {
    position: relative;
    display: flex;
    min-height: 96px;
    align-items: flex-start;
    gap: 10px;
    padding-block: 12px;
    padding-inline: 12px 21px; /* EN: tile / photo top-left; the AR frames mirror it */
    border: 1px solid var(--app-track);
    border-radius: 20px;
    background: var(--app-gold);
    cursor: pointer;
    animation: fade-up 420ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 70ms + 100ms);
    transition: background-color 220ms ease, transform 160ms ease;
}
.plan-option__photo { width: 68px; height: 68px; flex: none; border-radius: 14px; object-fit: cover; background: var(--app-track); }
.plan-option input { position: absolute; opacity: 0; pointer-events: none; }
.plan-option:active { transform: scale(0.985); }
.plan-option:focus-within { box-shadow: 0 0 0 3px var(--aiay-focus-ring); }
.plan-option.is-picked { background: var(--app-soft); }
.plan-option__tile { display: inline-flex; width: 42px; height: 42px; flex: none; align-items: center; justify-content: center; border-radius: 12px; background: color-mix(in srgb, var(--app-search) 70%, var(--app-canvas)); transition: background-color 220ms ease; }
.plan-option.is-picked .plan-option__tile { background: var(--app-surface); animation: pop 360ms var(--app-ease); }
.plan-option__tile .glyph { width: 21px; height: 21px; }
.plan-option__label { flex: 1; margin-top: 3px; font-size: 14px; line-height: 1.31; color: var(--app-deep); text-align: right; }
html[dir='rtl'] .plan-option__label { direction: rtl; font-family: var(--app-font-ar); }
html[dir='ltr'] .plan-option__label { text-align: left; }
.plan-option.is-picked .plan-option__label { font-weight: 700; }
.plan-new-goal { min-height: 56px; padding: 0 18px; border: 1px solid var(--app-accent); border-radius: 16px; background: var(--app-surface); color: var(--app-deep); font: inherit; font-size: 14px; animation: fade-up 260ms var(--app-ease) both; }
.plan-new-goal[hidden] { display: none; }
.plan-note { margin: 0; padding-top: 24px; font-size: 11px; line-height: 1.31; color: var(--app-muted); text-align: center; }
html[dir='rtl'] .plan-note { font-family: var(--app-font-ar); }
.plan-cta { margin-top: 24px; }
.plan-cta:disabled { opacity: 0.45; cursor: not-allowed; }

/* AR_46 My favourites: four photo tiles with a deep label band. */
.fav-hub { min-height: 0; }
.fav-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 23px 12px; margin-top: 47px; }
.fav-tile {
    position: relative;
    display: flex;
    height: 179px;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 17px;
    background: var(--app-track);
    color: var(--app-on-deep);
    text-decoration: none;
    animation: fade-up 480ms var(--app-ease) both;
    animation-delay: calc(var(--i, 0) * 70ms + 140ms);
    transition: transform 160ms ease;
}
.fav-tile::before { content: ''; position: absolute; inset: 0; background: var(--cover) center / cover no-repeat; animation: fav-settle 1.1s var(--app-ease) backwards; animation-delay: calc(var(--i, 0) * 70ms + 140ms); transition: transform 400ms var(--app-ease); }
.fav-tile:hover::before { transform: scale(1.04); }
.fav-tile:active { transform: scale(0.96); }
.fav-tile__label { position: relative; display: flex; width: 100%; height: 58px; align-items: center; justify-content: center; padding: 0 7px; background: var(--app-deep); font-size: 13px; line-height: 1.31; font-weight: 700; text-align: center; }
html[dir='rtl'] .fav-tile__label { font-family: var(--app-font-ar); }
@keyframes fav-settle { from { transform: scale(1.1); } to { transform: none; } }

/* AR_47 My saved signs: the AR_18 row, compact, on the surface, with a volume button under the headline. */
.saved-list { gap: 8px; }
.saved-row { position: relative; }
.saved-row .more-row { min-height: 88px; gap: 7px; padding: 6px 7px; background: var(--app-surface); }
.saved-row .more-row img { width: 80px; height: 74px; }
.saved-row .more-row__text { padding: 6px 9px 2px; justify-content: flex-start; }
.saved-row .more-row__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-row__gap { height: 22px; }
.saved-row .more-row__meta { margin-top: 2px; }
.saved-row__listen { position: absolute; top: 32px; inset-inline-start: 16px; display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; animation: fade-up 420ms var(--app-ease) backwards; animation-delay: calc(var(--i, 0) * 70ms + 200ms); }
.saved-row__listen .glyph { width: 18px; height: 18px; }
.saved-row__listen:active { transform: scale(0.88); }
.saved-row__listen.is-speaking .glyph { animation: listen-pulse 1.04s ease-in-out infinite; }
@keyframes listen-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(1.12); } }

/* AR_48 My notifications: 96px cards; unread ones wear the soft tint and their icon breathes. */
.inbox-list { display: grid; gap: 11px; margin: 35px 0 0; padding: 0; list-style: none; }
.inbox-list li { animation: fade-up 420ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 70ms + 120ms); }
.inbox-list form { margin: 0; }
.inbox-card {
    display: flex;
    flex-direction: row-reverse; /* icon tile left in Arabic, right in English, as in the AR frame */
    width: 100%;
    min-height: 96px;
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--app-track);
    border-radius: 16px;
    background: var(--app-surface);
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: transform 160ms ease, border-color 200ms ease;
}
.inbox-card:hover { border-color: var(--app-accent); }
.inbox-card:active { transform: scale(0.985); }
.inbox-card.is-unread { background: var(--app-soft); }
.inbox-card__icon { display: inline-flex; width: 42px; height: 42px; flex: none; align-items: center; justify-content: center; border-radius: 12px; background: var(--app-search); }
.inbox-card.is-unread .inbox-card__icon { background: var(--app-surface); animation: icon-breathe 2.8s ease-in-out infinite; }
.inbox-card__icon .glyph { width: 21px; height: 21px; }
.inbox-card__text { display: flex; flex: 1; min-width: 0; flex-direction: column; padding: 3px 9px 0; }
.inbox-card__label { overflow: hidden; font-size: 14px; line-height: 1.31; color: var(--app-on-soft); text-overflow: ellipsis; white-space: nowrap; }
.inbox-card.is-unread .inbox-card__label { font-weight: 700; }
.inbox-card__body { display: -webkit-box; margin-top: 6px; overflow: hidden; font-size: 12px; line-height: 1.33; color: var(--app-muted); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.inbox-card__time { margin-top: 6px; font-size: 11px; line-height: 1.31; color: var(--app-muted); }
html[dir='rtl'] .inbox-card__text { font-family: var(--app-font-ar); }
.inbox-footer { padding-top: 24px; }
.inbox-cta { margin-top: 24px; }
@keyframes icon-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

/* AR_52-54 option cards (mobile components/AiAYOptionCard.tsx): icon tile + label, the soft tint when picked. */
.option-form { display: flex; flex: 1; flex-direction: column; }
.option-cards { display: grid; gap: 11px; margin-top: 35px; }
.option-card {
    display: flex; /* EN: tile left, control right; most AR frames mirror it (the page direction does) */
    min-height: 72px;
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--app-track);
    border-radius: 16px;
    background: var(--app-surface);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    animation: fade-up 420ms var(--app-ease) backwards;
    animation-delay: calc(var(--i, 0) * 60ms + 120ms);
    transition: transform 160ms ease, border-color 200ms ease, background-color 240ms ease;
}
.option-card--tall { min-height: 96px; }
.option-card:hover { border-color: var(--app-accent); }
.option-card:active { transform: scale(0.985); }
.option-card input[type='radio'], .option-card input[type='checkbox']:not(.switch) { position: absolute; opacity: 0; pointer-events: none; }
.option-card:has(input:focus-visible) { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.option-card__tile { display: inline-flex; width: 42px; height: 42px; flex: none; align-items: center; justify-content: center; border-radius: 12px; background: var(--app-search); transition: background-color 240ms ease; }
.option-card__tile .glyph { width: 21px; height: 21px; }
/* The trailing value / switch sits at the card's outer edge: right in Arabic, left in English. */
.option-card__body { display: flex; flex: 1; min-width: 0; align-items: flex-start; gap: 12px; padding: 3px 9px 0; }
.option-card--link .option-card__body, .option-card--switch .option-card__body { min-height: 42px; align-items: center; padding-top: 0; }
.option-card__label { flex: 1; font-size: 14px; line-height: 1.31; color: var(--app-on-soft); }
.option-card__value { max-width: 50%; overflow: hidden; font-size: 12px; line-height: 1.31; color: var(--app-muted); text-overflow: ellipsis; white-space: nowrap; }
html[dir='rtl'] .option-card__label, html[dir='rtl'] .option-card__value { font-family: var(--app-font-ar); }
.option-card:has(input:not(.switch):checked) { background: var(--app-soft); }
.option-card:has(input:not(.switch):checked) .option-card__tile { background: var(--app-surface); animation: tile-pop 420ms var(--app-ease); }
.option-card:has(input:not(.switch):checked) .option-card__label { font-weight: 700; }
.option-footer { padding-top: 24px; }
.option-footer .form-error { margin-bottom: 12px; text-align: center; }
.option-cta { margin-top: 24px; }
@keyframes tile-pop { 0% { transform: scale(0.82); } 60% { transform: scale(1.06); } 100% { transform: none; } }

/* AR_52 switch: 38×20 track, 14px dot; accent when on. */
.switch { position: relative; width: 38px; height: 20px; flex: none; margin: 0; border-radius: 11px; background: var(--app-track); cursor: pointer; appearance: none; -webkit-appearance: none; transition: background-color 200ms ease; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); transition: transform 220ms var(--app-ease); }
.switch:checked { background: var(--app-accent); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }

/* AR_49 My reminders / AR_51 My space (templates/app/reminders.html, my_space.html). */
.space-page .setup-sub { margin-top: 12px; }
.space-cards { margin-top: 50px; }
.option-card.is-current { background: var(--app-soft); }
.option-card.is-current .option-card__tile { background: var(--app-surface); }
.option-card.is-current .option-card__label { font-weight: 700; }
.space-footer { padding-top: 24px; }
/* The Profile tab: the bottom nav sits under the page, so the page fills the space above it */
.setup--tab { min-height: var(--app-free-h); }
.space-notice { margin-top: 16px; }
.account-section { margin-top: 28px; }
.account-section .option-cards { margin-top: 12px; }
.account-card { margin-top: 28px; }
.account-actions { display: grid; gap: 10px; padding-top: 24px; }
.space-fields { display: grid; gap: 16px; margin-top: 40px; }
.glyph .g-knob { fill: var(--app-canvas); }

/* AR_55 / AR_57 option-card additions: a hint under the label, the tint on a switched-on card, plain note cards. */
.option-card__texts { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.option-card__texts .option-card__label { flex: none; }
.option-card__hint { margin-top: 8px; font-size: 12px; line-height: 1.33; color: var(--app-muted); }
/* My theme (mobile ThemesScreen): the palette tile's discs get a surface ring, as in the app */
.theme-swatch circle { stroke: var(--app-surface); stroke-width: 1.2; }
html[dir='rtl'] .option-card__hint { font-family: var(--app-font-ar); }
.option-card--tall.option-card--switch .option-card__body, .option-card--tall.option-card--link .option-card__body { align-items: flex-start; padding-top: 3px; }
.option-card--tint:has(.switch:checked) { background: var(--app-soft); }
.option-card--tint:has(.switch:checked) .option-card__tile { background: var(--app-surface); animation: tile-pop 420ms var(--app-ease); }
.option-card--tint:has(.switch:checked) .option-card__label { font-weight: 700; }
.option-card--info { cursor: default; }
.option-card--info:hover { border-color: var(--app-track); }
.option-card--info:active { transform: none; }
.is-dimmed > .option-card { opacity: 0.55; }
.option-card { transition: transform 160ms ease, border-color 200ms ease, background-color 240ms ease, opacity 260ms ease; }

/* AR_56 More room for my journey: photo hero + sheet with ticked feature rows. */
.hero--premium { height: calc(50px + env(safe-area-inset-top)); }
.sheet--premium { min-height: calc(var(--app-free-h) - 50px); margin-top: 0; padding-top: 23px; }
.premium-title { margin: 0; font-size: 24px; line-height: 1.31; font-weight: 700; color: var(--app-ink); }
.premium-lead { margin: 25px 0 0; font-size: 13px; line-height: 1.31; color: var(--app-muted); }
html[dir='rtl'] .premium-title, html[dir='rtl'] .premium-lead { font-family: var(--app-font-ar); }
.premium-rows { gap: 9px; margin: 42px 0 0; padding: 0; list-style: none; }
.premium-row { min-height: 65px; align-items: center; gap: 14px; padding: 0 13px 0 17px; cursor: default; }
html[dir='ltr'] .premium-row { padding: 0 17px 0 13px; }
.premium-row:hover { border-color: var(--app-track); }
.premium-row .glyph { width: 23px; height: 23px; flex: none; animation: pop 520ms var(--app-ease) backwards; animation-delay: calc(var(--i, 0) * 110ms + 520ms); }
.premium-footer { padding-top: 24px; }
.premium-cta { margin-top: 32px; }

/* AR_58 / AR_59 state pages (mobile components/AiAYStateScreen.tsx). */
.state-photo { height: 247px; margin: 22px 0 0; overflow: hidden; border-radius: 24px; background: var(--app-track); animation: fade-up 600ms var(--app-ease) both; }
.state-photo img { display: block; width: 100%; height: 100%; object-fit: cover; animation: state-settle 900ms var(--app-ease) both; }
.state-card { display: grid; gap: 8px; margin-top: 16px; padding: 10px 18px; border: 1px solid var(--app-track); border-radius: 16px; background: var(--app-surface); align-content: start; animation: fade-up 420ms var(--app-ease) 260ms backwards; }
.state-row { display: flex; /* icon on the left in both languages (EN/AR frames) */ min-height: 34px; align-items: center; gap: 14px; margin: 0; color: var(--app-deep); text-decoration: none; animation: fade-up 420ms var(--app-ease) backwards; animation-delay: calc(var(--i, 0) * 90ms + 360ms); transition: transform 160ms ease; }
a.state-row:active { transform: scale(0.97); }
a.state-row:hover span { text-decoration: underline; text-underline-offset: 4px; }
.state-row .glyph { width: 20px; height: 20px; flex: none; }
.state-row span { flex: 1; font-size: 13px; line-height: 1.31; font-weight: 700; }
html[dir='rtl'] .state-row span, html[dir='rtl'] .state-note { font-family: var(--app-font-ar); }
.state-card--offline .state-row:first-child .glyph { animation: state-breathe 2.6s ease-in-out infinite; }
.state-footer { padding-top: 20px; }
.state-note { margin: 0; font-size: 12px; line-height: 1.31; color: var(--app-muted); text-align: center; }
.state-cta { margin-top: 14px; }
@keyframes state-settle { from { transform: scale(1.08); } to { transform: none; } }
@keyframes state-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* AR_61-64 My journey today and routines (mobile components/AiAYRitual.tsx). */
.ritual-page { min-height: var(--app-free-h); }
.ritual-back { align-self: flex-start; margin: 0; }
.ritual-kicker { margin: 12px 0 0; font-size: 11px; line-height: 1.3; font-weight: 700; color: var(--app-accent); }
.ritual-title { margin: 8px 0 0; font-size: 25.5px; line-height: 1.3; font-weight: 700; color: var(--app-ink); }
.ritual-lead { margin: 10px 0 0; font-size: 13.7px; line-height: 1.31; color: var(--app-muted); }
html[dir='rtl'] .ritual-page { font-family: var(--app-font-ar); }
.ritual-hero { position: relative; height: 136px; margin-top: 18px; overflow: hidden; border-radius: 19px; background: var(--app-track); }
.ritual-hero::before { content: ''; position: absolute; inset: 0; background: var(--hero) center / cover no-repeat; animation: state-settle 1s var(--app-ease) both; }
.ritual-hero__card { position: absolute; top: 16px; bottom: 15px; inset-inline-start: 13px; display: flex; width: 62%; flex-direction: column; justify-content: center; padding: 0 13px; border-radius: 14px; background: color-mix(in srgb, var(--app-surface) 91%, transparent); animation: fade-up 480ms var(--app-ease) 320ms backwards; }
.ritual-hero__eyebrow { margin: 0; font-size: 12px; line-height: 1.25; font-weight: 700; color: var(--app-accent); }
.ritual-hero__message { margin: 6px 0 0; font-size: 17.5px; line-height: 1.26; font-weight: 700; color: var(--app-deep); }
.ritual-hero__tag { position: absolute; top: 14px; inset-inline-end: 14px; display: inline-flex; min-width: 99px; height: 30px; align-items: center; justify-content: center; padding: 0 12px; border-radius: 15px; background: var(--app-surface); font-size: 12px; font-weight: 700; color: var(--app-deep); animation: fade-up 480ms var(--app-ease) 320ms backwards; }
.ritual-progress { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }
.ritual-progress p { margin: 0; font-weight: 700; }
.ritual-progress__caption { font-size: 15px; color: var(--app-ink); }
.ritual-progress__count { font-size: 13px; color: var(--app-accent); }
.ritual-track { height: 7px; margin-top: 10px; overflow: hidden; border-radius: 5px; background: var(--app-sand); }
.ritual-track span { display: block; width: var(--fill, 0%); height: 100%; border-radius: 5px; background: var(--app-accent); animation: ritual-fill 700ms var(--app-ease) 300ms backwards; }
.ritual-section { margin: 20px 0 0; padding: 0; font-size: 16px; line-height: 1.25; font-weight: 700; color: var(--app-ink); }
.ritual-rows { display: grid; gap: 9px; margin-top: 10px; }
.ritual-rows--loose { gap: 13px; }
.ritual-row {
    display: flex;
    min-height: 77px;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--app-track);
    border-radius: 16px;
    background: var(--app-surface);
    color: inherit;
    text-decoration: none;
    animation: fade-up 420ms var(--app-ease) backwards;
    animation-delay: calc(var(--i, 0) * 70ms + 320ms);
    transition: transform 160ms ease, border-color 200ms ease;
}
.ritual-row:hover { border-color: var(--app-accent); }
.ritual-row:active { transform: scale(0.985); }
.ritual-row.is-tinted { border-color: color-mix(in srgb, var(--app-accent) 25%, var(--app-soft)); background: var(--app-soft); }
.ritual-row__icon { display: inline-flex; width: 45px; height: 45px; flex: none; align-items: center; justify-content: center; border-radius: 13px; background: var(--app-search); }
.ritual-row.is-tinted .ritual-row__icon { background: color-mix(in srgb, var(--app-accent) 15%, var(--app-soft)); }
.ritual-row__icon .glyph { width: 23px; height: 23px; }
.ritual-row__text { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.ritual-row__title { font-size: 15px; line-height: 1.25; font-weight: 700; color: var(--app-deep); }
.ritual-row__line { margin-top: 5px; font-size: 12.7px; line-height: 1.25; color: var(--app-muted); }
.ritual-row__arrow { display: inline-flex; width: 22px; flex: none; justify-content: center; }
.ritual-row__arrow .glyph { width: 19px; height: 19px; }
.g-line-arrow { fill: none; stroke: var(--app-muted); stroke-linecap: round; stroke-linejoin: round; }
.ritual-row.is-tinted .g-line-arrow { stroke: var(--glyph-accent); }
.ritual-row.is-tinted:not(.is-done) .ritual-row__arrow .glyph { animation: ritual-lean 3.2s ease-in-out 1.6s infinite; }
html[dir='ltr'] .ritual-row.is-tinted:not(.is-done) .ritual-row__arrow .glyph { animation-name: ritual-lean-ltr; }
.ritual-footer { padding-top: 24px; }
.ritual-note { margin: 0; font-size: 12.7px; line-height: 1.26; color: var(--app-muted); text-align: center; }
.ritual-cta { height: 55px; margin-top: 18px; border-radius: 15px; }
.ritual-form { display: flex; flex: 1; flex-direction: column; }
.ritual-choices-set { margin: 0; padding: 0; border: 0; }
.ritual-choices-set + .ritual-choices-set { margin-top: 4px; }
.ritual-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.ritual-choice { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--app-track); border-radius: 16px; background: var(--app-surface); cursor: pointer; animation: fade-up 420ms var(--app-ease) backwards; animation-delay: calc(var(--i, 0) * 60ms + 160ms); transition: background-color 220ms ease, border-color 220ms ease; }
.ritual-choice--tall { height: 82px; }
.ritual-choice--minutes { height: 64px; }
.ritual-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ritual-choice span { font-size: 13px; font-weight: 700; color: var(--app-deep); }
.ritual-choice--minutes span { font-size: 17.5px; }
.ritual-choice .glyph { width: 24px; height: 24px; }
.ritual-choice:has(input:checked) { border-color: color-mix(in srgb, var(--app-accent) 25%, var(--app-soft)); background: var(--app-soft); animation: tile-pop 380ms var(--app-ease); }
.ritual-choice--minutes:has(input:checked) span { color: var(--app-accent); }
.ritual-choice:has(input:focus-visible) { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.ritual-suggestion { min-height: 139px; margin-top: 32px; padding: 16px 18px; border-radius: 18px; background: var(--app-search); }
.ritual-suggestion__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15.5px; font-weight: 700; color: var(--app-deep); }
.ritual-suggestion__title .glyph { width: 22px; height: 22px; flex: none; }
.ritual-suggestion__body { margin: 18px 0 0; font-size: 13.6px; line-height: 1.4; color: var(--app-muted); }
.ritual-suggestion__body.is-changing { animation: fade-up 320ms var(--app-ease); }
@keyframes ritual-fill { from { width: 0; } }
@keyframes ritual-lean { 0%, 84%, 100% { transform: none; } 92% { transform: translateX(-4px); } }
@keyframes ritual-lean-ltr { 0%, 84%, 100% { transform: scaleX(-1); } 92% { transform: scaleX(-1) translateX(-4px); } }

/* AR_65-68 The calm routine (templates/app/calm_routine.html, mobile screens/CalmRoutineScreen.tsx) */
.calm-bars { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
html[dir='rtl'] .calm-bars { flex-direction: row-reverse; }
.calm-bar { width: 17px; height: 6px; border-radius: 3px; background: var(--app-sand); }
.calm-bar.is-active { width: 28px; background: var(--app-accent); animation: calm-bar-grow 360ms var(--app-ease) both; }
@keyframes calm-bar-grow { from { width: 17px; } to { width: 28px; } }

.calm-ring { position: relative; display: grid; place-items: center; width: 248px; height: 248px; margin: 33px auto 0; border-radius: 50%; background: var(--app-sand); }
.calm-ring__inner { position: absolute; inset: 13px; border-radius: 50%; background: var(--app-soft); transform: scale(.9); transition: transform var(--phase-ms, 4s) ease-in-out; }
.calm-ring[data-phase='0'] .calm-ring__inner, .calm-ring[data-phase='1'] .calm-ring__inner { transform: none; }
.calm-ring[data-phase='1'] .calm-ring__inner { transition: none; }
.calm-ring__content { position: relative; display: flex; flex-direction: column; align-items: center; }
.calm-ring__content .glyph { width: 50px; height: 50px; }
.calm-ring__title { margin-top: 27px; font-size: 21.5px; line-height: 1.2; font-weight: 700; color: var(--app-deep); text-align: center; }
.calm-ring__count { margin-top: 10px; font-size: 15.2px; line-height: 1.2; color: var(--app-muted); }
.calm-guide { margin: 30px 11px 0; font-size: 14.2px; line-height: 1.32; color: var(--app-muted); text-align: center; }
.calm-phases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.calm-phase { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; height: 75px; border-radius: 15px; background: var(--app-search); transition: background-color 300ms ease; }
.calm-phase.is-lit { background: var(--app-soft); --glyph-deep: var(--app-accent); }
.calm-phase.is-lit .glyph { animation: pop 420ms var(--app-ease); }
.calm-phase__label { font-size: 12.7px; line-height: 1.2; font-weight: 700; color: var(--app-deep); }
.calm-note { margin-top: 18px; }

.calm-photo { position: relative; overflow: hidden; background: var(--app-track); }
.calm-photo img { display: block; width: 100%; height: 100%; object-fit: cover; animation: photo-drift 1200ms var(--app-ease) both; }
.calm-photo--sea { height: 242px; margin-top: 28px; border-radius: 20px; }
.calm-photo--reflect { height: 140px; margin-top: 26px; border-radius: 18px; }
.calm-photo--lake { height: 169px; margin-top: 10px; border-radius: 19px; }
.calm-sea-label { position: absolute; inset: auto 11px 11px; display: flex; align-items: center; gap: 12px; height: 51px; padding: 0 24px; border-radius: 14px; background: color-mix(in srgb, var(--app-surface) 93%, transparent); font-size: 16.7px; font-weight: 700; color: var(--app-deep); --glyph-deep: var(--app-accent); animation: fade-up 480ms var(--app-ease) 320ms both; }
.calm-player { position: relative; display: grid; place-items: center; height: 48px; margin: 22px 25px 0; }
.calm-track { position: absolute; inset: 21px 0 auto; height: 6px; overflow: hidden; border-radius: 3px; background: var(--app-sand); }
.calm-track__fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 3px; background: var(--app-accent); transition: width 1s linear; }
html[dir='ltr'] .calm-track__fill { inset: 0 0 0 auto; }
.calm-play { position: relative; display: grid; place-items: center; width: 48px; height: 48px; padding: 0 0 0 2px; border: 0; border-radius: 50%; background: var(--app-deep); cursor: pointer; transition: transform 160ms ease; }
.calm-play:active { transform: scale(.94); }
.calm-play.is-playing { animation: soft-pulse 2.8s ease-in-out infinite; padding: 0; }
.calm-play__icon { display: grid; }
.calm-play__icon--pause, .calm-play.is-playing .calm-play__icon--play { display: none; }
.calm-play.is-playing .calm-play__icon--pause { display: grid; }
.calm-timer { min-height: 15px; margin-top: 21px; font-size: 12.2px; }

.calm-form { display: flex; flex: 1; flex-direction: column; }
.calm-question { display: block; margin-top: 14px; font-size: 19.5px; line-height: 1.28; font-weight: 700; color: var(--app-deep); }
.calm-entry { width: 100%; height: 174px; margin-top: 8px; padding: 18px; border: 1px solid var(--app-track); border-radius: 18px; background: var(--app-surface); font: inherit; font-size: 14.2px; line-height: 1.4; color: var(--app-ink); resize: none; transition: border-color 200ms ease; }
.calm-entry::placeholder { color: var(--app-muted); }
.calm-entry:focus { outline: none; border-color: var(--app-accent); }
.calm-private { display: flex; align-items: center; gap: 12px; min-height: 64px; margin: 23px 0 0; padding: 0 16px; border-radius: 14px; background: var(--app-search); font-size: 12.7px; line-height: 1.26; color: var(--app-muted); }
.calm-private .glyph { flex: none; }

.calm-emblem { display: grid; place-items: center; width: 84px; height: 84px; margin: 33px auto 0; border-radius: 50%; background: var(--app-soft); animation: pop 520ms var(--app-ease) 260ms both; }
.calm-emblem .glyph { width: 38px; height: 38px; animation: twinkle 3.6s ease-in-out 800ms infinite; }
.calm-heading { margin: 30px 10px 0; font-size: 23px; line-height: 1.22; font-weight: 700; color: var(--app-deep); text-align: center; }
.calm-body { margin: 24px 12px 0; font-size: 14.2px; line-height: 1.27; color: var(--app-muted); text-align: center; }
.calm-badge { align-self: center; min-width: 122px; height: 30px; margin: 22px auto 0; padding: 0 14px; border-radius: 15px; background: var(--app-sand); font-size: 12.2px; line-height: 30px; font-weight: 700; color: var(--app-deep); text-align: center; }
html[dir='rtl'] .calm-page { font-family: var(--app-font-ar); }

@media (prefers-reduced-motion: reduce) {
    .calm-ring__inner, .calm-track__fill { transition: none; }
    .calm-bar.is-active, .calm-phase.is-lit .glyph, .calm-photo img, .calm-sea-label, .calm-play.is-playing,
    .calm-emblem, .calm-emblem .glyph { animation: none; }
}

/* ------------------------------------------------ 09 Sounds (Figma AIAY FINAL) */
.sound-hero { position: relative; display: flex; min-height: 232px; flex-direction: column; justify-content: flex-end; padding: 0 24px 50px;
    background: linear-gradient(color-mix(in srgb, var(--app-ink) 43%, transparent), color-mix(in srgb, var(--app-ink) 43%, transparent)), var(--hero) center / cover; color: var(--app-on-photo); }
.sound-hero__back { position: absolute; top: calc(30px + env(safe-area-inset-top)); inset-inline-start: 23px; }
.sound-hero__title, .sound-plain__title { margin: 0; font-size: 31px; line-height: 41px; font-weight: 600; }
.sound-hero__lead { margin: 5px 0 0; font-size: 14px; line-height: 19px; }
.sound-plain { padding-bottom: 0; }
.sound-plain__title { margin-top: 30px; color: var(--app-ink); }
.sound-plain__lead { margin: 4px 0 0; font-size: 14px; line-height: 19px; color: var(--app-muted); }
.sound-sheet { position: relative; padding: 23px 24px 32px; background: var(--app-canvas); }
.sound-sheet--overlap { margin-top: -11px; border-radius: 24px 24px 0 0; }
.sound-chips { display: flex; justify-content: space-between; margin-bottom: 16px; }
.sound-chip { min-width: 62px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 16px; font-size: 12px; color: var(--app-muted); text-decoration: none; }
.sound-chip.is-on { background: var(--app-ink); color: var(--app-canvas); font-weight: 600; }
.sound-cards { display: grid; gap: 16px; }
.sound-card { display: flex; min-height: 96px; align-items: center; gap: 14px; padding: 8px; border-radius: 16px; background: var(--app-surface);
    animation: fade-up 420ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 60ms + 80ms); }
.sound-card__cover { width: 80px; height: 80px; flex: none; border-radius: 10px; object-fit: cover; background: var(--app-track); }
.sound-card__text { display: flex; flex: 1; flex-direction: column; gap: 4px; }
.sound-card__title { font-size: 14px; line-height: 19px; font-weight: 600; color: var(--app-ink); }
.sound-card__meta { font-size: 11px; color: var(--app-muted); }
.sound-card__fav { margin: 0; }
.sound-card__play { display: inline-flex; width: 32px; height: 32px; flex: none; margin-inline: 4px 12px; align-items: center; justify-content: center; border-radius: 50%; background: var(--app-deep); color: var(--app-on-deep); }
.sound-level-note { margin: 24px 0 0; font-size: 12px; text-align: center; color: var(--app-muted); }
.sounds-hero { display: flex; height: 126px; margin-top: 34px; align-items: flex-end; padding: 18px; border-radius: 18px; color: var(--app-on-photo); font-size: 18px; font-weight: 600; text-decoration: none;
    background: linear-gradient(color-mix(in srgb, var(--app-ink) 30%, transparent), color-mix(in srgb, var(--app-ink) 30%, transparent)), var(--cover) center / cover; }
.sounds-section { margin: 26px 0 0; font-size: 17px; line-height: 22px; font-weight: 700; color: var(--app-ink); }
.sounds-section-row { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; }
.sounds-section-row .sounds-section { margin: 0; }
.sounds-more { font-size: 12px; font-weight: 600; color: var(--app-accent); text-decoration: none; }
.sounds-needs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.sounds-need { display: flex; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--app-track); border-radius: 22px; background: var(--app-gold); font-size: 13px; font-weight: 600; color: var(--app-deep); text-decoration: none; }
.sounds-popular { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.sounds-popular__card { display: flex; height: 171px; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 14px; border-radius: 18px; color: var(--app-on-photo); text-decoration: none;
    background: linear-gradient(color-mix(in srgb, var(--app-ink) 25%, transparent), color-mix(in srgb, var(--app-ink) 25%, transparent)), var(--cover) center / cover; }
.sounds-popular__title { font-size: 15px; font-weight: 700; }
.sounds-popular__line { font-size: 12px; }
.sound-discovery__bar { display: flex; align-items: center; justify-content: space-between; }
.sound-discovery__title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; color: var(--app-ink); }
.sound-discovery__cards { display: grid; gap: 15px; margin-top: 40px; }
.sound-discovery__card { display: flex; height: 118px; flex-direction: column; justify-content: center; gap: 6px; padding: 0 20px; border-radius: 18px; color: var(--app-on-photo); text-decoration: none;
    background: linear-gradient(color-mix(in srgb, var(--app-ink) 35%, transparent), color-mix(in srgb, var(--app-ink) 35%, transparent)), var(--cover) center / cover;
    animation: fade-up 420ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 70ms + 80ms); }
.sound-discovery__name { font-size: 20px; line-height: 26px; font-weight: 700; }
.sound-discovery__line { font-size: 13px; }
.status-page__title { margin: 45px 0 0; font-size: 25px; line-height: 34px; font-weight: 700; color: var(--app-ink); }
html[dir='rtl'] .status-page__title { font-family: var(--app-font-ar); }
.status-page__body { margin: 66px 0 0; font-size: 13px; line-height: 18px; color: var(--app-muted); }
.status-page__cta { margin-top: 220px; border-radius: 17px; }
.status-page__link { display: block; margin-top: 26px; font-size: 13px; text-align: center; color: var(--app-deep); }
.status-page__spinner { display: block; width: 44px; height: 44px; margin: 40px auto 0; border: 3px solid var(--app-track); border-top-color: var(--app-accent); border-radius: 50%; animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
html[dir='rtl'] .state-row { flex-direction: row-reverse; }
/* My space, Language, Privacy: the AR frames keep the tile on the left */
html[dir='rtl'] .option-cards--keep-left .option-card { flex-direction: row-reverse; }

/* 12 Premium / 02 Sounds benefits (mobile PremiumSoundsScreen) */
.premium-sounds { --premium-tint: color-mix(in srgb, var(--app-ink) 58%, transparent); position: relative; min-height: var(--app-free-h); display: flex; flex-direction: column; padding: var(--app-page-top) 24px 24px; color: var(--app-on-photo);
    background: linear-gradient(var(--premium-tint), var(--premium-tint)), var(--photo) center / cover no-repeat, var(--app-deep); }
.premium-sounds__back { align-self: flex-start; }
.premium-sounds__brand { margin: 40px 0 0; font-size: 12px; line-height: 30px; font-weight: 700; letter-spacing: 1px; text-align: center; color: var(--icon-gold); }
.premium-sounds__title { margin: 40px 0 0; font-size: 31px; line-height: 41px; font-weight: 700; text-align: center; white-space: pre-line; color: var(--app-on-photo); }
.premium-sounds__lead { margin: 24px 0 0; font-size: 15px; line-height: 20px; text-align: center; color: color-mix(in srgb, var(--app-on-photo) 85%, transparent); }
html[dir='rtl'] .premium-sounds__title, html[dir='rtl'] .premium-sounds__lead, html[dir='rtl'] .premium-sounds__benefit { font-family: var(--app-font-ar); }
.premium-sounds__benefits { display: flex; flex-direction: column; gap: 26px; margin: 50px 0 40px; padding: 0 24px; list-style: none; }
.premium-sounds__benefit { display: flex; align-items: center; gap: 16px; font-size: 15px; line-height: 22px; font-weight: 500;
    animation: fade-up 520ms var(--app-ease) backwards; animation-delay: calc(var(--i, 0) * 70ms + 120ms); }
.premium-sounds__point { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--icon-gold); }
.premium-sounds__point .glyph { width: 12px; height: 12px; }
.premium-sounds__cta { margin-top: auto; height: 57px; border-radius: 28px; }

/* 12 Premium / 03-10 Plan selection DEMO (mobile PlanDemoScreen) */
.plan-demo__brand { margin: 4px 0 0; font-size: 12px; line-height: 18px; font-weight: 700; letter-spacing: 1px; color: var(--app-accent); }
.plan-demo__title { margin: 24px 0 0; font-size: 25px; line-height: 34px; font-weight: 700; color: var(--app-ink); }
.plan-demo__lead { margin: 18px 0 0; font-size: 13px; line-height: 18px; color: var(--app-muted); }
html[dir='rtl'] .plan-demo__title, html[dir='rtl'] .plan-demo__lead { font-family: var(--app-font-ar); }
.plan-demo__band { display: flex; align-items: center; justify-content: center; min-height: 42px; margin: 42px 0 0; padding: 0 9px; border-radius: 12px;
    font-size: 12px; line-height: 17px; font-weight: 700; text-align: center; background: var(--app-sand); color: var(--app-deep); }
.plan-demo__plans { display: flex; flex-direction: column; gap: 15px; margin-top: 25px; }
.plan-demo__plan { display: flex; flex-direction: column; min-height: 99px; padding: 14px 18px; border: 1px solid var(--app-track); border-radius: 18px;
    background: var(--app-surface); text-decoration: none; transition: border-color 160ms, background-color 160ms; }
.plan-demo__plan.is-selected { border: 1.5px solid var(--app-deep); background: var(--app-soft); }
.plan-demo__name { font-size: 16px; line-height: 22px; font-weight: 700; color: var(--app-deep); }
.plan-demo__price { display: block; margin-top: 2px; font-size: 24px; line-height: 32px; font-weight: 700; color: var(--app-ink); }
.plan-demo__period { display: block; margin-top: 2px; font-size: 11px; line-height: 15px; color: var(--app-muted); }
.plan-demo__sample { margin: 2px 0 0; font-size: 12px; line-height: 17px; text-align: center; color: var(--app-muted); }
.plan-demo__summary { display: flex; flex-direction: column; min-height: 232px; margin-top: 30px; padding: 20px; border: 1px solid var(--app-track); border-radius: 20px; background: var(--app-surface); }
.plan-demo__summary-title { margin: 0; font-size: 17px; line-height: 24px; font-weight: 700; color: var(--app-ink); }
.plan-demo__name--summary { margin-top: 40px; }
.plan-demo__note { margin: 70px 0 0; font-size: 13px; line-height: 18px; color: var(--app-muted); }
.plan-demo__disclosure { margin: 30px 0 0; font-size: 11px; line-height: 15px; text-align: center; color: var(--app-muted); }
.plan-demo__cta { margin-top: 30px; height: 55px; border-radius: 18px; }
.plan-demo__secondary { display: block; margin-top: 20px; font-size: 13px; line-height: 17px; font-weight: 500; text-align: center; color: var(--app-deep); }

/* Figma 08 Morning stretch / Step 1-3 and Paused on the web (mobile MovementRoutineScreen step mode). */
.is-started .routine-step:not(.is-current) { display: none; }
.routine-actions { display: flex; justify-content: center; gap: 12px; margin-top: 24px; }
.routine-actions[hidden] { display: none; }
.routine-action { min-width: 96px; padding: 10px 18px; border: 1px solid var(--app-track); border-radius: 20px; background: var(--app-sand);
    color: var(--app-deep); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
html[dir='rtl'] .routine-action { font-family: var(--app-font-ar); }
