:root {
  --paper: #f1f2ec;
  --paper-deep: #e4e7df;
  --white: #fbfcf8;
  --ink: #171914;
  --ink-soft: #22251f;
  --muted: #5f645a;
  --line: #c9ccc1;
  --line-dark: #3a3e35;
  --acid: #dfff58;
  --acid-deep: #cbed42;
  --orange: #e86b3d;
  --danger: #b43d30;
  --success: #178052;
  --info: #285f97;
  --radius: 4px;
  --sans: "Aptos", "Segoe UI", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  cursor: pointer;
}

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

p,
h1,
h2,
h3,
h4,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

code,
pre {
  font-family: var(--mono);
}

svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

::selection {
  color: var(--ink);
  background: var(--acid);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 800;
}

.brand--large {
  font-size: 20px;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  background: var(--acid);
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .045em;
  line-height: 1;
  transition:
    background-color .16s ease,
    color .16s ease,
    border-color .16s ease,
    transform .16s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: wait;
  opacity: .55;
  transform: none;
}

.button--primary {
  color: var(--ink);
  background: var(--acid);
  border-color: var(--ink);
}

.button--primary:hover {
  background: var(--acid-deep);
}

.button--dark {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.button--dark:hover {
  background: var(--ink-soft);
}

.button--ghost {
  background: transparent;
  border-color: var(--line);
}

.button--ghost:hover {
  border-color: var(--ink);
}

.button--danger {
  color: var(--danger);
  background: transparent;
  border-color: rgba(180, 61, 48, .38);
}

.button--danger:hover {
  background: rgba(180, 61, 48, .06);
  border-color: var(--danger);
}

.button--small {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
}

.button--wide {
  width: 100%;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition:
    background .16s ease,
    border-color .16s ease;
}

.icon-button:hover {
  background: var(--paper-deep);
  border-color: #adb0a4;
}

.icon-button--dark {
  color: var(--white);
  border-color: var(--line-dark);
}

.icon-button--dark:hover {
  background: var(--ink-soft);
  border-color: #54594e;
}

/* Authentication */
.auth-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1.1fr) minmax(410px, .9fr);
}

.auth-intro {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 4vw, 60px);
  background: var(--ink);
  color: var(--paper);
}

.auth-intro .brand-mark {
  color: var(--ink);
}

.auth-thesis {
  max-width: 720px;
  padding: 70px 0 60px;
}

.auth-thesis h1 {
  max-width: 700px;
  font-family: var(--serif);
  font-size: clamp(52px, 6vw, 92px);
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: .92;
}

.auth-thesis > p:last-child {
  max-width: 480px;
  margin-top: 30px;
  color: #b7baaf;
  font-size: 14px;
  line-height: 1.7;
}

.auth-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-dark);
}

.auth-facts > div {
  padding: 20px 18px 0 0;
}

.auth-facts span {
  display: block;
  color: #92978c;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.auth-facts strong {
  display: block;
  margin-top: 7px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.auth-panel {
  display: flex;
  max-width: 640px;
  width: 100%;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: center;
  justify-self: center;
  padding: 42px clamp(28px, 5vw, 86px);
}

.auth-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  padding: 10px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: 12px;
  font-weight: 700;
}

.auth-tab.is-active {
  color: var(--ink);
  border-color: var(--ink);
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-heading {
  margin-bottom: 8px;
}

.auth-heading h2 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -.025em;
}

.auth-heading p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span {
  color: #565b51;
  font-size: 12px;
  font-weight: 700;
}

.field > span small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.field--check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 5px;
}

.field--check input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin-top: 1px;
  accent-color: var(--ink);
}

.field--check > span {
  display: grid;
  gap: 3px;
}

.email-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.email-code-row .button {
  min-width: 108px;
}

.field input,
.field select,
.field textarea,
.filter-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, .42);
  border: 1px solid #b9bcb1;
  border-radius: var(--radius);
  outline: 0;
  transition:
    border-color .16s ease,
    box-shadow .16s ease,
    background .16s ease;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #959a8e;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.filter-input:focus {
  background: var(--white);
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(223, 255, 88, .52);
}

