/* Mobile readability-first question layout */
@media (max-width:760px){
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%;}

  body.quiz-one-screen #app{
    padding:calc(5px + env(safe-area-inset-top)) 7px calc(7px + env(safe-area-inset-bottom));
  }
  body.quiz-one-screen header{
    position:relative;
    top:auto;
    min-height:46px;
    margin-bottom:7px;
    padding:6px 8px;
    gap:7px;
    border-radius:13px;
    box-shadow:0 2px 8px rgba(15,45,53,.08);
  }
  body.quiz-one-screen .header-icon{width:33px;height:33px;border-radius:9px;}
  body.quiz-one-screen .header-icon svg{width:18px;height:18px;}
  body.quiz-one-screen header h1{font-size:.94rem;margin:0;line-height:1.18;}
  body.quiz-one-screen header p{display:none;}
  body.quiz-one-screen .icon-btn{width:33px;height:33px;border-radius:9px;font-size:.88rem;}

  body.quiz-one-screen .stage{
    padding:10px 9px 8px;
    border-radius:15px;
    box-shadow:0 3px 13px rgba(15,45,53,.08);
    overflow:visible;
  }
  body.quiz-one-screen .stage::before{height:3px;border-radius:15px 15px 0 0;}
  body.quiz-one-screen .session-banner{margin:0 0 6px;padding:6px 8px;border-radius:9px;font-size:.76rem;line-height:1.35;}
  body.quiz-one-screen .session-close{min-height:30px;padding:4px 8px;border-radius:8px;}
  body.quiz-one-screen .topbar{margin:0 0 5px;gap:6px;font-size:.75rem;}
  body.quiz-one-screen .badge,
  body.quiz-one-screen .score-badge{
    min-height:28px;
    padding:3px 8px;
    border-radius:9px;
    font-size:.75rem;
    line-height:1.1;
  }
  body.quiz-one-screen .favorite-btn{width:31px;height:31px;border-radius:9px;font-size:1.05rem;}
  body.quiz-one-screen .progress-wrap{height:4px;margin:0 0 6px;border-radius:3px;}
  body.quiz-one-screen .qnum-tag{display:none;}
  body.quiz-one-screen .topic-row{margin:0 0 7px;gap:6px;}
  body.quiz-one-screen .topic-badge,
  body.quiz-one-screen .mastery-badge{padding:4px 8px;font-size:.71rem;border-radius:8px;line-height:1.2;}
  body.quiz-one-screen .qtext{
    margin:0 0 9px;
    font-size:clamp(1.04rem,4vw,1.16rem);
    line-height:1.43;
    font-weight:800;
    letter-spacing:0;
  }
  body.quiz-one-screen .options{gap:7px;}
  body.quiz-one-screen .opt{
    min-height:0;
    padding:10px 10px;
    gap:9px;
    border-radius:11px;
    font-size:clamp(.91rem,3.55vw,1rem);
    line-height:1.43;
    font-weight:600;
  }
  body.quiz-one-screen .opt .letter{
    width:31px;height:31px;
    border-radius:8px;
    font-size:.86rem;
    flex:0 0 31px;
  }
  body.quiz-one-screen .opt .mark{font-size:1rem;}
  body.quiz-one-screen .feedback{margin-top:7px;padding:8px 9px;border-radius:9px;font-size:.82rem;line-height:1.45;}
  body.quiz-one-screen .qactions{display:none;}
  body.quiz-one-screen .source-notes{display:none;}
  body.quiz-one-screen .note-editor{display:none;}
  body.quiz-one-screen .navrow{
    position:relative;
    bottom:auto;
    margin:9px 0 0;
    padding:0;
    gap:7px;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
  }
  body.quiz-one-screen button.nav{
    min-height:43px;
    padding:8px 9px;
    border-radius:10px;
    font-size:.91rem;
    font-weight:800;
  }
  body.quiz-one-screen #studyDashboard,
  body.quiz-one-screen .swipe-hint{display:none;}

  /* Compact mode saves space without sacrificing readability. */
  body.quiz-one-screen.fit-compact .topic-row{display:none;}
  body.quiz-one-screen.fit-compact .qtext{font-size:1rem;line-height:1.38;margin-bottom:7px;}
  body.quiz-one-screen.fit-compact .opt{padding:8px 9px;font-size:.88rem;line-height:1.36;gap:8px;border-radius:10px;}
  body.quiz-one-screen.fit-compact .opt .letter{width:28px;height:28px;flex-basis:28px;border-radius:7px;font-size:.8rem;}
  body.quiz-one-screen.fit-compact .options{gap:6px;}
  body.quiz-one-screen.fit-compact .feedback{display:none;}
  body.quiz-one-screen.fit-compact .navrow{margin-top:7px;}
  body.quiz-one-screen.fit-compact button.nav{min-height:40px;padding:7px 8px;font-size:.86rem;}

  /* Dense mode only trims chrome; text remains comfortably readable. */
  body.quiz-one-screen.fit-dense header{min-height:40px;padding:4px 6px;margin-bottom:5px;}
  body.quiz-one-screen.fit-dense .header-icon{width:29px;height:29px;}
  body.quiz-one-screen.fit-dense .icon-btn{width:29px;height:29px;}
  body.quiz-one-screen.fit-dense header h1{font-size:.84rem;}
  body.quiz-one-screen.fit-dense .stage{padding:8px 7px 6px;}
  body.quiz-one-screen.fit-dense .topbar{margin-bottom:4px;}
  body.quiz-one-screen.fit-dense .progress-wrap{margin-bottom:4px;height:3px;}
  body.quiz-one-screen.fit-dense .qtext{font-size:.95rem;line-height:1.34;margin-bottom:6px;}
  body.quiz-one-screen.fit-dense .opt{padding:7px 8px;font-size:.84rem;line-height:1.32;gap:7px;}
  body.quiz-one-screen.fit-dense .opt .letter{width:27px;height:27px;flex-basis:27px;font-size:.76rem;}
  body.quiz-one-screen.fit-dense button.nav{min-height:38px;font-size:.82rem;}

  /* Ultra mode no longer shrinks text into unreadable sizes; long questions may scroll. */
  body.quiz-one-screen.fit-ultra header .header-icon,
  body.quiz-one-screen.fit-ultra header .header-text,
  body.quiz-one-screen.fit-ultra header #darkToggle{display:none;}
  body.quiz-one-screen.fit-ultra header{
    position:absolute;
    z-index:35;
    left:9px;
    top:calc(7px + env(safe-area-inset-top));
    min-height:0;
    width:31px;
    margin:0;
    padding:0;
    border:0;
    background:transparent;
    box-shadow:none;
  }
  body.quiz-one-screen.fit-ultra header #moreBtn{display:flex;width:31px;height:31px;background:var(--card);box-shadow:var(--shadow-sm);}
  body.quiz-one-screen.fit-ultra .stage{margin-top:0;padding-top:7px;}
  body.quiz-one-screen.fit-ultra .mastery-badge{display:none;}
  body.quiz-one-screen.fit-ultra .qtext{font-size:.91rem;line-height:1.31;margin-bottom:5px;}
  body.quiz-one-screen.fit-ultra .opt{padding:6px 7px;font-size:.81rem;line-height:1.29;gap:6px;}
  body.quiz-one-screen.fit-ultra .opt .letter{width:25px;height:25px;flex-basis:25px;border-radius:7px;font-size:.72rem;}
  body.quiz-one-screen.fit-ultra .options{gap:5px;}
  body.quiz-one-screen.fit-ultra .navrow{margin-top:5px;}
  body.quiz-one-screen.fit-ultra button.nav{min-height:36px;padding:5px 7px;font-size:.78rem;}
}
