/* Controls: 36px with a mouse, 44px under a finger (style guide, Controls; CL08, BUG-APP-13). */
:root { --sched-target: 36px; }
@media (pointer: coarse) { :root { --sched-target: 44px; } }
/* Staff scheduling. Phones (≤760px) get day sections and bottom sheets; nothing scrolls sideways. */

.schedule-workspace { width: 100%; min-width: 0; padding-bottom: 4rem; /* room under the floating Help button */ }
.schedule-workspace button, .schedule-workspace select, .schedule-workspace input:not([type="checkbox"]):not([type="radio"]) { min-height: var(--sched-target); }
.schedule-workspace [aria-pressed="true"] { outline: 2px solid var(--focus); outline-offset: -2px; background: var(--walk-in); }
/* The pills that choose what the calendar shows (page, whose shifts, view, filters, rows, colors): on is filled, off is an
   outline, so the choice reads at a glance (style guide, Chips: "on is aria-pressed and drawn filled"; owner, 16 Nov 2026). */
:root .schedule-workspace :is(.schedule-tabs, .schedule-segment, .chip-row) button[aria-pressed="true"] {
  background: var(--ink) !important; color: var(--paper) !important; border-color: var(--ink) !important; outline: 0; font-weight: 600;
  box-shadow: none !important; /* no inner ring from the shared pressed rule (controls.css): the fill says it */ }
:root .schedule-workspace :is(.schedule-tabs, .schedule-segment, .chip-row) button[aria-pressed="true"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.schedule-status-line .schedule-loading, .schedule-calendar .schedule-loading { margin: 0; }
.schedule-empty { margin: .6rem 0; font-weight: 600; }  /* why the grid under it has no shifts */
.schedule-workspace label, .schedule-sheet label { display: flex; flex-direction: column; gap: .3rem; }
.schedule-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .8rem 0; }
.schedule-toolbar h2 { margin: 0; }
.desktop-only { display: flex; }

/* ---- Page header, filters and toast ---- */
.schedule-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.schedule-head h1 { margin: 0; }
.schedule-tabs, .schedule-segment { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.schedule-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .4rem 0 .8rem; }
.schedule-request-button { margin-left: auto; }
.schedule-chip { border-radius: 999px !important; }
.schedule-toast { position: fixed; z-index: 60; left: 50%; bottom: var(--space-6); transform: translateX(-50%); width: max-content; max-width: min(560px, calc(100vw - 32px));
  margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--ink); color: var(--paper); box-shadow: 0 8px 24px rgb(0 0 0 / .18);
  pointer-events: none; }  /* words only: it never takes a click meant for what's under it */
@media (max-width: 760px) { .schedule-toast { bottom: calc(80px + env(safe-area-inset-bottom)); } }  /* above the tab bar */
/* The Saved bar floats over the page, so nothing moves under the pointer when it comes and goes (CL08, BUG-APP-21). */
.schedule-toolbar .schedule-delete { margin-right: auto; }

/* Checkboxes and radios with their words beside them (not stretched to the row's width). */
.schedule-check { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: .6rem; margin: .6rem 0; }
.schedule-workspace .schedule-check input[type="checkbox"], .schedule-workspace .schedule-check input[type="radio"],
.schedule-sheet .schedule-check input[type="checkbox"], .schedule-sheet .schedule-check input[type="radio"] { width: 20px; height: 20px; min-height: 20px; flex: none; margin: .15rem 0 0; }
.schedule-check > span { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.schedule-check small { font-weight: normal; }

/* ---- Requests list ---- */
/* Requests is an accordion (guide.css .accordion): its list is the accordion's body */
.schedule-requests ul { list-style: none; margin: 0; }
:root button.schedule-request-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: .6rem; align-items: center; width: 100%;
  text-align: left; padding: .5rem .2rem !important; border: 0 !important; border-bottom: 1px solid var(--edge) !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; }
.schedule-request-row small { color: var(--ink-soft); }

