:root {
  --surface-0: #f4f2ec;
  --surface-1: #eeece4;
  --surface-2: #ffffff;
  --border: rgba(27, 36, 32, 0.13);
  --border-strong: rgba(27, 36, 32, 0.28);
  --text-primary: #1b2420;
  --text-secondary: #5f6b62;
  --text-muted: #8a9089;
  --accent-bg: #e1eef0;
  --accent-text: #205e66;
  --warning-bg: #f7ecd9;
  --warning-text: #8a5a12;
  --success-fill: #2e7d5b;
  --on-success: #ffffff;
  --radius: 8px;

  --status-green: #2e7d5b;
  --status-orange: #d98a1f;
  --status-red: #b3261e;
  --status-grey: #b7bcb8;
  --danger-bg: #f8dede;
  --danger-text: #8a241d;
  --success-bg: #e2f0e7;

  /* Monospace stack — used where character-level differences must be visible,
     e.g. verbatim recipe names in the Recipes module. */
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

a { color: var(--accent-text); text-decoration: none; }

.card {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 16px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.hub-tile {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--text-primary);
  display: block;
  position: relative;
}

.hub-tile.disabled {
  color: var(--text-muted);
  opacity: 0.6;
  pointer-events: none;
}

.hub-tile .label {
  font-weight: 500;
  font-size: 14px;
  margin-top: 8px;
  display: block;
}

/* --- Stage-aware Staff section ------------------------------------------- */
/* The stage line + one sentence naming what matters now; then the Do now /
   spare-moment groups, with everything else dimmed-but-still-tappable. */
.staff-stage-line {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.staff-stage-sentence {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 12px;
}
.staff-nothing {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--surface-1);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 0 0 12px;
}
.staff-group-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 14px 0 8px;
}
/* The dimmed set (stage-irrelevant or nothing-to-do tiles). Still real links —
   quieted, not hidden — so they sit below the prompted groups at low opacity. */
.staff-dimmed-grid { margin-top: 14px; }
.hub-tile.staff-dim { opacity: 0.5; }
/* Live count badge — only rendered when positive, so it always means "this many
   waiting". Accent pill in the top-right corner of the tile. */
.staff-count {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}

button {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-primary);
  cursor: pointer;
}
button:hover { background: var(--surface-1); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.primary { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
button.danger { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-text); }
button.danger:hover { background: var(--danger-bg); filter: brightness(0.97); }
button.danger:disabled { filter: none; }

input[type="number"], input[type="datetime-local"], input[type="text"], input[type="date"], select {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border-strong);
  font-family: inherit;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text-primary);
}

.badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius);
  background: var(--surface-1);
  color: var(--text-secondary);
}
.badge.active { background: var(--accent-bg); color: var(--accent-text); }
.badge.success { background: var(--success-bg); color: var(--success-fill); }
.badge.warning { background: var(--warning-bg); color: var(--warning-text); }
.badge.danger { background: var(--danger-bg); color: var(--danger-text); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); }

.fill-bar-track {
  width: 56px;
  height: 170px;
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  background: var(--surface-1);
}
.fill-bar-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--accent-bg);
}

