/* ========================================================================== 
   Rota Done — Sol editor concept (only loaded with ?ui=sol)

   Visual thesis: a calm operations desk — dense, crisp and quietly tactile.
   The rota grid is the product; controls, staff context and labour data recede
   into supporting planes. Role colour is reserved for schedule information.
   ========================================================================== */

:root {
  /* Sol's tokens are now aliases onto the shared layer in
     static/css/tokens.css rather than a second set of literals. Before
     this, Sol carried its own palette and bridged onto --bg/--surface in
     its light block only, so the two systems agreed in one theme and not
     the other. There is one source of truth now, and no light/dark
     asymmetry to remember. Change a colour in tokens.css and both the
     editor and the rest of the site move together. */
  --sol-canvas: var(--bg);
  --sol-panel: var(--surface);
  --sol-raised: var(--surface2);
  --sol-cell: var(--surface3);
  --sol-line: var(--border);
  --sol-line-soft: var(--border-soft);
  --sol-ink: var(--text);
  --sol-muted: var(--muted);
  --sol-faint: var(--muted2);
  --sol-accent: var(--blue);
  --sol-accent-strong: var(--accent-strong);
  --sol-accent-wash: var(--accent-wash);
  --sol-brass: var(--gold);
  --sol-radius: var(--radius);
  --sol-shadow: var(--shadow);
}

body,
.app { background: var(--sol-canvas); color: var(--sol-ink); }

body { letter-spacing: -.004em; }

/* Typography is part of the product model: language is human, operational
   data is monospaced. This replaces the classic Inter/JetBrains/Playfair mix
   with one coherent family and its purpose-built mono companion. */
body,
body *,
body [class] {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
}

body :is(
  .wk-label,
  .wk-date-inp,
  .save-ind,
  .feas-badge,
  .sc-hrs,
  .sc-type,
  .staff-group-toggle,
  .staff-role-count,
  .tmpl-time,
  .wcount,
  .g-dh-hrs,
  .rh-meta,
  .chip-time,
  .os-chip-time,
  .g-task-time,
  .tkp-sub,
  .lab-val,
  .db-cost,
  .lab-target-inp,
  .rev-inp,
  .covers-pill,
  .bl-status,
  .sol-open-count,
  .sol-cov span,
  .sol-labour-glance b,
  .ct-val
) {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

/* Shell ------------------------------------------------------------------- */
.demo-banner {
  min-height: 34px;
  padding-block: 5px !important;
  background: var(--sol-accent-wash) !important;
  border-color: color-mix(in srgb, var(--sol-accent) 24%, transparent) !important;
  color: var(--sol-accent) !important;
}

.demo-banner a {
  background: var(--sol-accent) !important;
  border-radius: var(--sol-radius) !important;
}

.topbar {
  height: 54px;
  gap: 9px;
  padding-inline: 14px;
  background: color-mix(in srgb, var(--sol-panel) 94%, transparent);
  border-bottom: 1px solid var(--sol-line);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.sol-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}
.sol-brand-mark {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border-radius: 7px;
}
.sol-identity .tb-venue {
  flex: 1 1 auto;
  max-width: 190px;
}

.tb-wordmark {
  display: inline-flex;
  align-items: baseline;
  color: var(--sol-ink);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.065em;
}

.tb-wordmark .sol-word-rota { color: inherit; font-weight: 700; }
.tb-wordmark .sol-word-done { color: var(--sol-accent); font-weight: 700; }
.sol-word-terminal {
  width: 5px;
  height: 5px;
  margin-left: 4px;
  border-radius: 1px;
  background: var(--sol-brass);
  transform: translateY(-1px);
}

.tb-wordmark::after {
  content: none;
  display: none;
}

.tb-div { background: var(--sol-line); }
.tb-venue { color: var(--sol-muted); font-size: 13px; }

.tb-week {
  min-height: 34px;
  padding: 2px 5px;
  background: var(--sol-raised);
  border: 1px solid var(--sol-line);
  border-radius: var(--sol-radius);
  box-shadow: none;
}

.wk-btn {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  color: var(--sol-muted);
}

.wk-btn:hover { background: var(--sol-panel); color: var(--sol-ink); }
.wk-label { color: var(--sol-ink); font-size: 11px; }
.tb-actions { gap: 6px; }
.save-ind { color: var(--sol-faint); min-width: 70px; }

.btn-solve,
.btn-strict,
.btn-save2,
.btn-pub,
.btn-hist,
.tb-more,
.theme-toggle,
.bug-report-btn {
  min-height: 32px;
  border-radius: var(--sol-radius);
  box-shadow: none;
}

.btn-solve {
  padding-inline: 17px;
  background: var(--sol-accent) !important;
  border-color: var(--sol-accent) !important;
  color: #fff !important;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  letter-spacing: .04em;
}

.btn-solve:hover:not(:disabled) {
  background: var(--sol-accent-strong) !important;
}

.btn-strict,
.btn-save2,
.btn-pub,
.btn-hist,
.tb-more,
.bug-report-btn {
  background: transparent;
  border-color: var(--sol-line);
  color: var(--sol-muted);
}

.btn-save2:hover,
.btn-hist:hover:not(:disabled),
.tb-more:hover,
.tb-more.open {
  background: var(--sol-raised);
  border-color: color-mix(in srgb, var(--sol-muted) 45%, var(--sol-line));
  color: var(--sol-ink);
  box-shadow: none;
}

.btn-pub.ready,
.btn-pub.published { color: var(--green); }
.theme-toggle { border-color: var(--sol-line); color: var(--sol-muted); }
.tb-email, .signout-btn { color: var(--sol-faint); }

/* Staff context ----------------------------------------------------------- */
.sidebar {
  width: 232px;
  background: var(--sol-panel);
  border-right: 1px solid var(--sol-line);
}

.sb-sect { padding: 10px 12px; border-color: var(--sol-line); }
.sb-head { color: var(--sol-faint); font-size: 9px; letter-spacing: .09em; }

.sb-head button {
  padding: 3px 7px;
  background: transparent;
  border-color: var(--sol-line);
  border-radius: 5px;
  color: var(--sol-accent);
}

.sb-badge {
  padding: 1px 6px;
  background: var(--sol-raised);
  border-radius: 999px;
  color: var(--sol-muted);
}

.role-chips { gap: 5px; }
.role-chip { padding: 3px 7px; border-radius: 3px; }
.staff-tools { padding: 7px 10px; border-color: var(--sol-line); }
.staff-group-toggle { border-color: var(--sol-line); border-radius: 5px; }
.staff-list { gap: 1px; padding: 5px 7px; }

.staff-card {
  min-height: 43px;
  padding: 7px 8px 7px 11px;
  background: transparent;
  border-color: transparent;
  border-radius: 2px;
}

.staff-card::before { width: 2px; border-radius: 2px; opacity: .85; }
.staff-card:hover {
  background: var(--sol-raised);
  border-color: var(--sol-line-soft);
  transform: none;
}

.sc-name { margin-bottom: 2px; color: var(--sol-ink); font-size: 12px; }
.sc-hrs, .sc-type { color: var(--sol-faint); }
.staff-role-head { color: var(--sol-muted); }
.sb-footer { padding: 9px 12px; border-color: var(--sol-line); }
.tmpl-item { background: var(--sol-raised); border-color: var(--sol-line); }

/* Week controls ----------------------------------------------------------- */
.week-tabs {
  min-height: 38px;
  padding: 5px 12px;
  background: var(--sol-panel);
  border-color: var(--sol-line);
}

.wtab,
.wcount,
.wdup-btn {
  border-color: transparent;
  border-radius: 3px;
  color: var(--sol-muted);
}

.wtab.active,
.wcount.active {
  background: var(--sol-accent-wash);
  border-color: transparent;
  color: var(--sol-accent);
}

.wcount:hover,
.wdup-btn:hover,
.wtab:hover { background: var(--sol-raised); border-color: transparent; color: var(--sol-ink); }
.wtab-weeks-lbl { color: var(--sol-faint); }
.prog-strip { background: var(--sol-line-soft); }
.prog-fill {
  position: relative;
  height: 2px;
  background: var(--sol-accent);
}
.prog-fill::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  width: 5px;
  height: 5px;
  border: 1px solid var(--sol-panel);
  border-radius: 1px;
  background: var(--sol-brass);
  transform: translateY(-50%);
}

