/* Pulse operator interface. One family (Archivo variable, self-hosted; the
   width axis is used for titles), one brand colour, three status colours
   shared with the wall. Rules and whitespace, not cards. Light only: the
   wall keeps its own scheme (board.css). Ported from the WO-13 design
   system; legacy class names the templates still use are aliased below so
   every page keeps working inside the shell until its own work order. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-italic-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #EDEFF1;
  --surface: #FFFFFF;
  --surface-2: #F6F7F8;
  --ink: #161D26;
  --ink-2: #4F5965;
  --ink-3: #7B8590;
  --rule: #D6DBE0;
  --rule-strong: #A9B2BC;

  --brand: #F8951D;
  --brand-deep: #C56E0F;
  --brand-tint: #FFF1E0;

  --ok: #1E7B3A;      --ok-tint: #E5F2E9;
  --overdue: #B3261E; --overdue-tint: #FBE9E7;
  --fault: #9A5B00;   --fault-tint: #FFF3DB;
  --paused: #6B7280;  --paused-tint: #EEF0F2;

  --focus: var(--brand-deep);
  --side-w: 236px;
  --r-control: 4px;
  --r-panel: 6px;
}

* { box-sizing: border-box; }
html { font-size: 14px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  font-variation-settings: "wdth" 100;
  line-height: 1.45; -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--brand-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; }
h1 { font-size: 26px; font-variation-settings: "wdth" 112; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-variation-settings: "wdth" 106; }
h3 { font-size: 14px; font-variation-settings: "wdth" 104; }
p { margin: 0; }
p + p, .panel p + form, .panel p + table { margin-top: 10px; }
.lede { font-size: 15px; color: var(--ink-2); max-width: 62ch; }
.hint { font-size: 13px; color: var(--ink-3); max-width: 62ch; }
.num { font-variant-numeric: tabular-nums; }
.wide { font-variation-settings: "wdth" 112; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.empty { color: var(--ink-3); font-size: 14px; }
.crumbs { color: var(--ink-3); font-size: 13px; margin-bottom: 6px; }
code, .mono { font-family: inherit; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
code { background: var(--surface-2); border-radius: 3px; padding: 0 4px; font-size: 13px; }
.words { font-style: italic; white-space: pre-wrap; }
hr, .divider { border: 0; border-top: 1px solid var(--rule); margin: 18px 0; }

/* ---------- application shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--surface); border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; padding: 4px 0 16px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.wordmark {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 14px;
  text-decoration: none; color: var(--ink);
}
.wordmark:hover { text-decoration: none; }
.wordmark .logo { width: 36px; height: 38px; flex: none; display: block; }
.wordmark .lockup { display: flex; flex-direction: column; gap: 1px; line-height: 1.15; }
.wordmark .product {
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em;
  font-variation-settings: "wdth" 115; color: var(--ink);
}
.wordmark .org { font-size: 11px; color: var(--ink-3); font-weight: 500; letter-spacing: 0.02em; }
.nav { display: flex; flex-direction: column; padding: 0 12px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 10px; border-radius: var(--r-control); color: var(--ink); font-size: 15px; font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-deep); box-shadow: inset 3px 0 0 var(--brand); }
.nav .count { font-size: 12px; font-weight: 600; min-width: 20px; padding: 1px 6px; border-radius: 10px; text-align: center; background: var(--overdue); color: #fff; }
.nav .count.quiet { background: var(--paused-tint); color: var(--ink-2); }

.watch { margin-top: auto; padding: 14px 20px 0; border-top: 1px solid var(--rule); }
.watch h2 { font-size: 12px; color: var(--ink-3); font-weight: 600; font-variation-settings: "wdth" 100; margin-bottom: 8px; }
.watch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.watch li { display: grid; grid-template-columns: 14px 1fr; gap: 8px; align-items: start; font-size: 13px; line-height: 1.3; }
.watch li .name { color: var(--ink); font-weight: 500; }
.watch li .state { color: var(--ink-3); display: block; font-size: 12px; }
.watch li.fault .state { color: var(--fault); font-weight: 600; }
.watch li.overdue .state { color: var(--overdue); font-weight: 600; }
.menu > summary { display: none; }
.me { padding: 14px 20px 0; margin-top: 12px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 12px; }
.me .who { font-weight: 600; color: var(--ink); }
.me .where { display: block; font-size: 12px; color: var(--ink-3); }
.me .links { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.me form { display: inline; }
.me button { font: inherit; font-size: 13px; background: none; border: 0; padding: 0; color: var(--brand-deep); cursor: pointer; }
.me button:hover { text-decoration: underline; }

/* status shapes (carried from the wall) */
.shape { width: 12px; height: 12px; display: inline-block; margin-top: 3px; }
.shape.ok { background: var(--ok); border-radius: 50%; }
.shape.overdue { background: var(--overdue); border-radius: 50%; }
.shape.fault { width: 0; height: 0; background: none; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 12px solid var(--fault); }
.shape.paused { background: var(--paused); border-radius: 50%; }
.shape.off { border: 2px solid var(--rule-strong); border-radius: 50%; width: 12px; height: 12px; background: transparent; }

