/* =========================================================
   ScanMyIP — SaaS dashboard aesthetic, purple monochrome
   ========================================================= */

:root {
  /* Neutrals */
  --bg: #f7f7fb;
  --surface: #ffffff;
  --border: #ececf3;
  --border-strong: #e0e0ea;
  --hover: #faf9fc;

  /* Text */
  --text: #1a1a2e;
  --text-muted: #6b6b7d;
  --text-soft: #9999a8;

  /* Brand — single purple, varied shades */
  --purple-50:  #f5f3ff;
  --purple-100: #ede9fe;
  --purple-200: #ddd6fe;
  --purple-400: #a78bfa;
  --purple-500: #8b5cf6;
  --purple-600: #7c3aed;
  --purple-700: #6d28d9;

  /* Functional accents (used sparingly) */
  --green-50:  #ecfdf5;
  --green-500: #10b981;
  --green-700: #047857;

  /* Effects */
  --shadow-card: 0 1px 2px rgba(20, 16, 41, 0.04);
  --shadow-card-hover: 0 4px 16px rgba(20, 16, 41, 0.08);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;

  --max-width: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* =========================================================
   Shared card
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  background: var(--bg);
  padding: 1rem 1.5rem 0;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.logo-img {
  height: 36px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
}

.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  transition: all 0.15s ease;
}

.site-nav a:hover {
  color: var(--purple-700);
  background: var(--purple-50);
}

/* =========================================================
   Main dashboard layout
   ========================================================= */
.dashboard {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* =========================================================
   Hero card — the big IP reveal
   ========================================================= */
.hero-card {
  padding: 1.5rem 1.75rem 2.25rem;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.06), transparent 60%);
  pointer-events: none;
}

.hero-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.hero-card-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--green-500);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.08); }
}

.hero-card-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 500;
}

.hero-card-body {
  text-align: center;
  padding: 0.5rem 0 0;
  position: relative;
  z-index: 1;
}

.ip-kicker {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1.25rem;
  letter-spacing: -0.005em;
}

.protocol-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  background: var(--purple-100);
  color: var(--purple-700);
  border: 1px solid var(--purple-200);
}
.protocol-tag--v4 {
  background: var(--purple-100);
  color: var(--purple-700);
  border-color: var(--purple-200);
}
.protocol-tag--v6 {
  background: var(--green-50);
  color: var(--green-700);
  border-color: #a7f3d0;
}

.ip-display {
  margin-bottom: 1.75rem;
  padding: 0 0.5rem;
}

#ip-value {
  display: inline-block;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-weight: 800;
  font-size: clamp(2.5rem, 11vw, 7.5rem);
  line-height: 1;
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, #7c3aed 0%, #4c1d95 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  padding: 0.1em 0;
  max-width: 100%;
  white-space: nowrap;
}

#ip-value.ip-long {
  font-size: clamp(1rem, 3.4vw, 2.25rem);
  letter-spacing: -0.02em;
  white-space: normal;
  word-break: break-all;
  line-height: 1.2;
  max-width: 95%;
  margin: 0 auto;
  display: block;
}

#ip-value.ip-loading {
  font-size: clamp(1.25rem, 4vw, 2.25rem);
  font-weight: 600;
  background: var(--text-soft);
  -webkit-background-clip: text;
  background-clip: text;
}

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

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.625rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.005em;
}

.btn-primary {
  background: var(--purple-600);
  color: #fff;
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.btn-primary:hover { background: var(--purple-700); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.copied {
  background: var(--green-500);
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.18);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--hover);
  border-color: var(--purple-200);
  color: var(--purple-700);
}

/* =========================================================
   KPI row (4 stat cards)
   ========================================================= */
.kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.8fr 1fr;
  gap: 1rem;
}

.kpi-card--wide {
  /* Just a marker class - the grid handles sizing */
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 1.15rem;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

.kpi-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}

.kpi-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.625rem;
}

.kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.kpi-icon--purple { background: var(--purple-100); color: var(--purple-600); }
.kpi-icon--green  { background: var(--green-50);   color: var(--green-700); }

.kpi-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.kpi-value--mono {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  word-break: break-all;
  line-height: 1.3;
  color: var(--purple-700);
}

.kpi-value--muted {
  color: var(--text-soft);
  font-style: italic;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
}

.kpi-unit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 0.15rem;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.kpi-delta--up {
  background: var(--green-50);
  color: var(--green-700);
}

.kpi-delta--neutral {
  background: var(--purple-50);
  color: var(--purple-700);
}

/* =========================================================
   Section heading
   ========================================================= */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}

.section-head h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.section-link {
  font-size: 0.85rem;
  color: var(--purple-700);
  font-weight: 600;
  transition: opacity 0.15s ease;
}
.section-link:hover { opacity: 0.7; }

/* =========================================================
   Connection details cards
   ========================================================= */
.details-section {
  display: flex;
  flex-direction: column;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.detail-card {
  padding: 1.1rem 1.25rem 1.15rem;
  transition: all 0.2s ease;
}

.detail-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.625rem;
}

.detail-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.detail-value {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 0.35rem;
  word-break: break-word;
  min-height: 1.4em;
}

.detail-meta {
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* =========================================================
   Bottom row — explainer + tools
   ========================================================= */
.bottom-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
}

.explainer-card {
  padding: 1.75rem 1.75rem 2rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple-600);
  background: var(--purple-50);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.explainer-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  color: var(--text);
}

.explainer-card p {
  color: var(--text-muted);
  font-size: 0.97rem;
  margin-bottom: 0.9rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--purple-700);
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 0.5rem;
  transition: gap 0.15s ease;
}
.link-arrow:hover { gap: 0.55rem; }

/* Tools card */
.tools-card { padding: 1.5rem 1.5rem 0.75rem; }

.tools-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.875rem;
}

.tools-head h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.badge-soft {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--purple-700);
  background: var(--purple-50);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

.tools-list {
  list-style: none;
}

.tools-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  transition: background 0.15s ease;
  cursor: pointer;
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: var(--radius-sm);
}

.tools-list li:first-child { border-top: none; }

.tools-list li:hover {
  background: var(--hover);
}

