/* This host's own layout only. Colour, type and the shared controls arrive from /branding/theme.css
   and /css/rota-controls.css, which are generated from RotaPalette — the same values that seed the
   coordinator site's MudBlazor theme. The tokens that used to sit here were a hand-made copy of
   that palette, identical byte for byte to the one in the other PWA host, and a copy is a thing
   that gets half-updated. What is below overrules the shared sheet on purpose: this is a phone
   held in one hand, so the cards are rounder and the buttons are the width of the screen. */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
html { height: 100%; background: var(--page); }
body {
    margin: 0 auto;
    max-width: 44rem;
    color: var(--ink);
    background: var(--page);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    overflow-wrap: anywhere;
}

/* Auto-sized chrome keeps enlarged tab labels and safe areas out of the scrolling content.
   Save bars stick inside main, so their bottom edge always sits above the tab bar. */
.app-shell { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
/* Signed in, the shell is pinned to the screen's edges and takes its height from them, never from a
   viewport unit: an installed Android app can make 100dvh taller than the screen, and with the
   overflow hidden the tab bar would sit below the bottom edge, out of reach. */
.app-shell:not(.entry-shell) { position: fixed; inset: 0; width: 100%; height: auto; overflow: hidden; }
.entry-shell { grid-template-rows: auto minmax(0, 1fr); }
main {
    position: relative;
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    scroll-padding-block: 1rem 6rem;
    padding: 1.5rem max(1rem, env(safe-area-inset-right)) 1.5rem max(1rem, env(safe-area-inset-left));
}
.entry-shell main { padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
.app-header {
    padding: calc(.75rem + env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .75rem max(1rem, env(safe-area-inset-left));
    color: var(--on-app-header);
    background: var(--app-header);
    border-bottom: 3px solid var(--brand-rule);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; min-height: 44px; color: inherit; text-decoration: none; }
.brand img { flex: none; object-fit: contain; border-radius: 10px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--quiet); }
.brand-product { font-weight: 650; font-size: 1rem; }
.app-header .brand-name { color: inherit; opacity: .8; }
.app-header :focus-visible { outline-color: var(--on-app-header); }
.icon { width: 24px; height: 24px; flex: none; }

.app-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: .25rem;
    padding: .4rem max(.5rem, env(safe-area-inset-right)) calc(.4rem + env(safe-area-inset-bottom)) max(.5rem, env(safe-area-inset-left));
    background: var(--card);
    border-top: 1px solid var(--line);
}
.app-tabs a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    min-height: 52px;
    padding: .3rem .1rem;
    border-radius: 12px;
    color: var(--quiet);
    text-decoration: none;
    text-align: center;
    font-size: .6875rem;
    font-weight: 500;
    line-height: 1.3;
}
.app-tabs a[aria-current="page"] {
    color: var(--brand);
    background: var(--page);
    background: color-mix(in oklab, var(--brand) 12%, var(--card));
    font-weight: 750;
}
.app-tabs a[aria-current="page"] .icon { stroke-width: 2.2; }

.skip-link { position: fixed; top: -10rem; z-index: 10; padding: .75rem 1rem; background: var(--card); }
.skip-link:focus { top: max(.5rem, env(safe-area-inset-top)); }
.back-link { display: inline-flex; align-items: center; gap: .25rem; min-height: 44px; margin: -.75rem 0 .5rem -.4rem; text-decoration: none; font-weight: 600; }
.back-link .icon { width: 20px; }

h1 { font-size: 1.875rem; line-height: 1.15; letter-spacing: -.035em; margin: 0 0 .5rem; }
h2 { font-size: 1.0625rem; line-height: 1.35; margin: 1.5rem 0 .75rem; }
p { margin: 0 0 1rem; }
.lead, .muted { color: var(--quiet); }
.lead { margin: 0 0 1.5rem; }
.eyebrow { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--quiet); font-weight: 650; margin-bottom: .5rem; }
a { color: var(--brand); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; margin-bottom: 1rem; }
.card > h2:first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

