/* Ailoot docs, models and integrations: shared styles.
   Layout follows the measured three-column docs shell (sidebar 288 / article 689 / on-this-page 264 at 1440),
   colours and type come from the Ailoot landing (bone on graphite, Geologica/Onest/JetBrains Mono)
   and the tariffs page accent (teal). Dark is the default (the landing is dark-only); light only by the toggle. */

:root {
  --header-height: 113px;
  --font-ui: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Geologica', 'Onest', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #0F1113;
  --bg-elev: #13171B;
  --bg-soft: rgba(255, 255, 255, .035);
  --bg-hover: rgba(255, 255, 255, .055);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --ring: rgba(255, 255, 255, .22);
  --text-1: #F7F5F0;
  --text-2: #B9C0C7;
  --text-3: #8E98A2;
  --text-4: #66707A;
  --accent: #5EEAD4;
  --accent-ink: #5EEAD4;
  --accent-soft: rgba(94, 234, 212, .11);
  --accent-line: rgba(94, 234, 212, .45);
  --cta-bg: #F7F5F0;
  --cta-fg: #0C0F12;
  --cta-hover: #FFFFFF;
  --code-outer: rgba(255, 255, 255, .04);
  --code-inner: #0A0C0E;
  --code-text: #D6DADF;
  --tok-key: #9CDCFE;
  --tok-str: #E3B78E;
  --tok-num: #B5CEA8;
  --tok-com: #6E7C73;
  --tok-kw: #D7A6E6;
  --tok-fn: #8FD8C8;
  --note-bg: rgba(59, 130, 246, .12);
  --note-line: rgba(96, 165, 250, .35);
  --note-text: #A9CBFB;
  --tip-bg: rgba(34, 197, 94, .10);
  --tip-line: rgba(74, 222, 128, .32);
  --tip-text: #9BE8B5;
  --warn-bg: rgba(245, 158, 11, .10);
  --warn-line: rgba(251, 191, 36, .35);
  --warn-text: #F5CE7A;
  --req-bg: rgba(248, 113, 113, .12);
  --req-text: #FCA5A5;
  --get: #4ADE80;
  --post: #60A5FA;
  --fm-messages: #F4B08A;
  --fm-gemini: #9DB8FF;
  --fm-responses: #C7A7F5;
  --shadow-pop: 0 24px 64px -16px rgba(0, 0, 0, .7);
  --overlay: rgba(4, 6, 8, .62);
  --header-bg: rgba(15, 17, 19, .88);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #FAFAF8;
  --bg-elev: #FFFFFF;
  --bg-soft: rgba(12, 15, 18, .035);
  --bg-hover: rgba(12, 15, 18, .055);
  --line: rgba(12, 15, 18, .09);
  --line-2: rgba(12, 15, 18, .15);
  --ring: rgba(12, 15, 18, .25);
  --text-1: #0C0F12;
  --text-2: #3E454C;
  --text-3: #5F6973;
  --text-4: #7C858E;
  --accent: #0F766E;
  --accent-ink: #0F766E;
  --accent-soft: rgba(15, 118, 110, .09);
  --accent-line: rgba(15, 118, 110, .45);
  --cta-bg: #0C0F12;
  --cta-fg: #FFFFFF;
  --cta-hover: #000000;
  --code-outer: #F1F2EF;
  --code-inner: #FFFFFF;
  --code-text: #24292F;
  --tok-key: #0550AE;
  --tok-str: #A0461A;
  --tok-num: #116329;
  --tok-com: #6E7781;
  --tok-kw: #8250DF;
  --tok-fn: #0F766E;
  --note-bg: #EFF6FF;
  --note-line: #BFDBFE;
  --note-text: #1E40AF;
  --tip-bg: #F0FDF4;
  --tip-line: #BBF7D0;
  --tip-text: #166534;
  --warn-bg: #FFFBEB;
  --warn-line: #FDE68A;
  --warn-text: #92400E;
  --req-bg: rgba(220, 38, 38, .08);
  --req-text: #B91C1C;
  --get: #15803D;
  --post: #1D4ED8;
  --fm-messages: #9A3412;
  --fm-gemini: #1D4ED8;
  --fm-responses: #6D28D9;
  --shadow-pop: 0 24px 64px -20px rgba(12, 15, 18, .28);
  --overlay: rgba(12, 15, 18, .38);
  --header-bg: rgba(250, 250, 248, .9);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-height) + 16px); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text-2);
  font: 400 16px/28px var(--font-ui);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
::selection { background: var(--accent); color: #0C0F12; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 10px; background: var(--cta-bg); color: var(--cta-fg); text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }
.ico { width: 16px; height: 16px; flex: none; }

/* ---------------- header ---------------- */
.hdr {
  position: sticky; top: 0; z-index: 40; background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.hdr-row { max-width: 1472px; margin: 0 auto; padding: 0 48px; display: flex; align-items: center; }
.hdr-top { height: 64px; gap: 12px; }
.hdr-tabs { height: 48px; gap: 24px; border-top: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-1); text-decoration: none; border-radius: 8px; flex: none; }
.brand svg { height: 22px; width: auto; }
.brand .brand-sub { font: 500 13px/1 var(--font-mono); color: var(--text-3); padding: 4px 7px; border: 1px solid var(--line-2); border-radius: 6px; }
.hdr-search {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 36px; width: 220px;
  padding: 0 10px 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-soft);
  color: var(--text-3); font-size: 14px; text-align: left;
}
.hdr-search:hover { border-color: var(--ring); color: var(--text-2); }
.hdr-search span { flex: 1; }
kbd, .kbd { font: 500 11px/1 var(--font-mono); color: var(--text-3); padding: 3px 5px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--bg-soft); }
.hdr-links { display: flex; align-items: center; gap: 22px; margin-left: 12px; }
.hdr-links a { font-size: 14px; line-height: 20px; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.hdr-links a:hover, .hdr-links a[aria-current="page"] { color: var(--text-1); }
.hdr-actions { display: flex; align-items: center; gap: 8px; margin-left: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 12px; font: 600 14px/1 var(--font-ui); text-decoration: none; white-space: nowrap; border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--cta-bg); color: var(--cta-fg); clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%); border-radius: 10px; }
.btn-primary:hover { background: var(--cta-hover); }
.btn-primary:focus-visible { clip-path: none; }
.btn-ghost { border-color: var(--line-2); color: var(--text-1); background: transparent; }
.btn-ghost:hover { border-color: var(--ring); background: var(--bg-hover); }
/* Cabinet session: theme.js sets <html data-session="in"> before first paint, «Кабинет» replaces «Войти»/«Регистрация».
   Without JS or a session the logged-out buttons stay. */