.tool-info { display: flex; flex-direction: column; gap: 0.15rem; }
.tool-info strong { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.tool-info span { font-size: 0.8rem; color: var(--text-muted); }

.tool-arrow {
  color: var(--text-soft);
  font-size: 1.1rem;
  transition: all 0.15s ease;
}

.tools-list li:hover .tool-arrow {
  color: var(--purple-600);
  transform: translateX(2px);
}

/* =========================================================
   Footer
   ========================================================= */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-brand .logo { margin-bottom: 0.75rem; }
.footer-tag {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 320px;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}
.footer-nav a:hover { color: var(--purple-700); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.85rem;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-card--wide { grid-column: span 2; }
  .details-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { padding: 0.75rem 0.75rem 0; }
  .header-inner { padding: 0.45rem 0.65rem 0.45rem 0.75rem; }
  .logo-img { height: 22px; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 0.35rem 0.5rem; font-size: 0.82rem; }

  .dashboard { padding: 1rem 0.75rem 2rem; gap: 0.75rem; }

  .hero-card { padding: 1.25rem 1.25rem 1.75rem; }
  .hero-card-head { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .hero-actions { width: 100%; flex-direction: column; }
  .hero-actions .btn { justify-content: center; width: 100%; }

  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 0.625rem; }
  .kpi-card--wide { grid-column: span 2; }
  .kpi-card { padding: 0.875rem 1rem; }
  .kpi-value { font-size: 1.4rem; }

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

  .explainer-card { padding: 1.5rem 1.25rem; }
  .explainer-card h2 { font-size: 1.35rem; }

  .footer-inner { flex-direction: column; gap: 1.5rem; padding: 2rem 1rem 1.5rem; }
  .footer-brand .logo-img { height: 26px; }
}

@media (max-width: 380px) {
  .logo-img { height: 20px; }
  .site-nav a { padding: 0.3rem 0.4rem; font-size: 0.78rem; }
}

/* =========================================================
   IP Lookup tool — modern hero
   ========================================================= */

/* Override hero card spacing for the lookup tool */
.hero-card .lookup-body {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.lookup-title {
  font-size: clamp(1.85rem, 4.5vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.85rem;
  background: linear-gradient(180deg, var(--text) 0%, #4c1d95 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.lookup-subtitle {
  font-size: clamp(0.98rem, 2vw, 1.1rem);
  color: var(--text-muted);
  margin: 0 auto 2.25rem;
  max-width: 540px;
  line-height: 1.55;
}

/* Large modern search field */
.lookup-form {
  margin: 0 auto 1.5rem;
  max-width: 640px;
}

.lookup-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 16px;
  padding: 0.4rem;
  box-shadow: 0 1px 3px rgba(20, 16, 41, 0.04), 0 4px 24px rgba(124, 58, 237, 0.04);
  transition: all 0.2s ease;
}

.lookup-input-wrap:focus-within {
  border-color: var(--purple-500);
  box-shadow: 0 1px 3px rgba(20, 16, 41, 0.04), 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.lookup-input-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  pointer-events: none;
  transition: color 0.15s ease;
}

.lookup-input-wrap:focus-within .lookup-input-icon {
  color: var(--purple-600);
}

.lookup-input {
  flex: 1;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
  padding: 1.1rem 0.5rem 1.1rem 3.25rem;
  letter-spacing: -0.01em;
  min-width: 0;
}

.lookup-input::placeholder {
  font-weight: 400;
  color: var(--text-soft);
  letter-spacing: 0;
  opacity: 1;
}

/* Large pill submit button inside the search bar */
.lookup-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.95rem 1.5rem;
  background: var(--purple-600);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: -0.005em;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.lookup-submit:hover {
  background: var(--purple-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.lookup-submit:active {
  transform: translateY(0);
}

.lookup-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Error message */
.lookup-error {
  margin: 1rem auto 0;
  padding: 0.75rem 1.1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #b91c1c;
  font-size: 0.9rem;
  text-align: center;
  max-width: 640px;
}

/* Green example chips */
.lookup-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.75rem;
}

.lookup-examples-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 0.15rem;
}

.example-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--green-50);
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 0.4rem 0.95rem 0.4rem 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.example-chip:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.example-chip:active {
  transform: translateY(0);
}

.example-chip-ip {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--green-700);
  letter-spacing: -0.01em;
}

.example-chip-label {
  font-size: 0.78rem;
  color: var(--green-700);
  opacity: 0.8;
  font-weight: 500;
}

/* Loading state */
.lookup-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--purple-100);
  border-top-color: var(--purple-600);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Monospace IP display */
.ip-mono {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--purple-700);
  word-break: break-all;
}

.ip-mono.ip-long {
  font-size: 0.85em;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .hero-card .lookup-body {
    padding: 1.25rem 0.25rem 1rem;
  }

  .lookup-input-wrap {
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.4rem;
  }

  .lookup-input-icon {
    left: 1rem;
    top: 1.55rem;
    transform: none;
  }

  .lookup-input {
    width: 100%;
    padding: 0.85rem 0.5rem 0.85rem 2.75rem;
    font-size: 1rem;
    text-align: left;
  }

  .lookup-submit {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.25rem;
  }

  .lookup-examples {
    gap: 0.5rem;
  }

  .lookup-examples-label {
    width: 100%;
    text-align: center;
    margin-bottom: 0.25rem;
    margin-right: 0;
  }

  .example-chip {
    padding: 0.35rem 0.75rem 0.35rem 0.7rem;
  }

  .example-chip-ip {
    font-size: 0.82rem;
  }

  .example-chip-label {
    font-size: 0.72rem;
  }
}

