/* VƯỜN NGOẠI NGỮ v6.15.333 — LEARNING FIRST / iOS CLEANUP
   Keep study content dominant. PLUS appears only after FREE value is used. */

:root{
  --v333-ink:#173f35;
  --v333-muted:#6d7f78;
  --v333-line:#dbe7e2;
  --v333-soft:#f8fbfa;
  --v333-free:#2f7d55;
  --v333-free-soft:#f2faf5;
  --v333-deep:#526fb8;
  --v333-deep-soft:#f5f7ff;
}

/* =========================================================
   1. FREE: REMOVE COMMERCIAL NOISE BEFORE THE LEARNING
   ========================================================= */
body.v333-ui.v333-free-learning #view-lesson .v333-commercial-hidden,
body.v333-ui.v333-free-learning #view-lesson .v331-ai-access-strip,
body.v333-ui.v333-free-learning #view-lesson #v328LessonAccessStrip,
body.v333-ui.v333-free-learning #view-lesson .v333-game-legend-hidden{
  display:none!important;
}

body.v333-ui.v333-free-learning #view-lesson .v333-free-policy-collapsed{
  display:none!important;
}

body.v333-ui.v333-free-learning #skill-grammar .v333-grammar-lock-hidden{
  display:none!important;
}

body.v333-ui.v333-free-learning #skill-grammar .grammar-ai-card{
  border:1px solid var(--v333-line)!important;
  background:#fff!important;
  box-shadow:0 5px 15px rgba(18,66,56,.04)!important;
}
body.v333-ui.v333-free-learning #skill-grammar .grammar-ai-head{
  padding-bottom:8px!important;
}
body.v333-ui.v333-free-learning #skill-grammar .grammar-ai-head h3{
  color:var(--v333-ink)!important;
}
body.v333-ui.v333-free-learning #skill-grammar .v333-free-plan{
  color:#2d7058!important;
  background:#eaf6f0!important;
  border-color:#cfe5da!important;
}

/* =========================================================
   2. ROLEPLAY: iOS SAFE, ONE GUIDE ONLY
   ========================================================= */
body.v333-ui #skill-dubbing .dubbing-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:14px!important;
  align-items:start!important;
}
body.v333-ui #skill-dubbing .dubbing-head>div{
  min-width:0!important;
}
body.v333-ui #skill-dubbing .dubbing-head h3,
body.v333-ui #skill-dubbing .dubbing-head p,
body.v333-ui #skill-dubbing .dubbing-kicker{
  overflow-wrap:anywhere!important;
  word-break:normal!important;
}
body.v333-ui #skill-dubbing .v333-role-mode-switch,
body.v333-ui #skill-dubbing .dubbing-mode-switch{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(132px,1fr))!important;
  gap:8px!important;
  min-width:min(320px,100%)!important;
  max-width:420px!important;
  align-self:start!important;
}
body.v333-ui #skill-dubbing .v333-role-mode-switch button,
body.v333-ui #skill-dubbing .dubbing-mode-switch button{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:center!important;
  gap:2px!important;
  min-width:0!important;
  min-height:56px!important;
  padding:9px 11px!important;
  white-space:normal!important;
  text-align:left!important;
  line-height:1.2!important;
}
body.v333-ui #skill-dubbing .dubbing-mode-switch button b{
  font-size:13px!important;
}
body.v333-ui #skill-dubbing .dubbing-mode-switch button small{
  color:#73847d!important;
  font-size:10.5px!important;
  line-height:1.25!important;
}

/* Chinese FREE role guide */
body.v333-ui #v287ZhRoleModes.v333-role-guide,
body.v333-ui #v287ZhRoleModes{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(280px,.95fr)!important;
  gap:12px!important;
  align-items:center!important;
  width:100%!important;
  box-sizing:border-box!important;
  margin:10px 0 12px!important;
  padding:12px!important;
  border:1px solid #d8e7e1!important;
  border-radius:15px!important;
  background:#f8fcfa!important;
}
body.v333-ui #v287ZhRoleModes .v287-role-title{
  min-width:0!important;
}
body.v333-ui #v287ZhRoleModes .v287-role-title span,
body.v333-ui #v287ZhRoleModes .v287-role-title strong,
body.v333-ui #v287ZhRoleModes .v287-role-title small{
  display:block!important;
  max-width:100%!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
