/* =========================================================
 * AI Gateway — LAYOUT POLISH (Step 2.7)
 *
 * Unified grid system across ALL sections:
 *   Desktop >= 1200px:
 *     SIDEBAR: 180px, gap: 48px, MAIN: 1180px max
 *     LEFT copy column: 32%, RIGHT body column: 68%, col-gap: 64px
 *
 * LOCKED: data logic, merge, price, API, routing, header, i18n
 * ========================================================= */

/* ---------- Route guard ---------- */
html.ai-gateway-route #root { display: none !important; }
/* NO body overflow rules here — any overflow (incl. overflow-x: hidden)
   on an ancestor breaks position: sticky descendants. Body overflow
   must remain visible so that sticky elements can pin to the viewport. */
html.ai-gateway-route body { background: #FAFAFA; }

#ai-gateway-root {
  position: relative; z-index: 10; min-height: 100vh;
  background: #FAFAFA; display: block;
  /* CRITICAL: overflow must be visible for position: sticky descendants
     to work. If a parent has overflow: auto/hidden/scroll, sticky children
     stick to that parent's scroll container (not the viewport). */
  overflow: visible !important;
}

html.byok-route #root { display: none !important; }
html.byok-route body { background: #FAFAFA; }

#byok-root {
  position: relative; z-index: 10; min-height: 100vh;
  background: #FAFAFA; display: block;
  overflow: visible !important;
}

/* ---------- Loading ---------- */
.ag-loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh; color: #94A3B8; font-size: 14px;
  font-family: 'Inter', sans-serif;
}

/* =========================================================
 * GLOBAL LAYOUT SYSTEM
 * ========================================================= */
.ag-main {
  display: grid;
  grid-template-columns: 180px 1fr;
  column-gap: 48px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 56px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #111827;
  background: #FAFAFA;
  font-feature-settings: 'tnum', 'ss01';
  overflow-x: clip;}

.ag-main__content {
  min-width: 0;
  max-width: 1180px;
  padding-top: 0;
}

/* ---------- UNIFIED SECTION SYSTEM (01–06 ALL vertical layout) ---------- */
.ag-section {
  display: block;
  padding: 72px 0;
  border-top: 1px solid #EAEAEA;
  scroll-margin-top: 80px;
  width: 100%;
}

.ag-overview { border-top: none; padding-top: 72px; }

