/* Account pages (/account/billing, /account/api) and the API reference (/docs/api).
   Loaded after site.css and app.css and built on their tokens, so both themes
   follow the site-wide data-theme switch without a separate palette. */

.acct-body [hidden] { display: none !important; }

html:has(> body.acct-body) { scroll-padding-top: 92px; }
.acct-body section[id],
.acct-body main[id] { scroll-margin-top: 0; }

.acct-container {
  width: min(1180px, 100% - 40px);
  margin-inline: auto;
}

.acct-stack {
  display: grid;
  gap: 18px;
}
.acct-stack > * { min-width: 0; }

.acct-skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 60;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
}
.acct-skip:focus { top: 12px; }

.acct-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.acct-offscreen {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---------- Shell adjustments ---------- */

.acct-body .app-titlebar { padding: 28px 0 22px; }
.acct-body .app-titlebar h1 { max-width: none; }
.acct-body .app-main { padding: 24px 0 56px; }

.acct-body h2,
.acct-body h3 {
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.acct-body .app-section-head h2 { line-height: 1.2; }
.acct-body .app-section-sub { max-width: 720px; }

.acct-body .app-site-top .app-nav {
  align-self: stretch;
  border-top: 0;
}
.acct-body .app-site-top .app-nav-link { min-height: 74px; }

.acct-body .app-logout .top-action {
  background: transparent;
  color: var(--muted);
}
.acct-body .app-logout .top-action:hover {
  background: var(--app-hover);
  color: var(--red);
}
.app-header-actions .top-action.acct-top-ghost {
  background: transparent;
  color: var(--muted);
}
.app-header-actions .top-action.acct-top-ghost:hover {
  background: var(--app-hover);
  color: var(--text);
}

.acct-body main a:not(.app-cta) {
  color: var(--orange-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.acct-body main a:not(.app-cta):hover { color: var(--text); }

.acct-body :is(a, button, input, pre, code):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.acct-state:focus,
.acct-secret:focus { outline: none; }

.acct-body .app-cta { min-height: 44px; text-align: center; }
.acct-body .app-cta:disabled,
.acct-body .app-cta[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}
.acct-body .app-cta:disabled:hover {
  border-color: var(--line-2);
  background: var(--app-control);
  color: var(--text);
}
.acct-body .app-cta.is-primary:disabled:hover {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--bg);
}
:root[data-theme="light"] .acct-body .app-cta.is-primary:disabled:hover { color: #0d1724; }
.acct-body .app-cta.is-danger {
  border-color: var(--red);
  color: var(--red);
}
.acct-body .app-cta.is-danger:hover:not(:disabled) {
  background: var(--red);
  color: var(--bg);
}

.acct-footer {
  display: grid;
  gap: 10px;
}
.acct-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.acct-footer-links a { color: var(--muted); }
.acct-footer-links a:hover { color: var(--text); }

/* ---------- Banners, pills, states ---------- */

.acct-banner {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  background: var(--app-panel);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.acct-banner.is-success { border-left-color: var(--green); }
.acct-banner.is-info { border-left-color: var(--cyan); }
.acct-banner.is-warning { border-left-color: var(--amber); }
.acct-banner.is-error { border-left-color: var(--red); }
.acct-banner.is-sandbox {
  border-left-color: var(--amber);
  border-style: dashed;
  border-left-style: solid;
  font-family: var(--mono);
  font-size: 12px;
}

.acct-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}
.acct-pill.is-good { color: var(--green); }
.acct-pill.is-bad { color: var(--red); }
.acct-pill.is-warn { color: var(--amber); }
.acct-pill.is-muted { color: var(--muted); }
.acct-pill.is-accent { color: var(--orange-2); }

.acct-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
}
.acct-state p { margin: 0; max-width: 520px; }
.acct-state h2 { margin: 0; font-size: 20px; color: var(--text); }
.acct-state.is-error { border-color: var(--red); }

.acct-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--line-2);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: acct-spin 0.8s linear infinite;
}
@keyframes acct-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .acct-spinner { animation-duration: 2.4s; }
}