/* ---- Calendar header, status and actions ---- */
.schedule-calendar-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; justify-content: space-between; }
.schedule-period-nav { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.schedule-period-label { font-size: var(--text-base); margin: 0 .2rem; min-width: 14.5rem; text-align: center; }  /* the arrows stay put as the dates change (CL08, BUG-APP-14) */
.schedule-status-line { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; margin: .8rem 0 .4rem; }
.schedule-delivery { display: inline-flex; align-items: center; gap: .5rem; color: var(--red-pen); font-weight: 600; }
.schedule-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0; }
/* Filter pills on the left, the actions on the right: Undo, Add shifts, Copy, Print, then Review & publish last (owner, 9 Nov 2026) */
.schedule-actions-end { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-left: auto; }
/* The period's arrows are square, whatever the dates beside them wrap to */
/* The roster's corner holds the Rows choice (Job | People); the legend row holds the Colors choice */
/* stacked, so both fit the narrow first column */
.schedule-roster > .roster-corner { background: var(--walk-in); flex-direction: column; flex-wrap: nowrap; gap: 4px; align-items: stretch; }
.schedule-roster > .roster-corner button { min-height: 28px; padding: 2px 8px; white-space: nowrap; }
.schedule-legend-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-top: 1rem; }
.schedule-legend-row .schedule-legend { margin-top: 0; }
.schedule-colors { align-items: center; }
.schedule-accordion { margin: 0 0 .8rem; }
.schedule-week-select { max-width: 22rem; margin: .4rem 0; }

/* ---- Week roster (desktop) ---- */
.schedule-roster-scroll { max-width: 100%; overflow-x: auto; }
.schedule-roster { display: grid; grid-template-columns: minmax(7rem, .8fr) repeat(var(--schedule-days), minmax(7rem, 1fr)); min-width: calc((var(--schedule-days) + 1) * 7rem); border-top: 1px solid var(--edge); border-left: 1px solid var(--edge); margin-top: .6rem; }
.schedule-roster > * { min-width: 0; padding: .45rem; border-bottom: 1px solid var(--edge); border-right: 1px solid var(--edge); overflow-wrap: anywhere; }
.schedule-roster > .roster-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.schedule-roster > strong { background: var(--walk-in); font-size: var(--text-sm); }
.roster-cell { display: flex; flex-direction: column; }

/* Shift and request cards: job/service color on the left edge; state from the border style and words. */
.schedule-entry { display: flex; flex-direction: column; align-items: flex-start; width: 100%; box-sizing: border-box; gap: .15rem; padding: .5rem; margin: .25rem 0;
  text-align: left; white-space: normal; overflow-wrap: anywhere; background: var(--paper); color: var(--ink); line-height: 1.35; }
.schedule-entry strong { font-size: var(--text-sm); }
.schedule-entry small { font-size: var(--text-xs); }
.schedule-state { font-weight: 700; }
.historical .schedule-entry { opacity: .75; }
/* Calendar entries are labelled blocks, not ordinary buttons: hold their borders over controls.css's !important resets. */
:root button.schedule-entry { border: 1px solid var(--edge) !important; border-left: 4px solid var(--shift-color, var(--focus)) !important; border-radius: .25rem !important; box-shadow: none !important; }
:root button.schedule-entry.draft { border: 2px dotted var(--shift-color, var(--focus)) !important; border-left-width: 5px !important; }
:root button.schedule-entry.open { outline: 1px dashed var(--ink-soft); outline-offset: -5px; }
:root button.schedule-entry.seeking { box-shadow: inset 0 -3px var(--highlighter) !important; }
:root button.schedule-entry.conflict { box-shadow: inset 0 -3px var(--red-pen) !important; }
:root button.schedule-entry.request { border-left-color: var(--highlighter) !important; }
:root button.schedule-entry.request.approved { border-left-color: var(--done) !important; }
:root button.schedule-entry.request.declined { border-left-color: var(--red-pen) !important; opacity: .8; }

/* People view (managers): someone can't work this day, in whole or part. The + below stays for an override. */
.schedule-unavailable { margin: .25rem 0; padding: .4rem .5rem; border: 1px solid var(--red-pen); border-left-width: 4px; border-radius: .25rem; font-size: var(--text-xs); font-weight: 700; line-height: 1.35;
  color: var(--red-pen); background: color-mix(in srgb, var(--red-pen) 10%, var(--paper)); cursor: help; }

/* Add a shift: a quiet + in every cell; its full name is read out and shown on hover. */
:root button.schedule-add { width: 100%; min-height: var(--sched-target) !important; margin: .2rem 0; padding: 0 !important; font-size: var(--text-base); line-height: 1; color: var(--ink-soft);
  border: 1px dashed transparent !important; background: none !important; box-shadow: none !important; }
:root button.schedule-add:hover, :root button.schedule-add:focus-visible { border-color: var(--edge) !important; color: var(--ink); background: var(--walk-in) !important; }
:root .schedule-day button.schedule-add { min-height: var(--sched-target) !important; border-color: var(--edge) !important; }  /* phones: a visible target */

.schedule-legend { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; font-size: var(--text-xs); }
.schedule-legend i { display: inline-block; width: .65rem; height: .65rem; border-radius: 2px; margin-right: .3rem; }

