/* Pawprint: dark UI, written mobile-first. Base rules target phones;
   min-width media queries add room on larger screens. */

/* Self-hosted fonts (SIL OFL, see static/fonts/LICENSE-*.txt), Latin subset. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/inter-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/inter-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/inter-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/inter-latin-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/jetbrains-mono-latin-500.woff2") format("woff2"); }

:root {
  --bg: #0f1115;
  --surface: #161920;
  --surface-2: #1d2129;
  --surface-3: #262b35;
  --border: #2a2f3a;
  --border-strong: #3a4150;
  --text: #e7e9ee;
  --muted: #9aa3b2;
  --faint: #6d7585;
  --accent: #f08a45;
  --accent-strong: #ff9d5c;
  --accent-ink: #1b0f05;
  --accent-soft: rgba(240, 138, 69, 0.14);

  --ok: #46c98b;
  --info: #6aa6ff;
  --warn: #f5c35b;
  --err: #ff6b6b;

  --k-account: #6aa6ff;
  --k-profile: #b98cff;
  --k-registration: #3fd0b5;
  --k-breach: #ff6b6b;
  --k-infrastructure: #8fa3bf;
  --k-lead: #f5c35b;
  /* entity routes (match the query -> result model) */
  --t-username: #8b7cf6;
  --t-email: #e0a030;
  --t-ip: #e05a5a;
  --t-name: #3fb6c9;
  --t-phone: #d47fd0;
  --k-match: #4cc9e0;
  --step-done: #2fa37a;
  --step-info: #2a9fc4;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.25);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --gutter: 16px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.015em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; margin-top: 2em; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--surface-3); padding: 0.1em 0.35em; border-radius: 4px; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

.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;
}
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.lede { font-size: 1.05rem; color: var(--muted); max-width: 62ch; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 20px var(--gutter) 48px; flex: 1; }
.narrow { max-width: 440px; margin: 8vh auto; }
.prose { max-width: 780px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.5em; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter);
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; color: var(--text); font-weight: 700; font-size: 1.05rem; }
.brand span { display: none; }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  color: var(--muted); font-size: 0.88rem; font-weight: 500; white-space: nowrap;
  padding: 8px 8px; border-radius: var(--radius-sm);
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--surface-2); }

.config-warning {
  padding: 10px var(--gutter); font-size: 0.85rem; color: var(--warn);
  background: rgba(245, 195, 91, .08); border-bottom: 1px solid rgba(245, 195, 91, .3);
}
.config-warning p { margin: 0; max-width: 1180px; margin-inline: auto; }