.acct-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.acct-hint:empty { display: none; }
.acct-empty {
  margin: 0;
  padding: 18px 16px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
}
.acct-field-error {
  margin: 10px 0 0;
  color: var(--red);
  font-size: 13.5px;
  font-weight: 600;
}
.acct-subhead {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}

/* ---------- Membership ---------- */

.acct-plan {
  display: grid;
  gap: 14px;
}
.acct-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.acct-plan-name {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.acct-plan-price {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}
.acct-plan-period {
  margin: 0;
  font-size: 15px;
}
.acct-plan-actions .acct-field-error { margin-top: 10px; }

.acct-meters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.acct-meter {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--app-card);
}
.acct-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.acct-meter-label {
  font-size: 13.5px;
  font-weight: 600;
}
.acct-meter-count {
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.acct-meter-track {
  display: block;
  height: 8px;
  margin: 12px 0 8px;
  border-radius: 999px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.acct-meter-fill {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--cyan);
}
.acct-meter.is-full .acct-meter-fill { background: var(--orange); }
.acct-meter-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.acct-meter.is-full .acct-meter-note { color: var(--orange-2); font-weight: 600; }

.acct-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.acct-fact {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--app-card);
}
.acct-fact h3 { margin: 0 0 8px; font-size: 16px; }
.acct-fact p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}
.acct-fact .acct-fact-value {
  margin-bottom: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}
.acct-fact-value:empty { display: none; }

