:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #10172e;
  color: #f5f7ff;
  --muted: #b1bfd7;
  --line: #2e3b56;
  --accent: #8ee7ff;
}

* { box-sizing: border-box; }
body { margin: 0; }
main {
  width: min(100% - 2rem, 72rem);
  margin: 0 auto;
  padding: 1.25rem 0 1rem;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
nav { display: flex; gap: 0.65rem; font-size: 0.82rem; color: var(--muted); }
nav a { font-weight: 700; }
h1 { margin: 0.7rem 0 0; font-size: clamp(1.9rem, 4vw, 2.5rem); line-height: 1.1; }
.intro { margin: 0.35rem 0 0.9rem; color: var(--muted); font-size: 0.92rem; }
.controls { display: flex; gap: 0.65rem; align-items: end; }
.field:first-child { flex: 1; min-width: 0; }
label { display: block; margin-bottom: 0.2rem; font-size: 0.78rem; font-weight: 650; }
input, select {
  width: 100%;
  min-height: 2.4rem;
  border: 1px solid #465a78;
  border-radius: 0.4rem;
  padding: 0.35rem 0.6rem;
  font: inherit;
  color: inherit;
  background: #1a2540;
}
input::placeholder { color: #9eafcb; }
.meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; justify-content: space-between; margin: 0.6rem 0 0.35rem; color: var(--muted); font-size: 0.78rem; }

.results {
  overflow: auto;
  max-height: max(14rem, calc(100svh - 15rem));
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: #141e35;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: 0.85rem; }
thead th { position: sticky; top: 0; z-index: 1; background: #202c47; font-size: 0.75rem; letter-spacing: 0.015em; }
th, td { padding: 0.24rem 0.65rem; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #18223b; }
tbody tr:hover, tbody tr:focus-within { background: #223653; }
.flag { width: 2.75rem; text-align: center; }
td.flag { font-size: 1rem; line-height: 1; }
.suffix { white-space: nowrap; }
.suffix a { font-weight: 650; }
.punycode { color: var(--muted); font-size: 0.7rem; margin-inline-start: 0.45rem; }
td:last-child { color: var(--muted); width: 9rem; }
#empty, noscript p { margin: 0.8rem; color: var(--muted); }

@media (max-width: 36rem) {
  main { width: calc(100% - 1rem); padding-top: 0.75rem; }
  th, td { padding-inline: 0.35rem; }
  .flag { width: 2rem; }
  td:last-child { width: auto; }
  .punycode { display: none; }
}