/* The rota --------------------------------------------------------------- */
.grid-wrap {
  background: var(--sol-cell);
  scrollbar-color: var(--sol-line) transparent;
}

.gt { background: var(--sol-cell); }

.g-corner,
.g-dh {
  height: 62px;
  padding: 9px 11px;
  background: var(--sol-panel);
  border-right: 1px solid var(--sol-line);
  border-bottom: 1px solid var(--sol-line);
}

.g-corner { min-width: 156px; }
.g-dh { min-width: 148px; overflow: hidden; }
.g-dh-day { color: var(--sol-muted); font-size: 9px; letter-spacing: .08em; }
.g-dh-num { margin-top: 2px; color: var(--sol-ink); font-size: 19px; font-weight: 650; }
.g-dh.today .g-dh-num { color: var(--sol-accent); }
.g-dh-hrs { color: var(--sol-faint); font-size: 9px; }

.sol-cov {
  position: absolute;
  right: 10px;
  bottom: 9px;
  left: 48px;
  height: 21px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--sol-accent);
  opacity: .82;
}

/* width:100% on a flex child makes the sparkline claim the whole row and
   push the max-value label out past the column edge, where it gets clipped.
   Let it flex instead, and let the label keep its own space. */
.sol-cov svg { flex: 1 1 auto; min-width: 0; height: 20px; overflow: visible; }
.sol-cov span {
  flex: 0 0 auto;
  min-width: 12px;
  color: var(--sol-faint);
  font: 500 8px/1 'IBM Plex Mono', monospace;
  text-align: right;
}
.sol-cov-area { fill: currentColor; opacity: .11; }
.sol-cov-line { fill: none; stroke: currentColor; stroke-width: 1.35; vector-effect: non-scaling-stroke; }
.sol-cov-peak { fill: var(--sol-brass); stroke: var(--sol-panel); stroke-width: .7; vector-effect: non-scaling-stroke; }
.sol-cov-zero { stroke: var(--sol-line); stroke-width: 1; stroke-dasharray: 2 3; }
.sol-cov-empty { opacity: .5; }

.g-rh,
.g-role-row td,
.g-os-h,
.g-tasks-h,
.g-ua-h {
  min-width: 156px;
  padding-inline: 11px;
  background: var(--sol-panel);
  border-color: var(--sol-line);
}

.g-cell,
.g-os-c,
.g-tasks-c,
.g-ua-c {
  min-width: 148px;
  background: var(--sol-cell);
  border-right: 1px solid var(--sol-line-soft);
  border-bottom: 1px solid var(--sol-line-soft);
}

.g-cell { min-height: 58px; padding: 4px; }
.g-cell.weekend { background: color-mix(in srgb, var(--sol-raised) 20%, var(--sol-cell)); }
.g-cell.today-col { background: var(--sol-accent-wash); }
.g-cell:hover { background: color-mix(in srgb, var(--sol-accent) 5%, var(--sol-cell)); }
.rh-name { max-width: 103px; color: var(--sol-ink); font-size: 12px; }
.rh-meta { color: var(--sol-faint); font-size: 9px; }
.rh-bar { width: 2px; height: 30px; }
.g-role-divider, .g-os-label, .g-tasks-label { color: var(--sol-muted); }

