/*
 * Battalion web components (TASKS D3). Built ONLY on tokens.css — never a
 * hard-coded colour, size or duration here. Class names are the contract:
 * server/assets/js/ui.js renders them, pages use them directly.
 *
 * Layers: base · layout · text · button · card · status · field · dropdown ·
 * popup · toast · nav (bottom bar, side nav, drawer, fab) · feedback.
 */

/* ─── base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font: var(--t-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--c-link); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--c-focus-ring); outline-offset: 2px; border-radius: var(--r-sm); }
/* The hidden attribute must win over component display rules (.stack, .row are display:flex). */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.icon {
  font-family: 'Material Symbols Rounded';
  font-weight: normal; font-style: normal;
  font-size: var(--size-icon); line-height: 1;
  display: inline-block; flex: none;
  width: 1em; height: 1em; overflow: hidden;
  letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
.icon--sm { font-size: var(--size-icon-sm); }
.icon--lg { font-size: var(--size-icon-lg); }

/* ─── layout ───────────────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: var(--s-md); }
.stack--sm { gap: var(--s-sm); }
.stack--lg { gap: var(--s-lg); }
.row { display: flex; align-items: center; gap: var(--s-sm); }
.row--wrap { flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.page {
  --page-pad: var(--s-lg);
  width: 100%; max-width: var(--size-content-max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad) calc(var(--size-bottom-bar) + var(--s-xxl));
}
.page > .topbar { margin-bottom: var(--s-lg); }
.section-label { margin: var(--s-lg) 0 var(--s-sm); }

/* ─── text ─────────────────────────────────────────────────── */
.t-display  { font: var(--t-display); }
.t-title    { font: var(--t-title); }
.t-subtitle { font: var(--t-subtitle); }
.t-body     { font: var(--t-body); }
.t-strong   { font: var(--t-body-strong); }
.t-label    { font: var(--t-label); }
.t-caption  { font: var(--t-caption); color: var(--c-text-muted); }
.t-overline { font: var(--t-overline); letter-spacing: var(--t-overline-tracking); text-transform: uppercase; color: var(--c-text-faint); }
.t-muted    { color: var(--c-text-muted); }
.t-danger   { color: var(--c-danger); }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── button ───────────────────────────────────────────────── */
.btn {
  --btn-fill: var(--c-primary); --btn-ink: var(--c-text-on-primary); --btn-line: transparent;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-sm);
  min-height: var(--size-button-height); min-width: var(--size-button-height);
  padding: 0 var(--s-lg);
  border: 1px solid var(--btn-line); border-radius: var(--r-md);
  background: var(--btn-fill); color: var(--btn-ink);
  font: var(--t-label); text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease), transform var(--d-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover   { --btn-fill: var(--c-primary-hover); }
.btn:active  { --btn-fill: var(--c-primary-pressed); transform: scale(0.98); }
.btn .icon   { font-size: var(--size-icon-sm); }
.btn--secondary { --btn-fill: var(--c-surface); --btn-ink: var(--c-primary); --btn-line: var(--c-border); }
.btn--secondary:hover, .btn--ghost:hover { --btn-fill: var(--c-primary-soft); }
.btn--secondary:active, .btn--ghost:active { --btn-fill: var(--c-primary-soft); }
.btn--ghost  { --btn-fill: transparent; --btn-ink: var(--c-primary); }
.btn--accent { --btn-fill: var(--c-accent); --btn-ink: var(--c-text-on-accent); }
.btn--accent:hover, .btn--accent:active { --btn-fill: var(--c-accent); filter: brightness(0.96); }
.btn--danger { --btn-fill: var(--c-danger); --btn-ink: var(--c-surface); }
.btn--danger:hover, .btn--danger:active { --btn-fill: var(--c-danger); filter: brightness(0.94); }
.btn--sm     { min-height: var(--size-button-height-sm); padding: 0 var(--s-md); }
.btn--block  { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
/* Loading keeps the label laid out (invisible) so the width never jumps. */
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"] > :not(.spinner) { visibility: hidden; }
.btn[aria-busy="true"] > .spinner { position: absolute; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: var(--size-touch-target); height: var(--size-touch-target);
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--c-text);
  cursor: pointer; transition: background-color var(--d-fast) var(--ease);
}
.icon-btn:hover { background: var(--c-primary-soft); }
.icon-btn--muted { color: var(--c-text-muted); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; background: transparent; }

.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── card ─────────────────────────────────────────────────── */
.card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: var(--s-sm);
  padding: var(--s-lg);
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-low);
}
.card--raised { box-shadow: var(--shadow-mid); }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .tile, :root[data-theme="dark"] .listcard { border: 1px solid var(--c-divider); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card, :root:not([data-theme="light"]) .tile, :root:not([data-theme="light"]) .listcard { border: 1px solid var(--c-divider); } }
.card--accent { padding-left: calc(var(--s-lg) + 4px); }
.card--accent::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--card-accent); }
a.card, button.card { color: inherit; text-decoration: none; text-align: left; cursor: pointer; font: inherit; width: 100%;
  transition: box-shadow var(--d-fast) var(--ease), transform var(--d-fast) var(--ease); }
a.card:hover, button.card:hover { box-shadow: var(--shadow-mid); }
a.card:active, button.card:active { transform: scale(0.995); }
.divider { height: 1px; background: var(--c-divider); border: 0; margin: 0; width: 100%; }

