/* ============================================================================
   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: 500; 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); }
.sign-author { margin: 10px 0 0; font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--app-muted); }
.sign-author a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.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); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; } /* our own clear button */
.search__clear {
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-inline-end: -6px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--app-muted);
    cursor: pointer;
}
.search__clear[hidden] { display: none; }
.search__clear svg { width: 16px; height: 16px; }
.search__clear:focus-visible { outline: 2px solid var(--app-primary, currentColor); outline-offset: 1px; }
.explore-results__label { margin-top: 24px; }

.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%);
    /* Arabic mirrors the bar: Home on the right (AIAY | EN - 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: 500; 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: 44px; line-height: 18px; } /* frames: heading 104, subheading 182 */
.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: 1; flex-direction: column; gap: 26px; margin-top: 53px; }
/* Note and button at the bottom (frames: note 675, button 741 of 844). */
.choices .setup-note { margin-top: auto; padding-top: 6px; }

.choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    padding: 0 14px;
    border: 1px solid var(--app-track);
    border-radius: 15px; /* ROW cards in the AIAY | EN - AR frames: white, 1px border, radius 15 */
    background: var(--app-surface);
    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); }
/* Selection / checked: a 2px accent outline (padding takes the extra pixel so nothing moves). */
.choice.is-selected { background: var(--app-surface); border: 2px solid var(--app-accent); padding: 0 13px; }
.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: 24px; height: 52px; border-radius: 17px; font-size: 15px; font-weight: 500; }

/* 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 { position: relative; height: 533px; overflow: hidden; background: var(--app-canvas); }
/* Figma 01 · First Sign: no photo - the welcome's beam and sparkle, centred, under a faint cream tint. */
.first-light__tint { position: absolute; inset: 0 0 auto; height: 81px; background: rgba(244, 232, 212, 0.2); }
.first-light { position: absolute; left: 50%; pointer-events: none; }
.first-light--beam { top: 232.26px; width: 10.864px; height: 308.03px; margin-left: -5.432px; }
.first-light--sparkle { top: 101.11px; width: 82.299px; height: 166.639px; margin-left: -41.15px; animation: soft-pulse 3.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .first-light { animation: none; } }
/* The sheet starts at 324 of the 533px hero. */
.sheet--first { position: relative; margin-top: -209px; padding: 21px 24px 32px; border-radius: 24px; background: var(--app-canvas); }
.first-title { margin-top: 17px; font-size: 26px; line-height: 35px; font-weight: 500; }
.first-desc { margin-top: 27px; font-size: 15px; line-height: 20px; }
.first-secondary { margin: 51px 0 0; font-size: 14px; line-height: 19px; color: var(--app-deep); }
.first-cta { margin-top: 47px; height: 52px; border-radius: 17px; font-size: 15px; font-weight: 500; }

.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; }
.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; }
/* "Or continue with" + Apple/Google (app/_auth_social.html; Figma 02 Account / 01 Create Account) */
.auth-social { margin-top: 25px; padding: 0 15px; }
.auth-social__or { display: flex; align-items: flex-end; margin: 0; font-size: 12px; line-height: 16px; color: var(--app-muted); text-align: center; }
.auth-social__or span { flex: none; width: 65px; height: 1px; margin-bottom: 1px; background: var(--app-track); }
.auth-social__or span:first-child { margin-inline-end: auto; }
.auth-social__or span:last-child { margin-inline-start: auto; }
.auth-social__buttons { display: flex; justify-content: center; gap: 16px; margin-top: 39px; }
.auth-social__btn {
    flex: 1;
    max-width: 143px;
    height: 55px;
    padding: 5px 0 0; /* the marks sit 6px from the top, as drawn */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    border: 1px solid var(--app-track);
    border-radius: 14px;
    background: var(--app-canvas);
    cursor: pointer;
    transition: transform 160ms var(--app-ease), border-color 160ms ease;
}
.auth-social__btn:active { transform: scale(0.97); }
.auth-social__btn:focus-visible { outline: 3px solid var(--aiay-focus-ring, var(--app-accent)); outline-offset: 2px; }
.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: 52px;
    border: 0;
    border-radius: 17px;
    background: var(--app-deep);
    color: var(--app-on-deep);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 20px;
    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 */
/* A short "video": the 01 Welcome photo fills the screen (same framing - 1.5x as wide
   as tall, the woman left of centre) and slowly pushes in; the sun's glow breathes, the
   brand star blooms in over the sun with a halo, its beam draws down to the floor and
   the star keeps glowing. Light layers use the 01 Welcome frame metrics (hero 536px:
   glow 141x129 @226, beam 10.9x308 @232, sparkle 82x167 @101), scaled to the screen. */
.page-ar-splash .app-shell { padding-bottom: 0; }
.splash-video { position: relative; display: block; height: 100vh; height: 100dvh; overflow: hidden; background: #E9B984; transition: opacity 380ms ease; }
.splash-video.is-leaving { opacity: 0; }
.splash-video__scene { --h: 100vh; --sun-x: calc(50% + var(--h) * 1.5 * (0.403 - 0.372)); position: absolute; inset: 0; }
@supports (height: 100dvh) { .splash-video__scene { --h: 100dvh; } }
.splash-video__photo {
    position: absolute; top: 0; left: calc(50% - var(--h) * 1.5 * 0.372);
    width: calc(var(--h) * 1.5); height: 100%; max-width: none; object-fit: cover;
    transform-origin: 40% 45%;
    animation: splash-push 4.2s cubic-bezier(.25, .6, .3, 1) both;
}
.splash-video__light { position: absolute; pointer-events: none; }
.splash-video__glow {
    top: calc(var(--h) * 226 / 536); left: calc(var(--sun-x) - var(--h) * 70.5 / 536);
    width: calc(var(--h) * 141 / 536); height: calc(var(--h) * 129 / 536);
    animation: splash-fade 900ms 200ms ease-out both, splash-breathe 2.6s 1.1s ease-in-out infinite;
}
.splash-video__beam {
    top: calc(var(--h) * 232.26 / 536); left: calc(var(--sun-x) - var(--h) * 5.432 / 536);
    width: calc(var(--h) * 10.864 / 536); height: calc(var(--h) * 308.03 / 536);
    transform-origin: top center;
    animation: splash-beam 1100ms 900ms cubic-bezier(.2, .8, .2, 1) both, splash-shimmer 2.4s 2s ease-in-out infinite;
}
.splash-video__halo {
    top: calc(var(--h) * 120 / 536); left: calc(var(--sun-x) - var(--h) * 70 / 536);
    width: calc(var(--h) * 140 / 536); height: calc(var(--h) * 130 / 536);
    animation: splash-fade 800ms 600ms ease-out both, splash-halo 1.8s 1.4s ease-in-out infinite;
}
.splash-video__star {
    top: calc(var(--h) * 101.11 / 536); left: calc(var(--sun-x) - var(--h) * 41.15 / 536);
    width: calc(var(--h) * 82.299 / 536); height: calc(var(--h) * 166.639 / 536);
    filter: drop-shadow(0 0 10px rgba(255, 244, 214, .9)) drop-shadow(0 0 26px rgba(255, 214, 150, .7));
    animation: splash-star 1000ms 500ms cubic-bezier(.3, 1.5, .5, 1) both, splash-twinkle 1.8s 1.5s ease-in-out infinite;
}
.splash-video__skip { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; cursor: pointer; }
.splash-video__skip:focus-visible { outline: 3px solid var(--aiay-focus-ring, var(--app-accent)); outline-offset: -6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@keyframes splash-push { from { transform: scale(1.14) translateX(1.5%); } to { transform: scale(1.02); } }
@keyframes splash-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes splash-breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .75; transform: scale(1.12); } }
@keyframes splash-beam { from { opacity: 0; transform: scaleY(0); } to { opacity: 1; transform: none; } }
@keyframes splash-shimmer { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }
@keyframes splash-halo { 0%, 100% { opacity: .9; transform: scale(1); } 50% { opacity: .55; transform: scale(1.25); } }
@keyframes splash-star { from { opacity: 0; transform: scale(0) rotate(-45deg); } to { opacity: 1; transform: none; } }
@keyframes splash-twinkle { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255, 244, 214, .9)) drop-shadow(0 0 26px rgba(255, 214, 150, .7)); } 50% { transform: scale(1.08); filter: drop-shadow(0 0 16px rgba(255, 248, 226, 1)) drop-shadow(0 0 40px rgba(255, 214, 150, .9)); } }
@media (prefers-reduced-motion: reduce) {
    .splash-video__photo, .splash-video__light { animation: none; }
    .splash-video.is-leaving { transition: none; }
}

