/*
 * Styles of the app, from the prototype of phase 3A (docs/design/geor24-pwa/prototipo.html). Colors, type and shapes come from
 * tokens.css; MudBlazor gets the same colors from GeOr24Theme.
 */

/*
 * Inter, embedded (decision 4 of phase 3A): it works offline and tells no third party who the customers are.
 * @fontsource-variable/inter 5.3.0, Latin subset, weights 100-900; license in fonts/LICENSE-Inter.txt (SIL OFL 1.1).
 */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tokens of the app beyond those of phase 3A: the inverse surface of the messages at the bottom. */
:root {
    --inverse-bg: #1d1c47;
    --inverse-ink: #ffffff;
    --inverse-primary: #e6bde8;
    --bottom-nav-height: 72px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --inverse-bg: #ecebf5;
        --inverse-ink: #1d1c47;
        --inverse-primary: #84328a;
    }
}

:root[data-theme="dark"] {
    --inverse-bg: #ecebf5;
    --inverse-ink: #1d1c47;
    --inverse-primary: #84328a;
}

/* ---------- Base ---------- */
/* touch-action: manipulation removes iOS Safari's double-tap-to-zoom (and the old 300ms tap delay) while
   keeping pinch-to-zoom, which WCAG 2.2 AA (decision 8, phase 3A) requires to stay available. */
html { box-sizing: border-box; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
*, *::before, *::after { box-sizing: inherit; }
body {
    margin: 0;
    min-height: 100dvh;
    background: var(--background);
    color: var(--ink);
    font: var(--text-body);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
h1:focus, h2:focus { outline: none; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Splash screen (index.html) ---------- */
.splash {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--background);
    color: var(--ink);
}
.splash .emblem { width: 96px; height: 96px; color: var(--primary); }
.splash-name { font: 700 30px/36px var(--font); letter-spacing: -0.01em; }
.splash-progress { display: none; width: 120px; height: 3px; margin-top: 18px; overflow: hidden; border-radius: 2px; background: var(--divider); }
.first-visit .splash-progress { display: block; }
.splash-progress::after {
    content: "";
    display: block;
    width: var(--blazor-load-percentage, 0%);
    height: 100%;
    border-radius: 2px;
    background: var(--primary);
    transition: width var(--motion-base) var(--ease);
}

/* ---------- Shell: bottom navigation on phones and tablets, side navigation from 960 px ---------- */
.shell { display: flex; min-height: 100dvh; }
.shell-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
}
.side-nav { display: none; }

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    min-height: var(--bottom-nav-height);
    padding: 6px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: var(--surface);
    border-top: 1px solid var(--divider);
}
.nav-item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 56px;
    color: var(--ink-muted);
    font: 500 12px/16px var(--font);
    text-decoration: none;
}
.nav-item .pill { position: relative; width: 56px; height: 32px; border-radius: 16px; display: grid; place-items: center; }
.nav-item[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-item[aria-current="page"] .pill { background: var(--primary-tint); }
.nav-new { color: var(--ink); font-weight: 600; }
.nav-new .pill,
.nav-new[aria-current="page"] .pill {
    width: 64px;
    height: 40px;
    margin-block: -4px;
    border-radius: 20px;
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 3px 10px rgba(158, 64, 163, 0.35);
}

@media (min-width: 960px) {
    .shell-main { padding-bottom: 0; }
    .bottom-nav { display: none; }
    .side-nav {
        position: sticky;
        top: 0;
        width: 256px;
        height: 100dvh;
        flex: none;
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 16px 12px;
        background: var(--surface);
        border-right: 1px solid var(--divider);
    }
    .phone-only { display: none !important; }
    .bar .bar-emblem { display: none; }
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font: 700 20px/28px var(--font); }
.side-brand .emblem { width: 32px; height: 32px; color: var(--primary); }
.side-nav > .btn { margin-bottom: 14px; }
.side-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 16px;
    border-radius: var(--radius-pill);
    color: var(--ink-muted);
    font: 500 15px/20px var(--font);
    text-decoration: none;
}
.side-item:hover { background: var(--surface-2); }
.side-item[aria-current="page"] { background: var(--primary-tint); color: var(--ink); font-weight: 600; }

