:root {
  color-scheme: light;
  --canvas: #f4f7f5;
  --surface: #fff;
  --text: #192923;
  --muted: #53675e;
  --line: #dbe5e0;
  --accent: #135c46;
  --accent-hover: #0d4736;
  --focus: #338764;
  font-family: "Instrument Sans", Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 14px; }
.top { background: #102c25; color:#f0f9f4; display:flex; align-items:center;
  justify-content:space-between; height: 62px; padding: 0 max(22px, calc((100% - 1170px)/2)); }
.top .button { color:inherit; }
.top .button.secondary { background:#204036; border-color:#476057; }
.top .button:hover { background:#305247; }
.brand, #session-actions { display: flex; align-items: center; gap: 12px; }
.brand { font-size: 15px; }
.mark { display:grid; place-items:center; width:32px; height:32px; background:#b9e8d0; color:#143f2d;
  border-radius:9px; font-size:18px; font-weight:700; }
main { max-width: 1214px; padding: 30px 22px 50px; margin: auto; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(29px, 4vw, 41px); letter-spacing: -.035em; line-height: 1.15; font-weight: 720; }
h2 { font-size: 18px; }
p { line-height: 1.55; }
.page-title, .section-title, .dialog-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.page-title { margin-bottom: 22px; }
.page-title p, .section-title p { margin-top: 6px; color: var(--muted); }
.summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 22px; }
.metric { border:1px solid var(--line); background:var(--surface); padding: 14px 18px; border-radius: 12px; }
.metric:last-child { background:#e8f4ec; border-color:#d3e8da; }
.metric strong { font-size: 25px; display:block; margin-top:6px; font-variant-numeric:tabular-nums; }
.panel { background:var(--surface); border:1px solid var(--line); border-radius: 14px; margin-top: 19px;
  overflow:hidden; box-shadow:0 2px 6px #173a2910; }
.keys-panel .section-title { padding-bottom:12px; }
.key-toolbar { display:flex; gap:12px; align-items:center; justify-content:space-between; padding:0 20px 14px; }
.key-filters { display:inline-flex; gap:3px; border:1px solid var(--line); border-radius:8px;
  background:#f3f6f4; padding:3px; }
.key-filters button { border:1px solid transparent; background:transparent; color:var(--muted);
  border-radius:5px; cursor:pointer; padding:5px 11px; font:inherit; font-weight:600; white-space:nowrap; }
.key-filters button[aria-pressed="true"] { background:white; border-color:var(--line); color:var(--accent); }
.key-filters button:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
.timezone { font-size:12px; }
.key-empty { border-top:1px solid var(--line); text-align:center; padding:30px 20px 34px; }
.key-empty strong { font-size:16px; }
.key-empty p { color:var(--muted); margin-top:5px; }
.loading { padding-top:7vh; text-align:center; }
.section-title { padding:18px 20px; }
.table-wrap { overflow-x:auto; }
table { border-collapse:collapse; text-align:left; width:100%; min-width: 790px; }
th, td { padding:13px 15px; vertical-align:middle; }
th { background:#f0f4f1; font-size:12px; color:#3e554a; white-space:nowrap; }
td { border-top:1px solid var(--line); line-height:1.55; }
td:first-child, th:first-child { padding-left:20px; }
td:last-child, th:last-child { padding-right:20px; }
td strong { display:block; }
.muted, small { color:var(--muted); }
small { font-size:12px; }
.mono { font: 12px ui-monospace, monospace; }
.badge { display:inline-block; padding:2px 8px; border-radius:6px; background:#edf0ee; color:#44564d;
  font-size:12px; font-weight:650; white-space:nowrap; }
.badge.good { background:#e2f2e7; color:#1e5b3e; }
.badge.warn { background:#fff0d6; color:#714a0b; }
.badge.bad { background:#fce5e4; color:#8a2929; }
.actions { display:flex; align-items:center; flex-wrap:wrap; gap:5px; }
.button { border:1px solid transparent; border-radius:7px; color:var(--text); cursor:pointer; padding:8px 11px;
  background:transparent; font:inherit; font-weight:600; white-space:nowrap; }
.button.primary { background:var(--accent); color:white; }
.button.primary:hover { background:var(--accent-hover); }
.button.secondary { border-color:var(--line); background:white; }
.button.quiet:hover, .button.secondary:hover { background:#edf3ef; }
.button.danger { color:#8a2929; background:#fce5e4; }
.button:disabled { opacity:.55; cursor:wait; }
.button:focus-visible, input:focus-visible, select:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
.key-name { max-width: 175px; overflow-wrap: anywhere; }
.key-switch-column { width: 124px; }
.key-switch { display:inline-flex; align-items:center; gap:7px; color:var(--muted); background:#f2f4f3;
  border:1px solid var(--line); border-radius:8px; padding:6px 9px; cursor:pointer; font:inherit;
  font-weight:600; white-space:nowrap; }
.key-switch[aria-checked="true"] { color:#1e5b3e; background:#e8f4ec; border-color:#cfe6d6; }
.key-switch:hover { filter:brightness(.95); }
.key-switch:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
.key-switch:disabled { opacity:.55; cursor:wait; }
.switch-track { display:inline-flex; align-items:center; width:32px; height:18px; border-radius:10px;
  padding:2px; background:#62776d; }
.switch-track::before { content:""; width:14px; height:14px; border-radius:50%; background:#fff; }
.key-switch[aria-checked="true"] .switch-track { background:var(--accent); justify-content:flex-end; }
.quota { min-width:112px; margin-bottom:5px; }
.quota:last-child { margin-bottom:0; }
progress { display:block; width:100%; max-width:145px; height:6px; margin:4px 0; accent-color:var(--accent); }
.login-panel { width:min(100%, 430px); margin:7vh auto 0; background:white; border:1px solid var(--line);
  padding:26px; border-radius:14px; }
.login-panel > p { margin:9px 0 20px; color:var(--muted); }
.login-panel .button { margin-top:12px; min-height:40px; }
form label, legend { display:block; color:#334b3f; font-size:13px; font-weight:600; }
input:not([type=checkbox]), select { display:block; font:inherit; padding:8px 10px; height:40px; width:100%; margin-top:4px;
  color:var(--text); background:#fff; border:1px solid #b8c8bf; border-radius:7px; }
input[type=checkbox] { accent-color: var(--accent); }
dialog { width:min(92vw,480px); padding:21px; border:1px solid var(--line); border-radius:12px; color:var(--text); }
dialog::backdrop { background:#132b22a8; }
dialog p, dialog label, dialog fieldset { margin-top:12px; }
.fields { display:grid; grid-template-columns:1fr 1fr; gap:0 12px; }
fieldset { border:1px solid var(--line); margin-inline:0; border-radius:7px; }
.checks { display:flex; flex-wrap:wrap; gap:8px 12px; }
.checks label { margin:0; }
.dialog-actions { display:flex; justify-content:flex-end; margin-top:15px; }
.error { color:#972828; }
.error:empty { display:none; }
#notice { padding:10px 14px; border-radius:7px; background:#e2f2e7; }
#notice.error { background:#fce5e4; }
@media (max-width: 650px) {
  main { padding: 23px 13px 38px; }
  .top { padding:0 13px; }
  .page-title { align-items:flex-start; flex-direction:column; }
  .summary { gap:6px; }
  .metric { padding:10px; }
  .metric strong { font-size:21px; }
  .section-title { padding:14px; }
  .key-toolbar { padding:0 14px 12px; }
  .timezone { display:none; }
}