/* ----------------------------------------------------------- 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);
}
/* Brand star over the "I" of AIAY (mirror of the mobile components/AiAYWordmark.tsx).
   Sizes come from variables (01 Welcome: the 30x40 brand star). */
.ar-welcome__brand--star-on-i {
    --star-w: 30px;
    --star-h: 40px;
    --star-gap: 8px;
    --letter-gap: 4px;
    display: block;
    padding-top: calc(var(--star-h) + var(--star-gap));
    text-align: center;
}
.ar-welcome__brand--star-on-i .ar-welcome__wordmark {
    display: inline-block;
    /* Latin in every language; keep "AIAY" left-to-right on Arabic pages */
    direction: ltr;
    unicode-bidi: isolate;
    letter-spacing: var(--letter-gap);
    /* letter-spacing also trails the last letter; balance it so the word stays centred */
    padding-left: var(--letter-gap);
}
.ar-welcome__i { position: relative; display: inline-block; }
/* Centred over the I's glyph - the I's box includes its trailing letter-spacing */
.ar-welcome__star {
    position: absolute;
    bottom: calc(100% + var(--star-gap));
    left: calc(50% - var(--letter-gap) / 2 - var(--star-w) / 2);
    width: var(--star-w);
    height: var(--star-h);
    letter-spacing: 0;
    line-height: 0;
}
.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: 25px 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:not(.ar-splash) .ar-btn { max-width: 342px; }
.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; }
/* Figma 02 Life areas: 44px back target, title 92, subtitle 171, cards 244, note 656, Continue 724. */
.ar-areas { display: flex; flex-direction: column; padding: var(--app-page-top) 24px calc(36px + env(safe-area-inset-bottom)); }
.ar-areas .ar-back { width: 44px; height: 44px; margin-inline-start: -10px; align-items: center; justify-content: center; }
.ar-back { display: inline-flex; align-self: flex-start; color: var(--app-deep); }
.ar-areas__title { margin: 0; font-size: 26px; line-height: 35px; font-weight: 500; color: var(--app-ink); }
.ar-areas__sub { margin: 9px 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); }
/* Selection / checked: white stays, a 2px accent outline. */
.ar-area-card.is-selected { background: var(--app-surface); border: 2px solid var(--app-accent); }
.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: 19px;
    font-weight: 500;
    text-align: center;
    color: var(--app-deep);
}
/* Check top-right in the EN frames (left 142 of 165); the AR frames mirror it. */
.ar-area-card__check {
    position: absolute;
    top: 10px;
    right: 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 { right: auto; left: 10px; }
.ar-area-card.is-selected .ar-area-card__check { opacity: 1; transform: none; }
.ar-areas__note { margin: auto 0 0; padding-top: 32px; font-size: 12px; line-height: 16px; text-align: center; color: var(--app-muted); }
.ar-areas .ar-btn { margin-top: 52px; height: 50px; border-radius: 16px; font-size: 14px; font-weight: 500; }

/* ----------------------------------------------------------- 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: 500; 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); }
/* Figma 03 Sign Preferences: rows show only their title (the value line is kept for screen readers). */
.prefs-row__detail { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.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; }
/* Auth pages: subheading 10px under the heading (Figma 02 Account) */
.auth .setup-heading.t-serif + .setup-sub { margin-top: 10px; }
.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: 14px 10px; margin-top: 28px; 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: 28px 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: 16px 18px 10px; 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; flex: 1; width: 100%; align-items: flex-end; justify-content: space-between; }
html[dir='rtl'] .progress-chart__bars { flex-direction: row-reverse; }
.progress-chart__day { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.progress-chart__label { font-size: 11px; line-height: 14px; color: var(--app-muted); }
.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; }
.areas-link--icon { display: inline-flex; align-items: center; gap: 6px; }

/* Themes: icon style (Classic / Sculpted / Editorial / Soft inlay) under the colour moods */
.theme-section-title { margin: 32px 0 0; font-size: 16px; line-height: 1.4; font-weight: 700; color: var(--app-ink); }
.theme-section-lead { margin-top: 6px; }
/* My theme's icon style sheet (templates/app/themes.html): opens on a mood tap; its previews
   read the picked mood's --icon-* / --preview-* (set by the page script), else the page's own.
   Without <dialog> support or JavaScript its content shows inline under the moods. */
.theme-sheet { max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; padding-top: 10px; }
html:not(.has-theme-sheet) .theme-sheet { position: static; display: block; width: auto; margin: 32px 0 0; padding: 0; background: none; }
html:not(.has-theme-sheet) .theme-sheet__grabber, html:not(.has-theme-sheet) .theme-sheet__mood,
html:not(.has-theme-sheet) .theme-sheet .more-sheet__close { display: none; }
.theme-sheet__grabber { align-self: center; width: 40px; height: 4px; margin-bottom: 16px; border-radius: 2px; background: var(--app-track); }
.theme-sheet__mood { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--app-muted); }
.theme-sheet__title { margin-bottom: 0; font-size: 18px; }
.theme-sheet .theme-sheet__lead { margin: 6px 0 0; text-align: center; }
.theme-sheet__cards { margin-top: 18px; }
.theme-sheet__cards .option-card { animation-delay: calc(80ms + var(--i, 0) * 45ms); }
.theme-sheet__footer { padding-top: 18px; }
.theme-sheet__footer .more-sheet__close { display: block; margin-inline: auto; }
html[dir='rtl'] .theme-sheet__mood { font-family: var(--app-font-ar); }
/* Four icons side by side: the tile grows past the 42px square (beats .option-card__tile below) */
.option-card__tile.icon-style-preview { width: auto; min-width: 42px; padding: 0 10px; gap: 6px; background: var(--preview-tile, var(--app-search)); transition: background-color 240ms ease; }
.option-card__tile.icon-style-preview .glyph { width: 18px; height: 18px; }
.option-card:has(input:not(.switch):checked) .option-card__tile.icon-style-preview { background: var(--preview-tile-picked, var(--app-surface)); }
.icon-style-preview .aiay-icon path, .icon-style-preview .aiay-icon circle { transition: fill 240ms ease, stroke 240ms ease; }
.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; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
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: 12px; margin-top: 28px; }
.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; }
/* Life area rows say what they open (and how long), tick once done today, and the
   progress block shows the latest entry from this page. */
.area-row__body { flex: 1; display: grid; gap: 3px; min-width: 0; }
.area-row__body .area-row__text { flex: none; }
.area-row__kind { font-size: 12px; line-height: 1.3; color: var(--app-muted); }
.area-row__end { flex: none; display: inline-flex; opacity: 0.55; }
.area-row.is-done { border-color: color-mix(in srgb, var(--app-accent) 45%, var(--app-track)); background: color-mix(in srgb, var(--app-soft) 40%, var(--app-surface)); }
.area-row.is-done .area-row__kind { color: var(--app-accent); font-weight: 600; }
.area-row.is-done .area-row__end { opacity: 1; animation: pop 320ms var(--app-ease); }
.area-progress { margin-top: 18px; display: grid; gap: 8px; }
.area-progress__line { margin: 0; font-size: 13px; line-height: 1.45; color: var(--app-muted); }
.area-progress__line--done { color: var(--app-accent); font-weight: 600; }
.area-progress__latest { display: grid; gap: 4px; padding: 12px 16px; border-radius: 14px; background: var(--app-search); color: inherit; text-decoration: none; }
.area-progress__label { font-size: 11px; color: var(--app-muted); }
.area-progress__question { font-size: 14px; font-weight: 600; color: var(--app-deep); }

