:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #222;
  background: #fff;
  font-size: 14px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
a { color: #1658a0; }
button, input, select { font: inherit; }
button, .button { cursor: pointer; }
button, .button, input, select {
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 6px 10px;
  min-height: 34px;
}
button, .button { color: #222; background: #f7f7f7; text-decoration: none; }
button:hover, .button:hover { background: #eee; }
button:disabled { opacity: .55; cursor: default; }
input, select { color: #222; background: #fff; min-width: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid #2878cd; outline-offset: 2px; }
.button { display: inline-flex; justify-content: center; align-items: center; white-space: nowrap; font-size: 13px; }
code, pre { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 12px; background: #fff; padding: 8px 12px; border: 1px solid #999; z-index: 100; }
.skip-link:focus { top: 8px; }
.login-main { max-width: 360px; margin: 64px auto; padding: 0 20px; }
.login-main h1 { margin-bottom: 24px; }
.login-main h2 { margin-bottom: 18px; }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; margin-bottom: 5px; }
.form-field input { width: 100%; }
.password-field { display: flex; gap: 6px; }
.password-field input { flex: 1; }
.password-field button { font-size: 12px; }
.login-submit { min-width: 76px; }
.login-help { margin-top: 20px; color: #666; font-size: 12px; }
.form-error, .notice-error { color: #a22323; }
.form-error { margin-bottom: 15px; }
.console-header, .console-nav, .console-main, .console-footer { width: calc(100% - 48px); max-width: 1180px; margin-left: auto; margin-right: auto; }
.console-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 0 16px; }
.header-account { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.console-nav { display: flex; gap: 24px; padding: 0 0 12px; border-bottom: 1px solid #ddd; }
.nav-link { font-size: 13px; text-decoration: none; }
.nav-link.active { color: #222; text-decoration: underline; text-underline-offset: 4px; }
.console-main { padding-top: 24px; }
.page-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.page-actions { display: flex; align-items: center; gap: 14px; font-size: 12px; color: #666; }
.account-strip { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; color: #555; font-size: 13px; }
.badge { white-space: nowrap; }
.badge-success { color: #21713c; }
.badge-error { color: #a22323; }
.badge-warning, .metering-status.pending { color: #8a6019; }
.badge-neutral { color: #666; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 24px; margin: 22px 0 30px; padding-bottom: 24px; border-bottom: 1px solid #ddd; }
.metric dt { color: #555; font-size: 13px; margin-bottom: 4px; }
.metric strong { display: block; font-size: 24px; line-height: 1.4; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric p { font-size: 12px; color: #666; margin-top: 3px; }
.panel { margin-bottom: 30px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.data-table th, .data-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #e2e2e2; font-variant-numeric: tabular-nums; }
.data-table th { background: #f7f7f7; border-top: 1px solid #ddd; color: #444; font-weight: 600; }
.data-table th:first-child, .data-table td:first-child { padding-left: 8px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 8px; }
.data-table .numeric { text-align: right; }
.data-table tfoot td { font-weight: 600; }
.model-name { color: #222; }
.model-id, .request-id, .time-sub { font-size: 11px; color: #777; }
.request-id { max-width: 245px; overflow: hidden; text-overflow: ellipsis; }
.time-sub { display: block; }
.table-note { font-size: 12px; color: #777; margin-top: 8px; }
.ledger-note { display: flex; justify-content: space-between; gap: 12px; }
.ledger-controls { display: flex; align-items: center; gap: 8px; }
.ledger-controls input, .ledger-controls select { font-size: 12px; }
.search-input { width: 235px; }
.empty-state { padding: 20px 8px; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; color: #666; font-size: 13px; }
.empty-state h3 { font-weight: 400; }
.empty-state p + a { display: inline-block; margin-top: 5px; }
.initial-loading { padding: 30px 0; color: #666; }
.notice { margin: 12px 0; padding: 10px 12px; border: 1px solid #d8cba7; color: #75541b; font-size: 13px; }
.notice-error { border-color: #e3bbbb; color: #a22323; }
.notice-info { color: #365f85; border-color: #b7cbdf; }
.notice .text-button { margin-left: 12px; }
.text-button { padding: 0; min-height: 0; background: transparent; border: 0; color: inherit; text-decoration: underline; }
.integration-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.2fr); gap: 36px; border-top: 1px solid #ddd; padding-top: 24px; }
.connection-panel > h2 { margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; margin-bottom: 5px; }
.copy-field { display: flex; gap: 6px; }
.copy-field input { width: 100%; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.key-detail { margin-top: 16px; }
.key-detail code { font-size: 12px; }
.key-note, .fine-print, .code-note { color: #666; font-size: 12px; margin-top: 7px; overflow-wrap: anywhere; }
.model-picker-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; font-size: 12px; }
.model-select { width: 100%; font-size: 13px; }
.model-rates { display: flex; gap: 22px; margin-top: 12px; font-size: 12px; }
.model-rates dt { color: #666; }
.model-rates dd { margin-top: 3px; }
.restrictions { margin-top: 22px; color: #666; font-size: 12px; }
.restrictions h3 { color: #444; font-size: 13px; font-weight: 500; }
.restrictions ul { margin: 8px 0 0; padding-left: 18px; }
.restrictions li { margin-bottom: 4px; }
.code-panel { min-width: 0; }
.code-panel .panel-heading { margin-bottom: 10px; }
.code-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.code-tab { font-size: 12px; padding: 5px 10px; min-height: 30px; background: #fff; border-color: transparent; }
.code-tab.active { border-color: #bbb; background: #f3f3f3; }
#code-example { overflow: auto; border: 1px solid #ddd; background: #f8f8f8; }
#code-example pre { padding: 14px; margin: 0; font-size: 12px; line-height: 1.6; white-space: pre; tab-size: 2; }
.privacy-note { border-top: 1px solid #ddd; padding-top: 16px; margin-top: 28px; font-size: 12px; color: #777; }
.console-footer { padding: 14px 0 24px; color: #777; font-size: 12px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 20; padding: 10px 16px; max-width: calc(100% - 30px); border: 1px solid #aaa; background: #fff; color: #222; font-size: 13px; text-align: center; }
@media (max-width: 850px) {
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
  .integration-grid { grid-template-columns: 1fr; gap: 28px; }
  .ledger-heading { align-items: flex-start; flex-direction: column; }
  .ledger-controls { width: 100%; }
  .search-input { flex: 1; }
}
@media (max-width: 520px) {
  .console-header, .console-nav, .console-main, .console-footer { width: calc(100% - 28px); }
  .console-header { gap: 12px; padding-top: 16px; }
  .header-account { gap: 10px; font-size: 12px; }
  .header-account .button { font-size: 12px; }
  h1 { font-size: 20px; }
  .page-heading { align-items: flex-start; }
  .page-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px 10px; font-size: 11px; }
  .page-actions button { min-height: 30px; padding: 4px 8px; font-size: 12px; }
  .account-strip { font-size: 12px; }
  .metric strong { font-size: 22px; }
  .metric p { font-size: 11px; }
  .metrics { gap: 18px; }
  .ledger-note { flex-direction: column; gap: 2px; }
  .ledger-controls input { width: 100px; }
  .ledger-controls select { max-width: 120px; }
  .model-rates { gap: 18px; }
  #code-example pre { font-size: 11px; }
  .login-main { margin-top: 40px; }
}
