/* Route Planner Teams — гайды для диспетчера (/teams/guides/, scripts/build-teams-guides.js).
   Поверх how-to.css (токены, шапка, подвал, хлебные крошки) и teams.css (кнопки .tp-btn, выбор языка, ссылки языков). */

.tg-main { padding-top: 24px; }
.tg-inner { max-width: 760px; margin: 0 auto; }
.tg-article, .tg-lead, .tg-section p, .tg-section li, .tg-card__text { overflow-wrap: break-word; }

.tg-kicker {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.tg-h1 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4.2vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  text-wrap: balance;
}
.tg-lead {
  margin: 0 0 24px;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.tg-lead a, .tg-section a, .tg-hub-about a { color: var(--accent); font-weight: 600; text-decoration: none; }
.tg-lead a:hover, .tg-section a:hover, .tg-hub-about a:hover { text-decoration: underline; }

/* В этом гайде */
.tg-toc {
  margin: 0 0 8px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tg-toc__title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tg-toc ol { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.tg-toc li { line-height: 1.45; color: var(--text-muted); }
.tg-toc a { color: var(--text); font-weight: 600; text-decoration: none; }
.tg-toc a:hover { color: var(--accent); }

/* Разделы */
.tg-section { margin-top: 36px; scroll-margin-top: calc(5.5rem + env(safe-area-inset-top, 0px)); }
.tg-section h2 {
  margin: 0 0 12px;
  font-size: clamp(1.3rem, 2.6vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}
.tg-section p { margin: 0 0 14px; font-size: 1.02rem; line-height: 1.65; color: var(--text); }
.tg-ui { font-weight: 700; color: var(--text); }

/* Шаги: номер в плашке, как .tp-step__num страницы команд */
.tg-steps { list-style: none; counter-reset: tg-step; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.tg-steps > li {
  counter-increment: tg-step;
  position: relative;
  padding-left: 42px;
  min-height: 28px;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text);
}
.tg-steps > li::before {
  content: counter(tg-step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(93, 95, 239, 0.12);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1;
}
.tg-list { margin: 0 0 16px; padding-left: 1.25em; display: grid; gap: 8px; }
.tg-list li { font-size: 1.02rem; line-height: 1.6; color: var(--text); }
.tg-list li::marker { color: var(--accent); }

/* Надписи сайта и что они значат */
.tg-defs { margin: 0 0 16px; display: grid; gap: 10px; }
.tg-def {
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.tg-def dt { margin: 0 0 4px; font-weight: 700; color: var(--text); line-height: 1.4; }
.tg-def dd { margin: 0; color: var(--text-muted); line-height: 1.6; }

.tg-note {
  margin: 0 0 16px;
  padding: 14px 18px;
  background: rgba(93, 95, 239, 0.06);
  border: 1px solid rgba(106, 111, 230, 0.22);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
}
.tg-section p.tg-note { font-size: 0.98rem; line-height: 1.6; }

/* Таблица-пример */
.tg-table { margin: 4px 0 18px; }
.tg-table__scroll {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.tg-table table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tg-table th, .tg-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tg-table th { font-weight: 700; color: var(--text); background: var(--surface); }
.tg-table td { color: var(--text-muted); }
.tg-table tbody tr:last-child td { border-bottom: none; }
.tg-table figcaption, .tg-fig figcaption { margin-top: 8px; font-size: 0.9rem; line-height: 1.5; color: var(--text-muted); }

/* Снимок экрана (рисуется, только если файл есть) */
.tg-fig { margin: 6px 0 22px; }
.tg-fig--narrow img { max-width: 400px; margin: 0 auto; }
.tg-fig--narrow figcaption { text-align: center; }
.tg-fig img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.3), 0 6px 18px -12px rgba(99, 102, 241, 0.2);
}

/* Предыдущий / следующий */
.tg-pager {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.tg-pager__link {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tg-pager__link:hover { border-color: rgba(106, 111, 230, 0.5); box-shadow: 0 4px 18px -10px rgba(99, 102, 241, 0.45); }
.tg-pager__link:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.tg-pager__link--next { grid-column: 2; text-align: right; }
.tg-pager__label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.tg-pager__title { font-weight: 700; color: var(--text); line-height: 1.35; }
.tg-all { margin: 18px 0 0; text-align: center; }
.tg-all a { color: var(--accent); font-weight: 700; text-decoration: none; }
.tg-all a:hover { text-decoration: underline; }

/* Оглавление гайдов */
.tg-cards { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.tg-card__link {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tg-card__link:hover { border-color: rgba(106, 111, 230, 0.5); box-shadow: 0 6px 22px -12px rgba(99, 102, 241, 0.45); }
.tg-card__link:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.tg-card__num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(93, 95, 239, 0.12);
  color: var(--accent);
  font-weight: 800;
}
.tg-card__body { display: grid; gap: 4px; min-width: 0; }
.tg-card__title { font-size: 1.08rem; font-weight: 700; color: var(--text); line-height: 1.35; }
.tg-card__text { color: var(--text-muted); line-height: 1.55; font-size: 0.97rem; }
.tg-hub-about { margin: 28px 0 0; color: var(--text-muted); line-height: 1.6; text-align: center; }
/* Оглавление (21.10.2026): вводный абзац и заголовок списка гайдов. */
.tg-intro { margin: 0 0 28px; color: var(--text); font-size: 1rem; line-height: 1.65; }
.tg-hub-title { margin: 0 0 12px; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; color: var(--text); }

@media (max-width: 640px) {
  .tg-main { padding-top: 16px; }
  .tg-lead { font-size: 1.04rem; }
  .tg-section { margin-top: 30px; }
  .tg-toc { padding: 16px 18px; }
  .tg-pager { grid-template-columns: minmax(0, 1fr); }
  .tg-pager__link--next { grid-column: auto; text-align: left; }
  .tg-card__link { padding: 16px; gap: 14px; }
}
