/* ─────────────────────────────────────────────────────────────────────────
   Shared components. Every page links this after tokens.css, so a button, a
   card or a pager looks and behaves the same in every module.

   Both dashboards grew their own class names for the same things
   (button.approve / button.primary, .stat-card / .stat, .type-filter / .chips).
   Each component below answers to all of its names, so the pages' rendering
   code did not have to change to adopt it. New code should use the first
   name listed.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Icon shapes for masks ──
   Shapes, not colours: each is used as a mask-image and painted with a
   scheme colour, so no icon carries a colour of its own. */
:root {
  --ic-chart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 15l4-4 3 3 5-6'/%3E%3C/svg%3E");
  --ic-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.1V12a10 10 0 1 1-5.9-9.1'/%3E%3Cpath d='m22 4-10 10-3-3'/%3E%3C/svg%3E");
  --ic-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  --ic-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6M9 9l6 6'/%3E%3C/svg%3E");
  --ic-chat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
  --ic-send: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 2 11 13'/%3E%3Cpath d='M22 2 15 22l-4-9-9-4 20-7Z'/%3E%3C/svg%3E");
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
/* Always reserve the scrollbar's lane. Without it, any click that made a page
   tall enough to scroll (opening details, switching view, filtering) brought
   the scrollbar in and pushed the whole content column sideways and narrower
   — and back again when it went. */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; background: var(--page-bg); }
body {
  margin: 0; background: var(--page-bg); color: var(--text);
  font: var(--fw-regular) var(--fs-md)/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; font-weight: var(--fw-bold); }
a:hover { text-decoration: underline; }
code {
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  background: var(--surface-sunken); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border);
}
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow, .section-head {
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .08em;
  color: var(--text-3); text-transform: uppercase;
}
.section-head { display: block; margin: 30px 2px 12px; }
.spacer { flex: 1; }
[hidden] { display: none !important; }
.view { display: none; }
.view.active { display: block; animation: view-in .18s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Buttons ──
   .btn-primary  = button.approve = button.primary   (brand, the one action)
   .btn-ghost    = button.ghost                      (secondary)
   .btn-warn     = button.override / .approve.override (acts despite a hold) */
button { font: inherit; cursor: pointer; }
button.approve, button.primary, .btn-primary,
button.ghost, .btn-ghost,
button.override, .btn-warn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 18px; font-size: 13px; font-weight: var(--fw-bold); line-height: 1.3;
  white-space: nowrap; transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
button.approve, button.primary, .btn-primary { background: var(--accent); color: var(--on-fill); }
button.approve:hover, button.primary:hover, .btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-brand); }
button.ghost, .btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); font-weight: var(--fw-medium); }
button.ghost:hover, .btn-ghost:hover { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-tint); }
button.override, .btn-warn, button.approve.override {
  background: var(--surface); color: var(--warn); border-color: var(--warn-dot);
}
button.override:hover, .btn-warn:hover, button.approve.override:hover { background: var(--warn-soft); box-shadow: none; }
button:disabled, button:disabled:hover { opacity: .45; cursor: default; box-shadow: none; }
button.linklike {
  background: none; border: none; padding: 0; font: inherit; font-weight: var(--fw-bold);
  font-size: var(--fs-sm); color: var(--accent-text);
}
button.linklike:hover { text-decoration: underline; }
/* Round icon button — top bar actions. */
.icon-round {
  width: 38px; height: 38px; border-radius: 50%; border: none; background: transparent;
  color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; padding: 0;
  transition: background .15s, color .15s;
}
.icon-round:hover { background: var(--surface-sunken); color: var(--brand); }
/* A refresh in progress: the icon spins until the data lands. */
.icon-round.is-busy svg { animation: spin .8s linear infinite; color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .icon-round.is-busy svg { animation: none; } }
/* Content waiting on fresh data dims slightly, so a click visibly did something. */
.is-loading { opacity: .55; transition: opacity .2s; }

/* ── Form fields ── */
.field, .search, input.field, select.field {
  height: 40px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 13px; font-weight: var(--fw-medium); color: var(--text);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
textarea.field { height: auto; padding: 10px 14px; }
.field::placeholder, .search::placeholder { color: var(--text-3); }
.field:focus, .search:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.search {
  width: 300px; border-radius: var(--radius-pill); background: var(--surface-sunken); border-color: transparent;
  padding-left: 40px;
  /* An <input> has no pseudo-element to mask, so this one glyph names its
     colour: the slate of --text (#222E3A). */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23222E3A' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 15px center;
}
.search:focus { background-color: var(--surface); }
input[type="checkbox"] { accent-color: var(--accent); }
.select-all {
  display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted);
  font-weight: var(--fw-medium); cursor: pointer; user-select: none;
}
.select-all input { width: 16px; height: 16px; cursor: pointer; }
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }

/* ── Switch ── */
.switch { position: relative; flex: none; width: 44px; height: 24px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 12px; transition: background .16s; }
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: var(--surface); border-radius: 50%;
  box-shadow: var(--shadow-knob); transition: transform .16s;
}
.switch input:checked ~ .track { background: var(--accent); }
.switch input:checked ~ .knob { transform: translateX(20px); }
.switch input:focus-visible ~ .track { box-shadow: var(--focus-ring); }

/* ── Card / panel ── */
.card-surface, .panel {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel { padding: 24px 26px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-size: 18px; font-weight: var(--fw-bold); color: var(--text); letter-spacing: -0.01em; }
.panel-note { color: var(--muted); font-size: 13px; margin: 0 0 16px; max-width: 760px; line-height: 1.65; }

/* ── Chips (filters) ── */
.type-filter, .chips { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chips { display: flex; margin-bottom: 18px; }
.type-filter button, .chip {
  font: inherit; font-size: 12.5px; font-weight: var(--fw-medium); cursor: pointer;
  padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--muted); transition: all .15s;
}
.type-filter button:hover, .chip:hover { color: var(--accent-text); border-color: var(--accent-tint); }
.type-filter button.on, .chip.on { background: var(--accent); color: var(--on-fill); border-color: var(--accent); }
.type-filter button .n, .chip .n { opacity: .6; margin-left: 5px; font-weight: var(--fw-regular); }
.type-filter button.on .n, .chip.on .n { opacity: .85; }
.type-filter button[hidden] { display: none; }

/* ── Status pills & dots ── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: var(--fw-bold); padding: 3px 9px; border-radius: var(--radius-pill);
  text-transform: uppercase; letter-spacing: .04em;
}
.pill.on  { background: var(--good-soft); color: var(--good); }
.pill.off { background: var(--surface-sunken); color: var(--text-3); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--good); } .dot.bad { background: var(--bad-dot); } .dot.unknown { background: var(--text-3); }
.check, .check-pill {
  font-size: 11px; padding: 3px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); font-weight: var(--fw-bold); white-space: nowrap;
}
.check.pass, .check-pill.pass { color: var(--good); background: var(--good-soft); border-color: transparent; }
.check.fail, .check-pill.fail { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.check.warn, .check-pill.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.check.info, .check-pill.info { color: var(--info); background: var(--info-soft); border-color: transparent; }
.check-pill { font-size: 10px; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; flex: none; }

/* ── Stat cards (Horizon "mini statistics") ──
   An icon disc, a quiet label, a big value. The featured card is the queue
   someone opens the page to work, so it takes the logo's slate and orange. */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px; margin-bottom: 8px; }
.stat-card, .stat {
  position: relative; display: flex; align-items: center; gap: 16px; min-height: 98px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 22px; cursor: pointer; transition: box-shadow .15s, transform .15s;
}
.stat-card:hover, .stat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat.is-zero { cursor: default; }
.stat.is-zero:hover { transform: none; box-shadow: var(--shadow); }
/* The icon disc. Colours come from the scheme through three variables a tone
   sets; the glyph is a mask, so it is painted with --stat-ink rather than
   carrying a colour of its own. */