/* ---------- Top bar of the pages ---------- */
.bar-wrap { position: sticky; top: 0; z-index: 5; }
.bar {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 60px;
    padding: calc(6px + env(safe-area-inset-top)) max(4px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
    background: var(--surface);
    color: var(--ink);
    border-bottom: 1px solid var(--divider);
}
.bar .emblem { width: 30px; height: 30px; flex: none; margin-right: 8px; color: var(--primary); }
.bar-titles { flex: 1; min-width: 0; }
.bar h1 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 20px/26px var(--font); }
.bar-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--text-secondary); color: var(--ink-muted); }
.offline-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--tone-neutral-bg);
    color: var(--ink);
    font: var(--text-secondary);
}
.offline-strip .mud-icon-root { color: var(--tone-neutral); }

/* ---------- Content ---------- */
.content { flex: 1; }
.inner { max-width: 720px; margin: 0 auto; }
.inner.narrow { max-width: 640px; }
.home-top { padding: 16px 16px 12px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-pill);
    font: 600 16px/22px var(--font);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not([disabled]) { background: var(--primary-strong); }
.btn-tonal { background: var(--primary-tint); color: var(--ink); }
.btn-outline { background: transparent; border: 1px solid var(--outline); color: var(--primary); }
.btn-text { background: transparent; color: var(--primary); padding: 0 12px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 17px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- Empty states, system screens ---------- */
.empty, .state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 24px; text-align: center; }
.empty h2, .state h2 { margin: 8px 0 0; font: var(--text-section); }
.state h1 { margin: 8px 0 0; font: var(--text-title); }
.empty p, .state p { margin: 0; max-width: 34ch; color: var(--ink-muted); }
.state { max-width: 440px; margin: 0 auto; }
.state .actions { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.ill { width: 88px; height: 88px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--primary-tint); color: var(--primary); }
.ill .mud-icon-root { width: 44px; height: 44px; }
.ill-error { background: var(--tone-error-bg); color: var(--tone-error); }

.error-screen, #blazor-error-ui {
    position: fixed;
    inset: 0;
    z-index: 2000;
    overflow-y: auto;
    padding: calc(40px + env(safe-area-inset-top)) 24px 24px;
    background: var(--background);
    color: var(--ink);
}
#blazor-error-ui { display: none; }

/* ---------- Messages at the bottom: new version, snackbars ---------- */
.update-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--bottom-nav-height) + 12px + env(safe-area-inset-bottom));
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 6px 6px 6px 16px;
    border-radius: var(--radius-card);
    background: var(--inverse-bg);
    color: var(--inverse-ink);
    box-shadow: var(--shadow);
    font: var(--text-secondary);
    animation: up var(--motion-base) var(--ease);
}
.update-bar > span { flex: 1; }
.update-bar .btn-text { min-height: 40px; color: var(--inverse-primary); }
#mud-snackbar-container.mud-snackbar-location-bottom-center { bottom: calc(var(--bottom-nav-height) + 12px + env(safe-area-inset-bottom)); }

@media (min-width: 960px) {
    .update-bar { left: auto; right: 24px; bottom: 24px; width: 440px; }
    #mud-snackbar-container.mud-snackbar-location-bottom-center { bottom: 24px; }
}

/* ---------- Account ---------- */
.menu { list-style: none; margin: 16px; padding: 0; border: 1px solid var(--divider); border-radius: var(--radius-card); background: var(--surface); }
.menu > li + li { border-top: 1px solid var(--divider); }
.menu-btn { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 12px 8px 16px; border: 0; background: none; text-align: left; }
.menu-btn > .mud-icon-root { flex: none; color: var(--ink-muted); }
.m-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-sub { font: var(--text-secondary); color: var(--ink-muted); }

.install-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    padding: 14px 16px;
    border: 1px solid var(--divider);
    border-radius: var(--radius-card);
    background: var(--surface);
    text-align: left;
}
.install-card > .mud-icon-root { grid-row: span 2; margin-top: 2px; color: var(--primary); }
.card-title { font: var(--text-body-strong); }
.card-sub { font: var(--text-secondary); color: var(--ink-muted); }
.card-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ---------- Panels: MudDialog from the bottom on phones, centered from 960 px ---------- */
.mud-dialog-container .mud-dialog.sheet {
    border-radius: var(--radius-sheet);
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
}
.mud-dialog.sheet .mud-dialog-content { padding: 16px 16px 20px; }
.sheet-scrim { background: var(--scrim) !important; }