.footer {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; text-align: center;
  padding: 20px var(--gutter) 28px; color: var(--faint); font-size: 0.8rem;
  border-top: 1px solid var(--border);
}
.footer .dot { display: none; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h3 { margin: 0; }

.grid-3, .split { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 18px; }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 18px; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px;
  font: inherit; font-size: 0.92rem; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-sm { min-height: 32px; padding: 0 11px; gap: 6px; font-size: 0.8rem; border-radius: 7px; }
.ico {
  width: 15px; height: 15px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.btn.primary:hover { background: var(--accent-strong); }
.btn .spinner { display: none; }
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label { opacity: 0.7; }

input[type="text"], input[type="email"], input[type="tel"], input[type="search"], input[type="password"], input:not([type]), select {
  width: 100%; min-height: 44px; padding: 0 14px;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; }

.segmented {
  display: inline-flex; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.segmented label { position: relative; flex: 0 0 auto; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block; padding: 7px 12px; border-radius: 7px; cursor: pointer;
  font-size: 0.85rem; font-weight: 500; color: var(--muted);
}
.segmented input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px;
  font: inherit; font-size: 0.85rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
}
.chip:hover { border-color: var(--accent); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  text-transform: capitalize; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
}
.status-done { color: var(--ok); border-color: rgba(70, 201, 139, .35); background: rgba(70, 201, 139, .1); }
.status-running { color: var(--info); border-color: rgba(106, 166, 255, .35); background: rgba(106, 166, 255, .1); }
.status-queued, .status-pending { color: var(--muted); }
.status-failed { color: var(--err); border-color: rgba(255, 107, 107, .35); background: rgba(255, 107, 107, .1); }
.status-interrupted, .status-skipped { color: var(--warn); border-color: rgba(245, 195, 91, .3); background: rgba(245, 195, 91, .08); }
.status-running::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: pulse 1.2s ease-in-out infinite;
}

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-3);
}
.conf-confirmed { color: var(--ok); background: rgba(70, 201, 139, .12); }
.conf-likely { color: var(--info); background: rgba(106, 166, 255, .12); }
.conf-possible { color: var(--warn); background: rgba(245, 195, 91, .12); }
.conf-lead { color: var(--muted); }
.conf-search { color: #b98cff; background: rgba(185, 140, 255, .12); }
.conf-match { color: var(--k-match); background: rgba(76, 201, 224, .12); }
.conf-plan { color: var(--t-phone); background: rgba(212, 127, 208, .12); }
.k-match { background: var(--k-match); }
.k-search { background: #b98cff; }
.k-darkweb { background: #ff8a5c; }
.darkweb-note { margin: 0 0 12px; }
.darkweb-item { border-left-color: #ff8a5c; }
.onion-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; min-width: 0; }
.onion-addr {
  font-family: var(--mono); font-size: 0.74rem; color: var(--muted); background: var(--surface-2);
  padding: 3px 7px; border-radius: 5px; overflow-wrap: anywhere; min-width: 0;
}
.copy-onion { min-height: 26px; padding: 0 9px; font-size: 0.74rem; }

/* landing: options row with the dark web switch */
.option-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-left: auto; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative; width: 32px; height: 18px; flex: 0 0 auto; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border-strong); transition: background .15s;
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--muted); transition: transform .15s, background .15s;
}
.switch input:checked + .switch-track { background: rgba(255, 138, 92, .25); border-color: #ff8a5c; }
.switch input:checked + .switch-track::after { transform: translateX(14px); background: #ff8a5c; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch .ico { width: 15px; height: 15px; }
.switch input:checked ~ .ico { color: #ff8a5c; }

.kind-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--faint); }
.kind-username { background: var(--t-username); }
.kind-email { background: var(--t-email); }
.kind-name { background: var(--t-name); }
.kind-ip { background: var(--t-ip); }
.kind-phone { background: var(--t-phone); }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.3; } }

.notice { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; margin: 12px 0 0; }
.notice.warn { color: var(--warn); background: rgba(245, 195, 91, .08); border: 1px solid rgba(245, 195, 91, .25); }
.form-error { display: none; color: var(--err); font-size: 0.9rem; margin: 10px 0 0; }
.form-error.visible { display: block; }

.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: 10px; font-size: 0.9rem; font-weight: 500;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong);
  box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Landing: just the search bar ---------- */
.landing-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 24px var(--gutter) 12vh;
}
.landing-box { width: 100%; max-width: 640px; }
.landing-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 22px; }
.landing-brand h1 { margin: 0; font-size: 2.1rem; font-weight: 700; letter-spacing: -0.03em; }
.type-toggle { display: flex; width: 100%; margin-bottom: 10px; }
.type-toggle label { flex: 1; }
.type-toggle span {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 6px; font-size: 0.9rem; white-space: nowrap;
}
/* Four types don't fit beside their icons on a phone: icons come back at 420px. */
.type-toggle .ico { display: none; width: 16px; height: 16px; opacity: 0.75; }
.type-toggle input:checked + span .ico { opacity: 1; color: var(--accent-strong); }
.landing .search-options { justify-content: space-between; }
.link-btn { padding: 0; font: inherit; font-size: 0.85rem; color: var(--accent-strong); background: none; border: 0; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Home ---------- */
.hero { padding: 16px 0 8px; }
.hero h1 { font-size: 2rem; }
.search-box { margin-top: 18px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1 1 auto; min-width: 0; min-height: 52px; font-size: 1.05rem; border-radius: 10px; }
.search-row .btn { flex: 0 0 auto; }
.search-row .btn { min-height: 52px; padding: 0 18px; border-radius: 10px; }
.search-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.detected { font-size: 0.85rem; color: var(--muted); }
.detected strong { color: var(--text); font-weight: 600; }
.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: 0.85rem; }