/* Open shifts remain available without swallowing the schedule. */
.g-os-h,
.g-os-c { height: 116px; vertical-align: top; }

.sol-open-empty .g-os-h,
.sol-open-empty .g-os-c { height: 44px; }
.sol-open-empty .sol-open-stack { max-height: 32px; mask-image: none; }

.g-os-h { background: color-mix(in srgb, var(--sol-accent) 4%, var(--sol-panel)); }
.g-os-c { padding: 5px; background: color-mix(in srgb, var(--sol-accent) 2%, var(--sol-cell)); }
.sol-open-stack {
  max-height: 104px;
  overflow-y: auto;
  padding: 0 3px 0 0;
  scrollbar-width: thin;
  scrollbar-color: var(--sol-line) transparent;
  mask-image: none;
}

.sol-open-count {
  display: inline;
  min-width: 0;
  height: auto;
  margin-left: 5px;
  padding: 0;
  background: transparent;
  color: var(--sol-muted);
  font: 600 9px/1 'IBM Plex Mono', monospace;
  letter-spacing: 0;
}

.os-chip,
.ghost-chip {
  min-height: 27px;
  padding: 4px 6px !important;
  background: color-mix(in srgb, currentColor 7%, var(--sol-raised)) !important;
  border-color: color-mix(in srgb, currentColor 22%, var(--sol-line)) !important;
  border-left-width: 2px !important;
  border-radius: 3px !important;
}

.os-chip-name { color: var(--sol-ink); font-size: 10px; }
.os-chip-time { margin-left: auto; color: var(--sol-muted); font-size: 8.5px; }
.os-chip-dot { display: none; }
.os-chip { opacity: 1; }
.ghost-chip { opacity: .72; }
.os-chip-x { opacity: 0; }
.os-chip:hover .os-chip-x { opacity: .75; }

.chip {
  max-width: 150px;
  margin: 2px;
  padding: 5px 7px !important;
  gap: 1px;
  background: color-mix(in srgb, currentColor 8%, var(--sol-raised)) !important;
  border-color: color-mix(in srgb, currentColor 24%, var(--sol-line)) !important;
  border-left-width: 2px !important;
  border-radius: 3px !important;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.chip:hover {
  border-color: color-mix(in srgb, currentColor 48%, var(--sol-line)) !important;
  box-shadow: none;
  filter: none;
}

.chip-time { color: var(--sol-muted); font-size: 9px; opacity: 1; }
.chip-lbl { color: var(--sol-ink); font-size: 10.5px; }
.chip-x { opacity: 0; transform: scale(.9); }
.chip:hover .chip-x { opacity: .85; transform: scale(1); }
.chip-lock { opacity: 0; }
.chip.locked .chip-lock { opacity: 1; }
.chip.locked { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sol-brass) 46%, transparent); }
.add-btn { border-color: var(--sol-line); color: var(--sol-faint); }

/* Labour strip ------------------------------------------------------------ */
.bot {
  position: relative;
  max-height: min(32vh, 238px);
  background: var(--sol-panel);
  border-color: var(--sol-line);
  transition: max-height .25s ease;
}

.bot.collapsed { max-height: 34px; }
.bot-hdr { height: 34px; padding-inline: 14px; }
.bot-title { color: var(--sol-muted); font-size: 9px; letter-spacing: .08em; }
.bot-hdr-extras { padding-inline: 14px !important; }
.bot-body { min-height: 78px; padding: 5px 14px 10px; gap: 15px; }
.lab-val { color: var(--sol-ink); font-size: 18px; }
.lab-lbl, .db-lbl, .db-cost { color: var(--sol-faint); }
.day-bars { height: 58px; }
.db-bar { background: var(--sol-accent); opacity: .72; }
.baseline-bar { border-color: var(--sol-line); }

/* Panels and controls ----------------------------------------------------- */
.modal,
.tool-panel,
.tkp-body,
.fr-guide,
.wdup-menu,
.tb-menu,
.ct-card {
  background: var(--sol-panel);
  border-color: var(--sol-line);
  border-radius: 6px;
  box-shadow: var(--sol-shadow);
}

.mbg { background: rgba(6, 8, 13, .62); }
.m-title { color: var(--sol-ink); }
.m-hdr { border-color: var(--sol-line); }
.tmpl-item, .tool-record, .hre-card, .abs-req, .tkp-card, .g-task-card {
  background: var(--sol-raised);
  border-color: var(--sol-line);
  border-radius: var(--sol-radius);
}

input,
select,
textarea,
.tkp-input,
.sf-req-input,
.rev-inp,
.covers-inp,
.wk-date-inp {
  background: var(--sol-cell) !important;
  border-color: var(--sol-line) !important;
  border-radius: var(--sol-radius) !important;
  color: var(--sol-ink) !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sol-accent) !important;
  box-shadow: 0 0 0 3px var(--sol-accent-wash) !important;
}

.toast2 { background: var(--sol-panel); border-color: var(--sol-line); border-radius: 4px; }

/* Sol composition ---------------------------------------------------------
   The schedule owns the left edge. The team controls become a right-hand
   drawer, resolving the old double column of staff names before the rota. */
