/* ============================================================
   DailyCheck component styles — implements the design system.
   Palette, typography, spacing and radii come from tokens.css
   (loaded first). Do not redefine colour tokens in this file.

   Class names are the app's own; the visual language (flat
   panels, dark primary buttons, bordered badges with dot-shape
   status, mono numerals, 3px KPI accent) follows the handoff.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 400 14px/1.5 var(--font-ui);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1 { font: 600 18px var(--font-ui); margin: 0; }
h2 { font: 600 14px var(--font-ui); margin: 0; }
h3 { font: 600 13px var(--font-ui); margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--accent); }

/* Numerals share the mono face so columns line up everywhere. */
.num, .wtimer, .kpi .value, .cell-input, .timer { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-secondary); }
.faint { color: var(--text-muted); }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: var(--sp-3); }
.flex.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--sp-2); }
.tag-list { display: flex; flex-wrap: wrap; gap: var(--sp-1); }

@keyframes dc-marquee { to { transform: translateX(-50%); } }
@keyframes dc-pulse { 50% { opacity: .35; } }
@keyframes dc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Custom scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--neutral-border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--neutral-border); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: content-box; }

/* ---------------- App shell ---------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--elevated); border-right: 1px solid var(--border);
  padding: 0 0 var(--sp-3);
  display: flex; flex-direction: column; gap: 1px;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px; font: 600 15px var(--font-ui);
}
.brand .logo {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--text-primary); color: var(--elevated);
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 11px var(--font-num);
}
.nav-label {
  font: 500 10.5px var(--font-num); letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); padding: 16px 20px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  margin: 0 10px; padding: 7px 10px; border-radius: var(--radius-control);
  font: 500 13px var(--font-ui); color: var(--text-secondary);
  transition: background .14s ease, color .14s ease;
}
.nav-link svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.nav-link:hover { background: var(--surface); color: var(--text-primary); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-link.active svg { opacity: 1; }
.sidebar .spacer { flex: 1; }
.user-chip {
  margin: var(--sp-2) 10px 0; padding: 14px 10px 0;
  border-top: 1px solid var(--border); border-radius: 0;
}
.user-chip:hover { background: transparent; color: var(--text-secondary); }

/* ---------------- Topbar ---------------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 14px 28px;
  background: var(--elevated); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar .title { flex: 1; min-width: 0; }
.topbar .title small { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.content { padding: 24px 28px 48px; max-width: var(--content-max); width: 100%; margin: 0 auto; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; white-space: nowrap;
  font: 500 13px var(--font-ui); border-radius: var(--radius-control);
  border: 1px solid transparent; padding: 7px 14px;
  background: var(--text-primary); color: var(--elevated);
  transition: opacity .14s ease, background .14s ease, border-color .14s ease;
}
.btn:hover { opacity: .88; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.secondary { background: var(--elevated); color: var(--text-primary); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface); opacity: 1; }
.btn.danger { background: var(--elevated); border-color: var(--border); color: var(--bad-text); }
.btn.danger:hover { background: var(--bad-fill); border-color: var(--bad-border); opacity: 1; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; border-color: transparent; }
.btn.secondary.is-on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--radius-control); background: var(--elevated);
  border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer;
  transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--surface); color: var(--text-primary); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------------- Panels / cards ---------------- */
.card {
  background: var(--elevated); border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5);
}
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.card-head h2 { flex: 1; }

/* ---------------- KPI tiles ---------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.kpi {
  position: relative; overflow: hidden;
  background: var(--elevated); border: 1px solid var(--border);
  border-radius: var(--radius-card);
  /* extra left padding leaves room for the 3px accent rule below */
  padding: 14px 16px 14px 19px;
}
.kpi .label { font: 500 12px var(--font-ui); color: var(--text-secondary); }
.kpi .value { margin-top: 6px; font: 500 26px/1 var(--font-num); font-variant-numeric: tabular-nums; }
.kpi .sub { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
/* The template emits <span class="accent {tone}">; render it as the left rule. */
.kpi .accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.kpi .accent.green { background: var(--ok-text); }
.kpi .accent.amber { background: var(--warn-text); }
.kpi .accent.red { background: var(--bad-text); }
.kpi .accent.blue { background: var(--info-text); }
.kpi .accent.primary { background: var(--accent); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  position: sticky; top: 0; z-index: 1; background: var(--elevated);
  text-align: left; font: 500 11px var(--font-num);
  letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted);
  padding: 9px 14px; border-bottom: 1px solid var(--border);
}
tbody td { padding: 7px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; height: var(--row-h); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--surface); }
.t-empty { padding: 26px 16px !important; text-align: center; font-size: 13px; color: var(--text-secondary); }