.stat-card, .stat {
  --stat-disc: var(--accent-soft); --stat-ink: var(--brand); --stat-icon: var(--ic-chart);
}
.stat-card::before, .stat::before {
  content: ''; width: 56px; height: 56px; border-radius: 50%; flex: none; background: var(--stat-disc);
}
.stat-card::after, .stat::after {
  content: ''; position: absolute; left: 37px; top: 50%; width: 26px; height: 26px; transform: translateY(-50%);
  background: var(--stat-ink); -webkit-mask: var(--stat-icon) center / contain no-repeat; mask: var(--stat-icon) center / contain no-repeat;
}
.stat-card > div:first-child, .stat > div:first-child { flex: 1; min-width: 0; }
.stat-card .l, .stat .l {
  font-size: 13px; font-weight: var(--fw-medium); color: var(--text-3); margin-bottom: 4px; letter-spacing: 0; text-transform: none;
}
.stat-card .n, .stat .n { font-size: 26px; font-weight: var(--fw-bold); line-height: 1.1; color: var(--text); letter-spacing: -0.01em; }
.stat-card.tone-good .n, .stat.good .n { color: var(--text); }
.stat-card.tone-good, .stat.good { --stat-disc: var(--good-soft); --stat-ink: var(--good); --stat-icon: var(--ic-check); }
.stat-card.tone-good .n, .stat.good .n { color: var(--text); }
.stat-card.tone-warn { --stat-disc: var(--warn-soft); --stat-ink: var(--warn-dot); --stat-icon: var(--ic-alert); }
.stat.tone-bad, .stat-card.tone-bad { --stat-disc: var(--bad-soft); --stat-ink: var(--bad-dot); --stat-icon: var(--ic-x); }
/* Work-first Overview (no Reports access): the queues a person acts on. */
.stat.tone-ready, .stat-card.tone-ready { --stat-disc: var(--accent-soft); --stat-ink: var(--brand); --stat-icon: var(--ic-send); }
.stat-card.tone-info { --stat-disc: var(--surface-sunken); --stat-ink: var(--muted); --stat-icon: var(--ic-chat); }
.stat-card.featured, .stat.featured {
  --stat-disc: var(--brand); --stat-ink: var(--on-fill); --stat-icon: var(--ic-send);
  background: var(--dark-gradient); box-shadow: var(--shadow-dark);
  grid-column: span 2;
}
.stat-card.featured::before, .stat.featured::before { box-shadow: var(--glow-brand); }
/* Needs review as the featured queue: same slate card, the alert glyph. */
.stat-card.featured.featured-review, .stat.featured.featured-review { --stat-icon: var(--ic-alert); }
.stat-card.featured .l, .stat.featured .l { color: var(--on-dark-2); }
.stat-card.featured .n, .stat.featured .n { color: var(--on-fill); font-size: 32px; }
.stat-card .go, .stat .go {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 13px; font-weight: var(--fw-bold); color: var(--accent-text);
}
.stat-card.featured .go, .stat.featured .go {
  color: var(--on-fill); background: var(--accent); padding: 9px 16px; border-radius: var(--radius-sm);
}
.stat-card.featured:hover .go, .stat.featured:hover .go { background: var(--accent-hover); }
.stat .go svg { width: 13px; height: 13px; }
/* On the small cards the way in is an arrow disc; the words would crowd the number. */
.stat-card:not(.featured) .go, .stat:not(.featured) .go {
  font-size: 0; gap: 0; width: 34px; height: 34px; border-radius: 50%; justify-content: center;
  background: var(--surface-sunken); color: var(--accent-text);
}
.stat-card:not(.featured) .go svg, .stat:not(.featured) .go svg { width: 14px; height: 14px; }
/* Zero is not a result worth colouring. */
.stat-card.is-zero:not(.featured) .n, .stat.is-zero:not(.featured) .n { color: var(--text-3); }

/* ── Paging ── */
.pager { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; font-size: 13px; font-weight: var(--fw-medium); color: var(--muted); }
.pager:empty { display: none; }
.pager .grow { flex: 1; }
.pager-size { display: inline-flex; align-items: center; gap: 8px; }
.pager-nav { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pager-nav button {
  font: inherit; font-size: 13px; font-weight: var(--fw-medium); cursor: pointer;
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--radius-xs); border: 1px solid transparent;
  background: var(--surface); color: var(--muted); box-shadow: var(--shadow);
}
.pager-nav button:hover:not(:disabled) { color: var(--accent-text); }
.pager-nav button.on { background: var(--accent); color: var(--on-fill); }
.pager-nav button:disabled { opacity: .38; cursor: default; }
.pager-nav .gap { padding: 0 2px; }
.list-summary { font-size: 13px; color: var(--muted); margin: -4px 0 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.list-summary:empty { display: none; }
.list-summary b { color: var(--text); font-weight: var(--fw-bold); }
.list-summary .sep { opacity: .45; }

/* ── Table ── */
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 14px 22px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
th { color: var(--text-3); font-weight: var(--fw-medium); font-size: 12px; text-transform: none; letter-spacing: 0; padding-top: 18px; padding-bottom: 12px; }
td { color: var(--text); font-weight: var(--fw-medium); }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); }

/* ── Empty states ── */
.empty-state { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; padding: 64px 40px; }
.empty-state .headline, .empty .headline { font-weight: var(--fw-bold); font-size: 18px; color: var(--text); }
.empty-state .sub, .empty .sub { color: var(--muted); font-size: 13.5px; margin: 8px auto 0; max-width: 420px; line-height: 1.6; }
/* Empty-state illustrations (assets/ui/illustrations.js): inline SVG in the
   brand tokens. Scales with its column; never wider than it reads well. */
.empty-illu { width: 100%; max-width: 340px; margin: -18px auto 6px; }
.empty-illu svg { display: block; width: 100%; height: auto; }
.empty .empty-illu { max-width: 300px; margin-top: 0; }
.empty-hint {
  margin-top: 18px; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted);
  background: var(--surface-sunken); padding: 7px 14px; border-radius: var(--radius-pill);
}
.empty-hint kbd, .keys kbd {
  background: var(--surface); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px;
  padding: 1px 6px; font-family: inherit; font-size: 11px; font-weight: var(--fw-bold); color: var(--text);
}

/* ── Alerts & banners ── */
.alert, .banner {
  padding: 13px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: var(--fw-medium); line-height: 1.55;
  background: var(--info-soft); color: var(--text);
}
.alert.bad { background: var(--bad-soft); color: var(--bad); font-weight: var(--fw-bold); }
.banner { background: var(--warn-soft); color: var(--warn); margin-bottom: 18px; }
.banner code { background: var(--tint-dark); border-color: transparent; }
.role-note { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 13px 18px; margin-bottom: 20px; font-size: 13px; color: var(--text); }

