:root {
  color-scheme: light;
  --paper: #f5f5ed;
  --card: #fffef9;
  --well: #f0f2e9;
  --ink: #1a3027;
  --pine: #1b513e;
  --on-pine: #fffff6;
  --mint: #e4efdf;
  --muted: #59675d;
  --rule: #d6dcd0;
  --focus: #3c8058;
  --danger: #843b35;
  --danger-bg: #faeae5;
  --warning: #735017;
  --warning-bg: #f7edd7;
  --mono: "SFMono-Regular", Menlo, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: "PingFang SC", Inter, "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper); font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, dl, dd, pre, ul, form { margin: 0; }
h1 { font-size: clamp(29px, 3.6vw, 42px); line-height: 1.2; font-weight: 720; letter-spacing: -.045em; }
h2 { font-size: 20px; line-height: 1.4; font-weight: 660; letter-spacing: -.025em; }
h3 { font-size: 16px; line-height: 1.45; }
a { color: var(--pine); text-underline-offset: .22em; overflow-wrap: anywhere; }
code, pre, .mono, .numeric { font-family: var(--mono); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 5; inset: 8px auto auto 8px; background: var(--card); border-radius: 6px; padding: 8px 12px; }
.site-head { background: var(--card); border-bottom: 1px solid var(--rule); }
.head-inner, .page { width: min(1200px, 100%); margin-inline: auto; padding-inline: clamp(16px, 4vw, 54px); }
.head-inner { display: flex; align-items: center; gap: 24px; min-height: 73px; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 11px; font-size: 18px; font-weight: 720; letter-spacing: -.025em; text-decoration: none; color: var(--ink); }
.mark { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; background: var(--pine); color: var(--on-pine); font: 600 18px/1 var(--mono); }
.nav-links, .account, .heading-group, .actions, .controls, .search { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; min-width: 0; }
.nav-links { gap: 4px; }
.nav-links a { padding: 6px 12px; color: var(--muted); border-radius: 7px; font-weight: 600; font-size: 13px; text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current] { background: var(--well); color: var(--pine); }
.account { margin-left: auto; gap: 10px; flex-wrap: nowrap; min-width: 0; }
.account-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.text-btn { background: transparent; border: 0; color: var(--pine); font: 600 13px/1.6 var(--sans); cursor: pointer; padding: 6px 2px; white-space: nowrap; }
.text-btn:hover, .small-link:hover, .back-link:hover { text-decoration: underline; }
.page { display: grid; align-content: start; gap: 20px; padding-block: clamp(26px, 4.5vw, 58px) 72px; }
.page > *, .workspace-grid > *, .presets-grid > * { min-width: 0; }
.page-head, .panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; }
.page-head { margin-bottom: 3px; }
.eyebrow, .back-link { display: block; margin-bottom: 8px; color: var(--muted); font-weight: 600; font-size: 12px; }
.eyebrow { letter-spacing: .09em; }
.back-link, .small-link { color: var(--pine); font-weight: 600; text-decoration: none; }
.small-link { font-size: 13px; }
.vin-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 8px; color: var(--muted); font: 500 13px/1.5 var(--mono); }
.vin { color: var(--ink); font-size: 14px; letter-spacing: .025em; overflow-wrap: anywhere; }
.panel, .auth-panel, .metrics { border: 1px solid var(--rule); border-radius: 16px; background: var(--card); }
.panel { display: grid; align-content: start; gap: 18px; padding: clamp(17px, 2.4vw, 28px); scroll-margin-top: 16px; }
.help, .count, .cell-note, .pagination, .empty { font-size: 13px; line-height: 1.65; color: var(--muted); overflow-wrap: anywhere; }
.help time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { padding: 14px; border-radius: 9px; background: var(--well); }
.heading-group { gap: 9px; }
.count { padding-inline: 7px; border-radius: 5px; background: var(--well); font-size: 12px; }
.btn, .unbind > summary { display: inline-flex; justify-content: center; align-items: center; min-width: 0; min-height: 40px; max-width: 100%; padding: 8px 15px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); color: var(--ink); font: 600 14px/1.5 var(--sans); text-align: center; text-decoration: none; cursor: pointer; }
.btn:hover, .unbind > summary:hover { border-color: var(--muted); background: var(--well); }
.btn-primary { border-color: var(--pine); background: var(--pine); color: var(--on-pine); }
.btn-primary:hover { background: var(--pine); border-color: var(--pine); box-shadow: inset 0 0 0 1px var(--on-pine); }
.btn-small, .unbind > summary { min-height: 33px; padding: 5px 10px; font-size: 12px; }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .55; cursor: default; }
.status { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; padding: 3px 9px; border-radius: 99px; color: var(--pine); background: var(--mint); font-size: 12px; font-weight: 650; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.status.off { color: var(--muted); background: var(--well); }
.status.warn { color: var(--warning); background: var(--warning-bg); }
.stack, .field, .side-stack, .notices { display: grid; align-content: start; gap: 16px; min-width: 0; }
.field { gap: 6px; }
label { font-size: 13px; font-weight: 600; }
input:not([type="hidden"], [type="checkbox"], [type="radio"]), select, textarea { display: block; min-width: 0; max-width: 100%; width: 100%; min-height: 40px; margin: 0; padding: 8px 11px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
select {
  appearance: none;
  cursor: pointer;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 48%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 52%);
  background-position: calc(100% - 15px) center, calc(100% - 10px) center;
  background-repeat: no-repeat;
  background-size: 5px 5px;
}
@media (forced-colors: active) { select { appearance: auto; } }
textarea, textarea.codebox, pre { background: var(--well); font: 400 14px/1.75 var(--mono); tab-size: 2; }
textarea { resize: vertical; }
textarea.codebox { padding: 15px 16px; }
pre { min-width: 0; max-width: 100%; padding: 13px 15px; border: 1px solid var(--rule); border-radius: 8px; overflow-wrap: anywhere; white-space: pre-wrap; }
.snapshot { max-height: 23rem; overflow-y: auto; }
.checkbox { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.checkbox input { width: 17px; height: 17px; margin: 0; accent-color: var(--pine); }
.controls { align-items: end; }
.controls > .field { flex: 1 1 180px; }
.replace-prompt, .notice { border-left: 3px solid var(--pine); padding: 10px 13px; border-radius: 5px; color: var(--ink); background: var(--mint); font-size: 13px; overflow-wrap: anywhere; }
.replace-prompt { display: grid; gap: 8px; margin-top: 10px; }
.notices { gap: 8px; }
.notice.error, .errorlist { color: var(--danger); background: var(--danger-bg); border-color: var(--danger); }
.notice.warning { color: var(--warning); background: var(--warning-bg); border-color: var(--warning); }
.errorlist { border-radius: 5px; padding: 6px 11px; list-style: none; font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-block: 19px; }
.metrics > div { min-width: 0; display: grid; align-content: start; gap: 4px; padding-inline: clamp(12px, 2.8vw, 34px); }
.metrics > div + div { border-left: 1px solid var(--rule); }
.metrics dt { color: var(--muted); font-size: 13px; }
.metrics dd { color: var(--pine); font: 600 clamp(20px, 2.7vw, 31px)/1.4 var(--mono); letter-spacing: -.045em; overflow-wrap: anywhere; }
.metrics dd time { font-size: .8em; }
.metrics small { margin-left: 5px; color: var(--muted); font: 500 13px var(--sans); }
.workspace-grid, .presets-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(270px, 1fr); gap: 19px; align-items: start; }
.side-stack { gap: 18px; }
.records { min-width: 0; }
.record + .record, .preset-item + .preset-item { border-top: 1px solid var(--rule); }
.record { padding-block: 11px; }
.record:first-child { padding-top: 0; }
.record:last-child { padding-bottom: 0; }
.record summary { display: flex; align-items: center; gap: 10px; list-style: none; font-weight: 600; cursor: pointer; }
.record summary::-webkit-details-marker, .unbind summary::-webkit-details-marker { display: none; }
.record summary::before { content: ""; flex: 0 0 7px; width: 7px; height: 7px; margin-left: 2px; border: solid var(--muted); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.record[open] > summary::before { transform: rotate(135deg); }
.record-text { display: grid; min-width: 0; flex: 1; font-size: 14px; overflow-wrap: anywhere; }
.record-text time { color: var(--muted); font: 400 12px/1.6 var(--mono); font-variant-numeric: tabular-nums; }
.record pre, .record-body { margin-top: 10px; }
.http-code { border-radius: 5px; font-size: 12px; font-weight: 600; color: var(--pine); background: var(--mint); padding: 2px 6px; }
.http-code.quiet { color: var(--muted); background: var(--well); }
.history-panel .record-text { grid-template-columns: minmax(130px, 1fr) minmax(135px, 1fr); align-items: center; gap: 3px 12px; }
.presets-grid { grid-template-columns: minmax(200px, 1fr) minmax(0, 2fr); }
.preset-list { display: grid; min-width: 0; }
.preset-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-radius: 7px; text-decoration: none; color: var(--ink); }
.preset-item strong { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.preset-item:hover, .preset-item[aria-current] { background: var(--well); }
.search input[type="search"] { width: min(100%, 225px); }
.roster-wrap { min-width: 0; }
.roster { width: 100%; border-collapse: collapse; font-size: 14px; }
.roster :is(th, td) { padding: 12px 10px; text-align: left; vertical-align: top; }
.roster thead th { background: var(--well); color: var(--muted); font-size: 12px; font-weight: 650; }
.roster tbody tr + tr { border-top: 1px solid var(--rule); }
.roster th[scope="row"] { min-width: 150px; }
.cell-note { display: block; margin-top: 3px; font-weight: 400; }
.roster .vin { font-size: 13px; }
.compact { gap: 5px; }
.unbind { max-width: 100%; }
.unbind > summary { list-style: none; color: var(--danger); }
.unbind[open] { width: 100%; }
.unbind-box { max-width: 30em; padding: 9px 0 0; color: var(--muted); font-size: 13px; }
.unbind-box form { margin-top: 7px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.auth-panel { display: grid; grid-template-columns: .95fr 1.05fr; width: min(830px, 100%); margin: clamp(0px, 3vw, 45px) auto 0; overflow: hidden; }
.auth-intro { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 45px; padding: clamp(24px, 3.8vw, 43px); overflow: hidden; background: #194837; color: #fffcf0; }
.auth-intro h1 { font-size: clamp(31px, 3.6vw, 42px); }
.auth-intro p { margin-top: 15px; max-width: 22em; color: #d6e4d6; font-size: 14px; line-height: 1.9; }
.auth-art { position: relative; width: 100%; height: 140px; pointer-events: none; }
.art-sheet { display: block; position: absolute; width: 127px; height: 84px; border: 1px solid #89a994; border-radius: 11px; transform: skewY(-13deg); }
.art-sheet-back { bottom: 32px; left: 21px; background: #315c47; opacity: .6; }
.art-sheet-front { display: grid; align-content: center; gap: 10px; bottom: 14px; left: 0; padding: 16px 15px; background: #28543f; }
.art-sheet-front i { display: block; height: 2px; width: 45%; background: #bed1b7; }
.art-sheet-front i:nth-child(2) { width: 80%; background: #86a38e; }
.art-sheet-front i:nth-child(3) { width: 62%; background: #86a38e; }
.auth-main { padding: clamp(23px, 4vw, 47px); }
.auth-form { margin-top: 22px; }
.auth-form > .btn { margin-top: 3px; }
.auth-alternate { margin-top: 22px; color: var(--muted); font-size: 13px; }
.auth-alternate a { font-weight: 600; }
.help ul { padding-left: 20px; }
@media (max-width: 800px) {
  .workspace-grid { grid-template-columns: minmax(0, 1.45fr) minmax(220px, 1fr); gap: 13px; }
  .head-inner { gap: 14px; }
  .nav-links a { padding-inline: 9px; }
}
@media (max-width: 680px) {
  .head-inner { min-height: 62px; flex-wrap: wrap; gap: 7px 12px; padding-block: 10px; }
  .nav-links { order: 3; width: 100%; }
  .account { gap: 7px; }
  .account-name { max-width: 11ch; }
  .workspace-grid, .presets-grid { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
  .metrics > div { padding: 12px 16px; }
  .metrics > div:nth-child(odd) { border-left: 0; }
  .metrics > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .auth-panel { grid-template-columns: 1fr; margin-top: 0; }
  .auth-intro { padding: 24px; }
  .auth-art { display: none; }
  .auth-intro p { max-width: none; margin-top: 7px; }
  .auth-main { padding: 24px; }
  .roster thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .roster, .roster tbody, .roster tbody tr, .roster tbody :is(th, td) { display: block; }
  .roster tbody tr { padding: 11px 0; }
  .roster tbody tr:first-child { padding-top: 0; }
  .roster tbody :is(th, td) { padding: 4px 0; }
  .roster td[data-label] { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
  .roster td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; margin-right: 3px; }
  .roster th[scope="row"] .cell-note { display: inline; margin-left: 7px; }
  .row-controls { margin-top: 4px; }
  .search { width: 100%; }
  .search input[type="search"] { flex: 1 1 125px; width: auto; }
}
@media (max-width: 420px) {
  .page { gap: 14px; }
  .panel { gap: 14px; }
  .metrics > div { padding-inline: 13px; }
  .metrics dt, .metrics small { font-size: 11px; }
  .metrics dd time { font-size: .72em; }
  .history-panel .record-text { grid-template-columns: 1fr; }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #19201c; --card: #212923; --well: #2b362e;
    --ink: #edf1e8; --pine: #b3dfc0; --on-pine: #183d2b; --mint: #2c4333;
    --muted: #b3c1b5; --rule: #435047; --focus: #9bd7a7;
    --danger: #ffc0b2; --danger-bg: #4b302b; --warning: #efd39a; --warning-bg: #413a29;
  }
}
.preset-toolbar { justify-content: space-between; }
.preset-delete-link { display: inline-flex; align-items: center; min-height: 40px; padding-inline: 4px; color: var(--danger); font-size: .875rem; text-decoration: none; }
.preset-delete-link:hover { text-decoration: underline; }
.preset-dialog { width: min(26rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); margin: auto; padding: 24px; border: 1px solid var(--rule); border-radius: 14px; background: var(--card); color: var(--ink); }
.preset-dialog:not([open]) { display: none; }
.preset-dialog::backdrop { background: rgb(0 0 0 / .45); }
.preset-dialog h2, .preset-confirm-page h2 { overflow-wrap: anywhere; }
.preset-dialog .help { margin-top: 8px; overflow-wrap: anywhere; }
.preset-dialog-actions { justify-content: flex-end; margin-top: 20px; }
.preset-confirm-page { width: min(100%, 30rem); margin-inline: auto; }