.coverage h3 { display: flex; align-items: center; gap: 8px; }
.module-list { list-style: none; padding: 0; margin: 0; }
.route-card { border-top: 3px solid var(--c, var(--border)); }
.pipeline.static .step { opacity: 1; }
.pipeline.static .step-sum { white-space: normal; }
.module-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 0.88rem; }
.module-list .tool { font-weight: 600; }
.module-list li.off { opacity: 0.55; }

.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list a {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px;
  padding: 10px 8px; margin: 0 -8px; border-radius: var(--radius-sm); color: var(--text);
}
.recent-list a:hover { background: var(--surface-2); text-decoration: none; }
.recent-q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.recent-list .mono, .recent-list time { display: none; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { text-transform: uppercase; }
.stats { margin: 14px 0 0; }

/* ---------- Case page ---------- */
.case-head { margin-bottom: 16px; }
.case-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.case-id {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 10px;
  font-family: var(--mono); font-size: 0.85rem; font-weight: 500; color: var(--accent-strong);
  background: var(--accent-soft); border: 1px solid rgba(240, 138, 69, .3); border-radius: 8px; cursor: pointer;
}
.case-id:hover { border-color: var(--accent); }
.type-pill { text-transform: lowercase; }
.case-query { font-size: 1.6rem; word-break: break-word; margin-bottom: 4px; }
.case-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* shared (password-free) case pages */
.shared-note { color: var(--muted); font-size: 0.85rem; }
.shared-banner { color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.case-query.masked { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.mask-dots { letter-spacing: .12em; color: var(--faint); }
.mask-note { font-size: 0.8rem; font-weight: 500; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }

/* share dialog */
#share-open.on { border-color: var(--accent); color: var(--accent-strong); }
.share-dialog {
  width: min(520px, calc(100vw - 32px)); padding: 20px;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.share-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.share-dialog h3 { margin: 0 0 6px; padding-right: 28px; }
.share-dialog p { margin: 8px 0 0; }
.share-close-form { float: right; margin: -8px -8px 0 0; }
.share-close {
  min-height: 28px; padding: 0 8px; font: inherit; font-size: 1.2rem; line-height: 1;
  color: var(--muted); background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer;
}
.share-close:hover { color: var(--text); background: var(--surface-2); }
.share-mask { margin-top: 14px; font-size: 0.92rem; font-weight: 600; }
#share-mask-help { margin-top: 4px; }
.share-row { display: flex; gap: 8px; margin-top: 14px; }
.share-url { min-width: 0; font-size: 0.82rem; }
.btn.danger { color: var(--err); border-color: rgba(255, 107, 107, .4); }
.btn.danger:hover { background: rgba(255, 107, 107, .12); }
#share-body .btn { margin-top: 12px; }

.sources { margin-bottom: 16px; }
.runs { list-style: none; padding: 0; margin: 0; }
.run { padding: 10px 0; border-top: 1px solid var(--border); }
.run:first-child { border-top: 0; padding-top: 0; }
.run-top { display: flex; align-items: center; gap: 10px; }
.run-icon { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; }
.run-icon .spinner { width: 14px; height: 14px; color: var(--info); }
.run-name { flex: 1; min-width: 0; }
.run-name strong { font-size: 0.92rem; }
.run-name span { display: block; font-size: 0.8rem; color: var(--muted); }
.run-count { font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.run-msg { margin: 4px 0 0 28px; font-size: 0.8rem; color: var(--faint); word-break: break-word; }
.bar { height: 4px; margin: 8px 0 0 28px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .4s; }
.run.done .bar > i { background: var(--ok); }
.ico-done { color: var(--ok); }
.ico-failed { color: var(--err); }
.ico-skipped, .ico-interrupted { color: var(--warn); }
.ico-pending { color: var(--faint); }

.tiles {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)) 14px; padding: 2px var(--gutter);
  scroll-snap-type: x proximity;
}
.tiles::-webkit-scrollbar { display: none; }
.tile {
  flex: 0 0 auto; scroll-snap-align: start; min-width: 104px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 14px; font: inherit; color: var(--text); text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.tile:hover { border-color: var(--border-strong); }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.tile b { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile span { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.tile .kind-dot { width: 8px; height: 8px; }
.k-account { background: var(--k-account); }
.k-profile { background: var(--k-profile); }
.k-registration { background: var(--k-registration); }
.k-breach { background: var(--k-breach); }
.k-infrastructure { background: var(--k-infrastructure); }
.k-lead { background: var(--k-lead); }

.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.toolbar-left { display: flex; gap: 8px; }
.toolbar-left select { width: auto; flex: 0 0 auto; }
.view-switch { align-self: flex-start; }

.group { margin-bottom: 24px; }
.group-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.group-title .count { color: var(--faint); font-weight: 500; }
.grid { display: grid; grid-template-columns: 1fr; gap: 10px; }

.finding {
  position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0;
  padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  border-left: 3px solid var(--kind, var(--border));
  animation: fadein .3s ease-out;
}
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
.finding[data-kind="account"] { --kind: var(--k-account); }
.finding[data-kind="profile"] { --kind: var(--k-profile); }
.finding[data-kind="registration"] { --kind: var(--k-registration); }
.finding[data-kind="breach"] { --kind: var(--k-breach); }
.finding[data-kind="infrastructure"] { --kind: var(--k-infrastructure); }
.finding[data-kind="lead"] { --kind: var(--k-lead); }
.f-head { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.f-icon {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: 8px; object-fit: cover;
  background: var(--surface-3); display: grid; place-items: center; overflow: hidden;
  font-weight: 700; color: var(--muted); font-size: 0.9rem;
}
.f-icon.fav { padding: 8px; object-fit: contain; }
.f-icon.avatar { width: 48px; height: 48px; border-radius: 50%; }
.f-title { flex: 1; min-width: 0; }
.f-title h4 { margin: 0; font-size: 0.98rem; font-weight: 600; word-break: break-word; }
.f-title h4 a { color: var(--text); }
.f-title h4 a:hover { color: var(--accent-strong); }
.f-title .ext { color: var(--faint); font-size: 0.8em; margin-left: 2px; }
.f-sub { display: block; font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-data { display: grid; grid-template-columns: minmax(84px, max-content) 1fr; gap: 4px 12px; margin: 0; font-size: 0.85rem; }
.f-data dt { color: var(--faint); text-transform: capitalize; }
.f-data dd { margin: 0; min-width: 0; word-break: break-word; overflow-wrap: anywhere; }
.f-data.collapsed .extra { display: none; }
.f-more { align-self: flex-start; padding: 0; font: inherit; font-size: 0.8rem; color: var(--accent-strong); background: none; border: 0; cursor: pointer; }
.f-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.f-src { font-size: 0.75rem; color: var(--faint); margin-left: auto; }
.pivots { display: flex; flex-wrap: wrap; gap: 6px; }
.pivot {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  min-height: 30px; padding: 3px 10px; font: inherit; font-size: 0.8rem; color: var(--text);
  background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 999px; cursor: pointer;
}
.pivot:hover { border-color: var(--accent); border-style: solid; color: var(--accent-strong); text-decoration: none; }
.pivot .pv-type { color: var(--faint); font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em; }
.pivot .pv-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* compact rows for leads */
.lead-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.lead-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 0.9rem; }
.lead-list li:first-child { border-top: 0; }
.lead-list .lead-title { flex: 1 1 200px; min-width: 0; word-break: break-word; }
.lead-list .lead-note { flex-basis: 100%; font-size: 0.8rem; color: var(--faint); }
.lead-sub { margin: 14px 0 6px; font-size: 0.78rem; color: var(--faint); font-weight: 600; }

.empty, .empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .spinner { margin: 0 auto 12px; color: var(--accent); width: 22px; height: 22px; }

.graph-wrap { position: relative; }
.graph {
  height: 70vh; min-height: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.graph-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 0.8rem; color: var(--muted); }
.graph-legend span { display: inline-flex; align-items: center; gap: 6px; }
.graph-hint { margin-top: 6px; }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: 8px 0; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 0.9rem; }
.link-list li:first-child { border-top: 0; }

/* ---------- History & tables ---------- */
.page-head { margin-bottom: 16px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; padding: 12px; }
.filters input { grid-column: 1 / -1; }
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 0.72rem; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.row-link { cursor: pointer; }
.table tbody tr.row-link:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .q-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.hide-sm { display: none; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }

.defs { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; align-items: baseline; }
.defs dd { margin: 0; color: var(--muted); }

.login { display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: center; padding: 28px 20px; }
.login h1 { font-size: 1.3rem; margin: 4px 0 0; }
.login .btn { width: 100%; }

/* ---------- Query -> result pipeline ---------- */
/* Phones: a swipeable strip so hits stay near the top. Wide: five columns. */
.pipeline {
  list-style: none; margin: 0 calc(-1 * var(--gutter)) 12px; padding: 2px var(--gutter) 4px;
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  scroll-padding-inline: var(--gutter);
}
.pipeline::-webkit-scrollbar { display: none; }
.pipeline > .step { flex: 0 0 58%; max-width: 220px; scroll-snap-align: start; }
.step {
  position: relative; display: grid; grid-template-columns: auto 1fr; align-items: baseline;
  column-gap: 6px; padding: 7px 10px 7px 24px; margin-left: 0; min-width: 0;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  --c: var(--border-strong);
  border-color: color-mix(in srgb, var(--c) 70%, transparent);
}
.step + .step::before {
  /* connector arrow between steps */
  content: ""; position: absolute; left: -15px; top: 50%; width: 12px; height: 1px; background: var(--border-strong);
}
.step + .step::after {
  content: ""; position: absolute; left: -6px; top: calc(50% - 3px);
  border: 3px solid transparent; border-left-color: var(--border-strong);
}
.step-done { --c: var(--step-done); }
.step-active { --c: var(--step-info); }
.step-pending { --c: var(--border-strong); opacity: 0.7; }
.route-username { --c: var(--t-username); }
.route-email { --c: var(--t-email); }
.route-ip { --c: var(--t-ip); }
.route-phone { --c: var(--t-phone); }
.route-name { --c: var(--t-name); }
.step-mark { position: absolute; left: 9px; top: 11px; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.step-active .step-mark { animation: pulse 1.2s ease-in-out infinite; }
.step-n { font-family: var(--mono); font-size: 0.65rem; color: var(--faint); }
.step-title { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-sum {
  grid-column: 1 / -1; font-size: 0.74rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Outcomes ---------- */
/* Status colours, checked for colour-blind separation against --surface.
   Every use also carries a text label, never colour alone. */
:root { --oc-yes: #46c98b; --oc-no: #6b7385; --oc-unknown: #f5c35b; --oc-error: #e5484d; }

.overview { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 16px; align-items: start; }
.overview .sources { margin-bottom: 0; }
.outcomes .card-head { margin-bottom: 8px; }
.outcome-body { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.donut-wrap { position: relative; flex: 0 0 auto; width: 132px; height: 132px; }
.donut { display: block; width: 100%; height: 100%; overflow: visible; }
.donut .seg { fill: none; stroke-width: 14; cursor: default; transition: stroke-width .15s, opacity .15s; }
.donut .seg.oc-unknown, .donut .seg.oc-error { cursor: pointer; }
.donut.focus .seg { opacity: .35; }
.donut.focus .seg.on { opacity: 1; stroke-width: 18; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center strong { font-size: 1.45rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.donut-center span { font-size: 0.75rem; color: var(--muted); }
.chart-tip {
  position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 2;
  padding: 5px 9px; font-size: 0.78rem; white-space: nowrap; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 6px; pointer-events: none;
}
.outcome-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 180px; min-width: 0; display: grid; gap: 2px; }
.oc-row {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 3.2em; align-items: center; gap: 8px;
  width: 100%; padding: 5px 8px; font: inherit; font-size: 0.86rem; color: var(--text); text-align: left;
  background: none; border: 1px solid transparent; border-radius: 6px;
}
button.oc-row { cursor: pointer; }
button.oc-row:hover, button.oc-row:focus-visible { border-color: var(--border-strong); }
button.oc-row .oc-label::after { content: " ›"; color: var(--faint); }
.oc-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.oc-pct { color: var(--muted); font-size: 0.8rem; text-align: right; font-variant-numeric: tabular-nums; }
.oc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; font: inherit; font-size: 0.82rem; color: var(--text); background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; }
.oc-chip:hover { border-color: var(--border-strong); }
.oc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.oc-found, .oc-registered { background: var(--oc-yes); stroke: var(--oc-yes); }
.oc-not_found, .oc-not_registered { background: var(--oc-no); stroke: var(--oc-no); }
.oc-unknown { background: var(--oc-unknown); stroke: var(--oc-unknown); }
.oc-error { background: var(--oc-error); stroke: var(--oc-error); }
.oc-pill { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; color: #0f1115; }
.oc-pill.oc-not_found, .oc-pill.oc-not_registered { color: var(--text); background: none; box-shadow: inset 0 0 0 1px var(--oc-no); }

.disclaimer { margin: -4px 0 16px; font-size: 0.8rem; color: var(--faint); }

/* provenance badges */
.prov { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; border: 1px solid var(--border-strong); color: var(--muted); }
.prov-api { color: var(--info); border-color: rgba(106, 166, 255, .35); }
.prov-live { color: var(--ok); border-color: rgba(70, 201, 139, .35); }
.prov-cached { color: var(--warn); border-color: rgba(245, 195, 91, .35); border-style: dashed; }
.prov-derived { color: var(--faint); }

/* a result several sources returned, shown once as its earliest observation */
.dupe {
  display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 0.7rem;
  font-weight: 600; white-space: nowrap; color: var(--faint);
  border: 1px dashed var(--border-strong); cursor: help;
}

/* scan log */
.log-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.log { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.log-row { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 0.86rem; }
.log-row:first-child { border-top: 0; }
.log-target { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.log-target a { color: var(--text); }
.log-meta, .log-reason { grid-column: 2; font-size: 0.76rem; color: var(--faint); }
.log-reason { color: var(--warn); }

details.sources > summary { list-style: none; cursor: pointer; }
details.sources > summary::-webkit-details-marker { display: none; }
details.sources > summary h3::before { content: "▸ "; color: var(--faint); }
details.sources[open] > summary h3::before { content: "▾ "; }
details.sources:not([open]) > summary { margin-bottom: 0; }

.span-all { grid-column: 1 / -1; }
.f-data .unavail { color: var(--faint); font-style: italic; }
.f-data dd.caveat, .f-data dt.caveat { color: var(--warn); }
.f-data.network { grid-template-columns: minmax(120px, max-content) 1fr; }

.search-options { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; font-size: 0.85rem; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Results sections ---------- */
.toolbar { margin: 4px 0 18px; }
.hits { margin-bottom: 28px; }
.sec-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin: 0 0 4px; }
.sec-title .count { color: var(--faint); font-weight: 500; font-size: 0.95rem; }
.sec-help { margin: 0 0 12px; }
.sec-empty { padding: 18px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); font-size: 0.9rem; }
.sec-empty p { margin: 0; }
.sec-empty .spinner { display: inline-block; vertical-align: -3px; color: var(--accent); }
#network { grid-template-columns: 1fr; }
#network .finding { max-width: 760px; }

.serp { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.serp-item {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: 14px; background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid #b98cff; border-radius: var(--radius);
}
.serp-top { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.serp-top .f-icon { width: 28px; height: 28px; }
.serp-top .f-icon.fav { padding: 6px; }
.serp-main { display: flex; flex-direction: column; min-width: 0; }
/* The engine's thumbnail spans the result on the right, as on a results page. */
.serp-item.has-thumb { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-content: start; }
.serp-item.has-thumb > * { grid-column: 1; }
.serp-item.has-thumb > .serp-thumb { grid-column: 2; grid-row: 1 / span 3; }
.serp-thumb {
  width: 56px; height: 56px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2);
}
.serp-title { font-weight: 600; font-size: 0.98rem; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
a.serp-title:hover { color: var(--accent-strong); }
.serp-url { font-size: 0.78rem; color: var(--ok); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-snippet { margin: 0; font-size: 0.88rem; color: var(--muted); overflow-wrap: anywhere; }
.serp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.75rem; color: var(--faint); }
mark { background: rgba(240, 138, 69, .22); color: var(--text); border-radius: 3px; padding: 0 2px; }

details.collapsible { margin-bottom: 16px; }
details.collapsible > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible > summary h3 { margin: 0; }
details.collapsible > summary h3::before { content: "▸ "; color: var(--faint); }
details.collapsible[open] > summary h3::before { content: "▾ "; }
details.collapsible[open] > summary { margin-bottom: 12px; }
details.collapsible .count { color: var(--faint); font-weight: 500; }
.fail-log { border-color: rgba(255, 107, 107, .25); }
.fail-log .notice { margin: 0 0 12px; }

/* ---------- Same picture on several sites ---------- */
.finding[data-kind="avatar_match"] { --kind: var(--k-match); }
.match-members { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.match-members li { min-width: 0; flex: 1 1 120px; max-width: 100%; }
.match-member {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto;
  column-gap: 9px; align-items: center; padding: 7px; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
}
a.match-member:hover { border-color: var(--k-match); text-decoration: none; }
.match-pic {
  grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  background: var(--surface-3); display: grid; place-items: center; font-weight: 700; color: var(--muted);
}
.match-site { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-title { font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.same-pic {
  display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 0.7rem; font-weight: 600;
  color: var(--k-match); border: 1px solid rgba(76, 201, 224, .35); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.same-pic:hover { text-decoration: none; background: rgba(76, 201, 224, .1); }

/* ---------- Connections graph ---------- */
.graph-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 16px; }
.graph-wrap {
  position: relative; height: 62vh; min-height: 380px; max-height: 820px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.graph-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; }
.graph-svg:active { cursor: grabbing; }
.graph-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.graph-tools .btn { min-width: 32px; padding: 0 9px; }
.graph-empty { position: absolute; inset: auto 16px 16px; margin: 0; font-size: 0.9rem; }
.graph-side { display: flex; flex-direction: column; gap: 10px; align-self: start; min-width: 0; }
.graph-side .check { font-size: 0.88rem; }
.graph-side-title { margin: 6px 0 0; font-size: 0.8rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.graph-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.82rem; color: var(--muted); }
.graph-legend li { display: flex; align-items: center; gap: 8px; }
.g-key-line { flex: 0 0 auto; }
.g-key-unsearched { background: transparent; border: 1.5px dashed var(--muted); }
.g-key-account { background: var(--k-account); }
.g-key-page { background: var(--k-infrastructure); }
.g-kind { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 0.75rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.g-name { margin: 0; font-size: 1.05rem; word-break: break-word; }
.g-url { font-size: 0.85rem; overflow-wrap: anywhere; }
.g-sub { margin: 6px 0 0; font-size: 0.8rem; color: var(--faint); }
.g-links, .graph-list { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.g-links li, .graph-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; padding: 5px 0; border-top: 1px solid var(--border); }
.g-links li:first-child, .graph-list li:first-child { border-top: 0; }
.g-links .link-btn, .graph-list .link-btn { overflow-wrap: anywhere; text-align: left; }
.g-rel { font-size: 0.72rem; font-weight: 600; color: var(--faint); white-space: nowrap; }
.g-rel-pivot { color: var(--accent-strong); }
.g-rel-picture { color: var(--k-match); }
.g-rel-lists { color: var(--info); }
.g-cases li { padding: 6px 0; }

/* SVG parts */
.g-edge { stroke: var(--border-strong); stroke-width: 1.2; }
.g-found { stroke: #3d4556; }
.g-lists { stroke: var(--info); stroke-dasharray: 5 4; stroke-width: 1.4; }
.g-mentions { stroke: var(--faint); stroke-dasharray: 2 4; }
.g-pivot { stroke: var(--accent); stroke-width: 2.4; }
.g-picture { stroke: var(--k-match); stroke-width: 2.2; stroke-dasharray: 7 4; }
.g-edge.g-dim { opacity: 0.12; }
.g-edge.g-hot { stroke-width: 2.6; }
.g-node { cursor: pointer; transition: opacity .15s; outline: none; }
.g-node.g-dim { opacity: 0.18; }
.g-dot { fill: var(--surface-3); stroke: var(--border-strong); stroke-width: 1.5; }
.g-account .g-dot { fill: var(--surface-2); stroke: var(--k-account); }
.g-page .g-dot { fill: var(--surface-2); stroke: var(--k-infrastructure); }
.g-entity .g-dot { stroke-width: 2.5; }
.g-type-username .g-dot { fill: var(--t-username); stroke: var(--t-username); }
.g-type-email .g-dot { fill: var(--t-email); stroke: var(--t-email); }
.g-type-phone .g-dot { fill: var(--t-phone); stroke: var(--t-phone); }
.g-type-ip .g-dot { fill: var(--t-ip); stroke: var(--t-ip); }
.g-entity.g-unsearched .g-dot { fill: var(--bg); stroke-dasharray: 4 3; }
.g-root .g-dot { stroke: var(--text); stroke-width: 3; }
.g-node.g-sel .g-dot, .g-node:focus-visible .g-dot { stroke: var(--accent-strong); stroke-width: 3.5; }
.g-glyph { fill: var(--bg); font-size: 13px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.g-unsearched .g-glyph { fill: var(--muted); }
.g-label {
  fill: var(--muted); font-size: 10px; text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round;
}
.g-entity .g-label { fill: var(--text); font-size: 12px; font-weight: 600; }
.graph-svg.g-far .g-account .g-label, .graph-svg.g-far .g-page .g-label { display: none; }

/* The connections card on a case page */
.case-graph { display: flex; flex-direction: column; min-width: 0; }
.case-graph .card-head { margin-bottom: 2px; }
.case-graph-sum { margin: 0 0 10px; }
.case-graph .graph-wrap { flex: 1; height: auto; min-height: 340px; max-height: none; background: var(--bg); }
/* The box gets its height from min-height or the grid, which a percentage
   height can't follow, so the picture is pinned to it instead. */
.case-graph .graph-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.case-graph-detail { margin-top: 10px; min-height: 1.6em; }
.case-graph-detail p { margin: 0; }
.g-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.85rem; min-width: 0; }
.g-caption strong { overflow-wrap: anywhere; }
.g-caption-act { margin-left: auto; padding: 0; font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--accent-strong); background: none; border: 0; cursor: pointer; overflow-wrap: anywhere; }

/* ---------- Larger screens ---------- */
@media (min-width: 420px) {
  .brand span { display: inline; }
  .type-toggle .ico { display: inline; }
}

@media (min-width: 560px) {
  .serp-thumb { width: 72px; height: 72px; }
  .recent-list a { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
  .recent-list .mono, .recent-list time { display: inline; }
  .filters { grid-template-columns: 1fr auto auto; }
  .filters input { grid-column: auto; }
  .hide-sm { display: table-cell; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 760px) {
  :root { --gutter: 24px; }
  .pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 12px; padding: 0; overflow: visible; }
  .pipeline > .step { max-width: none; }
  .overview.has-outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  /* Routes & providers fills the left column, ending level with the bottom of
     the connections card. "contain: size" stops its list from setting the
     height; the right column does, and the list scrolls if it's longer. */
  .overview.has-graph { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto 1fr; gap: 16px; align-items: stretch; }
  .overview.has-graph .sources { grid-column: 1; grid-row: 1 / span 2; contain: size; overflow-y: auto; }
  .overview.has-graph .outcomes { grid-column: 2; grid-row: 1; }
  .overview.has-graph .case-graph { grid-column: 2; grid-row: 2; }
  .overview.has-graph:not(.has-outcomes) .case-graph { grid-row: 1 / span 2; }
  .case-graph .graph-wrap { min-height: 380px; }
  .log-row { grid-template-columns: 120px minmax(0, 1.2fr) minmax(0, 1fr); }
  .log-meta { grid-column: 3; }
  .log-reason { grid-column: 2 / -1; }
  h1 { font-size: 2rem; }
  .landing-brand h1 { font-size: 2.6rem; }
  .hero { padding: 48px 0 16px; text-align: center; }
  .hero h1 { font-size: 2.75rem; }
  .hero .lede { margin: 0 auto; }
  .search-box { max-width: 720px; margin: 28px auto 0; }
  .search-meta, .examples { justify-content: center; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); margin-top: 40px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); margin-top: 40px; }
  .split { grid-template-columns: 3fr 2fr; }
  .graph-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .graph-wrap { height: 72vh; }
  .case-query { font-size: 2.1rem; }
  .toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
  .toolbar-left input { width: 320px; }
  .view-switch { align-self: auto; }
  .tiles { flex-wrap: wrap; overflow: visible; margin: 0 0 16px; padding: 0; }
  .footer .dot { display: inline; }
  .card { padding: 20px; }
}

@media (min-width: 1040px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