/* ---- Day sections (phones, list view, My shifts) ---- */
.schedule-days { display: grid; gap: .8rem; margin-top: .6rem; }
.schedule-days.phone-only { display: none; }
.schedule-day { min-width: 0; border: 1px solid var(--edge); border-radius: .4rem; padding: .75rem; }
.schedule-day h3 { font-size: var(--text-base); margin: 0 0 .5rem; }

/* ---- Month overview ---- */
.schedule-month-overview { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-top: .6rem; }
.month-weekday { padding: .4rem 0; text-align: center; font-size: var(--text-xs); }
:root button.month-date { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; min-width: 0; min-height: 116px; padding: .45rem !important;
  gap: 5px; border: 1px solid var(--edge) !important; border-radius: 4px !important; text-align: left; }
:root button.month-date.selected-period { border-top: 3px solid var(--focus) !important; }
.month-date > strong { font-size: var(--text-sm); }
.month-shift-bars { display: grid; gap: 4px; }
.month-shift-bar { display: block; min-height: 16px; padding: 0 3px; font-size: var(--text-xs); font-weight: 700; line-height: 16px; letter-spacing: .02em; color: var(--paper);
  background: var(--service-color); border-left: 6px solid var(--job-color); border-radius: 2px; overflow: hidden; white-space: nowrap; text-shadow: 0 0 2px rgb(0 0 0 / .45); }
.month-shift-bar.draft { outline: 1px dotted var(--ink); outline-offset: 1px; }
.month-shift-bar.open { background: var(--paper); color: var(--ink); text-shadow: none; outline: 1px dashed var(--ink-soft); outline-offset: -1px; }
.month-more, .month-request-count { font-size: var(--text-xs); line-height: 1.1; }
.month-request-count { color: var(--ink-soft); }

/* ---- Sheets ---- */
.schedule-sheet { padding-top: .6rem; min-width: 0; }
.schedule-sheet h2 { padding-right: 4rem; }
.schedule-sheet label { margin: .7rem 0; gap: .35rem; }
.schedule-sheet input, .schedule-sheet select, .schedule-sheet button { min-height: var(--sched-target); }
.schedule-sheet details { padding: .6rem 0; border-top: 1px solid var(--edge); }
.schedule-sheet ul { padding-left: 1.1rem; }
.schedule-sheet .sheet-actions { position: sticky; bottom: 0; background: var(--paper); padding-top: .8rem; }
.schedule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.schedule-fields input, .schedule-fields select, .schedule-sheet textarea, .schedule-settings input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), .schedule-settings select {
  width: 100%; min-width: 0; box-sizing: border-box; font-size: var(--text-base); }
.schedule-person-row { display: flex; align-items: center; gap: .6rem; padding: .65rem 0; border-bottom: 1px solid var(--edge); }
.schedule-person-row > span { flex: 1; min-width: 0; }
.schedule-person-row small { display: block; color: var(--ink-soft); overflow-wrap: anywhere; }
.schedule-person-row button { flex: none; }
.schedule-day-buttons { display: flex; flex-wrap: wrap; gap: .4rem; }
.schedule-day-buttons button { flex: 1 0 75px; }
:root .schedule-day-buttons button[aria-pressed="true"] { background: var(--ink); color: var(--paper); outline: 0; }  /* chosen days read at a glance */
/* Add shifts: someone chosen to work the new shifts reads like a chosen day (Assign is on/off there). */
:root .schedule-person-row button[aria-pressed="true"] { background: var(--ink); color: var(--paper); outline: 0; }
.schedule-sheet fieldset { border: 0; padding: 0; margin: 0 0 var(--space-3); min-width: 0; }
.schedule-sheet legend { padding: 0; margin-bottom: var(--space-2); font-weight: 600; }
.schedule-fields .wide { grid-column: 1 / -1; }
.schedule-notice { background: var(--walk-in); border-left: 3px solid var(--focus); padding: .75rem; }
/* Settings → Jobs: a removed job has the name typed; Restore beside the sentence, wrapping under it on a phone. */
.schedule-job-restore { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin: -.3rem 0 .7rem; }
.schedule-status-choices { display: flex; flex-wrap: wrap; gap: .6rem; }
.schedule-status-choices button { flex: 1; }

/* ---- Settings ---- */
/* Two panels side by side only while each keeps 22rem: at 800px the Jobs panel was 237px and cut "Dishwasher" and
   "Front of house" (retest 19 Nov, TEAM18-02); below that they stack. */
