/* Такиватанга — «Лесной свет». Дизайн-система из карточки-концепции. */

:root {
  --bg: #f7f3e8;
  --panel: #fffdf7;
  --soft: #e5ead9;
  --btn: #425438;
  --btn-hover: #364630;
  --text: #293326;
  --light: #dfc77e;
  --accent: #a9684c;
  --muted: #5f6a57;
  --line: rgba(41, 51, 38, 0.14);
  --line-strong: rgba(41, 51, 38, 0.28);
  --radius-panel: 18px;
  --radius-card: 14px;
  --radius-btn: 10px;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Cormorant Garamond", "Times New Roman", serif;
  --shadow-panel: 0 1px 2px rgba(41, 51, 38, 0.04), 0 18px 40px -28px rgba(41, 51, 38, 0.22);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; font-synthesis: none; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, textarea, select {
  font-family: inherit;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.02; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.75rem); line-height: 1.1; }
h3 { font-size: 1.22rem; line-height: 1.25; }

p { margin: 0 0 0.85em; }
p:last-child { margin-bottom: 0; }

/* Ветки-акварель на фоне */
.tv-sprig {
  position: fixed;
  width: 130px;
  fill: none;
  stroke: var(--btn);
  stroke-width: 1.1;
  stroke-linecap: round;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
.tv-sprig-a { top: -30px; left: -28px; transform: rotate(18deg); }
.tv-sprig-b { bottom: -40px; right: -26px; transform: rotate(-160deg); }

/* Каркас */
.tv-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 110px;
  display: grid;
  gap: 18px;
}

.tv-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: clamp(24px, 3.4vw, 40px);
}

/* Хедер: лист вместо вордмарка — название уже в логотипе героя. */
.tv-head {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.tv-nav {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}
.tv-nav a {
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.tv-nav a:hover { border-bottom-color: var(--line-strong); }
.tv-nav a.is-active { border-bottom-color: var(--btn); }
.tv-head .tv-nav { margin-left: auto; }

/* Кнопки */
.tv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 28px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--btn);
  background: var(--btn);
  color: #fdfcf6;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.tv-btn:hover {
  background: var(--btn-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -14px rgba(41, 51, 38, 0.55);
}
.tv-btn-outline {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line-strong);
}
.tv-btn-outline:hover { background: var(--panel); border-color: var(--btn); box-shadow: none; }
.tv-btn-soft {
  background: var(--soft);
  color: var(--text);
  border-color: transparent;
  min-height: 44px;
  padding: 10px 22px;
  font-size: 0.92rem;
}
.tv-btn-soft:hover { background: #dbe2cc; box-shadow: none; }
.tv-btn-sm { min-height: 44px; padding: 10px 22px; font-size: 0.92rem; }
.tv-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.94rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  width: fit-content;
}
.tv-link:hover { border-bottom-color: var(--btn); }
.tv-arrow { transition: transform 0.2s var(--ease); }
.tv-btn:hover .tv-arrow,
.tv-link:hover .tv-arrow { transform: translateX(3px); }

/* Герой: логотип — главный носитель имени, слева только короткое приглашение. */
.tv-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr);
  gap: clamp(20px, 3.5vw, 40px);
  align-items: center;
  padding-top: clamp(28px, 4vw, 52px);
  padding-bottom: 8px;
}
.tv-kicker {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  line-height: 1.22;
  letter-spacing: 0;
  margin: 0 0 12px;
  max-width: 14em;
}
.tv-hero-text .tv-lead { max-width: 28ch; }
.tv-lead {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--muted);
  max-width: 62ch;
}
.tv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 0;
}
.tv-note {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}
.tv-hero-mark {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
}
/* Тонкая линейная графика: тень дублировала бы каждый штрих. */
.tv-hero-mark img {
  width: 100%;
  height: auto;
}
/* Нумерованный заголовок секции */
.tv-sec {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}
.tv-sec b { font-weight: 600; color: var(--text); }
.tv-sec::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.tv-panel h2 + .tv-lead { margin-top: 14px; }

