:root {
  color-scheme: dark;
  --bg: #070b16;
  --bg-accent: #0c1224;
  --surface: rgba(18, 26, 46, 0.92);
  --surface-solid: #121a2e;
  --surface-2: #0c1324;
  --surface-hover: rgba(255, 255, 255, 0.045);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #f87171;
  --code-bg: #0c1324;
  --terminal-bg: #050812;
  --terminal-text: #cbd5e1;
  --diff-add-bg: rgba(34, 197, 94, 0.12);
  --diff-del-bg: rgba(248, 113, 113, 0.12);
  --diff-chg-bg: rgba(245, 158, 11, 0.12);
  --graph-bg: #080e1e;
  --graph-edge: rgba(148, 163, 184, 0.34);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f5f9;
  --bg-accent: #e2e8f0;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-2: #f8fafc;
  --surface-hover: rgba(15, 23, 42, 0.045);
  --border: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.24);
  --text: #0f172a;
  --muted: #475569;
  --accent: #0284c7;
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;
  --code-bg: #f1f5f9;
  --terminal-bg: #f8fafc;
  --terminal-text: #1e293b;
  --diff-add-bg: rgba(22, 163, 74, 0.11);
  --diff-del-bg: rgba(220, 38, 38, 0.1);
  --diff-chg-bg: rgba(217, 119, 6, 0.11);
  --graph-bg: #f8fafc;
  --graph-edge: rgba(71, 85, 105, 0.36);
}

[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #02040a;
  --bg-accent: #070b18;
  --surface: rgba(9, 13, 26, 0.94);
  --surface-solid: #090d1a;
  --surface-2: #050811;
  --surface-hover: rgba(129, 140, 248, 0.07);
  --border: rgba(129, 140, 248, 0.16);
  --border-strong: rgba(129, 140, 248, 0.3);
  --text: #eef2ff;
  --muted: #8b95b5;
  --accent: #818cf8;
  --success: #34d399;
  --warning: #fbbf24;
  --error: #fb7185;
  --code-bg: #04060d;
  --terminal-bg: #020308;
  --terminal-text: #d1d5f0;
  --diff-add-bg: rgba(52, 211, 153, 0.12);
  --diff-del-bg: rgba(251, 113, 133, 0.12);
  --diff-chg-bg: rgba(251, 191, 36, 0.12);
  --graph-bg: #040711;
  --graph-edge: rgba(129, 140, 248, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 8%, rgba(56, 189, 248, 0.14), transparent 38%),
    radial-gradient(circle at 90% 12%, rgba(99, 102, 241, 0.11), transparent 36%),
    radial-gradient(circle at 80% 90%, rgba(34, 197, 94, 0.09), transparent 40%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
}

body.is-simple-mode .pro-only {
  display: none !important;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Shared Badges & Buttons */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.badge.is-success {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.3);
}

.badge.is-warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.32);
}

.badge.is-error {
  background: rgba(248, 113, 113, 0.14);
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.34);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.dot.pulse {
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes dashFlow {
  to {
    stroke-dashoffset: -24;
  }
}

button,
.btn-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

button:hover:not(:disabled),
.btn-link:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(148, 163, 184, 0.36);
  text-decoration: none;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.primary,
.btn-link.primary {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.42);
  color: #bae6fd;
}

button.primary:hover:not(:disabled),
.btn-link.primary:hover {
  background: rgba(56, 189, 248, 0.25);
}

button.danger {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.32);
  color: #fecaca;
}

button.danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.2);
}

.mono {
  font-family: var(--mono);
}

.hidden {
  display: none !important;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.pill.safe {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.pill.leak {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.pill.pending {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.pill.warn {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.32);
}

/* Mode Toggle & Tooltips */
.mode-switch {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.mode-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--muted);
}

.mode-btn.is-active {
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
}

.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.tooltip-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #090e1d;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tooltip-wrap:hover .tooltip-bubble,
.tooltip-wrap:focus-within .tooltip-bubble,
.tooltip-wrap.is-open .tooltip-bubble {
  opacity: 1;
}

/* Visitor Shell */
.visitor-page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px 20px 44px;
}

.page-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.brand-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-title p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Hero Section: Barometer + IP Comparison */
.hero-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(12px);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* SVG Barometer Gauge */
.gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gauge-svg-wrap {
  position: relative;
  width: 240px;
  height: 142px;
  margin-bottom: 8px;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gauge-track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.16);
  stroke-width: 16;
  stroke-linecap: round;
}

