:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --ink: #17201b;
  --muted: #62706a;
  --line: #d9dfd7;
  --panel: #ffffff;
  --panel-soft: #edf2ef;
  --accent: #0f766e;
  --accent-2: #b45309;
  --accent-3: #3f6c45;
  --danger: #a33d3d;
  --shadow: 0 18px 50px rgba(23, 32, 27, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

button,
input,
select {
  font: inherit;
}

.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.context,
.panel p {
  color: var(--muted);
  line-height: 1.5;
}

.context {
  max-width: 780px;
  margin-bottom: 0;
  font-size: 1.02rem;
}

.source-note {
  min-width: 230px;
  max-width: 360px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.source-note span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.source-note strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.source-note strong span {
  display: block;
  line-height: 1.35;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.nav-links .nav-link {
  margin-bottom: 0;
}

.nav-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: var(--panel-soft);
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 850;
  text-decoration: none;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 180px 145px 145px 160px 150px 190px minmax(220px, 1fr);
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 247, 244, 0.94);
  backdrop-filter: blur(12px);
}

.controls.assignment-controls {
  grid-template-columns: 200px 145px 145px 220px minmax(260px, 1fr);
}

.controls.insight-controls {
  grid-template-columns: 200px 145px 145px 280px minmax(280px, 1fr);
}

.controls.timing-controls {
  grid-template-columns: 200px 145px 145px 190px 230px minmax(280px, 1fr);
}

.controls.timeline-controls {
  grid-template-columns: 200px 145px 145px 230px 220px minmax(280px, 1fr);
}

/* ------------------------------------------------------------------------- */
/* Two-range comparison                                                      */
/* ------------------------------------------------------------------------- */

.compare-controls {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

label.compare-toggle {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

label.compare-toggle input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

label.compare-date {
  width: 165px;
}

label.compare-date[hidden] {
  display: none;
}

.compare-hint {
  align-self: center;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.compare-hint.error {
  color: var(--danger);
  font-weight: 750;
}

.compare-deck {
  display: block;
}

.compare-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.compare-side > .panel,
.compare-side > .metric {
  flex: 1;
}

.compare-tag {
  display: inline-flex;
  max-width: 100%;
  align-self: flex-start;
  margin: 0 0 6px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #e4ece8;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.4;
}

.compare-pair .compare-side:nth-child(2) .compare-tag,
.compare-panel-pair .compare-side:nth-child(2) .compare-tag,
.compare-stack .compare-side:nth-child(2) .compare-tag {
  background: #f3e8d8;
  color: var(--accent-2);
}

.compare-metric-pairs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.compare-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.compare-panel-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  align-items: stretch;
}

.compare-stack {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.compare-deck section[id$="detailPanel"],
.compare-deck section[id$="DetailPanel"] {
  scroll-margin-top: 150px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

select,
input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  min-height: 34px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 14px;
  font-size: 2rem;
  line-height: 1;
}

.metric em {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.branch-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 10px 18px 18px;
}

.branch-card {
  min-height: 104px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.branch-card span,
.branch-card em {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 750;
}

.branch-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 1.55rem;
  line-height: 1;
}

.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 18px 18px 8px;
}

.panel-head p {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.panel-head button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
}

.flow-wrap {
  padding: 4px 16px 16px;
  overflow-x: auto;
}

.flow-chart,
#flowChart {
  display: block;
  width: 100%;
  min-width: 800px;
  height: auto;
}

.flow-legend {
  margin: 10px 4px 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.node rect {
  fill: #e5ece8;
  stroke: #b9c8bf;
}

.node text {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.node .node-count {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.node.compact text {
  font-size: 12px;
}

.node.compact .node-count {
  font-size: 11.5px;
}

.link {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.22;
}

.link.hot {
  stroke: var(--accent-2);
  stroke-opacity: 0.48;
}

.link:hover {
  stroke-opacity: 0.8;
}

.path-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 10px 18px 18px;
}

.path-list.compact {
  max-height: 420px;
}

.path-list.wide {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  max-height: none;
  align-content: start;
}

.unassigned-summary {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f3e8d8;
}

.unassigned-summary strong {
  color: var(--accent-2);
  font-size: 1.6rem;
}

.unassigned-summary span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.3;
}

.path-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.path-count {
  display: grid;
  place-items: center;
  height: 36px;
  border-radius: 7px;
  background: #dfe9e4;
  color: var(--accent);
  font-weight: 850;
}

button.path-count {
  width: 100%;
  padding: 0;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

button.path-count:hover {
  border-color: #b9cec2;
  background: #d3e2da;
}

button.path-count:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.path-count.active {
  background: var(--accent);
  color: #fff;
}

button.path-count.active:hover {
  background: #0b5f58;
}

button.bar-value,
button.drill-count {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

button.bar-value {
  padding: 2px 5px;
}

button.drill-count {
  min-height: 26px;
  padding: 2px 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

button.bar-value:hover,
button.drill-count:hover {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--ink);
}

button.bar-value.active,
button.drill-count.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

button.bar-value:focus-visible,
button.drill-count:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.drill-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 0 18px 12px;
  padding: 10px 12px;
  border: 1px solid #c6d9ce;
  border-radius: 8px;
  background: #eef5f1;
}

.drill-bar[hidden] {
  display: none;
}

.drill-label {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.drill-bar strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.drill-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.drill-bar button {
  min-height: 32px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
  cursor: pointer;
}

.drill-bar button:hover {
  background: var(--panel-soft);
}

#detailPanel,
#assignmentDetailPanel,
#insightDetailPanel,
#timingDetailPanel,
#timelineDetailPanel {
  scroll-margin-top: 96px;
}

.path-text {
  min-width: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.35;
}

.bar-list,
.split-charts {
  padding: 12px 18px 18px;
}

.split-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.bar-group {
  display: grid;
  gap: 8px;
}

.bar-title {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(120px, 1.2fr) 42px;
  gap: 10px;
  align-items: center;
  margin: 9px 0;
}

.bar-row.wide {
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 1.2fr) 56px;
}

.bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 0.88rem;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e7ece8;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--accent);
}

.bar-row:nth-child(3n) .bar-fill {
  background: var(--accent-2);
}

.bar-value {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.timeline-hour-chart {
  display: grid;
  grid-template-columns: repeat(24, minmax(22px, 1fr));
  gap: 6px;
  min-height: 260px;
  align-items: end;
  padding: 18px;
}

.hour-bar {
  display: grid;
  grid-template-rows: minmax(120px, 1fr) 20px;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.hour-value {
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: var(--accent);
}

.hour-bar:nth-child(3n) .hour-value {
  background: var(--accent-3);
}

.hour-bar span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
}

.table-wrap {
  max-height: 560px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

th[data-sort-key] {
  padding: 0;
}

.sort-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  text-transform: inherit;
  letter-spacing: inherit;
}

.sort-button:hover {
  background: #e3eae5;
  color: var(--ink);
}

.sort-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.sort-indicator {
  opacity: 0.35;
  font-size: 0.7rem;
}

.sort-indicator::after {
  content: "↕";
}

th[aria-sort="ascending"] .sort-indicator::after {
  content: "▲";
}

th[aria-sort="descending"] .sort-indicator::after {
  content: "▼";
}

.sort-button.active .sort-indicator {
  opacity: 1;
  color: var(--accent);
}

td {
  font-size: 0.88rem;
  line-height: 1.35;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #e4ece8;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.pill.manual {
  background: #f3e8d8;
  color: var(--accent-2);
}

.pill.older,
.pill.no-ai {
  background: #ecefee;
  color: #52605b;
}

.pill.ai {
  background: #e0ebdf;
  color: var(--accent-3);
}

.pill.danger {
  background: #f4e1df;
  color: var(--danger);
}

.insight-list-row {
  align-items: start;
}

.insight-stack-row,
.recruiter-path-row {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.insight-stack-row:first-of-type,
.recruiter-path-row:first-of-type {
  border-top: 0;
}

.insight-stack-head,
.recruiter-path-main {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: baseline;
}

.insight-stack-head strong,
.recruiter-path-main strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.92rem;
}

.insight-stack-head span,
.recruiter-path-main span,
.recruiter-path-text,
.insight-stack-detail {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.stack-track {
  display: flex;
  height: 14px;
  border-radius: 999px;
  background: #e7ece8;
  overflow: hidden;
}

.stack-fill.assigned {
  background: var(--accent-3);
}

.stack-fill.prior {
  background: var(--accent-2);
}

.stack-fill.unassigned {
  background: var(--danger);
}

.insight-stack-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.recruiter-path-row {
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 1.2fr) 48px;
  align-items: center;
}

.recruiter-path-text {
  grid-column: 1 / -1;
}

.muted {
  color: var(--muted);
  font-size: 0.8rem;
}

.empty {
  padding: 28px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1000px) {
  .compare-panel-pair,
  .compare-pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 18px;
  }

  .topbar,
  .controls,
  .metric-grid,
  .split-charts {
    grid-template-columns: 1fr;
  }

  .controls {
    position: static;
  }

  h1 {
    font-size: 2.2rem;
  }

  .metric {
    min-height: auto;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .bar-value {
    text-align: left;
  }
}

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

.fraud-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid #e5c79b;
  border-radius: 10px;
  background: #fdf3e3;
  color: #6b4a1f;
  font-size: 0.86rem;
  line-height: 1.45;
}

.fraud-banner strong {
  color: #8a4b0f;
}

.fraud-banner code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #f5e3c8;
  color: #6b4a1f;
}

