:root {
  color-scheme: light dark;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #edf2f7;
  --text: #101828;
  --muted: #64748b;
  --line: #d9e2ec;
  --primary: #116b8f;
  --primary-strong: #0d5672;
  --good: #12805c;
  --warn: #b7791f;
  --bad: #c2413d;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    linear-gradient(135deg, rgba(17, 107, 143, 0.10), transparent 34%),
    linear-gradient(315deg, rgba(18, 128, 92, 0.10), transparent 30%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body.checker-page {
  background: #f6f7f9;
}

.material-symbols-outlined { font-size: 20px; line-height: 1; }
.page-shell, .admin-shell { padding: 28px; }
.customer-layout, .admin-layout { width: min(1180px, 100%); margin: 0 auto; }
.customer-layout { display: grid; gap: 18px; }

.lookup-panel, .admin-login, .admin-card, .status-card, .metric-card, .details-card, .summary-grid article {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lookup-panel { padding: 26px; display: grid; gap: 24px; }
.brand-row, .admin-header, .section-title { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0f6b83;
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 5vw, 48px); line-height: 1.02; letter-spacing: 0; }
.admin-header h1 { font-size: 34px; }
h2 { font-size: 24px; }
h3 { font-size: 16px; }
p, .muted, label, dt { color: var(--muted); }

.key-form label, .stack-form label, .generate-grid label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.input-row { display: grid; grid-template-columns: 1fr 44px auto; gap: 10px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 13px 14px;
  font: inherit;
  outline: none;
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(17, 107, 143, 0.16); }
button { font: inherit; border: 0; cursor: pointer; }
.primary-button, .ghost-button, .icon-button {
  height: 46px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  white-space: nowrap;
}
.primary-button { background: var(--primary); color: white; padding: 0 18px; }
.primary-button:hover { background: var(--primary-strong); }
.ghost-button { background: var(--surface-soft); color: var(--text); padding: 0 14px; }
.icon-button { width: 46px; background: var(--surface-soft); color: var(--text); }
button:disabled { opacity: 0.62; cursor: wait; }

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  font-weight: 700;
}
.notice.good { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }

.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.wide-card { grid-column: span 4; }
.status-card { padding: 22px; display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.status-pill { padding: 8px 12px; border-radius: 999px; font-weight: 900; background: var(--surface-soft); }
.status-pill.active { background: #dcfce7; color: var(--good); }
.status-pill.blocked { background: #fee2e2; color: var(--bad); }
.metric-card { padding: 18px; display: grid; gap: 10px; min-height: 142px; }
.metric-card span { color: var(--primary); }
.metric-card strong { font-size: 30px; letter-spacing: 0; }
.details-card { padding: 18px; display: grid; gap: 16px; grid-column: span 2; }
dl { display: grid; gap: 10px; margin: 0; }
dl div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 9px; }
dd { margin: 0; font-weight: 800; text-align: right; }
.bar-chart { display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 8px; min-height: 180px; }
.bar { display: grid; gap: 7px; text-align: center; color: var(--muted); font-size: 12px; }
.bar-fill { min-height: 6px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #0f6b83, #16a085); }

.checker-layout {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.checker-page {
  background:
    linear-gradient(180deg, #eef4f8 0%, #f7f8fa 46%, #f6f7f9 100%);
}

.checker-topbar,
.checker-hero,
.key-overview,
.metric-tile,
.clean-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.checker-topbar {
  min-height: 64px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.compact-brand strong,
.compact-brand span {
  display: block;
}

.compact-brand strong {
  font-size: 15px;
}

.compact-brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 8px;
  background: #e8eef4;
  color: #203040;
  text-decoration: none;
  font-weight: 800;
}

.checker-hero {
  padding: clamp(18px, 3vw, 30px);
  display: grid;
  grid-template-columns: minmax(270px, 0.9fr) minmax(390px, 1.1fr);
  gap: 28px;
  align-items: end;
}

.checker-copy {
  display: grid;
  gap: 10px;
}

.checker-copy h1 {
  max-width: 640px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.96;
}

.checker-copy p {
  max-width: 540px;
  font-size: 16px;
  line-height: 1.55;
}

.checker-form {
  display: grid;
  gap: 9px;
}

.checker-form label {
  color: #536171;
  font-size: 13px;
  font-weight: 800;
}

.checker-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px auto;
  gap: 10px;
}

.checker-result {
  display: grid;
  gap: 14px;
}

.key-overview {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.key-title-block {
  min-width: 0;
}

.key-overview h2 {
  margin-top: 4px;
  font-size: clamp(24px, 3vw, 34px);
  overflow-wrap: anywhere;
}

.key-state-block {
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.metric-tile {
  min-height: 134px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  box-shadow: none;
}

.metric-tile .material-symbols-outlined {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef4f8;
}

.metric-tile p {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-tile strong {
  font-size: clamp(19px, 2.2vw, 28px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.accent-blue .material-symbols-outlined { color: #0f6b83; background: #e8f4f7; }
.accent-green .material-symbols-outlined { color: #12805c; background: #e8f7ef; }
.accent-violet .material-symbols-outlined { color: #6252a2; background: #f0edf8; }
.accent-amber .material-symbols-outlined { color: #9a6700; background: #fff5db; }
.accent-red .material-symbols-outlined { color: #b4232d; background: #fdecec; }

.checker-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 14px;
}

.clean-panel {
  padding: 18px;
  box-shadow: none;
}

.chart-panel {
  grid-column: 1 / -1;
}

.compact-title {
  margin-bottom: 14px;
}

.compact-title h3 {
  font-size: 18px;
}

.budget-list {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.budget-row {
  display: grid;
  gap: 8px;
}

.budget-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.budget-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef4;
}

.budget-meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #12805c, #0f6b83);
  transition: width 220ms ease;
}

.budget-meter.unlimited span {
  background: transparent;
}

.compact-dl {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.budget-panel dl div,
.details-card dl div {
  align-items: flex-start;
}

.budget-panel dd,
.details-card dd {
  max-width: 64%;
  overflow-wrap: anywhere;
}

.empty-chart {
  align-self: center;
  justify-self: center;
}

.admin-layout { display: grid; gap: 18px; }
.admin-login { width: min(520px, 100%); margin: 12vh auto 0; padding: 26px; display: grid; gap: 24px; }
.stack-form { display: grid; gap: 12px; }
.admin-header { justify-content: space-between; margin-bottom: 18px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.summary-grid article { padding: 18px; box-shadow: none; }
.summary-grid span { color: var(--muted); font-size: 13px; font-weight: 700; }
.summary-grid strong { display: block; margin-top: 6px; font-size: 28px; }
.admin-columns { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); gap: 14px; }
.admin-card { padding: 18px; box-shadow: none; }
.section-title { margin-bottom: 14px; }
.section-title h2 { font-size: 18px; }
.section-title .icon-button { margin-left: auto; }
.generate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.generate-grid .full { grid-column: 1 / -1; }
.check-row { display: flex !important; align-items: center; gap: 9px !important; color: var(--text); }
.check-row input { width: auto; }
.keys-output { height: 264px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.model-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 45%, transparent);
}
.model-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.model-panel-head strong { display: block; font-size: 14px; }
.model-panel-head span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.model-actions { display: flex; gap: 8px; }
.model-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}
.model-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.model-option input { width: auto; margin-top: 2px; }
.model-option small { display: block; margin-top: 3px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.table-card { margin-top: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.tiny-button { height: 34px; padding: 0 10px; border-radius: 8px; background: var(--surface-soft); color: var(--text); font-weight: 800; }
.tiny-button.danger { background: #fee2e2; color: #b91c1c; }
.state-ok { color: var(--good); font-weight: 900; }
.state-bad { color: var(--bad); font-weight: 900; }

@media (max-width: 860px) {
  .page-shell, .admin-shell { padding: 14px; }
  .input-row { grid-template-columns: 1fr 44px; }
  .input-row .primary-button { grid-column: 1 / -1; }
  .result-grid, .summary-grid, .admin-columns { grid-template-columns: 1fr; }
  .wide-card, .details-card { grid-column: span 1; }
  .status-card, .admin-header { align-items: flex-start; flex-direction: column; }
  .generate-grid { grid-template-columns: 1fr; }
  .model-options { grid-template-columns: 1fr; }
  .checker-hero,
  .metric-strip,
  .checker-grid {
    grid-template-columns: 1fr;
  }
  .checker-input-row {
    grid-template-columns: 1fr 46px;
  }
  .checker-input-row .primary-button {
    grid-column: 1 / -1;
  }
  .key-overview {
    align-items: flex-start;
    flex-direction: column;
  }
  .chart-panel {
    grid-column: span 1;
  }
  .budget-panel dd,
  .clean-card dd {
    max-width: 100%;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10141b;
    --surface: #151c25;
    --surface-soft: #1f2a36;
    --text: #eef3f8;
    --muted: #9aa7b6;
    --line: #2d3a49;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  }
  .notice { background: #3b260f; color: #fed7aa; border-color: #7c4a12; }
  .notice.good { background: #0f2f24; color: #a7f3d0; border-color: #14553f; }
  .status-pill.active { background: #0f2f24; color: #a7f3d0; }
  .status-pill.blocked { background: #3f1717; color: #fecaca; }
  body.checker-page { background: #10141b; }
  .checker-hero,
  .key-overview,
  .metric-strip article,
  .budget-panel,
  .clean-card,
  .chart-panel {
    background: rgba(21, 28, 37, 0.94);
    border-color: var(--line);
  }
}

/* Customer key checker refresh */
.apple-checker {
  width: min(1220px, 100%);
}

.checker-page {
  background:
    radial-gradient(circle at 16% 0%, rgba(0, 122, 255, 0.09), transparent 30%),
    linear-gradient(180deg, #f7f8fb 0%, #eef2f7 100%);
}

.pro-hero,
.pro-panel,
.lookup-card,
.metric-tile {
  border: 1px solid rgba(210, 215, 224, 0.86);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 22px 60px rgba(24, 34, 48, 0.08);
  backdrop-filter: blur(18px);
}

.pro-hero {
  grid-template-columns: minmax(300px, 0.92fr) minmax(420px, 1.08fr);
  align-items: center;
  border-radius: 26px;
  padding: clamp(24px, 4vw, 40px);
}

.client-brand {
  margin-bottom: 14px;
}

.client-brand .brand-mark {
  background: linear-gradient(145deg, #0f6b83, #157f62);
}

.lookup-card {
  border-radius: 20px;
  padding: 18px;
}

.pro-panel {
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(24, 34, 48, 0.07);
}

.metric-strip {
  gap: 14px;
}

.metric-tile {
  min-height: 148px;
  border-radius: 18px;
  padding: 18px;
}

.metric-tile .material-symbols-outlined {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.metric-tile strong {
  color: #06162d;
  font-size: clamp(24px, 2.7vw, 34px);
  letter-spacing: 0;
}

.pro-grid {
  grid-template-columns: minmax(360px, 0.86fr) minmax(0, 1.14fr);
  align-items: stretch;
}

.monthly-panel,
.details-card,
.chart-panel {
  padding: 22px;
}

.monthly-body {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
}

.budget-ring {
  --percent: 0;
  width: 184px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(#007aff calc(var(--percent) * 1%), #dce5ef 0);
  box-shadow: inset 0 0 0 1px rgba(210, 215, 224, 0.72), 0 18px 34px rgba(15, 23, 42, 0.08);
}

.budget-ring.unlimited {
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(#cfd8e3 0 100%);
}

.budget-ring > div {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: #fff;
  text-align: center;
}

.budget-ring strong {
  display: block;
  color: #06162d;
  font-size: 30px;
  line-height: 1;
}

.budget-ring span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.budget-stats {
  display: grid;
  gap: 12px;
}

.budget-stats div,
.details-card dl div {
  min-height: 42px;
  align-items: center;
  padding: 0 0 12px;
}

.budget-stats dd,
.details-card dd {
  color: #06162d;
  font-size: 16px;
}

.panel-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f3f6fa;
  color: #536171;
  font-size: 13px;
  line-height: 1.45;
}

.chart-panel {
  grid-column: 1 / -1;
}

.chart-head {
  align-items: flex-start;
  justify-content: space-between;
}

.chart-head > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-head p {
  font-weight: 800;
}

.pro-chart {
  min-height: 250px;
  padding: 10px 0 0;
  align-items: end;
  gap: 14px;
}

.pro-chart .bar {
  min-width: 0;
  grid-template-rows: 184px auto auto;
  align-items: end;
}

.pro-chart .bar-track {
  width: 100%;
  height: 184px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(180deg, #f5f7fa, #edf2f7);
  overflow: hidden;
}

.pro-chart .bar-fill {
  width: min(42px, 58%);
  min-height: 6px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, #007aff, #28c76f);
  box-shadow: 0 10px 22px rgba(0, 122, 255, 0.20);
}

.pro-chart .bar.empty .bar-fill {
  background: #cfd8e3;
  box-shadow: none;
}

.pro-chart .bar strong {
  color: #06162d;
  font-size: 13px;
}

.pro-chart .bar span {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 920px) {
  .pro-hero,
  .pro-grid,
  .monthly-body {
    grid-template-columns: 1fr;
  }

  .budget-ring {
    width: min(184px, 72vw);
    justify-self: center;
  }
}

@media (prefers-color-scheme: dark) {
  .checker-page {
    background: linear-gradient(180deg, #10141b 0%, #121821 100%);
  }

  .pro-hero,
  .pro-panel,
  .lookup-card,
  .metric-tile {
    background: rgba(21, 28, 37, 0.92);
    border-color: var(--line);
  }

  .metric-tile strong,
  .budget-ring strong,
  .budget-stats dd,
  .details-card dd,
  .pro-chart .bar strong {
    color: var(--text);
  }

  .budget-ring,
  .budget-ring > div {
    background-color: var(--surface);
  }

  .budget-ring {
    background:
      radial-gradient(circle at center, var(--surface) 0 58%, transparent 59%),
      conic-gradient(#3b82f6 calc(var(--percent) * 1%), #2d3a49 0);
  }

  .budget-ring.unlimited {
    background:
      radial-gradient(circle at center, var(--surface) 0 58%, transparent 59%),
      conic-gradient(#2d3a49 0 100%);
  }

  .panel-note,
  .pro-chart .bar-track {
    background: var(--surface-soft);
  }
}
/* Layout fixes for checker panels */
.pro-grid .details-card {
  grid-column: auto;
  align-content: start;
}

.pro-grid .chart-panel {
  grid-column: 1 / -1;
}

@media (max-width: 920px) {
  .pro-grid .details-card,
  .pro-grid .chart-panel {
    grid-column: auto;
  }
}
/* Admin capacity, status and key operations */
.header-actions { display: flex; align-items: center; gap: 10px; }
.admin-insight-grid { display: grid; grid-template-columns: minmax(360px, 1.1fr) minmax(280px, 0.95fr) minmax(280px, 0.95fr); gap: 14px; margin-bottom: 14px; }
.capacity-card { display: grid; gap: 14px; }
.capacity-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.capacity-hero div { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--surface-soft) 55%, transparent); }
.capacity-hero span, .calculator-row span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.capacity-hero strong { display: block; margin-top: 6px; font-size: clamp(24px, 3vw, 34px); color: var(--text); }
.capacity-meter { height: 10px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.capacity-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #12805c, #007aff, #b7791f); transition: width 220ms ease; }
.admin-dl div { align-items: center; }
.calculator-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, auto); gap: 12px; align-items: end; }
.calculator-row > div { min-height: 68px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.calculator-row strong { display: block; margin-top: 5px; font-size: 28px; }
.server-list, .error-list { display: grid; gap: 10px; }
.server-item, .error-item { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.server-item { display: grid; gap: 10px; border-left: 4px solid var(--warn); }
.server-item.ok { border-left-color: var(--good); }
.server-item.bad { border-left-color: var(--bad); }
.server-item strong, .server-item span { display: block; overflow-wrap: anywhere; }
.server-item span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.server-item dl, .server-item dl div { margin: 0; }
.server-item dl { display: grid; gap: 6px; }
.server-item dl div { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 0; }
.server-item dd { font-size: 13px; }
.error-item { display: grid; gap: 5px; }
.error-item span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.error-item small { color: var(--muted); font-size: 11px; }
.form-hint { margin: -2px 0 0; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--surface-soft) 65%, transparent); font-size: 12px; line-height: 1.45; }
.generated-card { display: grid; align-content: start; gap: 12px; }
.copy-note { font-size: 12px; }
.table-title { align-items: center; }
.key-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 220px; gap: 10px; margin-bottom: 12px; }
.key-toolbar select { width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; padding: 0 12px; font: inherit; height: 46px; }
.keys-table { min-width: 1120px; }
.tail { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.comment-cell { max-width: 220px; overflow-wrap: anywhere; }
.limit-stack { display: grid; gap: 9px; min-width: 190px; }
.mini-budget { display: grid; gap: 5px; min-width: 160px; }
.mini-budget span, .mini-budget small { font-size: 12px; color: var(--muted); }
.mini-budget b { color: var(--text); }
.mini-budget i { display: block; height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.mini-budget em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #12805c, #007aff); }
.token-budget em { background: linear-gradient(90deg, #7c3aed, #f59e0b); }
.status-page-layout { gap: 18px; }
.status-hero { align-items: stretch; }
.status-summary-card { display: grid; align-content: center; gap: 8px; }
.status-summary-card strong { color: var(--text); font-size: clamp(24px, 3vw, 38px); }
.public-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.public-status-card { padding: 20px; border-left: 5px solid var(--warn); }
.public-status-card.ok { border-left-color: var(--good); }
.public-status-card.bad { border-left-color: var(--bad); }
.alias-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.alias-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 800; }
.alias-pill.ok { color: var(--good); background: #dcfce7; }
.alias-pill.bad { color: var(--bad); background: #fee2e2; }

@media (max-width: 1040px) {
  .admin-insight-grid, .public-status-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .header-actions, .capacity-hero, .calculator-row, .key-toolbar { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
  .header-actions .ghost-button { width: 100%; }
}

@media (prefers-color-scheme: dark) {
  .alias-pill.ok { background: #0f2f24; color: #a7f3d0; }
  .alias-pill.bad { background: #3f1717; color: #fecaca; }
}

.load-more-keys { width: min(360px, 100%); margin: 16px auto 0; display: flex; justify-content: center; }