@media (max-width: 959.98px) {
    .mud-dialog-container .mud-dialog.sheet {
        align-self: flex-end;
        width: 100%;
        max-width: none;
        max-height: 90dvh;
        margin: 0;
        border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
        padding-bottom: env(safe-area-inset-bottom);
        animation: up var(--motion-base) var(--ease);
    }
}

.sh-head { display: flex; align-items: flex-start; gap: 8px; }
.sh-head > div { flex: 1; min-width: 0; padding-top: 6px; }
.sh-head h2 { margin: 0; font: var(--text-title); overflow-wrap: anywhere; }
.sh-sub { margin: 2px 0 0; font: var(--text-secondary); color: var(--ink-muted); }
.sh-sec { margin-top: 18px; }
.sh-sec h3 { margin: 0 0 10px; font: 600 14px/20px var(--font); color: var(--ink-muted); }
.sh-text { margin: 12px 0 0; color: var(--ink-muted); }
.sh-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.sh-actions .btn-primary { flex: 1; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--divider); }
.kv span:first-child { color: var(--ink-muted); }

.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 14px 16px;
    border: 1px solid var(--divider);
    border-radius: var(--radius-card);
    background: var(--surface);
    cursor: pointer;
}
.opt input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--primary); }
.opt:has(input:checked) { border: 2px solid var(--primary); padding: 13px 15px; background: var(--primary-tint); }
.opt:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.opt input:focus-visible { outline: none; }
.opt-body { display: flex; flex-direction: column; min-width: 0; }
.opt-title { font: var(--text-body-strong); }
.opt-sub { font: var(--text-secondary); color: var(--ink-muted); }

.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-card); background: var(--tone-error-bg); font: var(--text-secondary); }
.alert > .mud-icon-root { flex: none; color: var(--tone-error); }
.alert-info { background: var(--tone-info-bg); }
.alert-info > .mud-icon-root { color: var(--tone-info); }
.alert p { margin: 0; }

.steps { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; align-items: flex-start; gap: 12px; }
.step-n { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--primary-tint); color: var(--primary); font: 600 14px/1 var(--font); }
.step-icon { vertical-align: -4px; color: var(--tone-info); }

