/* modelrouting — design system (dark, gradient, glass) */
:root {
  --tg-header: 0px;
  --tg-safe-top: 0px;
  --tg-safe-bottom: 0px;
  --tg-safe-left: 0px;
  --tg-safe-right: 0px;
  --tg-vh: 100vh;
  --bg: #07090f;
  --panel: #0d1119;
  --panel2: #101523;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.3);
  --text: #e8ecf4;
  --dim: #98a2b8;
  --faint: #5c6578;
  --accent: #8b7cff;
  --accent2: #4cc9f0;
  --good: #4ade80;
  --warn: #fbbf24;
  --grad: linear-gradient(120deg, #8b7cff, #4cc9f0);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html { max-width: 100%; }
body { max-width: 100%; overflow-x: hidden; }
body:not(.tg) { overflow-x: visible; }
body {
  margin: 0;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(139, 124, 255, 0.16), transparent 62%),
    radial-gradient(820px 480px at 88% -4%, rgba(76, 201, 240, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(#000 0%, transparent 70%);
  z-index: 0;
}
main, footer, .site { position: relative; z-index: 1; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: none; filter: brightness(1.15); }
:not(pre) > code {
  font: 0.88em/1.5 var(--mono);
  background: rgba(139, 124, 255, 0.1);
  border: 1px solid rgba(139, 124, 255, 0.22);
  border-radius: 5px;
  padding: 0.08em 0.4em;
  color: #c7bfff;
}
pre code { background: none; border: none; padding: 0; color: inherit; font: inherit; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: 2em; margin: 72px 0 8px; }
.sub { color: var(--dim); }
.section-sub { color: var(--dim); max-width: 620px; margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.site {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 15, 0.78);
  backdrop-filter: blur(12px);
}
.brand { display: flex; gap: 10px; align-items: center; font-weight: 800; font-size: 1.05em; color: var(--text); letter-spacing: -0.01em; }
.brand img { border-radius: 7px; }
.brand small { font-weight: 500; color: var(--faint); font-size: 0.8em; margin-left: 2px; }
nav { display: flex; gap: 22px; align-items: center; }
nav a { color: var(--dim); font-size: 0.92em; font-weight: 500; transition: color 0.15s; }
nav a:hover { color: var(--text); filter: none; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--grad);
  color: #0b0d14;
  font-weight: 700;
  font-size: 0.95em;
  padding: 10px 20px;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(139, 124, 255, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(139, 124, 255, 0.45); filter: none; }
.btn.ghost {
  background: rgba(148, 163, 184, 0.06);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.ghost:hover { background: rgba(148, 163, 184, 0.12); }
.site .btn { padding: 8px 16px; font-size: 0.88em; }

/* ---------- hero ---------- */
.hero { padding: 84px 0 8px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.06);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 20px;
}
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); }
.hero h1 { font-size: 3.35em; margin: 0 0 16px; }
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .sub { color: var(--dim); font-size: 1.1em; max-width: 540px; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* terminal mock */
.term {
  position: relative;
  background: rgba(10, 13, 20, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(139, 124, 255, 0.08), 0 0 64px rgba(139, 124, 255, 0.12);
}
.term-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.05);
  border-radius: 15px 15px 0 0;
}
.term-head i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-head i:nth-child(2) { background: #febc2e; }
.term-head i:nth-child(3) { background: #28c840; }
.term-head span { margin-left: 10px; font: 0.78em var(--mono); color: var(--faint); letter-spacing: 0.04em; }
.term-body { padding: 20px 20px 24px; font: 0.82em/1.9 var(--mono); color: var(--dim); overflow-x: auto; border-radius: 0 0 15px 15px; }
.t-line { display: block; opacity: 0; transform: translateY(6px); animation: t-in 0.6s ease forwards; white-space: nowrap; }
.t-line:nth-child(1) { animation-delay: 0.3s; }
.t-line:nth-child(2) { animation-delay: 1.1s; }
.t-line:nth-child(3) { animation-delay: 1.9s; }
.t-line:nth-child(4) { animation-delay: 2.7s; }
.t-line:nth-child(5) { animation-delay: 3.4s; }
@keyframes t-in { to { opacity: 1; transform: none; } }
.t-prompt { color: var(--good); }
.t-cmd { color: var(--text); }
.t-dim { color: var(--faint); }
.t-ok { color: var(--accent2); }
.t-data { color: var(--dim); }
.t-done { color: var(--good); }
.caret { display: inline-block; width: 8px; height: 1.1em; background: var(--accent2); vertical-align: text-bottom; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term-chip {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: -16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 16px;
  font: 0.72em var(--mono);
  color: var(--dim);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.term-chip b { color: var(--warn); font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .t-line { opacity: 1; transform: none; animation: none; }
  .caret { animation: none; }
}

/* stats strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 64px; }
.stat {
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}
.stat b { display: block; font-size: 1.55em; font-weight: 800; letter-spacing: -0.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 0.8em; color: var(--dim); }

/* ---------- pillars ---------- */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 28px; }
.pillar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  transition: transform 0.2s, border-color 0.2s;
}
.pillar:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.pillar .ic {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: rgba(139, 124, 255, 0.14);
  border: 1px solid rgba(139, 124, 255, 0.3);
  margin-bottom: 12px;
}
.pillar .ic svg { width: 20px; height: 20px; stroke: var(--accent); }
.pillar h3 { font-size: 1em; margin: 0 0 4px; }
.pillar p { font-size: 0.85em; color: var(--dim); margin: 0; }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 28px; counter-reset: step; }
.step { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.step .n {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--grad);
  color: #0b0d14;
  font-weight: 800;
  font-size: 0.95em;
  margin-bottom: 12px;
}
.step h3 { font-size: 0.98em; margin: 0 0 4px; }
.step p { font-size: 0.84em; color: var(--dim); margin: 0; }
.step p code { white-space: nowrap; }

/* ---------- pricing ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); gap: 18px; margin-top: 28px; justify-content: center; }
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
}
.card .tag { font-size: 0.72em; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.card.featured {
  background: linear-gradient(var(--panel2), var(--panel2)) padding-box, var(--grad) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 18px 60px rgba(139, 124, 255, 0.18);
}
.badge {
  position: absolute;
  top: -12px;
  left: 22px;
  background: var(--grad);
  color: #0b0d14;
  font-size: 0.68em;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 12px;
}
.card h3 { font-size: 1.15em; margin: 14px 0 2px; }
.price { font-size: 2.3em; font-weight: 800; letter-spacing: -0.03em; margin: 8px 0 14px; }
.price span { font-size: 0.36em; color: var(--dim); font-weight: 500; letter-spacing: 0; }
.card ul { list-style: none; padding: 0; margin: 0 0 20px; }
.card li { padding: 5px 0 5px 26px; position: relative; color: var(--dim); font-size: 0.92em; }
.card li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.4);
}
.card li::after {
  content: "";
  position: absolute;
  left: 4.5px; top: 0.85em;
  width: 6px; height: 3.5px;
  border-left: 1.6px solid var(--good);
  border-bottom: 1.6px solid var(--good);
  transform: rotate(-45deg);
}
.card .btn { width: 100%; justify-content: center; }
.fine { color: var(--faint); font-size: 0.84em; margin-top: 18px; }

/* ---------- models ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; padding: 0; list-style: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--mono);
  font-size: 0.88em;
  transition: transform 0.15s, border-color 0.2s;
}
.chip:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.chips.live .chip i { background: var(--good); box-shadow: 0 0 8px rgba(74, 222, 128, 0.8); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 2px rgba(74, 222, 128, 0.3); } }
.chip small { color: var(--faint); font-family: var(--font); font-size: 0.85em; }

/* ---------- setup tabs ---------- */
.tab-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 16px; }
.tab-btn {
  font: 0.88em var(--font);
  font-weight: 600;
  color: var(--dim);
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--text); border-color: var(--line-strong); }
.tab-btn.active {
  color: var(--text);
  background: rgba(139, 124, 255, 0.14);
  border-color: rgba(139, 124, 255, 0.5);
}
.tab-btn.soon { opacity: 0.55; cursor: default; }
.tab-btn.soon:hover { color: var(--dim); border-color: var(--line); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade-up 0.3s ease; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.codecard { position: relative; }
.codecard pre {
  background: #0a0d14;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0;
  font: 0.84em/1.75 var(--mono);
  color: #c9d2e3;
}
.codecard .tok-k { color: var(--accent2); }
.codecard .tok-s { color: #a5e0a1; }
.copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  font: 0.72em var(--font);
  font-weight: 600;
  color: var(--dim);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--line-strong); }
.copy-btn.ok { color: var(--good); border-color: rgba(74, 222, 128, 0.4); }

/* ---------- faq ---------- */
.faq-list { margin-top: 24px; }
.faq details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.faq details[open] { border-color: var(--line-strong); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.3em;
  font-weight: 400;
  color: var(--faint);
  transition: transform 0.2s;
  flex: none;
}
.faq details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.faq p { color: var(--dim); font-size: 0.92em; margin: 12px 0 2px; }

/* ---------- footer ---------- */
footer {
  max-width: 1120px;
  margin: 90px auto 0;
  padding: 26px 24px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 0.86em;
}
footer .fbrand { display: flex; align-items: center; gap: 10px; }
footer .fbrand img { width: 22px; height: 22px; border-radius: 5px; }
footer .flinks { display: flex; gap: 20px; }
footer a { color: var(--dim); }

/* ---------- docs ---------- */
.docs-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 56px; padding-top: 48px; }
.toc { position: sticky; top: 86px; align-self: start; }
.toc h2 { font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.12em; color: var(--faint); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; margin: 0; }
.toc a {
  display: block;
  color: var(--dim);
  font-size: 0.86em;
  padding: 5px 0 5px 34px;
  position: relative;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  font: 600 0.7em var(--mono);
  color: var(--faint);
  top: 8px;
}
.toc a:hover { color: var(--text); }
.docs h1 { font-size: 2.3em; margin: 0 0 10px; }
.docs h2 { scroll-margin-top: 90px; font-size: 1.45em; }
.docs p { color: var(--dim); }
.docs ul { color: var(--dim); padding-left: 20px; }
.docs li { margin: 6px 0; }
.docs b { color: var(--text); }
.codecard-doc { margin: 16px 0; }
.codecard-doc .code-head {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 10px 16px;
  font: 0.78em var(--mono);
  color: var(--faint);
}
.codecard-doc .code-head .m {
  font-weight: 700;
  font-size: 0.9em;
  padding: 2px 8px;
  border-radius: 6px;
}
.m.get { background: rgba(74, 222, 128, 0.14); color: var(--good); }
.m.post { background: rgba(139, 124, 255, 0.16); color: var(--accent); }
.codecard-doc pre {
  border-radius: 0 0 12px 12px;
  margin: 0;
}
.note {
  border-left: 3px solid var(--accent);
  background: rgba(139, 124, 255, 0.07);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  color: var(--dim);
  font-size: 0.9em;
  margin: 18px 0;
}
.note b { color: var(--text); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .term { max-width: 620px; }
  .docs-layout { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 4px 18px; }
  .toc h2 { width: 100%; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 0 18px; }
  .toc a { padding: 4px 0; }
  .toc a::before { display: none; }
}
@media (max-width: 720px) {
  .hero h1 { font-size: 2.3em; }
  .hero { padding-top: 56px; }
  .stats, .pillars, .steps { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .site { padding: 12px 16px; }
  nav a:not(.cta) { display: none; }
  h2 { margin-top: 56px; }
}

/* ---------- Telegram Mini App ---------- */
body.tg {
  --tg-header: 0px;
  background: var(--bg);
}
body.tg .site {
  padding-top: calc(10px + var(--tg-header));
  padding-left: calc(16px + var(--tg-safe-left));
  padding-right: calc(16px + var(--tg-safe-right));
}
body.tg main.wrap { padding-left: calc(18px + var(--tg-safe-left)); padding-right: calc(18px + var(--tg-safe-right)); }
body.tg footer {
  padding-left: calc(18px + var(--tg-safe-left));
  padding-right: calc(18px + var(--tg-safe-right));
  padding-bottom: calc(40px + var(--tg-safe-bottom) + 16px);
}
body.tg .hero { padding-top: 26px; }
body.tg .hero h1 { font-size: 1.72em; letter-spacing: -0.025em; }
body.tg .hero .sub { font-size: 0.92em; }
body.tg .eyebrow { margin-bottom: 14px; }
body.tg .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 34px; }
body.tg .stat { padding: 13px 14px; border-radius: 12px; }
body.tg .stat b { font-size: 1.25em; }
body.tg .stat span { font-size: 0.75em; }
body.tg h2 { font-size: 1.35em; margin-top: 42px; }
body.tg .pillars, body.tg .steps { grid-template-columns: 1fr; gap: 10px; }
body.tg .stats { grid-template-columns: 1fr 1fr; }
body.tg .pillar, body.tg .step { padding: 14px; border-radius: 12px; }
body.tg .cards { grid-template-columns: 1fr; gap: 14px; }
body.tg .card { padding: 20px; border-radius: 16px; }
body.tg .price { font-size: 2em; }
body.tg .term { border-radius: 14px; }
body.tg .term-body {
  font-size: 0.66em;
  line-height: 1.7;
  padding: 14px 12px 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
body.tg .term-body .t-line { white-space: inherit; }
body.tg .term-chip { position: static; margin: 0 0 0 2px; width: fit-content; }
body.tg .tab-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-left: calc(-1 * var(--tg-safe-left)); padding-left: var(--tg-safe-left); padding-right: var(--tg-safe-right); scrollbar-width: none; }
body.tg .tab-bar::-webkit-scrollbar { display: none; }
body.tg .tab-btn { flex: none; }
body.tg .codecard pre {
  font-size: 0.68em;
  padding: 12px 12px 40px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
body.tg .codecard pre code { white-space: inherit; }
body.tg .tab-bar { padding-right: 4px; }
body.tg .copy-btn { bottom: 10px; right: 10px; }
body.tg .copy-btn { top: auto; bottom: 8px; right: 8px; }
body.tg .mra-tabs { top: calc(50px + var(--tg-header)); }
body.tg .mra-body { padding-bottom: calc(14px + var(--tg-safe-bottom)); }
body.tg .docs-layout { padding-top: 20px; gap: 18px; }
body.tg .toc {
  position: static;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
body.tg .toc h2 { margin: 0 0 8px; }
body.tg .toc ol { display: block; columns: 2; column-gap: 18px; }
body.tg .toc li { break-inside: avoid; }
body.tg .toc a { padding: 3px 0; font-size: 0.82em; }
body.tg .toc a::before { display: none; }
body.tg .docs h1 { font-size: 1.6em; }
body.tg h1 { font-size: 1.75em; }
body.tg .hero-cta { gap: 10px; flex-direction: column; align-items: stretch; }
body.tg .hero-cta .btn { justify-content: center; padding: 13px 16px; font-size: 0.94em; width: 100%; }
body.tg .site { gap: 10px; }
body.tg .brand { font-size: 0.98em; }
body.tg .site .btn { padding: 8px 14px; font-size: 0.84em; }
body.tg .tab-btn { padding: 8px 14px; font-size: 0.84em; }
body.tg .chip { padding: 8px 14px; font-size: 0.82em; }
body.tg .faq details { padding: 14px 16px; border-radius: 12px; }
body.tg footer { flex-direction: column; align-items: flex-start; gap: 10px; font-size: 0.82em; }
body.tg main.wrap { padding-left: calc(16px + var(--tg-safe-left)); padding-right: calc(16px + var(--tg-safe-right)); }
body.tg p, body.tg li { font-size: 0.95em; }

/* mini-app shell used by the bot's hosted page */
.mra-hide-site .site, .mra-hide-site footer { display: none; }
.mra-tabs {
  position: sticky;
  top: 0;
  z-index: 9;
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 15, 0.92);
  backdrop-filter: blur(12px);
}
.mra-tab {
  flex: 1;
  text-align: center;
  font: 600 0.86em var(--font);
  color: var(--dim);
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.mra-tab.active {
  color: var(--text);
  background: rgba(139, 124, 255, 0.16);
  border-color: rgba(139, 124, 255, 0.5);
}
.mra-pane { display: none; }
.mra-pane.active { display: block; }
.mra-body { padding: 16px 14px 14px; }
.mra-body h1 { font-size: 1.6em; margin: 0 0 8px; }
.mra-body h2 { font-size: 1.2em; margin: 0 0 12px; }
.mra-status {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.mra-status .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.9em; }
.mra-status .k { color: var(--faint); }
.mra-status .v { color: var(--text); font-family: var(--mono); font-size: 0.92em; text-align: right; word-break: break-all; }
.mra-empty { color: var(--dim); font-size: 0.9em; }

/* overflow guards: long unbroken strings (URLs, keys) must wrap, not widen */
.wrap, main { min-width: 0; }
.hero-grid, .hero-grid > div, .hero, section { min-width: 0; }
.hero-cta { flex-wrap: wrap; }
.hero-cta .btn { max-width: 100%; }
p, li, .sub, .section-sub, .fine, .mra-empty, figcaption { overflow-wrap: anywhere; word-break: break-word; }
.code-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.74em;
}
.code-head .m { flex: none; }
.docs p, .docs li, .docs b { overflow-wrap: anywhere; }
.docs-layout, .docs, .toc, .tab-panel, .codecard { min-width: 0; }
.codecard pre, pre { max-width: 100%; }
.toc ol { min-width: 0; }
.term-body { max-width: 100%; }
