/* VƯỜN NGOẠI NGỮ v6.15.345 — English compact learning UI */

/* One compact status header replaces the repeated FREE/PLUS promo strip
   while a practice module is active. */
body.v345-ui.v345-compact-active #v328LessonAccessStrip{
  display:none!important;
}

body.v345-ui .v345-compact-panel{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  overflow:visible!important;
}
body.v345-ui .v345-compact-panel>.activity-heading{
  display:none!important;
}
body.v345-ui .v345-compact-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:12px!important;
  align-items:center!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  margin:10px 0 12px!important;
  padding:13px 14px!important;
  border:1px solid #dbe8e4!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:0 6px 18px rgba(31,61,53,.045)!important;
}
body.v345-ui .v345-compact-copy{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
}
body.v345-ui .v345-compact-kicker{
  margin:0 0 3px!important;
  font-size:11px!important;
  line-height:1.3!important;
  letter-spacing:.06em!important;
  font-weight:900!important;
  color:#0f766e!important;
}
body.v345-ui .v345-compact-head h2{
  margin:0!important;
  font-size:clamp(20px,2.4vw,27px)!important;
  line-height:1.25!important;
  letter-spacing:-.02em!important;
  color:#173f37!important;
}
body.v345-ui .v345-compact-head p{
  margin:4px 0 0!important;
  font-size:14px!important;
  line-height:1.45!important;
  color:#64748b!important;
}
body.v345-ui .v345-compact-kicker,
body.v345-ui .v345-compact-head h2,
body.v345-ui .v345-compact-head p{
  writing-mode:horizontal-tb!important;
  text-orientation:mixed!important;
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
  max-width:100%!important;
}
body.v345-ui .v345-compact-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:7px!important;
  flex-wrap:wrap!important;
  min-width:0!important;
}
body.v345-ui .v345-tier{
  display:inline-flex!important;
  align-items:center!important;
  min-height:34px!important;
  padding:6px 10px!important;
  border:1px solid #cfe4de!important;
  border-radius:999px!important;
  background:#f2faf7!important;
  color:#176f65!important;
  font-size:12px!important;
  font-weight:900!important;
  line-height:1.2!important;
  white-space:nowrap!important;
}
body.v345-ui .v345-compact-actions button{
  min-width:0!important;
  min-height:36px!important;
  max-width:100%!important;
  padding:7px 10px!important;
  font-size:12px!important;
  line-height:1.25!important;
  white-space:normal!important;
}

/* Keep inner navigation horizontal and compact. */
body.v345-ui .v345-compact-panel>.flow-subnav{
  display:flex!important;
  gap:7px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  width:100%!important;
  max-width:100%!important;
  padding:0 0 8px!important;
  margin:0 0 8px!important;
  scrollbar-width:none;
}
body.v345-ui .v345-compact-panel>.flow-subnav::-webkit-scrollbar{display:none}
body.v345-ui .v345-compact-panel>.flow-subnav button{
  flex:0 0 auto!important;
  min-height:38px!important;
  padding:7px 11px!important;
  border-radius:999px!important;
  font-size:13px!important;
  line-height:1.25!important;
  white-space:nowrap!important;
}

/* =========================================================
   ROLEPLAY — definitive mobile collapse fix + one practice surface
   ========================================================= */
