:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #14171f;
  --muted: #667085;
  --border: #e4e7ec;
  --row-hover: #f5f6fb;
  --accent: #4338ca;
  --accent-soft: #eef0ff;
  --best: #0a7d45;
  --best-bg: #e3f6ea;
  --sale: #c2410c;
  --radius: 10px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1016;
    --surface: #161922;
    --text: #e8eaf0;
    --muted: #8f97a8;
    --border: #262b38;
    --row-hover: #1b1f2a;
    --accent: #8f95ff;
    --accent-soft: #20244a;
    --best: #4ade80;
    --best-bg: #11301f;
    --sale: #fb923c;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

main {
  flex: 1;
  padding-bottom: 48px;
}

/* Header / footer */
.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.brand:hover {
  text-decoration: none;
}
.site-head nav {
  display: flex;
  gap: 4px;
}
.site-head nav a {
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 500;
}
.site-head nav a:hover {
  color: var(--text);
  text-decoration: none;
}
.site-head nav a[aria-current='page'] {
  color: var(--accent);
  background: var(--accent-soft);
}

.site-foot {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}

/* Headings */
h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h2 {
  margin: 28px 0 10px;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.hero {
  padding: 36px 0 20px;
}
.hero h1 {
  font-size: 30px;
}
.hero p {
  margin: 8px 0 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 15px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 16px;
}
.lead {
  margin: 6px 0 0;
  max-width: 68ch;
  color: var(--muted);
}
.tld-title {
  font-family: var(--mono);
  font-size: 32px;
}

.crumbs {
  padding-top: 16px;
  color: var(--muted);
  font-size: 13px;
}
.crumbs + .page-head {
  padding-top: 8px;
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.filter {
  flex: 1;
  min-width: 160px;
  max-width: 280px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.filter:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.seg button,
.seg a {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.seg button:hover,
.seg a:hover {
  color: var(--text);
}
.seg button[aria-pressed='true'],
.seg a[aria-current='page'] {
  background: var(--accent);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .seg button[aria-pressed='true'],
  .seg a[aria-current='page'] {
    color: #0e1016;
  }
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tbl th,
.tbl td {
  padding: 7px 14px;
  text-align: left;
}
.tbl th {
  padding-top: 0;
  padding-bottom: 0;
  height: 36px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.tbl tbody tr + tr td {
  border-top: 1px solid var(--border);
}
.tbl tbody tr:hover {
  background: var(--row-hover);
}
.tbl .num {
  text-align: right;
}
.tbl th button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.tbl th button:hover {
  color: var(--text);
}
.tbl th button::after {
  content: '↕';
  margin-left: 4px;
  opacity: 0.35;
}
.tbl th[aria-sort='ascending'] button,
.tbl th[aria-sort='descending'] button {
  color: var(--text);
}
.tbl th[aria-sort='ascending'] button::after {
  content: '↑';
  opacity: 1;
}
.tbl th[aria-sort='descending'] button::after {
  content: '↓';
  opacity: 1;
}

.tld {
  font-family: var(--mono);
  font-weight: 600;
}
.reg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 500;
}
.reg .ext {
  margin-left: -2px;
  color: var(--muted);
}
.reg:hover .ext {
  color: var(--accent);
}
.tag {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.best {
  padding: 2px 7px;
  margin-right: -7px;
  border-radius: 6px;
  background: var(--best-bg);
  color: var(--best);
  font-weight: 600;
}
.hint .best {
  margin-right: 0;
}
.na {
  color: var(--muted);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.hint {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

/* Promo prices */
.list-price {
  margin-right: 6px;
  color: var(--muted);
  font-size: 12px;
}
.promo {
  position: relative;
  display: inline-flex;
  margin-left: 5px;
  vertical-align: -2px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--sale);
  font: inherit;
  cursor: pointer;
}
.best + .promo {
  margin-left: 12px;
}
.promo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
/* Opens sideways so the scrolling table wrapper never clips it. */
.promo .tip {
  position: absolute;
  top: 50%;
  right: calc(100% + 6px);
  z-index: 5;
  transform: translateY(-50%);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.promo:hover .tip,
.promo:focus .tip {
  visibility: visible;
  opacity: 1;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.check input {
  margin: 0;
  accent-color: var(--accent);
}
.toolbar-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 16px;
}

/* Detail pages */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.prose {
  margin: 0 0 12px;
  max-width: 72ch;
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}
.facts > div {
  padding: 10px 14px;
  background: var(--surface);
}
.facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.facts dd {
  margin: 0;
}

.btn {
  flex: none;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn:hover {
  text-decoration: none;
  filter: brightness(1.1);
}
@media (prefers-color-scheme: dark) {
  .btn {
    color: #0e1016;
  }
}
.visit {
  font-weight: 500;
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 24px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .tbl th,
  .tbl td {
    padding-left: 10px;
    padding-right: 10px;
  }
  .page-head {
    flex-direction: column;
  }
}
