/* Compact module navigation: closed lessons must not reserve any vertical space. */
.module-nav {
  gap: 0;
}

.module-group {
  border-radius: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.module-group:first-child {
  border-radius: 12px 12px 0 0;
}

.module-group:last-child {
  border-bottom: 0;
  border-radius: 0 0 12px 12px;
}

.module-group.open {
  margin: 4px 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
}

.module-toggle {
  min-height: 52px;
}

.lesson-nav {
  display: none;
  overflow: hidden;
}

.module-group.open .lesson-nav {
  display: grid;
  grid-template-rows: auto;
  animation: reveal-lessons 220ms ease both;
}

@keyframes reveal-lessons {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 950px) {
  .module-nav {
    gap: 0;
  }
}

.training-access {
  margin: 24px 0 20px;
  padding: 22px 19px;
  border: 1px solid rgba(255, 223, 56, .35);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 223, 56, .13), rgba(52, 109, 255, .08));
  box-shadow: 0 16px 36px rgba(0, 0, 0, .12);
}

.access-label,
.gate-kicker {
  color: #ffe45e;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
}

.training-access h2 {
  margin: 9px 0 8px;
  color: #fff;
  font-size: 20px;
  line-height: 1.15;
}

.training-access p {
  margin: 0 0 18px;
  color: #cbd7ec;
  font-size: 12px;
  line-height: 1.55;
}

.training-access form { display: grid; gap: 8px; }
.training-access label { font-size: 11px; font-weight: 800; }
.training-access input {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 9px;
  background: rgba(3, 18, 44, .7);
  color: #fff;
  font: inherit;
  font-size: 12px;
  letter-spacing: .03em;
}
.training-access input:focus { outline: 2px solid #ffe45e; outline-offset: 2px; }
.training-access input::placeholder { color: #99a9c7; }
.training-access form button,
.gate-buy {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-radius: 9px;
  background: #ffe45e;
  color: #081a3d;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.training-access form button:hover,
.gate-buy:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(255, 223, 56, .18); }
.training-access form button:disabled { opacity: .65; cursor: wait; }
.training-access .access-message { margin: 9px 0 0; color: #ffe45e; }
.training-access small { display: block; margin-top: 14px; color: #b2c2df; line-height: 1.5; }
.training-access > a { display: inline-block; margin-top: 12px; color: #fff; font-size: 12px; font-weight: 800; }
.training-unlocked { margin: 24px 0 20px; padding: 15px; border: 1px solid rgba(255, 223, 56, .4); border-radius: 12px; color: #ffe45e; font-size: 12px; font-weight: 800; }

.lesson-gate {
  max-width: 800px;
  margin-top: 25px;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid #cdd9f0;
  border-radius: 20px;
  background: linear-gradient(145deg, #0b1f42, #152d5b);
  color: #fff;
  box-shadow: 0 20px 45px rgba(10, 32, 69, .14);
}
.lesson-gate h3 { margin: 12px 0 8px; color: #fff; font-size: clamp(23px, 3vw, 31px); letter-spacing: -.04em; }
.lesson-gate p { max-width: 540px; margin: 0 0 20px; color: #d4def0; font-size: 15px; line-height: 1.65; }
.lesson-gate > div { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.lesson-gate button { border: 0; background: transparent; color: #fff; font-size: 13px; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.lesson-gate small { display: block; margin-top: 18px; color: #aebed9; }
.lesson-loading,
.lesson-error { margin: 35px 0; color: #31415c; }

.lesson-resources { max-width: 800px; margin-top: 28px; padding: 25px; border: 1px solid #d5e0f3; border-radius: 20px; background: linear-gradient(145deg, #f7faff, #eef4ff); }
.resource-heading > span,
.related-lessons > span { color: #326bff; font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.resource-heading h3 { margin: 8px 0 20px; color: #0b2452; font-size: 24px; letter-spacing: -.04em; }
.resource-grid { display: grid; gap: 14px; }
.resource-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 15px; padding: 19px; border: 1px solid #d8e3f6; border-radius: 16px; background: #fff; box-shadow: 0 8px 20px rgba(21, 64, 140, .05); }
.resource-card img { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; box-shadow: 0 7px 15px rgba(226, 112, 10, .22); }
.resource-symbol { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: #326bff; color: #fff; font-size: 20px; font-weight: 900; }
.resource-card h4 { margin: 0 0 5px; color: #10295a; font-size: 17px; }
.resource-card p { margin: 0; color: #51627e; font-size: 14px; line-height: 1.55; }
.resource-card .copy-highlight { color: #193e86; font-weight: 800; }
.resource-eyebrow { display: block; margin: 2px 0 6px; color: #4285f4; font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.resource-logo { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #e4eaf4; border-radius: 14px; background: #fff; box-shadow: 0 8px 18px rgba(27, 67, 135, .08); }
.google-mark { width: 29px; height: 29px; }
.google-resource { border-color: #c8d9ff; background: linear-gradient(135deg, #fff 0%, #f4f8ff 100%); }
.resource-detail { margin-top: 10px !important; padding-top: 10px; border-top: 1px solid #e3ebf8; color: #304b78 !important; }
.resource-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 0; padding: 0; list-style: none; }
.resource-tags li { padding: 6px 8px; border: 1px solid #d8e5fb; border-radius: 999px; background: #fff; color: #2859ad; font-size: 11px; font-weight: 800; }
.resource-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.resource-links a { padding: 7px 9px; border-radius: 8px; background: #edf3ff; color: #2156d8; font-size: 12px; font-weight: 800; text-decoration: none; }
.resource-links a:hover { background: #dce8ff; }
.lesson-sections p .copy-highlight,
.lesson-intro .copy-highlight,
.lesson-tip .copy-highlight { color: #132f66; font-weight: 800; }
.related-lessons { max-width: 800px; margin-top: 18px; padding: 21px 0 2px; border-top: 1px solid #dce4f1; }
.related-lessons > div { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.related-lesson { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid #ccd9ef; border-radius: 10px; background: #fff; color: #123570; font-size: 13px; font-weight: 800; text-align: left; cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.related-lesson:hover { transform: translateY(-2px); border-color: #7da4fa; box-shadow: 0 8px 18px rgba(27, 72, 153, .1); }

@media (max-width: 600px) {
  .lesson-resources { padding: 20px 16px; }
  .resource-card { grid-template-columns: 36px minmax(0, 1fr); padding: 14px; }
  .resource-card img, .resource-symbol { width: 36px; height: 36px; }
  .related-lesson { width: 100%; }
}

.training-key-box {
  margin: 24px 0;
  padding: 22px;
  border: 1px solid #adc4f8;
  border-radius: 15px;
  background: #f3f7ff;
}
.training-key-box h2 { margin: 0 0 8px; font-size: 21px; }
.training-key-box p { margin: 0 0 14px; }
.training-key-box code { display: block; overflow-wrap: anywhere; padding: 13px; border: 1px dashed #6a91dc; border-radius: 9px; color: #0b2a64; background: #fff; font-size: clamp(13px, 2vw, 18px); font-weight: 800; letter-spacing: .04em; }
.training-key-box button { margin-top: 12px; padding: 10px 16px; border: 0; border-radius: 9px; background: #326bff; color: #fff; font-weight: 800; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .module-group.open .lesson-nav { animation: none; }
}