/* ---------- Public pages: sign-in and the links of the emails ---------- */
.public {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: calc(40px + env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}
.public-inner { flex: 1; width: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.public .state { max-width: none; padding: 16px 0 0; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.brand .emblem { width: 64px; height: 64px; color: var(--primary); }
.brand h1 { margin: 4px 0 0; font: 700 28px/34px var(--font); letter-spacing: -0.01em; }
.brand p { margin: 0; color: var(--ink-muted); }
.sec-title { margin: 0 0 6px; font: var(--text-section); }
.sec-text { margin: 0; font: var(--text-secondary); color: var(--ink-muted); }
.public-foot { margin: auto 0 0; text-align: center; font: var(--text-secondary); color: var(--ink-muted); }

@media (min-width: 960px) {
    .public { justify-content: center; }
    .public-inner { flex: none; padding: 32px; border: 1px solid var(--divider); border-radius: var(--radius-sheet); background: var(--surface); }
}

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.form > .btn-text { align-self: center; }
.tf { display: flex; flex-direction: column; gap: 6px; }
.tf > label { font: var(--text-body-strong); }
.tf-box {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 4px 0 14px;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--surface);
}
.tf-box:focus-within { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
/* 16 px: below that Safari on iPhone zooms the page when the field is touched. */
.tf-box input { flex: 1; min-width: 0; height: 48px; border: 0; outline: none; background: transparent; font-size: 16px; }
.tf.invalid .tf-box { border-color: var(--tone-error); }
.tf .err, .form-err { margin: 0; font: var(--text-secondary); color: var(--tone-error); }
.icon-btn {
    width: 48px;
    height: 48px;
    flex: none;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-muted);
}
.icon-btn:hover { background: color-mix(in srgb, currentColor 9%, transparent); }
.ro { display: flex; flex-direction: column; padding: 10px 14px; border-radius: var(--radius-card); background: var(--surface-2); }
.ro span:first-child { font: var(--text-label); color: var(--ink-muted); }
.ro span:last-child { font: var(--text-body-strong); overflow-wrap: anywhere; }
.rules { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font: var(--text-secondary); color: var(--ink-muted); }
.rules li { display: flex; align-items: center; gap: 6px; }
.rules li.ok { color: var(--tone-success); }
.check-row { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; font: var(--text-secondary); }
.check-row input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--primary); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.switch-row small { display: block; font: var(--text-secondary); color: var(--ink-muted); }
.sw {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: none;
    width: 52px;
    height: 32px;
    margin: 0;
    border: 2px solid var(--outline);
    border-radius: 16px;
    background: var(--surface-2);
    cursor: pointer;
}
.sw::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--outline); transition: left var(--motion-fast) var(--ease); }
.sw:checked { border-color: var(--primary); background: var(--primary); }
.sw:checked::after { left: 24px; background: var(--on-primary); }
.linkish { padding: 0; border: 0; background: none; color: var(--primary); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.spin {
    width: 20px;
    height: 20px;
    flex: none;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: spin 0.8s linear infinite;
}

/* ---------- Outcomes ---------- */
.ill-info { background: var(--tone-info-bg); color: var(--tone-info); }
.ill-success { background: var(--tone-success-bg); color: var(--tone-success); }
.ill-warning { background: var(--tone-warning-bg); color: var(--tone-warning); }
.check { width: 96px; height: 96px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; animation: pop 0.5s var(--ease); }
.check .mud-icon-root { width: 56px; height: 56px; }
.state .install-card { width: 100%; margin-top: 8px; }

/* ---------- Account ---------- */
.profile { display: flex; align-items: center; gap: 14px; padding: 20px 16px 4px; }
.avatar { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--primary-tint); color: var(--primary); font: 600 20px/1 var(--font); }
.profile > div:last-child { min-width: 0; }
.profile-name { font: var(--text-section); overflow-wrap: anywhere; }
.profile-meta { font: var(--text-secondary); color: var(--ink-muted); overflow-wrap: anywhere; }
.menu-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.sh-form { margin-top: 16px; }
.sh-hint { margin: 0; font: var(--text-secondary); color: var(--ink-muted); }
.menu.sh-menu { margin: 16px 0 0; }

/* ---------- Notices on the pages ---------- */
.home-notice { padding: 0 16px; }
.home-notice .notice { margin: 4px 0 12px; }
.notice {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    padding: 14px 16px;
    border: 1px solid var(--divider);
    border-radius: var(--radius-card);
    background: var(--surface);
    text-align: left;
}
.notice > .mud-icon-root { grid-row: span 2; margin-top: 2px; color: var(--tone-warning); }