/* ---------------- Status dots & badges ----------------
   Shape grammar: filled = active/resolved · hollow = awaiting
   · ring = escalated · dash = none/dismissed. Shapes mean state
   is never carried by colour alone. */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 9px; border: 1px solid; border-radius: var(--radius-control);
  font: 500 12px var(--font-ui); line-height: 1.4;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.badge.green { background: var(--ok-fill); border-color: var(--ok-border); color: var(--ok-text); }
.badge.amber, .badge.yellow { background: var(--warn-fill); border-color: var(--warn-border); color: var(--warn-text); }
.badge.red { background: var(--bad-fill); border-color: var(--bad-border); color: var(--bad-text); }
.badge.blue { background: var(--info-fill); border-color: var(--info-border); color: var(--info-text); }
.badge.gray { background: var(--neutral-fill); border-color: var(--neutral-border); color: var(--neutral-text); }
.badge.no-dot::before { display: none; }
/* Optional dot shapes (available for the status macro). */
.badge.hollow::before { background: transparent; border: 1.5px solid currentColor; }
.badge.ring::before { width: 5px; height: 5px; margin: 2px; box-shadow: 0 0 0 2px transparent, 0 0 0 3.5px currentColor; }
.badge.dash::before { width: 9px; height: 2px; border-radius: 1px; }
.badge.live::before { animation: dc-pulse 2.4s ease-in-out infinite; }

/* Bare status: dot + label with no chrome — for dense table columns. */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.status.green { color: var(--ok-text); }
.status.amber, .status.yellow { color: var(--warn-text); }
.status.red { color: var(--bad-text); }
.status.blue { color: var(--info-text); }
.status.gray { color: var(--neutral-text); }
.status.hollow::before { background: transparent; border: 1.5px solid currentColor; }
.status.ring::before { width: 5px; height: 5px; margin: 2px; box-shadow: 0 0 0 2px transparent, 0 0 0 3.5px currentColor; }
.status.dash::before { width: 9px; height: 2px; border-radius: 1px; }
.status.live::before { animation: dc-pulse 2.4s ease-in-out infinite; }

/* CSS padlock — replaces the emoji so it inherits colour and size. */
.lock { position: relative; display: inline-block; width: 8px; height: 6px; background: var(--neutral-text); border-radius: 1px; margin-top: 3px; }
.lock::before {
  content: ""; position: absolute; top: -4px; left: 1px; width: 6px; height: 5px;
  border: 1.5px solid var(--neutral-text); border-bottom: none; border-radius: 3px 3px 0 0;
}

/* Small-caps mono section label. */
.kicker { font: 500 11px var(--font-num); letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }

/* Numeric table cells: mono, right-aligned, never wrapped. */
.is-num, th.is-num { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Segmented control (filter presets). */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 2px; }
.seg button, .seg a {
  font: 500 12.5px var(--font-ui); border: none; background: none; color: var(--text-muted);
  padding: 4px 10px; border-radius: 3px; cursor: pointer;
}
.seg button[aria-pressed="true"], .seg a.is-on { background: var(--elevated); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--accent); }

