/* DreamMorrow brand system — dark mode only. Values are translated from the supplied 1.0 token pack. */
:root {
    color-scheme: dark;
    --dr-bg: #111422;
    --dr-surface: #1b2030;
    --dr-surface-elevated: #242a3d;
    --dr-text: #f5f3fa;
    --dr-text-muted: #b5b8c9;
    --dr-border: #333a50;
    --dr-primary: #b9b6ff;
    /* -strong is the darker press/settled variant used by the reconnect modal;
       -hover brightens, which is the right direction on a dark ground. */
    --dr-primary-strong: #a9a4ee;
    --dr-primary-hover: #c7c4ff;
    --dr-on-primary: #222638;
    --dr-accent: #f2c46d;
    --dr-success: #75c6b8;
    --dr-danger: #f08a99;
    --dr-recorded: #75c6b8;
    --dr-predicted: #c4b4f2;
    --dr-sleeping: #b9b6ff;
    --dr-awake: #f2c46d;
    --dr-predicted-surface: #302a49;
    /* The awake/sleeping/recorded surface tokens that sat alongside this one
       were never referenced. --dr-awake-surface was the muddy brown the awake
       state card was deliberately moved off; keeping it invited it back. */
    --dr-focus: #f2c46d;
    --dr-overlay: rgba(7, 9, 18, .78);
    --dr-shadow-card: 0 10px 30px rgba(0, 0, 0, .28);
    --dr-shadow-control: 0 8px 22px rgba(0, 0, 0, .2);
    --dr-radius-small: 10px;
    --dr-radius-control: 14px;
    --dr-radius-card: 20px;
    --dr-radius-sheet: 28px;
    --dr-motion-fast: 120ms;
    --dr-motion-standard: 220ms;
    --dr-motion-slow: 360ms;
    --dr-ease: cubic-bezier(.2, .8, .2, 1);
    --dr-font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Local-first type roles: a softly rounded display face for the night-sky
       hierarchy, and stable tabular numerals for timers/readouts. No network
       font dependency keeps the PWA usable offline. */
    --dr-font-display: "Avenir Next", "SF Pro Rounded", "Century Gothic", ui-rounded, "Trebuchet MS", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
    --dr-font-numeric: "Avenir Next Condensed", "Bahnschrift", "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", sans-serif;

    /* The last survivor of the alias block that carried the pre-token
       stylesheet. Everything else in it went unreferenced once the migration
       finished. */
    --sage-soft: #20263a;

    /* Channel triples for the token colours that get used at partial alpha.
       Without these every translucent tint is a hand-retyped rgba() literal,
       so changing a brand colour moves only some of the UI. */
    --dr-primary-rgb: 185, 182, 255;
    --dr-accent-rgb: 242, 196, 109;
    --dr-danger-rgb: 240, 138, 153;
    --dr-success-rgb: 117, 198, 184;
    --dr-text-rgb: 245, 243, 250;
    --dr-bg-rgb: 17, 20, 34;

    /* Sleep-state triples, added for the shared status badge. --dr-predicted has
       no equivalent above; the other three mirror a base colour but stay separate
       so a tint reads as its sleep meaning rather than borrowing "success" or
       "accent". Each was previously a hand-retyped rgba() literal. */
    --dr-recorded-rgb: 117, 198, 184;
    --dr-predicted-rgb: 196, 180, 242;
    --dr-sleeping-rgb: 185, 182, 255;
    --dr-awake-rgb: 242, 196, 109;

    /* Spacing and z-index had no scale at all; every value was a bare literal
       and the stacking order lived in five files. */
    --dr-space-2xs: .25rem;
    --dr-space-xs: .5rem;
    --dr-space-sm: .75rem;
    --dr-space-md: 1rem;
    --dr-space-lg: 1.35rem;
    --dr-space-xl: 2rem;
    --dr-z-raised: 1;
    --dr-z-sticky: 20;
    --dr-z-nav: 230;
    --dr-z-sheet: 500;
    --dr-z-error: 1000;

    /* Every interactive target clears this. It is the WCAG 2.2 SC 2.5.8
       minimum and the size the state-card actions already used. */
    --dr-target-min: 44px;

    /* One dimming value for every disabled affordance. It was a bare .5 literal
       in each control that had a disabled state. */
    --dr-disabled-opacity: .5;

    --motion-fast: var(--dr-motion-fast);
    --motion-standard: var(--dr-motion-standard);
    --motion-slow: var(--dr-motion-slow);
    --motion-celebrate: 520ms;
    --motion-breathe: 6s;
    --motion-pulse: 3.2s;
    --motion-orbit: 2.4s;
    --motion-shimmer: 1.8s;
    --motion-attention: 1.8s;
    --north-star-size: 60px;
    --north-star-right: calc(1rem + env(safe-area-inset-right, 0px));
    --north-star-browser-bottom: max(.85rem, env(safe-area-inset-bottom, 0px));
    /* The 60px control may overlap the outer part of the home-indicator inset.
       Keeping an 8px floor lowers it without making the trigger unreachable. */
    --north-star-safe-area-overlap: .75rem;
    --north-star-standalone-bottom: max(.5rem, calc(env(safe-area-inset-bottom, 0px) - var(--north-star-safe-area-overlap)));
    --north-star-bottom: var(--north-star-browser-bottom);
    --north-star-viewport-bottom: 0px;
    --north-star-reserved-height: calc(var(--north-star-size) + var(--north-star-bottom) + .75rem);
    --ease-standard: var(--dr-ease);
    --ease-gentle: cubic-bezier(.4, 0, .2, 1);
    --ease-spring: cubic-bezier(.2, .8, .2, 1);
    --ease-exit: cubic-bezier(.4, 0, 1, 1);
    --stagger-short: 45ms;
    --stagger-standard: 90ms;
    font-family: var(--dr-font-ui);
    color: var(--dr-text);
    background: var(--dr-bg);
}
html[data-shell-display-mode="standalone"] { --north-star-bottom: var(--north-star-standalone-bottom); }
html[data-shell-display-mode="browser"] { --north-star-bottom: var(--north-star-browser-bottom); }
@media (display-mode: standalone) { :root { --north-star-bottom: var(--north-star-standalone-bottom); } }

