/* Camp Soft Landing — screen styles.
 *
 * Every colour here is a token from tokens.css (05_CONVENTIONS.md guardrail
 * 10). Nothing in this file may contain a raw colour value; scripts/check.js
 * enforces it.
 *
 * Territory colours are the one exception, and they are not written here at
 * all: they are rows in the `territory` table, so components paint them as an
 * inline style straight from the API. The rules below carry a neutral token as
 * the fallback for when that value is missing.
 *
 * Two layouts, one data source: a role-column grid above 768px, a day agenda
 * below it.
 */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--size-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

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

.skip {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  z-index: 80;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
}
.skip:focus { top: var(--space-3); }

/* --- top bar -------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  /* The design's bar is tighter than the page under it: 13px 20px against the
   * content's 22px clamp(15px, 2.4vw, 28px). */
  padding: 13px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
  min-width: 0;
  /* Matches the icon button beside it — the bar is this tall either way, and
   * that height is the tap floor tokens.css sets, not a number chosen here. */
  min-height: var(--tap-min);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

/* The design's sizes exactly: 22px in the desktop bar, 21px on a phone. The
 * artwork is dark on transparent, so night mode inverts it — one file, both
 * themes, and nothing to keep in step. */
.brand-logo {
  display: block;
  height: 22px;
  width: auto;
}

.brand-logo[hidden] { display: none; }

[data-theme='night'] .brand-logo { filter: invert(1) brightness(1.06); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='sun']) .brand-logo { filter: invert(1) brightness(1.06); }
}

.wordmark {
  font-family: var(--font-display);
  font-size: var(--size-h2);
  white-space: nowrap;
}

.wordmark[hidden] { display: none; }

.tagline { font-size: var(--size-micro); color: var(--soft); white-space: nowrap; }

/* The design drops the tagline below 1080px, where the centred nav starts
 * crowding it. Ours is the flagship territory's name, so it is long. */
@media (max-width: 1079px) {
  .tagline { display: none; }
}

.topbar-actions { display: flex; align-items: center; gap: var(--space-3); flex: none; }

/* --- navigation -----------------------------------------------------------
 *
 * Two arrangements of one list: a slim centred bar on a desktop, a bottom tab
 * bar on a phone — bottom because thumbs, and because it survives one-handed
 * use in the dark (soft_landing_design_spec.md § 2.2).
 *
 * `is-lead` is the phase-aware emphasis: before the burn the app leads with
 * sign-up, during it with Live. Which one is computed from the season dates,
 * never chosen by hand (02_ARCHITECTURE.md).
 */

.topnav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
}

.nav-link {
  flex: none;
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--soft);
  font: inherit;
  font-size: var(--size-small);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  cursor: pointer;
}

/* Only the entry you are on wears a surface — the design's nav paints the
 * current screen and nothing else. Painting the phase's lead entry as well put
 * two lit tabs in the bar, and two lit tabs read as "where am I?". The
 * phase-aware emphasis lives in what the app *opens on*, not in bar paint. */
.nav-link.is-on { background: var(--card); color: var(--ink); font-weight: var(--weight-semibold); }

/* Fixed, so it survives a long scroll, and a fixed 64px tall. The page's bottom
 * padding and the toast's are both measured off that same 64 below, so the bar
 * can never end up sitting on the last shift of the week. Keep the three in
 * step if you change it. */
.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  /* app.js sets the real column count from the registry; this is only what the
   * bar looks like for the instant before the first render. */
  grid-template-columns: repeat(4, 1fr);
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: var(--space-1) var(--space-1) calc(var(--space-1) + env(safe-area-inset-bottom, 0px));
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-1);
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--soft);
  font: inherit;
  cursor: pointer;
}

/* Quiet monochrome glyphs, not full-colour emoji: the bar is a place-marker at
 * the bottom of the screen, and four saturated pictures down there pull the eye
 * away from the shift somebody is reading. `--font-ui` keeps them on the text
 * face rather than letting the system swap in its emoji font. */
.tab-glyph { font-family: var(--font-ui); font-size: 17px; line-height: 1; }

.tab-label {
  font-size: var(--size-kicker);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
}

/* The active tab is tea green (the design's own accent); everything else stays
 * soft. One lit tab, not a lit tab plus a coloured one. */
