/* Inter and IBM Plex Mono, bundled (SIL Open Font License; see fonts/OFL-*.txt). */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/plex-mono-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/plex-mono-500-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --page: #f2f4f3;
  --surface: #fcfcfb;
  --ink: #102030;
  --ink-2: #46535f;
  --muted: #6c7781;
  --rule: #d9dfdc;
  --rule-2: #c3cac7;
  --hover: #e8edef;
  --link: #1c5cab;
  --focus: #2a78d6;
  --here: #eb6834;
  --bar: #2a78d6;
  --tip-bg: #102030;
  --tip-ink: #f2f4f3;
  --error: #c42f2f;

  /* address map: share of a block that is routed */
  --m0: #e2e6e5;
  --m1: #b7d3f6;
  --m2: #6da7ec;
  --m3: #2a78d6;
  --m4: #184f95;
  --t0: #6c7781;
  --t1: #102030;
  --t2: #102030;
  --t3: #ffffff;
  --t4: #ffffff;
  --hatch: #c3cac7;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0f1418;
    --surface: #161c21;
    --ink: #e9edf0;
    --ink-2: #b4bec6;
    --muted: #87929b;
    --rule: #263038;
    --rule-2: #36414a;
    --hover: #1d252c;
    --link: #86b6ef;
    --focus: #5598e7;
    --here: #f0814f;
    --bar: #3987e5;
    --tip-bg: #e9edf0;
    --tip-ink: #0f1418;
    --error: #f07a7a;
    --m0: #222a30;
    --m1: #184f95;
    --m2: #256abf;
    --m3: #3987e5;
    --m4: #86b6ef;
    --t0: #87929b;
    --t1: #ffffff;
    --t2: #ffffff;
    --t3: #0f1418;
    --t4: #0f1418;
    --hatch: #36414a;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f1418;
  --surface: #161c21;
  --ink: #e9edf0;
  --ink-2: #b4bec6;
  --muted: #87929b;
  --rule: #263038;
  --rule-2: #36414a;
  --hover: #1d252c;
  --link: #86b6ef;
  --focus: #5598e7;
  --here: #f0814f;
  --bar: #3987e5;
  --tip-bg: #e9edf0;
  --tip-ink: #0f1418;
  --error: #f07a7a;
  --m0: #222a30;
  --m1: #184f95;
  --m2: #256abf;
  --m3: #3987e5;
  --m4: #86b6ef;
  --t0: #87929b;
  --t1: #ffffff;
  --t2: #ffffff;
  --t3: #0f1418;
  --t4: #0f1418;
  --hatch: #36414a;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(28px, 3.2vw, 40px); letter-spacing: -0.025em; overflow-wrap: anywhere; }
h2 { font-size: 19px; }
p { margin: 0; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--ink); color: var(--page); padding: 8px 12px; z-index: 10; }
.skip:focus { top: 8px; }
.num, .tnum { font-variant-numeric: tabular-nums; }

/* ---------- header */

.top { border-bottom: 1px solid var(--rule); background: var(--page); }
.top-inner { display: flex; align-items: center; gap: 12px 28px; min-height: 64px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.mark {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em;
}
.mark svg { width: 20px; height: 20px; }
.nav { display: flex; flex-wrap: wrap; gap: 2px 22px; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-weight: 550; white-space: nowrap;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }
.lookup-top { margin-left: auto; width: min(380px, 100%); }
body[data-route="home"] .lookup-top { display: none; }

/* ---------- lookup */

.lookup {
  display: flex; background: var(--surface);
  border: 1px solid var(--rule-2); border-radius: 8px; overflow: hidden;
}
.lookup:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.lookup input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: inherit;
  font: inherit; padding: 8px 12px; outline: none;
}
.lookup input::placeholder { color: var(--muted); }
.lookup button {
  border: 0; background: var(--ink); color: var(--page); cursor: pointer;
  font: inherit; font-weight: 600; padding: 0 16px;
}
.lookup button:hover { background: var(--ink-2); }
.lookup-big input { font-size: 19px; padding: 15px 16px; }
.lookup-big button { font-size: 16px; padding: 0 24px; }
.lookup:has([aria-invalid]) { border-color: var(--error); }
.form-error { margin-top: 8px; color: var(--error); font-size: 14px; }
.top-inner { position: relative; }
.top-inner > .form-error {
  position: absolute; right: 24px; top: calc(100% - 4px); z-index: 5; max-width: 340px; margin: 0;
  padding: 8px 11px; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--surface);
}

/* ---------- page furniture */

main { padding-top: 40px; padding-bottom: 72px; min-height: 60vh; transition: opacity .15s; }
main.loading { opacity: .45; }
main section:not(:first-child) { margin-top: 56px; }
.lede { font-size: 18px; line-height: 1.5; color: var(--ink-2); max-width: 66ch; margin-top: 12px; }
.lede strong { color: var(--ink); font-weight: 600; }
.meta { color: var(--muted); margin-top: 8px; }
.note { color: var(--muted); font-size: 13px; margin-top: 10px; max-width: 72ch; }
.more { display: inline-block; margin-top: 14px; font-weight: 550; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head p { color: var(--muted); font-size: 14px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--ink-2); }
.crumbs span[aria-hidden] { color: var(--rule-2); }

