:root {
  color-scheme: dark;
  --bg: #08090a;
  --panel: #0f1011;
  --surface: rgba(255,255,255,.025);
  --surface-2: rgba(255,255,255,.045);
  --border: rgba(255,255,255,.08);
  --border-soft: rgba(255,255,255,.05);
  --text: #f7f8f8;
  --secondary: #d0d6e0;
  --muted: #8a8f98;
  --quiet: #62666d;
  --accent: #7170ff;
  --accent-deep: #5e6ad2;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef6262;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv01", "ss03";
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 52% -20%, rgba(113,112,255,.18), transparent 32rem),
    linear-gradient(180deg, #0b0c0e 0%, var(--bg) 30rem);
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(8,9,10,.82);
  backdrop-filter: blur(18px);
}
.brand, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.brand { font-size: 14px; font-weight: 590; letter-spacing: -.15px; }
.topbar-actions { gap: 10px; }
.user-chip {
  padding: 7px 11px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.brand-mark { display: flex; align-items: end; justify-content: center; gap: 4px; height: 38px; }
.brand-mark span { width: 6px; border-radius: 2px; background: linear-gradient(180deg, #9594ff, var(--accent-deep)); }
.brand-mark span:nth-child(1) { height: 15px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 28px; }
.brand-mark span:nth-child(3) { height: 21px; opacity: .8; }
.brand-mark.small { width: 20px; height: 22px; gap: 2px; }
.brand-mark.small span { width: 3px; }
.brand-mark.small span:nth-child(1) { height: 8px; }
.brand-mark.small span:nth-child(2) { height: 17px; }
.brand-mark.small span:nth-child(3) { height: 12px; }

.button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--secondary);
  background: rgba(255,255,255,.03);
  font-size: 13px;
  font-weight: 510;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.button:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
.button:active { transform: translateY(1px); }
.button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.button-primary {
  width: 100%;
  min-height: 44px;
  border-color: transparent;
  color: white;
  background: var(--accent-deep);
  box-shadow: 0 10px 30px rgba(94,106,210,.2);
}
.button-primary:hover { background: var(--accent); border-color: transparent; }
.button-ghost { min-height: 34px; }

.dashboard-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0 96px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 48px; }
.hero h1 {
  margin: 8px 0 18px;
  max-width: 720px;
  font-size: clamp(42px, 6vw, 68px);
  line-height: .98;
  letter-spacing: -2.6px;
  font-weight: 510;
}
.hero h1 span { color: var(--muted); }
.hero-copy { max-width: 600px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.eyebrow {
  margin: 0;
  color: var(--quiet);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .13em;
}
.hero-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.018);
  font-size: 12px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(16,185,129,.1); }
.hero-status.is-warning .status-dot { background: var(--warning); box-shadow: 0 0 0 4px rgba(245,158,11,.1); }

.provider-grid { display: grid; gap: 18px; }
.provider-card {
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.provider-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.provider-head h2 { margin: 7px 0 0; font-size: 25px; font-weight: 510; letter-spacing: -.55px; }
.provider-meta { display: flex; flex-wrap: wrap; gap: 20px; margin: 18px 0 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border-soft); color: var(--quiet); font-size: 12px; }
.provider-meta strong { margin-left: 4px; color: var(--secondary); font-weight: 510; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--border-soft); border-radius: 999px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.status-pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--quiet); }
.status-success span { background: var(--success); }
.status-stale span, .status-failed span { background: var(--warning); }

.limit-stack { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.limit-row, .model-card {
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(255,255,255,.018);
}
.limit-line, .limit-foot, .metric-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.limit-line strong { font-size: 15px; font-weight: 510; }
.limit-line span { color: var(--secondary); font-size: 13px; }
.limit-foot { margin-top: 8px; color: var(--quiet); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }

.progress {
  display: block;
  width: 100%;
  height: 7px;
  margin: 16px 0 0;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  appearance: none;
}
.progress::-webkit-progress-bar { background: rgba(255,255,255,.06); border-radius: 99px; }
.progress::-webkit-progress-value { border-radius: 99px; background: linear-gradient(90deg, var(--accent-deep), #9190ff); }
.progress::-moz-progress-bar { border-radius: 99px; background: linear-gradient(90deg, var(--accent-deep), #9190ff); }
.progress.compact { height: 5px; margin-top: 10px; }

.model-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.model-title { display: flex; justify-content: space-between; margin-bottom: 16px; }
.model-title strong { display: block; font-size: 14px; font-weight: 510; }
.model-title span { display: block; margin-top: 4px; color: var(--quiet); font-size: 11px; }
.metric-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.metric { min-width: 0; padding: 12px; border-radius: 8px; background: rgba(255,255,255,.022); }
.metric-top span { color: var(--quiet); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.metric-top strong { color: var(--secondary); font-size: 12px; font-weight: 510; }
.metric code { display: block; overflow: hidden; margin-top: 8px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.data-note { margin: 18px 0 0; color: var(--quiet); font-size: 11px; }

.alert { margin: 14px 0; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--secondary); font-size: 12px; }
.alert-error { border-color: rgba(239,98,98,.25); background: rgba(239,98,98,.08); }
.alert-warning { border-color: rgba(245,158,11,.24); background: rgba(245,158,11,.07); }
.empty-state { padding: 42px; border: 1px dashed var(--border); border-radius: 14px; text-align: center; }
.empty-state h2 { margin: 0; font-weight: 510; }
.empty-state p { color: var(--muted); }

.auth-page { display: grid; place-items: center; padding: 24px; }
.auth-shell { width: min(420px, 100%); }
.auth-card {
  padding: 38px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  box-shadow: 0 30px 100px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.03);
}
.auth-card .brand-mark { justify-content: start; margin-bottom: 24px; }
.auth-card h1 { margin: 8px 0 10px; font-size: 36px; font-weight: 510; letter-spacing: -1.1px; }
.auth-card .muted { margin: 0 0 26px; color: var(--muted); line-height: 1.6; }
.auth-form { display: grid; gap: 9px; }
.auth-form label { margin-top: 7px; color: var(--secondary); font-size: 12px; font-weight: 510; }
.auth-form input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  background: rgba(0,0,0,.2);
  outline: none;
}
.auth-form input:focus { border-color: rgba(113,112,255,.7); }
.auth-form .button { margin-top: 14px; }

@media (max-width: 760px) {
  .topbar { padding: 0 16px; }
  .topbar .button { min-height: 40px; padding-inline: 16px; }
  .user-chip { display: none; }
  .dashboard-shell { width: min(100% - 24px, 1180px); padding-top: 46px; }
  .hero { align-items: start; flex-direction: column; margin-bottom: 32px; }
  .hero h1 { font-size: clamp(38px, 12vw, 52px); letter-spacing: -1.7px; }
  .limit-stack, .model-list { grid-template-columns: 1fr; }
  .provider-card { padding: 18px; border-radius: 12px; }
  .provider-head h2 { font-size: 21px; }
  .metric-grid { gap: 6px; }
  .metric { padding: 9px; }
  .auth-card { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