/* Loading placeholder. */
@keyframes dc-shimmer { to { background-position: -200% 0; } }
.skeleton {
  height: 10px; border-radius: 3px;
  background: linear-gradient(90deg, var(--border) 25%, var(--surface) 50%, var(--border) 75%);
  background-size: 200% 100%; animation: dc-shimmer 1.4s linear infinite;
}
.t-empty small { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

/* ---------------- Day rail ----------------
   Server positions the segments (0–24h as %); app.js moves the now-line. */
.rail { position: relative; height: 26px; }
.rail.row { height: 10px; }
.rail__axis { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
/* min-width keeps very short entries visible instead of collapsing to nothing */
.rail__seg { position: absolute; top: calc(50% - 3.5px); height: 7px; min-width: 2px; background: var(--text-secondary); border-radius: 1px; }
.rail.row .rail__seg { top: calc(50% - 2px); height: 4px; background: var(--text-muted); }
.rail__seg.break { background: var(--warn-border); }
.rail__now { position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--accent); }
.rail__labels { display: flex; justify-content: space-between; font: 400 10px var(--font-num); color: var(--text-muted); margin-top: 4px; }

/* Small neutral chip (used for inline values, not status). */
.pill {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-control);
  background: var(--neutral-fill); border: 1px solid var(--neutral-border);
  color: var(--neutral-text); font-size: 12px; font-weight: 500;
}
.pill.warn { background: var(--bad-fill); border-color: var(--bad-border); color: var(--bad-text); }

/* Accountability flag (staff only) — dashed to read as advisory. */
.flag-chip {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 3px;
  padding: 1px 7px; border-radius: var(--radius-control);
  background: none; border: 1px dashed var(--warn-border); color: var(--warn-text);
  font-size: 11px; font-weight: 500; cursor: help;
}

/* ---------------- Avatars ---------------- */
.avatar {
  position: relative; overflow: hidden; flex: none;
  width: var(--av, 32px); height: var(--av, 32px); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--neutral-fill); border: 1px solid var(--neutral-border);
  color: var(--text-secondary);
  font: 600 calc(var(--av, 32px) * 0.38) var(--font-ui); line-height: 1;
  user-select: none;
}
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; }
.avatar.dim { opacity: .45; }
/* Ring states — the board shows who's working/away at a glance. */
.avatar.working { box-shadow: 0 0 0 2px var(--elevated), 0 0 0 4px var(--ok-text); }
.avatar.on_break { box-shadow: 0 0 0 2px var(--elevated), 0 0 0 4px var(--warn-text); }
.avatar.time_off { box-shadow: 0 0 0 2px var(--elevated), 0 0 0 4px var(--info-text); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .meta { min-width: 0; }
.user-cell .meta .name { font-weight: 600; }
.user-cell .meta .sub { color: var(--text-muted); font-size: 12px; }

/* ---------------- Timers ---------------- */
.wtimer { font-weight: 500; }

/* ---------------- Progress ---------------- */
.progress { height: 6px; border-radius: 999px; background: var(--neutral-fill); overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.progress.green > span { background: var(--ok-text); }

/* ---------------- Forms ---------------- */
label { display: block; margin: 0 0 4px; font: 500 11.5px var(--font-ui); color: var(--text-secondary); }
input[type=text], input[type=email], input[type=password], input[type=time], input[type=search], select, textarea {
  width: 100%; padding: 6px 8px;
  font: 400 13px var(--font-ui); color: var(--text-primary); background: var(--elevated);
  border: 1px solid var(--border); border-radius: var(--radius-control);
  transition: border-color .14s, outline-color .14s;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface); color: var(--text-muted); cursor: not-allowed; }
select[multiple] { min-height: 150px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.field { margin-bottom: var(--sp-3); }
label .req { color: var(--bad-text); font-weight: 600; }
.row { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.row > .field, .row > div { flex: 1; min-width: 190px; }
.search { position: relative; }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-muted); }
.search input { padding-left: 30px; }
.toolbar { display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.toolbar label { margin-bottom: 4px; }

/* ---------------- Alerts ---------------- */
.alert {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid; border-radius: var(--radius-control);
  padding: 9px 14px; margin-bottom: var(--sp-4); font-size: 13px;
}
.alert.error { background: var(--bad-fill); border-color: var(--bad-border); color: var(--bad-text); }
.alert.info { background: var(--info-fill); border-color: var(--info-border); color: var(--info-text); }
.alert.success { background: var(--ok-fill); border-color: var(--ok-border); color: var(--ok-text); }
.alert.warn { background: var(--warn-fill); border-color: var(--warn-border); color: var(--warn-text); }
.alert.warn a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------------- Charts / week bars ---------------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--sp-5); }
.chart-box { position: relative; height: 260px; }
.daybars { display: flex; align-items: flex-end; gap: 10px; height: 110px; }
.daybar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.daybar .db-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.daybar .db-fill { width: 100%; max-width: 36px; background: var(--bar-fill); border-radius: 2px 2px 0 0; min-height: 2px; transition: height .2s; }
.daybar.is-today .db-fill { background: var(--accent); }
.daybar .db-label { font: 500 11px var(--font-ui); color: var(--text-muted); }
.daybar.is-today .db-label { color: var(--accent); }
.daybar .db-value { font: 400 10.5px var(--font-num); color: var(--text-muted); }
.daybar.is-today .db-value { color: var(--accent); }

