*{box-sizing:border-box}body{margin:0;background:#e8e8e8;background-image:radial-gradient(#cacaca .8px,transparent .8px);background-size:10px 10px;color:#181818;font:14px monospace}button,input{font:inherit}button{border:2px solid;border-color:white #666 #666 white;background:#c4c4c4;min-height:36px;cursor:pointer;padding:6px 14px;color:#171717}button:not(:disabled):active,button[aria-pressed=true]{border-color:#666 white white #666;background:#f5c8dc}button:disabled{color:#777;cursor:not-allowed}button:focus-visible,input:focus-visible{outline:2px dashed #000;outline-offset:2px}.window{max-width:1240px;margin:56px auto 16px;background:#c4c4c4;border:3px solid;border-color:#fff #666 #666 #fff;box-shadow:0 0 0 1px #111}header{background:linear-gradient(100deg,navy,#087bbb);color:#fff;font-weight:bold;padding:5px 8px;font-size:18px;letter-spacing:.6px}.heart{color:#ff4c9a}.window-controls{float:right;font-size:14px}nav{display:flex;border-bottom:1px solid #777;gap:5px;padding:5px;flex-wrap:wrap}.nav-actions{margin-left:auto;display:flex;gap:5px}#share .person{fill:currentColor;vertical-align:-2px;margin-left:2px}nav button{min-width:110px}.decoration{height:40px;display:flex;align-items:center;justify-content:space-between;padding:0 40px}.decoration span{font-size:40px;color:#ffe731}.decoration svg{height:30px;width:120px;fill:none;stroke:#ff5093;stroke-width:5}iframe{border:0;width:100%;height:510px;display:block}.zoom{display:flex;align-items:center;gap:5px;padding:6px 12px}.zoom span{}.zoom-pair{display:flex;gap:5px;margin-left:auto}.zoom button{min-width:45px}.actions{display:flex;gap:8px;padding:8px 12px;flex-wrap:wrap}.actions input{min-width:80px;flex:1;padding:8px;border:2px inset #eee;width:120px}#screen{background:#f5c8dc}footer{margin:5px;border:2px inset white;padding:5px;min-height:28px}section[hidden],[hidden]{display:none!important}h1{font-size:18px}#templates,#saved{min-height:500px;padding:20px 30px}#templates,#saved,#showing{height:644px;overflow-y:auto}.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px}.card{background:#eee;border:2px inset #fff;padding:10px}.card img{width:100%;aspect-ratio:1;object-fit:contain;image-rendering:pixelated;background:white}.card h2{font-size:15px;overflow-wrap:anywhere}.card button{margin:3px;font-size:12px;padding:6px}.footnote{text-align:center;color:#555;font-size:11px;padding:0 12px}#recovery{margin:10px;border:2px solid #92365d;padding:10px}#make-template{margin-top:20px}
@media(max-width:700px){.window{margin:12px 4px 8px}header{font-size:18px;padding:8px}nav button{flex:1;min-width:0;min-height:44px;padding:6px}.nav-actions{margin-left:0;width:100%}.nav-actions button{flex:1;min-height:44px}.decoration{height:42px;padding:0 16px}iframe{height:770px}.zoom{padding:4px;gap:4px;flex-wrap:wrap;row-gap:8px}.zoom>span:not(.zoom-pair){display:none}.zoom button{min-height:44px;min-width:44px;padding:6px 5px}.zoom-pair{gap:4px}#undo,#redo{font-size:0}#undo::before,#redo::before{font-size:18px}#undo::before{content:"\21B6"}#redo::before{content:"\21B7"}#clear{font-size:0}#clear::before{content:"Clear";font-size:14px}.actions{padding:6px;gap:6px}.actions button{min-height:44px;flex:1}.actions input{flex-basis:100%;min-height:44px}#screen{flex-basis:55%}#templates,#saved{padding:12px}#templates,#saved,#showing{height:776px;overflow-y:auto}.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.card{padding:6px}.card button{width:100%;margin:2px 0;min-height:44px}.footnote{line-height:1.6}}

/* Match the compact Paint window and centered reference template panel. */
.decoration{height:22px;padding:0 35px}.decoration span{font-size:28px}.decoration svg{height:20px;width:90px}nav{padding:3px}nav button{min-height:28px;padding:3px 14px}header{font-size:16px;padding:3px 6px}.actions{padding:4px 8px}.zoom{padding:4px 8px}.zoom button{min-height:28px}.actions button{min-height:30px}#templates{position:relative;padding:20px}#template-grid{display:grid;grid-template-columns:repeat(2,180px);gap:12px 18px;width:max-content;max-width:100%;margin:4px auto;background:#fff;padding:14px}.card{position:relative}.card h2{text-align:center;text-transform:uppercase;margin:5px 0;font-size:15px}#template-grid .card{background:white;border:0;padding:0;width:180px}#template-grid img{border:2px inset #ddd;display:block}#template-grid .card button{position:absolute;inset:0;opacity:0;width:100%;height:100%;margin:0}#template-grid .card:focus-within{outline:2px dotted black}#make-template{display:block;margin:12px auto;font-size:12px}#draw iframe{height:560px}
@media(max-width:700px){header{padding:8px;font-size:18px}nav button{min-height:44px;padding:6px}.decoration{height:34px;padding:0 15px}.decoration span{font-size:34px}.decoration svg{height:25px;width:100px}#draw iframe{height:560px}.actions button{min-height:44px}.zoom button{min-height:44px}.actions,.zoom{padding:6px}#templates{padding:12px}#template-grid{grid-template-columns:repeat(2,minmax(0,1fr));width:100%;padding:12px;gap:12px}#template-grid .card{width:100%}}

/* Tactile feedback stays static and respects touch devices. */
@media(hover:hover){button:not(:disabled):hover{background-color:#dedede}button[aria-pressed=true]:hover{background-color:#f5c8dc}#template-grid .card:hover{outline:1px dotted #222}}
button:not(:disabled):active{background-color:#f5c8dc;border-color:#666 white white #666}

/* Keep the reserved window stable and reveal the editor and controls together. */
.window{position:relative}.booting> :not(header):not(#boot):not(script){visibility:hidden}
#boot{position:absolute;inset:26px 0 0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#c4c4c4;z-index:20;gap:4px}
#boot .heart{font-size:26px}#boot p{margin:8px 16px;text-align:center}#boot-retry{margin:8px}
.window:not(.booting)>#boot{display:none}.window.just-ready>section:not([hidden]),.window.just-ready>nav{animation:none}
@keyframes paint-reveal{from{opacity:0}to{opacity:1}}
#saved-note{padding:14px 0;min-height:48px}#saved-note button{margin-left:12px}
@media(max-width:700px){#boot{top:40px}}
@media(prefers-reduced-motion:reduce){.window.just-ready>section,.window.just-ready>nav{animation:none}}
/* One screen's saved playlist, with browser-only playback. */
select{font:inherit;color:inherit;border:2px inset white;background:#f5f5f5;padding:5px;min-height:32px}select:focus-visible{outline:2px dashed navy;outline-offset:2px}#showing{padding:26px 28px 22px}.show-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:20px}.show-heading h1{font-size:24px;letter-spacing:-.8px;margin:0 0 8px}.show-heading p{font-size:13px;margin:0}.show-now{display:flex;align-items:center;gap:8px;margin-bottom:18px;font-size:13px}#playlist-state{padding:5px 8px;border:1px solid #171717;background:#f5c8dc;font-weight:bold}#playlist-next{margin-left:auto;font-size:12px;min-height:30px}.playlist-queue{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;align-items:start}.playlist-item{min-width:0;border:2px solid;border-color:#fff #777 #777 #fff;background:#d4d4d4;padding:10px}.playlist-item.active{outline:3px solid #c63579;outline-offset:2px}.playlist-item.dragging{opacity:.4}.playlist-order{display:flex;align-items:center;gap:6px;height:26px;margin-bottom:8px;font-size:12px}.playlist-handle{cursor:grab;padding:0 4px;min-height:26px;background:transparent;border:0;font-size:21px;line-height:20px}.playlist-arrows{display:flex;gap:3px;margin-left:auto}.playlist-arrows button{min-height:23px;font-size:12px;padding:0 6px}.playlist-art{display:block;width:100%;aspect-ratio:1.48;object-fit:contain;border:2px inset white;background:white;image-rendering:pixelated}.playlist-item h2{font-size:14px;font-weight:bold;margin:12px 0 11px;overflow-wrap:anywhere}.playlist-controls{display:flex;justify-content:space-between;align-items:center;gap:5px;font-size:12px}.playlist-controls button{padding:5px 8px;font-size:12px;min-height:32px}.show-under{display:flex;justify-content:space-between;gap:12px;align-items:center;font-size:12px;margin-top:18px}.show-under p{margin:0;line-height:1.7}#playlist-timeline{margin-top:17px;height:8px;border:2px inset white;display:flex;background:white}#playlist-timeline i{background:#f5c8dc;border-right:1px solid #777;height:100%}#playlist-timeline i.on{background:#c63579}.screen-note{font-size:12px;margin:16px 0 0}#playlist-note{font-size:12px;margin-bottom:16px}#playlist-note:empty{display:none}#playlist-note button{margin-left:10px;font-size:12px}.playlist-empty{grid-column:1/-1;background:white;border:2px inset white;padding:60px 20px;text-align:center}#playlist-picker{padding:18px;background:#c4c4c4;border:3px outset white;max-width:440px;width:calc(100% - 24px);font:14px monospace;color:#181818}#playlist-picker::backdrop{background:#0005}#playlist-picker h2{font-size:18px;margin-top:0}#playlist-choices{max-height:55vh;overflow:auto;margin-bottom:12px}.playlist-choice{display:flex;width:100%;align-items:center;gap:12px;text-align:left;margin:8px 0}.playlist-choice img{width:60px;height:45px;object-fit:contain;background:white;image-rendering:pixelated}.playlist-choice span{overflow-wrap:anywhere;min-width:0}

.add-group{display:flex;gap:8px;flex-wrap:wrap}
.weather-toggle{margin-left:12px;font-size:12px;min-height:30px}
.kind-badge{display:inline-block;font-size:11px;border:1px solid #171717;padding:1px 6px;background:#f5c8dc;vertical-align:middle;margin-left:6px;font-weight:normal}
.kind-badge.video{background:#dcd2f2}
.weather-art{display:flex;flex-direction:column;align-items:center;justify-content:center;background:linear-gradient(#f7c6d9,#fff);font-size:52px}
.weather-art small{font-size:20px;margin-top:6px}
.video-wrap{position:relative}
.video-wrap .play{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:46px;height:46px;border-radius:50%;background:#fffffff0;border:2px solid #111;display:flex;align-items:center;justify-content:center;font-size:18px;color:#111;pointer-events:none}
video.playlist-art{image-rendering:auto}
dialog.upload{padding:18px;background:#c4c4c4;border:3px outset white;max-width:440px;width:calc(100% - 24px);font:14px monospace;color:#181818}
dialog.upload::backdrop{background:#0005}
dialog.upload h2{font-size:18px;margin:0 0 12px}
dialog.upload .up-preview{display:block;width:100%;max-height:180px;object-fit:contain;background:white;border:2px inset white;margin-bottom:12px}
dialog.upload label{display:block;font-size:12px;margin:10px 0 4px}
dialog.upload input{width:100%;box-sizing:border-box;padding:8px;border:2px inset #eee;font:inherit}
dialog.upload .form-error{margin:12px 0 0;border:2px solid #92365d;padding:8px;font-size:12px;background:#fff}
dialog.upload .form-actions{display:flex;gap:8px;margin-top:14px}
.clip-note{font-size:12px;margin:10px 0 0}
@media(max-width:700px){#showing{padding:18px 13px}.show-heading{align-items:start}.show-heading h1{font-size:22px}.show-heading>button{font-size:12px;min-height:44px}.show-heading p{font-size:12px}.playlist-queue{grid-template-columns:1fr;gap:18px}.playlist-art{aspect-ratio:1.6}.show-now{flex-wrap:wrap;font-size:12px}#playlist-next,.playlist-controls button,.playlist-controls select{min-height:44px}.playlist-arrows button{min-height:30px;padding:3px 10px}.add-group button{min-height:44px;font-size:12px}.weather-toggle{min-height:44px;margin-left:0}.show-under{align-items:start;flex-wrap:wrap}.screen-note{line-height:1.5}}

/* Phone-sized viewports: the window becomes a full-height column so each view fits
   the usable browser viewport. Views scroll internally only when their content
   genuinely exceeds the space. Desktop layout is untouched. */
@media(max-width:700px),(max-height:540px){
html,body{height:100%}
.window{display:flex;flex-direction:column;height:100vh;height:100dvh;margin:0;max-width:none}
.window>header,.window>nav,.window>footer{flex:0 0 auto}
#draw,#templates,#saved,#showing{flex:1 1 auto;min-height:0;height:auto;overflow-y:auto}
#templates,#saved{min-height:0}
#draw{display:flex;flex-direction:column}
#draw iframe{height:auto;flex:1 0 auto;min-height:480px}
#draw .zoom,#draw .actions{flex:0 0 auto}
.actions input,dialog.upload input{font-size:16px}
.actions input{flex-basis:auto}
.window[data-current-view=templates] .nav-actions,.window[data-current-view=saved] .nav-actions,.window[data-current-view=showing] .nav-actions{display:none}
.show-heading{flex-direction:column;align-items:stretch;gap:8px;margin-bottom:10px}
.show-heading h1{margin:0}
.add-group{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;width:100%}
.add-group button{min-height:44px;font-size:11px;padding:4px 2px}
#playlist-current{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#playlist-weather{margin-left:auto}
#playlist-next{margin-left:0}
.show-now{flex-wrap:nowrap;gap:4px}
.show-now button{padding-left:8px;padding-right:8px}
#playlist-state{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#playlist-weather,#playlist-next{flex:0 0 auto;white-space:nowrap}
}

/* Narrow phones: tab labels size to their content and the row wraps instead of
   clipping single-word labels. Touch targets stay >=44px. */
@media(max-width:360px){
nav{flex-wrap:wrap}
nav button{min-width:max-content;padding-left:8px;padding-right:8px}
}
