:root {
  color-scheme: dark;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: #edf4ff;
  background: #0a121e;
  --surface: #111e30;
  --line: #30445e;
  --muted: #adbed3;
  --accent: #a6f3dc;
  --ink: #102c27;
}
* { box-sizing: border-box; }
body { margin: 0; }
.shell { width: min(70rem, calc(100% - 3rem)); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); background: #0d1726; }
.masthead-inner { min-height: 4.4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: #eaf3ff; }
.brand strong { color: var(--muted); font-weight: 600; }
.brand-mark { width: .95rem; height: .95rem; transform: rotate(45deg); border-radius: .2rem; background: var(--accent); }
a { color: var(--accent); text-underline-offset: .2em; }
a:focus-visible, :is(button,input,textarea,summary):focus-visible { outline: 2px solid #a6f3dc; outline-offset: .22rem; }
.site-footer { display: flex; justify-content: flex-end; padding-block: .9rem 1.5rem; border-top: 1px solid var(--line); }
.site-footer a { color: var(--muted); font-size: .8rem; }
h1,h2,p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; letter-spacing: -.04em; }
h2 { font-size: 1.2rem; line-height: 1.25; }
p, .hint, .section-heading span { color: var(--muted); }
code, pre { font-family: ui-monospace, "Cascadia Code", monospace; overflow-wrap: anywhere; }
pre { background: #0c1522; border-radius: .45rem; padding: .85rem 1rem; white-space: pre-wrap; margin: .9rem 0 0; }
.public-page, .admin-page { padding: 2.5rem 0 3.5rem; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 1.4rem;
  margin: 1rem 0 2rem;
}
.hero > div { padding: clamp(1rem, 3.1vw, 2.4rem) 0; align-self: center; }
.hero h1 { font-size: clamp(2.7rem, 7vw, 5.35rem); letter-spacing: -.068em; }
.hero p { max-width: 29rem; margin: .85rem 0 1.35rem; font-size: 1.08rem; }
.ip-card {
  position: relative;
  display: grid;
  align-content: center;
  gap: .5rem;
  min-height: 15rem;
  margin: 0;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid #3d5b69;
  border-radius: .9rem;
  background: radial-gradient(ellipse at top right, #1c474b, transparent 76%), #112334;
}
.ip-card dt { color: #c2d8e4; font-size: .86rem; font-weight: 650; }
.ip-card dd { margin: 0; color: var(--accent); font: 650 clamp(1.45rem, 3vw, 2.15rem)/1.25 ui-monospace, monospace; overflow-wrap: anywhere; }
.ip-card .asn-label { margin-top: .75rem; }
.ip-card .asn-value { font-size: 1.1rem; }
.panel { min-width: 0; padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.panel + .panel { margin-top: 1rem; }
.section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .65rem; }
.section-heading span { font-size: .85rem; }
.endpoint-list { margin: .75rem 0; }
.endpoint { display: flex; align-items: start; gap: .9rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.endpoint p { font-size: .9rem; margin-top: .22rem; }
.method { flex: none; padding: .15rem .45rem; border-radius: .35rem; background: #213d41; color: var(--accent); font-size: .72rem; font-weight: 750; }
.hint { margin-block: .75rem; font-size: .9rem; }
button,.button {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  justify-content: center;
  align-items: center;
  padding: .6rem .8rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  color: var(--ink);
  background: var(--accent);
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
}
button:hover,.button:hover { filter: brightness(.9); }
.secondary { color: #eef4ff; background: #283d55; border-color: #536c87; }
.danger { color: #ffe1e6; background: #432833; border-color: #785461; }
label { min-width: 0; display: grid; gap: .3rem; font-size: .86rem; font-weight: 600; }
input,textarea { width: 100%; padding: .58rem .65rem; border: 1px solid #536b87; border-radius: .45rem; color: #edf4ff; background: #0b1726; font: inherit; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #829ab3; }
.admin-login { max-width: 27rem; padding-top: clamp(2rem, 12vh, 8rem); }
.admin-login h1 { font-size: 1.8rem; }
.stack { display: grid; gap: .9rem; margin-top: 1rem; }
.admin-heading { margin-bottom: 1.25rem; }
.admin-heading p { margin-top: .35rem; }
.inline-form,.mapping-form,.key-form,.password-form { display: grid; gap: .8rem; align-items: end; margin-top: .9rem; }
.inline-form { grid-template-columns: minmax(0, 22rem) auto; justify-content: start; }
.key-form,.mapping-form,.password-form { grid-template-columns: repeat(3,minmax(0,1fr)); }
.wide,.key-form .actions,.mapping-form .actions,.password-form .actions { grid-column: 1 / -1; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.checkbox { display: flex; align-items: center; min-height: 2.5rem; gap: .5rem; }
.checkbox input { width: auto; accent-color: var(--accent); }
.records { margin-top: 1rem; }
.records details { border-top: 1px solid var(--line); padding: .75rem 0; }
.records summary { cursor: pointer; overflow-wrap: anywhere; }
.records summary span { color: var(--muted); font-size: .85rem; margin-inline-start: .65rem; }
.notice { padding: 1rem; margin-bottom: .9rem; background: #183a3a; border: 1px solid #466b68; border-radius: .6rem; }
.notice.error { color: #ffe1e6; background: #422936; border-color: #7d5264; }
.key-notice p { margin: .35rem 0 .6rem; }
.history-scroll { max-height: 22rem; overflow: auto; margin-top: .65rem; }
.compact-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
.compact-table :is(th,td) { border-bottom: 1px solid var(--line); padding: .55rem .65rem; }
.compact-table thead th { position: sticky; top: 0; background: var(--surface); color: var(--muted); }
.compact-table time,.mapping-table th[scope="row"] { white-space: nowrap; }
.mapping-table td:nth-child(2) { width: 100%; min-width: 10rem; }
.mapping-table .actions { flex-wrap: nowrap; }
.mapping-table :is(input,button) { padding: .35rem .55rem; }
.bulk-import { margin-top: .85rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.bulk-import summary { cursor: pointer; font-weight: 650; }
.bulk-import textarea { font-family: ui-monospace, "Cascadia Code", monospace; }
.mapping-notice { margin-top: .75rem; }
@media (max-width: 660px) {
  .shell { width: calc(100% - 2rem); }
  .hero,.key-form,.mapping-form,.password-form { grid-template-columns: minmax(0,1fr); }
  .hero { gap: .5rem; }
  .ip-card { min-height: 8rem; }
  .inline-form { grid-template-columns: minmax(0,1fr); }
  .records summary span { display: block; margin-inline-start: 0; }
}