/* =========================================================
   WebRTC Leak Test specific styles
   ========================================================= */

/* Status banner */
.status-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.status-banner[hidden] { display: none !important; }

.status-banner--running {
  background: var(--purple-50);
  border-color: var(--purple-200);
}
.status-banner--running .status-banner-icon { color: var(--purple-600); animation: spin 1.5s linear infinite; }

.status-banner--safe {
  background: var(--green-50);
  border-color: #a7f3d0;
}
.status-banner--safe .status-banner-icon { color: var(--green-700); }

.status-banner--leak {
  background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
  border-color: #f87171;
  border-width: 1.5px;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.12), 0 8px 24px rgba(239, 68, 68, 0.1);
  padding: 1.15rem 1.4rem;
}
.status-banner--leak .status-banner-icon {
  background: #dc2626;
  color: #fff;
}
.status-banner--leak .status-banner-text strong {
  color: #991b1b;
  font-size: 1.1rem;
}
.status-banner--leak .status-banner-text span {
  color: #b91c1c;
  font-weight: 500;
}

.status-banner--partial {
  background: #fffbeb;
  border-color: #fde68a;
}
.status-banner--partial .status-banner-icon { color: #b45309; }

.status-banner--error {
  background: #fef2f2;
  border-color: #fecaca;
}
.status-banner--error .status-banner-icon { color: #b91c1c; }

.status-banner-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.7);
  border-radius: 50%;
}

.status-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.status-banner-text strong {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.status-banner-text span {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* IP list */
.webrtc-ip-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.webrtc-no-ips {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
}

.webrtc-ip-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
}

.webrtc-ip-group--leak {
  background: #fef2f2;
  border-color: #fecaca;
}

.webrtc-ip-group--local {
  background: var(--bg);
  border-color: var(--border-strong);
}

.webrtc-ip-group-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  color: var(--text);
  font-size: 1.05rem;
}

.webrtc-ip-group--leak .webrtc-ip-group-header {
  color: #b91c1c;
}

.webrtc-ip-group-header strong {
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
}

.webrtc-ip-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.webrtc-ip-item:first-of-type { border-top: none; padding-top: 0.25rem; }

.webrtc-ip {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text);
  word-break: break-all;
  letter-spacing: -0.01em;
}

.webrtc-ip-group--leak .webrtc-ip {
  color: #991b1b;
}

.webrtc-ip-label {
  flex-shrink: 0;
  margin-left: 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0,0,0,0.06);
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  color: var(--text-muted);
}

.webrtc-ip-group--leak .webrtc-ip-label {
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
}

/* Down delta for leak indication */
.kpi-delta--down {
  background: #fef2f2;
  color: #b91c1c;
}

@media (max-width: 640px) {
  .status-banner { padding: 0.85rem 1rem; }
  .status-banner-icon { width: 32px; height: 32px; }
  .status-banner-text strong { font-size: 0.95rem; }
  .webrtc-ip-item { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .webrtc-ip-label { margin-left: 0; }
}

/* =========================================================
   WebRTC start button — premium hero CTA
   ========================================================= */
.webrtc-start-wrap {
  text-align: center;
  margin-top: 0.5rem;
}

.webrtc-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.015em;
  color: #fff;
  background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 100%);
  border: none;
  border-radius: 14px;
  padding: 1.15rem 2.5rem;
  cursor: pointer;
  box-shadow:
    0 2px 4px rgba(124, 58, 237, 0.18),
    0 8px 24px rgba(124, 58, 237, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.webrtc-start-btn:hover {
  background: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%);
  transform: translateY(-2px);
  box-shadow:
    0 4px 8px rgba(124, 58, 237, 0.22),
    0 12px 32px rgba(124, 58, 237, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.webrtc-start-btn:active {
  transform: translateY(0);
  box-shadow:
    0 1px 2px rgba(124, 58, 237, 0.2),
    0 4px 12px rgba(124, 58, 237, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.webrtc-start-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
}

.webrtc-start-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.2s ease;
}

.webrtc-start-btn:hover .webrtc-start-icon {
  background: rgba(255, 255, 255, 0.25);
}

.webrtc-start-icon svg {
  margin-left: 2px; /* visual centering of play triangle */
}

.webrtc-start-label {
  display: inline-block;
}

.webrtc-start-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-soft);
  letter-spacing: -0.005em;
}