/* Подзаголовок внутри секции */
.tv-sub {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 40px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.2;
}
.tv-sub::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.tv-panel[id],
.tv-sub[id] { scroll-margin-top: 20px; }
.tv-sub + .tv-grid-3,
.tv-sub + .tv-grid-benefits { margin-top: 18px; }

/* Секция «О клубе» */
.tv-two {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 44px);
  align-items: start;
}
.tv-two h2 { margin-bottom: 16px; }
.tv-sign {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--accent);
}
.tv-quote-card {
  background: var(--soft);
  border-radius: var(--radius-card);
  padding: 26px;
}
.tv-two .tv-quote-card {
  position: sticky;
  top: 24px;
}
.tv-label {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.tv-ticks {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.tv-ticks li {
  position: relative;
  padding-left: 26px;
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.3;
}
.tv-ticks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.48em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--light);
}
.tv-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--muted);
  padding-top: 18px;
  border-top: 1px solid rgba(41, 51, 38, 0.12);
}

/* Карточки */
.tv-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 26px;
  /* Раскрытая карточка не должна растягивать соседей по строке. */
  align-items: start;
}

/* Блок «Что я даю»: сетка по 3, одинаковая высота карточек. */
.tv-grid-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
  align-items: stretch;
}
.tv-card-benefit {
  height: 100%;
  padding: 28px 26px 26px;
  gap: 14px;
}
.tv-card-benefit h3 {
  font-size: 1.18rem;
  line-height: 1.28;
  min-height: 2.55em;
}
.tv-card-benefit p {
  flex: 1;
  line-height: 1.58;
}
.tv-grid-benefits .tv-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin-bottom: 2px;
}
.tv-grid-benefits .tv-icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
  stroke: currentColor;
  color: var(--btn);
}
.tv-grid-benefits > .tv-card-soft:last-child {
  grid-column: 1 / -1;
}
.tv-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.tv-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -22px rgba(41, 51, 38, 0.4);
}
.tv-card p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
}
.tv-card-soft { background: var(--soft); border-color: transparent; }
.tv-card-soft .tv-btn-soft { background: var(--panel); margin-top: auto; align-self: flex-start; }
.tv-card-soft .tv-btn-soft:hover { background: #fff; }
.tv-card-accent {
  background: var(--soft);
  border: 1px solid var(--accent);
}
.tv-card-accent h3 { color: var(--accent); }
.tv-card-accent .tv-btn-soft { background: var(--panel); margin-top: auto; align-self: flex-start; }
/* Иконки из линейного макета — на мягкой подложке, как в карточке концепции. */
.tv-icon-wrap {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--soft);
  flex: none;
}
.tv-card-soft .tv-icon-wrap { background: rgba(255, 253, 247, 0.78); }
.tv-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--btn);
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tv-icon circle { fill: var(--btn); stroke: none; }
.tv-card .tv-link { margin-top: auto; }

.tv-pull {
  margin: 28px 0 0;
  padding: 22px 26px;
  background: var(--soft);
  border-radius: var(--radius-card);
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.9vw, 1.4rem);
  line-height: 1.35;
}

/* Раскрывающиеся карточки и FAQ */
details.tv-card { gap: 0; cursor: pointer; }
details.tv-card:hover { transform: none; box-shadow: none; }
details.tv-card.is-open {
  border-color: var(--line-strong);
  box-shadow: 0 16px 34px -26px rgba(41, 51, 38, 0.45);
}
.tv-card-body { overflow: hidden; }
details.tv-card summary,
.tv-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.25;
}
details.tv-card summary::-webkit-details-marker,
.tv-faq summary::-webkit-details-marker { display: none; }
details.tv-card summary i,
.tv-faq summary i {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  font-family: var(--sans);
  font-style: normal;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--btn);
  transition: transform 0.38s var(--ease), background 0.28s var(--ease);
}
details[open] summary i { transform: rotate(135deg); background: var(--light); }
/* Когда скриптом управляется анимация, состояние иконки следует за .is-open:
   при закрытии плюс возвращается сразу, не дожидаясь конца сворачивания. */