.gauge-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 16;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.35s ease;
}

.gauge-center {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-percent {
  font-family: var(--mono);
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.gauge-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.gauge-verdict {
  font-size: 17px;
  font-weight: 700;
  margin: 4px 0 6px;
}

.gauge-summary {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* Exit vs Real IP Comparison */
.ip-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .ip-compare-grid {
    grid-template-columns: 1fr;
  }
}

.ip-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ip-panel.is-leak {
  border-color: rgba(248, 113, 113, 0.48);
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.09), var(--surface-2));
}

.ip-panel.is-indirect {
  border-color: rgba(245, 158, 11, 0.42);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.07), var(--surface-2));
}

.ip-panel.is-safe {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.06), var(--surface-2));
}

.ip-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ip-big {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  word-break: break-all;
  letter-spacing: -0.02em;
}

.ip-meta-line {
  font-size: 13px;
  color: var(--text);
}

.ip-meta-muted {
  font-size: 12.5px;
  color: var(--muted);
}

.factor-list {
  display: grid;
  gap: 8px;
}

.factor-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(148, 163, 184, 0.11);
  font-size: 13px;
}

.factor-left {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.factor-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.factor-mark.pass {
  background: rgba(34, 197, 94, 0.16);
  color: var(--success);
}

.factor-mark.warn {
  background: rgba(245, 158, 11, 0.18);
  color: var(--warning);
}

.factor-mark.fail {
  background: rgba(248, 113, 113, 0.18);
  color: var(--error);
}

.factor-title {
  font-weight: 600;
}

.factor-detail {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.factor-impact {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* Visual Row: Traffic Route + Geo Map */
.visual-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .visual-grid-2 {
    grid-template-columns: 1fr;
  }
}

.route-svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.route-line {
  fill: none;
  stroke-width: 2.5;
  stroke-dasharray: 6 6;
  animation: dashFlow 1.2s linear infinite;
}

.route-line.is-safe {
  stroke: var(--success);
}

.route-line.is-leak {
  stroke: var(--error);
}

.route-line.is-warn {
  stroke: var(--warning);
}

.geo-map-svg {
  width: 100%;
  height: auto;
  display: block;
  background: #091022;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.map-grid-line {
  stroke: rgba(148, 163, 184, 0.08);
  stroke-width: 0.7;
}

.map-land {
  fill: rgba(56, 189, 248, 0.1);
  stroke: rgba(56, 189, 248, 0.25);
  stroke-width: 0.8;
}

.map-arc {
  fill: none;
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.distance-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.distance-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
}

/* Advice / How to Fix */
.advice-card {
  margin-bottom: 18px;
}

.advice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.advice-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.advice-item.is-fail {
  border-color: rgba(248, 113, 113, 0.35);
}

.advice-item.is-warn {
  border-color: rgba(245, 158, 11, 0.32);
}

.advice-steps {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--muted);
}

/* 6-tile Quick Overview Strip */
.checks-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

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

@media (max-width: 560px) {
  .checks-grid {
    grid-template-columns: 1fr;
  }
}

.check-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.check-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.check-tile-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.check-tile-val {
  font-size: 15px;
  font-weight: 700;
}

.check-tile-desc {
  font-size: 12.5px;
  color: var(--muted);
}

/* Multi-Region Ping Bars */
.ping-bars {
  display: grid;
  gap: 8px;
}

.ping-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.ping-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.ping-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
}

/* Action Bar & Expandable Detailed Report */
.action-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

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

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

.metric-list {
  display: grid;
  gap: 8px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 13px;
}

.metric-key {
  color: var(--muted);
  flex-shrink: 0;
}

.metric-val {
  text-align: right;
  word-break: break-word;
  font-weight: 500;
}

.resolver-list {
  display: grid;
  gap: 8px;
}

.resolver-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
}

