:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --text: #1c2530;
  --muted: #5b6b7a;
  --border: #dde3e9;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #d5f0ec;
  --alert-bg: #fff4e5;
  --alert-border: #f3c58a;
  --alert-text: #7a4a00;
  --code-bg: #eef2f5;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151b;
    --surface: #171f27;
    --surface-2: #1f2932;
    --text: #e6edf3;
    --muted: #97a6b5;
    --border: #2a3541;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-soft: #0f3d38;
    --alert-bg: #2b2213;
    --alert-border: #6b4d12;
    --alert-text: #f5d08a;
    --code-bg: #1f2932;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
code, pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .95em;
}
code { background: var(--code-bg); padding: .1em .4em; border-radius: 6px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); padding: .9rem 1rem; border-radius: 8px; overflow-x: auto; margin: .5rem 0; }
pre code { background: none; padding: 0; }
.wrap { word-break: break-all; overflow-wrap: anywhere; }

.container { width: min(1040px, 100% - 2rem); margin: 0 auto; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); }
.brand small { font-size: .75em; color: var(--muted); font-weight: 500; }
.brand-mark { width: 26px; height: 26px; fill: var(--accent); }
.site-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.site-nav a { padding: .45rem .75rem; border-radius: 8px; color: var(--text); font-weight: 500; font-size: .95rem; white-space: nowrap; }
.site-nav a:hover { background: var(--surface-2); text-decoration: none; }
.site-nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; width: 42px; height: 38px; padding: 8px; cursor: pointer; flex-direction: column; justify-content: space-between; }
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .site-nav { display: none; width: 100%; flex-direction: column; padding-bottom: .5rem; }
  .site-nav.open { display: flex; }
}

/* Main */
main { flex: 1; padding: 1.75rem 0 3rem; }
.page-title { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 .25rem; letter-spacing: -.02em; }
.lead { color: var(--muted); margin: 0 0 1.5rem; font-size: 1.05rem; max-width: 60ch; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.card h2 { margin: 0 0 .75rem; font-size: 1.1rem; letter-spacing: -.01em; overflow-wrap: anywhere; }
.card h3 { margin: .25rem 0 .4rem; font-size: 1rem; }
.card > p:last-child, .card > dl:last-child { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.grid .card { margin-bottom: 0; }

.hero { text-align: center; padding: 2rem 1.4rem; background: linear-gradient(160deg, var(--surface) 0%, var(--accent-soft) 100%); }
.hero-label { color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.hero-ip { display: flex; justify-content: center; align-items: center; gap: .6rem; margin: .6rem 0 .8rem; flex-wrap: wrap; }
.hero-ip code { font-size: clamp(1.5rem, 5vw, 2.6rem); font-weight: 600; background: none; padding: 0; letter-spacing: -.01em; word-break: break-all; }
.hero .muted { max-width: 60ch; margin: 0 auto; }

.muted { color: var(--muted); }
.value { font-size: 1.1rem; margin: 0 0 .5rem; }
.source { font-size: .8rem; margin: .5rem 0 0; }
.alert { background: var(--alert-bg); border-color: var(--alert-border); color: var(--alert-text); }
.alert a { color: inherit; font-weight: 600; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
@media (max-width: 480px) { dl.kv { grid-template-columns: 1fr; gap: 0 } dl.kv dd { margin-bottom: .5rem } }

.tools { list-style: none; padding: 0; margin: 0; }
.tools li { padding: .35rem 0; border-bottom: 1px solid var(--border); }
.tools li:last-child { border-bottom: 0; }

details summary { cursor: pointer; color: var(--muted); margin-top: .5rem; }
details code { display: block; margin-top: .4rem; padding: .5rem .7rem; }

/* Forms */
.lookup-form label { display: block; font-weight: 600; margin-bottom: .4rem; }
.lookup-form .row { display: flex; gap: .6rem; flex-wrap: wrap; }
.lookup-form input {
  flex: 1 1 260px; min-width: 0;
  font: inherit; font-family: ui-monospace, Menlo, Consolas, monospace;
  padding: .65rem .85rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
.lookup-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.lookup-form p { margin: .6rem 0 0; font-size: .9rem; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
  padding: .6rem 1.1rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #062421; } }

.copy { font: inherit; background: none; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; color: var(--muted); padding: .15rem .5rem; line-height: 1.4; }
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy.done { color: var(--accent); border-color: var(--accent); }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.results { width: 100%; border-collapse: collapse; }
table.results th, table.results td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.results th { color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
table.results tr:last-child td { border-bottom: 0; }
table.results .actions { font-size: .9rem; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

.cmd { position: relative; }
.grid > div > p:first-of-type { min-height: 1.55em; }
.cmd pre { padding-right: 3rem; }
.cmd .copy { position: absolute; top: 50%; right: .6rem; transform: translateY(-50%); background: var(--surface); }

/* Map */
.map { width: 100%; height: clamp(280px, 50vh, 460px); border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0 2rem; font-size: .85rem; color: var(--muted); }
.site-footer p { margin: 0 0 .4rem; }
