:root {
  --paper: #F7F8FC;
  --sheet: #ffffff;
  --ink: #1D2040;
  --muted: #505050;
  --line: #D2D2D2;
  --teal: #3A3F7A;
  --teal-deep: #2E3263;
  --accent: #3A3F7A;
  --amber: #FFB900;
  --amber-ink: #1D2040;
  --rose: #FDE7E9;
  --rose-strong: #F25022;
  --rose-ink: #1D2040;
  --weekend: #ECEFFB;
  --holiday: #FFF4CE;
  --night: #0B2545;
  --admin: #1D2040;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.banner {
  background: var(--amber);
  color: var(--amber-ink);
  text-align: center;
  padding: 8px 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 28px;
  padding: 18px 22px 8px;
}

.eyebrow {
  margin: 0 0 2px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--teal);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

h2 { margin: 0 0 8px; font-size: 1.15rem; }
h3 { margin: 0 0 8px; font-size: 1rem; }
code { overflow-wrap: anywhere; }

.window-chip, .top-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip {
  border: 1px solid var(--line);
  background: var(--sheet);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 650;
}

.chip.status-collecting { color: var(--teal-deep); }
.chip.status-draft { background: #f8e7b8; border-color: #e2c56d; }
.chip.status-published { background: var(--teal); color: white; border-color: var(--teal-deep); }

label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 650; }
label.inline { display: flex; align-items: center; gap: 8px; }

input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
}

textarea { min-height: 72px; width: 100%; font-family: ui-monospace, "Cascadia Code", monospace; font-size: 12px; }

button, .btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--teal);
  background: #fff;
  color: var(--teal);
  border-radius: 2px;
  min-height: 36px;
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

button:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  background: #EAF3FB;
}

button:focus-visible, .btn:focus-visible {
  outline: 3px solid #1D2040;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff;
}