.acct-plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.acct-plan-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--app-card);
}
.acct-plan-card.is-highlight { border-color: var(--orange); }
.acct-plan-card.is-current {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}
.acct-plan-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}
.acct-plan-card h3 { margin: 0; font-size: 20px; }
.acct-plan-card-price { margin: 0; color: var(--muted); font-size: 13px; }
.acct-plan-card-price strong {
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.acct-plan-card-detail { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.45; }
.acct-plan-card-audience { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.acct-plan-features {
  margin: 0;
  padding: 10px 0 0 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
}
.acct-plan-features li { margin: 0 0 5px; }
.acct-plan-card-action { margin-top: auto; padding-top: 6px; }
.acct-plan-card-action .app-cta { width: 100%; }

/* ---------- Developer console ---------- */

.acct-credit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.acct-balance,
.acct-topup {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--app-card);
}
.acct-balance-label {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.acct-balance-value {
  margin: 8px 0 0;
  font-size: clamp(30px, 6vw, 42px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.acct-balance-held { margin: 8px 0 0; color: var(--amber); font-size: 13px; }
.acct-balance-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.acct-balance-stats dt { color: var(--muted); font-size: 12px; }
.acct-balance-stats dd {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.acct-balance .acct-empty,
.acct-balance .acct-banner { margin-top: 14px; }

.acct-topup fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.acct-topup legend {
  padding: 0;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}
.acct-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.acct-presets:empty { display: none; }
.acct-preset {
  min-width: 72px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--app-control);
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.acct-preset:hover:not(:disabled) { border-color: var(--orange); }
.acct-preset[aria-pressed="true"] {
  border-color: var(--orange);
  box-shadow: inset 0 0 0 1px var(--orange);
}
.acct-preset:disabled { opacity: 0.55; cursor: not-allowed; }

.acct-label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.acct-amount {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
}
.acct-amount > span { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.acct-body input[type="text"] {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--app-control);
  color: var(--text);
  font-size: 15px;
}
.acct-body input[type="text"]::placeholder { color: var(--dim); opacity: 1; }
.acct-body input[type="text"]:disabled { opacity: 0.55; cursor: not-allowed; }
.acct-body input[aria-invalid="true"] { border-color: var(--red); }
.acct-topup .app-cta { margin-top: 14px; }

.acct-keyform { margin-bottom: 16px; }
.acct-keyform .acct-label { margin-top: 0; }
.acct-keyform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.acct-keyform-row input { flex: 1 1 240px; max-width: 420px; }
.acct-keyform .acct-hint { margin-top: 8px; }
.acct-body [data-slot="keys-readonly"] { margin: 0 0 14px; }

.acct-secret {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--amber);
  border-left-width: 3px;
  border-radius: 12px;
  background: var(--app-card);
}
.acct-secret h3 { margin: 0; font-size: 18px; }
.acct-secret p { margin: 0; font-size: 14px; line-height: 1.55; }
.acct-secret-name { color: var(--muted); }
.acct-secret-name strong { color: var(--text); overflow-wrap: anywhere; }
.acct-secret-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}
.acct-secret-value {
  flex: 1 1 260px;
  min-width: 0;
  padding: 12px;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-all;
  user-select: all;
}
.acct-secret-row .acct-copy { min-height: 44px; padding: 0 16px; }

.acct-copy {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--app-control);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
.acct-copy:hover { border-color: var(--orange); color: var(--text); }
.acct-copy.is-done { border-color: var(--green); color: var(--green); }

.acct-inline-danger {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--red);
  border-radius: 6px;
  background: transparent;
  color: var(--red);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.acct-inline-danger { white-space: nowrap; }
.acct-inline-danger:hover { background: var(--red); color: var(--bg); }

/* Tables */
.acct-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--app-table);
}
.acct-body .app-table th,
.acct-body .app-table td { vertical-align: top; }
.acct-body .app-table tbody tr:last-child > * { border-bottom: 0; }
.acct-body .app-table tbody th {
  border-bottom: 1px solid var(--app-hairline);
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.acct-table .is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.acct-body .acct-table th,
.acct-body .acct-table td { padding: 11px 12px; }
.acct-table td { overflow-wrap: break-word; }
.acct-table td time,
.acct-table td .acct-pill,
.acct-table td > code { white-space: nowrap; }
.acct-body [data-slot="by-model"] td > code { white-space: normal; }
.acct-key-name {
  display: inline-block;
  min-width: 150px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.acct-model,
.acct-table th[scope="row"] { min-width: 200px; }
.acct-model { display: grid; gap: 4px; }
.acct-model-name {
  display: block;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
}
.acct-model-desc {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
}
.acct-amount-in { color: var(--green); }
.acct-amount-out { color: var(--red); }

.acct-body code {
  font-family: var(--mono);
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.acct-usage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.acct-usage-grid > * { min-width: 0; }

.acct-bars {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.acct-bar-row {
  display: grid;
  grid-template-columns: 52px minmax(32px, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
}
.acct-bar-day { color: var(--muted); white-space: nowrap; }
.acct-bar-track {
  display: block;
  height: 10px;
  border-radius: 3px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.acct-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
}
.acct-bar-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-bar-row.is-zero .acct-bar-value { color: var(--muted); }

/* Code blocks */
.acct-code {
  min-width: 0;
  max-width: 100%;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--app-card);
  overflow: hidden;
}
.acct-code figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 5px 8px 5px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--app-table-head);
}
.acct-code-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.acct-code pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  tab-size: 2;
}
.acct-code pre code {
  font-size: inherit;
  overflow-wrap: normal;
}

/* Revoke dialog */
.acct-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.acct-dialog::backdrop { background: rgba(7, 6, 4, 0.62); }
.acct-dialog h2 { margin: 0 0 12px; font-size: 20px; }
.acct-dialog p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; }
.acct-dialog-key strong { overflow-wrap: anywhere; }
.acct-dialog-key code { color: var(--muted); }
.acct-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- API reference ---------- */

.docs-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: start;
  gap: 36px;
}
.docs-toc {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--app-panel);
}
.docs-toc-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.docs-toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.acct-body main .docs-toc ol a {
  display: block;
  padding: 7px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-size: 13.5px;
  text-decoration: none;
}
.acct-body main .docs-toc ol a:hover { background: var(--app-hover); color: var(--text); }
.acct-body main .docs-toc ol a[aria-current] {
  border-left-color: var(--orange);
  color: var(--text);
  font-weight: 600;
}
.docs-toc-cta { width: 100%; margin-top: 14px; }

