:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-strong: #111827;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --field-line: #d8dde6;
  --green: #0a84ff;
  --cyan: #0f766e;
  --red: #d92d20;
  --amber: #b7791f;
  --code: #111827;
  --code-text: #f9fafb;
  --soft: #f9fafb;
  --soft-blue: #eef5ff;
  --shadow: 0 14px 34px rgba(17, 24, 39, 0.06);
  --content-narrow-max: 980px;
  --content-wide-max: 1188px;
  --console-grid-max: 1000px;
  --overview-grid-max: 1120px;
  --overview-inner-max: 940px;
  --docs-page-max: 1280px;
  --docs-nav-width: 260px;
  --docs-reading-width: 860px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.brand-image {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--line);
  image-rendering: pixelated;
  background: #fff;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

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

.brand-copy strong {
  font-size: 15px;
  font-weight: 700;
}

.brand-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.top-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-link,
.side-nav a {
  color: var(--muted);
  text-decoration: none;
}

.top-link {
  padding: 6px 0;
  font-size: 14px;
  font-weight: 600;
}

.top-link:hover,
.side-nav a:hover {
  color: var(--green);
}

.top-link.active-link,
.side-link.active-link {
  color: var(--text);
}

.shell {
  width: 100%;
  margin: 0;
}

.developer-layout {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.developer-main {
  min-width: 0;
  padding: 40px 0 72px;
}

.side-rail {
  position: sticky;
  top: 69px;
  min-height: calc(100vh - 69px);
  display: flex;
  flex-direction: column;
  align-self: start;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 72px;
  align-items: stretch;
  max-width: var(--console-grid-max);
  margin: 0 auto;
}

.overview-grid {
  max-width: var(--overview-grid-max);
}

.panel,
.doc-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.dashboard-panel {
  grid-column: 1 / -1;
}

.placeholder-grid,
.docs-shell {
  gap: 28px;
}

.placeholder-panel {
  min-height: 240px;
  display: flex;
  align-items: center;
}

.content-grid.docs-page-content {
  margin: 28px auto 0;
}

.docs-page-shell {
  display: grid;
  gap: 28px;
  padding: 32px 0 72px;
}

.docs-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 24px;
  align-items: start;
}

.docs-hero-copy,
.docs-hero-side,
.docs-internal-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.docs-hero-copy h1 {
  margin: 8px 0 12px;
  font-size: 36px;
  line-height: 1.12;
}

.docs-hero-copy .overview-note {
  max-width: 820px;
  margin: 0;
}

.docs-hero-side {
  display: grid;
  gap: 10px;
}

.docs-page-main {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.docs-internal-nav {
  position: sticky;
  top: 92px;
}

.docs-internal-card {
  display: grid;
  gap: 14px;
}

.docs-internal-card strong {
  font-size: 14px;
  font-weight: 700;
}

.docs-internal-card nav {
  display: grid;
  gap: 8px;
}

.docs-internal-card nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
}

.docs-internal-card nav a:hover {
  color: var(--green);
}

.docs-content-shell {
  min-width: 0;
}

.docs {
  display: grid;
  gap: 18px;
}

.doc-section {
  padding: 22px 24px;
}

.doc-section h2 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.25;
}

.doc-section h3 {
  margin: 22px 0 12px;
  font-size: 16px;
  line-height: 1.35;
}

.doc-section p,
.doc-section li {
  color: #4b5565;
  font-size: 14px;
  line-height: 1.85;
}

.doc-section p {
  margin: 0 0 12px;
}

.doc-section p:last-child {
  margin-bottom: 0;
}

.doc-section ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.doc-section pre {
  overflow-x: auto;
  margin: 14px 0 0;
  padding: 16px 18px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #fbfcfd;
}

.doc-section pre code {
  color: #1f2937;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre;
}

.doc-section code {
  padding: 1px 6px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #1f2937;
  font-size: 12px;
}

.docs-page-shell .table-wrap {
  margin-top: 14px;
}

.docs-page-shell .table-wrap table {
  width: 100%;
}

.docs-page-shell .table-wrap th,
.docs-page-shell .table-wrap td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.docs-page-shell .table-wrap thead th {
  color: #8a94a6;
  font-size: 12px;
  font-weight: 700;
  background: #fbfcfd;
}

.docs-page-shell .table-wrap tbody td {
  color: #374151;
  font-size: 13px;
  line-height: 1.75;
}

.api-key-page {
  max-width: var(--content-narrow-max);
  margin: 0 auto;
}

.api-key-header {
  max-width: 760px;
  margin-bottom: 18px;
}

.api-key-header h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.15;
}

.api-key-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.api-key-card {
  overflow: hidden;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #ffffff;
}

.remote-api-page {
  display: grid;
  gap: 18px;
}

.remote-api-summary-card {
  padding: 18px;
}

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

.remote-api-summary-head strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 15px;
}

.remote-api-summary-head .status-line {
  justify-content: flex-start;
  padding: 0;
  background: transparent;
  color: var(--muted);
}

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

.remote-api-metrics article {
  display: grid;
  gap: 4px;
  min-height: 98px;
  padding: 14px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #fbfcfd;
}

.remote-api-metrics small,
.remote-api-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.remote-api-metrics strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.15;
}

.remote-api-token-table {
  min-width: 920px;
}

.api-key-table-wrap {
  overflow-x: auto;
}