/* 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%, 430px); 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.d5f5299fafa5.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: 500; 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; gap: 8px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.sound-chips::-webkit-scrollbar { display: none; }
.sound-chip { flex-shrink: 0; min-width: 62px; height: 36px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 16px; font-size: 12px; color: var(--app-muted); text-decoration: none; white-space: nowrap; }
.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; width: 100%; }
.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; padding: 0 6px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; transition: transform 160ms ease, background 160ms ease; }
.sounds-need:active { transform: scale(0.96); }
html[dir='rtl'] .sounds-need { font-family: var(--app-font-ar); font-size: 13px; font-weight: 700; }
@media (max-width: 380px) {
    .sounds-need { font-size: 11.5px; padding: 0 2px; }
}
.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: 500; 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: 500; 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); }

/* AIAY | EN - AR frames: screen titles are Inter Medium in English and
   Alexandria Bold in Arabic. */
html[dir='rtl'] :is(.sign-headline, .setup-heading, .why-title, .companion-title, .status-page__title, .plan-demo__title) { font-family: var(--app-font-ar); font-weight: 700; }
html[dir='rtl'] .ar-btn { font-weight: 700; }

/* AIAY | EN - AR frames: the supporting note and the main button sit at the
   bottom of the screen, below the content. Footers are the last child of a
   flex column (.setup, the forms, the sheets), so margin-top:auto pins them. */
:is(.ritual-footer, .option-footer, .why-footer, .area-footer, .state-footer,
    .small-action-footer, .prefs-footer, .inbox-footer, .auth-footer) { margin-top: auto; }
:is(.setup, .sheet--why, .sheet--area, .sheet--done) > form { display: flex; flex: 1; flex-direction: column; }
.choices { flex: 1; }
.choices > .setup-note { margin-top: auto; }

/* 01 Welcome (Figma "AIAY | EN - AR"): the photo is 1.5x as wide as tall, the
   woman left of centre; the three light layers sit on the sun and scale with
   the hero (frame values: hero 536px, glow 141x129 @226, beam 10.9x308 @232,
   sparkle 82x167 @101). */
.ar-welcome { background: var(--app-gold); }
.ar-welcome__hero { --hero-h: min(64vh, 536px); --sun-x: calc(50% + var(--hero-h) * 1.5 * (0.403 - 0.372)); height: var(--hero-h); }
.ar-welcome__photo { position: absolute; top: 0; left: calc(50% - var(--hero-h) * 1.5 * 0.372); width: calc(var(--hero-h) * 1.5); height: 100%; object-fit: cover; animation: photo-drift 2.4s var(--app-ease) both; }
.ar-welcome__light { position: absolute; pointer-events: none; }
.ar-welcome__light--glow { top: calc(var(--hero-h) * 226 / 536); width: calc(var(--hero-h) * 141 / 536); height: calc(var(--hero-h) * 129 / 536); left: calc(var(--sun-x) - var(--hero-h) * 70.5 / 536); animation: soft-glow 3.6s ease-in-out infinite; }
.ar-welcome__light--beam { top: calc(var(--hero-h) * 232.26 / 536); width: calc(var(--hero-h) * 10.864 / 536); height: calc(var(--hero-h) * 308.03 / 536); left: calc(var(--sun-x) - var(--hero-h) * 5.432 / 536); }
.ar-welcome__light--sparkle { top: calc(var(--hero-h) * 101.11 / 536); width: calc(var(--hero-h) * 82.299 / 536); height: calc(var(--hero-h) * 166.639 / 536); left: calc(var(--sun-x) - var(--hero-h) * 41.15 / 536); animation: soft-pulse 3.6s ease-in-out infinite; }
.ar-welcome__panel { background: var(--app-canvas); }
html:not([dir='rtl']) .ar-welcome__title { font-family: var(--app-font); font-size: 32px; line-height: 1.35; font-weight: 500; }
.ar-welcome__body { margin-top: 21px; }
html[dir='rtl'] .ar-welcome__title { font-size: 32px; line-height: 42px; }
/* BUTTON/Begin my journey: 50px, radius 16, 14px / 500. */
.ar-welcome .ar-btn { height: 50px; border-radius: 16px; font-size: 14px; font-weight: 500; }
@keyframes soft-glow { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ar-welcome__photo, .ar-welcome__light { animation: none; } }

/* 03 Home dashboard (Figma "AIAY | EN - AR", 2038:6443) */
.ar-home__photo { height: 144.37%; object-position: top; }
.ar-sign-card__headline.t-serif-sign { font-family: var(--app-font) !important; font-weight: 700 !important; font-size: 23px !important; line-height: 1.35 !important; }
html[dir='rtl'] .ar-sign-card__headline.t-serif-sign { font-family: var(--app-font-ar) !important; font-size: 21px !important; }
.ar-moment-card { display: flex; flex-direction: column; gap: 20px; min-height: 111px; margin-top: 17px; padding: 17px 18px 16px; border-radius: 16px; background: var(--app-sand); color: var(--app-ink); text-decoration: none; transition: transform 160ms var(--app-ease); }
.ar-moment-card:active { transform: scale(0.98); }
.ar-moment-card__title { font-size: 17px; line-height: 25px; font-weight: 700; }
.ar-moment-card__line { font-size: 14px; line-height: 21px; font-weight: 700; }
.ar-moment-card__line--mood { color: var(--app-accent); }
.ar-moment-card { gap: 12px; }
.ar-moment-card--continue .ar-moment-card__line, .ar-moment-card--done .ar-moment-card__line { color: var(--app-deep); font-weight: 500; }
.ar-moment-card__line { display: inline-flex; align-items: center; gap: 8px; animation: fade-up 420ms var(--app-ease) both; }
.ar-moment-card__tick { display: inline-flex; animation: pop 420ms var(--app-ease) both; }
.ar-moment-card__cta { display: inline-flex; align-self: flex-start; align-items: center; gap: 4px; margin-top: auto; font-size: 14px; line-height: 19px;
    font-weight: 700; color: var(--app-accent); transition: gap 200ms var(--app-ease); }
.ar-moment-card:hover .ar-moment-card__cta { gap: 8px; }
.ar-quick-title { font-size: 15px; line-height: 22px; }
.ar-quick-card { border-radius: 16px; }
.ar-quick-card--explore .ar-quick-card__label { font-size: 13px; line-height: 19px; }

/* 03 Today Sign (Figma "AIAY | EN - AR"): cream sheet, the arch photo top-aligned,
   Inter Medium 25 headline and a Medium 13 eyebrow. */
.page-today .hero::before { background-position: top center; }
.sheet--sign.sheet--cream { background: var(--app-canvas); border-radius: 25px 25px 0 0; }
.sign-headline--today { font-size: 25px; line-height: 1.35; }
.sheet--sign .eyebrow { font-weight: 500; }
.fav-tile:first-child { grid-column: 1 / -1; }

/* AIAY | EN - AR: every screen title is Inter Medium (Alexandria Bold in Arabic). */
:is(.page-title, .track-title, .welcome-heading, .home-heading, .sign-card__text, .ar-areas__title, .ar-sign-card__headline,
    .timer-sheet__title, .mix-sheet__title, .breath-title, .breath-ring__label, .movement-title, .done-title, .chat-title,
    .premium-title, .calm-heading, .sound-hero__title, .sound-plain__title, .sound-discovery__name, .premium-sounds__title) { font-weight: 500; }
html[dir='rtl'] :is(.page-title, .track-title, .welcome-heading, .home-heading, .sign-card__text, .ar-areas__title, .ar-sign-card__headline,
    .timer-sheet__title, .mix-sheet__title, .breath-title, .breath-ring__label, .movement-title, .done-title, .chat-title,
    .premium-title, .calm-heading, .sound-hero__title, .sound-plain__title, .sound-discovery__name, .premium-sounds__title) { font-weight: 700; }