/* ── Key/value list ── */
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--text-3); font-weight: var(--fw-medium); }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }

/* ── Check breakdown rows ── */
.check-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); align-items: flex-start; font-size: 13px; }
.check-row:last-child { border-bottom: none; }
.check-name { font-weight: var(--fw-bold); min-width: 160px; flex: none; color: var(--text); }
.check-detail { color: var(--muted); flex: 1; min-width: 0; word-break: break-word; }
.anchor-line { display: flex; gap: 8px; padding: 3px 0; align-items: flex-start; }
.anchor-line .tag { font-size: 10px; font-weight: var(--fw-bold); padding: 1px 7px; border-radius: 6px; flex: none; margin-top: 2px; letter-spacing: .02em; }
.anchor-line .tag.ok { background: var(--good-soft); color: var(--good); }
.anchor-line .tag.no { background: var(--bad-soft); color: var(--bad); }
.anchor-line .tag.wr { background: var(--warn-soft); color: var(--warn); }

/* ── Bulk action bar ── */
.bulk-bar {
  position: fixed; bottom: 24px; left: calc(50% + var(--side-width) / 2); transform: translateX(-50%);
  background: var(--inverse-bg); color: var(--on-fill); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 12px 14px 12px 20px; display: none; align-items: center; gap: 14px; z-index: 60; max-width: calc(100vw - var(--side-width) - 40px);
}
.bulk-bar.show { display: flex; animation: view-in .18s ease-out; }
.bulk-count, .bulk-bar .count { font-size: 13.5px; font-weight: var(--fw-bold); white-space: nowrap; }
.bulk-bar .progress { font-size: 13px; color: var(--inverse-text); white-space: nowrap; }
.bulk-bar button.approve, .bulk-bar button.primary { background: var(--accent); color: var(--on-fill); }
.bulk-bar button.approve:hover, .bulk-bar button.primary:hover { background: var(--accent-soft); box-shadow: none; }
.bulk-bar button.ghost { background: transparent; color: var(--inverse-text); border-color: var(--inverse-line); }
.bulk-bar button.ghost:hover { background: var(--on-dark-hover); color: var(--on-fill); }
.bulk-bar .bulk-action {
  font: inherit; font-size: 13px; font-weight: var(--fw-medium); color: var(--on-fill); background: var(--on-dark-hover);
  border: 1px solid var(--inverse-line); border-radius: var(--radius-xs); height: 38px; padding: 0 10px; max-width: 260px; cursor: pointer;
}
.bulk-bar .bulk-action option { color: var(--text); background: var(--surface); }
.bulk-bar .bulk-action:disabled { opacity: .5; cursor: default; }

/* ── Toasts ── */
#toasts { position: fixed; top: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 120; }
.toast {
  background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--accent); padding: 12px 16px; font-size: 13.5px; max-width: 380px; color: var(--text);
  animation: toast-in .16s ease-out;
}
.toast.good { border-left-color: var(--good); }
.toast.bad { border-left-color: var(--bad-dot); }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ── Modal ── */
.overlay { position: fixed; inset: 0; background: var(--overlay); display: none; align-items: center; justify-content: center; z-index: 110; padding: 20px; backdrop-filter: blur(2px); }
.overlay.show { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 28px 30px; max-width: 480px; width: 100%; }
.modal h3 { margin: 0 0 6px; font-size: 20px; font-weight: var(--fw-bold); color: var(--text); }
.modal p, .modal p.sub { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; font-size: 13.5px; align-items: center; }
.keys kbd { justify-self: start; font-size: 12px; padding: 2px 8px; }

@media (max-width: 1024px) {
  .bulk-bar { left: 50%; max-width: calc(100vw - 32px); }
}

/* ── Charts (charts.js) & the Overview analytics panel (analytics.js) ── */
.an { margin-top: 30px; }
.an-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.an-title { margin: 0; font-size: 22px; font-weight: var(--fw-bold); color: var(--text); letter-spacing: -0.01em; }
.an-sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.an.has-error .an-sub { color: var(--bad); font-weight: var(--fw-bold); }
.chips.an-range { margin-bottom: 0; }
.an.is-loading .an-grid, .an.is-loading .an-kpis { opacity: .55; transition: opacity .2s; }