/* ---------- page ---------- */
.main { padding: 28px 36px 64px; max-width: 1280px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 22px; }
.page-head .when { color: var(--ink-3); font-size: 13px; margin-top: 4px; max-width: 70ch; }
.page-head .actions { display: flex; gap: 10px; flex: none; }
section { margin-bottom: 30px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 10px; }
.sec-head .hint { margin: 0; text-align: right; }
.panel .sec-head { margin-top: 18px; }
.panel > .sec-head:first-child, .panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel h2, .panel h3 { margin-bottom: 10px; }
.panel h3 { margin-top: 18px; }
/* legacy subtitles ("h1.h > .small") that WO-15 to WO-18 turn into hints */
h1.h, h2.h { margin-bottom: 14px; }
h2.h { margin-top: 24px; }
.h .small, h2 .small, h3 .small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-3); margin-top: 3px; font-variation-settings: "wdth" 100; letter-spacing: 0; max-width: 70ch; }
h3 .small { display: inline; margin-left: 6px; }

/* buttons (``.btn`` and the plain ``button`` the older pages use) */
.btn, button, .button { font: inherit; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: var(--r-control); border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; line-height: 1.2; }
.btn:hover, button:hover, .button:hover { background: var(--brand-deep); text-decoration: none; }
.btn.secondary, button.secondary, .button.secondary { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.btn.secondary:hover, button.secondary:hover, .button.secondary:hover { background: var(--surface-2); }
.btn.quiet, button.link, .button.quiet { background: transparent; border-color: transparent; color: var(--brand-deep); padding-left: 6px; padding-right: 6px; }
.btn.quiet:hover, button.link:hover { background: transparent; text-decoration: underline; }
.btn.danger, button.danger { background: var(--surface); color: var(--overdue); border-color: var(--overdue); }
.btn.danger:hover, button.danger:hover { background: var(--overdue-tint); }
.btn.sm, button.small, .button.small { font-size: 13px; padding: 5px 10px; }
.btn.lg, button.big { font-size: 15px; padding: 11px 18px; }
.btn .count { font-size: 12px; font-weight: 600; min-width: 20px; padding: 1px 6px; border-radius: 10px; text-align: center; background: var(--overdue); color: #fff; }
.btn.secondary .count { background: var(--paused-tint); color: var(--ink-2); }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
form.inline { display: inline; }
a.small:not(.btn):not(.button) { font-size: 13px; }

/* tags */
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 3px; border: 1px solid; line-height: 1.3; vertical-align: middle; white-space: nowrap; color: var(--ink-2); border-color: var(--rule-strong); background: transparent; }
.tag.ok { color: var(--ok); border-color: var(--ok); background: var(--ok-tint); }
.tag.overdue { color: var(--overdue); border-color: var(--overdue); background: var(--overdue-tint); }
.tag.fault { color: var(--fault); border-color: var(--fault); background: var(--fault-tint); }
.tag.paused { color: var(--ink-2); border-color: var(--rule-strong); background: var(--paused-tint); }
.tag.plain { color: var(--ink-2); border-color: var(--rule-strong); background: transparent; }
.tag.urgent { color: var(--overdue); border-color: var(--overdue); background: transparent; }
p.tag { display: inline-block; white-space: normal; }

/* verdicts (home) */
.verdicts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--surface); overflow: hidden; }
.verdict { padding: 22px 26px; display: grid; grid-template-columns: 28px 1fr; gap: 16px; align-items: start; }
.verdict + .verdict { border-left: 1px solid var(--rule); }
.verdict .shape { width: 22px; height: 22px; margin-top: 6px; }
.verdict .shape.fault { border-left-width: 11px; border-right-width: 11px; border-bottom-width: 22px; }
.verdict .kicker { font-size: 13px; color: var(--ink-3); margin-bottom: 2px; }
.verdict .word { font-size: 28px; font-weight: 700; font-variation-settings: "wdth" 115; letter-spacing: -0.015em; line-height: 1.1; }
.verdict.ok .word { color: var(--ok); }
.verdict.overdue .word { color: var(--overdue); }
.verdict.fault .word { color: var(--fault); }
.verdict .detail { margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.verdict .detail b { color: var(--ink); font-weight: 600; }
.verdict .links { margin-top: 10px; display: flex; gap: 14px; font-size: 13px; }
.verdict.fault { background: var(--fault-tint); }
.verdict.overdue { background: var(--overdue-tint); }

/* needs-you list */
.needs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.needs li { display: grid; grid-template-columns: 120px 1fr auto; gap: 18px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.needs .kind { font-size: 13px; font-weight: 600; }
.needs .kind.overdue { color: var(--overdue); }
.needs .kind.fault { color: var(--fault); }
.needs .what { font-size: 14px; }
.needs .what .sub { color: var(--ink-3); font-size: 13px; display: block; }

/* tables */
table { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-panel); overflow: hidden; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 9px 12px; border-bottom: 1px solid var(--rule-strong); background: var(--surface-2); }
td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; font-size: 14px; }
tr:last-child td { border-bottom: 0; }
td.primary { font-weight: 600; }
td .sub { display: block; color: var(--ink-3); font-size: 12.5px; }
td.right, th.right, td.num, th.num { text-align: right; }
td.actions { text-align: right; white-space: nowrap; }
td.subject { max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.subject a, td.primary a { color: inherit; }
tr.overdue td:first-child, tr.tone-overdue td:first-child { box-shadow: inset 4px 0 0 var(--overdue); }
tr.overdue, tr.tone-overdue { background: color-mix(in srgb, var(--overdue) 5%, white); }
tr.fault td:first-child, tr.tone-fault td:first-child, tr.tone-warn td:first-child { box-shadow: inset 4px 0 0 var(--fault); }
tr.fault, tr.tone-fault, tr.tone-warn { background: color-mix(in srgb, var(--fault) 6%, white); }
tr.tone-soon td:first-child { box-shadow: inset 4px 0 0 var(--brand); }
tr.quiet td, tr.tone-paused td, tr.muted td { color: var(--ink-3); }
table.list input, table.list select { width: 100%; }
table.hours input[type="time"] { width: 8em; }
table.callers input, table.callers select { min-width: 7em; }
.narrow-input { width: 5em !important; }
table.audit td.changes { font-size: 13px; }
.chg { display: inline-block; margin: 0 10px 2px 0; }
.panel table { margin-top: 4px; }
table + form, table + p { margin-top: 12px; }
table.notifications tr.status-failed td, table.notifications tr.status-no_recipient td,
table.notifications tr.status-undeliverable td { background: color-mix(in srgb, var(--fault) 6%, white); }

/* forms */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .help { font-size: 12.5px; color: var(--ink-3); }
.field-error { color: var(--overdue); font-size: 13px; margin: 0; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: var(--r-control); background: var(--surface); color: var(--ink); width: 100%; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.row { display: grid; gap: 16px; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.row.two { grid-template-columns: 1fr 1fr; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
.row > .grow { min-width: 0; }
.choice, label.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; padding: 6px 0; }
.choice input, label.check input { width: auto; margin-top: 3px; }
.choice .help { display: block; color: var(--ink-3); font-size: 12.5px; }
.stack.narrow { max-width: 640px; }
.stack.compact .field { margin-bottom: 10px; }
form.stack { margin-top: 10px; }
form.stack > button, form.stack > .btn { margin-top: 4px; }
form.stack + p, form + p.hint { margin-top: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; margin-bottom: 16px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink); }
.filters input, .filters select { width: auto; }
.filters input.short { width: 5em; }

/* panels */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-panel); padding: 18px 20px; margin-bottom: 16px; }
.panel.tint-fault, .panel.tone-fault, .panel.warn { background: var(--fault-tint); border-color: var(--fault); }
.panel.tone-warn { border-color: var(--fault); }
.panel.tint-overdue { background: var(--overdue-tint); border-color: var(--overdue); }
.panel.tint-brand { background: var(--brand-tint); border-color: var(--brand); }
.panel.subtle { background: transparent; }
.split, .two-col { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .split, .two-col { grid-template-columns: 1fr; } }