.docs-article {
  min-width: 0;
  font-size: 15px;
  line-height: 1.65;
}
.docs-lead p { margin: 0 0 14px; }
.docs-section-block {
  padding: 30px 0 6px;
  border-bottom: 1px solid var(--line);
}
.docs-section-block:last-child { border-bottom: 0; }
.docs-section-block > h2 { margin: 0 0 12px; font-size: 24px; }
.docs-section-block h3 { margin: 24px 0 8px; font-size: 17px; }
.docs-section-block p { margin: 0 0 14px; max-width: 78ch; }
.docs-section-block ul,
.docs-section-block ol { margin: 0 0 16px; padding-left: 22px; max-width: 78ch; }
.docs-section-block li { margin-bottom: 7px; }
.docs-section-block .app-cta-row,
.docs-section-block .acct-table-wrap,
.docs-section-block .acct-banner { margin-bottom: 18px; }
.docs-article :not(pre) > code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-2);
}
.docs-keyvalue {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.docs-keyvalue > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--app-card);
}
.docs-keyvalue dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.docs-keyvalue dd { margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
.docs-table td {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
}
.docs-table tbody th { width: 34%; line-height: 1.7; }
.docs-errors tbody th { width: 110px; font-family: var(--mono); white-space: nowrap; }
.docs-errors td:nth-child(2) { width: 30%; line-height: 1.9; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  html:has(> body.acct-body) { scroll-padding-top: 16px; }
  .acct-body .app-site-top { position: static; }
  .acct-body .app-site-top .app-nav { overflow-x: visible; border-top: 1px solid var(--line); }
  .acct-body .app-site-top .app-nav-link { min-height: 44px; }
  .acct-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .docs-toc {
    position: static;
    max-height: none;
  }
  .docs-toc ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .docs-toc-cta { display: none; }
  .acct-usage-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .acct-meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acct-facts { grid-template-columns: minmax(0, 1fr); }
  .acct-credit { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1040px) {
  .acct-table-wrap:has(> .is-stack) { overflow-x: visible; }
  .acct-table.is-stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
  }
  .acct-table.is-stack,
  .acct-table.is-stack tbody,
  .acct-table.is-stack tr { display: block; width: 100%; }
  .acct-table.is-stack tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  .acct-table.is-stack tr:last-child { border-bottom: 0; }
  .acct-body .acct-table.is-stack tbody > tr > * {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    padding: 4px 0;
    border: 0;
    text-align: right;
    white-space: normal;
  }
  .acct-table.is-stack td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 48%;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
  }
  .acct-body .acct-table.is-stack tbody > tr > :first-child {
    display: block;
    padding-bottom: 8px;
    text-align: left;
    font-size: 13.5px;
  }
  .acct-table.is-stack tbody > tr > :first-child::before { content: none; }
  .acct-table.is-stack td:empty { display: none; }
  .acct-table.is-stack td:not([data-label]) { justify-content: flex-end; padding-top: 8px; }
  .acct-model,
  .acct-key-name,
  .acct-table th[scope="row"] { min-width: 0; }
  .acct-table.is-stack td { overflow-wrap: anywhere; }
}

@media (max-width: 640px) {
  .docs-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-keyvalue { grid-template-columns: minmax(0, 1fr); }
  .docs-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
  }
  .docs-table,
  .docs-table tbody,
  .docs-table tr,
  .acct-body .docs-table tbody > tr > * { display: block; width: 100%; }
  .docs-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .docs-table tr:last-child { border-bottom: 0; }
  .acct-body .docs-table tbody > tr > * { padding: 2px 0; border: 0; white-space: normal; }
  .docs-errors td:nth-child(2) { width: 100%; }
  .docs-section-block > h2 { font-size: 21px; }
}

@media (max-width: 600px) {
  .acct-container { width: min(1180px, 100% - 28px); }
  .acct-body .app-nav-link { padding: 0 12px; }
  .acct-plans { grid-template-columns: minmax(0, 1fr); }
  .acct-plan-name { font-size: 26px; }
  .acct-body .app-cta-row .app-cta { flex: 1 1 100%; }
  .acct-keyform-row input { flex-basis: 100%; max-width: none; }
  .acct-keyform-row .app-cta { flex: 1 1 100%; }
  .acct-dialog-actions .app-cta { flex: 1 1 100%; }
  .acct-code pre { font-size: 12px; padding: 12px; }
}

@media (max-width: 440px) {
  .acct-meters { grid-template-columns: minmax(0, 1fr); }
  .acct-bar-row { grid-template-columns: 48px minmax(20px, 1fr) auto; gap: 8px; font-size: 11.5px; }
}
