.nav-item > span:first-child {
  font-size: 20px;
}

.nav-item .nav-label {
  font-size: inherit;
}

.nav-count {
  margin-left: auto;
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e24b5b;
  color: #fff;
  font-size: 11px;
  text-align: center;
}

.nav-count.warning {
  background: #d98a00;
}

.stat-action {
  text-align: left;
  color: var(--ink);
}

.stat-action:hover {
  border-color: #f0b24b;
  background: #fffbf2;
  transform: translateY(-1px);
}

.stat-action small {
  display: block;
  margin-top: 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.match-list {
  display: grid;
  gap: 18px;
}

.unoffered-list {
  display: grid;
  gap: 18px;
}

.unoffered-card {
  margin-bottom: 0;
}

.unoffered-head,
.unoffered-actions,
.offer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.unoffered-actions,
.offer-actions {
  justify-content: flex-end;
}

.danger-action {
  background: #ffe9eb;
  color: var(--danger);
}

.danger-action:hover {
  background: #ffd8dc;
}

.inactive-offers {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.inactive-offer {
  display: grid;
  grid-template-columns: minmax(150px, .6fr) minmax(260px, 1.4fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfe;
}

.inactive-offer > div,
.offer-row.detailed > div {
  display: grid;
  gap: 5px;
}

.inactive-offer small,
.offer-row.detailed small {
  display: block;
  color: var(--muted);
  line-height: 1.4;
}

.offer-row.detailed {
  grid-template-columns: 1fr 1.5fr .8fr .7fr auto;
  align-items: center;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 45px;
  margin-top: 34px;
}

.check-label input {
  width: auto;
}

.match-card {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(380px, 1.1fr);
  gap: 26px;
}

.match-card h3,
.match-card h4 {
  margin: 0;
}

.identity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.identity-grid span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.identity-grid b {
  color: var(--ink);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.review-reason {
  margin: 18px 0 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: #fff7e6;
  color: #835600;
  font-size: 13px;
}

.match-candidates {
  display: grid;
  align-content: start;
  gap: 10px;
}

.candidate-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.candidate-option:has(input:checked) {
  border-color: var(--brand);
  background: #f3f7ff;
  box-shadow: 0 0 0 2px rgba(36, 87, 214, .09);
}

.candidate-option input {
  width: auto;
  margin: 3px 0 0;
}

.candidate-option span {
  display: grid;
  gap: 3px;
}

.candidate-option small {
  color: var(--muted);
}

.candidate-option em {
  color: var(--brand2);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.no-candidate {
  padding: 14px;
  border: 1px dashed #cbd3df;
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
}

.match-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.match-reject {
  margin-right: auto;
  color: var(--danger);
}

.match-card.working {
  opacity: .55;
  pointer-events: none;
}

.source-policy {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.scraper-config {
  display: grid;
  gap: 18px;
}

.runtime-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.runtime-status.ready {
  border-left: 4px solid #25a86b;
}

.runtime-status.warning {
  border-left: 4px solid #d98a00;
}

.runtime-status.busy {
  align-items: stretch;
  border-left: 4px solid #e3a008;
}

.runtime-status h3,
.runtime-status p {
  margin: 4px 0;
}

.runtime-facts {
  display: flex;
  gap: 28px;
}

.runtime-facts span {
  display: grid;
  gap: 4px;
}

.runtime-facts b {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.runtime-progress {
  flex: 1;
  min-width: 0;
}

.runtime-progress-heading,
.runtime-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.runtime-progress-heading > strong {
  color: #9d6500;
  font-size: 13px;
}

.runtime-phase {
  color: var(--muted);
}

.runtime-phase b {
  color: var(--ink);
}

.runtime-progress-bar {
  height: 10px;
  margin: 14px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #fff1cc;
}

.runtime-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg,#e3a008,#f2bb38);
  transition: width .35s ease;
}

.runtime-progress-bar.indeterminate span {
  position: relative;
  width: 36%;
  animation: runtime-progress-moving 1.4s ease-in-out infinite;
}

@keyframes runtime-progress-moving {
  from { left: -36%; }
  to { left: 100%; }
}

.runtime-progress-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  color: #5d6676;
  font-size: 12px;
  font-weight: 700;
}

.runtime-progress-meta span + span::before {
  content: '·';
  margin-right: 12px;
  color: #a8afbb;
}

.runtime-freshness {
  margin-top: 12px !important;
  color: #6a7382;
  font-size: 12px;
}

.runtime-freshness.stale {
  color: #ad3442;
  font-weight: 750;
}

.scrape-run-row {
  cursor: pointer;
}

.scrape-runs-table {
  min-width: 1180px;
  table-layout: fixed;
}

.scrape-runs-table th,
.scrape-runs-table td {
  vertical-align: middle;
}

.scrape-runs-table th:first-child,
.scrape-runs-table td:first-child {
  width: 125px;
}

.scrape-runs-table th:nth-child(2),
.scrape-runs-table td:nth-child(2) {
  width: 150px;
}

.scrape-runs-table th:nth-child(3),
.scrape-runs-table td:nth-child(3) {
  width: 190px;
}

.scrape-runs-table th:nth-child(n + 4):nth-child(-n + 8),
.scrape-runs-table td:nth-child(n + 4):nth-child(-n + 8),
.scrape-runs-table th:last-child,
.scrape-runs-table td:last-child {
  text-align: center;
}

.scrape-runs-table th:nth-child(4),
.scrape-runs-table td:nth-child(4) {
  width: 100px;
}

.scrape-runs-table th:nth-child(5),
.scrape-runs-table td:nth-child(5),
.scrape-runs-table th:nth-child(6),
.scrape-runs-table td:nth-child(6) {
  width: 120px;
}

.scrape-runs-table th:nth-child(7),
.scrape-runs-table td:nth-child(7) {
  width: 105px;
}

.scrape-runs-table th:nth-child(8),
.scrape-runs-table td:nth-child(8) {
  width: 85px;
}

.scrape-runs-table th:last-child,
.scrape-runs-table td:last-child {
  width: 180px;
}

.scrape-run-row:hover {
  background: #f6f8fc;
}

.scrape-run-row:focus {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.run-public-id {
  color: var(--brand);
  font: 800 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .02em;
}

.scrape-run-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.scrape-log {
  margin: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101b2f;
  color: #dbe7ff;
}

.scrape-log h3,
.scrape-log .eyebrow {
  color: #fff;
}

.scrape-log pre {
  max-height: 360px;
  margin: 14px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.scrape-report-dialog {
  width: min(1180px, calc(100% - 30px));
  max-height: 92vh;
  overflow: hidden;
}

.scrape-report-shell {
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  padding: 24px;
}

.scrape-report-heading {
  flex: 0 0 auto;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.scrape-report {
  overflow: auto;
  padding: 20px 3px 5px;
}

.scrape-report-meta,
.scrape-report-identifiers,
.report-section-heading,
.scrape-error-group > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.scrape-report-meta {
  margin-bottom: 14px;
}

.scrape-report-meta > div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.scrape-report-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.resume-run-notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  background: #eff6ff;
}

.resume-run-notice p {
  margin: 5px 0 0;
  color: var(--muted);
}

.scrape-report-identifiers {
  align-items: stretch;
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faff;
}

.scrape-report-identifiers > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.scrape-report-identifiers b {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.scrape-report-identifiers code {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.report-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.report-stat {
  min-height: 130px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.report-stat.warning {
  border-color: #f3c5ca;
  background: #fff8f8;
}

.report-stat span,
.report-stat small {
  display: block;
  color: var(--muted);
}

.report-stat span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-stat strong {
  display: block;
  margin: 8px 0;
  font-size: 27px;
}

.report-stat small {
  line-height: 1.45;
}

.report-section {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.report-section-heading {
  align-items: flex-start;
  margin-bottom: 14px;
}

.report-section-heading h4,
.report-section-heading p {
  margin: 0;
}

.report-section-heading .muted {
  margin-top: 5px;
}

.report-definition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin: 0;
}

.report-definition-grid div {
  padding: 12px;
  border-radius: 10px;
  background: #f7f9fc;
}

.report-definition-grid dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-definition-grid dd {
  margin: 5px 0 0;
  font-weight: 750;
}

.report-table {
  min-width: 820px;
  white-space: normal;
}

.report-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.image-report {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.image-report span {
  padding: 14px;
  border-radius: 11px;
  background: #f7f9fc;
  color: var(--muted);
  font-size: 12px;
}

.image-report b {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 22px;
}

.scrape-error-list {
  display: grid;
  gap: 10px;
}

.scrape-error-group,
.report-ok {
  padding: 13px 14px;
  border: 1px solid #f2cbd0;
  border-radius: 11px;
  background: #fff8f8;
}

.report-ok {
  border-color: #c7ead9;
  background: #f5fcf8;
}

.scrape-error-group p,
.report-ok p {
  margin: 8px 0 4px;
  white-space: pre-wrap;
}

.scrape-error-group small {
  color: var(--muted);
}

.all-categories,
.technical-log {
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.all-categories summary,
.technical-log summary {
  cursor: pointer;
  padding: 13px 15px;
  font-weight: 800;
}

.all-categories > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 120px;
  gap: 12px;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.all-categories a {
  overflow-wrap: anywhere;
  color: var(--brand);
}

.technical-log {
  background: #101b2f;
  color: #dbe7ff;
}

.technical-log pre {
  max-height: 420px;
  margin: 0;
  overflow: auto;
  padding: 0 15px 15px;
  white-space: pre-wrap;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
}

@media (max-width: 1000px) {
  .match-card {
    grid-template-columns: 1fr;
  }

  .inactive-offer,
  .offer-row.detailed {
    grid-template-columns: 1fr;
  }

  .runtime-status,
  .runtime-facts {
    align-items: stretch;
    flex-direction: column;
  }

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

@media (max-width: 720px) {
  .match-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .match-reject {
    margin-right: 0;
  }

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

  .unoffered-head,
  .unoffered-actions,
  .offer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .scrape-report-shell {
    padding: 17px;
  }

  .scrape-report-meta,
  .scrape-report-identifiers {
    align-items: stretch;
    flex-direction: column;
  }

  .scrape-report-actions {
    justify-content: stretch;
  }

  .scrape-report-actions > button {
    flex: 1;
  }

  .report-stat-grid,
  .report-definition-grid,
  .image-report {
    grid-template-columns: 1fr;
  }

  .all-categories > div {
    grid-template-columns: 1fr;
  }
}
.runtime-steps { display:flex; flex-wrap:wrap; gap:8px 14px; padding:0; margin:18px 0; list-style:none; }
.runtime-steps li { display:flex; align-items:center; gap:5px; font-size:12px; color:#758397; }
.runtime-steps li>span:first-child { display:inline-grid; place-items:center; width:22px; height:22px; border-radius:50%; background:#edf1f6; font-weight:700; }
.runtime-steps .done { color:#148273; }
.runtime-steps .done>span:first-child { background:#e4f5ef; }
.runtime-steps .current { color:#865900; font-weight:700; }
.runtime-steps .current>span:first-child { background:#ffe7a4; }
.runtime-current { font-size:13px; overflow-wrap:anywhere; color:#53677f; }
.runtime-connection { font-size:13px; color:#986500; }
.runtime-connection:empty { display:none; }
.runtime-steps .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; }

.cloudflare-alert {
  position: fixed;
  z-index: 3000;
  top: 22px;
  right: 22px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  width: min(580px, calc(100vw - 32px));
  padding: 20px;
  border: 3px solid #fff;
  border-radius: 18px;
  background: #b20b1c;
  color: #fff;
  box-shadow: 0 18px 55px rgba(91, 0, 11, .48);
  animation: cloudflare-alert-flash .9s ease-in-out infinite alternate;
}

.cloudflare-alert-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  color: #b20b1c;
  font-size: 34px;
  font-weight: 900;
}

.cloudflare-alert-kicker,
.cloudflare-alert h2,
.cloudflare-alert p {
  margin: 0;
}

.cloudflare-alert-kicker {
  color: #ffe1e5;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.cloudflare-alert h2 {
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.2;
}

#cloudflareAlertMessage {
  margin-top: 10px;
  font-weight: 700;
  line-height: 1.45;
}

.cloudflare-alert-current {
  margin-top: 10px !important;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(71, 0, 8, .32);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.cloudflare-alert-audio {
  margin-top: 9px !important;
  color: #ffe5e8;
  font-size: 12px;
}

.cloudflare-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.cloudflare-alert-actions button {
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 9px;
  background: #fff;
  color: #8c0716;
  font-weight: 850;
  cursor: pointer;
}

.cloudflare-alert-actions button:last-child {
  background: transparent;
  color: #fff;
}

@keyframes cloudflare-alert-flash {
  from { background: #8e0715; box-shadow: 0 15px 42px rgba(91,0,11,.40); }
  to { background: #e0152b; box-shadow: 0 20px 65px rgba(224,21,43,.72); }
}

@media (max-width: 620px) {
  .cloudflare-alert {
    top: 12px;
    right: 16px;
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 15px;
  }

  .cloudflare-alert-icon {
    width: 40px;
    height: 40px;
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cloudflare-alert { animation: none; background: #c20e22; }
}
