/* TEST-009 · Desktop layout (≥1024px) + the phone variant (<1024px) at the end of this file. */
@media(min-width:1024px){
 body{overflow-x:clip}
 body>main{padding-top:0}
 /* full-width orange header */
 main>header{width:100vw;max-width:none;margin:0 calc(50% - 50vw);border-radius:0;padding:14px max(32px,calc((100vw - 1240px)/2));min-height:78px;box-shadow:none;gap:18px}
 main>header .brand h1{font-size:26px}
 main>header #tagline{display:none}
 .dh-tools{display:flex;align-items:center;gap:14px;margin-inline-start:auto;color:#fff}
 .dh-sep{width:1px;height:30px;background:#ffffff59}
 .dh-icon:focus-visible,.dh-account:focus-visible{outline:3px solid #fff;outline-offset:3px;border-radius:12px}
 .dh-icon{display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:#fff;cursor:pointer}.dh-icon svg{width:26px;height:26px}@media(hover:hover){
 .dh-icon:hover,.dh-account:hover{background:#ffffff26}}
 .dh-account{display:flex;align-items:center;gap:10px;border:0;border-radius:999px;background:transparent;color:#fff;font:800 16px/1.2 var(--font-body);padding:4px 12px 4px 4px;cursor:pointer;max-width:200px}
 .dh-avatar{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:50%;background:#fff;color:#2A1D12;font:900 17px/1 var(--font-body)}.dh-avatar svg{width:24px;height:24px}
 .dh-avatar.has-initial{background:#2A1D12;color:#FFD700}
 .dh-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 main>header .hdr-stats{gap:10px}
 /* the language lives in the header now */
 .learning-path .fh-tools .fh-language{display:none}

 /* white tab bar with icons above labels, active tab in orange with an underline */
 main>.modes-wrapper{position:sticky;top:0;width:100vw;max-width:none;margin:-18px calc(50% - 50vw) 22px;padding:0 max(32px,calc((100vw - 1240px)/2));border:0;border-bottom:1px solid var(--line);border-radius:0;background:var(--surface);box-shadow:0 6px 18px #42210e0d;gap:0}
 main>.modes-wrapper button{flex-direction:column;gap:6px;min-height:84px;padding:12px 8px 10px;border-radius:0;background:transparent;color:var(--ink-2);font-size:16px;font-weight:700;border:0;border-bottom:3px solid transparent}
 main>.modes-wrapper button svg,main>.modes-wrapper button .dock-ic{width:30px;height:30px}
 main>.modes-wrapper button.primary{background:transparent;color:#C2410C;border:0;border-bottom:3px solid #EB6A00;box-shadow:none;transform:none}@media(hover:hover){
 main>.modes-wrapper button:hover{background:var(--surface-2);color:var(--ink)}}@media(hover:hover){
 main>.modes-wrapper button.primary:hover{color:#C2410C}}

 /* Two-level navigation: app sections stay at the top, lesson modes dock at the bottom. */
 #lessonModes:not([hidden]){position:fixed;z-index:45;left:50%;bottom:14px;transform:translateX(-50%);width:min(760px,calc(100% - 48px));margin:0;padding:8px;gap:6px;border:1px solid #ffffff20;border-radius:22px;background:var(--be-black);box-shadow:0 12px 32px rgba(0,0,0,.32)}
 #lessonModes:not([hidden]) .seg-btn{flex:1 1 0;min-width:0;min-height:54px;gap:7px;border:0;border-radius:14px;color:rgba(255,255,255,.8);font-size:14px}
 #lessonModes:not([hidden]) .seg-btn .ico{width:20px;height:20px}
 #lessonModes:not([hidden]) .seg-btn[aria-selected="true"]{background:var(--be-yellow);color:#2A1D12;box-shadow:0 3px 0 var(--be-yellow-deep)}
 #lessonModes:not([hidden]) .seg-btn:focus-visible{outline-color:var(--be-yellow);outline-offset:3px}
 [data-theme="dark"] #lessonModes:not([hidden]){border-color:#ffffff26;background:#14100D}

 /* hero: text on the left, our cat on the right */
 .learning-path{max-width:1240px}
 .fh-hero{grid-template-columns:minmax(0,1.25fr) minmax(280px,.75fr);padding:44px 52px 0;border-radius:28px;border:0;box-shadow:0 10px 30px #42210e12;background:var(--surface)}
 .fh-hero .fh-eyebrow{font-size:15px;letter-spacing:.06em;color:#C2410C}
 .learning-path .fh-hero h2{font-size:64px;line-height:1.05;margin:6px 0 14px}
 .fh-hero .fh-description{font-size:20px;line-height:1.5;max-width:30ch;color:var(--ink-2)}
 .fh-hero .fh-lesson-detail{margin-top:14px}
 .fh-hero .fh-main-action{align-items:center;gap:22px;flex-direction:row;flex-wrap:wrap;margin-top:22px}
 .fh-hero .fh-primary{width:auto;min-width:240px;padding:16px 30px;font-size:20px;border-radius:14px}
 .fh-hero .fh-primary::after{content:"→";margin-inline-start:14px;font-size:22px;transition:transform .15s ease}
 [dir="rtl"] .fh-hero .fh-primary::after{content:"←"}@media(hover:hover){
 .fh-hero .fh-primary:hover::after{transform:translateX(3px)}}
 .fh-hero-art{position:relative;align-self:end;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;min-height:330px}
 .fh-hero-art:before{width:310px;height:310px;background:radial-gradient(circle,#FFE7CF 0 60%,transparent 61%)}
 .fh-hero-art .comp-cat{width:300px;height:300px}
 .fh-hero-art::after{content:"";position:absolute;inset:6% 0 0;pointer-events:none;background:
   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 34C6 24 4 14 11 10c4-2 7 0 9 4 2-4 5-6 9-4 7 4 5 14-9 24z' fill='%23F6D2B4'/%3E%3C/svg%3E") 8% 22%/26px no-repeat,
   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 34C6 24 4 14 11 10c4-2 7 0 9 4 2-4 5-6 9-4 7 4 5 14-9 24z' fill='%23F6D2B4'/%3E%3C/svg%3E") 92% 12%/22px no-repeat,
   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 120'%3E%3Cpath d='M30 118V10' stroke='%23F3DCC4' stroke-width='3' fill='none'/%3E%3Cg fill='%23F7E3CF'%3E%3Cellipse cx='18' cy='30' rx='12' ry='6' transform='rotate(-35 18 30)'/%3E%3Cellipse cx='42' cy='46' rx='12' ry='6' transform='rotate(35 42 46)'/%3E%3Cellipse cx='18' cy='64' rx='12' ry='6' transform='rotate(-35 18 64)'/%3E%3Cellipse cx='42' cy='80' rx='12' ry='6' transform='rotate(35 42 80)'/%3E%3C/g%3E%3C/svg%3E") 0 92%/54px no-repeat,
   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 120'%3E%3Cpath d='M30 118V10' stroke='%23F3DCC4' stroke-width='3' fill='none'/%3E%3Cg fill='%23F7E3CF'%3E%3Cellipse cx='18' cy='30' rx='12' ry='6' transform='rotate(-35 18 30)'/%3E%3Cellipse cx='42' cy='46' rx='12' ry='6' transform='rotate(35 42 46)'/%3E%3Cellipse cx='18' cy='64' rx='12' ry='6' transform='rotate(-35 18 64)'/%3E%3Cellipse cx='42' cy='80' rx='12' ry='6' transform='rotate(35 42 80)'/%3E%3C/g%3E%3C/svg%3E") 100% 70%/46px no-repeat}
 .fh-cat-caption{display:none}
 .fh-hero-footer{margin-top:26px}

 [data-theme="dark"] .fh-hero-art:before{background:#3A2A1E}
 [data-theme="dark"] .fh-hero .fh-eyebrow{color:#FFB070}
 @media(hover:hover){
 [data-theme="dark"] main>.modes-wrapper button.primary,[data-theme="dark"] main>.modes-wrapper button.primary:hover{color:#FFB070}}
}
@media(min-width:1024px) and (prefers-reduced-motion:reduce){.fh-hero .fh-primary::after{transition:none}}

/* ---------- TEST-009 · phones and tablets (<1024px) ---------- */
@media(max-width:1023.98px){
 /* Language is selected in Settings, not duplicated in the compact header. */
 .dh-tools{display:none}
 main>header .hdr-stats{gap:6px}
 .learning-path .fh-tools .fh-language{display:none}

}

/* The map and its preview share the tile and its native button interaction. */
.learning-path{container-type:inline-size}
.learning-path .fh-topic-grid{grid-template-columns:1fr;gap:12px}
.fh-topic-grid .fh-topic{
 display:grid;grid-template-columns:clamp(64px,18cqi,84px) minmax(0,1fr);
 align-items:start;gap:12px;padding:12px;border-radius:16px
}
.fh-topic-grid .fh-topic-picture{width:100%;height:auto;aspect-ratio:1;padding:0;border-radius:12px;overflow:hidden}
.fh-topic-grid .fh-topic-picture img{width:100%;height:100%;object-fit:cover}
.fh-topic-grid .fh-topic-body{padding:0;gap:5px}
.fh-topic .fh-topic-title{font-size:1.08rem}
.fh-topic .fh-topic-desc{display:block;color:var(--ink-2);font-size:.875rem;line-height:1.4}
.fh-topic .fh-topic-body>small{display:none}
.fh-topic .fh-meter{max-width:none;height:6px;margin-top:auto}
.fh-topic .fh-topic-foot{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 10px}
.fh-topic .fh-pct,.fh-topic .fh-topic-cta{font-size:.85rem;white-space:nowrap}
.fh-topic .fh-topic-cta{display:inline-flex;align-items:center;min-height:44px;padding-inline:12px;border:1px solid currentColor;border-radius:10px;font-weight:800;color:var(--lb-brand)}
@container(min-width:560px){
 .learning-path .fh-topic-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .fh-topic-grid .fh-topic{display:flex;align-items:stretch;padding:0;gap:0}
 .fh-topic-grid .fh-topic-picture{aspect-ratio:1.55;border-radius:0}
 .fh-topic-grid .fh-topic-picture img{object-position:center 21%}
 .fh-topic-grid .fh-topic-body{padding:14px;gap:7px}
}
@container(min-width:870px){
 .learning-path .fh-topic-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .fh-topic .fh-topic-title{font-size:1.2rem}
}
@media(min-width:1600px){
@container(min-width:1100px){
 .learning-path .fh-topic-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}
}

/* Compact phone header: keep the full domain visible and let the counters sit
   quietly at the far right without taking up pill-shaped blocks. */
@media(max-width:650px){
 main>header{gap:5px;padding-inline:10px}
 main>header .brand{gap:6px}
 main>header .brand::before{width:32px;height:32px;border-radius:9px}
 main>header .brand h1{font-size:clamp(10px,calc((100cqw - 38px)/8.3),18px)}
 main>header .hdr-stats{margin-inline-start:auto;justify-content:flex-end;gap:2px}
 main>header .hdr-stats .streak-pill,
 main>header .hdr-stats .score-pill{min-height:44px;min-width:0;position:relative;padding-inline:3px;gap:3px;background:transparent;box-shadow:none}
 main>header .hdr-stats .streak-pill{color:#fff}
 main>header .hdr-stats .streak-pill::after,main>header .hdr-stats .score-pill::after{content:"";position:absolute;inset:0 -5px}
 main>header .hdr-stats .streak-pill.off{color:#fff}
 main>header .hdr-stats .score-pill{color:#fff}
 main>header{gap:3px}
 main>header .hdr-stats{gap:0}
 main>header .header-language .hl-box{padding:0 6px;min-width:50px}
 main>header .hdr-stats .score-pill .ico{color:var(--be-yellow)}
}
@media(max-width:340px){main>header{padding-inline:6px}main>header .brand{gap:4px}main>header .brand::before{width:22px;height:22px;border-radius:7px}main>header .header-language .hl-box{min-width:46px;padding:0 4px}}
@media(min-width:651px) and (max-width:1000px){main>header .brand{flex:0 0 200px}main>header .brand h1{font-size:18px}main>header .comp-header-route{min-width:0;flex:1 1 0;overflow:hidden}}