html.tv-acc details summary i { transform: none; background: var(--soft); }
html.tv-acc details.is-open summary i { transform: rotate(135deg); background: var(--light); }
details.tv-card summary:hover i,
.tv-faq summary:hover i { background: #dbe2cc; }
details.tv-card .tv-card-body p { margin-top: 14px; }

.tv-faq {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}
.tv-faq details {
  background: var(--soft);
  border-radius: 12px;
  padding: 16px 20px;
}
.tv-faq details p {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--muted);
}
.tv-faq a { text-decoration: underline; text-underline-offset: 3px; }

/* Тарифы */
.tv-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin: 26px 0 20px;
}
.tv-plan {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.tv-plan:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -24px rgba(41, 51, 38, 0.45);
}
.tv-plan.is-featured {
  background: var(--soft);
  border-color: var(--btn);
}
.tv-card.is-featured {
  background: var(--panel);
  border-color: var(--btn);
}
.tv-badge {
  position: absolute;
  top: -11px;
  right: 22px;
  left: auto;
  margin: 0;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--light);
  color: var(--text);
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tv-plan-meta {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--muted);
  margin: 0;
}
.tv-plan-price {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.1;
  margin: 8px 0 18px;
}
.tv-plan .tv-btn { margin-top: auto; width: 100%; }

/* Подвал */
.tv-foot {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  font-size: 0.9rem;
  color: var(--muted);
}
.tv-foot-mark {
  font-family: var(--serif);
  font-size: 1.45rem;
  color: var(--text);
  margin-bottom: 6px;
}
.tv-foot-links { display: grid; gap: 10px; align-content: start; }
.tv-foot-links a { text-decoration: none; border-bottom: 1px solid var(--line); width: fit-content; padding-bottom: 2px; }
.tv-foot-links a:hover { border-bottom-color: var(--btn); }
.tv-foot-legal p { margin: 0; }

/* Плавающая кнопка */
.tv-float-cta {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: var(--radius-btn);
  background: var(--btn);
  color: #fdfcf6;
  font-size: 0.94rem;
  text-decoration: none;
  box-shadow: 0 14px 30px -18px rgba(41, 51, 38, 0.7);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
body.is-scrolled .tv-float-cta { opacity: 1; transform: none; pointer-events: auto; }

/* Панель черновика */
.tv-studio {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: 230px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.94);
  backdrop-filter: blur(6px);
  font-size: 0.78rem;
  color: var(--muted);
  box-shadow: var(--shadow-panel);
}
.tv-studio p { margin: 0 0 10px; }
.tv-studio button {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.78rem;
  cursor: pointer;
}
.tv-studio button:hover { background: var(--soft); }

/* Появление при скролле */
.tv-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.tv-reveal.is-visible { opacity: 1; transform: none; }

/* Адаптив */
@media (max-width: 900px) {
  .tv-grid-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tv-card-benefit h3 { min-height: 0; }
  .tv-hero,
  .tv-two,
  .tv-foot { grid-template-columns: minmax(0, 1fr); }
  .tv-hero-mark { order: -1; max-width: 380px; margin: 0 auto 4px; }
  .tv-hero-text { text-align: center; }
  .tv-kicker,
  .tv-hero-text .tv-lead { margin-inline: auto; }
  .tv-actions { justify-content: center; }
  .tv-head { flex-wrap: wrap; gap: 14px; }
  .tv-nav { order: 3; width: 100%; gap: 18px; margin-left: 0; }
  .tv-head .tv-btn-sm { margin-right: auto; }
  .tv-sprig { display: none; }
}

@media (max-width: 560px) {
  .tv-grid-benefits { grid-template-columns: minmax(0, 1fr); }
  .tv-shell { padding: 16px 14px 96px; }
  .tv-panel { padding: 22px 18px; }
  .tv-actions .tv-btn { width: 100%; }
  .tv-studio { display: none; }
  .tv-float-cta { left: 14px; right: 14px; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tv-reveal { opacity: 1; transform: none; transition: none; }
  .tv-card:hover, .tv-plan:hover, .tv-btn:hover { transform: none; }
}

html.tv-reduce .tv-reveal { opacity: 1; transform: none; transition: none; }
html.tv-reduce * { animation: none !important; transition: none !important; }
html.tv-reduce { scroll-behavior: auto; }

#landing.landing {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
}
#mini-status.empty { display: none !important; }