.an-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.kpi {
  position: relative; display: flex; align-items: flex-start; gap: 14px; overflow: hidden;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-height: 112px;
}
.kpi-ic {
  width: 48px; height: 48px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--brand);
}
.kpi-ic svg.ic { width: 22px; height: 22px; }
.kpi-body { min-width: 0; flex: 1; position: relative; z-index: 1; }
.kpi-label { font-size: 13px; color: var(--text-3); font-weight: var(--fw-medium); }
.kpi-value { font-size: 28px; font-weight: var(--fw-bold); color: var(--text); line-height: 1.15; margin-top: 2px; letter-spacing: -0.01em; }
.kpi-foot { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.kpi-spark { position: absolute; left: 82px; right: 16px; bottom: 10px; height: 36px; }
.kpi-brand .kpi-body { padding-bottom: 30px; }
.delta { font-weight: var(--fw-bold); }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

.an-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.panel.chart-card { padding: 20px 22px 18px; margin: 0; min-width: 0; display: flex; flex-direction: column; overflow: visible; }
.chart-card.span-2 { grid-column: span 2; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.chart-head h3 { margin: 0; font-size: 17px; font-weight: var(--fw-bold); color: var(--text); }
.chart-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.chart-toggle { width: 34px; height: 34px; flex: none; background: var(--surface-sunken); }
.chart-toggle[aria-pressed="true"] { background: var(--accent); color: var(--on-fill); }
.chart-legend { margin-top: 10px; }
.chart-legend:empty, .chart-legend[hidden] { display: none; }
.chart-body { margin-top: 12px; min-width: 0; flex: 1; }
.chart-body[hidden] { display: none; }

.viz { position: relative; width: 100%; }
.viz svg { display: block; overflow: visible; }
.viz-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.viz-axis { fill: var(--text-3); font-size: 11px; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.viz-band { fill: var(--accent-soft); transition: opacity .1s; }
.viz-hit { cursor: crosshair; }
.viz-slice { cursor: pointer; transition: opacity .12s; }
.viz-slice:hover { opacity: .85; }
.viz-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); font-weight: var(--fw-medium); }
.viz-legend li { display: inline-flex; align-items: center; gap: 7px; }
.viz-key { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.viz-empty { color: var(--text-3); font-size: 13px; padding: 30px 0; text-align: center; }

.viz-donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.viz-donut-figure { position: relative; flex: none; }
.viz-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.viz-donut-center b { font-size: 24px; color: var(--text); font-weight: var(--fw-bold); line-height: 1.1; }
.viz-donut-center span { font-size: 12px; color: var(--text-3); }
.viz-legend-list { flex-direction: column; flex: 1; min-width: 160px; gap: 9px; }
.viz-legend-list li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 9px; align-items: center; }
.viz-legend-label { color: var(--text); }
.viz-legend-value { color: var(--text); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.viz-legend-pct { color: var(--text-3); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

.viz-ranked { display: grid; gap: 12px; align-content: start; }
.viz-rank-row { display: grid; grid-template-columns: minmax(90px, 42%) 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.viz-rank-label { color: var(--text); font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viz-rank-label small { display: block; color: var(--text-3); font-size: 11.5px; font-weight: var(--fw-regular); overflow: hidden; text-overflow: ellipsis; }
.viz-rank-track { height: 10px; border-radius: 0 5px 5px 0; background: var(--surface-sunken); overflow: hidden; }
.viz-rank-bar { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); }
.viz-rank-value { color: var(--text); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }

.viz-spark svg { display: block; }
.viz-spark-area { fill: var(--accent); opacity: .08; }
.viz-spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; opacity: .7; }
.viz-spark-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }

.viz-table { box-shadow: none; border-radius: 0; }
.viz-table th, .viz-table td { padding: 9px 12px; font-size: 13px; }
.viz-table th.num, .viz-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.chart-body[data-table] .tbl-wrap { max-height: 300px; overflow: auto; border-radius: var(--radius-xs); }

.viz-tip {
  position: fixed; z-index: 130; pointer-events: none; opacity: 0; transition: opacity .1s;
  background: var(--inverse-bg); color: var(--on-fill); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 10px 12px; font-size: 12.5px; min-width: 170px;
}
.viz-tip.show { opacity: 1; }
.viz-tip-head { font-weight: var(--fw-bold); margin-bottom: 6px; }
.viz-tip-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; padding: 2px 0; }
.viz-tip-row .viz-key { box-shadow: 0 0 0 2px var(--on-dark-ring); }
.viz-tip-label { color: var(--inverse-text); }
.viz-tip-total { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--inverse-line); color: var(--inverse-text); }
.viz-tip-total b { color: var(--on-fill); }

