:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --ink: #16212e;
  --ink-2: #4c5a6b;
  --ink-3: #7b8796;
  --line: #d6dce3;
  --line-2: #e6eaef;
  --aqua: #008b94;       /* fiber jacket aqua: links, "in both" */
  --aqua-soft: #d5eff0;
  --orange: #d9661a;     /* fiber #2: on the IX's list only */
  --orange-soft: #fbe6d6;
  --slate: #8193a8;      /* fiber #5: in PeeringDB only */
  --slate-soft: #e3e8ee;
  --focus: #2b59d6;
  --row-hover: #f5f8fb;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1720; --surface: #16202b; --ink: #e6edf4; --ink-2: #a7b4c2; --ink-3: #75828f;
    --line: #2a3644; --line-2: #212c38; --aqua: #3cc4cc; --aqua-soft: #12383d;
    --orange: #f08a43; --orange-soft: #43281a; --slate: #8a9bb0; --slate-soft: #26313d;
    --focus: #7ea2ff; --row-hover: #1b2733; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1720; --surface: #16202b; --ink: #e6edf4; --ink-2: #a7b4c2; --ink-3: #75828f;
  --line: #2a3644; --line-2: #212c38; --aqua: #3cc4cc; --aqua-soft: #12383d;
  --orange: #f08a43; --orange-soft: #43281a; --slate: #8a9bb0; --slate-soft: #26313d;
  --focus: #7ea2ff; --row-hover: #1b2733; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--sans); font-variant-numeric: tabular-nums;
}
a { color: var(--aqua); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.mono { font-family: var(--mono); font-size: 0.86em; letter-spacing: -0.01em; }
.muted { color: var(--ink-3); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ---------- header */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 58px; }
.mark { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800;
        font-stretch: 125%; font-size: 20px; letter-spacing: -0.02em; }
.mark:hover { text-decoration: none; }
.mark svg { flex: none; }
.nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink-2); font-weight: 500; }
.nav a[aria-current="page"] { color: var(--ink); }
.theme { background: none; border: 1px solid var(--line); color: var(--ink-2); border-radius: 6px;
         width: 32px; height: 32px; cursor: pointer; display: grid; place-items: center; }

.sample { background: var(--orange-soft); color: var(--ink); border-bottom: 1px solid var(--line); font-size: 14px; }
.sample .wrap { padding-top: 8px; padding-bottom: 8px; }

/* ---------- index intro */
.intro { padding-top: 44px; padding-bottom: 28px; }
.intro h1 { font-size: clamp(28px, 4.2vw, 46px); line-height: 1.05; font-weight: 800; font-stretch: 112%;
            letter-spacing: -0.025em; margin: 0 0 14px; max-width: 18ch; }
.intro p { color: var(--ink-2); font-size: 17px; max-width: 62ch; margin: 0; }
.intro p b { color: var(--ink); font-weight: 600; }
.intro p + p { margin-top: 10px; }