.btn.auth-in { display: none; }
:root[data-session="in"] .btn.auth-in { display: inline-flex; }
:root[data-session="in"] .auth-out { display: none !important; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--text-3);
}
.icon-btn:hover { color: var(--text-1); background: var(--bg-hover); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 48px; min-height: 44px; font-size: 14px; color: var(--text-3);
  text-decoration: none; white-space: nowrap;
}
.tab:hover { color: var(--text-1); }
.tab[aria-current="page"] { color: var(--text-1); }
.tab[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px; background: var(--accent); }
.hdr-mobile { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; color: var(--text-3); }
.crumbs b { font-weight: 500; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- docs layout ---------------- */
.shell { max-width: 1472px; margin: 0 auto; padding: 0 32px; display: flex; align-items: flex-start; }
.sidebar {
  position: sticky; top: var(--header-height); width: 288px; flex: none; height: calc(100vh - var(--header-height)); overflow-y: auto;
  padding: 24px 32px 40px 0; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 32px); mask-image: linear-gradient(to bottom, transparent 0, #000 32px);
}
.sidebar::-webkit-scrollbar { display: none; }
.nav-group + .nav-group { margin-top: 26px; }
.nav-title { display: flex; align-items: center; gap: 10px; padding: 0 0 6px 16px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-1); }
.nav-title .ico { color: var(--text-3); }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 6px 12px 6px 16px; border-radius: 12px;
  color: var(--text-3); text-decoration: none; font-size: 14px; line-height: 20px; overflow-wrap: anywhere;
}
.nav-link .ico { color: var(--text-4); }
.nav-link:hover { color: var(--text-1); background: var(--bg-hover); }
.nav-link[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); font-weight: 500; }
.nav-link[aria-current="page"] .ico { color: var(--accent-ink); }
.nav-sub summary { list-style: none; cursor: pointer; }
.nav-sub summary::-webkit-details-marker { display: none; }
.nav-sub summary .chev { width: 14px; height: 14px; color: var(--text-4); transition: transform .15s ease; }
.nav-sub[open] summary .chev { transform: rotate(90deg); }
.nav-sub .nav-list { padding: 2px 0 6px 12px; }
.nav-sub .nav-link { padding-left: 28px; font-size: 13.5px; min-height: 32px; }
.badge-mini { font: 600 9px/1 var(--font-mono); padding: 3px 4px; border-radius: 5px; color: #fff; background: var(--post); letter-spacing: .02em; flex: none; }
.badge-mini.get { background: var(--get); color: #0C0F12; }

.main { flex: 1; min-width: 0; display: flex; justify-content: space-between; gap: 48px; padding: 40px 0 0 43px; }
.article { width: 100%; max-width: 689px; min-width: 0; padding-bottom: 64px; }
.toc { position: sticky; top: calc(var(--header-height) + 40px); width: 264px; flex: none; max-height: calc(100vh - var(--header-height) - 57px); overflow-y: auto; scrollbar-width: none; }
.toc-title { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-4); margin-bottom: 6px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 4px 0; font-size: 14px; line-height: 24px; color: var(--text-3); text-decoration: none; }
.toc a:hover { color: var(--text-1); }
.toc a.active { color: var(--accent-ink); }
.toc .toc-help { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; line-height: 20px; color: var(--text-3); }
.toc .toc-help a { display: inline; padding: 0; font-size: 13px; color: var(--text-2); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }

/* API reference: article + sticky code panel */
.main.api { gap: 52px; }
.main.api .article { max-width: 545px; }
.code-panel { position: sticky; top: calc(var(--header-height) + 40px); width: 448px; flex: none; max-height: calc(100vh - var(--header-height) - 57px); overflow-y: auto; display: grid; gap: 24px; scrollbar-width: none; }
.code-panel .code-group { margin: 0; }
.code-panel pre { font-size: 12px; line-height: 21.6px; }
.code-inline-api { display: none; }

/* ---------------- article typography ---------------- */
.eyebrow { display: inline-block; font-size: 16px; line-height: 24px; color: var(--accent-ink); text-decoration: none; margin-bottom: 8px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.copy-page { flex: none; height: 32px; padding: 0 10px; font-size: 13px; font-weight: 500; border-radius: 10px; margin-top: 4px; color: var(--text-2); }
.copy-page .ico { width: 14px; height: 14px; }
.article h1 { margin: 0; font: 600 36px/40px var(--font-display); letter-spacing: -.9px; color: var(--text-1); text-wrap: balance; }
.lead { margin: 10px 0 36px; font-size: 18px; line-height: 28px; color: var(--text-3); }
.article h2 {
  position: relative; margin: 44px 0 18px; font: 600 24px/32px var(--font-display); letter-spacing: -.6px; color: var(--text-1);
}
.article h2:first-child { margin-top: 0; }
.article h3 { margin: 32px 0 12px; font: 600 18px/27px var(--font-display); color: var(--text-1); }
.article h4 { margin: 36px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font: 600 18px/27px var(--font-display); color: var(--text-1); }
.anchor { position: absolute; left: -32px; top: 4px; width: 24px; height: 24px; display: grid; place-items: center; color: var(--text-4); opacity: 0; text-decoration: none; border-radius: 6px; }
.article h2:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--accent-ink); }
.article p { margin: 0 0 20px; }
.article strong { color: var(--text-1); font-weight: 600; }
.article a:not(.btn):not(.card-link):not(.eyebrow):not(.anchor):not(.pager a) {
  color: var(--text-1); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--accent-line);
}
.article a:not(.btn):not(.card-link):not(.eyebrow):not(.anchor):hover { border-bottom-color: var(--accent); }
.article ul, .article ol { margin: 0 0 20px; padding-left: 22px; }
.article li { margin: 6px 0; }
.article li::marker { color: var(--text-4); }
code { font: 400 .875em/1.5 var(--font-mono); }
:not(pre) > code { padding: 2px 7px; border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--text-1); white-space: nowrap; }
:not(pre) > code.w { white-space: normal; overflow-wrap: anywhere; }
.callout code, .param p code, .app-sheet-body p code { white-space: normal; overflow-wrap: anywhere; }
.compat td:first-child { min-width: 150px; }
.compat td:last-child, .compat th:last-child { text-align: right; white-space: nowrap; }
.compat td:nth-child(3) { white-space: nowrap; }
.muted { color: var(--text-4); font-size: .92em; }
.table-wrap { margin: 8px 0 28px; overflow-x: auto; }
.article table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 21px; }
.article th { text-align: left; font-weight: 500; color: var(--text-1); padding: 0 12px 10px 0; border-bottom: 1px solid var(--line-2); vertical-align: bottom; }
.article td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
.article td code, .article th code { font-size: 12.5px; }
.article hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }

/* steps */
.steps, .article .steps { list-style: none; counter-reset: step; margin: 8px 0 28px; padding: 0; }
.steps > li { counter-increment: step; position: relative; margin: 0; padding: 0 0 24px 44px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  font: 600 13px/1 var(--font-mono); color: var(--text-1); background: var(--bg-soft); border: 1px solid var(--line-2);
}
.steps > li::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 6px; width: 1px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps > li:last-child { padding-bottom: 0; }
.steps > li > p:last-child { margin-bottom: 0; }
.steps + .code-group { margin-top: 24px; }
.steps > li > b { display: block; color: var(--text-1); font-weight: 600; line-height: 28px; }

/* flow diagram (how it works) */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 28px; }
.flow > div { position: relative; padding: 14px 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-soft); }
.flow b { display: block; font: 600 14px/20px var(--font-display); color: var(--text-1); margin-bottom: 4px; }
.flow span { display: block; font-size: 13px; line-height: 19px; color: var(--text-3); }
.flow i { font-style: normal; font: 600 11px/1 var(--font-mono); color: var(--accent-ink); display: block; margin-bottom: 10px; }

/* cards (overview links) */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0 28px; }
.card-link {
  display: block; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-soft); text-decoration: none; color: var(--text-2);
  transition: border-color .15s ease, background-color .15s ease;
}
.card-link:hover { border-color: var(--line-2); background: var(--bg-hover); }
.card-link b { display: flex; align-items: center; gap: 10px; color: var(--text-1); font: 600 15px/22px var(--font-display); margin-bottom: 4px; }
.card-link span { display: block; font-size: 14px; line-height: 21px; color: var(--text-3); }
.card-link .ico { color: var(--accent-ink); }

/* callouts */
.callout { display: flex; gap: 12px; margin: 16px 0 24px; padding: 14px 18px; border-radius: 16px; border: 1px solid; font-size: 14px; line-height: 21px; }
.callout .ico { width: 18px; height: 18px; margin-top: 1px; }
.callout > div { min-width: 0; overflow-wrap: anywhere; }
.callout > div > :last-child { margin-bottom: 0; }
.article p, .article li, .article td { overflow-wrap: break-word; }
.app-setup p, .app-where { overflow-wrap: anywhere; }
.callout p { margin: 0 0 8px; }
.callout a { color: inherit !important; border-bottom-color: currentColor !important; }
.callout code { background: transparent; border-color: currentColor; color: inherit; opacity: .95; }
.callout.note { background: var(--note-bg); border-color: var(--note-line); color: var(--note-text); }
.callout.tip { background: var(--tip-bg); border-color: var(--tip-line); color: var(--tip-text); }
.callout.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }

/* ---------------- code groups ---------------- */
.code-group { margin: 20px 0 32px; padding: 2px; border-radius: 16px; border: 1px solid var(--line); background: var(--code-outer); display: flex; flex-direction: column; min-width: 0; }
.cg-bar { display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 4px 0 10px; min-width: 0; }
.cg-title { font-size: 12px; line-height: 24px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 8px; }
.cg-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
.cg-tabs::-webkit-scrollbar { display: none; }
.cg-tab { height: 26px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; font: 500 12px/24px var(--font-ui); color: var(--text-3); white-space: nowrap; }
.cg-tab:hover { color: var(--text-1); }
.cg-tab { position: relative; }
.cg-tab[aria-selected="true"] { color: var(--accent-ink); }
.cg-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -4px; height: 1.5px; border-radius: 1px; background: var(--accent); }
.cg-tools { display: flex; gap: 2px; margin-left: auto; flex: none; }
.cg-btn { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; border: 0; background: transparent; color: var(--text-3); }
.cg-btn:hover { color: var(--text-1); background: var(--bg-hover); }
.cg-btn svg { width: 15px; height: 15px; }
.cg-btn .ok { display: none; color: var(--accent-ink); }
.cg-btn.copied .cp { display: none; }
.cg-btn.copied .ok { display: block; }
.cg-body { position: relative; border-radius: 14px; background: var(--code-inner); border: 1px solid var(--line); min-width: 0; }
.cg-pane[hidden] { display: none; }
pre {
  margin: 0; padding: 14px 16px; overflow-x: auto; font: 400 13.5px/24px var(--font-mono); color: var(--code-text); tab-size: 2;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
pre code { font: inherit; white-space: pre; }
pre.ln { counter-reset: ln; }
pre.ln .l { display: block; }
pre.ln .l::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 2.2em; margin-right: 1em; text-align: right; color: var(--text-4); user-select: none; }
.t-k { color: var(--tok-key); }
.t-s { color: var(--tok-str); }
.t-n { color: var(--tok-num); }
.t-c { color: var(--tok-com); font-style: italic; }
.t-w { color: var(--tok-kw); }
.t-f { color: var(--tok-fn); }