.button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink);
  border-radius: 6px; padding: 7px 12px; font: inherit; font-size: 14px; font-weight: 550;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.button:hover { background: var(--hover); text-decoration: none; }

/* ---------- home */

.intro { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px 64px; align-items: start; }
.intro h1 { font-size: clamp(32px, 3.8vw, 48px); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; max-width: 13ch; margin-bottom: 28px; }
.try { margin-top: 12px; color: var(--muted); font-size: 14px; }
.figure { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--rule); }
.hero-num {
  font-size: clamp(48px, 6vw, 80px); font-weight: 700;
  line-height: 1; letter-spacing: -0.045em;
}
.figure .lede { font-size: 19px; margin-top: 14px; }
.figure .lede + .lede { font-size: 16px; margin-top: 10px; }
.intro-map { margin: 0; }
.intro-map figcaption { margin-bottom: 14px; }
.intro-map figcaption p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 48px; }
.cols h2 { margin-bottom: 4px; }
.cols .sub { color: var(--muted); font-size: 14px; }

/* ---------- address map */

.grid { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 2px; }
.cell {
  position: relative; aspect-ratio: 1; display: flex; align-items: flex-end;
  padding: 3px 4px; border-radius: 2px; text-decoration: none; line-height: 1;
  font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums;
  background: var(--m0); color: var(--t0);
}
.cell[data-bin="1"] { background: var(--m1); color: var(--t1); }
.cell[data-bin="2"] { background: var(--m2); color: var(--t2); }
.cell[data-bin="3"] { background: var(--m3); color: var(--t3); }
.cell[data-bin="4"] { background: var(--m4); color: var(--t4); }
.cell[data-bin="r"] { background: repeating-linear-gradient(45deg, var(--m0) 0 4px, var(--hatch) 4px 5px); }
.cell:hover { outline: 2px solid var(--ink); outline-offset: 0; z-index: 1; }
.cell:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; z-index: 2; border-radius: 2px; }
.cell[data-here] { outline: 3px solid var(--here); outline-offset: 1px; z-index: 2; }

@media (prefers-reduced-motion: no-preference) {
  .grid .cell { animation: cell-in .45s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--d) * 16ms); }
}
@keyframes cell-in { from { opacity: 0; transform: scale(.55); } }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 14px 0 0; padding: 0; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 7px; }
.sw { width: 12px; height: 12px; border-radius: 2px; background: var(--m0); }
.sw[data-bin="1"] { background: var(--m1); }
.sw[data-bin="2"] { background: var(--m2); }
.sw[data-bin="3"] { background: var(--m3); }
.sw[data-bin="4"] { background: var(--m4); }
.sw[data-bin="r"] { background: repeating-linear-gradient(45deg, var(--m0) 0 3px, var(--hatch) 3px 4px); }

/* A block with reserved space inside it, like 192.0.0.0/8 holding 192.168.0.0/16. */
.cell[data-part]::after, .sw[data-part]::after {
  content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 0 0 1.5px var(--ink);
}
.sw[data-part] { position: relative; }