.field-help {
  margin-top: -8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.tag--private {
  margin-top: 5px;
  color: #67400a;
  background: #fff0c2;
  border-color: #e7c56c;
}

.form-error {
  min-height: 17px;
  color: var(--danger);
  font-size: 12px;
}

.form-success {
  color: var(--success);
  font-size: 12px;
}

@media (max-width: 520px) {
  .email-code-row {
    grid-template-columns: 1fr;
  }
}

/* Application shell */
.app-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100dvh;
  flex-direction: column;
  padding: 22px 16px 17px;
  color: var(--white);
  background: var(--ink);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px 26px;
}

.sidebar .brand-mark {
  color: var(--ink);
}

.environment {
  padding: 3px 6px;
  color: #8e9488;
  border: 1px solid #3d4238;
  font-family: var(--mono);
  font-size: 12px;
}

.nav-stack {
  display: grid;
  gap: 4px;
}

.nav-stack + .nav-stack {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #30342c;
}

.nav-label {
  padding: 0 11px 6px;
  color: #777d72;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  color: #aeb3a7;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  font-size: 12px;
  text-align: left;
  transition:
    color .16s ease,
    background .16s ease;
}

.nav-item svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.6;
}

.nav-item:hover {
  color: var(--white);
  background: #252921;
}

.nav-item.is-active {
  color: var(--ink);
  background: var(--acid);
  font-weight: 750;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding: 18px 4px 0;
  border-top: 1px solid #30342c;
}

.account-mini {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.account-mini > div {
  min-width: 0;
}

.account-mini strong,
.account-mini small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-mini strong {
  max-width: 108px;
  font-size: 12px;
}

.account-mini small {
  color: #858b7f;
  font-size: 12px;
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  background: var(--acid);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 850;
}

.sidebar .icon-button {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  color: #9da298;
  border-color: #33372f;
}

.sidebar .icon-button svg {
  width: 15px;
  height: 15px;
}

.sidebar .icon-button:hover {
  color: var(--white);
  background: #262a23;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(24px, 3.5vw, 50px);
  background: rgba(244, 241, 232, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -.025em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.balance-chip {
  display: flex;
  min-width: 152px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--acid);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
}

.balance-chip span {
  font-size: 12px;
  font-weight: 700;
}

.balance-chip strong {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.content {
  width: min(1460px, 100%);
  padding: 26px clamp(24px, 3.5vw, 50px) 60px;
}

.view-loading {
  display: grid;
  min-height: 300px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.loading-line {
  width: 100%;
  height: 1px;
  overflow: hidden;
  background: var(--line);
}

.loading-line::after {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ink);
  animation: loading-pulse 1.2s ease-in-out infinite;
  content: "";
}

@keyframes loading-pulse {
  0%, 100% { opacity: .28; }
  50% { opacity: .75; }
}

/* Shared product surfaces */
.view-stack {
  display: grid;
  min-width: 0;
  gap: 26px;
}

.view-stack > * {
  min-width: 0;
}

.view-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.view-head h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -.025em;
}

.view-head p {
  max-width: 650px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

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

.account-strip {
  display: grid;
  grid-template-columns: 1.1fr .75fr 1.35fr 1fr auto;
  min-height: 104px;
  background: var(--acid);
  border: 1px solid var(--ink);
}

.account-strip > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 17px 20px;
  border-right: 1px solid rgba(23, 25, 20, .18);
}

.account-strip .button {
  align-self: center;
  margin: 16px;
}

.data-label {
  color: #5f6458;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.account-balance {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 36px;
  letter-spacing: -.025em;
  line-height: 1.05;
}

.account-value {
  margin-top: 7px;
  font-size: 16px;
  font-weight: 800;
}

.endpoint-value {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 8px 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, .58);
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-value code {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, .7fr);
  gap: 24px;
}

.surface {
  min-width: 0;
}

.surface-head {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 10px;
}

.surface-head h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -.015em;
}

.surface-head p,
.surface-head span {
  color: var(--muted);
  font-size: 12px;
}

.table-frame {
  width: 100%;
  overflow-x: auto;
  border-top: 2px solid var(--ink);
}

.data-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.data-table td {
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr {
  transition: background .16s ease;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, .4);
}

.data-table tbody tr.table-group-row:hover {
  background: var(--paper-deep);
}

