:root {
  --paper: #fbfbf9;
  --sheet: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --rule: #e5e7eb;
  --rule-2: #d4d4d0;
  --grid: rgba(15, 23, 42, 0.045);
  --arin: #3b82f6;
  --ripe: #ef4444;
  --apnic: #10b981;
  --lacnic: #f59e0b;
  --afrinic: #f97316;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  --r: 6px;
  --r-lg: 10px;
  --pad: clamp(16px, 4vw, 40px);
  --maxw: 1200px;

  /* Compatibility aliases for subpages */
  --background: 48 20% 98%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --secondary: 60 9% 96%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 60 9% 96%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 60 9% 94%;
  --destructive: 0 84.2% 60.2%;
  --border: 220 13% 91%;
  --input: 214.3 31.8% 85%;
  --ring: 222.2 47.4% 11.2%;
  --radius: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img,
svg,
pre,
table {
  max-width: 100%;
}

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

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.atlas {
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Sticky topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 3000;
  height: 56px;
  background: rgba(251, 251, 249, 0.9);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--rule);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font: 600 15px/1 var(--mono);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  gap: 2px;
}

.brand-mark i {
  display: block;
  width: 5px;
  height: 12px;
  border-radius: 1px;
}

.brand-ver {
  font: 500 11px/1 var(--mono);
  color: var(--ink-3);
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  padding: 3px 7px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  font: 500 13px/1 var(--sans);
  padding: 7px 10px;
  border-radius: var(--r);
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}

.nav a:hover {
  background: #f0f0ec;
  color: var(--ink);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  border-radius: var(--r);
  font: 500 13.5px/1 var(--sans);
  padding: 10px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn-ink,
.btn-primary {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.btn-ink:hover,
.btn-primary:hover {
  background: #1e293b;
}

.btn-line,
.btn-secondary {
  background: var(--sheet);
  color: var(--ink);
  border-color: var(--rule-2);
}

.btn-line:hover,
.btn-secondary:hover {
  background: #f4f4f0;
}

/* Typography helpers */
.eyebrow {
  margin: 0;
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 48px;
  padding-block: 64px 56px;
  align-items: start;
}

.hero-copy h1 {
  font-size: clamp(32px, 4.6vw, 50px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 12px 0 16px;
  text-wrap: balance;
}

.lead {
  font-size: 16.5px;
  color: var(--ink-2);
  max-width: 52ch;
  margin: 0 0 24px;
}

.cmd-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 450px;
}

.cmd {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule-2);
  background: var(--sheet);
  border-radius: var(--r);
  padding: 6px 6px 6px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.cmd code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font: 500 13.5px/1.4 var(--mono);
  color: var(--ink);
}

.cmd code::before {
  content: "$ ";
  color: var(--ink-3);
}

.copy-btn {
  font: 500 12px/1 var(--mono);
  padding: 7px 10px;
  border-radius: 4px;
  border: 1px solid var(--rule-2);
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}

.copy-btn:hover {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  margin: 28px 0 0;
}

.stats div {
  padding: 14px 12px 0 0;
  border-right: 1px solid var(--rule);
}

.stats div:not(:first-child) {
  padding-left: 16px;
}

.stats div:last-child {
  border-right: 0;
}

.stats dt {
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.stats dd {
  margin: 4px 0 0;
  font: 600 20px/1.2 var(--mono);
  color: var(--ink);
}

/* Visitor Probe Widget */
.probe {
  background: var(--sheet);
  border: 1px solid var(--rule-2);
  border-radius: var(--r-lg);
  padding: 20px;
  --rir: var(--ink-3);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.probe[data-rir="ARIN"] { --rir: var(--arin); }
.probe[data-rir="RIPE"],
.probe[data-rir="RIPE NCC"] { --rir: var(--ripe); }
.probe[data-rir="APNIC"] { --rir: var(--apnic); }
.probe[data-rir="LACNIC"] { --rir: var(--lacnic); }
.probe[data-rir="AFRINIC"] { --rir: var(--afrinic); }

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

.rir-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 11px/1 var(--mono);
  color: var(--ink-2);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.rir-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rir);
}

.probe-ip {
  font: 500 clamp(17px, 2.4vw, 23px)/1.3 var(--mono);
  overflow-wrap: anywhere;
  margin: 10px 0 14px;
  color: var(--ink);
}

.probe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  overflow: hidden;
  margin: 0;
}

