/* ===========================================================================
   Digital Matchbox — shared styles (light + dark)
   =========================================================================== */

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-elev: #ffffff;
  --ink: #0f172a;
  --ink-muted: #475569;
  --line: #e5e7eb;
  --brand: #0e7490;          /* deep teal */
  --brand-strong: #155e75;
  --brand-soft: #ecfeff;
  --accent: #dc2626;         /* red */
  --accent-soft: #fee2e2;
  --success: #15803d;
  --success-soft: #dcfce7;
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.15);
  --map-attr: #475569;
}

[data-bs-theme="dark"] {
  --bg: #0b1220;
  --surface: #111c2e;
  --surface-elev: #162338;
  --ink: #e2e8f0;
  --ink-muted: #94a3b8;
  --line: #1e293b;
  --brand: #22d3ee;
  --brand-strong: #67e8f9;
  --brand-soft: #083344;
  --accent: #f87171;
  --accent-soft: #3b1818;
  --success: #4ade80;
  --success-soft: #14361f;
  --shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.55);
  --map-attr: #94a3b8;
}

* { box-sizing: border-box; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Navbar -------------------------------------------------------------- */
.navbar-brand {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.25);
}
.brand-name { font-weight: 800; }
.brand-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  margin-left: 0.35rem;
}
.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.nav-link-plain {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.nav-link-plain:hover { background: var(--brand-soft); color: var(--brand); }

/* --- Theme toggle -------------------------------------------------------- */
.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); }
[data-bs-theme="light"] .theme-toggle .icon-go-light { display: none; }
[data-bs-theme="dark"]  .theme-toggle .icon-go-dark { display: none; }

/* --- Ad / affiliate slots ----------------------------------------------- */
.affiliate-slot {
  border: 1.5px dashed var(--line);
  background: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--ink-muted) 5%, transparent) 0 12px,
    color-mix(in srgb, var(--ink-muted) 10%, transparent) 12px 24px
  );
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 1rem;
}
.affiliate-vertical { min-height: 600px; position: sticky; top: 1.5rem; }
.affiliate-horizontal { min-height: 90px; }

/* Hosting affiliate banner (top) */
.hosting-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, transparent), color-mix(in srgb, var(--accent) 8%, transparent)),
    var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s, box-shadow 0.2s;
}
.hosting-banner:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.hosting-banner .icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
}
.hosting-banner .copy { flex-grow: 1; line-height: 1.35; }
.hosting-banner .copy strong { font-size: 1rem; font-weight: 700; }
.hosting-banner .copy .blurb { display: block; color: var(--ink-muted); font-size: 0.85rem; }
.hosting-banner .cta { font-weight: 700; color: var(--brand); white-space: nowrap; }

/* Hosting affiliate vertical card (sidebar) */
.hosting-card {
  display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1.25rem 1.1rem;
  border-radius: 16px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--brand) 10%, transparent), color-mix(in srgb, var(--accent) 5%, transparent)),
    var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  position: sticky; top: 1.5rem;
  transition: transform 0.15s, box-shadow 0.2s;
}
.hosting-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: var(--ink); }
.hosting-card h6 { font-size: 1rem; font-weight: 700; margin: 0.25rem 0 0; letter-spacing: -0.01em; }
.hosting-card p { margin: 0; font-size: 0.85rem; color: var(--ink-muted); line-height: 1.5; }
.hosting-card .cta { margin-top: 0.5rem; font-weight: 700; font-size: 0.88rem; color: var(--brand); }
.hosting-card .icon { font-size: 1.5rem; color: var(--brand); }

/* --- Hero --------------------------------------------------------------- */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 3rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(400px 200px at 50% 0%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--brand);
}
.hero-ip {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.75rem);
  letter-spacing: -0.01em;
  margin: 0.75rem 0 0.5rem;
  word-break: break-all;
  color: var(--ink);
}

/* Privacy shield badge */
.shield-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.shield-wrap[data-protected="true"] {
  background: var(--success-soft);
  color: var(--success);
}
.shield-wrap .bi { font-size: 1.15rem; }

.geo-line {
  color: var(--ink-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}
.geo-line strong { color: var(--ink); font-weight: 600; }

.hero-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.btn-pill {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  transition: transform 0.12s ease, background 0.2s ease, color 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}
.btn-pill-dark { background: var(--ink); color: var(--surface); }
.btn-pill-dark:hover { background: var(--brand); color: #fff; transform: translateY(-1px); }
.btn-pill-dark.copied { background: var(--success); color: #fff; }
.btn-pill-brand { background: var(--brand); color: #fff; }
.btn-pill-brand:hover { background: var(--brand-strong); color: #fff; transform: translateY(-1px); }
.btn-pill-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-pill-outline:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }

/* --- Affiliate alert (VPN upsell) --------------------------------------- */
.alert-affiliate {
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  box-shadow: 0 14px 30px -16px color-mix(in srgb, var(--brand) 65%, transparent);
  padding: 1.1rem 1.4rem;
}
.alert-affiliate .bi { font-size: 1.35rem; }
.alert-affiliate a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* --- Detail cards ------------------------------------------------------- */
.detail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.5rem 1.5rem;
  height: 100%;
}
.detail-card h6 {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}
.detail-card .value {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.92rem;
  color: var(--ink);
  word-break: break-word;
  line-height: 1.55;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--line);
}
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-muted); font-size: 0.88rem; }
.kv .v { font-weight: 600; }

