/* 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; }
.entry-shell { grid-template-rows: auto minmax(0, 1fr); }
main {
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    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; }
.note.install p:last-child { display: flex; flex-wrap: wrap; gap: .5rem; }
.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); }
.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 { 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; }