.api-key-table {
  min-width: 680px;
}

.api-key-table thead th {
  padding: 14px 18px;
  border-bottom: 1px solid #f0f2f5;
  color: #8a94a6;
  font-size: 12px;
  font-weight: 600;
  background: #fcfcfd;
}

.api-key-table tbody td {
  padding: 15px 18px;
  border-bottom: 0;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}

.api-key-name {
  font-weight: 600;
}

.api-key-value code {
  padding: 0;
  border: 0;
  background: transparent;
  color: #4b5565;
  font-size: 13px;
}

.action-column {
  width: 88px;
}

.api-key-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-size: 14px;
  font-weight: 400;
  box-shadow: none;
}

.icon-action:hover {
  background: #f3f5f8;
  color: var(--text);
}

.icon-action:disabled {
  opacity: 1;
  cursor: default;
}

.api-key-footer {
  margin-top: 14px;
}

.remote-api-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.api-key-footer-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.api-key-footer-status.ok {
  color: var(--green);
}

.api-key-footer-status.error {
  color: var(--red);
}

.api-key-secret-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #ffffff;
}

.api-key-secret-head {
  display: grid;
  gap: 2px;
}

.api-key-secret-head strong {
  font-size: 14px;
}

.api-key-secret-head span {
  color: var(--muted);
  font-size: 12px;
}

.api-key-secret-stack {
  display: grid;
  gap: 10px;
}

.api-key-secret-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.api-key-secret-row code {
  display: block;
  padding: 12px 14px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #fbfcfe;
  color: #2f3948;
  overflow-wrap: anywhere;
}

.api-key-secret-copy {
  min-width: 72px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.18);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-shell {
  width: min(100%, 420px);
  border: 1px solid #e8ebf0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 44px rgba(17, 24, 39, 0.12);
}

.modal-shell-sm {
  width: min(100%, 390px);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 18px 0;
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.modal-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.modal-close {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font-size: 20px;
  font-weight: 400;
  box-shadow: none;
}

.modal-close:hover {
  background: #f4f6f9;
  color: var(--text);
}

.modal-body {
  padding: 18px;
}

.modal-field {
  display: grid;
  gap: 8px;
}

.modal-field span {
  font-size: 13px;
  font-weight: 600;
}

.modal-copy {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 18px;
}

.danger-action {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

.danger-action:hover {
  border-color: #1f2937;
  background: #1f2937;
}

.dark-action {
  min-height: 34px;
  padding: 4px 12px;
  border: 1px solid #111111;
  border-radius: 8px;
  background: #111111;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  box-shadow: none;
}

.dark-action:hover {
  border-color: #1f2937;
  background: #1f2937;
}

.ledger-page {
  max-width: var(--content-narrow-max);
  margin: 0 auto;
}

.stack-page {
  max-width: var(--content-narrow-max);
  margin: 0 auto;
}

.page-stack {
  display: grid;
  gap: 18px;
}

.page-stack:has(.plan-offer-grid) {
  max-width: min(100%, var(--content-wide-max));
}

.page-card {
  padding: 18px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #ffffff;
}

.page-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.3;
}

.page-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.subscription-current-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #ffffff;
}

.subscription-current-copy {
  display: grid;
  gap: 4px;
}

.subscription-current-copy small,
.subscription-current-copy span,
.subscription-current-meta span {
  color: var(--muted);
}

.subscription-current-copy strong {
  font-size: 22px;
  line-height: 1.2;
}

.subscription-current-copy .subscription-enterprise-name {
  color: #8a94a6;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.subscription-current-copy .subscription-enterprise-name[hidden] {
  display: none;
}

.subscription-current-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 13px;
}

.subscription-current-meta strong {
  color: var(--text);
  font-weight: 600;
}

.plan-offer-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 372px));
  justify-content: center;
  align-items: stretch;
}

.plan-offer-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 16px;
  min-width: 0;
  min-height: 390px;
  padding: 20px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #ffffff;
}

.plan-offer-card-active {
  border-color: #dfe8f6;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.04);
}

.plan-offer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.plan-offer-head > div {
  min-width: 0;
}

.plan-offer-head small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.plan-offer-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.plan-offer-tag {
  display: inline-flex;
  align-items: center;
  flex: none;
  max-width: 142px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #e8edf5;
  border-radius: 999px;
  background: #fafbfc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.plan-offer-price {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.plan-offer-price strong {
  font-size: 28px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.plan-offer-price span {
  color: var(--muted);
  font-size: 12px;
}

.plan-offer-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: #374151;
  font-size: 13px;
  line-height: 1.7;
  min-width: 0;
}

