:root {
  color-scheme: light;
  --ground: #e6eaef;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --ink: #15233b;
  --ink-2: #4a5872;
  --ink-3: #7c879b;
  --line: #d6dde6;
  --cobalt: #4c66dd;
  --cobalt-soft: #e6ebfd;
  --cobalt-ink: #3149b8;
  --on-cobalt: #ffffff;
  --mark-lead: #d99a2b;
  --mark-wing: #7189f2;
  --signal: #d99a2b;
  --signal-soft: #f8edd6;
  --signal-ink: #7a5512;
  --alert: #c93c3c;
  --alert-soft: #fbe6e4;
  --ok: #23845f;
  --ok-soft: #dff2ea;
  --band: #15233b;
  --band-ink: #f2f5fb;
  --band-ink-2: #a9b6d0;
  --band-line: rgba(255, 255, 255, 0.1);
  --seg-done: #8da3ff;
  --seg-todo: rgba(255, 255, 255, 0.14);
  --seg-ok: #5ccb9c;
  --pay-1: #4c66dd;
  --pay-2: #8da3ff;
  --pay-3: #c3cefa;
  --pay-4: #9aa4b5;
  --top-h: 56px;
  --display:
    "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body:
    "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #0b1220;
    --surface: #141f36;
    --surface-2: #1a2640;
    --ink: #e8edf6;
    --ink-2: #a9b4c8;
    --ink-3: #7d8aa3;
    --line: #24324d;
    --cobalt: #8da3ff;
    --cobalt-soft: #1f2d5e;
    --cobalt-ink: #bac8ff;
    --on-cobalt: #0e1626;
    --mark-lead: #f0b848;
    --mark-wing: #8da3ff;
    --signal: #f0b848;
    --signal-soft: #3a2e14;
    --signal-ink: #f5cf7e;
    --alert: #f07a72;
    --alert-soft: #3d1c1f;
    --ok: #4fc495;
    --ok-soft: #133528;
    --band: #1b2a4e;
    --band-ink: #f2f5fb;
    --band-ink-2: #a3b2d3;
    --band-line: rgba(255, 255, 255, 0.09);
    --seg-done: #8da3ff;
    --seg-todo: rgba(255, 255, 255, 0.12);
    --seg-ok: #5ccb9c;
    --pay-1: #8da3ff;
    --pay-2: #5a70d6;
    --pay-3: #37468c;
    --pay-4: #5b6780;
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4 {
  font-family: var(--display);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.015em;
}
p {
  margin: 0;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2.5px solid var(--cobalt);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Top bar ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 6;
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px 0 16px;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.03em;
  flex: none;
}
.brand svg {
  width: 26px;
  height: 26px;
}
.site {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  flex: none;
}
.site strong {
  font-size: 14px;
}
.site span {
  font-size: 12.5px;
  color: var(--ink-3);
}
.cmd {
  position: relative;
  flex: 1;
  max-width: 680px;
  margin: 0 auto;
}
.cmd-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 8px 0 12px;
  border-radius: 10px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.cmd-box:focus-within {
  box-shadow: inset 0 0 0 2px var(--cobalt);
  background: var(--surface);
}
.cmd-box svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.cmd-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  padding: 0;
}
.cmd-box input::placeholder {
  color: var(--ink-3);
}
.cmd-box input:focus {
  outline: none;
}
.cmd-box kbd {
  font: 700 12px/1 var(--body);
  color: var(--ink-3);
  padding: 4px 7px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--line);
  background: var(--surface);
}
.links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
.links a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
}
.links a:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.links svg {
  width: 18px;
  height: 18px;
  flex: none;
}
/* Tooltips for the top bar links: show on hover or keyboard focus, stay while hovered, Escape dismisses */
.tipwrap {
  position: relative;
  display: flex;
}
.tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  width: max-content;
  max-width: 240px;
  padding: 8px 12px 9px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--surface);
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(10, 18, 34, 0.2);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.12s,
    visibility 0s linear 0.12s;
}
.tip::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top: 0;
  border-bottom-color: var(--ink);
}
.tip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 8px;
}
.tip b {
  display: block;
  font-weight: 700;
}
.tipwrap:hover .tip {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition:
    opacity 0.12s 0.25s,
    visibility 0s 0.25s;
}
.tipwrap:has(a:focus-visible) .tip {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.12s;
}
.tipwrap.tip-off .tip {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: none;
}
.tipwrap:nth-last-child(-n + 3) .tip {
  left: auto;
  right: 0;
  transform: none;
}
.tipwrap:nth-last-child(-n + 3) .tip::before {
  left: auto;
  right: 14px;
}
@media (min-width: 1440px) {
  .tip b {
    display: none;
  }
}

/* Command palette */
.palette {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: min(640px, calc(100vw - 24px));
  background: var(--surface);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px var(--line),
    0 18px 48px rgba(10, 18, 34, 0.22);
  padding: 10px;
  max-height: min(620px, calc(100vh - 90px));
  overflow: auto;
}
.palette[hidden] {
  display: none;
}
.suggest {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--cobalt);
  color: var(--on-cobalt);
  font-size: 14px;
}
.suggest[hidden] {
  display: none;
}
.suggest button {
  margin-left: auto;
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 13px;
  background: var(--on-cobalt);
  color: var(--cobalt-ink);
}
.pal-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
}
.group h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0;
  padding: 8px 8px 2px;
}
.group h3 svg {
  width: 15px;
  height: 15px;
}
/* Crew badge: the member's job as an icon (js/ui/avatar.js). Shared by the command bar, Underway, the drawer, the chat and the brief.
   The icon scales with the badge, so sizing a badge only needs width and height. The font is for the initial shown if a member has no icon. */