/* ─── a job as a card (/task): state strip, problem in bold, facts with icons ─── */
.task-card { padding: 0; gap: 0; }
.task-card__strip { display: flex; align-items: center; gap: var(--s-sm); padding: var(--s-md) var(--s-lg) 0; font: var(--t-subtitle); }
.task-card__body { display: flex; gap: var(--s-md); padding: var(--s-sm) var(--s-lg) var(--s-md); }
.task-card__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-sm); }
.portrait {
  flex: none; width: 48px; aspect-ratio: 3 / 4; display: grid; place-items: center; overflow: hidden;
  border-radius: var(--r-md); border: 1px solid var(--c-border); background: var(--c-primary-soft); color: var(--c-primary); font: var(--t-label);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.task-card__problem { margin: 0; font-weight: 600; color: var(--c-text); }
.task-card__problem--urgent { color: var(--c-status-critical-text); }
.task-meta { display: flex; align-items: center; gap: var(--s-sm); color: var(--c-text-muted); }
.task-card__chips { gap: var(--s-sm); }
.task-card__estimate { background: var(--c-primary-soft); color: var(--c-primary); }

/* ─── status ───────────────────────────────────────────────── */
.status--critical  { --st: var(--c-status-critical);  --st-soft: var(--c-status-critical-soft);  --st-ink: var(--c-status-critical-text); }
.status--attention { --st: var(--c-status-attention); --st-soft: var(--c-status-attention-soft); --st-ink: var(--c-status-attention-text); }
.status--stable    { --st: var(--c-status-stable);    --st-soft: var(--c-status-stable-soft);    --st-ink: var(--c-status-stable-text); }
.status--unknown   { --st: var(--c-status-unknown);   --st-soft: var(--c-status-unknown-soft);   --st-ink: var(--c-status-unknown-text); }
.status--offline, .status--presumed_inactive { --st: var(--c-status-offline); --st-soft: var(--c-status-offline-soft); --st-ink: var(--c-status-offline-text); }

.badge {
  display: inline-flex; align-items: center; gap: var(--s-xs);
  padding: var(--s-xs) var(--s-md);
  border-radius: var(--r-pill);
  background: var(--st-soft); color: var(--st-ink);
  font: var(--t-label); white-space: nowrap;
}
.badge .icon { font-size: var(--size-icon-sm); }
.badge--compact { padding: 2px var(--s-sm); font: var(--t-caption); }
.badge--compact .icon { font-size: 14px; }

.dot { width: var(--size-status-dot); height: var(--size-status-dot); border-radius: 50%; background: var(--st); flex: none; }
.dot.status--critical { animation: pulse var(--status-blink) linear infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Computer icon for a critical/attention system; a plain dot (same footprint) for every other state. */
.status-mark { display: inline-flex; align-items: center; justify-content: center; width: var(--size-icon); height: var(--size-icon); flex: none; color: var(--st); }
.status-mark--lg { width: var(--size-icon-lg); height: var(--size-icon-lg); }
.status-mark__icon { font-size: var(--size-icon); color: var(--st); }
.status-mark--lg .status-mark__icon { font-size: var(--size-icon-lg); }
.status-mark.status--critical .status-mark__icon { animation: pulse-soft var(--status-blink) linear infinite; }
.badge--blink { animation: pulse-soft var(--status-blink) linear infinite; }

.dot--lg { width: var(--size-icon-sm); height: var(--size-icon-sm); }

/* ─── public pages: privacy, data deletion, fair use, download ─ */
.legal { max-width: 720px; margin: 0 auto; padding: var(--s-lg) var(--s-lg) var(--s-xxl); display: flex; flex-direction: column; gap: var(--s-md); }
.legal h1 { margin-top: var(--s-md); }
.legal h2 { margin-top: var(--s-md); }
.legal__intro { color: var(--c-text-muted); }
.legal ul, .legal ol { margin: 0; padding-left: var(--s-lg); display: flex; flex-direction: column; gap: var(--s-xs); }
.legal code { overflow-wrap: anywhere; font-family: var(--font-mono); }
.legal__links { text-align: center; color: var(--c-text-faint); font: var(--t-caption); margin-top: var(--s-lg); }
.legal__links a { color: var(--c-link); }

/* ─── pictures, copyable values ────────────────────────────── */
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-lg); }
.image-slot { display: flex; flex-direction: column; gap: var(--s-sm); }
/* White: documents are paper in either theme. */
.image-slot__preview { height: 96px; display: flex; align-items: center; justify-content: center; padding: var(--s-sm);
  background: var(--brand-white); border: 1px solid var(--c-border); border-radius: var(--r-md); }
