/* ---------- Course page ---------- */

.course-layout {
  display: grid;
  gap: 1.3rem;
  padding-bottom: 1rem;
}

@media (min-width: 960px) {
  .course-layout {
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: start;
    gap: 2rem;
  }

  .price-aside {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
  }
}

.course-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
}

.course-main > * {
  min-width: 0;
}

.course-layout > * {
  min-width: 0;
}

@media (max-width: 959px) {
  .course-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.continue-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.continue-box .btn {
  min-height: 42px;
  padding: 0.3rem 0.9rem;
  font-size: 0.82rem;
}

.donut-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}

.donut-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  margin-inline: auto;
}

.donut-wrap svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.donut-center strong {
  font-size: 1.3rem;
  line-height: 1.1;
}

.donut-center span {
  color: var(--muted);
  font-size: 0.7rem;
}

.donut-legend {
  display: grid;
  gap: 0.32rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.donut-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.donut-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.donut-legend .legend-label {
  flex: 1;
  min-width: 0;
}

.donut-legend .legend-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.donut-legend .legend-pct {
  min-width: 2.9rem;
  padding: 0.02rem 0.35rem;
  border-radius: 999px;
  background: var(--locked-soft);
  color: var(--muted);
  font-size: 0.66rem;
  text-align: center;
}

@media (min-width: 480px) {
  .donut-card {
    grid-template-columns: 132px 1fr;
    align-items: center;
  }
}

.chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.1rem 0 0.4rem;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: none;
  min-height: 38px;
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chip .chip-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.22rem;
  border-radius: 999px;
  background: var(--locked-soft);
  color: var(--muted);
  font-size: 0.64rem;
}

.chip[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.chip[aria-pressed="true"] .chip-count {
  background: #fff;
  color: var(--primary-ink);
}

.lesson-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lesson-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 72px;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.04);
}

.lesson-row:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.lesson-num {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 0.82rem;
  font-weight: 700;
  flex: none;
}

.lesson-info {
  flex: 1;
  min-width: 0;
}

.lesson-info strong {
  display: block;
  font-size: 0.87rem;
  line-height: 1.45;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.5rem;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.lesson-meta .icon {
  width: 12px;
  height: 12px;
}

.lesson-meta .lock-note {
  color: #475569;
}

.lesson-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex: none;
}

.lesson-row--locked .lesson-num {
  background: var(--locked-soft);
  color: #475569;
}

.price-card {
  padding: 1.1rem;
}

.price-card h2 {
  font-size: 1.15rem;
}

.price-card .price .amount {
  font-size: 2.2rem;
}

.price-card .check-list li {
  font-size: 0.8rem;
}

.price-card .small {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

/* ---------- Lesson page ---------- */

.lesson-layout {
  display: grid;
  gap: 1.2rem;
  padding: 0.6rem 0 1rem;
}

@media (min-width: 960px) {
  .lesson-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 2rem;
  }

  .lesson-aside {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
  }
}

.lesson-main {
  min-width: 0;
}

.lesson-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.lesson-counter {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.video-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #c7ddff, #7fa9f5);
  box-shadow: var(--shadow-lg);
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.3rem;
  padding: 1rem;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.42), transparent 55%),
    repeating-linear-gradient(to bottom, transparent 0 39px, rgba(255, 255, 255, 0.07) 39px 40px),
    linear-gradient(145deg, #bcd8ff, #6f9cf0);
}

.video-placeholder strong {
  font-size: 1rem;
}

.video-placeholder small {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.76rem;
}

.play-btn {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 0.3rem;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(30, 42, 68, 0.2);
}

.play-btn .icon {
  width: 28px;
  height: 28px;
  margin-left: 3px;
}

@media (max-width: 699px) {
  .video-shell.is-locked {
    aspect-ratio: auto;
    min-height: 300px;
  }
}

