@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@500;600;700&display=swap');

/* INFWAVE_STATIC_FILE_ROLE: PUBLIC_SHELL_AUTHORITY
   Current shared public-site shell for /, /models, /docs, and /transparency. */
/* Shared public frontend shell primitives: page frame, nav, brand, footer, mobile nav. */
body.ifw-public-page {
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: clip !important;
  --ifw-frame-max: 1200px;
  --ifw-page-pad: 32px;
  --ink-950: #0a0e27;
  --ink-900: #0f1730;
  --ink-800: #1a2342;
  --ink-700: #2a3456;
  --ink-500: #4a5374;
  --ink-300: #8d95af;
  --ink-200: #b8becf;
  --ink-100: #d8dce6;
  --ink-50: #eef0f5;
  --ink-25: #f6f7fa;
  --canvas: #f8fafc;
  --canvas-alt: #f1f5f9;
  --amber-700: #8b6d3f;
  --amber-500: #c89d5e;
  --amber-300: #e4c898;
  --ifw-action-700: #de6023;
  --ifw-action-600: #c94e18;
  --ifw-action-100: rgba(222, 96, 35, 0.12);
  --ifw-action-075: rgba(222, 96, 35, 0.085);
  --ifw-action-ring: rgba(222, 96, 35, 0.22);
  --hairline: #e2e8f0;
  --hairline-strong: #cbd5e1;
  --ifw-nav-offset: 80px;
  --ifw-nav-pad-top: 20px;
  --ifw-nav-pad-bottom: 18px;
  --ifw-section-y: 24px;
  --ifw-section-gap: 14px;
  --ifw-card-pad: 14px;
  --ifw-card-gap: 10px;
  --ifw-footer-top: 32px;
  --ifw-footer-bottom: 38px;
  --ifw-h1: 32px;
  --ifw-h2: 22px;
  --ifw-h3: 16px;
  --ifw-body: 14px;
  --ifw-small: 12.5px;
  --ifw-caption: 11px;

  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  color: var(--ink-900);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 42%, #f1f5f9 100%);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

body.ifw-public-page .ifw-root {
  width: 100%;
  padding-top: var(--ifw-nav-offset, 80px);
  overflow-x: clip;
}

/* Phase 3: V9-scoped universal reset. Hoisted from 3 V9 subpage inline
   <style> blocks + the :where() block at top of infwave-newapi-home.css.
   V8 (no .ifw-v9-page) keeps browser-default margin/padding for backward
   compatibility with home-public.html.
   Wrap in :where() to keep specificity 0 — otherwise body.ifw-v9-page *
   (0,1,1) would override .ifw-nav (0,1,0) etc and strip intentional padding. */
:where(body.ifw-v9-page),
:where(body.ifw-v9-page *),
:where(body.ifw-v9-page *::before),
:where(body.ifw-v9-page *::after) {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Phase 2: V9 single-source design tokens. Scope: all 5 V9 pages
   (body.ifw-v9-page). V8 (home-public.html) does NOT carry .ifw-v9-page
   and is unaffected. Only override values that differ from body.ifw-public-page;
   shared values inherit. */
body.ifw-v9-page {
  --ifw-frame-max: 1320px;   /* override 1200 */
  --ifw-h1: 30px;            /* override 32 */
  --ifw-h2: 20px;            /* override 22 */
  --ifw-h3: 15px;            /* override 16 */
  --ifw-body: 13px;          /* override 14 */
  --ifw-small: 12px;         /* override 12.5 */
  --ink-950: #0a0e27;        /* extend palette (body.ifw-public-page has no --ink-950) */
  --ink: var(--ink-900);
  --muted: var(--ink-500);
  --soft: var(--ink-25);
  --line: var(--hairline);
  --line-strong: var(--hairline-strong);
  --brand: var(--ifw-action-700);
  --brand-dark: var(--ifw-action-600);
  --panel: #ffffff;
  --dark: #0b1020;
  --dark-2: #10172a;
}

body.ifw-public-page code {
  background: var(--ink-50);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color: var(--ifw-action-700);
}

body.ifw-public-page a {
  color: var(--ifw-action-700);
  text-decoration: none;
}

body.ifw-public-page a:hover {
  text-decoration: underline;
}

body.ifw-public-page .mono,
body.ifw-public-page .ifw-mono {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-feature-settings: "calt" 0;
}

.ifw-shell {
  width: min(100%, var(--ifw-frame-max));
  margin: 0 auto;
  padding-left: var(--ifw-page-pad);
  padding-right: var(--ifw-page-pad);
}

.ifw-nav {
  width: min(100%, var(--ifw-frame-max));
  margin: 0 auto;
  padding-left: var(--ifw-page-pad);
  padding-right: var(--ifw-page-pad);
}

.ifw-nav-wrap {
  border-bottom: 1px solid rgba(226, 232, 240, 0);
  background: rgba(248, 250, 252, 0.72);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 30;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.ifw-nav-wrap.is-scrolled {
  background: rgba(244, 247, 250, 0.68);
  border-bottom-color: rgba(226, 232, 240, 0);
  box-shadow: none;
}

.ifw-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: var(--ifw-nav-pad-top);
  padding-bottom: var(--ifw-nav-pad-bottom);
}

.ifw-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.ifw-brand-glyph {
  width: 40px;
  height: 40px;
  display: inline-flex;
  /* Force embedded SVG to light rendering even when iOS Safari is in dark mode.
     The brand SVG contains `@media (prefers-color-scheme: dark)` rules that
     would otherwise wash out the logo on iPhone in dark mode. */
  color-scheme: light;
}

.ifw-brand-glyph img,
.ifw-brand-glyph svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ifw-brand-name {
  font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink-900, #0f1730);
}

.ifw-nav-links {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
}

.ifw-nav-links > a:not(.ifw-nav-cta) {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 17px;
  line-height: 1.28;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--ink-700);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
  transition: color .15s;
}

.ifw-nav-links > a:not(.ifw-nav-cta):hover {
  color: var(--ink-900);
}

.ifw-nav-links > a:not(.ifw-nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 2.5px;
  border-radius: 999px;
  background: var(--ifw-action-700);
  opacity: 0;
  transition: opacity .12s ease;
}

.ifw-nav-links > a:not(.ifw-nav-cta):hover::after,
.ifw-nav-links > a.active:not(.ifw-nav-cta)::after {
  opacity: 1;
}

.ifw-nav-links > a.active {
  color: var(--ink-900);
}

.ifw-nav-cta {
  padding: 9px 18px !important;
  background: var(--ink-900);
  color: var(--canvas) !important;
  font-size: 15px !important;
  line-height: 1.25;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 6px;
  transition: background .15s, transform .15s;
}

.ifw-nav-cta:hover {
  background: var(--ifw-action-700);
  transform: translateY(-1px);
  text-decoration: none;
}

.ifw-nav-cta:active {
  background: var(--ifw-action-600);
  transform: translateY(0);
}

.ifw-lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: auto;
  color: var(--ink-700) !important;
  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  font-size: 15px !important;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.ifw-lang-switch::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  opacity: 0.78;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.ifw-nav-links > .ifw-lang-switch:not(.ifw-nav-cta)::after {
  display: none;
}

.ifw-lang-switch:hover {
  color: var(--ink-900) !important;
}

.ifw-lang-switch:hover::before {
  opacity: 1;
}

.ifw-nav-utilities {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ifw-nav-utility {
  position: relative;
  flex: 0 0 auto;
}

.ifw-icon-button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(15, 23, 48, 0.055);
  color: var(--ink-700);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.ifw-icon-button:hover,
.ifw-nav-utility.is-open .ifw-icon-button {
  border-color: rgba(15, 23, 48, 0.08);
  background: rgba(222, 96, 35, 0.1);
  color: var(--ink-900);
}

.ifw-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ifw-nav-badge {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 15px;
  height: 15px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ifw-action-700);
  color: #fff;
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
}

.ifw-nav-badge[data-count]:not([data-count="0"]) {
  display: inline-flex;
}

.ifw-control-menu,
.ifw-announcement-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 160;
  display: none;
  min-width: 180px;
  padding: 6px;
  border: 1px solid rgba(15,23,48,0.12);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 58px rgba(15,23,48,0.18);
}

