:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f0f4f8;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e2ec;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-soft: #d9f5f0;
  --blue: #2563eb;
  --warning: #b54708;
  --shadow: 0 18px 48px rgba(23, 32, 51, 0.09);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.preload-console-route .site-header,
html.preload-console-route .hero-section,
html.preload-console-route #pricing,
html.preload-console-route #capabilities,
html.preload-console-route #docs,
html.preload-console-route .site-footer,
html.preload-login-route .hero-section,
html.preload-login-route #pricing,
html.preload-login-route #capabilities,
html.preload-login-route #docs,
html.preload-login-route .site-footer {
  display: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}

input:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  gap: 20px;
  align-items: center;
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.console-route .site-header,
.console-route .hero-section,
.console-route #pricing,
.console-route #capabilities,
.console-route #docs,
.console-route .site-footer {
  display: none;
}

.console-route #login {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: 8px;
}

.console-route .login-console-grid {
  grid-template-columns: 1fr;
}

.console-route .section-head {
  display: none;
}

.login-section {
  display: none;
}

.login-route .hero-section,
.login-route #pricing,
.login-route #capabilities,
.login-route #docs,
.login-route .site-footer {
  display: none;
}

.login-route #login,
.console-route #login {
  display: block;
}

.login-route #login {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-top: 0;
}

.login-route .login-console-grid {
  width: min(390px, 100%);
  grid-template-columns: minmax(280px, 360px);
  justify-content: center;
}

.login-route .section-head {
  width: min(720px, 100%);
  margin: 0 auto;
  text-align: center;
}

.brand,
.header-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 21px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.main-nav {
  display: flex;
  gap: 22px;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.main-nav a:hover {
  color: var(--accent);
}

.header-actions {
  justify-content: flex-end;
}

.primary-link,
.ghost-link,
.copy-plan {
  min-height: 40px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  font-weight: 900;
  border: 1px solid transparent;
  cursor: pointer;
}

.primary-link,
.copy-plan {
  background: var(--accent);
  color: #fff;
}

.ghost-link {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.large {
  min-height: 46px;
  padding-inline: 18px;
}

.hero-section {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
  gap: 36px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 28px 52px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.98;
}

h2 {
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1.15;
}

h3 {
  margin-bottom: 10px;
}

.hero-lead,
.section-head p,
.feature-grid p,
.console-card small,
.site-footer {
  color: var(--muted);
  line-height: 1.7;
}

.hero-lead {
  max-width: 680px;
  font-size: 18px;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 32px 0 0;
}

.hero-facts div,
.doc-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.hero-facts dt,
.doc-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-facts dd {
  margin: 8px 0 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 900;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
  background: var(--warning);
  box-shadow: 0 0 0 5px rgba(181, 71, 8, 0.12);
}

.status-dot.ok {
  background: #12b76a;
  box-shadow: 0 0 0 5px rgba(18, 183, 106, 0.12);
}

.terminal-panel {
  overflow: hidden;
  border-radius: 8px;
  background: #101828;
  box-shadow: var(--shadow);
}

.terminal-top {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  background: #1d2939;
}

.terminal-top span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #f97066;
}

.terminal-top span:nth-child(2) {
  background: #fdb022;
}

.terminal-top span:nth-child(3) {
  background: #32d583;
}

pre,
code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

pre {
  margin: 0;
  overflow-x: auto;
  padding: 22px;
  color: #d0d5dd;
  line-height: 1.7;
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 28px;
}

.muted-band {
  max-width: none;
  padding-inline: max(28px, calc((100vw - 1180px) / 2 + 28px));
  background: #eaf1f7;
}

.section-head {
  max-width: 720px;
  margin-bottom: 28px;
}

.pricing-grid,
.feature-grid,
.docs-grid {
  display: grid;
  gap: 16px;
}

.pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-card,
.feature-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.04);
}

.plan-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.plan-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
}

.price {
  margin: 12px 0 18px;
  font-size: 44px;
  font-weight: 950;
}

.price small {
  color: var(--muted);
  font-size: 16px;
}

.plan-card ul {
  padding: 0;
  margin: 0 0 20px;
  list-style: none;
  display: grid;
  gap: 10px;
  color: #344054;
}

.plan-card li::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 999px;
  margin-right: 9px;
  background: var(--accent);
}