/* facts */
.facts, dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; min-width: 0; }
.obligations { list-style: none; padding: 0; margin: 12px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.obligations li { padding: 4px 9px; border-radius: var(--r-control); border: 1px solid var(--rule-strong); font-size: 13px; }
.obligations li.met { color: var(--ok); border-color: var(--ok); background: var(--ok-tint); }
.obligations li.overdue { color: var(--overdue); border-color: var(--overdue); background: var(--overdue-tint); }
.obligations li.fault { color: var(--fault); border-color: var(--fault); background: var(--fault-tint); }

/* steps (setup) */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 34px 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.steps li::before { counter-increment: s; content: counter(s); width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--rule-strong); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.steps li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.now::before { border-color: var(--brand); color: var(--brand); border-width: 2px; }
.steps .title { font-weight: 600; font-size: 15px; }
.steps .why { color: var(--ink-3); font-size: 13px; display: block; }
.steps li.done .title { color: var(--ink-2); }
.progress { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; margin: 10px 0 4px; }
.progress b { display: block; height: 100%; background: var(--brand); }

/* sub-navigation for Setup / Check-ins / Reports */
.subnav { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--rule-strong); margin-bottom: 22px; }
.subnav a { padding: 8px 12px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { text-decoration: none; color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--brand-deep); border-bottom-color: var(--brand); }
.setup-grid { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 32px; align-items: start; }
.setup-nav { display: flex; flex-direction: column; position: sticky; top: 28px; }
.setup-nav a { padding: 7px 10px; border-radius: var(--r-control); color: var(--ink); display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.setup-nav a:hover { background: var(--surface); text-decoration: none; }
.setup-nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-deep); font-weight: 600; }
.setup-nav .group { font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 14px 10px 4px; }
.setup-nav .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rule-strong); }
.setup-nav .dot.ok { background: var(--ok); }
.setup-nav .dot.fault { background: var(--fault); }