* { box-sizing: border-box; }
html {
    background: var(--dr-bg);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 75% 0, rgba(127, 131, 214, .14), transparent 32rem),
        var(--dr-bg);
    color: var(--dr-text);
    line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
input, select, textarea { font-size: 16px; }
a { color: var(--dr-primary); font-weight: 700; text-decoration: none; }
a:hover { color: var(--dr-text); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--dr-focus); outline-offset: 3px; }
h1[tabindex="-1"]:focus { outline: none; }
h1, h2, h3, p { text-wrap: pretty; }
h1, h2, h3 { color: var(--dr-text); font-family: var(--dr-font-display); font-weight: 720; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: none;
    min-height: 44px;
    color: var(--dr-text);
}
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: auto; height: auto; object-fit: contain; }
.brand-logo--full { padding-block: .35rem; }
.brand-logo--mark { display: none; width: 34px; height: 34px; }
.brand-wordmark { display: inline-flex; align-items: baseline; gap: .06em; color: var(--dr-text); font-family: var(--dr-font-display); font-size: 1.52rem; font-weight: 760; letter-spacing: -.065em; line-height: 1; white-space: nowrap; }
.brand-wordmark__accent { color: var(--dr-primary); }
.eyebrow { margin: 0 0 .3rem; color: var(--dr-primary); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.muted { color: var(--dr-text-muted); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: var(--dr-radius-control);
    padding: .68rem 1.15rem;
    color: var(--dr-text);
    background: var(--dr-surface-elevated);
    font-weight: 750;
    line-height: 1.1;
    cursor: pointer;
    transition: transform var(--motion-fast) var(--ease-spring), box-shadow var(--motion-fast) var(--ease-gentle), background-color var(--motion-fast) var(--ease-gentle), border-color var(--motion-fast) var(--ease-gentle);
}
.button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--dr-shadow-control); text-decoration: none; }
/* The press feedback is defined once, in production.css, where it also covers
   .tab, .icon-button, and .record-action. A second definition here at equal
   specificity never ran. */
.button.primary { color: var(--dr-on-primary); background: var(--dr-primary); box-shadow: 0 8px 22px rgba(var(--dr-primary-rgb), .18); }
.button.primary:hover:not(:disabled) { color: var(--dr-on-primary); background: var(--dr-primary-hover); }
.button.secondary { color: var(--dr-text); border-color: var(--dr-border); background: var(--dr-surface-elevated); }
.button.small { min-height: var(--dr-target-min); padding: .48rem .9rem; font-size: .88rem; }
button:disabled, .button:disabled { cursor: not-allowed; opacity: .55; }
.link-button { min-height: var(--dr-target-min); border: 0; padding: .6rem; color: var(--dr-primary); background: transparent; font-weight: 750; cursor: pointer; }
.link-button:hover { color: var(--dr-text); text-decoration: underline; }