.ag-section:last-of-type { border-bottom: 1px solid #EAEAEA; }

/* Copy block (header: number → eyebrow → title → desc) — full width, NO max-width constraint */
.ag-section__copy {
  width: 100%;
  max-width: none;
  margin-bottom: 28px;
}

/* Body block (functional content below header) — full width */
.ag-section__body {
  width: 100%;
  min-width: 0;
  overflow-x: visible;  /* desktop: no horizontal scroll */
}

/* ---------- Global Section Typography (01–06 LOCKED) ---------- */
.ag-section__number {
  font-size: 12px; font-weight: 600; color: #B8C1D1;
  line-height: 1.4; margin-bottom: 0;
}

.ag-section__eyebrow {
  font-size: 14px; font-weight: 600; color: #111827;
  line-height: 1.4; text-transform: none;
  margin-top: 4px; margin-bottom: 0;
}

.ag-section__title {
  font-size: 30px; font-weight: 700;
  line-height: 1.15; letter-spacing: -0.025em;
  color: #111827; margin: 16px 0 0 0;
  max-width: none;  /* full width available — no 420px limit */
}

.ag-section__title .ag-hl { color: #111827; }

.ag-section__desc {
  font-size: 15px; line-height: 1.6; color: #475569;
  margin: 12px 0 0 0; white-space: pre-line; max-width: 720px;
  }

/* =========================================================
 * SIDEBAR — 180px, sticky top 64px (viewport-pinned while body scrolls)
 * ========================================================= */
.ag-sidebar {
  position: sticky !important; top: 64px;
  align-self: flex-start;
    width: 180px; height: calc(100vh - 64px);
  padding: 48px 0 48px 0;
  overflow-y: auto; overflow-x: hidden; background: #FAFAFA;
  /* overflow-x:hidden prevents horizontal scrollbar from active item's negative margin-right: -12px */
  /* 
     Why position: sticky + !important:
     - We want the sidebar pinned at top:64px throughout the page scroll.
     - Sticky on a grid child works IF the grid container (.ag-main) does not 
       clip the sidebar (it doesn't — overflow visible).
     - !important overrides any accidental cascade from React's bundled CSS.
     - height: calc(100vh - 64px) ensures the sidebar occupies the full 
       remaining viewport height, so the sticky element stays pinned from 
       first scroll to last.
  */
}

.ag-sb__title {
  font-size: 13px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: #94A3B8;
  padding-left: 14px;
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid #EAEAEA;
}

.ag-sb__nav { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; }

.ag-sb__item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  width: 100%; box-sizing: border-box;
  min-height: 42px;
  font-size: 14px; line-height: 1.25;
  font-weight: 500; color: #64748B;
  text-decoration: none; border-left: 2px solid transparent;
  transition: all 0.12s ease;
}

.ag-sb__item:hover { color: #111827; }

  .ag-sb__item.is-active {
  background: transparent; color: #111827;
  border-left-color: transparent;
}

  .ag-sb__item.is-active::before {
  content: '';
  position: absolute;
  left: -14px; right: 0px;
  top: 0; bottom: 0;
  background: #FEF9E7;
  border-radius: 6px;
  border-left: 2px solid #F5B800;
  z-index: 0;
  pointer-events: none;
}

.ag-sb__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex-shrink: 0;
  position: relative; z-index: 1;
  color: #64748B;
}

.ag-sb__icon svg {
  width: 100%; height: 100%; display: block;
}

.ag-sb__item.is-active .ag-sb__icon { color: #B45309; }

/* =========================================================
 * BADGE — KEEP (used by Final CTA)
 * ========================================================= */
.ag-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; background: #FFFBEB;
  border: 0.67px solid #FDE68A; border-radius: 20px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: #B45309;
  margin-bottom: 20px;
}

.ag-badge__dot { color: #F5B800; animation: agPulse 2.2s ease-in-out infinite; }

@keyframes agPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* =========================================================
 * OVERVIEW — Compact single-column (Hero + Models full-width)
 * ========================================================= */
.ag-overview {
  border-top: none;
  padding-top: 72px;
  padding-bottom: 0;
  display: block;  /* no more grid split */
  min-height: 0;
}

/* Hero block */
.ag-overview__hero {
  max-width: none;  /* full main content width */
  padding-bottom: 48px;
  margin-bottom: 0;
}

/* Eyebrow — DEAD CLASS (removed from DOM) */
.ag-overview__eyebrow { display: none; }

/* H1 starts at top of Hero (no eyebrow above) */
.ag-overview__h1 { margin-top: 0; }

/* H1 — compact developer style, allows natural wrap on narrow viewports */
.ag-overview__h1 {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #111827;
  margin: 0;
  white-space: normal;
}

.ag-overview__h1 .ag-hl { color: #111827; }

/* Description — full width, no max-width limit for text block */
.ag-overview__desc {
  font-size: 16px; line-height: 1.6; color: #475569;
  margin: 18px 0 0 0;
  max-width: 760px;
}

/* ---------- Buttons — KEEP (used elsewhere) ---------- */
.ag-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; font-size: 14px; font-weight: 600;
  border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: all 0.15s ease; white-space: nowrap;
}

.ag-btn--primary { background: #F5B800; color: #111827; border-color: #F5B800; }
.ag-btn--primary:hover { background: #E6A900; border-color: #E6A900; }

.ag-btn--secondary { background: #FFFFFF; border-color: #E2E8F0; color: #334155; }
.ag-btn--secondary:hover { background: #F8FAFC; border-color: #CBD5E1; }

/* ---------- Facts — KEEP (just dead CSS, no longer rendered) ---------- */
.ag-facts {
  display: flex; gap: 32px; flex-wrap: wrap;
  padding-top: 24px; margin-top: 32px;
  border-top: 1px solid #EAEAEA;
}

.ag-fact__num {
  font-size: 22px; font-weight: 800; color: #111827;
  letter-spacing: -0.02em; margin-bottom: 2px;
}

.ag-fact__num--yellow {
  color: #F5B800; font-size: 16px; letter-spacing: 0.04em;
}

.ag-fact__label {
  font-size: 12px; font-weight: 500; color: #94A3B8; letter-spacing: 0.03em;
}

/* ---------- Available Models (table, full-width below Hero) ---------- */
.ag-overview__models {
  border-top: 1px solid #EAEAEA;
  padding-top: 32px;
  margin-top: 0;
  width: 100%;
}

.ag-overview__table-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.ag-overview__table-head h3 {
  font-size: 14px; font-weight: 600; color: #111827; margin: 0;
}

.ag-link {
  font-size: 13px; font-weight: 500; color: #111827;
  text-decoration: none; border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.ag-link:hover { border-bottom-color: #F5B800; }

/* =========================================================
 * TABLES (shared)
 * ========================================================= */
.ag-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: #FFFFFF; border: 1px solid #EAEAEA; border-radius: 8px; overflow: hidden;
}

.ag-table thead tr { background: #F8FAFC; }

.ag-table th {
  padding: 14px 16px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: #94A3B8;
  text-align: left; border-bottom: 1px solid #EAEAEA; background: #F8FAFC;
  height: 52px;
}

.ag-table td {
  padding: 16px; font-size: 13px; color: #334155;
  border-bottom: 1px solid #F1F5F9; vertical-align: middle;
  height: 56px;
}

.ag-table tbody tr:last-child td { border-bottom: none; }
.ag-table tbody tr:hover { background: #FAFBFC; }

/* Providers table (more compact) */
.ag-table.ag-table--compact td { height: 50px; padding: 12px 16px; }
.ag-table.ag-table--compact th { height: 46px; }

.ag-table__cell--model .ag-model-name { font-weight: 600; color: #111827; }
.ag-table__cell--num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.ag-table__cell--bold { font-weight: 600; color: #111827; }
.ag-table__cell--examples { color: #64748B; font-size: 12.5px; }

/* ---------- Tags ---------- */
.ag-tag {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.ag-tag--green { background: #F0FDF4; color: #15803D; }
.ag-tag--yellow { background: #FEF9E7; color: #B45309; }
.ag-tag--gray { background: #F1F5F9; color: #94A3B8; }

/* =========================================================
 * OPENAI COMPATIBLE — Right internal split 68/32 (stays INSIDE body block, vertical at section level)
 * ========================================================= */
.ag-opencol {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  align-items: stretch;
}

.ag-opencol .ag-code {
  margin-bottom: 20px;
}

.ag-code {
  display: flex; flex-direction: column;
  background: #1E293B; border-radius: 8px; overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}

.ag-code__header {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 14px; background: #0F172A; border-bottom: 1px solid #334155;
}

.ag-code__tab {
  padding: 6px 12px; font-size: 11px; font-weight: 600;
  color: #94A3B8; background: transparent; border: none;
  border-radius: 4px; cursor: pointer; letter-spacing: 0.02em; transition: all 0.12s;
}
.ag-code__tab:hover { color: #E2E8F0; background: #1E293B; }
.ag-code__tab.is-active { color: #F5B800; background: #1E293B; }

.ag-code__pre {
  margin: 0; padding: 16px 18px;
  overflow: auto; flex: 1;
  line-height: 1.65; color: #E2E8F0; background: #1E293B;
}

.ag-code__pre code { font-family: inherit; white-space: pre; }

.ag-code__footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #0F172A; border-top: 1px solid #334155;
}

.ag-code__copy {
  padding: 4px 12px; font-size: 11px; font-weight: 600;
  color: #94A3B8; background: transparent; border: 1px solid #334155;
  border-radius: 4px; cursor: pointer; transition: all 0.12s;
}
.ag-code__copy:hover { color: #F5B800; border-color: #F5B800; }

/* ---------- Request Panel ---------- */
.ag-reqpanel {
  background: #FFFFFF; border: 1px solid #EAEAEA; border-radius: 8px;
  display: flex; flex-direction: column; overflow: hidden;
}

.ag-reqpanel__tabs {
  display: flex; background: #F8FAFC; border-bottom: 1px solid #EAEAEA;
}

.ag-reqpanel__tab {
  flex: 1; padding: 9px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; color: #94A3B8;
  background: transparent; border: none; border-bottom: 2px solid transparent; cursor: pointer;
}
.ag-reqpanel__tab.is-active { color: #111827; border-bottom-color: #F5B800; }

.ag-reqpanel__body { padding: 14px 16px; }

.ag-reqpanel__row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 0; border-bottom: 1px solid #F1F5F9;
}
.ag-reqpanel__row:last-child { border-bottom: none; }

.ag-reqpanel__key {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: #94A3B8;
}

.ag-reqpanel__val {
  font-family: ui-monospace, monospace; font-size: 12.5px; color: #111827;
}

/* =========================================================
 * SCATTER PLOT — compact, 420px chart
 * ========================================================= */
.ag-scatter {
  background: #FFFFFF; border: 1px solid #EAEAEA; border-radius: 8px;
  padding: 24px;
}

.ag-scatter__filter {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 0; flex-wrap: wrap;
}

.ag-scatter__filter-group { display: flex; flex-wrap: wrap; gap: 6px; }

.ag-scatter__filter-btn {
  height: 30px; padding: 0 12px;
  font-size: 12px; font-weight: 500; color: #64748B;
  background: #F1F5F9; border: 1px solid transparent;
  border-radius: 6px; cursor: pointer; transition: all 0.12s;
}
.ag-scatter__filter-btn:hover { color: #111827; background: #E2E8F0; }
.ag-scatter__filter-btn.is-active { background: #F5B800; color: #111827; border-color: #F5B800; }

.ag-scatter__search { position: relative; display: flex; align-items: center; }
.ag-scatter__search svg { position: absolute; left: 10px; color: #94A3B8; }

.ag-scatter__search input {
  width: 220px; height: 32px;
  padding: 0 10px 0 30px; font-size: 12px; color: #334155;
  background: #F8FAFC; border: 1px solid #EAEAEA;
  border-radius: 6px; outline: none; transition: border-color 0.12s;
  margin-top: 14px;
}
.ag-scatter__search input:focus { border-color: #F5B800; }

.ag-scatter__chart { margin-top: 24px; height: 420px; }
.ag-scatter__chart svg { width: 100%; height: 100%; display: block; }

/* Override point size from JS-rendered r=4 to larger */
.ag-scatter__chart svg circle.ag-scatter__point {
  r: 5.5px !important;
}
.ag-scatter__chart svg circle.ag-scatter__point:hover {
  r: 8px !important;
}

.ag-scatter__tooltip {
  position: absolute; z-index: 100; min-width: 160px;
  background: #111827; color: #FFFFFF; padding: 10px 14px;
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  font-size: 12px; pointer-events: none;
}

.ag-scatter__tip-name { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.ag-scatter__tip-provider { font-size: 11px; color: #94A3B8; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.ag-scatter__tip-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; font-size: 11.5px; }
.ag-scatter__tip-row span { color: #94A3B8; }
.ag-scatter__tip-row strong { font-family: ui-monospace, monospace; font-weight: 600; color: #FFFFFF; }

.ag-scatter__legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  padding: 14px 4px 0; font-size: 11px; color: #64748B;
}
.ag-scatter__legend-item { display: flex; align-items: center; gap: 6px; }
.ag-scatter__swatch { width: 10px; height: 10px; border-radius: 50%; }

.ag-scatter__omitted {
  margin-top: 12px; font-size: 11px; color: #9A9A9A;
  padding-top: 12px; border-top: 1px dashed #EAEAEA;
}

/* =========================================================
 * BYOK — UNIFIED 32/68, no yellow side card
 * ========================================================= */
.ag-byok-right {
  display: flex; flex-direction: column; gap: 0;
}

.ag-byok-feat {
  padding: 14px 0; border-top: 1px solid #EAEAEA;
}
.ag-byok-feat:first-child { border-top: none; padding-top: 4px; }

.ag-byok-feat h3 {
  font-size: 14px; font-weight: 700; color: #111827; margin: 0 0 4px 0;
}

.ag-byok-feat p {
  font-size: 13px; color: #64748B; margin: 0; line-height: 1.6; max-width: 560px;
}

.ag-byok-inline-cta {
  margin-top: 28px; padding-top: 24px;
  border-top: 1px solid #EAEAEA;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.ag-byok-inline-cta span {
  font-size: 14px; color: #475569; font-weight: 500;
}

/* =========================================================
 * DEVELOPER CONTROL — UNIFIED 32/68, rows with dividers
 * ========================================================= */
.ag-dev-items { display: flex; flex-direction: column; }

.ag-dev-item {
  display: grid; grid-template-columns: 48px 220px 1fr;
  gap: 24px; align-items: start;
  min-height: 72px; padding: 18px 0;
  border-bottom: 1px solid #EAEAEA;
}
.ag-dev-item:last-child { border-bottom: none; }

.ag-dev-num {
  font-size: 14px; font-weight: 800; color: #CBD5E1;
  font-family: 'Inter', monospace; letter-spacing: 0.05em; padding-top: 2px;
}

.ag-dev-item h3 {
  font-size: 15px; font-weight: 700; color: #111827; margin: 2px 0 4px 0; line-height: 1.35;
}

.ag-dev-item p {
  font-size: 13.5px; color: #64748B; margin: 0; line-height: 1.6; padding-top: 2px;
}

/* =========================================================
 * SECTION 01 MODEL COVERAGE — table-specific overrides
 * Global typography/layout now applies to ALL sections (see above).
 * Only table-specific rules remain here.
 * ========================================================= */

/* Table — full width, no horizontal overflow on desktop */
.ag-section#model-coverage .ag-table {
  width: 100%;
  table-layout: fixed;  /* prevents column push-out from causing parent overflow */
}

/* Action column — "View models →" single line */
.ag-section#model-coverage .ag-table__cell--action,
.ag-section#model-coverage td:last-child,
.ag-section#model-coverage th:last-child {
  min-width: 100px;
  white-space: nowrap;
}

/* Mobile/Tablet — table wrapper allows scroll */
@media (max-width: 1023px) {
  .ag-section#model-coverage .ag-section__body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ag-section#model-coverage .ag-table { table-layout: auto; min-width: 700px; }
}

/* Chevron — idempotent single 12px, 1.6 stroke */
.ag-nav-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px; height: 12px;
  margin-left: 5px;
  color: inherit;
  transition: transform 120ms ease;
  pointer-events: none;
}
.ag-nav-chevron svg { width: 12px; height: 12px; display: block; }
.nav.nav-link.is-open .ag-nav-chevron,
nav.nav a.nav-link.is-open .ag-nav-chevron { transform: rotate(180deg); }

/* Dropdown panel — 285px, 10px radius, 8px pad */
.ag-pd {
  position: fixed; z-index: 9999;
  width: 285px; max-width: 285px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
  padding: 8px;
  opacity: 0; visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 0s linear 120ms;
  font-family: 'Inter', -apple-system, sans-serif;
}
.ag-pd.is-open {
  opacity: 1; visibility: visible;
  transform: translateY(0);
  transition: opacity 120ms ease, transform 120ms ease;
}

/* Each item — tight row, 6px radius ONLY on hover */
.ag-pd-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
  padding: 8px 10px;
  min-height: 50px;
  border-radius: 6px;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  color: inherit;
  transition: background-color 100ms ease;
}
.ag-pd-item:hover { background-color: #F7F7F7; }

/* Disabled (BYOK/Agents/Skills/Knowledge — no href yet) */
.ag-pd-item--disabled { cursor: default; }
.ag-pd-item--disabled:hover { background-color: #F7F7F7; }  /* still visually normal, readable */

/* Icon column — 18px col, 16px svg, NO bg/radius/border */
.ag-pd-item__icon {
  width: 18px; height: 18px;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  color: #737A86;
  background: transparent;
}
.ag-pd-item__icon svg { width: 16px; height: 16px; display: block; }

/* Text content */
.ag-pd-item__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ag-pd-item__name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ag-pd-item__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: #181818;
}
.ag-pd-item__desc {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  color: #858585;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* --- ACTIVE state (AI Gateway) — ONLY yellow icon, NO bg/border --- */
.ag-pd-item--active {
  background: transparent;
  border: none;
  border-radius: 6px;  /* same as normal — hover gets subtle radius */
}
.ag-pd-item--active:hover { background-color: #F7F7F7; }  /* same hover as others */
.ag-pd-item--active .ag-pd-item__icon { color: #B77900; }
.ag-pd-item--active .ag-pd-item__name { color: #181818; }  /* NOT yellow — same as others */

/* =========================================================
 * RESPONSIVE
 * ========================================================= */
@media (max-width: 1200px) {
  .ag-main { padding: 0 32px; column-gap: 32px; }
}

@media (max-width: 1024px) {
  .ag-main {
    grid-template-columns: 1fr;
    padding: 0 24px;
  }
  .ag-sidebar {
    position: static; width: 100%; height: auto;
    padding: 24px 0 16px; overflow: visible;
    border-bottom: 1px solid #EAEAEA;
  }
  .ag-sb__nav {
    flex-direction: row; flex-wrap: nowrap;
    gap: 4px; min-width: max-content; overflow-x: auto;
    scrollbar-width: none; padding-bottom: 4px;
  }
  .ag-sb__nav::-webkit-scrollbar { display: none; }
  .ag-sb__item { flex-shrink: 0; padding: 6px 12px; font-size: 13px; min-height: 36px; }
  .ag-sb__item.is-active { padding-left: 12px; padding-right: 12px; margin-left: 0; margin-right: 0; border-radius: 6px; }
  .ag-sb__title { display: none; }

  .ag-main__content { padding-top: 24px; }
  .ag-section, .ag-overview {
    padding: 48px 0;
  }
  /* Section title tablet font-size */
  .ag-section__title { font-size: 28px; }

  .ag-byok-right { flex-direction: column; }
  .ag-dev-item { grid-template-columns: 40px 1fr; gap: 16px; }
  .ag-dev-item h3 { grid-column: 2; }
  .ag-dev-item p { grid-column: 2; }

  /* Tablet H1 — allow wrap (no longer single-line) */
  .ag-overview__h1 { font-size: 28px; white-space: normal; letter-spacing: -0.025em; }
}

@media (max-width: 768px) {
  .ag-main { padding: 0 16px; }
  .ag-main__content { padding-top: 20px; }
  .ag-section, .ag-overview { padding: 36px 0; }

  .ag-overview__h1 { font-size: 26px; white-space: normal; letter-spacing: -0.02em; }
  .ag-section__title { font-size: 26px; }
  .ag-overview__desc { font-size: 16px; }
  .ag-section__desc { font-size: 15px; max-width: none; }

  .ag-overview__models, .ag-section__body {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    margin: 0 -16px; padding: 0 16px;
  }
  .ag-table { font-size: 12px; min-width: 580px; }
  .ag-table th, .ag-table td { padding: 10px 12px; height: auto; }

  .ag-facts { gap: 20px 24px; }

  .ag-byok-inline-cta {
    flex-direction: column; align-items: flex-start;
    gap: 12px;
  }

  .ag-scatter { padding: 16px; }
  .ag-scatter__chart { height: 340px; }
  .ag-scatter__search input { width: 100%; }
  .ag-scatter__filter { flex-direction: column; align-items: flex-start; }

  /* Products dropdown v4 — mobile */
  .ag-pd { width: calc(100vw - 24px); max-width: 285px; padding: 6px; left: 12px !important; right: 12px; }
  .ag-pd-item { grid-template-columns: 16px minmax(0,1fr); padding: 7px 8px; min-height: 46px; column-gap: 8px; }
  .ag-pd-item__icon { width: 16px; height: 16px; }
  .ag-pd-item__icon svg { width: 14px; height: 14px; }
  .ag-pd-item__name { font-size: 12px; }
  .ag-pd-item__desc { font-size: 10px; }

  .ag-code { min-height: 320px; }
  .ag-code__pre { font-size: 11.5px; padding: 14px 16px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ag-sb__item, .ag-btn, .ag-badge__dot {
    transition: none !important; animation: none !important;
  }
}

/* =========================================================
 * STEP 2.7 — AI GATEWAY PAGE GRID
 * Route-scoped overrides. These do not affect the shared product-page CSS
 * used by BYOK, Agents, Skills, or Knowledge.
 * ========================================================= */
@media (min-width: 1025px) {
  #ai-gateway-root .ag-main {
    width: min(100%, 1440px);
    max-width: 1440px;
    box-sizing: border-box;
    grid-template-columns: 180px minmax(0, 1fr);
    column-gap: 48px;
    padding-inline: 32px;
  }

  #ai-gateway-root .ag-main__content { max-width: 1180px; min-width: 0; }

  #ai-gateway-root .ag-sidebar { padding-top: 72px; }

  /* Sections 01-06: DEFAULT CSS already vertical (display:block, 100% width).
     No grid overrides here — Main Content is FULL-WIDTH vertical sections.
     The ONLY left/right grid remaining is .ag-main (180px sidebar + content). */

  #ai-gateway-root .ag-section__number { font-size: 11px; }
  #ai-gateway-root .ag-section__eyebrow { margin: 4px 0 24px; font-size: 13px; }

  #ai-gateway-root .ag-opencol {
    gap: 20px;
  }
  #ai-gateway-root .ag-code, #ai-gateway-root .ag-reqpanel { }
  #ai-gateway-root .ag-reqpanel__body { padding: 16px; }
  #ai-gateway-root .ag-reqpanel__row { padding-block: 10px; gap: 12px; }
  #ai-gateway-root .ag-reqpanel__val { overflow-wrap: anywhere; text-align: left; }

  #ai-gateway-root .ag-scatter { padding: 24px; }
  #ai-gateway-root .ag-scatter__filter { flex-wrap: nowrap; gap: 12px; }
  #ai-gateway-root .ag-scatter__filter-group { gap: 6px; }
  #ai-gateway-root .ag-scatter__search input { margin-top: 0; }
  #ai-gateway-root .ag-scatter__chart { height: 420px; margin-top: 24px; }
  #ai-gateway-root .ag-scatter__chart svg { width: 100%; height: 100%; }

  #ai-gateway-root .ag-table.ag-table--compact td { height: 50px; }
  #ai-gateway-root .ag-byok-feat { padding-block: 16px; }

  #ai-gateway-root .ag-dev-item {
    grid-template-columns: 48px 220px minmax(0, 1fr);
    min-height: 72px;
  }
}

@media (min-width: 1200px) {
  #ai-gateway-root .ag-main { padding-inline: 0; }
}

@media (max-width: 1024px) {
  #ai-gateway-root .ag-main__content { padding-top: 24px; }
  #ai-gateway-root .ag-section__copy { margin-bottom: 28px; }
}

@media (max-width: 767px) {
  #ai-gateway-root .ag-section__copy { margin-bottom: 32px; }
}


  .ag-sb__item > span:last-child { position: relative; z-index: 1; }


  /* OpenAI Compatible description — single line on desktop only */
  #openai-compatible .ag-section__desc { white-space: nowrap; }
  @media (max-width: 1024px) {
    #openai-compatible .ag-section__desc { white-space: normal; }
  }


/* =========================================================
 * Model Explorer v2 — deployed 20260926-172303
 * ========================================================= */
/* =========================================================
 * AI Gateway — Model Explorer v2 CSS
 * Appended to ai-gateway-page.css — scoped under .ag-scatter-v2__
 * BeeCore visual system: Inter, white panels, #FAFAFA bg,
 * #EAEAEA borders, #111827 text, #737373 secondary,
 * #F5B800 accent.
 * ========================================================= */

/* ---------- Controls row ---------- */
.ag-scatter-v2__controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 0 4px;
}

.ag-scatter-v2__ctrl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.ag-scatter-v2__ctrl-label {
  font-size: 11px;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ag-scatter-v2__select {
  height: 34px;
  padding: 0 28px 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: #111827;
  background: #fff;
  border: 1px solid #EAEAEA;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.12s;
}

.ag-scatter-v2__select:hover { border-color: #D4D4D4; }
.ag-scatter-v2__select:focus { border-color: #F5B800; }

/* Provider filter — reuse .ag-scatter__filter-btn but wrap */
.ag-scatter-v2__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}

.ag-scatter-v2__search {
  position: relative;
  display: flex;
  align-items: center;
}

.ag-scatter-v2__search svg {
  position: absolute;
  left: 10px;
  color: #9CA3AF;
  pointer-events: none;
}

.ag-scatter-v2__search input {
  width: 220px;
  height: 34px;
  padding: 0 12px 0 30px;
  font-size: 12.5px;
  color: #374151;
  background: #fff;
  border: 1px solid #EAEAEA;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.12s;
}
.ag-scatter-v2__search input::placeholder { color: #9CA3AF; }
.ag-scatter-v2__search input:focus { border-color: #F5B800; }

/* ---------- Chart panel ---------- */
.ag-scatter-v2__chart {
  margin-top: 20px;
  width: 100%;
  height: 520px;
  background: #fff;
  border: 1px solid #EAEAEA;
  border-radius: 8px;
  overflow: hidden;
}

.ag-scatter-v2__chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Point interaction */
.ag-scatter-v2__chart circle {
  transition: r 0.12s, opacity 0.12s;
}
.ag-scatter-v2__chart circle:hover,
.ag-scatter-v2__chart circle:focus {
  r: 7.5px;
  opacity: 1;
}

/* ---------- Tooltip (white BeeCore style) ---------- */
.ag-scatter-v2__tooltip {
  position: absolute;
  z-index: 100;
  min-width: 180px;
  background: #fff;
  border: 1px solid #EAEAEA;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
  padding: 12px 14px;
  font-size: 12px;
  pointer-events: none;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ag-scatter-v2__tip-name {
  font-weight: 700;
  font-size: 13px;
  color: #111827;
  margin-bottom: 1px;
}

.ag-scatter-v2__tip-provider {
  font-size: 10.5px;
  color: #9CA3AF;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.ag-scatter-v2__tip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 0;
  font-size: 11.5px;
  line-height: 1.4;
}

.ag-scatter-v2__tip-row span { color: #6B7280; }
.ag-scatter-v2__tip-row strong {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600;
  color: #111827;
}

/* ---------- Legend ---------- */
.ag-scatter-v2__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 2px 0;
  font-size: 11px;
  color: #6B7280;
}

.ag-scatter-v2__legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ag-scatter-v2__swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.8);
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.08);
}

/* ---------- Omitted count ---------- */
.ag-scatter-v2__omitted {
  margin-top: 14px;
  font-size: 11.5px;
  color: #9CA3AF;
  padding-top: 14px;
  border-top: 1px dashed #EAEAEA;
  line-height: 1.5;
}

/* ---------- Model data list header ---------- */
.ag-scatter-v2__list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 36px;
  padding-bottom: 12px;
  border-bottom: 1px solid #EAEAEA;
}

.ag-scatter-v2__list-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.ag-scatter-v2__list-title-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: #F3F4F6;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 700;
  color: #374151;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.ag-scatter-v2__list-title-text {
  color: #111827;
}

.ag-scatter-v2__sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ag-scatter-v2__sort-label {
  font-size: 11px;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ag-scatter-v2__sort-select {
  height: 30px;
  padding: 0 26px 0 10px;
  font-size: 12px;
  font-weight: 500;
  color: #111827;
  background: #fff;
  border: 1px solid #EAEAEA;
  border-radius: 5px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.ag-scatter-v2__sort-select:hover { border-color: #D4D4D4; }
.ag-scatter-v2__sort-select:focus { border-color: #F5B800; }

/* ---------- Model data list (2-column desktop) ---------- */
.ag-scatter-v2__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-top: 4px;
  padding: 0;
}

.ag-scatter-v2__list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #F1F1F1;
  transition: background-color 0.12s;
  gap: 12px;
}

.ag-scatter-v2__list-item:hover {
  background: #FAFAFA;
}

.ag-scatter-v2__li-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.ag-scatter-v2__li-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ag-scatter-v2__li-text {
  min-width: 0;
}

.ag-scatter-v2__li-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ag-scatter-v2__li-provider {
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 2px;
}

.ag-scatter-v2__li-vals {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}

.ag-scatter-v2__li-val {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  min-width: 70px;
}

.ag-scatter-v2__li-val-label {
  font-size: 9.5px;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ag-scatter-v2__li-val strong {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
}

.ag-scatter-v2__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px;
  font-size: 13px;
  color: #9CA3AF;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .ag-scatter-v2__list { grid-template-columns: repeat(2, 1fr); }
  .ag-scatter-v2__chart { height: 420px; }
  .ag-scatter-v2__search input { width: 180px; }
}

@media (max-width: 640px) {
  .ag-scatter-v2__controls { gap: 12px; }
  .ag-scatter-v2__ctrl { flex: 1; min-width: 0; }
  .ag-scatter-v2__select { width: 100%; }
  .ag-scatter-v2__filters { flex-basis: 100%; }
  .ag-scatter-v2__search { flex-basis: 100%; }
  .ag-scatter-v2__search input { width: 100%; }
  .ag-scatter-v2__chart { height: 340px; }
  .ag-scatter-v2__list { grid-template-columns: 1fr; }
  .ag-scatter-v2__list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .ag-scatter-v2__list-item { padding: 12px 4px; }
  .ag-scatter-v2__li-vals { gap: 14px; }
  .ag-scatter-v2__li-val { min-width: 60px; }
}



/* ============================================================
 * Model Explorer v3 — visual overhaul (append-only, scoped)
 * ============================================================ */

.ag-scatter-v2__chart {
  position: relative;
  background: #FFFFFF;
  border: 1px solid #EAEAEA;
  border-radius: 8px;
  padding: 0;
  margin-top: 24px;
  height: 460px;
  overflow: hidden;
}
.ag-scatter-v2__chart svg {
  width: 100%;
  height: calc(100% - 48px);
  display: block;
}
.ag-scatter-v2__chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #F0F0F0;
  height: 48px;
  box-sizing: border-box;
  background: #FAFAFA;
}
.ag-scatter-v2__chart-count {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #6B7280;
  text-transform: uppercase;
  font-family: Inter, -apple-system, sans-serif;
}
.ag-scatter-v2__chart-find {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ag-scatter-v2__find-label {
  font-size: 12px;
  color: #6B7280;
  font-weight: 500;
}
.ag-scatter-v2__find-select {
  appearance: none;
  background: #FFFFFF;
  border: 1px solid #D4D4D4;
  border-radius: 6px;
  padding: 4px 28px 4px 10px;
  font-size: 12px;
  color: #111827;
  font-family: Inter, -apple-system, sans-serif;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 14px;
  min-width: 180px;
}
.ag-scatter-v2__find-select:hover { border-color: #D4D4D4; }
.ag-scatter-v2__find-select:focus { outline: none; border-color: #F5B800; }
.ag-scatter-v2__controls {
  display: flex;
  gap: 12px;
  align-items: center;
  position: relative;
}
.ag-scatter-v2__ctrl {
  flex: 0 0 auto;
}
.ag-scatter-v2__select--axis {
  min-width: 180px;
}
.ag-scatter-v2__search {
  position: relative;
  margin-left: auto;
}
.ag-scatter-v2__filters { display: none !important; }
.ag-scatter-v2__ctrl-label { display: none !important; }
.ag-scatter-v2__chart circle.is-selected {
  filter: drop-shadow(0 0 4px rgba(245, 184, 0, 0.8));
}
.ag-scatter-v2__legend-item {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}
.ag-scatter-v2__legend-item:hover { opacity: 0.7; }
.ag-scatter-v2__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  margin-top: 8px;
}
.ag-scatter-v2__list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #EAEAEA;
  border-radius: 8px;
  background: #FFFFFF;
  transition: border-color 0.15s, background 0.15s;
}
.ag-scatter-v2__list-item:hover {
  border-color: #D4D4D4;
  background: #FAFAFA;
}
.ag-scatter-v2__li-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.ag-scatter-v2__li-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ag-scatter-v2__li-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ag-scatter-v2__li-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ag-scatter-v2__li-provider {
  font-size: 11px;
  color: #9CA3AF;
}
.ag-scatter-v2__li-vals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 12px;
}
.ag-scatter-v2__li-val {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.ag-scatter-v2__li-val-label {
  font-size: 10px;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ag-scatter-v2__li-val strong {
  font-size: 12px;
  color: #111827;
  font-family: ui-monospace, monospace;
  font-weight: 600;
}
.ag-scatter-v2__toggle-btn {
  grid-column: 1 / -1;
  width: 100%;
  padding: 10px 16px;
  border: 1px dashed #D4D4D4;
  border-radius: 8px;
  background: transparent;
  color: #6B7280;
  font-size: 13px;
  font-family: Inter, -apple-system, sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.ag-scatter-v2__toggle-btn:hover {
  border-color: #9CA3AF;
  color: #111827;
}
@media (max-width: 900px) {
  .ag-scatter-v2__list { grid-template-columns: 1fr; }
  .ag-scatter-v2__chart { height: 400px; }
  .ag-scatter-v2__find-select { min-width: 140px; }
  .ag-scatter-v2__chart-header { padding: 10px 14px; }
}
@media (max-width: 640px) {
  .ag-scatter-v2__controls { flex-wrap: wrap; gap: 8px; }
  .ag-scatter-v2__search { margin-left: 0; width: 100%; order: 3; }
  .ag-scatter-v2__chart { height: 360px; }
  .ag-scatter-v2__chart-header { flex-direction: column; align-items: flex-start; gap: 6px; height: auto; padding: 10px 14px; }
  .ag-scatter-v2__chart-count { font-size: 10px; }
}


/* ============================================================
 * Image1 match — Model Explorer v3 visual fix
 * Gaps fixed: legend inside chart, unified list container, row dividers,
 *             hidden sort, compact price format, no uppercase labels
 * ============================================================ */

/* --- 1. Hide list-header (contains title + sort — both NOT in image1) --- */
.ag-scatter-v2__list-header {
  display: none !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* --- 2. Legend + omitted now live INSIDE chartPanel — give them padding --- */
.ag-scatter-v2__chart .ag-scatter-v2__legend {
  padding: 10px 20px 6px;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 12px;
  border-top: 1px solid #F0F0F0;
  margin-top: auto;
}
.ag-scatter-v2__chart .ag-scatter-v2__omitted {
  padding: 2px 20px 10px;
  font-size: 11px;
  color: #9CA3AF;
  text-align: left;
}

/* --- 3. Unified model list container (one white card, not independent item cards) --- */
.ag-scatter-v2__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid #EAEAEA;
  border-radius: 8px;
  background: #FFFFFF;
  overflow: hidden;
  margin-top: 16px;
}

/* --- 4. List items → borderless rows with thin bottom divider --- */
.ag-scatter-v2__list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: none !important;
  border-bottom: 1px solid #F0F0F0;
  border-radius: 0 !important;
  background: transparent !important;
  transition: background 0.1s;
}
.ag-scatter-v2__list-item:hover {
  background: #FAFAFA;
  border-color: #F0F0F0 !important;
}
/* Last row of each column: no bottom border */
.ag-scatter-v2__list > .ag-scatter-v2__list-item:nth-last-child(-n+2) {
  border-bottom: none;
}
/* After Show more button: no border on preceding item's last-child rule */

/* --- 5. Price values — compact, no uppercase labels --- */
.ag-scatter-v2__li-vals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
  margin-left: 12px;
}
.ag-scatter-v2__li-val {
  display: flex;
  align-items: baseline;
}
.ag-scatter-v2__li-val strong {
  font-size: 13px;
  font-family: ui-monospace, monospace;
  font-weight: 600;
  color: #111827;
}
.ag-scatter-v2__li-sub {
  font-size: 11px;
  color: #9CA3AF;
  font-family: ui-monospace, monospace;
}
/* Hide old uppercase label spans (they remain in DOM via JS but have no text now) */
.ag-scatter-v2__li-val-label { display: none !important; }

/* --- 6. List item row height target: ~48px --- */
.ag-scatter-v2__li-name { font-size: 13px; }
.ag-scatter-v2__li-provider { font-size: 11px; }

/* --- 7. Toggle button — inside unified container, centered --- */
.ag-scatter-v2__toggle-btn {
  grid-column: 1 / -1;
  width: 100%;
  padding: 9px 16px;
  border: none;
  border-top: 1px solid #F0F0F0;
  border-radius: 0;
  background: transparent;
  color: #6B7280;
  font-size: 12px;
  font-family: Inter, -apple-system, sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ag-scatter-v2__toggle-btn:hover {
  background: #FAFAFA;
  color: #111827;
}

/* --- 8. Chart panel needs internal flex layout now that legend lives inside --- */
.ag-scatter-v2__chart {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ag-scatter-v2__chart svg {
  flex: 1;
  height: auto;
  min-height: 280px;
}

/* --- 9. Responsive tweaks for unified list --- */
@media (max-width: 900px) {
  .ag-scatter-v2__list { grid-template-columns: 1fr; }
  .ag-scatter-v2__list > .ag-scatter-v2__list-item:nth-last-child(-n+2) { border-bottom: none; }
  .ag-scatter-v2__list > .ag-scatter-v2__list-item:last-child { border-bottom: none; }
  .ag-scatter-v2__list > .ag-scatter-v2__list-item:nth-child(odd) { border-bottom: 1px solid #F0F0F0; }
  .ag-scatter-v2__chart svg { min-height: 220px; }
  .ag-scatter-v2__chart .ag-scatter-v2__legend { padding: 8px 14px 4px; }
  .ag-scatter-v2__chart .ag-scatter-v2__omitted { padding: 2px 14px 8px; }
}
@media (max-width: 640px) {
  .ag-scatter-v2__chart svg { min-height: 200px; }
}


/* ============================================================
 * Model Explorer Chart — Image 1 Match v1 (2026-09-26)
 * ONLY chart/controls/legend/tooltip — NOT model list
 * ============================================================ */

/* Chart card: flat compact height, inner padding */
.ag-scatter-v2__chart {
  height: 380px !important;
  padding: 14px 20px 10px !important;
  overflow: visible !important;
}

/* SVG fills remaining space */
.ag-scatter-v2__chart svg {
  height: calc(100% - 108px) !important;
}

/* Chart header row: no bg, no border, compact */
.ag-scatter-v2__chart-header {
  background: transparent !important;
  border-bottom: none !important;
  height: auto !important;
  padding: 2px 0 10px !important;
}

/* Chart count text */
.ag-scatter-v2__chart-count {
  font-size: 11px !important;
  letter-spacing: 0.03em !important;
  color: #6B7280 !important;
}

/* Find a model: hide label, compact select */
.ag-scatter-v2__find-label {
  display: none !important;
}
.ag-scatter-v2__chart-find {
  gap: 0 !important;
}
.ag-scatter-v2__find-select {
  height: 32px !important;
  padding: 4px 28px 4px 12px !important;
  border: 1px solid #E5E7EB !important;
  min-width: 200px !important;
  font-size: 12px !important;
  color: #374151 !important;
}
.ag-scatter-v2__find-select option[value=""] {
  color: #9CA3AF !important;
}

/* Axis selectors: compact height */
.ag-scatter-v2__select--axis {
  height: 34px !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 6px !important;
  min-width: 200px !important;
  font-size: 12px !important;
}

/* Controls gap */
.ag-scatter-v2__controls {
  gap: 12px !important;
}

/* SVG data points: white stroke for separation */
.ag-scatter-v2__chart circle {
  stroke: #FFFFFF !important;
  stroke-width: 1.5 !important;
}
.ag-scatter-v2__chart circle:hover,
.ag-scatter-v2__chart circle:focus {
  stroke-width: 2 !important;
}

/* Selected point: BeeCore yellow ring (via CSS) */
.ag-scatter-v2__chart circle.is-selected {
  stroke: #F5B800 !important;
  stroke-width: 2.5 !important;
  filter: none !important;
}

/* Legend: tighter spacing */
.ag-scatter-v2__legend {
  padding: 6px 0 2px !important;
  gap: 14px !important;
  font-size: 11px !important;
  color: #6B7280 !important;
  margin-top: 4px !important;
}
.ag-scatter-v2__legend-item {
  gap: 6px !important;
}
.ag-scatter-v2__legend-item .ag-scatter-v2__swatch,
.ag-scatter-v2__legend-item::before {
  border: none !important;
}

/* Omitted notice */
.ag-scatter-v2__omitted {
  padding: 2px 0 4px !important;
  font-size: 11px !important;
  color: #9CA3AF !important;
}

/* Tooltip: image1 style */
.ag-scatter-v2__tooltip {
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  color: #111827 !important;
  font-size: 12px !important;
  min-width: 180px !important;
}
.ag-scatter-v2__tooltip .ag-scatter-v2__tip-title {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #111827 !important;
  margin-bottom: 2px !important;
}
.ag-scatter-v2__tooltip .ag-scatter-v2__tip-provider {
  font-size: 11px !important;
  color: #9CA3AF !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  margin-bottom: 6px !important;
}
.ag-scatter-v2__tooltip .ag-scatter-v2__tip-row {
  font-size: 12px !important;
  color: #374151 !important;
  padding: 1px 0 !important;
}
.ag-scatter-v2__tooltip .ag-scatter-v2__tip-row strong {
  color: #111827 !important;
  font-family: ui-monospace, monospace !important;
  font-size: 12px !important;
}

/* Plot area bg: remove border-radius (image1 shows rect plot) */
.ag-scatter-v2__chart svg rect[fill="#FFFFFF"],
.ag-scatter-v2__chart svg rect[fill="#FAFAFA"] {
  rx: 0 !important;
}

/* Responsive chart card heights */
@media (max-width: 1024px) {
  .ag-scatter-v2__chart { height: 360px !important; }
  .ag-scatter-v2__chart svg { height: calc(100% - 108px) !important; }
}
@media (max-width: 640px) {
  .ag-scatter-v2__chart { height: 340px !important; padding: 12px 14px 8px !important; }
  .ag-scatter-v2__chart svg { height: calc(100% - 100px) !important; }
}



/* ============================================================
 * Chart Image 1 Match — v2 (tighter card, denser grid, clean count)
 * ============================================================ */

/* Chart card: even flatter */
.ag-scatter-v2__chart {
  height: 340px !important;
  padding: 12px 20px 8px !important;
}

/* SVG height: exact calc for compact plot */
.ag-scatter-v2__chart svg {
  height: calc(100% - 82px) !important;
}

/* Find select: fix first opt display (JS may have missed) */
.ag-scatter-v2__find-select option[value=""] {
  display: none !important;
}
.ag-scatter-v2__find-select::placeholder {
  color: #9CA3AF !important;
}

/* Grid lines: make sure they render on top of bg */
.ag-scatter-v2__chart svg line {
  shape-rendering: crispEdges !important;
  stroke-opacity: 0.7 !important;
}

/* Point grid separation */
.ag-scatter-v2__chart circle {
  stroke-linejoin: round !important;
}

/* Responsive */
@media (max-width: 1024px) {
  .ag-scatter-v2__chart { height: 320px !important; padding: 10px 16px 6px !important; }
  .ag-scatter-v2__chart svg { height: calc(100% - 78px) !important; }
}
@media (max-width: 640px) {
  .ag-scatter-v2__chart { height: 300px !important; padding: 10px 14px 6px !important; }
  .ag-scatter-v2__chart svg { height: calc(100% - 72px) !important; }
}