/* Setup pages (WO-16): the status panel a page opens with, the "More: …"
   disclosure for rarely-changed numbers, the save row, the per-row sub line */
.setup-body > section:first-child { margin-top: 0; }
.status-panel { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-panel); padding: 16px 20px; margin-bottom: 30px; }
.status-panel .shape { width: 16px; height: 16px; margin-top: 3px; }
.status-panel .shape.fault { width: 0; height: 0; border-left-width: 8px; border-right-width: 8px; border-bottom-width: 16px; }
.status-panel .shape.off { width: 16px; height: 16px; }
.status-panel h3 { font-size: 15px; }
.status-panel .hint { max-width: none; margin-top: 4px; }
.status-panel.fault { background: var(--fault-tint); border-color: var(--fault); }
.status-panel.fault h3 { color: var(--fault); }
details.more { margin: 6px 0 10px; }
details.more summary { cursor: pointer; color: var(--brand-deep); font-weight: 600; font-size: 13px; list-style: none; padding: 6px 0; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "▸ "; font-size: 11px; }
details.more[open] summary::before { content: "▾ "; }
details.more .more-body { padding: 10px 0 0; border-top: 1px solid var(--rule); margin-top: 4px; }
.save-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.save-row .hint { margin: 0; }
form.panel h3 { margin-top: 12px; }
form.panel .choice .help { max-width: 62ch; }
.field .label { font-size: 13px; font-weight: 600; color: var(--ink); }
table.advanced td code { display: inline-block; margin-top: 2px; }
table.history td.changes .chg { display: block; }
table.notices td .sub, table.history td .sub, table td .sub { display: block; color: var(--ink-3); font-size: 12.5px; }
.crumbs a { color: var(--ink-3); }
.setup-body table { margin-bottom: 4px; }

/* thread */
.msg, .message { padding: 12px 14px; border-left: 3px solid var(--rule-strong); background: var(--surface); border-radius: 0 var(--r-panel) var(--r-panel) 0; margin-bottom: 10px; }
.msg.out, .message.outbound { border-left-color: var(--brand); }
.msg .meta, .message header { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.msg .meta b, .message header b { color: var(--ink); }
.msg .body, .message .body { white-space: pre-wrap; font-size: 14px; font-family: inherit; margin: 0; }
.attachments { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }

/* journey (contact) */
.journey { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--surface); overflow: hidden; }
.journey .stage { padding: 12px 16px; display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.journey .stage + .stage { border-left: 1px solid var(--rule); }
.journey .stage .n { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--rule-strong); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--ink-2); margin-top: 1px; }
.journey .stage.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.journey .stage.now .n { border-color: var(--brand); color: var(--brand); border-width: 2px; }
.journey .stage.now { background: var(--brand-tint); }
.journey .stage.late { background: var(--overdue-tint); }
.journey .stage.late .n { border-color: var(--overdue); color: var(--overdue); }
.journey .stage .t { font-weight: 600; font-size: 14px; }
.journey .stage .d { font-size: 12.5px; color: var(--ink-2); display: block; }

