/* Telegram user guide: page-specific styles. Builds on /style.css tokens. */

.tg-page .content { max-width: 1080px; }
.tg-page .docs-switcher { max-width: 1080px; }
.tg-page section { scroll-margin-top: 72px; }
.tg-page h2, .tg-page h3 { scroll-margin-top: 72px; position: relative; }

/* ── Heading anchors ─────────────────────────────────────────────── */
.hanchor {
  margin-left: 8px;
  color: var(--text-muted);
  opacity: 0;
  font-weight: 500;
  text-decoration: none !important;
  transition: opacity .15s, color .15s;
}
h2:hover .hanchor, h3:hover .hanchor, .hanchor:focus { opacity: 1; }
.hanchor:hover { color: var(--accent); }
@media (hover: none) { .hanchor { opacity: .45; } }

/* ── Hero ────────────────────────────────────────────────────────── */
.tg-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 48px 40px 40px;
  margin-bottom: 36px;
  background:
    radial-gradient(900px 320px at 85% -10%, #2aabee26, transparent 60%),
    radial-gradient(700px 300px at 0% 110%, #7b61ff1f, transparent 60%),
    var(--bg-secondary);
}
.tg-hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(#ffffff0d 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.tg-hero > * { position: relative; z-index: 1; }
.tg-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid #00d4ff33;
  padding: 4px 12px; border-radius: 999px; margin-bottom: 18px;
}
.tg-hero h1 { font-size: 46px; margin-bottom: 14px; }
.tg-hero h1 span { background: linear-gradient(90deg, #2aabee, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tg-hero .lead { max-width: 640px; font-size: 18px; margin-bottom: 28px; }
.tg-cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.tg-cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 28px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2aabee, #229ed9);
  color: #fff !important;
  font-size: 18px; font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 10px 30px -8px #2aabee88, inset 0 1px 0 #ffffff33;
  transition: transform .15s, box-shadow .15s;
}
.tg-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 36px -8px #2aabeeaa, inset 0 1px 0 #ffffff33; color: #fff; }
.tg-cta svg { width: 24px; height: 24px; flex-shrink: 0; }
.tg-cta-sub { font-size: 13.5px; color: var(--text-muted); }
.tg-stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.tg-stat { font-size: 13px; color: var(--text-muted); }
.tg-stat b { display: block; font-size: 20px; color: var(--text-primary); font-weight: 800; letter-spacing: -.02em; }

/* ── Mobile sticky TOC chips ─────────────────────────────────────── */
.tg-toc-m { display: none; }
@media (max-width: 900px) {
  .tg-toc-m {
    display: flex; gap: 8px;
    position: sticky; top: 0; z-index: 50;
    margin: 0 -16px 24px; padding: 10px 16px;
    background: #0a0e1aee;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    overflow-x: auto; scrollbar-width: none;
  }
  .tg-toc-m::-webkit-scrollbar { display: none; }
  .tg-toc-m a {
    flex-shrink: 0; font-size: 12.5px; font-weight: 600;
    padding: 5px 12px; border-radius: 999px;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-secondary); text-decoration: none !important;
  }
  .tg-toc-m a.active { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-glow); }
}

