:root {
  color-scheme: light;
  --page: #f6f7f3;
  --surface: #ffffff;
  --surface-soft: #f0f3ed;
  --ink: #17211b;
  --muted: #69736d;
  --faint: #8b948f;
  --line: #dce2dc;
  --line-strong: #c8d0c9;
  --accent: #126b4d;
  --accent-strong: #0b5139;
  --accent-soft: #e2f1e9;
  --warn: #95580a;
  --warn-soft: #fff3d8;
  --danger: #a63c35;
  --danger-soft: #fbe9e7;
  --error: #d40000;
  --error-strong: #a60000;
  --error-soft: #fff0f0;
  --shadow: 0 18px 42px rgba(20, 36, 27, .07);
  --radius: 14px;
  --table-sticky-top: 0px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #101512;
    --surface: #161d19;
    --surface-soft: #1c251f;
    --ink: #edf4ef;
    --muted: #a7b1ab;
    --faint: #7e8982;
    --line: #2a352e;
    --line-strong: #3b473f;
    --accent: #72d6ad;
    --accent-strong: #a2e7c9;
    --accent-soft: #183c2d;
    --warn: #f1ba65;
    --warn-soft: #3c2b13;
    --danger: #f19a92;
    --danger-soft: #42231f;
    --error: #ff5a5f;
    --error-strong: #ff8a8e;
    --error-soft: #3d1517;
    --shadow: 0 18px 42px rgba(0, 0, 0, .22);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font: 12.5px/1.45 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 32%, transparent); outline-offset: 2px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(18px);
}

.header-inner, .app-shell, .site-footer {
  width: calc(100% - 24px);
  margin-inline: auto;
}

.header-inner {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--ink);
  color: var(--page);
  font-weight: 800;
  letter-spacing: -.06em;
}
.brand strong { display: block; font-size: 14px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: -2px; color: var(--muted); font-size: 11px; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 650;
}
.main-nav a:hover, .main-nav a.active { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

.global-search {
  justify-self: end;
  width: min(100%, 340px);
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--faint);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.global-search:hover, .global-search:focus-visible { border-color: var(--line-strong); color: var(--muted); box-shadow: 0 2px 10px rgba(22, 34, 27, .06); outline: none; }
.global-search svg, .global-search-input-row svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.global-search-label { min-width: 0; flex: 1; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.global-search kbd { margin-left: auto; padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--faint); font: 10px ui-monospace, monospace; white-space: nowrap; }

.global-search-dialog { max-width: none; margin: auto; padding: 0; border: 0; background: transparent; color: var(--ink); }
.global-search-dialog::backdrop { background: rgba(15, 22, 18, .42); backdrop-filter: blur(4px); }
.global-search-panel {
  width: min(680px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 72px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(14, 24, 18, .24);
}
.global-search-input-row { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.global-search-input-row input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font: 15px/1.4 inherit; }
.global-search-input-row input::placeholder { color: var(--faint); }
.global-search-input-row button { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--faint); cursor: pointer; font-size: 20px; line-height: 1; }
.global-search-input-row button:hover { background: var(--page); color: var(--ink); }
.global-search-results { min-height: 210px; overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
.global-search-group + .global-search-group { margin-top: 7px; }
.global-search-group h2 { display: flex; align-items: center; gap: 6px; margin: 0; padding: 7px 9px 5px; color: var(--faint); font-size: 11px; font-weight: 650; }
.global-search-group h2 span { font-weight: 500; }
.global-search-result { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px; border-radius: 10px; color: var(--ink); }
.global-search-result:hover, .global-search-result.active { background: var(--accent-soft); }
.global-search-result .logo { width: 24px; height: 24px; }
.global-search-result-copy { min-width: 0; }
.global-search-result-copy strong, .global-search-result-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-search-result-copy strong { font-size: 13px; font-weight: 650; }
.global-search-result-copy small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.global-search-kind { color: var(--faint); font-size: 10px; }
.global-search-mark { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--ink); color: var(--surface); font-size: 10px; font-weight: 800; }
.global-search-empty { min-height: 210px; display: grid; place-content: center; gap: 5px; text-align: center; }
.global-search-empty strong { font-size: 14px; }
.global-search-empty span { color: var(--muted); font-size: 12px; }
.global-search-footer { display: flex; justify-content: flex-end; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; }
.plan-billing {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  font-size: 10px;
  white-space: nowrap;
}

.reasoning-control { display: inline-flex; align-items: center; gap: 4px; }
.reasoning-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  cursor: help;
  font-size: 9px;
  line-height: 1;
}
.reasoning-tooltip { position: relative; outline: none; }
.reasoning-tooltip-content {
  display: grid;
  gap: 8px;
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 7px);
  left: 0;
  width: max-content;
  max-width: 380px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font: 11px/1.55 var(--font-sans);
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity 80ms ease, transform 80ms ease;
  visibility: hidden;
  white-space: nowrap;
}
.reasoning-tooltip-group { display: grid; gap: 2px; }
.reasoning-tooltip-group strong { color: var(--text); font-size: 11px; }
.reasoning-tooltip-group span { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.reasoning-tooltip:hover .reasoning-help, .reasoning-tooltip:focus-visible .reasoning-help { border-color: var(--accent); color: var(--accent-strong); }
.reasoning-tooltip:hover .reasoning-tooltip-content, .reasoning-tooltip:focus-visible .reasoning-tooltip-content { opacity: 1; transform: translateY(0); visibility: visible; }

.app-shell { min-height: calc(100vh - 150px); padding: 24px 0 40px; }
.loading-state, .empty-state {
  padding: 42px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.error-state {
  padding: 42px 20px;
  border: 2px solid var(--error);
  border-radius: var(--radius);
  background: var(--error-soft);
  color: var(--error);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 12%, transparent);
  text-align: center;
}
.error-state h1, .error-state h2, .error-state h3 { color: var(--error-strong); }
.error-state code { color: inherit; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(24px, 3vw, 34px); line-height: 1.12; letter-spacing: -.04em; }
h2 { margin-bottom: 11px; font-size: 17px; letter-spacing: -.025em; }
h3 { margin-bottom: 8px; font-size: 14px; }
.lead { max-width: 800px; margin-bottom: 0; color: var(--muted); font-size: 13px; }
.count-note { color: var(--faint); font-size: 11px; text-align: right; white-space: nowrap; }

.panel, .data-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.toolbar input, .toolbar select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 11px;
  background: var(--surface);
  color: var(--ink);
}
.toolbar input { min-width: min(320px, 100%); flex: 1; }
.toolbar select { min-width: 140px; }

