/* 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; }
.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; }
}

/* Schedule rows share one date column, including shifts with split hours. */
ul.shifts, ul.places { list-style: none; margin: 0; padding: 0; }
ul.shifts li { display: grid; grid-template-columns: 4rem minmax(0, 1fr); column-gap: 1rem; row-gap: .2rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
ul.shifts li:first-child { padding-top: 0; }
ul.shifts li:last-child { border-bottom: 0; padding-bottom: 0; }
.when { grid-row: span 2; align-self: start; display: flex; flex-direction: column; align-items: center; padding: .5rem .2rem; border-radius: 12px; background: var(--page); font-size: .875rem; font-weight: 700; }
.when small { display: block; font-weight: 500; color: var(--quiet); font-size: .75rem; }
.where { font-weight: 650; align-self: end; }
.detail { grid-column: 2; color: var(--quiet); font-size: .875rem; }
ul.shifts li .act { grid-column: 2; margin-top: .5rem; }
.act button { width: 100%; }
ul.shifts li.offered .when { color: var(--free); background: var(--free-bg); }
.offer-status { display: block; margin-top: .25rem; color: var(--free); font-weight: 600; }
.offer-status.waiting { color: var(--busy); }
/* Q3: what is waiting on them comes first, and reads as a job rather than a list. */
.to-confirm { margin-bottom: 1.5rem; border-color: var(--busy); }
.to-confirm > form { margin-top: 1rem; }
.to-confirm > form button { width: 100%; }
.shift-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .75rem; }
.shift-filter label { font-size: .875rem; }
.shift-filter button { white-space: normal; }
.calendar-export { margin-top: 1.5rem; }
.calendar-export .button-link { width: 100%; }
fieldset.week { display: grid; gap: 0; }
fieldset.week legend { color: var(--quiet); }
fieldset.week label { display: flex; align-items: center; gap: .75rem; min-height: 48px; padding: .6rem 0; margin: 0; border-top: 1px solid var(--line); color: var(--ink); cursor: pointer; }
fieldset.week label:has(input:checked) { font-weight: 650; }
fieldset.week input { margin: 0; }
ul.places li + li { border-top: 1px solid var(--line); }
ul.places label { display: flex; align-items: center; gap: .75rem; min-height: 56px; padding: .75rem 0; color: var(--ink); margin: 0; cursor: pointer; }
ul.places input { margin: 0; }
ul.places .area { display: block; color: var(--quiet); font-size: .875rem; }
ul.places form.row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 0; flex-wrap: wrap; }
.inline-action { display: inline; }
.inline-action button { margin-top: .5rem; }
@media (max-width: 359px) {
    .shift-filter { grid-template-columns: minmax(0, 1fr); }
    ul.shifts li { column-gap: .75rem; }
}

/* Messages (ADR-59): the shift list's layout, with a title that links and a line saying how it came. */
ul.messages .where a { color: inherit; }
ul.messages .reached { display: block; margin-top: .2rem; font-size: .75rem; }
ul.messages li.new .when { color: var(--brand); background: color-mix(in oklab, var(--brand) 12%, var(--card)); }
.new-flag { margin-left: .35rem; padding: 0 .4rem; border-radius: 999px; background: var(--brand); color: var(--card); font-size: .6875rem; font-weight: 700; vertical-align: middle; }
.app-tabs a { position: relative; }
.app-tabs .badge {
    position: absolute;
    top: .2rem;
    left: calc(50% + .45rem);
    min-width: 1.15rem;
    padding: 0 .3rem;
    border-radius: 999px;
    background: var(--brand);
    color: var(--card);
    font-size: .6875rem;
    font-weight: 750;
    line-height: 1.15rem;
    text-align: center;
}

/* How we contact you (ADR-68): one way to a row, its name, and the buttons that order it. */
.ways { list-style: none; margin: 0; padding: 0; }
.ways > li { display: flex; align-items: center; gap: .75rem; min-height: 64px; padding: .5rem 0; }
.ways > li + li { border-top: 1px solid var(--line); }
.way-name { flex: 1; color: var(--ink); }
.way-name small { display: block; color: var(--quiet); font-size: .875rem; margin-top: .15rem; }
.way-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.way-actions button { min-height: 44px; padding: .4rem .9rem; }
.icon-button { min-width: 44px; padding: .4rem; display: inline-flex; align-items: center; justify-content: center; }
/* First cannot go up and last cannot go down: shown as unavailable, not as busy. */
.icon-button:disabled { cursor: default; opacity: .35; }
/* How a message reached them, with the way's icon in front (ADR-68). The list's own rule is
   more specific than a bare .reached, so this matches it. */
ul.messages .reached { display: flex; align-items: center; gap: .3rem; }
ul.messages .reached .icon { width: 16px; height: 16px; }