/* ---------------- Timeline ---------------- */
.timeline { position: relative; padding-left: var(--sp-5); }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.tl-item { position: relative; margin-bottom: var(--sp-5); }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 6px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--elevated); border: 1.5px solid var(--neutral-border);
}

/* ---------------- Layout helpers ---------------- */
.section-divider {
  display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap;
  margin: var(--sp-6) 0 var(--sp-4); padding-top: var(--sp-5); border-top: 1px solid var(--border);
}
.section-divider h2 { font-size: 15px; }
.team-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.team-col { min-width: 0; }
.col-title { font-size: 15px; margin-bottom: var(--sp-3); }
@media (max-width: 1080px) { .team-split { grid-template-columns: 1fr; gap: var(--sp-4); } }

/* Condense content inside the split so both columns stay readable. */
.team-split .kpis { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-4); }
.team-split .kpi { padding: 10px 12px; }
.team-split .kpi .value { font-size: 20px; margin-top: 4px; }
.team-split .kpi .label { font-size: 11.5px; }
.team-split .kpi .sub { font-size: 11px; margin-top: 4px; }
.team-split .card { margin-bottom: var(--sp-4); }
.team-split table { font-size: 12.5px; }
.team-split thead th { padding: 7px 12px; }
.team-split tbody td { padding: 5px 12px; }

/* Client-question message excerpt, truncated to its column. */
.q-cell { max-width: 26rem; }
.q-excerpt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24rem; font-size: 12.5px; color: var(--text-muted); }
.team-split .q-cell { max-width: 20rem; }
.team-split .q-excerpt { max-width: 17rem; }

/* ---------------- Weekly timesheet grid ---------------- */
.ts-table td, .ts-table th { vertical-align: top; }
.ts-table th.is-today, .ts-table td.is-today { background: var(--accent-soft); }
.cell-form { margin: 0; }
.cell-input {
  width: 72px; text-align: right;
  font: 400 13px var(--font-num); font-variant-numeric: tabular-nums;
  border: 1px solid transparent; border-radius: var(--radius-control);
  padding: 6px 8px; background: transparent; color: var(--text-primary);
}
.cell-input:hover:not(:disabled) { border-color: var(--border); }
.cell-input:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.cell-input:disabled { color: var(--text-muted); cursor: not-allowed; background: transparent; }
.cell-input[aria-invalid="true"] { color: var(--bad-text); background: var(--bad-fill); border-color: var(--bad-border); }
.ts-table tfoot th {
  position: sticky; bottom: 0; background: var(--elevated);
  border-top: 1px solid var(--border); font-size: 12px; text-transform: none; letter-spacing: 0;
  color: var(--text-primary); font-family: var(--font-ui); font-weight: 600;
}
.ts-row select, .ts-row .row-desc { font-size: 12.5px; padding: 5px 7px; }

/* ---------------- Disclosure (AI draft, task breakdown) ---------------- */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.draft { margin-top: var(--sp-2); }
.draft > summary {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 12.5px var(--font-ui); color: var(--accent);
}
.draft > summary::before { content: "▶"; font-size: 9px; color: var(--text-muted); transition: transform .15s; }
.draft[open] > summary::before { transform: rotate(90deg); }
.draft-body {
  margin: var(--sp-2) 0; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control);
  white-space: pre-wrap; line-height: 1.5; font-size: 12.5px; color: var(--text-primary);
}