.plan-offer-list li {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.plan-offer-list strong {
  color: var(--text);
}

.plan-offer-services {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.plan-offer-services > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.plan-offer-services-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 74px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.plan-offer-services-scroll b {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid #e8edf5;
  border-radius: 999px;
  background: #fafbfc;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.plan-offer-empty {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
}

.plan-offer-action {
  justify-self: start;
  width: 132px;
  min-width: 132px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #111111;
  border-radius: 8px;
  background: #111111;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
}

.plan-offer-action-upgrade {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

.plan-offer-action-upgrade:hover {
  border-color: #1f2937;
  background: #1f2937;
}

.wallet-page-card {
  max-width: var(--content-narrow-max);
  margin: 0 auto;
  display: grid;
  gap: 20px;
  padding: 24px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #ffffff;
}

.wallet-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.wallet-card-head h1 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.15;
}

.wallet-card-head p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.wallet-card-head .status-line {
  padding: 0;
  background: transparent;
}

.wallet-balance-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #fbfcfd;
}

.wallet-balance-copy {
  display: grid;
  gap: 4px;
}

.wallet-balance-copy small,
.wallet-balance-copy span {
  color: var(--muted);
  font-size: 12px;
}

.wallet-balance-copy strong {
  color: var(--text);
  font-size: 32px;
  line-height: 1.1;
}

.wallet-balance-detail {
  cursor: help;
}

.wallet-history-head {
  display: flex;
  justify-content: flex-start;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  background: #f7f8fa;
}

.segmented-control button {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.segmented-control button.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.wallet-history-table-wrap {
  border: 1px solid #eef1f5;
  border-radius: 8px;
  overflow-x: auto;
}

.wallet-history-table {
  min-width: 100%;
  table-layout: auto;
}

.wallet-history-table[hidden] {
  display: none;
}

.plan-offer-action-current,
.plan-offer-action.is-disabled,
.plan-offer-action[aria-disabled="true"] {
  border-color: #e5e7eb;
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: none;
}

#subscriptionActionStandard,
#subscriptionActionProfessional {
  align-self: end;
  justify-self: stretch;
  width: auto;
  min-width: 0;
  min-height: 30px;
  padding: 0 14px;
  margin-top: auto;
}

.request-log-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.request-log-toolbar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.segmented-actions button {
  min-height: 36px;
  padding: 6px 12px;
}

.segmented-actions button.is-active {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

.request-log-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

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

.summary-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #ffffff;
}

.summary-card small,
.summary-card span {
  color: var(--muted);
}

.summary-card small {
  font-size: 12px;
  font-weight: 700;
}

.summary-card strong {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.summary-card span {
  font-size: 12px;
  line-height: 1.7;
}

.info-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #e7ebf2;
  border-radius: 999px;
  background: #fbfcfe;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.placeholder-table-note {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.profile-page {
  max-width: 740px;
  margin: 0 auto;
}

.profile-header {
  max-width: 820px;
  margin-bottom: 20px;
}

.profile-header h1 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.15;
}

.profile-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.profile-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #ffffff;
}

.profile-section-head {
  margin-bottom: 14px;
}

.profile-section-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.profile-info-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.profile-info-list div {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f5;
}

.profile-info-list div:last-child {
  border-bottom: 0;
}

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

.profile-info-list dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.profile-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-value-row span {
  min-width: 0;
  flex: 1 1 auto;
}

.security-stack {
  display: grid;
  gap: 14px;
}

.security-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f2f5;
}

.security-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.security-copy {
  min-width: 0;
}

.security-copy strong {
  display: block;
  font-size: 14px;
  line-height: 1.4;
}

.security-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.security-item-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.password-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.password-form label {
  display: grid;
  gap: 8px;
}

.password-form label span {
  font-size: 13px;
  font-weight: 600;
}

.password-form-actions {
  display: flex;
  justify-content: flex-start;
}

.form-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.ledger-header {
  max-width: 820px;
  margin-bottom: 18px;
}

.ledger-header h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.15;
}

.ledger-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.ledger-card {
  overflow: hidden;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #ffffff;
}

.ledger-table-wrap {
  overflow-x: auto;
}

.ledger-table {
  min-width: 620px;
}

.ledger-table thead th {
  padding: 14px 18px;
  border-bottom: 1px solid #f0f2f5;
  color: #8a94a6;
  font-size: 12px;
  font-weight: 600;
  background: #fcfcfd;
}

.ledger-table tbody td {
  padding: 15px 18px;
  border-bottom: 0;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}

.ledger-table tbody code {
  padding: 0;
  border: 0;
  background: transparent;
  color: #4b5565;
  font-size: 13px;
}

.page-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid #f0f2f5;
  background: #ffffff;
}

.page-pagination span {
  color: var(--muted);
  font-size: 13px;
}

.status-text {
  font-size: 13px;
  font-weight: 600;
}

.status-success {
  color: #0f8a43;
}

.status-pending {
  color: #c28a12;
}

.status-refund {
  color: #d14343;
}

.key-panel {
  grid-column: 1 / -1;
}

.section-head h1,
.doc-section h2 {
  margin: 0 0 10px;
  line-height: 1.2;
}

.section-head h1 {
  font-size: 34px;
}

.lead {
  max-width: 760px;
  margin: 0 0 22px;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.key-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

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

input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--field-line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

select {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--field-line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.14);
  outline: none;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  max-width: 100%;
  min-height: 34px;
  padding: 4px 12px;
  border: 1px solid #111111;
  border-radius: 8px;
  background: #111111;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  user-select: none;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

button.compact-action {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

button:hover {
  border-color: #1f2937;
  background: #1f2937;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.14);
}

button:focus-visible {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
  outline: 2px solid rgba(10, 132, 255, 0.38);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12);
}

button.secondary:hover {
  border-color: #cfd6e2;
  background: #f9fafb;
  color: var(--text);
  box-shadow: none;
}

button.secondary:focus-visible {
  border-color: #9fb0c5;
  background: #ffffff;
  color: var(--text);
}

button:active {
  transform: translateY(1px);
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}

button:disabled {
  border-color: #d9dee7;
  background: #f3f5f8;
  color: #98a2b3;
  box-shadow: none;
}

input:disabled {
  border-color: #e3e7ee;
  background: #f8fafc;
  color: #98a2b3;
}

.avatar-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  border-color: #c8d7f2;
  border-radius: 999px;
  background: #7fa6df;
  box-shadow:
    0 8px 18px rgba(79, 119, 180, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.32) inset;
}