.copy-plan {
  width: 100%;
}

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.login-console-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.login-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.04);
}

.login-card {
  display: grid;
  gap: 15px;
  padding: 22px;
}

.login-card label,
.dialog-body label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 14px;
  font-weight: 900;
}

.submit-btn {
  width: 100%;
  border: 0;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: #b42318;
  font-size: 14px;
}

.customer-console {
  display: grid;
  gap: 18px;
  padding: 0;
}

.console-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.console-topbar h3 {
  margin: 0;
  font-size: 24px;
}

.console-topbar p:not(.eyebrow) {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.console-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.35fr);
  gap: 14px;
}

.balance-panel,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.balance-panel {
  display: grid;
  align-content: center;
  min-height: 196px;
  padding: 24px;
  background: linear-gradient(135deg, #f7fbfb 0%, #e7f5f1 100%);
}

.balance-panel span,
.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.balance-panel strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 54px;
  line-height: 1;
}

.balance-panel p,
.metric-card small,
.panel-head p {
  color: var(--muted);
  line-height: 1.6;
}

.balance-panel p {
  margin: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 18px;
}

.metric-card strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 28px;
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head h3 {
  margin: 0;
}

.panel-head p {
  margin: 6px 0 0;
}

.copy-list,
.keys-list {
  display: grid;
  gap: 10px;
}

.copy-row {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(100px, 0.35fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
}

.copy-row:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.08);
}

.copy-row span,
.copy-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.copy-row code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--accent-dark);
  font-weight: 900;
}

.copy-row small {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
}

.key-item {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1.2fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.key-main h4 {
  margin: 8px 0 6px;
  font-size: 16px;
}

.key-main code {
  overflow-wrap: anywhere;
  color: var(--accent-dark);
  font-weight: 900;
}

.key-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.key-status.is-active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.key-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.key-meta div {
  min-width: 0;
}

.key-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.key-meta dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: #344054;
  font-size: 13px;
}

.key-actions {
  display: flex;
  justify-content: flex-end;
}

.empty-state {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 22px;
  line-height: 1.6;
}

.usage-chart {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.usage-chart-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.usage-chart-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.usage-chart-summary span,
.usage-bar small,
.usage-legend {
  color: var(--muted);
  font-size: 12px;
}

.usage-chart-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 20px;
}

.usage-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(54px, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 190px;
}

.usage-bar {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 7px;
  min-width: 54px;
  height: 190px;
  text-align: center;
}

.usage-bar-track {
  position: relative;
  overflow: hidden;
  align-self: stretch;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
}

.usage-bar-fill,
.usage-token-line {
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 8px;
  border-radius: 6px 6px 0 0;
}

.usage-bar-fill {
  background: linear-gradient(180deg, #1f7a6d 0%, #145a50 100%);
}

.usage-token-line {
  left: 45%;
  width: 4px;
  background: #f59e0b;
}

.usage-bar strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
}

.usage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.usage-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.usage-legend i {
  display: inline-block;
  width: 16px;
  height: 8px;
  border-radius: 999px;
}

.legend-cost {
  background: #1f7a6d;
}

.legend-token {
  background: #f59e0b;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap::-webkit-scrollbar {
  height: 10px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #eef3f7;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #9fb2c3;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #667f95;
}

.usage-events-wrap table {
  min-width: 1680px;
}

.usage-filters,
.usage-pagination {
  display: flex;
  align-items: end;
  gap: 12px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}

.usage-filters {
  justify-content: flex-start;
}

.usage-pagination {
  justify-content: space-between;
}

.usage-filters label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.console-input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.usage-filters .console-input,
.usage-filters .console-select {
  min-width: 150px;
}

.usage-filters #usage-page-size {
  min-width: 92px;
}

