/* Daily Tracker design system.
   One spacing scale (4, 8, 12, 16, 24, 32), one radius, one border colour, one type scale.
   Colours are tokens, so light and dark themes change in one place. */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --text: #1c2433;
  --muted: #667085;
  --line: #e4e9f2;          /* the light, thin border used on every card and field */
  --line-strong: #d0d7e4;
  --accent: #3157d5;
  --accent-soft: #eef2ff;
  --ok: #15803d;
  --ok-soft: #ecfdf3;
  --warn: #b45309;
  --warn-soft: #fff7ed;
  --bad: #b42318;
  --bad-soft: #fef3f2;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111520;
    --surface: #181d2a;
    --surface-2: #1d2331;
    --text: #e7eaf2;
    --muted: #9aa4b8;
    --line: #293142;
    --line-strong: #3a4357;
    --accent: #7c9cff;
    --accent-soft: #1f2a48;
    --ok-soft: #123222;
    --warn-soft: #3a2a12;
    --bad-soft: #3a1a18;
  }
}

*, *::before, *::after { box-sizing: border-box; }

/* The hidden attribute must win over the display rules below (buttons and navigation set their own display). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Header and navigation ---------- */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  padding: var(--space-3) var(--space-6);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: var(--space-2);
  border-radius: 3px;
  background: var(--accent);
  vertical-align: middle;
}

nav { display: flex; flex-wrap: wrap; gap: var(--space-1); }
nav a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
}
nav a:hover { background: var(--surface-2); color: var(--text); }
nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* A thin divider between navigation groups, and a tab of its own for Clients. */
nav .nav-sep { width: 1px; align-self: stretch; margin: 4px 6px; background: var(--line-strong); }
nav a.nav-clients { border: 1px solid var(--line-strong); }
nav a.nav-clients.on { border-color: var(--accent); }

/* Submenus: a title that opens a short list of pages beneath it. */
nav details.nav-menu { position: relative; }
nav details.nav-menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
}
nav details.nav-menu > summary::-webkit-details-marker { display: none; }
nav details.nav-menu > summary::after { content: " ▾"; font-size: 0.75em; }
nav details.nav-menu > summary:hover { background: var(--surface-2); color: var(--text); }
nav details.nav-menu > summary.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
nav .nav-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius, 10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
nav .nav-drop a { border-radius: 8px; }

.who {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Layout ---------- */

main { max-width: 1180px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-8); }

.page-head { margin: 0 0 var(--space-4); }
.page-head h1 { margin: 0 0 var(--space-1); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.page-head .muted { margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
}
.card h1 { margin: 0 0 var(--space-4); font-size: 1.35rem; font-weight: 700; }
.card h2 { margin: 0 0 var(--space-3); font-size: 1.05rem; font-weight: 600; }
.card h3 { margin: var(--space-6) 0 var(--space-2); font-size: 0.95rem; font-weight: 600; }

.narrow { max-width: 400px; margin: var(--space-8) auto; }
.narrow-form { max-width: 420px; }

/* Collapsible sections: native details, so they work without script and under the content policy. */
details.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-4);
}
details.section > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  font-weight: 600;
  font-size: 1.02rem;
  cursor: pointer;
  list-style: none;
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  margin-left: var(--space-2);
  flex-shrink: 0;
}
details.section[open] > summary { border-bottom: 1px solid var(--line); }
details.section[open] > summary::after { transform: rotate(-135deg); }
.section-body { padding: var(--space-4) var(--space-6) var(--space-6); }
details.section > summary small { font-weight: 400; }

details.stage, details.task-report {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: var(--space-3);
}
details.stage > summary, details.task-report > summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  list-style: none;
}
details.stage > summary::-webkit-details-marker, details.task-report > summary::-webkit-details-marker { display: none; }
details.stage[open] > summary, details.task-report[open] > summary { border-bottom: 1px solid var(--line); }
details.stage .section-body, details.task-report .section-body { padding: var(--space-3) var(--space-4) var(--space-4); }

details summary { cursor: pointer; }
details > form, details > .stack { margin-top: var(--space-3); }