/* ---------------- Working-now ticker ---------------- */
.ticker {
  display: flex; align-items: stretch; overflow: hidden;
  background: var(--elevated); border-bottom: 1px solid var(--border);
}
.ticker-label {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-right: 1px solid var(--border);
  font: 700 13px var(--font-num); letter-spacing: .05em; text-transform: uppercase;
  color: var(--ok-text); white-space: nowrap;
}
.ticker-label::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; animation: dc-pulse 2.4s ease-in-out infinite; }
.ticker.idle .ticker-label { color: var(--text-muted); }
.ticker.idle .ticker-label::before { animation: none; }
.ticker-viewport {
  flex: 1; overflow: hidden; display: flex; align-items: center;
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.ticker-track { display: inline-flex; align-items: center; white-space: nowrap; animation: dc-marquee linear infinite; will-change: transform; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: baseline; gap: 9px; padding: 11px 20px; font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.ticker-dot { width: 9px; height: 9px; border-radius: 50%; align-self: center; flex: none; }
.ticker-item.green .ticker-dot { background: var(--ok-text); }
.ticker-item.amber .ticker-dot { background: var(--warn-text); }
.ticker-item.red .ticker-dot { background: var(--bad-text); }
.ticker-channel { font-weight: 700; color: var(--text-primary); }
.ticker-item.red .ticker-channel { color: var(--bad-text); }
/* Kept lighter than the name so the bar still has a hierarchy at this size. */
.ticker-meta { color: var(--text-muted); font-size: 13.5px; font-weight: 500; }
.ticker-sep { color: var(--border); }
.ticker-item:hover .ticker-channel { text-decoration: underline; }

/* ---------------- Clock-back-in reminder (top bar pill) ---------------- */
.clockin-reminder {
  display: none; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--warn-fill); border: 1px solid var(--warn-border); color: var(--warn-text);
  font: 500 12.5px var(--font-ui);
}
.clockin-reminder.show { display: inline-flex; }
.clockin-reminder:hover { filter: brightness(.98); }
.clockin-reminder .cr-bang {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--warn-text); color: var(--warn-fill); font: 700 10px var(--font-ui);
  animation: dc-pulse 2.4s ease-in-out infinite;
}
@media (max-width: 620px) { .clockin-reminder .cr-text { display: none; } }

/* ---------------- Pager: broadcast banner + panel ---------------- */
.pager-banner {
  display: none; position: fixed; z-index: 80; left: 50%; top: var(--sp-4);
  transform: translateX(-50%); width: min(680px, calc(100vw - 2rem));
  align-items: center; gap: 14px; padding: 12px 18px;
  background: var(--text-primary); color: var(--elevated);
  border-radius: var(--radius-card); box-shadow: var(--shadow-overlay);
}
.pager-banner.show { display: flex; }
.pager-banner .pb-icon { font-size: 18px; animation: dc-pulse 2.4s ease-in-out infinite; }
.pager-banner .pb-body { flex: 1; min-width: 0; }
.pager-banner .pb-from { font-size: 11.5px; opacity: .7; }
.pager-banner .pb-text { font-weight: 600; overflow-wrap: anywhere; }
.pager-banner .btn.secondary { background: transparent; color: var(--elevated); border-color: rgba(255,255,255,.25); }
.pager-banner .btn.secondary:hover { background: rgba(255,255,255,.12); }

.pager-panel {
  display: none; position: fixed; z-index: 79; right: var(--sp-5); top: 64px;
  width: min(360px, calc(100vw - 2rem)); padding: 16px;
  background: var(--elevated); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-overlay);
}
.pager-panel.show { display: block; }
.pager-panel .pp-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.pager-panel .icon-btn { width: 26px; height: 26px; font-size: 12px; }
#pp-mic.recording { background: var(--bad-text); color: #fff; animation: dc-pulse 1.2s ease-in-out infinite; }

/* ---------------- Print (Save as PDF) ----------------
   Strips the app chrome so a report prints as a clean document. */