.avatar-button:hover {
  border-color: #b9cbed;
  background: #6f98d4;
}

.avatar-button span {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.avatar-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(17, 24, 39, 0.12);
}

.avatar-menu[hidden] {
  display: none;
}

.avatar-menu-header {
  display: grid;
  gap: 3px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #f0f2f5;
  transition: background 140ms ease;
}

.avatar-menu-header:hover {
  background: #f5f9ff;
}

.avatar-menu-name {
  max-width: 60%;
  overflow: hidden;
  font-size: clamp(12px, 0.9vw, 14px);
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-menu-id {
  max-width: 75%;
  color: var(--muted);
  overflow: hidden;
  font-size: clamp(11px, 0.76vw, 12px);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-menu-link,
.avatar-menu-action {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  box-shadow: none;
}

.avatar-menu-link:hover,
.avatar-menu-action:hover {
  background: #f5f9ff;
  color: var(--text);
}

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

.status-line {
  min-height: 32px;
  margin-top: 12px;
  color: var(--muted);
}

.status-line.ok {
  color: var(--green);
}

.status-line.error {
  color: var(--red);
}

.info-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.info-list div {
  min-height: 46px;
}

.info-list dt {
  color: var(--muted);
  font-size: 13px;
}

.info-list dd {
  margin: 2px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.compact-info-list {
  gap: 10px;
}

.compact-info-list div {
  min-height: 0;
}

.compact-info-list dd {
  font-size: 13px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #f3f4f6;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.94em;
  overflow-wrap: anywhere;
}

.copy-row code {
  display: block;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: var(--soft);
}

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

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

.section-head h2,
.section-head h1 {
  margin: 0;
  line-height: 1.2;
}

.section-head h2 {
  font-size: 24px;
}

.overview-panel {
  padding: 28px 30px 34px;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 250, 252, 0.78));
  box-shadow: none;
  max-width: none;
  margin: 0 auto;
  width: 100%;
}

.overview-head {
  width: min(var(--overview-inner-max), 100%);
  margin: 0 auto 22px;
  padding: 4px 10px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.overview-title-block {
  max-width: 760px;
}

.overview-head h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.18;
}

.overview-head .status-line {
  display: none;
}

.overview-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.overview-body {
  width: min(var(--overview-inner-max), 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
  justify-items: center;
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin: 0;
}

.overview-stat {
  display: grid;
  gap: 7px;
  min-height: 118px;
  align-content: space-between;
  position: relative;
  width: 100%;
  padding: 16px 17px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow:
    0 20px 48px rgba(15, 23, 42, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.88) inset;
}

.overview-stat small,
.overview-stat span {
  color: var(--muted);
}

.overview-stat small {
  font-size: 12px;
  font-weight: 600;
}

.overview-stat strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.12;
}

.overview-stat span {
  font-size: 12px;
  line-height: 1.45;
}

.overview-stat-time strong {
  font-size: 19px;
  line-height: 1.25;
}

.overview-stat-tooltip .overview-stat-popup {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 6;
  display: grid;
  gap: 4px;
  min-width: 164px;
  padding: 10px 12px;
  border: 1px solid #e7ebf2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 28px rgba(17, 24, 39, 0.08);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 0s linear 140ms;
}

.overview-stat-tooltip .overview-stat-popup span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.overview-stat-tooltip:hover .overview-stat-popup,
.overview-stat-tooltip:focus-within .overview-stat-popup {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition-delay: 220ms;
}

.overview-chart-section {
  width: 100%;
  padding: 18px 18px 16px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow:
    0 20px 48px rgba(15, 23, 42, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.88) inset;
}

.overview-chart-header {
  width: 100%;
  margin: 0 0 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.overview-chart-kicker {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.compact-select {
  min-width: 132px;
}

.overview-canvas-shell {
  width: 100%;
  margin: 0;
  padding: 4px 0 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.overview-canvas-shell canvas {
  display: block;
  width: 100%;
  height: 210px;
  background: transparent;
}

.overview-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin: 0;
}

.overview-mini {
  min-width: 0;
  width: 100%;
  padding: 15px 16px 13px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow:
    0 20px 48px rgba(15, 23, 42, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.88) inset;
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.mini-head strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.mini-chart-shell {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  min-height: 124px;
}

.mini-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 0 8px;
  color: #a7afbf;
  font-size: 11px;
}

.mini-bar-chart {
  height: 124px;
  padding-top: 6px;
  border-bottom: 1px solid #eceff4;
  align-items: end;
}

.token-mini-chart .trend-bar {
  background: #90caf9;
}

.token-mini-chart .trend-bar.is-zero {
  background: #e3ecfb;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 10px;
}

.key-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.key-metric-grid div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.key-metric-grid span {
  display: block;
  color: var(--cyan);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

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

.metric-grid div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.metric-grid span {
  display: block;
  color: var(--cyan);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

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

.chart-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.chart-box {
  min-height: 160px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.select-label {
  display: grid;
  gap: 6px;
  min-width: 160px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chart-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  margin-bottom: 12px;
}

.chart-title span {
  color: var(--muted);
  font-size: 13px;
}

.usage-canvas-wrap {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.usage-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.status-pill {
  display: inline-grid;
  min-width: 48px;
  min-height: 26px;
  place-items: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.status-pill.ok {
  background: rgba(22, 138, 90, 0.12);
  color: var(--green);
}

.status-pill.off {
  background: rgba(178, 58, 72, 0.12);
  color: var(--red);
}

.status-pill.warn {
  background: rgba(194, 120, 3, 0.12);
  color: #b76a00;
}

.split-bar {
  display: flex;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
}

.split-prompt,
.split-completion {
  width: 0;
  min-width: 0;
  transition: width 180ms ease;
}

.split-prompt {
  background: var(--green);
}

.split-completion {
  background: var(--cyan);
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(var(--bar-count, 10), minmax(0, 1fr));
  align-items: end;
  justify-items: center;
  gap: 6px;
  height: 104px;
  padding-top: 8px;
}

.trend-bar {
  width: 8px;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--green);
}

.trend-bar.is-zero {
  background: #d7deea;
}

.bar-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(70px, 0.85fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 26px;
}

.bar-row span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: #eef2f7;
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--green);
}

.content-grid {
  display: block;
  max-width: 760px;
  margin: 120px auto 0;
}

.side-nav {
  display: grid;
  gap: 4px;
  padding: 0;
}

.side-link {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.account-nav .side-link:hover {
  background: #f5f9ff;
}

.active-link {
  background: #edf5ff;
  color: var(--text);
  font-weight: 700;
}

.chat-entry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 8px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  box-shadow: none;
}

.chat-entry:hover {
  color: var(--text);
}

.chat-entry-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.chat-entry strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.chat-entry::after {
  content: "↗";
  color: var(--muted);
  font-size: 13px;
}

.docs {
  display: grid;
  gap: 16px;
}

.ticket-page {
  max-width: var(--content-wide-max);
}

.ticket-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 18px;
}

.ticket-sidebar,
.ticket-panel {
  min-height: clamp(420px, calc(100vh - 190px), 680px);
  min-height: clamp(420px, calc(100svh - 190px), 680px);
}

.ticket-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.ticket-sidebar-head,
.ticket-panel-head,
.ticket-composer-actions,
.request-log-toolbar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ticket-sidebar-head {
  align-items: flex-start;
}

.ticket-sidebar-head h2,
.ticket-panel-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.3;
}

.ticket-thread-list,
.ticket-message-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

.ticket-thread-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid #e9edf3;
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  box-shadow: none;
}

.ticket-thread-item:hover {
  border-color: #d7e5ff;
  background: #f8fbff;
}

.ticket-thread-item.is-active {
  border-color: #cfe0ff;
  background: #f5f9ff;
}

.ticket-thread-head-row,
.ticket-thread-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ticket-thread-subject {
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-thread-meta,
.ticket-thread-preview {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.ticket-thread-meta-row {
  color: var(--muted);
  font-size: 11px;
}

.ticket-thread-meta-row time {
  white-space: nowrap;
}

.ticket-thread-status-pill {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.ticket-thread-preview {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ticket-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
}

.ticket-message-list {
  padding: 6px 2px 6px 0;
}

.ticket-message {
  max-width: min(76%, 640px);
  padding: 12px 14px;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  background: #ffffff;
}

.ticket-message-self {
  justify-self: end;
  border-color: #d8e6ff;
  background: #f7fbff;
}

.ticket-message-peer {
  justify-self: start;
}

.ticket-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.ticket-message-head strong {
  color: var(--text);
  font-size: 13px;
}

.ticket-message-body {
  color: var(--text);
  font-size: 14px;
  line-height: 1.8;
  word-break: break-word;
}

.ticket-composer {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #eef1f5;
}

.ticket-composer-field {
  gap: 10px;
}

.ticket-composer textarea,
.modal-field textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
}

.ticket-composer-actions {
  align-items: flex-end;
}

.developer-ticket-layout .ticket-thread-list {
  display: grid;
  gap: 8px;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  max-height: clamp(280px, calc(100vh - 260px), 612px);
  max-height: clamp(280px, calc(100svh - 260px), 612px);
  overflow-y: auto;
}

.developer-ticket-layout .ticket-thread-item {
  gap: 6px;
  min-height: 0;
  padding: 12px 14px;
  align-self: start;
  justify-items: start;
  align-items: start;
  text-align: left;
  color: var(--text);
}

.developer-ticket-layout .ticket-thread-head-row,
.developer-ticket-layout .ticket-thread-meta-row {
  width: 100%;
}

.developer-ticket-layout .ticket-thread-head-row {
  justify-content: space-between;
  align-items: flex-start;
}

.developer-ticket-layout .ticket-thread-meta-row {
  justify-content: flex-start;
  gap: 10px;
}

.developer-ticket-layout .ticket-thread-status-pill {
  margin-left: auto;
  flex: none;
}

.developer-ticket-layout .ticket-thread-subject,
.developer-ticket-layout .ticket-thread-meta,
.developer-ticket-layout .ticket-thread-preview,
.developer-ticket-layout .ticket-thread-meta-row span,
.developer-ticket-layout .ticket-thread-meta-row time {
  text-align: left;
}

.developer-ticket-thread-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  align-items: stretch;
  justify-content: stretch;
  justify-items: stretch;
  width: 100%;
  min-height: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: none;
}

.developer-ticket-thread-item:hover {
  border-color: #d7e5ff;
  background: #f8fbff;
  color: var(--text);
}

.developer-ticket-thread-item.is-active {
  border-color: #cfe0ff;
  background: #f5f9ff;
}

.developer-ticket-thread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.developer-ticket-thread-subject {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.developer-ticket-thread-status {
  flex: none;
}

.developer-ticket-thread-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.developer-ticket-thread-owner,
.developer-ticket-thread-time {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  min-width: 0;
}

.developer-ticket-thread-preview {
  color: #8a94a6;
  font-size: 11px;
  line-height: 1.5;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.developer-ticket-layout .ticket-message-list {
  display: grid;
  align-content: start;
  align-items: start;
  gap: 12px;
  max-height: clamp(280px, calc(100vh - 330px), 520px);
  max-height: clamp(280px, calc(100svh - 330px), 520px);
}

.developer-ticket-layout .ticket-message {
  max-width: min(78%, 720px);
}

.ticket-empty-state {
  padding: 18px 14px;
  border: 1px dashed #e6ebf3;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  background: #fcfdff;
}

.doc-section {
  padding: 24px;
  scroll-margin-top: 92px;
}

.doc-section p {
  margin: 0 0 14px;
  color: var(--muted);
}

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

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.step strong {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-strong);
  color: #fff;
}

pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  border-radius: 8px;
  background: var(--code);
  color: var(--code-text);
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.endpoint-list {
  display: grid;
  gap: 10px;
}

.endpoint-list article {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.endpoint-list p {
  grid-column: 2;
  margin: 0;
}

.method {
  display: inline-grid;
  min-width: 58px;
  min-height: 28px;
  place-items: center;
  border-radius: 5px;
  background: rgba(27, 125, 135, 0.12);
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
}

.method.post {
  background: rgba(22, 138, 90, 0.13);
  color: var(--green);
}

.table-wrap {
  overflow-x: auto;
}

.order-table {
  min-width: 1040px;
}

.order-table th:nth-child(-n + 6),
.order-table td:nth-child(-n + 6) {
  white-space: nowrap;
}

.order-table th:last-child,
.order-table td:last-child {
  min-width: 240px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  .topbar {
    padding: 12px 16px;
  }

  .top-actions {
    gap: 12px;
  }

  .developer-layout,
  .console-grid,
  .content-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .side-rail {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    gap: 12px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .chat-entry {
    width: 100%;
    min-width: 0;
    margin-top: 0;
  }

  .developer-main {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 24px 18px 56px;
  }

  .stack-page,
  .page-stack {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .api-key-page {
    max-width: 100%;
  }

  .api-key-header h1 {
    font-size: 30px;
  }

  .ledger-page {
    max-width: 100%;
  }

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

  .ticket-sidebar,
  .ticket-panel {
    min-height: auto;
  }

  .ticket-thread-list {
    max-height: 320px;
  }

  .ticket-message {
    max-width: 100%;
  }

  .ledger-header h1 {
    font-size: 30px;
  }

  .overview-head,
  .overview-chart-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .overview-stats,
  .overview-mini-grid,
  .summary-grid,
  .plan-offer-grid {
    grid-template-columns: 1fr;
  }

  .docs-hero,
  .docs-page-main {
    grid-template-columns: 1fr;
  }

  .docs-internal-nav {
    position: static;
  }

  .docs-internal-card nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .subscription-current-strip {
    align-items: flex-start;
  }

  .key-row,
  .copy-row,
  .steps,
  .metric-grid,
  .key-metric-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .section-head h1 {
    font-size: 28px;
  }

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

  .endpoint-list p {
    grid-column: 1;
  }
}

/* Polish pass */
body {
  background: linear-gradient(180deg, #f8fafc 0%, #f4f6f9 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.topbar {
  min-height: 72px;
  padding: 14px 32px;
  border-bottom-color: rgba(220, 227, 238, 0.92);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.brand-image {
  width: 38px;
  height: 38px;
  border-color: #dbe2ec;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.top-link,
.side-link {
  transition:
    color 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.top-link {
  border-radius: 8px;
  padding: 8px 10px;
}

.top-link:hover {
  background: rgba(17, 24, 39, 0.04);
}

.top-link.active-link,
.side-link.active-link {
  color: #0f172a;
}

.side-rail {
  border-right-color: rgba(220, 227, 238, 0.92);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(20px);
}

.side-link:hover {
  background: rgba(17, 24, 39, 0.04);
}

.side-link.active-link {
  background: rgba(17, 24, 39, 0.05);
}

.panel,
.doc-section,
.page-card,
.overview-stat,
.overview-mini,
.api-key-card,
.api-key-secret-card,
.modal-shell,
.docs-hero-copy,
.docs-hero-side,
.docs-internal-card,
.subscription-current-strip,
.plan-offer-card,
.ticket-thread-item,
.developer-ticket-thread-item,
.ticket-composer,
.ticket-conversation-card {
  border-color: #e6ebf2;
  box-shadow:
    0 20px 48px rgba(15, 23, 42, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.88) inset;
}

.overview-stat,
.overview-mini,
.page-card,
.plan-offer-card,
.ticket-thread-item,
.developer-ticket-thread-item {
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.overview-stat:hover,
.overview-mini:hover,
.page-card:hover,
.plan-offer-card:hover,
.ticket-thread-item:hover,
.developer-ticket-thread-item:hover {
  transform: translateY(-1px);
  box-shadow:
    0 24px 56px rgba(15, 23, 42, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

input,
select,
textarea {
  border-color: #dbe2ec;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

input::placeholder,
textarea::placeholder {
  color: #9aa4b2;
}

button,
.dark-action,
.danger-action {
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.plan-offer-card .plan-offer-action,
.plan-offer-card .plan-offer-action:hover,
.plan-offer-card .plan-offer-action:active,
.plan-offer-card .plan-offer-action:focus-visible {
  box-shadow: none;
}

#subscriptionActionStandard,
#subscriptionActionProfessional,
.plan-offer-card .plan-offer-action {
  align-self: end;
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 32px;
  padding: 0 14px;
  margin-top: auto;
  box-sizing: border-box;
}

button.secondary {
  border-color: #dde3ec;
  background: rgba(255, 255, 255, 0.94);
}

button.secondary:hover {
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.chat-entry {
  border-color: #e1e7ef;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.chat-entry:hover {
  border-color: #d4dce7;
}

.doc-section pre,
.docs-page-shell .table-wrap table,
.table-wrap,
.ticket-thread-list,
.ticket-conversation-list,
.ticket-composer textarea,
.api-key-secret-row code {
  border-color: #e7ecf3;
}

.doc-section pre,
.docs-page-shell .table-wrap thead th,
.api-key-secret-row code {
  background: #fcfdff;
}

@media (min-width: 2200px) {
  :root {
    --content-narrow-max: 1120px;
    --content-wide-max: 1320px;
    --console-grid-max: 1240px;
    --overview-grid-max: 1360px;
    --overview-inner-max: 1240px;
    --docs-page-max: 1460px;
    --docs-nav-width: 260px;
    --docs-reading-width: 860px;
  }

  .developer-main {
    padding-top: 48px;
  }

  .overview-canvas-shell canvas {
    height: 246px;
  }

  .overview-stats,
  .overview-mini-grid {
    gap: 16px;
  }
}

@media (min-width: 3000px) {
  :root {
    --content-narrow-max: 1480px;
    --content-wide-max: 1760px;
    --console-grid-max: 1760px;
    --overview-grid-max: 1880px;
    --overview-inner-max: 1760px;
    --docs-page-max: 1880px;
    --docs-nav-width: 300px;
    --docs-reading-width: 1080px;
  }

  .developer-main {
    padding-top: 56px;
  }

  .overview-panel {
    padding-top: 34px;
    padding-bottom: 42px;
  }

  .overview-canvas-shell canvas {
    height: 300px;
  }

  .profile-page {
    max-width: 1040px;
  }

  .profile-info-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 22px;
  }

  .profile-info-list div {
    border-bottom: 0;
  }

  .security-item-form {
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
    gap: 22px;
    align-items: start;
  }

  .security-item-form .password-form {
    margin-top: 0;
  }
}

/* Formal docs refresh: placed after polish rules to avoid accidental overrides. */
.docs-page-shell {
  width: min(calc(100% - 80px), var(--docs-page-max));
  margin: 0 auto;
  padding: 30px 0 76px;
  gap: 22px;
}

.docs-page-shell .docs-hero {
  grid-template-columns: var(--docs-nav-width) minmax(0, var(--docs-reading-width));
  gap: 28px;
  align-items: end;
  justify-content: start;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 22px;
}

.docs-page-shell .docs-hero::before {
  content: none;
}

.docs-page-shell .docs-hero-copy,
.docs-page-shell .docs-hero-side {
  grid-column: 2;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.docs-page-shell .docs-hero-copy {
  padding: 0;
}

.docs-page-shell .docs-hero-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  align-items: start;
  gap: 16px;
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.docs-page-shell .docs-hero-copy h1 {
  margin: 0 0 12px;
  color: #0f172a;
  font-size: 36px;
  line-height: 1.12;
  letter-spacing: 0;
}

.docs-page-shell .docs-hero-copy .overview-note {
  max-width: 840px;
  color: #435064;
  font-size: 14px;
  line-height: 1.85;
}

.docs-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.docs-hero-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #dfe6f0;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.docs-page-shell .docs-hero-side .eyebrow {
  margin-bottom: 6px;
}

.docs-page-shell .docs-hero-side h2 {
  grid-column: 1 / -1;
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.25;
}

.docs-page-shell .docs-hero-side .copy-row {
  grid-column: 1;
}

.docs-page-shell .docs-hero-side > .muted {
  grid-column: 1;
  margin: 2px 0 0;
}

.docs-page-shell .copy-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.docs-page-shell .copy-row code {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  padding: 0 12px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-page-shell .docs-copy-action {
  min-width: 58px;
  min-height: 40px;
  box-shadow: none;
}

.docs-hero-facts {
  grid-column: 2;
  grid-row: 2 / span 2;
  display: grid;
  gap: 8px;
  margin: 0;
}

.docs-hero-facts div {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  min-height: 30px;
  align-items: center;
}

.docs-hero-facts dt {
  color: #8a94a6;
  font-size: 12px;
  font-weight: 700;
}

.docs-hero-facts dd {
  margin: 0;
  color: #1f2937;
  font-size: 13px;
  font-weight: 700;
}

.docs-page-shell .docs-page-main {
  grid-template-columns: var(--docs-nav-width) minmax(0, var(--docs-reading-width));
  justify-content: start;
  gap: 28px;
}

.docs-page-shell .docs-internal-card {
  padding: 6px 0 6px 12px;
  border: 0;
  border-left: 1px solid #dbe3ee;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.docs-page-shell .docs-internal-card strong {
  color: #0f172a;
  font-size: 13px;
  letter-spacing: 0;
}

.docs-page-shell .docs-internal-card nav {
  gap: 3px;
}

.docs-page-shell .docs-internal-card nav a {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  color: #64748b;
  font-size: 13px;
}

.docs-page-shell .docs-internal-card nav a:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.docs-page-shell .docs {
  counter-reset: docs-section;
  gap: 0;
  padding: 4px 34px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.045),
    0 1px 0 rgba(255, 255, 255, 0.92) inset;
}

.docs-page-shell .doc-section {
  position: relative;
  min-width: 0;
  padding: 30px 0;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.docs-page-shell .doc-section:last-child {
  border-bottom: 0;
}

.docs-page-shell .doc-section::before {
  content: none;
}

.docs-page-shell .doc-section h2 {
  margin-bottom: 12px;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.docs-page-shell .doc-section h3 {
  color: #182235;
}

.docs-page-shell .doc-section p,
.docs-page-shell .doc-section li {
  color: #4b5565;
  font-size: 14px;
  line-height: 1.9;
}

.docs-page-shell .doc-section pre {
  margin-top: 16px;
  border-color: #e3e9f2;
  background: #f8fafc;
}

.docs-page-shell .doc-section pre code {
  color: #111827;
}

.docs-page-shell .doc-section code {
  background: #eef2f7;
  color: #111827;
}

.docs-page-shell .steps {
  margin: 16px 0 2px;
}

.docs-page-shell .table-wrap {
  border-color: #e3e9f2;
}

.docs-page-shell .table-wrap thead th {
  background: #f8fafc;
  color: #64748b;
}

.docs-page-shell .table-wrap tbody td {
  color: #334155;
}

/* Subscription contact modal: scoped to avoid global button/card overrides. */
.subscription-contact-modal .subscription-contact-shell {
  width: min(100%, 392px);
  border-color: #e1e7ef;
  box-shadow:
    0 28px 68px rgba(15, 23, 42, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.92) inset;
}

.subscription-contact-modal .subscription-contact-head {
  padding: 20px 20px 0;
}

.subscription-contact-modal .subscription-contact-close {
  flex: none;
  box-shadow: none;
}

.subscription-contact-body {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px 20px 20px;
}

.subscription-contact-qr-card {
  display: grid;
  place-items: center;
  width: 188px;
  height: 188px;
  padding: 10px;
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.subscription-contact-qr-card img {
  display: block;
  width: 168px;
  height: 168px;
}

.subscription-contact-note {
  max-width: 286px;
  margin: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
}

.subscription-contact-agreement {
  max-width: 300px;
  margin: 2px 0 0;
  color: #8a94a6;
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

.subscription-contact-agreement a {
  color: #111827;
  text-decoration: none;
}

.subscription-contact-agreement a:hover {
  text-decoration: underline;
}

@media (max-width: 860px) {
  .docs-page-shell .docs-hero,
  .docs-page-shell .docs-page-main {
    grid-template-columns: 1fr;
  }

  .docs-page-shell .docs-hero-copy,
  .docs-page-shell .docs-hero-side {
    grid-column: 1;
  }

  .docs-page-shell .docs-hero-side {
    grid-template-columns: 1fr;
    border-top: 1px solid #e6ebf2;
    border-left: 0;
  }

  .docs-hero-facts,
  .docs-page-shell .docs-hero-side .copy-row,
  .docs-page-shell .docs-hero-side > .muted {
    grid-column: 1;
    grid-row: auto;
  }

  .docs-page-shell .doc-section {
    padding: 24px 0;
  }
}

@media (max-width: 560px) {
  .docs-page-shell {
    width: min(calc(100% - 32px), 1080px);
  }

  .docs-page-shell .docs-hero-copy,
  .docs-page-shell .docs-hero-side {
    padding: 24px 20px;
  }

  .docs-page-shell .docs-hero-copy h1 {
    font-size: 32px;
  }

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

  .docs-page-shell .docs-internal-card nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .remote-api-metrics {
    grid-template-columns: 1fr;
  }

  .wallet-card-head,
  .wallet-balance-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .subscription-contact-modal {
    padding: 18px;
  }
}

/* 2026-05-15 topbar consistency. Keep after page-specific polish rules. */
.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 14px;
  min-width: 0;
}

.top-link {
  white-space: nowrap;
}

.brand {
  min-width: 0;
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    gap: 12px;
    padding-inline: 16px;
  }

  .top-actions {
    gap: 8px 10px;
  }

  .top-link {
    font-size: 13px;
  }
}

/* 2026-05-16 real logo asset. Keep this last so earlier polish rules cannot re-add placeholder framing. */
.brand {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  border-radius: 8px;
}

.brand-image {
  width: 38px;
  height: 38px;
  display: block;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  image-rendering: auto;
}