.tab.is-on { color: var(--t-tea-deep); }
.tab.is-on .tab-label { font-weight: var(--weight-bold); }

/* --- the clock and the season --------------------------------------------- */

.whenbox {
  margin: 0;
  flex: none;
  text-align: right;
  line-height: 1.25;
  white-space: nowrap;
}

.whenbox-clock {
  display: block;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

.whenbox-season { display: block; font-size: var(--size-kicker); color: var(--soft); }

/* `display: flex` outranks the browser's `[hidden] { display: none }`, so the
 * chip has to say it twice or an anonymous device shows an empty pill. */
.chip[hidden] { display: none; }

/* The design's chip: a 30px initials avatar in a pill, 4px of padding around it
 * and 13px on the label side. Ours clears --tap-min rather than the design's
 * 40px, because on a phone this is a control somebody presses in the dark. */
.chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap-min);
  padding: var(--space-1) 13px var(--space-1) var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  max-width: 46vw;
}

/* Signed out, the chip is the way in and reads as the primary action. */
.chip--out { border-color: var(--t-tea); background: var(--t-tea); color: var(--t-tea-fg); }
.chip--out .chip-avatar { background: var(--card); color: var(--t-tea-deep); }

.chip-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  background: var(--t-tea);
  color: var(--t-tea-fg);
  font-size: var(--size-micro);
  font-weight: var(--weight-bold);
}

.chip-name {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The design carries the name only above 1180px; below that the avatar alone
 * is the chip, and the bar keeps its centred nav. */
@media (max-width: 1179px) {
  .chip-name { display: none; }
  .chip { padding-right: var(--space-1); }
}

/* The theme toggle, and on a phone the only control that is on every screen —
 * so it is the one that has to clear --tap-min without an argument. */
.icon-btn {
  flex: none;
  width: var(--tap-min);
  height: var(--tap-min);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
}

/* --- layout & type -------------------------------------------------------- */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--space-5) clamp(15px, 2.4vw, 28px) var(--space-6);
}

.display {
  font-family: var(--font-display);
  font-size: var(--size-display);
  font-weight: var(--weight-normal);
  line-height: 1.1;
  margin: 0;
}

.display-sm {
  font-family: var(--font-display);
  font-size: var(--size-h2);
  font-weight: var(--weight-normal);
  line-height: 1.2;
  margin: 0;
}

.lede { color: var(--soft); font-size: var(--size-small); margin: var(--space-1) 0 0; }
.muted { color: var(--soft); font-size: var(--size-small); margin: 2px 0 0; }
.note { color: var(--soft); font-size: var(--size-small); margin: var(--space-4) 0 0; }

.sched-head { margin-bottom: var(--space-4); }

/* --- buttons -------------------------------------------------------------- */

/* The design's quiet button is an outline on the page, not a raised chip:
 * `border: 1px solid var(--line); background: none`. Filling it with --panel
 * put a second surface under every "Try again" and every footer link, which is
 * the thing that made the page read busier than the design. */
.btn {
  min-height: var(--tap-min);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--size-small);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  white-space: nowrap;
}

.btn--primary { border-color: var(--t-tea); background: var(--t-tea); color: var(--t-tea-fg); }
.btn--danger { border-color: var(--gap); background: transparent; color: var(--gap); }
.btn--small { min-height: var(--tap-min); padding: var(--space-2) var(--space-3); }

/* Going somewhere, not doing something. The design writes these at 14px with no
 * weight at all — semibold is for the button that finishes a job. */
.btn--quiet { font-weight: var(--weight-normal); }

/* The design's in-banner escape hatch is a pill, so it never reads as the same
 * kind of thing as the buttons that claim and release. */
.btn--pill { border-radius: var(--radius-pill); padding: var(--space-3) var(--space-4); }

.btn[disabled] { opacity: 0.55; cursor: default; }

.linkish {
  border: 0;
  background: none;
  color: var(--soft);
  font: inherit;
  font-size: var(--size-micro);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  cursor: pointer;
  padding: var(--space-2);
  min-height: var(--tap-min);
}

/* --- filter chips ---------------------------------------------------------
 *
 * FilterChips from the design's component inventory (04_DESIGN_HANDOFF.md): an
 * on/off pill that narrows what a screen is showing. One primitive, used by the
 * overview's territory and coverage filters, the tally's sort, and the agenda's
 * expand-all. Screens add their own `--modifier.is-on` where a chip carries a
 * meaning of its own — "only gaps" is red because a gap is red everywhere. */