/* ---------- front page: changes box (left), data box (right) */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: 20px; padding-top: 32px; padding-bottom: 24px; align-items: start; }
.hero .databox { order: 2; padding: 26px 30px; }
.hero .changesbox { order: 1; }
.databox h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.05; font-weight: 800; font-stretch: 112%; letter-spacing: -0.025em; margin: 0 0 14px; }
.databox p { color: var(--ink-2); font-size: 16.5px; margin: 0; }
.databox p b { color: var(--ink); font-weight: 600; }
.databox .intro-links { margin-top: 14px; font-size: 15px; }
.changesbox h2 { font-size: 15px; margin: 0 0 10px; }
.changesbox .more-link { display: inline-block; margin-top: 10px; font-size: 14px; }
.changelist { list-style: none; margin: 0; padding: 0; }
.panel .changelist li, .changelist li { display: block; padding: 6px 0; border-bottom: 1px solid var(--line-2); line-height: 1.4; overflow-wrap: anywhere; }
.changelist li:last-child { border-bottom: 0; }
.changelist.small { font-size: 13.5px; max-height: 330px; overflow: auto; }
.changelist .when { display: block; color: var(--ink-3); font-size: 12px; }
.changelist .asn { font-variant-numeric: tabular-nums; }
.kind { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; border-radius: 4px; margin-right: 2px; }
.kind.new { background: var(--aqua-soft); color: var(--aqua); }
.kind.ghost, .kind.gone { background: var(--line-2); color: var(--ink-2); }
.kind.list { background: var(--orange-soft); color: var(--orange); }
.prose.wide { max-width: 900px; }
h2.day { font-size: 15px; color: var(--ink-2); margin: 26px 0 6px; }
h2.sectionhead { font-size: 18px; margin: 8px 0 12px; }
.grid td.nets { font-size: 12.5px; max-width: 520px; }
.netchip { display: inline-block; padding: 1px 7px; margin: 0 4px 4px 0; border-radius: 4px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.netchip.out { background: var(--aqua-soft); color: var(--ink); }
.ghosttag { font-size: 11px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }
.topfilter { display: flex; gap: 10px; align-items: end; margin-top: 16px; }
.topfilter .field { min-width: 240px; }
.toplist .scope { font-weight: 500; color: var(--ink-3); font-size: 14px; }

/* ---------- filters */
.filters { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 12px 0;
           border-bottom: 1px solid var(--line); }
.filters .wrap { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) minmax(130px, .8fr) minmax(200px, 1.4fr) auto;
                 gap: 10px; align-items: end; }
.field label { display: block; font-size: 12.5px; color: var(--ink-3); margin: 0 0 4px 2px; }
.field input, .field select {
  width: 100%; height: 38px; padding: 0 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 7px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.check { display: flex; gap: 8px; align-items: center; height: 38px; color: var(--ink-2); white-space: nowrap; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--aqua); width: 16px; height: 16px; }
.netfield { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none;
           background: var(--surface); border: 1px solid var(--line); border-radius: 8px; z-index: 20;
           box-shadow: 0 10px 30px -12px rgba(16, 30, 50, .35); max-height: 340px; overflow: auto; }
.suggest li { padding: 7px 10px; border-radius: 5px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--aqua-soft); }
.suggest .asn { color: var(--ink-3); font-size: 13px; min-width: 70px; }
.suggest .all { font-weight: 600; }
.suggest .ixn { margin-left: auto; color: var(--ink-3); font-size: 13px; white-space: nowrap; padding-left: 8px; }
.show-sm { display: none !important; }
.netfilters .wrap { grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto; }

.resultbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0 10px; color: var(--ink-2); font-size: 14px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; gap: 6px; align-items: center; background: var(--surface); border: 1px solid var(--line);
        border-radius: 999px; padding: 3px 4px 3px 11px; font-size: 13.5px; color: var(--ink); }
.chip button { border: 0; background: var(--line-2); color: var(--ink-2); width: 20px; height: 20px; border-radius: 50%; cursor: pointer; line-height: 1; }
.linkbtn { background: none; border: 0; color: var(--aqua); font: inherit; cursor: pointer; padding: 0; }

/* ---------- tables */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; margin-bottom: 48px; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0; border-bottom: 1px solid var(--line);
           background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