/* Quieter than the shared sheet's: on a phone the answer matters more than the question. */
label { display: block; margin: 0 0 .4rem; font-weight: 400; color: var(--quiet); }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: .75rem;
    font: inherit;
    color: inherit;
    background: var(--card);
    border: 1px solid var(--edge);
    border-radius: 10px;
}
input[type="checkbox"], input[type="radio"] { width: 1.25rem; height: 1.25rem; flex: none; accent-color: var(--brand); }
input.pin { max-width: 12rem; font-size: 1.375rem; letter-spacing: .35em; }
button, .button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    max-width: 100%;
    min-height: 48px;
    min-width: 44px;
    padding: .75rem 1rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-weight: 650;
    line-height: 1.4;
    background: var(--brand);
    color: var(--on-brand);
    text-decoration: none;
    text-align: center;
    overflow-wrap: anywhere;
    cursor: pointer;
}
button.quiet, .button-link.quiet { background: var(--card); color: var(--brand); border-color: var(--edge); }
button:disabled { cursor: wait; opacity: .7; }
/* A form on its way. Not :disabled — see busy.js for why the button must stay enabled. */
button[aria-busy="true"] { cursor: wait; opacity: .7; }
.sticky { position: sticky; bottom: -1.5rem; padding: .75rem 0 1.5rem; background: var(--page); margin-top: 1rem; }
.sticky button { width: 100%; }
.standalone-link { display: inline-flex; align-items: center; min-height: 44px; }

.note, .warn, .good { padding: 1rem; border: 1px solid var(--line); border-radius: 16px; margin: 0 0 1rem; background: var(--card); }
.good { background: var(--free-bg); border-color: var(--free); color: var(--free); }
.warn { background: var(--busy-bg); border-color: var(--busy); color: var(--busy); }
.note > :last-child, .warn > :last-child, .good > :last-child { margin-bottom: 0; }
.empty { text-align: center; color: var(--quiet); padding: 2.5rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.empty b { color: var(--ink); }
#stale a { display: inline-flex; align-items: center; min-height: 44px; }
#notify-said:empty { margin: 0; }
.app-setup h2 { margin: 0 0 .75rem; }
.setup-steps { padding-left: 1.25rem; margin: 0 0 1rem; }
.setup-steps li + li { margin-top: 1rem; }
.setup-steps p { margin: .35rem 0 .75rem; }
.setup-steps p:last-child { margin-bottom: 0; }
.install-help summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 44px;
    padding-block: .625rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.install-help summary::-webkit-details-marker { display: none; }
.install-help summary .icon { width: 18px; color: var(--quiet); }
.install-help[open] summary .icon { transform: rotate(90deg); }
.install-help[open] summary { margin-bottom: .75rem; }

.settings-list { padding: 0 1rem; }
.settings-list > a { display: flex; align-items: center; gap: .75rem; min-height: 76px; padding: 1rem 0; text-decoration: none; }
.settings-list > a + a { border-top: 1px solid var(--line); }
.settings-list > a > span { flex: 1; color: var(--ink); }
.settings-list small { display: block; color: var(--quiet); font-size: .875rem; margin-top: .15rem; }
.settings-list .icon:last-child { width: 18px; color: var(--quiet); }
/* Passkeys and remembered browsers: what it is on the left, the button that removes it on the right. */
.credential-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.credential-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--line); }
.credential-list li > span { min-width: 0; overflow-wrap: anywhere; }
.credential-list small { display: block; color: var(--quiet); font-size: .875rem; margin-top: .15rem; }
.credential-list form { margin: 0; flex: none; }
.sign-out { width: 100%; }

