/* Constrain the content itself, including SVGs inside grid tracks. */
html{width:100%;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body,header,main,.footer{width:100%;min-width:0}
.hero{grid-template-columns:minmax(0,1.04fr) minmax(0,1fr)}
.hero>*,.result-overview>*,.options>*,.answer-compare>*{min-width:0}
.result-overview{grid-template-columns:minmax(0,1.05fr) minmax(0,1fr)}
.options,.answer-compare{grid-template-columns:repeat(2,minmax(0,1fr))}
.options.text-options{grid-template-columns:minmax(0,1fr)}
.wheel-card{min-width:0;max-width:100%}
.wheel{display:block;width:100%;max-width:100%;height:auto;aspect-ratio:460/430}
.fraction-picture svg{max-width:100%;height:auto}
.primary{max-width:100%}
.result-author a{overflow-wrap:anywhere}
.footer{flex-wrap:wrap}
@media screen and (max-width:900px){
 .hero,.result-overview{grid-template-columns:minmax(0,1fr)}
 .hero{gap:30px;min-height:0}
 .hero .wheel-card,.result-overview .result-wheel{width:100%;max-width:480px;margin:0 auto}
}
@media screen and (max-width:380px){.answer-compare:has(.text-answer){grid-template-columns:minmax(0,1fr)}}

/* Fallback for a phone viewer that reports a wide viewport. */
@media screen{
 html.phone-layout{width:var(--phone-content-width);max-width:100%;margin:0}
 .phone-layout body{border-top-width:5px}
 .phone-layout header{padding:20px 16px;gap:12px;align-items:center}
 .phone-layout .brand{font-size:15px;max-width:175px;min-width:0}
 .phone-layout .header-author{max-width:110px;flex-shrink:0}
 .phone-layout .header-author span{display:none}
 .phone-layout .header-author strong{font-size:10px}
 .phone-layout main{padding:28px 16px 14px}
 .phone-layout .hero,.phone-layout .result-overview{grid-template-columns:minmax(0,1fr);gap:26px;min-height:0}
 .phone-layout .hero h1{font-size:38px;letter-spacing:-1.5px;max-width:100%}
 .phone-layout .hero-question{font-size:20px}
 .phone-layout .lead{font-size:16px}
 .phone-layout .intro-copy{font-size:15px}
 .phone-layout .hero .primary{font-size:16px;min-height:54px;padding:16px 22px;gap:16px}
 .phone-layout .facts{margin:25px 0;gap:32px}
 .phone-layout .hero .wheel-card,.phone-layout .result-wheel{width:100%;max-width:480px;margin:0 auto}
 .phone-layout .wheel-card{padding:23px 14px 18px;border-radius:24px}
 .phone-layout .wheel-card .topline{padding:0;font-size:11px;gap:10px;flex-wrap:wrap}
 .phone-layout .mini-pill{font-size:10px}
 .phone-layout .citrus-label-name,.phone-layout .slice-score{display:none}
 .phone-layout .citrus-label-index{display:block}
 .phone-layout .mobile-wheel-key{display:block;text-align:center;font-size:13px;color:var(--muted);margin:0 0 16px}
 .phone-layout .wheel-status{font-size:14px}
 .phone-layout .bottom-strip{grid-template-columns:minmax(0,1fr);margin-top:30px;gap:17px}
 .phone-layout .footer{padding:20px 16px;font-size:11px}
 .phone-layout .question-card{padding:24px 16px;border-radius:20px}
 .phone-layout .question-card h1{font-size:24px;line-height:1.35;letter-spacing:-.7px}
 .phone-layout .quiz-top{font-size:12px;gap:10px}
 .phone-layout .quiz-top>span:last-child{white-space:nowrap}
 .phone-layout .progress{margin-bottom:23px}
 .phone-layout .math{font-size:31px}
 .phone-layout .question-card .option{font-size:20px;padding:13px;gap:9px;min-height:78px}
 .phone-layout .question-card .option.selected{padding:12px}
 .phone-layout .question-card .text-options .option{font-size:16px;min-height:68px}
 .phone-layout .question-card .unknown{font-size:15px;min-height:48px}
 .phone-layout .quiz-nav .primary{padding:14px 18px;font-size:14px;gap:12px;min-width:0}
 .phone-layout .results-head{display:block}
 .phone-layout .results-head h1{font-size:34px}
 .phone-layout .result-takeaway .summary{padding:22px}
 .phone-layout .result-takeaway .summary h2{font-size:24px}
 .phone-layout .result-takeaway .summary p{font-size:16px}
 .phone-layout .result-author{font-size:14px}
 .phone-layout .save-result .primary{font-size:17px}
 .phone-layout .topic-review{padding:22px 14px}
 .phone-layout .topic-review h2{font-size:22px;line-height:1.3}
 .phone-layout .topic-review .review-intro{font-size:14px}
 .phone-layout .topic-review .skill-detail summary{gap:8px;font-size:15px}
 .phone-layout .topic-review .skill-detail summary>span:first-child{flex-basis:25px}
 .phone-layout .topic-number{width:25px;height:25px}
 .phone-layout .answer-compare{gap:8px}
 .phone-layout .answer-compare:has(.text-answer){grid-template-columns:minmax(0,1fr)}
 .phone-layout .answer-box{padding:15px 8px}
 .phone-layout .answer-box small{font-size:12px}
 .phone-layout .answer-value{font-size:25px}
 .phone-layout .answer-value.text-answer{font-size:14px}
 .phone-layout .mistake{padding:14px}
 .phone-layout .mistake h3{font-size:15px}
 .phone-layout .why{padding:13px;font-size:14px}
 .phone-layout .result-actions{gap:14px;flex-wrap:wrap}
}

.restart-test{display:block;width:100%;min-height:52px;margin-top:18px;border:1px solid #ecaa70;background:#fff3e4;color:#17385f;font-size:16px;font-weight:700}
.restart-test:hover{background:#ffe4c7}
@media print{.restart-test{display:none}}

/* A correct answer appears once; only different answers need a comparison. */
.answer-compare.answer-single{grid-template-columns:minmax(0,1fr)}
.answer-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.answer-heading .mistake-number{margin:0}
.answer-state{display:inline-flex;align-items:center;min-height:28px;padding:4px 10px;border-radius:10px;font-size:12px;font-weight:700;line-height:1.4}
.answer-state.correct{background:#fff0d9;color:#17385f}
.answer-state.wrong{background:#ffe4cb;color:#8d3e0b;border:1px solid #efb886}
.answer-state.unknown{background:#f4efe7;color:#65758a;width:auto;margin:0;min-height:28px}
.answer-single .answer-box{max-width:100%;padding:16px 18px}
.answer-single .answer-box small{max-width:270px;margin-left:auto;margin-right:auto}

/* Starting a new attempt is visible before the wheel on every screen. */
.restart-near-wheel{margin:0 0 22px;padding-bottom:20px;border-bottom:1px solid #eadfce}
.restart-near-wheel .primary{display:flex;width:100%;justify-content:center;gap:14px;min-height:54px;font-size:18px;white-space:normal}
.restart-near-wheel p{margin:10px 0 0;color:#65758a;font-size:13px;line-height:1.45;text-align:center}
@media print{.restart-near-wheel{display:none}}