@media (max-width: 640px) {
  .webrtc-start-btn {
    width: 100%;
    justify-content: center;
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
}

/* =========================================================
   IP change banner (homepage)
   ========================================================= */
.ip-change-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1.5px solid var(--purple-300);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 4px rgba(124, 58, 237, 0.06), 0 8px 24px rgba(124, 58, 237, 0.08);
  margin: 0;
  animation: ip-change-slide-in 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ip-change-banner[hidden] { display: none !important; }

@keyframes ip-change-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ip-change-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple-600);
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.ip-change-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.ip-change-text strong {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--purple-700);
  letter-spacing: -0.01em;
}

.ip-change-text span {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.ip-change-text code {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(124, 58, 237, 0.08);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  color: var(--purple-700);
  font-weight: 600;
}

.ip-change-dismiss {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ip-change-dismiss:hover {
  background: rgba(124, 58, 237, 0.08);
  color: var(--purple-700);
}

/* =========================================================
   Visit history card
   ========================================================= */
.visit-history-card {
  padding: 1.5rem 1.75rem;
}

.visit-history-card[hidden] { display: none !important; }

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

.visit-history-head h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.visit-history-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.btn-text {
  background: none;
  border: none;
  color: var(--purple-700);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.btn-text:hover { background: var(--purple-50); }

.visit-history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.visit-history-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
}

.visit-history-item:first-child { border-top: none; padding-top: 0.4rem; }

.visit-row-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.visit-ip {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  word-break: break-all;
  background: none;
  padding: 0;
}

.visit-ip--v6 { font-size: 0.92rem; }

.visit-history-item--current .visit-ip {
  color: var(--purple-700);
}

.visit-badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.visit-badge--current {
  background: var(--green-100);
  color: var(--green-700);
}

.visit-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.visit-row-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.visit-isp {
  color: var(--text-soft);
}

.visit-isp::before {
  content: "·";
  margin-right: 0.3rem;
  color: var(--text-soft);
}

.visit-time::before {
  content: "·";
  margin-right: 0.3rem;
  color: var(--text-soft);
}

@media (max-width: 640px) {
  .ip-change-banner { padding: 0.85rem 1rem; gap: 0.75rem; }
  .ip-change-icon { width: 32px; height: 32px; }
  .ip-change-text strong { font-size: 0.95rem; }
  .ip-change-text span { font-size: 0.82rem; }

  .visit-history-card { padding: 1.25rem; }
  .visit-history-head { flex-direction: column; gap: 0.5rem; }
  .visit-row-main { flex-wrap: wrap; }
  .visit-row-meta { gap: 0.4rem; font-size: 0.78rem; }
  .visit-isp::before, .visit-time::before { display: none; }
}

/* =========================================================
   PWA install button + banner
   ========================================================= */

/* Install button in nav */
.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--purple-600);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.95rem 0.45rem 0.75rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 0.5rem;
  letter-spacing: -0.005em;
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.2);
  transition: all 0.15s ease;
}

.pwa-install-btn[hidden] { display: none !important; }

.pwa-install-btn:hover {
  background: var(--purple-700);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

.pwa-install-btn:active { transform: translateY(0); }

/* Install banner (full-width below header) */
.pwa-banner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1.5px solid var(--purple-300);
  border-radius: var(--radius);
  padding: 0.95rem 1.25rem;
  margin: 0;
  box-shadow: 0 2px 4px rgba(124, 58, 237, 0.06), 0 8px 24px rgba(124, 58, 237, 0.08);
  animation: pwa-banner-in 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-banner[hidden] { display: none !important; }

@keyframes pwa-banner-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pwa-banner-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple-600);
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.pwa-banner-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.pwa-banner-body strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--purple-700);
  letter-spacing: -0.01em;
}