fieldset { border: 0; margin: 0 0 1rem; padding: 0; min-width: 0; }
fieldset > legend { padding: 0; margin-bottom: 1rem; }
.notify-choice { margin: 0; padding: 1rem 0; border-top: 1px solid var(--line); }
.notify-choice label { display: flex; align-items: flex-start; gap: .75rem; color: inherit; min-height: 44px; margin: 0; cursor: pointer; }
.notify-choice input { margin: .15rem 0 0; }
.notify-name { font-weight: 600; }
.notify-choice .lead { display: block; margin: .25rem 0 0 2rem; font-size: .875rem; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; font-size: .875rem; }
.pagination a { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--edge); border-radius: 10px; background: var(--card); text-decoration: none; }
.list-count { color: var(--quiet); font-size: .875rem; }
.area-filter { margin: -1rem 0 1.25rem; font-size: .875rem; color: var(--quiet); }
.entry-shell main > form button[type="submit"] { width: 100%; }

@media (min-width: 600px) { main { padding-inline: 1.5rem; } }
@media (prefers-reduced-motion: no-preference) {
    a, button, label { transition: background-color 120ms ease, color 120ms ease; }
}
@media (forced-colors: active) {
    .app-tabs a[aria-current="page"] { outline: 2px solid Highlight; outline-offset: -3px; }
}

ul.alerts { list-style: none; margin: 0 0 1.5rem; padding: 0; }
ul.alerts li { padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--card); margin-bottom: .75rem; }
.alert-kind { display: inline-block; padding: .25rem .6rem; border-radius: 8px; background: var(--page); color: var(--quiet); font-size: .75rem; font-weight: 650; margin-bottom: .75rem; }
.volunteer .alert-kind, .taken .alert-kind { background: var(--free-bg); color: var(--free); }
.unfilled .alert-kind, .away .alert-kind, .silent .alert-kind,
.declined .alert-kind, .unconfirmed .alert-kind, .reply .alert-kind,
.uncontactable .alert-kind { background: var(--busy-bg); color: var(--busy); }
.alert-subject { font-size: 1.0625rem; line-height: 1.4; font-weight: 650; margin: 0 0 .5rem; }
/* The day and the pharmacy identify the alert, so they take the weight; the pattern code and
   hours support them. Same division as ul.shifts .where / .detail in the portal. */