html.tv-offer-open {
  overflow: hidden;
}

.tv-offer-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 20px 16px;
  border: none;
  background: transparent;
  color: var(--text);
}
.tv-offer-dialog::backdrop {
  background: rgba(41, 51, 38, 0.48);
}
.tv-offer-dialog-panel {
  display: flex;
  flex-direction: column;
  width: min(820px, 100%);
  max-height: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: 0 24px 60px -28px rgba(41, 51, 38, 0.55);
}
.tv-offer-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  flex-wrap: wrap;
  padding: 14px 16px 14px 22px;
  border-bottom: 1px solid var(--line);
}
.tv-offer-dialog-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}
.tv-offer-dialog-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}
.tv-offer-dialog-actions .tv-btn-sm {
  min-height: 40px;
}
.tv-offer-dialog-body {
  overflow: auto;
  padding: 8px 22px 28px;
  -webkit-overflow-scrolling: touch;
}
.tv-offer-dialog .offer-doc h2,
.tv-offer-dialog .offer-doc h3 { font-family: var(--serif); }

.tv-offer .tv-head { justify-content: space-between; }
.tv-offer .offer-doc h2,
.tv-offer .offer-doc h3 { font-family: var(--serif); }

/* Mini App: узкий экран Telegram. */
html.tv-miniapp .tv-studio,
html.tg-app .tv-studio,
html.tv-miniapp .tv-sprig,
html.tg-app .tv-sprig { display: none; }
html.tv-miniapp .tv-shell,
html.tg-app .tv-shell {
  max-width: 100%;
  padding: 10px 12px calc(88px + env(safe-area-inset-bottom, 0px));
}
html.tv-miniapp .tv-panel,
html.tg-app .tv-panel { border-radius: 16px; }
html.tv-miniapp .tv-float-cta,
html.tg-app .tv-float-cta {
  left: 14px;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  justify-content: center;
}
html.tv-miniapp .tv-head,
html.tg-app .tv-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
html.tv-miniapp .tv-head .tv-btn-sm,
html.tg-app .tv-head .tv-btn-sm {
  align-self: flex-start;
  flex-shrink: 0;
  margin: 0;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.84rem;
}
html.tv-miniapp .tv-head .tv-btn-sm .tv-arrow,
html.tg-app .tv-head .tv-btn-sm .tv-arrow { display: none; }
html.tv-miniapp .tv-nav,
html.tg-app .tv-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  order: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  gap: 0;
}
html.tv-miniapp .tv-nav a,
html.tg-app .tv-nav a {
  display: block;
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  padding: 6px 2px;
}
html.tg-app .tv-offer .tv-head {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

/* Mini App: старт — тарифы на одном экране, остальное по навигации. */
html.tg-app .tv-reveal,
html.tv-miniapp .tv-reveal {
  opacity: 1;
  transform: none;
}
html.tg-app .tv-hero,
html.tv-miniapp .tv-hero,
html.tg-app .tv-float-cta,
html.tv-miniapp .tv-float-cta,
html.tg-app .tv-head .tv-btn-sm,
html.tv-miniapp .tv-head .tv-btn-sm {
  display: none !important;
}
html.tg-app .tv-panel-hero {
  position: sticky;
  top: 0;
  z-index: 6;
  padding: 10px 12px 8px;
  margin: 0 0 8px;
}
html.tg-app .tv-head {
  padding-bottom: 0;
  border-bottom: 0;
  gap: 0;
}
html.tg-app .tv-shell {
  padding: 8px 10px calc(12px + env(safe-area-inset-bottom, 0px));
  gap: 8px;
}
html.tg-app #club,
html.tv-miniapp #club,
html.tg-app #library,
html.tv-miniapp #library,
html.tg-app #tests,
html.tv-miniapp #tests,
html.tg-app #faq,
html.tv-miniapp #faq,
html.tg-app .tv-foot,
html.tv-miniapp .tv-foot { display: none !important; }
html.tg-app[data-tv-view="club"] #club,
html.tv-miniapp[data-tv-view="club"] #club,
html.tg-app[data-tv-view="library"] #library,
html.tv-miniapp[data-tv-view="library"] #library,
html.tg-app[data-tv-view="tests"] #tests,
html.tv-miniapp[data-tv-view="tests"] #tests,
html.tg-app[data-tv-view="faq"] #faq,
html.tv-miniapp[data-tv-view="faq"] #faq { display: block !important; }
html.tg-app[data-tv-view="club"] #join,
html.tv-miniapp[data-tv-view="club"] #join,
html.tg-app[data-tv-view="library"] #join,
html.tv-miniapp[data-tv-view="library"] #join,
html.tg-app[data-tv-view="tests"] #join,
html.tv-miniapp[data-tv-view="tests"] #join,
html.tg-app[data-tv-view="faq"] #join,
html.tv-miniapp[data-tv-view="faq"] #join { display: none !important; }
html.tg-app[data-tv-view="club"] .tv-foot,
html.tg-app[data-tv-view="library"] .tv-foot { display: grid !important; }
html.tg-app #join {
  padding: 14px 12px 12px;
}
html.tg-app #join .tv-sec,
html.tg-app #join .tv-lead,
html.tg-app #join .tv-note { display: none; }
html.tg-app #join h2 {
  font-size: 1.35rem;
  margin: 0 0 10px;
}
html.tg-app .tv-plans {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}
html.tg-app .tv-plan {
  padding: 12px 10px 10px;
  gap: 2px;
}
html.tg-app .tv-plan:hover { transform: none; box-shadow: none; }
html.tg-app .tv-plan-meta {
  font-size: 0.95rem;
  font-weight: 500;
}
html.tg-app .tv-plan-price {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  margin: 4px 0 8px;
}
html.tg-app .tv-plan h3 { font-size: 1.15rem; }
html.tg-app .tv-badge {
  top: -8px;
  right: 10px;
  left: auto;
  font-size: 0.62rem;
  padding: 2px 8px;
}
html.tg-app .tv-plan .tv-btn {
  min-height: 36px;
  padding: 6px 8px;
  font-size: 0.78rem;
}
html.tg-app #club,
html.tg-app #library,
html.tg-app #tests {
  padding: 16px 14px 18px;
}
.tv-club-logo { display: none; }
html.tg-app .tv-club-logo,
html.tv-miniapp .tv-club-logo {
  display: block;
  max-width: 168px;
  margin: 0 auto 14px;
}
html.tg-app .tv-club-logo img,
html.tv-miniapp .tv-club-logo img {
  width: 100%;
  height: auto;
}