.image-slot__preview img { max-width: 100%; max-height: 80px; object-fit: contain; }
.image-slot__empty { color: var(--c-text-faint); font-size: var(--size-icon-lg); }
.copy-field { display: flex; align-items: center; gap: var(--s-sm); background: var(--c-surface-alt); border-radius: var(--r-md); padding-left: var(--s-md); }
.copy-field code { font-family: var(--font-mono); padding: var(--s-md) 0; overflow-wrap: anywhere; }
.avatar.avatar--lg { width: 72px; height: 72px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ─── documents: line items and totals ─────────────────────── */
.line-item { display: flex; gap: var(--s-md); align-items: flex-start; }
.line-item__amount { white-space: nowrap; text-align: right; }
.money-row { display: flex; gap: var(--s-md); color: var(--c-text-muted); text-align: right; }
.money-row--total { color: var(--c-text); font: var(--t-subtitle); padding-top: var(--s-xs); }

/* ─── system detail: meter, detail row ─────────────────────── */
.meter { display: flex; flex-direction: column; gap: var(--s-xs); }
.meter__flag { color: var(--st-ink); }
.meter__track { height: var(--s-sm); border-radius: var(--r-pill); background: var(--c-surface-alt); overflow: hidden; }
.meter__fill { height: 100%; border-radius: var(--r-pill); background: var(--st); }
.detail-row { display: flex; gap: var(--s-md); align-items: flex-start; }
.detail-row__label { color: var(--c-text-muted); white-space: nowrap; }
.detail-row__value { flex: 1; text-align: right; overflow-wrap: anywhere; }

.card.status--critical, .card.status--attention, .card.status--stable, .card.status--unknown,
.card.status--offline, .card.status--presumed_inactive { --card-accent: var(--st); }

/* ─── troubleshooting guide (§11) ──────────────────────────── */
/* Category colours come from the tile tokens; every tile also carries an icon and a label. */
.tint--blue   { --tint: var(--c-tile-blue);   --tint-soft: var(--c-tile-blue-soft); }
.tint--violet { --tint: var(--c-tile-violet); --tint-soft: var(--c-tile-violet-soft); }
.tint--green  { --tint: var(--c-tile-green);  --tint-soft: var(--c-tile-green-soft); }
.tint--orange { --tint: var(--c-tile-orange); --tint-soft: var(--c-tile-orange-soft); }
.tint--rose   { --tint: var(--c-tile-rose);   --tint-soft: var(--c-tile-rose-soft); }
.tint--cyan   { --tint: var(--c-tile-cyan);   --tint-soft: var(--c-tile-cyan-soft); }
.bubble { width: var(--size-fab); height: var(--size-fab); flex: none; display: grid; place-items: center;
  border-radius: var(--r-lg); background: var(--tint-soft, var(--c-primary-soft)); color: var(--tint, var(--c-primary)); }
.bubble .icon { font-size: var(--size-icon-lg); }
.bubble--sm { width: var(--size-avatar); height: var(--size-avatar); border-radius: var(--r-md); }
.bubble--sm .icon { font-size: var(--size-icon); }
.bubble--lg { width: calc(var(--size-fab) + var(--s-lg)); height: calc(var(--size-fab) + var(--s-lg)); border-radius: var(--r-xl); }
.bubble--lg .icon { font-size: calc(var(--size-icon-lg) * 1.25); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--s-md); }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-sm);
  min-height: 176px; padding: var(--s-lg);
  background: var(--c-surface); border-radius: var(--r-xl); box-shadow: var(--shadow-low);
  color: inherit; text-decoration: none; text-align: left; font: inherit; cursor: pointer;
  transition: box-shadow var(--d-fast) var(--ease), transform var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
}
.tile:hover { box-shadow: var(--shadow-mid); transform: translateY(-2px); }
.tile:active { transform: scale(0.98); }
.tile__title { font: var(--t-subtitle); }
.tile__hint { font: var(--t-caption); color: var(--c-text-muted); }
.tile__meta { margin-top: auto; font: var(--t-label); color: var(--tint, var(--c-primary)); }
@media (max-width: 599px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-sm); }
  .tile { min-height: 164px; padding: var(--s-md); }
}
.guide-hero {
  display: flex; flex-direction: column; gap: var(--s-md);
  padding: var(--s-xl); border-radius: var(--r-xl); border: 1px solid var(--c-border);
  background: linear-gradient(135deg, var(--c-primary-soft), var(--c-surface) 70%);
}
.guide-hero .field__box { min-height: var(--size-fab); border-radius: var(--r-pill); padding: 0 var(--s-lg); box-shadow: var(--shadow-low); }
.guide-hero .field__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 599px) { .guide-hero { padding: var(--s-lg); } }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip { display: inline-flex; align-items: center; gap: var(--s-xs); padding: 2px var(--s-sm); border-radius: var(--r-pill);
  background: var(--c-surface-alt); color: var(--c-text-muted); font: var(--t-caption); text-decoration: none; white-space: nowrap; }
.chip .icon { font-size: var(--size-icon-sm); }
a.chip:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.chip--select { cursor: pointer; border: 1px solid var(--c-border); background: transparent; font: inherit; min-height: var(--size-button-sm, 32px); padding-inline: var(--s-md); }
.chip--select[aria-pressed="true"] { background: var(--c-primary-soft); border-color: var(--c-primary); color: var(--c-primary); }
.chip--tint { background: var(--tint-soft); color: var(--tint); }
.callout { display: flex; gap: var(--s-md); align-items: flex-start; padding: var(--s-lg); border-radius: var(--r-lg);
  background: var(--st-soft); color: var(--c-text); border: 1px solid var(--st); }
.callout > .icon { color: var(--st-ink); }
.callout--tip { --st: var(--c-primary-soft); --st-soft: var(--c-primary-soft); --st-ink: var(--c-primary); }
.num { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--c-primary-soft); color: var(--c-primary); font: var(--t-label); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-md); }
.steps > li { display: flex; gap: var(--s-md); align-items: flex-start; }
.steps > li > .grow { display: flex; flex-direction: column; gap: var(--s-sm); padding-top: 3px; }
.steps ul { margin: 0; padding-left: var(--s-lg); display: flex; flex-direction: column; gap: var(--s-xs); color: var(--c-text-muted); }
.copy-field--code code { white-space: pre-wrap; }
.how { border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface); }
.how > summary { list-style: none; display: flex; align-items: center; gap: var(--s-sm); min-height: var(--size-touch-target);
  padding: var(--s-sm) var(--s-lg); cursor: pointer; font: var(--t-label); color: var(--c-primary); border-radius: var(--r-lg); }
.how > summary::-webkit-details-marker { display: none; }
.how > summary:hover { background: var(--c-primary-soft); }
.how > summary .how__chev { transition: transform var(--d-base) var(--ease); }
.how[open] > summary .how__chev { transform: rotate(180deg); }
.how__body { display: flex; flex-direction: column; gap: var(--s-md); padding: var(--s-sm) var(--s-lg) var(--s-lg); }
/* Fix wizard: one numbered step at a time, with a line joining the markers. */
.fix-steps { list-style: none; margin: 0; padding: 0; }
.fix-step { position: relative; display: flex; gap: var(--s-md); padding-bottom: var(--s-xl); }
.fix-step::before { content: ""; position: absolute; left: 17px; top: 40px; bottom: var(--s-xs); width: 2px; background: var(--c-divider); }
.fix-step:last-child { padding-bottom: 0; }
.fix-step:last-child::before { display: none; }
.fix-step__marker { position: relative; width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%;
  border: 2px solid var(--c-border); background: var(--c-surface); color: var(--c-text-muted); font: var(--t-label);
  transition: background-color var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease); }