/* endpoint row + params */
.endpoint { display: flex; align-items: center; gap: 10px; margin: 0 0 28px; padding: 5px 5px 5px 6px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg-soft); min-width: 0; }
.endpoint .m { font: 600 12px/1 var(--font-mono); padding: 6px 7px; border-radius: 8px; color: #fff; background: var(--post); flex: none; }
.endpoint .m.get { background: var(--get); color: #0C0F12; }
.endpoint code { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-1); background: none !important; border: 0 !important; padding: 0 !important; white-space: normal; overflow-wrap: anywhere; }
.endpoint + .endpoint { margin-top: -18px; }
.params, .article .params { list-style: none; margin: 0 0 12px; padding: 0; }
.article .params li { margin: 0; }
.param { padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.param-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 6px; }
.param-name { font: 500 14px/20px var(--font-mono); color: var(--accent-ink); }
.chip { font: 500 12px/1 var(--font-mono); padding: 4px 7px; border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--text-3); }
.chip.req { background: var(--req-bg); border-color: transparent; color: var(--req-text); }
.chip.opt { color: var(--text-4); }
.param p { margin: 0; font-size: 14px; line-height: 22px; color: var(--text-2); }
.param p + p { margin-top: 6px; }

/* pager + footer */
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 56px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { display: grid; gap: 2px; max-width: 48%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); text-decoration: none; }
.pager a:hover { border-color: var(--line-2); background: var(--bg-hover); }
.pager small { font-size: 12px; color: var(--text-4); }
.pager span { font-size: 14px; line-height: 20px; color: var(--text-1); font-weight: 500; }
.pager .next { margin-left: auto; text-align: right; }
.ask {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 40px; padding: 14px 16px 14px 18px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--bg-soft); font-size: 14px; line-height: 21px; color: var(--text-3);
}
.ask a { flex: none; }
.foot { border-top: 1px solid var(--line); margin-top: 24px; }
.foot-in { max-width: 1472px; margin: 0 auto; padding: 28px 48px 36px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: 13px; color: var(--text-3); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.foot a:hover { color: var(--text-1); text-decoration-color: var(--text-3); }

/* ---------------- search dialog ---------------- */
.dlg { position: fixed; inset: 0; z-index: 80; display: none; }
.dlg.open { display: block; }
.dlg-back { position: absolute; inset: 0; background: var(--overlay); }
.search-box {
  position: absolute; left: 50%; top: 54px; transform: translateX(-50%); width: min(640px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 80px));
  display: flex; flex-direction: column; border-radius: 20px; background: var(--bg-elev); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); overflow: hidden;
}
.search-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 56px; border-bottom: 1px solid var(--line); }
.search-input svg { width: 18px; height: 18px; color: var(--text-3); }
.search-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--text-1); }
.search-input input::placeholder { color: var(--text-4); }
input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.search-results { overflow-y: auto; padding: 8px; flex: 1; }
.search-results .grp { padding: 10px 10px 6px; font: 500 12px/1 var(--font-ui); color: var(--text-4); }
.sr {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 7px 10px; border-radius: 12px; text-decoration: none; color: var(--text-2);
}
.sr .ico { color: var(--text-4); }
.sr b { display: block; font-weight: 500; font-size: 14px; line-height: 20px; color: var(--text-1); }
.sr small { display: block; font-size: 12px; line-height: 17px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr mark { background: transparent; color: var(--accent-ink); }
.sr.active, .sr:hover { background: var(--bg-hover); }
.sr-empty { padding: 28px 12px; text-align: center; font-size: 14px; color: var(--text-3); }
.search-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-4); }
.search-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------- mobile drawer ---------------- */
.drawer { position: fixed; inset: 0; z-index: 70; display: none; }
.drawer.open { display: block; }
.drawer-panel {
  position: absolute; left: 0; top: 0; bottom: 0; width: min(332px, 88vw); background: var(--bg); border-right: 1px solid var(--line);
  overflow-y: auto; padding: 16px 16px 40px; animation: slidein .18s ease-out;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.drawer .nav-link { font-size: 16px; line-height: 22px; min-height: 40px; }
.drawer .nav-title { font-size: 15px; }
.drawer-links { display: grid; gap: 8px; margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.drawer-links .row { display: flex; gap: 8px; }
.drawer-links .row .btn { flex: 1; height: 40px; }
.drawer-sections { display: grid; gap: 4px; }
.drawer-sections a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid transparent; border-radius: 10px; color: var(--text-2); text-decoration: none; }
.drawer-sections a:hover { background: var(--bg-hover); color: var(--text-1); }
.drawer-sections a[aria-current="page"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
@keyframes slidein { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- integrations ---------------- */
.page-wide { max-width: 1280px; margin: 0 auto; padding: 40px 32px 72px; }
.int-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; margin-bottom: 28px; }
.int-hero h1 { margin: 6px 0 10px; font: 600 40px/44px var(--font-display); letter-spacing: -1px; color: var(--text-1); text-wrap: balance; }
.int-hero p { margin: 0; max-width: 720px; font-size: 17px; line-height: 27px; color: var(--text-3); }
.stats { display: flex; gap: 10px; }
.stat { min-width: 108px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-soft); }
.stat b { display: block; font: 600 22px/28px var(--font-display); color: var(--text-1); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; line-height: 16px; color: var(--text-3); }
.int-tools { position: sticky; top: var(--header-height); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; margin-bottom: 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.field { position: relative; flex: 1 1 280px; min-width: 0; }
.field svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-4); pointer-events: none; }
.field input { width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-soft); color: var(--text-1); font-size: 14px; outline: 0; }
.field input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip {
  height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-size: 13px; white-space: nowrap;
}
.fchip:hover { border-color: var(--ring); color: var(--text-1); }
.fchip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.fchip .n { margin-left: 6px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.int-group { margin-top: 36px; }
.int-group > header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.int-group h2 { margin: 0; font: 600 22px/28px var(--font-display); color: var(--text-1); letter-spacing: -.4px; }
.int-group header p { margin: 0; font-size: 14px; color: var(--text-3); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; align-items: stretch; }
.app {
  display: flex; flex-direction: column; min-width: 0; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-soft);
  transition: border-color .15s ease, background-color .15s ease;
}
.app:hover { border-color: var(--line-2); }
.app:target, .app.hl { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.app-top { display: flex; gap: 12px; padding: 16px 16px 12px; }
.av {
  width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; font: 600 14px/1 var(--font-display);
  color: var(--text-1); background: var(--bg-hover); border: 1px solid var(--line-2); letter-spacing: -.3px;
}
.app h3 { margin: 0; font: 600 16px/22px var(--font-display); color: var(--text-1); }
.app h3 a { text-decoration: none; }
.app h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.app .kind { font-size: 13px; line-height: 18px; color: var(--text-3); }
.fmt { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 14px; }
.fmt span { font: 500 11.5px/1 var(--font-mono); padding: 5px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--text-2); background: var(--bg-soft); }
.fmt span.f-messages { color: var(--fm-messages); } .fmt span.f-gemini { color: var(--fm-gemini); } .fmt span.f-responses { color: var(--fm-responses); } .fmt span.f-chat { color: var(--accent-ink); }
.app-desc { margin: 0; padding: 0 16px 14px; font-size: 14px; line-height: 21px; color: var(--text-2); flex: 1; }
.app-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px 12px 16px; border-top: 1px solid var(--line); }
.app-foot .btn { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.app-foot .more { margin-left: auto; font-size: 13px; color: var(--text-3); text-decoration: none; }
.app-foot .more:hover { color: var(--text-1); }
.st { font: 500 11px/1 var(--font-ui); padding: 4px 7px; border-radius: 999px; color: var(--warn-text); background: var(--warn-bg); border: 1px solid var(--warn-line); white-space: nowrap; align-self: flex-start; }
.int-sheet .sheet-panel { width: min(760px, 100vw); }
.int-sheet .sheet-head { align-items: center; margin-bottom: 8px; }
.int-sheet .sheet-head h2 { font: 600 22px/28px var(--font-display); }
.int-sheet .kind { font-size: 13px; color: var(--text-3); }
#int-sheet-body h4 { margin: 20px 0 6px; font: 600 14px/20px var(--font-ui); color: var(--text-1); }
#int-sheet-body p { margin: 0 0 10px; font-size: 14px; line-height: 22px; color: var(--text-2); overflow-wrap: break-word; }
#int-sheet-body p code { white-space: normal; overflow-wrap: anywhere; }
#int-sheet-body .code-group { margin: 8px 0 12px; }
#int-sheet-body pre { font-size: 12.5px; line-height: 20px; }
#int-sheet-body .links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; }
#int-sheet-body .links a { color: var(--text-1); text-decoration: none; border-bottom: 1px solid var(--accent-line); font-size: 14px; }
.sheet-warn { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn-text) !important; }
.empty { padding: 48px 0; text-align: center; color: var(--text-3); }
.excluded { margin-top: 48px; padding: 20px 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-soft); }
.excluded h2 { margin: 0 0 6px; font: 600 18px/24px var(--font-display); color: var(--text-1); }
.excluded > p { margin: 0 0 8px; font-size: 14px; color: var(--text-3); }
.excluded .table-wrap { margin: 0; }
.excluded table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 21px; }
.excluded th { text-align: left; font-weight: 500; color: var(--text-1); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line-2); }
.excluded td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: top; }
.excluded tr:last-child td { border-bottom: 0; }
.excluded strong { color: var(--text-1); font-weight: 500; }