.pwa-banner-body span {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.pwa-banner-cta {
  flex-shrink: 0;
  background: var(--purple-600);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.2);
}

.pwa-banner-cta:hover {
  background: var(--purple-700);
  transform: translateY(-1px);
}

.pwa-banner-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pwa-banner-close:hover {
  background: rgba(124, 58, 237, 0.08);
  color: var(--purple-700);
}

@media (max-width: 640px) {
  .pwa-install-btn span { display: none; } /* Icon only on small screens */
  .pwa-install-btn { padding: 0.45rem 0.6rem; }

  .pwa-banner {
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    gap: 0.65rem;
  }
  .pwa-banner-body { flex: 1 1 100%; order: 2; }
  .pwa-banner-icon { order: 1; }
  .pwa-banner-cta { order: 3; flex: 1; }
  .pwa-banner-close { order: 4; }
  .pwa-banner-body strong { font-size: 0.9rem; }
  .pwa-banner-body span { font-size: 0.8rem; }
}

/* =========================================================
   PWA install modal (custom, replaces native browser alerts)
   ========================================================= */
.pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: pwa-modal-fade 0.18s ease-out;
}

.pwa-modal[hidden] { display: none !important; }

@keyframes pwa-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pwa-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 12, 35, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pwa-modal-content {
  position: relative;
  background: var(--surface);
  border-radius: 18px;
  padding: 2rem 2rem 1.5rem;
  max-width: 460px;
  width: 100%;
  box-shadow:
    0 4px 12px rgba(15, 12, 35, 0.1),
    0 24px 48px rgba(15, 12, 35, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  animation: pwa-modal-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

@keyframes pwa-modal-pop {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.pwa-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.pwa-modal-close:hover {
  background: var(--purple-50);
  color: var(--purple-700);
}

.pwa-modal-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--purple-500) 0%, var(--purple-700) 100%);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  margin-bottom: 1.25rem;
}

.pwa-modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0 0 1rem 0;
  line-height: 1.2;
}

.pwa-modal-body {
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.pwa-modal-body p {
  margin: 0 0 0.85rem;
}

.pwa-modal-body p:last-child { margin-bottom: 0; }

.pwa-modal-body strong { color: var(--text); font-weight: 600; }

.pwa-modal-steps {
  margin: 0 0 1rem 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pwa-modal-steps li {
  color: var(--text);
  line-height: 1.5;
}

.pwa-modal-steps li::marker {
  color: var(--purple-600);
  font-weight: 700;
}

.pwa-inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--purple-50);
  color: var(--purple-700);
  border-radius: 6px;
  vertical-align: middle;
  margin: 0 0.2rem;
}

.pwa-modal-note {
  background: var(--bg);
  border-left: 3px solid var(--purple-300);
  padding: 0.7rem 0.95rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.pwa-modal-body kbd {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.82em;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 1px 0 var(--border);
  margin: 0 0.1rem;
}

.pwa-modal-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.pwa-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: all 0.15s ease;
}

.pwa-modal-btn--primary {
  background: var(--purple-600);
  color: #fff;
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pwa-modal-btn--primary:hover {
  background: var(--purple-700);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pwa-modal-btn--primary:active { transform: translateY(0); }

@media (max-width: 540px) {
  .pwa-modal-content {
    padding: 1.5rem 1.4rem 1.25rem;
    border-radius: 14px;
  }
  .pwa-modal-title { font-size: 1.2rem; }
  .pwa-modal-body { font-size: 0.92rem; }
  .pwa-modal-icon { width: 44px; height: 44px; margin-bottom: 1rem; }
  .pwa-modal-btn { width: 100%; }
  .pwa-modal-actions { flex-direction: column; }
}