.fraud-banner-muted {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--muted);
}

.fraud-controls {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.fraud-controls .search-label {
  grid-column: span 2;
}

.metric-button {
  width: 100%;
  border: 1px solid var(--line);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

.metric-button:hover {
  border-color: #b9cec2;
  background: #fbfdfb;
  transform: translateY(-1px);
}

.metric-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 28px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.82rem;
  font-weight: 900;
  color: #fff;
  background: #52605b;
}

.score-high {
  background: #a33d3d;
}

.score-medium {
  background: #b45309;
}

.score-low {
  background: #0f766e;
}

.score-minimal {
  background: #7a8781;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
  background: #e8eeea;
  color: #52605b;
}

.status-new {
  background: #e8eeea;
  color: #52605b;
}

.status-in-review {
  background: #f3e8d8;
  color: #8a4b0f;
}

.status-confirmed {
  background: #f4e1df;
  color: var(--danger);
}

.status-dismissed,
.status-false-positive {
  background: #ecefee;
  color: #6b7671;
}

.chip {
  display: inline-flex;
  align-items: center;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 999px;
  padding: 2px 7px;
  background: #e4ece8;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.chip-soft {
  background: #f0f3f0;
  color: var(--muted);
}

.chip-warn {
  background: #fdf0d5;
  color: #8a4b0f;
}

.reason-chip {
  display: inline-flex;
  align-items: center;
  margin: 2px 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f3e8d8;
  color: #8a4b0f;
  font-size: 0.74rem;
  font-weight: 800;
}

.pii-value {
  display: inline-block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  border-radius: 5px;
  padding: 1px 5px;
  background: #fff4e5;
  color: #6b3d0f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.35;
}

.cluster-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #f3e2c7;
  color: #8a4b0f;
  font-size: 0.74rem;
  font-weight: 900;
}