body.v333-ui #v287ZhRoleModes .v287-role-title span{
  color:#2f725d!important;
  font-size:10.5px!important;
  font-weight:900!important;
  letter-spacing:.06em!important;
}
body.v333-ui #v287ZhRoleModes .v287-role-title strong{
  margin-top:3px!important;
  color:var(--v333-ink)!important;
  font-size:16px!important;
}
body.v333-ui #v287ZhRoleModes .v287-role-title small{
  margin-top:3px!important;
  color:var(--v333-muted)!important;
  font-size:11.5px!important;
  line-height:1.45!important;
}
body.v333-ui #v287ZhRoleModes .v287-role-buttons{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
  min-width:0!important;
}
body.v333-ui #v287ZhRoleModes .v287-role-buttons button{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  gap:2px!important;
  min-width:0!important;
  min-height:56px!important;
  padding:9px 10px!important;
  white-space:normal!important;
  text-align:left!important;
}
body.v333-ui #v287ZhRoleModes .v287-role-buttons button b{
  font-size:12.5px!important;
}
body.v333-ui #v287ZhRoleModes .v287-role-buttons button small{
  color:#72837c!important;
  font-size:10.5px!important;
}

/* Recording actions: always wrap, never overlap on iOS. */
body.v333-ui #skill-dubbing .dubbing-actions,
body.v333-ui #skill-dubbing .v289-role-tools,
body.v333-ui #skill-dubbing .v288-free-role-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  align-items:center!important;
}
body.v333-ui #skill-dubbing .dubbing-actions button,
body.v333-ui #skill-dubbing .v289-role-tools button,
body.v333-ui #skill-dubbing .v288-free-role-actions button{
  flex:1 1 150px!important;
  min-width:0!important;
  min-height:44px!important;
  white-space:normal!important;
}

/* =========================================================
   3. GAME: VIETNAMESE TRANSLATION UNDER EVERY QUESTION
   ========================================================= */
body.v333-ui #skill-quiz .v333-question-vi{
  display:flex!important;
  gap:7px!important;
  align-items:flex-start!important;
  margin:7px 0 10px!important;
  padding:8px 10px!important;
  border-left:3px solid #72a596!important;
  border-radius:8px!important;
  background:#f6faf8!important;
}
body.v333-ui #skill-quiz .v333-question-vi span{
  flex:0 0 auto!important;
  line-height:1.35!important;
}
body.v333-ui #skill-quiz .v333-question-vi strong{
  color:#49645c!important;
  font-size:12.5px!important;
  line-height:1.45!important;
  font-weight:750!important;
}
body.v333-ui #skill-quiz .quiz-question-card{
  border:1px solid var(--v333-line)!important;
  border-radius:15px!important;
  background:#fff!important;
  box-shadow:0 4px 12px rgba(18,66,56,.035)!important;
}
body.v333-ui.v333-free-learning #skill-quiz .v287-gate{
  margin-top:14px!important;
}

/* =========================================================
   4. LISTENING: REAL DEEP-PRACTICE SAMPLE WITHOUT SALES BLOCK
   ========================================================= */