.alert-where { margin: 0 0 .25rem; font-weight: 650; }
.alert-detail { margin: 0 0 .5rem; color: var(--quiet); font-size: .875rem; }
.alert-who { margin: 0 0 .5rem; }
.alert-when { font-size: .875rem; color: var(--quiet); margin: 0; }
.reply { margin: 0 0 .75rem; padding: .5rem .75rem; border-left: 3px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.alert-act { display: flex; flex-wrap: wrap; align-items: stretch; gap: .5rem; margin: 1rem 0 0; }
.alert-act form { flex: 1 1 12rem; margin: 0; }
.alert-act button { width: 100%; }
.alert-act > .button-link { flex: 1 1 5rem; }
.alert-act > .lead { flex-basis: 100%; }
.settled .alert-subject { font-size: 1rem; }
.codes { list-style: none; padding: .75rem; margin: 0 0 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .5rem; font-family: ui-monospace, monospace; letter-spacing: .08em; }
.secret { font-family: ui-monospace, monospace; letter-spacing: .12em; word-break: break-all; background: var(--page); border: 1px solid var(--line); border-radius: 12px; padding: .75rem; margin: 0 0 1rem; }

/* Help (/alerts/help), the same block as the portal's. The way in is a labelled button in the header on every screen. What help
   adds of its own is neutral — ink, quiet and the rules — so it never carries a group's colour; the
   samples inside .help-sample are the screen's own classes and so look exactly like the screen. */
.app-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.help-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex: none;
    min-height: 44px;
    min-width: 44px;
    padding: .3rem .75rem .3rem .55rem;
    border: 1px solid color-mix(in oklab, currentColor 40%, transparent);
    border-radius: 999px;
    color: inherit;
    font-size: .875rem;
    font-weight: 650;
    text-decoration: none;
}
.help-link .icon { width: 20px; height: 20px; }
.help-article h2 { margin-top: 1.75rem; }
.help-article ul, .help-article ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.help-article li + li { margin-top: .4rem; }
.help-sample { margin: 0 0 1.25rem; }
.help-sample-frame { position: relative; padding: 2rem .85rem .85rem; border: 1px dashed var(--edge); border-radius: 16px; background: var(--page); }
.help-sample-frame::before {
    content: "Example";
    position: absolute;
    top: .55rem;
    left: .9rem;
    color: var(--quiet);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.help-sample-frame > .card:last-child, .help-sample-frame > section:last-child { margin-bottom: 0; }
.help-sample figcaption { margin-top: .45rem; color: var(--quiet); font-size: .875rem; }
.help-keys { margin: 0 0 1rem; padding: 0 1rem; }
.help-key { padding: .85rem 0; }
.help-key + .help-key { border-top: 1px solid var(--line); }
.help-key dt { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-weight: 650; }
.help-key dt .offer-status { margin: 0; }
.help-key dd { margin: .3rem 0 0; color: var(--quiet); }
.help-example { margin: 0 0 1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-left: 4px solid var(--quiet); border-radius: 12px; background: var(--card); }
.help-example::before { content: "Example"; display: block; margin-bottom: .3rem; color: var(--quiet); font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.help-example > :last-child { margin-bottom: 0; }
.help-says { margin: .5rem 0; padding: .5rem .75rem; border-left: 3px solid var(--edge); background: var(--page); border-radius: 0 8px 8px 0; font-weight: 650; }
.help-reply { display: inline-block; min-width: 3.5rem; padding: .15rem .55rem; border: 1px solid var(--edge); border-radius: 8px; background: var(--page); font-family: ui-monospace, monospace; letter-spacing: .04em; text-align: center; }
.help-steps { list-style: none; counter-reset: help-step; padding-left: 0 !important; }
.help-steps > li { counter-increment: help-step; position: relative; padding-left: 2.25rem; min-height: 1.75rem; }
.help-steps > li::before {
    content: counter(help-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: var(--card);
    font-size: .8125rem;
    font-weight: 700;
}
.help-more { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.help-more h2 { margin-top: 0; }
.help-more ul { list-style: none; margin: 0; padding: 0; }
.help-more a { display: inline-flex; align-items: center; min-height: 44px; }
@media (forced-colors: active) { .help-steps > li::before { border: 1px solid CanvasText; } }

/* Labels of the alert's own buttons, for the key: the button's look without being one. */
.help-button { display: inline-flex; align-items: center; min-height: 36px; padding: .35rem .8rem; border: 1px solid transparent; border-radius: 10px; background: var(--brand); color: var(--on-brand); font-weight: 650; }
.help-button.quiet { background: var(--card); color: var(--brand); border-color: var(--edge); }
.help-kinds li { margin-bottom: .6rem; }
.help-kinds .alert-subject { font-size: 1rem; }
.help-back { margin-top: 1.5rem; }
.help-back .button-link { width: 100%; }

/* Triage describes the shift's date, independently of when the alert was raised. */
.alert-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1rem;
}

.alert-filters a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: .4rem .75rem;
    border: 1px solid var(--edge);
    border-radius: 999px;
    text-decoration: none;
    font-size: .875rem;
}

.alert-filters a[aria-current="true"] {
    color: var(--on-brand);
    background: var(--brand);
    font-weight: 650;
}

.alert-due {
    display: inline-block;
    margin: 0 0 .75rem .5rem;
    color: var(--quiet);
    font-size: .8125rem;
    font-weight: 650;
}

.alert-due.soon {
    color: var(--busy);
}

.alert-act > .warn {
    flex-basis: 100%;
    margin: 0;
}

@media (forced-colors: active) {
    .alert-filters a[aria-current="true"] {
        outline: 2px solid Highlight;
        outline-offset: -3px;
    }

}