.usage-pagination {
  align-items: center;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.token-stack {
  display: grid;
  gap: 3px;
}

.token-stack small,
.usage-muted {
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 6px;
  padding: 3px 7px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 13px;
  text-align: left;
  white-space: nowrap;
  font-size: 14px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.empty-row {
  height: 70px;
  color: var(--muted);
}

.key-mask {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.danger-btn {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  background: #fee4e2;
  color: #b42318;
  cursor: pointer;
  font-weight: 900;
}

dialog {
  width: min(460px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
}

dialog.wide-dialog {
  width: min(920px, calc(100vw - 28px));
}

dialog::backdrop {
  background: rgba(16, 24, 40, 0.56);
}

.dialog-body {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.new-key-result {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
  word-break: break-all;
}

.new-key-result code {
  color: var(--accent-dark);
  font-weight: 900;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.docs-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doc-card code {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  color: var(--accent-dark);
  font-weight: 900;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 26px 32px;
  background: #fff;
}

.site-footer span:first-child {
  color: var(--ink);
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 40px));
  border-radius: 8px;
  background: #101828;
  color: #fff;
  padding: 13px 16px;
  box-shadow: var(--shadow);
}

.app-console {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.console-sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  min-height: 100%;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  font-size: 16px;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.console-nav {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px 10px;
}

.console-nav-item {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  cursor: pointer;
  padding: 0 14px;
  text-align: left;
  text-decoration: none;
  font-weight: 850;
}

.console-nav-item:hover,
.console-nav-item.active {
  background: #e6f5f2;
  color: var(--accent-dark);
}

.console-nav-divider {
  height: 1px;
  margin: 6px 8px;
  background: var(--line);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 16px 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.console-main {
  min-width: 0;
  background: linear-gradient(135deg, #f3fffd 0%, #f8fafc 35%, #fff 100%);
}

.console-appbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  padding: 22px 28px;
}

.console-appbar h3 {
  margin: 0;
  font-size: 24px;
}

.console-appbar p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.header-user-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 190px;
  max-width: 270px;
  min-height: 46px;
  margin-right: 4px;
  padding: 5px 12px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(16, 24, 40, 0.05);
}

.header-user-card:hover {
  border-color: #99d9cf;
  background: #f4fffc;
}

.header-user-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f766e, #149783);
  color: #fff;
  font-size: 16px;
  font-weight: 950;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}

.header-user-copy {
  min-width: 0;
}

.header-user-copy strong,
.header-user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-user-copy strong {
  color: #101828;
  font-size: 14px;
}

.header-user-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.console-view {
  min-width: 0;
  display: none;
  padding: 24px 28px 28px;
}

.console-view.active {
  display: grid;
  gap: 18px;
}

.tutorial-panel {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#view-tutorial-detailed {
  padding: 14px 12px 28px;
}

.tutorial-hero {
  padding: 34px 38px;
  background: linear-gradient(135deg, #e8f8f5 0%, #f8fbff 55%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
}

.tutorial-hero.compact {
  padding-bottom: 28px;
}

.tutorial-hero h3 {
  margin: 8px 0 10px;
  font-size: 28px;
}

.tutorial-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.tutorial-kicker {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.tutorial-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 12px 38px 24px 72px;
}

.tutorial-steps li {
  padding: 22px 8px;
  border-bottom: 1px solid var(--line);
}

.tutorial-steps li:last-child {
  border-bottom: 0;
}

.tutorial-steps strong {
  display: block;
  margin-bottom: 7px;
  color: #101828;
  font-size: 17px;
}

.tutorial-steps p {
  margin: 0;
  color: #475467;
  line-height: 1.75;
}

.inline-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.tutorial-callout {
  margin: 0 38px 32px;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #effaf7;
}

.tutorial-callout.warning {
  margin: 20px 0;
  border-left-color: #f79009;
  background: #fffaeb;
}

.tutorial-callout.success {
  margin: 22px 0 0;
}

.tutorial-callout p {
  margin: 5px 0 0;
  color: #475467;
  line-height: 1.7;
}

.tutorial-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: start;
  min-height: 620px;
}

.tutorial-toc {
  position: sticky;
  top: 18px;
  display: grid;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  gap: 3px;
  margin: 20px 0 24px 18px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.tutorial-toc-label {
  padding: 7px 10px 12px;
  color: #101828;
  font-size: 15px;
  font-weight: 950;
}

.tutorial-toc a {
  display: block;
  border-radius: 7px;
  color: #475467;
  line-height: 1.35;
  text-decoration: none;
}

.tutorial-toc a:hover,
.tutorial-toc a.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.tutorial-toc a.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.tutorial-toc .level-1 {
  margin-top: 4px;
  padding: 10px;
  font-size: 14px;
  font-weight: 900;
}

.tutorial-toc .level-2 {
  padding: 8px 10px 8px 24px;
  font-size: 13px;
  font-weight: 800;
}

.tutorial-toc .level-3 {
  padding: 7px 10px 7px 38px;
  font-size: 12px;
  font-weight: 750;
}

.tutorial-toc .level-4 {
  padding: 7px 10px 7px 52px;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.tutorial-content {
  min-width: 0;
}

.tutorial-section {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  scroll-margin-top: 24px;
  padding: 38px 42px;
  border-bottom: 1px solid var(--line);
}

.tutorial-section[hidden] {
  display: none;
}

.tutorial-section:last-child {
  border-bottom: 0;
}

.tutorial-step-number {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 8px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
}

.tutorial-section h4 {
  margin: 4px 0 14px;
  font-size: 23px;
}

.tutorial-section h5 {
  margin: 26px 0 8px;
  font-size: 18px;
}

.tutorial-section p,
.tutorial-section li {
  color: #475467;
  line-height: 1.8;
}

.tutorial-section ol {
  padding-left: 22px;
}

.tutorial-section figure {
  margin: 24px 0 32px;
}

.tutorial-section img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #f8fafc;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.10);
}

.tutorial-section figcaption {
  margin-top: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric-tile {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(23, 32, 51, 0.05);
}

.metric-tile.accent-tile {
  background: linear-gradient(135deg, #0f766e 0%, #149783 100%);
  color: #fff;
}

.metric-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.metric-tile.accent-tile span,
.metric-tile.accent-tile small {
  color: rgba(255, 255, 255, 0.78);
}

.metric-tile strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 30px;
  line-height: 1.1;
}

.metric-tile small {
  color: var(--muted);
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 16px;
}

.bottom-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.75fr);
}

.model-distribution,
.activity-list,
.quick-actions {
  display: grid;
  gap: 10px;
}

.model-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.9fr) minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: #344054;
  font-size: 13px;
}

.model-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
}

.model-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.activity-row strong,
.activity-row small {
  display: block;
}

.activity-row small,
.activity-row span,
.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.copy-row.compact {
  min-height: 64px;
}

.pro-key-item {
  grid-template-columns: minmax(190px, 0.8fr) minmax(0, 1.4fr) auto;
}

.pro-key-item .key-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stacked-actions {
  display: grid;
  gap: 8px;
}

.copy-key-btn {
  min-width: 96px;
  border: 0;
}

.console-select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.api-tester-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
}