.stat-card {
  flex: 1;
  background: var(--surface-1);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.stat-card.warning { background: var(--warning-bg); }
.stat-card .stat-label { font-size: 12px; color: var(--text-secondary); margin: 0 0 2px; }
.stat-card.warning .stat-label { color: var(--warning-text); }
.stat-card .stat-value { font-size: 18px; font-weight: 500; margin: 0; }
.stat-card.warning .stat-value { color: var(--warning-text); }
.stat-card .stat-sub { font-size: 11px; color: var(--text-muted); margin: 2px 0 0; }

.next-step-card {
  background: var(--surface-1);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.lifecycle-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.lifecycle-connector { width: 1px; height: 8px; background: var(--border); margin-left: 8px; }
.lifecycle-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 0.5px solid var(--border-strong);
  flex-shrink: 0;
}
.lifecycle-dot.done { background: var(--success-fill); border: none; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; }
.lifecycle-dot.current { width: 18px; height: 18px; background: var(--text-primary); border: none; }
.lifecycle-label { font-size: 12px; color: var(--text-secondary); margin: 0; }
.lifecycle-label.current { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.lifecycle-label.done { color: var(--text-muted); }

.history-entry {
  display: flex; align-items: center; gap: 12px; padding: 8px 0;
  border-top: 0.5px solid var(--border);
  font-size: 13px;
}
.history-entry .time { color: var(--text-muted); width: 110px; flex-shrink: 0; font-size: 12px; }
.history-entry .history-desc { flex: 1; min-width: 0; }
.history-edit-btn { font-size: 11px; padding: 4px 8px; flex-shrink: 0; }

.cycle-group { border-top: 0.5px solid var(--border); }
.cycle-group:first-child { border-top: none; }
.cycle-header {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  background: none; border: none; padding: 8px 2px;
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  cursor: pointer; text-align: left;
}
.cycle-header:hover { background: var(--surface-1); }
.cycle-meta { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.cycle-entries .history-entry:first-child { border-top: none; }

/* --- temperature records ------------------------------------------------ */

.status-dot {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--status-grey);
  flex-shrink: 0;
}
.status-dot.green { background: var(--status-green); }
.status-dot.orange { background: var(--status-orange); }
.status-dot.red { background: var(--status-red); }
.status-dot.grey { background: var(--status-grey); }
.status-dot.unchecked { background: none; border: 1.5px solid var(--border-strong); }

.temp-history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.temp-history-table th, .temp-history-table td {
  padding: 8px 6px;
  text-align: center;
  border-top: 0.5px solid var(--border);
}
.temp-history-table th { color: var(--text-secondary); font-weight: 500; font-size: 12px; }
.temp-history-table td:first-child, .temp-history-table th:first-child { text-align: left; }
.temp-history-row { cursor: pointer; }
.temp-history-row:hover { background: var(--surface-1); }

.temp-legend { font-size: 12px; color: var(--text-muted); margin-top: 10px; }

/* Shared location-code legend (config.js locationLegend) — same look on
   every screen that shows DC/SF/SG/BE codes. */
.location-legend { font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.location-legend strong { color: var(--text-secondary); font-weight: 600; }

/* Uniform narrow columns for the four location codes so DC/SF/SG/BE all
   sit at the same tight width. */
.tray-table th.loc-col, .tray-table td.loc-col { width: 34px; padding-left: 2px; padding-right: 2px; }

/* Compact per-expansion location sub-header (flavour-status) — lighter
   than the main table head so it reads as a helper, not a repeat. */
.tray-table tr.tray-subhead td {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 5px 4px 3px;
  border-top: 0.5px dashed var(--border);
}

.checklist-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 12px 4px;
  border-top: 0.5px solid var(--border);
  background: none; border-left: none; border-right: none; border-bottom: none;
  cursor: pointer; font-family: inherit;
}
.checklist-row:first-child { border-top: none; }
.checklist-row:hover { background: var(--surface-1); }
.checklist-row .name { flex: 1; font-size: 14px; }
.checklist-row .summary { font-size: 12px; color: var(--text-muted); }

.choice-group { display: flex; gap: 8px; margin-bottom: 16px; }
.choice-btn { flex: 1; padding: 12px; }
.choice-btn.selected { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }

.status-preview {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-1);
  font-size: 13px;
  margin: 12px 0;
}
.status-preview.orange { background: var(--warning-bg); color: var(--warning-text); }
.status-preview.red { background: var(--danger-bg); color: var(--danger-text); }
.status-preview.success { background: var(--success-bg); color: var(--success-fill); }
.status-preview.accent { background: var(--accent-bg); color: var(--accent-text); }

/* Right-pinned mono location tag (CODE #position) on tray-specific alert
   rows. margin-left:auto keeps it hard right; when the sentence is long
   it wraps to its own line and stays right-aligned rather than squashing
   the text. */
.loc-tag {
  margin-left: auto;
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius);
  background: var(--accent-bg);
  color: var(--accent-text);
  white-space: nowrap;
}

.contact-reminder { font-size: 13px; margin: 0 0 12px; }
.contact-reminder.urgent { color: var(--danger-text); font-weight: 500; }

textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border-strong);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 70px;
}

.progress-text { font-size: 12px; color: var(--text-muted); margin: 0 0 12px; }

/* --- gelato flavour register --------------------------------------------- */

.flavour-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.flavour-table th, .flavour-table td {
  padding: 8px 6px;
  text-align: left;
  border-top: 0.5px solid var(--border);
}
.flavour-table th { color: var(--text-secondary); font-weight: 500; font-size: 12px; }
/* Narrow, centred icon-only column (Flavour Register "Requires topping").
   Fixed narrow width lets the two-word header wrap like the others. */