/* Mini App: оформление тарифа в той же стилистике, без тестов и срока. */
html.tg-app.tg-workspace.tg-checkout .header,
html.tg-app.tg-workspace.tg-checkout .admin-chrome,
html.tg-app.tg-workspace.tg-checkout #open-tests,
html.tg-app.tg-workspace.tg-checkout #plans-head,
html.tg-app.tg-workspace.tg-checkout #plans-list,
html.tg-app.tg-workspace.tg-checkout #status-card,
html.tg-app.tg-workspace.tg-checkout #app > .legal-footer {
  display: none !important;
}

html.tg-app.tg-workspace.tg-checkout .app {
  max-width: 560px;
  padding: calc(10px + var(--safe-top, 0px)) 12px calc(20px + var(--safe-bottom, 0px));
}

html.tg-app .tv-checkout {
  display: grid;
  gap: 12px;
}

html.tg-app .tv-checkout-back {
  width: fit-content;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.84rem;
}

html.tg-app .tv-checkout .tv-btn {
  appearance: none;
  font: inherit;
  font-weight: 500;
}

html.tg-app .tv-checkout .tv-btn:not(.tv-checkout-back) {
  width: 100%;
}

html.tg-app .tv-checkout .tv-btn:hover {
  transform: none;
  box-shadow: none;
}