.api-tester-form,
.api-tester-result {
  min-width: 0;
}

.tester-endpoint {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid #b7e4da;
  border-radius: 999px;
  background: #ecfdf9;
  color: var(--accent-dark);
  padding: 0 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  font-weight: 900;
}

.tester-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.tester-field small {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.5;
}

.tester-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tester-model-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.tester-model-picker .ghost-link {
  min-height: 40px;
  white-space: nowrap;
}

.tester-custom-model {
  width: 100%;
}

.tester-message {
  min-height: 150px;
  resize: vertical;
  padding-top: 11px;
  line-height: 1.65;
}

.api-tester-form .submit-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  cursor: pointer;
}

.api-tester-form button:disabled,
.api-tester-form input:disabled,
.api-tester-form select:disabled,
.api-tester-form textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.tester-security-note {
  margin: 10px 0 0;
  text-align: center;
}

.tester-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.tester-result-head h3,
.tester-result-head p {
  margin: 0;
}

.tester-result-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.tester-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  min-height: 30px;
  border-radius: 999px;
  background: #eef2f6;
  color: #475467;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 950;
}

.tester-status.waiting {
  background: #fffaeb;
  color: #b54708;
}

.tester-status.success {
  background: #ecfdf3;
  color: #067647;
}

.tester-status.error {
  background: #fef3f2;
  color: #b42318;
}