.rapid-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #f4d9d6;
  color: #a33d3d;
  font-size: 0.74rem;
  font-weight: 900;
}

.cluster-row {
  cursor: pointer;
}

.cluster-row:hover td {
  background: #f7faf7;
}

.rapid-row td {
  cursor: default;
}

.cluster-row.selected td {
  background: #eef6f0;
  box-shadow: inset 3px 0 0 var(--accent);
}

.cluster-pair-row {
  cursor: pointer;
}

.cluster-pair-row:hover td {
  background: #f7faf7;
}

.cluster-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid #e5c79b;
  border-radius: 10px;
  background: #fdf3e3;
  color: #6b4a1f;
  font-size: 0.86rem;
}

.cluster-banner button {
  border: 1px solid #d9b478;
  border-radius: 8px;
  padding: 4px 10px;
  background: #fff7ea;
  color: #8a4b0f;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
}

.fraud-signal-wrap {
  max-height: 360px;
}

.pair-row {
  cursor: pointer;
}

.pair-row:hover td {
  background: #f7faf7;
}

.pair-row.selected td {
  background: #eef6f0;
  box-shadow: inset 3px 0 0 var(--accent);
}

.fraud-table-wrap {
  max-height: 680px;
}

#fraudDetailPanel,
#fraudPairTable,
#fraudClusterPanel,
#fraudRapidPanel {
  scroll-margin-top: 150px;
}

.fraud-status {
  min-height: 22px;
  padding: 0 4px 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.fraud-status.error,
.empty.error {
  color: var(--danger);
}

.fraud-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.talent-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: var(--panel-soft);
}

.talent-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.talent-id {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
}