.ifw-nav-utility.is-open .ifw-control-menu,
.ifw-nav-utility.is-open .ifw-announcement-panel {
  display: grid;
  gap: 2px;
}

.ifw-control-menu button,
.ifw-control-menu a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-800);
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.ifw-control-menu button:hover,
.ifw-control-menu a:hover {
  background: var(--ifw-action-100);
  color: var(--ink-900);
  text-decoration: none;
}

.ifw-control-menu [aria-current="true"]::after {
  content: "✓";
  color: var(--ifw-action-700);
  font-weight: 700;
}

.ifw-announcement-panel {
  width: min(340px, calc(100vw - 32px));
  padding: 12px;
  gap: 10px;
}

.ifw-announcement-panel h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
}

.ifw-announcement-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.ifw-announcement-item {
  padding: 9px 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--ink-25);
}

.ifw-announcement-item b {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-900);
  font-size: 12px;
}

.ifw-announcement-item p {
  margin: 0;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.45;
}

/* ===== Phase 4: V9 Dark Mode — single source ===== */
/* All V9 pages (body.ifw-v9-page) share one dark mode token flip + body bg
   + nav bg + component dark backgrounds + dark logo content swap. V8
   (home-public.html, no .ifw-v9-page) does not receive dark mode here; if
   V8 dark mode is needed later, build a separate body.ifw-public-page.ifw-theme-dark
   block. */