.filter-chip {
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--soft);
  font: inherit;
  font-size: var(--size-small);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  cursor: pointer;
}

.filter-chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* --- territory picker ----------------------------------------------------- */

.terr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.terr-box {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-height: 78px;
  text-align: left;
  padding: 11px 13px;
  border: 2px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.terr-box.is-active { border-color: var(--ink); background: var(--card); }

.terr-box-head { display: flex; align-items: center; gap: var(--space-2); }
.terr-box-emoji { font-size: 16px; }
.terr-box-name { font-family: var(--font-display); font-size: 16px; color: var(--ink); }
.terr-box-times { flex: 1; font-size: var(--size-kicker); color: var(--soft); line-height: 1.3; }

.terr-box-status { font-size: var(--size-micro); font-weight: var(--weight-bold); }
.terr-box-status.is-gap { color: var(--gap); }
.terr-box-status.is-live { color: var(--live); }
.terr-box-status.is-soft { color: var(--soft); }

/* --- banners & mode toggle ------------------------------------------------ */

.banner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-card);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--size-small);
  line-height: 1.45;
}

.banner > span { flex: 1 1 240px; min-width: 0; }
.banner--signup { background: var(--card); color: var(--soft); }
.banner--offline { background: var(--soon-bg); color: var(--ink); }

/* --- the section row and filters -------------------------------------------
 *
 * The design's row above the grid: the territory re-states itself on the left
 * — Fraunces, with its hours and fill under it — and Pod and Day hang off the
 * right-hand end of the same row. */
.sched-sectionrow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
  margin-bottom: var(--space-3);
}

.sched-section { flex: 1 1 220px; min-width: 0; }
.sched-section .muted { margin-top: 2px; }

.filter {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 0 1 150px;
}

.filter-label { font-size: var(--size-micro); color: var(--soft); }

.field {
  width: 100%;
  min-height: var(--tap-min);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: var(--size-body);
}

.field:disabled { color: var(--soft); }

/* --- coverage bars -------------------------------------------------------- */

.bars { display: inline-flex; gap: 3px; align-items: flex-end; height: 15px; flex: none; }
.bars--compact { gap: 2px; height: 13px; }
.bar { width: 4px; border-radius: 1px; background: var(--line); }
.bars--compact .bar { width: 3px; }
.bar--on { background: currentColor; }

.level--empty, .level--critical { color: var(--gap); }
.level--thin { color: var(--soon); }
.level--covered, .level--strong { color: var(--live); }

/* --- desktop grid --------------------------------------------------------- */

/* Shrink-to-fit, not full-bleed. Campers see only the seat columns camp has
 * opened (04_DESIGN_HANDOFF.md § Where we knowingly depart), so the Teahouse is
 * three columns rather than seven — and three columns stretched across a
 * 1280px window stops reading as a timetable and starts reading as a sparse
 * roster. The panel hugs the table; the table stays left. */
.grid-wrap {
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel);
  overflow: auto;
  max-height: 66vh;
}

/* No min-width: every track already carries its own floor (164px for the day,
 * 112px a seat), so the table cannot be crushed — and a blanket 620 left a band
 * of empty panel beside a one-seat territory like Love Kitchen. */
.grid { display: grid; justify-content: start; }

.gcell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 9px 11px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
}

button.gcell { cursor: pointer; }

.gcell-text {
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gcell-sub {
  font-size: var(--size-kicker);
  opacity: 0.78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gcell-meta { display: flex; gap: var(--space-2); align-items: center; min-width: 0; }

.gcell--corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 5;
  background: var(--card);
  color: var(--soft);
  font-weight: var(--weight-bold);
  font-size: var(--size-kicker);
  letter-spacing: var(--track-kicker);
}

.gcell--colhead {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--card);
  color: var(--ink);
  font-weight: var(--weight-semibold);
}

.gcell--rowhead {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--panel);
  font-weight: var(--weight-semibold);
}

.gcell--rowhead.is-premium { background: var(--t-prem-t); }