.schedule-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.schedule-settings .panel { min-width: 0; }
.schedule-settings h2 { font-size: var(--text-lg); margin-top: 0; }
/* Job, color, front of house or kitchen, Remove: the name gets the room; on phones Where and Remove go under it. */
/* Where fits "Front of house" (CL08, BUG-APP-16); the field names show on the first row only, as column headings. */
.schedule-setting-row { display: grid; grid-template-columns: minmax(0, 1fr) 60px minmax(11rem, auto) auto; align-items: end; gap: .5rem; margin: .7rem 0; }
@media (max-width: 760px) {
  /* The second column holds Remove or Kitchen access as well as the color swatch: let its text fit. */
  .schedule-setting-row { grid-template-columns: minmax(0, 1fr) minmax(60px, max-content); }
  .schedule-setting-row label:nth-of-type(3) { grid-column: 1; }
  .schedule-setting-row button { grid-column: 2; }
}
/* The same two lines whenever the Jobs panel itself is narrow (half of a 1280px page, or the pane): beside color, Where
   and Remove the name had 86px and "Dishwasher" was cut off (TEAM18-02). */
.schedule-jobs-panel { container: jobs-panel / inline-size; }
@container jobs-panel (max-width: 34rem) {
  .schedule-jobs-panel .schedule-setting-row { grid-template-columns: minmax(0, 1fr) minmax(60px, max-content); }
  .schedule-jobs-panel .schedule-setting-row label:nth-of-type(3) { grid-column: 1; }
  .schedule-jobs-panel .schedule-setting-row button { grid-column: 2; }
}
/* Name and color on one line; From and Until share the full width below at equal size (review: Until was squeezed into
   the color swatch's column and times were cut off on phones). */
.schedule-service-row { display: grid; gap: .5rem; padding: .75rem 0; border-bottom: 1px solid var(--edge); }
.schedule-service-name { display: grid; grid-template-columns: minmax(0, 1fr) 60px; gap: .5rem; align-items: end; }
.schedule-service-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.schedule-service-times input[type="time"] { width: 100%; min-width: 0; }
.schedule-service-row > button { justify-self: start; }
.schedule-setting-row ~ .schedule-setting-row .field-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.schedule-overnight { margin-top: -.25rem; }
.schedule-settings input[type="color"] { min-width: var(--sched-target); width: 60px; padding: .2rem; }
.schedule-settings a { overflow-wrap: anywhere; }
.schedule-save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .6rem;
  margin-top: 1rem; padding: .7rem 1rem; background: var(--paper); border-top: 1px solid var(--edge); box-shadow: 0 -4px 12px rgb(15 20 35 / .06); }
.schedule-save-bar > span { margin-right: auto; color: var(--ink-soft); }
.schedule-save-bar.changed > span { color: var(--ink); font-weight: 700; }

/* ---- Date picker and usual week ---- */
.schedule-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--edge); background: var(--edge); user-select: none; }
.schedule-month > * { min-width: 0; text-align: center; border-radius: 0; background: var(--paper); }
.schedule-month .weekday { padding: .5rem 0; font-size: var(--text-xs); }
.schedule-month button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 58px; padding: .3rem; border: 0; }
:root .schedule-month button.outside { color: var(--ink-soft) !important; background: var(--walk-in) !important; }
.schedule-month small { font-size: var(--text-xs); }
.range-selected { box-shadow: inset 0 0 0 2px var(--focus) !important; background: var(--walk-in) !important; }
:root button.range-selected { box-shadow: inset 0 0 0 2px var(--focus) !important; outline: 2px solid var(--focus); outline-offset: -2px; }
.schedule-week-pattern { display: grid; grid-template-columns: 65px repeat(7, minmax(0, 1fr)); gap: 2px; user-select: none; }
.schedule-week-pattern .time-label { display: flex; align-items: center; font-size: var(--text-xs); padding: .3rem; }
.schedule-week-pattern .pattern-heading { text-align: center; padding: .5rem .1rem; font-size: var(--text-xs); }
.pattern-cell { border-radius: 0; padding: .2rem !important; font-size: var(--text-xs); min-width: 0; min-height: 36px !important; }
:root button.pattern-cell.available, :root .schedule-status-choices button.available { background: var(--walk-in) !important; }
:root button.pattern-cell.preferred, :root .schedule-status-choices button.preferred { background: color-mix(in srgb, var(--done) 16%, var(--paper)) !important; }
:root button.pattern-cell.unavailable, :root .schedule-status-choices button.unavailable { background: color-mix(in srgb, var(--red-pen) 10%, var(--paper)) !important; }
.schedule-mobile-day { display: none !important; }