.video-locked {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.3rem;
  padding: 1.1rem;
  color: #fff;
  text-align: center;
  background: linear-gradient(150deg, #2b3f66, #1e2a44);
}

.video-locked h2 {
  margin: 0.2rem 0 0;
  color: #fff;
  font-size: 1.2rem;
}

.video-locked p {
  max-width: 34ch;
  margin: 0 0 0.4rem;
  color: #dbe4f3;
  font-size: 0.8rem;
}

.video-locked .lock-disc {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.lesson-title-block {
  margin-top: 1rem;
}

.lesson-title-block h1 {
  margin: 0.35rem 0;
  font-size: clamp(1.35rem, 4.2vw, 2rem);
}

.lesson-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.8rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.lesson-meta-line span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.lesson-meta-line .icon {
  width: 14px;
  height: 14px;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

.quick-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 62px;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.quick-btn .icon-tile {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.quick-btn .icon-tile .icon {
  width: 19px;
  height: 19px;
}

.quick-btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary-bright), var(--primary));
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
}

.quick-btn--primary .icon-tile {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.lesson-panels {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.panel-list {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.panel-list li {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.panel-list .icon {
  width: 15px;
  height: 15px;
  margin-top: 0.18rem;
  color: var(--primary);
  flex: none;
}

.model-preview {
  padding: 0.75rem;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: #fbfdff;
  text-align: center;
}

.model-preview .handwriting {
  margin: 0.2rem 0;
  color: var(--ink);
  font-size: 1.6rem;
}

.model-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.think-note {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.8rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
}

.think-note img {
  width: 58px;
  height: 62px;
  object-fit: contain;
  flex: none;
}

.think-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.think-note strong {
  display: block;
  color: var(--ink);
  font-size: 0.84rem;
}

.lesson-pager {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  max-width: 48%;
  min-height: 48px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-decoration: none;
}

.pager-link:hover {
  border-color: var(--primary);
}

.pager-link.is-next {
  margin-left: auto;
  text-align: right;
}

.pager-label {
  color: var(--muted);
  font-size: 0.7rem;
}

.pager-title {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}

.lesson-aside {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.lesson-aside h2 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.side-list {
  display: grid;
  gap: 0.25rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  max-height: 56vh;
  overflow: auto;
}

.side-item {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.45rem 0.4rem;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
}

.side-item:hover {
  background: var(--bg-top);
}

.side-item.is-current {
  background: var(--primary-soft);
}

.side-num {
  min-width: 1.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding-top: 0.08rem;
}

.side-item.is-current .side-num {
  color: var(--primary-ink);
}

.side-title {
  flex: 1;
  font-size: 0.74rem;
  line-height: 1.45;
}

.side-tag {
  flex: none;
  padding-top: 0.1rem;
  color: var(--muted);
}

.side-tag .icon {
  width: 12px;
  height: 12px;
}

.drawer-close {
  display: none;
}

.drawer-toggle {
  display: inline-flex;
}

.drawer-overlay {
  display: none;
}

@media (max-width: 959px) {
  .lesson-aside {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 95;
    max-height: 78vh;
    overflow: auto;
    border-radius: 24px;
    padding: 0.9rem;
    transform: translateY(110%);
    transition: transform 0.25s ease;
    box-shadow: 0 -12px 40px rgba(30, 42, 68, 0.22);
  }

  .lesson-aside.is-open {
    transform: none;
  }

  .lesson-aside .aside-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .drawer-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
  }

  .drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(15, 23, 42, 0.42);
  }

  .drawer-overlay.is-open {
    display: block;
  }

  body.drawer-open {
    overflow: hidden;
  }

  .side-list {
    max-height: none;
  }
}

@media (min-width: 960px) {
  .drawer-toggle {
    display: none;
  }

  .lesson-aside .aside-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .drawer-close {
    display: none;
  }
}

/* ---------- Private page ---------- */

.split {
  display: grid;
  gap: 1.2rem;
  padding: 0.5rem 0 1rem;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
    gap: 2rem;
  }

  .booking-aside {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
  }
}

.option-grid {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

@media (min-width: 560px) {
  .option-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.option-card {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.option-card h3 {
  margin: 0.35rem 0 0.15rem;
  font-size: 0.9rem;
}

.option-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.booking-card {
  padding: 1.1rem;
}

.booking-card h2 {
  font-size: 1.15rem;
}

.hourly {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.stepper button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  color: var(--primary-ink);
  font-size: 1.4rem;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
}

.stepper button:hover {
  border-color: var(--primary);
}

.stepper input {
  width: 76px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  -moz-appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.total-box {
  margin-bottom: 0.9rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-top);
  text-align: center;
}

.total-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.total {
  margin: 0.1rem 0;
  color: var(--ink);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.total-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

/* ---------- Join page ---------- */

.steps-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps-bar li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
}

.steps-bar li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 0.72rem;
  flex: none;
}

.steps-bar li {
  counter-increment: step;
}

.steps-bar li.is-done::before {
  content: "✓";
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.steps-bar li.is-current {
  color: var(--primary-ink);
}

.steps-bar li.is-current::before {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.join-layout {
  display: grid;
  gap: 0.8rem;
  padding: 0.8rem 0 1rem;
}

@media (min-width: 900px) {
  .join-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
    align-items: start;
    gap: 1.5rem;
  }

  .join-aside {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
  }
}

.join-main {
  display: grid;
  gap: 0.8rem;
}

.join-main .card h2,
.join-aside .card h2 {
  font-size: 1.05rem;
  margin-bottom: 0.7rem;
}

.summary-list {
  margin: 0;
}

.summary-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--line-strong);
}

.summary-list > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.summary-list dt {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.summary-list dd {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: right;
}

.summary-total dd {
  color: var(--ink);
  font-size: 1.25rem;
}

.qr-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}

.qr-box {
  position: relative;
  width: 160px;
  height: 160px;
  padding: 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #fff;
  flex: none;
}

.qr-box svg {
  width: 100%;
  height: 100%;
}

.qr-label {
  position: absolute;
  left: 50%;
  bottom: 0.3rem;
  transform: translateX(-50%);
  padding: 0.02rem 0.4rem;
  border-radius: 999px;
  background: var(--amber);
  color: #3b2500;
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
}

.qr-copy {
  flex: 1;
  min-width: 170px;
}

.qr-copy p {
  margin: 0 0 0.2rem;
  font-size: 0.84rem;
}

.qr-copy .amount {
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 700;
}

.slip-drop {
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 1.1rem 0.8rem;
  border: 2px dashed rgba(37, 99, 235, 0.25);
  border-radius: 18px;
  background: var(--bg-top);
  text-align: center;
  cursor: pointer;
}

.slip-drop:hover {
  border-color: var(--primary);
  background: #fff;
}

.slip-drop .icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
  margin-bottom: 0.15rem;
}

.slip-title {
  font-size: 0.86rem;
  font-weight: 600;
}

.slip-hint {
  color: var(--muted);
  font-size: 0.72rem;
}

.file-name {
  margin: 0.6rem 0 0;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 0.78rem;
  word-break: break-word;
}

.file-name[hidden] {
  display: none;
}

.note-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0.7rem 0 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 12px;
  background: var(--amber-soft);
  color: #5f4300;
  font-size: 0.78rem;
  line-height: 1.55;
}

.note-banner .icon {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 0.1rem;
}

.join-main [data-mock-submit] {
  margin-top: 0.8rem;
}

.steps-mini {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: mini;
}

.steps-mini li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
  counter-increment: mini;
}

.steps-mini li::before {
  content: counter(mini);
  position: absolute;
  left: 0;
  top: 0.05rem;
  display: grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 0.62rem;
  font-weight: 700;
}

.steps-mini strong {
  display: block;
  color: var(--ink);
}

/* ---------- Sheet dialog ---------- */

dialog.sheet {
  width: min(560px, calc(100% - 16px));
  max-width: 560px;
  max-height: 88dvh;
  margin: auto auto 8px;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

dialog.sheet::backdrop {
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(2px);
}

dialog.sheet[open] {
  animation: sheet-up 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sheet-card {
  max-height: 88dvh;
  overflow: auto;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sheet-head img {
  width: 52px;
  height: 56px;
  object-fit: contain;
  flex: none;
}

.sheet-head h2 {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.sheet-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-top);
  color: var(--ink);
  cursor: pointer;
  flex: none;
}

.sheet-close .icon {
  width: 19px;
  height: 19px;
}

.sheet-sub {
  margin: 0.45rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.sheet-lesson-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.sheet-actions .btn {
  min-height: 46px;
  padding-inline: 0.6rem;
  font-size: 0.82rem;
}

.sheet-reveal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  margin-top: 0.7rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--bg-top);
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.sheet-reveal .icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
  transition: transform 0.2s ease;
}

.sheet-reveal[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}

.sheet-explainer {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line-strong);
}

.sheet-explainer h3 {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.sheet-explainer ol {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: explain;
}

.sheet-explainer li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  counter-increment: explain;
}

.sheet-explainer li::before {
  content: counter(explain);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 0.72rem;
  font-weight: 700;
  flex: none;
}

.sheet-explainer li .step-text {
  flex: 1;
}

.sheet-explainer li strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.45;
}

.sheet-explainer li span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.sheet-note {
  margin: 0.7rem 0 0;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  background: var(--amber-soft);
  color: #5f4300;
  font-size: 0.72rem;
  line-height: 1.55;
}

body.sheet-open {
  overflow: hidden;
}

/* ---------- Misc ---------- */

.empty-state {
  padding: 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: #fff;
  color: var(--muted);
  font-size: 0.84rem;
}

.noscript-note {
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  background: var(--amber-soft);
  color: #5f4300;
  font-size: 0.8rem;
}

@media (min-width: 768px) {
  .site-footer {
    margin-top: 3rem;
  }
}