.done-lead { font-size: 15px; }
.aiay-btn, .ar-btn { font-weight: 500; }
html[dir='rtl'] :is(.aiay-btn, .ar-btn) { font-weight: 700; }
/* Figma 06 / 03 Journey Completion: a full-bleed photo and a rounded panel floating at 237px. */
.page-done-float .app-main, .page-done-float main { position: relative; }
.page-done-float .hero--done { position: absolute; inset: 0; height: auto; min-height: var(--app-free-h, 100vh); }
.page-done-float .hero--done::before { background-position: left center; }
.page-done-float .sheet--done { position: relative; z-index: 1; min-height: 0; margin-top: 237px; border-radius: 25px; padding-bottom: 33px; animation: fade-up 520ms var(--app-ease) both; }
.page-done-float .done-lead { margin-top: 22px; }
.page-done-float .done-bullets { margin: 50px 0 0; gap: 14px; }
.page-done-float .done-cta { margin-top: 20px; }

/* ------------------------------------------- 05 Check-in & reflection / 06 Small action (Figma AIAY | EN - AR) */
.moment-lead { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--app-ink); }
.moment-strip { height: 62px; margin-top: 22px; overflow: hidden; border-radius: 14px; background: var(--app-track); }
.moment-strip img { width: 100%; height: 100%; object-fit: cover; animation: photo-drift 1.2s var(--app-ease) both; }
.mood-form, .moment-form { display: flex; flex: 1; flex-direction: column; }
.mood9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.mood9__card { position: relative; display: flex; height: 96px; flex-direction: column; align-items: center; padding-top: 13px; gap: 16px;
    border: 1px solid var(--app-track); border-radius: 16px; background: var(--app-surface); color: var(--app-deep); cursor: pointer;
    animation: fade-up 420ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 40ms + 120ms);
    transition: background-color 200ms ease, border-color 200ms ease, transform 160ms ease; }
.mood9__card:active { transform: scale(0.97); }
.mood9__card input { position: absolute; opacity: 0; pointer-events: none; }
.mood9__card:focus-within { box-shadow: 0 0 0 3px var(--aiay-focus-ring, rgba(83, 50, 29, .25)); }
.mood9__card .mood-icon { flex: none; transition: transform 260ms var(--app-ease); }
.mood9__card.is-selected { border: 2px solid var(--app-deep); background: var(--app-sand); }
.mood9__card.is-selected .mood-icon { transform: scale(1.12); }
.mood9__name { font-size: 12px; line-height: 1.5; font-weight: 500; color: var(--app-ink); text-align: center; }
html[dir='rtl'] .mood9__name { font-family: var(--app-font-ar); font-size: 11px; }
.moment-footer { display: grid; gap: 14px; margin-top: auto; padding-top: 32px; }
.moment-footer .aiay-btn { border-radius: 16px; font-size: 14px; }
.moment-footer .aiay-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.moment-quiet { display: flex; height: 52px; align-items: center; justify-content: center; border-radius: 16px; font-size: 14px; font-weight: 500; color: var(--app-ink); text-decoration: none; }
.moment-quiet--soft { background: var(--app-sand); }
/* 80 · Prototype states: Reflection saved, My moment, Choose another (templates/app/moment_action.html) */
.moment-kept { margin: 54px 0 0; font-size: 17px; line-height: 1.5; color: var(--app-ink); }
.moment-action__title { margin: 72px 0 0; font-size: 24px; line-height: 1.4; font-weight: 500; color: var(--app-ink); }
.moment-action__body { margin: 40px 0 0; font-size: 16px; line-height: 1.5; color: var(--app-ink); }
.moment-action__note { margin: 40px 0 0; font-size: 15px; line-height: 1.6; color: var(--app-ink); }
.moment-lead--another { margin-top: 44px; font-size: 15px; }
.moment-alternatives { display: grid; gap: 24px; margin-top: 86px; }
.moment-alternative { display: flex; min-height: 106px; align-items: center; justify-content: center; padding: 16px; border: 1px solid var(--app-track); border-radius: 16px;
    background: var(--app-surface); font-size: 14px; line-height: 1.5; font-weight: 500; color: var(--app-ink); text-align: center; text-decoration: none;
    animation: fade-up 420ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 60ms + 160ms); transition: transform 160ms ease; }
.moment-alternative:active { transform: scale(0.985); }
.moment-quiet--last { margin-top: 64px; }
/* STATE · Check-in / <mood>: the chosen card's tick, top corner (mirrored in Arabic) */
.mood9__tick { position: absolute; top: 4px; inset-inline-end: 6px; display: none; font-size: 14px; line-height: 21px; font-weight: 500; color: var(--app-ink); }
.mood9__card.is-selected .mood9__tick { display: block; animation: pop 320ms var(--app-ease); }
.moment-mood-row { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; }
.moment-mood { margin: 22px 0 0; font-size: 14px; line-height: 1.5; font-weight: 500; color: var(--app-ink); }
.moment-mood-row .moment-mood { margin: 0; }
.moment-change { padding: 14px 12px; margin: -14px -12px; font-size: 14px; font-weight: 500; color: var(--app-ink); text-decoration: none; }
.moment-message { margin: 22px 0 0; font-size: 16px; line-height: 1.5; color: var(--app-ink); }
.moment-question { margin-top: 32px; min-height: 116px; padding: 18px 16px; border-radius: 16px; background: var(--app-sand); font-size: 19px; line-height: 1.47; font-weight: 500; color: var(--app-ink); }
.moment-question--plain { min-height: 0; margin-top: 36px; padding: 0; background: none; font-size: 20px; }
.moment-options { display: grid; gap: 10px; margin-top: 24px; }
.moment-option { position: relative; cursor: pointer; animation: fade-up 420ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 60ms + 220ms); }
.moment-option input { position: absolute; opacity: 0; pointer-events: none; }
.moment-option > span, .moment-option-btn { display: flex; height: 52px; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--app-track); border-radius: 16px;
    background: var(--app-surface); font-size: 14px; font-weight: 500; color: var(--app-ink); text-decoration: none; transition: background-color 200ms ease, border-color 200ms ease, transform 160ms ease; }
.moment-option:active > span, .moment-option-btn:active { transform: scale(0.985); }
.moment-option:focus-within > span { box-shadow: 0 0 0 3px var(--aiay-focus-ring, rgba(83, 50, 29, .25)); }
.moment-option__tick { display: none; }
.moment-option.is-selected > span { border: 2px solid var(--app-deep); background: var(--app-sand); }
.moment-option.is-selected .moment-option__tick { display: inline; animation: pop 320ms var(--app-ease); }
.moment-write { margin-top: 14px; }
.moment-words { display: block; height: 260px; margin-top: 36px; padding: 18px; border-radius: 16px; background: var(--app-surface); }
.moment-words span { display: block; font-size: 12px; line-height: 1.75; color: var(--app-ink); }
.moment-words textarea { width: 100%; height: 200px; margin-top: 16px; padding: 0; border: 0; outline: 0; resize: none; background: none; font: inherit; font-size: 16px; line-height: 1.6; color: var(--app-ink); }
.moment-optional { margin: 26px 0 0; font-size: 13px; line-height: 1.46; color: var(--app-ink); }
.small-one { margin-top: 56px; }
.small-one__title { margin: 0; font-size: 23px; line-height: 1.48; font-weight: 500; color: var(--app-ink); }
.small-one__body { margin: 40px 0 0; font-size: 16px; line-height: 1.5; color: var(--app-ink); }
.small-one__photo { height: 112px; margin-top: 34px; overflow: hidden; border-radius: 16px; background: var(--app-track); }
.small-one__photo img { width: 100%; height: 100%; object-fit: cover; animation: photo-drift 1.2s var(--app-ease) both; }
.small-one__actions { display: grid; gap: 12px; margin-top: 32px; }
.small-one__actions .aiay-btn { border-radius: 16px; font-size: 14px; }
.refl-days { display: grid; gap: 12px; margin-top: 18px; padding-bottom: 8px; }
.refl-day { margin: 10px 0 0; font-size: 12px; line-height: 1.5; font-weight: 500; color: var(--app-ink); }
.refl-card { display: grid; gap: 10px; padding: 16px; border-radius: 12px; background: var(--app-surface); color: var(--app-ink); text-decoration: none;
    animation: fade-up 420ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 60ms + 120ms); transition: transform 160ms ease; }
