:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  --ink: #192333;
  --mute: #526177;
  --stroke: #dce4ed;
  --accent: #1749ad;
  --red: #ad302a;
  background: #f4f7fb;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.topbar { height: 68px; padding: 0 max(24px, calc((100% - 1184px) / 2)); background: #fff; border-bottom: 1px solid var(--stroke); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { color: var(--ink); display: flex; gap: 12px; align-items: center; text-decoration: none; font-weight: 750; white-space: nowrap; }
.brand-mark { height: 32px; width: 28px; border-radius: 8px; display: grid; place-items: center; background: #1749ad; }
.brand-mark::before { content: ""; height: 17px; width: 10px; border: 2px solid white; border-radius: 3px; }
main { max-width: 1232px; margin: 0 auto; padding: 40px 24px 60px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(26px, 4vw, 35px); letter-spacing: -.035em; line-height: 1.28; }
h2 { font-size: 17px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-head p { color: var(--mute); margin-top: 8px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.metric, .panel { border: 1px solid var(--stroke); border-radius: 12px; background: #fff; }
.metric { display: grid; gap: 8px; padding: 15px 18px; color: var(--mute); }
.metric strong { font-size: 28px; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.2; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.green { background: #19805b; } .gray { background: #8491a4; } .amber { background: #a06715; }
.section-head { padding: 18px 20px; display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.controls { padding: 0 20px 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
button, input, select { font: inherit; }
button, select, input:not([type=checkbox]) { border: 1px solid #cbd6e3; border-radius: 7px; background: #fff; color: inherit; padding: 8px 11px; min-height: 39px; }
input[type=search] { width: 218px; }
input[type=checkbox] { accent-color: var(--accent); width: 17px; height: 17px; margin: 0; vertical-align: middle; cursor: pointer; }
button { cursor: pointer; font-weight: 620; white-space: nowrap; }
button:hover:not(:disabled) { filter: brightness(.96); background-color: #f2f6fb; }
button:disabled { cursor: default; opacity: .52; }
button.primary, button.primary:hover:not(:disabled) { color: #fff; background: var(--accent); border-color: var(--accent); }
button.danger, button.danger:hover:not(:disabled) { color: #fff; background: var(--red); border-color: var(--red); }
button.text-button { border-color: transparent; color: var(--accent); padding-inline: 5px; }
:focus-visible { outline: 2px solid #2365c8; outline-offset: 2px; }
.muted, .selected-count { color: var(--mute); font-size: 13px; }
.table-scroll { overflow: auto; }
table { width: 100%; min-width: 660px; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 16px; border-top: 1px solid #e7ecf3; vertical-align: top; }
th { background: #f7f9fc; color: #4c5b6e; font-size: 13px; font-weight: 650; }
th:first-child, td:first-child { padding-left: 20px; }
.checkbox-col { width: 52px; }
.device-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 7px; }
.device-name, .serial { display: block; overflow-wrap: anywhere; }
.device-name { font-weight: 700; }
button.rename-button { min-height: 30px; padding-block: 3px; font-size: 13px; }
.serial { color: var(--mute); font: 12px ui-monospace, monospace; margin-top: 5px; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 670; color: #45556d; background: #eef2f7; white-space: nowrap; }
.badge.online, .badge.succeeded { background: #e2f5eb; color: #126342; }
.badge.queued, .badge.running { background: #e8efff; color: #1749ad; }
.badge.partial, .badge.uncertain, .badge.needs_review { background: #fff3db; color: #805214; }
.badge.failed { background: #fbe9e7; color: #a22c26; }
.notice { margin-bottom: 16px; background: #edf3ff; color: #234b85; border: 1px solid #d0def8; border-radius: 8px; padding: 11px 14px; }
.error { color: #9e2824; line-height: 1.5; }
.empty { padding: 22px 20px; color: var(--mute); }
.history-panel { margin-top: 20px; }
.batch { border-top: 1px solid #e7ecf3; padding: 12px 20px; }
details summary { cursor: pointer; }
.batch summary { line-height: 1.8; }
.detail-list { margin: 8px 0 4px; padding-left: 20px; font-size: 13px; color: var(--mute); }
.detail-list li { margin-bottom: 4px; }
.login { max-width: 420px; margin: 7vh auto; padding: 26px; }
.login form, .login label { display: grid; gap: 7px; }
.login form { gap: 16px; margin-top: 22px; }
.stack, .stack label { display: grid; gap: 8px; }
.stack { margin-top: 16px; gap: 12px; }
.stack p { margin: 0; }
.guide-steps { padding-left: 22px; line-height: 1.65; }
.guide-steps li { margin-bottom: 8px; }
.command { display: block; padding: 10px 12px; margin: 8px 0; border-radius: 7px; background: #eef3fb; color: #223a58; overflow-wrap: anywhere; white-space: pre-wrap; }
.download { padding: 9px 12px; border-radius: 7px; background: var(--accent); color: #fff; font-weight: 650; text-decoration: none; }
dialog { border: 1px solid var(--stroke); border-radius: 13px; width: min(500px, calc(100% - 30px)); color: var(--ink); padding: 22px; box-shadow: 0 16px 60px #1d29452b; }
dialog::backdrop { background: #17284380; }
dialog p { margin-top: 12px; }
.target-list { margin: 12px 0; padding: 9px 13px 9px 29px; max-height: 160px; overflow: auto; background: #f4f7fb; border-radius: 7px; }
dialog h3 { font-size: 15px; margin: 18px 0 0; }
.guide-actions { margin-top: 12px; }
#guide details { margin-top: 14px; }
#guide form.stack button, #grant-list button { justify-self: start; }
.confirm-note { color: #8b332e; line-height: 1.55; }
.check-option { display: flex; gap: 9px; align-items: flex-start; line-height: 1.55; }
.check-option input { margin-top: 5px; flex: none; }
.dialog-actions { display: flex; justify-content: end; gap: 9px; margin-top: 20px; }
#rename-form .dialog-actions { margin-top: 4px; }
@media (max-width: 620px) {
  .topbar { padding-inline: 14px; }
  main { padding: 25px 12px 35px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .controls, .section-head { padding-inline: 12px; }
  input[type=search] { width: 177px; }
}