.fix-step__marker .icon { font-size: var(--size-icon-sm); }
.fix-step__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-md); padding-top: 6px; }
.fix-step[data-state="current"] .fix-step__marker { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-text-on-primary); box-shadow: 0 0 0 4px var(--c-primary-soft); }
.fix-step[data-state="current"] .fix-step__text { font: var(--t-body-strong); }
.fix-step[data-state="upcoming"] .fix-step__text, .fix-step[data-state="skipped"] .fix-step__text { color: var(--c-text-muted); }
.fix-step[data-state="done"] .fix-step__marker { background: var(--c-status-stable-soft); border-color: var(--c-status-stable); color: var(--c-status-stable-text); }
.fix-step[data-state="skipped"] .fix-step__marker { background: var(--c-surface-alt); }
.result { display: flex; flex-direction: column; align-items: center; gap: var(--s-md); padding: var(--s-xl); text-align: center;
  border-radius: var(--r-xl); background: var(--st-soft); border: 1px solid var(--st); }
.result__icon { width: var(--size-fab); height: var(--size-fab); display: grid; place-items: center; border-radius: 50%; background: var(--c-surface); color: var(--st-ink); }
.result__icon .icon { font-size: var(--size-icon-lg); }
.result p { max-width: 52ch; }

/* ─── plans (§5): paid features and what stays with the technician ─── */
.tone--paid       { --st: var(--c-accent);  --st-soft: var(--c-accent-soft);  --st-ink: var(--c-text-on-accent); }
.tone--technician { --st: var(--c-primary); --st-soft: var(--c-primary-soft); --st-ink: var(--c-text-on-primary); }
.badge--paid { background: var(--c-accent); color: var(--c-text-on-accent); }
.locked { display: flex; gap: var(--s-md); align-items: flex-start; padding: var(--s-lg); border-radius: var(--r-lg);
  background: var(--st-soft); border: 1px dashed var(--st); color: var(--c-text); }
.locked__icon { width: var(--size-avatar); height: var(--size-avatar); flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--st); color: var(--st-ink); }
.locked__icon .icon { font-size: var(--size-icon); }
.plan-row { display: flex; gap: var(--s-md); align-items: center; padding: var(--s-sm) 0; border-bottom: 1px solid var(--c-divider); }
.plan-row:last-child { border-bottom: 0; }
.plan-row__feature { flex: 1; }
.plan-row__cell { width: 7rem; flex: none; text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-xs); }
.plan-row__cell .icon { font-size: var(--size-icon-sm); }
.plan-row--head { font: var(--t-label); color: var(--c-text-muted); }
.plan-row--focus { background: var(--c-accent-soft); border-radius: var(--r-md); padding-left: var(--s-sm); padding-right: var(--s-sm); }
@media (max-width: 480px) { .plan-row__cell { width: 4.5rem; } }

/* ─── people, tabs, months, attendance calendar (§12.9–§12.11) ─── */
.segmented { display: flex; gap: var(--s-xxs); padding: var(--s-xxs); border-radius: var(--r-pill); background: var(--c-surface-alt);
  border: 1px solid var(--c-border); overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented__opt { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-xs);
  min-height: var(--size-button-height-sm); padding: 0 var(--s-md); border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--c-text-muted); font: var(--t-label); cursor: pointer; white-space: nowrap; }
.segmented__opt .icon { font-size: var(--size-icon-sm); }
.segmented__opt:hover { color: var(--c-text); }
.segmented__opt[aria-selected="true"] { background: var(--c-surface); color: var(--c-primary); box-shadow: var(--shadow-low); }
.segmented__opt .count-badge { position: static; }
.month-stepper { display: flex; align-items: center; gap: var(--s-sm); }
.month-stepper__label { flex: 1; text-align: center; font: var(--t-subtitle); }
.person { display: flex; align-items: center; gap: var(--s-md); }
.person__text { flex: 1; min-width: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s-xs); }
.cal__head { text-align: center; font: var(--t-overline); letter-spacing: var(--t-overline-tracking); color: var(--c-text-faint); padding-bottom: var(--s-xxs); }
.cal__day { position: relative; aspect-ratio: 1 / 1; min-height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: var(--r-md); border: 1px solid transparent; background: var(--c-surface-alt); color: var(--c-text);
  font: var(--t-label); cursor: pointer; padding: 0; }
.cal__day .icon { font-size: 14px; }
.cal__day[data-tone="good"], .cal__day[data-tone="warn"], .cal__day[data-tone="bad"], .cal__day[data-tone="pending"] { background: var(--st-soft); color: var(--st-ink); border-color: var(--st); }
.cal__day[data-tone="off"] { background: var(--c-tile-blue-soft); color: var(--c-tile-blue); border-color: var(--c-tile-blue); }
.cal__day[data-tone="none"] { color: var(--c-text-faint); }
.cal__day[data-today] { box-shadow: 0 0 0 2px var(--c-primary); }
.cal__day:hover { filter: brightness(0.97); }
.cal__day:focus-visible { outline: 2px solid var(--c-focus-ring); outline-offset: 2px; }
.cal__day--blank { visibility: hidden; }
.cal-legend { display: flex; flex-wrap: wrap; gap: var(--s-xs); }
.badge[data-tone="off"] { background: var(--c-tile-blue-soft); color: var(--c-tile-blue); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--s-sm); }
.stat { padding: var(--s-md); border-radius: var(--r-md); background: var(--c-surface-alt); text-align: center; }
.stat__value { font: var(--t-title); color: var(--c-text); }
.stat__label { font: var(--t-caption); color: var(--c-text-muted); }
.stat--status { background: var(--st-soft); }
.stat--status .stat__value, .stat--status .stat__label { color: var(--st-ink); }
.stat--blink { animation: pulse-soft var(--status-blink) linear infinite; }

