/* OM dashboards. Layout: one column on phones with a 16px gutter; from 720px the tiles, job cards
   and detail panels flow into grids inside a 1200px frame. Colours are tokens on :root, redefined
   for dark mode. Status and alert colours are reserved for state and always sit next to a word. */

:root {
  color-scheme: light;
  --page: #f2f2ee;
  --surface: #ffffff;
  --surface-sunk: #f7f7f3;
  --ink: #171715;
  --ink-2: #4a4944;
  --ink-3: #686761;
  --line: #e0dfd8;
  --line-2: #c6c4bb;
  /* form field borders: 3:1 or more against surface and surface-sunk (WCAG 1.4.11) */
  --input-border: #858379;
  --scroll-fade: rgba(23, 23, 21, 0.18);
  --accent: #3047b8;
  --accent-ink: #ffffff;
  --accent-wash: #e8ebf9;
  --focus: #3047b8;
  /* chart series (validated: light surface, adjacent CVD dE 24.7) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --grid: #ebeae4;
  --axis: #c3c2b7;
  /* status */
  --good: #0ca30c;
  --good-wash: #e3f3e1;
  --good-ink: #1d5c1d;
  --warn: #fab219;
  --warn-wash: #fcefd0;
  --warn-ink: #674600;
  --crit: #d03b3b;
  --crit-wash: #fbe4e2;
  --crit-ink: #9a1f1f;
  --info: #66758f;
  --info-wash: #e7ebf1;
  --info-ink: #33405a;
  --on-info: #ffffff;
  --neutral: #8b8981;
  --neutral-wash: #ebeae5;
  --neutral-ink: #45443f;
  --danger-bg: #c23434;
  --danger-ink: #ffffff;
  --tip-shadow: 0 6px 20px rgba(20, 20, 18, 0.12);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0f0f0e;
    --surface: #1a1a19;
    --surface-sunk: #151514;
    --ink: #f1f0eb;
    --ink-2: #c3c2b7;
    --ink-3: #a09e95;
    --line: #2e2e2b;
    --line-2: #46453f;
    --input-border: #77756d;
    --scroll-fade: rgba(241, 240, 235, 0.16);
    --accent: #9fb0ff;
    --accent-ink: #10131f;
    --accent-wash: #1f2440;
    --focus: #9fb0ff;
    /* validated: dark surface, adjacent CVD dE 26.8 */
    --series-1: #3987e5;
    --series-2: #d95926;
    --grid: #282826;
    --axis: #3e3e3a;
    --good-wash: #15301a;
    --good-ink: #93dc8e;
    --warn-wash: #3a2d0b;
    --warn-ink: #f6cf72;
    --crit-wash: #3d1717;
    --crit-ink: #ffa3a3;
    --info: #8e9bb5;
    --info-wash: #1f2634;
    --info-ink: #c6cee0;
    --on-info: #10131f;
    --neutral-wash: #2a2a27;
    --neutral-ink: #d4d2c9;
    --danger-bg: #d03b3b;
    --tip-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0f0e;
  --surface: #1a1a19;
  --surface-sunk: #151514;
  --ink: #f1f0eb;
  --ink-2: #c3c2b7;
  --ink-3: #a09e95;
  --line: #2e2e2b;
  --line-2: #46453f;
  --input-border: #77756d;
  --scroll-fade: rgba(241, 240, 235, 0.16);
  --accent: #9fb0ff;
  --accent-ink: #10131f;
  --accent-wash: #1f2440;
  --focus: #9fb0ff;
  --series-1: #3987e5;
  --series-2: #d95926;
  --grid: #282826;
  --axis: #3e3e3a;
  --good-wash: #15301a;
  --good-ink: #93dc8e;
  --warn-wash: #3a2d0b;
  --warn-ink: #f6cf72;
  --crit-wash: #3d1717;
  --crit-ink: #ffa3a3;
  --info: #8e9bb5;
  --info-wash: #1f2634;
  --info-ink: #c6cee0;
  --on-info: #10131f;
  --neutral-wash: #2a2a27;
  --neutral-ink: #d4d2c9;
  --danger-bg: #d03b3b;
  --tip-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: break-word;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
pre {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
h1,
h2,
h3 {
  text-wrap: balance;
  line-height: 1.25;
}
h1 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.0625rem;
  font-weight: 650;
}
a {
  color: var(--accent);
  text-underline-offset: 2px;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
h1:focus,
main:focus {
  outline: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 8px;
}
.skip:focus {
  top: 8px;
}

/* ---------- top bar ---------- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-in {
  max-width: 1232px;
  margin: 0 auto;
  padding-inline: 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-mark rect {
  fill: var(--accent);
}
.brand-mark path {
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 2;
  stroke-linecap: round;
}
.session {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.session-email {
  color: var(--ink-3);
  font-size: 0.8125rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 28ch;
}
.nav-link {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
}
@media (max-width: 479px) {
  .session-email {
    display: none;
  }
  .brand span {
    font-size: 0.9375rem;
  }
}

/* ---------- page frame ---------- */

.page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1232px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 20px 56px;
  transition: opacity 0.15s ease;
}
.page.is-busy {
  opacity: 0.6;
}
.loading,
.quiet {
  color: var(--ink-3);
}
.page-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-block: 4px;
}
.page-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.page-title .page-asof {
  flex-basis: 100%;
}
.back-link {
  font-size: 0.875rem;
  font-weight: 600;
  align-self: flex-start;
}
.back-link::before {
  content: "\2190\00a0";
}
.lede {
  color: var(--ink-2);
}
.notice {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent-wash);
  color: var(--ink);
}
.banner {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent-wash);
  color: var(--ink);
  font-size: 0.875rem;
}
.message {
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  padding-block: 8vh 0;
}