/* ---- Daily Dish card ---- */
.schedule-dish-list { list-style: none; padding: 0; margin: .4rem 0 .8rem; }
.schedule-dish-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .8rem; padding: .55rem .2rem; border-bottom: 1px solid var(--edge); }
.schedule-dish-list li.next { border-left: 3px solid var(--focus); padding-left: .6rem; background: var(--walk-in); }
/* Shared by the Daily Dish's cards (pages/daily-dish-page.tsx) */
.staff-dish-note { display: block; color: var(--ink-soft); font-size: var(--text-sm); }
ul.staff-dish-hours { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; }

/* ---- Phones ---- */
@media (max-width: 760px) {
  .desktop-only { display: none !important; }
  .schedule-head h1 { font-size: var(--text-lg); }
  .schedule-filters { gap: .4rem; }
  .schedule-request-button { margin-left: 0; flex: 1 0 100%; }
  .schedule-calendar.panel { padding: .75rem; }
  .schedule-calendar-head { gap: .4rem; }
  .schedule-period-nav { width: 100%; }
  .schedule-period-label { flex: 1 1 0; min-width: 0; text-align: center; font-size: var(--text-base); }  /* ‹ dates › on one row; Today wraps under (verified 9 Nov) */
  .schedule-actions-end { margin-left: 0; }
  .schedule-actions .primary { flex: 1 0 100%; order: -1; }
  :root button.schedule-request-row { grid-template-columns: 1fr; gap: .1rem; }
  .schedule-roster-scroll { display: none; }
  .schedule-days.phone-only { display: grid; }
  .schedule-settings-grid { grid-template-columns: 1fr; }
  .schedule-mobile-day { display: flex !important; margin-bottom: .7rem; }
  .schedule-week-pattern { grid-template-columns: 75px minmax(0, 1fr); }
  .schedule-week-pattern .hide-on-phone { display: none; }
  .pattern-cell { min-height: var(--sched-target) !important; font-size: var(--text-sm); }
  .schedule-sheet .sheet-actions { position: static; }
  .schedule-sheet h2 { padding-right: 3rem; }
  .schedule-month button { min-height: 48px; }
  .schedule-status-choices { flex-direction: column; }
  .schedule-month-overview { gap: 2px; }
  :root button.month-date { min-height: 100px; padding: .25rem !important; gap: 4px; }
  .month-shift-bar { border-left-width: 4px; padding: 0 1px; font-size: var(--text-xs); }
  .month-more, .month-request-count { font-size: var(--text-xs); overflow-wrap: anywhere; }
  .month-weekday { font-size: var(--text-xs); }
  .schedule-save-bar { margin: 1rem -.5rem 0; padding: .6rem .75rem; }
}
@media (prefers-reduced-motion: reduce) { .schedule-workspace * { scroll-behavior: auto; } }