/* ─── the live feel ─ */
.badge.age--ok { --st-soft: var(--c-surface-alt); --st-ink: var(--c-text-muted); }
.status-change--worse { color: var(--c-status-critical-text); }
.status-change--better { color: var(--c-status-stable-text); }

.tracker { display: flex; list-style: none; margin: 0; padding: 0; }
.tracker__step { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s-xs); text-align: center; font: var(--t-caption); }
.tracker__step::before { content: ''; position: absolute; top: 11px; right: 50%; width: 100%; height: 3px; background: var(--c-border); }
.tracker__step:first-child::before { display: none; }
.tracker__step--done + .tracker__step::before { background: var(--c-status-stable); }
.tracker__dot { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--c-border); background: var(--c-surface); }
.tracker__step--done .tracker__dot { background: var(--c-status-stable); border-color: var(--c-status-stable); color: var(--c-surface); }
.tracker__step--current .tracker__dot { border: 3px solid var(--c-primary); background: var(--c-primary-soft); animation: pulse-soft var(--status-blink) linear infinite; }
.tracker__step--todo .tracker__label { color: var(--c-text-muted); }
.tracker__label { font: var(--t-caption); color: var(--c-text); }

.job-ring { --p: 0; --ring: var(--c-primary); position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: var(--ring);
  background: conic-gradient(var(--ring) calc(var(--p) * 1%), var(--c-border) 0); }
.job-ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--c-surface); }
.job-ring .icon { position: relative; }
.job-ring--over { --ring: var(--c-status-attention); }

.today__bar { display: flex; height: 10px; border-radius: var(--r-pill); background: var(--c-border); overflow: hidden; }
.today__seg { display: block; flex-basis: 0; }
.today__seg--done { background: var(--c-status-stable); }
.today__seg--busy { background: var(--c-status-attention); }
.today__seg--wait { background: transparent; }
.today__nums { display: flex; gap: var(--s-sm); }
.today__num { flex: 1; text-align: center; }
.today__done { color: var(--c-status-stable-text); }
.today__busy { color: var(--c-status-attention-text); }

.feed__row { display: flex; align-items: center; gap: var(--s-sm); padding: var(--s-xs) 0; color: inherit; text-decoration: none; }
a.feed__row:hover { background: var(--c-surface-alt); }
.feed__icon--attention { color: var(--c-status-attention-text); } .feed__icon--primary { color: var(--c-primary); }
.feed__icon--stable { color: var(--c-status-stable-text); } .feed__icon--critical { color: var(--c-status-critical-text); } .feed__icon--muted { color: var(--c-text-muted); }
.feed__row--new { animation: feed-in var(--d-slow) ease-out; }
@keyframes feed-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.check-in { align-items: center; text-align: center; gap: var(--s-md); }
.check-in__time { font: var(--t-display); }

/* ─── field ────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--s-xs); }
.field__label { font: var(--t-label); color: var(--c-text-muted); }
.field__box {
  display: flex; align-items: center; gap: var(--s-sm);
  min-height: var(--size-input-height);
  padding: var(--s-sm) var(--s-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
}
.field__box:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary); }
.field__box > .icon { color: var(--c-text-faint); }
.field__input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: var(--t-body); color: var(--c-text); padding: 0;
}
.field__input::placeholder { color: var(--c-text-faint); opacity: 1; }
textarea.field__input { resize: vertical; min-height: calc(var(--t-body-line, 22px) * 3); }
.field__box--multiline { align-items: flex-start; }
.field__help { font: var(--t-caption); color: var(--c-text-muted); }
.field--error .field__label, .field--error .field__help { color: var(--c-danger); }
.field--error .field__box { border-color: var(--c-danger); box-shadow: 0 0 0 1px var(--c-danger); }
.field--disabled .field__box { background: var(--c-surface-alt); }

/* checkbox — native input, restyled; the whole row is the target */
.check { display: flex; align-items: center; gap: var(--s-sm); min-height: var(--size-touch-target); cursor: pointer; font: var(--t-body); }
.check input { appearance: none; width: 22px; height: 22px; margin: 0; flex: none; border: 2px solid var(--c-border); border-radius: 6px; background: var(--c-surface);
  display: grid; place-items: center; cursor: pointer; transition: background-color var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease); }
.check input::after { content: ""; width: 6px; height: 11px; border: solid var(--c-text-on-primary); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); margin-top: -2px; transition: transform var(--d-fast) var(--ease); }
.check input:checked { background: var(--c-primary); border-color: var(--c-primary); }
.check input:checked::after { transform: rotate(45deg) scale(1); }