body.v333-ui #skill-listening .v333-deep-listening-trial{
  margin:12px 0 16px!important;
  padding:14px!important;
  border:1px solid #d5deef!important;
  border-left:5px solid var(--v333-deep)!important;
  border-radius:16px!important;
  background:linear-gradient(135deg,var(--v333-deep-soft),#fff)!important;
}
body.v333-ui #skill-listening .v333-learning-kicker{
  margin-bottom:10px!important;
  color:#4f65a6!important;
  font-size:11px!important;
  font-weight:900!important;
  letter-spacing:.06em!important;
}
body.v333-ui #skill-listening .v333-deep-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
}
body.v333-ui #skill-listening .v333-deep-grid article{
  display:grid!important;
  gap:8px!important;
  min-width:0!important;
  padding:12px!important;
  border:1px solid #e0e6f1!important;
  border-radius:12px!important;
  background:#fff!important;
}
body.v333-ui #skill-listening .v333-deep-grid article>span{
  color:#52689e!important;
  font-size:10.5px!important;
  font-weight:900!important;
  letter-spacing:.04em!important;
}
body.v333-ui #skill-listening .v333-deep-grid article>strong{
  color:var(--v333-ink)!important;
  font-size:14px!important;
  line-height:1.4!important;
}
body.v333-ui #skill-listening .v333-deep-grid article>small{
  color:var(--v333-muted)!important;
  font-size:11.5px!important;
  line-height:1.4!important;
}
body.v333-ui #skill-listening .v333-deep-grid audio{
  width:100%!important;
  min-width:0!important;
}
body.v333-ui #skill-listening .v333-answer-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:7px!important;
}
body.v333-ui #skill-listening .v333-answer-row input,
body.v333-ui #skill-listening .v333-deep-grid textarea{
  width:100%!important;
  box-sizing:border-box!important;
  border:1px solid #d6e0dc!important;
  border-radius:10px!important;
  padding:9px 10px!important;
  color:var(--v333-ink)!important;
  background:#fff!important;
}
body.v333-ui #skill-listening .v333-tier-deep,
body.v333-ui #skill-listening .v333-deep-step small{
  color:#52689e!important;
}
body.v333-ui #skill-listening .v333-deep-step{
  background:#f5f7ff!important;
  border-color:#dce3f3!important;
}

/* =========================================================
   5. READ ALONG: FREE, AI SCORE AS OPTIONAL LEARNING TOOL
   ========================================================= */
body.v333-ui #skill-reading .reading-readalong-promo.locked,
body.v333-ui #skill-reading .plus-part-lock-badge,
body.v333-ui #skill-reading [data-plus-part-unlock="read_along"]{
  display:none!important;
}
body.v333-ui #skill-reading .read-along-kicker{
  color:#2e725c!important;
}
body.v333-ui #skill-reading .v333-read-ai-row{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  margin-top:10px!important;
  padding:11px 12px!important;
  border:1px solid #d9e7e1!important;
  border-radius:12px!important;
  background:#f8fcfa!important;
}
body.v333-ui #skill-reading .v333-read-ai-row>div{
  min-width:0!important;
}
body.v333-ui #skill-reading .v333-read-ai-row strong,
body.v333-ui #skill-reading .v333-read-ai-row small{
  display:block!important;
}
body.v333-ui #skill-reading .v333-read-ai-row strong{
  color:var(--v333-ink)!important;
  font-size:13px!important;
}
body.v333-ui #skill-reading .v333-read-ai-row small{
  margin-top:2px!important;
  color:var(--v333-muted)!important;
  font-size:11.5px!important;
  line-height:1.4!important;
}
body.v333-ui #skill-reading .v333-read-ai-row button{
  flex:0 0 auto!important;
  min-height:38px!important;
  white-space:nowrap!important;
}
body.v333-ui #skill-reading .v333-read-ai-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  flex:0 0 auto!important;
}
body.v333-ui #skill-reading .v333-read-ai-row audio{
  width:100%!important;
  grid-column:1/-1!important;
}
body.v333-ui #skill-reading .v333-read-ai-result{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  gap:10px!important;
  align-items:start!important;
  width:100%!important;
  padding:10px!important;
  border:1px solid #dce7e2!important;
  border-radius:10px!important;
  background:#fff!important;
}
body.v333-ui #skill-reading .v333-read-ai-result[hidden]{display:none!important}
body.v333-ui #skill-reading .v333-read-score{
  display:flex!important;
  align-items:flex-end!important;
  gap:2px!important;
  padding:8px 10px!important;
  border-radius:10px!important;
  background:#eef5ff!important;
  color:#4964a8!important;
}
body.v333-ui #skill-reading .v333-read-score strong{
  font-size:24px!important;
  line-height:1!important;
}
body.v333-ui #skill-reading .v333-read-score span{
  font-size:10px!important;
}
body.v333-ui #skill-reading .v333-read-ai-result p{
  margin:3px 0!important;
  color:#49615a!important;
  font-size:12.5px!important;
  line-height:1.45!important;
}

/* =========================================================
   6. GRAMMAR: FREE FIRST, ANALYZE → PRACTICE → RETRY
   ========================================================= */
