:root {
  color-scheme: dark;
  --night: #101522;
  --panel: #171f2e;
  --line: #303b50;
  --ink: #f2f5fb;
  --text: #b0bed3;
  --dim: #9baac3;
  --blue: #bbccff;
  --green: #9ae3c1;
  --orange: #ffd3a0;
  --mono: "Cascadia Mono", ui-monospace, Consolas, monospace;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--night);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .65em;
  min-height: 42px; padding: 0 15px; border-radius: 6px; border: 1px solid transparent;
  background: var(--blue); color: #18213b; font-weight: 700; font-size: .875rem;
  text-decoration: none; cursor: pointer;
}
.quiet { background: transparent; color: var(--text); border-color: var(--line); }
button:hover, .button:hover { filter: brightness(1.12); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.top { border-bottom: 1px solid var(--line); background: #121827; }
.rail, main { width: min(1360px, calc(100% - 72px)); margin-inline: auto; }
.rail { min-height: 70px; display: flex; align-items: center; gap: 44px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 1.2rem; font-weight: 750; white-space: nowrap; }
.moon { display: block; width: 21px; height: 21px; border-radius: 50%; box-shadow: -6px 5px 0 0 var(--blue); transform: translateY(-3px); margin-left: 6px; }
nav, .account { display: flex; align-items: center; gap: 22px; color: var(--text); font-size: .875rem; }
nav a { text-decoration: none; }
nav a:hover { color: var(--ink); }
nav a[aria-current="page"] { color: var(--blue); font-weight: 650; }
.account { margin-left: auto; overflow-wrap: anywhere; }
.account button { min-height: 34px; }
.intro, .section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.intro { padding: 47px 0 30px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.045em; font-weight: 750; }
h2 { font-size: 1.5rem; letter-spacing: -.025em; }
h1 + p, h2 + p { margin-top: 7px; color: var(--text); font-size: .9rem; line-height: 1.6; }
.host {
  display: grid; grid-template-columns: minmax(190px, .9fr) 3fr; align-items: stretch;
  min-height: 162px; border: 1px solid #374864; border-radius: 10px;
  background: radial-gradient(ellipse at 95% 100%, #244064 0%, transparent 65%), #18243b;
}
.host-summary { display: flex; flex-direction: column; justify-content: center; padding: 23px 27px; border-right: 1px solid #3a4a65; }
.eyebrow, .timestamp, .count, .addresses, .proto { font-family: var(--mono); font-size: .78rem; }
.eyebrow { color: var(--blue); letter-spacing: .065em; }
.host-state { margin-block: 8px; font-size: 1.5rem; }
.timestamp { color: var(--text); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; align-items: center; }
.metrics div { padding: 12px 24px; min-width: 0; }
.metrics dt { color: var(--text); font-size: .9rem; }
.metrics dd { font-family: var(--mono); margin: 9px 0 0; font-size: clamp(1.125rem, 2.8vw, 2rem); font-weight: 700; letter-spacing: -.07em; overflow-wrap: anywhere; }
.metrics div:last-child dd { font-size: clamp(1rem, 1.9vw, 1.55rem); }
.section { margin-top: 45px; scroll-margin-top: 20px; }
.section-head { margin-bottom: 16px; }
.count { color: var(--text); text-align: right; }
.services { padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.service { min-width: 0; background: var(--panel); }
.service a { display: flex; height: 100%; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 18px; text-decoration: none; min-height: 68px; }
.service:has(.remove) a { height: auto; }
.service a:focus-visible { outline-offset: -3px; }
.service a:hover { background: #212e45; }
.service a > span:first-child { min-width: 0; }
.service strong, .service small { display: block; }
.service small { margin-top: 4px; font: .75rem var(--mono); color: var(--dim); overflow-wrap: anywhere; }
.service-right { display: flex; align-items: center; gap: 15px; white-space: nowrap; }
.status { font-size: .75rem; color: var(--dim); }
.status::before { content: ""; display: inline-block; height: .42em; width: .42em; border-radius: 50%; background: currentColor; margin-right: .6em; vertical-align: .13em; }
.good { color: var(--green); }
.warn { color: var(--orange); }
.arrow { color: var(--blue); font-size: 1.15rem; }
.remove { margin: 0 18px 10px; }
.remove button { min-height: 30px; font-size: .72rem; }
input, select { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 6px; background: #111928; color: var(--ink); }
input::placeholder { color: var(--dim); }
.search { display: flex; align-items: center; gap: 8px; width: min(100%, 330px); }
.search button { white-space: nowrap; }
.port-box { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); }
.table-scroll { max-height: 468px; overflow: auto; }
table { border-collapse: collapse; text-align: left; width: 100%; font-size: .875rem; }
thead { position: sticky; top: 0; background: #1e2a41; color: var(--text); }
th, td { padding: 11px 16px; border-bottom: 1px solid var(--line); }
tbody th, tbody td { vertical-align: top; }
tbody th { white-space: nowrap; }
.proto { color: var(--blue); text-transform: uppercase; }
.addresses, .secondary { color: var(--text); }
.port-link { display: inline-block; color: var(--blue); margin-right: .75em; }
.table-note { padding: 11px 16px; color: var(--text); font-size: .78rem; }
.empty { color: var(--text); }
.registration { padding: 22px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.form-grid { display: grid; grid-template-columns: 1fr 90px 105px 1.6fr auto; gap: 12px; align-items: end; margin-top: 20px; }
.form-grid label { display: grid; gap: 6px; color: var(--text); font-size: .875rem; min-width: 0; }
.form-grid button { white-space: nowrap; }
.flash { color: var(--green); margin-bottom: 15px; }
footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 36px; padding-block: 20px; font: .78rem var(--mono); color: var(--dim); }
.message { padding-block: 15vh; }
.message h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); margin-block: 30px; }
.message .button { margin-right: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.catalog-search { display: flex; gap: 12px; max-width: 780px; }
.catalog-search button { white-space: nowrap; min-width: 82px; }
.catalog-results { margin-top: 18px; }
.catalog-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.catalog-card { min-width: 0; padding: 19px 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.catalog-card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.catalog-card-title h2 { font-size: 1.2rem; overflow-wrap: anywhere; }
.catalog-card-title a, .metadata-links a { color: var(--blue); font-size: .875rem; white-space: nowrap; }
.catalog-card p { color: var(--text); margin-top: 8px; font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
.catalog-card .catalog-url { color: var(--dim); font: .75rem var(--mono); }
.catalog-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 12px 0 0; }
.catalog-tags li { border-radius: 5px; padding: 5px 8px; background: #25324a; color: var(--blue); font: .75rem var(--mono); }
.catalog-card details { margin-top: 12px; color: var(--text); font-size: .8rem; }
.catalog-card summary { cursor: pointer; }
.metadata-links { display: flex; gap: 15px; margin-top: 8px; }
.catalog-pagination { display: flex; gap: 10px; margin-top: 18px; }
.integration h2 { margin-bottom: 12px; }
.integration pre { overflow: auto; padding: 13px 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--night); color: var(--blue); font: .8rem/1.65 var(--mono); }
.tool-list { display: grid; grid-template-columns: minmax(0,auto) 1fr; gap: 10px 14px; font-size: .875rem; }
.tool-list dt { color: var(--blue); font-family: var(--mono); }
.tool-list dd { margin: 0; color: var(--text); }
.token-create { grid-template-columns: minmax(180px,2fr) minmax(140px,1fr) minmax(105px,1fr) auto; }
.token-secret { margin-top: 15px; padding: 18px 20px; border: 1px solid #355950; border-radius: 8px; background: #192e36; }
.token-secret strong, .token-notice { color: var(--green); }
.token-secret p, .token-notice, .token-error { margin-top: 9px; color: var(--text); font-size: .875rem; }
.token-error { color: var(--orange); }
.token-copy { display: flex; gap: 12px; margin-top: 14px; }
.token-copy input, .token-service { font-family: var(--mono); }
.token-copy button { white-space: nowrap; }
.token-service { display: block; color: var(--dim); margin-top: 5px; font-size: .75rem; }
.token-actions { display: flex; gap: 8px; }
.token-actions button { min-height: 34px; font-size: .76rem; white-space: nowrap; }
.token-scroll { max-height: 560px; }
@media (max-width: 900px) {
  .rail, main { width: calc(100% - 40px); }
  .rail { gap: 24px; }
  .metrics div { padding-inline: 14px; }
  .services { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .rail, main { width: calc(100% - 28px); }
  .rail { flex-wrap: wrap; gap: 12px; padding-block: 11px; }
  nav { order: 3; width: 100%; gap: 13px; flex-wrap: wrap; padding-block: 2px; }
  .account { gap: 8px; }
  .account span { font-size: .75rem; }
  .intro, .section-head { align-items: flex-start; flex-direction: column; gap: 13px; }
  .intro { padding-top: 28px; }
  .host { grid-template-columns: 1fr; }
  .host-summary { border-right: 0; border-bottom: 1px solid #3a4a65; padding: 16px; }
  .metrics { grid-template-columns: repeat(2, 1fr); padding: 6px 0; }
  .metrics div { padding: 10px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .service a { padding-inline: 13px; }
  .service-right { gap: 9px; }
  table { min-width: 540px; }
  .catalog-grid { grid-template-columns: 1fr; }
}