/* ---------- Confirmations: a centered dialog at every width ---------- */
.mud-dialog-container .mud-dialog.confirm { border-radius: var(--radius-sheet); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.mud-dialog.confirm .mud-dialog-content { padding: 20px 20px 12px; }
.confirm-title { margin: 0 0 8px; font: var(--text-section); }
.confirm-text { margin: 0; color: var(--ink-muted); }
.confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

/* ---------- Status of a request: color, icon and text ---------- */
.st {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 8px;
    border-radius: var(--radius-pill);
    background: var(--tbg);
    color: var(--tfg);
    font: 600 13px/18px var(--font);
    white-space: nowrap;
}
.st .mud-icon-root { width: 18px; height: 18px; }
.st-lg { padding: 6px 14px 6px 10px; font-size: 15px; line-height: 20px; }
.st-lg .mud-icon-root { width: 20px; height: 20px; }
.t-success { --tfg: var(--tone-success); --tbg: var(--tone-success-bg); }
.t-warning { --tfg: var(--tone-warning); --tbg: var(--tone-warning-bg); }
.t-error { --tfg: var(--tone-error); --tbg: var(--tone-error-bg); }
.t-info { --tfg: var(--tone-info); --tbg: var(--tone-info-bg); }
.t-neutral { --tfg: var(--tone-neutral); --tbg: var(--tone-neutral-bg); }

/* ---------- Composition of a request ---------- */
/* The page fills the screen: only the lists scroll, the bars stay where the thumb reaches. */
.compose-page { flex: none; height: 100dvh; display: flex; flex-direction: column; }
.shell:has(.compose-page) .bottom-nav { display: none; }
.shell:has(.compose-page) .shell-main { padding-bottom: 0; }
.compose-panes { flex: 1; min-height: 0; display: flex; }
.pane { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pane-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.pane-summary { display: none; background: var(--surface); }
.compose-review .pane-groups { display: none; }
.compose-review .pane-summary { display: flex; }
.skeletons { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.list-end { height: 24px; }
.placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; color: var(--ink-muted); }
.placeholder p { margin: 0; max-width: 28ch; }

@media (min-width: 960px) {
    .pane-summary { display: flex; flex: none; width: 400px; border-left: 1px solid var(--divider); }
    .compose-review .pane-groups { display: flex; }
}

.bottom-bar {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: var(--surface);
    border-top: 1px solid var(--divider);
}
.bottom-inner { width: 100%; }
.bottom-hint { margin: 0; font: var(--text-secondary); color: var(--ink-muted); text-align: center; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--outline);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--ink);
    font: 500 14px/20px var(--font);
}
.chip::before { content: ""; position: absolute; inset: -4px 0; }
.chip .mud-icon-root { width: 18px; height: 18px; }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--primary-tint); border-color: var(--primary); }
.chip-problem { border-color: var(--tone-error); color: var(--tone-error); }
.ctx { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--divider); scrollbar-width: none; }
.ctx::-webkit-scrollbar { display: none; }
.ctx .chip { max-width: 100%; }
.ctx .chip .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.search-wrap { position: sticky; top: 0; z-index: 2; padding: 12px 16px 8px; background: var(--background); }
.search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 4px 0 14px;
    border: 1px solid var(--outline);
    border-radius: var(--radius-pill);
    background: var(--surface);
}
.search:focus-within { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.search > .mud-icon-root { color: var(--ink-muted); }
.search input { flex: 1; min-width: 0; height: 46px; border: 0; outline: none; background: transparent; font-size: 16px; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

.g-head {
    position: sticky;
    top: 68px;
    z-index: 1;
    margin: 0;
    padding: 16px 16px 6px;
    background: var(--background);
    font: 600 12px/16px var(--font);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
}
.g-head small { display: block; margin-top: 2px; font: var(--text-secondary); letter-spacing: 0; text-transform: none; }
.g-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-block: 1px solid var(--divider); }
.g-item { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 0 12px 0 16px; }
.g-item + .g-item { border-top: 1px solid var(--divider); }
.g-item.in { background: color-mix(in srgb, var(--primary-tint) 60%, var(--surface)); }
.g-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 0; border: 0; background: none; text-align: left; }
.g-name { font: var(--text-body-strong); }
.g-sub { font: var(--text-secondary); color: var(--ink-muted); }
.g-parent { font: 500 12px/16px var(--font); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.add-btn { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border: 1px solid var(--outline); border-radius: 50%; background: var(--surface); color: var(--primary); }
.add-btn:hover { background: var(--primary-tint); }
.stepper { display: flex; align-items: center; height: 48px; flex: none; border-radius: var(--radius-pill); background: var(--primary); color: var(--on-primary); }
.stepper button { width: 44px; height: 48px; display: grid; place-items: center; border: 0; border-radius: var(--radius-pill); background: transparent; color: inherit; }
.stepper button[disabled] { opacity: 0.4; cursor: not-allowed; }
.stepper output { min-width: 30px; text-align: center; font: 600 16px/24px var(--font); font-variant-numeric: tabular-nums; }
.qty-chip { position: relative; flex: none; min-height: 40px; padding: 0 14px; border: 0; border-radius: var(--radius-pill); background: var(--primary); color: var(--on-primary); font: 600 14px/20px var(--font); font-variant-numeric: tabular-nums; }
.qty-chip::before { content: ""; position: absolute; inset: -4px 0; }
.no-results { padding: 32px 24px; text-align: center; color: var(--ink-muted); }
.no-results strong { display: block; color: var(--ink); margin-bottom: 4px; }

.cart {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: var(--surface);
    border-top: 1px solid var(--divider);
    box-shadow: 0 -6px 18px rgba(29, 28, 71, 0.08);
}
.cart-sum { flex: 1; min-width: 0; }
.cart-n { font: var(--text-body-strong); }
.cart-t { font: var(--text-secondary); color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* Review */
.sec { padding: 16px 16px 8px; }
.sec h2 { font: var(--text-section); margin: 0 0 12px; }
.card { margin: 16px; background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-card); }
.pane-summary .card { background: var(--background); }
.sum-row { display: flex; align-items: center; gap: 14px; padding: 12px 8px 12px 16px; }
.sum-row + .sum-row { border-top: 1px solid var(--divider); }
.sum-row > .mud-icon-root { flex: none; color: var(--ink-muted); }
.sum-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sum-l { font: 500 12px/16px var(--font); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.sum-v { font: var(--text-body-strong); }
.sum-s { font: var(--text-secondary); color: var(--ink-muted); }
.compose-page .sec-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 20px 16px 8px; font: var(--text-section); }
.sec-title small { font: var(--text-secondary); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.rv-row { display: flex; align-items: center; gap: 4px; min-height: 64px; padding-left: 16px; }
.rv-row + .rv-row { border-top: 1px solid var(--divider); }
.rv-row.bad { background: var(--tone-warning-bg); }
.rv-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 0; border: 0; background: none; text-align: left; }
.rv-main[disabled] { cursor: default; }
.rv-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rv-qty { font: 600 16px/24px var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-note { font: var(--text-secondary); color: var(--ink-muted); overflow-wrap: anywhere; }
.bad-msg { display: flex; align-items: center; gap: 4px; font: 500 13px/18px var(--font); color: var(--tone-warning); }
.bad-msg .mud-icon-root { width: 16px; height: 16px; flex: none; }
.add-more { margin: 4px 16px 0; }
.field { display: flex; flex-direction: column; gap: 6px; padding: 0 16px; }
.field > label { font: 500 14px/20px var(--font); }
.field textarea, .sheet textarea {
    min-height: 88px;
    padding: 12px 14px;
    border: 1px solid var(--outline);
    border-radius: var(--radius-card);
    background: var(--surface);
    font-size: 16px;
    resize: vertical;
}
.field textarea:focus, .sheet textarea:focus { outline: none; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.note-field { margin-top: 16px; }
.sheet .field { padding: 0; margin-top: 8px; }
.counter { align-self: flex-end; font: var(--text-label); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.callout { display: flex; gap: 10px; margin: 16px; padding: 12px 14px; border-radius: var(--radius-card); background: var(--tone-info-bg); font: var(--text-secondary); }
.callout > .mud-icon-root { flex: none; color: var(--tone-info); }
.callout.warn { background: var(--tone-warning-bg); }
.callout.warn > .mud-icon-root { color: var(--tone-warning); }
.callout.flush { margin: 0; }
.callout p { margin: 0; }

/* Outcome */
.done { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 24px 24px; text-align: center; }
.done h1 { font: var(--text-title); margin: 12px 0 0; }
.done h1:focus { outline: none; }
.done > p { margin: 0; color: var(--ink-muted); }
.done-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 10px; margin: 12px 0 8px; padding: 16px; text-align: left; border: 1px solid var(--divider); border-radius: var(--radius-card); background: var(--surface); }
.done .callout, .done .install-card { width: 100%; max-width: 400px; margin: 0; text-align: left; }
.done-actions { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 8px; padding-top: 16px; }
.rc-date { font: var(--text-body-strong); }
.rc-meta { font: var(--text-secondary); color: var(--ink-muted); }

/* Panels of the quantity and of the date */
.handle { width: 36px; height: 4px; margin: 0 auto 10px; border-radius: 2px; background: var(--outline); opacity: 0.6; }
.seg { display: flex; gap: 4px; margin: 18px 0 4px; padding: 4px; border-radius: var(--radius-pill); background: var(--surface-2); }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink-muted); font: 600 15px/20px var(--font); }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.qty-big { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px 0 6px; }
.qbtn { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border: 1px solid var(--outline); border-radius: 50%; background: var(--surface); color: var(--primary); }
.qbtn .mud-icon-root { width: 28px; height: 28px; }
.qbtn[disabled] { opacity: 0.35; cursor: not-allowed; }
.qfield { display: flex; align-items: baseline; gap: 6px; padding: 0 6px 4px; border-bottom: 2px solid var(--primary); }
.qfield input { width: 4.2ch; border: 0; outline: none; background: transparent; text-align: center; font: 600 36px/46px var(--font); font-variant-numeric: tabular-nums; }
.qfield input.loose { width: 5.4ch; }
.qunit { color: var(--ink-muted); }
.qhelp { min-height: 20px; margin: 6px 0 8px; text-align: center; font: var(--text-secondary); color: var(--tone-error); font-weight: 500; }
.sh-link { display: flex; justify-content: center; margin-top: 8px; }
.cal { margin-top: 18px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head strong { font: var(--text-body-strong); text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 6px; }
.cal-dow { padding: 6px 0; text-align: center; font: var(--text-label); color: var(--ink-muted); }
.cal-day { height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; font: 500 15px/20px var(--font); font-variant-numeric: tabular-nums; }
.cal-day:hover:not([disabled]) { background: var(--primary-tint); }
.cal-day[disabled] { color: var(--ink-muted); opacity: 0.45; cursor: not-allowed; }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--outline); }
.cal-day[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }

/* ---------- History: the list of the requests and the detail of one ---------- */
/* Like the composition, the page fills the screen and every pane scrolls by itself. The bottom navigation takes the padding of the shell. */
.requests-page { flex: none; height: calc(100dvh - var(--bottom-nav-height) - env(safe-area-inset-bottom)); display: flex; }
.pane-detail { display: none; background: var(--background); }
.requests-page.with-detail .pane-list { display: none; }
.requests-page.with-detail .pane-detail { display: flex; }
.pane-list { background: var(--background); }
.spinning { animation: spin 0.9s linear infinite; }

.pull-indicator { display: flex; align-items: center; justify-content: center; height: var(--pull, 0px); overflow: hidden; transition: height var(--motion-base) var(--ease); }
.pull-indicator { color: var(--primary); }
.pull-indicator .spin { opacity: 0; }
.pane-scroll.pulling .pull-indicator { transition: none; }
.pane-scroll.pulling .pull-indicator .spin, .pull-indicator.refreshing .spin { opacity: 1; }
.pull-indicator.refreshing { height: 48px; }

.list-chips { padding: 4px 16px 4px; }
.chip .count { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.stale { margin: 12px 16px 0; align-items: center; }
.stale p { flex: 1; }
.day-head { margin: 0; padding: 16px 16px 8px; font: 600 12px/16px var(--font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.req-list { list-style: none; margin: 0; padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.req-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--divider);
    border-radius: var(--radius-card);
    background: var(--surface);
    color: inherit;
    text-align: left;
    text-decoration: none;
}
.req-card:hover { border-color: var(--outline); }
.req-card[aria-current="true"] { border: 2px solid var(--primary); padding: 13px 15px; }
.rc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.upd { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/16px var(--font); color: var(--primary); white-space: nowrap; }
.upd::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.rc-where { font: var(--text-secondary); color: var(--ink-muted); overflow-wrap: anywhere; }
.rc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; }
.rc-reason { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--tone-error-bg); font: var(--text-secondary); overflow-wrap: anywhere; }
.more { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 16px 24px; }
.list-end { padding: 20px 16px 28px; text-align: center; font: var(--text-secondary); color: var(--ink-muted); }

