/* 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, input.code { 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; }

/* Passkeys: 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; }
.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, .act .button-link { 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; }

/* Help (/portal/help). 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; } }
.help-back { margin-top: 1.5rem; }
.help-back .button-link { width: 100%; }

/* A preview of the same bookings and availability, with letters and symbols as well as colour. */
.next-shift {
    border-inline-start: 4px solid var(--brand);
}

.next-shift h2 {
    color: var(--brand);
}

.next-place {
    font-size: 1.25rem;
    font-weight: 700;
}

ul.shifts li.is-today .when {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

.when .today-word {
    color: var(--brand);
    font-weight: 750;
}

ul.shifts li.offered .when {
    color: var(--busy);
    background: var(--busy-bg);
}

.offer-status.declined {
    color: var(--quiet);
    font-weight: 500;
}

.offer-status.first-come {
    color: var(--brand);
}

.booking-clashes h2 {
    margin: 0 0 .5rem;
}

.booking-clashes ul {
    margin: 0;
    padding-inline-start: 1.25rem;
}

.booking-clashes li + li {
    margin-top: .5rem;
}

.booking-clashes a {
    color: inherit;
}

.availability-preview summary {
    min-height: 44px;
    cursor: pointer;
    font-weight: 650;
}

.availability-month {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: .5rem;
    margin: .5rem 0;
}

.availability-month h2 {
    margin: 0;
    text-align: center;
}

.availability-month a {
    display: grid;
    place-items: center;
    min-height: 44px;
    border: 1px solid var(--edge);
    border-radius: 8px;
    text-decoration: none;
}

.availability-calendar {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: .875rem;
}

.availability-calendar th {
    padding: .4rem 0;
    color: var(--quiet);
    font-weight: 500;
}

.availability-calendar td {
    height: 54px;
    padding: .25rem .1rem;
    border: 1px solid var(--line);
    text-align: center;
    vertical-align: top;
}

.availability-calendar td.outside {
    border: 0;
}

.availability-calendar .calendar-marks {
    display: flex;
    justify-content: center;
    gap: .15rem;
    min-height: 1.1rem;
    font-size: .75rem;
    color: var(--brand);
}

.availability-calendar td.is-away {
    background: repeating-linear-gradient(135deg, transparent, transparent 4px, color-mix(in srgb, var(--quiet) 12%, transparent) 4px, color-mix(in srgb, var(--quiet) 12%, transparent) 6px);
}

.availability-calendar td.never-works {
    background-color: var(--page);
}

.availability-calendar td.is-today {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
    font-weight: 750;
}

.availability-calendar td.has-clash {
    background-color: var(--busy-bg);
}

.availability-calendar td.has-clash .calendar-marks {
    color: var(--busy);
}

.calendar-key {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    list-style: none;
    padding: 0;
    margin: .75rem 0;
    font-size: .75rem;
    color: var(--quiet);
}

.calendar-key li {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.calendar-key li:last-child {
    color: var(--busy);
}

@media (forced-colors: active) {
    .availability-calendar td.has-clash {
        border: 2px solid Highlight;
    }

}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