/* ── Module summary card (the Dashboard) ──
   One per module: its queues as rows, each a link into that queue. */
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 8px; }
.module-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; display: flex; flex-direction: column; }
.module-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.module-card-ic { width: 46px; height: 46px; border-radius: 14px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-gradient); color: var(--on-fill); }
.module-card-ic svg.ic { width: 22px; height: 22px; }
.module-card-head h3 { margin: 0; font-size: 18px; font-weight: var(--fw-bold); color: var(--text); }
.module-card-head .sub { font-size: 12.5px; color: var(--text-3); }
.module-card-head .open { margin-left: auto; }
.module-queue {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; margin: 0 -12px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-weight: var(--fw-medium); font-size: 14px; transition: background .12s;
}
.module-queue:hover { background: var(--surface-sunken); text-decoration: none; }
.module-queue .q-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--text-3); }
/* Ready is blue, not orange: an orange dot beside a red one reads as the same state. */
.module-queue .q-dot.accent { background: var(--info); }
.module-queue .q-dot.warn { background: var(--warn-dot); }
.module-queue .q-dot.bad { background: var(--bad-dot); }
.module-queue .q-label { flex: 1; }
.module-queue .q-n { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.module-queue .q-n.zero { color: var(--text-3); font-weight: var(--fw-medium); }
.module-queue .q-go { color: var(--text-3); width: 16px; height: 16px; }
.module-card-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.module-card-foot b { color: var(--text); font-size: 18px; display: block; }
.module-card.unavailable .module-queue, .module-card.unavailable .module-card-foot { opacity: .5; }
.module-card .module-error { color: var(--bad); font-size: 13px; font-weight: var(--fw-bold); margin: -4px 0 8px; }
.greeting { font-size: 15px; color: var(--muted); }

@media (max-width: 1280px) {
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Notification panel (notifications.js) ── */
.notify { position: relative; }
.notify-bell { position: relative; }
.notify-bell .notify-bell-ic { display: inline-flex; }
.notify.open .notify-bell { background: var(--accent-soft); color: var(--brand); }
.notify-count {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-pill); background: var(--accent); color: var(--on-fill);
  font-size: 10.5px; font-weight: var(--fw-bold); line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.notify.is-silent .notify-count { background: var(--side-icon); }
/* A soft pulse while something is unread — never in silent mode. */
.notify.has-unread .notify-count::after {
  content: ''; position: absolute; inset: -3px; border-radius: inherit; border: 2px solid var(--brand);
  animation: notify-pulse 2s ease-out infinite; pointer-events: none;
}
@keyframes notify-pulse { 0% { opacity: .7; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.5); } }
@media (prefers-reduced-motion: reduce) { .notify.has-unread .notify-count::after { animation: none; } }

.notify-panel {
  position: absolute; right: -56px; top: calc(100% + 14px); z-index: 120; width: 400px; max-width: calc(100vw - 24px);
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  display: flex; flex-direction: column; max-height: min(620px, calc(100vh - 120px)); overflow: hidden;
  animation: view-in .16s ease-out;
}
.notify-panel[hidden] { display: none; }
.notify-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }
.notify-head h3 { margin: 0; font-size: 18px; font-weight: var(--fw-bold); color: var(--text); }
.notify-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.notify-head .linklike { font-size: 12.5px; margin-top: 4px; white-space: nowrap; }
.notify-head .linklike:disabled { color: var(--text-3); opacity: 1; cursor: default; text-decoration: none; }
.notify-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 20px 12px; border-bottom: 1px solid var(--border); }
.notify-tabs { display: inline-flex; gap: 4px; background: var(--surface-sunken); padding: 3px; border-radius: var(--radius-sm); }
.notify-tabs button {
  border: none; background: none; padding: 6px 12px; border-radius: 9px; font-size: 12.5px; font-weight: var(--fw-medium);
  color: var(--muted); cursor: pointer;
}
.notify-tabs button.on { background: var(--surface); color: var(--text); font-weight: var(--fw-bold); box-shadow: var(--shadow); }
.notify-silent { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: var(--fw-medium); color: var(--muted); cursor: pointer; }