.app { flex-direction: row; }
.app { position: relative; }
.main { order: 1; width: 100%; }
.sidebar {
  order: 2;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 46;
  width: 286px;
  height: 100%;
  border-right: 0;
  border-left: 1px solid var(--sol-line);
  box-shadow: none;
  transform: translateX(0);
  transition: transform .18s ease;
}
.sidebar.collapsed {
  width: 286px;
  transform: translateX(100%);
  pointer-events: none;
}
body:not(.sol-ready) .sidebar { transform: translateX(100%); }

.sb-restore {
  position: static;
  width: auto;
  height: 32px;
  padding: 0 10px;
  border-radius: 4px;
  background: #181c25;
  border-color: #303642;
  color: #b2b8c3;
  box-shadow: none;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .01em;
}
body.has-demo-banner .sb-restore { top: auto; }

.sol-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 45px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--sol-line);
  color: var(--sol-ink);
  font-size: 12px;
  font-weight: 700;
}
.sol-drawer-head button {
  padding: 5px 7px;
  border: 0;
  background: transparent;
  color: var(--sol-muted);
  font: 500 11px/1 'IBM Plex Sans', sans-serif;
  cursor: pointer;
}
.sol-drawer-head button:hover { color: var(--sol-ink); }

.sol-staff-search {
  flex-shrink: 0;
  padding: 8px 9px 5px;
}
.sol-staff-search input {
  height: 31px;
  padding: 6px 8px !important;
  border-radius: 3px !important;
  font-size: 11px;
}
.staff-card[hidden],
.staff-role-group[hidden] { display: none !important; }

.sol-history-group,
.sol-build-group,
.sol-commit-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.sol-history-group {
  padding-inline: 4px;
  border-inline: 1px solid #2b303b;
}

/* A dark command deck frames both themes and makes the working canvas feel
   like a dedicated planning surface rather than the classic site shell. */
.topbar {
  height: 62px;
  padding-inline: 15px;
  background: #12151d;
  border-bottom-color: #282d38;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .025);
}