button.primary, .btn.primary {
  background: #3A3F7A;
  color: #fff;
  border-color: #3A3F7A;
}
button.primary:hover, .btn.primary:hover { background: #2E3263; }

button.secondary, .btn.secondary {
  background: #fff;
  color: #3A3F7A;
  border-color: #3A3F7A;
}
button.secondary:hover, .btn.secondary:hover { background: #EAF3FB; }

button.tertiary, .btn.tertiary, button.tab {
  background: transparent;
  color: #3A3F7A;
  border-color: transparent;
  border-radius: 2px;
}
button.tertiary:hover, .btn.tertiary:hover, button.tab:hover { background: #EAF3FB; }

button.danger { color: #7c261e; border-color: #e4b7b0; background: #fff; }
button:disabled {
  background: #C8C8C8;
  color: #505050;
  border-color: #C8C8C8;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}
button.tab {
  border-bottom: 3px solid transparent;
  border-radius: 2px 2px 0 0;
  padding: 8px 12px;
}
button.tab.active {
  color: #3A3F7A;
  border-bottom-color: #3A3F7A;
  font-weight: 700;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

main { padding: 16px 22px 48px; }

.toolbar, .row-actions, .legend, .split {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.card {
  background: #fff;
  border: 0;
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 12px;
}

.muted { color: var(--muted); }
.narrative { white-space: pre-wrap; }
.small { font-size: 12px; }
.warn { color: var(--rose-ink); font-weight: 700; }
.stretch-warn { color: #8a5a00; font-weight: 800; margin-right: 4px; }
.stretch-warn-strong { color: #8b1e1e; }
.grid-cell.night .stretch-warn { color: #f5c16c; }
.grid-cell.night .stretch-warn-strong { color: #ffb4a8; }
.has-warn { outline: 2px dashed #8a5a00; }
.warn-strong { outline: 2px solid #8b1e1e; }

.roster-scroll {
  overflow: auto;
  max-height: calc(100vh - 250px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

table.roster, table.data {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.roster th, .roster td {
  border-bottom: 1px solid #eee4d6;
  border-right: 1px solid #f3ece1;
  min-width: 34px;
  height: 34px;
  text-align: center;
  font-size: 12px;
  padding: 0 2px;
  font-variant-numeric: tabular-nums;
}

.roster thead th {
  position: sticky;
  top: 0;
  background: #f4eee4;
  z-index: 1;
  font-weight: 650;
  height: 42px;
}

.roster .name, .roster thead .name {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  min-width: 168px;
  max-width: 200px;
  padding: 0 10px;
  background: #fbf8f3;
  font-weight: 680;
}

.roster thead .name { z-index: 4; background: #efe6d8; }
.roster td.weekend, .roster th.weekend { background: var(--weekend); }
.roster td.holiday, .roster th.holiday { background: var(--holiday); }
.roster tr.actor th.name,
.roster tr.actor td.name { box-shadow: inset 3px 0 0 var(--teal); background: #e5f2f0; }
.day-list li.mine { box-shadow: inset 3px 0 0 var(--teal); padding-left: 6px; }
.roster tr.gap-row th, .roster tr.gap-row td { background: var(--rose); color: var(--rose-ink); font-weight: 750; }
.roster tr.gap-row td.short { background: var(--rose-strong); }
.roster tr.gap-row .name { z-index: 2; }

.dow { display: block; font-size: 10px; color: var(--muted); font-weight: 650; }
.num { display: block; }

.shift {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.legend .swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid var(--line);
}

table.data th, table.data td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data th { font-size: 12px; color: var(--muted); font-weight: 700; }
table.data tr.clickable { cursor: pointer; }
table.data tr.selected { background: #efe7c8; }

.bar-wrap { background: #efe7da; border-radius: 99px; height: 8px; width: 88px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.bar { display: block; height: 8px; border-radius: 99px; background: var(--teal); }

.cycle { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-day, .chip-off {
  min-width: 36px;
  text-align: center;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 750;
  border: 1px solid var(--line);
}
.chip-off { color: var(--muted); background: #f3efe7; }
.chip-day { background: #e7f0ee; color: var(--teal-deep); }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 14px;
}

.fields { display: grid; gap: 8px; }
.fields .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.audit-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  max-width: min(420px, calc(100vw - 32px));
  background: var(--ink);
  color: #f7f3eb;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 5;
}
.toast.error { background: var(--rose-ink); }

.proposal { border-left: 4px solid var(--teal); }

.shift-btn, .tap, button, .btn {
  min-height: 36px;
}

.shift-btn {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  padding: 2px 4px;
}

.shift-btn sup {
  font-size: 9px;
  letter-spacing: 0.02em;
  margin-left: 2px;
  color: var(--muted);
  font-weight: 700;
}

.shift-btn sup.badge-override,
.badge.badge-override {
  color: #6a3d00;
  background: #f3d6a2;
  border-radius: 4px;
  padding: 0 3px;
  font-weight: 700;
}

td.hit { outline: 2px solid var(--teal); outline-offset: -2px; }

.phone-board { display: none; }
.agenda, .day-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.agenda li, .day-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.sheet {
  position: fixed;
  inset: auto 0 0 0;
  background: var(--sheet);
  border-top: 1px solid var(--line);
  padding: 16px;
  z-index: 6;
  max-height: 80vh;
  overflow: auto;
  box-shadow: var(--shadow);
}

.bars { display: grid; gap: 8px; }
.bars .row { display: grid; grid-template-columns: 140px 1fr 48px; gap: 8px; align-items: center; }
.bars .track { background: #efe7da; border-radius: 99px; height: 12px; }
.bars .fill { display: block; height: 12px; border-radius: 99px; background: var(--teal); }

.cards { display: grid; gap: 10px; }
.cards article { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: white; }

.badge {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 99px;
  background: #efe7da;
  font-size: 12px;
}

.slot-list { display: grid; gap: 8px; }
.slot-day { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.draft-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.draft-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.draft-day, .draft-pad {
  min-width: 0;
}

.draft-day {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.draft-day .num { font-size: 12px; font-weight: 750; }
.draft-day.weekend { background: var(--weekend); }
.draft-day.holiday { background: var(--holiday); }
.draft-day.outside { background: transparent; border-color: transparent; min-height: 0; }

.draft-slot {
  width: 100%;
  justify-content: center;
  font-weight: 800;
  padding: 4px 2px;
  background: white;
}

.shift-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.shift-grid .dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.shift-day {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.shift-day.weekend { background: var(--weekend); }
.shift-day.holiday { background: var(--holiday); }
.shift-day .num { font-size: 12px; font-weight: 750; }

.grid-badge {
  display: inline-block;
  margin: 0 4px 2px 0;
  padding: 0 5px;
  border-radius: 99px;
  background: #efe7da;
  font-size: 11px;
  font-weight: 700;
}

.grid-cell {
  width: 100%;
  text-align: left;
  min-height: 48px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.grid-cell { position: relative; }
.grid-cell.below { box-shadow: none; }
.grid-cell.outside { background: transparent; color: var(--muted); box-shadow: none; }
.grid-cell.blocked, .grid-cell.hatch {
  background: repeating-linear-gradient(135deg, #F2F2F2 0 6px, #D9D9D9 6px 9px);
  color: #1D2040;
  border: 1px dashed #8A8A8A;
}
.grid-cell.staged {
  border: 3px solid #3A3F7A;
  background: #fff;
  color: #1D2040;
  font-weight: 700;
  box-shadow: none;
}
.grid-cell.pto { box-shadow: inset 0 0 0 2px #6e6256; }
.grid-cell.education { box-shadow: inset 0 0 0 2px #1d4e89; }
.leave-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  border-radius: 3px;
  padding: 1px 3px;
  color: #1a2330;
  background: transparent;
}
.leave-badge.pending { border: 1.5px dashed #1a2330; }
.leave-badge.approved {
  color: #fff;
  background: #1a2330;
  border: 1.5px solid #1a2330;
}
.grid-cell.night .leave-badge.pending {
  color: #fff;
  border-color: #fff;
}
.grid-cell.night .leave-badge.approved {
  color: #0B2545;
  background: #fff;
  border-color: #fff;
}
.pto-list { list-style: none; padding: 0; margin: 8px 0 0; }
.pto-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.grid-cell .grid-shift,
.grid-cell .grid-people,
.grid-cell .grid-status { display: block; font-size: 11px; line-height: 1.25; }
.grid-icon { font-weight: 800; margin-right: 3px; }

.grid-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 8px 0 10px;
}
.grid-legend li {
  background: #fff;
  border: 1px solid #D2D2D2;
  border-radius: 2px;
  padding: 1px 6px;
  font-size: 12px;
}

.grid-nav {
  flex: 1 0 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.grid-nav strong { text-align: center; }
.grid-week { display: grid; gap: 8px; }
.grid-week-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}
.grid-week-label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.turn-banner {
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: #3A3F7A;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}
.turn-banner .badge { background: #fff; color: #3A3F7A; }
.turn-banner[hidden] { display: none; }
.turn-in { max-width: 1440px; margin: 0 auto; padding: 12px 16px; }
.picker-lock-reason {
  margin: 0 0 8px;
  padding: 8px 10px;
  background: #F2F2F2;
  border: 1px solid #D2D2D2;
  color: #1D2040;
  font-weight: 700;
}
.picker-locked .picker-surface {
  filter: grayscale(1);
  opacity: 0.55;
}
.search-cards { display: none; }
.search-desktop { overflow-x: auto; max-width: 100%; }
.search-quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.search-quick label { flex: 1 1 16rem; min-width: 0; }
.search-filters-toggle, .search-sheet .sheet-only, .sheet-scrim { display: none; }
.search-sheet select[multiple] { width: 100%; max-width: 100%; }
.search-day { display: grid; gap: 8px; }
.search-day h3 { margin: 8px 0 0; }
.search-cards article { min-width: 0; overflow-wrap: anywhere; }
button.sort {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  min-height: 0;
  color: inherit;
  font-weight: 700;
}
button.sort.active { color: var(--teal-deep); text-decoration: underline; }

.equity-svg, svg[role="img"] { max-width: 100%; height: auto; }

@media (max-width: 800px) {
  .audit-filters { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .card { min-width: 0; }
  .card:has(table.data) { overflow-x: auto; }
  main { padding: 12px; }
  .top { padding: 14px 12px 6px; }
  .roster-scroll { display: none; }
  .phone-board { display: block; }
  .legend { display: none; }
  .grid-legend { display: flex; }
  .grid-cell { min-height: 64px; }
  .search-desktop { display: none; }
  .search-cards { display: grid; }
  .search-filters-toggle { display: inline-flex; }
  .search-sheet { display: none; }
  .search-sheet.open {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    max-height: 80vh;
    overflow: auto;
    background: var(--sheet);
    border-top: 1px solid var(--line);
    padding: 16px;
    box-shadow: var(--shadow);
  }
  .search-sheet .sheet-only { display: inline-flex; }
  .sheet-scrim {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 25, 21, 0.35);
    border: 0;
    border-radius: 0;
    z-index: 5;
    min-height: 0;
  }
  button, .btn, .tap, select, input { min-height: 44px; }
  .agenda .tap, .day-list .tap { flex: 1 1 12rem; justify-content: flex-start; }
  .draft-cal { gap: 4px; }
  .draft-slot { min-height: 44px; font-size: 13px; }
  .tabs { gap: 6px; }
  .tab { padding: 10px 12px; }
  .top-controls, .top-controls label, .fields label { width: 100%; }
  .fields .pair { grid-template-columns: 1fr; }
}

.more-tabs { display: inline-flex; align-items: center; }
.more-tabs summary { cursor: pointer; padding: 8px 10px; color: var(--muted); }
.more-tabs[open] { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs { align-items: center; }

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}
.phase-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 12px;
}
.phase-bar .stepper { flex: 1; margin: 0; gap: 4px 12px; }
.phase-bar .step {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 2px 0;
  font-size: 13px;
}
.phase-bar .step.done { color: #107C10; }
.phase-bar .step.current {
  background: transparent;
  color: #3A3F7A;
  border-bottom: 2px solid #3A3F7A;
  font-weight: 700;
}
.phase-bar .primary { margin-left: auto; }
.seg {
  display: inline-flex;
  border: 1px solid #3A3F7A;
  border-radius: 2px;
  overflow: hidden;
}
.seg button { border: 0; border-radius: 0; min-height: 32px; background: #fff; color: #3A3F7A; }
.seg button.on { background: #3A3F7A; color: #fff; }
.seg button:hover { transform: none; }
.step {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--sheet);
  color: var(--muted);
}
.step.current {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
  font-weight: 700;
}
.step.done { color: var(--teal-deep); }
.card-grid, .tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.action-card, .tile {
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 120px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.tile.glow {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 92, 87, 0.25);
}
.tile-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--teal);
  font-weight: 700;
}
.night-counter { font-weight: 700; }
.whos-up { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.whos-up li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

@media print {
  .banner, .tabs, .toolbar, .top-controls, .toast, button { display: none !important; }
  body { background: white; }
  .roster-scroll { overflow: visible; max-height: none; border: 0; }
}

.top { display: block; padding: 0; background: #fff; border-bottom: 1px solid #D2D2D2; }
.topin {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  flex-wrap: wrap;
  padding: 6px 16px;
}
.sp { flex: 1; }
.brand { display: inline-flex; align-items: center; flex: none; }
.logo { display: block; flex: none; height: 32px; width: auto; }
.logo-dark, body.role-admin .logo-light { display: none; }
body.role-admin .logo-dark { display: block; }
.brand-name { font-size: 15px; }
.badge {
  display: inline-block;
  border-radius: 2px;
  padding: 1px 6px;
  font-size: 12px;
  font-weight: 700;
  color: #1D2040;
}
.badge.y { background: #FFB900; }
.badge.g { background: #7FBA00; }
.badge.b { background: #00A4EF; }
.badge.r { background: #F25022; color: #000; }
.who { color: #505050; font-size: 12px; }
.pill, .window-chip .pill {
  border: 1px solid #3A3F7A;
  color: #3A3F7A;
  border-radius: 12px;
  padding: 1px 8px;
  font-size: 12px;
  background: #fff;
}
.top .tabs { border: 0; padding: 0; gap: 2px; }
.more-panel {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}
.more-panel[hidden], #dev-tools[hidden], #admin-badge[hidden], .phone-tabs[hidden] { display: none; }
#dev-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.frame { max-width: 1440px; margin: 0 auto; }
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  align-items: start;
  padding: 12px 16px 32px;
}
.cols > main, .cols > aside { min-width: 0; }
#view { padding: 0; }
body.role-admin .top { background: #1D2040; color: #fff; border-bottom: 0; }
body.role-admin .who { color: #E1E5EA; }
body.role-admin .pill { border-color: #fff; color: #fff; background: transparent; }
body.role-admin .top button.tab,
body.role-admin .top button.tertiary { color: #fff; }
body.role-admin .top button.tab:hover,
body.role-admin .top button.tertiary:hover { background: #3A3F7A; }
body.role-admin .top button.tab.active { border-bottom-color: #7FA7E8; color: #fff; }
body.role-admin .top button.secondary { background: #fff; color: #1D2040; border-color: #fff; }
body.role-admin .top button.secondary:hover { background: #F2F2F2; color: #1D2040; }
body.role-admin .top button:focus-visible {
  outline-color: #fff;
  box-shadow: 0 0 0 2px #1D2040;
}
.grid-cell.night { background: #0B2545; color: #fff; border-color: #0B2545; }
.grid-cell.night.staged { border: 3px solid #FFB900; background: #0B2545; color: #fff; }
.grid-cell.taken { background: #3A4C66; color: #fff; border-color: #3A4C66; }
.grid-cell.mine { box-shadow: inset 4px 0 0 #3A3F7A; font-weight: 700; }
.grid-cell.night.mine { box-shadow: inset 4px 0 0 #00A4EF; }
.grid-cell.has-badge { padding-top: 18px; }
.corner-badge {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 10px;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 2px;
  background: #F25022;
  color: #000;
  border: 1px solid #fff;
}
.cell-mark { float: right; font-weight: 700; }
.day-head { display: flex; justify-content: space-between; gap: 4px; align-items: center; }
.day-tag { font-size: 11px; font-weight: 700; }
.shift-day.weekend { background: #E6EEF7; }
.shift-day.holiday { background: #FFF4CE; }
.fair-share p { margin: 2px 0; font-weight: 650; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.status-grid .v { font-size: 18px; font-weight: 700; }
.bar { height: 6px; background: #EAEAEA; border-radius: 3px; margin-top: 3px; }
.bar i { display: block; height: 6px; background: #3A3F7A; border-radius: 3px; }
.inbox { list-style: none; margin: 0; padding: 0; }
.inbox li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-left: 4px solid #D2D2D2;
  border-bottom: 1px solid #EAEAEA;
}
.inbox li.crit { border-left-color: #F25022; background: #FDE7E9; }
.inbox li.warn { border-left-color: #FFB900; }
.inbox li.info { border-left-color: #00A4EF; }
.inbox .tx { flex: 1; }
tr.flag td { background: #FFF4CE; }
.sticky-submit {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #D2D2D2;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  z-index: 4;
}
.inbox-chip { width: 100%; justify-content: space-between; }
.phone-tabs {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  background: #fff;
  border-top: 1px solid #D2D2D2;
}
.phone-tabs button {
  flex: 1;
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #3A3F7A;
  box-shadow: none;
}
.phone-tabs button.active { border-bottom: 3px solid #3A3F7A; font-weight: 700; }
.phone-tabs button:hover { transform: none; box-shadow: none; }
@media (max-width: 1023px) {
  .cols { grid-template-columns: 1fr; }
  #rail { order: -1; }
}
@media (max-width: 800px) {
  .top { padding: 0; }
  .tabs, .window-chip, .who { display: none; }
  #view, .cols > main { padding: 0; }
  .status-grid { grid-template-columns: 1fr; }
  .grid-legend { display: none; }
  .phone-tabs { display: flex; }
  body { padding-bottom: 56px; }
  .sticky-submit { bottom: 56px; }
  .phase-bar { flex-direction: column; align-items: stretch; }
  .phase-bar .primary { width: 100%; margin-left: 0; }
}

.acting-as { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.acting-as select { min-height: 32px; }

.reconnect-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: #FFF4CE; color: #1D2040; border-bottom: 1px solid #C8A600; text-align: center; padding: 8px; font-weight: 600; }
.reconnect-banner[hidden] { display: none; }

.acting-as[hidden] { display: none; }
body.viewing-as .turn-banner { background: #5C2D91; }
.setup-link input { width: 100%; font-family: monospace; padding: 6px; }
.who .small { margin-left: 6px; }

/* MD act-as: persistent, unmistakable banner with one-click return. */
#act-as-banner { position: sticky; top: 0; z-index: 1000; background: #B42318; color: #fff; padding: 8px 14px; font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#act-as-banner button { background: #fff; color: #B42318; border: 0; border-radius: 6px; padding: 4px 12px; font-weight: 600; cursor: pointer; }
body.acting-as-on .top { border-top: 4px solid #B42318; }

/* Leave summary: one compact chip per day; a day cell never overflows. */
.shift-day, .grid-cell { min-width: 0; overflow: hidden; }
.grid-cell .grid-people, .grid-cell .grid-status, .grid-cell .grid-shift {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.leave-summary {
  display: inline-flex; align-items: center; gap: 3px;
  max-width: 100%; min-width: 0; align-self: flex-start;
  font-size: 10px; font-weight: 800; line-height: 1.2;
  padding: 1px 5px; border-radius: 4px; cursor: pointer;
  color: #1a2330; background: #fff; border: 1.5px dashed #1a2330;
  white-space: nowrap; overflow: hidden;
}
.leave-summary.approved { color: #fff; background: #1a2330; border-style: solid; }
.leave-summary-text { overflow: hidden; text-overflow: ellipsis; }
.grid-week-label .leave-summary { margin-top: 2px; }
.leave-popover {
  position: absolute; z-index: 60; background: #fff; color: #1a2330;
  border: 1px solid #8A8A8A; border-radius: 8px; padding: 8px 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: 13px;
}
.leave-popover ul { margin: 4px 0 0; padding-left: 16px; }
.leave-summary.full { border-color: #a4262c; box-shadow: inset 0 0 0 1px #a4262c; }
span.leave-summary.full { color: #a4262c; background: #fff; border-style: solid; cursor: default; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.inline-form label { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; }
.inline-confirm {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 72px; z-index: 80;
  width: min(560px, calc(100vw - 16px)); display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: #FFF4CE; color: #3b2a00; border: 1px solid #c19c00; border-left: 6px solid #c19c00;
  border-radius: 10px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 14px;
}
.inline-confirm-text { flex: 1 1 240px; font-weight: 600; }
.inline-confirm-actions { display: flex; gap: 6px; }

/* SPEC 78 Evenvue palette: indigo #3A3F7A primary, sky #7FA7E8 accent (decor only, never text on light),
   tint #ECEFFB, background #F7F8FC, ink #1D2040. Text pairs checked for WCAG AA (4.5:1). */
:root { --brand: #3A3F7A; --brand-sky: #7FA7E8; --brand-tint: #ECEFFB; }
.acting-as { color: #1D2040; font-weight: 600; }
body.role-admin .top .acting-as { color: #FFFFFF; }
.acting-as select { color: #1D2040; background: #FFFFFF; border: 1px solid #3A3F7A; border-radius: 4px; }
.badge.y { background: #ECEFFB; color: #3A3F7A; border-color: #3A3F7A; }
body.role-admin .top .badge.y { background: #7FA7E8; color: #1D2040; border-color: #7FA7E8; }

.email-badge { display: inline-block; background: #FFF1D6; color: #6B3D00; border: 1px solid #C98A1B; border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.email-cell input { width: 15em; max-width: 100%; }

.leave-summary.week-cont { opacity: .8; border-style: dashed; }
