:root {
    font-family: Inter, "Segoe UI", sans-serif;
    color: #163b39;
    background: #f5f7f6;
    font-synthesis: none;
    line-height: 1.5;
    --header-height: 100px;
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; scroll-padding-top: calc(var(--header-height) + 24px); }
body { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #74bfb4; outline-offset: 3px; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -.04em; line-height: 1.2; margin: 0 0 16px; }
h1:focus { outline: none; }
h2 { font-size: 1.2rem; margin: 6px 0; }
p { margin: 0 0 24px; }
.muted { color: #607572; }
.brand { font-size: 1.2rem; font-weight: 750; letter-spacing: -.04em; text-decoration: none; white-space: nowrap; }
.brand span { font-weight: 400; color: #487d75; }

/* A fixed, content-independent header keeps every page at the same offset. */
.app-header { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-height); background: #fff; border-bottom: 1px solid #e0e8e5; }
.header-bar { height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 32px; }
.header-bar .brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-shrink: 0; }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; padding: 9px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #285c50; }
.icon-button:hover, .icon-button[aria-expanded="true"] { background: #eaf3ee; }
.icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.account-avatar { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #c7ded3; border-radius: 50%; background: #eaf3ee; color: #205d50; font-size: .75rem; font-weight: 750; text-decoration: none; }
.account-avatar:hover, .account-avatar.active { background: #205d50; color: white; }
.language-switch { display: inline-flex; gap: 2px; border: 1px solid #d5e0dc; border-radius: 7px; padding: 2px; flex-shrink: 0; }
.language-switch button { min-width: 28px; height: 28px; border: 0; background: transparent; border-radius: 4px; padding: 0 5px; color: #526d66; font-size: .65rem; font-weight: 700; }
.language-switch .selected { background: #184f46; color: white; }
.breadcrumb { height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 32px; border-top: 1px solid #f0f4f2; font-size: .75rem; color: #607572; overflow: hidden; white-space: nowrap; }
.breadcrumb a { text-decoration: none; flex-shrink: 0; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current] { color: #285c50; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.menu-backdrop { position: fixed; inset: var(--header-height) 0 0; z-index: 40; border: 0; background: #163b3929; width: 100%; }
.page-menu { position: fixed; top: calc(var(--header-height) + 8px); left: 24px; z-index: 45; display: flex; flex-direction: column; gap: 4px; width: min(280px, calc(100vw - 32px)); max-height: calc(100dvh - var(--header-height) - 24px); overflow-y: auto; background: white; padding: 10px; border: 1px solid #dfe8e3; border-radius: 12px; box-shadow: 0 14px 40px #163b3920; }
.page-menu a { display: flex; align-items: center; min-height: 48px; padding: 12px 16px; border-radius: 7px; text-decoration: none; font-size: .9rem; color: #607572; }
.page-menu a:hover, .page-menu a.active { background: #eaf3ee; color: #205d50; }
.page-menu a.active { font-weight: 650; }
.workspace { padding-top: var(--header-height); min-height: 100dvh; }
.workspace main, .welcome-shell main { padding: 40px 32px; max-width: 1120px; width: 100%; margin: 0 auto; min-width: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .15em; font-size: .7rem; font-weight: 700; color: #6d847c; margin-bottom: 12px; }
.account-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: white; padding: 24px 28px; border: 1px solid #dfe8e3; border-radius: 12px; margin: 30px 0; }
.account-card h2 { overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: .75rem; padding: 6px 12px; border-radius: 30px; background: #eaf3ee; color: #2e6554; }
.empty-state { padding: 70px 24px; text-align: center; border: 1px dashed #cbd9d2; border-radius: 12px; }
.empty-state .mark { margin: 0 auto 20px; }
.empty-state p { margin-bottom: 0; }
.profile-card { background: white; border: 1px solid #dfe8e3; border-radius: 12px; padding: 8px 28px; margin-top: 30px; }
.profile-details { margin: 0; }
.profile-details > div { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 3fr); gap: 20px; padding: 20px 0; border-bottom: 1px solid #edf2ef; }
.profile-details > div:last-child { border-bottom: 0; }
.profile-details dt { color: #607572; font-size: .85rem; }
.profile-details dd { margin: 0; overflow-wrap: anywhere; }

/* Login retains its own simple header and reserved validation area. */
.login-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 40px; gap: 20px; }
.login-shell { min-height: 100dvh; background: radial-gradient(ellipse at 15% 80%, #dcece5 0, transparent 50%), #f5f7f6; }
.login-shell main { display: flex; justify-content: center; padding: 8vh 24px 60px; }
.login-card { background: white; border: 1px solid #e0e8e5; border-radius: 20px; padding: 42px; width: 100%; max-width: 450px; box-shadow: 0 16px 55px #173f3510; }
.login-card h1 { font-size: 1.9rem; }
.mark { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: #e8f2ed; color: #2b6f5e; font-size: 2rem; font-weight: 300; margin-bottom: 26px; }
label { display: block; font-size: .85rem; font-weight: 600; margin: 18px 0 7px; }
input { width: 100%; border: 1px solid #cbd9d3; background: #fcfdfc; border-radius: 8px; padding: 12px 14px; color: #163b39; min-height: 48px; }
.button-primary { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 26px; padding: 13px 18px; border: 0; border-radius: 8px; background: #205d50; color: white; font-weight: 600; }
.button-primary:hover { background: #174b40; }
.button-quiet { border: 1px solid #d5e0dc; background: white; padding: 8px 14px; border-radius: 8px; color: #285c50; min-height: 44px; }
.alert { background: #fff1ee; color: #943c32; padding: 12px 16px; border-radius: 8px; font-size: .9rem; }
.login-error-slot { display: grid; margin-bottom: 24px; }
.login-error-slot > .alert { grid-area: 1 / 1; margin: 0; align-self: start; overflow-wrap: anywhere; }
.login-error-size { visibility: hidden; pointer-events: none; user-select: none; }
.login-error-message:empty { visibility: hidden; }
.boot { display: flex; justify-content: center; align-items: center; gap: 12px; height: 100dvh; }
.loading-dot { width: 9px; height: 9px; border-radius: 50%; background: #2b6f5e; }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: #fff1ee; color: #943c32; padding: 16px; z-index: 1000; }
@media (max-width: 700px) {
    .header-bar { padding: 0 12px; gap: 8px; }
    .header-bar .brand { font-size: 1rem; }
    .header-actions { gap: 8px; }
    .breadcrumb { padding: 0 20px; }
    .page-menu { left: 12px; }
    .workspace main, .welcome-shell main { padding: 30px 20px; }
    .account-card { align-items: flex-start; flex-direction: column; padding: 22px; }
    .empty-state { padding: 48px 18px; }
    .profile-card { padding: 4px 22px; }
    .profile-details > div { grid-template-columns: 1fr; gap: 6px; }
    .login-header { padding: 16px; gap: 10px; }
    .login-header .brand { font-size: 1rem; }
    .login-card { padding: 28px 22px; }
    .login-shell main { padding: 24px 16px 40px; }
}
@media (max-width: 400px) {
    .header-bar { gap: 6px; padding: 0 8px; }
    .header-bar .brand { font-size: .85rem; }
    .header-actions { gap: 4px; }
    .icon-button { width: 36px; height: 36px; flex-basis: 36px; padding: 7px; }
    .account-avatar { width: 32px; height: 32px; }
}

/* Public welcome: a quiet, scalable pictogram story with room for future copy. */
.app-shell, .welcome-shell { min-height: 100dvh; background: radial-gradient(ellipse at 50% 55%, #e9f1e8 0, #f5f7f6 65%); }
.welcome-shell { padding-top: var(--header-height); }
.header-spacer { visibility: hidden; pointer-events: none; }
.welcome-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: 40px; min-height: 480px; text-align: left; }
.welcome-heading h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 650; letter-spacing: -.055em; margin-bottom: 0; }
.welcome-heading .eyebrow { margin-bottom: 18px; }
.welcome-animation { position: relative; width: min(100%, 520px); margin: 12px auto 24px; }
.request-scene { display: block; width: 100%; height: auto; overflow: visible; }
.welcome-primary { display: inline-flex; align-items: center; justify-content: space-between; gap: 44px; min-height: 50px; padding: 12px 24px; border-radius: 10px; background: #205d50; color: #fff; text-decoration: none; font-weight: 600; box-shadow: 0 5px 15px #205d5012; }
.welcome-primary:hover { background: #174b40; }
.animation-control { position: absolute; bottom: 0; right: 6%; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #cbd9d3; border-radius: 50%; background: #ffffff99; color: #487d75; }
.animation-control:hover { background: white; }
.animation-control svg { width: 18px; height: 18px; }


.receiving-arm { animation: request-arms 12s ease-in-out infinite; }
.phone-tick { animation: phone-send 12s ease-in-out infinite; }
.request-envelope { opacity: 0; offset-anchor: 0px 0px; offset-rotate: 0deg; transform-box: view-box; animation: letter-travel 12s linear infinite; }
.request-trail { opacity: 0; animation: trail-reveal 12s linear infinite; }
.trail-progress { animation: trail-draw 12s linear infinite; }
.waving-arm { opacity: 0; transform-origin: 468px 195px; animation: hand-wave 12s ease-in-out infinite; }
.invitation { opacity: 0; animation: check-reveal 12s ease-in-out infinite; }
.is-paused .request-scene * { animation-play-state: paused; }
@keyframes phone-send {
    0%, 7% { opacity: 0; }
    12%, 46% { opacity: 1; }
    53%, 100% { opacity: 0; }
}
@keyframes letter-travel {
    0%, 18% { opacity: 0; offset-distance: 0%; }
    20% { opacity: 1; offset-distance: 0%; }
    44%, 49% { opacity: 1; offset-distance: 100%; }
    53%, 100% { opacity: 0; offset-distance: 100%; }
}
/* The mask and envelope share arc-length progress and timing: no dots ahead. */
@keyframes trail-draw {
    0%, 20% { stroke-dashoffset: 100; }
    44%, 100% { stroke-dashoffset: 0; }
}
@keyframes trail-reveal {
    0%, 18% { opacity: 0; }
    20%, 49% { opacity: .8; }
    54%, 100% { opacity: 0; }
}
@keyframes request-arms {
    0%, 52% { opacity: 1; }
    60%, 94% { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes hand-wave {
    0%, 53% { opacity: 0; transform: rotate(0deg); }
    58% { opacity: 1; transform: rotate(0deg); }
    62%, 70% { opacity: 1; transform: rotate(12deg); }
    66%, 74% { opacity: 1; transform: rotate(-8deg); }
    78%, 92% { opacity: 1; transform: rotate(0deg); }
    97%, 100% { opacity: 0; transform: rotate(0deg); }
}
@keyframes check-reveal {
    0%, 78% { opacity: 0; }
    83%, 94% { opacity: 1; }
    99%, 100% { opacity: 0; }
}
.welcome-text-placeholder { min-height: 100px; display: flex; align-items: center; border-left: 2px solid #c5d9cc; padding: 16px 20px; margin: 28px 0; color: #7c9188; font-size: 1rem; }
.welcome-text-lead { font-weight: 600; }
@media (max-width: 700px) {
    .welcome-hero { grid-template-columns: 1fr; gap: 12px; min-height: 0; }
    .welcome-animation { width: min(100%, 440px); margin: 12px auto 24px; }
    .welcome-heading { padding: 0 12px; }
    .welcome-primary { min-width: 180px; }
    .animation-control { width: 32px; height: 32px; right: 5%; bottom: -12px; }
}
@media (prefers-reduced-motion: reduce) {
    .request-scene * { animation: none !important; }


    .receiving-arm, .request-envelope, .request-trail { opacity: 0; }
    .waving-arm, .invitation { opacity: 1; }
    .animation-control { display: none; }
}

/* The welcome text and illustration share one composition. */
.welcome-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); grid-template-rows: auto; column-gap: 24px; row-gap: 0; min-height: 320px; align-content: center; }
.welcome-hero > .welcome-text-placeholder { grid-column: 1; grid-row: 1; align-self: center; position: relative; z-index: 2; margin: 0; }
.welcome-hero > .welcome-animation { grid-column: 2; grid-row: 1; align-self: center; justify-self: center; width: min(100%, 420px); margin: 0; }
.welcome-cta { display: flex; justify-content: flex-start; position: relative; z-index: 3; margin: 12px 0 0; }
button.welcome-primary { border: 0; width: 200px; min-width: 200px; height: 50px; gap: 12px; white-space: nowrap; }
.login-chevron { display: inline-block; transition: transform .25s ease; }
.login-chevron.is-open { transform: rotate(180deg); }
.welcome-login { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .3s ease, opacity .3s ease; }
.welcome-login.is-open { grid-template-rows: 1fr; opacity: 1; }
.welcome-login-inner { min-height: 0; overflow: hidden; display: flex; justify-content: center; }
.welcome-login .login-card { margin-top: 24px; box-shadow: none; }
.welcome-login .login-card h2 { font-size: 1.6rem; letter-spacing: -.035em; margin: 0 0 16px; }
@media (max-width: 700px) {
    .welcome-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-rows: auto; column-gap: 8px; min-height: 0; }
    .welcome-hero > .welcome-text-placeholder { grid-column: 1; grid-row: 1; margin: 0 0 0 12px; min-height: 80px; padding: 12px; }
    .welcome-hero > .welcome-animation { grid-column: 2; grid-row: 1; width: min(100%, 340px); margin: 0; }
    .welcome-cta { margin: 16px 12px 0; }
}
@media (prefers-reduced-motion: reduce) {
    .welcome-login, .login-chevron { transition: none; }
}

/* Compact account access card and quiet disclosure button. */
button.welcome-primary.is-expanded { background: #e7eeea; color: #48675d; box-shadow: none; }
button.welcome-primary.is-expanded:hover { background: #dce7e1; }
.welcome-login .login-card { max-width: 360px; padding: 22px; font-size: .8rem; }
.welcome-login .auth-description { margin: 0 0 12px; line-height: 1.5; }
.auth-mode-switch { display: flex; gap: 3px; padding: 3px; margin-bottom: 14px; border-radius: 7px; background: #edf2ef; }
.auth-mode-switch button { flex: 1; min-width: 0; min-height: 32px; border: 0; border-radius: 5px; background: transparent; color: #607572; font-size: .75rem; padding: 6px 10px; }
.auth-mode-switch button.selected { background: #fff; color: #205d50; font-weight: 650; box-shadow: 0 1px 4px #163b3910; }
.welcome-login .login-card label { font-size: .75rem; margin: 12px 0 5px; }
.welcome-login .login-card input { font-size: .8rem; min-height: 38px; padding: 8px 10px; border-radius: 6px; }
.welcome-login .login-card .alert { font-size: .75rem; padding: 8px 10px; border-radius: 6px; }
.welcome-login .login-error-slot { margin-bottom: 12px; }
.welcome-login .login-card .button-primary { min-height: 38px; padding: 9px 12px; margin-top: 16px; font-size: .8rem; border-radius: 6px; }
.registration-notice { margin: 12px 0 0; font-size: .75rem; }

/* Permanent account card; both modes reserve the same field and message space. */
.welcome-between-placeholder { min-height: 120px; display: flex; align-items: center; margin: 32px 0; padding: 16px 20px; border-left: 2px solid #c5d9cc; color: #7c9188; font-size: 1rem; }
.welcome-login { scroll-margin-top: 24px; }
.welcome-login:focus { outline: none; }
.welcome-login .login-card { margin-top: 0; }
.auth-password-slot { display: grid; }
.auth-password-slot > * { grid-area: 1 / 1; }
.auth-password-slot .is-hidden { visibility: hidden; pointer-events: none; }
.auth-password-slot .registration-notice { display: flex; align-items: center; margin: 12px 0 0; }
.welcome-login .login-error-slot { margin: 14px 0 0; }
@media (max-width: 700px) {
    .welcome-between-placeholder { margin: 28px 12px; }
}
.welcome-primary .tap-icon { width: 23px; height: 27px; flex-shrink: 0; }
