/* Compact commands, nested C-shaped repeat blocks, and the phone command drawer. */
.command{min-height:38px;padding:7px 10px;gap:7px;border-radius:8px;font-size:12px;box-shadow:inset 0 1px 0 #fff9,0 2px 0 var(--edge)}
.command .icon{width:16px;height:16px;stroke-width:2}
.palette{gap:7px}.toolbox{padding-bottom:12px}.panel-intro{padding-top:14px;padding-bottom:12px}.panel-intro h1{font-size:21px}.program-heading{margin-bottom:5px}.program-meta{margin-bottom:7px}.program-meta>span:first-child{padding:4px 9px;font-size:10px}.program-title{font-size:13px}.program{padding:7px 4px 10px}
.block{border-radius:6px;margin-bottom:5px;box-shadow:inset 0 1px 0 #fff9,0 1px 0 var(--edge)}
.block-row{min-height:40px;padding:3px 5px;gap:4px;flex-wrap:nowrap}
.block-name,.loop-children .block-name{font-size:11px;min-width:0;font-weight:800;line-height:1.2}
.block-num{font-size:9px;opacity:.65}.block-row>.icon{width:15px;height:15px;stroke-width:2}
.drag-handle,.loop-children .drag-handle{flex:0 0 18px;width:18px;height:30px;background:transparent;border-radius:4px}
.drag-handle .icon{width:13px;height:18px;stroke-width:3.3}
.block-tools,.loop-children .block-tools{gap:2px;align-items:center;margin:0 0 0 auto}
.block-tools button,.loop-children .block-tools button{width:25px;min-width:25px;height:30px;min-height:30px;padding:3px;box-shadow:none;border-radius:5px;border-color:#ffffff90;background:#ffffff66}
.block-tools button .icon{width:14px;height:14px;stroke-width:2.5}
.block-tools .delete-block,.loop-children .block-tools .delete-block{margin-left:2px;background:#fff0e8;border:1px solid #d99b86;color:#a53731;box-shadow:none}
.block-tools button:disabled{opacity:.23}.block-tools button:focus-visible{outline-width:2px;outline-offset:1px}
.loop-children .block-row{padding:3px 4px;gap:3px}.loop-children .block-num{display:none}
.block.repeat{--soft:#ffbc4d;--ink:#694617;--line:#da922b;--edge:#d5912c;background:transparent;border:0;box-shadow:none;border-radius:6px;position:relative;padding-bottom:2px;margin:6px 0 8px}
.block.repeat>.block-row{background:linear-gradient(#ffc661,#ffb63d);border:1px solid #db932e;border-radius:6px 6px 5px 0;min-height:40px;flex-wrap:nowrap;position:relative}
.block.repeat>.block-row:before{content:'';position:absolute;top:-4px;left:24px;width:22px;height:5px;background:#ffc661;border:1px solid #db932e;border-bottom:0;border-radius:4px 4px 0 0}
.block.repeat>.block-row>.block-name{flex:1;min-width:30px;font-size:11px}.repeat-times{display:none}
.loop-select{width:36px;min-width:36px;height:27px;border-radius:15px;font-size:12px;border:1px solid #d7983d;background:#fffdf3;color:#61451b;padding:2px 3px;font-weight:900;flex-shrink:0}
.block.repeat>.loop-children,.block.repeat.editing-loop>.loop-children{margin:0;padding:6px 0 5px 7px;border:0;border-left:12px solid #ffb63d;background:transparent;min-height:42px;border-radius:0;box-shadow:inset 1px 0 #d99436}
.loop-children .loop-children{margin-left:0}.block.repeat>.loop-tail{height:18px;background:#ffb63d;border:1px solid #db932e;border-top:0;border-radius:0 5px 5px 5px;display:flex;justify-content:flex-end;align-items:center;padding-right:8px;position:relative;color:#895c1e}
.loop-tail:after{content:'';position:absolute;bottom:-4px;left:24px;width:22px;height:5px;border:1px solid #db932e;border-top:0;background:#ffb63d;border-radius:0 0 4px 4px}.loop-tail .icon{width:13px;height:13px;stroke-width:2.2}
.loop-target,.loop-target.selected{display:flex;align-items:center;justify-content:flex-start;gap:4px;width:100%;margin:0;min-height:29px;padding:3px 7px;border:1px dashed #d5b47b;border-radius:5px;background:#fff8e77d;color:#95692b;font-size:10px;font-weight:600;text-align:left;box-shadow:none}
.loop-target.selected{border-color:#bc7a24;background:#fff2c9}.loop-target span{font-size:15px;line-height:1}.editing-loop>.block-row{box-shadow:0 0 0 2px #f4dc9b}.block.repeat.active>.block-row{box-shadow:0 0 0 3px #ffe37c}
.root-target{display:block;width:100%;min-height:31px;margin:7px 0 0;padding:5px 8px;font-size:10px;border:1px dashed #b7cdb0;border-radius:6px;color:#58784d;background:#f6fbea90;text-align:left}.root-target.selected{border-color:#81a374;background:#eaf5df}.program-empty{min-height:62px;font-size:11px}.program-empty small{font-size:10px;margin-top:4px}
.add-command{display:none}.command-dialog{width:min(430px,100%);border:1px solid #cfdec7;border-radius:20px 20px 0 0;padding:18px 18px max(20px,env(safe-area-inset-bottom));background:#fbfdf5;color:#315b47;box-shadow:0 -8px 40px #224c4030;max-height:75dvh;margin:auto auto 0}
.command-dialog::backdrop{background:#173c3b55;backdrop-filter:blur(2px)}.command-dialog-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;gap:12px}.command-dialog h2{font-size:18px;margin:0 0 4px}.command-dialog p{font-size:12px;margin:0;color:#6d8069}.command-dialog .command{min-height:46px;font-size:13px}.command-dialog .command .icon{width:17px;height:17px}.command-dialog .palette{grid-template-columns:1fr 1fr;gap:10px}.command-dialog .icon-button{width:32px;height:32px;min-width:32px;font-size:20px}.command-dialog:not([open]){display:none}
@media(min-width:600px) and (max-width:1000px) and (orientation:portrait){
 .coding-panel{grid-template-columns:230px minmax(0,1fr)}.command{min-height:39px;font-size:11px;padding:7px 9px}.palette{gap:7px}.toolbox{padding:13px 12px 8px}.section-label{margin-bottom:9px}.program-section{padding-top:12px}.run-area{padding-left:12px;padding-right:12px}.loop-children .loop-children{margin-left:0}
}
@media(max-width:599px), (max-width:950px) and (max-height:500px){
 body{height:100dvh;overflow:hidden}.topbar{height:88px;padding:7px 12px;display:flex;flex-wrap:wrap;gap:5px 10px}.brand{gap:7px}.brand img{width:87px;height:32px}.brand>span:last-child{font-size:7px}.brand b{font-size:8px}.brand-divider{height:23px}.header-tools{margin-left:auto;gap:6px}.header-tools .icon-button{min-width:29px;width:29px;height:29px;font-size:16px}.total-stars{font-size:12px;margin:0 2px 0 0}.total-stars>span{font-size:10px}.total-stars .icon{width:16px;height:16px}.level-nav{order:3;flex-basis:100%;justify-content:space-between;gap:3px}.level-button{width:27px;min-width:27px;height:28px;font-size:11px;border-radius:9px}.level-button.completed:after{font-size:12px;bottom:-8px}
 .workspace{height:calc(100dvh - 88px);min-height:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 256px;padding:10px 10px 12px;gap:10px}.play-panel{order:0;min-height:0;display:flex;flex-direction:column}.coding-panel{order:1;display:flex;min-height:0;border-radius:13px}.panel-intro,.toolbox{display:none}.program-section{padding:8px 10px 5px;min-height:0;flex:1}.program-heading{margin-bottom:4px;gap:8px}.program-title{font-size:13px}.add-command{display:inline-flex;align-items:center;margin-left:auto;min-height:30px;padding:4px 10px;border:1px solid #a8c396;border-radius:7px;background:#e7f2db;color:#42683b;font-size:11px;font-weight:800}.text-button{font-size:10px;min-height:30px;padding:3px 2px}.program-meta{margin-bottom:5px;font-size:9px}.program-meta>span:first-child{font-size:9px;padding:3px 8px}.program{min-height:0;max-height:none;overflow:auto;padding:6px 3px 8px}.program-empty{min-height:36px}.program-empty small{display:none}
 .run-area{flex:0 0 auto;padding:7px 10px 8px}.play-controls{gap:7px}.run-button{min-height:35px;padding:7px 12px;font-size:12px;box-shadow:inset 0 1px 0 #91d59c,0 2px 0 #216b4e}.run-button .icon{width:16px;height:16px}.secondary-button{min-width:38px;min-height:35px;padding:4px 8px;font-size:16px}.step-button span{font-size:8px}.run-footer{margin-top:5px;font-size:9px;line-height:1}.speed-button{min-height:20px;font-size:10px}.run-footer>span{font-size:9px}
 .mission{min-height:60px;flex:0 0 auto;gap:7px;padding:0 0 9px}.mission-number{display:none}.mission .eyebrow{display:none}.mission h2{font-size:17px;padding:4px 9px;margin:0 0 6px;border-width:1px}.mission p{font-size:10px;line-height:1.35;margin:0}.hint-button{font-size:10px;min-height:32px;min-width:54px;padding:5px 7px;margin:0}.hint-button span{display:none}.farm-world{flex:1;min-height:0;border-radius:14px}.scene{position:absolute;inset:28px 0 20px;width:100%;height:calc(100% - 48px);min-width:0;min-height:0;max-height:none;margin:0}.world-top{padding:10px 12px 0}.location{font-size:7px;letter-spacing:.6px}.weather{font-size:17px}.weather span{display:none}.objectives{top:29px;gap:5px}.objective{padding:4px 7px;font-size:9px;gap:4px}.objective .icon{width:12px;height:12px}.world-bottom{position:absolute;bottom:0;left:0;right:0;padding:0 9px 8px;margin:0}.direction-tag{padding:5px 7px;font-size:8px;gap:4px}.direction-tag b{font-size:12px}.world-note,.learning-footer{display:none}.feedback{min-height:40px;padding:4px 8px;gap:7px;margin-top:8px;border-radius:10px}.feedback>img{width:23px;height:29px}.feedback b{font-size:10px}.feedback p{font-size:9px;line-height:1.3;margin:2px 0 0}.feedback-decoration{display:none}.action-notice{padding:5px 8px;margin-bottom:6px;gap:6px;border-radius:8px;flex-shrink:0}.action-notice>span{font-size:18px;min-width:20px}.action-notice strong{font-size:12px}.action-notice p{font-size:9px;margin-top:1px}.success-overlay{padding:9px}.success-overlay .eyebrow{font-size:7px}.success-overlay>img{display:none}.success-stars{font-size:20px;margin:3px 0}.success-overlay h2{font-size:18px;margin:3px 0}.success-overlay p{font-size:10px;margin:3px 0 8px}.success-actions{gap:8px}.success-actions .run-button,.success-actions .secondary-button{min-height:30px;padding:6px 10px;font-size:10px}.auto-next{margin-top:7px}.auto-next p{font-size:10px}.auto-next .text-button{min-height:22px;font-size:9px}
}
@media(max-width:599px) and (max-height:700px){.workspace{grid-template-rows:minmax(0,1fr) 230px}.mission{min-height:50px;padding-bottom:7px}.mission p{font-size:9px}.feedback{min-height:32px}.feedback b{display:none}.feedback>img{height:24px}.feedback p{margin:0}}
@media(min-width:600px) and (max-width:950px) and (max-height:500px){.topbar{height:68px;padding:4px 12px}.brand img{height:24px}.brand>span:last-child,.brand-divider{display:none}.level-button{height:23px;width:25px;min-width:25px}.workspace{height:calc(100dvh - 68px);grid-template-columns:300px minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:12px}.coding-panel{order:0}.play-panel{order:1}.mission{min-height:51px}.feedback{min-height:32px}.feedback b{display:none}.feedback p{margin:0}.command-dialog{max-width:500px;padding:12px}.command-dialog .command{min-height:38px}.command-dialog .palette{grid-template-columns:repeat(3,1fr)}}
@media(min-width:600px) and (max-height:800px){.panel-intro{display:none}.toolbox{padding-top:14px}.run-area{padding-top:9px;padding-bottom:8px}.run-footer .speed-button{min-height:20px}}
@media(max-width:599px), (max-width:950px) and (max-height:500px){
 .topbar{min-height:0}.workspace{grid-template-rows:minmax(0,1fr) clamp(220px,38dvh,320px)}.program-meta{display:none}.program-heading{margin-bottom:5px}.run-area{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px}.run-footer{margin:0}.run-footer>span{display:none}.speed-button{min-height:35px;font-size:9px;gap:3px}.program-empty{min-height:35px}
}
@media(min-width:600px) and (max-width:950px) and (max-height:500px){.workspace{grid-template-rows:minmax(0,1fr)}.toolbox{display:none}}
/* Keep the farm readable while an action notice is visible on short phones. */
@media(max-width:359px){.brand>span{display:none}.topbar{gap:5px 7px}}
@media(max-width:599px) and (max-height:700px){
 .workspace{grid-template-rows:minmax(0,1fr) clamp(160px,30dvh,210px);gap:8px;padding-top:8px;padding-bottom:8px}
 .feedback{display:none}.action-notice{padding:4px 7px;margin-bottom:6px}.action-notice strong{font-size:11px}.action-notice p{display:none}
}