.refl-card:active { transform: scale(0.985); }
.refl-card__meta, .refl-card__status { font-size: 11px; line-height: 1.6; }
.refl-card__title { font-size: 16px; line-height: 1.5; font-weight: 500; }
.refl-card__action { margin-top: 12px; font-size: 12px; line-height: 1.6; }
.refl-empty { margin: 128px 0 0; font-size: 19px; line-height: 1.47; font-weight: 500; color: var(--app-ink); }
.moment-footer--sticky { position: sticky; bottom: 0; padding-bottom: 16px; background: linear-gradient(transparent, var(--app-canvas) 30%); }
.refl-detail__date { margin: 24px 0 0; font-size: 12px; line-height: 1.5; color: var(--app-ink); }
.refl-detail { display: grid; gap: 16px; margin-top: 20px; color: var(--app-ink); }
.refl-detail p { margin: 0; }
.refl-detail__meta { font-size: 13px; line-height: 1.46; }
.refl-detail__sign { font-size: 17px; line-height: 1.5; font-weight: 500; }
.refl-detail__question { margin-top: 20px !important; font-size: 19px; line-height: 1.47; font-weight: 500; }
.refl-detail__answer { margin-top: 56px !important; font-size: 16px; line-height: 1.5; }
.refl-detail__text { font-size: 16px; line-height: 1.5; }
.refl-detail__action { margin-top: 64px !important; font-size: 16px; line-height: 1.5; }
.refl-detail__status { margin-top: 40px !important; font-size: 12px; line-height: 1.5; }
.refl-detail__delete { text-align: center; }
html[dir='rtl'] :is(.moment, .check-in) :is(p, span, a, button, textarea, h2) { font-family: var(--app-font-ar); }
.check-in .mood-form { margin-top: 0; }
.moment-mood-row { margin-top: 30px; }
.moment-message { margin-top: 26px; }
.moment-question:not(.moment-question--plain) { margin-top: 40px; }
.check-in--mood .mood-form { margin-top: 0; }
.page-done-float .app-main { display: flow-root; }
.small-one { margin-top: 72px; }
.small-one__body { margin-top: 74px; }
.small-one__photo { margin-top: 58px; }
.small-one__photo img { object-position: center 19%; }
.page-done-float .hero--done { position: relative; inset: auto; height: var(--app-free-h, 100vh); min-height: 0; }
.page-done-float .sheet--done { margin-top: calc(237px - var(--app-free-h, 100vh)); margin-bottom: 32px; }
.page-done-float .hero--done::before { background-size: 136.6% auto; background-position: left 47%; }
.ar-home__photo { height: 100%; object-position: 50% 46%; }
.ar-home__photo { object-position: 50% 24%; }
.page-today .hero::before { background-position: 50% 24%; }

/* --- Interactive user reactions & AI sign tailoring --- */
.ar-sign-card__header-actions { display: flex; align-items: center; gap: 8px; }
.ar-sign-card__spark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    color: var(--app-accent);
    transition: background 160ms ease, transform 160ms ease;
}
.ar-sign-card__spark:hover, .ar-sign-card__spark[aria-expanded="true"] {
    background: rgba(var(--app-accent-rgb, 101, 90, 62), 0.12);
    transform: scale(1.08);
}
.ar-sign-card__body-text {
    margin: -10px 0 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--app-muted);
}
.ar-sign-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.sign-reaction-bar {
    margin: 12px 0;
    padding: 12px;
    border-radius: 14px;
    background: var(--app-canvas);
    animation: fade-in 240ms ease both;
}
.sign-reaction-bar__lead {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--app-ink);
}
.sign-reaction-bar__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.sign-reaction-bar__chips .chip {
    height: 30px;
    padding: 0 12px;
    font-size: 11px;
    border-color: var(--app-track);
    color: var(--app-ink);
}
.sign-reaction-bar__chips .chip.is-on {
    background: var(--app-deep);
    color: var(--app-on-deep);
    border-color: transparent;
}
.sign-inline-toast {
    margin: 8px 0 0;
    font-size: 11px;
    color: var(--app-accent);
    font-weight: 600;
    animation: fade-in 200ms ease both;
}

/* Today detail page feedback & AI interaction */
.today-feedback {
    margin: 28px auto 0;
    max-width: 340px;
    padding: 16px;
    border-radius: 18px;
    background: var(--app-surface);
    border: 1px solid var(--app-track);
    text-align: center;
}
.today-feedback__title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--app-ink);
}
.today-feedback__chips {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}
.today-feedback__chips form { margin: 0; }
.today-feedback .chip {
    border-color: var(--app-track);
    color: var(--app-ink);
}
.today-feedback .chip.is-on {
    background: var(--app-deep);
    color: var(--app-on-deep);
    border-color: transparent;
}

/* Check-in extra fields */
.check-in-extra {
    margin: 22px 0 16px;
    padding: 16px;
    border-radius: 18px;
    background: var(--app-surface);
    border: 1px solid var(--app-track);
    text-align: start;
}
.check-in-extra__label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--app-ink);
    margin-bottom: 8px;
}
.energy-picker {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}
.energy-dot {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 12px;
    border: 1px solid var(--app-track);
    background: var(--app-canvas);
    cursor: pointer;
    font-size: 11px;
    color: var(--app-muted);
    transition: all 160ms ease;
}
.energy-dot.is-selected {
    border-color: var(--app-accent);
    background: var(--app-accent);
    color: #fff;
    font-weight: 700;
}
.check-in-note {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--app-track);
    background: var(--app-canvas);
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
    color: var(--app-ink);
    resize: vertical;
}
.check-in-note:focus {
    outline: none;
    border-color: var(--app-accent);
}


/* Life area: my signs in this area; journey completion: on to My progress */
.area-signs { margin-top: 22px; }
.area-signs__title { margin: 0 0 10px; font-size: 15px; line-height: 1.4; font-weight: 700; color: var(--app-ink); }
.done-link { display: block; margin-top: 14px; text-align: center; font-size: 13px; font-weight: 700; color: var(--app-accent); text-decoration: none; }
.done-link:hover { text-decoration: underline; }

/* Check-in: the note's question follows the chosen mood */
.check-in-extra__label--question { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--app-ink); }
.check-in-extra__label.is-swapped { animation: fade-in 260ms ease both; }
@media (prefers-reduced-motion: reduce) { .check-in-extra__label.is-swapped { animation: none; } }

/* App toast (templates/app/base.html aiayToast): "Saved", soft errors, Undo */
.app-toast {
    position: fixed; z-index: 60; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
    width: min(440px, calc(100% - 40px)); display: flex; align-items: center; gap: 12px;
    padding: 12px 18px; border-radius: 16px; background: var(--app-deep); color: var(--app-on-deep);
    font-size: 13px; line-height: 1.45; box-shadow: 0 6px 20px color-mix(in srgb, var(--app-ink) 22%, transparent);
    opacity: 0; transform: translate(-50%, 16px); transition: opacity 200ms ease, transform 220ms var(--app-ease);
}
.app-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.app-toast[data-kind='error']::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--app-accent); }
.app-toast__text { flex: 1; }
.app-toast__action { flex: none; background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
body.page-setup .app-toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); }

/* A plain submit button while its form posts (base.html); .aiay-btn shows its own spinner */
.is-busy { opacity: 0.6; pointer-events: none; }

/* Page-to-page: a short cross-fade instead of a hard cut (browsers with
   cross-document view transitions; others just navigate). The bottom nav and
   mini player stay put. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 200ms; animation-timing-function: ease; }
.ar-nav { view-transition-name: app-nav; }
.mini-player { view-transition-name: mini-player; }
@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    .app-toast { transition: none; }
}

/* 05.03 Notification onboarding + account options (templates/app/account.html,
   mobile screens/NotificationsScreen.tsx): Onboarding sunset hero with gentle animations,
   curved cream panel, and redesigned permission denied screen. */