/* ---- Printing ---- */
.schedule-print-root { display: none; }
@page schedule { size: landscape; margin: 12mm; }
@media print {
  body:has(> .schedule-print-root) > :not(.schedule-print-root) { display: none !important; }
  body:has(> .schedule-print-root), html:has(.schedule-print-root) { overflow: visible !important; height: auto !important; background: white !important; }
  .schedule-print-root { display: block; page: schedule; color: #111; font-family: Arial, sans-serif; font-size: 10pt; }
  .schedule-print-root h1 { font-size: 18pt; }
  .schedule-print-week { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 0 0 14mm; break-inside: avoid; }
  .schedule-print-week th, .schedule-print-week td { border: 1px solid #777; padding: 2mm; vertical-align: top; overflow-wrap: anywhere; }
  .schedule-print-week th { background: #eee; }
  .schedule-print-shift { padding: 1mm 0; }
  /* The page is white in print whatever the theme, so the light green, which also prints dark enough in grey. */
  .schedule-print-root .compliance-cert-mark { color: #1F7A4D; }
  .schedule-print-shift.draft { border: 1px dotted #56637b; padding: 4px; }
}

/* ---- People (Add person, each person's sheet, Schedule → People; Corey, 6 Nov) ----------------------------------------
   Works inside and outside .schedule-workspace: the owners' People page opens the same sheet. */
.person-sheet fieldset { border: 0; padding: 0; margin: .9rem 0; min-width: 0; }
.person-sheet legend { font-weight: 600; padding: 0; margin-bottom: .45rem; }
.person-sheet .hint { font-weight: 400; }
.person-sheet label > .hint { font-size: var(--text-sm); }
.person-field-error { color: var(--red-pen); margin: -.3rem 0 .6rem; font-size: var(--text-sm); }

/* Jobs as chips: tap to choose; the job's color is the dot, and a chosen chip fills with a tint of it. */
.person-job-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.person-job-chip { display: inline-flex; align-items: center; gap: .45rem; min-height: var(--sched-target); padding: .35rem .9rem; border-radius: 999px;
  border: 1px solid var(--edge); background: var(--paper); color: var(--ink); font-weight: 600; }
.person-job-chip small { color: var(--ink-soft); font-size: var(--text-xs); }
.person-job-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--job, var(--ink-soft)); flex: none; }
.person-job-chip[aria-pressed="true"], .schedule-workspace .person-job-chip[aria-pressed="true"] {
  outline: none; border-color: var(--job, var(--focus)); background: color-mix(in srgb, var(--job, var(--focus)) 16%, var(--paper));
  box-shadow: inset 0 0 0 1px var(--job, var(--focus)); font-weight: 650; }
.person-job-chip[aria-pressed="true"]::after { content: ""; width: 5px; height: 9px; margin: 0 2px 3px 2px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }  /* a drawn check, never the ✓ character */
.person-job-new { border-style: dashed; color: var(--focus); }
.person-new-job { margin-top: .7rem; padding: .8rem; border: 1px solid var(--config-edge); border-radius: var(--radius); background: var(--config); }
.person-new-job label { margin-top: 0; }
.person-side { display: flex; width: 100%; }
.person-side button { flex: 1; min-height: var(--sched-target); }

.person-contact { padding: .2rem 0 0 !important; border-top: 1px solid var(--edge) !important; }
.person-contact legend { padding-top: .8rem; }

/* After adding: who it was, then the welcome question. */
.person-made-name { display: flex; align-items: center; gap: .7rem; font-size: var(--text-base); margin: .4rem 0 .8rem; }
.person-avatar { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; flex: none; font-weight: 700; font-size: var(--text-sm);
  color: var(--ink); background: color-mix(in srgb, var(--job, var(--focus)) 22%, var(--paper)); border: 2px solid var(--job, var(--focus)); }
.person-welcome { padding: .9rem; border-radius: var(--radius); background: var(--config); border: 1px solid var(--config-edge); margin: .6rem 0; }
.person-welcome p { margin: 0 0 .4rem; }
.person-welcome .schedule-toolbar { margin-top: .6rem; }
.person-locked { padding: .7rem .9rem; border-radius: var(--radius); background: var(--walk-in); margin: .4rem 0 .8rem; }
.person-locked p { margin: .2rem 0; }
.person-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 .2rem; }
.person-welcome-reminder { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.person-welcome-reminder p { margin: 0; flex: 1 1 16rem; }

/* Schedule → People: one row per person; the whole row opens their sheet. */
.schedule-people-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.schedule-people-head h2 { margin: 0; }
.schedule-people-head .primary { min-height: var(--sched-target); }
.schedule-people-search { max-width: 24rem; margin: .8rem 0 0; }
.schedule-people-list { list-style: none; margin: .8rem 0 0; padding: 0; }
.schedule-people-row { display: flex; align-items: center; gap: .5rem; border-top: 1px solid var(--edge); padding: .35rem 0; }
.schedule-people-open, .schedule-workspace .schedule-people-open { flex: 1 1 18rem; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .8rem;
  text-align: left; background: none; border: 0; padding: .55rem .4rem; border-radius: var(--radius); color: inherit; min-height: 56px; }
.schedule-people-open:hover { background: var(--walk-in); }
.schedule-workspace .schedule-people-open { border: 0; box-shadow: none; }
.schedule-people-main { display: grid; gap: .2rem; min-width: 0; }
.schedule-people-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-people-jobs { display: flex; flex-wrap: wrap; gap: .3rem; }
.person-job-tag { font-size: var(--text-xs); padding: .05rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--job) 15%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--job) 55%, var(--paper)); }
.schedule-people-contact { color: var(--ink-soft); font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-status { font-size: var(--text-sm); color: var(--ink-soft); text-align: right; white-space: nowrap; }
.person-status.not_welcomed { color: var(--ink); font-weight: 600; }
.schedule-people-welcome, .schedule-people-call { min-height: var(--sched-target); white-space: nowrap; }
.schedule-people-call { display: inline-flex; align-items: center; padding: 0 .8rem; border: 1px solid var(--edge); border-radius: var(--radius); text-decoration: none; }
.schedule-add-new { margin-top: .9rem; width: 100%; min-height: 48px; border-style: dashed; color: var(--focus); }
.schedule-back { margin-bottom: .6rem; min-height: var(--sched-target); }
@media (max-width: 760px) {
  .schedule-people-open { grid-template-columns: auto minmax(0, 1fr); }
  .person-status { grid-column: 2; text-align: left; white-space: normal; }  /* "Team member · No sign-in" wraps at 200% text (I18N-F8) */
  .schedule-people-row { flex-wrap: wrap; padding-bottom: .6rem; }
  .schedule-people-open, .schedule-workspace .schedule-people-open { flex-basis: 100%; }
  .schedule-people-welcome, .schedule-people-call { flex: 1; justify-content: center; margin-left: 3.3rem; }
  .schedule-people-call + .schedule-people-welcome, .schedule-people-welcome + .schedule-people-call { margin-left: 0; }
  .schedule-people-head .primary { width: 100%; }
}
.people-add { margin: 1.2rem 0 .4rem; display: grid; gap: .35rem; justify-items: start; }
.people-add .primary { min-height: var(--sched-target); }
.person-field-hint { margin: -.45rem 0 .5rem; font-size: var(--text-sm); }
/* People rows are list rows, not boxed buttons: hold that over controls.css's !important resets (as calendar entries do). */
:root button.schedule-people-open { border: 0 !important; box-shadow: none !important; background: none !important; }
:root button.schedule-people-open:hover { background: var(--walk-in) !important; }
:root button.schedule-people-open:focus-visible { outline: 2px solid var(--focus) !important; outline-offset: 2px; }

/* ---- Email: language picker, sent email, the Daily Dish card (Corey, 7 Nov) ----------------------------------------- */
.email-language { margin: .6rem 0; }
.email-language-note { margin: -.2rem 0 .4rem; font-size: var(--text-sm); }
.email-language-search { margin-top: .5rem; padding: .7rem; border: 1px solid var(--config-edge); border-radius: var(--radius); background: var(--config); }
.email-language-results { list-style: none; margin: .4rem 0; padding: 0; display: grid; gap: .3rem; }
.email-language-results button { width: 100%; text-align: left; min-height: var(--sched-target); }
.schedule-people-tools { display: flex; gap: .5rem; flex-wrap: wrap; }
.person-status.email-problem, .person-email-problem { color: var(--red-pen); font-weight: 600; }

.email-status { display: inline-block; white-space: nowrap; font-size: var(--text-xs); font-weight: 600; padding: .12rem .55rem; border-radius: 999px;
  border: 1px solid var(--edge); color: var(--ink-soft); background: var(--paper); }
.email-status.good { color: var(--done); border-color: color-mix(in srgb, var(--done) 45%, var(--paper)); background: color-mix(in srgb, var(--done) 9%, var(--paper)); }
.email-status.problem { color: var(--red-pen); border-color: color-mix(in srgb, var(--red-pen) 45%, var(--paper)); background: color-mix(in srgb, var(--red-pen) 8%, var(--paper)); }
.email-status.wait { color: var(--ink); border-color: var(--highlighter); background: color-mix(in srgb, var(--highlighter) 22%, var(--paper)); }

.email-log-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; align-items: end; }
.email-log-filters label { margin: 0; }
.email-log-list { list-style: none; margin: .9rem 0; padding: 0; }
.email-log-list li { border-top: 1px solid var(--edge); }
:root button.email-log-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; width: 100%; text-align: left;
  border: 0 !important; box-shadow: none !important; background: none !important; padding: .7rem .4rem; border-radius: var(--radius); color: inherit; }