/* choice card — one option of a radio group, shown as a card */
.choice { display: flex; align-items: center; gap: var(--s-md); padding: var(--s-lg); border: 1px solid var(--c-border); border-radius: var(--r-lg);
  background: var(--c-surface); cursor: pointer; transition: border-color var(--d-fast) var(--ease), background-color var(--d-fast) var(--ease); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > .icon { color: var(--c-text-muted); }
.choice:has(input:checked) { border: 2px solid var(--c-primary); background: var(--c-primary-soft); padding: calc(var(--s-lg) - 1px); }
.choice:has(input:checked) > .icon { color: var(--c-primary); }
.choice:has(input:focus-visible) { outline: 3px solid var(--c-focus-ring); outline-offset: 2px; }

/* form-level error banner */
.form-error { padding: var(--s-md); border-radius: var(--r-md); background: var(--c-danger-soft); color: var(--c-danger); font: var(--t-body); }

/* ─── problems picked from the guide (complaint form) ───────── */
.problem-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); }
.problem-list__item { display: flex; align-items: center; gap: var(--s-sm); padding: var(--s-xs) var(--s-xs) var(--s-xs) var(--s-md); }
.problem-list__item + .problem-list__item { border-top: 1px solid var(--c-divider); }
.problem-list[hidden], .problem-list + p[hidden] { display: none; }

/* ─── dropdown (trigger; the list lives in a popup) ────────── */
.select-trigger { cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; }
.select-trigger .field__value { flex: 1; min-width: 0; }
.select-trigger .field__value:empty::before { content: attr(data-placeholder); color: var(--c-text-faint); }
.option-list { display: flex; flex-direction: column; gap: var(--s-xxs); min-height: 120px; }
.option {
  display: flex; flex-direction: column; justify-content: center;
  min-height: var(--size-touch-target);
  padding: var(--s-sm) var(--s-md);
  border: 0; border-radius: var(--r-sm); background: transparent;
  text-align: left; cursor: pointer; font: var(--t-body); color: var(--c-text);
}
.option:hover, .option[aria-selected="true"] { background: var(--c-primary-soft); }
.option[aria-selected="true"] { font: var(--t-body-strong); }

/* ─── popup (§12.17) — native <dialog>, glass over a blurred page ── */
.popup {
  padding: 0; border: 0; background: transparent; color: var(--c-text);
  width: min(560px, calc(100vw - 2 * var(--s-lg)));
  max-width: none; max-height: calc(100dvh - 2 * var(--s-lg));
  overflow: visible;
}
.popup::backdrop { background: var(--c-scrim); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); opacity: 0; transition: opacity var(--d-slow) var(--ease); }
.popup[data-open]::backdrop { opacity: 1; transition-duration: var(--d-emph); }
.popup__panel:focus { outline: none; }
.popup__panel {
  display: flex; flex-direction: column;
  max-height: calc(100dvh - 2 * var(--s-lg));
  border-radius: var(--r-xl);
  background: var(--c-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--c-glass-border);
  box-shadow: var(--shadow-high);
  transform-origin: 0 0;
  will-change: transform;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .popup__panel { background: var(--c-surface); border-color: var(--c-border); }
}
.popup__head { display: flex; align-items: center; gap: var(--s-sm); padding: var(--s-sm) var(--s-sm) 0 var(--s-xl); }
.popup__title { flex: 1; font: var(--t-subtitle); }
/* Head and foot stay put; a long form scrolls inside the body (content → body must be allowed to shrink). */
.popup__body { display: flex; flex-direction: column; gap: var(--s-md); padding: var(--s-sm) var(--s-xl); overflow-y: auto; overscroll-behavior: contain;
  flex: 1 1 auto; min-height: 0; }
.popup__foot { display: flex; justify-content: flex-end; align-items: center; gap: var(--s-sm); padding: var(--s-lg); flex: none; }
.popup__content { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; transition: opacity var(--d-base) var(--ease); }
.popup__head { flex: none; }

/* ─── toast ────────────────────────────────────────────────── */
.toast-region {
  position: fixed; z-index: 60; left: 0; right: 0;
  bottom: calc(var(--size-bottom-bar) + var(--size-fab) + 2 * var(--s-lg) + env(safe-area-inset-bottom));
  display: flex; justify-content: center; pointer-events: none; padding: 0 var(--s-lg);
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--s-sm);
  max-width: 520px; padding: var(--s-md) var(--s-lg);
  border-radius: var(--r-pill);
  background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-high);
  font: var(--t-label); cursor: pointer;
  animation: toast-in var(--d-base) var(--ease-emph);
}
.toast--leaving { animation: toast-out var(--d-fast) var(--ease-exit) forwards; }
.toast .icon { color: var(--toast-ink, var(--c-primary)); }
.toast--success { --toast-ink: var(--c-status-stable); }
.toast--error { --toast-ink: var(--c-danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(50%); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(50%); } }

/* ─── navigation (§12.15) ──────────────────────────────────── */
.app { min-height: 100dvh; }
.bottom-bar {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center;
  height: calc(var(--size-bottom-bar) + env(safe-area-inset-bottom));
  padding: 0 var(--s-sm) env(safe-area-inset-bottom);
  background: var(--c-surface); border-top: 1px solid var(--c-border);
  border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-high);
}
.nav-tab {
  flex: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; background: transparent; color: var(--c-text-muted);
  font: var(--t-caption); text-decoration: none; cursor: pointer; border-radius: var(--r-lg);
}
.nav-tab__icon { position: relative; padding: var(--s-xs) var(--s-lg); border-radius: var(--r-pill); transition: background-color var(--d-fast) var(--ease); }
.nav-tab[aria-current="page"] { color: var(--c-primary); }
.nav-tab[aria-current="page"] .nav-tab__icon { background: var(--c-primary-soft); }
.count-badge {
  position: absolute; top: -2px; right: 6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: var(--r-pill); background: var(--c-danger); color: var(--c-surface);
  font: var(--t-overline);
}

/* Log complaint (§12.7): a round button in the logo's orange, at the top bar's right end. Its words are for screen readers (aria) and the shortcut tile.
   shell.js moves it into the page's .topbar; where a page has none it stays pinned top-right. */
