.grade-four-screen .grade3-house:nth-child(n+5){transform:none}.grade-four-screen .g4-house-history .g3-house-button strong{font-size:20px}.g4-fraction-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.g4-fraction-pair>div{min-width:0;text-align:center}.g4-timeline{list-style:none;padding:0 0 0 17px;border-left:3px solid #83b4b0}.g4-timeline li{display:grid;grid-template-columns:105px 1fr;gap:14px;padding:12px 0;line-height:1.65}.g4-timeline strong{color:#348284}.g4-scratch-grid{width:100%;max-width:380px;aspect-ratio:1;background:repeating-linear-gradient(0deg,transparent 0 calc(20% - 1px),#d5e3cf calc(20% - 1px) 20%),repeating-linear-gradient(90deg,transparent 0 calc(20% - 1px),#d5e3cf calc(20% - 1px) 20%);background-color:#f2f8ec;border:2px solid #8fb596;border-radius:14px;position:relative;margin:18px auto}.g4-scratch-actor{width:20%;height:20%;position:absolute;display:grid;place-items:center;font-size:35px;transition:left .25s,top .25s}.g4-scratch-blocks{display:flex;flex-wrap:wrap;gap:9px}.g4-scratch-blocks button{font:inherit;font-weight:800;border:2px solid #d3a168;border-radius:12px;background:#ffdb9b;padding:11px 14px}.g4-word-preview{min-height:150px;border:2px solid #d6dfd1;border-radius:14px;background:white;padding:20px;white-space:pre-wrap;overflow-wrap:anywhere}.g4-block-program{display:flex;flex-wrap:wrap;gap:7px;padding:12px;border-radius:14px;background:#f4edff;min-height:58px;align-items:center}.g4-block-program span{background:#e5d6f6;border-radius:8px;padding:7px 10px}.g4-it-search-results article{padding:15px;border:2px solid #e1e9db;border-radius:15px;margin:10px 0}.g4-it-search-results h3{margin:0 0 7px}.g4-it-search-results small{color:#678478}@media(max-width:480px){.grade-four-screen .g4-house-history .g3-house-button strong{font-size:17px}.g4-fraction-pair{grid-template-columns:1fr}.g4-timeline li{grid-template-columns:1fr;gap:2px}.g4-math-lab .grade3-lab-controls label{min-width:120px}.grade-four-screen .g3-house-note{min-height:29px}.grade-four-screen .reference-brand-copy small{font-size:10px}}@media(prefers-reduced-motion:reduce){.g4-scratch-actor{transition:none}}

.grade-four-screen .g3-keyboard>div{display:flex;justify-content:center;gap:3px;width:100%}.grade-four-screen .g3-keyboard>div button{flex:0 1 36px;min-width:0;padding:2px;font-size:16px}.g4-it-lab select,.g4-it-lab input[type=file]{max-width:100%;font:inherit}.g4-it-lab>label{display:flex;flex-direction:column;gap:8px;margin:15px 0}.g4-it-lab textarea{max-width:100%;font:inherit}.g4-it-lab .practice-actions{flex-wrap:wrap}.g4-it-lab video{width:100%;max-width:640px;border-radius:16px;background:#e8f3dd}.g4-scratch-pen{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.g4-scratch-target{position:absolute;width:20%;height:20%;display:grid;place-items:center;font-size:32px}

/* Book-specific resources remain readable in narrow phone layouts. */
.g4-workshop{min-width:0}.g4-workshop h2{margin-top:.5rem}.g4-resource-reading{background:#f0f5e9;padding:1rem;border-radius:18px}.g4-resource-reading p{white-space:pre-wrap}.g4-resource-table{max-width:100%;overflow-x:auto;margin:1rem 0;border:1px solid #d9e3d0;border-radius:16px}.g4-resource-table table{width:100%;border-collapse:collapse;font-size:1rem}.g4-resource-table th,.g4-resource-table td{padding:.7rem;border-bottom:1px solid #d9e3d0;min-width:90px;text-align:left;vertical-align:top}.g4-resource-table th{background:#edf3e4}.g4-example-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:.8rem}.g4-example-cards article{padding:1rem;border-radius:16px;background:#fff3dd}.g4-check-item{border-top:1px solid #dce5d4;padding:.5rem 0}.g4-check-item summary{cursor:pointer;font-weight:700;padding:.6rem}.g4-review-diagram{width:100%;height:auto;max-height:none}.g4-workshop li{margin:.45rem 0}.g4-it-lab img.g4-document-image{max-width:100%;display:block;margin:.6rem auto}.g4-it-lab video{max-width:100%;height:auto}.g4-scratch-blocks button{min-height:44px}.g4-block-program button{margin:.25rem;white-space:normal}.g4-it-web-page{padding:1rem;background:#eef5e9;border-radius:18px}.g4-it-web-page [hidden]{display:none}.g4-event-tally{max-width:100%;height:auto}.g4-example-cards h3{margin-top:0}