html.tg-app .tv-checkout-panel {
  display: grid;
  gap: 14px;
  padding: 20px 18px 18px;
}

html.tg-app .tv-checkout-title {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

html.tg-app .tv-checkout-price {
  font-family: var(--serif);
  margin: 6px 0 0;
  font-size: 2.05rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
}

html.tg-app .tv-checkout-terms {
  display: grid;
  gap: 8px;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
}

html.tg-app .tv-checkout-terms p {
  margin: 0;
}

html.tg-app .tv-checkout-field {
  display: grid;
  gap: 6px;
}

html.tg-app .tv-checkout-label {
  font-family: var(--serif);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

html.tg-app .tv-field {
  width: 100%;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

html.tg-app .tv-field::placeholder {
  color: var(--muted);
}

html.tg-app .tv-field:focus {
  outline: 2px solid rgba(66, 84, 56, 0.28);
  outline-offset: 1px;
}

html.tg-app .tv-checkout-legal {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  justify-self: center;
}

html.tg-app .tv-checkout-legal:hover {
  color: var(--text);
}

html.tg-app.tg-workspace.tg-checkout #offer-back {
  appearance: none;
  width: fit-content;
  min-height: 40px;
  margin: 0 0 12px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 500;
}

.tv-cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: grid;
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 18px 16px;
  background: var(--panel, #fffdf7);
  border: 1px solid var(--line, rgba(41, 51, 38, 0.14));
  border-radius: 18px;
  box-shadow: 0 18px 40px -24px rgba(41, 51, 38, 0.45);
  color: var(--text, #293326);
}

.tv-cookie-copy {
  display: grid;
  gap: 8px;
}

.tv-cookie-copy strong {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
}

.tv-cookie-banner p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--muted, #5f6a57);
}

.tv-cookie-banner a {
  color: var(--btn, #425438);
}

.tv-cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 14px;
}

.tv-cookie-more {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: var(--btn, #425438);
  font: inherit;
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.tv-cookie-cats {
  display: grid;
  gap: 10px;
}

.tv-cookie-cat {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 11px;
  border: 1px solid var(--line, rgba(41, 51, 38, 0.14));
  border-radius: 14px;
  background: var(--soft, #e5ead9);
}

.tv-cookie-cat b {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.tv-cookie-cat span {
  display: block;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--muted, #5f6a57);
}

.tv-cookie-switch {
  flex: none;
  width: 51px;
  height: 31px;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e4e6de;
  position: relative;
  cursor: default;
  transition: background-color 0.28s ease;
  box-shadow: inset 0 0 0 1px rgba(41, 51, 38, 0.08);
}

.tv-cookie-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(41, 51, 38, 0.28), 0 1px 1px rgba(41, 51, 38, 0.12);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.tv-cookie-switch[aria-checked="true"] {
  background: var(--btn, #425438);
}

.tv-cookie-switch[aria-checked="true"]::after {
  transform: translateX(20px);
}

.tv-cookie-switch:not(:disabled) {
  cursor: pointer;
}

.tv-cookie-switch:disabled {
  opacity: 0.55;
}

html.tv-cookie-open body {
  padding-bottom: calc(168px + env(safe-area-inset-bottom, 0px));
}

html.tv-cookie-open .tv-float-cta {
  bottom: calc(176px + env(safe-area-inset-bottom, 0px));
}

html.tv-cookie-open.tv-cookie-settings body {
  padding-bottom: calc(360px + env(safe-area-inset-bottom, 0px));
}

html.tv-cookie-open.tv-cookie-settings .tv-float-cta {
  bottom: calc(368px + env(safe-area-inset-bottom, 0px));
}

html.tests-running .tv-cookie-banner,
html.tv-offer-open .tv-cookie-banner,
html.tg-app .tv-cookie-banner,
html.tg-app a[href="#cookies"],
html.tg-app a[href="/#cookies"],
html.tg-app a[href="/cookies"] {
  display: none !important;
}

.cookies-page-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 18px 56px;
}

.cookies-page-shell > .tv-link {
  display: inline-block;
  margin-bottom: 18px;
}