.hero { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px 16px; background: var(--surface); border-bottom: 1px solid var(--divider); }
.hero p { margin: 0; }
.hero .extra { color: var(--ink-muted); }
.reason { align-self: stretch; padding: 12px 14px; border-radius: var(--radius-card); background: var(--tone-error-bg); }
.reason .sum-l { color: var(--tone-error); }
.reason p { margin: 2px 0 0; overflow-wrap: anywhere; }
.timeline { font: var(--text-secondary); color: var(--ink-muted); }
.note-text { overflow-wrap: anywhere; font-weight: 400; }
.pane-detail .sec-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 20px 16px 8px; font: var(--text-section); }
.pane-detail .inner { width: 100%; }
.d-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; }
.d-row + .d-row { border-top: 1px solid var(--divider); }
.d-actions { display: flex; flex-direction: column; gap: 8px; padding: 20px 16px 32px; }
.d-end { height: 32px; }
.btn-danger { background: transparent; border: 1px solid var(--tone-error); color: var(--tone-error); }
.date-range { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sh-skeleton { margin-top: 18px; }

@media (min-width: 960px) {
    .requests-page { height: 100dvh; }
    .requests-page .pane-list, .requests-page.with-detail .pane-list { display: flex; flex: none; width: 420px; border-right: 1px solid var(--divider); }
    .requests-page .pane-detail { display: flex; }
}

/* The request in composition, on the list of the requests */
.home-notice .draft-box > .mud-icon-root { color: var(--primary); }

/* ---------- Management of the company (Admins) ---------- */
.company-page { flex: 1; display: flex; flex-direction: column; }
.company-page .content { display: flex; flex-direction: column; }
.company-page .inner { width: 100%; flex: 1; }
a.menu-btn { color: inherit; text-decoration: none; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--tone-error); color: var(--surface); font: 600 12px/20px var(--font); text-align: center; font-variant-numeric: tabular-nums; }
.nav-item .pill .badge { position: absolute; top: -4px; right: 4px; }
.side-item .badge { margin-left: auto; }
.tag { padding: 2px 8px; border-radius: var(--radius-pill); background: var(--tone-neutral-bg); color: var(--tone-neutral); font: 600 11px/16px var(--font); white-space: nowrap; }