.resolver-item.is-foreign {
  border-color: rgba(248, 113, 113, 0.4);
}

.resolver-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.console-preview {
  background: #050812;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.console-body {
  padding: 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 5px;
}

/* Admin Panel Layout */
.admin-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}

.admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-header h1 {
  margin: 0 0 4px;
  font-size: 24px;
}

.admin-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px 18px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-num {
  font-size: 27px;
  font-weight: 700;
  font-family: var(--mono);
}

.stat-num.is-danger {
  color: var(--error);
}

/* Admin Analytics Charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 980px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px 18px;
}

.bar-chart {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(70px, 120px) minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.bar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

/* Link Generator Drawer/Panel */
.links-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}

.links-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.search-input {
  width: 100%;
  max-width: 320px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.admin-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(350px, 0.98fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 1080px) {
  .admin-workspace {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  vertical-align: top;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: var(--surface-hover);
}

tbody tr.is-selected {
  background: rgba(56, 189, 248, 0.1);
}

.ua-cell {
  max-width: 195px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11.5px;
}

.leaks-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 180px;
}

.detail-body {
  padding: 18px;
}

.detail-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.detail-section {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.detail-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.kv-list {
  display: grid;
  gap: 7px;
  font-size: 13px;
}

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

.kv-key {
  color: var(--muted);
}

.kv-val {
  word-break: break-word;
}

.code-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-word;
  color: #cbd5e1;
}

.reason-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: #fecaca;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Fullscreen Detail Modal (Admin) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.8);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 60;
}

.modal-dialog {
  width: 100%;
  max-width: 1120px;
  max-height: 90vh;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  display: grid;
  gap: 18px;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 18, 0.85);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 70;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

/* ==========================================================================
   Base Controls, Forms, Modal Variants & Toasts
   ========================================================================== */
.theme-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.theme-btn {
  border: none;
  background: transparent;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.25;
}

.theme-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}

.theme-btn.is-active,
.theme-btn[aria-pressed="true"] {
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
}

button.btn-sm,
.btn-link.btn-sm,
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 8px;
  gap: 5px;
}

button.btn-icon,
.btn-link.btn-icon,
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  flex-shrink: 0;
}

button.btn-sm.btn-icon,
.btn-link.btn-sm.btn-icon,
.btn-sm.btn-icon {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select.form-control {
  cursor: pointer;
  min-height: 38px;
}

textarea.form-control {
  resize: vertical;
  min-height: 82px;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.form-control::placeholder {
  color: var(--muted);
  opacity: 0.78;
}

.form-control:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-hint {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.modal-dialog.modal-sm {
  max-width: 520px;
}

.modal-dialog.modal-lg {
  max-width: 960px;
}

.modal-dialog.modal-xl {
  max-width: 1320px;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-left-width: 4px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.44);
  animation: toastSlideIn 0.2s ease;
}

.toast.is-info {
  border-left-color: var(--accent);
}

.toast.is-success {
  border-left-color: var(--success);
}

.toast.is-warn {
  border-left-color: var(--warning);
}

.toast.is-error {
  border-left-color: var(--error);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   Toolbar, Compare Selection & Export Menu
   ========================================================================== */
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.col-select {
  width: 40px;
  min-width: 40px;
  text-align: center;
  padding-left: 10px;
  padding-right: 6px;
  vertical-align: middle;
}

.compare-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
  vertical-align: middle;
}

tbody tr.is-compare-selected {
  background: rgba(56, 189, 248, 0.12);
  box-shadow: inset 3px 0 0 var(--accent);
}

tbody tr.is-compare-selected:hover {
  background: rgba(56, 189, 248, 0.17);
}

tbody tr.is-selected.is-compare-selected {
  background: rgba(56, 189, 248, 0.2);
}

.compare-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #04101c;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.export-dropdown {
  position: relative;
  display: inline-flex;
}

.export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 245px;
  max-width: calc(100vw - 32px);
  padding: 6px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.export-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}

.export-menu-item:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border);
}

.export-menu-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* ==========================================================================
   Interactive SVG Relation Graph
   ========================================================================== */
.relation-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 18px;
}

.relation-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.relation-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.relation-filter-btn {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.relation-filter-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}

