/* Screenshot-inspired compact layout; original activities and controls retained. */
#mobile-practice-bar,.daily-options-toggle{display:none}
body.guided-learning{--muted:#536b61}
body.guided-learning .sidebar{width:174px;padding:22px 14px 18px;overflow-y:auto}
body.guided-learning .brand{font-size:16px;gap:9px;padding:0 5px}
body.guided-learning .brand-mark{width:35px;height:42px;font-size:28px;flex-shrink:0}
body.guided-learning .sidebar nav{gap:4px}
.mobile-subjects-toggle{display:none}
body.guided-learning .nav-item{font-size:14px;min-height:45px;padding:7px 8px;gap:8px;border-radius:11px}
body.guided-learning .nav-icon{font-size:23px;width:29px;height:29px;border-radius:10px}
body.guided-learning main{width:calc(100% - 174px);max-width:1600px;margin:0 auto;padding:18px 22px 24px;min-width:0}
body.guided-learning .topbar{display:grid;grid-template-columns:minmax(145px,1fr) auto;align-items:start;gap:12px;margin-bottom:4px;padding:0}
body.guided-learning .welcome{font-size:16px;line-height:1.45}
body.guided-learning .welcome span{font-size:16px}
body.guided-learning .welcome small{font-size:14px;margin-top:2px}
body.guided-learning .top-controls{position:static;display:grid;grid-template-columns:minmax(0,1fr) 290px;justify-content:end;align-items:start;gap:6px 12px;padding:0;max-width:900px;width:100%}
.header-languages{display:grid;grid-template-columns:minmax(0,auto) minmax(0,1fr);align-items:start;justify-items:start;gap:6px;min-width:0}
body.guided-learning .header-languages .language-switch{grid-column:1/-1;max-width:100%;min-width:0;width:100%;justify-self:stretch;display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
body.guided-learning .header-languages .language-switch button{min-width:0;white-space:normal;overflow-wrap:anywhere;padding:7px 6px}
.header-languages .learning-resources{grid-row:2;grid-column:2;min-width:0;max-width:100%}
.header-languages .learning-resources a{max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.35}
.header-languages .more-languages{grid-row:2;grid-column:1;min-width:0;width:100%}
.header-languages .more-languages summary{white-space:normal;overflow-wrap:anywhere;line-height:1.35}
.header-languages .more-languages-panel{left:0;right:auto}
.header-preferences{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:6px;min-width:0}
body.guided-learning .topbar .header-preferences :is(.donation-heart,.halloween-toggle){order:0}
body.guided-learning .header-preferences .learning-mode-switch{order:1;max-width:100%}
@media(max-width:700px){body.guided-learning .top-controls{grid-template-columns:minmax(0,1fr)}.header-languages{grid-template-columns:repeat(2,minmax(0,1fr))}.header-preferences{justify-content:flex-start}}
body.guided-learning .topbar :is(.donation-heart,.halloween-toggle){position:static;right:auto;top:auto;min-height:44px;min-width:44px;order:2;flex:0 0 44px}
body.guided-learning .learning-mode-switch{order:1;flex-shrink:0}
body.guided-learning .learning-mode-switch button{font-size:14px;padding:9px 11px;min-height:44px}
body.guided-learning .language-switch{gap:2px;padding:2px}
body.guided-learning .language-switch button{font-size:14px;padding:7px 10px;min-height:44px}
.learning-resources{display:flex;justify-content:flex-end;align-items:center;min-height:44px;margin:0 0 10px}
.learning-resources a{display:inline-flex;gap:8px;align-items:center;min-height:44px;padding:7px 13px;border:1px solid #cddfcc;border-radius:11px;color:#315c40;background:#f4f8ef;text-decoration:none;font-size:14px;font-weight:750}
.learning-resources a:hover{background:#e8f0df}
body.guided-learning .activity-toolbar{margin-bottom:10px;gap:12px;align-items:center;flex-direction:row;flex-wrap:wrap}
body.guided-learning .tab{font-size:14px;padding:9px 16px;min-height:44px;border-radius:11px}
body.guided-learning .rule-reminder{padding:8px 16px;min-height:56px;margin:9px 0 10px;gap:13px;border-radius:13px}
body.guided-learning .rule-reminder img{width:34px;height:34px;object-fit:contain}
body.guided-learning .rule-reminder strong{font-size:18px}
body.guided-learning .rule-reminder button{font-size:14px;padding:8px 15px;min-height:44px;flex-shrink:0}
body.guided-learning .round-line{display:grid;grid-template-columns:minmax(230px,auto) minmax(0,1fr);gap:22px;align-items:center;margin:8px 0 18px}
body.guided-learning .round-heading{display:flex;align-items:center;gap:15px;justify-content:flex-start;flex-wrap:wrap;font-size:14px;margin:0}
body.guided-learning .round-heading strong{font-size:16px}
body.guided-learning .round-heading small{font-size:13px}
body.guided-learning .round-progress{margin:0 0 9px}
body.guided-learning .guided-card{padding:18px 24px 16px;border-radius:22px;box-shadow:0 5px 16px #263e430a;overflow:visible}
.guided-card .guided-task-top{display:grid;grid-template-columns:1fr auto;align-items:start;gap:12px;margin-bottom:10px}
.guided-task-heading{text-align:center;padding-left:130px}
.guided-card .guided-task-heading h2{font-size:clamp(23px,2.4vw,33px);line-height:1.25;margin:0 0 4px}
.guided-card .guided-task-heading p{font-size:16px;line-height:1.5;margin:0;color:#3e6845;font-weight:650}
.guided-card .guided-task-top>button{font-size:14px;min-height:44px;border-radius:12px}
.guided-workspace{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:26px;align-items:center;margin:4px auto 14px;max-width:1000px}
.guided-workspace.no-guided-hint{grid-template-columns:minmax(0,1fr)}
.guided-board-scroll{max-width:100%;overflow-x:auto;padding:6px 3px;min-width:0;overscroll-behavior-inline:contain}
.guided-card .column-board{margin:0 auto;width:fit-content;max-width:none}
.guided-card .column-row{grid-template-columns:26px repeat(var(--column-count),68px);gap:7px;align-items:center;padding:2px 0}
.guided-card .column-number{height:48px;font-size:40px}
.guided-card .column-symbol{font-size:35px;color:var(--ink)}
.guided-card .column-field-label{font-size:14px;margin:4px 0 2px}
.guided-card .column-cell{font-size:35px;height:60px;min-height:44px;border-radius:13px;background:#eff5e9;border-color:#8ab16a}
.guided-card .column-cell.active{outline:3px solid #327344;outline-offset:2px;background:#e9f4df;box-shadow:0 0 0 6px #e2efda}
.guided-card .column-rule{border-color:#a886cb;padding-bottom:5px}
.guided-place-row{display:grid;grid-template-columns:26px repeat(var(--column-count),68px);gap:7px;text-align:center;font-size:14px;line-height:1.3;color:#45663c;margin:8px 0 5px}
.guided-card .column-final{margin-top:3px;padding-top:3px}
.guided-card .guided-hint{border-left:1px solid #d9dfd9;padding-left:24px;min-width:0}
.guided-card .hint-panel{margin:0;padding:17px 20px;border-radius:18px;background:#f0e7fa;border:1px solid #eadcf3;color:#41265c;overflow-wrap:anywhere;min-width:0}
.guided-card .hint-panel h3{font-size:22px;line-height:1.35;margin:6px 0 12px}
.guided-card .hint-panel p{font-size:16px;line-height:1.6}
.guided-card .split-step-count{font-size:14px;font-weight:750;background:#e3d5f3;border-radius:9px;padding:4px 10px;display:inline-block}
.guided-card .split-numbers>div{font-size:24px;padding:10px;background:#fffdf8;border-radius:12px;margin:10px 0}
.guided-card .split-products>div{font-size:20px;line-height:1.6}
.guided-card .split-navigation{display:flex;gap:10px;flex-wrap:wrap;justify-content:space-between;margin-top:14px}
.guided-card .split-navigation button{min-height:44px;padding:8px 13px;font-size:14px;border-radius:11px;flex:1}
.guided-card .split-navigation .primary{background:#76509b}
.guided-card .division-board-wrap{max-width:100%;overflow-x:auto}
.guided-card .division-equation{font-size:22px;line-height:1.5;overflow-wrap:anywhere}
.guided-controls{display:grid;grid-template-columns:minmax(240px,1fr) minmax(290px,1fr);gap:22px;max-width:1000px;margin:4px auto 0;align-items:center}
.guided-card .written-keypad{display:grid;grid-template-columns:repeat(5,minmax(44px,1fr));gap:8px;width:100%;max-width:none}
.guided-card .written-keypad button{min-height:48px;padding:4px;font-size:25px;border-radius:12px;background:#f4f6f1}
.guided-action-group{display:grid;grid-template-columns:135px minmax(150px,1fr);gap:14px;border-left:1px solid #d9dfd9;padding-left:22px}
.guided-edit-controls{display:grid;gap:8px}
.guided-check-controls{min-width:0}
.guided-check-controls.guided-solved{grid-column:1/-1}
.guided-edit-controls button{font-size:14px;min-height:48px;border-radius:12px;padding:6px 10px;line-height:1.3}
.guided-action-group .work-bottom{display:block;width:auto;max-width:none;margin:0;padding:0;border:0;background:none}
.guided-action-group .actions{display:flex;flex-direction:column-reverse;gap:8px;align-items:stretch;width:100%}
.guided-action-group .actions button{width:100%;margin:0;min-height:48px;padding:8px 12px;line-height:1.3;font-size:16px;border-radius:12px}
.guided-action-group .actions button[data-action="hint"]{background:#fcf9ff;border:1px solid #9b71c1;color:#5d3284}
.guided-action-group .helper-mini{display:none}
.guided-action-group .feedback{grid-column:1/-1;margin:0;line-height:1.5;font-size:16px}
.guided-action-group .feedback:empty{display:none}
.guided-example{background:#f0f5ec;border:1px solid #d6e3cf;border-radius:20px;padding:17px 22px;margin-top:16px}
.guided-example-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}
.guided-example-header button{font-size:18px;min-height:44px;text-align:left;border:0;background:none;font-weight:800;color:var(--ink);padding:0}
.guided-example-header p{font-size:14px;margin:3px 0;color:#4c664a;line-height:1.5}
.guided-example-task{background:#e8dcf4;padding:7px 13px;border-radius:12px;font-size:14px;color:#4c2d68}
.guided-example-task strong{font-size:21px;white-space:nowrap;color:var(--ink);margin-left:8px}
.guided-example-body{margin-top:12px;padding:14px 18px;background:#fffdf9;border-radius:14px;border:1px solid #e0e7da}
.guided-example-body h3{font-size:18px;line-height:1.4;margin:6px 0}
.guided-example-body p{font-size:16px;line-height:1.6}
.guided-example-body .explain-equation{font-size:clamp(20px,2.4vw,30px);overflow-wrap:anywhere;margin:12px 0}
.guided-example-nav{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:10px}
.guided-example-nav button{min-height:44px;padding:8px 15px;font-size:14px}
@media(max-width:1100px){body.guided-learning .topbar{grid-template-columns:1fr}.guided-task-heading{padding-left:0}.guided-workspace{gap:16px}.guided-card .guided-hint{padding-left:16px}.guided-controls{gap:15px;grid-template-columns:1fr 1fr}.guided-action-group{grid-template-columns:1fr;border-left:0;padding-left:0}.guided-edit-controls{grid-template-columns:1fr 1fr}.guided-card .column-row,.guided-place-row{grid-template-columns:22px repeat(var(--column-count),58px)}.guided-card .split-numbers>div{font-size:21px}}
@media(max-width:800px){body.guided-learning .sidebar{width:100%;height:auto;padding:12px;position:relative;overflow:visible}body.guided-learning{display:block}body.guided-learning main{width:100%;padding:15px}body.guided-learning .sidebar nav{grid-template-columns:repeat(5,minmax(0,1fr));display:grid}.guided-workspace{grid-template-columns:minmax(0,1fr)}.guided-card .guided-hint{border-left:0;border-top:1px solid #d9dfd9;padding:15px 0 0}.guided-controls{grid-template-columns:minmax(0,1fr)}.guided-action-group{grid-template-columns:1fr 1.3fr;border-top:1px solid #e0e5dc;padding-top:12px}.guided-edit-controls{grid-template-columns:1fr}.guided-card .guided-task-top{grid-template-columns:1fr}.guided-card .guided-task-top>button{justify-self:end}.guided-card .guided-task-heading h2{font-size:25px}body.guided-learning .round-line{grid-template-columns:1fr;gap:10px}body.guided-learning .guided-card{padding:17px}.learning-resources{justify-content:flex-start}}
@media(max-width:540px){body.guided-learning .nav-item{font-size:12px;min-height:54px;gap:3px;padding:6px 2px}body.guided-learning .top-controls{justify-content:flex-start}body.guided-learning .language-switch{flex-basis:100%;justify-content:space-between}body.guided-learning .language-switch button{font-size:14px;padding:7px 8px}body.guided-learning .welcome{font-size:16px}body.guided-learning .rule-reminder{flex-wrap:wrap;padding:10px}body.guided-learning .rule-reminder strong{font-size:16px;flex:1}body.guided-learning .rule-reminder button{margin-left:auto}.guided-card .column-row,.guided-place-row{grid-template-columns:18px repeat(var(--column-count),52px);gap:6px}.guided-card .column-cell{height:55px;font-size:32px}.guided-place-row{font-size:14px}.guided-card .hint-panel{padding:14px}.guided-card .split-numbers>div{font-size:20px}.guided-card .written-keypad{gap:6px}.guided-card .written-keypad button{min-height:48px;font-size:24px}.guided-action-group{gap:10px}.guided-card .guided-task-heading p{font-size:16px}.guided-example{padding:15px}.guided-example-task strong{font-size:20px}}
body.guided-learning.reading-expanded .sidebar,body.guided-learning.reading-expanded .topbar,body.guided-learning.reading-expanded .learning-resources{display:none!important}
body.guided-learning.reading-expanded main{width:100%;max-width:none;padding:8px 14px 24px}

/* A phone practice view reuses the real exercise, hints and action buttons. */
@media(max-width:800px){
 body.guided-learning .learning-dock-region{display:none}
 body.mobile-practice .sidebar,body.mobile-practice .topbar,body.mobile-practice .learning-dock-region,body.mobile-practice #workspace :is(.activity-toolbar,.compact-level){display:none!important}
 body.mobile-practice #mobile-practice-bar{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;position:sticky;top:0;z-index:40;background:var(--cream);padding:6px 0;border-bottom:1px solid var(--line)}
 #mobile-practice-bar strong{font-size:14px;line-height:1.3;overflow-wrap:anywhere;text-align:center}
 #mobile-practice-bar button{min-width:44px;min-height:44px;padding:6px 8px;font-size:14px}
 body.mobile-practice.mobile-options-open .topbar{display:grid!important;margin:8px 0}
 body.mobile-practice.mobile-options-open .topbar .welcome{display:none}
 body.mobile-practice.mobile-options-open #workspace :is(.activity-toolbar,.compact-level){display:flex!important}
 body.guided-learning.mobile-practice main{padding-bottom:calc(var(--mobile-actions-height,110px) + 30px + env(safe-area-inset-bottom,0px))}
 body.mobile-practice #workspace .actions{position:fixed;left:0;right:0;bottom:0;z-index:42;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);align-items:stretch;gap:8px;width:auto;margin:0;padding:8px max(10px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px));border-top:1px solid var(--line);background:var(--cream);box-shadow:0 -3px 12px #263e4314}
 body.mobile-practice #workspace .actions button{min-width:0;min-height:48px;width:100%;font-size:16px;line-height:1.3;padding:8px;overflow-wrap:anywhere}
 body.mobile-practice #workspace .actions .primary{grid-column:2;grid-row:1}
 body.mobile-practice #workspace .actions [data-action="hint"]{grid-column:1;grid-row:1}
 body.mobile-practice :is(.learning-dock-region,.helper-mini,#season-decor,#halloween-mantel,#spring-bee){display:none!important}
 body.mobile-practice #workspace :is(.hint-panel,.feedback){scroll-margin:80px 0 calc(var(--mobile-actions-height,110px) + 20px)}
 body.mobile-practice:has(dialog[open]) #workspace .actions{visibility:hidden}
 body.mobile-practice.mobile-options-open #workspace .actions{visibility:hidden}
 body.mobile-practice .guided-card .hint-panel{font-size:16px;border-width:2px}
 body.mobile-practice .rule-reminder{margin-top:6px}
 .daily-presets [data-daily-action="short"]{flex-basis:100%;border:2px solid var(--green);background:var(--mint);font-weight:750}
 .daily-dialog .daily-options-toggle{display:block}
 .daily-dialog .daily-header{display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;gap:6px}
 .daily-dialog .daily-header h2{grid-column:2;grid-row:1;font-size:18px}
 .daily-dialog .daily-header>.daily-options-toggle{grid-column:3;grid-row:1;font-size:14px;min-height:44px;padding:6px 8px}
 .daily-dialog .daily-header>[data-daily-action="close"]{grid-column:1;grid-row:1;min-width:44px;min-height:44px;font-size:0;padding:4px}
 .daily-dialog .daily-header>[data-daily-action="close"]::after{content:'×';font-size:26px}
 .daily-dialog.games-view .daily-header>[data-daily-action="close"]:not(.games-exit){display:none}
 .daily-dialog.games-view .daily-header>.games-exit{font-size:26px}
 .daily-dialog.games-view .daily-header>.games-exit::after{content:none}
 .daily-dialog:not(.daily-options-open) .daily-header>:is(label,.games-language){display:none}
 .daily-dialog.daily-options-open .daily-header>:is(label,.games-language){grid-column:1/-1;grid-row:auto}
 .daily-task-view .daily-actions{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.4fr) minmax(72px,1fr);gap:6px}
 .daily-dialog .daily-task-controls .daily-actions button,.daily-dialog .daily-task-controls .daily-secondary button{font-size:14px;padding:6px 8px;min-width:0;overflow-wrap:anywhere}
 .daily-task-view .daily-actions [data-daily-action="help"]{grid-column:1;grid-row:1}
 .daily-task-view .daily-actions [data-daily-action="easier"]{grid-column:2;grid-row:1}
 .daily-dialog .daily-task-controls .daily-actions .primary{grid-column:3;grid-row:1;min-width:0;margin:0}
 .daily-task-view .daily-help{font-size:16px;border-width:2px}
}
@media(max-width:800px){body.guided-learning .sidebar{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;border-bottom:1px solid var(--line);border-right:0}body.guided-learning .sidebar .brand{flex:1;font-size:14px}body.guided-learning .sidebar .brand br{display:none}.mobile-subjects-toggle{display:block;min-height:44px;font-size:14px}body.guided-learning .sidebar>:not(.brand):not(.mobile-subjects-toggle){display:none}body.guided-learning .sidebar.subjects-open nav#subject-navigation{display:grid;flex-basis:100%;grid-template-columns:repeat(4,minmax(0,1fr))}body.guided-learning .sidebar.subjects-open>:not(.brand):not(.mobile-subjects-toggle):not(nav):not([hidden]){display:block;flex:1 0 40%;margin:0}}

/* Phone quick actions sit beside the greeting, above the language choices. */
@media(max-width:800px){
 body.guided-learning .welcome{display:grid;grid-template-columns:minmax(0,.9fr) minmax(160px,1.1fr);align-items:center;gap:8px}
 body.guided-learning .welcome-copy{overflow-wrap:anywhere}
 body.guided-learning .welcome-copy small{font-size:14px;line-height:1.35;margin-top:3px}
 body.guided-learning .welcome .daily-entry{display:block;margin:0;width:100%}
 body.guided-learning .welcome .daily-entry-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:4px}
 body.guided-learning .welcome .daily-entry-actions button{width:100%;min-width:0;min-height:44px;padding:6px 8px;font-size:14px;line-height:1.25;overflow-wrap:anywhere}
}
@media(max-width:540px){
 body.guided-learning .sidebar{padding:8px 10px}
 body.guided-learning .sidebar .brand-mark{width:30px;height:34px;font-size:26px}
 body.guided-learning main{padding:8px 10px 20px}
 body.guided-learning .topbar{gap:6px;margin-bottom:6px}
 body.guided-learning .top-controls{gap:4px}
 body.guided-learning .header-languages{gap:4px}
 body.guided-learning .header-languages .language-switch button{padding:5px 3px;line-height:1.25}
 body.guided-learning .header-languages :is(.more-languages summary,.learning-resources a){min-height:44px;padding:4px 8px;font-size:14px;line-height:1.25}
 body.guided-learning .header-preferences{gap:4px;justify-content:space-between}
 body.guided-learning .header-preferences :is(.icon-button,.star-counter){min-height:44px}
 body.guided-learning .header-preferences .icon-button{min-width:44px}
 body.guided-learning .header-preferences .learning-mode-switch{width:100%;padding:2px}
 body.guided-learning .learning-mode-switch button{flex:1;padding:5px 8px}
 body.guided-learning .activity-toolbar{gap:4px;margin-bottom:6px}
 body.guided-learning .activity-toolbar .tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;width:100%;flex-basis:100%}
 body.guided-learning .activity-toolbar .tab{min-width:0;min-height:44px;padding:4px;font-size:14px;line-height:1.25;overflow-wrap:anywhere}
 body.guided-learning .activity-toolbar .level-wrap{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px}
 body.guided-learning .level-wrap label{font-size:12px;letter-spacing:.5px;flex-shrink:0}
 body.guided-learning .level-wrap select{min-width:0;max-width:100%;min-height:44px;font-size:14px;padding:5px 24px 5px 8px}
 body.guided-learning .rule-reminder{margin:6px 0;padding:6px 8px;gap:8px;min-height:56px}
 body.guided-learning .rule-reminder img{width:28px;height:28px}
 body.guided-learning .rule-reminder strong{font-size:16px;line-height:1.3}
 body.guided-learning .rule-reminder button{padding:5px 8px}
 body.guided-learning .round-line{gap:4px;margin:6px 0 8px}
 body.guided-learning .round-heading{gap:4px 8px;justify-content:space-between}
 body.guided-learning .round-heading strong{font-size:14px}
 body.guided-learning .round-heading small{font-size:12px}
 body.guided-learning .round-progress{height:22px;margin:0}
 body.guided-learning .task-card:not(.guided-card){padding:12px}
 body.guided-learning .task-card:not(.guided-card) .task-top{gap:4px}
 body.guided-learning .task-card:not(.guided-card) .task-badge{font-size:12px;line-height:1.3;letter-spacing:.3px;padding:5px 7px}
 body.guided-learning .task-card:not(.guided-card) .task-top .link-button{font-size:14px;min-height:44px;padding:4px}
 body.guided-learning .task-card:not(.guided-card) h2{font-size:22px;line-height:1.3;margin:8px 0 4px}
 body.guided-learning .task-card:not(.guided-card) .instruction{margin:0;line-height:1.35}
 body.guided-learning .task-card:not(.guided-card) .equation{padding:12px 0}
 body.guided-learning .task-card:not(.guided-card) .number-slot{min-height:84px}
 body.guided-learning .task-card:not(.guided-card) .answer-prompt{font-size:14px;line-height:1.35;margin:0 0 6px}
 body.guided-learning .task-card:not(.guided-card) .choices{gap:6px}
 body.guided-learning .task-card:not(.guided-card) .choice{min-height:58px}
 body.guided-learning .task-card:not(.guided-card) .input-tools{margin-top:6px}
}
