:root {
  --bg: #eef3f7;
  --bg-deep: #d8e2eb;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-muted: #f6f9fb;
  --ink: #14212b;
  --muted: #5d6d79;
  --accent: #214d78;
  --accent-strong: #173654;
  --accent-soft: #dce8f3;
  --danger: #a53b36;
  --danger-strong: #842d29;
  --line: rgba(20, 33, 43, 0.12);
  --line-strong: rgba(20, 33, 43, 0.2);
  --shadow: 0 18px 42px rgba(24, 46, 66, 0.12);
  --shadow-strong: 0 28px 60px rgba(24, 46, 66, 0.18);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html.app-booting body {
  visibility: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(33, 77, 120, 0.08), transparent 30%),
    radial-gradient(circle at bottom right, rgba(118, 146, 173, 0.12), transparent 28%),
    linear-gradient(180deg, #f4f7fa 0%, #e9eff4 100%);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

body.scraper-form-open {
  overflow: hidden;
}

.background-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.04));
}

.hero,
.tabbar,
.tab-shell {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
}

.hero {
  padding: 3rem 2rem 1.75rem;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

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

.hero h1,
.panel h2,
.modal-head h2 {
  margin: 0;
  font-family: "Georgia", "Palatino Linotype", "Book Antiqua", serif;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.hero-copy,
.panel-copy {
  color: var(--muted);
  line-height: 1.65;
}

.hero-copy {
  max-width: 50rem;
  font-size: 1.02rem;
}

.panel-copy {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
}

.hero-stats {
  min-width: 320px;
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 1rem;
}

.stat {
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.stat label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat strong {
  font-size: 1.95rem;
  letter-spacing: -0.03em;
}

.tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 0 2rem 1.4rem;
}

.tab-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.86rem 1.2rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.tab-button.is-locked {
  opacity: 0.55;
}

.tab-button.is-complete {
  border-color: rgba(33, 77, 120, 0.3);
}

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

.tab-shell {
  padding: 0 2rem 3rem;
}

.flow-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.flow-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 50rem;
}

.flow-banner-copy strong {
  font-size: 1.08rem;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 1.2rem;
}

.tab-panel.active {
  display: flex;
}

.panel {
  width: 100%;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.wide-panel {
  width: 100%;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.compact-head {
  margin-bottom: 0;
}

.panel h2 {
  font-size: 1.5rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.scroll-list,
.scroll-grid,
.modal-scroll-list,
.modal-scroll-grid {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
}

.scroll-list,
.modal-scroll-list {
  max-height: 25rem;
}

.scroll-grid,
.modal-scroll-grid {
  max-height: 26rem;
}

.scroll-list::-webkit-scrollbar,
.scroll-grid::-webkit-scrollbar,
.modal-scroll-list::-webkit-scrollbar,
.modal-scroll-grid::-webkit-scrollbar {
  width: 10px;
}

.scroll-list::-webkit-scrollbar-thumb,
.scroll-grid::-webkit-scrollbar-thumb,
.modal-scroll-list::-webkit-scrollbar-thumb,
.modal-scroll-grid::-webkit-scrollbar-thumb {
  background: rgba(20, 33, 43, 0.16);
  border-radius: 999px;
}

.overview-grid,
.setup-shell,
.library-grid,
.builder-grid,
.wizard-grid,
.preview-grid,
.images-strip,
.candidate-grid,
.selector-grid {
  display: grid;
  gap: 1rem;
}

.overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.setup-shell {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.92fr);
  align-items: start;
}

.library-grid,
.builder-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wizard-grid,
.selector-grid,
.candidate-grid {
  grid-template-columns: 1fr;
}

.step-card,
.card,
.job-card,
.listing-card,
.profile-card,
.candidate-card,
.selector-group,
.preview-card {
  padding: 1rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.step-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
}

.single-step {
  grid-template-columns: 1fr;
}

.step-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-head {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.step-card p {
  margin: 0;
}

.step-badge {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}

.profile-card,
.candidate-card,
.selector-group,
.preview-card {
  box-shadow: 0 8px 22px rgba(24, 46, 66, 0.05);
}

.job-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.job-card-main,
.job-card-side {
  min-width: 0;
}

.job-card-actions {
  justify-content: flex-end;
}

.listing-card {
  position: relative;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding-bottom: 3rem;
}

.listing-card-media,
.listing-card-main,
.listing-card-side {
  min-width: 0;
}

.listing-thumbnail {
  width: 100%;
  height: 92px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.listing-thumbnail.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.profile-head,
.candidate-head,
.selector-head,
.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.profile-actions,
.selector-actions,
.candidate-actions,
.action-row,
.selector-flags,
.manual-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.profile-template,
.code-chip {
  padding: 0.55rem 0.7rem;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.84rem;
  background: rgba(20, 33, 43, 0.06);
  border-radius: 12px;
  word-break: break-word;
}

.profile-template {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.pill,
.flag,
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 700;
}

.pill {
  color: var(--accent-strong);
  background: var(--accent-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pill-muted,
.flag,
.check-pill {
  color: var(--ink);
  background: rgba(20, 33, 43, 0.07);
}

.selector-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.selector-notes {
  font-size: 0.86rem;
}

.selector-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.selector-item,
.preview-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.8rem;
  background: var(--surface-muted);
  border: 1px solid rgba(20, 33, 43, 0.08);
  border-radius: 14px;
}

.manual-builder {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 0.65rem;
}

.manual-builder .manual-flags {
  grid-column: 1 / -1;
}

.preview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-values {
  display: grid;
  gap: 0.6rem;
}

.images-strip {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}

.modal-scroll-grid.images-strip {
  max-height: 15rem;
  align-content: start;
}

.images-strip img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.form input,
.form select,
.form textarea,
.filter-bar input,
.filter-bar select,
textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
}

.form textarea,
textarea {
  min-height: 110px;
  resize: vertical;
}

.form input:focus,
.form select:focus,
.form textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus,
textarea:focus {
  outline: 2px solid rgba(33, 77, 120, 0.14);
  border-color: var(--accent);
}

.risk-summary,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.risk-summary {
  margin-top: 0.65rem;
}

.priority-badge,
.tag-chip,
.tag-button {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.priority-badge,
.tag-chip {
  padding: 0.35rem 0.65rem;
}

.priority-high { color: #7b211d; background: #f8d9d6; }
.priority-medium { color: #74520b; background: #f8e8b9; }
.priority-low { color: #285c45; background: #dcefe5; }

.tag-row {
  margin-top: 0.55rem;
}

.tag-chip {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.tag-button {
  padding: 0.55rem 0.8rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: rgba(33, 77, 120, 0.18);
  box-shadow: none;
}

.tag-button:hover,
.tag-button.active {
  color: #fff;
  background: var(--accent);
}

.match-highlight {
  padding: 0.08em 0.16em;
  color: #3c2b05;
  background: #ffdc70;
  border-radius: 4px;
}

.evidence-explanation {
  padding: 0.75rem;
  background: var(--surface-muted);
  border-radius: 12px;
}

.rule-disabled {
  opacity: 0.62;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field-group label {
  font-size: 0.95rem;
  font-weight: 700;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.filter-checkbox-list {
  max-height: 14rem;
}

.filter-check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.8rem 0.85rem;
  background: var(--surface-muted);
  border: 1px solid rgba(20, 33, 43, 0.08);
  border-radius: 14px;
}

.filter-check-row input {
  margin-top: 0.2rem;
}

.filter-check-row strong,
.filter-check-row .meta {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.split-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

button {
  padding: 0.88rem 1.08rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(33, 77, 120, 0.18);
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.version-compare-button-wrap,
.contact-related-button-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.version-compare-button-wrap[data-disabled-help],
.contact-related-button-wrap[data-disabled-help] {
  cursor: help;
}

.version-compare-button-wrap[data-disabled-help] button,
.contact-related-button-wrap[data-disabled-help] button {
  pointer-events: none;
  cursor: inherit;
}

.version-compare-button-wrap[data-disabled-help]::after,
.contact-related-button-wrap[data-disabled-help]::after {
  content: attr(data-disabled-help);
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.5rem);
  right: 0;
  width: max-content;
  max-width: min(300px, calc(100vw - 2rem));
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.2rem);
  transition: opacity 120ms ease, transform 120ms ease;
}

.version-compare-button-wrap[data-disabled-help]:hover::after,
.contact-related-button-wrap[data-disabled-help]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

button.ghost,
.tab-button {
  box-shadow: none;
}

button.ghost {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

button.ghost:hover {
  background: var(--surface-muted);
}

button.small {
  padding: 0.55rem 0.8rem;
  font-size: 0.88rem;
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 10px 22px rgba(165, 59, 54, 0.18);
}

button.danger:hover {
  background: var(--danger-strong);
}

button.indicator-delete-button {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  place-items: center;
  color: var(--danger);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

button.indicator-delete-button:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

button.indicator-edit-button {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  place-items: center;
  color: #2563eb;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

button.indicator-edit-button:hover {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #bfdbfe;
}

.trash-icon {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.pencil-icon {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.technical-details,
.advanced-block,
.editor {
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(20, 33, 43, 0.08);
  border-radius: 16px;
}

.technical-details summary,
.advanced-block summary,
.editor summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.technical-details[open] summary,
.advanced-block[open] summary,
.editor[open] summary {
  margin-bottom: 0.8rem;
}

.info-card {
  margin-top: 0.5rem;
}

.result-box {
  min-height: 160px;
  margin: 0;
  padding: 1rem;
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.result-crawler-tag {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.75rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 30, 0.48);
}

.modal-panel {
  position: relative;
  width: min(960px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-strong);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: -1.2rem -1.2rem 1rem;
  padding: 1.1rem 1.2rem 1rem;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(20, 33, 43, 0.08);
  border-radius: 22px 22px 0 0;
  backdrop-filter: blur(10px);
}

.modal-content {
  padding-bottom: 0.2rem;
}

.image-modal-panel {
  width: min(1120px, calc(100vw - 2rem));
  padding: 0.5rem;
}

.expanded-posting-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 3rem);
  margin: 0 auto;
  object-fit: contain;
}

.network-workspace { display: grid; align-content: start; align-items: start; gap: 0.85rem; min-height: calc(100vh - 11rem); }
.network-generation-controls { padding: 0; }
.network-generation-row { display: grid; grid-template-columns: minmax(12rem, 1fr) auto auto auto; align-items: center; gap: 0.65rem; }
.network-generation-row > input,
.network-limit-label,
.network-generation-row > button,
.network-generation-row .network-checkbox { min-height: 3rem; }
.network-generation-row > input { width: 100%; padding: 0.85rem 0.95rem; font: inherit; color: var(--ink); background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: 10px; }
.network-generation-row > input:focus { outline: 2px solid rgba(33, 77, 120, 0.14); border-color: var(--accent); }
.network-view-toggle { display: inline-flex; align-self: start; width: 15rem; overflow: hidden; border: 1px solid var(--line); border-radius: 0.5rem; }
.network-view-toggle button { flex: 1 1 50%; min-height: 2.75rem; padding: 0.42rem 0.8rem; border: 0; border-radius: 0; background: var(--surface-muted); color: var(--muted); box-shadow: none; font-size: 0.78rem; }
.network-view-toggle button + button { border-left: 1px solid var(--line); }
.network-view-toggle button.active { background: var(--accent-soft); color: var(--accent-strong); }
.network-limit-label { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0 0.75rem; color: var(--muted); background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: 10px; font-size: 1rem; font-weight: 700; white-space: nowrap; }
.network-limit-label input { width: 4.5rem; min-height: 2rem; padding: 0.3rem 0.45rem; color: var(--ink); background: transparent; border: 0; border-left: 1px solid var(--line); border-radius: 0; font: inherit; }
.network-limit-label input:focus { outline: 0; }
/* Keep the limit help inside the Network controls when its icon is near the right edge. */
.network-limit-label .info-tip-content {
  right: 0;
  left: auto;
  width: min(310px, calc(100vw - 2rem));
  transform: translate(0, -0.2rem);
}
.network-limit-label .info-tip:hover .info-tip-content,
.network-limit-label .info-tip:focus-visible .info-tip-content { transform: translate(0, 0); }
.network-checkbox { display: inline-flex !important; align-items: center; gap: 0.35rem; cursor: pointer; color: var(--ink) !important; font-size: 1rem !important; font-weight: 600 !important; }
.network-generation-row .network-checkbox { padding: 0 0.75rem; background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: 10px; white-space: nowrap; }
.network-generation-row > button { padding: 0.65rem 1rem; white-space: nowrap; }
.network-visibility-controls { display: flex; flex-wrap: wrap; align-items: start; gap: 0.8rem 1.2rem; }
.network-visibility-controls .network-checkbox { font-size: 0.78rem !important; }
.network-filter-panel summary .meta { margin-left: 0.5rem; font-weight: 400; }
.network-filter-panel .network-visibility-controls { margin-top: 0.75rem; }
.network-visibility-controls .panel-head { flex: 1 1 100%; }
.network-visibility-controls .panel-head .ghost.small { padding: 0.18rem 0.42rem; font-size: 0.78rem; line-height: 1.2; }
.network-visibility-controls .filter-checkbox-list { display: grid; flex: 1 1 100%; max-height: 14rem; grid-template-columns: 1fr; gap: 0.35rem; }
.network-similarity-control { display: grid; grid-template-columns: auto minmax(10rem, 18rem) 4rem auto; align-items: center; gap: 0.55rem; margin-bottom: 0.7rem; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.network-similarity-control input[type="range"] { accent-color: var(--accent); }
.network-similarity-control input[type="number"] { width: 4rem; padding: 0.28rem 0.38rem; color: var(--ink); background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: 7px; font: inherit; }
.network-canvas-card { display: grid; grid-template-columns: minmax(0, 1fr) 15.5rem; min-height: min(68vh, 54rem); overflow: hidden; border: 1px solid var(--line); border-radius: 0.6rem; background: var(--surface-strong); }
.network-canvas-card.profile-mode { grid-template-columns: 1fr; min-height: 0; align-self: start; }
.network-canvas-card.profile-mode .network-graph { min-height: 0; }
.network-canvas-card.profile-mode.is-empty-profile { min-height: 7rem; }
.network-canvas-card.profile-mode.is-empty-profile .network-graph { display: grid; min-height: 7rem; place-items: center; }
#networkGraph.network-graph { position: relative; min-width: 0; min-height: 32rem; overflow: hidden; background: var(--bg); }
.network-viewport { width: 100%; height: 100%; min-height: 32rem; overflow: visible; transform-origin: 0 0; }
.network-stage { position: relative; min-width: 100%; min-height: 32rem; overflow: visible; }
#networkGraph .network-stage { background: var(--bg); }
.network-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#networkGraph .network-edges { overflow: hidden; }
.network-edges line { stroke: color-mix(in srgb, var(--line-strong) 68%, var(--accent)); stroke-width: 1.25; opacity: 0.62; }
.network-node { position: absolute; left: var(--network-x); top: var(--network-y); z-index: 1; max-width: 7.75rem; transform: translate(-50%, -50%); padding: 0.34rem 0.48rem; border: 1px solid var(--line-strong); border-radius: 0.4rem; background: var(--surface-strong); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.14); font-size: 0.66rem; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.network-node:hover, .network-node.selected { transform: translate(-50%, -50%); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
.network-stage .network-node strong { display: block; width: 5.5rem; padding: 0; background: transparent; }
.network-graph-controls { position: absolute; right: 0.8rem; bottom: 0.8rem; z-index: 3; display: inline-flex; overflow: hidden; border: 1px solid var(--line); border-radius: 0.45rem; background: var(--surface-strong); box-shadow: var(--shadow); }
.network-graph-controls button { border: 0; border-radius: 0; box-shadow: none; }
.network-graph-controls button + button { border-left: 1px solid var(--line); }
.network-node-lead { border-radius: 999px; background: color-mix(in srgb, #ef8354 18%, var(--surface-strong)); }
.network-node.network-node-search-match { border-color: #16803d; background: color-mix(in srgb, #22c55e 30%, var(--surface-strong)); box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 30%, transparent); }
.network-node-contact { background: color-mix(in srgb, #8b6fd6 18%, var(--surface-strong)); }
.network-node-indicator { background: color-mix(in srgb, #d16b3f 18%, var(--surface-strong)); }
html[data-theme="light"] #networkGraph.network-graph,
html[data-theme="light"] #networkGraph .network-stage { background: #f4f7fb; }
#networkGraph > .empty-inline {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 1rem;
  color: var(--ink);
  background: transparent;
  border-radius: 0;
  text-align: center;
}
.network-inspector { display: grid; align-content: start; gap: 0.55rem; padding: 1rem; border-left: 1px solid var(--line); background: var(--surface-strong); }
.network-inspector p { margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.4; overflow-wrap: anywhere; }
.profile-heatmap-wrap { max-height: calc(16 * 3.45rem + 3rem); overflow: auto; }
.profile-heatmap { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.76rem; }
.profile-heatmap th, .profile-heatmap td { min-width: 6.5rem; padding: 0.55rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.profile-heatmap thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-muted); color: var(--muted); font-size: 0.68rem; font-weight: 750; }
.profile-heatmap thead th:first-child { left: 0; z-index: 2; text-align: left; }
.profile-heatmap tbody th { position: sticky; left: 0; z-index: 1; min-width: 14rem; background: var(--surface-strong); text-align: left; }
.profile-heatmap .profile-group-row th { position: static; padding: 0.38rem 0.55rem; background: var(--surface-muted); color: var(--muted); font-size: 0.68rem; font-weight: 750; letter-spacing: 0.02em; text-align: left; text-transform: uppercase; }
.profile-lead-name { display: block; max-width: 14rem; padding: 0; border: 0; background: transparent; color: var(--ink); box-shadow: none; font-size: 0.75rem; font-weight: 700; text-align: left; overflow-wrap: anywhere; }
.profile-lead-name:hover { color: var(--accent); transform: none; }
.profile-lead-actions { display: flex; align-items: start; gap: 0.35rem; }
.profile-view-lead { position: relative; display: inline-grid; flex: 0 0 auto; width: 1.45rem; height: 1.45rem; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 50%; box-shadow: none; }
.profile-view-lead:hover { color: var(--accent); background: var(--accent-soft); transform: none; }
.profile-view-lead svg { width: 0.92rem; height: 0.92rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.profile-view-lead::after { content: attr(data-tooltip); position: absolute; z-index: 10; bottom: calc(100% + 0.35rem); left: 50%; width: max-content; padding: 0.35rem 0.45rem; color: var(--ink); background: var(--surface-strong); border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: var(--shadow-strong); font-size: 0.7rem; font-weight: 600; opacity: 0; pointer-events: none; transform: translate(-50%, 0.15rem); transition: opacity 120ms ease, transform 120ms ease; }
.profile-view-lead:hover::after, .profile-view-lead:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.profile-heatmap small { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.68rem; font-weight: 400; }
.profile-heat-cell { display: inline-grid; place-items: center; width: 2rem; height: 1.55rem; border-radius: 0.32rem; color: var(--muted); font-weight: 750; }
.profile-heat-0 { background: transparent; }
.profile-heat-1 { color: var(--ink); background: color-mix(in srgb, #d16b3f 18%, var(--surface-strong)); }
.profile-heat-2 { color: var(--ink); background: color-mix(in srgb, #d16b3f 34%, var(--surface-strong)); }
.profile-heat-3 { color: var(--ink); background: color-mix(in srgb, #d16b3f 52%, var(--surface-strong)); }
.profile-heat-4 { color: #fff; background: #d16b3f; }
@media (max-width: 820px) {
  .network-generation-row { grid-template-columns: 1fr 1fr; }
  .network-generation-row > :first-child { grid-column: 1 / -1; }
  .network-canvas-card { grid-template-columns: 1fr; }
  .network-inspector { min-height: 8rem; border-top: 1px solid var(--line); border-left: 0; }
}

.image-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

.image-modal-close:hover { background: rgba(0, 0, 0, 0.78); transform: none; }
.image-modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  z-index: 40;
  transform: translateX(-50%);
  padding: 0.9rem 1.15rem;
  color: #fff;
  background: rgba(20, 33, 43, 0.94);
  border-radius: 999px;
  box-shadow: 0 14px 28px rgba(20, 33, 43, 0.22);
}
.global-hover-tooltip {
  position: fixed;
  z-index: 200;
  width: max-content;
  max-width: min(260px, calc(100vw - 2rem));
  padding: 0.45rem 0.6rem;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  box-shadow: var(--shadow-strong);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  pointer-events: none;
  transform: translate(-50%, -100%);
}
.global-hover-tooltip[data-placement="below"] { transform: translate(-50%, 0); }

.hidden {
  display: none !important;
}

a {
  color: var(--accent);
}

@media (max-width: 1320px) {
  .hero {
    flex-direction: column;
  }

  .hero-stats {
    width: 100%;
  }
}

@media (max-width: 960px) {
  .overview-grid,
  .setup-shell,
  .library-grid,
  .builder-grid,
  .preview-grid,
  .split,
  .split-three,
  .split-four,
  .manual-builder,
  .listing-card,
  .job-card {
    grid-template-columns: 1fr;
  }

  .hero,
  .tabbar,
  .tab-shell {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .step-card {
    grid-template-columns: 1fr;
  }

  .tabbar {
    flex-direction: column;
  }

  .flow-banner {
    flex-direction: column;
  }

  .action-row,
  .profile-actions,
  .candidate-actions,
  .selector-actions,
  .selector-flags,
  .manual-flags,
  .job-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .listing-card {
    padding-bottom: 4rem;
  }

  .listing-thumbnail {
    height: 180px;
  }

  .result-crawler-tag {
    left: 1rem;
    right: auto;
  }

  .modal {
    padding: 0.75rem;
  }
}

/* Integrated interface direction: mclean-ui-ux shell + investigator triage density. */
:root {
  color-scheme: dark;
  --bg: #0a101b;
  --bg-deep: #060a12;
  --surface: rgba(17, 26, 42, 0.94);
  --surface-strong: #151f31;
  --surface-muted: #1b283c;
  --ink: #edf3fb;
  --muted: #9caabd;
  --accent: #7895ff;
  --accent-strong: #9aafff;
  --accent-soft: rgba(120, 149, 255, 0.15);
  --danger: #e4616b;
  --danger-strong: #f07a83;
  --line: rgba(195, 211, 235, 0.11);
  --line-strong: rgba(195, 211, 235, 0.2);
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
  --shadow-strong: 0 28px 72px rgba(0, 0, 0, 0.44);
  --input-bg: #0e1726;
  --sidebar-bg: linear-gradient(180deg, #111b2c 0%, #080e18 100%);
  --body-bg: radial-gradient(circle at 14% 0%, rgba(100, 128, 239, 0.13), transparent 32%), linear-gradient(180deg, #0d1421 0%, #080d16 100%);
  --sidebar-width: 248px;
  --sidebar-collapsed-width: 76px;
  --radius: 16px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f7;
  --bg-deep: #dce4ed;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-muted: #f4f7fb;
  --ink: #162130;
  --muted: #617083;
  --accent: #3f63d3;
  --accent-strong: #294aaf;
  --accent-soft: #e5ebff;
  --danger: #b43e49;
  --danger-strong: #8d2d36;
  --line: rgba(22, 33, 48, 0.1);
  --line-strong: rgba(22, 33, 48, 0.2);
  --shadow: 0 14px 38px rgba(25, 43, 66, 0.1);
  --shadow-strong: 0 28px 60px rgba(25, 43, 66, 0.18);
  --input-bg: #ffffff;
  --sidebar-bg: linear-gradient(180deg, #1b3152 0%, #102138 100%);
  --body-bg: radial-gradient(circle at 14% 0%, rgba(63, 99, 211, 0.09), transparent 32%), linear-gradient(180deg, #f7f9fc 0%, #edf2f7 100%);
}

body {
  min-height: 100vh;
  background: var(--body-bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: -0.005em;
}

.background-grid {
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 0.85rem;
  color: #fff;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 12px 0 34px rgba(0, 0, 0, 0.18);
  transition: width 180ms ease;
}

.sidebar-brand {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.2rem 0.35rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  white-space: nowrap;
}

.brand-mark img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.theme-logo.logo-on-light { display: none; }
.theme-logo.logo-on-dark { display: block; }
[data-theme="light"] .theme-logo.logo-on-light { display: block; }
[data-theme="light"] .theme-logo.logo-on-dark { display: none; }

.brand-copy {
  display: flex;
  align-items: center;
  min-width: 135px;
}

.brand-copy strong { font-size: 1.05rem; }

.sidebar-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  box-shadow: none;
}

.sidebar-toggle-icon {
  display: inline-grid;
  width: 1rem;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  -webkit-text-stroke: 0.35px currentColor;
}

html[data-theme="dark"] .sidebar-toggle:hover,
html[data-theme="dark"] .sidebar-toggle:focus-visible {
  color: #ffffff;
  background: #29292e;
  border-color: #a1a1aa;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: none;
}

.sidebar .tabbar {
  display: flex;
  max-width: none;
  margin: 0;
  padding: 0;
  flex: 1;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar .tab-button {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 0.8rem;
  padding: 0.72rem 0.8rem;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  box-shadow: none;
  text-align: left;
}

.sidebar .tab-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  transform: none;
}

.sidebar .tab-button.active {
  color: #fff;
  background: rgba(120, 149, 255, 0.18);
  border-color: rgba(146, 169, 255, 0.28);
  box-shadow: inset 3px 0 #8aa3ff;
}

.nav-icon {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 20px;
  place-items: center;
  font-size: 1.25rem;
  line-height: 1;
}
.nav-flag-icon {
  display: block;
  height: 20px;
  color: inherit;
  fill: currentColor;
  stroke: none;
}
.nav-flag-icon .nav-flag-pole,
.nav-flag-icon .nav-flag-banner {
  fill: currentColor;
  opacity: 1;
}
.nav-spider-icon {
  display: block;
  height: 20px;
  color: inherit;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
.nav-search-icon {
  display: block;
  height: 20px;
  color: inherit;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.nav-label { white-space: nowrap; }

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #68d59c;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(104, 213, 156, 0.13);
}

.app-content {
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left 180ms ease;
}

body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .app-content { margin-left: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .sidebar .nav-label,
body.sidebar-collapsed .brand-copy { display: none; }
body.sidebar-collapsed .sidebar-toggle,
body.sidebar-collapsed .sidebar .tab-button { justify-content: center; padding-inline: 0.5rem; }

.hero,
.tab-shell {
  max-width: 1480px;
}

.hero {
  min-height: 0;
  padding: 1.25rem 2rem 0.65rem;
  align-items: flex-start;
  border-bottom: 0;
}

.hero h1 {
  font-family: inherit;
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.045em;
}

.hero-copy { max-width: 58rem; margin-bottom: 0; }

.theme-toggle {
  display: flex;
  align-items: center;
}

.hero-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.55rem;
}

html:not([data-active-tab="review"]) .hero-controls .safer-viewing-toggle {
  display: none;
}

.tab-shell { padding-top: 0.7rem; }
.flow-banner { display: none !important; }

.panel,
.step-card,
.card,
.job-card,
.listing-card,
.profile-card,
.candidate-card,
.selector-group,
.preview-card {
  background: var(--surface);
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025), var(--shadow);
  backdrop-filter: blur(14px);
}

.panel { padding: 1.35rem; }
.panel h2, .modal-head h2 { font-family: inherit; font-weight: 740; }

.form input,
.form select,
.form textarea,
.filter-bar input,
.filter-bar select,
textarea {
  color: var(--ink);
  background: var(--input-bg);
  border-color: var(--line-strong);
  border-radius: 10px;
}

button { border-radius: 10px; box-shadow: none; }
button.ghost { color: var(--ink); background: var(--surface-muted); border-color: var(--line); }

.technical-details,
.advanced-block,
.editor,
.filter-check-row,
.evidence-explanation,
.result-box {
  color: var(--ink);
  background: var(--surface-muted);
  border-color: var(--line);
}

.overview-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 1.75rem;
  color: #fff;
  background: linear-gradient(125deg, #243f8e, #4e67c8 58%, #7159b5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(31, 51, 124, 0.28);
}

.overview-hero h2 { margin: 0; font-size: 1.75rem; }
.overview-hero .eyebrow, .overview-hero .panel-copy { color: rgba(255, 255, 255, 0.75); }
.overview-hero button { color: #273666; background: #fff; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.metric-grid .stat {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.metric-grid .stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}

.metric-grid .stat strong { font-size: 2.2rem; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 1rem;
}

.priority-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.priority-overview-card {
  display: grid;
  gap: 0.3rem;
  padding: 1rem;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  text-align: left;
}

.priority-overview-card:hover { transform: translateY(-2px); background: var(--surface-strong); }
.priority-overview-card span { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; }
.priority-overview-card strong { font-size: 2.3rem; line-height: 1; }
.priority-overview-card small { color: var(--muted); }
.priority-overview-card.high { border-top: 3px solid #e66b72; }
.priority-overview-card.medium { border-top: 3px solid #e6b65f; }
.priority-overview-card.low { border-top: 3px solid #62c28e; }

.activity-list { display: grid; gap: 0.6rem; }
.activity-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  padding: 0.72rem;
  background: var(--surface-muted);
  border-radius: 11px;
}
.activity-icon { display: grid; width: 34px; height: 34px; place-items: center; color: var(--accent-strong); background: var(--accent-soft); border-radius: 9px; }
.activity-item strong, .activity-item small { display: block; }
.activity-item small { margin-top: 0.15rem; color: var(--muted); }

.dashboard-findings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.finding-card {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.finding-card .finding-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.finding-card button { justify-self: start; }

.listing-card {
  grid-template-columns: 88px minmax(0, 1fr) auto;
  padding: 1rem;
  padding-left: 1.15rem;
  border-left: 4px solid var(--line-strong);
}
.listing-card.priority-high { border-left-color: #e66b72; }
.listing-card.priority-medium { border-left-color: #e6b65f; }
.listing-card.priority-low { border-left-color: #62c28e; }
.listing-thumbnail { height: 78px; }
.result-crawler-tag { position: static; grid-column: 2 / 3; justify-self: start; margin-top: -0.25rem; }

.risk-summary { margin-block: 0.55rem 0; }
.priority-badge { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; }

.rule-disabled { filter: grayscale(0.4); }

.scraper-form-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.scraper-form-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 13, 0.76);
  backdrop-filter: blur(5px);
}

.scraper-form-dialog {
  position: relative;
  width: min(1040px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.35rem;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-strong);
}

.scraper-library-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 1rem;
}
.scraper-card-list {
  max-height: none;
  overflow: visible;
}
.scraper-card-list .job-card { background: var(--surface-muted); box-shadow: none; }
.scraper-card-list .job-card-actions .job-action-icon {
  display: inline-grid;
  width: 2.15rem;
  min-width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 0.45rem;
  background: transparent;
  box-shadow: none;
}
.scraper-card-list .job-card-actions .job-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  width: 2.15rem;
  min-width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 0.45rem;
  box-shadow: none;
}
.scraper-card-list .job-card-actions .job-action-icon svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.scraper-card-list .job-card-actions .job-toggle-symbol {
  display: inline-block;
  width: auto;
  height: auto;
  color: currentColor;
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}
/* The pause/resume glyph inherits this color. Keep it explicitly contrasting
   against each scraper-card theme instead of sharing the light-theme slate. */
html[data-theme="light"] .scraper-card-list .job-card-actions .job-toggle-action {
  color: #334155 !important;
}
html[data-theme="light"] .scraper-card-list .job-card-actions .job-toggle-action:hover,
html[data-theme="light"] .scraper-card-list .job-card-actions .job-toggle-action:focus-visible {
  color: #0f172a !important;
  background: #e2e8f0 !important;
}
html[data-theme="dark"] .scraper-card-list .job-card-actions .job-toggle-action {
  color: #e2e8f0 !important;
  background: #1e293b !important;
}
html[data-theme="dark"] .scraper-card-list .job-card-actions .job-toggle-action:hover,
html[data-theme="dark"] .scraper-card-list .job-card-actions .job-toggle-action:focus-visible {
  color: #ffffff !important;
  background: #334155 !important;
}
html[data-theme] .scraper-card-list .job-card-actions .job-edit-action {
  color: #2563eb !important;
}
html[data-theme] .scraper-card-list .job-card-actions .job-delete-action {
  color: #dc2626 !important;
}
html[data-theme] .scraper-card-list .job-card-actions .job-edit-action:hover,
html[data-theme] .scraper-card-list .job-card-actions .job-edit-action:focus-visible {
  color: #1d4ed8 !important;
  background: #dbeafe !important;
}
html[data-theme] .scraper-card-list .job-card-actions .job-delete-action:hover,
html[data-theme] .scraper-card-list .job-card-actions .job-delete-action:focus-visible {
  color: #b91c1c !important;
  background: #fee2e2 !important;
}
.tab-panel[data-tab-panel="start"] button:not(.danger) {
  color: #18181b;
  background: #ffffff;
  border-color: #d4d4d8;
}
.tab-panel[data-tab-panel="start"] button:not(.danger):hover {
  color: #18181b;
  background: #e4e4e7;
  border-color: #a1a1aa;
}

.review-operations-panel > summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 750;
}
.review-operations-panel[open] > summary { margin-bottom: 0.8rem; }
.review-operations-panel #jobsList,
.review-operations-panel #runsList { margin-top: 1.1rem; }
.lead-filter-panel > summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 750;
}
.lead-filter-panel[open] > summary { margin-bottom: 0.8rem; }
.lead-filter-panel #filterForm {
  width: calc(100% - 0.75rem);
  margin-left: 0.75rem;
}
#filterForm .action-row { width: 100%; }
#filterForm .action-row > button[type="submit"] { width: 100%; justify-content: center; }
.lead-filter-panel .filter-section {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
}
.lead-filter-panel .filter-section > .panel-head {
  margin: 0;
  padding-left: 0.75rem;
}
.lead-filter-panel .filter-section > .filter-checkbox-list {
  margin-left: 2.25rem;
  width: calc(100% - 2.25rem);
}
.lead-filter-panel .filter-section .crawler-filter-option {
  background: transparent;
  border: 0;
}
.lead-filter-panel .review-status-filter {
  margin-left: 0;
  width: 100%;
  min-height: 0;
}
.lead-filter-panel .review-status-filter .review-status-select { margin-left: 0.75rem; }
.queue-panel {
  display: flex;
  height: min(56rem, calc(100dvh - 3rem));
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}
.queue-panel > .panel-head,
.queue-panel > .lead-filter-panel { flex: 0 0 auto; }
.queue-panel #listingsList {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin-top: 0.55rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.queue-panel .filter-checkbox-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  max-height: min(12rem, 18dvh);
}

.modal-backdrop { background: rgba(3, 7, 13, 0.74); backdrop-filter: blur(4px); }
.modal-panel { background: var(--surface-strong); border: 1px solid var(--line-strong); border-radius: 16px; }
.modal-head { background: color-mix(in srgb, var(--surface-strong) 94%, transparent); border-color: var(--line); border-radius: 16px 16px 0 0; }
.modal-panel { width: min(1120px, calc(100vw - 2rem)); }
.modal-content {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 0.9rem;
}
.detail-identity,
.detail-wide-panel { grid-column: 1 / -1; }
.detail-risk-panel,
.detail-capture-panel { align-self: start; background: var(--surface-muted); box-shadow: none; }
.detail-capture-panel > p { line-height: 1.75; white-space: pre-wrap; }

.toast { background: var(--surface-strong); color: var(--ink); border: 1px solid var(--line-strong); }
a { color: var(--accent-strong); }

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

@media (max-width: 760px) {
  :root { --sidebar-collapsed-width: 64px; }
  .sidebar { width: var(--sidebar-collapsed-width); padding-inline: 0.55rem; }
  .app-content { margin-left: var(--sidebar-collapsed-width); }
  .sidebar .nav-label, .brand-copy { display: none; }
  .sidebar-toggle, .sidebar .tab-button { justify-content: center; padding-inline: 0.4rem; }
  .hero { min-height: auto; padding: 1rem 1rem 0.55rem; flex-direction: column; }
  .hero-controls { align-self: flex-end; }
  .overview-hero { align-items: flex-start; flex-direction: column; }
  .metric-grid, .priority-overview, .dashboard-findings-grid { grid-template-columns: 1fr; }
  .listing-card { grid-template-columns: 1fr; }
  .modal-content { grid-template-columns: 1fr; }
  .detail-identity, .detail-wide-panel { grid-column: auto; }
  .result-crawler-tag { grid-column: auto; }
}

/* Posting details: one quiet reading surface with progressive disclosure. */
.detail-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
}
.detail-brand img { width: 30px; height: 30px; object-fit: contain; }
.lead-card-name { display: block; font-size: 1.02rem; }
.lead-card-source-title {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}
.posting-primary-surface {
  overflow: visible;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.posting-primary-surface > header,
.posting-source-content > section,
.posting-evidence-section { padding: 1.25rem 1.4rem; }
.posting-source-content > section,
.posting-evidence-section { border-top: 0; }
.lead-detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}
.lead-name-block { min-width: 0; }
.lead-name-display { display: flex; align-items: center; gap: 0.45rem; }
.lead-name-display h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.35rem); }
html[data-theme] .listing-detail-page button.icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 2rem;
  min-height: 2rem;
  padding: 0;
  place-items: center;
  border-radius: 8px;
}
.lead-name-form { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.lead-name-form input { min-width: min(360px, 65vw); font-size: 1.05rem; font-weight: 700; }
#leadNameForm,
.lead-name-display {
  min-height: clamp(3rem, 4.5vw, 3.4rem);
}
#leadNameForm {
  align-items: center;
}
#leadNameForm input {
  box-sizing: border-box;
  width: min(560px, 65vw);
  height: clamp(3rem, 4.5vw, 3.4rem);
  padding: 0.35rem 0.75rem;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 760;
  line-height: 1.1;
}
#leadNameForm button {
  height: 2.7rem;
  align-self: center;
}
.source-post-title {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}
.posting-meta-line { display: flex; flex: 0 0 100%; flex-wrap: wrap; overflow: visible; gap: 0.35rem 1rem; margin-top: 0.65rem; color: var(--muted); font-size: 0.8rem; white-space: normal; }
.posting-meta-line > * { flex: 0 0 auto; }
.posting-indicator-category { overflow: visible; }
.contact-related-button-wrap[data-disabled-help]::after { top: auto; bottom: calc(100% + 0.5rem); }
#futureTimelineResult:not(.hidden) { max-height: 12rem; overflow-y: auto; padding-right: 0.3rem; }
.review-outcome-label select { display: block; margin-top: 0.45rem; }
.carousel-image-card { flex: 0 0 auto; display: grid; gap: 0.35rem; }
.image-evidence-actions { display: flex; gap: 0.35rem; justify-content: center; }
.image-evidence-action { position: relative; display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 1px solid var(--line); border-radius: 0.42rem; background: var(--surface-muted); color: var(--ink); text-decoration: none; }
.image-evidence-action:hover { border-color: var(--accent); color: var(--accent); }
.image-evidence-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.image-evidence-action::after { content: attr(data-tooltip); position: absolute; z-index: 130; bottom: calc(100% + 0.45rem); left: 0; width: max-content; max-width: 13rem; padding: 0.45rem 0.6rem; color: var(--ink); background: var(--surface-strong); border: 1px solid var(--line-strong); border-radius: 7px; box-shadow: var(--shadow-strong); font-size: 0.72rem; font-weight: 600; line-height: 1.3; opacity: 0; pointer-events: none; transform: translate(0, 0.2rem); transition: opacity 120ms ease, transform 120ms ease; }
.image-evidence-action:hover::after, .image-evidence-action:focus-visible::after { opacity: 1; transform: translate(0, 0); }
.reverse-image-service-icon { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.google-lens-icon { stroke-width: 2.4; }
.google-lens-icon .lens-blue { stroke: #4285f4; }
.google-lens-icon .lens-red { stroke: #ea4335; }
.google-lens-icon .lens-yellow { stroke: #fbbc04; }
.google-lens-icon .lens-green { stroke: #34a853; }
.tineye-icon { color: #2d82aa; }
.expand-image-action svg { width: 1.32rem; height: 1.32rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.posting-location { display: inline-flex; align-items: center; gap: 0.3rem; }
.metadata-icon {
  position: relative;
  display: inline-grid;
  width: 1rem;
  height: 1rem;
  place-items: center;
  color: var(--muted);
  cursor: help;
  vertical-align: -0.13rem;
}
.metadata-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.metadata-tooltip {
  position: absolute;
  z-index: 150;
  bottom: calc(100% + 0.45rem);
  left: 50%;
  width: max-content;
  max-width: min(250px, calc(100vw - 2rem));
  padding: 0.42rem 0.56rem;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  box-shadow: var(--shadow-strong);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.2rem);
  transition: opacity 120ms ease, transform 120ms ease;
}
.metadata-icon:hover .metadata-tooltip,
.metadata-icon:focus-visible .metadata-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}
.metadata-icon svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.posting-search-term { display: inline-flex; align-items: center; gap: 0.3rem; }
.posting-website { display: inline-flex; align-items: center; gap: 0.3rem; }
.indicator-category-flag .metadata-icon { color: #ef4444; }
.indicator-category-flag .metadata-icon svg { fill: currentColor; }
.indicator-count { color: var(--muted); font-weight: 700; }
.compact-metadata-list { display: grid; gap: 0.24rem; }
.compact-metadata-line { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; }
.compact-metadata-line .metadata-icon { flex: 0 0 auto; }
.review-operations-panel .job-card-main > strong {
  display: block;
  margin-bottom: 0.45rem;
}
.scraper-card-list .job-card-main > strong {
  display: block;
  margin-bottom: 0.45rem;
}
.review-operations-panel #runsList > .card > strong {
  display: block;
  margin-bottom: 0.45rem;
}
.review-operations-panel .compact-metadata-list {
  gap: 0.08rem;
  line-height: 1.3;
}
.scraper-card-list .compact-metadata-list {
  gap: 0.08rem;
  line-height: 1.3;
}
.review-operations-panel .compact-metadata-line { line-height: 1.3; }
.scraper-card-list .compact-metadata-line { line-height: 1.3; }
.scraper-card-list .metadata-tooltip {
  left: 0;
  transform: translate(0, 0.2rem);
}
.scraper-card-list .metadata-icon:hover .metadata-tooltip,
.scraper-card-list .metadata-icon:focus-visible .metadata-tooltip {
  transform: translate(0, 0);
}
/* These rows live in scrollable panes; native tooltips avoid clipping at the pane edge. */
.review-operations-panel .compact-metadata-line .metadata-tooltip { display: none; }
.listings-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.15rem 0 0.2rem;
}
.pagination-button-wrap {
  position: relative;
  display: inline-flex;
  cursor: help;
}
.pagination-button-wrap button:disabled { pointer-events: none; cursor: inherit; }
.pagination-button-wrap::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 150;
  top: calc(100% + 0.45rem);
  left: 50%;
  width: max-content;
  max-width: min(240px, calc(100vw - 2rem));
  padding: 0.42rem 0.56rem;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  box-shadow: var(--shadow-strong);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -0.2rem);
  transition: opacity 120ms ease, transform 120ms ease;
}
.pagination-button-wrap:hover::after { opacity: 1; transform: translate(-50%, 0); }

/* Shared alignment for icon-and-label controls and compact multi-item rows. */
svg { vertical-align: middle; }
button > svg,
a > svg,
.metadata-icon > svg,
.info-tip > svg,
.posting-location > svg,
.posting-search-term > svg,
.posting-website > svg,
.posting-last-seen > svg {
  display: block;
  flex: 0 0 auto;
}
.action-row,
.title-with-help,
.field-label-with-help,
.rule-settings-trigger,
.risk-summary,
.tag-row,
.posting-meta-line,
.posting-location,
.posting-search-term,
.posting-website,
.posting-last-seen,
.compact-metadata-line,
.listing-scraper-sightings,
.listing-card-status-row,
.dashboard-finding-meta,
.lead-card-name-row,
.lead-name-display {
  align-items: center;
}
.title-with-help > .info-tip,
.panel-head .info-tip,
.modal-head .info-tip {
  align-self: center;
}
.legacy-advanced-tools { display: none; }
.legacy-advanced-tools .advanced-block > .stack { gap: 0.55rem; }
.legacy-advanced-tools .builder-grid > .card.stack { gap: 0.5rem; }
.legacy-advanced-tools .builder-grid > .card.stack .meta { margin: 0; }
.storage-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.7rem; margin-top: 1rem; }
.storage-breakdown .card { padding: 0.8rem; }
.lead-hero-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 0.55rem; }
.priority-inline-control {
  display: flex;
  align-items: center;
  gap: 0.38rem;
}
.needs-risk-review { min-height: 42px; padding: 0.48rem 0.9rem; color: var(--ink) !important; background: #fff1f2 !important; border-color: #fda4af !important; border-radius: 0.55rem; font-weight: 800; }
.needs-risk-review:hover, .needs-risk-review:focus-visible { color: var(--ink) !important; background: #ffe4e6 !important; border-color: #fb7185 !important; }
.needs-risk-review-mark { color: #dc2626; }
html[data-theme="dark"] .needs-risk-review { color: #fecdd3 !important; background: #4c0519 !important; border-color: #fb7185 !important; }
html[data-theme="dark"] .needs-risk-review:hover,
html[data-theme="dark"] .needs-risk-review:focus-visible { color: #fff1f2 !important; background: #881337 !important; border-color: #fda4af !important; }
html[data-theme="dark"] .needs-risk-review-mark { color: #fda4af; }
.priority-inline-control:has(> .risk-gauge) { flex-direction: column; align-items: center; gap: 0.1rem; }
.priority-inline-control > .risk-gauge { width: 10.25rem; height: 5.9rem; }
.priority-inline-control > .risk-gauge .risk-gauge-copy { inset: 1.68rem 0 0; }
.priority-inline-control > .risk-gauge .risk-gauge-copy strong { font-size: 1.6rem; }
.priority-badge.priority-large {
  min-height: 5.9rem;
  padding: 0.48rem 0.8rem;
  font-size: 0.78rem;
}
.priority-provenance {
  position: relative;
  display: inline-grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.priority-provenance:hover,
.priority-provenance:focus-visible { color: var(--accent); background: var(--accent-soft); }
.priority-provenance svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.priority-select-badge {
  position: relative;
  display: inline-flex;
  min-width: 8.5rem;
  padding: 0;
  cursor: pointer;
}
.priority-select-badge:focus-within { outline: 2px solid #3b82f6; outline-offset: 2px; }
.priority-select-badge select {
  width: 100%;
  height: 40px;
  padding: 0 2rem 0 0.8rem;
  color: currentColor;
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 800;
  letter-spacing: inherit;
  text-transform: uppercase;
  width: 100%;
  cursor: pointer;
}
.priority-select-badge svg {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transform: translateY(-50%);
}
.risk-badge-with-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 8.5rem;
  text-align: center;
}
.risk-badge-caret {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.risk-badge-edit {
  display: inline-grid;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  place-items: center;
  color: currentColor;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.risk-badge-edit:hover,
.risk-badge-edit:focus-visible { background: rgba(255, 255, 255, 0.2); }
.risk-badge-edit svg { width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.section-line { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.85rem; }
.posting-description-body { position: relative; }
.posting-description-section p {
  max-height: 14em;
  margin: 0;
  padding-right: 0.35rem;
  white-space: pre-wrap;
  line-height: 1.75;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.posting-description-section p.is-expanded { max-height: none; overflow-y: visible; }
.posting-description-toggle {
  position: absolute;
  right: 0.15rem;
  bottom: 0.15rem;
  padding: 0.12rem 0.2rem;
  color: var(--muted);
  background: var(--surface);
  border: 0;
  border-radius: 3px;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.2;
  cursor: pointer;
}
.posting-description-toggle:hover,
.posting-description-toggle:focus-visible { color: var(--ink); background: var(--surface-muted); }
.posting-overflow-menu { position: relative; }
.posting-overflow-menu > summary {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 800;
  list-style: none;
}
.posting-overflow-menu > summary::-webkit-details-marker { display: none; }
.posting-overflow-menu > div {
  position: absolute;
  z-index: 25;
  top: calc(100% + 0.35rem);
  right: 0;
  display: grid;
  min-width: 180px;
  padding: 0.35rem;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-strong);
}
.posting-overflow-menu a { padding: 0.65rem 0.75rem; color: var(--ink); border-radius: 7px; text-decoration: none; }
.posting-overflow-menu a:hover { background: var(--surface-muted); }
.evidence-category-list { border-top: 1px solid var(--line); }
.evidence-category { border-bottom: 1px solid var(--line); }
.evidence-category > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0.15rem;
  cursor: pointer;
}
.evidence-category > summary > span:first-child { display: grid; gap: 0.2rem; }
.evidence-category > summary small { color: var(--muted); font-size: 0.75rem; }
.category-priority-stack { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.3rem; }
.evidence-rule-list { padding: 0 0 0.75rem 1.25rem; }
.evidence-rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}
.contact-evidence-row { grid-template-columns: minmax(0, 1fr) auto; }
html[data-theme] .listing-detail-page button.evidence-rule-main {
  display: grid;
  justify-items: start;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.35rem 0.2rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: left;
}
html[data-theme] .listing-detail-page button.evidence-rule-main:hover { color: var(--ink); background: var(--surface-muted); }
.evidence-rule-main span { font-weight: 750; }
.evidence-rule-main small,
.adjusted-rule-note { color: var(--muted); font-size: 0.75rem; }
.empty-inline { padding: 0.9rem; color: var(--muted); background: var(--surface-muted); border-radius: 10px; }
.risk-details-content { padding: 0.9rem 1rem 1rem; gap: 0.85rem; }
.risk-details-summary { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; color: var(--muted); font-size: 0.88rem; }
.risk-details-summary strong { color: var(--ink); }
.risk-details-timeline { display: grid; gap: 0.45rem; }
.risk-details-timeline .priority-audit-list { max-height: 6.5rem; margin: 0; padding-right: 0.35rem; overflow-y: auto; }
.risk-details-timeline .priority-audit-entry { display: grid; gap: 0.16rem; padding: 0.05rem 0 0.05rem 0.7rem; }
.risk-details-timeline .priority-audit-entry span { font-size: 0.84rem; font-weight: 650; }
.risk-details-timeline .priority-audit-entry small { color: var(--muted); font-size: 0.76rem; }
.capture-history-panel { margin-top: 0.2rem; }

@media (max-width: 820px) {
  .lead-detail-hero { flex-direction: column; }
  .lead-hero-actions { flex-wrap: wrap; }
  .evidence-rule-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .evidence-rule-row .evidence-rule-main { grid-column: 1 / -1; }
}

/* Flat neutral visual system and configurable priority workflow. */
:root {
  --bg: #09090b;
  --surface: #141416;
  --surface-muted: #18181b;
  --surface-strong: #202023;
  --ink: #f4f4f5;
  --muted: #a1a1aa;
  --line: #2e2e33;
  --line-strong: #44444b;
  --accent: #d4d4d8;
  --accent-strong: #fafafa;
  --accent-soft: #29292e;
  --input-bg: #18181b;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.24);
  --shadow-strong: 0 28px 64px rgba(0, 0, 0, 0.4);
  --primary-bg: #f4f4f5;
  --primary-ink: #18181b;
}

:root[data-theme="light"] {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-muted: #f7f7f8;
  --surface-strong: #ffffff;
  --ink: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-strong: #c9c9cf;
  --accent: #3f3f46;
  --accent-strong: #18181b;
  --accent-soft: #ededf0;
  --input-bg: #ffffff;
  --shadow: 0 14px 38px rgba(24, 24, 27, 0.09);
  --shadow-strong: 0 28px 60px rgba(24, 24, 27, 0.16);
  --primary-bg: #27272a;
  --primary-ink: #fafafa;
}

body,
[data-theme="light"] body {
  background: var(--bg);
  background-image: none;
}

.background-grid { display: none; }

.sidebar {
  background: #0c0c0e;
  border-right-color: #29292e;
}

[data-theme="light"] .sidebar { background: #18181b; }
.brand-mark { background: rgba(255, 255, 255, 0.06); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.32); }
[data-theme="light"] .brand-mark { background: #ffffff; }
.sidebar .tab-button.active {
  background: #29292e;
  color: #fafafa;
  border-color: #52525b;
  box-shadow: inset 3px 0 #d4d4d8;
}
.sidebar .tab-button.active::before { background: #e4e4e7; }

.primary,
.button-primary,
button[type="submit"]:not(.danger) {
  background: var(--primary-bg);
  color: var(--primary-ink);
  border-color: var(--primary-bg);
  background-image: none;
}

.overview-hero {
  background: #242427;
  background-image: none;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .overview-hero {
  background: #27272a;
  background-image: none;
}
.overview-hero button { color: #18181b; background: #f4f4f5; }

.priority-overview { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.priority-overview-card.critical { border-top: 3px solid #c084fc; }
.priority-overview-card.high { border-top-color: #fb7185; }
.priority-overview-card.medium { border-top-color: #fbbf24; }
.priority-overview-card.low { border-top-color: #60a5fa; }
.priority-overview-card.benign { border-top: 3px solid #71717a; }

.priority-badge.priority-critical { color: #e9d5ff; background: #3b0764; border-color: #7e22ce; }
.priority-badge.priority-high { color: #fecdd3; background: #4c0519; border-color: #be123c; }
.priority-badge.priority-medium { color: #fef3c7; background: #451a03; border-color: #b45309; }
.priority-badge.priority-low { color: #dbeafe; background: #172554; border-color: #1d4ed8; }
.priority-badge.priority-benign { color: #d4d4d8; background: #27272a; border-color: #52525b; }

[data-theme="light"] .priority-badge.priority-critical { color: #6b21a8; background: #f3e8ff; border-color: #d8b4fe; }
[data-theme="light"] .priority-badge.priority-high { color: #9f1239; background: #fff1f2; border-color: #fda4af; }
[data-theme="light"] .priority-badge.priority-medium { color: #92400e; background: #fffbeb; border-color: #fcd34d; }
[data-theme="light"] .priority-badge.priority-low { color: #1e40af; background: #eff6ff; border-color: #93c5fd; }
[data-theme="light"] .priority-badge.priority-benign { color: #52525b; background: #f4f4f5; border-color: #d4d4d8; }

.listing-card.priority-critical { border-left-color: #c084fc; }
.listing-card.priority-high { border-left-color: #fb7185; }
.listing-card.priority-medium { border-left-color: #fbbf24; }
.listing-card.priority-low { border-left-color: #60a5fa; }
.listing-card.priority-benign { border-left-color: #71717a; }

.risk-source,
.priority-source {
  color: var(--muted);
  font-size: 0.75rem;
}

.category-count-chip,
.benign-category-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 0.76rem;
}

.benign-category-chip { color: var(--muted); }

.rules-settings-button,
.rules-settings-fab {
  position: sticky;
  z-index: 12;
  bottom: 1.25rem;
  margin: 1rem 0 0 auto;
  display: flex;
  width: max-content;
  box-shadow: var(--shadow-strong);
}

.panel-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.rule-settings-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}

.rule-settings-icon {
  display: inline-block;
  flex: 0 0 auto;
  font-size: 1.35rem;
  line-height: 1;
}

.settings-modal-content {
  display: grid;
  gap: 1.15rem;
}

.settings-modal-panel {
  width: min(680px, calc(100vw - 2rem));
  overflow: visible;
  padding: 1rem 1.1rem 1.1rem;
}
.settings-modal-panel .modal-head {
  position: static;
  margin: -1rem -1.1rem 0;
  padding: 0.7rem 1.1rem 0.5rem;
  background: transparent;
  border: 0;
  border-radius: 16px 16px 0 0;
  backdrop-filter: none;
}
.settings-modal-panel .modal-head h2 { font-size: 1.1rem; }
.settings-modal-panel .info-tip-content {
  left: 0;
  transform: translate(0, -0.2rem);
}
.settings-modal-panel .info-tip:hover .info-tip-content,
.settings-modal-panel .info-tip:focus-visible .info-tip-content { transform: translate(0, 0); }
.settings-modal-panel #prioritySettingsForm { gap: 0.65rem; }
.settings-modal-panel .settings-scale { margin-top: 0.2rem; }
.threshold-setting {
  display: grid;
  grid-template-columns: 1fr 110px;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}
.threshold-setting span { display: grid; gap: 0.2rem; }
.threshold-setting small { color: var(--muted); }
.threshold-setting input { width: 100%; }
.settings-scale { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }

.threshold-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.threshold-card,
.priority-scale,
.priority-adjustment,
.priority-adjustment-form,
.priority-audit {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.threshold-card { display: grid; gap: 0.45rem; }
.threshold-card input { width: 100%; }
.priority-scale { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.priority-scale-arrow { color: var(--muted); }

.priority-adjustment form,
.priority-adjustment-form { display: grid; gap: 0.75rem; }
.priority-adjustment textarea,
.priority-adjustment-form textarea { min-height: 88px; }
.system-priority-callout {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.45rem 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.priority-source-note { color: var(--muted); font-size: 0.75rem; }
.priority-audit { margin-top: 0.8rem; }
.priority-audit-list { display: grid; gap: 0.65rem; margin-top: 0.65rem; }
.priority-audit-entry { padding-left: 0.75rem; border-left: 2px solid var(--line-strong); }
.priority-audit-entry p { margin: 0.15rem 0; }
body.rule-settings-open { overflow: hidden; }
body.rule-editor-open { overflow: hidden; }
.rule-editor-modal-panel { width: min(680px, calc(100vw - 2rem)); }
.rule-editor-content { padding: 1rem; }
.emoji-selector-launcher { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: -0.2rem; }
.emoji-selector-label { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.emoji-platform-actions { display: flex; gap: 0.45rem; }
.emoji-platform-button { position: relative; display: grid; width: 2.35rem; height: 2.2rem; padding: 0; place-items: center; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 0.55rem; box-shadow: none; }
.emoji-platform-button:hover, .emoji-platform-button:focus-visible { color: var(--surface); background: var(--ink); border-color: var(--ink); transform: none; }
.emoji-platform-button::after { content: attr(data-tooltip); position: absolute; z-index: 5; top: calc(100% + 0.45rem); right: 0; width: max-content; padding: 0.4rem 0.55rem; color: var(--ink); background: var(--surface-strong); border: 1px solid var(--line-strong); border-radius: 0.4rem; box-shadow: var(--shadow-strong); font-size: 0.72rem; font-weight: 700; opacity: 0; pointer-events: none; transform: translateY(-0.2rem); transition: opacity 120ms ease, transform 120ms ease; }
.emoji-platform-button:hover::after, .emoji-platform-button:focus-visible::after { opacity: 1; transform: translateY(0); }
.emoji-platform-button svg { width: 1.22rem; height: 1.22rem; fill: currentColor; }
.emoji-selector { display: grid; gap: 0.75rem; margin-top: 0.1rem; padding: 0.9rem; background: var(--surface-muted); border: 1px solid var(--line-strong); border-radius: 0.75rem; }
.emoji-selector-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.emoji-selector-head .ghost { padding: 0.35rem 0.55rem; font-size: 0.78rem; }
.emoji-search-label { display: grid; gap: 0.35rem; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.emoji-selector-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.45rem; max-height: 230px; overflow-y: auto; }
.emoji-result { display: grid; gap: 0.18rem; min-height: 4.3rem; padding: 0.5rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 0.55rem; box-shadow: none; font-size: 1.35rem; text-align: left; }
.emoji-result span { overflow: hidden; color: var(--muted); font-size: 0.65rem; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.emoji-result:hover, .emoji-result:focus-visible { border-color: var(--accent-strong); background: var(--accent-soft); transform: none; }
.emoji-load-more { grid-column: 1 / -1; min-height: 2.5rem; padding: 0.55rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: none; font-size: 0.8rem; }
.emoji-empty { grid-column: 1 / -1; margin: 0.3rem; color: var(--muted); font-size: 0.85rem; }
.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; }

.rule-catalog-card { margin-top: 0.9rem; }
.rule-category-list { gap: 0.65rem; }
.rule-category-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.rule-category-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  list-style: none;
}

.rule-category-group > summary::-webkit-details-marker { display: none; }
.rule-category-group > summary::before {
  content: "›";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 140ms ease;
}
.rule-category-group[open] > summary::before { transform: rotate(90deg); }
.rule-category-group > summary > span:first-of-type {
  display: grid;
  flex: 1 1 auto;
  gap: 0.18rem;
}
.rule-category-group > summary small { color: var(--muted); font-weight: 500; }
.rule-count-badge {
  flex: 0 0 auto;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}
.rule-category-summary-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.45rem;
}
.rule-category-summary-actions button.category-edit-button,
.rule-category-summary-actions button.indicator-delete-button {
  width: 2.5rem;
  height: 2.5rem;
}
.rule-category-summary-actions .pencil-icon,
.rule-category-summary-actions .trash-icon {
  width: 1.18rem;
  height: 1.18rem;
}
.rule-category-content {
  padding: 0 0.8rem 0.8rem;
  border-top: 1px solid var(--line);
}
.rule-category-content > :first-child { margin-top: 0.8rem; }
.rule-catalog-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
}
.rule-catalog-copy {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 0.5rem;
}
.rule-catalog-phrase { flex: 0 0 auto; white-space: pre-wrap; }
.rule-catalog-divider {
  flex: 0 0 auto;
  color: var(--line-strong);
  font-weight: 800;
}
.rule-catalog-explanation {
  min-width: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.35;
}
.rule-catalog-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}
.rule-catalog-state {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}
.rule-catalog-actions { gap: 0.3rem; }
.rule-catalog-actions button {
  padding: 0.38rem 0.56rem;
  font-size: 0.76rem;
}
.rule-catalog-actions button.rule-delete-button {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
}
.rule-catalog-actions button.rule-edit-button {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
}
.system-managed-badge {
  padding: 0.25rem 0.48rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.system-managed-indicator { border-style: dashed; }
.empty-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 980px) {
  .rule-catalog-entry { grid-template-columns: minmax(0, 1fr); }
  .rule-catalog-tools { justify-content: flex-start; flex-wrap: wrap; }
}

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

@media (max-width: 760px) {
  .threshold-grid { grid-template-columns: 1fr; }
  .threshold-setting { grid-template-columns: 1fr; }
  .priority-overview { grid-template-columns: 1fr; }
  .rules-settings-button,
  .rules-settings-fab { right: auto; }
  .panel-head-actions { width: 100%; justify-content: flex-start; }
  .queue-panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .queue-panel #listingsList {
    max-height: 60dvh;
    min-height: 14rem;
  }
}

/* High-contrast Scrapers actions in both themes. Keep destructive actions red. */
[data-tab-panel="start"] .scraper-library-actions button:not(.danger),
[data-tab-panel="start"] .scraper-form-dialog button:not(.danger) {
  color: #18181b;
  background: #ffffff;
  background-image: none;
  border-color: #a1a1aa;
  box-shadow: none;
}

[data-tab-panel="start"] .scraper-library-actions button:not(.danger):hover,
[data-tab-panel="start"] .scraper-form-dialog button:not(.danger):hover {
  color: #09090b;
  background: #e4e4e7;
  border-color: #71717a;
}

/* High-contrast Leads actions in dark mode. */
html[data-theme="dark"] [data-tab-panel="review"] button:not(.danger) {
  color: #18181b;
  background: #ffffff;
  background-image: none;
  border-color: #a1a1aa;
  box-shadow: none;
}

html[data-theme="dark"] [data-tab-panel="review"] button:not(.danger):hover {
  color: #09090b;
  background: #e4e4e7;
  border-color: #71717a;
}

html[data-theme="dark"] #addCategoryButton,
html[data-theme="dark"] #addRuleButton {
  color: #09090b;
  background: #ffffff;
  background-image: none;
  border-color: #ffffff;
  box-shadow: none;
}

html[data-theme="dark"] #addCategoryButton:hover,
html[data-theme="dark"] #addRuleButton:hover,
html[data-theme="dark"] #addCategoryButton:focus-visible,
html[data-theme="dark"] #addRuleButton:focus-visible {
  color: #000000;
  background: #e4e4e7;
  border-color: #a1a1aa;
}

.correlation-chip {
  border-color: color-mix(in srgb, #8b5cf6 42%, var(--line));
  background: color-mix(in srgb, #8b5cf6 12%, var(--surface-strong));
}

.sighting-chip {
  border-color: color-mix(in srgb, #0ea5e9 38%, var(--line));
  background: color-mix(in srgb, #0ea5e9 10%, var(--surface-strong));
}

.contact-entity-button small,
.correlation-entry small { color: var(--muted); }

.contact-entity-button,
.correlation-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}

.contact-entity-button {
  width: 100%;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.contact-entity-button:hover,
.contact-entity-button:focus-visible {
  color: var(--ink);
  background: var(--accent-soft);
  border-color: var(--line-strong);
}

:root[data-theme="light"] .contact-entity-button {
  color: #18181b;
  background: #ffffff;
  border-color: #a1a1aa;
}

:root[data-theme="light"] .contact-entity-button small {
  color: #3f3f46;
}

:root[data-theme="light"] .contact-entity-button:hover,
:root[data-theme="light"] .contact-entity-button:focus-visible {
  color: #09090b;
  background: #f4f4f5;
  border-color: #71717a;
}

.contact-entity-button > span,
.contact-entity-button > small,
.correlation-entry > div {
  display: block;
}

.correlation-entry > div { flex: 1 1 auto; }
.correlation-entry span,
.correlation-entry small { display: block; }

/* The height is set from the first three rendered entries so additional
   correlations remain available without expanding the detail panel. */
.correlation-evidence-results {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
}

.similarity-evidence-results {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
}

.version-compare-controls,
.version-diff-summary,
.version-diff-field {
  margin-top: 0.75rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}

.version-compare-controls,
.version-diff-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.version-compare-select {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  font-weight: 700;
}

.version-diff-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.55rem;
}

.version-diff-columns > div {
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.version-diff-text {
  margin-top: 0.35rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.version-diff-field.unchanged { opacity: 0.72; }
.version-diff-text del {
  color: #991b1b;
  background: #fee2e2;
  text-decoration: line-through;
}
.version-diff-text ins {
  color: #166534;
  background: #dcfce7;
  text-decoration: none;
}

@media (max-width: 760px) {
  .version-diff-columns { grid-template-columns: 1fr; }
  .version-compare-controls,
  .version-diff-summary { align-items: flex-start; flex-direction: column; }
}

.listing-detail-route .sidebar,
.listing-detail-route .app-content { display: none; }

.listing-detail-page {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.listing-detail-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.listing-detail-header h1 { margin: 0.1rem 0 0; }
.listing-detail-content { margin-top: 1rem; }
.listing-detail-content > .card {
  width: 100%;
  align-self: stretch;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
}

.view-details-link {
  color: var(--primary-ink);
  background: var(--primary-bg);
  border-color: var(--primary-bg);
}

.view-details-link:hover,
.view-details-link:focus-visible {
  color: var(--primary-ink);
  background: var(--accent-strong);
}

.view-original-link {
  gap: 0.4rem;
  color: var(--accent-strong);
  background: var(--surface-strong);
  border-color: var(--line-strong);
}
.view-original-link:hover,
.view-original-link:focus-visible {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-strong);
}
.external-link-icon {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="dark"] .view-details-link {
  color: #18181b;
  background: #ffffff;
  border-color: #a1a1aa;
}

html[data-theme="dark"] .view-details-link:hover,
html[data-theme="dark"] .view-details-link:focus-visible {
  color: #09090b;
  background: #e4e4e7;
  border-color: #71717a;
}

.listing-tag-editor-list {
  display: grid;
  gap: 0.55rem;
}

.listing-tag-editor {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}

.listing-tag-editor .tag-button { flex: 1 1 260px; text-align: left; }
.tag-remove-button.confirming {
  color: #fff;
  border-color: #b91c1c;
  background: #b91c1c;
}

.tag-priority-modal-panel { width: min(540px, calc(100vw - 2rem)); }

html[data-theme="dark"] .listing-detail-page button:not(.danger):not(.confirming),
html[data-theme="dark"] .listing-detail-page .button-link {
  color: #111;
  border-color: #fff;
  background: #fff;
}

html[data-theme="dark"] .listing-detail-page button:not(.danger):not(.confirming):hover,
html[data-theme="dark"] .listing-detail-page .button-link:hover {
  color: #000;
  background: #e5e7eb;
}

@media (max-width: 700px) {
  .listing-detail-header { align-items: flex-start; flex-direction: column; }
  .listing-tag-editor > button { flex: 1 1 auto; }
}

/* Reduced-density analyst workflow. */
.metric-grid .stat::before { display: none; }
.metric-grid .stat {
  overflow: visible;
  box-shadow: none;
}
.metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.dashboard-findings-list { display: grid; }
.dashboard-finding-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.dashboard-finding-row:last-child { border-bottom: 0; }
.dashboard-finding-main { min-width: 0; }
.dashboard-finding-main strong,
.dashboard-finding-main .meta { display: block; }
.dashboard-finding-row .priority-badge {
  box-sizing: border-box;
  padding: 0.55rem 0.8rem;
  font-size: 0.88rem;
  line-height: normal;
  letter-spacing: normal;
  text-transform: none;
}
.dashboard-finding-meta {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.posting-last-seen { display: inline-flex; align-items: center; gap: 0.3rem; }
.metadata-divider { line-height: 1; }
.dashboard-finding-meta .metadata-tooltip {
  left: 0;
  transform: translate(0, 0.2rem);
}
.dashboard-finding-meta .metadata-icon:hover .metadata-tooltip,
.dashboard-finding-meta .metadata-icon:focus-visible .metadata-tooltip {
  transform: translate(0, 0);
}
.dashboard-finding-source-title {
  overflow: hidden;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-card,
.listing-card.priority-critical,
.listing-card.priority-high,
.listing-card.priority-medium,
.listing-card.priority-low,
.listing-card.priority-benign {
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.sidebar .tab-button.active { box-shadow: none; }
.sidebar .tab-button.active::before { display: none; }

.title-with-help {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.title-with-help h2,
.title-with-help h1,
.title-with-help strong { margin: 0; }
.field-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.info-tip {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  cursor: help;
}
.info-tip-content {
  position: absolute;
  z-index: 100;
  top: calc(100% + 0.45rem);
  left: 50%;
  width: min(310px, 75vw);
  padding: 0.65rem 0.75rem;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  box-shadow: var(--shadow-strong);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -0.2rem);
  transition: opacity 120ms ease, transform 120ms ease;
}
.info-tip:hover .info-tip-content,
.info-tip:focus-visible .info-tip-content {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Page-header help sits near the viewport edge on narrow Leads layouts. */
#heroInfo .info-tip-content {
  left: 0;
  width: min(310px, calc(100vw - 2rem));
  transform: translate(0, -0.2rem);
}
#heroInfo:hover .info-tip-content,
#heroInfo:focus-visible .info-tip-content {
  transform: translate(0, 0);
}

.setup-shell.single-column { grid-template-columns: minmax(0, 1fr); }
.setup-shell.single-column .step-card { box-shadow: none; }
.setup-action-status {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.15rem;
  padding: 0.8rem;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.rules-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.rule-category-group {
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.rule-category-group > summary { padding-inline: 0.25rem; }
.rule-category-content {
  margin-left: 1.5rem;
  padding: 0 0 0.85rem;
  border-top: 0;
}
.rule-catalog-entry {
  border: 1px solid var(--line);
  box-shadow: none;
}

.rule-editor-content label,
#tagPriorityForm label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}

.filter-checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  max-height: none;
}
.crawler-filter-option,
.simple-check-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.crawler-filter-option input,
.simple-check-option input { margin: 0; }

/* Scraper filters are intentionally a simple, single-column checklist. */
.queue-panel .filter-checkbox-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  margin: 0;
  padding: 0;
  gap: 0.35rem;
  max-height: min(16rem, 26dvh);
}
.queue-panel #indicatorCategoryFilterOptions {
  flex-wrap: nowrap;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
.queue-panel #indicatorCategoryFilterOptions .crawler-filter-option {
  flex: 0 0 auto;
  width: 100%;
}
.review-status-filter {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 3rem;
}
.review-status-select {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}
.review-status-select select {
  width: auto;
  min-width: 12rem;
  min-height: 2.1rem;
  padding: 0.35rem 0.65rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
}
.queue-panel .crawler-filter-option {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  width: 100%;
  justify-content: start;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0;
  text-align: left;
}
.queue-panel .crawler-filter-option span {
  justify-self: start;
  text-align: left;
}

/* An expanded filter should grow with its indicator list instead of trapping
   selections in a nested scroll area. */
.queue-panel:has(.lead-filter-panel[open]) {
  height: auto;
  overflow: visible;
}

/* The Scrapers hint sits near the left edge of the scrolling Leads workspace. */
.lead-filter-panel .info-tip-content {
  left: 0;
  width: min(310px, calc(100vw - 3rem));
  transform: translate(0, -0.2rem);
}
.lead-filter-panel .info-tip:hover .info-tip-content,
.lead-filter-panel .info-tip:focus-visible .info-tip-content {
  transform: translate(0, 0);
}

@media (max-width: 720px) {
  .dashboard-finding-row { grid-template-columns: minmax(0, 1fr) auto; }
  .dashboard-finding-row button { grid-column: 1 / -1; justify-self: start; }
}

/* Keep the entire parsed-contact workflow readable on light surfaces. */
html[data-theme="light"] .parsed-contacts-section,
html[data-theme="light"] .parsed-contacts-section > strong,
html[data-theme="light"] .parsed-contacts-section .contact-entity-button > span,
html[data-theme="light"] #contactRelatedListings,
html[data-theme="light"] #contactRelatedListings .correlation-entry span {
  color: #09090b;
}

html[data-theme="light"] .parsed-contacts-section .contact-entity-button {
  appearance: none;
  color: #09090b;
  background-color: #ffffff;
  border: 2px solid #71717a;
}

html[data-theme="light"] .parsed-contacts-section .contact-entity-button > span {
  font-weight: 750;
}

html[data-theme="light"] .parsed-contacts-section .contact-entity-button > small,
html[data-theme="light"] .parsed-contacts-section .meta,
html[data-theme="light"] #contactRelatedListings .correlation-entry small {
  color: #27272a;
  font-weight: 600;
}

html[data-theme="light"] .parsed-contacts-section .contact-entity-button:hover,
html[data-theme="light"] .parsed-contacts-section .contact-entity-button:focus-visible {
  color: #000000;
  background-color: #e4e4e7;
  border-color: #3f3f46;
}

html[data-theme="light"] #contactRelatedListings .correlation-entry {
  color: #09090b;
  background: #ffffff;
  border-color: #a1a1aa;
}

.safer-viewing-toggle {
  display: inline-flex;
  align-items: center;
}

html[data-theme] button.icon-control {
  position: relative;
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0 !important;
  place-items: center;
  color: var(--ink) !important;
  background: var(--surface) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 9px;
  box-shadow: none !important;
}

html[data-theme] button.icon-control:hover,
html[data-theme] button.icon-control:focus-visible {
  color: var(--ink) !important;
  background: var(--surface-muted) !important;
  border-color: var(--ink) !important;
  transform: none !important;
}

.control-icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-moon { display: none; }
html[data-theme="light"] .theme-icon-sun { display: none; }
html[data-theme="light"] .theme-icon-moon { display: block; }
.safer-viewing-toggle:not(.active) .eye-off-slash { display: none; }

.icon-control::after,
.priority-provenance::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 120;
  top: calc(100% + 0.5rem);
  right: 0;
  width: max-content;
  max-width: 220px;
  padding: 0.45rem 0.6rem;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  box-shadow: var(--shadow-strong);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.2rem);
  transition: opacity 120ms ease, transform 120ms ease;
}

.icon-control:hover::after,
.icon-control:focus-visible::after,
.priority-provenance:hover::after,
.priority-provenance:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.crossed-eye-icon {
  display: inline-grid;
  min-width: 1.35rem;
  place-items: center;
  line-height: 1;
}

.crossed-eye-icon svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crossed-eye-icon .eye-off-slash { stroke-width: 2.8; }

html[data-theme] [data-tab-panel="review"] button.safer-image-frame,
html[data-theme] .listing-detail-page button.safer-image-frame {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: #ffffff;
  background: #111111;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
  cursor: default;
  transform: none;
}

html[data-theme] [data-tab-panel="review"] button.safer-image-frame:hover,
html[data-theme] .listing-detail-page button.safer-image-frame:hover {
  color: #ffffff;
  background: #111111;
  transform: none;
}

.listing-card {
  grid-template-columns: 240px minmax(0, 1fr) auto;
  min-height: 240px;
  overflow: hidden;
}

.queue-panel #listingsList > .listing-card {
  flex: 0 0 auto;
}

.listing-card-media {
  position: absolute;
  inset: 0 auto 0 0;
  width: 240px;
  height: 240px;
  aspect-ratio: 1;
  height: 100%;
  min-height: 0;
  margin: 0;
}

.listing-card-main { grid-column: 2; }
.listing-card-side { grid-column: 3; }
.listing-scraper-sightings {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}
.listing-card-main .lead-card-name,
.listing-card-main .lead-card-source-title,
.listing-card-main .risk-summary,
.listing-card-main .priority-badge,
.listing-card-main .tag-chip,
.listing-card-main .meta,
.listing-card-main .listing-scraper-sightings {
  font-size: 0.85rem;
  line-height: 1.4;
}
.listing-card-main .lead-card-name { font-size: 1rem; }
.listing-card-main .lead-card-name,
.listing-card-main .lead-card-source-title { color: var(--ink); }
.listing-card-main .tag-row { margin-top: 0.2rem; }
.listing-card-main .tag-row > .indicator-count,
.listing-card-main .tag-row > .indicator-category-flag {
  display: inline-flex;
  align-items: center;
  align-self: center;
}
.listing-card-main .indicator-category-flag .metadata-icon { vertical-align: middle; }
.listing-card-side > .priority-badge {
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1.4;
}
.listing-card-status-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: 0.45rem;
}
.listing-card-status-row .risk-gauge { justify-self: center; }
.listing-card-side .view-details-link,
.listing-card-side .view-original-link { justify-self: center; }
.listing-card-status-row > .priority-badge,
.listing-card-status-row > .pill {
  justify-content: center;
  min-width: 0;
  font-size: 0.85rem;
  line-height: 1.4;
}
.listing-card-status-row > .priority-badge {
  width: 11.5rem;
  min-height: 5.5rem;
  border-radius: 0.65rem;
  text-align: center;
}
.listing-status-active { color: #166534; background: #dcfce7; }
.listing-status-inactive { color: #52525b; background: #e4e4e7; }
html[data-theme="dark"] .listing-status-active { color: #bbf7d0; background: rgba(34, 197, 94, 0.2); }
html[data-theme="dark"] .listing-status-inactive { color: #d4d4d8; background: rgba(161, 161, 170, 0.2); }

.safer-image-listing,
.listing-card-media > .listing-thumbnail {
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
}

.safer-image-listing { height: 100%; }
.safer-image-listing .listing-thumbnail {
  height: 100%;
  border: 0;
  border-radius: 0;
}

@media (max-width: 760px) {
  .listing-card { grid-template-columns: 1fr; min-height: 0; }
  .listing-card-media {
    position: relative;
    inset: auto;
    width: auto;
    height: 140px;
    min-height: 140px;
    margin: -1rem -1rem 0;
  }
  .listing-card-main,
  .listing-card-side { grid-column: auto; }
}

.safer-image-detail { min-height: 190px; }
.safer-image-detail img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.safer-image-cover {
  display: none;
  position: absolute;
  inset: 0;
  align-content: center;
  justify-items: center;
  padding: 0.75rem;
  color: #ffffff;
  background: rgba(9, 9, 11, 0.48);
  text-align: center;
}

.safer-image-cover .crossed-eye-icon {
  width: 3.5rem;
  height: 3.5rem;
  color: #ffffff;
}

.safer-image-cover .crossed-eye-icon svg {
  width: 2.7rem;
  height: 2.7rem;
  stroke-width: 2.2;
}

.safer-image-frame.is-obscured { cursor: pointer !important; }
.safer-image-frame.is-obscured img {
  filter: blur(18px) saturate(0.45);
  transform: scale(1.12);
}
.safer-image-frame.is-obscured .safer-image-cover { display: grid; }

.original-posting-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.original-posting-header h2 { margin: 0.35rem 0; }
.original-posting-panel > p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.75;
}
.original-post-images {
  display: flex;
  gap: 1rem;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scrollbar-width: thin;
}
.original-post-images > .safer-image-frame {
  flex: 0 0 calc((100% - 2rem) / 3);
  scroll-snap-align: start;
}
.posting-image-gallery {
  position: relative;
  min-width: 0;
}
.posting-image-gallery:not(.has-carousel) .original-post-images {
  overflow-x: hidden;
}
html[data-theme] .listing-detail-page button.image-carousel-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 2.35rem;
  min-width: 2.35rem;
  height: 2.35rem;
  min-height: 2.35rem;
  padding: 0;
  place-items: center;
  color: var(--ink) !important;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent) !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22) !important;
  transform: translateY(-50%) !important;
}
html[data-theme] .listing-detail-page button.image-carousel-arrow:hover:not(:disabled),
html[data-theme] .listing-detail-page button.image-carousel-arrow:focus-visible:not(:disabled) {
  color: #3b82f6 !important;
  background: var(--surface-strong) !important;
  transform: translateY(-50%) !important;
}
html[data-theme] .listing-detail-page button.image-carousel-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}
.image-carousel-previous { left: 0.65rem; }
.image-carousel-next { right: 0.65rem; }
.image-carousel-arrow svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.version-history-card { box-shadow: none; }
.version-history-card .meta { line-height: 1.6; }

@media (max-width: 760px) {
  .original-posting-header { flex-direction: column; }
  .original-post-images > .safer-image-frame { flex-basis: 100%; }
  .posting-image-gallery:not(.has-carousel) .original-post-images { flex-wrap: wrap; }
}

/* Compact, recognizable lead renaming in both list and detail views. */
.lead-card-name-row,
.lead-name-display {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
html[data-theme] button.lead-name-pencil {
  appearance: none;
  width: 1.9rem;
  min-width: 1.9rem;
  min-height: 1.9rem;
  padding: 0.2rem;
  color: #3b82f6 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 4px;
  box-shadow: none !important;
  font-size: 1rem;
  line-height: 1;
}
html[data-theme] button.lead-name-pencil:hover,
html[data-theme] button.lead-name-pencil:focus-visible {
  color: #60a5fa !important;
  background: transparent !important;
  transform: none !important;
}
.lead-name-pencil .pencil-icon {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lead-name-display .lead-name-pencil {
  width: 2.35rem;
  min-width: 2.35rem;
  min-height: 2.35rem;
  padding: 0.25rem;
}
.lead-name-display .lead-name-pencil .pencil-icon {
  width: 1.65rem;
  height: 1.65rem;
}
.lead-card-name-row .lead-name-pencil {
  width: 1.55rem;
  min-width: 1.55rem;
  min-height: 1.55rem;
  padding: 0.12rem;
}
.lead-card-name-row .lead-name-pencil .pencil-icon {
  width: 1rem;
  height: 1rem;
}
.listing-price-editor {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
}
.listing-price-pencil {
  width: 1.55rem !important;
  min-width: 1.55rem !important;
  min-height: 1.55rem !important;
  padding: 0.12rem !important;
}
.listing-price-pencil .pencil-icon {
  width: 1rem;
  height: 1rem;
}
.listing-price-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.listing-price-form.hidden { display: none; }
.listing-price-form input {
  width: 8rem;
  min-height: 1.8rem;
  padding: 0.25rem 0.45rem;
}
.lead-list-name-form {
  position: absolute;
  inset: 0 auto auto 0;
  display: inline-flex;
  width: min(420px, 100%);
  height: 1.9rem;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.22rem 0.1rem 0.55rem;
  margin: 0;
  border: 1px solid color-mix(in srgb, #3b82f6 48%, var(--line));
  border-radius: 11px;
  background: color-mix(in srgb, #3b82f6 7%, var(--surface-strong));
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}
.lead-card-name-editor {
  position: relative;
  min-height: 1.9rem;
}
.lead-card-name-editor .lead-card-name-row {
  min-height: 1.9rem;
}
.lead-card-name-editor .lead-card-name {
  line-height: 1.2;
}
.lead-card-name-editor.is-editing .lead-card-name-row {
  visibility: hidden;
}
.lead-list-name-form:focus-within {
  border-color: #3b82f6;
  background: var(--surface-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, #3b82f6 20%, transparent);
}
.lead-list-name-form input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
  box-shadow: none;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.2;
}
html[data-theme] .lead-list-name-form button.lead-name-icon-action {
  appearance: none;
  display: inline-grid;
  flex: 0 0 auto;
  width: 1.45rem;
  min-width: 1.45rem;
  height: 1.45rem;
  min-height: 1.45rem;
  padding: 0;
  place-items: center;
  color: #3b82f6 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 5px;
  box-shadow: none !important;
}
html[data-theme] .lead-list-name-form button.lead-name-icon-action:hover {
  color: #60a5fa !important;
  background: transparent !important;
  transform: none !important;
}
html[data-theme] .lead-list-name-form button.lead-name-icon-action:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}
.lead-name-icon-action svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Modal field labels need breathing room before their controls. */
#tagPriorityForm { gap: 1.15rem; }
#tagPriorityForm label {
  display: grid;
  gap: 0.7rem;
  font-weight: 700;
}

/* Side-by-side posting review keeps indicators visible while reading source content. */
.posting-primary-surface {
  display: block;
}
.posting-review-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  align-items: stretch;
}
.posting-source-content { min-width: 0; }
.posting-evidence-section {
  position: sticky;
  top: 5.4rem;
  align-self: stretch;
  min-height: 0;
  max-height: min(31rem, calc(100vh - 6.5rem));
  margin: 0.75rem 0.75rem 0.75rem 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--surface-muted);
  border: 0;
  border-radius: 12px;
}
.posting-indicators-heading {
  position: sticky;
  z-index: 2;
  top: 0;
  margin: 0;
  padding: 0 0 0.85rem;
  background: var(--surface-muted);
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.posting-indicators-heading .info-tip-content {
  left: 0;
  transform: translate(0, -0.2rem);
}
.posting-indicators-heading .info-tip:hover .info-tip-content,
.posting-indicators-heading .info-tip:focus-visible .info-tip-content {
  transform: translate(0, 0);
}
.posting-indicator-view-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  color: var(--muted);
  font-size: 0.76rem;
}
html[data-theme] .listing-detail-page .posting-indicator-view-controls button {
  min-width: 0;
  min-height: 0;
  padding: 0;
  color: #3b82f6 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.16rem;
}
html[data-theme] .listing-detail-page .posting-indicator-view-controls button:hover,
html[data-theme] .listing-detail-page .posting-indicator-view-controls button:focus-visible {
  color: #60a5fa !important;
  transform: none !important;
}
.posting-evidence-section .evidence-category-list { border-top: 0; }
.posting-indicator-category {
  margin-top: 0.65rem;
  overflow: hidden;
  background: var(--surface);
  border: 0;
  border-radius: 10px;
}
.posting-indicator-category:first-child { margin-top: 0; }
.posting-indicator-category > summary { padding: 0.8rem 0.9rem; }
.posting-indicator-category .rule-category-content {
  margin-left: 0;
  padding: 0 0.7rem 0.7rem;
  border-left: 0;
}
.posting-indicator-list { gap: 0.4rem; }
.posting-indicator-list > :first-child { margin-top: 0; }
.posting-indicator-card {
  display: block;
  padding: 0.65rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: var(--surface-strong);
}
.posting-indicator-card:last-child { border-bottom: 0; }
.posting-indicator-primary-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.25rem auto;
  align-items: center;
  gap: 0.4rem;
}
html[data-theme] .listing-detail-page button.posting-indicator-title {
  min-width: 0;
  min-height: 0;
  padding: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--ink) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  font-size: 0.88rem;
  font-weight: 750;
  text-align: left;
}
html[data-theme] .listing-detail-page button.posting-indicator-title:hover,
html[data-theme] .listing-detail-page button.posting-indicator-title:focus-visible {
  color: #3b82f6 !important;
  background: transparent !important;
  transform: none !important;
}
.posting-indicator-card .risk-level-badge {
  box-sizing: border-box;
  min-width: 6.25rem;
  height: 1.65rem;
  justify-content: center;
  padding: 0.18rem 0.55rem;
  font-size: 0.67rem;
  line-height: 1;
  text-align: center;
}
.contact-indicator-card .posting-indicator-primary-line {
  grid-template-columns: minmax(0, 1fr) auto auto;
}
.contact-indicator-card .posting-indicator-primary-line > * { min-width: 0; }
.contact-indicator-card > .meta {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.risk-gauge {
  position: relative;
  width: 9.5rem;
  height: 5.5rem;
  color: #8a8f98;
}
.risk-gauge svg { width: 100%; height: 100%; overflow: visible; }
.risk-gauge path { fill: none; stroke-linecap: round; stroke-width: 12; }
.risk-gauge-track { stroke: color-mix(in srgb, var(--muted) 30%, transparent); }
.risk-gauge-value { stroke: currentColor; }
.risk-gauge-low { color: #35a853; }
.risk-gauge-medium { color: #eab308; }
.risk-gauge-high { color: #fb8c3d; }
.risk-gauge-critical { color: #e34b4b; }
.risk-gauge-copy {
  position: absolute;
  inset: 1.55rem 0 0;
  display: grid;
  place-items: center;
  gap: 0;
  color: var(--ink);
  line-height: 1;
}
.risk-gauge-copy strong { font-size: 1.45rem; }
.risk-gauge-copy span { margin-top: 0.18rem; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.system-indicator-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.posting-indicator-actions {
  flex-wrap: nowrap;
  gap: 0.28rem;
}
html[data-theme] .listing-detail-page .posting-indicator-actions button.indicator-icon-action {
  min-width: 1.65rem;
  width: 1.65rem;
  padding: 0.2rem;
  border: 1px solid currentColor !important;
  border-radius: 0.38rem;
  background: transparent !important;
}
html[data-theme] .listing-detail-page .posting-indicator-actions button.indicator-icon-action svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
html[data-theme] .listing-detail-page .posting-indicator-actions button.indicator-edit-action {
  color: #2563eb !important;
}
html[data-theme] .listing-detail-page .posting-indicator-actions button.indicator-remove-action {
  color: #dc2626 !important;
}
html[data-theme] .listing-detail-page .posting-indicator-actions button.indicator-edit-action:hover,
html[data-theme] .listing-detail-page .posting-indicator-actions button.indicator-edit-action:focus-visible {
  color: #1d4ed8 !important;
  background: #dbeafe !important;
}
html[data-theme] .listing-detail-page .posting-indicator-actions button.indicator-remove-action:hover,
html[data-theme] .listing-detail-page .posting-indicator-actions button.indicator-remove-action:focus-visible {
  color: #b91c1c !important;
  background: #fee2e2 !important;
}
.posting-indicator-actions .tag-remove-button.confirming {
  width: auto;
  min-width: 5.9rem;
  color: #fff !important;
  border-color: #b91c1c !important;
  background: #b91c1c !important;
}
.posting-indicator-copy,
.posting-indicator-card > .meta {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}
.posting-indicator-card .adjusted-rule-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
}
.posting-evidence-section #contactRelatedListings { margin-top: 0.7rem; }

/* Analyst evidence tools reuse the existing card, compact action, and correlation patterns. */
.rule-test-bench { margin: 0.8rem 0; }
.rule-test-bench > summary { cursor: pointer; display: flex; gap: 0.65rem; align-items: baseline; }
.compact-form { gap: 0.65rem; }
.detail-evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.detail-tool-panel { min-width: 0; }
.detail-tool-panel .panel-copy { margin: 0 0 0.7rem; }
.detail-tool-panel .correlation-entry small { overflow-wrap: anywhere; }
.evidence-graph-shell { min-width: 0; }
.evidence-graph-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin: 0 0 0.55rem; color: var(--muted); font-size: 0.76rem; }
.evidence-graph-toolbar strong { color: var(--ink); font-size: 0.82rem; }
.evidence-graph-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.65rem; margin: 0 0 0.65rem; padding: 0; border: 0; color: var(--muted); font-size: 0.7rem; }
.evidence-graph-filters legend { float: left; width: auto; margin-right: 0.1rem; color: var(--ink); font-weight: 700; }
.evidence-graph-filters label { display: inline-flex; align-items: center; gap: 0.25rem; cursor: pointer; white-space: nowrap; }
.evidence-graph-filters input { accent-color: var(--accent); }
.evidence-graph-filters .ghost { padding: 0.18rem 0.42rem; font-size: 0.66rem; box-shadow: none; }
.evidence-graph-expand { display: inline-grid; place-items: center; width: 1.85rem; height: 1.85rem; padding: 0; border: 1px solid var(--line); border-radius: 0.42rem; background: var(--surface-muted); color: var(--ink); cursor: pointer; }
.evidence-graph-expand:hover { border-color: var(--accent); color: var(--accent); }
.evidence-graph-expand svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.evidence-graph-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 13.5rem; min-height: 21rem; overflow: hidden; border: 1px solid var(--line); border-radius: 0.6rem; background: var(--surface-strong); }
.evidence-graph { position: relative; min-height: 21rem; overflow: hidden; border-right: 1px solid var(--line); background: radial-gradient(circle at center, color-mix(in srgb, var(--accent) 9%, var(--surface-strong)) 0 14%, transparent 38%), var(--surface-muted); touch-action: none; outline: none; }
.evidence-graph:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 52%, transparent); }
.evidence-graph-edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.evidence-graph-edges line { stroke: color-mix(in srgb, var(--line-strong) 68%, var(--accent)); stroke-width: 1.5; opacity: 0.72; }
.evidence-graph-edges marker path { fill: color-mix(in srgb, var(--line-strong) 68%, var(--accent)); }
.evidence-graph-nodes { position: absolute; inset: 0; }
.evidence-graph-node { position: absolute; left: var(--node-x); top: var(--node-y); z-index: 1; width: 1.1rem; height: 1.1rem; transform: translate(-50%, -50%); padding: 0; border: 1px solid #303846; border-radius: 50%; background: var(--node-color); color: var(--ink); cursor: pointer; box-shadow: none; transition: box-shadow 120ms ease, outline-color 120ms ease; }
.evidence-graph-node.graph-filtered { display: none; }
.evidence-graph button.evidence-graph-node:hover { transform: translate(-50%, -50%); }
.evidence-graph-node:hover, .evidence-graph-node.selected { box-shadow: 0 0 0 4px color-mix(in srgb, var(--node-color) 28%, transparent); outline: 2px solid color-mix(in srgb, var(--node-color) 72%, #fff); outline-offset: 2px; }
.evidence-graph-node:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.evidence-graph-node strong { position: absolute; top: calc(100% + 0.42rem); left: 50%; width: 7.5rem; transform: translateX(-50%); color: var(--ink); font-size: 0.7rem; font-weight: 600; line-height: 1.2; text-align: center; overflow-wrap: anywhere; pointer-events: none; }
.network-stage .evidence-graph-node,
.network-stage .evidence-node-lead { width: 1.1rem; height: 1.1rem; }
.evidence-node-kind { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.evidence-node-lead { --node-color: #ef8354; }
.evidence-graph-node.evidence-node-primary-lead {
  --node-color: #22c55e;
  z-index: 2;
  width: 1.35rem;
  height: 1.35rem;
  border-color: #bbf7d0;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}
.evidence-node-contact { --node-color: #8b6fd6; }
.evidence-node-price { --node-color: #279c91; }
.evidence-node-indicator { --node-color: #d16b3f; }
.evidence-node-related { --node-color: #4c8fe8; }
.evidence-graph-inspector { min-width: 0; overflow: auto; background: var(--surface-strong); }
.evidence-graph-inspector-head { display: grid; gap: 0.15rem; padding: 0.8rem 0.85rem; border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.evidence-graph-inspector-head strong { font-size: 0.82rem; }
.evidence-graph-inspector-head span { color: var(--muted); font-size: 0.7rem; }
.evidence-graph-detail { display: grid; gap: 0.85rem; padding: 0.9rem 0.85rem; }
.evidence-detail-summary { min-width: 0; }
.evidence-graph-detail strong { display: block; overflow-wrap: anywhere; }
.evidence-graph-detail p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.72rem; }
.evidence-graph-detail-action {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  text-decoration: none;
}
.evidence-graph-detail-action:hover { color: var(--accent); border-color: var(--accent); }
.evidence-graph-detail-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.evidence-graph-detail-action svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.evidence-detail-kind { color: var(--accent); font-size: 0.65rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.evidence-detail-fields { display: grid; gap: 0.55rem; margin: 0; }
.evidence-detail-fields div { padding-top: 0.55rem; border-top: 1px solid var(--line); }
.evidence-detail-fields dt { color: var(--muted); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.evidence-detail-fields dd { margin: 0.15rem 0 0; color: var(--ink); font-size: 0.75rem; line-height: 1.35; }
.evidence-graph-modal-panel { width: min(58rem, calc(100vw - 2rem)); max-height: min(48rem, calc(100vh - 2rem)); overflow: auto; }
.evidence-graph-modal-panel .evidence-graph-workspace { min-height: min(60vh, 34rem); }
.evidence-graph-modal-panel .evidence-graph { min-height: min(60vh, 34rem); }
@media (max-width: 620px) { .evidence-graph-workspace { grid-template-columns: 1fr; } .evidence-graph { min-height: 18rem; border-right: 0; border-bottom: 1px solid var(--line); } .evidence-graph-inspector { max-height: 14rem; } .evidence-graph-node { width: 1rem; height: 1rem; } .network-stage .evidence-graph-node, .network-stage .evidence-node-lead { width: 1rem; height: 1rem; } .evidence-graph-node strong { width: 5.5rem; font-size: 0.61rem; } }
.reverse-image-tools { display: grid; gap: 0.55rem; }
.reverse-image-tools .correlation-entry { align-items: center; }
@media (max-width: 820px) { .detail-evidence-grid { grid-template-columns: 1fr; } }

@media (max-width: 1180px) {
  .posting-indicator-primary-line { grid-template-columns: minmax(0, 1fr) 6.25rem; }
  .posting-indicator-actions { grid-column: 1 / -1; }
}

/* Capture history defaults to compact, collapsed version rows. */
.capture-history-panel .panel-head { margin-bottom: 0.45rem; }
.version-compare-controls { justify-content: flex-end; padding: 0 0 0.65rem; }
.version-history-list { border-top: 1px solid var(--line); }
.version-history-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  border-bottom: 1px solid var(--line);
}
.version-history-row { min-width: 0; }
.version-history-row > summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 0.15rem;
  cursor: pointer;
  list-style: none;
}
.version-history-row > summary::-webkit-details-marker { display: none; }
.version-history-row > summary::before {
  content: "›";
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  transition: transform 120ms ease;
}
.version-history-row[open] > summary::before { transform: rotate(90deg); }
.version-history-row > summary > span { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; }
.version-divider { color: var(--muted); }
.version-compare-select { display: inline-flex; align-items: center; margin: 0; padding: 1rem 0.2rem; }
.version-compare-select input { margin: 0; }
.version-history-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  padding: 0 0.75rem 0.9rem 1.65rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.version-history-details strong { flex-basis: 100%; color: var(--ink); }

@media (max-width: 980px) {
  .posting-review-body { grid-template-columns: 1fr; }
  .posting-evidence-section {
    position: static;
    max-height: none;
    margin: 0 0.75rem 0.75rem;
    overflow: visible;
    border-left: 0;
  }
  .posting-indicators-heading { position: static; margin: 0; }
}

/* Let the Leads page grow naturally so expanded filters and their results stay
   reachable through the normal page scrollbar. */
html[data-active-tab="review"],
html[data-active-tab="review"] body {
  height: auto;
  overflow-y: auto;
}

html[data-active-tab="review"] .app-content {
  display: flex;
  height: auto;
  min-height: 100dvh;
  flex-direction: column;
  overflow: visible;
}

/* A direct lead URL must never inherit the previously selected workspace layout. */
body.listing-detail-route .app-content,
body.listing-detail-route .sidebar {
  display: none !important;
}

html[data-active-tab="review"] .hero {
  width: 100%;
  flex: 0 0 auto;
}

html[data-active-tab="review"] .tab-shell {
  display: flex;
  width: 100%;
  min-height: auto;
  flex: 0 0 auto;
  flex-direction: column;
  padding-bottom: 1.5rem;
  overflow: visible;
}

html[data-active-tab="review"] .tab-panel[data-tab-panel="review"].active {
  min-height: auto;
  flex: 0 0 auto;
  gap: 0;
  overflow: visible;
}

html[data-active-tab="review"] .leads-workspace {
  height: auto;
  min-height: auto;
  max-height: none;
  flex: 0 0 auto;
  padding-right: 0.35rem;
  overflow: visible;
}
html[data-active-tab="review"] .queue-panel {
  height: auto;
  overflow: visible;
}
html[data-active-tab="review"] .queue-panel #listingsList {
  flex: 0 0 auto;
  overflow: visible;
}

html[data-active-tab="review"] .leads-workspace > details {
  flex: 0 0 auto;
  padding: 0.35rem 0.15rem;
}

html[data-active-tab="review"] .leads-workspace > details[open] {
  padding-bottom: 0.6rem;
}

html[data-active-tab="review"] .leads-workspace > details.lead-filter-panel[open] {
  padding-bottom: 0.3rem;
}

html[data-active-tab="review"] .leads-workspace #listingsList {
  min-height: 0;
  max-height: none;
  flex: 0 0 auto;
  margin-top: 0.35rem;
  padding-right: 0;
  overflow: visible;
}

@media (min-width: 761px) {
  .queue-panel #listingsList > .listing-card {
    min-height: 205px;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
  }
  .queue-panel .listing-card-side { gap: 0.45rem; }
}