.relation-filter-btn.is-active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.42);
  color: var(--accent);
}

.relation-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.relation-canvas-wrap {
  position: relative;
  width: 100%;
  height: 420px;
  min-height: 300px;
  background: var(--graph-bg);
  overflow: hidden;
  user-select: none;
}

.relation-svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.relation-svg:active {
  cursor: grabbing;
}

.relation-edge {
  fill: none;
  stroke: var(--graph-edge);
  stroke-width: 1.6;
  stroke-linecap: round;
  transition: opacity 0.18s ease, stroke-width 0.18s ease, stroke 0.18s ease;
}

.relation-edge.is-ip {
  stroke: rgba(56, 189, 248, 0.54);
}

.relation-edge.is-real {
  stroke: rgba(248, 113, 113, 0.74);
  stroke-dasharray: 5 4;
}

.relation-edge.is-dns {
  stroke: rgba(245, 158, 11, 0.6);
}

.relation-edge.is-device {
  stroke: rgba(168, 85, 247, 0.6);
}

.relation-edge.is-tag {
  stroke: rgba(34, 197, 94, 0.54);
}

.relation-edge.is-highlighted {
  stroke-width: 2.8;
  opacity: 1;
}

.relation-edge.is-dimmed {
  opacity: 0.14;
}

.relation-node {
  cursor: pointer;
  transition: opacity 0.18s ease;
}

.relation-node-circle {
  stroke-width: 2;
  fill: rgba(56, 189, 248, 0.2);
  stroke: var(--accent);
  transition: transform 0.15s ease, fill 0.15s ease, stroke 0.15s ease;
}

.relation-node-ring {
  fill: none;
  stroke: transparent;
  stroke-width: 2.5;
  opacity: 0;
  transition: opacity 0.15s ease, stroke 0.15s ease;
}

.relation-node-label {
  fill: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--graph-bg);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.relation-node.node-visit .relation-node-circle {
  fill: rgba(56, 189, 248, 0.22);
  stroke: var(--accent);
}

.relation-node.node-exit-ip .relation-node-circle {
  fill: rgba(34, 197, 94, 0.2);
  stroke: var(--success);
}

.relation-node.node-real-ip .relation-node-circle {
  fill: rgba(248, 113, 113, 0.24);
  stroke: var(--error);
}

.relation-node.node-dns .relation-node-circle {
  fill: rgba(245, 158, 11, 0.22);
  stroke: var(--warning);
}

.relation-node.node-device .relation-node-circle {
  fill: rgba(168, 85, 247, 0.22);
  stroke: #a855f7;
}

.relation-node.node-tag .relation-node-circle {
  fill: rgba(20, 184, 166, 0.22);
  stroke: #14b8a6;
}

.relation-node:hover .relation-node-ring {
  opacity: 0.75;
  stroke: var(--text);
}

.relation-node.is-selected .relation-node-ring {
  opacity: 1;
  stroke: var(--accent);
}

.relation-node.is-leak .relation-node-circle {
  fill: rgba(248, 113, 113, 0.3);
  stroke: var(--error);
}

.relation-node.is-leak .relation-node-ring {
  opacity: 0.9;
  stroke: var(--error);
  stroke-dasharray: 4 3;
}

.relation-node.is-dimmed {
  opacity: 0.2;
}

.relation-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 15;
  max-width: 280px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.relation-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
}

.relation-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

/* ==========================================================================
   Resource Waterfall
   ========================================================================== */
.waterfall-wrap {
  display: grid;
  gap: 10px;
}

.waterfall-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

.waterfall-header {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) 72px;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.waterfall-axis {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}

.waterfall-tick {
  white-space: nowrap;
}

.waterfall-list {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}

.waterfall-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) 72px;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.waterfall-row:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.waterfall-row.is-error {
  border-color: rgba(248, 113, 113, 0.42);
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.09), var(--surface-2));
}

.waterfall-row.is-slow {
  border-color: rgba(245, 158, 11, 0.38);
}

.waterfall-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.waterfall-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.waterfall-type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.25);
  flex-shrink: 0;
}