.public-shell, .app-shell { position: relative; min-height: 100vh; }
.today-scene { position: relative; isolation: isolate; min-height: calc(100vh - 2rem); }
.today-content { position: relative; z-index: 1; }
.dr-public-content, .dr-app-content { position: relative; z-index: 1; }
.landing { width: min(100%, 1200px); margin: auto; padding: max(1rem, env(safe-area-inset-top, 0px)) max(1.1rem, env(safe-area-inset-right, 0px)) 2.5rem max(1.1rem, env(safe-area-inset-left, 0px)); }
.landing-nav, .app-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.landing-nav { min-height: 4.5rem; border-bottom: 1px solid rgba(var(--dr-text-rgb), .08); }
.landing-nav > .brand { min-width: var(--dr-target-min); justify-content: center; }
.landing-nav__actions { display: flex; align-items: center; gap: .75rem; }
.landing-nav__link { display: inline-flex; min-width: var(--dr-target-min); min-height: var(--dr-target-min); align-items: center; justify-content: center; padding-inline: .5rem; color: var(--dr-text-muted); font-weight: 750; }
.landing-nav__link:hover { color: var(--dr-text); text-decoration: none; }

.landing-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(22rem, .95fr); align-items: center; gap: clamp(2rem, 5vw, 5.5rem); padding: clamp(2.75rem, 6vw, 5.5rem) 0; animation: rise-in var(--motion-celebrate) var(--ease-standard) both; }
.landing-hero__copy { position: relative; z-index: 2; max-width: 42rem; }
.landing-hero h1 { max-width: none; margin: .45rem 0 1.25rem; color: var(--dr-text); font-family: var(--dr-font-display); font-size: clamp(3rem, 5.1vw, 4.5rem); font-weight: 760; letter-spacing: -.065em; line-height: .94; text-wrap: balance; }
.landing-hero__summary { max-width: 38rem; color: var(--dr-text-muted); font-size: clamp(1.08rem, 1.8vw, 1.28rem); line-height: 1.65; }
.hero-actions, .compact-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; }
.landing-hero .text-link { gap: .4rem; color: var(--dr-primary); font-size: .86rem; font-weight: 750; }
.landing-assurances { display: flex; flex-wrap: wrap; gap: .65rem 1.25rem; margin: 1.8rem 0 0; padding: 0; color: var(--dr-text-muted); font-size: .84rem; font-weight: 700; list-style: none; }
.landing-assurances li { position: relative; padding-left: 1rem; }
.landing-assurances li::before { position: absolute; top: .5em; left: 0; width: .4rem; height: .4rem; border-radius: 50%; background: var(--dr-success); box-shadow: 0 0 12px rgba(var(--dr-success-rgb), .45); content: ""; }