:root button.email-log-row:hover { background: var(--walk-in) !important; }
.email-log-main { display: grid; gap: .15rem; min-width: 0; }
.email-log-main strong, .email-log-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-log-to { font-size: var(--text-sm); }
.email-sheet { max-width: 720px; }
.email-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .3rem .9rem; margin: .4rem 0 .9rem; }
.email-facts dt { color: var(--ink-soft); }
.email-facts dd { margin: 0; overflow-wrap: anywhere; }
.email-events { margin: .2rem 0 .8rem; padding-left: 1.2rem; }
.email-preview-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.email-preview { width: 100%; height: min(520px, 55vh); border: 1px solid var(--edge); border-radius: var(--radius); background: var(--walk-in); }
.email-plain { white-space: pre-wrap; overflow-wrap: anywhere; font: .9rem/1.5 ui-monospace, Menlo, monospace; background: var(--walk-in); padding: .8rem; border-radius: var(--radius); }

.email-dish h2 { margin-top: 0; }
.email-dish-list { list-style: none; margin: .4rem 0 .8rem; padding: 0; display: grid; gap: .7rem; }
.email-dish-list li { display: grid; gap: .15rem; padding-left: .7rem; border-left: 3px solid var(--red-pen); }
.email-dish-line { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.email-dish-advice { font-size: var(--text-sm); }
@media (max-width: 760px) {
  .email-log-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .email-log-search { grid-column: 1 / -1; }
  .email-preview { height: min(420px, 55vh); }
}

/* Scheduling's refusals ("Give the job a name.", "That time has already passed…") in the error style, like every other
   form's (CL08, BUG-APP-12). */
.schedule-workspace p[role="alert"], .sheet p[role="alert"]:not(.notice) { color: var(--red-pen); font-weight: 600; }
.schedule-month button:disabled { color: var(--ink-soft); opacity: .45; cursor: not-allowed; }
.schedule-long-shift { display: flex; gap: var(--space-2); align-items: flex-start; margin: var(--space-2) 0; }
/* The Save group button sits on the input's line at its own height, not stretched to the label's (CL08, BUG-APP-20). */
.schedule-group-save { align-items: end; }
.schedule-group-save > button { align-self: end; justify-self: start; }

/* Staff certifications (docs/software-design/staff-certifications.md) */
.schedule-people-certs { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
.person-certs { border: 0; padding: 0; margin: 0; }
.person-cert-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.person-cert-list > li { padding: var(--space-2) var(--space-3); border-radius: var(--radius); }
.person-cert-list > li:nth-child(even) { background: var(--row-stripe); }
.person-cert-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.person-cert-head button { margin-left: auto; }
.person-cert-list p { margin: var(--space-1) 0; }
.person-cert-photo { display: block; max-width: min(100%, 240px); border: 1px solid var(--edge); border-radius: var(--radius); margin: var(--space-2) 0; }
.person-cert-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.person-cert-confirm p { flex-basis: 100%; }
.person-cert-form { display: grid; gap: var(--space-3); }
.person-cert-form label { display: grid; gap: var(--space-1); }

/* Removed people (Schedule → People), and each person's own join code */
.schedule-people-removed { margin-top: 12px; }
.schedule-people-removed summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; font-weight: 600; list-style: none; }
.schedule-people-removed summary::-webkit-details-marker { display: none; }
.schedule-people-removed .schedule-chevron { display: inline-flex; width: 16px; height: 16px; transform: rotate(-90deg); transition: transform .15s; }
.schedule-people-removed .schedule-chevron svg { width: 16px; height: 16px; flex: none; }
.schedule-people-removed[open] .schedule-chevron { transform: none; }
.schedule-people-removed ul { margin: 0; padding: 0; list-style: none; }
.schedule-people-removed li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; }
.person-join-code { margin: .4rem 0; }


