/* ==========================================================================
   mobile.css  (phones only)
   Loaded LAST in app.html. Everything that changes the look sits inside a
   max-width media query, so desktop and tablet layouts are exactly as before.
   Goals on a phone: bigger readable text (nothing under 12px), roomier cards,
   headings that never collide with their sub-text, tap targets of 40px or more,
   modals as bottom sheets, and no sideways scrolling.
   ========================================================================== */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media(max-width:700px){
 body{overflow-x:hidden;line-height:1.5}
 #view,#view *{overflow-wrap:break-word}
 img,video,canvas,iframe{max-width:100%}
 table{max-width:100%}

 /* ---- page rhythm: more air, one consistent gutter ---- */
 .pg{padding:18px 16px calc(104px + env(safe-area-inset-bottom,0px))}
 .pgh{gap:6px;margin-bottom:18px}
 .pgh h1{font-size:26px;line-height:1.2;letter-spacing:-.015em}
 .pgh p,.pgh .mut{font-size:14.5px;line-height:1.55}
 .h1s{font-size:25px;line-height:1.22;letter-spacing:-.01em}
 .sh2{margin:32px 0 14px}
 .sh2 h2{font-size:21px;line-height:1.25}
 /* a heading with a grey sentence beside it: stack them, never squeeze side by side */
 .sh2:has(>.mut),.sh2:has(>span){flex-direction:column;align-items:flex-start;gap:5px}
 .sh2:has(>a){flex-direction:row;align-items:center}
 .sh2 .mut.sm,.sh2>span.mut{font-size:13.5px;line-height:1.5}
 h2{line-height:1.25}
 h3{line-height:1.3}
 .mut,.mut.sm,p{line-height:1.55}

 /* ---- cards ---- */
 .card{padding:18px;border-radius:18px}
 .card h3{font-size:17px}
 .g2,.g3,.g4,.two,.hs{gap:14px}
 .g5,.g6{gap:12px}
 .welcome{padding:20px}
 .welcome h1{font-size:25px;line-height:1.2}
 .welcome .row,.welcome .btns{gap:10px}

 /* ---- tap targets ---- */
 .btn{min-height:46px;font-size:15px}
 .btn.sm{min-height:40px;padding:9px 15px;font-size:14px}
 .pill{min-height:40px;padding:0 16px;display:inline-flex;align-items:center}
 .chips{gap:8px}
 a.lk{display:inline-flex;align-items:center;min-height:40px}
 .ib{width:44px;height:44px}
 .tbs .chip{height:36px}
 .tbs .subb{height:36px;width:42px}
 .bt a,.bt button{min-height:56px;gap:3px}
 .bt a span,.bt button span{font-size:12px;line-height:1.1}
 .bt a .ic,.bt button .ic{width:22px;height:22px}
 select.in,input.in,.btn-chip{min-height:46px}
 textarea.in{font-size:16px;line-height:1.5}
 .row.gap{gap:10px}

 /* ---- popups become bottom sheets (easy to reach and read) ---- */
 .mbg{place-items:end center;padding:0}
 .mbox{width:100%!important;max-width:100%!important;min-width:0!important;max-height:92dvh!important;border-radius:24px 24px 0 0;padding:24px 18px calc(24px + env(safe-area-inset-bottom,0px))!important;overflow-y:auto;-webkit-overflow-scrolling:touch}
 .mx{top:12px;right:12px}
 .mbox h2{font-size:22px;line-height:1.25;padding-right:36px}

 /* ---- study material / file pages ---- */
 .pc h3{font-size:16.5px;line-height:1.35}
 .paper{padding:22px 18px}
 .paper .tag{display:table;margin-bottom:10px}
 .paper h3{display:block;font-size:19px;line-height:1.3}
 .tb td,.tb th{padding:11px 4px;vertical-align:top}
 .tb td:last-child{text-align:right;overflow-wrap:anywhere}

 /* ---- subject, quiz and mock chapter rows ---- */
 .assessment-page details.assessment-chapter>summary.assessment-chapter-summary{padding:15px 14px;row-gap:6px;min-height:0}
 .assessment-chapter-name>b{font-size:15.5px;line-height:1.35}
 .assessment-chapter-index{width:34px;height:34px;font-size:13px}
 .assessment-overview{padding:20px}
 .assessment-overview-copy h2{font-size:24px;line-height:1.2}
 .assessment-overview-copy p{font-size:14.5px;line-height:1.55}
 .assessment-stats{gap:8px}
 .assessment-stats>div{padding:12px 6px}
 .assessment-stats b{font-size:20px}
 .assessment-section-heading{margin:26px 0 12px;gap:10px}
 .assessment-section-heading h3{font-size:19px}
 .assessment-section-heading p{font-size:13.5px;line-height:1.5}
 .assessment-chapter-body{padding:14px}
 .qrow.assessment-row{padding:14px;gap:12px}
 .assessment-row-title>b{font-size:15px;line-height:1.35}
 .assessment-row-mark{width:40px;height:40px}

 /* ---- quiz / mock player and results ---- */
 .assessment-question .qq,.qq{font-size:19px;line-height:1.45}
 .opt,.quiz-option{min-height:52px;padding:14px 15px;font-size:15.5px;line-height:1.45}
 .assessment-question-nav .btn{font-size:14px;padding:11px 12px}
 .assessment-question-navbox .qgrid{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
 .assessment-question-navbox .qgrid button{min-height:44px}
 .assessment-result-actions .btn{min-height:48px}
 .rs2-hero{gap:14px}

 /* ---- analytics, planner and other dense dashboards ---- */
 .an-panel-card{padding:16px}
 .an-panel-card h3,.an-panel-card b{font-size:16px}
 .study-intel-card{padding:16px}
 .study-intel-list{gap:12px}
 .snapg,.snap3{gap:10px}
 .snk{padding:16px 10px}
 .lbr{padding:12px}
 .upr{gap:8px}
 .tcard{padding:16px}
 .tcard h3{font-size:16.5px}
 .tcard p{font-size:13.5px;line-height:1.5}
 .subc{padding:16px}
 .toolf .fg{margin-bottom:14px}
 .fg label{font-size:14px;margin-bottom:6px;display:block}
 .fr3{gap:12px}
 .out .prose,.prose{font-size:15.5px;line-height:1.7}
 .prose h3{font-size:18px;margin:20px 0 8px}
 .tbr .gs .in{font-size:16px}

 /* ---- planner setup choices: bigger finger-friendly segmented buttons ---- */
 .setupc button,.seg button,.segc button,.dsub button{min-height:42px}
}
@media(max-width:400px){
 .pg{padding-left:14px;padding-right:14px}
 .pgh h1{font-size:24px}
 .card{padding:16px}
 .welcome h1{font-size:23px}
}
@media(max-width:340px){
 .g4:has(>.tcard){grid-template-columns:1fr}
 .snapg{grid-template-columns:1fr 1fr}
}

/* ---- text floor: every small label that was 8 to 11.5px on a phone is lifted to 12px ---- */
@media(max-width:700px){
.ai-assessment-kpis span,
.ai-assessment-row-link,
.ai-assessment-row-score>span,
.ai-history .aih-card-top,
.ai-history .aih-preview,
.ai-history .aih-reset,
.ai-history .aih-shared,
.ai-mock-kpis small,
.ai-review-answers small,
.ai-review-marks span,
.ai-review-model summary,
.ai-review-option>b,
.ai-review-option>small,
.ai-review-qno,
.ai-review-status,
.ai-review-steps>b,
.ai-review-steps>div,
.ai-review-summary small,
.ai-review-topic,
.ai-review-topic-row span,
.an-page .chart .ax,
.an-page .ovp small,
.an-page .tn-l small,
.an-panel-count,
.an-panel-desc,
.analysis-column>b,
.analysis-column>small,
.analysis-kpis small,
.analysis-kpis span,
.analysis-panel-head span,
.analysis-rank>span,
.analysis-rank>strong,
.assessment-chapter-count,
.assessment-chapter-name small,
.assessment-count,
.assessment-kicker,
.assessment-nav-head small,
.assessment-nav-legend>span,
.assessment-panel-heading p,
.assessment-question .quiz-topic,
.assessment-question-nav .btn,
.assessment-question-nav>span,
.assessment-question-navbox .qn,
.assessment-result-facts small,
.assessment-review-item summary>b,
.assessment-row-main>small,
.assessment-row-state .tag,
.assessment-row-state small,
.assessment-run-progress,
.assessment-section-heading p,
.assessment-stats span,
.att-score,
.att-when,
.badge-chip.sm,
.bdg.sm,
.bt a,
.bt button,
.cal-duration-wrap span,
.cal-mid span,
.calfs .cal-tray-sec h4 b,
.calfs .cal-tw,
.chapter-frequency-bottom,
.chapter-frequency-chart b,
.chapter-frequency-chart small,
.chapter-frequency-top,
.chapter-frequency-value span,
.chapter-modal-topic span,
.chart .ax,
.cring b,
.english-lit-list>span,
.lbmini small,
.mat .tag,
.mock-mark,
.mock-opts .opt>b,
.mock-section-total,
.mock-written-review small,
.mqb-head,
.msh>div small,
.ovs small,
.pyq-axis,
.pyq-bar-label small,
.pyq-heat .hc,
.pyq-subject-card>small,
.pyq-subject-foot,
.pyq-year small,
.pyq-year span,
.pyq-year-total-grid b,
.pyq-year-total-grid small,
.quiz-prompt,
.quiz-score small,
.rf-chip small,
.rq-filter button em,
.rq-o em,
.rtb small,
.simple-mini-years small,
.simple-modal-top small,
.simple-modal-top>strong small,
.simple-subject-card small,
.simple-topic-heading span,
.simple-topic-top strong small,
.simple-topic-year b,
.simple-topic-year small,
.simple-total span,
.simple-year-values b,
.simple-year-values small,
.simple-years-label,
.study-intel-action-card>p,
.study-intel-count,
.study-intel-evidence,
.study-intel-kind,
.study-intel-source,
.study-intel-subject-row small,
.subject-page .chd .cm small,
.subject-page .chd .tag,
.subject-page .cpr em,
.subject-page .wbr .wl,
.tkt small,
.tn small,
.tool-context>small,
.topic-ch-index,
.topic-chapter-footer,
.topic-chapter-meta small,
.topic-detail-name>span,
.topic-detail-years small,
.topic-year-mini span,
.tst-r small,
.wri-skip-tag{font-size:12px!important;line-height:1.4}
}

@media(max-width:700px){
 /* chapter rows: number | name + badges | arrow. Badges drop under the name instead of floating in empty space */
 .assessment-page details.assessment-chapter>summary.assessment-chapter-summary{display:grid!important;grid-template-columns:36px minmax(0,1fr) 22px!important;grid-template-areas:"index name chev" "index meta chev"!important;column-gap:12px!important;row-gap:8px!important;align-items:center!important}
 .assessment-page details.assessment-chapter>summary.assessment-chapter-summary>.assessment-chapter-index{grid-area:index!important;align-self:start!important}
 .assessment-page details.assessment-chapter>summary.assessment-chapter-summary>.assessment-chapter-name{grid-area:name!important;min-width:0!important}
 .assessment-page details.assessment-chapter>summary.assessment-chapter-summary>.assessment-chapter-meta{grid-area:meta!important;justify-content:flex-start!important;margin-left:0!important;min-width:0!important;flex-wrap:wrap!important;white-space:normal!important}
 .assessment-page details.assessment-chapter>summary.assessment-chapter-summary>.assessment-chevron{grid-area:chev!important}
 /* subject bars: label column wide enough for "Mathematics" */
 .dsub{grid-template-columns:minmax(104px,36%) minmax(0,1fr) 42px!important;gap:10px!important;font-size:14px}
}
@media(max-width:700px){
 .assessment-page details.assessment-chapter.card{padding:0}
 .assessment-page details.assessment-chapter[open]>summary{border-bottom:1px solid var(--ln)}
}