.hero-banner { position: relative; width: 100%; min-width: 0; margin: 0; overflow: hidden; border: 1px solid rgba(var(--dr-primary-rgb), .3); border-radius: 2rem; background: #111426; box-shadow: 0 35px 90px rgba(0, 0, 0, .3), 0 0 70px rgba(var(--dr-primary-rgb), .08); }
.hero-banner picture { display: block; }
.hero-banner img { display: block; width: 100%; height: auto; object-fit: contain; }
.landing-dreamline-heading { display: grid; gap: .3rem; padding: 1.5rem 1.5rem 0; }
.landing-dreamline-heading > span { color: var(--dr-primary); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.landing-dreamline-heading > strong { font-family: var(--dr-font-display); font-size: 1.4rem; letter-spacing: -.025em; }
.hero-banner figcaption { display: grid; gap: .35rem; padding: 1rem 1.5rem 1.25rem; border-top: 1px solid rgba(var(--dr-text-rgb), .08); color: var(--dr-text-muted); font-size: .8rem; line-height: 1.5; }
.hero-banner figcaption strong { color: var(--dr-text); font-weight: 650; }
.hero-banner figcaption a { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; justify-self: start; color: var(--dr-primary); font-weight: 750; }
.landing-hero__next-step { max-width: 28rem; margin: .85rem 0 0; color: var(--dr-text-muted); font-size: .8rem; line-height: 1.5; }
.landing-section { padding: clamp(4.5rem, 8vw, 7rem) 0; scroll-margin-top: 1.5rem; }
.landing-section > .dr-section-intro { max-width: 47rem; margin-bottom: 2.25rem; }
.landing-card-grid { display: grid; gap: 1rem; }
.landing-card-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.landing-card, .panel, .state-card, .empty-card, .auth-card { border: 1px solid var(--dr-border); border-radius: var(--dr-radius-card); background: var(--dr-surface); box-shadow: var(--dr-shadow-card); }
.landing-card { min-height: 15rem; padding: 1.5rem; background: linear-gradient(145deg, rgba(var(--dr-primary-rgb), .055), transparent 48%), var(--dr-surface); }
.landing-card__icon { display: grid; place-items: center; width: 3rem; height: 3rem; border: 1px solid rgba(var(--dr-primary-rgb), .18); border-radius: 1rem; background: rgba(var(--dr-primary-rgb), .08); }
.landing-card__icon img { width: 1.5rem; height: 1.5rem; }
.landing-card h3 { margin: 2.25rem 0 .6rem; font-family: var(--dr-font-display); font-size: 1.28rem; }
.landing-card p { margin: 0; color: var(--dr-text-muted); line-height: 1.65; }

.landing-how { display: grid; grid-template-columns: minmax(0, .8fr) minmax(24rem, 1.2fr); gap: clamp(2rem, 7vw, 6rem); align-items: start; }
.landing-how > .dr-section-intro { position: sticky; top: 2rem; }
.landing-steps { display: grid; gap: .85rem; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.landing-steps li { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.25rem; border: 1px solid rgba(var(--dr-text-rgb), .1); border-radius: var(--dr-radius-card); background: rgba(var(--dr-bg-rgb), .34); }
.landing-step__number { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid rgba(var(--dr-accent-rgb), .32); border-radius: 50%; color: var(--dr-accent); background: rgba(var(--dr-accent-rgb), .08); font-family: var(--dr-font-numeric); font-weight: 850; }
.landing-steps h3 { margin: .2rem 0 .35rem; font-size: 1.05rem; }
.landing-steps p { margin: 0; color: var(--dr-text-muted); line-height: 1.55; }

.landing-today { display: grid; grid-template-columns: minmax(0, .85fr) minmax(22rem, 1.15fr); align-items: center; gap: clamp(2rem, 7vw, 6rem); padding-inline: clamp(1.25rem, 5vw, 4.5rem); border: 1px solid rgba(var(--dr-primary-rgb), .18); border-radius: clamp(1.75rem, 4vw, 3rem); background: radial-gradient(circle at 78% 20%, rgba(var(--dr-primary-rgb), .11), transparent 32%), linear-gradient(140deg, rgba(25, 29, 51, .92), rgba(17, 20, 34, .76)); box-shadow: var(--dr-shadow-card); }
.landing-checklist { display: grid; gap: .8rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }
.landing-checklist li { padding-left: 1.15rem; border-left: 2px solid rgba(var(--dr-primary-rgb), .4); color: var(--dr-text-muted); line-height: 1.55; }
.landing-checklist strong { color: var(--dr-text); }
.landing-today__cta { margin-top: 1.75rem; }
.landing-sample-day { min-width: 0; padding: 1.5rem; border: 1px solid rgba(var(--dr-text-rgb), .13); border-radius: 1.5rem; background: rgba(12, 15, 31, .6); }
.landing-sample-day h3 { margin: 0 0 1.4rem; font-family: var(--dr-font-display); font-size: 1.1rem; }
.landing-sample-day dl { display: grid; gap: 1.25rem; margin: 0; }
.landing-sample-day dl > div { padding-left: 1rem; border-left: 2px solid var(--dr-primary); }
.landing-sample-day dt { color: var(--dr-text-muted); font-size: .78rem; font-weight: 750; }
.landing-sample-day dd { display: grid; gap: .3rem; margin: .3rem 0 0; }
.landing-sample-day dd strong { font-family: var(--dr-font-display); font-size: 1.5rem; letter-spacing: -.035em; }
.landing-sample-day dd span, .landing-sample-day > p { color: var(--dr-text-muted); font-size: .85rem; line-height: 1.55; }
.landing-sample-day > p { margin: 1.5rem 0 0; padding-top: 1rem; border-top: 1px solid rgba(var(--dr-text-rgb), .1); }
.landing-feature-constellation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.landing-feature-constellation article { display: grid; grid-template-columns: auto 1fr; gap: .9rem; min-height: 9rem; padding: 1.15rem; border: 1px solid rgba(var(--dr-text-rgb), .09); border-radius: var(--dr-radius-control); background: rgba(var(--dr-bg-rgb), .32); }
.landing-feature-constellation img { width: 1.45rem; height: 1.45rem; margin-top: .12rem; }
.landing-feature-constellation h3 { margin: 0 0 .3rem; font-size: .98rem; }
.landing-feature-constellation p { margin: 0; color: var(--dr-text-muted); font-size: .9rem; line-height: 1.55; }

.landing-trust { position: relative; }
.landing-trust::before { position: absolute; z-index: -1; top: 10%; right: 4%; width: 18rem; height: 18rem; border-radius: 50%; background: rgba(var(--dr-success-rgb), .06); filter: blur(50px); content: ""; }
.landing-trust-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid rgba(var(--dr-text-rgb), .1); border-radius: var(--dr-radius-card); background: rgba(var(--dr-text-rgb), .1); }
.landing-trust-grid article { min-height: 10rem; padding: 1.4rem; background: var(--dr-bg); }
.landing-trust-grid h3 { margin: 0 0 .5rem; font-size: 1rem; }
.landing-trust-grid p { margin: 0; color: var(--dr-text-muted); line-height: 1.62; }

.landing-real-life { display: grid; grid-template-columns: minmax(0, .85fr) minmax(25rem, 1.15fr); gap: clamp(2rem, 7vw, 6rem); align-items: start; }
.landing-real-life__list { display: grid; gap: .8rem; margin: 0; padding: 0; list-style: none; }
.landing-real-life__list li { display: grid; grid-template-columns: minmax(8rem, .65fr) 1.35fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid rgba(var(--dr-text-rgb), .1); }
.landing-real-life__list strong { color: var(--dr-text); }
.landing-real-life__list span { color: var(--dr-text-muted); line-height: 1.55; }

.landing-faq { max-width: 52rem; margin-inline: auto; }
.landing-faq__items { display: grid; gap: .7rem; }
.landing-faq details { border: 1px solid rgba(var(--dr-text-rgb), .1); border-radius: var(--dr-radius-control); background: rgba(var(--dr-bg-rgb), .34); }
.landing-faq summary { display: flex; min-height: var(--dr-target-min); align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; font-weight: 780; cursor: pointer; list-style: none; }
.landing-faq summary::-webkit-details-marker { display: none; }
.landing-faq summary::after { color: var(--dr-primary); font-size: 1.25rem; content: "+"; }
.landing-faq details[open] summary::after { content: "−"; }
.landing-faq details p { margin: 0; padding: 0 1.1rem 1.15rem; color: var(--dr-text-muted); line-height: 1.65; }

.landing-closing { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin: clamp(4rem, 8vw, 7rem) 0 3rem; padding: clamp(1.5rem, 5vw, 3.25rem); border: 1px solid rgba(var(--dr-primary-rgb), .22); border-radius: clamp(1.5rem, 4vw, 2.5rem); background: linear-gradient(120deg, rgba(var(--dr-primary-rgb), .12), rgba(var(--dr-accent-rgb), .05)), var(--dr-surface); box-shadow: var(--dr-shadow-card); }
.landing-closing h2 { max-width: 18ch; margin: .35rem 0 .65rem; font-family: var(--dr-font-display); font-size: clamp(1.9rem, 4vw, 3.3rem); letter-spacing: -.045em; line-height: 1.08; }
.landing-closing p:not(.eyebrow) { max-width: 38rem; margin: 0; color: var(--dr-text-muted); }
.landing-closing__actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: .7rem; }
.landing-footer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5rem; padding: 2rem 0 max(1rem, env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(var(--dr-text-rgb), .08); }
.landing-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: .25rem 1rem; }
.landing-footer nav a { display: inline-flex; min-width: var(--dr-target-min); min-height: var(--dr-target-min); align-items: center; justify-content: center; color: var(--dr-text-muted); font-size: .84rem; }
.landing-footer > p { margin: 0; color: var(--dr-text-muted); font-size: .72rem; text-align: right; }