body.ifw-v9-page[data-ifw-theme="dark"],
body.ifw-v9-page.ifw-theme-dark {
  /* dark ink palette */
  --ink-950: #f8fafc;
  --ink-900: #eef2ff;
  --ink-800: #e2e8f0;
  --ink-700: #cbd5e1;
  --ink-500: #94a3b8;
  --ink-300: #64748b;
  --ink-200: #475569;
  --ink-100: #334155;
  --ink-50: #1e293b;
  --ink-25: #111827;
  --canvas: #0b1020;
  --canvas-alt: #111827;
  --hairline: rgba(148, 163, 184, 0.22);
  --hairline-strong: rgba(148, 163, 184, 0.34);
  /* derived re-resolve so .ifw-newapi-root legacy --ink / --muted etc
     pick up the dark values; --panel needs explicit dark value because
     light --panel: #fff is too high contrast. */
  --ink: var(--ink-900);
  --muted: var(--ink-500);
  --soft: var(--ink-25);
  --line: var(--hairline);
  --line-strong: var(--hairline-strong);
  --panel: #101827;
  color: var(--ink-900);
  background:
    radial-gradient(circle at 16% 16%, rgba(222,96,35,0.16), transparent 32%),
    radial-gradient(circle at 82% 9%, rgba(71,107,255,0.14), transparent 30%),
    linear-gradient(180deg, #080c18 0%, #0d1324 46%, #080c18 100%);
}

/* Nav wrap dark frosted bg (V9 only) */
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-nav-wrap,
body.ifw-v9-page.ifw-theme-dark .ifw-nav-wrap {
  background: rgba(8, 12, 24, 0.76);
}

/* Dark mode panel-style component backgrounds (V9 only).
   Folded from the legacy ad-hoc body.ifw-public-page.ifw-theme-dark scope. */
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-icon-button,
body.ifw-v9-page.ifw-theme-dark .ifw-icon-button,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-control-menu,
body.ifw-v9-page.ifw-theme-dark .ifw-control-menu,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-announcement-panel,
body.ifw-v9-page.ifw-theme-dark .ifw-announcement-panel,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-model-card,
body.ifw-v9-page.ifw-theme-dark .ifw-model-card,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-newapi-model-card,
body.ifw-v9-page.ifw-theme-dark .ifw-newapi-model-card,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-newapi-market-sidebar button,
body.ifw-v9-page.ifw-theme-dark .ifw-newapi-market-sidebar button,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-market-toolbar,
body.ifw-v9-page.ifw-theme-dark .ifw-market-toolbar {
  background: rgba(15, 23, 42, 0.94);
}

/* Hero proof tiles + workflow/trust cards dark bg (home unique).
   Without this, cards keep their light-mode #fff bg and become unreadable. */
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-hero-proof span,
body.ifw-v9-page.ifw-theme-dark .ifw-hero-proof span,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-workflow-grid article,
body.ifw-v9-page.ifw-theme-dark .ifw-workflow-grid article,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-trust-board article,
body.ifw-v9-page.ifw-theme-dark .ifw-trust-board article {
  background: rgba(15, 23, 42, 0.78);
  border-color: var(--hairline);
}

/* Dark logo swap (V9 only; V8 does not enter dark mode). */
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-brand-glyph img[src$="/infwave-logo-gateway.svg"],
body.ifw-v9-page.ifw-theme-dark .ifw-brand-glyph img[src$="/infwave-logo-gateway.svg"] {
  content: url(/infwave-logo-gateway-dark.svg);
}

/* Phase 5: subpage panel/card backgrounds. Inline <style> blocks on
   models/docs/transparency hard-code white panel backgrounds for light mode.
   This block flips them dark in V9 dark mode so text stays readable.
   Border-color also flipped to dark --hairline (rgba 148,163,184,0.22). */
body.ifw-v9-page[data-ifw-theme="dark"] .docs-summary-card,
body.ifw-v9-page.ifw-theme-dark .docs-summary-card,
body.ifw-v9-page[data-ifw-theme="dark"] .surface-card,
body.ifw-v9-page.ifw-theme-dark .surface-card,
body.ifw-v9-page[data-ifw-theme="dark"] .step,
body.ifw-v9-page.ifw-theme-dark .step,
body.ifw-v9-page[data-ifw-theme="dark"] .panel,
body.ifw-v9-page.ifw-theme-dark .panel,
body.ifw-v9-page[data-ifw-theme="dark"] .schema-panel,
body.ifw-v9-page.ifw-theme-dark .schema-panel,
body.ifw-v9-page[data-ifw-theme="dark"] .contact-card,
body.ifw-v9-page.ifw-theme-dark .contact-card,
body.ifw-v9-page[data-ifw-theme="dark"] .meta-pill,
body.ifw-v9-page.ifw-theme-dark .meta-pill,
body.ifw-v9-page[data-ifw-theme="dark"] .schema-stat,
body.ifw-v9-page.ifw-theme-dark .schema-stat,
body.ifw-v9-page[data-ifw-theme="dark"] .models-link,
body.ifw-v9-page.ifw-theme-dark .models-link,
body.ifw-v9-page[data-ifw-theme="dark"] .models-status-card,
body.ifw-v9-page.ifw-theme-dark .models-status-card,
body.ifw-v9-page[data-ifw-theme="dark"] .docs-search input,
body.ifw-v9-page.ifw-theme-dark .docs-search input {
  background: rgba(15, 23, 42, 0.78);
  border-color: var(--hairline);
}

/* Code blocks: .code-block uses background: var(--ink-900) which in dark mode
   resolves to #eef2ff (white) — reverse intent. Lock to fixed dark bg. */
body.ifw-v9-page[data-ifw-theme="dark"] .code-block,
body.ifw-v9-page.ifw-theme-dark .code-block {
  background: #0b1020;
  border-color: var(--hairline);
}

/* Model catalog & market board panels: shared CSS hardcodes white bg too. */
body.ifw-v9-page[data-ifw-theme="dark"] .docs-model-board,
body.ifw-v9-page.ifw-theme-dark .docs-model-board,
body.ifw-v9-page[data-ifw-theme="dark"] .docs-model-board-head,
body.ifw-v9-page.ifw-theme-dark .docs-model-board-head,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-market-table-head,
body.ifw-v9-page.ifw-theme-dark .ifw-market-table-head {
  background: rgba(15, 23, 42, 0.78);
  border-color: var(--hairline);
}

/* Phase 5 follow-up (Codex review P0): docs/transparency table-row level
   widgets — <details>/<summary> accordion, .sdk-card, .schema-nav anchors,
   table rows. Inline <style> in docs.html / transparency.html uses #fff
   for these in light mode; V9 dark needs explicit flip. */
body.ifw-v9-page[data-ifw-theme="dark"] details,
body.ifw-v9-page.ifw-theme-dark details,
body.ifw-v9-page[data-ifw-theme="dark"] .sdk-card,
body.ifw-v9-page.ifw-theme-dark .sdk-card,
body.ifw-v9-page[data-ifw-theme="dark"] .schema-nav a,
body.ifw-v9-page.ifw-theme-dark .schema-nav a,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-table-scroll table,
body.ifw-v9-page.ifw-theme-dark .ifw-table-scroll table,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-table-scroll tr,
body.ifw-v9-page.ifw-theme-dark .ifw-table-scroll tr,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-table-scroll td,
body.ifw-v9-page.ifw-theme-dark .ifw-table-scroll td,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-table-scroll th,
body.ifw-v9-page.ifw-theme-dark .ifw-table-scroll th {
  background: rgba(15, 23, 42, 0.78);
  border-color: var(--hairline);
  color: var(--ink-900);
}

/* docs.html .docs-main details has higher specificity (body.ifw-public-page .docs-main details);
   match it for the dark override. */
body.ifw-v9-page[data-ifw-theme="dark"].ifw-public-page .docs-main details,
body.ifw-v9-page.ifw-theme-dark.ifw-public-page .docs-main details {
  background: rgba(15, 23, 42, 0.78);
  border-color: var(--hairline);
}

body.ifw-v9-page[data-ifw-theme="dark"] .ifw-market-search input,
body.ifw-v9-page.ifw-theme-dark .ifw-market-search input,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-market-action,
body.ifw-v9-page.ifw-theme-dark .ifw-market-action,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-market-segment,
body.ifw-v9-page.ifw-theme-dark .ifw-market-segment {
  background: rgba(8, 13, 27, 0.96);
  border-color: var(--hairline);
  color: var(--ink-900);
}

.ifw-foot {
  width: 100%;
  margin-top: var(--ifw-section-y);
  padding: var(--ifw-footer-top) 0 var(--ifw-footer-bottom);
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
}

.ifw-foot-brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-300);
  letter-spacing: 0.1em;
}