/* ---------- Forms ---------- */

.stack > * + * { margin-top: var(--space-3); }
/* Grid cells start at the top, so labels and boxes line up across each row even when a field has help text. */
.grid2, .grid3 { display: grid; gap: var(--space-4) var(--space-4); align-items: start; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) {
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
}
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; }
.row.between { justify-content: space-between; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbl { font-size: 0.82rem; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; line-height: 1.2; }
.help { font-size: 0.8rem; color: var(--muted); }

input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; margin: 0 var(--space-2) 0 0; padding: 0; flex-shrink: 0; accent-color: var(--accent); }
input[type="date"], input[type="datetime-local"] { padding-right: 8px; }
input.auto, select.auto { width: auto; min-width: 160px; }
textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
textarea[name="description"] { min-height: 160px; }
select { padding-right: 32px; }

/* Password box with Generate and Copy */
.pw-row { display: flex; flex-wrap: nowrap; gap: var(--space-2); align-items: center; }
.pw-row input { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, Consolas, monospace; }
.pw-row button { flex: 0 0 auto; }

/* Checkbox groups laid out in an even grid */
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-2) var(--space-4); margin: var(--space-2) 0; }
.check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.92rem;
  cursor: pointer;
}
.check:hover { border-color: var(--line-strong); }

/* Multi-select dropdown: a field-like summary that opens a checkbox menu */
.multi-select { position: relative; min-width: 220px; }
.multi-select > summary {
  list-style: none;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multi-select > summary::-webkit-details-marker { display: none; }
.multi-select > summary::after { content: "▾"; float: right; color: var(--muted); }
.multi-select[open] > summary { border-color: var(--line-strong); }
.multi-menu {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin-top: 4px;
  padding: var(--space-2);
  max-height: 260px;
  overflow-y: auto;
  display: grid;
  gap: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.multi-menu .check { margin: 0; }

/* ---------- Buttons ---------- */

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s ease, background 0.15s ease;
}
button:hover { filter: brightness(0.95); }
button.ghost { background: var(--surface); color: var(--accent); border-color: var(--line-strong); }
button.ghost:hover { background: var(--surface-2); filter: none; }
button.ok { background: var(--ok); border-color: var(--ok); }
button.bad { background: var(--bad); border-color: var(--bad); }
button.link {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 500;
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
button.mic {
  align-self: flex-start;
  height: 30px;
  min-height: 30px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
}
button.mic.live { background: var(--bad); border-color: var(--bad); color: #fff; }
button:disabled { opacity: 0.5; cursor: default; filter: none; }
.no-print button, button.no-print { }

/* ---------- Text, links and helpers ---------- */

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.muted { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--bad); }
.late { color: var(--bad); font-weight: 600; }
.ok-text { display: flex; align-items: center; gap: var(--space-2); }
.empty { padding: var(--space-4) 0; margin: 0; text-align: center; }
.prose { white-space: pre-wrap; margin: var(--space-2) 0 var(--space-4); }
.procedure { margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); }
.person {
  display: inline-block;
  padding: 2px 10px;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
}
.note { margin: var(--space-1) 0; color: var(--text); }
.plain { padding-left: var(--space-6); margin: var(--space-2) 0; }
.plain li { margin-bottom: var(--space-1); }

/* ---------- Tags and badges ---------- */

.tag, .badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.tag + .tag, .badge + .tag, .tag + .badge { margin-left: 0; }
.tag.ok, .badge.present { color: var(--ok); border-color: #b7e4c7; background: var(--ok-soft); }
.tag.bad, .badge.absent, .tag.sev-critical, .tag.sev-high { color: var(--bad); border-color: #fecdca; background: var(--bad-soft); }
.badge.late, .tag.sev-medium { color: var(--warn); border-color: #fed7aa; background: var(--warn-soft); }
.tag.sev-low { color: var(--muted); }
.tag.kind-work { color: var(--accent); border-color: #c7d2fe; background: var(--accent-soft); }

/* ---------- Progress bars ---------- */

.bar {
  display: block;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  min-width: 80px;
}
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.bar.small { display: inline-block; width: 96px; min-width: 0; height: 6px; vertical-align: middle; margin-right: var(--space-2); }
.kpi .bar.small { display: block; width: auto; margin: var(--space-3) 0 var(--space-2); height: 6px; }

/* ---------- Tables ---------- */

.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.92rem; }
th, td {
  text-align: left;
  vertical-align: middle;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.late { color: var(--bad); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .person { margin: 0; }

/* ---------- KPI tiles ---------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-3); }
.kpi {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.kpi b { display: block; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.kpi > span:not(.bar) { display: block; color: var(--muted); font-size: 0.85rem; }
.kpi > span:first-of-type { color: var(--text); font-weight: 500; }

/* ---------- Project cards ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.project-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08); text-decoration: none; }
.project-card b { font-size: 1.05rem; }
.project-card .bar { margin-top: var(--space-1); }

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-1);
  margin-bottom: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
}
.tabs a {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); border: 1px solid var(--line); }

/* ---------- Activity logs ---------- */

ul.logs { list-style: none; padding: 0; margin: var(--space-3) 0 0; }
ul.logs li {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  background: var(--surface);
}
ul.logs li.kind-fix { border-left-color: var(--warn); }
ul.logs li.kind-blocker { border-left-color: var(--bad); }
ul.logs li.kind-feature { border-left-color: var(--ok); }
ul.logs li.kind-work { border-left-color: var(--accent); }
ul.logs li p { margin: var(--space-1) 0; white-space: pre-wrap; }
ul.logs small { display: block; margin-top: var(--space-1); }
.meta { display: flex; flex-wrap: wrap; gap: var(--space-1); align-items: center; }

/* ---------- Timelines (steps) ---------- */

ol.timeline { list-style: none; margin: var(--space-3) 0; padding: 0 0 0 var(--space-6); position: relative; }
ol.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line-strong);
}
ol.timeline > li { position: relative; padding: 0 0 var(--space-4); }
ol.timeline > li::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-6) + 2px);
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--surface);
}
ol.timeline > li:last-child { padding-bottom: 0; }
.step { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: baseline; }
.step b { font-weight: 600; }
.step .muted { font-size: 0.85rem; }