.fab {
  position: fixed; z-index: 45;
  top: calc(var(--s-sm) + env(safe-area-inset-top)); right: var(--s-lg);
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--size-fab-sm); height: var(--size-fab-sm); padding: 0;
  border: 0; border-radius: 50%;
  background: var(--c-accent); color: var(--c-text-on-accent);
  cursor: pointer;
  transition: transform var(--d-fast) var(--ease), filter var(--d-fast) var(--ease);
}
.fab > span:not(.icon) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fab .icon { font-size: var(--size-icon); }
.fab:hover { filter: brightness(0.96); }
.fab:active { transform: scale(0.97); }
.topbar > .fab { position: static; flex: none; }

/* The brand band: the screen's "head". A page that continues it below (search, today's numbers) adds .band right after. */
.topbar {
  display: flex; align-items: center; gap: var(--s-sm);
  min-height: calc(var(--size-touch-target) + var(--s-sm)); padding: env(safe-area-inset-top) var(--s-sm) 0;
  margin: 0 calc(-1 * var(--page-pad, var(--s-lg)));
  background: var(--c-band); color: var(--c-on-band);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.topbar .icon-btn, .topbar .t-title { color: var(--c-on-band); }
.topbar .icon-btn:hover { background: var(--c-band-fill); }
.topbar--flat { border-radius: 0; margin-bottom: 0 !important; }
.band {
  display: flex; flex-direction: column; gap: var(--s-md);
  margin: 0 calc(-1 * var(--page-pad, var(--s-lg))) calc(-1 * var(--size-band-overlap));
  padding: var(--s-xs) var(--s-lg) calc(var(--s-sm) + var(--size-band-overlap));
  background: var(--c-band); color: var(--c-on-band); border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.band + * { position: relative; }
.band > :empty { display: none; }
.band .field__label { color: var(--c-on-band-muted); }

.avatar {
  width: var(--size-avatar); height: var(--size-avatar); flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--c-primary-soft); color: var(--c-primary); border: 1px solid var(--c-border);
  font: var(--t-label); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--tint { background: var(--tint-soft); color: var(--tint); border: 0; font-weight: 600; }
.avatar--sm { width: var(--size-avatar-row); height: var(--size-avatar-row); font: var(--t-caption); font-weight: 600; }
/* A logo is shown whole on white (it prints on paper), never cropped to a circle. */
.avatar--logo { border-radius: var(--r-md); background: var(--brand-white); padding: 3px; }
.avatar--logo img { object-fit: contain; border-radius: 0; }

/* Drawer: slides over the page on phones; a permanent side nav on wide screens. */
.drawer {
  position: fixed; z-index: 50; inset: 0 auto 0 0;
  width: min(var(--size-drawer-width), 86vw);
  display: flex; flex-direction: column;
  background: var(--c-surface); border-right: 1px solid var(--c-border);
  border-radius: 0 var(--r-xl) var(--r-xl) 0; box-shadow: var(--shadow-high);
  padding-top: env(safe-area-inset-top);
  transform: translateX(-105%); visibility: hidden;
  transition: transform var(--d-slow) var(--ease-exit), visibility 0s linear var(--d-slow);
}
.drawer[data-open] { transform: none; visibility: visible; transition: transform var(--d-emph) var(--ease-emph); }
.drawer-scrim {
  position: fixed; z-index: 49; inset: 0; background: var(--c-scrim);
  opacity: 0; pointer-events: none; transition: opacity var(--d-slow) var(--ease);
}
.drawer-scrim[data-open] { opacity: 1; pointer-events: auto; }
.drawer__head { display: flex; align-items: center; gap: var(--s-md); padding: var(--s-lg) var(--s-xs) var(--s-lg) var(--s-lg); }
.drawer__nav { display: flex; flex-direction: column; gap: var(--s-xxs); padding: var(--s-sm); overflow-y: auto; }
.drawer__item {
  display: flex; align-items: center; gap: var(--s-md);
  min-height: var(--size-touch-target); padding: 0 var(--s-md);
  border-radius: var(--r-md); color: var(--c-text); text-decoration: none; font: var(--t-label);
}
.drawer__item .icon { color: var(--c-text-muted); }
.drawer__item:hover { background: var(--c-surface-alt); }
.drawer__item[aria-current="page"] { background: var(--c-primary-soft); color: var(--c-primary); }
.drawer__item[aria-current="page"] .icon { color: var(--c-primary); }

/* Main sections (Monitoring · Attendance · Task) live in the bottom bar on phones and at the top of the side nav on wide screens. */
.drawer__tabs { display: none; flex-direction: column; gap: var(--s-xxs); padding: var(--s-sm) var(--s-sm) 0; }

/* Wide screens: permanent side nav, no bottom bar; FAB sits bottom-right. */
@media (min-width: 840px) {
  .app { display: grid; grid-template-columns: var(--size-drawer-width) 1fr; }
  .drawer { position: sticky; top: 0; height: 100dvh; transform: none; visibility: visible; border-radius: 0; box-shadow: none; transition: none; }
  .drawer .drawer__close, .drawer-scrim, .menu-btn { display: none; }
  .bottom-bar { display: none; }
  .drawer__tabs { display: flex; }
  .fab { right: var(--s-xl); }
  .toast-region { bottom: calc(var(--size-fab) + 2 * var(--s-xl)); left: var(--size-drawer-width); }
  .page { --page-pad: var(--s-xl); padding: 0 var(--page-pad) var(--s-xxxl); }
}

/* ─── signed-out pages ─────────────────────────────────────── */
.auth { width: 100%; max-width: 480px; margin: 0 auto; padding: var(--s-lg) var(--s-xl) var(--s-xxl); display: flex; flex-direction: column; gap: var(--s-xl); }
.auth__top { display: flex; align-items: center; justify-content: space-between; padding-top: env(safe-area-inset-top); }
.auth__credit { text-align: center; }
.brand-mark { width: 44px; height: 44px; border-radius: var(--r-md); display: block; }
.wordmark, .wordmark img { display: block; height: 32px; width: auto; }
.logo, .logo img { display: block; height: 56px; width: auto; }
.drawer__item { border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; }

/* ─── feedback ─────────────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--s-md); padding: var(--s-xxl); text-align: center; }
.empty__icon { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: var(--c-primary-soft); color: var(--c-primary); }
.empty__icon .icon { font-size: var(--size-icon-lg); }
.empty p { color: var(--c-text-muted); max-width: 44ch; }

.skeleton {
  display: block; border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--c-surface-alt) 25%, var(--c-divider) 50%, var(--c-surface-alt) 75%);
  background-size: 300% 100%;
  animation: shimmer 1200ms linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }

/* ─── motion preferences ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .dot.status--critical, .status-mark__icon, .badge--blink, .stat--blink, .tracker__step--current .tracker__dot, .feed__row--new, .skeleton, .spinner { animation-duration: 0s; animation-iteration-count: 1; }
  .spinner { animation: spin 1600ms linear infinite; } /* a spinner that never moves looks broken */
}

/* ─── visual hierarchy: search pill, today on the band, one list card, shortcuts, one primary action ─── */
.searchpill {
  display: flex; align-items: center; gap: var(--s-sm); height: var(--size-fab-sm); padding: 0 var(--s-xs) 0 var(--s-md);
  background: var(--c-surface); border-radius: var(--r-pill); color: var(--c-text-faint);
}
.searchpill:focus-within { outline: 2px solid var(--c-focus-ring); outline-offset: 2px; }
.searchpill__input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--c-text); font: var(--t-body); }
.searchpill__input::placeholder { color: var(--c-text-faint); }