.crew-av {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cobalt-soft);
  color: var(--cobalt-ink);
  font: 800 13px/1 var(--display);
  letter-spacing: 0;
  transition:
    background-color 0.12s,
    color 0.12s;
}
.crew-av svg {
  width: 57%;
  height: 57%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (prefers-reduced-motion: reduce) {
  .crew-av {
    transition: none;
  }
}
.wf {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 7px 8px;
}
.wf .crew-av {
  margin-top: 1px;
}
.wf:hover .crew-av,
.wf:focus-visible .crew-av {
  background: var(--cobalt);
  color: var(--on-cobalt);
}
.wf-text {
  display: block;
  min-width: 0;
}
.wf:hover,
.wf:focus-visible {
  background: var(--surface-2);
}
.wf b {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 7px;
  font-size: 14.5px;
}
.wf .role {
  font-weight: 400;
  font-size: 13.5px;
  color: var(--ink-2);
}
.wf .live {
  font-size: 12px;
  font-weight: 700;
  color: var(--cobalt-ink);
  background: var(--cobalt-soft);
  border-radius: 99px;
  padding: 0 8px;
}
.wf .live {
  align-self: center;
}
.wf .desc {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.4;
}
.pal-foot {
  font-size: 13px;
  color: var(--ink-3);
  padding: 10px 8px 2px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.pal-empty {
  padding: 12px 8px;
  color: var(--ink-2);
  font-size: 14px;
}

/* ---------- Wall of tiles ---------- */
.wall {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  /* The two short tiles stack on the left (greeting at its own height, Underway takes the rest);
     the two long lists sit side by side at full height. */
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas:
    "sit sit sit sit dec dec dec dec todo todo todo todo"
    "run run run run dec dec dec dec todo todo todo todo"
    "pulse pulse pulse pulse pulse pulse pulse pulse pulse pulse pulse pulse"
    "day day day day day day day day day day day day";
}
.t-sit {
  grid-area: sit;
}
.t-todo {
  grid-area: todo;
}
.t-run {
  grid-area: run;
}
.t-dec {
  grid-area: dec;
}
.t-pulse {
  grid-area: pulse;
}
.t-day {
  grid-area: day;
}

.tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.tile-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 12px 16px 0;
  flex: none;
}
.tile-head h2 {
  font-size: 16px;
}
.tile-head a {
  margin-left: auto;
  font-size: 13px;
  color: var(--cobalt-ink);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
.tile-head a:hover {
  text-decoration: underline;
}
.tile-body {
  padding: 10px 16px 14px;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
}

/*
 * Status readout in a tile or panel head. Metric views show one only when something is off (.off);
 * there is no "fine" pill. Amber (.warn) means it waits on the user, and nothing else.
 */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}
.status.warn {
  color: var(--signal-ink);
}
.status.warn::before {
  background: var(--signal);
}
.status.bad {
  color: var(--alert);
}
.status.bad::before,
.status.off::before {
  background: var(--alert);
}
.status.off {
  color: var(--ink);
  font-weight: 700;
}
.day-left {
  font-size: 13px;
  color: var(--ink-3);
}

/* Pulse: one slim line, one headline per area; each opens that area's zoom view */
.t-pulse {
  flex-direction: row;
  flex-wrap: wrap;
  padding: 4px;
}
.pulse-item {
  flex: 1 1 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: max-content;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
}
.pulse-item + .pulse-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: var(--line);
}
.pulse-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.pulse-item:hover::before,
.pulse-item:hover + .pulse-item::before {
  opacity: 0;
}
.pulse-item svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ink-3);
}
.pulse-item b {
  color: var(--ink);
  font-weight: 700;
}
.pulse-item.off svg {
  color: var(--alert);
}