.app-shell { min-height: 100vh; }
.app-header { max-width: 1100px; margin: auto; border-bottom: 1px solid var(--dr-border); padding: .85rem 1.1rem; }
.app-header__glance { display: flex; align-items: center; gap: .55rem; min-height: 44px; margin-left: auto; color: var(--dr-text-muted); }
.app-header__glance-signal { position: relative; display: grid; place-items: center; width: 1.05rem; height: 1.05rem; border: 1px solid rgba(185, 182, 255, .42); border-radius: 50%; }
.app-header__glance-signal::before,
.app-header__glance-signal::after,
.app-header__glance-signal span { position: absolute; display: block; border-radius: 50%; content: ""; }
.app-header__glance-signal::before { inset: 3px; background: rgba(185, 182, 255, .18); }
.app-header__glance-signal::after { inset: -4px; border: 1px solid rgba(185, 182, 255, .18); animation: app-header-orb-halo 14s ease-in-out infinite; }
.app-header__glance-signal span { width: 4px; height: 4px; background: var(--dr-accent); box-shadow: 0 0 8px rgba(242, 196, 109, .72); animation: app-header-live-dot 2.9s ease-in-out infinite; }
.app-header__glance-copy { display: grid; min-width: 0; gap: .08rem; }
.app-header__glance-label { color: var(--dr-text-muted); font-size: .62rem; font-weight: 800; letter-spacing: .12em; line-height: 1; text-transform: uppercase; }
.app-header__glance-detail { display: flex; min-width: 0; justify-content: flex-end; color: var(--dr-text); font-family: var(--dr-font-numeric); font-size: .78rem; font-variant-numeric: tabular-nums; font-weight: 750; line-height: 1.1; }
.app-header__glance-detail-part { white-space: nowrap; }
.app-header__glance-detail-part--live { color: #f4f0ff; }
.app-header__glance-copy--handoff { animation: app-header-starlight-handoff 480ms var(--ease-gentle) both; }
.app-header__glance-stat-bubble { display: inline-block; animation: app-header-stat-dissolve 420ms var(--ease-gentle) both; }
.app-header__glance-stat-bubble::after { display: inline-block; width: .28rem; height: .28rem; margin-left: .34rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 .45rem currentColor; content: ""; opacity: .48; vertical-align: .08em; }
.app-header__glance--live .app-header__glance-label { color: var(--dr-primary); }
.app-header__glance--live .app-header__glance-signal { border-color: rgba(169, 213, 206, .62); }
.app-header__glance--live .app-header__glance-signal span { background: #a9d5ce; box-shadow: 0 0 9px rgba(169, 213, 206, .84); }
.app-header__glance[data-header-status-kind="night"] .app-header__glance-signal span { background: #c8bbff; box-shadow: 0 0 10px rgba(200, 187, 255, .9); }
.app-header__glance[data-header-status-kind="nap"] .app-header__glance-signal span { background: #a9d5ce; box-shadow: 0 0 10px rgba(169, 213, 206, .9); }
.content { max-width: 920px; margin: auto; padding: 2rem 1.1rem calc(3.5rem + var(--north-star-reserved-height)); }
.content:has(.dreamline-panel) { max-width: 1440px; padding-inline: clamp(1rem, 3vw, 2.3rem); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; animation: rise-in var(--motion-standard) var(--ease-standard) both; }
.page-heading h1 { margin: 0; color: var(--dr-text); font-size: clamp(2rem, 6vw, 2.55rem); letter-spacing: -.055em; line-height: 1.05; }
.page-heading h1, .panel-heading h2, .panel > h2, .empty-card > h2 { font-family: var(--dr-font-display); }
.panel, .empty-card { margin: 1rem 0; padding: 1.35rem; animation: rise-in var(--motion-standard) var(--ease-standard) both; }
.panel h2, .empty-card h2 { margin: .05rem 0 .6rem; color: var(--dr-text); font-size: 1.22rem; letter-spacing: -.025em; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.panel-heading > a { display: inline-flex; align-items: center; min-height: 44px; }

.child-tabs { display: flex; gap: .55rem; overflow-x: auto; margin: 0 0 1rem; padding: .2rem .1rem .45rem; scrollbar-width: none; }
.child-tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: .45rem; flex: none; min-height: 46px; border: 1px solid var(--dr-border); border-radius: var(--dr-radius-control); padding: .4rem .9rem; color: var(--dr-text-muted); background: var(--dr-surface-elevated); font-weight: 750; cursor: pointer; transition: transform var(--motion-fast) var(--ease-spring), background-color var(--motion-fast) var(--ease-gentle), color var(--motion-fast) var(--ease-gentle); }
.tab:hover:not(:disabled) { transform: translateY(-1px); }
.tab.selected { border-color: var(--dr-primary); color: var(--dr-on-primary); background: var(--dr-primary); box-shadow: 0 5px 15px rgba(185, 182, 255, .16); }
.tab-avatar { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; color: var(--dr-primary); background: var(--dr-bg); font-size: .72rem; }
.tab.selected .tab-avatar { color: var(--dr-on-primary); background: rgba(34, 38, 56, .16); }

.profile-list { display: grid; gap: .25rem; }
.profile-row { display: flex; align-items: center; gap: .8rem; min-height: 58px; border-radius: var(--dr-radius-small); padding: .65rem; color: var(--dr-text); transition: background-color var(--motion-fast) var(--ease-gentle), transform var(--motion-fast) var(--ease-spring); }
.profile-row:hover { background: var(--dr-surface-elevated); text-decoration: none; }
.profile-row > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.profile-row small { color: var(--dr-text-muted); }
.avatar { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; color: var(--dr-primary); background: var(--dr-surface-elevated); font-weight: 850; }

.field { display: flex; flex-direction: column; gap: .35rem; margin: 1rem 0; }
.field label, .choice-group legend { color: var(--dr-text); font-weight: 750; }
.field input, .field select, .field textarea {
    width: 100%; min-height: 48px; border: 1px solid var(--dr-border); border-radius: var(--dr-radius-small); padding: .7rem .8rem; color: var(--dr-text); background: var(--dr-bg); transition: border-color var(--motion-fast) var(--ease-gentle), box-shadow var(--motion-fast) var(--ease-gentle);
}
.field input::placeholder, .field textarea::placeholder { color: var(--dr-text-muted); }
/* Pointer focus keeps the quiet tinted border. Keyboard focus additionally
   gets the global amber ring: the old rule killed `outline` on plain `:focus`
   and left an 18%-alpha lavender shadow measuring about 1.4:1 against the
   field, which is not a perceivable focus indicator (WCAG 2.2 SC 1.4.11). */
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--dr-primary); box-shadow: 0 0 0 3px rgba(var(--dr-primary-rgb), .28); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--dr-focus); outline-offset: 2px; }
.field textarea { min-height: 6rem; resize: vertical; }
.validation-message, .error { color: var(--dr-danger); font-size: .88rem; }
/* The row, not just the box, is the target. An 18px checkbox on a text-height
   row was the smallest hit area in the app. */
.check { display: flex; align-items: center; gap: .55rem; min-height: var(--dr-target-min); margin: 1rem 0; color: var(--dr-text); font-weight: 700; }
.check input { width: 1.35rem; height: 1.35rem; accent-color: var(--dr-primary); }
.hint { margin: -.6rem 0 .7rem; color: var(--dr-text-muted); font-size: .84rem; }

.notice { border: 1px solid transparent; border-radius: var(--dr-radius-small); margin: 1rem 0; padding: .8rem 1rem; animation: notice-in var(--motion-standard) var(--ease-standard) both; }
.notice.success { border-color: rgba(117, 198, 184, .42); color: var(--dr-success); background: rgba(117, 198, 184, .12); }
.notice.error { border-color: rgba(240, 138, 153, .45); color: var(--dr-danger); background: rgba(240, 138, 153, .12); }
.notice ul { margin: .2rem 0; padding-left: 1.2rem; }
.danger-text { color: var(--dr-danger) !important; }
.danger-zone { border-color: rgba(240, 138, 153, .5); }

.auth-shell { position: relative; z-index: 1; max-width: 480px; margin: auto; padding: 2rem 1.1rem 4rem; }
.auth-shell > .brand { margin-bottom: 4rem; }
.auth-card { padding: 1.4rem; }
.auth-card h1 { margin: .3rem 0; color: var(--dr-text); font-size: 2rem; letter-spacing: -.04em; }
.auth-footer { margin: 1.5rem 0 0; color: var(--dr-text-muted); text-align: center; }
.auth-gateway .auth-footer a { display: inline-flex; min-height: 44px; align-items: center; padding-inline: .35rem; }

.welcome-empty { display: flex; align-items: center; flex-direction: column; padding: 3.5rem 1.5rem; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin-bottom: 1rem; border-radius: 50%; color: var(--dr-primary); background: var(--dr-surface-elevated); font-size: 1.7rem; }

@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes notice-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes app-header-orb-halo { 0%, 100% { opacity: .24; transform: scale(.92); } 50% { opacity: .58; transform: scale(1.04); } }
@keyframes app-header-live-dot { 0%, 100% { opacity: .58; } 50% { opacity: 1; } }
@keyframes app-header-stat-dissolve { from { opacity: 0; transform: translate3d(0, 2px, 0); filter: blur(2px); } to { opacity: 1; transform: translate3d(0, 0, 0); filter: none; } }
@keyframes app-header-starlight-handoff { 0% { opacity: .42; filter: blur(2px); } 55% { opacity: 1; text-shadow: 0 0 10px rgba(200, 187, 255, .28); } 100% { opacity: 1; filter: none; text-shadow: none; } }

@media (prefers-reduced-motion: reduce) {
    .app-header__glance-detail-part, .app-header__glance-stat-bubble, .app-header__glance-copy--handoff, .app-header__glance-signal::after, .app-header__glance-signal span { animation: none; }
}

@media (max-width: 960px) {
    .landing-hero { grid-template-columns: 1fr; min-height: auto; gap: 2.75rem; }
    .landing-hero__copy { max-width: 45rem; }
    .landing-hero h1 { max-width: none; }
    .hero-banner { width: min(100%, 43rem); justify-self: center; }
    .landing-how, .landing-today, .landing-real-life { grid-template-columns: 1fr; }
    .landing-how > .dr-section-intro { position: static; }
    .landing-feature-constellation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .landing-closing { align-items: flex-start; flex-direction: column; }
    .landing-footer { grid-template-columns: 1fr; justify-items: start; }
    .landing-footer nav { justify-content: flex-start; }
    .landing-footer > p { text-align: left; }
}

@media (max-width: 700px) {
    :root {
        /* Keep the FAB in the visual lower-right corner; the bottom token above
           owns the independently tuned browser/standalone home-indicator gap. */
        --north-star-right: max(.85rem, env(safe-area-inset-right, 0px));
    }

    .landing { padding-inline: max(.9rem, env(safe-area-inset-left, 0px)) max(.9rem, env(safe-area-inset-right, 0px)); }
    .landing-nav { min-height: 4rem; }
    .landing-hero { gap: 2rem; padding: 2.5rem 0 3.5rem; }
    .landing-hero h1 { font-size: clamp(2.35rem, 10.8vw, 3rem); }
    .landing-hero__summary { font-size: 1.02rem; }
    .landing-assurances { gap: .55rem 1rem; font-size: .75rem; }
    .hero-banner { border-radius: 1.5rem; }
    .landing-section { padding: 4rem 0; }
    .landing-card-grid--three, .landing-feature-constellation, .landing-trust-grid { grid-template-columns: 1fr; }
    .landing-card { min-height: auto; }
    .landing-card h3 { margin-top: 1.5rem; }
    .landing-steps li { padding: 1rem; }
    .landing-today { padding: 3.5rem 1rem; }
    .landing-sample-day { padding: 1.1rem; }
    .landing-feature-constellation article { min-height: auto; }
    .landing-real-life__list li { grid-template-columns: 1fr; gap: .35rem; }
    .landing-closing { margin-top: 4rem; padding: 1.35rem; }
    .landing-closing__actions { width: 100%; }
    .landing-closing__actions .button { flex: 1 1 10rem; }
    .app-header {
        position: sticky;
        top: 0;
        z-index: 20;
        flex-wrap: nowrap;
        min-width: 0;
        padding-top: max(.65rem, env(safe-area-inset-top, 0px));
        padding-bottom: .65rem;
        background: var(--dr-bg);
    }
    .app-header .brand-logo--full { display: none; }
    .app-header .brand-logo--mark { display: block; }
    .app-header__glance { min-width: 0; gap: .45rem; }
    .app-header__glance-label { font-size: .56rem; }
    .app-header { gap: .5rem; }
    .app-header__glance-detail { max-width: min(17rem, calc(100vw - 9.5rem)); font-size: .7rem; text-align: right; }
    .app-header__glance-detail-part { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
    .content { padding-top: .85rem; padding-bottom: calc(3rem + var(--north-star-reserved-height)); }
    .page-heading { align-items: flex-start; margin-bottom: .85rem; }
    .child-tabs { margin-bottom: .65rem; }
    .page-heading .quick-add-button { padding-inline: .85rem; font-size: .86rem; }
    .auth-shell > .brand { margin-bottom: 3rem; }
}

@media (min-width: 701px) {
    :root {
        --north-star-size: 58px;
        --north-star-right: calc(1.5rem + env(safe-area-inset-right, 0px));
        --north-star-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 430px) {
    .landing-nav .brand-logo--full { display: none; }
    .landing-nav .brand-logo--mark { display: block; }
    .landing-nav__actions { gap: .35rem; }
    .landing-nav__actions > a:first-child { font-size: .84rem; }
    .landing-nav .button.small { padding-inline: .7rem; }
    .hero-actions .button { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* The document-level bootstrap runs in the head, before the Blazor circuit can
   read device localStorage. Keep an explicit Off selection static from first
   paint; component-level effective policy takes over once hydration completes. */
html[data-dreamspace-motion="off"] .dreamfield *,
html[data-dreamspace-motion="off"] .dreamline-v3 * {
    animation: none !important;
    transition: none !important;
}

/* Gentle has no travel even during first paint. Its opacity-only treatment is
   repeated here because component-scoped CSS cannot select the head bootstrap
   attribute before the circuit writes root-level effective attributes. */
html[data-dreamspace-motion="gentle"] .dreamfield .dreamfield-star {
    animation: dreamfield-gentle-opacity var(--dreamfield-twinkle-duration, 4.2s) ease-in-out var(--dreamfield-delay, 0s) infinite alternate !important;
}

/* The bootstrap fallback loads before component-scoped Dreamfield CSS. Keep
   its opacity-only keyframe global so the first rendered frame is complete. */
@keyframes dreamfield-gentle-opacity {
    from { opacity: .68; }
    to { opacity: 1; }
}

html[data-dreamspace-motion="gentle"] .dreamfield .dreamfield-star img,
html[data-dreamspace-motion="gentle"] .dreamfield .dreamfield-dust,
html[data-dreamspace-motion="gentle"] .dreamfield .dreamfield-atmosphere *,
html[data-dreamspace-motion="gentle"] .dreamfield .dreamfield-transition-presentation,
html[data-dreamspace-motion="gentle"] .dreamfield .dreamfield-focal-overlay,
html[data-dreamspace-motion="gentle"] .dreamfield .dreamfield-selection-overlay::before,
html[data-dreamspace-motion="gentle"] .dreamfield .dreamfield-current-beacon,
html[data-dreamspace-motion="gentle"] .dreamfield .dreamfield-next-atmosphere,
html[data-dreamspace-motion="gentle"] .dreamline-v3 .dreamline-path--guidance,
html[data-dreamspace-motion="gentle"] .dreamline-v3 .dreamline-orbit__dust,
html[data-dreamspace-motion="gentle"] .dreamline-v3 .dreamline-orbit__fragments,
html[data-dreamspace-motion="gentle"] .dreamline-v3 .dreamline-event__planet,
html[data-dreamspace-motion="gentle"] .dreamline-v3 [data-dreamline-planet-layer="clouds-back"],
html[data-dreamspace-motion="gentle"] .dreamline-v3 [data-dreamline-planet-layer="clouds-front"],
html[data-dreamspace-motion="gentle"] .dreamline-v3 [data-dreamline-planet-layer="surface-texture"] {
    animation: none !important;
    transition: none !important;
}
