/* BASIS: forest-green navigation, mist-white workspace and lime current-location marks.
   Loaded only by the opt-in /pat-next/ shell. */
:root {
  --ink: #193c33;
  --muted: #586f65;
  --line: #d6e0da;
  --paper: #f6f8f7;
  --next-surface-soft: #eef2f0;
  --teal: #246653;
  --lime: #c4ef45;
  --navy: #173f35;
  --radius: 6px;
  --next-soft: #edf5f2;
  --next-focus: #246653;
  --next-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
html { color-scheme: light; scroll-padding-top: 24px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #dce9e1; color: var(--navy); }
h1, h2, h3 { line-height: 1.4; text-wrap: balance; letter-spacing: -.025em; }
h1 { font-size: 1.875rem; font-weight: 650; margin: 8px 0; }
p { color: var(--muted); }
button, a, select, summary { touch-action: manipulation; }
button, a, input, select, textarea, summary { scroll-margin: 24px; }
button, a, select { transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible {
  outline: 2px solid var(--next-focus); outline-offset: 3px;
}
button:disabled { cursor: not-allowed; opacity: .6; }
button[aria-busy="true"] { cursor: progress; }
input, select, textarea {
  min-height: 44px; border: 1px solid #b9cbcd; border-radius: 4px;
  background-color: var(--paper); color: var(--ink); font-size: .875rem; line-height: 1.5;
  padding: 10px 12px; box-shadow: none;
}
input::placeholder, textarea::placeholder { color: #657e83; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #7faaa6; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--teal); }
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23596f76' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 16px; background-position: right 12px center; background-repeat: no-repeat;
}
select::-ms-expand { display: none; }
button.primary, a.primary, .secondary {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 4px;
  font-size: .875rem; font-weight: 550; line-height: 1.5; box-shadow: none;
}
button.primary, a.primary { background: var(--teal); color: #fff; border: 1px solid var(--teal); }
button.primary:hover, a.primary:hover { background: #076b62; border-color: #076b62; }
.secondary { background: var(--paper); border-color: #bacdcd; }
.secondary:hover { background: var(--next-soft); border-color: #86b3aa; }
.text-button { min-height: 36px; display: inline-flex; align-items: center; padding: 6px 8px; border-radius: 4px; font-size: .875rem; font-weight: 500; }
.text-button:hover { color: #065b53; background: #e9f3ef; }
.icon-button { display: grid; place-items: center; min-width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 4px; font-size: 26px; line-height: 1; }
.icon-button:hover { color: var(--ink); background: var(--paper); }
.app { grid-template-columns: 232px minmax(0, 1fr); }
#sidebar { padding: 30px 16px 20px; background: var(--navy); border-right: 1px solid #2e5549; overflow-y: auto; }
.brand { padding: 0 14px 30px; margin-bottom: 26px; border-bottom: 1px solid #49685b; }
.brand img { display: block; }
#sidebar .basis-sidebar img { padding: 0; background: transparent; border-radius: 0; }
.brand small { font-size: .8125rem; color: #c0d1d3; letter-spacing: .06em; margin-top: 14px; }
#sidebar .basis-sidebar > span { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
#sidebar .basis-sidebar strong { font-size: 1.375rem; letter-spacing: .045em; }
#sidebar .basis-sidebar small { margin: 0; font-size: .75rem; letter-spacing: 0; font-weight: 400; }
.nav-label { font-size: .75rem; color: #a7c0c4; padding: 0 14px 14px; letter-spacing: .1em; }
#sidebar nav { gap: 6px; }
.nav-item { min-height: 48px; padding: 12px 15px; border-radius: 3px; gap: 12px; font-size: .875rem; color: #bed0d3; }
.nav-item:hover { background: #244f42; color: #fff; }
.nav-item.active { background: #2b5548; color: #f6f8f7; box-shadow: inset 3px 0 var(--lime); font-weight: 600; }
.nav-item.active svg { color: var(--lime); }
.nav-item:focus-visible, #sidebar a:focus-visible { outline-color: #dce9e1; }
.sidebar-bottom { margin-top: auto; padding: 20px 14px 0; border: 0; border-top: 1px solid #49685b; border-radius: 0; background: transparent; gap: 8px; }
#sidebar nav { margin-bottom: 32px; }
.sidebar-bottom .smallcaps { color: #a7c0c4; font-size: .75rem; }
.sidebar-bottom .muted { color: #b2c9cb; font-size: .8125rem; }
.sidebar-foot { font-size: .75rem; padding-top: 16px; border-color: #49685b; }
.sidebar-foot span { color: #b8cdd0; }
header { min-height: 80px; height: auto; padding: 18px 36px; background: #fff; gap: 16px; }
.breadcrumb { gap: 12px; font-size: .875rem; white-space: nowrap; }
.breadcrumb b { font-weight: 550; }
.header-right { gap: 8px; font-size: .8125rem; justify-content: flex-end; }
.header-right .text-button { font-size: .8125rem; }
.demo { font-size: .75rem; margin: 0; background: #edf3e4; color: #49642a; padding: 4px 8px; border: 1px solid #dbe7c6; border-radius: 3px; }
.avatar { font-family: var(--next-mono); border-radius: 4px; width: 30px; height: 30px; background: var(--next-soft); }
#currentUser { color: var(--muted); }
.next-version { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 10px 4px 4px; margin-right: 8px; border: 1px solid var(--line); border-radius: 4px; font-size: .75rem; color: var(--muted); }
.next-version span { padding: 3px 7px; background: var(--navy); color: #f6f8f7; border-radius: 2px; }
.next-version:hover { border-color: #93b9ad; color: var(--teal); }
.content { max-width: 1680px; padding: 32px 36px 24px; }
.page-heading { margin-bottom: 26px; gap: 24px; align-items: center; }
.eyebrow { font-family: var(--next-mono); font-size: .75rem; font-weight: 500; letter-spacing: .085em; }
.page-heading p { font-size: .875rem; max-width: 65ch; line-height: 1.8; }
#refresh { flex-shrink: 0; }
#refresh::before { content: ""; width: 16px; height: 16px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 11a8 8 0 1 0-2 6M20 4v7h-7' stroke='black' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
#refresh[aria-busy="true"]::before { animation: next-spin 1.2s linear infinite; }
@keyframes next-spin { to { transform: rotate(360deg); } }
.filters { padding: 16px 0; margin-bottom: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); gap: 14px; font-size: .875rem; flex-wrap: wrap; }
.filters > div { gap: 12px; flex-wrap: wrap; }
.filters > span { font-size: .8125rem; line-height: 1.6; }
.filters label { margin-right: 4px; }
.billing-info { border-radius: 4px; padding: 14px 16px; background: var(--next-soft); border-color: #c8ded5; color: #3d645a; font-size: .875rem; line-height: 1.8; margin-bottom: 24px; }
/* Keep the original overview banner and product chips. */
.hero { border-radius: 16px; font-size: 14px; line-height: normal; font-family: Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif; }
.hero h2 { font-weight: 700; letter-spacing: normal; line-height: normal; }
.hero .eyebrow { font-family: inherit; font-size: 11px; font-weight: 700; letter-spacing: 1.8px; }
.api-products { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; }
.card { background: var(--paper); border-color: var(--line); border-radius: var(--radius); box-shadow: none; }
.kpis { gap: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; margin-bottom: 24px; overflow: hidden; }
.kpis > .kpi { border: 0; border-radius: 0; background: transparent; padding: 22px 24px; }
.kpis > .kpi + .kpi { border-left: 1px solid var(--line); }
.kpi-head { font-size: .875rem; color: #4a656e; gap: 10px; }
.kpi-head .icon { color: var(--teal); width: 18px; height: 18px; }
.kpi-value { font-size: 1.875rem; line-height: 1.25; margin: 16px 0 10px; letter-spacing: -.05em; font-weight: 500; }
.kpi-foot { font-size: .8125rem; line-height: 1.6; }
.kpi-value, .coverage-totals strong, .product-info strong,
.market-count, .metric-grid strong, .trend-total strong { font-family: var(--next-mono); font-variant-numeric: tabular-nums; }
.dashboard-grid { gap: 24px; margin-bottom: 24px; }
.dashboard-grid > .card { min-width: 0; }
.panel { padding: 24px; }
.panel-head { margin-bottom: 22px; gap: 16px; }
.panel-head h2, .table-title h2 { font-size: 1rem; font-weight: 600; }
.panel-head p, .legend, .activity small { font-size: .8125rem; line-height: 1.7; }
.legend { gap: 14px; }
.legend span::before { border-radius: 1px; }
.chart { margin-top: 8px; }
.next-chart-scroll { min-width: 0; }
.chart text, .trend-plot text { fill: #526e77; font-family: var(--next-mono); }
.activity { padding: 16px 0; border-color: var(--line); }
.activity strong { font-size: .875rem; font-weight: 550; }
.activity-icon { background: var(--next-soft); border: 1px solid #cde2da; border-radius: 4px; }
.activity time { font-size: .75rem; color: var(--muted); }
.table-title { padding: 20px 24px 16px; min-height: 64px; }
.table-scroll { overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #a3bdbb #f0f5f4; }
.table-scroll[data-next-overflow="true"]::before { content: "左右滚动可查看完整表格"; display: block; position: sticky; left: 0; width: fit-content; padding: 10px 20px; color: var(--muted); font-size: .75rem; }
.next-account-table { table-layout: auto; min-width: 1280px; white-space: normal; }
.next-account-table th, .next-account-table td { padding-left: 12px; padding-right: 12px; overflow-wrap: anywhere; vertical-align: top; }
.next-account-table th:first-child { min-width: 220px; }
.next-account-table td:nth-child(2) { min-width: 420px; white-space: nowrap; overflow-wrap: normal; }
.next-account-table .customer { align-items: flex-start; gap: 8px; }
.next-account-table .logo { flex-shrink: 0; }
.next-account-table td:nth-child(2) > strong { display: block; font-weight: 550; }
.next-account-table td:nth-child(2) > .sub { margin: 4px 0 10px; }
.next-quota-list { line-height: 1.5; }
.next-quota-item { padding: 4px 0; }
.next-quota-item + .next-quota-item { border-top: 1px solid var(--line); }
.next-quota-item > strong { display: block; font-size: .875rem; font-weight: 550; }
.next-quota-item > .sub { margin: 2px 0 0; font-size: .75rem; line-height: 1.5; }
.next-account-table td:last-child .text-button { display: flex; width: fit-content; }
.next-account-table .api-products { margin-top: 10px; }
table { font-size: .875rem; line-height: 1.6; }
th { padding: 13px 20px; background: var(--next-surface-soft); font-size: .8125rem; font-weight: 550; color: #4a656d; }
td { padding: 15px 20px; font-size: .875rem; border-color: #e3ebea; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--next-surface-soft); }
td .text-button { margin: -4px 0; white-space: nowrap; }
.customer { gap: 12px; }
.customer strong { font-weight: 550; }
.customer small, .sub { color: var(--muted); font-size: .8125rem; line-height: 1.6; margin-top: 4px; }
.logo, .product-symbol { border-radius: 4px; background: #e8f2ee; }
.badge { padding: 4px 8px; border: 1px solid #c7dfd0; border-radius: 3px; color: #226349; background: #edf6ef; font-size: .75rem; line-height: 1.6; }
.badge.test { color: #415b83; border-color: #d5deed; background: #f0f3f9; }
.badge.warning { color: #855c17; border-color: #ebd7ab; background: #fff6e5; }
.badge.paused { color: #55676c; border-color: #dce3e3; background: #f0f3f3; }
.quota > div { font-size: .75rem; }
.toolbar { gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar p { font-size: .875rem; }
.toolbar input { width: 300px; }
.notice { font-size: .8125rem; line-height: 1.85; color: var(--muted); }
.empty { font-size: .875rem; padding: 44px 24px; line-height: 1.8; }
.metric-grid > div, .detail-grid > div { background: var(--next-surface-soft); border-radius: 4px; padding: 18px; }
.metric-grid small, .detail-grid small { font-size: .8125rem; }
.detail-grid strong { font-size: 1rem; }
.log-filters, .product-filters { gap: 16px; }
.product-filters { border-radius: 4px; }
.product-filters label, .log-filters label { font-size: .875rem; gap: 8px; }
.product-description dl, .log-detail { font-size: .875rem; gap: 14px 18px; }
.request-id { font-size: .8125rem; }
.pagination { font-size: .8125rem; padding: 16px 24px; flex-wrap: wrap; }
.pagination .secondary { min-height: 40px; }
.coverage-overview { margin-bottom: 30px; box-shadow: none; border-radius: 4px; border-color: var(--line); }
.coverage-map { background: var(--paper); }
.map-country:not(.covered) { fill: #e5e3d7; }
.map-marker rect { fill: var(--paper); }
.coverage-heading { padding: 24px 28px; border-color: var(--line); }
.coverage-heading h2 { font-size: 1.375rem; letter-spacing: -.025em; }
.coverage-heading p { font-size: .8125rem; color: var(--muted); }
.coverage-heading .eyebrow, .catalog-heading .eyebrow { font-family: var(--next-mono); font-size: .75rem; letter-spacing: .075em; }
.coverage-totals { gap: 28px; }
.coverage-totals strong { font-size: 1.875rem; font-weight: 500; }
.coverage-totals span { font-size: .8125rem; color: var(--muted); }
.coverage-markets { border-color: var(--line); gap: 6px; padding: 20px 16px; }
.coverage-list-heading, .coverage-note { font-size: .75rem; color: var(--muted); }
.coverage-market { padding: 10px 8px; min-height: 64px; border-radius: 4px; }
.coverage-market.active { background: var(--next-soft); border-color: #bbd7ca; }
.market-flag { border-radius: 4px; font-size: .75rem; color: #416e5c; }
.market-name strong { font-size: .875rem; }
.market-name small { font-size: .75rem; color: var(--muted); }
.market-count { font-size: 1rem; color: #235c4d; }
.market-arrow, .product-open { display: none; }
.map-footer { font-size: .75rem; color: var(--muted); flex-wrap: wrap; line-height: 1.8; }
.catalog-heading { margin-bottom: 20px; }
.catalog-heading h2 { font-size: 1.375rem; }
.catalog-search { width: 300px; }
.catalog-search input { background: var(--paper); font-size: .875rem; padding: 11px 12px 11px 38px; border-color: #b9cbcd; border-radius: 4px; }
.catalog-search input::placeholder { color: #657e83; }
.country-tabs { gap: 4px; border-color: var(--line); }
.country-tab { min-height: 48px; padding: 12px 14px; font-size: .875rem; border-radius: 3px 3px 0 0; color: #536f63; }
.country-tab.active { color: #076e5b; border-color: var(--teal); }
.country-tab > span:last-child { font-family: var(--next-mono); font-size: .75rem; border-radius: 3px; color: #4d6b5c; }
.country-tab .tab-flag { font-size: .75rem; color: #536f63; }
.catalog-caption { font-size: .8125rem; line-height: 1.8; padding: 16px 0; color: var(--muted); }
.catalog-caption > span:first-child { color: #4d695d; }
.marketplace-grid { gap: 18px; }
.marketplace-product { padding: 24px; border-radius: 4px; box-shadow: none; text-align: left; }
.marketplace-product:hover { transform: none; border-color: #75a58e; box-shadow: none; background: var(--next-surface-soft); }
.marketplace-product.selected { border-color: var(--teal); box-shadow: inset 0 2px var(--teal); }
.marketplace-product .product-symbol { width: 38px; height: 38px; font-family: var(--next-mono); font-size: .875rem; border-radius: 4px; color: #28674d; }
.marketplace-status { font-size: .75rem; color: #466b56; }
.marketplace-status.pending { color: #866224; }
.product-country { font-size: .8125rem; color: #4c6b59; }
.product-country > span { color: #627a6c; }
.marketplace-product h3 { font-size: 1rem; font-weight: 600; line-height: 1.65; letter-spacing: -.015em; }
.product-english { font-size: .8125rem; color: #5c7467; line-height: 1.7; }
.marketplace-product > p { flex: 1 0 auto; font-size: .875rem; color: #586e63; line-height: 1.85; margin: 0 0 16px; }
.marketplace-product .product-info { margin-top: 0; border-color: var(--line); padding-top: 18px; gap: 16px; }
.marketplace-product .product-info small { font-size: .75rem; color: #5b7465; }
.marketplace-product .product-info strong { font-size: 1.125rem; }
.product-detail-heading { margin-top: 32px; border-color: var(--line); }
.product-detail-heading h2 { font-size: 1.125rem; }
.product-detail-heading > span { font-size: .8125rem; color: var(--muted); }
.provider-summary { font-size: .8125rem; border-radius: 3px; border-left: 2px solid #97c8b5; background: #f0f6f2; color: #346853; }
.marketplace-product .provider-summary { display: block; width: 100%; min-height: 44px; margin: auto 0 16px; padding: 10px 12px; line-height: 1.65; box-sizing: border-box; }
.api-doc-layout { gap: 24px; }
.api-doc-list { background: var(--paper); border-radius: 4px; border-color: var(--line); }
.api-doc-list label { font-size: .875rem; }
.api-doc-pick { padding: 12px 10px; border-radius: 4px; }
.api-doc-pick strong { font-size: .875rem; line-height: 1.7; }
.api-doc-pick small { font-size: .75rem; color: var(--muted); }
.api-doc-pick.selected { background: var(--next-soft); border-color: #b3d4c4; }
.api-doc-products h3 { font-size: .8125rem; }
.api-doc-summary strong { font-size: 1.25rem; }
.api-doc-summary span { font-size: .8125rem; line-height: 1.8; }
.api-doc-header h2 { font-size: 1.375rem; }
.api-doc-section > h2 { font-size: 1.125rem; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.api-docs p, .api-docs li { font-size: .875rem; }
.api-docs code, .api-endpoint code, .endpoint { font-size: .8125rem; font-family: var(--next-mono); line-height: 1.8; }
.api-docs pre { border-radius: 4px; background: var(--navy); padding: 20px; }
.api-docs td, .api-docs th { font-size: .8125rem; padding: 13px 14px; }
.api-code-head h3 { font-size: .875rem; }
.api-docs summary, .api-doc-links { font-size: .875rem; }
.api-endpoint { border: 1px solid #d5e4db; border-radius: 4px; padding: 14px 16px; background: #f0f6f3; }
.api-endpoint > span { font-family: var(--next-mono); font-size: .8125rem; }
.api-doc-download { border-radius: 4px; gap: 24px; }
.api-doc-download p { font-size: .875rem; }
.api-doc-download-url { font-size: .8125rem; }
.api-doc-download-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.api-doc-download-actions > a { white-space: nowrap; text-align: center; }
.service-balance-module h3 { font-size: 1.125rem; }
.service-balance-grid { gap: 20px; }
.service-balance-grid .kpi { padding: 24px; border-top: 2px solid #a3c9b8; }
.service-balance-grid .kpi-value { font-size: 1.75rem; line-height: 1.4; }
.account-trend-row > td { padding: 4px 24px 24px; background: var(--paper); }
.trend-header h2 { font-size: 1rem; }
.trend-header p, .trend-total small, .trend-footer, .trend-detail-head span { font-size: .8125rem; }
.trend-detail-head h3 { font-size: .875rem; }
.trend-day-logs th, .trend-day-logs td { font-size: .8125rem; padding: 12px; }
dialog { background: var(--paper); padding: 28px; border: 1px solid #c7d7d4; border-top: 3px solid var(--teal); border-radius: 6px; max-height: calc(100dvh - 48px); box-shadow: 0 16px 72px #102f3933; }
dialog::backdrop { background: #102f3973; backdrop-filter: blur(2px); }
.dialog-head { align-items: flex-start; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 1.375rem; line-height: 1.6; }
.form-grid label { font-size: .875rem; gap: 8px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; }
.dialog-actions { gap: 12px; }
.check-row { border-radius: 4px; font-size: .875rem; }
.check-row small { font-size: .8125rem; }
.error { font-size: .875rem; color: #a2312d; line-height: 1.8; }
#toast { max-width: calc(100% - 32px); padding: 14px 20px; border-radius: 4px; font-size: .875rem; background: var(--navy); box-shadow: 0 8px 30px #102f3924; }
footer { font-size: .75rem; color: #596f76; line-height: 1.8; padding-top: 20px; margin-top: 24px; }
.login-screen { min-height: 100dvh; padding: 32px 24px; background: var(--paper); }
.login-card { background: var(--paper); width: 460px; padding: 36px 40px; border-radius: 4px; border: 1px solid #ccdcd7; border-top: 3px solid var(--teal); box-shadow: 0 12px 40px #102f3908; }
.next-login-eyebrow { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 26px; color: var(--muted); font-family: var(--next-mono); font-size: .75rem; letter-spacing: .08em; }
.next-login-eyebrow span { font-family: inherit; letter-spacing: 0; color: #426932; background: #eef5df; padding: 2px 8px; border-radius: 2px; }
.login-card > img { display: block; width: 257px; max-width: 100%; height: auto; margin-bottom: 26px; }
.login-card h1 { font-size: 1.5rem; margin: 10px 0; }
.login-card p { font-size: .875rem; }
.login-card form { gap: 20px; margin: 26px 0 20px; }
.login-card label { font-size: .875rem; gap: 8px; }
.login-card input { min-height: 48px; }
.login-card button.primary { min-height: 48px; margin-top: 4px; }
.login-card > small { font-size: .75rem; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--line); }
.next-legacy-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--teal); font-size: .8125rem; margin-top: 4px; text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 1600px) { .content { padding-top: 38px; } }
@media (max-width: 1200px) {
  .app { grid-template-columns: 210px minmax(0, 1fr); }
  header { padding: 16px 24px; flex-wrap: wrap; }
  .header-right { flex-wrap: wrap; }
  .content { padding: 28px 24px; }
  .kpis > .kpi { padding: 20px 18px; }
  .kpi-value { font-size: 1.625rem; }
  .coverage-heading { padding: 22px 24px; }
  .coverage-body { grid-template-columns: minmax(0, 1fr) 230px; }
}
@media (max-width: 1000px) {
  .coverage-body { grid-template-columns: 1fr; }
  .coverage-markets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-left: 0; border-top: 1px solid var(--line); }
  .coverage-list-heading, .coverage-note { grid-column: 1 / -1; }
}
@media (max-width: 900px) { .api-doc-list { position: static; max-height: 400px; } .api-doc-layout { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .app { display: block; }
  #sidebar { width: 248px; max-width: calc(100vw - 44px); left: -260px; z-index: 30; height: 100dvh; }
  #sidebar.open { left: 0; box-shadow: 0 0 0 100vmax #102f3966; }
  #menu { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 4px; }
  header { padding: 12px 16px; gap: 10px; min-height: 80px; }
  .header-right { gap: 4px 8px; width: 100%; justify-content: flex-start; }
  .header-right .text-button { min-height: 40px; padding: 6px; }
  .header-right .avatar { display: none; }
  .header-right #currentUser { display: inline; }
  .demo { margin-left: auto; }
  .next-version { margin-right: 0; min-height: 40px; }
  .breadcrumb { gap: 10px; }
  .content { padding: 24px 16px; }
  .page-heading { gap: 12px; align-items: flex-start; margin-bottom: 22px; }
  h1 { font-size: 1.5rem; letter-spacing: -.02em; }
  .page-heading p { font-size: .875rem; }
  .eyebrow { font-size: .75rem; letter-spacing: .06em; }
  .page-heading .primary { padding: 10px 12px; font-size: .875rem; }
  .filters { gap: 12px; align-items: stretch; }
  .filters > div { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 10px; }
  .filters label { grid-column: 1 / -1; font-size: .875rem; }
  .filters select { width: 100%; font-size: .875rem; padding: 10px 32px 10px 10px; }
  .filters > span { font-size: .75rem; }
  .billing-info { padding: 12px 14px; font-size: .8125rem; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .kpis > .kpi { padding: 18px 16px; }
  .kpis > .kpi:nth-child(odd) { border-left: 0; }
  .kpis > .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .kpi-head { font-size: .8125rem; }
  .kpi-value { font-size: 1.625rem; }
  .kpi-foot { font-size: .75rem; }
  .panel { padding: 20px; }
  .next-chart-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .next-chart-scroll .chart { min-width: 580px; height: auto; }
  .panel-head { align-items: flex-start; flex-wrap: wrap; }
  .table-title { padding: 18px 20px 14px; flex-wrap: wrap; }
  th, td { padding: 13px 16px; }
  .text-button { min-height: 44px; }
  .toolbar input { width: 100%; }
  .toolbar > div { flex-wrap: wrap; }
  .coverage-heading { padding: 20px; gap: 16px; flex-wrap: wrap; }
  .coverage-heading h2 { font-size: 1.25rem; }
  .coverage-heading p { max-width: none; font-size: .8125rem; }
  .coverage-heading .eyebrow, .catalog-heading .eyebrow { font-size: .75rem; letter-spacing: .05em; }
  .coverage-totals { gap: 24px; width: 100%; padding-top: 14px; border-top: 1px solid var(--line); }
  .coverage-totals > div { min-width: 66px; }
  .coverage-totals > div + div { padding-left: 24px; }
  .coverage-totals strong { font-size: 1.75rem; }
  .coverage-totals span { font-size: .8125rem; }
  .coverage-markets { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px 12px; gap: 6px 8px; }
  .market-name strong { font-size: .8125rem; }
  .market-name small, .coverage-note { font-size: .75rem; }
  .market-flag { width: 28px; height: 28px; font-size: .75rem; }
  .map-footer { font-size: .75rem; }
  .catalog-heading { align-items: stretch; flex-direction: column; gap: 16px; }
  .catalog-heading h2 { font-size: 1.25rem; }
  .catalog-search { width: 100%; }
  .catalog-search input { font-size: .875rem; }
  .country-tab { padding: 12px; font-size: .875rem; }
  .catalog-caption { font-size: .8125rem; }
  .marketplace-product { padding: 22px; }
  .product-detail-heading { align-items: flex-start; }
  .product-detail-heading > span { font-size: .8125rem; text-align: left; }
  .api-doc-download { padding: 20px; }
  .api-doc-products { grid-template-columns: 1fr; }
  .api-docs .panel { padding: 20px; }
  .product-filters { padding: 16px; gap: 12px; }
  .pagination { padding: 16px; gap: 12px; }
  .pagination .secondary { min-height: 44px; }
  dialog { padding: 22px; width: calc(100% - 24px); max-width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .dialog-head { gap: 12px; margin-bottom: 20px; }
  .dialog-head h2 { font-size: 1.25rem; }
  .dialog-actions { flex-wrap: wrap; }
  .login-card { padding: 28px; }
  .next-login-eyebrow { font-size: .75rem; }
  footer { font-size: .75rem; flex-direction: column; gap: 6px; }
}
@media (max-width: 380px) {
  .page-heading { flex-wrap: wrap; }
  .filters > div { grid-template-columns: 1fr; }
  .coverage-markets { grid-template-columns: 1fr; }
  .next-version { font-size: .75rem; }
  .header-right { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* The overview's two filters are white interactive surfaces against mist white. */
.filters select { background-color: #fff; border-color: #8ba398; }
.filters select:hover { border-color: #638c77; }
.filters select:focus-visible { border-color: #246653; }
.demo { background: #eaf1ed; color: #365c4b; border-color: #d3e0d8; }
.next-login-eyebrow span { color: #365c4b; background: #eaf1ed; }
.hero .eyebrow { color: #e2eee8; }
.hero::after { border-color: #dce9e130; box-shadow: 0 0 0 44px #dce9e107, 0 0 0 88px #dce9e105; }

/* =========================================================================
   BASIS v2 Upgrades: Account Dropdown, Collapsible Sidebar, API Docs Studio
   ========================================================================= */

/* Compact Topbar Account Dropdown (prevents right-edge clipping) */
header { min-height: 64px; padding: 10px 28px; flex-wrap: nowrap; }
.header-right { gap: 10px; flex-wrap: nowrap; flex-shrink: 0; }
.account-menu { position: relative; }
.account-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 4px 10px 4px 5px;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--ink); font-size: .8125rem; font-weight: 500;
  white-space: nowrap;
}
.account-trigger:hover { background: var(--next-soft); border-color: #9dc0b3; }
.account-trigger .avatar { width: 28px; height: 28px; font-size: 11px; flex-shrink: 0; }
.account-trigger .caret { width: 14px; height: 14px; color: var(--muted); transition: transform 140ms ease; }
.account-trigger[aria-expanded="true"] .caret { transform: rotate(180deg); }
.account-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  min-width: 164px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(16, 47, 41, .14);
  display: flex; flex-direction: column; gap: 2px;
}
.account-menu-item {
  width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 12px; border-radius: 5px; font-size: .8125rem; color: var(--ink);
  font-weight: 500; white-space: nowrap;
}
.account-menu-item:hover { background: var(--next-soft); color: var(--teal); }
.account-menu-item.danger { color: #b42318; border-top: 1px solid #eef2f0; margin-top: 2px; padding-top: 10px; border-radius: 0 0 5px 5px; }
.account-menu-item.danger:hover { background: #fef2f2; color: #991b1b; }

/* Clean Sidebar Bottom & Desktop Collapse Toggle */
#sidebar { padding: 22px 14px 14px; transition: width 160ms ease; }
.brand.basis-sidebar { padding: 0 10px 18px; margin-bottom: 16px; gap: 8px; }
#sidebar nav { margin-bottom: 16px; gap: 4px; }
.nav-item { min-height: 42px; padding: 10px 13px; }
.sidebar-bottom {
  margin-top: auto; padding: 14px 10px 4px; gap: 10px;
  border-top: 1px solid #49685b; flex-shrink: 0;
}
.sidebar-org { display: grid; gap: 3px; }
.sidebar-org strong { font-size: .8125rem; color: #f1f7f4; }
.sidebar-org .muted { font-size: .75rem; color: #a7c0c4; }
.sidebar-collapse-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; min-height: 34px; padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 5px;
  background: rgba(255,255,255,.06); color: #cde0db; font-size: .75rem; font-weight: 500;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.sidebar-collapse-btn svg { width: 16px; height: 16px; flex-shrink: 0; transition: transform 160ms ease; }

.app.sidebar-collapsed { grid-template-columns: 68px minmax(0, 1fr); }
.app.sidebar-collapsed #sidebar { padding: 18px 10px 14px; align-items: center; }
.app.sidebar-collapsed .brand.basis-sidebar { padding: 0 0 16px; margin-bottom: 12px; align-items: center; width: 100%; }
.app.sidebar-collapsed #sidebar .basis-sidebar img { width: 38px; height: 38px; max-width: 38px; object-fit: cover; object-position: left center; border-radius: 7px; }
.app.sidebar-collapsed #sidebar .basis-sidebar > span,
.app.sidebar-collapsed .nav-label,
.app.sidebar-collapsed .nav-text,
.app.sidebar-collapsed .sidebar-org,
.app.sidebar-collapsed .collapse-label { display: none; }
.app.sidebar-collapsed #sidebar nav { width: 100%; }
.app.sidebar-collapsed .nav-item { justify-content: center; padding: 10px; }
.app.sidebar-collapsed .sidebar-bottom { width: 100%; padding: 12px 0 4px; }
.app.sidebar-collapsed .sidebar-collapse-btn { padding: 6px; }
.app.sidebar-collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

/* API Docs Dedicated Compact Shell (Reclaims ~400px Above the Fold) */
body[data-page="api-docs"] .page-heading { display: none; }
body[data-page="api-docs"] .content { padding: 16px 24px 24px; max-width: 1760px; }

.api-doc-topbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px 16px;
  padding: 10px 14px; margin-bottom: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
}
.topbar-left { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; min-width: 0; }
.topbar-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.topbar-title-row h1 { margin: 0; font-size: 1.125rem; font-weight: 650; line-height: 1.3; color: var(--navy); }
.topbar-count {
  font-size: .75rem; font-weight: 600; color: var(--teal);
  background: var(--next-soft); border: 1px solid #c9e0d6; border-radius: 999px; padding: 2px 9px;
}
.topbar-updated { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.topbar-icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--line); border-radius: 5px; background: var(--paper);
  color: var(--muted); font-size: 14px; line-height: 1;
}
.topbar-icon-btn:hover { background: var(--next-soft); color: var(--teal); border-color: #9dc0b3; }

.version-pills { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ver-filter {
  border: 1px solid var(--line); background: var(--paper); color: var(--muted);
  padding: 4px 9px; border-radius: 999px; font-size: .75rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.ver-filter b { font-family: var(--next-mono); font-weight: 600; font-size: .72rem; }
.ver-filter:hover { border-color: #93b9ad; color: var(--ink); }
.ver-filter.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.ver-filter.active b { color: var(--lime); }

.topbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.env-switch {
  display: inline-flex; padding: 2px; background: var(--next-surface-soft);
  border: 1px solid var(--line); border-radius: 6px;
}
.env-opt {
  border: 0; background: transparent; color: var(--muted);
  padding: 5px 10px; border-radius: 4px; font-size: .75rem; font-weight: 550; white-space: nowrap;
}
.env-opt:hover { color: var(--ink); }
.env-opt.active { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(16,47,41,.1); }

.compact-btn { min-height: 32px !important; padding: 5px 11px !important; font-size: .78rem !important; }
.secondary.active-toggle { background: var(--next-soft); border-color: var(--teal); color: var(--teal); }

.batch-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 10px 14px; margin-bottom: 14px;
  background: #edf6f1; border: 1px solid #b5d6c7; border-radius: 6px; font-size: .8125rem;
}
.batch-bar strong { color: var(--navy); margin-right: 10px; }
.batch-bar span { color: var(--muted); }
.batch-bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Two-Column API Docs Layout (Eliminates Nested Double Scrollbar) */
.api-doc-layout {
  display: grid; grid-template-columns: 276px minmax(0, 1fr);
  align-items: start; gap: 18px;
}
.api-doc-list {
  position: sticky; top: 12px; max-height: calc(100vh - 24px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px;
}
.api-list-filters { flex-shrink: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.api-list-filters input {
  width: 100%; min-height: 36px; padding: 6px 10px; margin-bottom: 8px;
  font-size: .8125rem; background: var(--paper);
}
.api-list-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.api-list-selects select {
  width: 100%; min-height: 34px; padding: 5px 28px 5px 8px; margin-bottom: 0;
  font-size: .75rem; background-color: var(--paper); background-position: right 8px center;
}
.api-doc-products {
  flex: 1 1 auto; overflow-y: auto; padding-top: 6px; padding-right: 2px;
  scrollbar-width: thin; scrollbar-color: #b7cbc4 transparent;
}
.api-country-group h3 {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .72rem; font-weight: 650; letter-spacing: .04em; color: var(--muted);
  margin: 12px 6px 5px; padding-bottom: 4px; border-bottom: 1px dashed #e5ece8;
}
.api-country-group:first-child h3 { margin-top: 4px; }
.api-country-group h3 span { font-family: var(--next-mono); font-size: .7rem; color: #7b9088; }

.api-pick-row { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 4px; }
.batch-check { margin: 12px 0 0 4px; width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
.api-doc-pick {
  flex: 1; min-width: 0; text-align: left; padding: 8px 10px; margin-bottom: 0;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
}
.api-doc-pick:hover { background: #f3f7f5; }
.api-doc-pick.selected { background: var(--next-soft); border-color: #a9cebe; }
.pick-title-line { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.api-doc-pick strong { font-size: .825rem; font-weight: 600; line-height: 1.4; color: var(--ink); display: block; }
.pick-lock { font-size: 11px; flex-shrink: 0; }
.pick-en {
  display: block; font-size: .7rem; color: #6a8078; line-height: 1.35; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pick-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: .7rem; color: var(--muted); }
.ver-dot {
  font-family: var(--next-mono); font-weight: 700; font-size: .68rem;
  padding: 0 5px; border-radius: 3px; text-transform: uppercase;
}
.ver-dot.ver-v3, .ver-pill.ver-v3 { background: #e6f4ee; color: #166549; border: 1px solid #bce0cf; }
.ver-dot.ver-v2, .ver-pill.ver-v2 { background: #eef4f8; color: #24577a; border: 1px solid #c7dceb; }
.ver-dot.ver-v1, .ver-pill.ver-v1 { background: #fef6e4; color: #9a5b0c; border: 1px solid #f2d59b; }
.pick-match-hit {
  display: inline-block; margin-top: 4px; padding: 1px 6px; border-radius: 4px;
  background: #fef6e4; color: #92540a; font-size: .68rem; font-family: var(--next-mono);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Detail Header Card & Actions */
.api-doc-content { min-width: 0; }
.api-doc-header { background: #fff; padding: 20px 22px; scroll-margin-top: 68px; }
.api-detail-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px 18px; margin-bottom: 10px;
}
.api-detail-title-wrap { min-width: 0; flex: 1 1 300px; }
.api-detail-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ver-pill { font-family: var(--next-mono); font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.meta-pill {
  font-size: .72rem; color: var(--muted); background: var(--next-surface-soft);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 7px;
}
.meta-pill.mono { font-family: var(--next-mono); }
.api-doc-header h2 { margin: 0; font-size: 1.3rem; font-weight: 650; color: var(--navy); line-height: 1.35; }
.api-en-sub { font-size: .8125rem; color: var(--muted); margin-top: 2px; font-weight: 450; }
.api-detail-desc { margin: 8px 0 12px; font-size: .875rem; color: #3d524b; line-height: 1.65; }

.api-detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; flex-shrink: 0; }
.export-menu { position: relative; }
.export-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 248px; padding: 6px; background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(16,47,41,.15);
  display: flex; flex-direction: column; gap: 4px;
}
.export-item {
  display: block; width: 100%; text-align: left; padding: 9px 10px;
  border: 0; border-radius: 5px; background: transparent; color: var(--ink);
}
.export-item:hover { background: var(--next-soft); }
.export-item strong { display: block; font-size: .8125rem; color: var(--navy); }
.export-item small { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.internal-doc-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
  padding: 5px 10px; border-radius: 4px; font-size: .78rem; font-weight: 600;
  background: #fffbeb; color: #92400e; border: 1px solid #f59e0b; white-space: nowrap;
}
.internal-doc-btn:hover { background: #fef3c7; border-color: #d97706; }
.internal-tag {
  font-size: .66rem; padding: 1px 5px; border-radius: 3px;
  background: #f59e0b; color: #fff; font-weight: 700;
}

/* Internal Ops Metadata Strip */
.api-ops-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  padding: 8px 12px; margin-bottom: 12px;
  background: #f4f7f5; border: 1px dashed #c2d4cc; border-radius: 5px;
  font-size: .76rem; color: var(--muted);
}
.api-ops-strip code {
  background: #e6efea; color: var(--navy); padding: 1px 5px; border-radius: 3px;
  font-size: .74rem;
}
.api-ops-strip strong { color: var(--ink); font-weight: 600; }
.ops-lock {
  font-weight: 650; color: #92400e; background: #fef3c7; border: 1px solid #fcd34d;
  padding: 1px 6px; border-radius: 4px; font-size: .7rem;
}
.ops-links { margin-left: auto; display: inline-flex; gap: 12px; }
.ops-links a { color: var(--teal); font-weight: 600; white-space: nowrap; }
.ops-links a:hover { text-decoration: underline; }

.api-v1-notice {
  padding: 10px 13px; margin-bottom: 12px; border-radius: 5px;
  background: #fffbeb; border: 1px solid #fcd34d; color: #78350f;
  font-size: .8rem; line-height: 1.6;
}
.api-v1-notice code { background: #fef3c7; padding: 0 4px; border-radius: 3px; color: #78350f; }

/* Endpoint Box */
.api-endpoint-group { display: grid; gap: 8px; }
.api-endpoint {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: #f0f6f3; border: 1px solid #cfe2d8; border-radius: 6px;
}
.http-method {
  font-family: var(--next-mono); font-size: .75rem; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; background: var(--navy); color: var(--lime);
}
.api-endpoint > code { flex: 1 1 240px; min-width: 0; font-size: .84rem; color: var(--navy); word-break: break-all; }
.env-tag { font-size: .7rem; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.env-tag.env-prod { background: #dcfce7; color: #166534; }
.env-tag.env-debug { background: #fef3c7; color: #92400e; }
.copy-inline-btn { min-height: 28px !important; padding: 3px 9px !important; font-size: .76rem !important; }
.copy-inline-btn.copied, .code-copy-btn.copied { color: #047857 !important; border-color: #34d399 !important; background: #ecfdf5 !important; }
.api-http-fallback { margin-top: 2px !important; }
.api-http-fallback summary { font-size: .76rem; color: #9a5b0c; padding: 4px 2px; }
.api-endpoint.subtle { background: #fafaf9; border-color: #e5e7eb; margin-top: 6px; }

/* Sticky Section Sub-Nav */
.api-sticky-nav {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 12px; padding: 6px 10px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 4px 14px rgba(16, 47, 41, .06);
}
.api-sticky-tabs { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.api-sticky-tabs::-webkit-scrollbar { display: none; }
.sticky-tab {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 10px; border-radius: 5px; font-size: .8rem; font-weight: 550;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
}
.sticky-tab:hover { background: var(--next-soft); color: var(--navy); }
.sticky-tab.active { background: var(--navy); color: #fff; }
.sticky-tab .tab-cnt {
  font-family: var(--next-mono); font-size: .7rem; padding: 0 5px; border-radius: 999px;
  background: rgba(23, 63, 53, .1); color: inherit;
}
.sticky-tab.active .tab-cnt { background: rgba(196, 239, 69, .22); color: var(--lime); }
.sticky-top-btn {
  border: 1px solid var(--line); background: var(--paper); color: var(--muted);
  padding: 4px 9px; border-radius: 5px; font-size: .75rem; white-space: nowrap; flex-shrink: 0;
}
.sticky-top-btn:hover { background: var(--next-soft); color: var(--teal); }

/* Sections */
.api-doc-section { background: #fff; padding: 20px 22px; margin-top: 14px; scroll-margin-top: 64px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.section-head h2 { margin: 0; font-size: 1.05rem; font-weight: 650; color: var(--navy); border: 0; padding: 0; }
.section-meta { font-size: .78rem; color: var(--muted); }
.sub-heading { font-size: .84rem; font-weight: 600; color: var(--ink); margin: 14px 0 8px; }
.sub-heading:first-of-type { margin-top: 0; }
.api-rules-list { margin: 0; padding-left: 18px; }
.api-rules-list li { margin-bottom: 8px; font-size: .85rem; line-height: 1.7; color: #31463f; }
.api-rules-list li:last-child { margin-bottom: 0; }

.data-kind-badge {
  font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
}
.data-kind-badge.mock { background: #eef4f8; color: #24577a; border: 1px solid #c7dceb; }
.data-kind-badge.real { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* Tabbed Code Cards + Syntax Highlighting */
.api-code-card {
  border: 1px solid #21443b; border-radius: 8px; overflow: hidden; background: #102621;
}
.code-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 6px 10px; background: #16332c; border-bottom: 1px solid #244b41;
}
.code-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.code-tab {
  border: 0; background: transparent; color: #a8c2ba;
  padding: 5px 10px; border-radius: 5px; font-size: .76rem; font-weight: 550;
}
.code-tab:hover { color: #fff; background: rgba(255,255,255,.08); }
.code-tab.active { background: #246653; color: #fff; }
.code-copy-btn {
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08);
  color: #e2efe9; padding: 4px 10px; border-radius: 5px; font-size: .74rem; font-weight: 550;
}
.code-copy-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.case-desc { margin: 0; padding: 10px 16px 0; font-size: .78rem; color: #b7d2c8; }
.code-pre {
  margin: 0; padding: 14px 16px !important; border-radius: 0 !important;
  background: transparent !important; color: #e2eee9;
  max-height: 440px; overflow: auto; font-size: .79rem; line-height: 1.65;
}
.code-pre code { font-family: var(--next-mono); white-space: pre; overflow-wrap: normal; }
.tok-key { color: #86efac; }
.tok-str { color: #fde68a; }
.tok-num { color: #93c5fd; }
.tok-kw { color: #c4b5fd; font-weight: 600; }
.tok-com { color: #7c9a92; font-style: italic; }

/* Tables, Response Field Groups & In-Table Search */
.field-head-row { align-items: center; }
.field-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field-search-input {
  min-height: 32px !important; padding: 4px 10px !important;
  width: 220px; font-size: .78rem !important; background: var(--paper);
}

.api-docs .table-scroll { margin-bottom: 12px; overflow-x: auto; max-width: 100%; }
.api-field-table, .api-error-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.api-docs th, .api-docs td {
  padding: 10px 12px; font-size: .8rem; vertical-align: top;
  word-break: normal; overflow-wrap: break-word;
}
.api-docs td:first-child { min-width: 140px; }
.api-docs td:nth-child(2) { min-width: 72px; }
.api-docs td:nth-child(3) { min-width: 82px; }
.api-field-table .col-field { padding-left: calc(12px + var(--depth, 0) * 14px); white-space: nowrap; }
.api-field-table .col-desc { min-width: 220px; color: #2f433c; line-height: 1.6; }
.api-docs .api-error-table td:first-child { min-width: 68px; width: 72px; white-space: nowrap; }
.api-docs .api-error-table td:nth-child(2) { min-width: 110px; white-space: nowrap; }
.api-docs .api-error-table td:nth-child(3) { min-width: 260px; }
.api-error-table .col-msg code { word-break: break-word; overflow-wrap: break-word; }
.api-error-table .col-help { min-width: 220px; color: #2f433c; line-height: 1.6; }

.field-copy-btn {
  border: 0; background: transparent; padding: 1px 4px; margin: -1px -4px;
  border-radius: 4px; color: var(--navy); text-align: left; display: inline-flex; align-items: center; gap: 4px;
}
.field-copy-btn:hover { background: var(--next-soft); color: var(--teal); }
.tree-branch { color: #9db3ab; font-family: var(--next-mono); font-size: .75rem; }
.type-chip {
  font-family: var(--next-mono); font-size: .73rem; color: #355a66;
  background: #edf3f5; padding: 2px 6px; border-radius: 4px; white-space: nowrap;
}
.req-chip { font-size: .72rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.req-chip.req-yes { background: #ecfdf5; color: #047857; }
.req-chip.req-cond { background: #fffbeb; color: #b45309; }
.req-chip.req-no { background: #f1f5f9; color: #64748b; }
.http-chip { font-family: var(--next-mono); font-size: .74rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.http-chip.http-4xx { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.http-chip.http-5xx { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.field-group {
  border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px !important;
  margin-top: 0 !important; overflow: hidden; background: #fff;
}
.field-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px !important; background: #f7faf8; color: var(--navy) !important;
  font-size: .82rem !important; font-weight: 600; list-style: none; cursor: pointer;
}
.field-group-head::-webkit-details-marker { display: none; }
.field-group-head::before { content: "▸"; margin-right: 6px; color: var(--teal); transition: transform 120ms ease; display: inline-block; }
.field-group[open] > .field-group-head::before { transform: rotate(90deg); }
.field-group[open] > .field-group-head { border-bottom: 1px solid var(--line); }
.field-group-title { flex: 1; min-width: 0; }
.field-group-count {
  font-family: var(--next-mono); font-size: .72rem; color: var(--muted);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
}
.field-group-body .table-scroll { margin-bottom: 0; }

/* Responsive Refinements */
@media (max-width: 1200px) {
  header { padding: 10px 18px; }
  body[data-page="api-docs"] .content { padding: 14px 18px 20px; }
  .api-doc-layout { grid-template-columns: 236px minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 960px) {
  .api-doc-layout { grid-template-columns: 1fr; }
  .api-doc-list { position: static; max-height: 360px; }
  .api-sticky-nav { top: 0; }
  .ops-links { margin-left: 0; }
}
@media (max-width: 760px) {
  .sidebar-collapse-btn { display: none; }
  .app.sidebar-collapsed { display: block; }
  header { flex-wrap: nowrap; padding: 10px 14px; }
  .header-right { width: auto; }
  .account-trigger #currentUser { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  .field-search-input { width: 100%; }
}

/* === Clients Management Compact Hierarchy & Quota Drawer (2026-12-01) === */
.clients-table { width: 100%; border-collapse: collapse; }
.clients-table th { white-space: nowrap; padding: 11px 14px; font-size: 12px; font-weight: 600; color: #526a71; letter-spacing: .01em; }
.clients-table td { vertical-align: middle; padding: 14px 14px; border-top: 1px solid #e6efef; }
.clients-table .client-row-master { background: #f6fbf9; box-shadow: inset 3px 0 0 #087f73; }
.clients-table .client-row-master:hover { background: #eef8f5; }
.clients-table .client-row-legacy { background: #ffffff; }
.clients-table .client-section-row td { background: #f6f9f9; padding: 7px 14px; font-size: 12px; color: #647980; font-weight: 500; border-top: 1px solid #e1eaea; border-bottom: 1px solid #e1eaea; }
.clients-table .customer { display: flex; align-items: flex-start; gap: 10px; }
.clients-table .logo { width: 32px; height: 32px; flex-shrink: 0; border-radius: 7px; font-size: 11px; font-weight: 700; display: grid; place-items: center; background: #e6f2ef; color: #087f73; margin-top: 1px; }
.clients-table .logo.logo-master { background: #087f73; color: #ffffff; box-shadow: 0 2px 6px rgba(8,127,115,.22); }
.clients-table .acct-meta { min-width: 0; }
.clients-table .acct-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; line-height: 1.3; }
.clients-table .acct-title strong { font-size: 14px; font-weight: 600; color: #152f39; }
.clients-table .acct-title .badge { padding: 1px 7px; font-size: 11px; line-height: 1.5; border-radius: 4px; }
.clients-table .acct-meta small { display: block; color: #6e8188; font-size: 12px; margin-top: 3px; line-height: 1.4; }
.clients-table .acct-prods-line { margin-top: 6px; }
.prod-count-chip { display: inline-block; padding: 4px 9px; font-size: 11.5px; color: #2f5550; background: #edf5f3; border: 1px solid #d5e6e2; border-radius: 6px; line-height: 1.5; max-width: 330px; white-space: normal; text-align: left; word-break: keep-all; overflow-wrap: break-word; transition: background .15s, border-color .15s, color .15s; }
.prod-count-chip:hover { background: #dff0ec; border-color: #9ecfc5; color: #087f73; }
.metric-main { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; line-height: 1.3; }
.metric-main strong { font-size: 14px; font-weight: 600; color: #152f39; font-variant-numeric: tabular-nums; }
.metric-cap { font-size: 12.5px; color: #75858b; font-variant-numeric: tabular-nums; }
.metric-inline { margin: 0; font-size: 12px; color: #75858b; }
.metric-sub { margin-top: 3px; font-size: 11.5px; color: #75858b; }
.mini-bar { height: 5px; background: #e5efef; border-radius: 99px; overflow: hidden; margin: 6px 0 3px; max-width: 196px; }
.mini-bar-fill { display: block; height: 100%; border-radius: 99px; background: #0c8b7e; transition: width .2s ease; }
.mini-bar-fill.warn { background: #d9822b; }
.mini-bar-fill.danger { background: #d64545; }
.quota-summary-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.q-chip { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 4px; font-size: 11.5px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.q-chip.ok { background: #edf6ef; color: #226349; border: 1px solid #cbe2d3; }
.q-chip.warn { background: #fff6e5; color: #9a5b13; border: 1px solid #efd5a3; }
.q-chip.danger { background: #fef0f0; color: #b93838; border: 1px solid #f4c7c7; }
.chip-toggle { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 5px; font-size: 11.5px; font-weight: 500; color: #2d555e; background: #ffffff; border: 1px solid #d4e1e2; line-height: 1.5; white-space: nowrap; transition: all .15s; }
.chip-toggle:hover { border-color: #087f73; color: #087f73; background: #f2faf8; }
.quota-drawer-row > td { padding: 12px 18px 16px !important; background: #f7fbfa !important; border-top: 1px dashed #d6e4e2; }
.quota-drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.quota-drawer-head strong { font-size: 13px; color: #152f39; }
.quota-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.quota-card { background: #ffffff; border: 1px solid #e1ebeb; border-radius: 8px; padding: 9px 11px; border-left: 3px solid #96c7bf; }
.quota-card.warn { border-left-color: #d9822b; }
.quota-card.danger { border-left-color: #d64545; background: #fffafa; }
.quota-card.unlimited { border-left-color: #087f73; }
.quota-card-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 5px; }
.quota-card-name { font-size: 12.5px; font-weight: 600; color: #17343e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quota-country { font-size: 11px; color: #677d84; background: #f1f6f6; padding: 1px 6px; border-radius: 4px; flex-shrink: 0; }
.quota-card-nums { display: flex; align-items: baseline; gap: 4px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.quota-card-nums strong { color: #152f39; font-weight: 600; }
.quota-card-nums span { color: #7a8d93; font-size: 11.5px; }
.quota-rem { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 500; color: #226349; }
.quota-rem.warn { color: #9a5b13; }
.quota-rem.danger { color: #b93838; }
.quota-card .mini-bar { margin: 5px 0 0; max-width: none; height: 4px; }
.muted-dash { color: #a7b7bc; font-size: 13px; font-weight: 400; }
.action-group { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.action-pill { display: inline-flex; align-items: center; justify-content: center; padding: 5px 10px; font-size: 12px; font-weight: 500; line-height: 1.2; border-radius: 6px; border: 1px solid #d5e2e3; background: #ffffff; color: #1c404a; white-space: nowrap; transition: all .15s; }
.action-pill:hover { border-color: #087f73; color: #087f73; background: #f2faf8; }
.action-pill.primary-soft { background: #eaf6f3; border-color: #b7ddd4; color: #076d63; font-weight: 600; }
.action-pill.primary-soft:hover { background: #087f73; border-color: #087f73; color: #ffffff; }
.action-pill.active { background: #143944; border-color: #143944; color: #ffffff; }
.action-pill.subtle { color: #5b7279; border-color: #e2ebeb; background: #fafcfc; }
.action-pill.subtle:hover { color: #152f39; border-color: #c5d6d8; background: #f1f6f6; }

/* === API Key Vault Modal === */
.key-meta-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #dce7e5; border-radius: 10px; background: #f8fbfa; overflow: hidden; margin-bottom: 16px; }
.key-meta-cell { padding: 10px 13px; border-right: 1px solid #e5eeec; border-bottom: 1px solid #e5eeec; min-width: 0; }
.key-meta-cell:nth-child(3n) { border-right: 0; }
.key-meta-cell:nth-child(n+4) { border-bottom: 0; }
.key-meta-cell label { display: block; font-size: 11px; color: #6c8187; margin-bottom: 3px; font-weight: 500; }
.key-meta-cell strong { display: block; font-size: 13.5px; color: #152f39; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key-meta-cell strong.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; letter-spacing: .01em; }
.key-vault { border: 1px solid #cbe0dc; border-radius: 11px; background: linear-gradient(180deg, #f3faf8 0%, #ffffff 44px); padding: 14px 16px; margin-bottom: 14px; }
.key-vault-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.key-vault-title { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #15383f; }
.key-state-pill { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 500; background: #e8f0ef; color: #476369; border: 1px solid #d3e1df; }
.key-state-pill.revealed { background: #fff4e0; color: #9a5b13; border-color: #eed098; }
.key-vault-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.key-btn, .key-btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 32px; min-height: 32px; min-width: 104px; padding: 0 12px; font-size: 12.5px; font-weight: 500; border-radius: 7px; border: 1px solid #cddcda; background: #ffffff; color: #1c404a; cursor: pointer; transition: all .15s; line-height: 1; white-space: nowrap; box-sizing: border-box; }
.key-btn:hover { border-color: #087f73; color: #087f73; background: #f2faf8; }
.key-btn-primary { background: #087f73; border-color: #087f73; color: #ffffff; font-weight: 600; }
.key-btn-primary:hover { background: #066a60; border-color: #066a60; color: #ffffff; }
.key-value-box { display: block; width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; font-weight: 600; letter-spacing: .02em; color: #102a31; background: #ffffff; border: 1px solid #cfe0dd; border-radius: 8px; padding: 11px 13px; word-break: break-all; user-select: all; box-shadow: inset 0 1px 2px rgba(16,42,49,.04); }
.key-headers-wrap { margin-top: 12px; border-top: 1px dashed #d8e7e4; padding-top: 10px; }
.key-headers-label { font-size: 11.5px; color: #5d747a; margin-bottom: 6px; font-weight: 500; }
.key-header-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #f5f9f8; border: 1px solid #e1ecea; border-radius: 7px; padding: 7px 10px; margin-bottom: 6px; }
.key-header-row:last-child { margin-bottom: 0; }
.key-header-row code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: #24454d; word-break: break-all; flex: 1; min-width: 0; }
.key-copy-mini { flex-shrink: 0; padding: 3px 9px; font-size: 11px; font-weight: 500; border-radius: 5px; border: 1px solid #cfe0dd; background: #ffffff; color: #1c4c47; cursor: pointer; transition: all .15s; }
.key-copy-mini:hover { border-color: #087f73; color: #087f73; background: #eaf6f3; }
.key-audit-bar { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: 8px; background: #f7f9f9; border: 1px solid #e4eceb; font-size: 12px; color: #5b7177; line-height: 1.5; margin: 0; }
.key-audit-bar .lock-ico { flex-shrink: 0; font-size: 13px; line-height: 1.4; }
@media (max-width: 640px) { .key-meta-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .key-meta-cell:nth-child(3n) { border-right: 1px solid #e5eeec; } .key-meta-cell:nth-child(2n) { border-right: 0; } }