.gcell--absent { background: var(--card); color: var(--soft); }
.gcell--closed { background: var(--card); color: var(--soft); }
.gcell--open { background: var(--panel); }
.gcell--premium { background: var(--t-prem-t); }
.gcell--needed { background: var(--gap-bg); color: var(--gap); font-weight: var(--weight-bold); }
.gcell--filled { background: var(--card); color: var(--ink); }
.gcell--mine { background: var(--card); color: var(--ink); box-shadow: inset 3px 0 0 var(--ink); }

.gcell.is-dim { opacity: 0.38; }
.is-washing { animation: wash 200ms ease-out; }

/* --- mobile agenda --------------------------------------------------------
 *
 * Days collapse. A week opened all the way is a twelve-thousand-pixel page on a
 * phone, which is not a schedule anybody can read — so the agenda opens the one
 * day that still needs people and leaves the rest a tap away. */

/* The design does not draw a box around a day. A day is a kicker with a hairline
 * under it and its shifts below, separated from the next day by whitespace —
 * `margin-bottom: 20px` and nothing else. Panels around each day added a second
 * surface, a second radius and a second border to a screen whose only real box
 * is the shift card, and made a week of them read like a stack of drawers. */
.agenda { display: flex; flex-direction: column; gap: 20px; }

.day-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--tap-min);
  margin: 0;
  padding: var(--space-2) 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.day-caret { flex: none; width: 14px; color: var(--soft); align-self: center; }

/* The design's kicker, exactly: 11px, 700, 0.16em, uppercase. */
.day-weekday {
  font-size: var(--size-kicker);
  font-weight: var(--weight-bold);
  letter-spacing: var(--track-kicker);
  text-transform: uppercase;
}

.day-date { font-size: var(--size-micro); color: var(--soft); }