.waterfall-lane {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.waterfall-lane .waterfall-bar,
.waterfall-lane [class*="waterfall-bar-"] {
  position: absolute;
  top: 2px;
  bottom: 2px;
  min-width: 4px;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.waterfall-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  vertical-align: middle;
}

.waterfall-bar-seg {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 2px;
}

.waterfall-bar.is-dns,
.waterfall-bar-dns {
  background: #a855f7;
}

.waterfall-bar.is-connect,
.waterfall-bar.is-tcp,
.waterfall-bar-connect,
.waterfall-bar-tcp {
  background: var(--warning);
}

.waterfall-bar.is-tls,
.waterfall-bar-tls {
  background: #ec4899;
}

.waterfall-bar.is-wait,
.waterfall-bar.is-ttfb,
.waterfall-bar-wait,
.waterfall-bar-ttfb {
  background: var(--accent);
}

.waterfall-bar.is-download,
.waterfall-bar.is-transfer,
.waterfall-bar-download,
.waterfall-bar-transfer {
  background: var(--success);
}

.waterfall-bar.is-slow,
.waterfall-bar-slow {
  background: var(--warning);
}

.waterfall-bar.is-error,
.waterfall-bar-error {
  background: var(--error);
}

.waterfall-bar.is-cached,
.waterfall-bar-cached {
  background: var(--muted);
  opacity: 0.72;
}

.waterfall-duration {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  color: var(--text);
  white-space: nowrap;
}

.waterfall-row.is-error .waterfall-duration {
  color: var(--error);
}

.waterfall-row.is-slow .waterfall-duration {
  color: var(--warning);
}

.waterfall-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

/* ==========================================================================
   Diff Modal
   ========================================================================== */
.diff-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.diff-selector-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  flex: 1;
  min-width: 280px;
}

.diff-select {
  width: 100%;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.diff-select:focus {
  outline: none;
  border-color: var(--accent);
}

.diff-swap-btn {
  flex-shrink: 0;
  white-space: nowrap;
  height: 36px;
}

.diff-stats-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.diff-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.diff-stat-pill.is-changed {
  background: var(--diff-chg-bg);
  border-color: rgba(245, 158, 11, 0.36);
  color: var(--warning);
}

.diff-stat-pill.is-added {
  background: var(--diff-add-bg);
  border-color: rgba(34, 197, 94, 0.36);
  color: var(--success);
}

.diff-stat-pill.is-removed {
  background: var(--diff-del-bg);
  border-color: rgba(248, 113, 113, 0.36);
  color: var(--error);
}

.diff-section {
  display: grid;
  gap: 8px;
}

.diff-section h3,
.diff-section h4 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.diff-grid {
  display: grid;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}

.diff-grid > .diff-col-head {
  display: grid;
  grid-template-columns: minmax(140px, 210px) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  background: rgba(148, 163, 184, 0.08);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.diff-row > .diff-col-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.diff-row {
  display: grid;
  grid-template-columns: minmax(140px, 210px) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.diff-row:last-child {
  border-bottom: none;
}

.diff-row.is-same {
  background: transparent;
}

.diff-row.is-changed {
  background: var(--diff-chg-bg);
}

.diff-row.is-added {
  background: var(--diff-add-bg);
}

.diff-row.is-removed {
  background: var(--diff-del-bg);
}

.diff-key {
  font-weight: 600;
  color: var(--muted);
  word-break: break-word;
}

.diff-cell {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  word-break: break-word;
  min-width: 0;
}

.diff-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--muted);
}

.diff-row.is-changed .diff-badge,
.diff-badge.is-changed {
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.38);
}

.diff-row.is-added .diff-badge,
.diff-badge.is-added {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.38);
}

.diff-row.is-removed .diff-badge,
.diff-badge.is-removed {
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.38);
}

.diff-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

/* ==========================================================================
   Manual IP / Port Inspector
   ========================================================================== */
.inspector-form {
  display: grid;
  gap: 12px;
}

.inspector-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

.inspector-input-row > input,
.inspector-input-row > .form-control,
.inspector-input-row > .search-input {
  flex: 1 1 220px;
  max-width: none;
}

.inspector-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.inspector-preset-btn {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.inspector-preset-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.inspector-preset-btn.is-active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent);
}

.inspector-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