/* ---------------- models ---------------- */
.models-shell { display: flex; align-items: flex-start; max-width: 1600px; margin: 0 auto; }
.filters {
  position: sticky; top: var(--header-height); width: 264px; flex: none; height: calc(100vh - var(--header-height)); overflow-y: auto; padding: 12px 16px 40px 24px;
  border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.fgroup { border-bottom: 1px solid var(--line); }
.fgroup > button {
  width: 100%; display: flex; align-items: center; gap: 10px; height: 47px; padding: 12px 8px 12px 0; border: 0; background: transparent;
  font: 500 14px/20px var(--font-ui); color: var(--text-1); text-align: left;
}
.fgroup > button .ico { color: var(--text-3); }
.fgroup > button .chev { margin-left: auto; width: 16px; height: 16px; color: var(--text-4); transition: transform .15s ease; }
.fgroup[data-open="true"] > button .chev { transform: rotate(180deg); }
.fgroup .fbody { display: none; padding: 0 0 12px; }
.fgroup[data-open="true"] .fbody { display: block; }
.check { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 8px 0 4px; border-radius: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check:hover { background: var(--bg-hover); color: var(--text-1); }
.check input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; flex: none; border-radius: 4px; border: 1px solid var(--ring); background: var(--bg-soft); display: grid; place-items: center; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #0C0F12; border-bottom: 2px solid #0C0F12; transform: translateY(-1px) rotate(-45deg); }
.check .n { margin-left: auto; font-size: 12px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.range { padding: 6px 6px 4px 4px; }
.range input[type=range] { width: 100%; accent-color: var(--accent); }
.range .ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-4); }
.range .val { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.fhead { display: none; align-items: center; justify-content: space-between; padding: 4px 0 6px; }
.fhead b { font: 600 16px/22px var(--font-display); color: var(--text-1); }
.f-actions { display: flex; gap: 8px; margin-top: 14px; }
.f-actions .reset { flex: 1; }
.filters-back { position: fixed; inset: 0; z-index: 59; background: var(--overlay); }
.filters-back[hidden] { display: none; }
.mcontent { flex: 1; min-width: 0; padding: 24px 24px 64px; }
.mhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mhead h1 { margin: 0; font: 600 22px/28px var(--font-display); color: var(--text-1); letter-spacing: -.3px; }
.mhead h1 small { font: 400 14px/1 var(--font-ui); color: var(--text-3); margin-left: 8px; letter-spacing: 0; }
.mtools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mtools .field { flex: 1 1 320px; }
.alias-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 10px; color: var(--text-2); font-size: 14px; cursor: pointer; }
.alias-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.sel {
  height: 38px; padding: 0 32px 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-soft); color: var(--text-1); font-size: 14px;
  appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat;
}
.sel option { background: var(--bg-elev); color: var(--text-1); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--line); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-3); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--bg-elev); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.seg svg { width: 14px; height: 14px; }
.cats { display: flex; gap: 2px; margin: 16px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 43px; padding: 0 14px; border: 0; background: transparent; font: 500 14px/1 var(--font-ui); color: var(--text-3); white-space: nowrap; }
.cat .n { color: var(--text-4); font-variant-numeric: tabular-nums; }
.cat:hover { color: var(--text-1); }
.cat[aria-selected="true"] { color: var(--accent-ink); }
.cat[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.mtable-wrap { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.mtable { width: 100%; min-width: 880px; border-collapse: collapse; font-size: 14px; }
.mtable th { position: sticky; top: 0; z-index: 1; height: 46px; padding: 10px 16px; text-align: left; font-weight: 500; color: var(--text-3); background: var(--bg-elev); border-bottom: 1px solid var(--line); white-space: nowrap; }
.mtable th.num, .mtable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mtable th button { border: 0; background: transparent; padding: 0; color: inherit; font: inherit; display: inline-flex; gap: 6px; align-items: center; }
.mtable th button:hover { color: var(--text-1); }
.mtable th button[data-dir] { color: var(--accent-ink); }
.mtable td { height: 52px; padding: 8px 16px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
.mtable tr:last-child td { border-bottom: 0; }
.mtable tbody tr { cursor: pointer; }
.mtable tbody tr:hover td { background: var(--bg-hover); }
.mname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mav { width: 24px; height: 24px; flex: none; border-radius: 7px; display: grid; place-items: center; font: 600 10.5px/1 var(--font-display); color: var(--text-1); background: var(--bg-hover); border: 1px solid var(--line-2); }
.mname a { color: var(--text-1); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; font-weight: 500; }
.mname a:hover { text-decoration-color: var(--accent); }
.mid { display: block; font: 400 12px/16px var(--font-mono); color: var(--text-4); }
.alias { font: 500 11px/1 var(--font-ui); padding: 3px 6px; border-radius: 999px; color: var(--text-3); border: 1px solid var(--line-2); white-space: nowrap; }
.mpointer { display: block; margin-top: 5px; font-size: 13px; line-height: 20px; color: var(--text-3); overflow-wrap: anywhere; }
.mcard .mname a { overflow-wrap: anywhere; }
.fmts { display: flex; flex-wrap: wrap; gap: 4px; }
.mtable .fmts { flex-wrap: nowrap; }
.mtable td:first-child { max-width: 360px; }
.mtable .mname a { overflow-wrap: anywhere; }
.fm { font: 500 11px/1 var(--font-mono); padding: 4px 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--text-3); white-space: nowrap; }
.fm.chat { color: var(--accent-ink); } .fm.messages { color: var(--fm-messages); } .fm.gemini { color: var(--fm-gemini); } .fm.responses { color: var(--fm-responses); }
.dash { color: var(--text-4); }
.price-unit { display: block; font-size: 12px; line-height: 16px; color: var(--text-3); white-space: nowrap; }
.pv { color: var(--text-1); }
.pu { font-size: 12px; color: var(--text-4); }
.mlist { display: grid; gap: 8px; margin-top: 12px; }
.mcard { padding: 16px 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-soft); cursor: pointer; }
.mcard:hover { border-color: var(--line-2); }
.mcard-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mcard-top b { font: 600 16px/22px var(--font-display); color: var(--text-1); }
.mcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--text-3); }
.mcard-meta > span + span { padding-left: 14px; border-left: 1px solid var(--line-2); }
/* curated description (models.json "description") and models announced before the live catalogue ("pending") */
.mdesc { margin: 8px 0 0; max-width: 78ch; font-size: 13.5px; line-height: 20px; color: var(--text-2);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.mcard-meta .mnote code { font-size: 12px; }
.soon { font: 500 11px/1 var(--font-ui); padding: 3px 6px; border-radius: 999px; color: var(--warn-text); background: var(--warn-bg); border: 1px solid var(--warn-line); white-space: nowrap; }
.more-row { display: flex; justify-content: center; margin-top: 16px; }
.mcount { font-size: 13px; color: var(--text-3); margin-left: auto; white-space: nowrap; }
.fab-filter { display: none; }

/* model sheet */
.sheet { position: fixed; inset: 0; z-index: 75; display: none; }
.sheet.open { display: block; }
.sheet-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(720px, 100vw); background: var(--bg); border-left: 1px solid var(--line-2);
  overflow-y: auto; padding: 22px 28px 48px; box-shadow: var(--shadow-pop); animation: sheetin .18s ease-out;
}
@keyframes sheetin { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; }
.sheet-head h2 { margin: 0; font: 600 22px/28px var(--font-display); color: var(--text-1); letter-spacing: -.3px; overflow-wrap: anywhere; }
.sheet-head .icon-btn { margin-left: auto; }
.idline { display: flex; align-items: center; gap: 8px; margin: 8px 0 18px; font: 400 13px/1 var(--font-mono); color: var(--text-2); }
.idline button { height: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text-3); font: 500 12px/1 var(--font-ui); }
.idline button:hover { color: var(--text-1); }
.statcards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 22px; }
.sc { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft); min-width: 0; }
.sc small { display: block; font: 500 11px/14px var(--font-ui); letter-spacing: .3px; text-transform: uppercase; color: var(--text-4); margin-bottom: 4px; }
.sc b { display: block; font: 500 15px/20px var(--font-ui); color: var(--text-1); overflow-wrap: anywhere; }
.sc b em { font-style: normal; font-size: 12px; color: var(--text-3); font-weight: 400; }
.sheet h3 { margin: 22px 0 10px; font: 600 16px/22px var(--font-display); color: var(--text-1); }
.sheet table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sheet th { text-align: left; font-weight: 500; color: var(--text-3); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.sheet td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: top; }
.sheet td.num, .sheet th.num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet .tw { overflow-x: auto; }
.sheet td code { white-space: nowrap; font-size: 12px; }
.sheet .note-s { font-size: 13px; line-height: 20px; color: var(--text-3); margin: 10px 0 0; }
.sheet .note-s code { white-space: normal; }
.sheet .idline + .note-s { margin: 0 0 16px; }
.sheet .mdesc-full { margin: 0 0 10px; font-size: 14.5px; line-height: 22px; color: var(--text-2); }
.sheet .soon-note { padding: 10px 12px; border-radius: 10px; color: var(--warn-text); background: var(--warn-bg); border: 1px solid var(--warn-line); }
.sheet .note-s + .statcards, .sheet .mdesc-full + .statcards { margin-top: 16px; }
/* curated card text (models.json "about", safe markdown subset rendered by models.js) */
.sheet .mabout { max-width: 68ch; font-size: 14.5px; line-height: 23px; color: var(--text-2); }
.sheet .mabout > :first-child { margin-top: 0; }
.sheet .mabout p { margin: 0 0 12px; }
.sheet .mabout h4 { margin: 22px 0 8px; font: 600 15px/22px var(--font-display); color: var(--text-1); }
.sheet .mabout ul, .sheet .mabout ol { margin: 0 0 14px; padding-left: 22px; }
.sheet .mabout li { margin: 0 0 7px; padding-left: 2px; }
.sheet .mabout li::marker { color: var(--text-4); }
.sheet .mabout ol > li::marker { font-variant-numeric: tabular-nums; }
.sheet .mabout strong { font-weight: 600; color: var(--text-1); }
.sheet .mabout code { padding: 1px 5px; font-size: 12.5px; white-space: normal; overflow-wrap: anywhere; }
.meth { margin: 0 0 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-soft); min-width: 0; }
.meth header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.meth header b { font: 600 14px/20px var(--font-ui); color: var(--text-1); }
.meth header code { font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.meth dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; margin: 0; }
.meth dt { font: 500 11px/14px var(--font-ui); letter-spacing: .3px; text-transform: uppercase; color: var(--text-4); }
.meth dd { margin: 2px 0 0; font-size: 14px; line-height: 20px; color: var(--text-1); font-variant-numeric: tabular-nums; }
.meth dd em { font-style: normal; font-size: 12px; color: var(--text-3); }