.probe-grid > div {
  background: var(--sheet);
  padding: 10px 12px;
  min-width: 0;
}

.probe-grid dt {
  font: 500 10.5px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.probe-grid dd {
  margin: 3px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.probe-divider {
  height: 1px;
  background: var(--rule);
  margin: 16px 0;
}

.probe-form label {
  display: block;
  margin-bottom: 8px;
}

.field {
  display: flex;
  gap: 8px;
}

.field input {
  flex: 1;
  min-width: 0;
  font: 14px/1 var(--mono);
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--rule-2);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink);
}

.field input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.samples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.samples button {
  font: 11.5px/1 var(--mono);
  padding: 5px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.samples button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.probe-result {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--rule-2);
}

.probe-error {
  margin: 8px 0 0;
  font: 500 12.5px/1.4 var(--mono);
  color: #dc2626;
}

/* Map Plate */
#map-plate {
  padding-block: 56px;
  border-block: 1px solid var(--rule);
  background-color: var(--sheet);
}

.plate-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.plate-head h2,
.docs h2 {
  font-size: clamp(22px, 2.8vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-weight: 700;
  margin: 6px 0 0;
}

.map-frame {
  position: relative;
  border: 1px solid var(--rule-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #f4f5f2;
}

.map-frame::before {
  content: "";
  position: absolute;
  z-index: 500;
  pointer-events: none;
  inset: 0;
  background: repeating-linear-gradient(90deg, var(--rule-2) 0 1px, transparent 1px 40px) top/100% 6px no-repeat,
    repeating-linear-gradient(0deg, var(--rule-2) 0 1px, transparent 1px 40px) left/6px 100% no-repeat;
}

#map {
  height: clamp(400px, 60vh, 620px);
  width: 100%;
  background: #f4f5f2;
}

.leaflet-container {
  font-family: var(--sans);
}

.info-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  width: min(320px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow: auto;
  background: var(--sheet);
  border: 1px solid var(--rule-2);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  display: none;
  animation: rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.info-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.info-content p {
  margin: 0 0 6px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.status-indicators {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.status-badge {
  padding: 2px 7px;
  border-radius: 4px;
  font: 500 11.5px/1.3 var(--mono);
}

.status-exhausted {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.status-actively-allocated {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.status-available {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.legend-strip {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  overflow: hidden;
}

.legend-strip li {
  background: var(--sheet);
  padding: 10px 12px;
  min-width: 0;
}

.legend-strip b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 600 12px/1.3 var(--mono);
  color: var(--ink);
}

.legend-strip b::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  flex-shrink: 0;
}

.legend-strip span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.map-hint {
  margin: 10px 0 0;
  font: 400 12px/1.4 var(--mono);
  color: var(--ink-3);
}

/* Leaflet popups & country labels */
.leaflet-popup-content-wrapper {
  border-radius: var(--r-lg);
  border: 1px solid var(--rule-2);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.popup-content {
  min-width: 240px;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.popup-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.popup-rir {
  font: 600 12px/1 var(--mono);
}

.popup-body p {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--ink-2);
}

.ip-info {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.ip-section h4 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
}

.ip-section .description {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
}

.view-patterns-btn {
  margin-top: 12px;
  width: 100%;
  padding: 8px 12px;
  background: var(--ink);
  color: #ffffff;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  font: 500 13px/1 var(--sans);
  cursor: pointer;
}

.view-patterns-btn:hover {
  background: #1e293b;
}

.country-label {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.country-name {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: #1e293b;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.95),
    -1px -1px 2px rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  pointer-events: none;
  text-align: center;
  line-height: 1;
  display: block;
  transform: translate(-50%, -50%);
}

.leaflet-interactive:hover {
  fill-opacity: 0.92 !important;
  stroke-width: 2.5 !important;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(2px);
  z-index: 4000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: var(--sheet);
  border: 1px solid var(--rule-2);
  border-radius: var(--r-lg);
  max-width: 760px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  animation: rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: var(--sheet);
  z-index: 1;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--ink);
  color: #ffffff;
}

.modal-body {
  padding: 20px;
}

.address-section {
  margin-bottom: 24px;
}

.address-section h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.status-info {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.allocation-info,
.description {
  font-size: 13.5px;
  color: var(--ink-2);
}

.range-category {
  margin-bottom: 8px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  overflow: hidden;
}

.range-category-toggle {
  width: 100%;
  padding: 10px 12px;
  background: var(--paper);
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font: 500 13px/1.3 var(--sans);
  color: var(--ink);
}

.category-name {
  flex: 1;
  text-align: left;
}

.range-count {
  font: 400 12px var(--mono);
  color: var(--ink-3);
}

.range-list .address-item {
  padding: 6px 12px;
  border-top: 1px solid var(--rule);
  font: 12.5px/1.4 var(--mono);
}

.rir-overview {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.rir-card {
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.rir-card h3 {
  margin: 0 0 2px;
  font: 600 14px var(--mono);
}

.rir-card h4 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
}

.rir-card p {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--ink-2);
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.status-card {
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.status-card h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

.status-card p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}

.test-ip-section {
  margin-top: 20px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  text-align: center;
}

.test-ip-btn {
  display: inline-flex;
  padding: 9px 14px;
  background: var(--ink);
  color: #ffffff;
  text-decoration: none;
  border-radius: var(--r);
  font: 500 13px/1 var(--sans);
}

/* Docs Section */
.docs {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 56px;
  padding-block: 64px 72px;
}

.toc {
  position: sticky;
  top: 76px;
  align-self: start;
  font: 500 12.5px/1.4 var(--mono);
  border-left: 1px solid var(--rule);
}

.toc a {
  display: block;
  padding: 7px 14px;
  color: var(--ink-3);
  text-decoration: none;
  margin-left: -1px;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.toc a:hover,
.toc a[aria-current="true"] {
  color: var(--ink);
  border-left-color: var(--ink);
}

.prose {
  min-width: 0;
  max-width: 78ch;
}

.doc-block {
  scroll-margin-top: 76px;
  margin-bottom: 56px;
}

.doc-block:last-child {
  margin-bottom: 0;
}

.doc-block > p {
  color: var(--ink-2);
  margin: 10px 0 18px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.spec-grid > div {
  background: var(--sheet);
  padding: 18px;
}

.spec-grid h3 {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 600;
}

.spec-grid p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--sheet);
}

.data-table,
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th,
.data-table td,
.comparison-table th,
.comparison-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}

.data-table th,
.comparison-table th {
  background: var(--paper);
  font: 600 12px/1.3 var(--mono);
  color: var(--ink);
}

.data-table tr:last-child td,
.comparison-table tr:last-child td {
  border-bottom: 0;
}

.data-table td,
.comparison-table td {
  color: var(--ink-2);
}

.data-table code {
  font: 500 12.5px var(--mono);
  color: var(--ink);
}

/* Recipe Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.tabs button {
  font: 500 12.5px/1 var(--mono);
  padding: 12px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
}

.tabs button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.code-panel {
  position: relative;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding: 18px 20px;
  font: 13px/1.65 var(--mono);
  overflow-x: auto;
  animation: fadeIn 0.15s ease;
}

.code-panel.standalone {
  border-radius: var(--r-lg);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

.code-panel pre {
  margin: 0;
  white-space: pre;
  overflow-x: auto;
}

.code-panel .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.18);
}

.code-panel .copy-btn:hover {
  background: #ffffff;
  color: #0f172a;
}

.code-panel .c { color: #94a3b8; }
.code-panel .k { color: #93c5fd; }
.code-panel .s { color: #86efac; }

/* More links grid */
.more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.more-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 16px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s;
}

.more-card:hover {
  border-color: var(--ink);
}

.more-card .arrow {
  display: inline-block;
  transition: transform 0.15s;
}

.more-card:hover .arrow {
  transform: translateX(3px);
}

.more-card strong {
  font-size: 14.5px;
  font-weight: 600;
}

.more-card p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}

/* Footer */
.footer {
  border-top: 1px solid var(--rule);
  padding: 24px var(--pad);
  text-align: center;
  background: var(--paper);
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font: 500 13px/1.4 var(--mono);
  color: var(--ink-3);
}

.footer-link {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-2);
}

.footer-link:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* Subpage compatibility styles (check.html, format.html, interview-prep.html) */
.header {
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
  padding: 24px var(--pad);
}

.header-content {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.header-text h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-text p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.main-content {
  flex: 1;
  padding: 32px var(--pad);
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.ip-test-card,
.location-info,
.rir-info,
.format-section,
.subnet-info {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.ip-test-card h2,
.format-section h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
}

.lookup-form {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.lookup-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--rule-2);
  border-radius: var(--r);
  font: 14px var(--mono);
  background: var(--paper);
}

.lookup-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.ip-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.ip-info-item {
  text-align: center;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.ip-info-item h3 {
  margin: 0 0 6px;
  font: 500 11.5px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.ip-address {
  font: 600 16px var(--mono);
  margin: 0;
  word-break: break-all;
}

.loading {
  color: var(--ink-3);
  font-style: italic;
}

.error {
  color: #dc2626;
}

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

.location-item {
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.location-item strong {
  display: block;
  font: 500 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.location-item span {
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.rir-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r);
  font: 600 13px var(--mono);
  margin-bottom: 10px;
}

.rir-color-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.refresh-btn {
  width: 100%;
  padding: 11px 16px;
  background: var(--ink);
  color: #ffffff;
  border: 0;
  border-radius: var(--r);
  font: 500 13.5px var(--sans);
  cursor: pointer;
}

.format-badge {
  background: var(--ink);
  color: #ffffff;
  padding: 3px 7px;
  border-radius: 4px;
  font: 500 11.5px var(--mono);
}

.examples-grid {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.example-item {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 14px;
  min-width: 0;
}

.example-item h5 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
}

.example-code,
.promo-code {
  font: 13px/1.45 var(--mono);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 10px 12px;
  overflow-x: auto;
  white-space: nowrap;
}

.format-rules {
  background: var(--paper);
  border-left: 3px solid var(--ink);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 14px 16px;
  margin: 14px 0;
}

.format-rules h5 {
  margin: 0 0 6px;
  font-size: 13px;
}

.format-rules ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
}

.promo-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 1023px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-block: 36px 40px;
  }
  .docs {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-block: 44px;
  }
  .toc {
    position: static;
    display: flex;
    overflow-x: auto;
    border-left: 0;
    border-bottom: 1px solid var(--rule);
    scrollbar-width: none;
  }
  .toc a {
    border-left: 0;
    border-bottom: 2px solid transparent;
    margin-left: 0;
    white-space: nowrap;
  }
  .toc a[aria-current="true"] {
    border-bottom-color: var(--ink);
  }
}

@media (max-width: 720px) {
  .nav a:not(.nav-keep) {
    display: none;
  }
  .legend-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .legend-strip li:last-child {
    grid-column: 1 / -1;
  }
  #map {
    height: 60svh;
    min-height: 340px;
  }
  .info-panel {
    position: static;
    width: auto;
    max-height: none;
    border-width: 1px 0 0;
    border-radius: 0;
  }
  .field,
  .lookup-form {
    flex-direction: column;
  }
  .field input,
  .lookup-input {
    font-size: 16px;
  }
  .field .btn {
    width: 100%;
  }
  .spec-grid,
  .status-grid,
  .ip-info-grid {
    grid-template-columns: 1fr;
  }
  .stats dd {
    font-size: 17px;
  }
  .country-name {
    font-size: 0.52rem !important;
  }
}
