:root {
  color-scheme: light;
  --canvas: #f3f6f4;
  --surface: #ffffff;
  --surface-muted: #f7f9f8;
  --ink: #171b19;
  --muted: #65706a;
  --faint: #8b948f;
  --line: #dce3df;
  --line-strong: #cbd4cf;
  --green: #148a5a;
  --green-bright: #3dcf8e;
  --green-soft: #e7f7ef;
  --blue: #356ae6;
  --blue-soft: #ebf0ff;
  --coral: #e7654f;
  --coral-soft: #fff0ed;
  --dark: #151917;
  --sidebar: 244px;
  --shadow: 0 8px 28px rgba(21, 25, 23, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.5; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--dark); color: #eef3f0; padding: 20px 14px; display: flex; flex-direction: column; z-index: 30; }
.brand-row { display: flex; gap: 11px; align-items: center; padding: 0 8px 18px; }
.brand-row img { border: 1px solid #313834; border-radius: 8px; }
.brand-row strong, .brand-row span { display: block; letter-spacing: 0; }
.brand-row strong { font-size: 16px; line-height: 1.25; }
.brand-row span { color: #929d97; font-size: 11px; margin-top: 1px; }
.demo-label { margin: 0 8px 18px; padding: 7px 9px; border: 1px solid #343b37; background: #202522; border-radius: 6px; color: #aab3ae; font-size: 11px; display: flex; align-items: center; gap: 7px; }
.demo-label span { width: 6px; height: 6px; background: var(--green-bright); border-radius: 50%; }
.side-nav { display: grid; gap: 3px; }
.nav-item, .support-link { border: 0; background: transparent; color: #aab3ae; padding: 10px 11px; display: flex; gap: 10px; align-items: center; text-align: left; border-radius: 6px; cursor: pointer; width: 100%; }
.nav-item:hover, .support-link:hover { color: #fff; background: #242a27; }
.nav-item.active { color: #fff; background: #2b322e; box-shadow: inset 3px 0 var(--green-bright); }
.nav-item svg { width: 17px; height: 17px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #303632; padding-top: 16px; }
.system-state { display: flex; align-items: flex-start; gap: 9px; padding: 2px 8px 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-bright); margin-top: 5px; box-shadow: 0 0 0 3px rgba(61,207,142,.12); }
.system-state strong, .system-state small { display: block; }
.system-state strong { font-size: 11px; color: #dce4e0; }
.system-state small { color: #78837d; font-size: 10px; margin-top: 2px; }
.support-link { font-size: 12px; }

.main-area { margin-left: var(--sidebar); min-width: 0; }
.topbar { height: 64px; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); }
.topbar-left, .topbar-actions, .crumb { display: flex; align-items: center; }
.crumb { gap: 8px; font-size: 12px; }
.crumb span { color: var(--faint); }
.crumb svg { width: 13px; height: 13px; color: var(--faint); }
.topbar-actions { gap: 10px; }
.cohort-chip { border: 1px solid #cce9da; color: #0d6844; background: #eef9f3; border-radius: 999px; padding: 5px 10px; font-size: 11px; font-weight: 650; }
.icon-button, .avatar-button { border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; position: relative; }
.icon-button { width: 36px; height: 36px; border-radius: 6px; }
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-muted); }
.notification-dot { position: absolute; width: 6px; height: 6px; background: var(--coral); border: 2px solid #fff; border-radius: 50%; right: 7px; top: 7px; box-sizing: content-box; }
.avatar-button { width: 36px; height: 36px; border-radius: 50%; background: var(--dark); color: #fff; font-size: 11px; font-weight: 700; }
.mobile-menu { display: none; margin-right: 10px; }

.content { max-width: 1460px; margin: 0 auto; padding: 30px 32px 60px; }
.view { display: none; }
.view.active { display: block; animation: appear .18s ease-out; }
@keyframes appear { from { opacity: .25; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.page-heading.compact { align-items: center; }
.eyebrow { text-transform: uppercase; color: var(--green); font-size: 10px; font-weight: 750; display: block; margin-bottom: 5px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 27px; line-height: 1.2; margin-bottom: 5px; letter-spacing: 0; }
h2 { font-size: 15px; line-height: 1.35; margin-bottom: 3px; letter-spacing: 0; }
.page-heading p, .panel-head p { color: var(--muted); margin-bottom: 0; }
.page-heading p { font-size: 13px; }
.primary-button, .secondary-button, .danger-button { min-height: 38px; border-radius: 6px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 650; font-size: 12px; white-space: nowrap; }
.primary-button { color: #fff; background: var(--dark); border: 1px solid var(--dark); }
.primary-button:hover { background: #2b302d; }
.secondary-button { color: var(--ink); background: #fff; border: 1px solid var(--line-strong); }
.secondary-button:hover { background: var(--surface-muted); }
.danger-button { color: #ad3c2c; background: #fff; border: 1px solid #eccbc5; }
.full { width: 100%; }
.text-link { border: 0; padding: 0; background: transparent; color: var(--green); display: inline-flex; align-items: center; gap: 3px; cursor: pointer; font-size: 11px; font-weight: 650; }
.text-link svg { width: 13px; height: 13px; }

.capacity-band { background: #e9f7f0; border: 1px solid #c7ead8; min-height: 88px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 15px 18px; border-radius: 8px; margin-bottom: 18px; }
.capacity-band.small { margin-bottom: 20px; }
.capacity-mark { width: 56px; height: 56px; display: grid; place-content: center; text-align: center; background: var(--dark); color: #fff; border-radius: 7px; }
.capacity-mark span { font-size: 20px; line-height: 1; font-weight: 750; }
.capacity-mark small { font-size: 8px; color: #b7c0bb; text-transform: uppercase; margin-top: 3px; }
.capacity-band strong { font-size: 13px; }
.capacity-band p { margin: 2px 0 0; color: #456256; font-size: 12px; }
.capacity-state { color: #0e6f49; border: 1px solid #abdcc4; background: rgba(255,255,255,.55); border-radius: 999px; padding: 5px 9px; font-size: 10px; font-weight: 700; white-space: nowrap; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.metric-card, .panel, .key-item, .plan-card, .quota-item { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.metric-card { padding: 15px 16px; min-height: 150px; display: flex; flex-direction: column; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; min-height: 22px; }
.metric-top svg { width: 16px; height: 16px; }
.metric-top small { color: var(--green); font-weight: 700; }
.metric-card > strong { font-size: 24px; line-height: 1.15; margin-top: 14px; }
.metric-card > p { color: var(--muted); font-size: 11px; margin: 4px 0 10px; }
.metric-card > p span { color: var(--faint); }
.metric-card .text-link, .mini-progress, .good-state { margin-top: auto; }
.mini-progress, .quota-bar { height: 6px; background: #edf1ef; overflow: hidden; border-radius: 999px; }
.mini-progress span, .quota-bar span { display: block; min-width: 8px; height: 100%; background: var(--green); border-radius: inherit; }
.progress-36 { width: 3.6%; }
.progress-49 { width: 4.9%; }
.progress-58 { width: 5.8%; }
.progress-12 { width: 12%; }
.mini-progress.output span, .quota-bar.coral span { background: var(--coral); }
.quota-bar.blue span { background: var(--blue); }
.quota-bar.dark span { background: var(--dark); }
.good-state { display: flex; align-items: center; gap: 5px; color: var(--green); font-size: 10px; font-weight: 650; }
.good-state svg { width: 14px; height: 14px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 12px; margin-bottom: 12px; }
.panel { padding: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.panel-head p { font-size: 11px; }
.panel-icon { color: var(--green); }
.segmented { display: flex; padding: 2px; border: 1px solid var(--line); background: var(--surface-muted); border-radius: 6px; }
.segmented button, .code-tabs button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 10px; font-weight: 650; }
.segmented button { min-width: 38px; height: 25px; border-radius: 4px; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,25,22,.1); }
.chart-summary { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.chart-summary strong { font-size: 25px; }
.chart-summary span { color: var(--muted); font-size: 10px; }
.chart-summary b { color: var(--green); }
.chart-wrap { height: 225px; }
.chart-wrap > svg { width: 100%; height: 190px; overflow: visible; }
.grid-lines line { stroke: #e5eae7; stroke-width: 1; stroke-dasharray: 3 5; }
.area { fill: #e2f5eb; stroke: none; }
.line { fill: none; stroke: var(--green); stroke-width: 3; vector-effect: non-scaling-stroke; }
.chart-wrap circle { fill: #fff; stroke: var(--green); stroke-width: 3; }
.chart-labels { display: flex; justify-content: space-between; color: var(--faint); font-size: 9px; }
.quick-panel { display: flex; flex-direction: column; }
.config-row { display: grid; grid-template-columns: 58px minmax(0,1fr) 28px; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.config-row > span, .code-mini > span { color: var(--muted); font-size: 10px; }
.config-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.copy-button { width: 28px; height: 28px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--muted); border-radius: 4px; }
.copy-button:hover { color: var(--ink); background: var(--surface-muted); }
.copy-button svg { width: 14px; height: 14px; }
.code-mini { margin: 14px 0; }
.code-mini pre { margin: 6px 0 0; padding: 12px; background: var(--dark); color: #cce6d8; font-size: 9px; line-height: 1.7; border-radius: 6px; overflow: auto; }
.activity-panel .panel-head { align-items: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th { text-align: left; color: var(--faint); font-size: 9px; text-transform: uppercase; font-weight: 700; padding: 0 12px 9px; }
td { padding: 11px 12px; border-top: 1px solid var(--line); font-size: 11px; color: #404945; }
td code { color: var(--ink); }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 7px; font-size: 9px; font-weight: 750; }
.status.success { color: #087048; background: var(--green-soft); }
.status.warning { color: #a94835; background: var(--coral-soft); }
.status.preview { color: #395bb3; background: var(--blue-soft); }

.quota-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-bottom: 12px; }
.quota-item { padding: 18px; }
.quota-item > div:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; }
.quota-item span { color: var(--muted); font-size: 11px; }
.quota-item strong { font-size: 18px; }
.quota-item strong small { font-size: 10px; color: var(--faint); }
.quota-bar { margin: 16px 0 7px; }
.quota-item p { margin: 0; color: var(--faint); font-size: 10px; }
.privacy-note { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 10px; }
.privacy-note svg { width: 15px; height: 15px; }

.notice { border: 1px solid #d6e0ea; background: #f4f7fb; border-radius: 8px; padding: 14px; display: flex; gap: 11px; }
.notice svg { color: var(--blue); margin-top: 1px; }
.notice strong { font-size: 12px; }
.notice p { color: #586678; font-size: 11px; margin: 2px 0 0; }
.demo-notice { margin-bottom: 12px; }
.key-item { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px; margin-bottom: 12px; }
.key-main { display: flex; gap: 13px; align-items: center; min-width: 0; }
.key-icon { width: 42px; height: 42px; border-radius: 7px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); }
.key-title { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.key-main code { font-size: 11px; }
.key-main p { margin: 4px 0 0; color: var(--faint); font-size: 10px; }
.key-actions { display: flex; gap: 8px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 9px; color: #46504b; font-size: 11px; }
.check-list svg { width: 15px; height: 15px; color: var(--green); }
.detail-list { margin: 0; }
.detail-list > div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 0; border-top: 1px solid var(--line); }
.detail-list > div:first-child { border-top: 0; padding-top: 0; }
.detail-list dt { color: var(--muted); font-size: 10px; }
.detail-list dd { margin: 0; font-size: 10px; font-weight: 650; text-align: right; }

.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; align-items: stretch; }
.plan-card { padding: 20px; display: flex; flex-direction: column; position: relative; }
.plan-card.featured { border-color: #78bd9d; box-shadow: var(--shadow); }
.popular { position: absolute; right: 12px; top: 12px; color: #0a7048; background: var(--green-soft); padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 750; }
.plan-name { font-size: 14px; font-weight: 750; }
.plan-card > div:first-of-type p, .plan-card.featured > div:nth-of-type(2) p { color: var(--muted); font-size: 11px; margin: 4px 0 0; }
.price { display: flex; align-items: baseline; gap: 5px; margin: 20px 0; }
.price strong { font-size: 25px; }
.price span { color: var(--faint); font-size: 10px; }
.plan-card ul { margin: 0 0 20px; padding: 0; list-style: none; display: grid; gap: 10px; flex: 1; }
.plan-card li { display: flex; gap: 7px; font-size: 11px; color: #46504b; }
.plan-card li svg { width: 14px; height: 14px; color: var(--green); }
.plan-footnote { color: var(--faint); text-align: center; font-size: 10px; margin: 16px 0 0; }

.docs-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 12px; }
.docs-main { padding: 8px 22px; }
.doc-section { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 12px; padding: 22px 0; border-top: 1px solid var(--line); }
.doc-section:first-child { border-top: 0; }
.doc-section p { color: var(--muted); font-size: 11px; margin-bottom: 14px; }
.step-number { width: 28px; height: 28px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 6px; font-size: 9px; font-weight: 750; }
.code-block { background: var(--dark); color: #d6e6dd; border: 1px solid #303733; border-radius: 7px; position: relative; overflow: hidden; }
.code-block pre { margin: 0; padding: 16px 42px 16px 16px; overflow: auto; font-size: 10px; line-height: 1.65; }
.code-block .copy-button { position: absolute; right: 8px; top: 8px; color: #9caaa2; background: #252b28; z-index: 1; }
.code-block.large { min-height: 180px; }
.code-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.code-tabs button { padding: 7px 10px; border-bottom: 2px solid transparent; }
.code-tabs button.active { color: var(--green); border-color: var(--green); }
.error-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.error-grid div { border: 1px solid var(--line); background: var(--surface-muted); border-radius: 6px; padding: 10px; }
.error-grid code, .error-grid span { display: block; }
.error-grid code { font-weight: 750; margin-bottom: 3px; }
.error-grid span { color: var(--muted); font-size: 9px; }
.docs-side { display: grid; align-content: start; gap: 12px; }

.account-layout { display: grid; grid-template-columns: .75fr 1.25fr; gap: 12px; }
.profile-panel { grid-row: span 2; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 320px; }
.large-avatar { width: 72px; height: 72px; background: var(--dark); color: #fff; display: grid; place-items: center; border-radius: 50%; font-weight: 750; font-size: 20px; margin-bottom: 14px; }
.profile-panel h2 { font-size: 18px; }
.profile-panel p { color: var(--muted); font-size: 11px; margin-bottom: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { color: var(--muted); font-size: 10px; }
.form-grid label.wide { grid-column: 1 / -1; }
.form-grid input { width: 100%; height: 38px; margin-top: 5px; border: 1px solid var(--line); background: var(--surface-muted); border-radius: 6px; padding: 0 10px; color: var(--ink); }
.toggle-list { display: grid; }
.toggle-list label { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 10px 0; border-top: 1px solid var(--line); position: relative; }
.toggle-list label:first-child { border-top: 0; padding-top: 0; }
.toggle-list strong, .toggle-list span { display: block; }
.toggle-list strong { font-size: 11px; }
.toggle-list span { color: var(--muted); font-size: 9px; }
.toggle-list input { position: absolute; opacity: 0; }
.toggle-list i { width: 34px; height: 18px; border-radius: 999px; background: #d7ddda; position: relative; }
.toggle-list i:after { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.toggle-list input:checked + i { background: var(--green); }
.toggle-list input:checked + i:after { left: 18px; }
.billing-panel { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.billing-panel p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }

dialog { width: min(430px, calc(100vw - 32px)); padding: 28px; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 24px 80px rgba(18,24,20,.2); color: var(--ink); }
dialog::backdrop { background: rgba(18,23,20,.48); backdrop-filter: blur(2px); }
.dialog-close { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; display: grid; place-items: center; background: transparent; border: 0; cursor: pointer; color: var(--muted); }
.dialog-icon { width: 44px; height: 44px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); border-radius: 7px; margin-bottom: 18px; }
dialog h2 { font-size: 20px; margin-bottom: 8px; }
dialog p { color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--dark); color: #fff; padding: 9px 13px; border-radius: 6px; display: flex; gap: 7px; align-items: center; font-size: 11px; opacity: 0; pointer-events: none; transition: .18s ease; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 14px; height: 14px; color: var(--green-bright); }
.scrim { display: none; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .quick-panel { min-height: 340px; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-side { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 18px 0 60px rgba(0,0,0,.18); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; border: 0; background: rgba(18,23,20,.38); z-index: 25; }
  .scrim.show { display: block; }
  .main-area { margin-left: 0; }
  .mobile-menu { display: grid; }
  .content { padding-left: 20px; padding-right: 20px; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card { min-height: 0; }
  .two-column, .account-layout { grid-template-columns: 1fr; }
  .profile-panel { grid-row: auto; min-height: 240px; }
  .billing-panel { grid-column: auto; }
}

@media (max-width: 620px) {
  .topbar { height: 58px; padding: 0 14px; }
  .crumb span, .crumb svg, .cohort-chip { display: none; }
  .content { padding: 22px 14px 44px; }
  .page-heading, .page-heading.compact { align-items: stretch; flex-direction: column; gap: 14px; }
  .page-heading .primary-button, .page-heading .secondary-button { width: 100%; }
  h1 { font-size: 23px; }
  .capacity-band, .capacity-band.small { grid-template-columns: 48px 1fr; gap: 12px; }
  .capacity-mark { width: 48px; height: 48px; }
  .capacity-state { grid-column: 1 / -1; justify-self: stretch; text-align: center; }
  .metric-grid, .quota-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 138px; }
  .panel { padding: 15px; }
  .panel-head { gap: 10px; }
  .chart-wrap { height: 200px; }
  .chart-wrap > svg { height: 165px; }
  .key-item { align-items: flex-start; flex-direction: column; }
  .key-actions { width: 100%; }
  .key-actions button { flex: 1; }
  .key-main { align-items: flex-start; }
  .key-main code { overflow-wrap: anywhere; }
  .docs-main { padding: 4px 14px; }
  .doc-section { grid-template-columns: 1fr; }
  .error-grid, .docs-side { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label.wide { grid-column: auto; }
  .billing-panel { align-items: stretch; flex-direction: column; }
  .config-row { grid-template-columns: 48px minmax(0,1fr) 28px; }
  .code-block pre { font-size: 9px; }
}

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