/* ---------- panels ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.panel-intro {
  color: var(--ink-2);
  font-size: 0.875rem;
}
.sub-head {
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--ink-2);
  margin-top: 4px;
}
.split,
.detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 900px) {
  .page {
    padding-inline: 24px;
    padding-block: 28px 64px;
  }
  .topbar-in {
    padding-inline: 24px;
  }
  .split {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  h1 {
    font-size: 1.875rem;
  }
  .panel {
    padding: 18px 20px;
  }
}

/* ---------- pills, chips, as-of stamps ---------- */

.pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.pill {
  padding: 4px 11px 4px 9px;
}
.chip {
  padding: 2px 9px;
  font-size: 0.75rem;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.tone-good {
  background: var(--good-wash);
  color: var(--good-ink);
}
.tone-good .dot {
  background: var(--good);
}
.tone-warn {
  background: var(--warn-wash);
  color: var(--warn-ink);
}
.tone-warn .dot {
  background: var(--warn);
}
.tone-crit {
  background: var(--crit-wash);
  color: var(--crit-ink);
}
.tone-crit .dot {
  background: var(--crit);
}
.tone-info {
  background: var(--info-wash);
  color: var(--info-ink);
}
.tone-info .dot {
  background: var(--info);
}
.tone-neutral {
  background: var(--neutral-wash);
  color: var(--neutral-ink);
}
.tone-neutral .dot {
  background: var(--neutral);
}
.asof {
  color: var(--ink-3);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- alerts ---------- */

.alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 4px solid var(--neutral);
  background: var(--surface-sunk);
}
.alert-level {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 8px;
  border-radius: 4px;
}
.alert-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.level-red {
  border-left-color: var(--crit);
  background: var(--crit-wash);
}
.level-red .alert-level,
.level-chip.level-red {
  background: var(--crit);
  color: #ffffff;
}
.level-amber {
  border-left-color: var(--warn);
  background: var(--warn-wash);
}
.level-amber .alert-level,
.level-chip.level-amber {
  background: var(--warn);
  color: #1d1600;
}
.level-info {
  border-left-color: var(--info);
  background: var(--info-wash);
}
.level-info .alert-level,
.level-chip.level-info {
  background: var(--info);
  color: var(--on-info);
}
.level-red .asof,
.level-amber .asof,
.level-info .asof {
  color: var(--ink-2);
}
@media (max-width: 479px) {
  .alert {
    grid-template-columns: minmax(0, 1fr);
  }
  .alert-level {
    justify-self: start;
  }
}

/* ---------- metric tiles ---------- */

.metrics {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tile-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.group-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tiles {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.tile .asof {
  margin-top: auto;
  padding-top: 6px;
}
.tile-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-2);
}
.tile-value {
  font-size: 1.75rem;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.tile-value.is-missing {
  font-size: 1.0625rem;
  font-weight: 650;
  color: var(--ink-2);
  padding-block: 6px 2px;
}
.tile-value.tile-value-long {
  font-size: 1.375rem;
}
.tile-sub {
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.tile-note {
  font-size: 0.75rem;
  color: var(--ink-3);
}
/* "Sent on <day>": the count is not today's (W6) */
.tile.is-old .tile-label,
.tile.is-old .tile-value {
  color: var(--ink-3);
}
.tile.is-old {
  background: var(--surface-sunk);
}
.breakdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-block: 4px;
  font-size: 0.8125rem;
}
.breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-block: 2px;
}
.breakdown li:last-child {
  border-bottom: 0;
}
.bd-name {
  color: var(--ink-2);
}
.bd-val {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}
@media (max-width: 719px) {
  .tile-wide,
  .tile-half {
    grid-column: 1 / -1;
  }
}
@media (min-width: 720px) {
  .tiles {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
  .tile-group:nth-child(3) .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .metrics {
    display: grid;
    grid-template-columns: 4fr 3fr;
    gap: 18px 16px;
  }
  .tile-group:first-child {
    grid-column: 1 / -1;
  }
}

/* ---------- key/value lists and tables ---------- */

.kv {
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
}
.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
  padding-block: 6px;
  border-bottom: 1px solid var(--line);
}
.kv-row:last-child {
  border-bottom: 0;
}
.kv dt {
  color: var(--ink-2);
  min-width: 0;
}
.kv dd {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  overflow-wrap: anywhere;
}
.kv dd.is-missing,
.is-missing-text {
  color: var(--ink-3);
  font-weight: 500;
  font-style: italic;
}
.kv-mono dt {
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.kv-stack .kv-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.kv-stack dd {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
}
/* A table wider than its panel scrolls inside it; a fade on the edge shows there is more (W2).
   The two "local" layers cover the fades when the table is scrolled to that end. */
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  background:
    linear-gradient(to right, var(--surface) 40%, transparent) left center / 28px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 40%, transparent) right center / 28px 100% no-repeat local,
    linear-gradient(to right, var(--scroll-fade), transparent) left center / 14px 100% no-repeat scroll,
    linear-gradient(to left, var(--scroll-fade), transparent) right center / 14px 100% no-repeat scroll;
  background-color: var(--surface);
}
.th-short {
  display: none;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.table th,
.table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
/* a long single word (a company name) may break rather than push the table wider than its panel */
.table td {
  overflow-wrap: anywhere;
}
.table thead th {
  color: var(--ink-2);
  font-weight: 600;
  border-bottom-color: var(--line-2);
  vertical-align: bottom;
}
.table tbody th {
  font-weight: 600;
}
/* Cells wrap only when the table would not fit otherwise (auto table layout), so no column is
   pushed out of its panel; below 480 px the cell padding is tighter too. */
@media (max-width: 479px) {
  .table th,
  .table td {
    padding-inline: 4px;
  }
  .th-long {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .th-short {
    display: inline;
  }
}
.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table-mono td:first-child {
  font-family: var(--mono);
}
.table-replies td:first-child {
  white-space: nowrap;
}
.table th:first-child,
.table td:first-child {
  padding-left: 0;
}
.table th:last-child,
.table td:last-child {
  padding-right: 0;
}
details.table-toggle > summary,
details.rules > summary,
details.audit > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.875rem;
  width: fit-content;
}
details.table-toggle[open] > summary {
  margin-bottom: 8px;
}
details.rules > summary,
details.audit > summary {
  font-size: 1rem;
  color: var(--ink);
}
.mono-text {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}
pre.note {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  max-height: 26rem;
  overflow: auto;
}
.missing {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.875rem;
}
.missing li {
  padding-left: 14px;
  position: relative;
}
.missing li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-3);
}
.plain-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8125rem;
}