.ifw-foot-inner {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
}

.ifw-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
  align-items: center;
}

.ifw-foot-links a {
  color: var(--ink-500);
  text-decoration: none;
  transition: color .15s;
}

.ifw-foot-links a:hover {
  color: var(--ink-900);
}

.ifw-foot .ifw-lang-switch {
  gap: 5px;
  color: var(--ink-500) !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: inherit !important;
  line-height: inherit;
  font-weight: 500;
}

.ifw-foot .ifw-lang-switch::before {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.ifw-foot-mail {
  color: var(--ifw-action-700) !important;
  font-family: 'JetBrains Mono', monospace;
}

@media (max-width: 1040px) {
  body.ifw-public-page {
    --ifw-page-pad: 20px;
    --ifw-section-y: 20px;
    --ifw-section-gap: 12px;
    --ifw-h1: 26px;
    --ifw-h2: 20px;
  }

  body.ifw-public-page .ifw-root {
    --ifw-nav-offset: 116px;
    padding-top: var(--ifw-nav-offset, 116px);
  }

  .ifw-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .ifw-nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .ifw-nav-links > a:not(.ifw-nav-cta) {
    font-size: 12px;
    padding: 6px 8px;
    border: 1px solid var(--hairline-strong);
    border-radius: 999px;
    background: #fff;
  }

  .ifw-nav-links > .ifw-lang-switch:not(.ifw-nav-cta) {
    min-width: auto;
    padding-left: 10px;
    padding-right: 10px;
  }

  .ifw-nav-links > a:not(.ifw-nav-cta)::after {
    display: none;
  }

  .ifw-nav-links > a.active {
    background: rgba(15, 23, 48, 0.06);
    border-color: rgba(15, 23, 48, 0.14);
  }

  .ifw-nav-links > .ifw-nav-cta {
    margin-left: auto;
  }

  .ifw-nav-utilities {
    gap: 6px;
    margin-left: auto;
  }

  .ifw-icon-button {
    width: 34px;
    height: 34px;
    background: #fff;
    border-color: var(--hairline-strong);
  }

  .ifw-nav-cta {
    border-color: var(--ink-900) !important;
    background: var(--ink-900) !important;
    color: var(--canvas) !important;
    border-radius: 6px !important;
  }
}

/* ===== Public child-page primitives (shared by /docs and /transparency) ===== */
/* Page header */
body.ifw-public-page .page-header { width: 100%; padding: 16px 0 12px; }
body.ifw-public-page .page-header h1 { font-size: var(--ifw-h1); font-weight: 600; letter-spacing: -0.014em; line-height: 1.18; margin-bottom: 8px; }
body.ifw-public-page .page-header p { font-size: 14px; color: var(--ink-500); max-width: 720px; line-height: 1.56; }

/* Eyebrow / page-tag (uppercase mono lead-in) */
body.ifw-public-page .page-tag,
body.ifw-public-page .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--amber-700);
}
body.ifw-public-page .page-tag {
  padding: 4px 10px 4px 9px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: #fff;
  margin-bottom: 10px;
}
body.ifw-public-page .page-tag::before,
body.ifw-public-page .eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber-500);
  box-shadow: 0 0 8px var(--amber-500);
}

