/* Desktop: preserve existing fine adjustments. */
.hero .herocopy{transform:translateY(-22px)}
.hero h2 .hero-e{display:inline-block;margin-right:.14em}
.mobile-home{display:none}
@media(max-width:640px){
 #app .shell{height:auto!important;min-height:100dvh;overflow:visible!important;display:block!important}
 #app .shell .content{box-sizing:border-box;min-width:0;height:auto!important;max-height:none!important;overflow:visible!important;padding:0 12px calc(100px + env(safe-area-inset-bottom))!important}
 #app #view{height:auto!important;max-height:none!important;overflow:visible!important}
 #app #view>.desktop-home-hero,#app #view>.desktop-home-section{display:none!important}
 #app #view>.mobile-home{display:block!important;min-width:0}
 #app .mobile-app-header{min-height:64px;padding:8px 16px}
 .mobile-home-hero{position:relative;isolation:isolate;min-height:310px;border-radius:16px;overflow:hidden;background:#efd9ca;margin:10px 0 24px;display:flex;align-items:center}
 .mobile-home-photo{position:absolute;inset:0;z-index:-1;background:url('assets/lira-banner-principal.png') no-repeat 72% center;background-size:auto 100%}
 .mobile-home-photo:after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#efd9ca 0%,#efd9ca 30%,rgba(239,217,202,.92) 40%,rgba(239,217,202,.12) 53%,transparent 60%)}
 .mobile-home-copy{width:52%;padding:16px 0 16px 14px;box-sizing:border-box;color:#2b2023}
 .mobile-home-copy>span{display:block;color:#94616c;font:800 9px/1.2 Arial,sans-serif;letter-spacing:.16em}
 .mobile-home-copy>b{display:block;margin-top:12px;color:#94616c;font:800 10px/1.3 Arial,sans-serif}
 .mobile-home-copy h2{margin:14px 0;font:800 clamp(21px,6.1vw,27px)/1.04 Arial,sans-serif;letter-spacing:-.035em;text-transform:uppercase;overflow-wrap:normal}
 .mobile-home-copy h2 em{color:#94616c;font-style:normal}
 .mobile-hero-cta{border:0;border-radius:20px;background:#8d5967;color:white;padding:10px 12px;font:700 11px Arial,sans-serif;cursor:pointer}
 .mobile-featured,.mobile-training{margin:0 0 24px;min-width:0}
 .mobile-featured-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}
 .mobile-featured-head h2{margin:0;font:800 22px/1.15 Arial,sans-serif;color:#2b2023}
 .mobile-featured-head button{border:0;background:none;color:#94616c;font:700 12px Arial,sans-serif;white-space:nowrap;cursor:pointer}
 .mobile-featured-rail{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;padding:0 0 8px;min-width:0}
 .mobile-module-card{display:flex;flex-direction:column;flex:0 0 calc((100% - 20px)/3);min-width:0;padding:0;overflow:hidden;border:1px solid #eadbd4;border-radius:10px;background:#fffdfb;scroll-snap-align:start;text-align:left;color:#2b2023;cursor:pointer}
 .mobile-module-thumb{display:block;width:100%;height:auto;aspect-ratio:4/7;object-fit:contain;background:#f1e6df}
 .mobile-card-title{font:800 12px/1.2 Arial,sans-serif;padding:8px 7px 3px}
 .mobile-card-description{font:400 11px/1.3 Arial,sans-serif;padding:0 7px 9px;overflow-wrap:anywhere}
 .mobile-training-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
 #app .side .nav .mobile-profile-photo{display:block!important;width:26px;height:26px;object-fit:cover;border-radius:50%}
 #app .side .nav .mobile-profile-nav:before{display:none!important}
 #app .side{box-sizing:border-box;height:calc(72px + env(safe-area-inset-bottom))!important;padding-bottom:calc(8px + env(safe-area-inset-bottom))!important}
 #app .side .nav button svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
}

.card.is-locked { cursor: pointer !important; filter: grayscale(1) !important; opacity: 1 !important; }
.card.is-locked .thumb { filter: grayscale(1) !important; }
.card:not(.is-locked), .card:not(.is-locked) .thumb { filter: none !important; opacity: 1 !important; }
.mobile-module-card.is-locked { filter: grayscale(1) !important; opacity: 1 !important; cursor: pointer; }
.mobile-module-card:not(.is-locked) { filter: none !important; opacity: 1 !important; }
.coming-soon { display:block; margin-top:5px; color:#b18435; font:800 10px/1 Arial,sans-serif; letter-spacing:1.5px; text-transform:uppercase; }
.card.is-locked .coming-soon { color:#777 !important; }
.mobile-card-title .coming-soon { margin-top:4px; font-size:9px; letter-spacing:1px; }
.lesson-item.is-locked .lesson-thumb { filter: grayscale(1) !important; }
.lesson-item.is-locked .coming-soon { color:#777 !important; }

/* Player ampliado e identificação animada somente no notebook/desktop. */
@media (min-width: 641px) {
  .course-player-card .lesson-video-shell { position: relative; width: 100%; overflow: hidden; background: #211318; }
  .course-player-card .lesson-video { width: 100%; height: clamp(420px, 43vw, 680px); aspect-ratio: auto; object-fit: cover; object-position: center top; }
  .lesson-presenter { position: absolute; right: 18px; bottom: 58px; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 7px; border: 1px solid rgba(255,238,213,.55); border-radius: 999px; background: rgba(45,18,24,.82); color: #fff4df; box-shadow: 0 8px 24px rgba(0,0,0,.28); animation: presenterFloat 3.2s ease-in-out infinite; pointer-events: none; }
  .lesson-presenter img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; object-position: center; border: 2px solid #e7bd72; transform: scale(1.18); }
  .lesson-presenter span { font: 800 13px/1.1 Arial,sans-serif; letter-spacing: .04em; white-space: nowrap; }
  @keyframes presenterFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
}
.side .avatar { padding:0 !important; overflow:hidden !important; border-radius:50% !important; display:grid !important; place-items:center !important; }
.side .avatar img { display:block !important; width:100% !important; height:100% !important; max-width:none !important; max-height:none !important; border-radius:50% !important; object-fit:cover !important; object-position:center !important; }
.admin-lesson-row { display:flex; justify-content:space-between; gap:16px; padding:12px 0; border-top:1px solid rgba(93,45,58,.12); }
.admin-lesson-row span { color:#775e63; font-size:13px; }
.lesson-more { width:100%; margin-top:8px; padding:11px 14px; border:1px solid #d5a968; border-radius:999px; background:#fffaf7; color:#6d3c4b; font-weight:800; cursor:pointer; }

/* Cursos mobile: todas as 12 aulas ficam visíveis em uma grade vertical. */
@media (max-width: 640px) {
  .content #view > .page:not(.course-enhanced) > .section { position: relative; margin-top: 18px; padding: 0 0 84px; }
  .content #view > .page:not(.course-enhanced) > .section .cards { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; gap: 10px !important; width: 100%; padding: 0 !important; overflow: visible !important; }
  .content #view > .page:not(.course-enhanced) > .section .card { width: 100% !important; min-width: 0 !important; height: auto !important; aspect-ratio: auto !important; border-radius: 14px !important; overflow: hidden !important; }
  .content #view > .page:not(.course-enhanced) > .section .card .thumb { width: 100% !important; height: auto !important; aspect-ratio: 4 / 7 !important; background-size: 100% 100% !important; background-position: center !important; }
  .content #view > .page:not(.course-enhanced) > .section .cardcopy { position: static !important; display: block !important; min-height: 82px; padding: 12px !important; opacity: 1 !important; background: #fffaf7 !important; }
  .content #view > .page:not(.course-enhanced) > .section .cardcopy h3 { margin: 0 0 5px; font-size: 15px; line-height: 1.15; }
  .content #view > .page:not(.course-enhanced) > .section .cardcopy .muted { font-size: 12px; line-height: 1.35; }
  .content #view > .page:not(.course-enhanced) > .section .carousel-arrow { display: none !important; }
}

/* Cada aula usa a capa informada pelo próprio módulo, sem o mapeamento antigo por posição. */
.page .card .thumb,
.section .card .thumb {
  background-image: var(--card-image) !important;
}

/* Hero mobile: foto sem sombra sobreposta e texto com contraste localizado. */
@media (max-width: 640px) {
  .mobile-home-hero {
    box-shadow: none !important;
  }

  .mobile-home-photo {
    filter: none !important;
  }

  .mobile-home-photo::after {
    background: linear-gradient(
      90deg,
      rgba(239, 217, 202, .98) 0%,
      rgba(239, 217, 202, .96) 30%,
      rgba(239, 217, 202, .72) 43%,
      rgba(239, 217, 202, .16) 56%,
      transparent 66%
    ) !important;
  }

  .mobile-home-copy {
    position: relative;
    z-index: 1;
    text-shadow: none;
  }

  .mobile-home-copy h2,
  .mobile-home-copy > b,
  .mobile-home-copy > span {
    text-shadow: 0 1px 0 rgba(255, 248, 242, .7);
  }
}

/* Página de reprodução mobile: composição independente da página inicial. */
@media (max-width: 640px) {
  .content:has(.course-enhanced) { padding: 0 12px calc(92px + env(safe-area-inset-bottom)) !important; }
  .content:has(.course-enhanced) .top { display: none !important; }
  .course-enhanced { width: 100%; max-width: none; padding-top: 12px; }
  .course-enhanced > .back { display: block; margin: 0 4px 12px; padding: 0; border: 0; background: transparent; color: #5b2938; font-size: 16px; line-height: 1.2; }
  .course-enhanced > h1 { margin: 0 4px 4px; color: #342528; font: 500 clamp(28px, 8vw, 34px)/1.05 Georgia, serif; }
  .course-enhanced > .muted { margin: 0 4px 12px; color: #806f72; font-size: 13px; line-height: 1.35; }
  .course-learning-layout { display: flex !important; flex-direction: column; gap: 12px !important; margin-top: 0 !important; }
  .course-player-column { min-width: 0; }
  .course-player-card { overflow: hidden; border-radius: 16px; box-shadow: 0 8px 24px rgba(74,40,45,.12); }
  .course-player-card .lesson-video { display: block; width: 100%; max-width: 100%; height: auto; min-height: 0; aspect-ratio: 16 / 9; object-fit: cover; object-position: center top; background: #211318; }
  .lesson-presenter { display: none !important; }
  .course-player-card .lesson-video::-webkit-media-controls-panel,
  .course-player-card .lesson-video::-webkit-media-controls-enclosure { background-image: none !important; background-color: transparent !important; }
  .course-player-info { padding: 14px 16px 16px; }
  .course-player-kicker { font-size: 10px; letter-spacing: .14em; }
  .course-player-info h2 { margin: 5px 0 3px; font-size: 25px; line-height: 1.05; }
  .course-player-info p { margin: 0; font-size: 13px; line-height: 1.35; }
  .course-player-actions { display: flex; gap: 8px; margin-top: 12px; }
  .course-player-actions button { flex: 1 1 0; min-height: 40px; padding: 9px 8px; font-size: 12px; white-space: nowrap; }
  .lesson-playlist, .course-support-panel { width: 100%; min-width: 0; padding: 14px; border-radius: 16px; box-shadow: 0 5px 16px rgba(74,40,45,.06); }
  .lesson-playlist { order: 2; }
  .course-panel-kicker { font-size: 10px; letter-spacing: .14em; }
  .lesson-playlist h3, .course-support-panel h3 { margin: 4px 0 10px; font-size: 23px; }
  .lesson-count { font-size: 11px; margin-top: 7px; }
  .lesson-item { grid-template-columns: 70px minmax(0,1fr); gap: 10px; min-height: 60px; padding: 7px; border-radius: 10px; }
  .lesson-thumb { width: 70px; height: 44px; aspect-ratio: auto; background-size: contain; background-repeat: no-repeat; background-color: #f3e5df; }
  .lesson-item strong { font-size: 12px; }
  .lesson-item small { margin-top: 3px; font-size: 10px; }
  .course-bottom-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 12px !important; margin-top: 12px !important; }
  .course-bottom-grid .course-comments { order: 1; }
  .course-bottom-grid > .course-support-panel:last-child { order: 2; }
  .course-tabs { display: flex; gap: 8px; margin-bottom: 12px; padding: 0; border: 0; }
  .course-tab { flex: 1; min-height: 40px; padding: 8px 6px; font-size: 12px; }
  .workspace-input { min-height: 90px; font-size: 13px; }
  .course-comments button.workspace-save { min-height: 40px; padding: 9px 14px; font-size: 12px; }
  .course-materials-list { gap: 8px; }
  .course-empty { padding: 12px; font-size: 12px; }
}

/* Hero mobile: foto sem sombra sobreposta e texto com contraste localizado. */
@media (max-width: 640px) {
  .mobile-home-hero { box-shadow: none !important; }
  .mobile-home-photo {
    filter: none !important;
    background-position: 78% center !important;
  }
  .mobile-home-photo::after { display: none !important; }
  .mobile-home-copy {
    position: relative;
    z-index: 1;
    width: 56%;
    padding-right: 10px;
    background: rgba(239,217,202,.94);
    text-shadow: none;
  }
  .mobile-home-copy h2,
  .mobile-home-copy > b,
  .mobile-home-copy > span { text-shadow: none; }
}