body.v333-ui #skill-grammar .v333-grammar-tools{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:10px 14px!important;
  align-items:center!important;
  margin:12px 0!important;
  padding:13px 14px!important;
  border:1px solid #d8e6e0!important;
  border-left:5px solid #7e9d52!important;
  border-radius:15px!important;
  background:#fbfdf9!important;
}
body.v333-ui #skill-grammar .v333-grammar-tools>div{
  min-width:0!important;
}
body.v333-ui #skill-grammar .v333-grammar-tools span,
body.v333-ui #skill-grammar .v333-grammar-tools strong,
body.v333-ui #skill-grammar .v333-grammar-tools small{
  display:block!important;
}
body.v333-ui #skill-grammar .v333-grammar-tools span{
  color:#668348!important;
  font-size:10.5px!important;
  font-weight:900!important;
  letter-spacing:.06em!important;
}
body.v333-ui #skill-grammar .v333-grammar-tools strong{
  margin-top:3px!important;
  color:var(--v333-ink)!important;
  font-size:15px!important;
}
body.v333-ui #skill-grammar .v333-grammar-tools small{
  margin-top:3px!important;
  color:var(--v333-muted)!important;
  font-size:11.5px!important;
}
body.v333-ui #skill-grammar .v333-grammar-tools details{
  grid-column:1/-1!important;
  padding:9px 10px!important;
  border-radius:10px!important;
  background:#fff!important;
  border:1px solid #e1e9e5!important;
}
body.v333-ui #skill-grammar .v333-grammar-tools summary{
  cursor:pointer!important;
  color:#4e675f!important;
  font-size:12.5px!important;
  font-weight:850!important;
}
body.v333-ui #skill-grammar .v333-grammar-tools ol{
  margin:8px 0 0 20px!important;
  padding:0!important;
  color:#566c64!important;
  font-size:12px!important;
  line-height:1.55!important;
}
body.v333-ui #skill-grammar .v333-grammar-tools button{
  min-height:40px!important;
  white-space:nowrap!important;
}

/* =========================================================
   7. MOBILE / iOS / iPAD
   ========================================================= */
@media(max-width:900px){
  body.v333-ui #skill-dubbing .dubbing-head{
    grid-template-columns:1fr!important;
  }
  body.v333-ui #skill-dubbing .v333-role-mode-switch,
  body.v333-ui #skill-dubbing .dubbing-mode-switch{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
  }
  body.v333-ui #v287ZhRoleModes{
    grid-template-columns:1fr!important;
  }
}
@media(max-width:700px){
  body.v333-ui #skill-dubbing .v333-role-mode-switch,
  body.v333-ui #skill-dubbing .dubbing-mode-switch,
  body.v333-ui #v287ZhRoleModes .v287-role-buttons{
    grid-template-columns:1fr!important;
  }
  body.v333-ui #skill-dubbing .dubbing-mode-switch button,
  body.v333-ui #v287ZhRoleModes .v287-role-buttons button{
    width:100%!important;
  }
  body.v333-ui #skill-dubbing .dubbing-actions button,
  body.v333-ui #skill-dubbing .v289-role-tools button,
  body.v333-ui #skill-dubbing .v288-free-role-actions button{
    flex:1 1 100%!important;
    width:100%!important;
  }
  body.v333-ui #skill-listening .v333-deep-grid{
    grid-template-columns:1fr!important;
  }
  body.v333-ui #skill-reading .v333-read-ai-row{
    align-items:stretch!important;
    flex-direction:column!important;
  }
  body.v333-ui #skill-reading .v333-read-ai-row button{
    width:100%!important;
  }
  body.v333-ui #skill-reading .v333-read-ai-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    width:100%!important;
  }
  body.v333-ui #skill-reading .v333-read-ai-result{
    grid-template-columns:1fr!important;
  }
  body.v333-ui #skill-grammar .v333-grammar-tools{
    grid-template-columns:1fr!important;
  }
  body.v333-ui #skill-grammar .v333-grammar-tools button{
    width:100%!important;
  }
}
@supports(-webkit-touch-callout:none){
  body.v333-ui #skill-dubbing button,
  body.v333-ui #skill-dubbing select,
  body.v333-ui #skill-dubbing audio,
  body.v333-ui #skill-listening input,
  body.v333-ui #skill-listening textarea{
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  body.v333-ui #v287ZhRoleModes,
  body.v333-ui #skill-dubbing .dubbing-shell{
    overflow:visible!important;
    contain:none!important;
  }
}