.grid th button { all: unset; display: flex; gap: 6px; align-items: center; padding: 11px 14px; cursor: pointer; width: 100%; box-sizing: border-box; }
.grid th.num button { justify-content: flex-end; }
.grid th button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.grid th .arrow { width: 9px; color: var(--ink-3); font-size: 10px; }
.grid th[aria-sort="ascending"] .arrow::after { content: "▲"; color: var(--ink); }
.grid th[aria-sort="descending"] .arrow::after { content: "▼"; color: var(--ink); }
.grid th[aria-sort="none"] button:hover .arrow::after { content: "▲"; opacity: .4; }
.grid td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover { background: var(--row-hover); }
.grid .num { text-align: right; white-space: nowrap; }
.grid .nm a { color: var(--ink); font-weight: 600; }
.grid .sub { display: block; color: var(--ink-3); font-size: 13px; line-height: 1.35; margin-top: 1px; }
.grid .loc { min-width: 140px; max-width: 300px; }
.grid .flag { margin-right: 6px; }
img.flg { width: 20px; height: 15px; vertical-align: -2px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); }
.grid .flagcell { width: 1%; padding-right: 0; }
.flagbtn { border: 0; background: none; padding: 2px; margin: -2px; cursor: pointer; border-radius: 3px; line-height: 0; }
.flagbtn:hover img, .flagbtn:focus-visible img { box-shadow: 0 0 0 2px var(--aqua); }
.flagbtn:focus-visible { outline: none; }
.grid .none { color: var(--ink-3); }
.empty { padding: 48px 20px; text-align: center; color: var(--ink-2); }
.grid td.asn { font-variant-numeric: tabular-nums; width: 1%; }
.grid .sub.listonly { color: var(--orange); }
.more { text-align: center; margin: -28px 0 48px; }
.btn { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
       border-radius: 7px; padding: 8px 18px; cursor: pointer; }
.btn:hover { border-color: var(--aqua); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* the fiber strand: in both / IX list only / PeeringDB only */
.strand { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line-2); min-width: 120px; }
.strand i { display: block; height: 100%; }
.strand .b { background: var(--aqua); }
.strand .l { background: var(--orange); }
.strand .p { background: var(--slate); opacity: .65; }
.matchcell { min-width: 160px; }
.matchcell .legend { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; white-space: nowrap; }
.matchcell .legend b { color: var(--orange); font-weight: 600; }

.pres { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 4px; white-space: nowrap; }
.tag.both { background: var(--aqua-soft); color: var(--aqua); }
.tag.list { background: var(--orange-soft); color: var(--orange); }
.tag.pdb { background: var(--slate-soft); color: var(--ink-2); }
.tag.err { background: var(--orange-soft); color: var(--orange); }