.flavour-table th.topping-col, .flavour-table td.topping-col { text-align: center; width: 60px; }
.flavour-row { cursor: pointer; }
.flavour-row:hover { background: var(--surface-1); }

/* Opt-in modifier: body rows always highlight on hover, header never
   does — scoped to tbody so it never touches thead regardless of markup. */
.flavour-table.hoverable { table-layout: fixed; }
.flavour-table.hoverable tbody tr:hover { background: var(--surface-1); cursor: pointer; }
.flavour-table.hoverable td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- gelato tray register -------------------------------------------------- */

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pill {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 0.5px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
}
.pill.active { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }

.tray-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tray-table th, .tray-table td {
  padding: 8px 4px;
  text-align: center;
  border-top: 0.5px solid var(--border);
}
.tray-table th { color: var(--text-secondary); font-weight: 500; font-size: 11px; }
.tray-table td:first-child, .tray-table th:first-child { text-align: left; font-size: 13px; }
.tray-row { cursor: pointer; }
.tray-row:hover { background: var(--surface-1); }

.lifecycle-cell {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; font-size: 11px;
}
.lifecycle-cell.done { background: var(--success-fill); color: #fff; }
.lifecycle-cell.current { background: var(--text-primary); color: #fff; font-weight: 600; }
.lifecycle-cell.pending { color: var(--text-muted); }

.section-heading {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.03em;
  margin: 20px 0 10px;
}
.section-heading:first-of-type { margin-top: 4px; }
.field-row { display: flex; gap: 8px; margin-bottom: 4px; }
.field-col { flex: 1; }
.field-label { font-size: 12px; color: var(--text-secondary); display: block; margin-bottom: 6px; }
.form-note { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; }
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-option {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; padding: 10px 12px;
  border: 0.5px solid var(--border-strong); border-radius: var(--radius);
  cursor: pointer;
}
.radio-option input { width: auto; }

.material-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 0.5px solid var(--border); font-size: 13px; }
.material-row:first-child { border-top: none; }
.material-row .name { flex: 1; }
.material-row .code { color: var(--text-muted); font-size: 12px; width: 40px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.modal-box {
  background: var(--surface-2); border-radius: 12px; border: 0.5px solid var(--border);
  padding: 1.25rem 1.5rem; width: 320px; max-width: 90vw;
}
.warning-text { font-size: 12px; color: var(--warning-text); margin: 8px 0; }
.hidden { display: none; }

/* --- freezer cabinets ------------------------------------------------------ */

.freezer-visual-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 32px 16px;
  margin: 12px 0 20px;
  color: var(--text-muted);
  font-size: 13px;
}
.freezer-visual-placeholder p { margin: 0; }
.freezer-visual-icon { font-size: 26px; }

.icon-btn {
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1;
}
/* Armed state for an inline "tap again to confirm" destructive control. */
.icon-btn.armed { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-text); }
.position-row { cursor: pointer; }
.position-row:hover { background: var(--surface-1); }
.position-row.editing { cursor: default; }
.position-row.editing:hover { background: none; }
.position-row input[type="text"] { width: 56px; padding: 4px 6px; font-size: 13px; }
.position-row.selected { background: var(--accent-bg); }
.position-row.selected:hover { background: var(--accent-bg); }

/* --- cash drawer & float ---------------------------------------------------- */

.big-number-label { font-size: 12px; color: var(--text-secondary); margin: 16px 0 4px; }
.big-number { font-size: 32px; font-weight: 600; margin: 0; }

/* --- tray, tub & freezer locations ------------------------------------------ */

.state-tile { display: block; }
.stat-card.selected { background: var(--accent-bg); }
.stat-card.selected .stat-label { color: var(--accent-text); }

.checklist-row.selected, .swap-entry.selected { background: var(--accent-bg); }

.volume-row { border-top: 0.5px solid var(--border); padding: 4px 0; }
.volume-row:first-of-type { border-top: none; }

/* Flavour-picker results — scrollable so every match is reachable, not just
   the first few. */