/* ---------- rules disclosure ---------- */

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  max-width: 72ch;
}
.rule dt {
  font-weight: 650;
}
.rule dd {
  color: var(--ink-2);
  font-size: 0.875rem;
}

/* ---------- chart ---------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.key-1 {
  background: var(--series-1);
}
.key-2 {
  background: var(--series-2);
}
.chart-box {
  position: relative;
  width: 100%;
  min-height: 214px;
}
.chart-svg {
  display: block;
  overflow: visible;
}
.chart-svg .grid {
  stroke: var(--grid);
  stroke-width: 1;
}
.chart-svg .axis {
  stroke: var(--axis);
  stroke-width: 1;
}
.chart-svg .tick {
  fill: var(--ink-3);
  font-size: 11px;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}
.chart-svg .tick-day.is-today {
  fill: var(--ink);
  font-weight: 700;
}
.chart-svg .bar-label {
  fill: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
  font-family: var(--font);
}
.chart-svg .seg-1 {
  fill: var(--series-1);
}
.chart-svg .seg-2 {
  fill: var(--series-2);
}
.chart-svg .bar {
  transition: opacity 0.12s ease;
}
.chart-svg.has-active .bar:not(.is-active) {
  opacity: 0.35;
}
.chart-svg .hit {
  fill: transparent;
  pointer-events: all;
}
.chart-svg .hit:focus {
  outline: none;
}
.chart-svg .hit:focus-visible {
  outline: none;
  stroke: var(--focus);
  stroke-width: 2;
}
.chart-tip {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--tip-shadow);
  font-size: 0.8125rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tip-date {
  color: var(--ink-3);
  font-size: 0.75rem;
}
.tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
}
.tip-row strong,
.tip-total strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.tip-key {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  flex: none;
}
.tip-total {
  color: var(--ink-2);
  border-top: 1px solid var(--line);
  padding-top: 3px;
  margin-top: 2px;
}

/* ---------- research ---------- */

