:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #08111f;
  color: #e7eef8;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(33, 150, 243, .2), transparent 36rem),
    radial-gradient(circle at 100% 30%, rgba(73, 208, 179, .12), transparent 30rem),
    #08111f;
}
button, input { font: inherit; }
button {
  border: 0;
  border-radius: .7rem;
  padding: .72rem 1.05rem;
  color: #05101d;
  background: #73d8c1;
  font-weight: 750;
  cursor: pointer;
}
button:disabled { cursor: not-allowed; opacity: .45; }
.shell { width: min(1440px, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 5rem; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.4rem; }
.brand { display: flex; align-items: center; gap: 1rem; }
.brand-icon {
  width: 5rem; height: 5rem; flex: 0 0 auto; object-fit: cover;
  border: 2px solid rgba(115,216,193,.55); border-radius: 1.15rem;
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
}
.eyebrow { margin: 0 0 .45rem; color: #73d8c1; font-size: .75rem; font-weight: 800; letter-spacing: .2em; }
h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 3rem); letter-spacing: -.045em; }
h2 { margin: 0 0 1rem; font-size: 1.05rem; }
.subtitle, .muted, .generated { color: #8da1b9; }
.subtitle { margin: .55rem 0 0; }
.card, .metric {
  border: 1px solid rgba(166, 190, 220, .14);
  background: rgba(15, 29, 48, .78);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .16);
  backdrop-filter: blur(14px);
  border-radius: 1rem;
}
.card { padding: 1.25rem; margin-bottom: 1rem; }
.login-card { max-width: 32rem; margin: 5rem auto; }
.login-card p { color: #9bacc0; line-height: 1.55; }
form { display: grid; gap: .7rem; }
label, .label { color: #b8c7d9; font-size: .88rem; font-weight: 700; }
input[type="password"] {
  width: 100%; border: 1px solid #2b425e; border-radius: .7rem; padding: .8rem;
  color: #e7eef8; background: #091727; outline: none;
}
input[type="password"]:focus { border-color: #73d8c1; box-shadow: 0 0 0 3px rgba(115, 216, 193, .12); }
.ghost { color: #b8c7d9; background: rgba(255,255,255,.07); }
.compact { padding: .42rem .7rem; font-size: .78rem; }
.key-presets { display: flex; flex-wrap: wrap; gap: .45rem; }
.tabs {
  display: inline-flex; gap: .3rem; margin: 0 0 1rem; padding: .3rem;
  border: 1px solid rgba(166,190,220,.14); border-radius: .85rem;
  background: rgba(8,20,36,.82);
}
.tab { color: #91a5bc; background: transparent; padding: .62rem 1rem; }
.tab.active { color: #06131f; background: #73d8c1; }
.controls { display: grid; gap: 1.15rem; }
.control-block { display: grid; gap: .65rem; }
.choice-row { display: flex; flex-wrap: wrap; gap: .55rem; }
.choice { cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: block; border: 1px solid #2b425e; border-radius: 999px; padding: .5rem .8rem;
  color: #9fb0c4; background: rgba(2, 12, 25, .28); transition: .15s ease;
}
.choice input:checked + span { color: #07131f; background: #73d8c1; border-color: #73d8c1; }
.choice input:focus-visible + span { outline: 2px solid #9ce9d8; outline-offset: 2px; }
.refresh-row { display: flex; align-items: center; gap: .85rem; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 1rem 0; }
.metric { min-height: 8.6rem; padding: 1.15rem; display: flex; flex-direction: column; justify-content: space-between; }
.metric > span, .metric small { color: #8da1b9; }
.metric strong { font-size: clamp(1.2rem, 3vw, 1.75rem); overflow-wrap: anywhere; }
.metric small { font-size: .72rem; }
.detail-row, .quota-row, .account-head { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-top: 1px solid rgba(166,190,220,.1); }
.detail-row span, .quota-row span { color: #9fb0c4; text-align: right; }
.account-head { margin-top: .4rem; align-items: center; }
.quota-progress {
  display: block; width: 100%; height: 1rem; margin: 0 0 .8rem;
  overflow: hidden; border: 0; border-radius: 999px; background: #172a41; accent-color: #73d8c1;
}
.quota-progress::-webkit-progress-bar { background: #172a41; border-radius: 999px; }
.quota-progress::-webkit-progress-value { background: #73d8c1; border-radius: 999px; }
.quota-progress::-moz-progress-bar { background: #73d8c1; border-radius: 999px; }
.quota-cache { margin: .35rem 0 0; font-size: .8rem; }
.quota-usage-title { margin: 1.2rem 0 .7rem; font-size: .9rem; color: #b8c7d9; }
.quota-usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .65rem; }
.quota-stat {
  display: grid; gap: .5rem; min-height: 7.2rem; padding: .9rem;
  border: 1px solid rgba(166,190,220,.12); border-radius: .8rem;
  background: rgba(5,16,29,.42);
}
.quota-stat > span, .quota-stat small { color: #8398b0; }
.quota-stat > span { font-size: .76rem; font-weight: 750; }
.quota-stat strong { color: #e7eef8; font-size: 1.2rem; }
.quota-stat small { align-self: end; font-size: .7rem; line-height: 1.4; }
.monitor-toolbar { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1rem; }
.monitor-toolbar h2, .section-heading h2 { margin-bottom: .35rem; }
.monitor-note, .section-heading p { margin: 0; font-size: .82rem; }
.monitor-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; justify-content: flex-end; }
.monitor-toolbar .error { grid-column: 1 / -1; }
.monitor-card { padding: 0; overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem; }
.count-badge {
  flex: 0 0 auto; color: #73d8c1; background: rgba(115,216,193,.1);
  border: 1px solid rgba(115,216,193,.24); border-radius: 999px;
  padding: .28rem .62rem; font-size: .75rem; font-weight: 800;
}
.table-scroll { width: 100%; overflow-x: auto; border-top: 1px solid rgba(166,190,220,.1); }
.monitor-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .82rem; }
.request-scroll {
  overflow-x: auto; overscroll-behavior-inline: contain; scroll-padding-right: .8rem;
  padding-bottom: .25rem; -webkit-overflow-scrolling: touch;
}
.request-table { width: calc(100% - .8rem); min-width: 1200px; margin-right: .8rem; table-layout: fixed; }
.monitor-table th, .monitor-table td {
  padding: .72rem .8rem; text-align: left; white-space: nowrap;
  border-bottom: 1px solid rgba(166,190,220,.08);
}
.request-table th, .request-table td { padding: .52rem .48rem; }
.request-table th:first-child, .request-table td:first-child { width: 9.5rem; padding-left: .68rem; }
.request-table th:nth-child(2), .request-table td:nth-child(2) { width: 8.2rem; }
.request-table th:nth-child(3), .request-table td:nth-child(3) { width: 13.8rem; }
.request-table th:nth-child(4), .request-table td:nth-child(4),
.request-table th:nth-child(5), .request-table td:nth-child(5) { width: 6.2rem; }
.request-table th:nth-child(6), .request-table td:nth-child(6) { width: 6.3rem; }
.request-table th:nth-child(7), .request-table td:nth-child(7),
.request-table th:nth-child(8), .request-table td:nth-child(8) { width: 5.8rem; }
.request-table th:nth-child(9), .request-table td:nth-child(9) { width: 6.6rem; }
.request-table th:last-child, .request-table td:last-child { width: 7.6rem; padding-right: 1rem; }
.request-table th:nth-child(n+4), .request-table td:nth-child(n+4) { text-align: right; }
.monitor-table th {
  color: #8297af; background: rgba(5,16,29,.58); font-size: .72rem;
  font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.monitor-table tbody tr:hover { background: rgba(115,216,193,.045); }
.monitor-table tbody tr:last-child td { border-bottom: 0; }
.monitor-table .model-cell { max-width: 15rem; overflow: hidden; text-overflow: ellipsis; color: #b9caDB; }
.model-status-cell { overflow: hidden; }
.model-status-wrap { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.model-status-wrap .model-text { flex: 1 1 auto; min-width: 0; max-width: none; }
.model-status-wrap .status-pill { flex: 0 0 auto; }
.model-text { overflow: hidden; text-overflow: ellipsis; color: #b9cadb; }
.monitor-table .key-cell { overflow: hidden; text-overflow: ellipsis; color: #73d8c1; font-weight: 750; }
.monitor-table .time-cell { color: #8fa5bc; font-variant-numeric: tabular-nums; }
.monitor-table .number-cell { font-variant-numeric: tabular-nums; }
.monitor-table .cost-cell { color: #f0c981; font-weight: 750; }
.empty-cell { color: #748aa2; text-align: center !important; padding: 2.2rem !important; }
.status-pill { display: inline-flex; border-radius: 999px; padding: .2rem .52rem; font-size: .72rem; font-weight: 800; }
.status-pill.ok { color: #7ce6bf; background: rgba(40,181,129,.14); }
.status-pill.failed { color: #ff9a9a; background: rgba(235,72,72,.15); }
.badge { border-radius: 999px; padding: .25rem .6rem; font-size: .75rem; font-weight: 800; }
.badge.healthy { color: #7ce6bf; background: rgba(40,181,129,.15); }
.badge.stale, .badge.unknown { color: #ffd38c; background: rgba(236,158,48,.15); }
.badge.exhausted { color: #ff9a9a; background: rgba(235,72,72,.16); }
.error { min-height: 1.2em; margin: 0; color: #ff9a9a; }
.generated { text-align: right; font-size: .8rem; }
.hidden { display: none !important; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 1rem); padding-top: 1.25rem; }
  .brand-icon { width: 4rem; height: 4rem; border-radius: .9rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-toolbar { grid-template-columns: 1fr; align-items: start; }
  .monitor-actions { justify-content: flex-start; }
  .quota-usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-row, .quota-row { flex-direction: column; gap: .35rem; }
  .detail-row span, .quota-row span { text-align: left; }
}
@media (max-width: 1232px) {
  .request-scroll { overflow-x: scroll; }
}
@media (max-width: 460px) {
  .metrics, .quota-usage-grid { grid-template-columns: 1fr; }
}