/* Section primitives */
body.ifw-public-page .section { padding: var(--ifw-section-y) 0; }
body.ifw-public-page .section + .section { border-top: 1px solid var(--hairline); }
body.ifw-public-page .section-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--amber-700);
  margin-bottom: 8px;
}
body.ifw-public-page .section-title {
  font-size: var(--ifw-h2); font-weight: 600;
  letter-spacing: -0.014em; line-height: 1.25;
  margin-bottom: 14px;
}
body.ifw-public-page .page-copy,
body.ifw-public-page .section-copy {
  font-size: 14px; color: var(--ink-500); max-width: 760px;
}

/* Badges */
body.ifw-public-page .badge,
body.ifw-public-page .badge-ok,
body.ifw-public-page .badge-warn {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px; font-weight: 500;
}
body.ifw-public-page .badge-ok { background: #e6f7ee; color: #1a7a4c; }
body.ifw-public-page .badge-warn { background: #fff4e6; color: #a85c00; }

/* ===== Shared model catalog =====
   Single styling authority for the homepage #models block, /models, and docs model tables. */
.ifw-market-table-wrap,
.docs-model-board {
  width: 100%;
  min-width: 0;
  scroll-margin-top: calc(var(--ifw-nav-offset, 80px) + 28px);
  border: 1px solid rgba(222,96,35,0.14);
  border-radius: 12px;
  background: rgba(255,255,255,0.96);
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(15,23,48,0.065);
}

.ifw-market-table-wrap {
  max-width: 1120px;
  margin: 20px auto 0;
}

.docs-model-board {
  margin: 0 auto;
}

.ifw-market-table-head,
.docs-model-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--hairline);
  border-radius: 12px 12px 0 0;
  background: #fff;
}

.ifw-market-table-head b,
.docs-model-board-head b {
  color: var(--ink-900);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 600;
}

.ifw-market-table-head span,
.docs-model-board-head span {
  color: var(--ink-300);
  font-size: 13px;
  line-height: 1.2;
}

.ifw-market-filter-panel {
  position: relative;
  z-index: 50;
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--hairline);
  background: #f8fafc;
  box-shadow: none;
  box-sizing: border-box;
}

.ifw-market-filter-bar {
  display: grid;
  grid-template-columns: minmax(168px, 1.15fr) minmax(168px, 1.05fr) minmax(168px, 1.05fr) minmax(132px, 0.7fr) minmax(150px, 0.8fr);
  gap: 12px;
  align-items: end;
  width: 100%;
}

.ifw-market-filter-field,
.ifw-market-head-cell,
.docs-model-head-cell {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ifw-market-filter-field-label,
.ifw-market-head-label,
.docs-model-head-label {
  color: var(--ink-500);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  font-weight: 600;
}

.ifw-market-table-scroll,
.docs-model-scroll {
  max-height: 540px;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

.ifw-market-table,
.docs-model-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink-900);
  font-size: 14px;
}

.docs-model-table {
  min-width: 860px;
}

.ifw-market-col-model { width: 24%; }
.ifw-market-col-scenario { width: 17%; }
.ifw-market-col-endpoint { width: 35%; }
.ifw-market-col-billing { width: 12%; }
.ifw-market-col-status { width: 12%; }

.ifw-market-table th,
.docs-model-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 13px 14px;
  border-bottom: 1px solid var(--hairline);
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 var(--hairline);
  color: var(--ink-500);
  vertical-align: top;
  text-align: left;
}

.ifw-market-table:not(.docs-model-table) th:not(:first-child),
.ifw-market-table:not(.docs-model-table) td:not(:first-child) {
  text-align: right;
}

.ifw-market-table th:nth-child(1) { width: 24%; }
.ifw-market-table th:nth-child(2) { width: 17%; }
.ifw-market-table th:nth-child(3) { width: 35%; }
.ifw-market-table th:nth-child(4) { width: 12%; }
.ifw-market-table th:nth-child(5) { width: 12%; }
.docs-model-table th:nth-child(1) { width: 22%; }
.docs-model-table th:nth-child(2) { width: 34%; }
.docs-model-table th:nth-child(3) { width: 30%; }
.docs-model-table th:nth-child(4) { width: 14%; }

.ifw-market-table:not(.docs-model-table) th:not(:first-child) .ifw-market-head-cell {
  justify-items: end;
}

.ifw-market-table td,
.docs-model-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--ink-700);
}

.ifw-market-table tbody tr:hover td,
.docs-model-table tbody tr:hover td {
  background: rgba(222,96,35,0.035);
}

.ifw-market-table tr:last-child td,
.docs-model-table tr:last-child td {
  border-bottom: none;
}

.ifw-model-name-cell,
.docs-model-name {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  color: var(--ink-900);
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

.ifw-model-mark,
.docs-model-mark {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-800);
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,48,0.035);
}

.ifw-model-mark img,
.ifw-model-mark svg,
.docs-model-mark img,
.docs-model-mark svg {
  width: 18px;
  height: 18px;
  display: block;
}

.ifw-model-mark-anthropic img,
.docs-model-mark-anthropic img {
  width: 21px;
  height: 21px;
  border-radius: 5px;
}

.ifw-model-mark-openai svg,
.ifw-model-mark-bytedance svg,
.docs-model-mark-openai svg,
.docs-model-mark-bytedance svg {
  width: 18px;
  height: 18px;
}

.ifw-model-mark-surface {
  color: var(--ifw-action-700);
}