.talent-contact {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.talent-contact > div {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.talent-contact > div > span:first-child {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 7px 0;
}

.talent-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.talent-metrics strong {
  color: var(--ink);
}

.review-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(180px, 1fr) minmax(220px, 2fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
}

.review-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.review-form textarea {
  min-height: 68px;
  resize: vertical;
}

.review-form button {
  min-height: 36px;
}

.fraud-detail-section {
  margin-top: 18px;
}

.fraud-detail-section h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.fraud-detail-section h3 .muted {
  font-weight: 500;
}

.fraud-detail-table {
  max-height: 380px;
}

.fraud-detail-table td {
  font-size: 0.8rem;
}

.activity-detail {
  max-width: 320px;
  white-space: normal;
}

.fraud-detail-loading {
  padding: 24px;
  color: var(--muted);
}

.fraud-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .fraud-detail-grid {
    grid-template-columns: 1fr;
  }

  .review-form {
    grid-template-columns: 1fr 1fr;
  }

  .review-form .review-notes {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .fraud-controls .search-label {
    grid-column: auto;
  }

  .review-form {
    grid-template-columns: 1fr;
  }
}

/* AI Outreach dashboard */

#aiJobMetricGrid {
  margin-bottom: 0;
  padding: 0 18px 18px;
}

.controls.ai-controls {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

@media (max-width: 1300px) {
  .controls.ai-controls {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .controls.ai-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.callout {
  margin: 0 18px 16px;
  padding: 12px 14px;
  border: 1px solid #e3cfae;
  border-radius: 8px;
  background: #fbf3e4;
  color: #6b4a1c;
  font-size: 0.9rem;
  line-height: 1.45;
}

.callout strong {
  color: #8a4b0f;
}

.waterfall {
  display: grid;
  gap: 10px;
  padding: 4px 18px 18px;
}

.waterfall-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) minmax(150px, 2fr) 64px 70px 120px;
  gap: 12px;
  align-items: center;
}

.waterfall-label strong {
  display: block;
  font-size: 0.88rem;
}

.waterfall-label span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.3;
}

.waterfall-track {
  height: 18px;
  border-radius: 999px;
  background: #e7ece8;
  overflow: hidden;
}

.waterfall-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #4a9d8f);
}

button.waterfall-count {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

button.waterfall-count:hover {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--ink);
}

button.waterfall-count.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

button.waterfall-count:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.waterfall-pct {
  color: var(--ink);
  font-weight: 850;
  text-align: right;
}

.waterfall-step {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  text-align: right;
}

.data-notes {
  margin: 0;
  padding: 4px 18px 20px 38px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.data-notes li {
  margin: 8px 0;
}

.subhead {
  margin: 22px 18px 6px;
  font-size: 0.95rem;
}

.subhead-note {
  margin: 0 18px 12px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.disp-indent {
  padding-left: 30px;
  color: var(--muted);
}

#aiDispositionTable th:first-child {
  width: 42%;
}

@media (max-width: 900px) {
  .waterfall-row {
    grid-template-columns: minmax(160px, 1fr) 64px 70px;
  }

  .waterfall-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .waterfall-step {
    display: none;
  }
}

/* ------------------------------------------------------------------------- */
/* Advertising / applicant distribution                                      */
/* ------------------------------------------------------------------------- */

.controls.ads-controls {
  grid-template-columns: 200px 145px 145px 160px minmax(240px, 1fr) 110px;
}

.controls.ads-controls > button {
  align-self: end;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
}

.controls.ads-controls > button:hover {
  background: #e3ebe6;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.link-button {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 0;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible {
  text-decoration: underline;
}

.ads-flag {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f3e8d8;
  color: #8a4b0f;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .controls.ads-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .controls.ads-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#adsCompanyTable { min-width: 1280px; }
#adsJobsTable { min-width: 1520px; }
#adsBranchMonthTable { min-width: 1280px; }
#adsCampaignTable { min-width: 1260px; }
#adsTransitionTable { min-width: 520px; }

#adsJobsPanel,
#adsCompanyTable,
#adsBranchMonthTable,
#adsCampaignTable {
  scroll-margin-top: 110px;
}

/* Advertising charts must show full company/source names instead of ellipses. */
#adsSourceChart .bar-label,
#adsSourceClassChart .bar-label,
#adsWeeklyPaidChart .bar-label,
#adsWeeklyCompletedChart .bar-label,
#adsMultiDistributionChart .bar-label,
#adsMultiBurstChart .bar-label,
#adsMultiCompanyChart .bar-label {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  line-height: 1.25;
}

#adsMultiCompanyChart .bar-row.wide {
  grid-template-columns: minmax(230px, 1.4fr) minmax(90px, 1fr) 64px;
}

#adsSourceChart .bar-row.wide {
  grid-template-columns: minmax(150px, 1fr) minmax(100px, 1.2fr) 64px;
}

/* ---------------------------------------------------------------------------
   Authentication UI
   ------------------------------------------------------------------------- */

.nav-client-select {
  min-height: 34px;
  max-width: 240px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  background: var(--panel);
  color: var(--ink);
}

.nav-user {
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(15, 118, 110, 0.12), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(180, 83, 9, 0.1), transparent 40%),
    var(--bg);
}

.login-card {
  width: min(480px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.15;
}

.login-copy,
.login-footnote {
  color: var(--muted);
  line-height: 1.55;
}

.login-error {
  border: 1px solid rgba(163, 61, 61, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(163, 61, 61, 0.08);
  color: var(--danger);
}

.login-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  margin: 8px 0 18px;
  border-radius: 9px;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
}

.login-button:hover,
.login-button:focus-visible {
  background: #0b5d57;
}

.login-footnote {
  margin-bottom: 0;
  font-size: 0.85rem;
}
