:root{font-family:'Malgun Gothic','Apple SD Gothic Neo',system-ui,sans-serif;color:#173e3c;background:#fbf7ef;font-synthesis:none;--accent:#176f68;--ink:#173e3c;--muted:#687f76;--line:#dce5da;--mint:#dfefe6}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 3% 0,#e5ead980,transparent 35%),#fbf7ef}button,input,textarea,select{font:inherit;color:inherit}button,summary,select{cursor:pointer}button{touch-action:manipulation;transition:background .16s,box-shadow .16s,transform .16s}button:disabled{opacity:.4;cursor:not-allowed}button:focus-visible,summary:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #76b9aa;outline-offset:3px}[hidden]{display:none!important}input[type=checkbox]{accent-color:var(--accent);width:18px;height:18px}input[type=range]{accent-color:var(--accent);width:100%}input[type=text],textarea,select{border:1px solid var(--line);border-radius:10px;background:#fffdf8;padding:10px 11px;min-width:0;width:100%;outline-offset:2px}input[type=text]:focus,textarea:focus{background:white;border-color:#71a99d}label{font-size:12px;font-weight:700;color:#5b746d}label>input[type=text]{display:block;margin-top:6px;font-size:14px;color:var(--ink);font-weight:500}.app-shell{width:95%;max-width:1880px;margin:0 auto;padding:22px 0 12px}.site-header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px}.brand{display:flex;align-items:center;gap:14px}.brand-mark{width:54px;height:54px;border-radius:18px;background:var(--accent);position:relative;box-shadow:0 4px 0 #b9d7cc;transform:rotate(-6deg)}.brand-mark i{position:absolute;width:19px;height:19px;border:2px solid #ffffffa0;border-radius:50%;background:#ffe3a0;left:9px;top:10px}.brand-mark i:nth-child(2){background:#f2bb82;left:26px;top:19px}.brand-mark i:nth-child(3){background:#d9e9b4;left:12px;top:29px;width:15px;height:15px}.eyebrow{font-size:10px;color:#6c867c;letter-spacing:1.1px;font-weight:800;margin:0 0 5px}.eyebrow span{padding:0 6px}h1{font-size:clamp(24px,2.2vw,37px);font-weight:900;letter-spacing:-1.6px;margin:0;line-height:1.25}h1 span{font-weight:600}h2{font-size:21px;letter-spacing:-.8px;margin:0}.header-tools{display:flex;align-items:center;gap:8px}.button{border:0;border-radius:12px;min-height:44px;padding:10px 16px;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-size:13px;font-weight:700;white-space:nowrap}.light{background:white;border:1px solid var(--line);box-shadow:0 2px 2px #143c3803}.light:hover:not(:disabled){background:#e9f1e8}.primary{background:var(--accent);color:white;box-shadow:0 4px 0 #104e49}.primary:hover:not(:disabled){background:#125b55}.primary:active:not(:disabled){transform:translateY(2px);box-shadow:0 2px 0 #104e49}.header-tools b{font-size:10px;background:var(--mint);color:var(--accent);padding:3px 6px;border-radius:5px}.sound-menu{position:relative}.sound-menu summary{display:flex;gap:8px;align-items:center;list-style:none;min-height:44px;border:1px solid var(--line);border-radius:12px;background:white;padding:10px 15px;font-size:13px;font-weight:700}.sound-menu summary::-webkit-details-marker{display:none}.sound-popover{position:absolute;right:0;top:52px;width:225px;z-index:30;padding:19px;background:white;border:1px solid var(--line);border-radius:17px;box-shadow:0 12px 40px #143c3820;display:grid;gap:9px}.sound-popover label{display:flex;justify-content:space-between;align-items:center}.sound-popover>input{margin-bottom:9px}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 370px;gap:20px}.machine-panel{position:relative;min-width:0;background:#f1f2e7;border:1px solid #d7e3d7;border-radius:28px;overflow:hidden;display:flex;flex-direction:column;background-image:radial-gradient(#bd9d6430 1.1px,transparent 1.1px);background-size:19px 19px}.machine-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:18px 23px 0;z-index:1;font-size:11px;color:#7b8d7d}.live-pill{display:inline-flex;align-items:center;gap:7px;color:#326f60;background:#ffffffb0;border:1px solid white;border-radius:24px;padding:7px 11px;font-size:11px;font-weight:800}.live-pill i{width:6px;height:6px;border-radius:50%;background:#e4a967}.machine-art{position:relative;flex:1;min-height:0;display:flex;justify-content:center;align-items:center}.machine-art canvas{display:block;position:relative;z-index:1;width:100%;height:100%;object-fit:contain;max-height:540px}.orbit{position:absolute;width:63%;aspect-ratio:1;border:1px solid #bad5c575;border-radius:50%;left:18%;top:0;transform:rotate(-15deg)}.orbit-two{width:68%;left:15.5%;top:-4%;border-style:dashed;border-color:#c3d7c365}.spark{position:absolute;color:#6a9c82;font-size:30px;left:11%;top:22%}.spark-two{left:auto;right:11%;top:61%;font-size:38px;color:#d59851}.machine-caption{position:relative;z-index:1;font-size:13px;text-align:center;color:#577b68;margin:-10px 10px 17px;min-height:20px;font-weight:600}.settings-panel{border-radius:24px;border:1px solid var(--line);background:white;overflow:hidden;display:flex;flex-direction:column;min-height:0}.panel-heading{display:flex;justify-content:space-between;align-items:center;padding:20px 21px 15px;border-bottom:1px solid #edf0e6}.save-state{font-size:10px;color:#788779;display:inline-flex;align-items:center;gap:4px}.save-state:before{content:'';width:5px;height:5px;background:#6da184;border-radius:50%}.settings-scroll{padding:16px 21px 8px;overflow:auto;scrollbar-width:thin;scrollbar-color:#c8d6c7 transparent;min-height:0;flex:1}.section-label{font-size:12px;font-weight:800;display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.section-label span{font-size:10px;font-weight:400;color:#819080}.slot-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px}.slot-tab{background:#f6f8ed;border:1px solid var(--line);border-radius:9px;padding:8px 11px;min-height:36px;font-size:12px;color:#5f7f6d;font-weight:700;max-width:100%;overflow-wrap:anywhere}.slot-tab.active{background:var(--accent);color:white;border-color:var(--accent)}.slot-tab.add{border-style:dashed;min-width:34px}.slot-fields,.prefix-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.slot-actions{display:flex;margin:3px 0 12px;gap:8px}.slot-actions .danger{margin-left:auto}.text-button{border:0;background:transparent;color:#286f60;font-size:11px;padding:5px 0;min-height:32px;font-weight:600}.text-button:hover:not(:disabled){color:var(--accent);text-decoration:underline}.danger{color:#b66c54}.muted{color:#8a9989}.candidates-heading{margin-top:8px}.candidate-list{display:grid;gap:6px;max-height:180px;overflow:auto;scrollbar-width:thin;padding:1px 3px 2px 1px}.candidate-row{display:flex;align-items:center;gap:7px;min-width:0}.candidate-dot{border:1px solid #ffffffcc;border-radius:50%;min-width:32px;width:32px;height:32px;padding:0;display:grid;place-items:center;font-size:14px;box-shadow:inset 0 -3px 4px #305e4612,0 2px 3px #305e4610}.candidate-dot img{width:24px;height:24px;object-fit:contain;border-radius:50%}.candidate-row input{min-width:0;flex:1;background:#fcfaf4;border:1px solid #e8eadf;font-size:13px;padding:8px 10px;height:36px}.delete-item{border:0;background:transparent;font-size:17px;color:#a0afa0;width:24px;min-width:24px;height:32px}.candidate-actions{display:flex;align-items:center;gap:9px;margin-top:10px;flex-wrap:wrap}.small{padding:6px 10px;min-height:32px;font-size:11px}.candidate-actions .danger{margin-left:auto}.duplicate-notice{border-radius:8px;background:#fff0d9;padding:7px 9px;font-size:11px;color:#9a6638;margin-top:9px;display:flex;align-items:center;justify-content:space-between}.prefix-fields{margin-top:16px;border-top:1px solid #e9ede0;padding-top:13px}.prefix-fields input{font-size:12px}.settings-bottom{display:flex;justify-content:space-between;gap:10px;margin-top:8px}.sentence-panel{margin-top:18px;border:1px solid var(--line);border-radius:22px;background:white;padding:15px 24px 20px;min-height:120px}.sentence-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:11px;color:#748977;font-weight:700;margin-bottom:12px}.sentence-line{text-align:center;font-weight:800;font-size:clamp(23px,2.5vw,41px);line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;color:#234f46}.sentence-line .connector{font-weight:500;color:#426a5b}.result-word{display:inline;box-decoration-break:clone;-webkit-box-decoration-break:clone;border-radius:12px;padding:6px 13px;background:var(--card,#dfefe6);color:#173e3c;position:relative}.result-word.placeholder{font-size:.78em;box-shadow:inset 0 0 0 1px #b9cfb66b;color:#6f8b73;background:#f0f5e8}.result-word.pending{background:#f0f3e8;color:#8ca08a;box-shadow:inset 0 0 0 1px #d6dfc9}.result-word.current{box-shadow:inset 0 0 0 2px #4e9a79;color:#4f886d}.result-word img{display:inline-block;width:1.1em;height:1.1em;object-fit:contain;vertical-align:-.15em;margin-right:.15em}.main-actions{display:flex;gap:9px}.start-button{font-size:20px;padding:13px 38px;min-width:225px;border-radius:15px;min-height:55px}.start-button span{font-size:15px}footer{margin-top:23px;display:flex;justify-content:space-between;color:#94a28b;font-size:10px}footer b{font-size:10px;letter-spacing:2px;margin-right:10px;color:#668467}.workspace.playing{grid-template-columns:1fr}.workspace.playing .machine-panel{min-height:400px}.workspace.playing .machine-art canvas{max-width:1050px}.workspace.playing .orbit{width:390px;left:calc(50% - 195px)}.workspace.playing .orbit-two{width:430px;left:calc(50% - 215px)}.workspace.playing .spark-one{left:25%}.workspace.playing .spark-two{right:25%}.sentence-panel.finished{background:#fffdf5;border-color:#d4bc84;box-shadow:0 5px 24px #d8b36a0b}.sentence-panel.finished .sentence-heading{color:#937035}.reveal-card{position:absolute;z-index:4;top:50%;right:4%;transform:translateY(-50%);width:min(33%,270px);background:#fffffff5;border:2px solid white;border-radius:24px;padding:20px;box-shadow:0 12px 40px #2b684b22;text-align:center;overflow-wrap:anywhere}.reveal-card small{font-size:12px;color:#5e896e;display:block;margin-bottom:8px}.reveal-card strong{font-size:clamp(18px,2.2vw,32px);line-height:1.4;display:block}.reveal-card img{width:64px;height:64px;object-fit:contain}.reveal-card #revealPicture{font-size:42px}.pause-cover{position:absolute;inset:0;z-index:8;background:#edf2e399;backdrop-filter:blur(4px);display:flex;flex-direction:column;align-items:center;justify-content:center;color:#276950}.pause-cover>span{font-size:52px}.pause-cover b{font-size:26px}.pause-cover p{font-size:13px}.batch-results{margin-top:25px;background:white;border:1px solid var(--line);padding:25px;border-radius:24px}.batch-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.batch-heading h2{font-size:20px}.batch-heading h2 span{color:#b98b3b}.batch-results ol,#historyList{padding-left:30px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}.batch-results li,#historyList li{padding:12px 10px;border-bottom:1px solid #e5ecdc;font-size:20px}.batch-results li::marker,#historyList li::marker{color:#7fa17a;font-weight:700;font-size:13px}.batch-results li:last-child,#historyList li:last-child{border:0}dialog{border:1px solid var(--line);border-radius:24px;padding:25px;color:var(--ink);width:470px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 30px);overflow:auto;box-shadow:0 20px 80px #163f2d38}dialog::backdrop{background:#173f3460;backdrop-filter:blur(5px)}.dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.close-button{width:36px;min-width:36px;height:36px;border:0;background:#eff4e7;color:#7e9e7b;border-radius:50%;font-size:25px}.dialog-help{font-size:13px;line-height:1.7;color:#72876e;margin:12px 0 20px}dialog label{display:block;margin-top:15px}dialog textarea{resize:vertical;line-height:1.8;min-height:180px}.dialog-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:22px}.palette{display:flex;gap:10px;margin-top:20px}.palette button{width:36px;height:36px;border:3px solid white;border-radius:50%;box-shadow:0 0 0 1px #dde7d3}.palette button.selected{box-shadow:0 0 0 3px #5b986c}.image-upload input{margin-top:10px;width:100%;font-size:12px}.image-preview img{max-width:100%;max-height:110px;margin-top:10px;object-fit:contain}.toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);z-index:100;background:#285744;color:white;padding:13px 20px;border-radius:13px;font-size:13px;max-width:calc(100vw - 24px);box-shadow:0 8px 30px #153d2820;white-space:pre-wrap}.expanded-view{position:fixed;inset:0;z-index:50;background:#fbf7ef;overflow:auto;width:100%;padding:20px 2.5%}:fullscreen{background:#fbf7ef}.flying-result{position:fixed;z-index:45;border-radius:22px;background:var(--card);box-shadow:0 8px 25px #39674630;border:3px solid white;padding:14px 20px;max-width:280px;font-size:22px;font-weight:800;text-align:center;overflow-wrap:anywhere;pointer-events:none}.flying-result img{width:32px;height:32px;object-fit:contain;vertical-align:middle;margin-right:8px}
@media(min-width:1100px) and (min-height:650px){.app-shell{padding-top:18px}.site-header{margin-bottom:17px}.workspace{height:calc(100dvh - 335px);min-height:385px;max-height:690px}.workspace.playing .machine-panel{min-height:0}.machine-art canvas{position:absolute;inset:0;max-height:none}.machine-caption{margin:0 10px 14px}.machine-heading{padding-top:14px}.sentence-panel{margin-top:16px}footer{margin-top:18px}}
@media(min-width:1600px){.workspace{grid-template-columns:minmax(0,1fr) 425px;gap:24px}.settings-scroll{padding:20px 25px}.panel-heading{padding:23px 25px}.candidate-list{max-height:290px}.candidate-row input{font-size:15px;height:40px}.slot-tab{font-size:13px;padding:10px 15px}.settings-panel h2{font-size:25px}.section-label{font-size:14px}.settings-scroll label{font-size:13px}.machine-caption{font-size:16px}.machine-heading{font-size:13px}.live-pill{font-size:13px}.sentence-panel{padding:20px 30px 26px;min-height:145px}.start-button{font-size:23px;min-width:270px;min-height:61px}}
@media(max-width:1099px){.workspace{grid-template-columns:minmax(0,1fr) 330px;gap:14px}.machine-panel{min-height:470px}.machine-art{height:370px}.settings-panel{max-height:525px}.panel-heading{padding:18px 16px}.settings-scroll{padding:15px 16px}.start-button{min-width:190px;padding-inline:24px}.machine-heading{padding-inline:15px}.machine-heading>span:last-child{max-width:110px;text-align:right;font-size:10px}.header-tools .button{padding-inline:12px}.site-header{gap:12px}.reveal-card{right:2%;width:40%;padding:13px}}
@media(max-width:760px){.app-shell{width:93%;padding-top:16px}.site-header{flex-wrap:wrap;gap:16px}.brand-mark{width:45px;height:45px;transform:none}.brand-mark i{transform:scale(.85);transform-origin:left top}.brand{gap:10px}.eyebrow{font-size:8px;letter-spacing:.6px}h1{font-size:24px;letter-spacing:-1.2px}.header-tools{width:100%;justify-content:flex-end;gap:7px}.header-tools .button,.sound-menu summary{font-size:11px;min-height:40px;padding:9px 12px}.header-tools #historyButton{margin-right:auto}.workspace{grid-template-columns:1fr;gap:16px}.machine-panel{min-height:0;border-radius:23px}.machine-art{height:330px}.machine-art canvas{position:absolute;inset:0}.machine-heading{padding:14px 15px 0}.machine-heading>span:last-child{max-width:none}.machine-caption{font-size:12px;margin:-5px 12px 15px}.settings-panel{max-height:none;border-radius:22px}.settings-scroll{overflow:visible;padding:16px 20px}.panel-heading{padding:18px 20px}.candidate-list{max-height:210px}.candidate-row input{min-height:42px;font-size:14px}.candidate-dot{width:38px;height:38px;min-width:38px}.delete-item{width:34px;min-width:34px;height:40px}.slot-tab{min-height:40px}.candidate-actions .button,.text-button{min-height:38px}.sentence-panel{padding:14px 17px 20px}.sentence-heading{font-size:10px;align-items:flex-start}.sentence-line{font-size:25px;line-height:2}.result-word{padding:5px 8px;border-radius:9px}.main-actions{width:100%;flex-wrap:wrap}.main-actions .start-button{flex:1}.main-actions #pauseButton{flex:1;font-size:17px}.main-actions #cancelButton{font-size:12px}.workspace.playing .machine-panel{min-height:0}.workspace.playing .machine-art{height:350px}.workspace.playing .orbit{width:280px;left:calc(50% - 140px)}.workspace.playing .orbit-two{width:310px;left:calc(50% - 155px)}.workspace.playing .spark-one{left:9%}.workspace.playing .spark-two{right:8%}.reveal-card{right:3%;width:42%;padding:12px;border-radius:18px}.reveal-card strong{font-size:20px}.reveal-card #revealPicture{font-size:30px}.reveal-card img{width:42px;height:42px}footer{line-height:1.8;flex-direction:column;gap:5px;font-size:9px}.batch-results{padding:18px}.batch-heading{align-items:flex-start}.batch-heading h2{font-size:17px}.batch-heading .button{font-size:10px;padding:8px}.batch-results li{font-size:18px}.flying-result{font-size:18px;max-width:180px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
.machine-art canvas{margin:auto}.reveal-card{max-height:calc(100% - 20px);overflow:auto;scrollbar-width:thin}.flying-result{max-height:240px;overflow:auto}
.result-word{display:inline-block;max-width:100%;vertical-align:middle;line-height:1.35}
@media(min-width:1100px) and (min-height:650px){.workspace{height:calc(100dvh - 349px)}}
@media(max-width:760px){.machine-art{flex:none;height:330px}.workspace.playing .machine-art{height:350px}}
/* Settings place the preview above the drum. The drawing view puts its result below. */
.app-shell[data-view=settings] .sentence-panel {margin: 0 0 16px; min-height: 0;}
@media(min-width:1100px) and (min-height:560px){
 .app-shell{height:100dvh;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:12px;padding-top:16px;padding-bottom:10px}
 .site-header{margin:0;min-width:0}.app-shell>main{min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px}
 .app-shell[data-view=settings] .sentence-panel {margin:0;}
 .workspace{height:auto;min-height:0;max-height:none}.workspace .machine-panel,.workspace.playing .machine-panel{min-height:0}.settings-panel{max-height:none}
 .machine-art{height:auto;min-height:0}.machine-art canvas{position:absolute;inset:0;max-height:none}.machine-caption{margin:0 12px 12px}.machine-heading{padding-top:12px}
 .sentence-panel{margin:0;min-height:0;max-height:30dvh;overflow:auto;scrollbar-width:thin;padding:16px 24px}.sentence-heading{margin-bottom:9px}.sentence-panel.finished{padding-block:18px}
 footer{margin:0;min-width:0;line-height:1.4}
 .batch-results{margin:0;min-height:0;padding:12px 20px;overflow:auto;scrollbar-width:thin}.batch-heading{position:sticky;top:-12px;background:white;padding-block:6px;z-index:1}.batch-results ol{margin:4px 0}
}
@media(min-width:1100px) and (max-height:700px){.app-shell{gap:9px;padding-top:12px;padding-bottom:8px}.app-shell>main{gap:9px}.sentence-panel{padding:12px 20px}.sentence-panel.finished{padding-block:12px}.sentence-line{font-size:clamp(23px,2.25vw,34px)}.site-header .brand-mark{height:47px;width:47px}.site-header h1{font-size:28px}}
/* Classroom actions remain at the same top-centre position in every phase. */
.site-header{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:16px}
.site-header .brand{min-width:0;justify-self:start}.site-header .main-actions{justify-self:center;justify-content:center}.site-header .header-tools{justify-self:end}
footer{justify-content:flex-end}
@media(min-width:1100px) and (min-height:560px){.app-shell[data-view=run]>main{grid-template-rows:minmax(0,1fr) auto}.app-shell.has-batch[data-view=run]>main{grid-template-rows:minmax(0,1fr) auto minmax(100px,18dvh)}}
@media(min-width:1100px) and (max-width:1279px){.site-header{gap:10px}.site-header .brand{gap:10px}.site-header .brand-mark{width:40px;height:40px;flex-shrink:0}.site-header h1{font-size:22px}.site-header .eyebrow{font-size:8px;letter-spacing:.5px}.site-header .main-actions .start-button{min-width:170px;padding-inline:22px;font-size:19px}.site-header .header-tools .button,.site-header .sound-menu summary{padding-inline:10px;font-size:12px}}
@media(max-width:1099px){.site-header{grid-template-columns:minmax(0,1fr) auto;gap:14px}.site-header .main-actions{grid-column:1/-1;grid-row:2}.site-header .header-tools{grid-column:2;grid-row:1}.site-header h1{font-size:24px}}
@media(max-width:760px){.site-header{grid-template-columns:minmax(0,1fr);gap:13px}.site-header .brand{grid-row:1}.site-header .main-actions{grid-column:1;grid-row:2;width:100%;justify-content:center}.site-header .main-actions .start-button,.site-header .main-actions #pauseButton{flex:0 1 auto}.site-header .header-tools{grid-column:1;grid-row:3;width:100%}footer{align-items:flex-end}}
/* Wagle workshop: sea-glass enamel, apricot accents and warm paper. */
body{background:radial-gradient(ellipse at 4% 0,#e4ecda90,transparent 40%),#fbf7ef}
.brand-mark{transform:rotate(0);border-radius:18px;background:#176f68;box-shadow:0 4px 0 #bed3c0;border:1px solid #0b5a50}
.brand-mark i{background:#ffdb8c}.brand-mark i:nth-child(2){background:#ffbd8d}.brand-mark i:nth-child(3){background:#c7e4b3}
h1{color:#173e3c}.eyebrow{color:#68856d}.primary .start-button,.start-button>span{color:#ffdc9a}
.machine-panel{border:1px solid #cad9c8;background-color:#eef2e5;background-image:radial-gradient(#b4c7a847 1px,transparent 1px),radial-gradient(ellipse at 93% 100%,#f6dfb877,transparent 45%);background-size:20px 20px,100% 100%}
.live-pill{background:#fffdf2;border-color:#e6d8b9;color:#356d55}.live-pill i{background:#dc9e58}
.machine-art canvas,.workspace.playing .machine-art canvas{position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;object-fit:fill}
.workspace.playing .reveal-card{top:3%;right:3%;max-height:40%;transform:none}
@media (min-width:1100px) and (min-height:560px) {
  .machine-heading {position:absolute;inset:0 0 auto;z-index:2;pointer-events:none;}
  .workspace.playing .reveal-card {top: max(46px, 3%);}
}
.workspace.playing .machine-art{overflow:hidden;isolation:isolate;background:radial-gradient(ellipse at 48% 36%,#fffaf0 0%,#edf3e8 55%,#d5e7db 100%);box-shadow:inset 0 1px #b6ccc2,inset 0 -1px #b6ccc2}
.workspace.playing .machine-art::before{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse at 48% 53%,#ffe9b7 0,transparent 56%),linear-gradient(115deg,#2474652b,transparent 36%,transparent 72%,#de9b5929);opacity:0;transition:opacity .4s}
.workspace.playing[data-shot="exit"] .machine-art::before,.workspace.playing[data-shot="reveal"] .machine-art::before{opacity:.92}
@media(prefers-reduced-motion:reduce){.workspace.playing .machine-art::before{transition:none}}
.settings-panel,.sentence-panel,.batch-results{background:#fffef9}.panel-heading{background:#f8f8ed;border-bottom-color:#e5e8d5}
.slot-tab.active{background:#176f68;border-color:#176f68}.settings-scroll{scrollbar-color:#c9d6bc transparent}
.sentence-panel{border-color:#d9e3ce}.sentence-panel.finished{background:#fff8e7;border:2px solid #ceaa68;box-shadow:inset 0 5px 0 #f6dfad,0 3px 0 #e5d4aa}
.result-word{color:#173e3c;border-radius:12px;font-weight:900;box-shadow:inset 0 -3px 0 #173e3c0b}
.sentence-panel.finished .sentence-line{font-size:clamp(52px,5vw,96px);font-weight:900;line-height:1.62;letter-spacing:-.045em;color:#173e3c}
.sentence-panel.finished .connector{font-weight:750;color:#305c50;letter-spacing:-.04em}
.sentence-panel.finished .sentence-line {
  word-break: keep-all;
  text-wrap: balance;
}
.result-phrase {
  display: inline-block;
  max-inline-size: 100%;
  overflow-wrap: anywhere;
}
.sentence-panel.finished .result-word{padding:7px 16px;border-radius:14px;line-height:1.3;letter-spacing:-.045em}
.batch-results li,#historyList li{color:#254d3d;font-size:clamp(22px,1.9vw,34px);font-weight:750;line-height:1.6}
.batch-heading{background:#fffef9}.sound-popover,dialog{background:#fffef9}.pause-cover{background:#edf2e3b8}.palette button{box-shadow:0 0 0 1px #d9dfca}.palette button.selected{box-shadow:0 0 0 3px #176f68}
@media(min-width:1100px) and (min-height:560px){.sentence-panel.finished{max-height:42dvh;padding:20px 28px}.app-shell.has-batch .sentence-panel.finished{max-height:31dvh}}
@media(max-width:760px){.sentence-panel.finished{padding:20px 14px}.sentence-panel.finished .sentence-line{font-size:clamp(38px,10.8vw,52px);line-height:1.75;letter-spacing:-.05em}.sentence-panel.finished .result-word{padding:6px 10px;border-radius:12px}.batch-results li,#historyList li{font-size:23px}}

/* Editable words stay in sentence order; literal spaces belong to their own phrase. */
#sentenceTitle {font-size: 14px; color: #426558;}
.app-shell[data-view=settings] .sentence-panel:not(.is-editing) {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr) 6rem;
  align-items: center;
  padding-block: 6px;
}
.app-shell[data-view=settings] .sentence-panel:not(.is-editing) .sentence-heading {
  margin: 0;
}
.app-shell[data-view=settings] .sentence-line {
  font-size: clamp(26px, 2.85vw, 47px);
  line-height: 1.35;
}
@media (min-width: 1100px) and (max-height: 700px) {
  .app-shell[data-view=settings] .sentence-line {font-size: clamp(26px, 2.6vw, 39px);}
}
@media (max-width: 760px) {
  .app-shell[data-view=settings] .sentence-line {font-size: 28px;}
  .app-shell[data-view=settings] .sentence-panel:not(.is-editing) {
    grid-template-columns: minmax(0, 1fr);
  }
}
.preview-toggle {
  min-height: 34px;
  flex: none;
  border: 1px solid var(--accent);
  border-radius: 9px;
  padding: 5px 12px;
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 700;
}
.preview-toggle:hover {background: #125b55;}
.preview-piece {
  appearance: none;
  max-inline-size: 100%;
  vertical-align: middle;
  white-space: break-spaces;
  overflow-wrap: anywhere;
  border: 0;
  cursor: text;
}
.preview-piece.connector {
  padding: 0;
  border-radius: 5px;
  background: transparent;
  line-height: 1.45;
}
.preview-piece.result-word {color: #4c6e59;}
.preview-piece.result-word.placeholder {font-size: .82em;}
.preview-piece:hover,
.preview-piece:focus-visible {
  background: #e2f0e6;
  color: #15594f;
  text-decoration: underline dotted;
  text-underline-offset: .14em;
  text-decoration-thickness: 1px;
}
.sentence-panel.is-editing {border-color: #a6c6b9;}
.preview-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: center;
  gap: 12px 8px;
  padding: 3px;
}
.preview-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  min-width: 0;
  max-width: min(100%, 18rem);
}
.preview-field > span {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.3;
  color: #546e60;
}
.preview-field input[type=text] {
  width: 7.5em;
  max-width: 100%;
  margin: 0;
  min-height: 44px;
  padding: 7px 10px;
  border-color: #c4d4c7;
  background: #fffefb;
  color: var(--ink);
  font-size: clamp(16px, 1.2vw, 21px);
  line-height: 1.45;
}
.preview-field[data-part=candidate] input {background: #edf5e9; font-weight: 700;}
.preview-field input::placeholder {color: #687e71; font-weight: 400;}
.preview-field:focus-within > span {color: #15594f;}
.preview-field input:focus {outline: 2px solid #368578; outline-offset: 1px; background: white;}
@supports (field-sizing: content) {
  .preview-field input[type=text] {field-sizing: content; width: auto; min-width: 4.6em;}
  .preview-field[data-part=candidate] input {min-width: 6em;}
}
@media (max-width: 760px) {
  .sentence-heading {align-items: center;}
  .preview-toggle {min-height: 44px;}
  .preview-editor {display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);}
  .preview-field {max-width: none;}
  .preview-field[data-part=prefix], .preview-field[data-part=suffix] {grid-column: 1 / -1;}
  .preview-field input[type=text] {width: 100%; min-width: 0;}
}

.draw-settings {
  margin: 0 0 15px;
  border: 1px solid #cddccd;
  border-radius: 12px;
  background: #f6f9f0;
}
.draw-settings > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: inherit;
  color: #285f50;
  font-size: 14px;
  font-weight: 750;
  list-style: none;
}
.draw-settings > summary::-webkit-details-marker {display: none;}
.draw-settings > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0 2px 4px 0;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.draw-settings[open] > summary::after {transform: rotate(225deg); margin-block: 4px 0;}
.draw-settings > summary:hover {background: #edf4e9;}
.draw-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 6px 10px;
  margin: 0 12px;
  padding: 12px 0 7px;
  border-top: 1px solid #d3dfd1;
}
.draw-options > label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #45674f;
  font-size: 13px;
}
.draw-options select {
  min-height: 42px;
  padding: 6px 8px;
  background: #fffef9;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}
.draw-options .repeat-label {
  display: flex;
  align-items: center;
  word-break: keep-all;
  gap: 7px;
  min-height: 42px;
  cursor: pointer;
}
.draw-options .repeat-label input {margin: 0; flex: none;}

.collection-link {
  display: inline-block;
  color: #185b53;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.collection-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