/* flashes */
.flash { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.flash li { padding: 10px 14px; border-radius: var(--r-panel); font-size: 14px; border: 1px solid var(--rule-strong); background: var(--surface); }
.flash-ok { background: var(--ok-tint); border-color: var(--ok) !important; color: var(--ok); }
.flash-error { background: var(--overdue-tint); border-color: var(--overdue) !important; color: var(--overdue); }
.flash-message { background: var(--surface); }

/* transcript (check-in record) */
ol.transcript { list-style: none; margin: 0; padding: 0; }
ol.transcript li.turn { padding: 5px 10px; border-left: 3px solid var(--rule); margin: 3px 0; }
ol.transcript li.turn.assistant { border-left-color: var(--brand); }
ol.transcript li.turn.manager { border-left-color: var(--ok); }
ol.transcript li.turn.note { color: var(--ink-3); font-style: italic; }
ol.transcript li.turn.this { background: var(--brand-tint); }
ol.transcript .who { font-weight: 600; margin-right: 6px; }
table.list.compact { margin: 6px 0; width: auto; border: 0; background: transparent; }
table.list.compact th { text-align: left; color: var(--ink-3); font-weight: 600; padding: 3px 12px 3px 0; background: transparent; border: 0; }
table.list.compact td { padding: 3px 0; border: 0; }

/* misc */
.inline-list { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.explain { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--surface); overflow: hidden; }
.explain > div { padding: 22px 24px; }
.explain > div + div { border-left: 1px solid var(--rule); }
.explain h3 { font-size: 18px; font-variation-settings: "wdth" 112; margin-bottom: 8px; }
.explain p { color: var(--ink-2); font-size: 14px; }
.kbd-phone { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* sign-in: the product on the left, the form on the right (WO-13 mock 01) */
body.centered { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
body.login-page { display: block; }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr); }
.login .intro { padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; position: relative; }
.login .intro .wordmark { padding: 0; margin-bottom: 28px; }
.login .intro .wordmark .logo { width: 52px; height: 55px; }
.login .one-line { font-size: 26px; font-weight: 600; font-variation-settings: "wdth" 110; letter-spacing: -0.01em; color: var(--ink); max-width: 30ch; line-height: 1.2; margin-bottom: 18px; }
.login .lede { max-width: 54ch; font-size: 16px; margin-bottom: 30px; }
.login .three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--rule-strong); max-width: 640px; }
.login .three div { padding: 16px 18px 0 0; }
.login .three div + div { border-left: 1px solid var(--rule); padding-left: 18px; }
.login .three h3 { font-size: 15px; margin-bottom: 4px; }
.login .three p { font-size: 13.5px; color: var(--ink-2); }
.login .foot { position: absolute; left: 64px; bottom: 28px; font-size: 12.5px; color: var(--ink-3); display: flex; gap: 18px; }
.login .form { background: var(--surface); border-left: 1px solid var(--rule); display: flex; flex-direction: column; justify-content: center; padding: 56px 64px; }
.login .form form { max-width: 360px; width: 100%; }
.login .form h1 { font-size: 22px; margin-bottom: 4px; }
.login .form .hint { margin-bottom: 26px; }
.login .form .flash { margin-bottom: 14px; }
.login .form .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login .form .after { margin-top: 22px; font-size: 13px; color: var(--ink-3); }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; min-height: 0; }
  .login .intro { padding: 28px 20px 12px; order: 1; }
  .login .one-line { font-size: 20px; max-width: none; }
  .login .lede { font-size: 14.5px; margin-bottom: 18px; }
  .login .three { grid-template-columns: 1fr; max-width: none; }
  .login .three div + div { border-left: 0; border-top: 1px solid var(--rule); padding: 14px 0 0; margin-top: 14px; }
  .login .foot { position: static; padding: 18px 0 8px; order: 3; }
  .login .form { order: 2; border-left: 0; border-top: 1px solid var(--rule); padding: 28px 20px 40px; }
}