/* --- Lookup search bar -------------------------------------------------- */
.lookup-form {
  display: flex;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.4rem 0.4rem 1.2rem;
  box-shadow: var(--shadow);
  align-items: center;
  max-width: 540px;
}
.lookup-form input {
  flex-grow: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.95rem;
  padding: 0.5rem 0;
}
.lookup-form input::placeholder { color: var(--ink-muted); }

/* --- DNS toolbox -------------------------------------------------------- */
.dns-title {
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0.25rem 0 0.5rem;
}
.dns-form {
  display: flex;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.4rem 0.4rem 1.2rem;
  box-shadow: var(--shadow);
  align-items: center;
  max-width: 640px;
}
.dns-form-wide { max-width: 720px; }
.dns-port-input { width: 88px; }
.col-name { width: 30%; }

.hero-card-compact {
  padding: 2rem 1.75rem;
  text-align: left;
}
.hero-card-compact .hero-ip {
  font-size: clamp(1.4rem, 4.5vw, 2.25rem);
  margin: 0.5rem 0 1rem;
}
.dns-form input {
  flex-grow: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.95rem;
  padding: 0.5rem 0;
}
.dns-form input::placeholder { color: var(--ink-muted); }
.dns-form .dns-type {
  border: 1px solid var(--line);
  background: var(--surface-elev);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.dns-results {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.dns-result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.dns-result-head h6 {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  font-weight: 800;
  color: var(--brand);
}
.dns-count { font-size: 0.78rem; color: var(--ink-muted); font-weight: 600; }
.dns-table {
  --bs-table-bg: transparent;
  color: var(--ink);
  margin-top: 0.25rem;
}
.dns-table thead th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  border-bottom-color: var(--line);
}
.dns-table tbody td {
  border-color: var(--line);
  vertical-align: top;
}
.dns-table .dns-value {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.88rem;
  word-break: break-all;
}
.dns-table .ttl-col {
  width: 1%;
  white-space: nowrap;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82rem;
}
.dns-empty {
  color: var(--ink-muted);
  font-size: 0.88rem;
  padding: 0.25rem 0;
}
.dns-empty .bi { color: var(--brand); margin-right: 0.35rem; }

/* Property flag pills (subnet calc) */
.flag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.flag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--line);
}
.flag-on  { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.flag-off { color: var(--ink-muted); }
.flag .bi { font-size: 0.95rem; }
.cert-warn {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #b45309;
  border-color: transparent;
}
[data-bs-theme="dark"] .cert-warn { color: #fbbf24; }
.cert-bad {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

/* SAN chips */
.kv-label {
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.san-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.san-item {
  background: var(--surface-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  color: var(--ink);
}
.cert-fp {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  word-break: break-all;
}

/* DNS propagation */
.prop-banner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-top: 0.25rem;
}
.prop-banner .bi { font-size: 1.4rem; flex-shrink: 0; }
.prop-uniform  { background: var(--success-soft); color: var(--success); }
.prop-diverged {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #b45309;
}
[data-bs-theme="dark"] .prop-diverged { color: #fbbf24; }
.prop-failed   { background: var(--accent-soft); color: var(--accent); }

.prop-table tbody tr td { vertical-align: middle; }
.prop-resolver { display: flex; flex-direction: column; gap: 0.1rem; }
.prop-resolver strong { font-size: 0.95rem; }
.prop-meta {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--ink-muted);
}
.prop-row-match    td { box-shadow: inset 3px 0 0 0 var(--success); }
.prop-row-mismatch td { box-shadow: inset 3px 0 0 0 #f59e0b; }
.prop-row-error    td { box-shadow: inset 3px 0 0 0 var(--ink-muted); opacity: 0.85; }

/* HTTP headers inspector */
.hdr-status {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  border: 1px solid var(--line);
}
.status-2xx { background: var(--success-soft); color: var(--success); border-color: transparent; }
.status-3xx { background: var(--brand-soft);   color: var(--brand);   border-color: transparent; }
.status-4xx {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #b45309;
  border-color: transparent;
}
[data-bs-theme="dark"] .status-4xx { color: #fbbf24; }
.status-5xx { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.status-1xx { background: var(--surface-elev); color: var(--ink-muted); }

.hdr-final {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.25rem;
}
.hdr-method {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  background: var(--surface-elev);
  color: var(--ink-muted);
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.hdr-url {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.88rem;
  color: var(--ink);
  word-break: break-all;
  flex: 1 1 auto;
}
.hdr-meta {
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.hdr-url-line {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 0.2rem 0 0.85rem;
  word-break: break-all;
}
.hdr-chain {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.hdr-chain li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-left: 3px solid var(--line);
  background: var(--surface-elev);
  border-radius: 0 8px 8px 0;
}
.hdr-name {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--brand);
  white-space: nowrap;
}

/* Security headers analyzer */
.security-grade-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.security-grade {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 3rem;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.security-summary { flex: 1 1 240px; }
.grade-a { background: var(--success-soft); color: var(--success); }
.grade-b { background: var(--brand-soft); color: var(--brand); }
.grade-c {
  background: color-mix(in srgb, #f59e0b 22%, transparent);
  color: #b45309;
}
[data-bs-theme="dark"] .grade-c { color: #fbbf24; }
.grade-d, .grade-f { background: var(--accent-soft); color: var(--accent); }

.security-findings {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.4rem;
}
.security-finding {
  border-left: 3px solid var(--line);
  padding: 0.7rem 1rem;
  border-radius: 0 10px 10px 0;
  background: var(--surface-elev);
}
.finding-good    { border-left-color: var(--success); }
.finding-warning { border-left-color: #f59e0b; }
.finding-missing { border-left-color: var(--accent); }
.finding-info    { border-left-color: var(--brand); }

.finding-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.finding-name { font-weight: 700; }
.finding-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}
.sev-good    { background: var(--success-soft); color: var(--success); }
.sev-warning {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #b45309;
}
[data-bs-theme="dark"] .sev-warning { color: #fbbf24; }
.sev-missing { background: var(--accent-soft); color: var(--accent); }
.sev-info    { background: var(--brand-soft); color: var(--brand); }

.finding-value {
  display: block;
  margin: 0.45rem 0 0.3rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--ink);
  background: var(--surface);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  word-break: break-all;
}
.finding-notes {
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* Crawler permission checker */
.scrap-score {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}
.scrap-numeric {
  font-weight: 800;
  font-size: 3rem;
  letter-spacing: -0.04em;
  line-height: 1;
  flex-shrink: 0;
  color: var(--ink);
}
.scrap-numeric-max {
  color: var(--ink-muted);
  font-size: 1.15rem;
  font-weight: 600;
  margin-left: 0.2rem;
}
.scrap-bar-wrap {
  flex: 1 1 240px;
  min-width: 200px;
}
.scrap-bar {
  width: 100%;
  height: 14px;
  display: block;
}
.scrap-track { fill: var(--line); }
.scrap-good { fill: var(--success); }
.scrap-warn { fill: #f59e0b; }
.scrap-bad  { fill: var(--accent); }

.scrap-reasons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.scrap-reason {
  border-left: 3px solid var(--line);
  padding: 0.7rem 1rem;
  border-radius: 0 10px 10px 0;
  background: var(--surface-elev);
}
.scrap-reason-blocked  { border-left-color: var(--accent); }
.scrap-reason-penalty  { border-left-color: #f59e0b; }
.scrap-reason-info     { border-left-color: var(--brand); }
.scrap-reason-positive { border-left-color: var(--success); }

.scrap-reason-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.scrap-reason-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.scrap-reason-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.scrap-reason-value {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  color: var(--ink-muted);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scrap-reason-explanation {
  font-size: 0.86rem;
  color: var(--ink-muted);
  line-height: 1.55;
}
.scrap-delta {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  min-width: 56px;
  text-align: center;
}
.scrap-delta-neg  { background: var(--accent-soft); color: var(--accent); }
.scrap-delta-pos  { background: var(--success-soft); color: var(--success); }
.scrap-delta-info { background: var(--brand-soft); color: var(--brand); }

/* --- Leaflet map -------------------------------------------------------- */
.map-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  height: 100%;
  min-height: 460px;
  display: flex;
  flex-direction: column;
}
.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.map-header h6 {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin: 0;
}
.map-coords { font-family: "JetBrains Mono", monospace; font-size: 0.8rem; color: var(--ink-muted); }
#map { flex-grow: 1; min-height: 400px; }
.map-empty {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  color: var(--ink-muted);
  text-align: center;
}
.map-empty .bi { font-size: 2rem; color: var(--brand); }
[data-bs-theme="dark"] .leaflet-tile-pane { filter: brightness(0.85) contrast(1.05); }
.leaflet-container { background: var(--surface-elev); }

/* --- Footer ------------------------------------------------------------- */
footer {
  color: var(--ink-muted);
  font-size: 0.85rem;
  padding: 2rem 0 1.5rem;
  text-align: center;
  margin-top: auto;        /* pin to bottom of viewport on short pages */
  flex-shrink: 0;
  position: relative;
  z-index: 1;              /* sit above any stray Leaflet panes */
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 991.98px) {
  .affiliate-vertical { display: none; }
}