.data-table .table-group-row td {
  padding: 13px 10px 10px;
  background: var(--paper-deep);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.table-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.table-group-head strong {
  font-size: 14px;
  font-weight: 800;
}

.table-group-head span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.model-groups {
  display: grid;
  gap: 10px;
}

.model-group {
  border: 1px solid var(--line);
  background: var(--paper);
}

.model-group[open] {
  border-color: var(--ink);
}

.model-group summary {
  cursor: pointer;
  list-style: none;
  padding: 15px 16px;
}

.model-group summary::-webkit-details-marker {
  display: none;
}

.model-group summary::after {
  content: "+";
  color: var(--muted);
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
}

.model-group[open] summary::after {
  content: "−";
  color: var(--ink);
}

.model-group-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.model-group-summary > span:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.model-group-summary strong {
  font-size: 15px;
  font-weight: 800;
}

.model-group-description {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.model-group-count {
  color: var(--muted);
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.model-group-content {
  border-top: 1px solid var(--line);
  padding: 10px;
}

.model-group-content .table-frame {
  border: 0;
}

.model-catalog {
  container: model-catalog / inline-size;
}

.cheapest-model {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(105px, auto)) auto;
  align-items: center;
  gap: 18px;
  padding: 16px;
  background: var(--paper-deep);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.cheapest-model-main,
.cheapest-model-metric {
  min-width: 0;
}

.cheapest-model-main strong,
.cheapest-model-main small,
.cheapest-model-metric span,
.cheapest-model-metric strong {
  display: block;
}

.cheapest-model-main strong {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 16px;
}

.cheapest-model-main small,
.cheapest-model-metric span {
  color: var(--muted);
  font-size: 11px;
}

.cheapest-model-metric strong {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.model-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.model-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.model-cell strong {
  display: block;
  font-size: 13px;
}

.model-name-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.model-rate {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 6px;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.pricing-explainer {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, .8fr);
  gap: 16px 24px;
  margin: 4px 0 2px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}

.pricing-explainer h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.pricing-explainer p {
  max-width: 70ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.pricing-explainer strong {
  color: var(--ink);
}

.pricing-explainer__formula {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: center;
  gap: 6px 12px;
  font-size: 12px;
}

.pricing-explainer__formula span {
  color: var(--muted);
}

.pricing-explainer__formula strong {
  font-family: var(--mono);
  font-size: 13px;
}

.pricing-explainer__example {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
}

.model-cell small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.status::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: var(--success);
  border-radius: 50%;
  content: "";
}

.status--off::before,
.status--error::before {
  background: var(--danger);
}

.status--warn::before {
  background: #c98313;
}

.tag {
  display: inline-block;
  padding: 3px 5px;
  color: var(--info);
  background: rgba(40, 95, 151, .1);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.danger-text {
  color: var(--danger);
}

.profit-text {
  color: var(--success);
}

.request-rail {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.request-list {
  display: grid;
}

.request-item {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.request-item-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.request-item-head strong {
  font-family: var(--mono);
  font-size: 12px;
}

.request-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.request-charge {
  color: var(--danger);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.request-charge--ok {
  color: var(--success);
}

.trace {
  padding: 18px;
  color: var(--white);
  background: var(--ink);
}

.trace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.trace-head h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
}

.trace-head span {
  color: #9da295;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.trace-flow {
  display: grid;
  grid-template-columns: 1fr 34px 1fr 34px 1fr;
  align-items: center;
  margin-top: 17px;
}

.trace-node {
  min-width: 0;
  padding: 12px;
  color: var(--ink);
  background: var(--paper);
}

.trace-node strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-node span {
  display: block;
  margin-top: 3px;
  color: #666b60;
  font-family: var(--mono);
  font-size: 12px;
}

.trace-node--accent {
  background: var(--acid);
}

.trace-connector {
  height: 1px;
  background: #5f6459;
}

.trace-connector::after {
  display: block;
  width: 5px;
  height: 5px;
  margin: -2px 0 0 auto;
  background: var(--acid);
  border-radius: 50%;
  content: "";
}

.trace-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 12px;
  color: #a3a89c;
  font-family: var(--mono);
  font-size: 12px;
}

/* Forms and management */
.editor-panel {
  padding: 20px;
  background: var(--paper-deep);
  border-top: 2px solid var(--ink);
}

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

.editor-head h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
}

.editor-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

.form-grid .field--full,
.form-grid .form-actions,
.form-grid .form-error {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.inline-form .field {
  min-width: 0;
  flex: 1;
}

.inline-form .field--small {
  max-width: 140px;
}

.description-list {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
}

.description-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.description-row dt {
  color: var(--muted);
  font-size: 12px;
}

.description-row dd {
  min-width: 0;
  font-size: 12px;
}

.empty-state {
  padding: 34px 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
}

.empty-state p {
  max-width: 500px;
  margin: 5px auto 14px;
  font-size: 12px;
}

.callout {
  padding: 12px 14px;
  color: #52574d;
  background: rgba(223, 255, 88, .3);
  border: 1px solid #bbc66f;
  font-size: 12px;
}

.danger-callout {
  color: #77372f;
  background: rgba(180, 61, 48, .08);
  border-color: rgba(180, 61, 48, .28);
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 30px;
}

.docs-layout > * {
  min-width: 0;
}

.docs-layout section {
  min-width: 0;
}

.code-block {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 16px;
  color: #e8eadf;
  background: var(--ink);
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre;
}

.code-block .code-command {
  color: var(--acid);
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.copy-row code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-band {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.metric {
  min-width: 0;
  overflow: hidden;
  padding: 18px 18px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.user-usage-row > td {
  padding: 0;
  background: var(--paper-deep);
  border-top: 1px solid var(--ink);
}

.user-usage-row:hover {
  background: var(--paper-deep);
}

.user-usage-panel {
  padding: 17px 12px 20px;
}

.user-usage-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.user-usage-head h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -.015em;
}

.user-usage-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.user-usage-table-frame {
  border-top-width: 1px;
}

.user-usage-loading {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 12px;
}

.usage-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 620px) {
  .user-usage-head {
    align-items: stretch;
    flex-direction: column;
  }

  .user-usage-head .button {
    align-self: flex-start;
  }

  .usage-pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

.key-prefix {
  font-family: var(--mono);
  font-size: 12px;
}

/* Dialog and toast */
.dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 22px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(20, 22, 17, .24);
}

.dialog::backdrop {
  background: rgba(17, 19, 15, .56);
  backdrop-filter: blur(3px);
}

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

.dialog-head h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
}

.dialog-kicker {
  margin-bottom: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.dialog-note {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.dialog .field {
  margin-bottom: 14px;
}

.dialog .button {
  margin-top: 12px;
}

.secret-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 9px 9px 12px;
  color: var(--acid);
  background: var(--ink);
}

.secret-box code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secret-box .icon-button {
  width: 31px;
  height: 31px;
  color: var(--acid);
  border-color: var(--line-dark);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100vw - 44px));
  padding: 12px 15px;
  color: var(--white);
  background: var(--ink);
  border: 1px solid #3f4438;
  border-radius: var(--radius);
  box-shadow: 0 16px 45px rgba(20, 22, 17, .22);
  font-size: 12px;
  animation: toast-in .18s ease-out;
}

.toast--error {
  color: #fff2ef;
  background: #762d25;
  border-color: #9e4a3e;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Responsive */
@media (max-width: 1180px) {
  .dashboard-grid,
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .request-rail {
    padding-top: 18px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .request-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
  }

  .account-strip {
    grid-template-columns: 1fr 1fr auto;
  }

  .account-strip > div:nth-child(3),
  .account-strip > div:nth-child(4) {
    grid-column: 1 / 3;
    border-top: 1px solid rgba(23, 25, 20, .18);
  }

  .account-strip .button {
    grid-column: 3;
    grid-row: 1 / 3;
  }
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-intro {
    min-height: auto;
    padding: 24px;
  }

  .auth-thesis {
    padding: 56px 0 42px;
  }

  .auth-thesis h1 {
    font-size: 52px;
  }

  .auth-facts {
    margin-top: 24px;
  }

  .auth-panel {
    min-height: auto;
    padding: 34px 24px 52px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 30;
    top: 0;
    width: 100%;
    height: auto;
    padding: 10px 14px;
    overflow: hidden;
  }

  .sidebar-head {
    padding: 0 0 9px;
  }

  .nav-stack {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .nav-stack + .nav-stack {
    margin-top: 6px;
    padding-top: 6px;
  }

  .nav-label {
    display: none;
  }

  .nav-item {
    width: auto;
    flex: 0 0 auto;
    padding: 8px 10px;
    white-space: nowrap;
  }

  .sidebar-foot {
    position: absolute;
    top: 9px;
    right: 13px;
    width: auto;
    padding: 0;
    border: 0;
  }

  .account-mini > div {
    display: none;
  }

  .topbar {
    position: static;
    min-height: 74px;
    padding: 12px 18px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .balance-chip {
    min-width: 0;
  }

  .balance-chip span {
    display: none;
  }

  .content {
    padding: 22px 18px 50px;
  }

  .account-strip {
    grid-template-columns: 1fr 1fr;
  }

  .account-strip > div:nth-child(3),
  .account-strip > div:nth-child(4) {
    grid-column: 1 / -1;
  }

  .account-strip .button {
    grid-column: 1 / -1;
    grid-row: auto;
    width: calc(100% - 32px);
  }

  .trace-flow {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .trace-connector {
    width: 1px;
    height: 10px;
    margin-left: 18px;
    background: #5f6459;
  }

  .trace-connector::after {
    margin: 3px 0 0 -2px;
  }
}

@container model-catalog (max-width: 712px) {
  .cheapest-model {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .cheapest-model-main {
    grid-column: 1 / -1;
  }

  .cheapest-model-main strong,
  .cheapest-model-main small {
    overflow-wrap: anywhere;
  }

  .cheapest-model > .button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .auth-intro {
    padding: 20px;
  }

  .auth-thesis {
    padding: 40px 0 30px;
  }

  .auth-thesis h1 {
    font-size: 40px;
  }

  .auth-facts {
    grid-template-columns: 1fr;
  }

  .auth-facts > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #30342c;
  }

  .auth-facts strong {
    margin-top: 0;
  }

  .auth-panel {
    padding-inline: 20px;
  }

  .auth-heading h2 {
    font-size: 29px;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .content {
    padding-inline: 14px;
  }

  .view-head {
    align-items: start;
    flex-direction: column;
  }

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

  .account-strip {
    grid-template-columns: 1fr;
  }

  .account-strip > div {
    border-right: 0;
    border-bottom: 1px solid rgba(23, 25, 20, .18);
  }

  .account-strip > div:nth-child(3),
  .account-strip > div:nth-child(4) {
    grid-column: auto;
    border-top: 0;
  }

  .account-strip .button {
    grid-column: auto;
  }

  .request-list {
    grid-template-columns: 1fr;
  }

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

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-form .field--small {
    max-width: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .description-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .data-table {
    min-width: 570px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Online recharge follows the existing dispatch console. */
.payment-create-form { flex-direction: row; align-items: end; flex-wrap: wrap; }
.payment-create-form > .field { flex: 1 1 180px; }
.payment-create-form > p { flex-basis: 100%; margin: 0; }
.payment-details { display: flex; align-items: flex-start; gap: 28px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.payment-qr { display: block; width: min(256px, 100%); height: auto; aspect-ratio: 1; flex-shrink: 0; background: var(--white); }
.payment-summary { flex: 1; min-width: 0; }
.payment-summary h3 { margin: 0 0 10px; font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.payment-summary > p { margin: 12px 0 18px; max-width: 65ch; }
.payment-summary .description-row { grid-template-columns: 100px minmax(0, 1fr); gap: 14px; }
.payment-summary dd { overflow-wrap: anywhere; }
.payment-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.payment-order-id { max-width: 280px; overflow-wrap: anywhere; white-space: normal; }
.payment-device-list > h3 { margin: 0 0 12px; font-family: var(--serif); font-size: 22px; font-weight: 400; }
.payment-device-list .muted.mono { margin-top: 4px; font-size: 12px; }
@media (max-width: 700px) {
  .pricing-explainer {
    grid-template-columns: 1fr;
  }

  .pricing-explainer__example {
    grid-column: auto;
  }

  .payment-details { flex-direction: column; gap: 18px; }
  .payment-summary { width: 100%; }
  .payment-create-form > button { flex: 1 1 180px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.group-description { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 75ch; font-weight: 400; }