body.v345-ui #skill-dubbing,
body.v345-ui #skill-dubbing *{
  writing-mode:horizontal-tb!important;
  text-orientation:mixed!important;
}
body.v345-ui #skill-dubbing{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
}
body.v345-ui #skill-dubbing :where(
  div,section,article,header,p,h1,h2,h3,h4,strong,small,span,b,button
){
  min-width:0!important;
  max-width:100%!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
}
body.v345-ui #skill-dubbing .v344-role-modes{
  width:100%!important;
  max-width:100%!important;
  margin:0 0 10px!important;
}
body.v345-ui #skill-dubbing .v344-role-modes>button{
  min-width:0!important;
  max-width:100%!important;
  min-height:92px!important;
  padding:12px!important;
  border-radius:15px!important;
}
body.v345-ui #skill-dubbing .v344-role-modes>button b{
  font-size:17px!important;
}
body.v345-ui #skill-dubbing .v344-role-modes>button small{
  font-size:13px!important;
  line-height:1.4!important;
}
body.v345-ui #skill-dubbing #dubbingShell{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  padding:12px!important;
  border-radius:16px!important;
  overflow:hidden!important;
}
body.v345-ui #skill-dubbing .dubbing-stage-head{
  grid-template-columns:minmax(0,1fr) auto!important;
  width:100%!important;
  min-width:0!important;
}
body.v345-ui #skill-dubbing .dubbing-stage-head>div{
  min-width:0!important;
}
body.v345-ui #skill-dubbing .dubbing-target-card,
body.v345-ui #skill-dubbing .dubbing-script-lines,
body.v345-ui #skill-dubbing .dubbing-script-line{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
body.v345-ui #skill-dubbing .dubbing-script-line strong,
body.v345-ui #skill-dubbing .dubbing-target-card strong{
  display:block!important;
  width:auto!important;
  min-width:0!important;
  max-width:100%!important;
  font-size:17px!important;
  line-height:1.5!important;
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
}
body.v345-ui #skill-dubbing .v344-role-practice-label{
  margin:10px 0 7px!important;
  padding:9px 11px!important;
}
body.v345-ui #skill-dubbing .v344-role-practice-label strong{
  font-size:14px!important;
}
body.v345-ui #skill-dubbing .dubbing-actions{
  gap:7px!important;
}
body.v345-ui #skill-dubbing .dubbing-actions>button{
  min-height:44px!important;
  padding:8px 9px!important;
  font-size:14px!important;
}
body.v345-ui #skill-dubbing .audio-settings{
  margin-top:8px!important;
}
body.v345-ui #skill-dubbing .audio-settings summary{
  min-height:38px!important;
  padding:7px 9px!important;
  font-size:12px!important;
}

/* =========================================================
   LISTENING — one mode at a time
   ========================================================= */
body.v345-ui #skill-listening #lessonPartListening{
  display:none!important;
}
body.v345-ui #skill-listening .listening-path-card,
body.v345-ui #skill-listening .v345-hidden-guide{
  display:none!important;
}
body.v345-ui #skill-listening .v345-listen-tabs{
  display:flex!important;
  gap:7px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  width:100%!important;
  max-width:100%!important;
  margin:0 0 8px!important;
  padding:1px 0 4px!important;
  scrollbar-width:none;
}
body.v345-ui #skill-listening .v345-listen-tabs::-webkit-scrollbar{display:none}
body.v345-ui #skill-listening .v345-listen-tabs button{
  flex:1 1 0!important;
  min-width:145px!important;
  min-height:44px!important;
  padding:8px 10px!important;
  border:1px solid #dbe6e2!important;
  border-radius:13px!important;
  background:#fff!important;
  color:#38534c!important;
  font:inherit!important;
  font-size:14px!important;
  line-height:1.25!important;
  font-weight:800!important;
  white-space:normal!important;
  cursor:pointer!important;
}
body.v345-ui #skill-listening .v345-listen-tabs button small{
  display:block!important;
  margin-top:2px!important;
  font-size:10px!important;
  color:#7a8a85!important;
}
body.v345-ui #skill-listening .v345-listen-tabs button.active{
  border-color:#0f8f83!important;
  background:#effaf7!important;
  color:#0f766e!important;
  box-shadow:0 0 0 2px rgba(15,143,131,.08)!important;
}
body.v345-ui #skill-listening .v345-listen-tabs button.locked{
  background:#fffaf1!important;
}
body.v345-ui #skill-listening .v345-listen-lock{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  margin:0 0 10px!important;
  padding:9px 11px!important;
  border:1px solid #eadfc8!important;
  border-radius:12px!important;
  background:#fffaf1!important;
  color:#6b5d42!important;
  font-size:12px!important;
  line-height:1.4!important;
}
body.v345-ui #skill-listening .v345-listen-lock[hidden]{
  display:none!important;
}
body.v345-ui #skill-listening .v345-listen-lock button{
  flex:0 0 auto!important;
  min-height:34px!important;
  padding:6px 9px!important;
  border-radius:10px!important;
  white-space:nowrap!important;
}
body.v345-ui #skill-listening .listening-practice-section{
  margin-top:8px!important;
  padding-top:0!important;
  border-top:0!important;
}
body.v345-ui #skill-listening .listening-practice-section[hidden]{
  display:none!important;
}
body.v345-ui #skill-listening .listening-section-head{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr) auto!important;
  gap:8px!important;
  align-items:center!important;
  margin:0 0 9px!important;
}
body.v345-ui #skill-listening .listening-section-head>span{
  width:30px!important;
  height:30px!important;
  flex-basis:30px!important;
}
body.v345-ui #skill-listening .listening-section-head h3{
  margin:0!important;
  font-size:18px!important;
  line-height:1.3!important;
}
body.v345-ui #skill-listening .listening-section-head p{
  display:none!important;
}
body.v345-ui #skill-listening .listening-tier{
  font-size:10px!important;
  white-space:nowrap!important;
}
body.v345-ui #skill-listening .listen-catch-example{
  display:none!important;
}
body.v345-ui #skill-listening .listening-plus-lock-card{
  display:none!important;
}
body.v345-ui #skill-listening .exercise-stack{
  gap:9px!important;
  padding-bottom:12px!important;
}
body.v345-ui #skill-listening .exercise-item{
  padding:13px!important;
  border-radius:14px!important;
}