.page-notify .app-shell { padding-bottom: 0; }
.notify { padding: 0; display: flex; flex-direction: column; min-height: 100vh; background: var(--app-gold); }
.notify-hero {
    --hero-h: min(40vh, 310px);
    --sun-x: calc(50% + var(--hero-h) * 1.5 * (0.403 - 0.372));
    height: var(--hero-h);
    position: relative;
    overflow: hidden;
    background: var(--app-gold);
}
.notify-back-float {
    position: absolute;
    top: 16px;
    inset-inline-start: 16px;
    z-index: 10;
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.76);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--app-deep);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 160ms var(--app-ease), background 160ms var(--app-ease);
}
.notify-back-float:hover { background: rgba(255, 255, 255, 0.92); transform: scale(1.05); }
.notify-panel {
    position: relative;
    flex: 1;
    margin-top: -22px;
    padding: 28px 24px calc(28px + env(safe-area-inset-bottom, 20px));
    border-radius: 26px 26px 0 0;
    background: var(--app-canvas);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 2;
}
.notify-heading {
    margin: 0;
    font-size: 28px;
    line-height: 38px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--app-ink);
}
html[dir='rtl'] .notify-heading { font-family: var(--app-font-ar); letter-spacing: 0; }
.notify-sub {
    margin: 12px 0 0;
    font-size: 15px;
    line-height: 22px;
    color: var(--app-muted);
}
.notify-actions { display: grid; gap: 14px; margin-top: 28px; }
.notify-actions[hidden] { display: none; }
.notify-actions--ask { margin-top: 32px; }
.notify-actions--account { gap: 18px; }
.notify-prompt { margin: 0; font-size: 14px; line-height: 20px; color: var(--app-muted); }
.notify-prompt [hidden] { display: none; }
.notify-allow-pill {
    display: inline-flex;
    height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--app-track);
    border-radius: 24px;
    background: var(--app-surface);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--app-deep);
    cursor: pointer;
    transition: background 160ms var(--app-ease);
}
.notify-allow-pill:hover { background: color-mix(in srgb, var(--app-surface) 90%, var(--app-accent)); }
.notify-allow-pill[hidden] { display: none; }
.notify-account-buttons { display: grid; gap: 12px; }
.notify-guest {
    justify-self: start;
    padding: 6px 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 13px;
    line-height: 18px;
    font-weight: 700;
    color: var(--app-muted);
    cursor: pointer;
}