/* Situation tile */
.t-sit .tile-body {
  display: flex;
  flex-direction: column;
  padding-top: 16px;
}
.clock {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.9;
}
.clock b {
  font-size: clamp(48px, 4.4vw, 72px);
  font-variant-numeric: tabular-nums;
}
.clock span {
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink-2);
}
.dateline {
  color: var(--ink-3);
  font-size: 14px;
  margin-top: 8px;
}
.t-sit h1 {
  font-size: 20px;
  letter-spacing: -0.02em;
  margin: 14px 0 6px;
}
.brief {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}
.brief a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--cobalt-soft);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.brief a:hover {
  text-decoration-color: var(--cobalt);
}
.sit-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: auto;
  padding-top: 14px;
  font-size: 13px;
  color: var(--ink-3);
}
.sit-foot .btn-row {
  margin-left: auto;
}
.btn-row {
  display: flex;
  gap: 8px;
}
.btn {
  border: 0;
  border-radius: 9px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn:hover {
  box-shadow: inset 0 0 0 1px var(--ink-3);
}
.btn.primary {
  background: var(--cobalt);
  color: var(--on-cobalt);
  box-shadow: none;
}
.btn.primary:hover {
  filter: brightness(1.08);
}
.btn.small {
  padding: 6px 11px;
  font-size: 13px;
  border-radius: 8px;
}

/* Underway tile (the bold element) */
.t-run {
  background: var(--band);
  color: var(--band-ink);
  box-shadow: none;
}
.t-run .tile-head {
  padding: 14px 20px 0;
  align-items: baseline;
}
.t-run .tile-head h2 {
  font-size: 18px;
}
.t-run .tile-head p {
  color: var(--band-ink-2);
  font-size: 14px;
}
.t-run .tile-body {
  padding: 4px 20px 6px;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.runs {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* One slim row per run: badge, subject and step bar, then a one-line note. Details are in the tooltip. */
.run {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) minmax(96px, 30%);
  grid-template-areas: "av subj segs" ". note note";
  column-gap: 10px;
  row-gap: 1px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--band-line);
}
.run:first-child {
  border-top: 0;
}
.run:has(.run-act) {
  grid-template-areas: "av subj segs" ". note act";
}
.run > .crew-av {
  grid-area: av;
  width: 24px;
  height: 24px;
  font-size: 11.5px;
  background: rgba(141, 163, 255, 0.18);
  color: #c9d4ff;
}
.run-subj {
  grid-area: subj;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.run-act {
  grid-area: act;
  justify-self: end;
}
.t-run .run-act {
  padding: 2px 9px;
  background: transparent;
  color: var(--band-ink);
  box-shadow: inset 0 0 0 1px var(--band-line);
}
.run-empty {
  padding: 10px 0;
  font-size: 14px;
  color: var(--band-ink-2);
}
.run-stop {
  color: #f07a72;
}
.segs {
  grid-area: segs;
  display: flex;
  gap: 4px;
}
.seg {
  flex: 1;
  height: 9px;
  border-radius: 5px;
  background: var(--seg-todo);
  transform-origin: left center;
}
.seg.done {
  background: var(--seg-done);
}
.seg.now {
  background: linear-gradient(
    90deg,
    var(--seg-done) 0 30%,
    rgba(141, 163, 255, 0.35) 30% 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2.4s linear infinite;
}
.seg.wait {
  background: #f0b848;
}
.seg.fail {
  background: #f07a72;
}
.run[data-status="done"] .seg {
  background: var(--seg-ok);
}
.run-note {
  grid-area: note;
  font-size: 13px;
  line-height: 1.4;
  color: var(--band-ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "2 waiting on you → Decisions": the only amber in Underway, because it needs the user */
.uw-wait {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin: 4px 0 6px;
  padding: 4px 11px 4px 9px;
  border-radius: 99px;
  background: rgba(240, 184, 72, 0.14);
  color: #f5cf7e;
  font-size: 13.5px;
  text-decoration: none;
}
.uw-wait::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f0b848;
  flex: none;
}
.uw-wait b {
  color: #f0b848;
}
.uw-wait:hover {
  background: rgba(240, 184, 72, 0.22);
}
.uw-wait[hidden],
.uw-done[hidden] {
  display: none;
}

/* "3 finished today": finished runs, folded away */
.uw-done {
  margin-top: 2px;
  border-top: 1px solid var(--band-line);
  font-size: 13.5px;
  color: var(--band-ink-2);
}
.uw-done summary {
  padding: 8px 0;
  cursor: pointer;
  width: max-content;
}
.uw-done summary:hover {
  color: var(--band-ink);
}
.uw-done .run {
  opacity: 0.75;
}
.run.fresh {
  animation: fresh 1.6s ease-out;
}
@keyframes fresh {
  from {
    background: rgba(141, 163, 255, 0.16);
  }
  to {
    background: transparent;
  }
}
.t-run.intro .seg {
  animation: grow 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i) * 70ms + var(--r) * 120ms);
}
.t-run.intro .seg.now {
  animation:
    grow 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both,
    shimmer 2.4s linear infinite 0.8s;
  animation-delay: calc(var(--i) * 70ms + var(--r) * 120ms), 0.9s;
}
@keyframes grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

/* Decisions tile */
.t-dec {
  box-shadow: inset 0 0 0 1px var(--signal);
}
.t-dec .tile-head {
  background: var(--signal-soft);
  padding: 8px 14px;
  color: var(--signal-ink);
}
.t-dec .n {
  font-weight: 700;
  font-size: 13px;
  background: var(--signal);
  color: #15233b;
  border-radius: 99px;
  padding: 1px 9px;
}
.t-dec .tile-head p {
  flex-basis: 100%;
  font-size: 13px;
  line-height: 1.3;
}
.t-dec .tile-body {
  padding: 0;
}
/* Compact rows: title, a two-line detail (full text in the tooltip), then source and buttons on one line. */
.dec {
  padding: 7px 14px 8px;
  border-top: 1px solid var(--line);
}
.dec:first-child {
  border-top: 0;
}
.dec-title {
  display: block;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.3;
}
.dec-detail {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-2);
  margin-top: 1px;
}
.dec-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}
.dec-from {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.3;
  margin-right: auto;
}
.dec-foot .btn {
  flex: none;
}

/* To do: every open job, late first */
.t-todo .n {
  font-weight: 700;
  font-size: 13px;
  background: var(--line);
  color: var(--ink);
  border-radius: 99px;
  padding: 1px 9px;
}
.t-todo .tile-head p {
  flex-basis: 100%;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink-2);
}
.t-todo .tile-body {
  padding: 0;
}
.todo-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  flex: none;
}
.chip {
  border: 0;
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}
.chip span {
  opacity: 0.7;
}
.chip[aria-pressed="true"] {
  background: var(--cobalt);
  color: var(--on-cobalt);
  box-shadow: none;
}
.todos {
  list-style: none;
  margin: 0;
  padding: 0;
}
.todo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 10px;
  align-items: center;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
}
.todo.late {
  box-shadow: inset 3px 0 0 var(--alert);
}
.todo-title {
  font-weight: 700;
  line-height: 1.3;
}
.todo-subj,
.todo-meta {
  grid-column: 1;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-2);
}
.todo-act {
  grid-column: 2;
  grid-row: 1 / span 3;
}
.todo-role {
  color: var(--ink-3);
}
.todo-none,
.todo-late {
  color: var(--alert);
}
.todo-wait {
  font-size: 12.5px;
  color: var(--ink-3);
}
.todo-foot {
  padding: 8px 16px 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
}
.empty {
  padding: 18px 16px;
  color: var(--ink-2);
  font-size: 14px;
}