.map-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px 56px; margin-top: 32px; align-items: start; }
.map-layout figure { margin: 0; }
.map-layout figcaption { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* ---------- bar lists (single series, value at the bar tip) */

.bars { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: rank; }
.bars li { counter-increment: rank; }
.bars a {
  display: grid; grid-template-columns: 1.6rem minmax(0, 10.5rem) minmax(0, 1fr);
  align-items: center; gap: 10px; padding: 5px 6px 5px 0; border-radius: 4px;
  color: inherit; text-decoration: none;
}
.bars a::before { content: counter(rank); text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.bars a:hover { background: var(--hover); }
.bar-label { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.bar-name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar { flex: none; height: 14px; width: calc((100% - 4.25rem) * var(--w)); min-width: 2px; background: var(--bar); border-radius: 0 4px 4px 0; }
.bar-value { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- tables */

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th {
  text-align: left; font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--rule); white-space: nowrap;
}
td { padding: 9px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
th.num, td.num { text-align: right; white-space: nowrap; }
td.rank { color: var(--muted); width: 1%; }
.net { text-decoration: none; color: inherit; display: inline-flex; flex-direction: column; line-height: 1.3; }
.net b { font-weight: 600; color: var(--link); }
.net:hover b { text-decoration: underline; text-underline-offset: 3px; }
.net small { color: var(--muted); font-size: 12.5px; }
.asn-tag { color: var(--muted); font-size: 12.5px; }
tr.current td { background: color-mix(in srgb, var(--bar) 9%, transparent); }
.share { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.mini { width: 56px; height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; display: inline-block; }
.mini span { display: block; height: 100%; width: calc(var(--w) * 100%); min-width: 1px; background: var(--bar); }
.cidr, .addr-range, .mono { font-family: var(--mono); font-size: 0.93em; }
.cidr { font-weight: 500; }
.addr-range { color: var(--ink-2); }

.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; margin: 24px 0 18px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 550; }
.filters input, .filters select {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule-2); border-radius: 6px; padding: 0 10px; height: 38px; min-width: 0;
}
.filters .button { height: 38px; }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.filters .grow { flex: 1 1 260px; }
.filters .end { margin-left: auto; }
.summary { margin-bottom: 14px; color: var(--ink-2); max-width: 80ch; }
.summary strong { color: var(--ink); font-weight: 600; }
.pager { display: flex; align-items: center; gap: 16px; margin-top: 16px; color: var(--muted); font-size: 14px; }
.pager .button[aria-disabled] { opacity: .4; pointer-events: none; }
.empty { padding: 28px 20px; color: var(--ink-2); }

/* ---------- network & address pages */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 28px 0 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts > div { padding: 16px 20px 16px 0; }
.facts > div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-size: 26px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.facts dd small { display: block; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--muted); margin-top: 4px; }
.facts dd.mono { font-size: 22px; font-weight: 500; letter-spacing: 0; }
.links { margin-top: 18px; color: var(--muted); font-size: 14px; }

.tabs { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 6px; overflow: hidden; }
.tabs a { padding: 6px 12px; font-size: 14px; font-weight: 550; color: var(--ink-2); text-decoration: none; }
.tabs a + a { border-left: 1px solid var(--rule-2); }
.tabs a[aria-current] { background: var(--ink); color: var(--page); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin: 16px 0 14px; }
.toolbar input, .toolbar select {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule-2); border-radius: 6px; padding: 6px 10px;
}
.toolbar input { flex: 1 1 200px; max-width: 320px; }
.toolbar .end { margin-left: auto; }

.callout { margin-top: 20px; padding: 14px 16px; border-left: 3px solid var(--bar); background: var(--surface); max-width: 72ch; }

/* ---------- tooltip */

.tip {
  position: fixed; left: 0; top: 0; z-index: 20; pointer-events: none;
  max-width: 300px; padding: 8px 11px; border-radius: 6px;
  background: var(--tip-bg); color: var(--tip-ink); font-size: 13px; line-height: 1.45;
  box-shadow: 0 6px 24px rgba(16, 32, 48, .18);
}
.tip strong { display: block; font-weight: 650; font-variant-numeric: tabular-nums; }
.tip span { display: block; opacity: .85; overflow-wrap: anywhere; }

/* ---------- history charts */

.chart { max-width: 760px; margin-top: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--bar); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--bar); opacity: .1; }
.chart .hair { stroke: var(--ink-2); stroke-width: 1; }
.chart .dot { fill: var(--bar); stroke: var(--page); stroke-width: 2; }

.h2-gap { margin-bottom: 14px; }
.nowrap { white-space: nowrap; }
@media (min-width: 721px) {
  .cols.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cols h2 + .table-wrap { margin-top: 12px; }

/* ---------- bulk lookup */

.bulk textarea {
  display: block; width: 100%; min-height: 190px; margin-top: 24px; padding: 12px 14px; resize: vertical;
  border: 1px solid var(--rule-2); border-radius: 8px; background: var(--surface); color: var(--ink);
  font-family: var(--mono); font-size: 13.5px; line-height: 1.55;
}
.bulk textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.bulk .toolbar { margin-top: 12px; }
.button.primary { background: var(--ink); border-color: var(--ink); color: var(--page); }
.button.primary:hover { background: var(--ink-2); }
.bulk-cols { margin-top: 32px; }

/* ---------- footer */

.foot { border-top: 1px solid var(--rule); padding: 24px 0 40px; color: var(--muted); font-size: 13px; }
.foot p { max-width: 90ch; }
.foot p + p { margin-top: 6px; }

/* ---------- responsive */

@media (max-width: 1080px) {
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .intro, .map-layout { grid-template-columns: minmax(0, 1fr); }
  .intro h1 { max-width: none; }
  .figure { margin-top: 28px; }
}
@media (max-width: 720px) {
  .wrap { padding-inline: 16px; }
  main { padding-top: 28px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .lookup-top { order: 3; width: 100%; }
  .nav { gap: 16px; }
  .opt { display: none; }
  th, td { padding: 8px 10px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px 0; }
  .facts > div, .facts > div + div { padding: 12px 12px 12px 0; border-left: 0; }
  .facts dd { font-size: 26px; }
}
@media (max-width: 520px) {
  .cell { font-size: 0; padding: 0; }
  .lookup-big input { font-size: 17px; padding: 13px 12px; }
  .lookup-big button { padding: 0 16px; }
  .bars a { grid-template-columns: 1.4rem minmax(0, 8rem) minmax(0, 1fr); }
}
