:root {
  --tg-bg: var(--tg-theme-bg-color, #fff8f6);
  --tg-text: var(--tg-theme-text-color, #1c1b1f);
  --tg-hint: var(--tg-theme-hint-color, #80807a);
  --tg-section: var(--tg-theme-section-bg-color, #ffffff);
  --tg-secondary: var(--tg-theme-secondary-bg-color, #fff1ec);
  --tg-link: var(--tg-theme-link-color, #d6336c);
  --tg-button: var(--tg-theme-button-color, #ff5d8f);
  --tg-button-text: var(--tg-theme-button-text-color, #ffffff);
  --tg-destructive: var(--tg-theme-destructive-text-color, #d6336c);
  --accent: #ff5d8f;
  --accent-soft: #ffd0de;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 6px 24px rgba(214, 51, 108, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--tg-bg);
  color: var(--tg-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
}

/* Hero */
.hero {
  text-align: center;
  padding: 24px 8px 28px;
}
.hero__eyebrow {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hero__title {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  margin-bottom: 8px;
}
.hero__lede {
  color: var(--tg-hint);
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto;
}

/* Lessons list */
.lessons {
  display: grid;
  gap: 12px;
}
.card {
  background: var(--tg-section);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  border: 1px solid rgba(214, 51, 108, 0.06);
  transition: transform 120ms ease;
}
.card:active { transform: scale(0.99); }
.card__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 26px;
}
.card__body { min-width: 0; }
.card__meta {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: center;
}
.card__title {
  font-size: 16px;
  font-weight: 600;
  margin: 2px 0 4px;
}
.card__summary {
  font-size: 13.5px;
  color: var(--tg-hint);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feedback {
  margin-top: 20px;
}
.feedback__btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #ff5d8f 0%, #ff7eaa 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(214, 51, 108, 0.22);
  transition: transform 120ms ease;
}
.feedback__btn:active { transform: scale(0.99); }
.feedback__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.feedback__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feedback__title { font-size: 15px; font-weight: 600; }
.feedback__sub { font-size: 13px; opacity: 0.92; }

.foot {
  text-align: center;
  padding-top: 24px;
}
.foot__id {
  color: var(--tg-hint);
  font-size: 12px;
}

/* Lesson page */
.back {
  background: none;
  border: 0;
  color: var(--tg-link);
  padding: 8px 0 16px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.lesson-page article { display: grid; gap: 16px; }
.lesson-page h1 { font-size: 24px; line-height: 1.2; }
.video-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.video-wrap video {
  display: block;
  width: 100%;
  height: auto;
}
.summary {
  color: var(--tg-hint);
  font-size: 15px;
}
.transcript-toggle {
  background: var(--tg-secondary);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--tg-text);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.transcript {
  background: var(--tg-secondary);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--tg-text);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Text-lesson blocks */
.block { background: var(--tg-section); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.block h2 { font-size: 17px; margin-bottom: 8px; }
.block p { font-size: 15px; color: var(--tg-text); }
.block ul, .block ol { padding-left: 22px; }
.block li { font-size: 15px; margin: 4px 0; }
.block .footer-note { color: var(--tg-hint); font-size: 13.5px; margin-top: 8px; }
.block--warning {
  background: linear-gradient(135deg, #fff1ec 0%, #ffe1ea 100%);
  border-left: 4px solid var(--accent);
}
.block--warning p { font-weight: 500; }
.block--tip {
  background: #f5f9ff;
  border-left: 4px solid #4a90e2;
}

.tg-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  margin: 4px 6px 4px 0;
}
.tg-link .note { color: var(--tg-hint); font-size: 12px; font-weight: 400; }

/* Skeletons */
.skeleton {
  background: linear-gradient(90deg, var(--tg-secondary) 0%, #fff 50%, var(--tg-secondary) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius);
  height: 88px;
}
.skeleton--lg { height: 320px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Empty / error */
.notice {
  background: var(--tg-section);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.notice h2 { font-size: 18px; margin-bottom: 8px; }
.notice p { color: var(--tg-hint); margin-bottom: 12px; }
.notice code {
  background: var(--tg-secondary);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
}