/* Census */
.bignum {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.bignum b {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.bignum span {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.3;
}
.spark {
  display: block;
  width: 100%;
  height: 30px;
  margin: 8px 0 10px;
}
.paybar {
  display: flex;
  height: 9px;
  border-radius: 5px;
  overflow: hidden;
  gap: 2px;
}
.paybar i {
  display: block;
}
.legend {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 16px;
  font-size: 13px;
  color: var(--ink-2);
}
.legend li {
  display: flex;
  align-items: center;
  gap: 7px;
}
.legend li span {
  margin-left: auto;
  color: var(--ink);
  font-weight: 700;
}
.sw {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: none;
}
.note {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.45;
}
.note p + p {
  margin-top: 2px;
}

/* Staffing */
.shift {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 66px;
  gap: 12px;
  align-items: center;
  padding: 4px 0;
}
.shift .lbl {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
}
.shift .hrs {
  font-size: 12.5px;
  color: var(--ink-3);
  display: block;
  font-weight: 400;
}
.meter {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--ok);
  border-radius: 4px;
}
.meter.short i {
  background: var(--alert);
}
.shift .val {
  text-align: right;
  font-size: 14px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.kpi b {
  display: block;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.kpi span {
  font-size: 12.5px;
  color: var(--ink-2);
  display: block;
  line-height: 1.35;
}
.tone-ok {
  color: var(--ok);
}
.tone-warn {
  color: var(--signal-ink);
}
.tone-bad {
  color: var(--alert);
}

/* Clinical */
.mlist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mlist li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px 112px;
  gap: 10px;
  align-items: baseline;
  padding: 5px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.mlist li:first-child {
  border-top: 0;
  padding-top: 0;
}
.mlist b {
  font-family: var(--display);
  font-size: 18px;
  text-align: right;
  line-height: 1.2;
}
.mlist .cmp {
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: right;
}
.mlist .cmp.down {
  color: var(--ok);
}
.mlist .cmp.up {
  color: var(--alert);
}

/* Compliance */
.callout {
  background: var(--cobalt-soft);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  line-height: 1.4;
  margin-bottom: 6px;
}
.callout b {
  display: block;
}
.dl {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dl li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.35;
}
.dl li:first-child {
  border-top: 0;
}
.dl time {
  font-weight: 700;
  color: var(--ink-2);
  font-size: 13px;
}
.dl .flag {
  color: var(--alert);
  font-weight: 700;
}

/* Your day: a proportional timeline with a live now-line */
.t-day .tile-body {
  padding: 6px 16px 12px;
}
.tl {
  position: relative;
  height: 96px;
}
.tl-hours span {
  position: absolute;
  top: 0;
  left: var(--x);
  font-size: 12px;
  color: var(--ink-3);
  padding-left: 5px;
  border-left: 1px solid var(--line);
  line-height: 16px;
}
.tl-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
}
.tl-track i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--cobalt);
  opacity: 0.45;
}
.tl-now {
  position: absolute;
  top: 16px;
  bottom: 0;
  left: var(--x);
  width: 2px;
  margin-left: -1px;
  background: var(--cobalt);
}
.tl-now::before {
  content: "";
  position: absolute;
  top: 5px;
  left: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cobalt);
  box-shadow: 0 0 0 3px var(--surface);
}
.tl-events {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tl-events li {
  position: absolute;
  top: 22px;
  left: var(--x);
  width: var(--w);
  padding: 16px 16px 0 0;
}
.tl-events li::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 2.5px var(--ink-3);
}
.tl-events time {
  display: block;
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.3;
}
.tl-events time em {
  font-style: normal;
  white-space: nowrap;
  color: var(--cobalt-ink);
  margin-left: 6px;
}
.tl-events span {
  display: block;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.35;
}
.tl-events li.past {
  opacity: 0.55;
}
.tl-events li.past::before {
  background: var(--ink-3);
  box-shadow: none;
}
.tl-events li.next::before {
  background: var(--cobalt);
  box-shadow: 0 0 0 3px var(--cobalt-soft);
}

/* ---------- Drawer ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(10, 18, 34, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.scrim.open {
  opacity: 1;
  pointer-events: auto;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100%);
  background: var(--surface);
  box-shadow: -12px 0 40px rgba(10, 18, 34, 0.18);
  transform: translateX(102%);
  visibility: hidden;
  transition:
    transform 0.26s cubic-bezier(0.2, 0.7, 0.2, 1),
    visibility 0s linear 0.26s;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.drawer.open {
  transform: none;
  visibility: visible;
  transition:
    transform 0.26s cubic-bezier(0.2, 0.7, 0.2, 1),
    visibility 0s;
}
.d-head {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.d-head h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  letter-spacing: -0.025em;
}
.d-head h2 .crew-av {
  width: 38px;
  height: 38px;
  font-size: 17px;
}
.d-role {
  display: block;
  font-family: var(--body);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--ink-2);
  line-height: 1.3;
}
.d-head p {
  color: var(--ink-2);
  margin-top: 8px;
}
.d-close {
  margin-left: auto;
  border: 0;
  background: var(--surface-2);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 20px;
  line-height: 1;
  flex: none;
}
.d-body {
  padding: 18px 24px;
  overflow: auto;
  flex: 1;
}
.d-body h3 {
  font-size: 15px;
  margin: 18px 0 8px;
}
.d-body h3:first-child {
  margin-top: 0;
}
.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: s;
}
.steps li {
  counter-increment: s;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  align-items: start;
}
.steps li::before {
  content: counter(s);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--cobalt-soft);
  color: var(--cobalt-ink);
}
.steps li.you::before {
  background: var(--signal);
  color: #15233b;
}
.steps small {
  display: block;
  color: var(--signal-ink);
  font-weight: 700;
  font-size: 12.5px;
}
.field label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  background: var(--surface-2);
  color: var(--ink);
}
.field input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--cobalt);
}
.facts {
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: var(--ink-2);
  margin-top: 14px;
}
.d-error {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--alert-soft);
  color: var(--alert);
  font-size: 14px;
}
.d-error[hidden] {
  display: none;
}
.check {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--cobalt);
}
.check small {
  display: block;
  font-weight: 400;
  color: var(--ink-2);
  font-size: 13px;
  margin-top: 2px;
}
.d-note {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 14px;
}
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  background: var(--surface-2);
  color: var(--ink);
  resize: vertical;
}
.field textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--cobalt);
}

.d-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ---------- Ask The Fleet chat ---------- */
.ask-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 38px;
  padding: 0 14px 0 11px;
  border: 0;
  border-radius: 10px;
  background: var(--cobalt-soft);
  color: var(--cobalt-ink);
  font-weight: 700;
  font-size: 14px;
}
.ask-btn svg {
  width: 19px;
  height: 19px;
}
.ask-btn:hover {
  box-shadow: inset 0 0 0 1px var(--cobalt);
}
.ask-btn[aria-expanded="true"] {
  background: var(--cobalt);
  color: var(--on-cobalt);
}
.chat {
  position: fixed;
  z-index: 7;
  top: calc(var(--top-h) + 8px);
  right: 12px;
  width: min(420px, calc(100vw - 24px));
  height: min(660px, calc(100vh - var(--top-h) - 20px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px var(--line),
    0 18px 48px rgba(10, 18, 34, 0.24);
  overflow: hidden;
}
.chat[hidden] {
  display: none;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px 18px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.chat-head h2 {
  font-size: 18px;
}
.chat-head .btn {
  margin-left: auto;
  white-space: nowrap;
  flex: none;
}
.chat-x {
  border: 0;
  background: var(--surface-2);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 19px;
  line-height: 1;
  flex: none;
}
.chat-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}
.chat-intro p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}
.chat-crew {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 12px 0 0;
  padding: 0;
}
.chat-crew li {
  display: flex;
  border-radius: 50%;
  cursor: default;
}
/* Hover or focus fills the badge, like the Ask The Fleet button when open. */
.chat-crew li:hover .crew-av,
.chat-crew li:focus-visible .crew-av {
  background: var(--cobalt);
  color: var(--on-cobalt);
}
/* Name-and-job tooltip on the chat's crew avatars; positioned by js/ui/chat.js. --ax is where the arrow points. */
.crew-tip {
  position: fixed;
  z-index: 9;
  width: max-content;
  max-width: 220px;
  padding: 7px 11px 8px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--surface);
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(10, 18, 34, 0.2);
}
.crew-tip[hidden] {
  display: none;
}
.crew-tip b {
  display: block;
  font-weight: 700;
}
.crew-tip::before {
  content: "";
  position: absolute;
  top: -5px;
  left: var(--ax, 50%);
  margin-left: -5px;
  border: 5px solid transparent;
  border-top: 0;
  border-bottom-color: var(--ink);
}
.crew-tip.above::before {
  top: auto;
  bottom: -5px;
  border-bottom: 0;
  border-top: 5px solid var(--ink);
}
.chat-try {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
}
.chat-try button {
  border: 0;
  text-align: left;
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 14px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.chat-try button:hover {
  box-shadow: inset 0 0 0 1px var(--cobalt);
}
.msg {
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 92%;
}
.msg.you {
  align-self: flex-end;
  background: var(--cobalt-soft);
  border-radius: 12px 12px 4px 12px;
  padding: 8px 12px;
  white-space: pre-wrap;
}
.msg.fleet {
  align-self: flex-start;
}
.msg.fleet p + p,
.msg.fleet p + ul,
.msg.fleet ul + p,
.msg.fleet p + ol,
.msg.fleet ol + p {
  margin-top: 8px;
}
.msg.fleet ul,
.msg.fleet ol {
  margin: 0;
  padding-left: 20px;
}
.msg.fleet li {
  margin: 2px 0;
}
.msg.error {
  color: var(--alert);
}
.msg-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
/* Assistants Ask The Fleet activated in this reply */
.msg.fleet ul.msg-tools {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.msg-tools li {
  font-size: 13px;
  color: var(--ink-2);
  padding-left: 20px;
  position: relative;
}
.msg-tools li::before {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  text-align: center;
}
.msg-tools li.working::before {
  content: "…";
}
.msg-tools li.done {
  color: var(--ok);
}
.msg-tools li.done::before {
  content: "✓";
}
.msg-tools li.failed {
  color: var(--alert);
}
.msg-tools li.failed::before {
  content: "✕";
}
.thinking {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 22px;
}
.thinking i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: blink 1.2s infinite ease-in-out;
}
.thinking i:nth-child(2) {
  animation-delay: 0.15s;
}
.thinking i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}
.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  flex: none;
}
.chat-form textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  max-height: 120px;
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.chat-form textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--cobalt);
}
.chat-form .btn {
  height: 40px;
}