.tester-reply {
  min-height: 210px;
  max-height: 520px;
  overflow: auto;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 16px;
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tester-reply.empty {
  color: var(--muted);
}

.tester-error {
  margin-top: 12px;
  border: 1px solid #fecdca;
  border-radius: 8px;
  background: #fef3f2;
  color: #b42318;
  padding: 12px 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tester-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tester-details summary {
  cursor: pointer;
  padding: 11px 13px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.tester-details pre {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 13px;
  background: #101828;
  color: #e4e7ec;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.status-card strong,
.status-card small {
  display: block;
}

.status-card strong {
  margin: 10px 0 4px;
}

.status-card small {
  color: var(--muted);
}

.help-note {
  border: 1px solid #b7e4da;
  border-radius: 8px;
  background: #ecfdf9;
  color: #164e45;
  margin-top: 16px;
  padding: 14px;
}

.help-note p {
  margin: 6px 0 0;
  line-height: 1.7;
}

.warning-note {
  border-color: #fedf89;
  background: #fffbeb;
  color: #93370d;
}

.subscription-detail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.subscription-detail div,
.subscription-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.subscription-detail span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.subscription-detail strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.subscription-detail small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.subscription-empty p {
  color: var(--muted);
  margin: 8px 0 0;
}

.redeem-panel {
  width: min(720px, 100%);
  margin-inline: auto;
}

.redeem-balance {
  border-radius: 8px;
  background: linear-gradient(135deg, #0f766e 0%, #149783 100%);
  color: #fff;
  margin-bottom: 18px;
  padding: 28px;
  text-align: center;
}

.redeem-balance span,
.redeem-balance small {
  color: rgba(255, 255, 255, 0.78);
}

.redeem-balance strong {
  display: block;
  margin: 8px 0;
  font-size: 38px;
}

.redeem-form {
  display: grid;
  gap: 14px;
}

.profile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.profile-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.profile-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.profile-list dd {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  font-weight: 900;
}

.dialog-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.dialog-title-row h3 {
  margin-bottom: 6px;
}

.dialog-title-row p {
  margin: 0;
  color: var(--muted);
}

.help-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.compact-tabs {
  border-bottom: 0;
  padding-bottom: 0;
}

.help-tab {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  padding: 0 12px;
  font-weight: 850;
}

.help-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.help-content {
  display: grid;
  gap: 14px;
}

.help-summary h4 {
  margin: 0 0 6px;
}

.help-summary p {
  margin: 0;
  color: var(--muted);
}

.code-block {
  overflow: hidden;
  border: 1px solid #263244;
  border-radius: 8px;
  background: #101828;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #344054;
  background: #1d2939;
  color: #d0d5dd;
  padding: 9px 12px;
  font-size: 13px;
}

.code-head .ghost-link {
  min-height: 30px;
  background: #344054;
  border: 0;
  color: #fff;
}

.code-block pre {
  max-height: 360px;
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .main-nav,
  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hero-section,
  .pricing-grid,
  .feature-grid,
  .docs-grid,
  .hero-facts,
  .login-console-grid,
  .app-console,
  .dashboard-metrics,
  .analytics-grid,
  .bottom-grid,
  .status-grid,
  .subscription-detail,
  .profile-list,
  .console-hero,
  .usage-chart-summary,
  .metric-grid,
  .portal-grid,
  .key-item,
  .key-meta,
  .api-tester-grid,
  .tester-row {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
    padding-top: 42px;
  }

  .site-footer {
    flex-direction: column;
  }

  .console-route #login {
    padding-top: 22px;
  }

  .customer-console {
    padding: 0;
  }

  .console-topbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .balance-panel {
    min-height: 160px;
  }

  .balance-panel strong {
    font-size: 42px;
  }

  .copy-row {
    grid-template-columns: 1fr;
  }

  .key-actions {
    justify-content: flex-start;
  }

  .console-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .console-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .console-appbar,
  .dialog-title-row {
    flex-direction: column;
  }

  .console-view {
    padding: 16px;
  }

  .tutorial-hero,
  .tutorial-section {
    padding: 24px 20px;
  }

  .tutorial-toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    margin: 18px 20px 0;
  }

  .tutorial-layout {
    grid-template-columns: 1fr;
  }

  .tutorial-toc-label {
    grid-column: 1 / -1;
  }

  .tutorial-toc .level-1,
  .tutorial-toc .level-2,
  .tutorial-toc .level-3,
  .tutorial-toc .level-4 {
    margin: 0;
    padding: 9px 10px;
  }

  .tutorial-section {
    grid-template-columns: 1fr;
  }

  .tutorial-steps {
    padding: 8px 24px 20px 50px;
  }

  .tutorial-callout {
    margin-right: 20px;
    margin-left: 20px;
  }

  .pro-key-item .key-meta {
    grid-template-columns: 1fr;
  }

  .usage-bars {
    overflow-x: auto;
    grid-template-columns: repeat(7, 68px);
    padding-bottom: 4px;
  }
}