/* Today: the paused contacts fold away under the open table */
details.paused { margin-top: 10px; }
details.paused summary { cursor: pointer; list-style: none; margin: 0; max-width: none; }
details.paused summary::-webkit-details-marker { display: none; }
details.paused summary .toggle { color: var(--brand-deep); }
details.paused[open] summary .toggle { display: none; }
details.paused .sec-head { margin-top: 16px; }
.needs .what a { color: inherit; }
.needs .what a:hover { text-decoration: underline; }
.needs .kind.plain { color: var(--ink-2); }
.verdict .shape.off { margin-top: 6px; }
.verdict .detail a { color: var(--brand-deep); }
.first-run + .lede { margin-bottom: 22px; }

/* --- reports (WO-12) ------------------------------------------------------- */
/* The three daily states are told apart with colour removed: on time is a
   light cell with a thin dark rule, a problem is a dark cell with light
   text, did not report is an empty dashed cell. The luminances are far
   apart on purpose (tests/test_reports_ui.py checks them). */
:root {
  --day-good-bg: #f1f5f2;   --day-good-fg: #1f3a2a;   --day-good-line: #4d7a5c;
  --day-problem-bg: #5a1a1a; --day-problem-fg: #ffffff; --day-problem-line: #5a1a1a;
  --day-missed-bg: #ffffff;  --day-missed-fg: #4a4a4a;  --day-missed-line: #8a8a8a;
  --day-nostatus-bg: #e6e6e6; --day-nostatus-fg: #333333;
  --day-safety-bg: #fff2cc;  --day-safety-fg: #6b4c00;  --day-safety-line: #c99a00;
}
.cal-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 8px; }
.cal-nav { display: flex; gap: 16px; white-space: nowrap; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 8px 0; font-size: 13px; color: var(--ink-3); }
.legend .swatch { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -.2em; margin-right: .35em; border-radius: 3px; border: 1px solid var(--day-missed-line); }
.legend .swatch.reported_good { background: var(--day-good-bg); border-color: var(--day-good-line); }
.legend .swatch.reported_problem { background: var(--day-problem-bg); border-color: var(--day-problem-line); }
.legend .swatch.did_not_report { background: var(--day-missed-bg); border: 2px dashed var(--day-missed-line); }
.legend .swatch.reported_no_status { background: var(--day-nostatus-bg); }
.legend .swatch.not_judged { background: transparent; border-style: dotted; }
table.cal-grid { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; border: 0; background: transparent; border-radius: 0; overflow: visible; }
table.cal-grid th { font-size: 12px; color: var(--ink-3); text-align: center; background: transparent; border: 0; }
table.cal-grid td.cell { vertical-align: top; min-height: 6.5rem; height: 6.5rem; padding: .35rem .4rem; font-size: .8rem; }
/* The border and background sit on the lower-specificity selector so each
   state's rule below wins (WO-18: they had been losing to the table rule,
   leaving a problem day white on white). */