/* ---------- Zoomed tile view ---------- */
.zscrim {
  position: fixed;
  inset: 0;
  z-index: 11;
  background: rgba(10, 18, 34, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s;
}
.zscrim.open {
  opacity: 1;
  pointer-events: auto;
}
.zoom {
  position: fixed;
  z-index: 12;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  background: var(--surface);
  color: var(--ink);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px var(--line),
    0 30px 80px rgba(10, 18, 34, 0.35);
  transform-origin: 0 0;
  overflow: hidden;
}
.zoom[hidden] {
  display: none;
}
.zoom.moving {
  transition: transform 0.34s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.zoom-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 20px 22px 0;
  flex: none;
}
.zoom-head h2 {
  font-size: 24px;
  letter-spacing: -0.025em;
}
.zoom-head a {
  margin-left: auto;
  font-size: 14px;
  color: var(--cobalt-ink);
  text-decoration: none;
  font-weight: 700;
}
.zoom-head a:hover {
  text-decoration: underline;
}
.zoom-head .status {
  font-size: 14px;
}
.zoom-close {
  margin-left: auto;
  border: 0;
  background: var(--surface-2);
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: 21px;
  line-height: 1;
  flex: none;
}
.zoom-head a + .zoom-close {
  margin-left: 4px;
}
.zoom-body {
  padding: 14px 22px 24px;
  overflow: auto;
  min-height: 0;
  transition: opacity 0.2s 0.14s;
}
.zoom.entering .zoom-body,
.zoom.leaving .zoom-body {
  opacity: 0;
  transition-delay: 0s;
}
.zoom-content {
  zoom: var(--z, 1);
}
.zv h3 {
  font-size: 15px;
  margin: 20px 0 8px;
}
.zv h3:first-child {
  margin-top: 0;
}
.zv > .kpis:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.zv .zv-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.zv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.zv-list li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.4;
}
.zv-list li:first-child {
  border-top: 0;
}
.zv-list b {
  font-weight: 700;
}
.zv-list span {
  color: var(--ink-2);
}
.zv p {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
}
.zv p + p {
  margin-top: 8px;
}
.spark-axis {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-3);
  margin: -6px 0 10px;
}
@media (max-width: 720px) {
  .zv-list li {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  opacity: 0;
  background: var(--ink);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s;
  pointer-events: none;
  z-index: 20;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Wall mode: on a big enough screen, everything fits one view ---------- */
@media (min-width: 1280px) and (min-height: 900px) {
  body {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .wall {
    flex: 1;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }
  .tile-body {
    overflow: auto;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1439px) {
  .links .t {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
@media (max-width: 1279px) {
  .wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* Pair tiles of similar length: the two short ones, then the two long lists. */
    grid-template-rows: none;
    grid-template-areas: "sit run" "dec todo" "pulse pulse" "day day";
  }
  .tl {
    height: 124px;
  }
}
@media (max-width: 980px) {
  .site {
    display: none;
  }
}
@media (max-width: 720px) {
  :root {
    --top-h: auto;
  }
  .top {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
  }
  .cmd {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .cmd-box kbd {
    display: none;
  }
  .links {
    margin-left: auto;
  }
  .links a {
    padding: 7px;
  }
  .ask-btn {
    padding: 0 10px;
  }
  .ask-btn .t {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .chat {
    top: auto;
    bottom: 8px;
    right: 8px;
    width: calc(100vw - 16px);
    height: min(620px, calc(100vh - 16px));
  }
  .tip {
    left: auto;
    right: 0;
    transform: none;
  }
  .tip::before {
    left: auto;
    right: 14px;
  }
  .pal-groups {
    grid-template-columns: 1fr;
  }
  .wall {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
    grid-template-areas: "sit" "dec" "todo" "run" "pulse" "day";
  }
  .run {
    grid-template-columns: 24px minmax(0, 1fr) 72px;
  }
  .pulse-item {
    flex-basis: 40%;
  }
  .pulse-item + .pulse-item::before {
    display: none;
  }
  .tl {
    height: auto;
  }
  .tl-hours,
  .tl-track,
  .tl-now {
    display: none;
  }
  .tl-events li {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    padding: 0 0 12px 22px;
  }
  .tl-events li::before {
    top: 4px;
    left: 0;
  }
  .tl-events li::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 18px;
    bottom: 2px;
    width: 3px;
    background: var(--line);
  }
  .tl-events li:last-child::after {
    display: none;
  }
}
/* ---------- Morning brief dialog (js/ui/brief.js). Everything is scoped to .bview with b- names. ---------- */
.bscrim {
  position: fixed;
  inset: 0;
  z-index: 11;
  background: rgba(10, 18, 34, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s;
}
.bscrim.open {
  opacity: 1;
  pointer-events: auto;
}
.bview {
  position: fixed;
  z-index: 12;
  inset: 24px;
  margin: auto;
  max-width: 1180px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--ink);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px var(--line),
    0 30px 80px rgba(10, 18, 34, 0.35);
  overflow: hidden;
}
.bview[hidden] {
  display: none;
}
.bview select,
.bview input,
.bview textarea {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface-2);
  border: 0;
  border-radius: 9px;
  padding: 7px 10px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.bview select:focus,
.bview input:focus,
.bview textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--cobalt);
}
.bview .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.b-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.b-titles {
  flex: 1;
  min-width: 0;
}
.b-kicker {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
}
.b-head h2 {
  font-size: 24px;
  letter-spacing: -0.025em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
}
.b-head h2 .status {
  font: 400 14px/1.4 var(--body);
  letter-spacing: 0;
}
.b-meta {
  font-size: 13.5px;
  color: var(--ink-2);
  margin-top: 3px;
}
.b-close {
  border: 0;
  background: var(--surface-2);
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: 21px;
  line-height: 1;
  flex: none;
}
.b-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
}
.b-sheet {
  overflow: auto;
  padding: 18px 22px 28px;
}
.b-side {
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--surface-2);
  padding: 14px 16px 24px;
}
.b-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  flex: none;
}
.b-keep {
  font-size: 13px;
  color: var(--ink-3);
  margin-right: auto;
}

.b-banner,
.b-stamp {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14.5px;
}
.b-banner {
  background: var(--signal-soft);
}
.b-banner b {
  color: var(--signal-ink);
}
.b-stamp {
  background: var(--ok-soft);
}
.b-stamp b {
  color: var(--ok);
}
.b-note {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.b-sec {
  margin-top: 22px;
}
.b-sec h3 {
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.b-count {
  font: 700 12px/1 var(--body);
  color: var(--ink-2);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px 8px;
}
.b-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.b-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.b-item:last-child {
  border-bottom: 0;
}
.b-p-high {
  --p: var(--alert);
  --p-ink: var(--alert);
}
.b-p-medium {
  --p: var(--signal);
  --p-ink: var(--signal-ink);
}
.b-p-low {
  --p: var(--cobalt);
  --p-ink: var(--cobalt-ink);
}
.b-prio {
  align-self: start;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  padding: 1px 0 1px 8px;
  border-left: 3px solid var(--p);
  color: var(--p-ink);
}
.b-owner {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 2px;
}
.b-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
.b-chip {
  border: 0;
  font-size: 12px;
  line-height: 1.4;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
button.b-chip:hover {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink-3);
}
.b-chip.b-done {
  background: var(--cobalt-soft);
  color: var(--cobalt-ink);
  box-shadow: none;
  font-weight: 700;
}
.b-nothing {
  color: var(--ink-3);
  font-size: 14px;
  padding: 8px 0;
}
.b-editing textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.45;
}
.b-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.b-row label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.b-row select {
  max-width: 100%;
}
.b-rm {
  margin-left: auto;
}
.b-pending {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--cobalt-ink);
}
.b-form {
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.b-form h4 {
  font-size: 15px;
  margin-bottom: 10px;
}
.b-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.b-fld label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.b-fld input,
.b-fld select {
  width: 100%;
  background: var(--surface);
}
.b-preview {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.b-preview ul {
  margin: 4px 0 0;
  padding-left: 18px;
}
.b-empty,
.b-busy {
  max-width: 460px;
  margin: 0 auto;
  padding: 64px 20px;
  text-align: center;
}
.b-empty h3 {
  font-size: 20px;
  margin-bottom: 8px;
}
.b-empty p {
  color: var(--ink-2);
  margin-bottom: 18px;
}
.b-busy {
  color: var(--ink-2);
}
.b-busy-sub {
  font-size: 13.5px;
  color: var(--ink-3);
  margin-top: 6px;
}

/* Fleet's voice: the headline, the ask bar and what it just changed */
.b-avatar {
  width: 30px;
  height: 30px;
  font-size: 14px;
}
.b-avatar.sm {
  width: 28px;
  height: 28px;
  font-size: 13px;
}
.b-avatar.lg {
  display: grid;
  width: 52px;
  height: 52px;
  font-size: 22px;
  margin: 0 auto 16px;
}
.b-lead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--cobalt-soft);
}
.b-banner + .b-lead,
.b-stamp + .b-lead {
  margin-top: 12px;
}
.b-lead-body {
  flex: 1;
  min-width: 0;
}
.b-lead-by {
  font-size: 13px;
  font-weight: 700;
  color: var(--cobalt-ink);
}
.b-lead-text {
  font: 500 18px/1.42 var(--display);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-top: 1px;
}
.b-lead-sub {
  font-size: 13.5px;
  color: var(--ink-2);
  margin-top: 6px;
}
.b-lead textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  resize: vertical;
  line-height: 1.45;
  background: var(--surface);
}
.b-tag {
  display: inline-block;
  font: 700 11.5px/1 var(--body);
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--cobalt-soft);
  color: var(--cobalt-ink);
  vertical-align: 1px;
}
.b-item .b-tag {
  margin-bottom: 4px;
}
.b-changed {
  background: var(--cobalt-soft);
  border-radius: 10px;
  margin: 0 -10px;
  padding-left: 10px;
  padding-right: 10px;
}
.b-changed .b-tag,
.b-changed .b-chip {
  background: var(--surface);
}
.b-ask {
  flex: none;
  padding: 10px 22px 12px;
  border-top: 1px solid var(--line);
}
.b-thread {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 14px;
}
.b-you {
  justify-self: end;
  max-width: 80%;
  padding: 6px 12px;
  border-radius: 12px 12px 4px 12px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.b-reply {
  max-width: 92%;
  color: var(--ink);
}
.b-reply > b {
  color: var(--cobalt-ink);
  margin-right: 4px;
}
.b-reply.b-no > b {
  color: var(--signal-ink);
}
.b-reply .btn {
  margin-left: 6px;
}
.b-working {
  color: var(--ink-2);
}
.b-ask-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.b-ask-row input {
  flex: 1;
  min-width: 0;
  height: 38px;
}
.b-ask-row input[readonly] {
  color: var(--ink-3);
}
.bview .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.b-spin {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  vertical-align: -4px;
  border-radius: 50%;
  border: 2.5px solid var(--cobalt-soft);
  border-top-color: var(--cobalt);
  animation: b-spin 0.9s linear infinite;
}
@keyframes b-spin {
  to {
    transform: rotate(360deg);
  }
}

.b-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.b-tabs [role="tab"] {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
}
.b-tabs [role="tab"]:hover {
  color: var(--ink);
}
.b-tabs [aria-selected="true"] {
  background: var(--cobalt-soft);
  color: var(--cobalt-ink);
}
.b-panel {
  padding-top: 14px;
  font-size: 14px;
}
.b-panel > p {
  color: var(--ink-2);
}
.b-panel h4 {
  font-size: 14px;
  margin: 18px 0 4px;
}
.b-checks,
.b-facts,
.b-left,
.b-log {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.b-checks li,
.b-facts li,
.b-left li,
.b-log li {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.b-checks li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
}
.b-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface);
  color: var(--ink-3);
}
.b-ok .b-mark {
  background: var(--ok-soft);
  color: var(--ok);
}
.b-bad .b-mark {
  background: var(--alert-soft);
  color: var(--alert);
}
.b-detail,
.b-left span,
.b-actor {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
}
.b-facts li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
}
.b-log li {
  display: grid;
  grid-template-columns: minmax(64px, auto) minmax(0, 1fr);
  gap: 10px;
}
.b-log time {
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
}
.b-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--cobalt-soft);
  color: var(--cobalt-ink);
  font-size: 13.5px;
}
.bview:not([hidden]) ~ .toast {
  bottom: 104px;
} /* clear the dialog's footer buttons */
.bview:not([hidden]):has(.b-ask) ~ .toast {
  bottom: 190px;
} /* and the ask bar above them */
@media (max-width: 980px) {
  .b-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .b-sheet,
  .b-side {
    overflow: visible;
  }
  .b-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 720px) {
  .bview {
    inset: 8px;
  }
  .b-head,
  .b-sheet,
  .b-foot,
  .b-ask {
    padding-left: 14px;
    padding-right: 14px;
  }
  .b-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .b-keep {
    width: 100%;
  }
  .bview:not([hidden]) ~ .toast {
    bottom: 128px;
  }
  .bview:not([hidden]):has(.b-ask) ~ .toast {
    bottom: 220px;
  }
}

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