/* ---- Review and publish: a read-only calendar of the period (owner, 9 Nov 2026) ---- */
.schedule-review-scroll { max-width: 100%; overflow-x: auto; margin: .4rem 0 .6rem; }
.schedule-review-grid { border-collapse: collapse; font-size: var(--text-xs); width: 100%; }
.schedule-review-grid th, .schedule-review-grid td { border: 1px solid var(--edge); padding: 3px 4px; vertical-align: top; text-align: left; }
.schedule-review-grid thead th { background: var(--walk-in); font-weight: 600; white-space: nowrap; }
.schedule-review-grid tbody th { font-weight: 600; white-space: nowrap; }
.review-shift { display: block; white-space: nowrap; color: var(--ink-soft); }
.review-shift.changed { color: var(--ink); font-weight: 700; }
.review-shift.open { font-style: normal; }

/* WhenToWork review, Roles: the position on the left, its PlateWize role (or the choice of one) on the right. */
.schedule-roles { list-style: none; margin: 0 0 12px; padding: 0; }
.schedule-role-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 4px 16px; align-items: start; padding: 10px 0; border-top: 1px solid var(--edge); }
.schedule-role-row > strong { padding-top: 8px; overflow-wrap: anywhere; }
.schedule-role-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.schedule-role-choice select { flex: 1 1 180px; max-width: 280px; min-width: 0; }
.schedule-role-choice > .hint, .schedule-role-choice > .schedule-check { flex-basis: 100%; margin: 0; }
@media (max-width: 560px) {
  .schedule-role-row { grid-template-columns: minmax(0, 1fr); }
  .schedule-role-row > strong { padding-top: 0; }
  .schedule-role-choice select { max-width: none; flex-basis: 100%; }
}