.inspector-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.inspector-ports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.inspector-ports-table tbody tr {
  cursor: default;
}

.port-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--border);
}

.port-pill.is-open {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
}

.port-pill.is-closed {
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted);
  border-color: rgba(148, 163, 184, 0.28);
}

.port-pill.is-timeout {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.34);
}

.port-pill.is-filtered {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.34);
}

.inspector-history-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inspector-history-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.inspector-history-chip:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--accent);
}

/* ==========================================================================
   Hash-Chain Audit Verifier
   ========================================================================== */
.audit-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.audit-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13.5px;
  line-height: 1.45;
}

.audit-banner.is-valid {
  background: rgba(34, 197, 94, 0.11);
  border-color: rgba(34, 197, 94, 0.38);
}

.audit-banner.is-broken {
  background: rgba(248, 113, 113, 0.13);
  border-color: rgba(248, 113, 113, 0.42);
}

.audit-banner.is-empty {
  border-style: dashed;
  color: var(--muted);
}

.audit-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.audit-metric-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audit-metric-card .stat-num {
  font-size: 20px;
}

.audit-chain-list {
  display: grid;
  gap: 10px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 2px;
}

.audit-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.audit-block.is-valid {
  border-left-color: var(--success);
}

.audit-block.is-broken {
  border-color: rgba(248, 113, 113, 0.36);
  border-left-color: var(--error);
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.09), var(--surface-2));
}

.audit-block.is-warning {
  border-color: rgba(245, 158, 11, 0.34);
  border-left-color: var(--warning);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), var(--surface-2));
}

.audit-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.audit-hash-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.audit-hash-val {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 8px;
  word-break: break-all;
}

.audit-hash-match {
  color: var(--success);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.audit-hash-mismatch {
  color: var(--error);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* ==========================================================================
   Risk Rules, Live WS Terminal & Keyboard Shortcuts
   ========================================================================== */
.rules-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
  display: grid;
  gap: 14px;
}

.rules-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rules-form {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.rules-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

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

.rule-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rule-card.is-disabled {
  opacity: 0.6;
}

.rule-severity {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  white-space: nowrap;
}

.rule-severity.is-high,
.rule-severity.is-critical,
.rule-severity.is-error,
.rule-severity.is-danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--error);
}

.rule-severity.is-medium,
.rule-severity.is-warn,
.rule-severity.is-warning {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--warning);
}

.rule-severity.is-low,
.rule-severity.is-info {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.32);
  color: var(--success);
}

/* Live WS Terminal */
.ws-terminal-panel {
  background: var(--terminal-bg);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.ws-terminal-panel.is-docked {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(680px, calc(100vw - 32px));
  z-index: 55;
  margin-bottom: 0;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.ws-terminal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(148, 163, 184, 0.06);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.ws-terminal-panel.is-collapsed .ws-terminal-header {
  border-bottom: none;
}

.ws-terminal-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.03);
}

.ws-terminal-body {
  height: 260px;
  max-height: 45vh;
  overflow-y: auto;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--terminal-text);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-terminal-panel.is-collapsed .ws-terminal-filters,
.ws-terminal-panel.is-collapsed .ws-terminal-body {
  display: none;
}

.ws-log-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 6px;
  word-break: break-word;
}

.ws-log-line:hover {
  background: var(--surface-hover);
}

.ws-log-line.is-error,
.ws-log-line.is-leak {
  background: rgba(248, 113, 113, 0.09);
}

.ws-log-line.is-warn {
  background: rgba(245, 158, 11, 0.08);
}

.ws-log-ts {
  color: var(--muted);
  font-size: 11px;
  flex-shrink: 0;
}

.ws-log-src {
  color: var(--accent);
  font-weight: 600;
  font-size: 11.5px;
  flex-shrink: 0;
}

.ws-log-event {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.ws-log-msg {
  color: var(--terminal-text);
  flex: 1;
  min-width: 0;
}

.ws-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  flex-shrink: 0;
}

.ws-status-dot.is-connected,
.ws-status-dot.is-live,
.ws-status-dot.is-online {
  background: var(--success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.65);
}

.ws-status-dot.is-connecting {
  background: var(--warning);
}