/* =========================================================
   READING — keep content, remove repeated framing
   ========================================================= */
body.v345-ui #skill-reading #readingContent{
  padding:15px!important;
  border-radius:16px!important;
}
body.v345-ui #skill-reading #readingContent>p:first-child{
  margin-top:0!important;
  font-size:16px!important;
  line-height:1.7!important;
}
body.v345-ui #skill-reading .reading-q{
  margin-top:13px!important;
  padding-top:12px!important;
}
body.v345-ui #skill-reading .reading-q>strong{
  font-size:16px!important;
  line-height:1.45!important;
}

/* =========================================================
   SHADOWING — hide policy wall, keep one compact disclosure
   ========================================================= */
body.v345-ui #skill-shadowing #shadowingCreditRule{
  display:none!important;
}
body.v345-ui #skill-shadowing .v345-credit-note{
  margin:0 0 9px!important;
  border:1px solid #dde7e3!important;
  border-radius:12px!important;
  background:#f8fbfa!important;
}
body.v345-ui #skill-shadowing .v345-credit-note summary{
  padding:8px 10px!important;
  cursor:pointer!important;
  font-size:12px!important;
  font-weight:850!important;
  color:#526963!important;
}
body.v345-ui #skill-shadowing .v345-credit-note p{
  margin:0!important;
  padding:0 10px 9px!important;
  font-size:12px!important;
  line-height:1.45!important;
  color:#64748b!important;
}
body.v345-ui #skill-shadowing #shadowFullDialogue{
  margin:0 0 9px!important;
  padding:11px!important;
  border-radius:14px!important;
}
body.v345-ui #skill-shadowing .shadow-toolbar-v2{
  margin-bottom:9px!important;
  padding:11px!important;
  border-radius:14px!important;
}
body.v345-ui #skill-shadowing .shadow-practice-options summary{
  font-size:12px!important;
}

/* =========================================================
   AI REFLEX — start first, options on demand
   ========================================================= */
body.v345-ui #skill-speaking #aiSpeakingCreditRule{
  display:none!important;
}
body.v345-ui #skill-speaking .ai-speaking-card{
  padding:14px!important;
  border-radius:16px!important;
}
body.v345-ui #skill-speaking .ai-speaking-top{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  padding:0 0 10px!important;
  margin-bottom:10px!important;
}
body.v345-ui #skill-speaking .ai-speaking-top h3,
body.v345-ui #skill-speaking .ai-live-badge{
  display:none!important;
}
body.v345-ui #skill-speaking #aiSpeakingTopic{
  margin:0!important;
  font-size:14px!important;
  line-height:1.4!important;
  font-weight:750!important;
}
body.v345-ui #skill-speaking .ai-speaking-meters{
  flex:0 0 auto!important;
}
body.v345-ui #skill-speaking .ai-mode-primary{
  margin:0 0 7px!important;
}
body.v345-ui #skill-speaking .ai-mode-primary .ai-mode{
  min-height:40px!important;
  padding:7px 10px!important;
}
body.v345-ui #skill-speaking .v345-ai-options{
  margin:0 0 8px!important;
  border:1px solid #dde7e3!important;
  border-radius:12px!important;
  background:#f8fbfa!important;
}
body.v345-ui #skill-speaking .v345-ai-options summary{
  padding:8px 10px!important;
  cursor:pointer!important;
  font-size:12px!important;
  font-weight:850!important;
  color:#526963!important;
}
body.v345-ui #skill-speaking .v345-ai-options-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
  padding:0 10px 10px!important;
}
body.v345-ui #skill-speaking .v345-ai-options-grid label{
  min-width:0!important;
}
body.v345-ui #skill-speaking .ai-quick-settings{
  display:block!important;
  margin:0 0 8px!important;
}
body.v345-ui #skill-speaking #aiStartBtn{
  width:100%!important;
  min-height:46px!important;
  font-size:15px!important;
}
body.v345-ui #skill-speaking .ai-badge-row,
body.v345-ui #skill-speaking .ai-voice-hint,
body.v345-ui #skill-speaking .v345-secondary-note{
  display:none!important;
}
body.v345-ui #skill-speaking .ai-status{
  margin:7px 0!important;
}
body.v345-ui #skill-speaking .ai-chat{
  min-height:180px!important;
  border-radius:14px!important;
}
body.v345-ui #skill-speaking .ai-input-shell{
  margin-top:9px!important;
}