.ifw-model-mark-surface svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ifw-market-table strong,
.docs-model-table strong {
  display: block;
  color: var(--ink-900);
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ifw-model-name-cell strong {
  display: inline;
}

.ifw-market-table small {
  display: block;
  margin-top: 4px;
  color: var(--ink-300);
  font-size: 12px;
  line-height: 1.25;
}

.ifw-market-table code,
.docs-model-table code,
.docs-model-source code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--ifw-action-700);
  font-size: 13px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.docs-model-source {
  font-size: 13.5px;
  color: var(--ink-300);
  margin-top: 14px;
  line-height: 1.6;
}

.ifw-status-pill {
  display: inline-flex;
  justify-content: center;
  min-width: 58px;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--ink-25);
  color: var(--ink-500);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.ifw-status-pill.is-callable {
  border-color: rgba(34,197,94,0.25);
  background: rgba(34,197,94,0.08);
  color: #15803d;
}

.ifw-status-pill.is-dynamic,
.ifw-status-pill.is-planned {
  border-color: rgba(222,96,35,0.22);
  background: rgba(222,96,35,0.075);
  color: var(--ifw-action-700);
}

.ifw-status-pill.is-enable {
  border-color: rgba(200,157,94,0.3);
  background: rgba(200,157,94,0.1);
  color: var(--amber-700);
}

.ifw-market-empty,
.docs-model-empty {
  display: none;
  padding: 14px 18px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.ifw-market-table-wrap[data-empty="true"] .ifw-market-empty,
.docs-model-board[data-empty="true"] .docs-model-empty {
  display: block;
}

.ifw-market-filter-control {
  position: relative;
  width: 100%;
  min-width: 0;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
}

.docs-model-table .ifw-market-filter-control {
  min-width: 118px;
}

.ifw-market-filter-control.is-open {
  z-index: 120;
}

.ifw-market-filter-button {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-800);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  cursor: pointer;
}

.ifw-market-filter-button::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.78;
}

.ifw-market-filter-button:focus-visible {
  outline: 2px solid var(--ifw-action-ring);
  outline-offset: 1px;
  border-color: rgba(222, 96, 35, 0.44);
}

.ifw-market-filter-control.is-open .ifw-market-filter-button {
  border-color: rgba(222, 96, 35, 0.44);
  box-shadow: 0 0 0 3px var(--ifw-action-075);
}

.ifw-market-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 130;
  display: none;
  min-width: 100%;
  padding: 6px;
  border: 1px solid rgba(15,23,48,0.12);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 58px rgba(15,23,48,0.18);
}

.ifw-market-filter-field:nth-child(n+3) .ifw-market-filter-menu,
.docs-model-table th:not(:first-child) .ifw-market-filter-menu {
  right: 0;
  left: auto;
}

.ifw-market-filter-control.is-open .ifw-market-filter-menu {
  display: grid;
  gap: 2px;
}

.ifw-market-filter-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 32px;
  padding: 7px 9px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-800);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.1;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.ifw-market-filter-option::before {
  content: '';
  color: #fff;
  font-weight: 700;
  line-height: 1;
}

.ifw-market-filter-option[aria-selected="true"] {
  background: var(--ifw-action-700);
  color: #fff;
}

.ifw-market-filter-option[aria-selected="true"]::before {
  content: '✓';
}

.ifw-market-filter-option:hover,
.ifw-market-filter-option:focus-visible {
  outline: none;
  background: var(--ifw-action-100);
  color: var(--ink-900);
}

.ifw-market-filter-option[aria-selected="true"]:hover,
.ifw-market-filter-option[aria-selected="true"]:focus-visible {
  background: var(--ifw-action-600);
  color: #fff;
}

.ifw-simple-section {
  padding: 22px 0 0;
  border-top: none;
}

@media (max-width: 1040px) {
  .ifw-market-table-wrap { margin-top: 20px; }
}

@media (max-width: 720px) {
  .ifw-market-table-head,
  .docs-model-board-head {
    display: block;
  }

  .ifw-market-table-head span,
  .docs-model-board-head span {
    display: block;
    margin-top: 6px;
  }

  .ifw-market-filter-control { min-width: 0; }
  .ifw-market-filter-panel { padding: 12px 10px; }
  .ifw-market-table-scroll,
  .docs-model-scroll { max-height: 450px; }
  .ifw-market-table thead { display: block; }
  .docs-model-table { min-width: 700px; }

  .ifw-market-filter-bar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr) minmax(0, 0.94fr);
    gap: 8px;
  }

  .ifw-market-filter-field:nth-child(2),
  .ifw-market-filter-field:nth-child(4) {
    display: none;
  }

  .ifw-market-filter-field-label,
  .ifw-market-head-label,
  .docs-model-head-label {
    font-size: 10px;
  }

  .ifw-market-label-row {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.88fr) minmax(0, 1.04fr);
    gap: 8px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--hairline);
    background: #f8fafc;
  }

  .ifw-market-label-row th:nth-child(2),
  .ifw-market-table:not(.docs-model-table) td:nth-child(2),
  .ifw-market-label-row th:nth-child(4),
  .ifw-market-table:not(.docs-model-table) td:nth-child(4) {
    display: none;
  }

  .ifw-market-label-row th:nth-child(1),
  .ifw-market-label-row th:nth-child(3),
  .ifw-market-label-row th:nth-child(5) { width: auto; }

  .ifw-market-table:not(.docs-model-table),
  .ifw-market-table:not(.docs-model-table) tbody,
  .ifw-market-table:not(.docs-model-table) td {
    display: block;
    width: 100%;
  }

  .ifw-market-table th,
  .ifw-market-table td,
  .docs-model-table th,
  .docs-model-table td {
    padding: 12px 10px;
  }

  .ifw-market-table:not(.docs-model-table) th {
    position: static;
    padding: 0;
    border-bottom: none;
    background: transparent;
    box-shadow: none;
  }

  .ifw-market-filter-button {
    height: 34px;
    padding: 0 6px;
    gap: 4px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ifw-market-filter-button::after { flex: 0 0 8px; }
  .ifw-market-table code,
  .docs-model-table code { font-size: 12px; overflow-wrap: normal; word-break: normal; }
  .ifw-status-pill { min-width: 0; padding: 6px 7px; font-size: 10px; }

  .ifw-market-table:not(.docs-model-table) tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 12px;
    align-items: center;
    padding: 13px 10px;
    border-bottom: 1px solid var(--hairline);
  }

  .ifw-market-table:not(.docs-model-table) tbody tr:last-child { border-bottom: none; }

  .ifw-market-table:not(.docs-model-table) td {
    padding: 0;
    border-bottom: none;
  }

  .ifw-market-table:not(.docs-model-table) td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  .ifw-market-table:not(.docs-model-table) td:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
    margin-top: 5px;
    padding-left: 31px;
    text-align: left !important;
  }

  .ifw-market-table:not(.docs-model-table) td:nth-child(5) {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    text-align: right !important;
  }

  .ifw-simple-section { padding-top: 24px; }
}

