/* Questboard: small, mobile-first, no build step. Colours meet WCAG AA contrast on their backgrounds. */
:root {
  --fg: #1d1b26;
  --muted: #5b5868;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --line: #dcd8e3;
  --accent: #5b2a86;
  --accent-fg: #ffffff;
  --focus: #e0a100;
  --radius: 0.5rem;
  --tint: #f1ebf7;
  --accent-dark: #47206a;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 48rem; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0.5rem 0 1rem; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 0; padding: 0.5rem; background: var(--surface); }
.skip:focus { left: 0.5rem; z-index: 10; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  padding: 0.5rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; text-decoration: none; color: var(--fg); }
/* The shop's logo (/branding/logo): a fixed height, the width following the logo's own shape. */
.brand img { height: 2rem; width: auto; max-width: 8rem; }
.top nav { order: 3; flex-basis: 100%; min-width: 0; }
/* Wraps onto a second line on a phone rather than hiding items off-screen. */
.top nav ul { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
/* The main menu as tabs: the current page is filled, the others outlined. */
.top nav a {
  display: inline-block; padding: 0.45rem 0.9rem; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; white-space: nowrap; color: var(--accent); background: var(--surface);
}
.top nav a:hover { border-color: var(--accent); background: var(--tint); }
.top nav a[aria-current="page"] { font-weight: 700; border-color: var(--accent); background: var(--accent); color: var(--accent-fg); }
.tools { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.tools form { margin: 0; }

button, .button {
  display: inline-block; min-height: 2.75rem; padding: 0.5rem 1rem; border: 1px solid var(--accent);
  border-radius: var(--radius); background: var(--accent); color: var(--accent-fg); font: inherit;
  text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button:active, .button:active { transform: translateY(1px); }
/* The quieter variant: outlined, for navigation and secondary actions (never a bare text link). */
button.secondary, .button.secondary { background: var(--surface); color: var(--accent); }
button.secondary:hover, .button.secondary:hover { background: var(--tint); border-color: var(--accent); }
button.small, .button.small { min-height: 2.25rem; padding: 0.25rem 0.75rem; }
.button { line-height: 1.6; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.roster-weeks { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.75rem; }
.lang { display: flex; }
.lang button { min-height: 2.25rem; padding: 0.25rem 0.5rem; background: var(--surface); color: var(--accent); }
.lang button:first-of-type { border-radius: var(--radius) 0 0 var(--radius); }
.lang button:last-of-type { border-radius: 0 var(--radius) var(--radius) 0; border-left: 0; }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }
.lang button[aria-pressed="false"]:hover { background: var(--tint); }

.stack { display: flex; flex-direction: column; gap: 0.75rem; max-width: 24rem; }
select, input[type="text"], input[type="number"] {
  min-height: 2.75rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit;
}
fieldset { border: 1px solid var(--line); border-radius: var(--radius); }
fieldset label { display: block; padding: 0.25rem 0; }
.notice { padding: 0.75rem; border-left: 4px solid var(--focus); background: var(--surface); color: var(--muted); }

.foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem;
  max-width: 48rem; margin: 0 auto; padding: 1rem; border-top: 1px solid var(--line); font-size: 0.875rem;
}
.foot a { color: var(--muted); }
.foot form { margin: 0; }
.foot button.quiet {
  min-height: 2.25rem; padding: 0.25rem 0.75rem; border-color: var(--line); background: var(--surface);
  color: var(--muted); font-size: inherit;
}
mark { background: #fff1c2; color: var(--fg); }

/* htmx's indicator styles (it can't inject them itself under the Content-Security-Policy). */
.htmx-indicator { opacity: 0; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; transition: opacity 200ms ease-in; }

@media (min-width: 40rem) {
  .top nav { order: 0; flex-basis: auto; }
  main { padding: 1.5rem; }
}

/* === Roster (web/roster.py, templates/roster/, templates/_ics.html) =====================================   Phone: a list per day. From 64rem (the register PC): a grid, days as columns and the parts of the day aligned
   as rows through subgrid. A shortage is always spelled out; the colour only adds to it. */
main:has(.roster) { max-width: 96rem; }
.roster-range { margin: -0.75rem 0 0.5rem; color: var(--muted); }
.roster-calendar { margin: 0 0 1rem; }
.roster-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; margin: 0 0 1rem; }
.tag {
  display: inline-block; margin-left: 0.25rem; padding: 0 0.4rem; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-fg); font-size: 0.8rem; font-weight: 600; vertical-align: middle;
}
.tag.muted { background: var(--line); color: var(--fg); }
.week { display: flex; flex-direction: column; gap: 1.5rem; }
.day h2 { font-size: 1.125rem; margin: 0 0 0.5rem; }
.day.today h2 { color: var(--accent); }
.cells { display: flex; flex-direction: column; gap: 0.5rem; }
.cell {
  padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
}
.cell h3 { font-size: 1rem; margin: 0 0 0.25rem; }
.cell .time { font-weight: 400; color: var(--muted); font-size: 0.875rem; }
.cell ul { margin: 0.25rem 0; padding: 0; list-style: none; }
.cell p { margin: 0.25rem 0; }
.cell .label { font-weight: 600; }
.cell.shut { background: var(--bg); }
.cell.past { background: var(--bg); border-style: dashed; }
.cell.short { border-left-color: #b3261e; }
.fill { display: flex; flex-wrap: wrap; gap: 0 0.75rem; }
.fill .is-short, .shortage { color: #b3261e; font-weight: 600; }
.covered { color: #1e6b33; }
.shortage .sign {
  display: inline-block; width: 1.25rem; border-radius: 50%; background: #b3261e; color: #fff; text-align: center;
}
.nobody { color: var(--muted); }
.event-note { font-style: italic; }
.error { padding: 0.5rem; border-left: 4px solid #b3261e; background: #fdecea; color: #7a1610; }
.cell form { display: inline; margin: 0; }
.cell .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.cell details.claim { flex-basis: 100%; }
.cell details.claim summary { cursor: pointer; color: var(--accent); padding: 0.25rem 0; }
.cell details.claim form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.cell .hint, .ics .hint { flex-basis: 100%; font-size: 0.875rem; color: var(--muted); }
.coverage-form { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.5rem; }
.coverage-form fieldset { display: grid; grid-template-columns: 1fr 5rem; gap: 0.25rem 0.5rem; align-items: center; }
.coverage-form fieldset label { padding: 0; }
.ics .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.ics .actions form { margin: 0; }
.ics-url { width: 100%; font-family: ui-monospace, monospace; }

@media (min-width: 64rem) {
  .week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0 0.5rem; }
  .day { display: grid; grid-template-rows: subgrid; gap: 0.5rem; }
  .cells { display: contents; }
  .week.parts-1 .day { grid-row: span 2; }
  .week.parts-2 .day { grid-row: span 3; }
  .week.parts-3 .day { grid-row: span 4; }
  .week.parts-4 .day { grid-row: span 5; }
  .week.parts-5 .day { grid-row: span 6; }
  .week.parts-6 .day { grid-row: span 7; }
  .day h2 { font-size: 1rem; }
  .cell { font-size: 0.9rem; }
}
/* === End of the roster section ================================================================================= */
/* ===== Personal screens: "My day", "I have time", task suggestions, profile (web/day.py, free_time.py, profile.py) ===== */
h2 { font-size: 1.2rem; margin: 0 0 0.5rem; }
h3 { font-size: 1rem; margin: 0.25rem 0; }
.muted { color: var(--muted); }
.card {
  margin: 0 0 1rem; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.plain { margin: 0; padding: 0; list-style: none; }
.plain > li + li { margin-top: 0.5rem; }
.cta { margin: 0 0 1rem; }
.big, .button.big { width: 100%; min-height: 3.5rem; font-size: 1.15rem; font-weight: 700; text-align: center; }
.button.big { padding-top: 0.9rem; }
.day.today h3 { color: var(--accent); }
.shift, .task { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; }
.when { font-variant-numeric: tabular-nums; }
.badge {
  display: inline-block; padding: 0 0.5rem; border: 1px solid var(--line); border-radius: 1rem;
  font-size: 0.8rem; color: var(--muted);
}
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 0 0 1rem; }
.choices form { margin: 0; }
.choices button[aria-pressed="true"] { outline: 3px solid var(--focus); }
.reasons { margin: 0.25rem 0 0.75rem; padding-left: 1.25rem; }
.done { padding: 0.75rem; border-left: 4px solid var(--accent); background: var(--surface); }
.levels label { padding: 0.35rem 0; }
.levels input, fieldset input[type="checkbox"] { width: 1.25rem; height: 1.25rem; vertical-align: middle; }
input[type="password"] {
  min-height: 2.75rem; max-width: 8rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; letter-spacing: 0.3em;
}
/* ===== End personal screens ===== */
/* --- Team screen (kiosk) and QR claim: web/kiosk.py, templates/kiosk/ --------------------------------------- */
.kiosk { display: grid; gap: 1rem; }
.kiosk section { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.kiosk h2 { font-size: 1.25rem; margin: 0 0 0.75rem; }
.kiosk h2 small, .kiosk h3 small { font-weight: 400; color: var(--muted); }
.kiosk h3 { font-size: 1.05rem; margin: 1rem 0 0.5rem; }
.kiosk-part { padding: 0.5rem 0; border-top: 1px solid var(--line); }
.kiosk-part h3 { margin-top: 0; }
.kiosk-now { border-left: 4px solid var(--accent); padding-left: 0.75rem; }
.kiosk-badge { margin-left: 0.5rem; padding: 0 0.5rem; border-radius: var(--radius); background: var(--accent); color: var(--accent-fg); font-size: 0.875rem; }
.kiosk-people { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; padding: 0; list-style: none; }
.kiosk-kind, .kiosk-task-meta, .kiosk-hint, .kiosk-fill { color: var(--muted); }
.kiosk-short { margin: 0.25rem 0; font-weight: 700; color: #8a1c1c; }
.kiosk-note { font-style: italic; }
.kiosk-message { padding: 0.75rem; border-left: 4px solid var(--accent); background: var(--bg); }
.kiosk-message.kiosk-error { border-left-color: #8a1c1c; }
.kiosk-identify, .kiosk-inbox, .kiosk-time, .kiosk-assign, .kiosk-task-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.kiosk-identify input, .kiosk-pin { width: 6rem; }
.kiosk-inbox input { flex: 1 1 14rem; }
.kiosk-board input[type="password"] {
  min-height: 2.75rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; width: 6rem;
}
.kiosk-timer { font-weight: 700; }
.kiosk-countdown { margin-left: 0.5rem; font-variant-numeric: tabular-nums; }
.kiosk-tasks, .kiosk-reasons { margin: 0; padding: 0; list-style: none; }
.kiosk-task { padding: 0.75rem 0; border-top: 1px solid var(--line); }
.kiosk-task p { margin: 0 0 0.25rem; }
.kiosk-task-title { font-weight: 700; }
.kiosk-task-actions form { margin: 0; }
.kiosk-reasons li { color: var(--muted); }
.kiosk-qr { margin: 0.5rem 0 0; }
.kiosk-qr svg { width: 12rem; height: auto; background: #ffffff; }
.kiosk-qr figcaption { font-size: 0.875rem; color: var(--muted); }
@media (min-width: 64rem) {
  .kiosk { grid-template-columns: 1fr 1fr; }
  .kiosk-roster { grid-row: span 2; }
  main:has(.kiosk) { max-width: 80rem; }
}
/* --- The managers' area (web/manage.py, web/admin.py): its sections, one at a time ------------------------- */
.manage-sections ul { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.manage-sections a { white-space: nowrap; }
.manage-sections a[aria-current="page"] { font-weight: 700; border-color: var(--accent); }
.manage-overview h2 { margin-top: 0; font-size: 1.1rem; }
.manage-overview p { margin-bottom: 0; }
/* --- The shop's settings (web/admin.py, templates/admin/) ---------------------------------------------------- */
.admin-toc { margin: 0 0 1rem; }
.admin-row { padding: 0.75rem 0; border-top: 1px solid var(--line); }
.admin-row p { margin: 0 0 0.25rem; }
.admin-row.admin-off { color: var(--muted); }
.admin-fields { display: grid; gap: 0.5rem; margin: 0 0 0.5rem; }
.admin-fields label, .admin-new label, .admin-times label, #admin-general > label { display: flex; flex-direction: column; gap: 0.125rem; }
.admin-fields fieldset label { flex-direction: row; gap: 0.5rem; align-items: center; }
.admin-new { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.admin-new fieldset label { flex-direction: row; gap: 0.5rem; align-items: center; }
.admin-times { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; align-items: end; }
.admin-times legend code { font-weight: 400; color: var(--muted); }
.admin-times .admin-open, .admin-times .actions { grid-column: 1 / -1; flex-direction: row; gap: 0.5rem; align-items: center; }
.admin-times input[type="text"] { width: 100%; font-variant-numeric: tabular-nums; }
.admin-times .admin-wide { grid-column: 1 / -1; }
.error ul, .error p { margin: 0 0 0.25rem; }
@media (min-width: 40rem) {
  .admin-fields { grid-template-columns: 1fr 1fr; }
  .admin-times { grid-template-columns: 8rem 1fr 1fr; }
  .admin-times .admin-open { grid-column: auto; }
  .admin-times.admin-part { grid-template-columns: 1fr 1fr; }
}

/* "Give back" (templates/cant_do): a quiet link that opens a short form. */
.cant-do summary { cursor: pointer; color: var(--muted); font-size: 0.875rem; margin-top: 0.5rem; }
.cant-do[open] summary { margin-bottom: 0.5rem; }
.cant-do fieldset label { display: block; }
.cant-do-done { margin-top: 0.5rem; }
/* A small number next to a menu item: what waits for a manager. */
.nav-count {
  display: inline-block; min-width: 1.25rem; margin-left: 0.25rem; padding: 0 0.35rem; border-radius: 999px;
  background: var(--tint); color: var(--accent); font-size: 0.8125rem; text-align: center;
}
.decision-note { color: var(--muted); font-size: 0.875rem; }
.kiosk-give summary { cursor: pointer; }
.kiosk-give ul { list-style: none; padding: 0; }
.kiosk-give li { margin: 0.5rem 0; }
/* --- The manager's board and the staff's notes (web/board.py, web/notes.py, templates/board/, templates/notes/) ---
   Calm: few colours, and colour only for meaning (the amber border of a possible false positive is also spelled out).
   Phone: one column at a time, picked in the switcher. From 64rem: the five columns side by side. Nothing moves by
   itself: the "board changed" line has its space kept free, and a card's quick action replaces only that card. */
textarea {
  width: 100%; padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); font: inherit;
}
.text { white-space: pre-line; overflow-wrap: anywhere; }
.hint { font-size: 0.875rem; color: var(--muted); }
.label { margin: 0.75rem 0 0.25rem; font-weight: 600; }
.ai-list { margin: 0 0 0.5rem; padding-left: 1.5rem; }
blockquote.text { margin: 0 0 0.5rem; padding: 0.5rem 0.75rem; border-left: 4px solid var(--line); background: var(--bg); }
.note-form { max-width: none; }
.note-manager { margin: 0.5rem 0; padding: 0.5rem 0.75rem; border-left: 4px solid var(--accent); background: var(--bg); }
.note-manager .label { margin-top: 0; }
/* The note flow: each question with its own box; Accept and Adjust side by side; earlier answers folded away. */
.note-question { padding: 0.5rem 0 0.75rem; border-bottom: 1px solid var(--line); }
.note-question .label { display: block; margin-top: 0; }
.note-choice { align-items: flex-start; }
.note-choice form { margin: 0; }
.note-adjust { flex-basis: 100%; }
.note-adjust > summary { list-style: none; }
.note-adjust > summary::-webkit-details-marker { display: none; }
.note-adjust[open] > summary { margin-bottom: 0.5rem; }
.note-given summary { cursor: pointer; color: var(--muted); margin-top: 0.5rem; }
.note-given dt { font-weight: 600; margin-top: 0.5rem; }
.note-given dd { margin: 0 0 0.25rem; }
a.quiet { font-size: 0.875rem; color: var(--muted); }
/* "Take photo": our own quiet button (a label) over the hidden file input; the count appears next to it. */
.photo-pick { margin: 0.5rem 0 0; }
.photo-pick label.button { cursor: pointer; }
.photo-pick input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.photo-chosen { margin-left: 0.5rem; font-size: 0.875rem; }
.photo-pick .hint { margin: 0.25rem 0 0; }
/* Thumbnails of a task's photos: small squares in a row; each opens the photo. */
.photos { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; padding: 0; list-style: none; }
.photos img {
  display: block; width: 6rem; height: 6rem; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius);
}
.task-steps { flex-basis: 100%; margin-top: 0.25rem; }
.task-steps form { margin: 0; }

main:has(.board) { max-width: 96rem; }
.board-cue { min-height: 2.75rem; margin: 0 0 0.5rem; }
.board-cue-text { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; }
.count { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-switch ul { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.board-switch a {
  display: inline-block; padding: 0.45rem 0.9rem; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; white-space: nowrap; color: var(--accent); background: var(--surface);
}
.board-switch a[aria-current="true"] { font-weight: 700; border-color: var(--accent); }
.board-switch a[aria-current="true"] .count { color: inherit; }
.board-col:not(.is-current) { display: none; }
.board-col h2 { font-size: 1.1rem; }
.board-cards > li + li { margin-top: 0.5rem; }
.board-card {
  padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
}
.board-card.flagged { border-left-color: var(--focus); }
.board-card p { margin: 0.25rem 0; }
.board-card form { margin: 0.25rem 0 0; }
.board-card-title { font-weight: 600; }
.board-facts { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; color: var(--muted); }
.board-flag { font-weight: 600; }
.board-line { color: var(--muted); }
.board-detail .card > h2 { margin-top: 0; }
.board-detail details > summary { cursor: pointer; color: var(--accent); padding: 0.25rem 0; }
.board-detail details[open] > summary { margin-bottom: 0.5rem; }
.board-detail .actions form { margin: 0; }
.board-flag-box { margin-top: 0.75rem; padding: 0.5rem 0.75rem; border-left: 4px solid var(--focus); background: var(--bg); }
.estimate-skills { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.5rem; align-items: center; }
.estimate-skills legend { grid-column: 1 / -1; }
.labels { margin: 0.5rem 0 0; }
.board-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.board-all { margin: 0 0 0.5rem; }
.board-all > summary { cursor: pointer; color: var(--accent); padding: 0.25rem 0; }
.board-all ul { margin: 0.25rem 0; }
.board-new { max-width: 40rem; }
.board-split { max-width: 40rem; }
.split-steps > li + li { margin-top: 0.5rem; }
.split-steps .muted { display: block; margin-left: 1.75rem; }

@media (min-width: 64rem) {
  .board-switch { display: none; }
  .board-columns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; align-items: start; }
  .board-col:not(.is-current) { display: block; }
  .board-col { padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); }
  .board-card { font-size: 0.95rem; }
}

/* No motion without meaning: whoever asks their system for less motion gets none. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  button:active, .button:active { transform: none; }
}

/* Radio buttons and checkboxes big enough to hit on a phone, with the whole label as the target. */
input[type="radio"], input[type="checkbox"] { width: 1.25rem; height: 1.25rem; margin: 0 0.5rem 0 0; vertical-align: -0.2rem; }
fieldset label:has(> input[type="radio"]), fieldset label:has(> input[type="checkbox"]) { display: block; padding: 0.4rem 0; }
/* The roster opens at today (the menu links to #today): leave a little room above it. */
#today { scroll-margin-top: 1rem; }

/* Logging in with a passkey (login.html, welcome.html) and a manager's login code (manage/login_code.html). */
.login { max-width: 28rem; }
.login-qr svg { width: min(18rem, 100%); height: auto; background: #ffffff; padding: 0.5rem; }
#login-link { width: 100%; }