.picker-results { max-height: 320px; overflow-y: auto; }
.volume-row-main {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 10px 4px;
  background: none; border: none;
  font-family: inherit; font-size: 14px;
  cursor: pointer;
}
button.volume-row-main:hover { background: var(--surface-1); }
.volume-pos { width: 22px; flex-shrink: 0; color: var(--text-muted); font-size: 12px; }
.volume-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.volume-fill-track { display: inline-block; vertical-align: middle; width: 60px; height: 8px; border-radius: 4px; background: var(--surface-1); border: 0.5px solid var(--border-strong); overflow: hidden; flex-shrink: 0; }
.volume-fill-bar { display: block; height: 100%; background: var(--accent-text); }
.volume-fill-bar.fill-red { background: var(--danger-text); }
.volume-fill-bar.fill-amber { background: var(--warning-text); }
.volume-fill-bar.fill-green { background: var(--success-fill); }
.volume-pct { width: 36px; flex-shrink: 0; text-align: right; font-size: 12px; color: var(--text-secondary); }
/* Flavour-at-a-glance: rows are tappable (drill-down); hover only on pointers. */
.glance-row { cursor: pointer; }
@media (hover: hover) {
  .glance-row:hover { background: var(--surface-1); }
}
.glance-row:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -2px; }

/* Flavour drill-down popup. */
.glance-drill { position: relative; width: 420px; }
.glance-drill-close { position: absolute; top: 8px; right: 10px; background: none; border: none; font-size: 22px; line-height: 1; color: var(--text-muted); cursor: pointer; padding: 2px 6px; }
.glance-drill-head { padding-right: 28px; }
.glance-drill-head h3 { font-size: 17px; font-weight: 600; margin: 0; }
.glance-drill-fun { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.glance-drill-context { font-size: 13px; color: var(--text-secondary); margin: 8px 0 0; }
.glance-drill-short { font-size: 13px; font-weight: 600; color: var(--warning-text); margin: 4px 0 0; }
.glance-drill-section-block { margin-top: 14px; }
.glance-drill-section { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 0 0 6px; }
.glance-drill-tray, .glance-drill-remnant { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-top: 0.5px solid var(--border); flex-wrap: wrap; }
.glance-drill-meta { font-size: 12px; color: var(--text-secondary); }
.glance-drill-kg { font-weight: 600; font-size: 13px; min-width: 52px; }
.glance-ready { font-size: 11px; font-weight: 600; color: var(--success-fill); background: var(--success-bg, #e2f0e7); border-radius: 999px; padding: 1px 8px; margin-left: auto; }
.glance-needs { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.volume-grams { flex-shrink: 0; text-align: right; font-size: 12px; color: var(--text-secondary); }
.volume-quick-select { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 4px 10px 34px; }

/* --- shop hours ------------------------------------------------------------ */

/* Live status header: title left, pill + stage readout right. */
.shop-status { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.shop-status .readout { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
/* neutral tint reuses the plain .badge look; success/warning reuse .badge.success/.warning */

/* Week timeline. A fixed 10:00–22:00 axis; each open day draws its stage
   segments proportionally, closed days a dashed outline. */
.hours-timeline { margin: 4px 0 8px; }
.hours-axis {
  position: relative; height: 14px; margin-left: 38px; margin-bottom: 2px;
  font-size: 10px; color: var(--text-muted);
}
.hours-tick { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.hours-day-row { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.hours-day-label { width: 32px; flex-shrink: 0; font-size: 11px; color: var(--text-secondary); }
.hours-track {
  position: relative; flex: 1; height: 22px;
  background: transparent; border-radius: 4px; overflow: hidden;
}
.hours-seg {
  position: absolute; top: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1; white-space: nowrap; overflow: hidden;
}
.hours-closed {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border-strong); border-radius: 4px;
  background: transparent; color: var(--text-muted); font-size: 10px;
}
.hours-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0 38px; }
.hours-legend .key { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-secondary); }
.hours-legend .swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.hours-legend .swatch.dashed { background: transparent; border: 1px dashed var(--border-strong); }

/* Trading hours table. */
.hours-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hours-table td { padding: 8px 4px; border-top: 0.5px solid var(--border); vertical-align: middle; }
.hours-table tr:first-child td { border-top: none; }
/* Muted column-header row, matching the register/cabinet table heads. The
   hairline border-bottom collapses with the first data row's border-top. */
.hours-table tr.hours-head td { color: var(--text-secondary); font-weight: 500; font-size: 11px; padding: 2px 4px 6px; border-bottom: 0.5px solid var(--border); }
.hours-table .day-name { font-weight: 500; white-space: nowrap; }
.hours-table .toggle-btn { padding: 5px 10px; font-size: 12px; }
.hours-table .toggle-btn.open { background: var(--success-bg); color: var(--success-fill); border-color: var(--success-fill); }
.hours-table input[type="time"] {
  width: 100%; padding: 6px 8px; border-radius: var(--radius);
  border: 0.5px solid var(--border-strong); font-family: inherit; font-size: 13px;
  background: var(--surface-2); color: var(--text-primary);
}
.hours-table .time-cell { width: 84px; }
.hours-table .closed-cell { color: var(--text-muted); font-size: 12px; }
.hours-table .onsite { text-align: right; white-space: nowrap; color: var(--text-secondary); font-size: 12px; }
.hours-footer { font-size: 12px; color: var(--text-muted); margin: 12px 0 0; }
.hours-row.closed .day-name { color: var(--text-muted); }

/* --- freezer configuration (read-only) ------------------------------------ */

/* Wider than the default 480px page — this is a two-configuration comparison
   read across the columns. Scrolls horizontally rather than squashing below. */
.fc-page { max-width: 900px; }
.fc-scroll { overflow-x: auto; }
.fc-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-width: 620px; }

.fc-colhead { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.fc-colhead h2 { font-size: 15px; font-weight: 600; margin: 0; }

.fc-unit { background: var(--surface-2); border: 0.5px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.fc-unit-title { font-size: 13px; font-weight: 600; margin: 0; }
.fc-unit-sub { font-size: 11px; color: var(--text-muted); margin: 1px 0 8px; }

/* One Hiber shelf: narrow shelf-number column + three tray columns. The
   shelf-number cell spans BOTH rows (grid-row: span 2); no spacer element is
   emitted between back and front cells — auto-placement flows the three front
   cells onto row 2 (columns 2–4) because the spanning cell already reserves
   column 1 of row 2. Adding a spacer would push the 6th tray onto a 3rd row. */
.fc-shelf { display: grid; grid-template-columns: 20px repeat(3, 1fr); gap: 4px; padding: 6px 0; border-top: 0.5px solid var(--border); }
.fc-shelf:first-child { border-top: none; }
.fc-shelfnum { grid-row: span 2; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-muted); }
.fc-base { border: 1px dashed var(--border-strong); border-radius: 6px; margin-top: 6px; padding: 8px; text-align: center; font-size: 10px; color: var(--text-muted); }

.fc-cabinet-head { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; font-size: 10px; color: var(--text-secondary); font-weight: 500; text-align: center; margin-bottom: 4px; }
.fc-cabinet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.fc-cabinet-foot { font-size: 10px; color: var(--text-muted); margin: 6px 0 0; }

/* Bench: a single vertical column, BE 1 (top) → BE 24 (bottom), in both
   configurations. Taller card, but the 1→24 vertical read is what's wanted. */
.fc-bench { display: grid; grid-template-columns: 1fr; gap: 4px; }

/* Fixed height for every tray cell regardless of occupancy — a slot is a
   physical space whether or not a tray is in it, so uniform height is the
   truthful drawing and the columns align without any row coupling. Fits the
   tallest (three-line, occupied) cell. */
.fc-cell { height: 54px; border-radius: 6px; padding: 4px 6px; overflow: hidden; }
.fc-cell .fc-pos { font-size: 9px; opacity: 0.75; line-height: 1.2; }
.fc-cell .fc-flav { display: block; font-size: 11px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-cell.empty { background: transparent; border: 1px dashed var(--border-strong); }
.fc-cell.empty .fc-pos { display: block; color: var(--text-muted); }
.fc-cell.void { background: transparent; border: 1px dashed var(--border); }
/* Working Freezer empty slot: faint name of the group that belongs there. */
.fc-cell .fc-default-group { display: block; font-size: 9px; line-height: 1.2; color: var(--text-muted); opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
/* No default set — same red vocabulary as the SF defaults screen, shrunk to fit a cell. */
.fc-cell.fc-nodefault { border-color: var(--danger-text); }
.fc-cell.fc-nodefault .badge.danger { font-size: 8px; padding: 0 3px; margin-top: 2px; }
/* Unplaced staging trays: shown, not dropped, under the flagged treatment. */
.fc-unplaced { margin-top: 8px; border: 1px dashed var(--danger-text); border-radius: 6px; padding: 8px; }
.fc-unplaced-head { margin: 0 0 6px; font-size: 10px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.fc-unplaced-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }

/* Occupied cell: three stacked lines — [pos · date] / flavour / fullness bar. */
.fc-cell.filled { display: flex; flex-direction: column; gap: 2px; }
.fc-cell .fc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.fc-cell .fc-date { font-size: 9px; opacity: 0.6; white-space: nowrap; flex-shrink: 0; }
.fc-cell .fc-bar { display: block; height: 4px; border-radius: 2px; background: rgba(0, 0, 0, 0.13); overflow: hidden; margin-top: auto; }
.fc-cell .fc-bar-fill { display: block; height: 100%; border-radius: 2px; }
/* Working Freezer cells carry an origin body colour, so the bar needs a darker
   translucent track to stay legible on all four (light) origin backgrounds. */
.fc-cell--origin .fc-bar { background: rgba(20, 20, 20, 0.16); }

/* Base-shelf storage rows — shared by the base-shelves screen and the
   freezer-config base block. The row itself is the fullness bar: a light-tint
   background with a stronger-tint filled portion from the left (width = fill %),
   text in a dark stop. Colours are supplied inline per row (containerTypeColour
   in config.js); these rules are structure only. */
.bs-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-width: 560px; }
.bs-col { min-width: 0; }
.bs-colhead { margin-bottom: 8px; }
.bs-name { margin: 0; font-size: 15px; }
.bs-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }
.bs-count { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }
.bs-rows { display: flex; flex-direction: column; gap: 3px; }
.bs-row { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; font-size: 12px; overflow: hidden; white-space: nowrap; background: var(--surface-1); }
/* Capacity track (light tint, width = capacity/reference) with the fullness fill
   inside it (stronger stop) — both anchored left, so coloured length = weight. */
.bs-track { position: absolute; left: 0; top: 0; bottom: 0; z-index: 0; }
.bs-fill { position: absolute; left: 0; top: 0; bottom: 0; z-index: 1; }
/* Faint 1/2/3 kg gridlines (25/50/75% of the row) — a scale, subordinate to bars. */
.bs-grid { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(rgba(27,36,32,0.12), rgba(27,36,32,0.12)) 25% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(27,36,32,0.12), rgba(27,36,32,0.12)) 50% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(27,36,32,0.12), rgba(27,36,32,0.12)) 75% 0 / 1px 100% no-repeat; }
.bs-row > span:not(.bs-track):not(.bs-fill):not(.bs-grid) { position: relative; z-index: 3; }
.bs-free { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); font-style: italic; }
/* Only the interactive base-shelves screen marks rows actionable; the read-only
   freezer-config block renders identical rows with no handler and no pointer. */
.bs-row.is-actionable { cursor: pointer; }
.bs-row.is-actionable:hover { box-shadow: inset 0 0 0 1.5px var(--border-strong); }

/* Container actions modal (base-shelves screen). */
.bs-modal-backdrop { position: fixed; inset: 0; background: rgba(20,24,22,0.4); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.bs-modal { background: var(--surface-2); border-radius: var(--radius); padding: 18px; width: 100%; max-width: 420px; position: relative; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.bs-modal-close { position: absolute; top: 8px; right: 10px; background: none; border: none; font-size: 24px; line-height: 1; color: var(--text-muted); cursor: pointer; width: auto; padding: 4px; }
.bs-modal-title { margin: 0 24px 2px 0; font-size: 16px; }
.bs-modal-sub { margin: 0 0 14px; font-size: 13px; color: var(--text-secondary); }
.bs-action-btns { display: flex; flex-direction: column; gap: 8px; }
.bs-act { width: 100%; text-align: left; padding: 12px 14px; border-radius: 8px; border: 0.5px solid var(--border-strong); background: var(--surface-1); font-size: 14px; font-weight: 500; cursor: pointer; }
.bs-act:hover { filter: brightness(0.98); }
.bs-act.danger { color: var(--danger-text); }
.bs-form { margin-top: 12px; }
.bs-modal-links { display: flex; gap: 16px; margin-top: 16px; padding-top: 12px; border-top: 0.5px solid var(--border); font-size: 13px; }
.bs-pos { width: 16px; text-align: right; opacity: 0.7; flex: none; }
.bs-type { font-weight: 600; flex: none; }
.bs-flav { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.bs-date { flex: none; opacity: 0.85; }
.bs-weight { flex: none; font-variant-numeric: tabular-nums; }
.bs-pct { width: 36px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.bs-empty { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-muted); }
.bs-empty-label { flex: 1 1 auto; text-align: center; font-style: italic; opacity: 0.7; }