.print-only { display: none; }
@media print {
  @page { margin: 14mm; }
  .sidebar, .topbar, #ticker-strip, .pager-banner, .pager-panel,
  .screen-only, .seg, .btn, .filters { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .print-only { display: block; }
  .card { border: none; box-shadow: none; padding: 0; margin: 0; }
  .card-head { display: none; }
  table { font-size: 9.5pt; }
  thead th { background: #fff; color: #000; border-bottom: 1px solid #000; }
  tbody td { border-bottom: 1px solid #ddd; }
  tbody tr { break-inside: avoid; }
  thead { display: table-header-group; }   /* repeat headers on every page */
  tfoot { display: table-footer-group; }
  a { color: #000; text-decoration: none; }
}
.print-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10mm; }
.print-title { font-size: 20pt; font-weight: 700; margin: 0 0 2mm; }
.print-range { font-size: 9.5pt; color: #555; margin-bottom: 4mm; }
.print-totals { display: flex; gap: 10mm; font-size: 13pt; font-family: var(--font-num); }
.print-totals .pt-label { font-size: 9.5pt; color: #555; font-family: var(--font-ui); }
.print-logo { max-height: 18mm; max-width: 60mm; object-fit: contain; }
.print-brand { font-size: 14pt; font-weight: 700; }

/* ---------------- Responsive ---------------- */
.menu-toggle { display: none; }
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; z-index: 50; transition: left .2s ease; box-shadow: var(--shadow-overlay); }
  .sidebar.open { left: 0; }
  .content { padding: var(--sp-4); }
  .topbar { padding: 12px 16px; }
  .menu-toggle { display: inline-grid; }
}

/* Collapsible daily stand-up. The summary is the card header, so it needs the
   default disclosure marker removed and a chevron of our own. */
.standup > summary {
  display: flex; align-items: center; gap: var(--sp-3);
  cursor: pointer; list-style: none; user-select: none;
}
.standup > summary::-webkit-details-marker { display: none; }
.standup > summary::after {
  content: "›"; margin-left: auto; font-size: 1.2rem; line-height: 1;
  color: var(--text-muted); transition: transform .15s ease;
}
.standup[open] > summary { margin-bottom: var(--sp-3); }
.standup[open] > summary::after { transform: rotate(90deg); }
.standup > summary:hover::after { color: var(--text-primary); }

/* Day navigation inside the stand-up panel. */
.standup-days {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.standup-days .btn { min-width: 32px; justify-content: center; font-size: 1rem; line-height: 1; }
.standup-days__label { min-width: 96px; text-align: center; }
.btn.is-disabled { opacity: .4; pointer-events: none; }

/* Per-listener volume control in the pager banner. */
.pb-vol { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; }
.pb-vol input[type="range"] { width: 92px; accent-color: var(--accent); cursor: pointer; }

/* The brand mark (same SVG as the favicon) replaces the old "DC" block, so the
   sidebar and the browser tab wear the same glyph. */
.logo.mark { background: none; border-radius: 0; }
.logo.mark img { display: block; width: 26px; height: 26px; }

/* The $ on a period of work. Hollow = not billable, filled green = billable.
   Shape and fill both change, so the state never rests on colour alone. */
.money-form { display: inline; margin: 0; }
.money {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; padding: 0; border-radius: 50%;
  font: 600 12.5px/1 var(--font-num);
  color: var(--text-muted); background: transparent;
  border: 1.5px solid var(--neutral-border); cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.money:hover { border-color: var(--ok-border); color: var(--ok-text); }
.money.on { background: var(--ok-fill); border-color: var(--ok-border); color: var(--ok-text); }
.money.static { cursor: default; opacity: .8; }
.money.static:hover { border-color: var(--neutral-border); color: var(--text-muted); }
.money.static.on:hover { border-color: var(--ok-border); color: var(--ok-text); }
/* On the clock-in form it is a checkbox wearing the same chip. */
.money-check { display: inline-flex; align-items: center; cursor: pointer; }
.money-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.money-check input:checked + .money { background: var(--ok-fill); border-color: var(--ok-border); color: var(--ok-text); }
.money-check input:focus-visible + .money { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =====================================================================
   Refinement layer
   Small, consistent touches on top of the flat design: softer corners,
   panels that sit a hair above the page, a top bar you can see through,
   one height for every control, and quieter hover states. Nothing here
   adds colour to data or changes a layout's meaning.
   ===================================================================== */

/* Page: the faintest wash of the accent behind the top of the page. */
body {
  background:
    radial-gradient(1100px 380px at 72% -160px, var(--page-glow), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

/* Panels */
.card, .kpi { box-shadow: var(--shadow-card); }
.card-head { padding: 12px 18px; }
.card h2, .card-head h2 { letter-spacing: -.005em; }
.kpi .value { font-weight: 600; letter-spacing: -.01em; }
.kpi .accent { border-radius: 0 3px 3px 0; top: 12px; bottom: 12px; }

/* Top bar: stays put, lets the page show through. */
.topbar {
  background: color-mix(in srgb, var(--elevated) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
.topbar h1 { font-size: 19px; letter-spacing: -.01em; }
.icon-btn { border-radius: var(--radius-control); transition: background .14s, color .14s, border-color .14s; }
.icon-btn:hover { border-color: var(--border-strong); }
.icon-btn svg { width: 16px; height: 16px; }

/* Sidebar: a clear "you are here" without shouting. */
.brand { padding: 20px 18px 16px; letter-spacing: -.01em; }
.nav-link { position: relative; }
.nav-link.active { font-weight: 600; }
.nav-link.active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-link:hover svg { opacity: 1; }
.nav-label { padding-top: 18px; }

/* Controls: one height, one radius, visible focus. */
.btn { min-height: 34px; border-radius: var(--radius-control); }
.btn.sm { min-height: 28px; }
.btn:not(.secondary):not(.danger):not(:disabled) { box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(0,0,0,.18); }
.btn:active:not(:disabled) { transform: translateY(.5px); }
.btn.secondary:hover { border-color: var(--border-strong); }
input[type=text], input[type=email], input[type=password], input[type=time],
input[type=search], input[type=date], select, textarea {
  border-radius: var(--radius-control);
}
input[type=text], input[type=email], input[type=password], input[type=time],
input[type=search], input[type=date], select:not([multiple]) { min-height: 34px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring);
}
/* A drawn chevron instead of each browser's own arrow, so selects match. */
select:not([multiple]) {
  appearance: none; -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%238A9097%27 stroke-width=%272.2%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M6 9l6 6 6-6%27/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 14px;
}
.seg { border-radius: var(--radius-control); }
.seg button, .seg a { border-radius: calc(var(--radius-control) - 2px); transition: color .14s, background .14s; }
.seg a:hover, .seg button:hover { color: var(--text-primary); }

/* Tables: a settled header row and a gentle hover. */
thead th { background: color-mix(in srgb, var(--elevated) 94%, var(--text-primary)); }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }

/* Chips: rounder, so they read as labels rather than buttons. */
.badge, .pill, .flag-chip { border-radius: 999px; }
.alert { border-radius: var(--radius-control); }

/* ---- The clock controls (team board + My time) ---- */
.status-card { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); }
/* Each form keeps its own pieces on one line; the forms wrap as whole units. */
.clock-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.clock-form { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--sp-2); margin: 0; }
.clock-tail { display: flex; align-items: center; gap: var(--sp-2); }
/* The wrap-up owed for the last day worked, asked for where "Clock in" would be. */
.recap-owed {
  flex: 1 1 100%; display: grid; gap: var(--sp-2); margin: 0; padding: var(--sp-3);
  background: var(--warn-fill); border: 1px solid var(--warn-border); border-radius: var(--radius-control);
}
.recap-owed label { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.recap-owed textarea { width: 100%; resize: vertical; background: var(--elevated); }
.clock-tail form { margin: 0; }
.clock-form select[name=project_id] { width: 260px; min-width: 0; flex: 0 1 260px; }
.clock-form select[name=reason] { width: 150px; flex: 0 1 150px; }
.clock-form .other-input { width: 220px; flex: 0 1 220px; }
.status-card .clock-controls { flex: 1 1 560px; justify-content: flex-end; }
@media (max-width: 720px) {
  .clock-form { flex-wrap: wrap; }
  .clock-form select[name=project_id], .clock-form .other-input { flex: 1 1 100%; width: 100%; }
}

/* ---- Page width: fit the screen, or a readable column ---- */
:root[data-width="fit"] .content { max-width: 2200px; padding-left: clamp(20px, 2.4vw, 44px); padding-right: clamp(20px, 2.4vw, 44px); }
:root[data-width="fit"] .team-split { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; }
.width-toggle .w-expand, .width-toggle .w-contract { display: none; }
:root[data-width="fit"] .width-toggle .w-contract,
:root:not([data-width="fit"]) .width-toggle .w-expand { display: block; }
@media (max-width: 1080px) { :root[data-width="fit"] .team-split { grid-template-columns: 1fr; } }

/* Admin "clock out someone" on the board: an icon, so the table fits its column. */
.icon-action {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border-radius: var(--radius-control); border: 1px solid var(--border);
  background: var(--elevated); color: var(--text-muted); cursor: pointer;
  transition: color .14s, border-color .14s, background .14s;
}
.icon-action svg { width: 14px; height: 14px; }
.icon-action:hover { color: var(--bad-text); border-color: var(--bad-border); background: var(--bad-fill); }
/* The same small button for something harmless (opening the activity controller). */
.icon-action.neutral:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.icon-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A short message from the activity controller ("it closed — reopen?"). */
.mini-toast {
  position: fixed; z-index: 70; right: var(--sp-4); bottom: var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-3);
  max-width: min(460px, calc(100vw - 2rem)); padding: 10px 10px 10px 14px;
  background: var(--elevated); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-overlay); font-size: 13px;
}
.mini-toast span { flex: 1; min-width: 0; }

/* ---- Settings ---- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); align-items: stretch; max-width: 1280px; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-grid .card { margin: 0; }
.settings-wide { grid-column: 1 / -1; }
.settings-note { font-size: 12.5px; margin: 4px 0 var(--sp-4); }
.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 12px; border-radius: var(--radius-card); cursor: pointer;
  background: var(--elevated); border: 1px solid var(--border); color: var(--text-primary);
  font: 400 12.5px var(--font-ui); transition: border-color .14s, box-shadow .14s;
}
.choice strong { font-size: 13px; }
.choice:hover { border-color: var(--border-strong); }
.choice.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
/* Tiny drawings of each option: a sidebar and a content block. */
.choice-art {
  position: relative; display: block; width: 100%; height: 54px; margin-bottom: 4px;
  border-radius: 6px; border: 1px solid var(--border); background: var(--surface); overflow: hidden;
}
.choice-art i { position: absolute; left: 0; top: 0; bottom: 0; width: 18%; background: var(--neutral-fill); }
.choice-art b { position: absolute; top: 10px; bottom: 10px; border-radius: 3px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.art-fit b { left: 23%; right: 5%; }
.art-column b { left: 38%; right: 20%; }
.art-dark { background: #0d0f11; border-color: #282c31; }
.art-dark i { background: #16191c; }
.art-dark b { left: 26%; right: 8%; background: #16191c; border-color: #282c31; }
.art-light { background: #f4f5f6; border-color: #e1e3e6; }
.art-light i { background: #ffffff; }
.art-light b { left: 26%; right: 8%; background: #ffffff; border-color: #e1e3e6; }
.menu-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4); }
.menu-picks fieldset { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 10px 12px 12px; margin: 0; }
.menu-picks legend { padding: 0 6px; font: 500 11px var(--font-num); letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.menu-pick {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 7px 6px;
  border-radius: var(--radius-control); cursor: pointer;
  font: 500 13px var(--font-ui); color: var(--text-primary);
}
.menu-pick:hover { background: var(--surface); }
.menu-pick svg { width: 16px; height: 16px; color: var(--text-muted); flex: none; }
.menu-pick input:not(:checked) ~ span { color: var(--text-muted); text-decoration: line-through; }

@media (prefers-reduced-motion: reduce) { .btn:active:not(:disabled) { transform: none; } }