.add-step > summary { color: var(--accent); font-weight: 600; margin-top: var(--space-3); }

/* ---------- Checklists ---------- */

.missing {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid #fecdca;
  border-radius: var(--radius-sm);
  background: var(--bad-soft);
}
.missing b { display: block; margin-bottom: var(--space-1); color: var(--bad); }
.missing ul { margin: 0; padding-left: var(--space-6); }

/* ---------- Timeline chart ---------- */

.gantt { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-4); background: var(--surface); }
.gantt-head { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); margin-bottom: var(--space-3); }
.gantt-body { position: relative; padding-top: var(--space-4); }
.gantt-row { margin-bottom: var(--space-3); }
.gantt-label { font-size: 0.9rem; margin-bottom: var(--space-1); }
.gantt-label .tag { margin-right: var(--space-2); }
.gantt-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.gantt-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: var(--accent);
  min-width: 6px;
}
.gantt-bar.done { background: var(--ok); }
.gantt-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed var(--bad);
  pointer-events: none;
}
.gantt-marker.today { border-left-color: var(--accent); }
.gantt-marker span {
  position: absolute;
  top: -20px;
  left: -4px;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bad);
}
.gantt-marker.today span { color: var(--accent); }

/* ---------- Burndown ---------- */

.burn { margin-top: var(--space-4); }
.burn-head { font-weight: 600; margin-bottom: var(--space-2); }
.burn-row { display: grid; grid-template-columns: 110px 1fr 180px; gap: var(--space-3); align-items: center; padding: var(--space-1) 0; font-size: 0.88rem; }
.burn-date { color: var(--muted); }
.burn-track { position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.burn-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.burn-track i.ideal { background: var(--line-strong); }
.burn-track i.actual { background: var(--accent); }
.burn p { margin-top: var(--space-2); }

/* ---------- Delivery: checklists, discussion threads and reminders ---------- */
ul.checklist { list-style: none; padding: 0; margin: var(--space-3) 0; }
ul.checklist li { display: flex; gap: var(--space-2); align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.checklist li:last-child { border-bottom: 0; }
ul.checklist li.done > span { color: var(--ok); font-weight: 700; }
ul.checklist li.todo > span { color: var(--warn); font-weight: 700; }
ul.thread { list-style: none; padding: 0; margin: var(--space-2) 0 var(--space-4); }
ul.thread li { padding: var(--space-3) var(--space-4); margin-bottom: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
ul.thread li p { margin: 4px 0; white-space: pre-wrap; }
li.done-item { color: var(--muted); text-decoration: line-through; }
/* A check or reminder row: keep the controls and the text on one line */
ul.plain li { margin-bottom: var(--space-2); }

/* ---------- Project life cycle ---------- */
.lifecycle h2 { margin: 0; }
ol.lc-track { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-3); }
.lc-step { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.lc-dot { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); font-size: 0.8rem; font-weight: 700; color: var(--muted); background: var(--surface); }
.lc-name { font-weight: 600; font-size: 0.9rem; }
.lc-state { font-size: 0.78rem; color: var(--muted); }
.lc-step.done { border-color: #b7e4c7; background: var(--ok-soft); }
.lc-step.done .lc-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.lc-step.done .lc-state { color: var(--ok); }
.lc-step.current { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.lc-step.current .lc-dot { border-color: var(--accent); color: var(--accent); }
.lc-step.current .lc-state { color: var(--accent); font-weight: 600; }

/* ---------- Dialogs ---------- */

dialog.modal {
  width: min(640px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.25);
}
dialog.modal::backdrop { background: rgba(16, 24, 40, 0.45); }
.modal-body { margin: 0; }
.modal-head { padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.modal-fields { padding: var(--space-6); max-height: 70vh; overflow-y: auto; }
.modal-actions { justify-content: flex-end; padding: var(--space-4) var(--space-6); border-top: 1px solid var(--line); margin-top: 0; }

/* Page-level action rows and detail lists */
.page-actions { margin-bottom: var(--space-4); }
.details-list { gap: var(--space-4) var(--space-6); }
.details-list .span-2 { grid-column: 1 / -1; }
.details-list .lbl { display: block; margin-bottom: 4px; }
.nowrap { white-space: nowrap; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.18);
  z-index: 50;
  max-width: 90vw;
  font-size: 0.92rem;
}

/* ---------- Print ---------- */

@media print {
  .top, .no-print, button, .mic { display: none !important; }
  body { background: #fff; color: #000; }
  .card, details.section, details.stage { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
}

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  .top { padding: var(--space-3) var(--space-4); }
  main { padding: var(--space-4) var(--space-3) var(--space-6); }
  .who { margin-left: 0; width: 100%; justify-content: space-between; }
  .card { padding: var(--space-4); }
  details.section > summary { padding: var(--space-3) var(--space-4); }
  .section-body { padding: var(--space-3) var(--space-4) var(--space-4); }
  .burn-row { grid-template-columns: 1fr; gap: var(--space-1); }
  .cards { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.3rem; }
}

/* Morning report and Insights */
.talking { background: var(--warn-soft); border-radius: var(--radius-sm); padding: var(--space-3); margin-bottom: var(--space-3); }
.chart { display: block; width: 100%; height: auto; }
.chart-bar { fill: var(--accent); }
.chart-hit { fill: transparent; }
.chart-slot:hover .chart-hit { fill: var(--accent-soft); }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-label { fill: var(--muted); font-size: 11px; }

/* Operations checks: question, answer and notes on one line that wraps on small screens */
.ops-row { align-items: center; flex-wrap: wrap; }
.ops-q { flex: 1 1 320px; }

/* Hover card: recent activity for an item, shown beside the pointer */
.activity-card { position: absolute; z-index: 50; max-width: 420px; padding: var(--space-3); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 0.85rem; pointer-events: none; }
.activity-card[hidden] { display: none; }
.activity-card ul { margin: var(--space-2) 0 0; }