/* ---------- exchange page */
.crumbs { padding: 22px 0 0; font-size: 14px; color: var(--ink-3); }
.ixhead { padding: 10px 0 26px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
.ixhead h1 { margin: 0; font-size: clamp(30px, 4.6vw, 52px); font-weight: 800; font-stretch: 118%; letter-spacing: -0.03em; line-height: 1; }
.ixhead .long { font-size: 18px; color: var(--ink-2); margin: 10px 0 0; }
.ixhead .where { margin: 6px 0 0; color: var(--ink-2); }
.ixhead .ext { display: flex; gap: 16px; font-weight: 500; }

.compare { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; margin-bottom: 22px; }
.compare h2, .panel h2, .peers h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; letter-spacing: -0.005em; }
.compare .strand { height: 14px; border-radius: 7px; margin: 4px 0 16px; }
.counts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.counts button { all: unset; cursor: pointer; padding: 6px 16px 6px 12px; border-left: 3px solid var(--line); }
.counts button:first-child { padding-left: 12px; }
.counts button:focus-visible { outline: 2px solid var(--focus); }
.counts button[aria-pressed="true"] { background: var(--row-hover); }
.counts .n { display: block; font-size: 26px; font-weight: 700; font-stretch: 110%; line-height: 1.1; }
.counts .k { display: block; font-size: 13px; color: var(--ink-2); }
.counts .c-list { border-color: var(--orange); }
.counts .c-list .n { color: var(--orange); }
.counts .c-both { border-color: var(--aqua); }
.counts .c-pdb { border-color: var(--slate); }
.compare .src { margin: 16px 0 0; font-size: 13.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.compare .nolist { color: var(--ink-2); margin: 0; max-width: 70ch; }

.cols { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 22px; margin-bottom: 30px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; min-width: 0; }
.panel dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.panel dt { color: var(--ink-3); }
.panel dd { margin: 0; overflow-wrap: anywhere; }
.panel ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.panel li { padding: 5px 0; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 12px; }
.panel li:last-child { border-bottom: 0; }
.panel .scroll { max-height: 260px; overflow: auto; }

.peers { margin-bottom: 56px; }
.peerbar { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.peerbar h2 { margin: 0; }
.peerbar .field { width: min(320px, 100%); }
.grid td.ips { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }
.grid tr.list_only td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
.grid tr.pdb_only td:first-child { box-shadow: inset 3px 0 0 var(--slate); }
.flagmark { display: inline-flex; align-items: center; gap: 5px; color: var(--orange); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.flagmark svg { flex: none; }
.listname { display: block; color: var(--ink-3); font-size: 12.5px; }

.intro-links { margin-top: 14px !important; font-size: 15px !important; }

/* ---------- top 10 */
.tophead { padding: 36px 0 22px; }
.jump { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 18px; max-width: 900px; }
.jump a { font-size: 13.5px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); }
.jump a:hover { color: var(--ink); border-color: var(--ink-3); text-decoration: none; }
.toplist { scroll-margin-top: 16px; }
.toplist .emptylist { color: var(--ink-2); margin: 0 0 14px; padding: 14px 0 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.tophead h1 { margin: 0; font-size: clamp(30px, 4.6vw, 52px); font-weight: 800; font-stretch: 118%; letter-spacing: -0.03em; line-height: 1; }
.toplists { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 56px; align-items: stretch; }
.toplist { padding: 22px 24px 10px; }
.toplist h2 { font-size: 20px; font-weight: 700; font-stretch: 110%; margin: 0 0 4px; }
.toplist .note { margin: 0 0 14px; color: var(--ink-3); font-size: 13.5px; }
.toplist ol { list-style: none; margin: 0; padding: 0; }
.toplist li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line-2); }
.toplist .rank { font-size: 22px; font-weight: 800; font-stretch: 112%; color: var(--ink-3); line-height: 1.1; }
.toplist li:first-child .rank { color: var(--aqua); }
.toplist .who a { color: var(--ink); font-weight: 600; }
.toplist .sub { display: block; color: var(--ink-3); font-size: 13px; }
.toplist .fig { text-align: right; }
.toplist .fig .n { display: block; font-size: 18px; font-weight: 700; font-stretch: 108%; line-height: 1.2; }
.sizebar { grid-column: 2 / 4; height: 6px; background: var(--line-2); border-radius: 3px; margin-top: -4px; overflow: hidden; }
.sizebar i { display: block; height: 100%; background: var(--aqua); border-radius: 3px; }

/* ---------- about */
.prose { max-width: 68ch; padding: 36px 0 20px; }
.prose h1 { font-size: 38px; font-weight: 800; font-stretch: 115%; letter-spacing: -0.02em; margin: 0 0 16px; }
.prose h2 { font-size: 20px; margin: 32px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }

footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--ink-3); font-size: 13.5px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero .databox { order: 1; }
  .hero .changesbox { order: 2; }
  .filters .wrap { grid-template-columns: 1fr 1fr; }
  .cols, .toplists { grid-template-columns: 1fr; }
  .counts { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .filters { position: static; }
  .filters .wrap { grid-template-columns: 1fr; }
  .ixhead { grid-template-columns: 1fr; }
  .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { gap: 12px; }
  .nav a { white-space: nowrap; font-size: 14px; }
  .mark .wordmark { display: none; }
  .grid .flagcell { padding-left: 8px; }
  .grid .sub.listonly { white-space: normal; }
  .grid td.asn { padding-right: 4px; }
  .hide-sm { display: none !important; }
  .show-sm { display: block !important; }
  .grid td, .grid th button { padding-left: 7px; padding-right: 7px; }
  .grid th { font-size: 12px; }
  .grid th button { gap: 3px; }
  .grid th .arrow { width: 7px; }
}
@media (prefers-reduced-motion: no-preference) {
  .strand i { transition: width .4s ease; }
}