/* ── Two tables ──────────────────────────────────────────────────── */
.tg-split { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; margin: 8px 0 12px; }
.tg-panel {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden;
}
.tg-panel-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.tg-panel-head h3 { margin: 0 0 4px; font-size: 18px; }
.tg-panel-head p { margin: 0; font-size: 13.5px; }
.tg-panel.api { border-color: #7b61ff55; }
.tg-panel.api .tg-panel-head { background: linear-gradient(180deg, #7b61ff14, transparent); }
.tg-panel.tgp .tg-panel-head { background: linear-gradient(180deg, #2aabee14, transparent); }
.tg-panel table { width: 100%; border-collapse: collapse; }
.tg-panel th, .tg-panel td { padding: 10px 14px; font-size: 13.5px; text-align: left; vertical-align: top; }
.tg-panel thead th { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); background: transparent; }
.tg-panel tbody tr { background: transparent !important; border-bottom: 1px solid var(--border); }
.tg-panel tbody tr:last-child { border-bottom: 0; }
.tg-panel td:first-child { color: var(--text-primary); font-weight: 600; }
.tg-panel td .muted { display: block; font-weight: 400; color: var(--text-muted); font-size: 12.5px; }
.tg-panel td.price { white-space: nowrap; color: var(--success); font-weight: 600; }
.tg-panel .foot { padding: 14px 20px; font-size: 13px; color: var(--text-muted); border-top: 1px solid var(--border); }
.tg-panel .foot a { font-weight: 600; }
.botname { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 1100px) { .tg-split { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .tg-panel th, .tg-panel td { padding: 9px 10px; font-size: 13px; }
  .tg-panel thead { display: none; }
  .tg-panel tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; }
  .tg-panel tbody td { padding: 0; }
  .tg-panel tbody td:first-child { grid-column: 1; }
  .tg-panel tbody td.price { grid-column: 2; grid-row: 1; text-align: right; }
  .tg-panel tbody td.what { grid-column: 1 / -1; }
  .tg-panel tbody td.bot { grid-column: 1 / -1; }
}

/* ── Steps ───────────────────────────────────────────────────────── */
ol.tg-steps { list-style: none; counter-reset: s; padding: 0; margin: 20px 0; }
ol.tg-steps > li {
  counter-increment: s; position: relative;
  padding: 0 0 22px 56px; margin: 0;
}
ol.tg-steps > li::before {
  content: counter(s);
  position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: var(--bg-primary);
  background: linear-gradient(135deg, var(--accent), #2aabee);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
ol.tg-steps > li::after {
  content: ""; position: absolute; left: 17px; top: 40px; bottom: 4px; width: 2px;
  background: var(--border);
}
ol.tg-steps > li:last-child::after { display: none; }
ol.tg-steps > li > strong:first-child { display: block; font-size: 16px; margin-bottom: 2px; padding-top: 5px; }
ol.tg-steps li p { margin: 4px 0 0; }
ol.tg-steps.compact > li { padding-left: 44px; padding-bottom: 14px; }
ol.tg-steps.compact > li::before { width: 28px; height: 28px; font-size: 13px; }
ol.tg-steps.compact > li::after { left: 13px; top: 32px; }
ol.tg-steps.compact > li > strong:first-child { font-size: 15px; padding-top: 2px; }

/* ── Inline command chip with copy ───────────────────────────────── */
.cmd {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: .88em;
  background: var(--bg-code); border: 1px solid var(--border);
  color: var(--accent); padding: 1px 4px 1px 8px; border-radius: 6px;
  white-space: nowrap; vertical-align: baseline;
}
.cmd button {
  all: unset; cursor: pointer;
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 4px;
  color: var(--text-muted);
}
.cmd button:hover, .cmd button:focus-visible { color: var(--text-primary); background: var(--bg-card-hover); }
.cmd button:focus-visible { outline: 2px solid var(--accent); }
.cmd button svg { width: 13px; height: 13px; }
.cmd button.ok { color: var(--success); }

/* ── Feature guide cards ─────────────────────────────────────────── */
.guide {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  padding: 26px; margin: 22px 0;
}
.guide h3 { margin-top: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.guide .tagline { margin-top: -6px; }
.pill {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
  padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border-light);
  color: var(--text-secondary); background: var(--bg-secondary); white-space: nowrap;
}
.pill.free { color: var(--success); border-color: #00e68a55; }
.pill.paid { color: var(--warning); border-color: #ffb02055; }
.pill.bot { color: #6ab3f3; border-color: #2aabee55; font-family: var(--font-mono); font-weight: 600; }
.guide ul, .guide ol { margin-bottom: 12px; }
.guide .note { font-size: 13px; color: var(--text-muted); margin-top: 10px; }
@media (max-width: 1000px) { .guide { grid-template-columns: 1fr; padding: 18px; gap: 18px; } }

/* ── Mock Telegram chat (light/dark aware) ───────────────────────── */
.tgchat {
  --tg-wall: #99ba92;
  --tg-wall2: #c3d7a4;
  --tg-bub: #ffffff;
  --tg-text: #000000;
  --tg-sub: #707579;
  --tg-link: #168acd;
  --tg-name: #3a8ed4;
  --tg-btn: #00000030;
  --tg-btntext: #ffffff;
  --tg-code: #00000010;
  --tg-quote: #168acd;
  --tg-quotebg: #168acd14;
  --tg-head: #ffffff;
  --tg-headtext: #000000;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border);
  align-self: start;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  box-shadow: 0 20px 40px -20px #000c;
}
@media (prefers-color-scheme: dark) {
  .tgchat {
    --tg-wall: #0e1621;
    --tg-wall2: #17212b;
    --tg-bub: #182533;
    --tg-text: #f5f5f5;
    --tg-sub: #6d7f8f;
    --tg-link: #6ab3f3;
    --tg-name: #6ab3f3;
    --tg-btn: #ffffff1c;
    --tg-btntext: #ffffff;
    --tg-code: #ffffff12;
    --tg-quote: #6ab3f3;
    --tg-quotebg: #6ab3f31a;
    --tg-head: #17212b;
    --tg-headtext: #f5f5f5;
  }
}
.tgchat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: var(--tg-head); color: var(--tg-headtext);
  border-bottom: 1px solid #0000001a;
}
.tgchat-ava {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, #00d4ff, #2a7bee);
}
.tgchat-head b { display: block; font-size: 14.5px; line-height: 1.2; }
.tgchat-head small { display: block; font-size: 12px; color: var(--tg-sub); line-height: 1.2; }
.tgchat-body {
  padding: 14px 10px 12px;
  background:
    radial-gradient(circle at 20% 20%, #ffffff14 0 2px, transparent 3px) 0 0 / 38px 38px,
    radial-gradient(circle at 70% 60%, #ffffff10 0 1.5px, transparent 2.5px) 0 0 / 30px 30px,
    linear-gradient(160deg, var(--tg-wall2), var(--tg-wall));
}
.bub {
  position: relative; max-width: 100%;
  background: var(--tg-bub); color: var(--tg-text);
  border-radius: 12px 12px 12px 4px;
  padding: 7px 10px 18px; font-size: 13.8px; line-height: 1.42;
  box-shadow: 0 1px 1px #0000002a;
  word-wrap: break-word; overflow-wrap: anywhere;
}
.bub p { color: inherit; margin: 0 0 6px; font-size: inherit; line-height: inherit; }
.bub p:last-of-type { margin-bottom: 0; }
.bub b { font-weight: 700; color: inherit; }
.bub a { color: var(--tg-link) !important; text-decoration: none !important; }
.bub code { background: var(--tg-code); color: inherit; border: 0; font-size: 12.5px; padding: 1px 4px; border-radius: 4px; word-break: normal; overflow-wrap: anywhere; }
.bub .q {
  border-left: 3px solid var(--tg-quote); background: var(--tg-quotebg);
  border-radius: 4px; padding: 4px 8px; margin: 4px 0 6px; font-size: 13px;
}
.bub .sub { color: var(--tg-sub); font-size: 12.5px; }
.bub .time { position: absolute; right: 9px; bottom: 4px; font-size: 11px; color: var(--tg-sub); }
.bub .from { display: block; color: var(--tg-name); font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.kb { display: grid; gap: 4px; margin-top: 4px; }
.kb .row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.kb span {
  display: block; text-align: center;
  background: var(--tg-btn); color: var(--tg-btntext);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-radius: 8px; padding: 7px 6px; font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bub-caption { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 8px; }
.bub + .bub, .kb + .bub { margin-top: 8px; }

/* ── Plans ───────────────────────────────────────────────────────── */
.tg-plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 20px; }
.tg-plan { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.tg-plan.hl { border-color: var(--accent-dim); box-shadow: 0 0 0 1px var(--accent-dim) inset, 0 10px 30px -16px var(--accent); }
.tg-plan h4 { margin: 0 0 2px; font-size: 14px; color: var(--text-secondary); }
.tg-plan .amt { font-size: 26px; font-weight: 800; color: var(--text-primary); letter-spacing: -.02em; }
.tg-plan .amt small { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.tg-plan .lim { font-size: 13px; color: var(--text-secondary); }
@media (max-width: 900px) { .tg-plans { grid-template-columns: repeat(2, 1fr); } }

/* ── FAQ ─────────────────────────────────────────────────────────── */
.faq details {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  margin: 10px 0; transition: border-color .15s;
}
.faq details[open] { border-color: var(--border-light); }
.faq summary {
  cursor: pointer; list-style: none; padding: 14px 44px 14px 18px; position: relative;
  font-weight: 600; color: var(--text-primary); font-size: 15px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 20px; color: var(--accent); font-weight: 400; transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq .ans { padding: 0 18px 14px; }
.faq .ans p, .faq .ans li { font-size: 14px; }
.faq .ans p:last-child { margin-bottom: 0; }

/* ── Cheat sheet ─────────────────────────────────────────────────── */
.cheat td:first-child { white-space: nowrap; }
.cheat .bothead td { background: var(--bg-secondary) !important; color: var(--text-primary); font-weight: 700; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }

/* ── Support card ────────────────────────────────────────────────── */
.tg-support {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 24px; border-radius: 14px; border: 1px solid var(--border);
  background: linear-gradient(135deg, #2aabee14, #7b61ff10), var(--bg-card);
}
.tg-support p { margin: 0; }

@media (max-width: 900px) {
  .tg-hero { padding: 28px 18px 24px; border-radius: 14px; }
  .tg-hero h1 { font-size: 30px; }
  .tg-hero .lead { font-size: 15.5px; }
  .tg-cta { font-size: 16px; padding: 14px 20px; width: 100%; justify-content: center; }
}
@media (max-width: 400px) {
  .tg-plans { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tg-plan { padding: 12px; }
  .tg-plan .amt { font-size: 22px; }
}

.cheat td:first-child { white-space: normal; }
.cheat td .cmd { margin: 2px 0; }
@media (max-width: 560px) {
  .cheat thead { display: none; }
  .cheat tr, .cheat td { display: block; }
  .cheat td { padding: 6px 12px; border-bottom: 0; }
  .cheat tbody tr { padding: 4px 0; border-bottom: 1px solid var(--border); }
  .cheat td + td { padding-top: 0; font-size: 13px; }
}
@media (max-width: 400px) {
  .tg-page .content { padding-left: 16px; padding-right: 16px; }
}
.tg-page .content a.botname { text-decoration: none; }
.tg-panel td:first-child { width: 34%; }
.tg-panel td.what { width: auto; }
@media (max-width: 900px) { .tg-page .content { padding-top: 16px; } }
@media (max-width: 560px) { .tg-panel td:first-child { width: auto; } }
