/* 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;

    /* 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;

    --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 { max-width: 1100px; margin: auto; padding: 1.25rem 1.1rem 3rem; }
.landing-nav, .app-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.landing-nav > div { display: flex; align-items: center; gap: 1rem; }
.hero { max-width: 860px; padding: 3.25rem 0 6rem; animation: rise-in var(--motion-celebrate) var(--ease-standard) both; }
.hero-banner { position: relative; min-height: clamp(190px, 28vw, 310px); margin-bottom: 2.4rem; overflow: hidden; border: 1px solid rgba(185, 182, 255, .28); border-radius: var(--dr-radius-card); background: var(--dr-surface); box-shadow: 0 20px 55px rgba(0, 0, 0, .28); isolation: isolate; }
.hero-banner img { display: block; width: 100%; height: 100%; min-height: inherit; object-fit: cover; object-position: center 82%; filter: saturate(1.08) brightness(.78); }
.hero-banner::after { position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(11, 15, 38, .86) 0%, rgba(21, 20, 56, .5) 46%, rgba(13, 15, 36, .16) 100%), linear-gradient(0deg, rgba(8, 11, 27, .72), transparent 52%); content: ""; pointer-events: none; }
.hero-banner__copy { position: absolute; z-index: 2; inset: auto auto 1.35rem 1.5rem; display: grid; gap: .15rem; max-width: calc(100% - 3rem); }
.hero-banner__title { color: var(--dr-text); font-family: var(--dr-font-display); font-size: clamp(2rem, 6vw, 3.7rem); font-weight: 760; letter-spacing: -.065em; line-height: .98; }
.hero-banner__title span { color: var(--dr-primary); }
.hero-banner__tagline { color: rgba(245, 243, 250, .82); font-size: .92rem; font-weight: 650; letter-spacing: .02em; }
.hero-copy { max-width: 700px; }
.hero h1 { margin: .3rem 0 1.2rem; color: var(--dr-text); font-size: clamp(2.8rem, 8vw, 5.4rem); line-height: 1; letter-spacing: -.065em; }
.hero p:not(.eyebrow) { max-width: 580px; color: var(--dr-text-muted); font-size: 1.2rem; }
.hero-actions, .compact-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.feature-grid article, .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); }
.feature-grid article { padding: 1.35rem; }
.feature-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; color: var(--dr-primary); background: var(--dr-surface-elevated); font-size: 1.35rem; }
.feature-grid h2 { margin: 1rem 0 .35rem; font-size: 1.1rem; }
.feature-grid p { color: var(--dr-text-muted); }
.disclaimer { margin-top: 2rem; color: var(--dr-text-muted); font-size: .8rem; }

.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; }

.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: 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));
    }

    .feature-grid { grid-template-columns: 1fr; }
    .hero { padding: 2rem 0 4rem; }
    .hero-banner { min-height: 230px; margin-bottom: 2rem; }
    .hero-banner__copy { inset: auto 1rem 1rem; }
    .hero-banner__tagline { max-width: 18rem; font-size: .84rem; }
    .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__glance-detail { max-width: min(17rem, calc(100vw - 5.75rem)); 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 > div { gap: .55rem; }
    .landing-nav > div > a:first-child { font-size: .88rem; }
}

@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;
}