td.cell { border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--surface); }
td.cell .n { font-weight: 700; color: var(--ink-3); font-size: .8rem; }
td.cell.out { opacity: .35; }
td.cell.not-expected { background: transparent; }
td.cell.today { outline: 2px solid var(--rule-strong); }
td.cell.state-reported_good { background: var(--day-good-bg); color: var(--day-good-fg); border-color: var(--day-good-line); }
td.cell.state-reported_problem { background: var(--day-problem-bg); color: var(--day-problem-fg); border-color: var(--day-problem-line); }
td.cell.state-reported_good .n, td.cell.state-did_not_report .n, td.cell.state-reported_no_status .n,
td.cell.state-reported_good .muted, td.cell.state-did_not_report .muted, td.cell.state-reported_no_status .muted { color: rgba(0,0,0,.6); }
td.cell.state-reported_good a, td.cell.state-did_not_report a, td.cell.state-reported_no_status a { color: var(--brand-deep); }
td.cell.state-reported_problem .n, td.cell.state-reported_problem .muted { color: rgba(255,255,255,.8); }
td.cell.state-reported_problem a { color: #fff; }
td.cell.state-did_not_report { background: var(--day-missed-bg); color: var(--day-missed-fg); border: 2px dashed var(--day-missed-line); }
td.cell.state-reported_no_status { background: var(--day-nostatus-bg); color: var(--day-nostatus-fg); }
td.cell.state-not_judged { border-style: dotted; }
td.cell .chip { display: block; margin-top: .3rem; padding: .1rem .4rem; border-radius: 999px; font-weight: 650; font-size: .75rem; border: 1px solid currentColor; }
td.cell .chip.sched.good::before { content: "● "; }
td.cell .chip.sched.problem::before { content: "▲ "; }
td.cell .chip.sched.missed::before { content: "○ "; }
td.cell .chip.sched.missed { border-style: dashed; }
td.cell .chip.sched.nostatus::before { content: "◐ "; }
td.cell .chip.sched.unjudged { border-style: dotted; font-weight: 500; }
td.cell .chip.safety { background: var(--day-safety-bg); color: var(--day-safety-fg); border-color: var(--day-safety-line); }
td.cell .chip.safety.unclear { background: transparent; }
td.cell .words { margin-top: .3rem; }
td.cell a.open { display: inline-block; margin-top: .25rem; }
.legend .chip.safety { display: inline-block; padding: 0 .4rem; border-radius: 999px; border: 1px solid var(--day-safety-line); background: var(--day-safety-bg); color: var(--day-safety-fg); font-size: .75rem; margin-right: .35em; }
p.counts b { font-variant-numeric: tabular-nums; }

/* —— The shell at 1024px and below (WO-18): the sidebar becomes a sticky top
   bar (wordmark, the five areas, a Menu holding the person and the links)
   and "Pulse is watching" becomes one status line under it, every line
   still present with its shape and words. Pages stack; tables scroll
   inside themselves so nothing overflows the viewport. Desktop is primary. —— */
@media (max-width: 1024px) {
  .shell { display: block; }
  .side {
    position: sticky; top: 0; z-index: 20; height: auto; overflow: visible;
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "mark nav menu" "watch watch watch";
    align-items: center; gap: 2px 12px;
    padding: 6px 14px 0; border-right: 0; border-bottom: 1px solid var(--rule);
  }
  .wordmark { grid-area: mark; padding: 4px 0; gap: 8px; }
  .wordmark .logo { width: 28px; height: 30px; }
  .nav { grid-area: nav; flex-direction: row; flex-wrap: wrap; gap: 2px; padding: 0; }
  .nav a { padding: 7px 9px; gap: 6px; font-size: 14px; white-space: nowrap; }
  .nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--brand); }
  .menu { grid-area: menu; position: relative; justify-self: end; }
  .menu > summary { display: inline-flex; align-items: center; cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; padding: 6px 12px; border: 1px solid var(--rule-strong); border-radius: var(--r-control); background: var(--surface); color: var(--ink); }
  .menu > summary::-webkit-details-marker { display: none; }
  .menu[open] > summary { background: var(--surface-2); }
  .menu .me { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: max-content; min-width: 220px; margin: 0; padding: 12px 16px; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-panel); flex-direction: column; align-items: flex-start; gap: 10px; }
  .me .links { align-items: flex-start; }
  .watch { grid-area: watch; margin: 4px 0 0; padding: 6px 0 6px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
  .watch h2 { margin: 0; font-size: 12px; white-space: nowrap; }
  .watch ul { flex-direction: row; flex-wrap: wrap; gap: 2px 16px; }
  .watch li { grid-template-columns: 12px auto; gap: 6px; font-size: 12px; line-height: 1.4; }
  .watch li .shape { margin-top: 4px; }
  /* Every line keeps its name and shape; the words show for a line that is
     not fine (a fault is never hidden) and stay readable to a screen
     reader for the rest. */
  .watch li .state { display: inline; font-size: 12px; }
  .watch li.fault .name::after, .watch li.overdue .name::after { content: ": "; }
  .watch li.ok .state, .watch li.off .state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .main { padding: 18px 20px 48px; max-width: none; }
  .setup-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .setup-grid > * { min-width: 0; }
  .setup-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .setup-nav .group { width: 100%; padding: 10px 10px 2px; }
  .split, .two-col { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* A table scrolls inside itself. As a block its rows take their content
     width, so the frame is drawn on the cells, not the table. */
  table:not(.cal-grid):not(.compact) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; background: transparent; border: 0; border-radius: 0; }
  table:not(.cal-grid):not(.compact) th { border-top: 1px solid var(--rule); }
  table:not(.cal-grid):not(.compact) td { background: var(--surface); }
  table:not(.cal-grid):not(.compact) tr:last-child td { border-bottom: 1px solid var(--rule); }
  table:not(.cal-grid):not(.compact) th:first-child, table:not(.cal-grid):not(.compact) td:first-child { border-left: 1px solid var(--rule); }
  table:not(.cal-grid):not(.compact) th:last-child, table:not(.cal-grid):not(.compact) td:last-child { border-right: 1px solid var(--rule); }
  table:not(.cal-grid):not(.compact) tr.overdue td, table:not(.cal-grid):not(.compact) tr.fault td { background: inherit; }
  .page-head { flex-wrap: wrap; }
}