.ws-status-dot.is-disconnected,
.ws-status-dot.is-error {
  background: var(--error);
}

/* Shortcuts Modal */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.shortcut-group {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.shortcut-group h3,
.shortcut-group h4 {
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 13px;
}

.shortcut-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.shortcut-keys {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-family: var(--mono);
}

.shortcut-desc {
  color: var(--text);
  font-size: 13px;
}

/* ==========================================================================
   Theme Overrides (Light & Midnight)
   ========================================================================== */
[data-theme="light"] body,
body[data-theme="light"] {
  background:
    radial-gradient(circle at 10% 8%, rgba(2, 132, 199, 0.1), transparent 40%),
    radial-gradient(circle at 90% 12%, rgba(99, 102, 241, 0.08), transparent 38%),
    radial-gradient(circle at 80% 90%, rgba(22, 163, 74, 0.07), transparent 42%),
    var(--bg);
}

[data-theme="light"] button,
[data-theme="light"] .btn-link {
  background: rgba(15, 23, 42, 0.04);
}

[data-theme="light"] button:hover:not(:disabled),
[data-theme="light"] .btn-link:hover {
  background: rgba(15, 23, 42, 0.09);
  border-color: rgba(15, 23, 42, 0.24);
}

[data-theme="light"] button.primary,
[data-theme="light"] .btn-link.primary {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.42);
  color: #0369a1;
}

[data-theme="light"] button.primary:hover:not(:disabled),
[data-theme="light"] .btn-link.primary:hover {
  background: rgba(2, 132, 199, 0.2);
}

[data-theme="light"] button.danger {
  background: rgba(220, 38, 38, 0.09);
  border-color: rgba(220, 38, 38, 0.32);
  color: #b91c1c;
}

[data-theme="light"] button.danger:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.17);
}

[data-theme="light"] .pill.safe {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.3);
}

[data-theme="light"] .pill.leak {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.32);
}

[data-theme="light"] .pill.pending {
  background: rgba(2, 132, 199, 0.12);
  color: #0369a1;
  border-color: rgba(2, 132, 199, 0.3);
}

[data-theme="light"] .pill.warn {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.32);
}

[data-theme="light"] .port-pill.is-open {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.32);
}

[data-theme="light"] .port-pill.is-timeout {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.32);
}

[data-theme="light"] .port-pill.is-filtered {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.32);
}

[data-theme="light"] .mode-btn.is-active,
[data-theme="light"] .theme-btn.is-active,
[data-theme="light"] .theme-btn[aria-pressed="true"] {
  background: rgba(2, 132, 199, 0.14);
  color: #0369a1;
}