.notify-list { overflow-y: auto; flex: 1; padding: 6px 8px; scrollbar-width: thin; }
.notify-item {
  position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 12px 12px 14px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .12s;
}
.notify-item:hover, .notify-item:focus-visible { background: var(--surface-sunken); outline: none; }
.notify-item.unread { background: var(--accent-soft); }
.notify-item.unread:hover { background: var(--accent-tint); }
.notify-item.unread::before { content: ''; position: absolute; left: 4px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--brand); }
.notify-ic {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-sunken); color: var(--muted);
}
.notify-ic svg.ic { width: 17px; height: 17px; }
.notify-ic.tone-brand { background: var(--accent-soft); color: var(--brand); }
.notify-ic.tone-warn { background: var(--warn-soft); color: var(--warn); }
.notify-ic.tone-bad { background: var(--bad-soft); color: var(--bad); }
.notify-ic.tone-info { background: var(--info-soft); color: var(--info); }
.notify-item.unread .notify-ic { background: var(--surface); }
.notify-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.notify-title { font-size: 13.5px; font-weight: var(--fw-bold); color: var(--text); }
.notify-item:not(.unread) .notify-title { font-weight: var(--fw-medium); }
.notify-body { font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.notify-meta { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.notify-mark {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: none; background: transparent; color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.notify-item:hover .notify-mark, .notify-item:focus-within .notify-mark, .notify-mark:focus-visible { opacity: 1; }
.notify-mark:hover { background: var(--surface); color: var(--accent-text); }
.notify-mark svg.ic { width: 15px; height: 15px; }
.notify-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 40px 30px; color: var(--muted); font-size: 13px; }
.notify-empty b { color: var(--text); font-size: 15px; }
.notify-empty-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.notify-empty-ic svg.ic { width: 24px; height: 24px; }
.notify-foot { padding: 10px 20px; border-top: 1px solid var(--border); text-align: center; }
.notify-foot .linklike { font-size: 12.5px; color: var(--muted); }
.notify-foot .linklike:hover { color: var(--bad); }
.notify-foot .linklike:disabled { opacity: .45; cursor: default; text-decoration: none; }

.notify-pops { position: fixed; right: 20px; bottom: 20px; z-index: 125; display: flex; flex-direction: column; gap: 10px; width: 340px; max-width: calc(100vw - 32px); }
.notify-pop {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-lg); border-left: 4px solid var(--brand);
  color: inherit; text-decoration: none; font-weight: inherit; animation: toast-in .2s ease-out;
}
.notify-pop:hover { text-decoration: none; background: var(--surface-2); }
.notify-pop.tone-warn { border-left-color: var(--warn-dot); }
.notify-pop.tone-bad { border-left-color: var(--bad-dot); }
.notify-pop.tone-info { border-left-color: var(--info); }
.notify-pop-more { font-size: 12.5px; color: var(--muted); border-left-color: var(--border-strong); }

/* ── Dropdowns (<select>) ──
   Themed in two layers:
   1. Everywhere: the closed control drops the browser chrome and draws its
      own chevron from two gradient halves, so its colour is a token like
      everything else. The right padding is the chevron's own lane — text
      truncates before it, and the chevron never touches the border.
   2. Where the browser allows styling the OPEN list (appearance: base-select,
      Chrome/Edge 2025+), the list becomes our card: rounded, shadowed, with
      brand hover and a checkmark. Elsewhere the native list still opens from
      the themed control. */
select.field, .bulk-bar select.bulk-action {
  --chev: var(--side-icon);
  appearance: none; -webkit-appearance: none;
  padding-right: 42px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--chev) 50%),
    linear-gradient(135deg, var(--chev) 50%, transparent 50%);
  background-position: calc(100% - 21px) 52%, calc(100% - 16px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
select.field:hover:not(:disabled) { border-color: var(--accent-tint); }
select.field:focus, select.field:focus-visible { --chev: var(--accent); }
select.field:disabled { opacity: .55; cursor: not-allowed; }
.bulk-bar select.bulk-action { --chev: var(--inverse-text); padding-right: 38px; background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; }
select.field option { color: var(--text); background: var(--surface); }

@supports (appearance: base-select) {
  /* The closed control keeps layer 1's drawn chevron in the padding lane and
     clips a long choice at the content edge, so it never runs under the
     chevron or past the border into the next field. */
  select.field, .bulk-bar select.bulk-action {
    appearance: base-select; -webkit-appearance: base-select;
    display: inline-flex; align-items: center;
    overflow: clip; overflow-clip-margin: content-box;
  }
  select.field::picker-icon, .bulk-bar select.bulk-action::picker-icon { display: none; }
  select.field:open, .bulk-bar select.bulk-action:open {
    background-image:
      linear-gradient(225deg, transparent 50%, var(--chev) 50%),
      linear-gradient(315deg, var(--chev) 50%, transparent 50%);
    background-position: calc(100% - 21px) 46%, calc(100% - 16px) 46%;
  }
  .bulk-bar select.bulk-action:open { background-position: calc(100% - 19px) 46%, calc(100% - 14px) 46%; }
  select.field:open { border-color: var(--accent); box-shadow: var(--focus-ring); --chev: var(--accent); }
  select.field::picker(select), .bulk-bar select.bulk-action::picker(select) {
    appearance: base-select;
    margin: 6px 0; padding: 6px; min-width: anchor-size(width);
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    max-height: min(340px, 60vh); max-width: min(440px, 92vw); overflow-y: auto;
  }
  select.field option, .bulk-bar select.bulk-action option {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; border-radius: var(--radius-xs);
    font: inherit; font-size: 13px; font-weight: var(--fw-medium); color: var(--text); background: transparent;
    cursor: pointer; white-space: normal; line-height: 1.35;
  }
  select.field option:hover, select.field option:focus-visible,
  .bulk-bar select.bulk-action option:hover, .bulk-bar select.bulk-action option:focus-visible {
    background: var(--surface-sunken); outline: none;
  }
  select.field option:checked, .bulk-bar select.bulk-action option:checked {
    background: var(--accent-soft); color: var(--accent-text); font-weight: var(--fw-bold);
  }
  select.field option::checkmark, .bulk-bar select.bulk-action option::checkmark { order: 1; margin-left: auto; color: var(--accent); }
  select.field option:disabled, .bulk-bar select.bulk-action option:disabled { color: var(--text-3); cursor: not-allowed; background: transparent; }
}

/* ── Note dialog (askForNote) ──
   For actions that need a reason on the record — Dismiss, Mark delivered.
   One dialog does the asking AND the confirming: what it is, why, what will
   happen, and a button named for the action. */
.modal.modal-note { max-width: 520px; padding: 26px 28px 22px; }
.modal-note-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.modal-ic {
  width: 44px; height: 44px; border-radius: 14px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-sunken); color: var(--muted);
}
.modal-ic svg.ic { width: 22px; height: 22px; }
.modal-ic.tone-good { background: var(--good-soft); color: var(--good); }
.modal-ic.tone-warn { background: var(--warn-soft); color: var(--warn); }
.modal-ic.tone-bad { background: var(--bad-soft); color: var(--bad); }
.modal-note-head h3 { margin: 0 0 4px; }
.modal-subject { font-size: 13px; color: var(--muted); line-height: 1.5; word-break: break-word; }
.modal-subject b { color: var(--text); }
.note-label { display: block; font-size: 13px; font-weight: var(--fw-bold); color: var(--text); margin: 4px 0 8px; }
.note-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.note-presets .chip { padding: 5px 12px; font-size: 12.5px; }
.modal-note textarea.field {
  width: 100%; min-height: 84px; resize: vertical; line-height: 1.5; font-size: 13.5px;
}
.note-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.note-error { color: var(--bad); font-weight: var(--fw-bold); }
.modal-note textarea.field.invalid { border-color: var(--bad-dot); box-shadow: 0 0 0 3px var(--bad-soft); }
.modal-consequence {
  display: flex; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-sunken); color: var(--muted); font-size: 13px; line-height: 1.55;
}
.modal-consequence.tone-warn { background: var(--warn-soft); color: var(--warn); }
.modal-consequence svg.ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.modal-note .modal-actions { margin-top: 20px; }
.modal-note .modal-actions .kbd-hint { margin-right: auto; align-self: center; font-size: 12px; color: var(--text-3); }