/* ---------------- responsive ---------------- */
@media (max-width: 1279px) {
  .toc { display: none; }
  .main { padding-left: 40px; }
  .main .article { max-width: 896px; }
  .code-panel { display: none; }
  .code-inline-api { display: block; }
  .main.api .article { max-width: 760px; }
  .hdr-links { display: none; }
}
@media (max-width: 1023px) {
  :root { --header-height: 165px; }
  .sidebar { display: none; }
  .main { padding: 24px 0 0; }
  .shell { padding: 0 20px; }
  .hdr-row { padding: 0 16px; }
  .hdr-tabs { gap: 20px; }
  .hdr-mobile { display: flex; height: 52px; gap: 10px; border-top: 1px solid var(--line); }
  .hdr-search { width: 36px; padding: 0; justify-content: center; }
  .hdr-search span, .hdr-search kbd { display: none; }
  .hdr-actions { margin-left: 12px; gap: 6px; }
  .hdr-actions .btn { height: 32px; padding: 0 10px; font-size: 13px; }
  .page-wide { padding: 24px 20px 56px; }
  .int-hero { grid-template-columns: 1fr; }
  .filters {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 60; width: auto; height: auto; max-height: 78vh; border-right: 0; border-top: 1px solid var(--line-2);
    border-radius: 18px 18px 0 0; background: var(--bg); box-shadow: var(--shadow-pop); transform: translateY(102%); transition: transform .2s ease; padding: 8px 20px 28px;
  }
  .filters.open { transform: none; }
  .filters .sheet-grip { display: block; }
  .fab-filter {
    display: inline-flex; position: fixed; right: 16px; bottom: 20px; z-index: 65; height: 40px; padding: 0 16px; border-radius: 999px;
    box-shadow: var(--shadow-pop); clip-path: none;
  }
  .mcontent { padding: 18px 16px 88px; }
  .statcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.f-done { display: none; }
@media (max-width: 1023px) { .f-done { display: inline-flex; flex: 1; clip-path: none; } .fhead { display: flex; } body.filters-open .fab-filter { display: none; } }
.sheet-grip { display: none; width: 44px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 4px auto 8px; }
@media (max-width: 720px) {
  #int-sheet-body pre code, .article pre.ln code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .copy-page span { display: none; }
  .copy-page { width: 32px; padding: 0; }
  .brand .brand-sub { display: none; }
  .cards { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr 1fr; }
  .pager a { max-width: 100%; }
  .int-hero h1 { font-size: 32px; line-height: 38px; }
  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { min-width: 0; padding: 10px 12px; }
  .int-tools { position: static; }
  .int-group > header { flex-direction: column; gap: 4px; }
  .int-tools .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
  .int-tools .chips::-webkit-scrollbar { display: none; }
  .grid { grid-template-columns: 1fr; }
  .mhead { flex-wrap: wrap; }
  .mtools .sel { flex: 1 1 140px; min-width: 0; }
  .sheet-panel { padding: 18px 16px 40px; }
  .mtable th:first-child, .mtable td:first-child { position: sticky; left: 0; z-index: 2; background: var(--bg); box-shadow: 1px 0 0 var(--line); max-width: 190px; }
  .mtable th:first-child { background: var(--bg-elev); z-index: 3; }
  .foot-in { padding: 22px 20px 30px; }
}
@media (max-width: 480px) {
  :root { --header-height: 205px; }
  .hdr-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); height: 88px; gap: 0; }
  .hdr-tabs .tab { height: 44px; justify-content: center; }
  .article h1 { font-size: 30px; line-height: 36px; letter-spacing: -.75px; }
  .page-head { align-items: flex-start; }
  .shell { padding: 0 16px; }
  .ask { flex-direction: column; align-items: flex-start; }
  .hdr-actions { margin-left: 8px; gap: 4px; }
  .hdr-actions .btn { height: 34px; padding: 0 12px; }
  /* «Войти» stays as the primary button, «Регистрация» is in the drawer */
  .hdr-actions .hdr-signup { display: none; }
  .hdr-actions .hdr-login {
    background: var(--cta-bg); color: var(--cta-fg); border-color: transparent; border-radius: 10px;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  }
  .hdr-actions .hdr-login:hover { background: var(--cta-hover); }
  .hdr-actions .hdr-login:focus-visible { clip-path: none; }
  .brand svg { height: 19px; }
  .mcard { padding: 14px 16px; }
  .mdesc { -webkit-line-clamp: 3; line-clamp: 3; }
  .flow { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Keep the loaded catalogue count inside the mobile viewport. */
@media (max-width: 600px) {
  .mcount { white-space: normal; line-height: 1.5; }
}

.app[hidden] { display: none; }
h1, h2 { text-wrap: balance; }
.int-hero p { text-wrap: pretty; }
html[lang="fr-ca" i] .int-hero p { text-wrap: balance; }
html[lang="nb" i] .int-hero h1 { text-wrap: balance; }
html[dir="rtl"] :is(pre, code, kbd), html[dir="rtl"] .cg-body {
  direction: ltr; unicode-bidi: isolate; text-align: left;
}
html[dir="rtl"] svg:has(> use[href="#i-arrow"]) { transform: scaleX(-1); }
html[dir="rtl"] .cabinet-plans :is(.amt, .big, .roll, .badge, .seg) { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .cabinet-plans .unit { direction: rtl; unicode-bidi: isolate; }
html[dir="rtl"] .cabinet-plans .plan > :is(.plan-cap, .amt, .price, .incl) { animation: none; }
.steps > li { padding-left: 0; padding-inline-start: 44px; }
.steps > li::before { left: auto; inset-inline-start: 0; }
.steps > li::after { left: auto; inset-inline-start: 14px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; unicode-bidi: isolate; }
.fchip .n { margin-left: 0; margin-inline-start: 0; direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .fmt span, html[dir="rtl"] .fm { direction: ltr; unicode-bidi: isolate; }
html[lang="ar" i] .brand .brand-sub { font-family: var(--font-ui); letter-spacing: normal; }
html[lang="ja" i] body { line-break: strict; }
html[lang="ja" i] :is(h1, h2, h3, .sidebar .nav-link, .article td:first-child) { word-break: auto-phrase; }
html[lang="ja" i] .stat span { white-space: nowrap; word-break: keep-all; font-size: 11px; }
html:is([lang="ja" i], [lang="zh-hant-tw" i]) :is(p, td, th) { text-wrap: pretty; }
html:is([lang="ja" i], [lang="zh-hant-tw" i]) .article > .table-wrap:has(td > a[href$="/connect/openai-sdk/"]) td:first-child { min-width: 110px; white-space: nowrap; }
.article th { vertical-align: top; }
.fgroup > button { height: auto; min-height: 47px; text-wrap: balance; }
.foot-in > :first-child { text-wrap: balance; }
.nav-sub summary .chev { flex: none; margin-inline-start: auto; align-self: flex-start; margin-top: 3px; }
@media (min-width: 1024px) {
  html:is([lang="nl" i], [lang="nb" i], [lang="da" i]) .article > .table-wrap:has(td > a[href$="/connect/openai-sdk/"]) td:first-child { min-width: 180px; white-space: nowrap; }
}
html[lang="th" i] .stat span { overflow-wrap: normal; word-break: normal; }
html[lang="nl-be" i] .article > .table-wrap:has(td > a[href$="/connect/openai-sdk/"]) { max-width: 100%; overflow-x: auto; }
html[lang="nl-be" i] .article > .table-wrap:has(td > a[href$="/connect/openai-sdk/"]) th:first-child,
html[lang="nl-be" i] .article > .table-wrap:has(td > a[href$="/connect/openai-sdk/"]) td:first-child { min-width: 110px; white-space: nowrap; }
.article .cabinet-plans { --font: var(--font-ui); --serif: var(--font-display); }
.sidebar { scroll-padding-block: 40px; -webkit-mask-image: none; mask-image: none; }
.sidebar .nav-link { scroll-margin-block: 8px; }
.cg-bar { height: auto; min-height: 34px; padding-block: 5px; }
.cg-title { min-width: 0; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 18px; }
.cg-tools { align-self: flex-start; }
.app-top { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px 12px; align-items: start; }
.app-top > .st { grid-column: 2; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.app .kind, .int-group > header p { line-height: 1.5; }
.mcard-top { align-items: flex-start; }
.mcard-top .fmts { align-self: flex-start; }
.mpointer code { padding-inline: 0; }
.mtools { align-items: stretch; }
.mtools .field input, .mtools .sel { height: 44px; min-height: 44px; }
.mtools .sel { background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px; }
.mtools .alias-toggle { min-height: 44px; min-width: 0; padding-inline: 12px; line-height: 1.4; }
.mtools .alias-toggle input { flex: none; }
.filters .check { align-items: flex-start; padding-block: 6px; line-height: 1.3; }
.filters .check input { margin-top: 1px; }
.filters .check .n { line-height: 18px; }
/* Keep the outer code gutter fixed while long lines wrap inside it. */
@media (min-width: 721px) {
  pre { overflow-x: visible; padding-inline-end: 16px; }
  pre > code { display: block; width: 100%; min-width: 0; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding-inline-end: 16px; box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
}
@media (max-width: 720px) {
  html[dir="rtl"] .int-group > header { width: 100%; align-items: stretch; text-align: start; }
  html[dir="rtl"] .int-group > header > :is(h2, p) { width: 100%; text-align: start; }
  .article pre code, #int-sheet-body pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .mcard-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
  .mcard-meta > span + span { border-left: 0; padding-left: 0; }
  .mtools .sel, .mtools .alias-toggle { flex: 1 1 100%; width: 100%; }
}
/* Keep desktop permalinks at the writing-direction start without a mobile text gap. */
html[dir="rtl"] .article .anchor { left: auto; right: -32px; }
@media (max-width: 1023px) {
  .article h2 { padding-inline-start: 0; }
  .article h2 > .anchor { display: none; }
}
/* Keep headings measurable without forcing offscreen section contents. */
@supports (content-visibility: auto) and (contain-intrinsic-size: auto 600px) {
  .article > .ailoot-doc-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 600px;
    margin-top: var(--ailoot-section-margin-start);
    margin-bottom: var(--ailoot-section-margin-end);
  }
  .article > .ailoot-doc-section > :first-child { margin-top: 0; }
  .article > .ailoot-doc-section > :last-child { margin-bottom: 0; }
  .article > .ailoot-doc-section[data-ailoot-section-first-list] > ul:first-child > li:first-child { margin-top: 0; }
  .article > .ailoot-doc-section[data-ailoot-section-last-list] > ul:last-child > li:last-child { margin-bottom: 0; }
}
@media print {
  .article > .ailoot-doc-section {
    content-visibility: visible;
    contain-intrinsic-size: none;
  }
}