/* Redesigned Permission Denied State ("أنت في السيطرة" - Stay in control) */
.notify-denied {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background: #141816;
    animation: fade-up 320ms var(--app-ease) both;
}
.notify-denied[hidden] { display: none; }
.notify-denied__bg-wrap { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.notify-denied__bg { width: 100%; height: 100%; object-fit: cover; animation: photo-drift 2.6s var(--app-ease) both; }
.notify-denied__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(20, 24, 21, 0.45) 0%, rgba(18, 22, 19, 0.72) 45%, rgba(14, 18, 16, 0.90) 100%);
}
.notify-denied__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100vh;
    padding: max(24px, env(safe-area-inset-top, 24px)) 24px max(32px, env(safe-area-inset-bottom, 32px));
    box-sizing: border-box;
}
.notify-denied__header { display: flex; align-items: center; justify-content: flex-start; }
.notify-denied__brand {
    font-family: 'Manrope', var(--app-font);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #FFF9DE;
}
.notify-denied__orb-box {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 50px;
    height: 170px;
}
.notify-denied__orb {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle, #FFE7B0 0%, rgba(233, 185, 132, 0.45) 55%, rgba(233, 185, 132, 0) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF9DE;
    animation: soft-glow 2.8s ease-in-out infinite;
}
.notify-denied__text {
    margin-top: 40px;
    text-align: center;
}
.notify-denied__title {
    margin: 0;
    font-family: var(--app-font);
    font-size: 28px;
    line-height: 36px;
    font-weight: 700;
    color: #FFF9DE;
}
html[dir='rtl'] .notify-denied__title { font-family: var(--app-font-ar); }
.notify-denied__body {
    margin: 14px auto 0;
    max-width: 310px;
    font-size: 15px;
    line-height: 22px;
    color: #E8DFC8;
}
.notify-denied__actions {
    margin-top: auto;
    padding-top: 32px;
    display: grid;
    gap: 16px;
}
.notify-denied__cta {
    height: 56px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    background: var(--app-accent, #B9785D);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.notify-denied__return {
    padding: 8px;
    border: 0;
    background: none;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #FFF9DE;
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
    text-align: center;
    transition: opacity 160ms var(--app-ease);
}
.notify-denied__return:hover { opacity: 0.85; }

/* AIAY wordmark (mobile components/AiAYBrandLogo.tsx): "A I A Y", the sparkle over the I, Manrope in every language. */
.brand-logo { display: inline-flex; justify-self: start; gap: 8px; padding-top: 12px; font-family: 'Manrope', var(--app-font);
    font-size: 20px; line-height: 24px; font-weight: 700; color: var(--app-deep); }
html[dir='rtl'] .brand-logo { justify-self: end; }
.brand-logo__i { position: relative; }
.brand-logo__i::before { content: '\2726'; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 13px; line-height: 1; }

/* 09 Sounds landing: a heart on each popular card (top-end corner, on the photo). */
.sounds-popular__item { position: relative; min-width: 0; }
.sounds-popular__item .sounds-popular__card { height: 100%; }
.sounds-popular__fav { position: absolute; top: 8px; inset-inline-end: 8px; margin: 0; }
.icon-btn--on-photo { color: var(--app-on-photo); filter: drop-shadow(0 1px 2px color-mix(in srgb, var(--app-ink) 35%, transparent)); }
.icon-btn--on-photo.is-on { color: var(--app-accent); filter: none; }
.sounds-popular__fav .icon-btn.is-on svg { animation: pop 320ms var(--app-ease); }

/* ======================================================= 07 Rituals - Figma EN spec
   (AIAY FINAL 07 · Rituals: Inter 500 throughout; the AR frames keep Alexandria Bold).
   Header kicker 10/12 at 101, title 25/30 at 123, subtitle 12.5/15 at 165; photo 31 below,
   radius 18, its card 224x103 at 13; rows 77 tall (title 14/17, line 11.5/14, gap 14);
   footnote 11.5/14 at the bottom, then the 55px CTA (14.5/18). */
.ritual-kicker { margin-top: 9px; font-size: 10px; line-height: 12px; letter-spacing: 0.3px; }
.ritual-title { margin-top: 10px; font-size: 25px; line-height: 30px; }
.ritual-lead { margin-top: 12px; font-size: 12.5px; line-height: 15px; }
.ritual-hero { margin-top: 31px; border-radius: 18px; }
.ritual-hero__card { top: 13px; bottom: auto; height: 103px; width: 65.5%; justify-content: flex-start; padding: 13px 12px 0; }
.ritual-hero__eyebrow { font-size: 11px; line-height: 13px; }
.ritual-hero__message { margin-top: 11px; font-size: 16.5px; line-height: 20px; }
/* HERO/TimeTag: top-left in both frames */
.ritual-hero__tag { inset-inline-end: auto; left: 14px; right: auto; min-width: 99px; font-size: 11px; }
.ritual-section { margin-top: 14px; font-size: 15.5px; line-height: 19px; }
.ritual-rows--loose { gap: 14px; margin-top: 21px; }
.ritual-row__icon { background: var(--app-search); }
.ritual-row__title { font-size: 14px; line-height: 17px; }
.ritual-row__line { margin-top: 9px; font-size: 11.5px; line-height: 14px; }
.ritual-page { display: flex; flex-direction: column; }
.ritual-footer { margin-top: auto; padding-top: 27px; }
.ritual-note { font-size: 11.5px; line-height: 14px; }
.ritual-cta { margin-top: 43px; font-size: 14.5px; }
/* Personalization: "How am I feeling?" 46 below the subtitle, sections 25 apart, tiles 18 below */
.ritual-choices-set .ritual-section { margin-top: 46px; font-size: 16px; }
.ritual-choices-set + .ritual-choices-set .ritual-section { margin-top: 25px; }
.ritual-choices { margin-top: 18px; }
.ritual-choice span { font-size: 12px; }
.ritual-choice--minutes span { font-size: 17px; }
.ritual-suggestion { padding: 14px 18px 16px; }
.ritual-suggestion__title { gap: 8px; font-size: 14.5px; line-height: 18px; }
.ritual-suggestion__body { margin-top: 20px; font-size: 12.4px; line-height: 15px; }
/* Breathe / Sound / Reflection / Complete */
.calm-bars { margin-top: 18px; }
.calm-ring__title { font-size: 21px; line-height: 25px; }
.calm-ring__count { margin-top: 13px; font-size: 14px; line-height: 17px; }
.calm-guide { margin-top: 18px; font-size: 13px; line-height: 16px; }
.calm-phases { margin-top: 54px; }
.calm-phase__label { font-size: 11.5px; line-height: 14px; }
.calm-note { margin-top: 16px; font-size: 11.5px; line-height: 14px; }
.calm-sea-label { padding: 0 16px; font-size: 15.5px; }
.calm-player { margin-top: 46px; }
.calm-timer { font-size: 11px; }
.calm-question { margin-top: 9px; font-size: 19px; line-height: 23px; }
.calm-entry { margin-top: 18px; font-size: 13px; line-height: 16px; }
.calm-private { gap: 11px; font-size: 11.5px; line-height: 14px; }
.calm-photo--lake { margin-top: 31px; }
.calm-heading { margin-top: 22px; font-size: 22.5px; line-height: 27px; }
.calm-body { margin-top: 48px; font-size: 13px; line-height: 16px; }
.calm-badge { margin-top: 55px; font-size: 11px; }
html[dir='ltr'] :is(.ritual-kicker, .ritual-title, .ritual-hero__eyebrow, .ritual-hero__message, .ritual-hero__tag, .ritual-section,
    .ritual-row__title, .ritual-choice span, .ritual-suggestion__title, .ritual-cta, .calm-ring__title, .calm-phase__label,
    .calm-sea-label, .calm-question, .calm-heading, .calm-badge) { font-weight: 500; }
/* Alexandria needs more room than Inter at the same size: looser lines in Arabic. */
html[dir='rtl'] :is(.ritual-kicker, .ritual-hero__eyebrow, .ritual-row__line, .ritual-note, .calm-phase__label, .calm-note, .calm-private) { line-height: 1.45; }
html[dir='rtl'] :is(.ritual-title, .ritual-lead, .ritual-hero__message, .ritual-section, .ritual-row__title, .ritual-suggestion__title,
    .ritual-suggestion__body, .calm-ring__title, .calm-guide, .calm-question, .calm-heading, .calm-body, .calm-entry) { line-height: 1.5; }

/* ================================================ 06 Journey & progress - Figma EN spec
   (Inter 500 in English; the AR frames keep Alexandria Bold). */
/* Small Action: action 23/34 at 220, the line 16/24 at 340, the photo at 446. */
.small-one__body { margin-top: 86px; }
/* My Progress / Weekly Progress: subtitle 42 below the title, 166x100 metrics 59 below (10 / 17 apart),
   chart title 18/24 44 below them, the 130px chart, Keep going 51 below it. */
.progress-page .setup-sub { margin-top: 42px; }
.progress-metrics { gap: 17px 10px; margin-top: 59px; }
.progress-metric--first { border-color: var(--app-track); }
.progress-chart__title { margin-top: 44px; line-height: 24px; }
.progress-chart { margin-bottom: 27px; }
/* My Mini Plan / My Goals: 96px option cards, radius 16, white (the picked one peach); Save 35 below the note. */
.plan-option { border-radius: 16px; background: var(--app-surface); }
.plan-option__tile { background: var(--app-search); }
.plan-cta { margin-top: 35px; }
/* Daily Journey: the 133px photo (radius 19) with a 210x102 card at 16, caption 17 below,
   the track 19 below, "Three gentle moments" 14 below, rows 23 below (9 apart). */
.ritual-page--journey .ritual-hero { height: 133px; border-radius: 19px; }
.ritual-page--journey .ritual-hero__card { top: 16px; height: 102px; width: 61.4%; }
.ritual-page--journey .ritual-hero__message { font-size: 17.5px; line-height: 21px; }
.ritual-page--journey .ritual-progress { margin-top: 17px; }
.ritual-page--journey .ritual-progress__caption { font-size: 14px; line-height: 17px; }
.ritual-page--journey .ritual-progress__count { font-size: 12px; line-height: 15px; }
.ritual-page--journey .ritual-track { margin-top: 19px; }
.ritual-page--journey .ritual-section { margin-top: 14px; font-size: 14px; line-height: 17px; }
.ritual-page--journey .ritual-rows { margin-top: 23px; gap: 9px; }
.ritual-page--journey .ritual-footer { padding-top: 37px; }
html[dir='ltr'] :is(.small-one__actions .aiay-btn, .progress-metric__text, .progress-chart__title, .plan-option.is-picked .plan-option__label,
    .reflection-prompt__question, .done-title, .ritual-progress__caption, .ritual-progress__count) { font-weight: 500; }

/* ===================================================== 04 Explore & life areas - Figma EN spec
   (Inter 500 in English; the AR frames keep Alexandria Bold). */
/* Discover Life Areas: title 28/38, the grid 47 below the line, 166x155 tiles (radius 16) 10 / 17 apart. */
.page:has(.area-grid) .page-title { font-size: 28px; line-height: 38px; }
.area-grid { margin-top: 47px; }
.area-tile { border-radius: 16px; overflow: hidden; }
/* Life area pages: subtitle 23 below the title, rows 47 below it (75 tall, 16 apart), note and CTA 12 apart. */
.area-lead { margin-top: 23px; line-height: 19px; }
.area-rows { gap: 16px; margin-top: 47px; }
.area-row__text { line-height: 19px; }
.area-footer { padding-top: 12px; }
.area-cta { margin-top: 12px; font-size: 15px; }
html[dir='ltr'] :is(.page-title, .tile__label, .area-tile__name, .area-row__text, .area-cta) { font-weight: 500; }

/* ======================================================= 09 Sounds - Figma EN spec (Inter 500 in English). */
/* Landing: title 34/45, line 14/19, the 126px hero (48% shade, 19/25 text, chevron), need tiles 70x60 with the
   name under them, "Popular Sounds" 19/25 and "More" 13/17, two 165x171 cards (radius 14) with a dark label band. */
.sounds-home .page-title { font-size: 34px; line-height: 45px; }
.sounds-home .page-lead { margin-top: 6px; font-size: 14px; line-height: 19px; }
.sounds-hero { position: relative; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; font-size: 19px; line-height: 25px; font-weight: 500; }
.sounds-hero { background: linear-gradient(color-mix(in srgb, var(--app-ink) 48%, transparent), color-mix(in srgb, var(--app-ink) 48%, transparent)), var(--cover) center / cover; }
.sounds-hero__chev { flex: none; transition: transform 200ms var(--app-ease); }
.sounds-hero:hover .sounds-hero__chev { transform: translateX(3px); }
html[dir='rtl'] .sounds-hero:hover .sounds-hero__chev { transform: translateX(-3px) scaleX(-1); }
.sounds-section { margin-top: 21px; font-size: 18px; line-height: 24px; font-weight: 500; }
.sounds-section-row { margin-top: 29px; }
.sounds-section-row .sounds-section { font-size: 19px; line-height: 25px; }
.sounds-more { font-size: 13px; line-height: 17px; font-weight: 400; color: var(--app-muted); }
.sounds-needs { display: flex; justify-content: space-between; gap: 0; margin-top: 20px; }
.sounds-need { display: flex; width: 70px; height: auto; flex-direction: column; align-items: center; gap: 11px; padding: 0; border: 0; border-radius: 0;
    background: none; color: var(--app-muted); font-size: 11px; line-height: 15px; font-weight: 400; text-decoration: none;
    animation: fade-up 420ms var(--app-ease) both; animation-delay: calc(var(--i, 0) * 60ms + 200ms); }
.sounds-need__tile { display: grid; width: 70px; height: 60px; place-items: center; border-radius: 16px; background: var(--app-sand); transition: transform 160ms ease; }
.sounds-need:active .sounds-need__tile { transform: scale(0.94); }
.sounds-popular { margin-top: 17px; }
.sounds-popular__card { padding: 0; border-radius: 14px; overflow: hidden; }
.sounds-popular__card { background: var(--cover) center / cover; }
.sounds-popular__band { display: flex; height: 77px; align-items: flex-end; gap: 8px; padding: 0 13px 12px; border-radius: 8px;
    background: color-mix(in srgb, var(--app-ink) 57%, transparent); }
.sounds-popular__text { display: flex; flex: 1; min-width: 0; flex-direction: column; align-self: stretch; padding-top: 17px; }
.sounds-popular__title { font-size: 13px; line-height: 17px; font-weight: 500; }
.sounds-popular__line { margin-top: 8px; font-size: 11px; line-height: 15px; }
.sounds-popular__play { display: grid; width: 26px; height: 26px; flex: none; place-items: center; border-radius: 50%; background: var(--app-surface); color: var(--app-deep); transition: transform 160ms ease; }
.sounds-popular__card:hover .sounds-popular__play { transform: scale(1.08); }
.sounds-popular__fav { top: 10px; inset-inline-end: 11px; }
/* Libraries: 88px rows (title 14/19 500), card rows with the cover 16 from the title, CTA radius 17. */
.sound-row__title { font-size: 14px; line-height: 19px; }
.sound-card { gap: 16px; }
html[dir='ltr'] :is(.sound-row__title, .sound-card__title, .sound-hero__title, .sound-plain__title, .sounds-popular__title) { font-weight: 500; }
html[dir='rtl'] :is(.sounds-hero, .sounds-section, .sounds-popular__title) { font-weight: 700; }

/* Figma 11 My space: the cream "My Reflections" card under the four rows (templates/app/my_space.html) */
.space-reflections { display: grid; gap: 3px; min-height: 72px; margin-top: 22px; padding: 10px 17px; border-radius: 16px; background: var(--app-sand); color: var(--app-ink); text-decoration: none; transition: transform 160ms ease; }
.space-reflections:active { transform: scale(0.985); }
.space-reflections__title { font-size: 16px; line-height: 24px; font-weight: 700; }
.space-reflections__lead { font-size: 12px; line-height: 18px; }
.space-cards .option-card--tall { min-height: 76px; }

/* ======================================================= 12 Premium & 13 AI companion - Figma EN spec
   (Inter 500 in English; the AR frames keep Alexandria Bold). Both languages keep the tick / icon on the left. */
/* Premium Preview: title 24/32, line 13/18, 65px rows 9 apart (tick at 17, text at 54), note 11/15, CTA 52. */
.sheet--premium { padding-top: 41px; }
.premium-title { line-height: 32px; }
.premium-lead { margin-top: 24px; line-height: 18px; }
.area-rows.premium-rows { gap: 9px; margin-top: 40px; }
.area-row.premium-row, html[dir='ltr'] .area-row.premium-row { padding: 0 14px 0 17px; }
.premium-row .area-row__text, .companion-promise .area-row__text { line-height: 19px; }
.area-footer.premium-footer { padding-top: 24px; }
.premium-footer .area-note { line-height: 15px; }
.premium-cta { margin-top: 19px; }
/* Sounds benefits: kicker 17/23 at 104, title 31/41 at 180, line 15/20 at 288, six points 48 apart from 364. */
.premium-sounds__brand { margin-top: 13px; font-size: 17px; line-height: 23px; font-weight: 500; letter-spacing: 0; }
.premium-sounds__title { margin-top: 53px; }
.premium-sounds__lead { margin-top: 26px; color: var(--app-on-photo); }
.premium-sounds__benefits { gap: 28px; margin: 36px 0 40px; }
.premium-sounds__benefit { line-height: 20px; font-weight: 400; }
.premium-sounds__benefit > span:last-child { flex: 1; text-align: start; }
.premium-sounds__cta { font-size: 16px; }
html[dir='ltr'] .premium-sounds__cta { font-weight: 500; }
/* AI Companion Intro: the sheet at 124, title 25/34, line 14/19, 56px promises 10 apart (icon at 18, text at 53),
   note 12/17, CTA 52. */
.hero--companion { height: calc(106px + env(safe-area-inset-top)); }
.companion-lead { margin-top: 24px; line-height: 19px; }
.area-rows.companion-promises { gap: 10px; margin-top: 34px; }
.area-row.companion-promise, html[dir='ltr'] .area-row.companion-promise { min-height: 56px; padding: 0 18px; }
.area-footer.companion-footer { padding-top: 21px; }
.companion-note { line-height: 17px; }
.companion-cta { margin-top: 14px; }
html[dir='rtl'] :is(.premium-row, .companion-promise, .premium-sounds__benefit) { flex-direction: row-reverse; }
html[dir='ltr'] :is(.premium-row, .companion-promise) .area-row__text { font-weight: 500; }
/* AI Conversation: title 23/31 at 68, line 12/16 at 115, the divider at 161; my bubbles 275 wide (peach, right),
   the companion's 290 (soft sand, left), 14/19 text; note 11/15, the 344x53 field 16 below, the CTA 8 below. */
.chat-head { padding-bottom: 30px; }
.chat-title { line-height: 31px; }
.chat-lead { margin-top: 16px; line-height: 16px; }
.chat-thread { padding-top: 59px; }
.chat-bubble { max-width: 80%; line-height: 19px; }
.chat-bubble--theirs { max-width: 84%; }
.chat-footer { padding-inline: 23px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
.chat-note { margin-inline: 2px; line-height: 15px; }
.chat-field { margin-top: 16px; padding: 0 15px; }
.chat-cta { margin-top: 8px; }
html[dir='ltr'] .chat-cta, html[dir='ltr'] :is(.premium-cta, .companion-cta) { font-weight: 500; }
/* Figma 11 App Preferences: a chevron on the far side of each row */
.prefs-link .option-card__body { justify-content: space-between; }
.prefs-link__chevron { flex: none; color: var(--app-deep); }
/* Figma 10 Saved Signs, nothing saved: one 14px line mid-page (templates/app/saved_signs.html) */
.saved-empty { margin: 196px 0 auto; font-size: 14px; line-height: 17px; color: var(--app-ink); }

/* Notification step: the photo always covers the hero's full width. It is sized from the wider of the hero
   height and width / 1.5 (the photo's ratio), so the glow, beam and sparkle stay on the sun; extra height
   is cropped at the bottom under the panel. */
.notify-hero { --notify-h: min(40vh, 310px); height: var(--notify-h); container-type: inline-size; }
.notify-hero > :is(.ar-welcome__photo, .ar-welcome__light) {
    --hero-h: max(var(--notify-h), calc(100cqw / 1.5));
    /* Keep the woman left of centre, but never leave a gap at either edge. */
    --photo-left: clamp(calc(100% - var(--hero-h) * 1.5), calc(50% - var(--hero-h) * 1.5 * 0.372), 0px);
    --sun-x: calc(var(--photo-left) + var(--hero-h) * 1.5 * 0.403);
}
.notify-hero > .ar-welcome__photo { left: var(--photo-left); height: var(--hero-h); }

/* Popular sound cards: the play arrow is deep brown on the white button (the glyph's default fill is the
   on-deep white, which vanished on it); nudged 1px so the triangle looks centred. */
.sounds-popular__play .glyph .g-on-fill { fill: var(--app-deep); }
.sounds-popular__play .glyph { margin-left: 2px; }

/* Calm (sound categories): "Other ways to calm" gets room above it and sits 14px over its tiles
   (the generic .area-grid 47px top margin pushed it away from the tiles instead). */
.area-grid + .ar-quick-title { margin-top: 32px; }
.ar-quick-title + .area-grid { margin-top: 14px; }