/* =========================================================
   MOBILE: strict width protection — fixes the one-letter-per-line bug
   ========================================================= */
@media(max-width:700px){
  body.v345-ui .v345-compact-head{
    grid-template-columns:1fr!important;
    gap:8px!important;
    padding:11px 12px!important;
  }
  body.v345-ui .v345-compact-actions{
    justify-content:flex-start!important;
    width:100%!important;
  }
  body.v345-ui .v345-compact-actions .complete-skill,
  body.v345-ui .v345-compact-actions .activity-reset-btn{
    flex:1 1 auto!important;
  }

  body.v345-ui #skill-dubbing{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  body.v345-ui #skill-dubbing>.v345-compact-head,
  body.v345-ui #skill-dubbing .v344-role-modes,
  body.v345-ui #skill-dubbing #dubbingShell,
  body.v345-ui #skill-dubbing #dubbingStage{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  body.v345-ui #skill-dubbing .v344-role-modes{
    display:grid!important;
    grid-template-columns:1fr!important;
  }
  body.v345-ui #skill-dubbing .v344-role-modes>button{
    display:grid!important;
    grid-template-columns:38px minmax(0,1fr)!important;
    width:100%!important;
  }
  body.v345-ui #skill-dubbing .v344-role-modes>button>span{
    width:38px!important;
    height:38px!important;
  }
  body.v345-ui #skill-dubbing .dubbing-stage-head{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:6px!important;
  }
  body.v345-ui #skill-dubbing .dubbing-stage-head>b{
    max-width:100%!important;
    text-align:left!important;
  }
  body.v345-ui #skill-dubbing .dubbing-script-line{
    grid-template-columns:30px minmax(0,1fr)!important;
  }
  body.v345-ui #skill-dubbing .dubbing-actions{
    grid-template-columns:1fr 1fr!important;
  }

  body.v345-ui #skill-listening .v345-listen-tabs button{
    flex:0 0 138px!important;
    min-width:138px!important;
  }
  body.v345-ui #skill-listening .v345-listen-lock{
    align-items:flex-start!important;
    flex-direction:column!important;
  }

  body.v345-ui #skill-shadowing .lesson-shell{
    grid-template-columns:1fr!important;
  }
  body.v345-ui #skill-shadowing .line-list{
    display:none!important;
  }
  body.v345-ui #skill-shadowing .action-grid{
    grid-template-columns:1fr 1fr!important;
    gap:7px!important;
  }

  body.v345-ui #skill-speaking .ai-speaking-top{
    align-items:flex-start!important;
    flex-direction:column!important;
  }
  body.v345-ui #skill-speaking .v345-ai-options-grid{
    grid-template-columns:1fr!important;
  }
  body.v345-ui #skill-speaking .ai-input-actions{
    grid-template-columns:1fr 1fr!important;
  }
}

@media(max-width:430px){
  body.v345-ui #skill-dubbing .dubbing-actions{
    grid-template-columns:1fr!important;
  }
  body.v345-ui #skill-shadowing .action-grid{
    grid-template-columns:1fr 1fr!important;
  }
  body.v345-ui #skill-speaking .ai-input-actions{
    grid-template-columns:1fr!important;
  }
}