/* ---------- Late jobs dialog (js/ui/late.js). Reuses the brief dialog's frame; names are l- scoped. ---------- */
.late-status {
  font-size: 13px;
  color: var(--signal-ink);
  font-weight: 700;
}
.late-status.off {
  color: var(--alert); /* late is off, not waiting on the user; amber stays for referrals to decide */
}
.late-status:empty {
  display: none;
}
.sit-foot .late-status {
  margin-left: 12px;
}
#lateView .b-meta {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
#lateView .b-meta .crew-av {
  margin-top: 1px;
}
.l-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding: 10px 22px;
  background: var(--surface-2);
  font-size: 14px;
  color: var(--ink-2);
  flex: none;
}
.l-clock b {
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
}
.l-count {
  font-weight: 700;
  color: var(--cobalt-ink);
}
.l-busy {
  margin-left: auto;
  font-weight: 700;
  color: var(--signal-ink);
}
.l-note {
  padding: 8px 22px;
  font-size: 13.5px;
  background: var(--signal-soft);
  color: var(--signal-ink);
  flex: none;
}
.l-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  overflow: hidden;
}
.l-jobs {
  list-style: none;
  margin: 0;
  padding: 6px 22px 14px;
  overflow: auto;
}
.l-job {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.l-job:first-child {
  border-top: 0;
}
.l-job-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.l-title {
  font-weight: 700;
  flex: 1;
  min-width: 0;
}
.l-badge {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.l-badge.late {
  background: var(--alert-soft);
  color: var(--alert);
  box-shadow: none;
}
.l-badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
  box-shadow: none;
}
.l-sub {
  font-size: 13.5px;
  color: var(--ink-2);
  margin-top: 2px;
}
.l-job.is-done .l-title {
  color: var(--ink-3);
  text-decoration: line-through;
}
.l-acts {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.l-act {
  display: block;
  border-left: 3px solid #7b5cd6;
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
  padding: 7px 11px;
  font-size: 13.5px;
  line-height: 1.4;
  animation: l-flash 1.4s ease-out;
}
.l-act.escalation {
  border-left-color: var(--alert);
}
.l-act.suggest_owner {
  border-left-color: var(--cobalt);
}
.l-act-top {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  align-items: baseline;
}
.l-meta {
  font-size: 12px;
  color: var(--ink-3);
}
.l-msg,
.l-why {
  display: block;
}
.l-why {
  color: var(--ink-3);
  font-size: 12.5px;
  margin-top: 2px;
}
.l-foot {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.l-divider {
  padding: 12px 0 2px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  margin-top: 6px;
}
.l-side {
  border-left: 1px solid var(--line);
  padding: 12px 18px;
  overflow: auto;
}
.l-side h3 {
  font-size: 14px;
  margin-bottom: 6px;
}
.l-sent {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.4;
}
.l-sent li {
  border-left: 3px solid #7b5cd6;
  padding-left: 9px;
}
.l-sent .l-meta {
  display: block;
}
.l-empty {
  color: var(--ink-3);
  font-size: 14px;
  padding: 10px 0;
}
.l-spacer {
  flex: 1;
}
@keyframes l-flash {
  from {
    background: var(--cobalt-soft);
  }
  to {
    background: var(--surface-2);
  }
}
@media (prefers-reduced-motion: reduce) {
  .l-act {
    animation: none;
  }
}
@media (max-width: 900px) {
  .l-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .l-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .l-jobs {
    overflow: visible;
  }
}
@media (max-width: 720px) {
  #lateView .b-head,
  .l-bar,
  .l-jobs,
  .l-side,
  .l-note {
    padding-left: 14px;
    padding-right: 14px;
  }
}
/* ---------- Review dialog: a real agent's own page in an iframe (js/ui/review.js) ---------- */
.rscrim {
  position: fixed;
  inset: 0;
  z-index: 13;
  background: rgba(10, 18, 34, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s;
}
.rscrim.open {
  opacity: 1;
  pointer-events: auto;
}
.rview {
  position: fixed;
  z-index: 14;
  inset: 24px;
  margin: auto;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--ink);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px var(--line),
    0 30px 80px rgba(10, 18, 34, 0.35);
  overflow: hidden;
}
.rview[hidden] {
  display: none;
}
.rv-head {
  display: flex;
  align-items: center;
  gap: 6px 14px;
  padding: 14px 18px;
  flex: none;
}
.rv-head h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
}
.rv-head .zoom-close {
  margin-left: 4px;
}
.rv-head h2 {
  margin-right: auto;
}
.iv-who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.iv-who select,
.iv-body select,
.iv-body input {
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}
.iv-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.iv-sec h3 {
  font-size: 13px;
  color: var(--ink-3);
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 8px;
}
.iv-sec h4 {
  font-size: 13px;
  margin: 0 0 6px;
}
.iv-muted {
  color: var(--ink-3);
  font-size: 12.5px;
}
.iv-states {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.iv-state {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink-3);
}
.iv-state.past {
  color: var(--ink-2);
}
.iv-state.now {
  background: var(--cobalt-soft);
  color: var(--cobalt-ink);
  font-weight: 700;
}
.iv-state.bad {
  background: var(--alert-soft);
  color: var(--alert);
}
.iv-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--alert-soft);
  color: var(--alert);
  font-size: 13px;
}
.iv-task {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.iv-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.iv-task .iv-split {
  margin: 0;
}
.iv-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.iv-row input,
.iv-wide {
  flex: 1;
  min-width: 180px;
}
.iv-wide {
  width: 100%;
  box-sizing: border-box;
  margin: 6px 0 10px;
}
.iv-tag {
  font-size: 12px;
  color: var(--ink-3);
}
.iv-tag.ok {
  color: var(--ok);
}
.iv-tag.bad {
  color: var(--alert);
  font-weight: 700;
}
.iv-scroll {
  overflow-x: auto;
}
.iv-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.iv-table th,
.iv-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.iv-table td:first-child {
  white-space: normal;
}
.iv-chip {
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink-3);
}
.iv-chip.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.iv-chip.bad {
  background: var(--alert-soft);
  color: var(--alert);
}
.iv-chip.warn {
  background: var(--signal-soft);
  color: var(--signal-ink);
}
.iv-note {
  font-size: 13px;
  margin: 8px 0 0;
}
.iv-summary {
  margin: 0 0 10px;
}
.iv-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.iv-totals div {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--ink-3);
}
.iv-totals b {
  display: block;
  font-size: 18px;
  color: var(--ink);
}
.iv-totals b.ok,
.iv-sec h4.ok {
  color: var(--ok);
}
.iv-totals b.bad,
.iv-sec h4.bad {
  color: var(--alert);
}
.iv-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.iv-cols ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}
.iv-cols li.warn {
  color: var(--signal-ink);
}
.iv-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
@media (max-width: 720px) {
  .rview {
    inset: 8px;
  }
}