.research-summary {
  font-size: 0.9375rem;
}

/* ---------- overview ---------- */

.feed-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.feed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.feed.is-stale {
  color: var(--crit-ink);
  font-weight: 600;
}
.problems {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 4px solid var(--warn);
  background: var(--warn-wash);
  color: var(--ink);
  font-size: 0.875rem;
}
.problems-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 650;
}
.problems-list li,
.jobcard-rejected,
.rejected-note {
  overflow-wrap: anywhere;
}
.jobcard-rejected,
.rejected-note {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--warn-wash);
  color: var(--ink);
  font-size: 0.8125rem;
}
.jobcard-alerts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.alert-codes {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.jobcard-research .pill {
  padding: 1px 8px 1px 7px;
  font-size: 0.75rem;
  vertical-align: 1px;
}
.jobgrid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}
.jobcard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.jobcard:hover {
  border-color: var(--accent);
}
.jobcard:focus-visible {
  outline-offset: 3px;
}
.jobcard.is-hidden {
  background: var(--surface-sunk);
  border-style: dashed;
}
.jobcard.is-hidden > * {
  opacity: 0.62;
}
.jobcard-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.jobcard-name {
  font-size: 1.0625rem;
  min-width: 0;
}
.jobcard:hover .jobcard-name {
  color: var(--accent);
}
.jobcard-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.kv-card {
  font-size: 0.8125rem;
}
.kv-card .kv-row {
  padding-block: 4px;
}
.jobcard-research {
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.jobcard-k {
  font-weight: 650;
  color: var(--ink);
}
.jobcard-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.job-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.job-link {
  display: block;
  padding: 10px 0;
  font-weight: 600;
  font-size: 1rem;
}

/* ---------- events ---------- */

.events {
  display: flex;
  flex-direction: column;
}
.event {
  padding-block: 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.event:last-child {
  border-bottom: 0;
}
.event-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  font-size: 0.8125rem;
}
.event-at {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.event-action {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--neutral-wash);
  color: var(--neutral-ink);
}
.event-lead {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-2);
}
.event-company {
  font-weight: 600;
}
.event-detail {
  font-size: 0.8125rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

/* ---------- people ---------- */

.people {
  display: flex;
  flex-direction: column;
}
.person {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
}
.person:last-child {
  border-bottom: 0;
}
.person-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.person-email {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.person-confirm {
  flex-basis: 100%;
}
.link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.link-row .input {
  min-width: 0;
  flex: 1;
}
.copy-status,
.form-status {
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.form-status:empty,
.copy-status:empty {
  display: none;
}

/* ---------- forms and buttons ---------- */

.form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.label {
  font-weight: 600;
  font-size: 0.875rem;
}
.help {
  font-size: 0.8125rem;
  color: var(--ink-3);
}
.help:empty {
  display: none;
}
.input {
  font: inherit;
  font-size: 1rem;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}
.input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: var(--focus);
}
.input[aria-invalid="true"] {
  border-color: var(--crit);
}
.input-code {
  font-size: 1.5rem;
  letter-spacing: 0.25em;
  font-variant-numeric: tabular-nums;
  max-width: 15rem;
}
.input-link {
  font-family: var(--mono);
  font-size: 0.8125rem;
  background: var(--surface-sunk);
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.form-error {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--crit-wash);
  color: var(--crit-ink);
  font-size: 0.875rem;
  font-weight: 600;
}
.btn {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--ink-3);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  border-color: var(--accent);
  filter: brightness(1.08);
}
.btn-danger {
  background: var(--danger-bg);
  border-color: var(--danger-bg);
  color: var(--danger-ink);
}
.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}
.btn-quiet:hover {
  border-color: var(--line-2);
}
.btn-small {
  min-height: 34px;
  padding: 5px 11px;
  font-size: 0.8125rem;
}
.btn-block {
  width: 100%;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.add-person {
  max-width: 28rem;
}
.add-person .btn {
  align-self: flex-start;
}

/* ---------- sign in ---------- */

.signin {
  width: 100%;
  max-width: 26rem;
  margin: 6vh auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
@media (min-width: 480px) {
  .signin {
    padding: 32px 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page,
  .chart-svg .bar {
    transition: none;
  }
}
@media (forced-colors: active) {
  .chart-svg .seg-1,
  .chart-svg .seg-2 {
    fill: CanvasText;
  }
  .chart-svg .seg-2 {
    fill: GrayText;
  }
}