[data-theme="light"] .tooltip-btn {
  background: rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .tooltip-bubble {
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .geo-map-svg {
  background: #eef4fb;
}

[data-theme="light"] .map-grid-line {
  stroke: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .map-land {
  fill: rgba(2, 132, 199, 0.14);
  stroke: rgba(2, 132, 199, 0.35);
}

[data-theme="light"] .console-preview {
  background: var(--terminal-bg);
}

[data-theme="light"] .console-header {
  background: rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .console-body {
  color: var(--terminal-text);
}

[data-theme="light"] .code-block {
  background: var(--code-bg);
  color: var(--text);
}

[data-theme="light"] .glass-card {
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .factor-item {
  background: rgba(15, 23, 42, 0.025);
}

[data-theme="light"] .hint {
  background: rgba(15, 23, 42, 0.03);
}

[data-theme="light"] kbd {
  background: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] th {
  background: rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .reason-list {
  color: #b91c1c;
}

[data-theme="light"] .modal-backdrop {
  background: rgba(15, 23, 42, 0.45);
}

[data-theme="light"] .modal-dialog {
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
}

[data-theme="light"] .auth-overlay {
  background: rgba(15, 23, 42, 0.52);
}

[data-theme="light"] .toast,
[data-theme="light"] .export-menu,
[data-theme="light"] .relation-tooltip {
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .ws-terminal-panel {
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .ws-terminal-panel.is-docked {
  box-shadow: 0 20px 52px rgba(15, 23, 42, 0.22);
}

[data-theme="light"] .compare-count-badge {
  color: #ffffff;
}

[data-theme="midnight"] body,
body[data-theme="midnight"] {
  background:
    radial-gradient(circle at 10% 8%, rgba(129, 140, 248, 0.14), transparent 40%),
    radial-gradient(circle at 90% 12%, rgba(56, 189, 248, 0.09), transparent 38%),
    radial-gradient(circle at 80% 90%, rgba(52, 211, 153, 0.07), transparent 42%),
    var(--bg);
}

[data-theme="midnight"] .geo-map-svg {
  background: var(--graph-bg);
}

[data-theme="midnight"] .console-preview {
  background: var(--terminal-bg);
}

[data-theme="midnight"] .console-body {
  color: var(--terminal-text);
}

[data-theme="midnight"] .code-block {
  background: var(--code-bg);
  color: var(--terminal-text);
}

[data-theme="midnight"] .tooltip-bubble {
  background: #060914;
}

[data-theme="midnight"] button.primary,
[data-theme="midnight"] .btn-link.primary {
  background: rgba(129, 140, 248, 0.16);
  border-color: rgba(129, 140, 248, 0.42);
  color: #c7d2fe;
}

[data-theme="midnight"] button.primary:hover:not(:disabled),
[data-theme="midnight"] .btn-link.primary:hover {
  background: rgba(129, 140, 248, 0.26);
}

[data-theme="midnight"] .mode-btn.is-active,
[data-theme="midnight"] .theme-btn.is-active,
[data-theme="midnight"] .theme-btn[aria-pressed="true"] {
  background: rgba(129, 140, 248, 0.2);
  color: #c7d2fe;
}

[data-theme="midnight"] .pill.pending {
  background: rgba(129, 140, 248, 0.14);
  color: #c7d2fe;
  border-color: rgba(129, 140, 248, 0.34);
}

[data-theme="midnight"] .relation-filter-btn.is-active {
  background: rgba(129, 140, 248, 0.2);
  border-color: rgba(129, 140, 248, 0.45);
  color: #c7d2fe;
}

[data-theme="midnight"] .compare-count-badge {
  color: #040711;
}

/* ==========================================================================
   Responsive Breakpoints for New Grids & Modals
   ========================================================================== */
@media (max-width: 900px) {
  .inspector-result-grid {
    grid-template-columns: 1fr;
  }

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

  .diff-selector-group {
    grid-template-columns: 1fr;
  }

  .waterfall-header,
  .waterfall-row {
    grid-template-columns: minmax(130px, 180px) minmax(0, 1fr) 60px;
    gap: 8px;
  }

  .relation-canvas-wrap {
    height: 340px;
  }

  .ws-terminal-panel.is-docked {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }
}

@media (max-width: 720px) {
  .admin-shell {
    padding: 14px;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-dialog,
  .modal-dialog.modal-sm,
  .modal-dialog.modal-lg,
  .modal-dialog.modal-xl {
    max-height: 94vh;
    border-radius: 14px;
  }

  .modal-header {
    padding: 12px 14px;
  }

  .modal-body {
    padding: 14px;
    gap: 14px;
  }

  .diff-grid > .diff-col-head,
  .diff-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .waterfall-header {
    display: none;
  }

  .waterfall-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
  }

  .waterfall-lane {
    grid-column: 1 / -1;
  }

  .audit-hash-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

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

  .kv-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .ping-row {
    grid-template-columns: 110px minmax(0, 1fr) 54px;
  }

  .ws-log-line {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .toast-stack {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
  }
}

/* Print / PDF Report Styling */
@media print {
  body {
    background: #ffffff !important;
    color: #0f172a !important;
  }

  .topbar-actions,
  .action-strip,
  .hint,
  .tooltip-btn,
  .tooltip-bubble {
    display: none !important;
  }

  .detailed-panel {
    display: grid !important;
  }

  .glass-card,
  .check-tile,
  .ip-panel,
  .metric-row,
  .resolver-item,
  .advice-item {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
    box-shadow: none !important;
  }

  .ip-meta-muted,
  .factor-detail,
  .check-tile-desc,
  .metric-key,
  .card-kicker {
    color: #475569 !important;
  }
}