/* Model marketplace layout.
   /models and docs reuse the exact public-home marketplace structure. */
.ifw-model-market-board {
  margin: 0 auto;
  overflow: visible;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ifw-market-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 28px rgba(15,23,48,0.035);
}

.ifw-market-search {
  position: relative;
  /* 2026-05-25: cap search input width so toolbar actions on the right
     get enough room. Previously `flex: 1 1 360px` made the search greedy. */
  flex: 0 1 380px;
  min-width: 220px;
  max-width: 420px;
}

.ifw-market-search::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  opacity: .58;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.8-3.8'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.8-3.8'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.ifw-market-search input {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: #fff;
  padding: 0 16px 0 40px;
  color: var(--ink-900);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.ifw-market-search input:focus {
  border-color: rgba(222, 96, 35, 0.44);
  box-shadow: 0 0 0 3px var(--ifw-action-075);
}

.ifw-market-toolbar-actions {
  /* 2026-05-25: take the remaining toolbar width so right-side controls have
     room (was inline-flex, did not grow, leaving them cramped on the right). */
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.ifw-market-action,
.ifw-market-segment {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-700);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.ifw-market-action {
  gap: 7px;
  padding: 0 16px;
  cursor: pointer;
}

.ifw-market-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ifw-market-segment {
  gap: 2px;
  padding: 3px;
}

.ifw-market-segment button {
  /* 2026-05-25: padding-based width so text labels (卡片/表格) get breathing room. */
  min-width: 38px;
  min-height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-500);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ifw-market-segment button[aria-pressed="true"] {
  background: var(--ink-900);
  color: var(--canvas);
}

.ifw-market-toggle {
  gap: 8px;
  padding: 0 10px;
}

.ifw-market-toggle span {
  white-space: nowrap;
}

.ifw-market-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ifw-market-toggle i {
  width: 34px;
  height: 20px;
  position: relative;
  border-radius: 999px;
  background: var(--ink-50);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.ifw-market-toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15,23,48,0.18);
  transition: transform .15s ease, background .15s ease;
}

.ifw-market-toggle input:checked + i {
  background: rgba(222,96,35,0.22);
}

.ifw-market-toggle input:checked + i::after {
  transform: translateX(14px);
  background: var(--ifw-action-700);
}

.ifw-model-market-board[data-view-mode="table"] .ifw-model-grid {
  grid-template-columns: 1fr;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-newapi-model-card {
  min-height: 0;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-newapi-model-card dl,
.ifw-model-market-board[data-view-mode="table"] .ifw-model-price-lines {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ifw-market-shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ifw-market-sidebar {
  position: sticky;
  top: calc(var(--ifw-nav-offset, 80px) + 18px);
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(255,255,255,0.9);
}

.ifw-market-sidebar button,
.ifw-market-sidebar a {
  width: 100%;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475467;
  text-align: left;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.ifw-market-sidebar button.is-active {
  background: rgba(222,96,35,0.09);
  border-color: rgba(222,96,35,0.26);
  color: var(--ifw-action-700);
}

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

.ifw-model-card {
  min-width: 0;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 18px 44px rgba(17,24,39,0.045);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.ifw-model-card:hover {
  border-color: var(--ifw-action-700);
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(15,23,48,0.07);
}

.ifw-model-card.is-hidden,
.ifw-model-card[hidden] {
  display: none;
}

.ifw-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.ifw-card-top b,
.ifw-model-card b {
  color: var(--ink-900);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 600;
}

.ifw-model-card .ifw-model-mark,
.ifw-model-card .docs-model-mark {
  width: 32px;
  height: 32px;
  min-width: 32px;
  aspect-ratio: 1 / 1;
  flex: 0 0 32px;
  border-radius: 8px;
  overflow: hidden;
}

.ifw-model-card .ifw-model-mark img,
.ifw-model-card .docs-model-mark img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.ifw-model-card .ifw-model-mark svg,
.ifw-model-card .docs-model-mark svg {
  width: 22px;
  height: 22px;
}

.ifw-model-card p {
  margin: 0;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.56;
}

.ifw-model-card dl {
  display: grid;
  gap: 8px;
  margin: auto 0 0;
  padding-top: 14px;
  font-size: 11px;
}

.ifw-model-card dl div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
}

.ifw-model-card dt {
  color: #98a2b3;
}

.ifw-model-card dd {
  margin: 0;
  color: #344054;
  overflow-wrap: anywhere;
}

/* Phase 5 final: V9 frame-max is single-sourced to 1320px at body.ifw-v9-page
   scope (see Phase 2 token block). Historic 1360px values for marketplace
   and v9 pages here are removed so all 5 V9 pages render at the same width
   as home-V9.html (Codex review item: user requirement "4 子页统一首页"). */

body.ifw-v9-page.ifw-page-models .page-header {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 28px;
  padding: 24px 0 24px;
  position: relative;
  isolation: isolate;
  border-top: 0;
  border-bottom: 0;
  background: transparent;
  color: #fff;
}

body.ifw-v9-page.ifw-page-models .page-header::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  border-top: 1px solid rgba(226,232,240,0.72);
  border-bottom: 1px solid rgba(226,232,240,0.72);
  background:
    linear-gradient(135deg, rgba(15,23,48,0.94) 0%, rgba(35,76,168,0.86) 54%, rgba(222,96,35,0.74) 100%);
}

body.ifw-v9-page.ifw-page-models .models-topline {
  width: min(100%, var(--ifw-frame-max));
  margin: 0 auto;
  padding: 0 var(--ifw-page-pad);
}

body.ifw-v9-page.ifw-page-models .page-tag,
body.ifw-v9-page.ifw-page-models .page-header h1,
body.ifw-v9-page.ifw-page-models .page-header p,
body.ifw-v9-page.ifw-page-models .page-header code {
  color: #fff;
}

/* Phase 5 follow-up #2: .page-tag base rule (L800+) sets background: #fff
   for off-banner placement; on the marketplace gradient banner this collapses
   to white text on white pill (Codex flagged). Override to translucent so
   the navy/blue/orange banner shows through and the white text + amber dot
   stay legible. Apply to all 5 V9 pages for consistency. */
body.ifw-v9-page.ifw-page-models .page-tag,
body.ifw-v9-page.ifw-page-transparency .page-tag,
body.ifw-v9-page.ifw-page-legal .page-tag,
body.ifw-v9-page.ifw-page-docs .page-tag {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
}

body.ifw-v9-page.ifw-page-models .page-tag {
  opacity: 0.82;
}

body.ifw-v9-page.ifw-page-models .page-header p {
  max-width: 820px;
  opacity: 0.86;
}

body.ifw-v9-page.ifw-page-models .page-header code {
  background: rgba(255,255,255,0.14);
}

body.ifw-v9-page.ifw-page-models .models-link {
  border-color: rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.12);
  color: #fff;
}

body.ifw-v9-page.ifw-page-models .models-link:hover {
  border-color: rgba(255,255,255,0.48);
  color: #fff;
}

.ifw-model-market-board .ifw-market-shell {
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
}

.ifw-newapi-market-sidebar {
  gap: 18px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.ifw-newapi-market-sidebar h2 {
  color: var(--ink-900);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 600;
}

.ifw-filter-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
}

.ifw-filter-group > span {
  grid-column: 1 / -1;
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
}

.ifw-newapi-market-sidebar button {
  min-height: 34px;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border-color: var(--hairline);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-700);
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ifw-newapi-market-sidebar button em {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ink-25);
  color: var(--ink-500);
  font-style: normal;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

.ifw-newapi-market-sidebar button.is-active {
  border-color: rgba(222,96,35,0.22);
  background: rgba(222,96,35,0.08);
  color: var(--ifw-action-700);
}

.ifw-newapi-market-sidebar button.is-active em {
  background: rgba(222,96,35,0.13);
  color: var(--ifw-action-700);
}

.ifw-model-market-board .ifw-model-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ifw-newapi-model-card {
  min-height: 230px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15,23,48,0.045);
}

.ifw-newapi-card-top {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ifw-model-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ifw-model-copy {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-500);
  cursor: pointer;
}

.ifw-model-copy svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ifw-model-copy:hover {
  border-color: rgba(222,96,35,0.28);
  color: var(--ifw-action-700);
}

.ifw-model-price-lines {
  display: grid;
  gap: 3px;
  margin: 4px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.ifw-model-price-lines div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  color: var(--ink-700);
  font-size: 13px;
  line-height: 1.35;
}

.ifw-model-price-lines span {
  min-width: 70px;
  color: var(--ink-300);
}

.ifw-model-price-lines strong {
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.ifw-newapi-model-card dl {
  margin-top: 14px;
  padding-top: 0;
}

.ifw-model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
}

.ifw-model-tags span {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--ink-25);
  color: var(--ink-700);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 500;
}

.ifw-model-tags span:first-child {
  background: rgba(222,96,35,0.1);
  color: var(--ifw-action-700);
}

@media (max-width: 1180px) {
  .ifw-model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .ifw-market-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .ifw-market-search {
    flex-basis: auto;
    min-width: 0;
  }

  .ifw-market-toolbar-actions {
    justify-content: flex-start;
  }

  .ifw-market-shell {
    grid-template-columns: 1fr;
  }

  .ifw-market-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ifw-model-market-board .ifw-market-shell,
  .ifw-model-market-board .ifw-model-grid {
    grid-template-columns: 1fr;
  }

  .ifw-newapi-market-sidebar {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .ifw-model-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 560px) {
  .ifw-market-sidebar {
    grid-template-columns: 1fr;
  }
}