.t-numeral { font: var(--t-numeral); }
.today { display: flex; flex-direction: column; gap: var(--s-sm); }
.today .t-overline { color: var(--c-on-band-muted); margin: 0; }
.band .today__bar { background: var(--c-band-fill); height: 8px; }
.today__nums { display: flex; gap: var(--s-sm); }
.today__num { flex: 1; text-align: center; color: var(--c-on-band); }
.today__label { display: flex; align-items: center; justify-content: center; gap: var(--s-xs); font: var(--t-caption); color: var(--c-on-band-muted); }
.today__dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--c-on-band-muted); }
.today__dot.today__seg--done { background: var(--c-status-stable); }
.today__dot.today__seg--busy { background: var(--c-status-attention); }
.today__fastest { font: var(--t-caption); color: var(--c-on-band-muted); }

.listcard { background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--shadow-mid); overflow: hidden; }
.listrow {
  display: flex; align-items: center; gap: var(--s-md); width: 100%; min-height: var(--size-touch-target); padding: var(--s-md) var(--s-lg);
  border: 0; background: transparent; color: inherit; text-decoration: none; text-align: left; font: inherit; cursor: pointer;
}
.listrow + .listrow { border-top: 1px solid var(--c-divider); }
.listrow:hover { background: var(--c-surface-alt); }
.listrow .t-subtitle { margin: 0; }

.quick { flex-direction: row; justify-content: space-around; gap: var(--s-xs); padding: var(--s-md) var(--s-sm); }
.quick__item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--s-xs); padding: var(--s-xs); border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--c-text); text-decoration: none; font: var(--t-caption); text-align: center; cursor: pointer; }
.quick__item:hover { background: var(--c-surface-alt); }
.quick__tile { width: var(--size-quick-tile); height: var(--size-quick-tile); display: grid; place-items: center; border-radius: var(--r-md); background: var(--tint-soft); color: var(--tint); }

.menu-wrap { position: relative; flex: none; }
.menu { position: absolute; right: 0; bottom: calc(100% + var(--s-xs)); z-index: 40; min-width: 200px; padding: var(--s-xs);
  background: var(--c-surface); border-radius: var(--r-md); box-shadow: var(--shadow-high); }
.menu__item { display: flex; align-items: center; gap: var(--s-md); width: 100%; min-height: var(--size-touch-target); padding: 0 var(--s-md); border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--c-text); font: var(--t-label); text-align: left; cursor: pointer; }
.menu__item:hover { background: var(--c-surface-alt); }
.menu__item .icon { color: var(--c-text-muted); font-size: var(--size-icon-sm); }
.menu__item--danger, .menu__item--danger .icon { color: var(--c-danger); }
.actionbar {
  position: sticky; z-index: 30; bottom: calc(var(--size-bottom-bar) + var(--s-sm));
  display: flex; align-items: center; gap: var(--s-sm); margin-top: var(--s-lg); padding: var(--s-sm) 0;
  background: var(--c-bg);
}
.actionbar > .btn { flex: 1; }
@media (min-width: 840px) { .actionbar { bottom: 0; } }

/* The menu button: the drawer's header picture in a pill on the band. */
.menu-btn--person { display: inline-flex; align-items: center; width: auto; height: auto; padding: var(--s-xxs) var(--s-xs) var(--s-xxs) var(--s-xxs); gap: var(--s-xxs); border-radius: var(--r-pill); background: var(--c-band-fill); }
.menu-btn--person .avatar { width: var(--size-avatar); height: var(--size-avatar); }
.menu-btn--person .icon { color: var(--c-on-band); }
.icon--svg { width: var(--size-icon-sm); height: var(--size-icon-sm); flex: none; }
.maker-logo { display: flex; justify-content: center; padding-top: var(--s-sm); }
.maker-logo img { width: min(240px, 70%); height: auto; padding: var(--s-md); border-radius: var(--r-lg); background: var(--brand-white); }