/* —— Phones (390px up): one column everywhere. —— */
@media (max-width: 720px) {
  .side { padding: 6px 10px 0; gap: 2px 8px; }
  .wordmark .org { display: none; }
  .main { padding: 16px 14px 48px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-head .actions { flex-wrap: wrap; }
  .verdicts, .explain, .journey, .row, .row.two, .row.three { grid-template-columns: 1fr !important; grid-auto-flow: row; }
  .needs li { grid-template-columns: 1fr; gap: 6px; }
  .status-panel { grid-template-columns: auto 1fr; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .sec-head .hint { text-align: left; }
}

/* --- Contacts and Check-ins areas (WO-17) ---------------------------------- */
.subnav .count { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 9px; background: var(--overdue); color: #fff; margin-left: 4px; vertical-align: middle; }
h1 .head-tag { vertical-align: middle; font-size: 13px; margin-left: 4px; }
.panel.banner { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.panel.banner .shape { margin-top: 0; }
.panel.banner .shape.overdue { border-bottom-color: var(--overdue); }
.panel.banner h3 { color: var(--overdue); margin-bottom: 2px; }
.panel.tint-fault.banner h3 { color: var(--fault); }
.panel.banner .hint { max-width: none; color: var(--ink-2); }
.panel.other { display: flex; flex-direction: column; gap: 12px; }
.panel.other .consequence { display: block; margin-top: 4px; }
.panel.other .divider { margin: 4px 0; border: 0; border-top: 1px solid var(--rule); }
details.action summary { list-style: none; display: inline-block; cursor: pointer; }
details.action summary::-webkit-details-marker { display: none; }
details.action[open] summary { margin-bottom: 10px; }
details.action .stack { margin-top: 6px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--surface-2); }
table.history td.when { color: var(--ink-3); width: 160px; }
table.strip td { white-space: nowrap; }
table.jobs tr.quiet td, table.strip tr.quiet td { color: var(--ink-3); }
.words { font-style: italic; }
form.filters[role="search"] { margin-bottom: 14px; }

/* —— The calendar's project picker (WO-21): a search field, two list tabs
   and the projects as links; the chosen one marked; scrolls inside itself. —— */
.panel.picker { padding: 16px 20px; }
.picker-head { margin: 0 0 12px; font-size: 16px; }
details.more.picker { margin: 0; }
details.more.picker summary { padding: 2px 0; }
details.more.picker .more-body { padding-top: 12px; margin-top: 8px; }
.picker-form { margin-bottom: 12px; }
.picker-form input[type="search"] { width: 22em; max-width: 100%; }
.picker-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.picker-tabs a { padding: 5px 12px; border: 1px solid var(--rule-strong); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.picker-tabs a:hover { text-decoration: none; color: var(--ink); border-color: var(--ink-3); }
.picker-tabs a[aria-current="true"] { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-deep); }
.picker-tabs .count { font-weight: 500; color: var(--ink-3); margin-left: 4px; font-variant-numeric: tabular-nums; }
.picker-tabs a[aria-current="true"] .count { color: var(--brand-deep); }
[data-role="picker-hint"] { margin: 0 0 4px; }
[data-role="picker-count"] { margin: 0 0 8px; font-variant-numeric: tabular-nums; }
.picker-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--surface); }
.picker-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 12px; border-bottom: 1px solid var(--rule); }
.picker-list li:last-child { border-bottom: 0; }
.picker-list li[aria-current="true"] { background: var(--brand-tint); box-shadow: inset 3px 0 0 var(--brand); }
.picker-list li[hidden] { display: none; }
.picker-list a { font-weight: 600; }
[data-role="picker-empty"] { margin: 8px 0 0; }
[data-role="picker-empty"][hidden] { display: none; }
@media (max-width: 720px) {
  .picker-form input[type="search"] { width: 100%; }
  .picker-form label { width: 100%; }
  .picker-list { max-height: 260px; }
}
@media (max-width: 720px) {
  .panel.banner { grid-template-columns: auto 1fr; }
  .panel.banner .btn { grid-column: 2; justify-self: start; }
  .split { grid-template-columns: 1fr; }
  table.history td.when { width: auto; white-space: normal; }
}