.tabs { flex: none; display: flex; background: var(--surface); border-bottom: 1px solid var(--divider); }
.tab { flex: 1; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--ink-muted); font: 600 14px/20px var(--font); }
.tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.tab-intro { margin: 16px 16px 0; font: var(--text-secondary); color: var(--ink-muted); }

.avatar.sm { width: 40px; height: 40px; font-size: 15px; }
.avatar.off { background: var(--tone-neutral-bg); color: var(--tone-neutral); }
.u-row { width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) 24px; align-items: center; gap: 6px 12px; min-height: 72px; padding: 12px 12px 12px 16px; border: 0; background: none; text-align: left; }
.u-row > .avatar { grid-row: 1; }
.u-row > .u-main:not(.u-side) { grid-row: 1; grid-column: 2; }
.u-row > .u-side { grid-row: 2; grid-column: 2; }
.u-row > .mud-icon-root { grid-row: 1; grid-column: 3; color: var(--ink-muted); }
.u-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.u-name { display: flex; align-items: center; gap: 8px; font: var(--text-body-strong); overflow-wrap: anywhere; }
.u-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.u-main .m-sub { overflow-wrap: anywhere; }
.lk { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.lk > .st { align-self: flex-start; }
.lk-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lk-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.company-page .callout { margin: 16px 16px 0; }
.company-page .empty { padding-top: 56px; }

.sticky-action {
    position: sticky;
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 12px);
    z-index: 4;
    display: flex;
    justify-content: center;
    padding: 0 16px;
    pointer-events: none;
}
.sticky-action .btn { pointer-events: auto; box-shadow: 0 4px 14px rgba(29, 28, 71, 0.25); }

.tree { display: flex; flex-direction: column; margin-top: 12px; border: 1px solid var(--divider); border-radius: var(--radius-card); }
.tree label { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 12px; }
.tree label + label { border-top: 1px solid var(--divider); }
.tree label.pt { padding-left: 46px; }
.tree input[type="checkbox"] { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--primary); }
.tree small { display: block; font: var(--text-secondary); color: var(--ink-muted); }
.scope-err { margin-top: 8px; }
.seg.seg-flush { margin: 0; }
.seg button[disabled] { opacity: 0.6; cursor: not-allowed; }
.role-help { margin: 6px 4px 0; font: var(--text-secondary); color: var(--ink-muted); }
.sh-alert { margin-top: 12px; }

@media (min-width: 960px) {
    .handle { display: none; }
    .u-row { grid-template-columns: 40px minmax(0, 1.6fr) minmax(0, 1fr) 24px; }
    .u-row > .u-side { grid-row: 1; grid-column: 3; }
    .u-row > .mud-icon-root { grid-column: 4; }
    .sticky-action { bottom: 24px; justify-content: flex-end; padding: 0 24px; }
}

/* ---------- Motion ---------- */
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