.day-count {
  margin-left: auto;
  font-size: var(--size-micro);
  color: var(--soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.day-gapcount { color: var(--gap); font-weight: var(--weight-semibold); }

.day-shifts {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-3);
}

.agenda-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.shift-card {
  border-radius: var(--radius-control);
  border-left: 3px solid var(--line);
  background: var(--panel);
  padding: var(--space-3);
}

/* The badge carries the 2x; the accent just makes it findable while scrolling. */
.shift-card.is-premium { border-left-color: var(--t-prem); }

.shift-head {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

/* The shift's own hours: the single most-read thing on this screen, and the one
 * a camper matches against their memory of what they signed up for. A point
 * above --size-small on purpose. */
.shift-window {
  flex: 1;
  font-size: 15px;
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

.shift-level { display: inline-flex; align-items: center; gap: var(--space-2); }
.shift-level-text {
  font-size: var(--size-micro);
  font-weight: var(--weight-semibold);
  text-transform: lowercase;
}

.badge {
  font-size: var(--size-micro);
  font-weight: var(--weight-semibold);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge--premium { background: var(--t-prem-t); color: var(--t-prem); }

.shift-slots { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.slot {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 124px;
  min-height: var(--tap-min);
  text-align: left;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-slot);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.slot[disabled] { cursor: default; }
.slot-name { font-size: var(--size-small); font-weight: var(--weight-semibold); }
.slot-sub { font-size: var(--size-kicker); opacity: 0.82; }

.slot--premium { background: var(--t-prem-t); border-color: var(--t-prem); }
.slot--needed { background: var(--gap-bg); border-color: var(--gap); color: var(--gap); }
.slot--filled { background: var(--ink); border-color: var(--ink); color: var(--on); }
.slot--mine { background: var(--ink); border-color: var(--ink); border-width: 2px; color: var(--on); }
.slot--closed { background: var(--card); border-color: var(--line); color: var(--soft); }

/* --- panels, skeleton, errors --------------------------------------------- */

/* Fill separates, not a border. Every block of this shape in the design — the
 * admin password prompt, the claim sheet's warning, the "you" card — is a fill
 * with a radius and nothing drawn around it. */
.panel {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: var(--space-4) 18px;
}

.panel--error { background: var(--gap-bg); }
.panel-title { font-family: var(--font-display); font-size: var(--size-h2); font-weight: var(--weight-normal); margin: 0 0 var(--space-2); }
.panel p { margin: 0 0 var(--space-3); }

.skeleton { display: flex; flex-direction: column; gap: var(--space-2); }
.skeleton-row {
  height: 56px;
  border-radius: var(--radius-control);
  background: var(--card);
  animation: breathe 2.6s ease-in-out infinite;
}

.is-stale { opacity: 0.6; }

/* --- dialogs: bottom sheet on a phone, centred modal on a desktop ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-4);
}

/* A separate layer so the panel above it stays fully opaque. */
.scrim::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: 0.45;
}

.sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  max-height: 100%;
  overflow-y: auto;
  padding: var(--space-5) var(--space-5) var(--space-5);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-raised);
  animation: rise 180ms ease-out;
}

.sheet-kicker {
  margin: 0 0 var(--space-1);
  font-size: var(--size-kicker);
  font-weight: var(--weight-bold);
  letter-spacing: var(--track-kicker);
  text-transform: uppercase;
  color: var(--soft);
}

.sheet-kicker--gap { color: var(--gap); }

.sheet-title {
  font-family: var(--font-display);
  font-size: var(--size-h2);
  font-weight: var(--weight-normal);
  margin: 0 0 var(--space-1);
}

.sheet-sub { margin: 0 0 var(--space-4); font-size: var(--size-small); color: var(--soft); }
.sheet-body { margin: 0 0 var(--space-4); font-size: var(--size-small); color: var(--soft); line-height: 1.55; }
.sheet-note { margin: 0; font-size: var(--size-micro); color: var(--soft); }

.sheet-error {
  min-height: 20px;
  margin: 0 0 var(--space-3);
  font-size: var(--size-small);
  color: var(--gap);
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
}

.sheet-actions .btn { font-size: var(--size-body); }

.whoami {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  background: var(--card);
  border-radius: var(--radius-control);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
}

.whoami-mark { font-size: 18px; }
.whoami-body { flex: 1; min-width: 0; }
.whoami-name { display: block; font-size: var(--size-small); font-weight: var(--weight-semibold); }
.whoami-pod { display: block; font-size: var(--size-micro); color: var(--soft); }

.fields { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.field-label { font-size: var(--size-small); color: var(--soft); margin-top: var(--space-2); }
.field-hint { opacity: 0.75; }

.warn {
  display: flex;
  gap: var(--space-3);
  border-radius: var(--radius-control);
  background: var(--soon-bg);
  color: var(--ink);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: var(--size-small);
  line-height: 1.45;
}

/* --- toast ---------------------------------------------------------------- */

#toast-root {
  position: fixed;
  left: 50%;
  bottom: var(--space-6);
  transform: translateX(-50%);
  z-index: 70;
  pointer-events: none;
  max-width: 88vw;
}

.toast {
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-pill);
  padding: var(--space-3) var(--space-5);
  font-size: var(--size-small);
  font-weight: var(--weight-medium);
  text-align: center;
  box-shadow: var(--shadow-raised);
  animation: rise 180ms ease-out;
}

/* --- phone ---------------------------------------------------------------- */

@media (max-width: 767px) {
  /* The tab bar is fixed over the page, so the page has to end above it, or the
   * last shift of the week lives permanently under a thumb. 64px is the bar;
   * the rest is breathing room and the home indicator below it. */
  .wrap { padding-bottom: calc(64px + var(--space-5) + env(safe-area-inset-bottom, 0px)); }

  .topnav { display: none; }
  .tabbar { display: grid; }

  /* The season line is the header's first casualty on a narrow bar; the clock
   * is the part nobody on playa can do without. */
  .whenbox-season { display: none; }
  .topbar { gap: var(--space-2); padding: 11px 15px; }
  .topbar-actions { gap: 9px; }
  .brand-logo { height: 21px; }

  .terr-grid { grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); }

  /* Pod and Day stay side by side, as they are in the design. Stacking them
   * into two full-width rows costs ~76px of the one screenful a phone has, and
   * on the territory schedule that is the difference between opening the page
   * on a shift and opening it on a pair of dropdowns. */
  .filter { flex: 1 1 140px; min-width: 0; }

  /* Primary actions sit at the bottom of the sheet, inside thumb reach. */
  .scrim { align-items: flex-end; padding: 0; }

  .sheet {
    max-width: none;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    padding-bottom: var(--space-6);
  }

  .sheet-actions .btn { flex: 1 1 auto; }

  /* Clear of the tab bar, or the confirmation lands behind it. */
  #toast-root { bottom: calc(64px + var(--space-3) + env(safe-area-inset-bottom, 0px)); }
}