.topbar .tb-wordmark,
.topbar .tb-venue { color: #f5f6f8; }
.topbar .tb-venue { opacity: .68; }
.topbar .tb-div { background: #303541; }
.topbar .tb-wordmark .sol-word-rota { color: #f5f6f8; }
.topbar .tb-wordmark .sol-word-done { color: #8098ff; }
.topbar .tb-wordmark::after { color: #9eafff; border-color: #485a9e; }
.topbar .tb-week {
  display: grid;
  grid-template-columns: 30px minmax(118px, 1fr) 30px;
  gap: 2px;
  min-width: 214px;
  min-height: 42px;
  padding: 3px;
  background: #191d26;
  border-color: #343a46;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}
.sol-week-center {
  display: grid;
  grid-template-rows: 10px 20px;
  align-content: center;
  min-width: 0;
  text-align: center;
}
.sol-week-kicker {
  color: #9a845c;
  font-size: 7px;
  font-weight: 700;
  line-height: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.topbar .wk-label { color: #f4f5f7; }
.topbar .wk-label {
  width: auto;
  min-width: 0;
  padding: 0 3px;
  font-size: 10.5px;
  line-height: 20px;
}
.topbar .wk-btn {
  width: 30px;
  height: 34px;
  align-self: center;
  border-radius: 2px;
  color: #8992a3;
}
.topbar .wk-btn:hover { color: #fff; background: #282e3a; }
.topbar .wk-date-inp {
  grid-row: 2;
  width: 100%;
  min-width: 0;
  height: 20px;
  padding: 0 3px !important;
  font-size: 10px;
}
.topbar .theme-toggle,
.topbar .btn-save2,
.topbar .btn-hist,
.topbar .tb-more,
.topbar .bug-report-btn,
.topbar .btn-pub {
  background: #181c25;
  border-color: #303642;
  color: #a2a9b6;
}
.topbar .btn-save2:hover,
.topbar .btn-hist:hover:not(:disabled),
.topbar .tb-more:hover,
.topbar .tb-more.open {
  background: #242a35;
  border-color: #3c4351;
  color: #fff;
}
.topbar .btn-pub.ready,
.topbar .btn-pub.published {
  background: rgba(42, 180, 105, .09);
  border-color: rgba(42, 180, 105, .42);
  color: #66d89a;
}
.topbar .btn-strict {
  background: rgba(235, 174, 52, .07);
  border-color: rgba(235, 174, 52, .34);
  color: #e9b849;
}
.topbar .save-ind.ok { color: #66d89a; }
.topbar .tb-email,
.topbar .signout-btn { color: #737c8d; }

.topbar .theme-toggle,
.topbar .btn-save2,
.topbar .btn-strict,
.topbar .btn-solve,
.topbar .btn-pub,
.topbar .btn-hist,
.topbar .bug-report-btn,
.topbar .tb-more,
.topbar .sb-restore {
  height: 34px;
  min-height: 34px;
}
.topbar .btn-save2,
.topbar .btn-strict,
.topbar .btn-solve,
.topbar .btn-pub,
.topbar .bug-report-btn,
.topbar .sb-restore { padding-inline: 11px; }
.topbar .theme-toggle,
.topbar .btn-hist,
.topbar .tb-more { width: 34px; }

/* Assigned work is a schedule block, not a floating tag. */
.g-cell > .chip:not(.ghost-chip) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: calc(100% - 4px);
  max-width: none;
  min-width: 0;
  min-height: 31px;
  padding: 6px 7px !important;
  column-gap: 6px;
}
.g-cell > .chip:not(.ghost-chip) .chip-lbl {
  grid-column: 1;
  grid-row: 1;
  width: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-cell > .chip:not(.ghost-chip) .chip-time {
  grid-column: 2;
  grid-row: 1;
  font-size: 8px;
}

/* Editorial day mastheads: big date, tiny metrics and an embedded 24h curve. */
.g-corner,
.g-dh {
  height: 72px;
  padding: 10px 12px;
}
.g-corner::after {
  content: 'Schedule';
  display: block;
  margin-top: 10px;
  color: var(--sol-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.g-corner .sb-toggle {
  width: auto;
  min-width: 42px;
  padding: 0 7px;
  font-size: 10px;
  font-weight: 650;
}
.g-dh { border-top: 3px solid transparent; }
.g-dh.today { border-top-color: var(--sol-accent); }
.g-dh.today::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 10px;
  width: 7px;
  height: 3px;
  background: var(--sol-brass);
}
.g-dh-day { font-size: 9px; letter-spacing: .12em; }
.g-dh-num {
  margin-top: 3px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.06em;
}
.g-dh-hrs { font-size: 8.5px; }
.sol-cov { left: 53px; bottom: 11px; }

.week-tabs {
  min-height: 43px;
  padding-inline: 13px;
  background: var(--sol-cell);
}
.wtab {
  padding-inline: 10px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
}
.wtab.active {
  position: relative;
  background: transparent;
  border-color: var(--sol-accent);
  color: var(--sol-ink);
}
.wtab.active::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -2px;
  width: 4px;
  height: 4px;
  background: var(--sol-brass);
}
.wtab:hover { border-radius: 5px; }

html.rd-light-mode .grid-wrap,
html.rd-light-mode .gt { background: #fffefa; }
html.rd-light-mode .g-corner,
html.rd-light-mode .g-dh,
html.rd-light-mode .g-rh,
html.rd-light-mode .g-role-row td,
html.rd-light-mode .g-os-h,
html.rd-light-mode .g-tasks-h,
html.rd-light-mode .g-ua-h { background: #f6f4ef !important; }
html.rd-light-mode .g-cell,
html.rd-light-mode .g-os-c,
html.rd-light-mode .g-tasks-c,
html.rd-light-mode .g-ua-c { background: #fffefa; }
html.rd-light-mode .g-cell.weekend { background: #faf8f3; }
html.rd-light-mode .g-cell.today-col { background: #f5f7ff; }
html.rd-light-mode .g-cell.unavail {
  background: repeating-linear-gradient(45deg,#fffefa,#fffefa 5px,#f3f1eb 5px,#f3f1eb 10px);
}

/* Light mode is light all the way through the secondary workspace. */
html.rd-light-mode .sidebar {
  background: #f8f7f3;
  border-left-color: #d8d5ce;
  box-shadow: none;
}
html.rd-light-mode .sidebar .sb-sect,
html.rd-light-mode .sidebar .staff-tools,
html.rd-light-mode .sidebar .sb-footer { border-color: #d8d5ce; }
html.rd-light-mode .sidebar .sol-drawer-head {
  border-color: #d8d5ce;
  color: #191b22;
}
html.rd-light-mode .sidebar .sol-drawer-head button { color: #666b75; }
html.rd-light-mode .sidebar .sol-drawer-head button:hover { color: #315bea; }
html.rd-light-mode .sidebar .sol-staff-search input {
  background: #fffefa !important;
  border-color: #d2cfc7 !important;
  color: #191b22 !important;
}
html.rd-light-mode .sidebar .sb-head,
html.rd-light-mode .sidebar .staff-tool-label,
html.rd-light-mode .sidebar .tmpl-toggle-row span { color: #70747c; }
html.rd-light-mode .sidebar .sb-head button,
html.rd-light-mode .sidebar .staff-group-toggle {
  background: #fffefa;
  border-color: #d2cfc7;
  color: #315bea;
}
html.rd-light-mode .sidebar .sb-badge,
html.rd-light-mode .sidebar .sc-type {
  background: #ebe9e3;
  border-color: #d8d5ce;
  color: #686d76;
}
html.rd-light-mode .sidebar .staff-card {
  background: transparent;
  border-color: transparent;
}
html.rd-light-mode .sidebar .staff-card:hover {
  background: #eeece6;
  border-color: #dedbd4;
  transform: none;
}
html.rd-light-mode .sidebar .sc-name { color: #191b22; }
html.rd-light-mode .sidebar .sc-hrs,
html.rd-light-mode .sidebar .sc-type,
html.rd-light-mode .sidebar .staff-role-head { color: #777b83; }
html.rd-light-mode .sidebar .tmpl-item {
  background: #fffefa;
  border-color: #d8d5ce;
  color: #191b22;
}

/* Make shift blocks read like marks on the rota rather than mini windows. */
html.rd-light-mode .chip,
html.rd-light-mode .os-chip,
html.rd-light-mode .ghost-chip {
  box-shadow: none;
}
.chip { min-width: 70px; }
.chip-time { font-weight: 500; }
.chip-lbl { font-weight: 700; letter-spacing: -.015em; }

/* Labour is an inspector, not a permanent dashboard. */
.bot.collapsed {
  max-height: 32px;
  background: var(--sol-panel);
  border-color: var(--sol-line);
}
.bot.collapsed .bot-hdr { height: 32px; }
.bot.collapsed .bot-title,
.bot.collapsed .bot-arrow { color: var(--sol-muted); }

.sol-labour-glance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 auto;
  color: var(--sol-faint);
  font: 500 9px/1 'IBM Plex Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.sol-labour-glance span { white-space: nowrap; }
.sol-labour-glance b {
  margin-right: 3px;
  color: var(--sol-ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.sol-labour-glance b.pct-ok { color: var(--green); }
.sol-labour-glance b.pct-warn { color: var(--amber); }
.sol-labour-glance b.pct-over { color: var(--red); }
.bot:not(.collapsed) .sol-labour-glance { visibility: hidden; }

.bot:not(.collapsed) {
  height: var(--sol-labour-height, 380px);
  min-height: 176px;
  max-height: 72vh;
}
.bot.collapsed { height: 32px; min-height: 32px; }
.bot:not(.collapsed) .bot-body {
  align-content: flex-start;
}
.sol-labour-resizer {
  position: absolute;
  top: -5px;
  right: 0;
  left: 0;
  z-index: 8;
  height: 10px;
  cursor: ns-resize;
  touch-action: none;
}
.sol-labour-resizer::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 0;
  left: 0;
  height: 1px;
  background: transparent;
}
.sol-labour-resizer:hover::after,
.sol-labour-resizer:focus-visible::after,
.sol-resizing-labour .sol-labour-resizer::after { background: var(--sol-accent); }
.sol-labour-resizer:focus-visible { outline: none; }
.bot.collapsed .sol-labour-resizer { display: none; }
.sol-resizing-labour,
.sol-resizing-labour * {
  cursor: ns-resize !important;
  user-select: none !important;
}
.sol-resizing-labour .bot { transition: none; }

/* Classic's light-mode selectors are more specific than ordinary component
   rules. This block explicitly owns the complete light command deck. */
html.rd-light-mode body .topbar {
  background: #fbfaf7;
  border-color: #d8d5ce;
  box-shadow: 0 1px 0 rgba(25,27,34,.04);
  color: #191b22;
}
html.rd-light-mode body .topbar .sol-brand-mark {
  background: transparent;
  border: 0;
}
html.rd-light-mode body .topbar .tb-wordmark,
html.rd-light-mode body .topbar .tb-wordmark .sol-word-rota { color: #171920; }
html.rd-light-mode body .topbar .tb-wordmark .sol-word-done { color: #315bea; }
html.rd-light-mode body .topbar .sol-word-terminal { background: #9a7440; }
html.rd-light-mode body .topbar .tb-venue { color: #606671; opacity: 1; }
html.rd-light-mode body .topbar .tb-div { background: #d8d5ce; }
html.rd-light-mode body .topbar .tb-week {
  background: #eeece6;
  border-color: #d6d2ca;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
html.rd-light-mode body .topbar .sol-week-kicker { color: #8f6a36; }
html.rd-light-mode body .topbar .wk-label { color: #20232b; }
html.rd-light-mode body .topbar .wk-btn {
  background: transparent;
  border-color: transparent;
  color: #69707c;
}
html.rd-light-mode body .topbar .wk-btn:hover {
  background: #fffefa;
  border-color: transparent;
  color: #315bea;
}
html.rd-light-mode body .topbar .wk-date-inp {
  background: #fffefa !important;
  border-color: #c9c5bd !important;
  color: #20232b !important;
}
html.rd-light-mode body .topbar .sol-history-group { border-color: #d8d5ce; }
html.rd-light-mode body .topbar :is(
  .theme-toggle,
  .btn-save2,
  .btn-hist,
  .tb-more,
  .bug-report-btn,
  .sb-restore,
  .btn-pub
) {
  background: #fffefa;
  border-color: #d6d2ca;
  color: #525965;
  box-shadow: none;
}
html.rd-light-mode body .topbar :is(
  .theme-toggle,
  .btn-save2,
  .btn-hist,
  .tb-more,
  .bug-report-btn,
  .sb-restore
):hover {
  background: #eef1ff;
  border-color: #b9c4f2;
  color: #315bea;
  box-shadow: none;
}
html.rd-light-mode body .topbar .btn-solve,
html.rd-light-mode body .topbar .btn-solve:hover,
html.rd-light-mode body .topbar .btn-solve.solving {
  background: var(--sol-accent) !important;
  border-color: var(--sol-accent) !important;
  color: #fff !important;
  box-shadow: none;
}
html.rd-light-mode body .topbar .btn-solve:hover { background: var(--sol-accent-strong) !important; }
html.rd-light-mode body .topbar .btn-strict {
  background: #f6efe3;
  border-color: #d8c39f;
  color: #805d2d;
}
html.rd-light-mode body .topbar .btn-strict:hover,
html.rd-light-mode body .topbar .btn-strict.on {
  background: #efe2cc;
  border-color: #b9945c;
  color: #68491f;
}
html.rd-light-mode body .topbar .btn-pub.ready,
html.rd-light-mode body .topbar .btn-pub.published,
html.rd-light-mode body .topbar .btn-pub.ready:hover {
  background: #edf8f1;
  border-color: #9dcdae;
  color: #19733c;
}
html.rd-light-mode body .topbar .btn-hist:disabled { color: #a5a8ad; opacity: .6; }
html.rd-light-mode body .topbar .save-ind { color: #777d86; }
html.rd-light-mode body .topbar .save-ind.ok { color: #19733c; }
html.rd-light-mode body .topbar .save-ind.err { color: #bb3d37; }
html.rd-light-mode body .topbar .tb-email,
html.rd-light-mode body .topbar .signout-btn { color: #747a84; }
html.rd-light-mode body .topbar .signout-btn:hover { color: #20232b; }
html.rd-light-mode body .topbar .tb-menu {
  background: #fffefa;
  border-color: #d6d2ca;
  box-shadow: 0 18px 46px rgba(30,33,41,.15);
}
html.rd-light-mode body .topbar .tb-menu button { color: #2b2e36; }
html.rd-light-mode body .topbar .tb-menu button:hover { background: #eeece6; color: #315bea; }
html.rd-light-mode body .topbar .tb-menu small { color: #7c818a; }

/* Command centre ---------------------------------------------------------
   The visible toolbar stays task-led; the complete editor is one keystroke
   away. This is additive and invokes the editor's existing commands. */
.sol-command-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 9px;
  flex: 0 0 auto;
  background: #181c25;
  border: 1px solid #303642;
  border-radius: 4px;
  color: #a2a9b6;
  font: 600 10px/1 'IBM Plex Sans', sans-serif;
  letter-spacing: .015em;
  cursor: pointer;
}
.sol-command-trigger svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: square;
}
.sol-command-trigger kbd {
  min-width: 27px;
  padding: 3px 4px;
  background: #10131a;
  border: 1px solid #353b47;
  border-radius: 2px;
  color: #777f8e;
  font: 500 8px/1 'IBM Plex Mono', monospace;
  text-align: center;
}
.sol-command-trigger:hover,
.sol-command-trigger[aria-expanded='true'] {
  background: #242a35;
  border-color: #4b587d;
  color: #fff;
}

.sol-command[hidden] { display: none; }
.sol-command {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: start center;
  padding: clamp(72px, 11vh, 124px) 18px 24px;
}
.sol-command-shade {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 11, .68);
  opacity: 0;
  transition: opacity .15s ease;
}
.sol-command-panel {
  position: relative;
  width: min(680px, calc(100vw - 36px));
  max-height: min(670px, calc(100vh - 110px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #151922;
  border: 1px solid #39404d;
  border-top: 2px solid var(--sol-accent);
  border-radius: 5px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, .52);
  opacity: 0;
  transform: translateY(-8px) scale(.99);
  transition: opacity .15s ease, transform .15s ease;
}
.sol-command-panel::before {
  content: '';
  position: absolute;
  top: -2px;
  right: 42px;
  width: 26px;
  height: 2px;
  background: var(--sol-brass);
}
.sol-command.open .sol-command-shade { opacity: 1; }
.sol-command.open .sol-command-panel { opacity: 1; transform: translateY(0) scale(1); }
.sol-command-open { overflow: hidden; }

.sol-command-head {
  min-height: 58px;
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 0 17px;
  border-bottom: 1px solid #2b313c;
}
.sol-command-index {
  color: var(--sol-brass);
  font: 600 8px/1 'IBM Plex Mono', monospace;
  letter-spacing: .1em;
}
.sol-command-head h2 {
  margin: 0;
  color: #f2f4f7;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.025em;
}
.sol-command-head button {
  padding: 5px 7px;
  background: #1d222c;
  border: 1px solid #343b48;
  border-radius: 3px;
  color: #7f8898;
  font: 500 8px/1 'IBM Plex Mono', monospace;
  cursor: pointer;
}
.sol-command-head button:hover { color: #fff; border-color: #4a5362; }

.sol-command-search {
  min-height: 58px;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  border-bottom: 1px solid #2b313c;
  color: #778194;
}
.sol-command-search svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.sol-command-search input {
  width: 100%;
  height: 56px;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #f5f6f8 !important;
  font: 500 16px/1 'IBM Plex Sans', sans-serif;
  letter-spacing: -.025em;
  outline: 0;
}
.sol-command-search input::placeholder { color: #626b7b; }
.sol-command-list {
  min-height: 156px;
  overflow-y: auto;
  padding: 7px;
  scrollbar-width: thin;
  scrollbar-color: #363d49 transparent;
}
.sol-command-option {
  width: 100%;
  min-height: 53px;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 14px;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #a7afbd;
  text-align: left;
  cursor: pointer;
}
.sol-command-option.active {
  background: #202631;
  border-color: #303947;
  color: #fff;
}
.sol-command-option.active::before {
  content: '';
  position: absolute;
  left: 7px;
  width: 2px;
  height: 21px;
  background: var(--sol-accent);
}
.sol-command-option { position: relative; }
.sol-command-group {
  color: #687284;
  font: 600 8px/1 'IBM Plex Mono', monospace;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.sol-command-option.active .sol-command-group { color: #8fa3ff; }
.sol-command-copy { min-width: 0; display: grid; gap: 3px; }
.sol-command-copy b {
  overflow: hidden;
  color: inherit;
  font-size: 12px;
  font-weight: 620;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sol-command-copy small {
  overflow: hidden;
  color: #747d8d;
  font-size: 10px;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sol-command-option kbd,
.sol-command-arrow {
  justify-self: end;
  color: #697385;
  font: 500 8px/1 'IBM Plex Mono', monospace;
}
.sol-command-option kbd {
  min-width: 30px;
  padding: 4px 5px;
  border: 1px solid #343c49;
  border-radius: 2px;
  text-align: center;
}
.sol-command-option.active kbd { border-color: #4b5770; color: #b8c2d4; }
.sol-command-empty {
  min-height: 156px;
  display: grid;
  place-content: center;
  gap: 5px;
  color: #8e97a6;
  text-align: center;
}
.sol-command-empty b { color: #d9dde4; font-size: 12px; }
.sol-command-empty span { font-size: 10px; }
.sol-command-foot {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 17px;
  border-top: 1px solid #2b313c;
  color: #697283;
  font-size: 9px;
}
.sol-command-foot span:last-child { margin-left: auto; }
.sol-command-foot kbd {
  margin-right: 3px;
  color: #a5adbb;
  font: 500 8px/1 'IBM Plex Mono', monospace;
}

/* Tactical grid tracing. It reduces eye travel across a wide week without
   obscuring availability, today, drag or role colour states. */
.gt :is(.g-dh, .g-cell, .g-os-c, .g-tasks-c, .g-ua-c).sol-col-focus {
  box-shadow: inset 1px 0 color-mix(in srgb, var(--sol-accent) 24%, transparent),
              inset -1px 0 color-mix(in srgb, var(--sol-accent) 24%, transparent);
}
.gt .g-dh.sol-col-focus {
  box-shadow: inset 0 -2px var(--sol-accent),
              inset 1px 0 color-mix(in srgb, var(--sol-accent) 24%, transparent),
              inset -1px 0 color-mix(in srgb, var(--sol-accent) 24%, transparent);
}
.gt tr.sol-row-focus > :is(.g-rh, .g-cell) {
  box-shadow: inset 0 1px color-mix(in srgb, var(--sol-brass) 34%, transparent),
              inset 0 -1px color-mix(in srgb, var(--sol-brass) 34%, transparent);
}
.gt tr.sol-row-focus > .g-rh .rh-name { color: var(--sol-brass); }

html.rd-light-mode body .topbar .sol-command-trigger {
  background: #fffefa;
  border-color: #d6d2ca;
  color: #525965;
}
html.rd-light-mode body .topbar .sol-command-trigger kbd {
  background: #eeece6;
  border-color: #d4d0c7;
  color: #737983;
}
html.rd-light-mode body .topbar .sol-command-trigger:hover,
html.rd-light-mode body .topbar .sol-command-trigger[aria-expanded='true'] {
  background: #eef1ff;
  border-color: #b9c4f2;
  color: #315bea;
}
html.rd-light-mode .sol-command-shade { background: rgba(25, 27, 34, .32); }
html.rd-light-mode .sol-command-panel {
  background: #fbfaf7;
  border-color: #c9c5bd;
  border-top-color: #315bea;
  box-shadow: 0 32px 80px rgba(30, 33, 41, .22);
}
html.rd-light-mode .sol-command-head,
html.rd-light-mode .sol-command-search { border-color: #dedbd4; }
html.rd-light-mode .sol-command-head h2 { color: #191b22; }
html.rd-light-mode .sol-command-head button {
  background: #eeece6;
  border-color: #d4d0c7;
  color: #666b75;
}
html.rd-light-mode .sol-command-search { color: #747a84; }
html.rd-light-mode .sol-command-search input { color: #191b22 !important; }
html.rd-light-mode .sol-command-search input::placeholder { color: #8b8e94; }
html.rd-light-mode .sol-command-option { color: #353943; }
html.rd-light-mode .sol-command-option.active {
  background: #eceffc;
  border-color: #d2d9f5;
  color: #182454;
}
html.rd-light-mode .sol-command-option.active .sol-command-group { color: #315bea; }
html.rd-light-mode .sol-command-copy small,
html.rd-light-mode .sol-command-group { color: #777c85; }
html.rd-light-mode .sol-command-option kbd { border-color: #d2cec6; color: #737983; }
html.rd-light-mode .sol-command-empty b { color: #272a32; }
html.rd-light-mode .sol-command-empty { color: #737983; }
html.rd-light-mode .sol-command-foot { border-color: #dedbd4; color: #777c85; }
html.rd-light-mode .sol-command-foot kbd { color: #4f5560; }

@media (max-width: 1240px) {
  .sol-command-trigger span { display: none; }
}
@media (max-width: 1080px) {
  .sol-command-trigger { width: 34px; padding: 0; justify-content: center; }
  .sol-command-trigger kbd { display: none; }
}
@media (max-width: 900px) {
  .sol-command-trigger { display: none; }
}
@media (max-width: 620px) {
  .sol-command { padding: 54px 8px 8px; }
  .sol-command-panel { width: calc(100vw - 16px); max-height: calc(100vh - 62px); }
  .sol-command-head,
  .sol-command-option { grid-template-columns: 54px minmax(0, 1fr) 40px; gap: 8px; }
  .sol-command-foot span:last-child { display: none; }
}

/* Keep routine editor state changes immediate. The only motion left is the
   existing modal/menu feedback where movement explains layer changes. */
.sol-ready .topbar,
.sol-ready .sidebar { animation: none; }
.chip { animation: none; }

@media (max-width: 1080px) {
  .sidebar,
  .sidebar.collapsed { width: 270px; }
  .sol-identity { min-width: 145px; }
  .sol-identity .tb-venue,
  .sol-identity .tb-div { display: none; }
  .g-corner, .g-rh, .g-role-row td, .g-os-h, .g-tasks-h, .g-ua-h { min-width: 148px; }
  .g-dh, .g-cell, .g-os-c, .g-tasks-c, .g-ua-c { min-width: 142px; }
}

@media (max-width: 900px) and (min-width: 769px) {
  .sol-identity { min-width: 76px; }
  .sol-identity .tb-venue,
  .sol-identity .tb-div { display: none; }
  .sol-brand-mark { display: none; }
  .tb-week { flex-basis: 172px; min-width: 154px; }
  .wk-label { width: 96px; }
}

@media (max-width: 768px) {
  .topbar { height: 48px; padding-inline: 9px; }
  .sol-identity { min-width: 0; }
  .sol-identity .tb-venue,
  .sol-identity .tb-div { display: none; }
  .sol-brand-mark { display: none; }
  .sidebar {
    width: 270px;
    right: -280px;
    left: auto;
    border-right: 0;
    border-left: 1px solid var(--sol-line);
  }
  .sidebar.mob-open { right: 0; left: auto; }
  .sidebar.collapsed { width: 270px; right: -280px; left: auto; }
  .sol-labour-glance { gap: 9px; }
  .sol-labour-glance span:nth-child(4) { display: none; }
  .tb-wordmark::after { display: none; }
  .g-os-h, .g-os-c { height: 102px; }
  .sol-open-stack { max-height: 90px; }
}

@media (hover: none) {
  .chip-x, .os-chip-x { opacity: .65; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
}
