/* 차시 페이지 공통 머리말 — 디지털 탐험대(1차시)와 같은 소개 카드·본문 폭·탭 모양.
   body 에 tl-lesson 을 붙인 페이지에만 쓴다(디지털 탐험대는 explore.css 로 같은 모양을 따로 갖고 있다).
   머리말 마크업: header.green-top > a.home + .title-block(.kicker, h1, .lesson-lead) + #who(있으면) + .lesson-goals */
body.tl-lesson { background: #f5f6fa; color: #20243a; }
.tl-lesson .tl-nav { position: relative; z-index: 30; }

.tl-lesson .green-top {
  position: relative; top: auto; z-index: 1; box-sizing: border-box;
  width: calc(100% - 32px); max-width: 1140px; margin: 22px auto 0; padding: 28px 30px;
  border: 1px solid #e4e7f0; border-radius: 20px; box-shadow: none;
  background: linear-gradient(115deg, #eef7f2 0%, #f7f8ff 65%, #fff9dc 100%);
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "home who" "title goals"; align-items: center; gap: 10px 28px;
}
.tl-lesson .green-top .home { grid-area: home; justify-self: start; color: #626980; font-size: .82rem; padding: 0; }
.tl-lesson .green-top .who { grid-area: who; justify-self: end; margin: 0; }
.tl-lesson .green-top .title-block { grid-area: title; min-width: 0; }
.tl-lesson .green-top .kicker { color: #21835c; font-size: .78rem; letter-spacing: .02em; }
.tl-lesson .green-top h1 { font-size: clamp(1.8rem, 3.2vw, 2.55rem); color: #171c44; letter-spacing: -1.1px; margin: 4px 0 7px; }
.tl-lesson .lesson-lead { margin: 0; color: #626980; font-size: .98rem; max-width: 690px; }
.tl-lesson .lesson-goals { grid-area: goals; display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.tl-lesson .lesson-goals span {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid #dfe5ea; border-radius: 10px;
  background: rgba(255, 255, 255, .82); font-size: .78rem; font-weight: 700; color: #44506f;
}
.tl-lesson .lesson-goals span::before {
  content: '✓'; display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: #e3f5eb; color: #1e8b5a; font-size: .72rem;
}

.tl-lesson .green-main { width: calc(100% - 32px); max-width: 1140px; margin: 0 auto; box-sizing: border-box; padding: 18px 0 56px; }

/* 활동 탭: 흰 상자 안에 같은 너비로 놓고, 고른 탭은 남색 */
.tl-lesson .green-main > .tabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px;
  padding: 6px; margin: 0 0 16px; border: 1px solid #e0e4ee; border-radius: 16px; background: #fff;
}
.tl-lesson .green-main > .tabs .tab { min-height: 52px; border: 0; border-radius: 12px; background: transparent; color: #66708a; }
.tl-lesson .green-main > .tabs .tab:hover { background: #f6f7fb; }
.tl-lesson .green-main > .tabs .tab[aria-selected="true"] { background: #171c44; color: #fff; }

.tl-lesson .green-main .card { border-color: #e0e4ee; border-radius: 18px; }

@media (max-width: 900px) {
  .tl-lesson .green-top { margin: 14px 16px 0; width: auto; grid-template-columns: 1fr; grid-template-areas: "home" "title" "who"; }
  .tl-lesson .green-top .who { justify-self: start; }
  .tl-lesson .lesson-goals { display: none; }
}
@media (max-width: 620px) {
  .tl-lesson .green-top { padding: 20px; }
  .tl-lesson .green-top h1 { font-size: 1.8rem; }
  .tl-lesson .lesson-lead { font-size: .85rem; }
  .tl-lesson .green-main > .tabs { grid-auto-flow: row; grid-auto-columns: auto; }
  .tl-lesson .green-main > .tabs .tab { min-height: 46px; }
}

/* 공용 도구는 소개를 짧게 읽고 바로 활동할 수 있게 한다. */
.tl-lesson:is(.notebook, .video) .green-top {
  margin-top: 16px; padding: 18px 22px; border-radius: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title goals"; gap: 8px 20px;
}
.tl-lesson.notebook .green-top:has(.who:not([hidden])) { grid-template-areas: "title who" "title goals"; }
.tl-lesson:is(.notebook, .video) .green-top .kicker { margin: 0 0 3px; }
.tl-lesson:is(.notebook, .video) .green-top h1 {
  font-size: clamp(1.55rem, 2.4vw, 1.85rem); line-height: 1.25;
  min-height: 36px; letter-spacing: -.6px; margin: 0 0 5px;
}
.tl-lesson:is(.notebook, .video) .lesson-lead { font-size: .92rem; line-height: 1.55; }
.tl-lesson:is(.notebook, .video) .lesson-goals {
  min-width: 0; flex-direction: row; flex-wrap: wrap; justify-content: flex-end;
  max-width: 300px; gap: 6px;
}
.tl-lesson:is(.notebook, .video) .lesson-goals span {
  padding: 5px 8px; gap: 5px; border-radius: 8px; font-size: .76rem; line-height: 1.4;
}
.tl-lesson:is(.notebook, .video) .lesson-goals span::before { width: 17px; height: 17px; }
.tl-lesson:is(.notebook, .video) .green-main { padding-top: 12px; }
@media (max-width: 900px) {
  .tl-lesson:is(.notebook, .video) .green-top {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "goals";
    margin: 12px 16px 0; padding: 16px 18px;
  }
  .tl-lesson:is(.notebook, .video) .lesson-goals { display: flex; justify-content: flex-start; max-width: none; }
  .tl-lesson.notebook .green-top:has(.who:not([hidden])) { grid-template-areas: "title" "who" "goals"; }
}