/* Referrals dialog (js/ui/referral.js). Reuses the late-jobs list styles (.l-*). */
#referralView .b-meta {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
#referralView .b-meta .crew-av {
  margin-top: 1px;
}
.r-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  min-height: 0;
}
.r-card {
  padding: 16px 22px 18px;
  border-bottom: 1px solid var(--line, rgba(0, 0, 0, 0.1));
}
.r-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.r-head h3 {
  margin: 0 0 2px;
  font-family: var(--display);
  font-size: 18px;
}
.r-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}
.r-chip {
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.r-chip.ok {
  background: var(--cobalt-soft, var(--surface-2));
  color: var(--cobalt-ink);
}
.r-chip.warn {
  background: var(--signal-soft);
  color: var(--signal-ink);
}
.r-read {
  margin: 6px 0 2px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.r-read.ok {
  color: var(--cobalt-ink);
  font-weight: 600;
}
.r-read.busy {
  color: var(--signal-ink);
  font-weight: 700;
}
.r-jobs {
  overflow: visible;
}
.r-draft textarea,
.r-reason {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  padding: 8px 10px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.2));
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--ink);
}
.r-draft-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  margin: 8px 0 4px;
}
.r-decide {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.r-reason {
  flex: 1;
  min-width: 160px;
  width: auto;
}
.r-history {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 12.5px;
  color: var(--ink-2);
}
@media (max-width: 860px) {
  #referralView .l-body {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }
}
