.dr-main{max-width:1100px;padding-top:12px}.dr-head{padding:4px 0 12px}.dr-head h1{font-size:clamp(30px,6vw,52px);margin:6px 0}
.dr-lesson{padding:14px 18px;margin-bottom:14px;border-radius:18px}.dr-lesson h2{font-size:22px;margin:10px 0 4px}
.dr-lesson-top{display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center}.dr-label{font-weight:800;color:var(--gold)}
select{font:600 16px system-ui;min-height:44px;padding:8px 12px;border-radius:10px;border:1px solid var(--line);background:var(--bg);color:var(--ink);max-width:100%}
.dr-check{display:inline-flex;align-items:center;gap:8px;min-height:44px}.dr-check input{width:22px;height:22px;accent-color:var(--gold)}
.dr-step{margin:0;color:var(--gold)}.dr-nav{margin-top:8px}.dr-steps summary{cursor:pointer;min-height:44px;display:flex;align-items:center;color:var(--gold)}.dr-steps li{margin:6px 0;line-height:1.5}
.dr-tools{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;margin-bottom:10px}.dr-group{display:flex;gap:6px;flex-wrap:wrap}
.dr-tools button{min-height:44px;padding:8px 14px;font-size:15px}.dr-on{background:var(--gold)!important;color:var(--bg)!important}
.dr-colors button{width:44px;min-width:44px;padding:0;border-radius:50%;border:3px solid var(--panel);box-shadow:0 0 0 1px var(--line)}
.dr-colors button[aria-pressed="true"]{box-shadow:0 0 0 3px var(--gold)}.dr-colors input{width:44px;height:44px;padding:0;border:1px solid var(--line);border-radius:50%;background:none}
.dr-size{display:inline-flex;align-items:center;gap:8px;font-weight:700}.dr-size input{width:120px;accent-color:var(--gold)}.dr-size output{min-width:2ch;font-variant-numeric:tabular-nums}
.dr-stage{grid-area:stage;position:relative;width:100%;aspect-ratio:4/3;max-height:68dvh;min-height:200px;display:flex;align-items:flex-start;justify-content:center}
.dr-frame{position:relative;background:#fff;border-radius:14px;box-shadow:0 0 0 2px var(--line),0 10px 30px rgba(0,0,0,.4);overflow:hidden}
.dr-frame canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:crosshair}
.dr-guide{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;fill:none;stroke-linecap:round;stroke-linejoin:round}
.dr-guide .past{stroke:#9db7d6;stroke-width:5;opacity:.55}.dr-guide .now{stroke:#2f80ed;stroke-width:7;stroke-dasharray:18 12}
.dr-confirm{margin-top:10px;padding:14px;border:1px solid var(--gold);border-radius:14px;background:var(--panel)}.dr-confirm p{margin:0}
/* Phones first: tools, then the drawing, then the lesson, so the page you draw on is on screen without scrolling. */
.dr-work{display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:"tools" "stage" "mini" "status" "confirm" "lesson";gap:0}
.dr-tools{grid-area:tools}.dr-lesson{grid-area:lesson;margin:12px 0 0}#status{grid-area:status}.dr-mini{grid-area:mini;display:flex;gap:8px;align-items:center;margin-top:8px}.dr-mini[hidden]{display:none}.dr-mini p{flex:1;margin:0;font-size:15px;line-height:1.35}.dr-mini button{min-width:48px;min-height:48px;padding:0;font-size:26px;line-height:1}.dr-confirm{grid-area:confirm}
@media (max-width:899px){.dr-head p{display:none}.dr-head{padding:0 0 6px}.dr-head h1{font-size:28px;margin:2px 0}.dr-head .eyebrow{display:none}
 .dr-colors{flex-wrap:nowrap;overflow-x:auto;max-width:100%;padding:3px;scrollbar-width:thin}.dr-colors>*{flex:0 0 auto}}
/* Wide screens: lesson and tools beside a large page. */
@media (min-width:900px){.dr-main{max-width:1440px}
 .dr-work{grid-template-columns:minmax(280px,340px) minmax(0,1fr);grid-template-areas:"tools stage" "status stage" "confirm stage" "lesson stage" ". stage";grid-template-rows:auto auto auto auto 1fr;column-gap:20px;align-items:start}
 .dr-lesson{margin:4px 0 12px}.dr-head{padding:0 0 10px}.dr-head h1{font-size:40px;margin:2px 0}.dr-stage{aspect-ratio:auto;height:min(calc(100dvh - 224px),900px);min-height:420px;max-height:none;position:sticky;top:12px}.dr-mini{display:none}}
/* Phone landscape: tools and lesson in a column, the page beside them and kept in view. */
@media (orientation:landscape) and (max-height:540px){.dr-head{display:none}.dr-main{max-width:none;padding-top:6px}
 .dr-work{grid-template-columns:minmax(210px,34%) minmax(0,1fr);grid-template-areas:"tools stage" "status stage" "confirm stage" "lesson stage";grid-template-rows:auto auto auto 1fr;column-gap:12px;align-items:start}
 .dr-stage{aspect-ratio:auto;height:calc(100dvh - 58px);max-height:none;min-height:0;position:sticky;top:6px}.dr-mini{display:none}
 .dr-colors{flex-wrap:wrap;overflow:visible}.dr-lesson{padding:8px 12px;margin:8px 0 0}.dr-lesson h2{font-size:18px;margin:6px 0 2px}}
@media (max-width:420px){.dr-size input{width:90px}.dr-tools button{padding:8px 11px}}
@media (forced-colors:active){.dr-frame{forced-color-adjust:none}}

/* Start the drawing frame at its 4:3 shape so the lesson below does not jump when the canvas is sized. */
.dr-frame{aspect-ratio:4/3;height:100%;max-width:100%}