/* Heatmap (Charts.heatmap): weekday × hour. */
.viz-heat-grid { display: grid; gap: 3px; align-items: center; }
.viz-heat-cell { height: 22px; border-radius: 4px; }
.viz-heat-row, .viz-heat-col { font-size: 11px; color: var(--text-3); }
.viz-heat-col { text-align: left; white-space: nowrap; overflow: visible; }
.viz-heat-key { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 10px; font-size: 11px; color: var(--text-3); }
.viz-heat-key i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

/* ── Delivered page (assets/ui/delivered.js), shared by every module ── */
.dv-switch { display: inline-flex; background: var(--surface-sunken); border-radius: var(--radius-pill); padding: 3px; gap: 2px; }
.dv-switch button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: var(--fw-bold); color: var(--muted); padding: 7px 16px; border-radius: var(--radius-pill); cursor: pointer; }
.dv-switch button.on { background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow); }
.dv-line { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dv-line b { color: var(--text); font-weight: var(--fw-bold); }
.dv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--series-1); flex: none; }
.dv-dot.auto { background: var(--series-2); }
.run-chip { font-size: 11.5px; font-family: var(--font-mono); color: var(--text-3); border: 1px solid var(--border-strong); border-radius: 6px; padding: 1px 6px; }
.view.dv-runs-mode .type-filter { display: none; }
.dv-runs { padding: 0; overflow: hidden; }
.batch { border-bottom: 1px solid var(--border); }
.batch:last-child { border-bottom: none; }
.batch-head { display: flex; align-items: center; gap: 16px; padding: 18px 26px; }
.batch-head:hover { background: var(--surface-2); }
.ring { width: 48px; height: 48px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: var(--fw-black); border: 3px solid var(--good); color: var(--good); background: var(--good-soft); }
.ring.partial { border-color: var(--warn-dot); color: var(--warn); background: var(--warn-soft); }
.ring.none { border-color: var(--bad-dot); color: var(--bad); background: var(--bad-soft); }
.batch-body { flex: 1; min-width: 0; }
.batch-title { font-size: 14px; font-weight: var(--fw-bold); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.batch-title .bid { color: var(--accent-text); font-family: var(--font-mono); font-size: 12.5px; }
.batch-title .who { color: var(--text-3); font-weight: var(--fw-medium); font-size: 12.5px; }
.batch-stats { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.batch-stats b { color: var(--text); font-weight: var(--fw-bold); }
.batch-stats .fail { color: var(--bad); font-weight: var(--fw-bold); }
.batch-orders { border-top: 1px solid var(--border); background: var(--surface-2); }
.batch-fail { padding: 10px 34px; font-size: 12.5px; color: var(--bad); border-top: 1px solid var(--border); }
