:root {
  color-scheme: light;
  --ink: #202c28;
  --muted: #52635c;
  --border: #dce5df;
  --surface: #fff;
  --canvas: #f4f7f3;
  --accent: #164f3a;
  --accent-ink: #143f31;
  --soft: #e7f0e9;
  --danger: #9d321f;
  font: 15px/1.6 "Inter", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .62; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(29px, 4vw, 42px); line-height: 1.2; letter-spacing: -.035em; }
h2 { font-size: 20px; line-height: 1.35; letter-spacing: -.015em; }

.wrap { max-width: 1460px; margin-inline: auto; padding-inline: clamp(18px, 4vw, 65px); }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: var(--accent-ink); display: flex; align-items: center; gap: 11px; white-space: nowrap; font-weight: 700; }
.brand > span:last-child { font-weight: 500; color: var(--muted); }
.brand-mark { width: 22px; height: 24px; display: inline-block; position: relative; background: var(--accent); border-radius: 5px; }
.brand-mark::before { content: ""; position: absolute; top: 6px; left: 6px; width: 8px; height: 8px; border: 1.5px solid #fff; border-radius: 50%; }
.brand-mark::after { content: ""; position: absolute; background: #fff; width: 1.5px; height: 6px; top: 12px; left: 9px; border-radius: 2px; }
.brand-divider { height: 19px; width: 1px; background: var(--border); }

.subnav { display: flex; gap: 8px; padding-block: 18px 0; }
.subnav button[aria-pressed="true"] { background: var(--soft); }
.page-heading { margin-block: 28px 24px; }
.page-heading p { margin-top: 9px; }
.workspace { display: grid; grid-template-columns: minmax(268px, 320px) minmax(0, 1fr); gap: 22px; align-items: start; padding-bottom: 48px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: 0 3px 16px #233f2810; }
.create, .records { padding: 25px; min-width: 0; }
.muted, .hint, small { color: var(--muted); }
.hint { font-size: 13px; }
label, legend { font-weight: 600; }
label small { margin-left: 4px; font-weight: 400; }
input:not([type="radio"]), select, textarea {
  color: var(--ink);
  border: 1px solid #b7c7bd;
  border-radius: 7px;
  min-height: 41px;
  background: var(--surface);
  padding: 7px 10px;
}
input:not([type="radio"]) { display: block; width: 100%; margin-top: 5px; }
textarea { width: 100%; resize: vertical; }
input::placeholder { color: var(--muted); opacity: .92; }

.button { min-height: 39px; padding: 6px 13px; border: 1px solid transparent; border-radius: 7px; font-weight: 600; white-space: nowrap; }
.button.primary { color: #fff; background: var(--accent); }
.button.primary:hover:not(:disabled) { background: #0e3d2c; }
.button.secondary { color: var(--accent-ink); background: #f5f8f5; border-color: var(--border); }
.button.secondary:hover:not(:disabled) { background: var(--soft); }
.button.quiet { background: transparent; color: var(--accent-ink); }
.button.quiet:hover:not(:disabled) { background: var(--soft); }
.button.danger { background: var(--danger); color: #fff; }
.button.danger:hover:not(:disabled) { background: #7e2415; }
.feedback { font-size: 13px; color: var(--danger); overflow-wrap: anywhere; }
.feedback:empty { display: none; }
.feedback[data-kind="success"] { color: var(--accent-ink); }

.startup { margin-top: 30px; color: var(--muted); }
.startup .button { margin-top: 12px; }
.auth { width: min(100%, 420px); margin: clamp(46px, 10vh, 104px) auto; padding: clamp(22px, 5vw, 32px); }
.auth h1 { font-size: 28px; }
.auth > p { margin-top: 10px; }
.auth form { display: grid; gap: 13px; margin-top: 24px; }
.auth input { margin: -7px 0 0; }
.auth form > div input { margin-top: 5px; }

.create form { display: grid; margin-top: 18px; }
.create form > input, .create form > textarea { margin-bottom: 12px; }
.create form > p { margin-bottom: 9px; }
.create form > .release-version-hint { margin-top: -7px; }
.create fieldset { margin: 0 0 18px; padding: 0; border: 0; min-inline-size: 0; }
.create legend { padding: 0; }
.terms { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin-block: 7px 5px; }
.terms label { position: relative; grid-column: span 2; cursor: pointer; }
.terms label:nth-last-child(-n+2) { grid-column: span 3; }
.terms input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.terms span { display: block; text-align: center; border: 1px solid var(--border); border-radius: 7px; padding: 5px 10px; font-size: 14px; }
.terms input:checked + span { background: var(--soft); border-color: #8eb49c; color: var(--accent-ink); }
.terms input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.issued { display: grid; gap: 9px; margin-top: 20px; padding: 13px; background: #eff6ef; border: 1px solid #d6e6d8; border-radius: 9px; }
.issued input { font-family: "IBM Plex Mono", Consolas, monospace; font-size: 13px; margin-top: 0; }
.issued .button { justify-self: start; }

.records-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.records-header h2 span { font-size: 13px; font-weight: 500; margin-left: 4px; white-space: nowrap; }
.records-controls { display: flex; align-items: center; gap: 7px; }
.records-controls select { font-size: 14px; min-height: 39px; }
.list-feedback:not(:empty) { margin-top: 8px; }
.empty { margin-top: 18px; padding: 23px 0; color: var(--muted); border-top: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 14px; }
th, td { text-align: left; padding: 10px 9px 10px 0; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; border-bottom: 1px solid #cddbd1; white-space: nowrap; }
td { border-bottom: 1px solid var(--border); }
td:last-child, th:last-child { text-align: right; padding-right: 0; }
.records td:first-child { max-width: 175px; overflow-wrap: anywhere; }
.record-note { display: block; color: var(--muted); font-size: 12px; }
.records code { color: var(--accent-ink); font: 13px "IBM Plex Mono", Consolas, monospace; }
.state { display: inline-block; padding: 2px 7px; border-radius: 6px; color: var(--muted); background: #f1f2f1; white-space: nowrap; font-size: 12px; }
.state[data-state="active"] { color: var(--accent-ink); background: var(--soft); }
.state[data-state="revoked"], .state[data-state="banned"] { color: var(--danger); background: #faefe9; }
.row-actions { display: flex; flex-wrap: wrap; gap: 2px 5px; justify-content: flex-end; }
.row-actions .button, .ip-usage { min-height: 30px; padding: 3px 5px; font-size: 13px; }
.row-actions .is-danger, .ip-usage.is-danger { color: var(--danger); }
.ip-usage.is-danger { background: #fcece8; border-color: #e9a798; }
.over-limit { background: #fffbfa; }
.ips-dialog { width: min(820px, calc(100% - 28px)); padding: 24px; color: var(--ink); }
.ips-dialog > .muted { margin-top: 5px; }
.ips-dialog::backdrop { background: #0d281d65; }
.limit-form { margin-block: 16px 8px; max-width: 360px; }
.table-scroll { overflow-x: auto; }
.ips-dialog table { min-width: 650px; }
.ips-dialog .empty { padding-block: 10px; }
.url-control { display: flex; align-items: end; gap: 7px; }
.url-control input { min-width: 0; }
.release-addresses { display: grid; gap: 10px; margin-top: 17px; padding: 14px; border-radius: 9px; background: var(--soft); }
.release-addresses label { font-size: 13px; }
.release-entry { padding-block: 14px; border-top: 1px solid var(--border); }
.release-entry:first-child { margin-top: 18px; }
.release-entry-header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 11px; }
.release-entry-header strong { color: var(--accent-ink); }
.release-entry-header time, .release-entry p { font-size: 13px; }
.release-notes { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 5px; }
.revoke-dialog { width: min(380px, calc(100% - 28px)); padding: 24px; color: var(--ink); }
.revoke-dialog::backdrop { background: #0d281d65; }
.revoke-dialog p { margin-top: 9px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 1070px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .create, .records { padding: 20px; }
}

@media (max-width: 520px) {
  .brand { font-size: 14px; gap: 6px; }
  .page-heading { margin-block: 30px 19px; }
  .workspace { gap: 14px; }
  .records th { padding-bottom: 8px; }
  .records thead, .records th { position: absolute; clip-path: inset(50%); inline-size: 1px; block-size: 1px; overflow: hidden; }
  .records tbody { display: block; }
  .records tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding-block: 7px; border-top: 1px solid var(--border); }
  .records td { border: 0; padding: 3px 8px 3px 0; }
  .records td:first-child { max-width: none; }
  .records td:nth-child(2) { grid-column: 2; grid-row: 2; text-align: right; padding-right: 0; }
  .records td:nth-child(5) { grid-column: 2; grid-row: 1; text-align: right; padding-right: 0; }
  .records td:last-child { grid-column: 2; }
  .ips-dialog { padding: 18px; }
}