.table-panel { width: 100%; background: transparent; }
.table-scroll { overflow: visible; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); background: var(--surface-soft); font-size: 11px; font-weight: 750; letter-spacing: .025em; }
thead th {
  position: sticky;
  top: var(--table-sticky-top);
  z-index: 10;
  box-shadow: 0 1px 0 var(--line), 0 5px 12px color-mix(in srgb, var(--ink) 7%, transparent);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 30%, transparent); }
.sort-button { border: 0; padding: 0; background: transparent; color: inherit; cursor: pointer; font-weight: inherit; }
.sort-button.active { color: var(--accent); }
.primary-cell { display: flex; align-items: center; gap: 8px; min-width: 190px; }
.primary-cell strong { display: block; }
.primary-cell small, .subtle { display: block; color: var(--muted); font-size: 11px; }
.series-model-cell { display: flex; align-items: center; gap: 5px; }
.series-model-cell .primary-cell { min-width: 170px; max-width: 260px; }
.series-model-cell .primary-cell > span { min-width: 0; }
.series-model-cell .primary-cell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.series-title-line { min-width: 0; display: flex; align-items: center; gap: 7px; }
.series-title-line strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.series-count { padding: 1px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 9.5px; font-weight: 650; }
.series-row { background: color-mix(in srgb, var(--surface-soft) 42%, transparent); }
.version-row { background: color-mix(in srgb, var(--surface-soft) 72%, transparent); }
.version-row .series-model-cell { padding-left: 27px; }
.version-row .primary-cell { position: relative; }
.version-row .primary-cell::before { content: ""; position: absolute; left: -12px; width: 7px; height: 1px; background: var(--line-strong); }
.row-link strong, .interactive-link {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.row-link:hover strong, .interactive-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.logo { width: 24px; height: 24px; object-fit: contain; flex: 0 0 auto; }
.logo.large { width: 42px; height: 42px; }
.number { font-variant-numeric: tabular-nums; }
.api-address {
  color: var(--ink);
  font-size: 11px;
  user-select: all;
  white-space: nowrap;
}
.model-call-cell {
  min-width: 190px;
  white-space: normal;
}
.model-call-cell > .interactive-link, .model-call-cell > strong {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-bottom: 5px;
  font-weight: 720;
}
.call-id { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.call-id code { max-width: 210px; overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.copy-button {
  width: 21px;
  height: 21px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  border-radius: 5px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.copy-button:hover, .copy-button.copied { background: var(--accent-soft); color: var(--accent-strong); }
.key-cell { color: var(--ink); font-weight: 400; }
.secondary-cell { color: var(--faint); }
.secondary-cell .badge { opacity: .78; }
.pending-value { color: var(--faint); font-weight: 400; }
.token-limit { display: inline-grid; gap: 1px; line-height: 1.15; white-space: nowrap; }
.token-compact { color: var(--ink); font-size: 12px; font-weight: 650; }
.token-exact { color: var(--faint); font-size: 9.5px; font-weight: 400; }
.token-exact.only { color: var(--ink); font-size: 11px; }
.price-pair { display: inline-flex; align-items: baseline; gap: 5px; }
.price-separator { color: var(--faint); }
.mode-prices { display: grid; gap: 2px; }
.mode-prices > span { display: flex; align-items: baseline; gap: 6px; }
.mode-prices small { width: 24px; color: var(--faint); font-size: 10px; }
.tier-prices { display: grid; gap: 2px; }
.tier-prices > span { display: grid; grid-template-columns: max-content max-content; align-items: baseline; justify-content: start; gap: 4px; }
.price-tier-summary { display: inline-flex; align-items: center; gap: 4px; color: var(--faint); font-size: 10px; white-space: nowrap; }
.price-help {
  position: relative;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  cursor: help;
  font-size: 9px;
  font-style: normal;
  line-height: 1;
  outline: none;
}
.price-help::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 40;
  left: 50%;
  bottom: calc(100% + 7px);
  width: max-content;
  max-width: min(300px, 72vw);
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--ink);
  box-shadow: 0 6px 20px rgba(15, 23, 42, .18);
  color: var(--surface);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-22%, 2px);
  visibility: hidden;
  white-space: normal;
}
.price-help:hover, .price-help:focus { border-color: var(--accent); color: var(--accent-strong); }
.price-help:hover::after, .price-help:focus::after { opacity: 1; transform: translate(-22%, 0); visibility: visible; }
.point-cost { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.point-cost > span { display: inline-flex; align-items: baseline; gap: 4px; }
.point-cost small { color: var(--faint); font-size: 9px; }
.provider-plans { margin-top: 14px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 8px; }
.plan-card { min-height: 92px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.plan-card > span { display: block; color: var(--muted); font-size: 10px; }
.plan-card strong { display: flex; align-items: baseline; gap: 3px; margin-top: 5px; color: var(--ink); font-size: 18px; font-weight: 600; }
.plan-card strong small { color: var(--faint); font-size: 9px; font-weight: 400; }
.plan-card p, .plan-card > small { display: block; margin: 4px 0 0; color: var(--faint); font-size: 9px; line-height: 1.35; }
.credit-card { background: var(--surface-soft); }
.model-prices-cell { min-width: 165px; white-space: normal; }
.model-price-summary { display: grid; gap: 7px; }
.model-price-toggle {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 4px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}
.model-price-toggle:hover { color: var(--accent); }
.model-price-caret { display: inline-block; font-size: 14px; line-height: 1; transition: transform 120ms ease; }
.model-price-toggle.expanded .model-price-caret { transform: rotate(90deg); }
.model-price-list { display: grid; gap: 5px; }
.model-price-list > span { display: grid; grid-template-columns: minmax(78px, auto) 1fr; align-items: start; gap: 8px; }
.model-price-list > span + span { padding-top: 4px; border-top: 1px solid var(--line); }
.modality-icons { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.modality-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
}
.modality-icon.both { border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: var(--accent-soft); color: var(--accent-strong); }
.modality-icon.output { border-style: dashed; color: var(--ink); }
.modality-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.protocol-list { display: flex; flex-wrap: wrap; gap: 4px; min-width: 112px; }
.protocol-badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.2;
  white-space: nowrap;
}
.protocol-badge.default { border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: var(--accent-soft); color: var(--accent-strong); }

.badge, .capability, .modality {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.badge.yes, .capability.yes { background: var(--accent-soft); color: var(--accent-strong); }
.badge.no { background: var(--danger-soft); color: var(--danger); }
.badge.unknown { color: var(--faint); }
.badge.status { background: var(--warn-soft); color: var(--warn); }
.badge-group { display: flex; flex-wrap: wrap; gap: 6px; }

.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; color: var(--muted); font-size: 11px; }
.breadcrumb a:hover { color: var(--accent); }
.detail-title { display: flex; align-items: flex-start; gap: 16px; }
.detail-title code { color: var(--muted); }
.version-switcher { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.version-switcher > span { margin-right: 2px; color: var(--faint); font-size: 10px; }
.version-switcher a { padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 10px; }
.version-switcher a:hover { border-color: var(--accent); color: var(--accent); }
.version-switcher a.active { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }
.provider-breadcrumb { margin-bottom: 8px; }
.provider-heading { align-items: center; margin-bottom: 10px; }
.provider-heading .detail-title { align-items: center; gap: 11px; }
.provider-heading .logo.large { width: 36px; height: 36px; }
.provider-heading .eyebrow { margin-bottom: 2px; font-size: 10px; }
.provider-heading h1 { margin-bottom: 2px; font-size: clamp(22px, 2.3vw, 28px); }
.provider-heading .lead { font-size: 11.5px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.provider-link-list { display: flex; flex-wrap: wrap; gap: 4px 9px; min-width: 150px; }
.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
}
.button-link:hover { border-color: var(--accent); color: var(--accent); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .7fr); gap: 10px; margin-bottom: 18px; }
.provider-overview { margin-bottom: 10px; }
.provider-overview .panel { padding: 9px 12px; }
.provider-overview .field-tree { gap: 2px; }
.provider-overview .field-row { padding: 5px 0; }
.provider-overview .stat { padding: 7px 9px; }
.endpoint-list { display: grid; gap: 3px; }
.endpoint-row { display: grid; grid-template-columns: minmax(132px, .4fr) minmax(0, 1fr); align-items: center; gap: 10px; min-height: 28px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.endpoint-row:last-child { border-bottom: 0; }
.endpoint-row > span { display: flex; align-items: center; gap: 5px; color: var(--ink); font-size: 10.5px; }
.endpoint-row small { padding: 1px 4px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 8.5px; }
.endpoint-row .api-address { overflow: hidden; text-overflow: ellipsis; }
.panel { padding: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 9px; border-radius: 8px; background: var(--surface-soft); }
.stat span { display: block; color: var(--muted); font-size: 11px; }
.stat strong { display: block; margin-top: 2px; font-size: 13px; overflow-wrap: anywhere; }
.section { margin-top: 20px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 12px; }
.section-heading h2 { margin: 0; }
.section-heading span { color: var(--muted); font-size: 12px; }

.field-tree { display: grid; gap: 10px; }
.field-node { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.field-node > summary { cursor: pointer; list-style: none; padding: 8px 10px; background: var(--surface-soft); font-weight: 650; }
.field-node > summary::-webkit-details-marker { display: none; }
.field-node > summary::after { content: "+"; float: right; color: var(--muted); }
.field-node[open] > summary::after { content: "−"; }
.field-children { display: grid; gap: 0; padding: 3px 10px 6px; }
.field-row { display: grid; grid-template-columns: minmax(180px, .48fr) minmax(0, 2fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.field-row:last-child { border-bottom: 0; }
.field-label { min-width: 0; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.field-label strong { flex: 0 0 auto; font-size: 12px; }
.field-label code { min-width: 0; overflow: hidden; color: var(--faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.field-node > summary code { margin-left: 5px; color: var(--faint); font-size: 10px; font-weight: 400; }
.field-row > .field-value:only-child { grid-column: 1 / -1; }
.field-value { overflow-wrap: anywhere; }
.field-value a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.raw-block { overflow: auto; max-height: 560px; margin: 0; padding: 12px; border-radius: 9px; background: #101713; color: #d9e8df; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.tab-strip { display: flex; gap: 5px; margin-bottom: 10px; }
.tab-button { border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; background: var(--surface); color: var(--muted); cursor: pointer; }
.tab-button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.hidden { display: none !important; }

.lab-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.data-card { display: flex; align-items: center; gap: 10px; padding: 12px; transition: transform .16s ease, border-color .16s ease; }
.data-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.data-card strong { display: block; font-size: 15px; }
.data-card span { color: var(--muted); font-size: 12px; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; }
.footer-links a:hover { color: var(--accent); }

@media (max-width: 920px) {
  .header-inner { grid-template-columns: 1fr auto; gap: 10px 18px; padding: 12px 0; }
  .main-nav { justify-self: end; }
  .global-search { grid-column: 1 / -1; justify-self: stretch; width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .lab-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .header-inner, .app-shell, .site-footer { width: calc(100% - 16px); }
  .header-inner { grid-template-columns: 1fr; }
  .brand { justify-self: center; }
  .main-nav { justify-self: stretch; justify-content: center; }
  .main-nav a { flex: 1; text-align: center; }
  .app-shell { padding-top: 20px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .count-note { text-align: left; white-space: normal; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar input, .toolbar select { width: 100%; }
  .detail-title { align-items: center; }
  .field-row { grid-template-columns: 1fr; gap: 5px; }
  .field-label { white-space: normal; }
  .field-label code { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
  .site-footer { flex-direction: column; }
  .footer-links { justify-content: flex-start; }
  .global-search-panel { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 14px; }
  .global-search-footer { display: none; }
}
