.tml-wrap {
  --bg: #fefefc;
  --bg-soft: #f8fbf3;
  --surface: #ffffff;
  --text: #2f4a28;
  --muted: #5f7a56;
  --accent: #84b179;
  --border: rgba(132, 177, 121, 0.24);
  --shadow: 0 14px 28px rgba(80, 114, 72, 0.1);
  width: min(1100px, 92%);
  margin: 24px auto 50px;
  font-family: "Cairo", sans-serif;
  color: var(--text);
}

.tml-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.tml-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  line-height: 1.35;
}

.tml-list-section {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
  scroll-margin-top: 20px;
}

.tml-lesson-list {
  display: grid;
  gap: 10px;
}

.tml-empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  color: var(--muted);
}

.tml-lesson-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.tml-lesson-no {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(162, 203, 139, 0.5);
  flex: 0 0 auto;
}

.tml-lesson-item > div {
  min-width: 0;
}

.tml-lesson-item h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  word-break: break-word;
}

.tml-wrap .tml-watch,
.tml-wrap .tml-watch:link,
.tml-wrap .tml-watch:visited,
.tml-wrap .tml-watch:hover,
.tml-wrap .tml-watch:focus,
.tml-wrap .tml-watch:active {
  text-decoration: none !important;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #6f9a65);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.9rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 0;
  box-sizing: border-box;
  max-width: 100%;
}

.tml-watch-disabled {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

@media (max-width: 860px) {
  .tml-lesson-item {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "no title"
      "button button";
    align-items: center;
  }

  .tml-lesson-no {
    grid-area: no;
    justify-self: start;
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .tml-lesson-item > div {
    grid-area: title;
    min-width: 0;
  }

  .tml-lesson-item h4 {
    margin: 0;
  }

  .tml-watch {
    grid-area: button;
    margin-top: 8px;
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .tml-wrap {
    width: 94%;
    margin: 18px auto 28px;
  }

  .tml-hero {
    padding: 18px;
  }

  .tml-hero h1 {
    font-size: 1.2rem;
  }

  .tml-list-section {
    padding: 14px;
  }

  .tml-lesson-item {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "no title"
      "button button";
    align-items: center;
    gap: 8px;
    padding: 10px;
  }

  .tml-lesson-no {
    grid-area: no;
    justify-self: start;
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .tml-lesson-item > div {
    grid-area: title;
    width: 100%;
  }

  .tml-watch {
    grid-area: button;
    width: 100%;
    text-align: center;
    padding: 9px 12px;
  }
}

@media (max-width: 380px) {
  .tml-lesson-item {
    padding: 10px;
  }

  .tml-watch {
    padding: 10px;
  }
}
