/* Typing Coach Core v1.87.143: narrow-screen text overflow repair for three
   verified memory short lessons only. Does not alter unrelated practice. */
@media (max-width:900px) {
  html body.tc-stage-practice:has(.tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short]){
    overflow-x:hidden!important;
    overflow-y:auto!important;
    height:auto!important;
    min-height:100dvh!important;
  }
  html body.tc-stage-practice .tc-app-main:has(.tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short]){
    height:auto!important;
    min-height:calc(100dvh - 82px)!important;
    overflow:visible!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short][data-lesson-type="short"]{
    height:auto!important;
    min-height:calc(100dvh - 120px)!important;
    overflow:visible!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-formal,
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-viewport,
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-fit{
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
    transform:none!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-fit{
    display:block!important;
    min-width:0!important;
    padding:0!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    flex:0 1 auto!important;
    padding:12px!important;
    transform:none!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto auto auto auto auto auto!important;
    row-gap:10px!important;
    overflow:visible!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-practice-head{
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    grid-template-columns:minmax(0,1fr)!important;
    overflow:visible!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-practice-title{
    min-width:0!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-practice-title h2{
    font-size:clamp(17px,2.6vw,23px)!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-metrics-formal{
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-metric-card{
    min-width:0!important;
    height:auto!important;
    min-height:68px!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas > .tc-sentence-stage.tc-sentence-formal{
    grid-column:1/-1!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    padding:12px!important;
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto auto!important;
    row-gap:10px!important;
    overflow:visible!important;
    justify-items:stretch!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-current-example{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto auto!important;
    row-gap:6px!important;
    align-content:start!important;
    overflow:visible!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-current-example .tc-jp{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:6px 4px 9px!important;
    box-sizing:border-box!important;
    font-size:clamp(19px,2.7vw,25px)!important;
    line-height:1.55!important;
    letter-spacing:.012em!important;
    text-align:center!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-current-example .tc-jp-line{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    display:block!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
    line-break:strict!important;
    text-align:center!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-current-example .tc-kana{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:3px 5px!important;
    box-sizing:border-box!important;
    font-size:clamp(12px,1.8vw,14px)!important;
    line-height:1.55!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    text-overflow:clip!important;
    text-align:center!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-current-example .tc-roman{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:5px 4px!important;
    box-sizing:border-box!important;
    font-size:clamp(14px,1.9vw,16px)!important;
    line-height:1.5!important;
    letter-spacing:.025em!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    text-align:center!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-long-lookahead{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0 auto!important;
    padding:8px!important;
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:70px minmax(0,1fr)!important;
    gap:8px!important;
    align-items:center!important;
    overflow:visible!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-long-lookahead strong{
    display:block!important;
    min-width:0!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    padding:0!important;
    font-size:clamp(12px,1.6vw,15px)!important;
    line-height:1.5!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    text-overflow:clip!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-progress-row{
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:18px!important;
    overflow:visible!important;
  }
}
@media (max-width:430px){
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas{
    padding:8px!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas > .tc-sentence-stage.tc-sentence-formal{
    padding:9px 7px!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-current-example .tc-jp{
    font-size:19px!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-long-lookahead{
    grid-template-columns:64px minmax(0,1fr)!important;
  }
}

/* Only the new short lessons: remove legacy 98/24/32px fixed text lanes. */
@media (max-width:900px){
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-current-example .tc-jp,
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-current-example .tc-kana,
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-current-example .tc-roman {
    display:block!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
    line-break:strict!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-current-example .tc-jp-line {
    display:block!important;
    height:auto!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    line-break:strict!important;
  }
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-current-example .tc-jp {font-size:clamp(19px,2.8vw,25px)!important;line-height:1.5!important;}
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-current-example .tc-kana {font-size:clamp(13px,1.9vw,15px)!important;line-height:1.6!important;}
  html body.tc-stage-practice .tc-shell[data-tc-app][data-lesson-type="short"][data-tc-memory-short] .tc-practice-canvas .tc-current-example .tc-roman {font-size:clamp(13px,1.9vw,15px)!important;line-height:1.6!important;word-break:break-all!important;}
}
