:root{color-scheme:dark}*{box-sizing:border-box}body{margin:0;background:#101611;color:#e2e9d9;font:16px/1.5 system-ui,sans-serif}main{max-width:900px;margin:auto;padding:20px}header,nav,.row,.settings{display:flex;flex-wrap:wrap;gap:12px}header{justify-content:space-between}a{color:#f4b362}h1{font-size:clamp(28px,5vw,44px)}h2{margin-top:0}.eyebrow{color:#b9c590;font:12px ui-monospace,monospace;letter-spacing:2px}section{position:relative;margin:20px 0;padding:20px;background:#1c281c;border:1px solid #69794d;border-radius:10px;box-shadow:inset 0 0 0 3px #111910,inset 0 0 0 4px #455339}label{display:block;margin:12px 0}.settings label{flex:1;min-width:150px}input:not([type=checkbox]),select{display:block;width:100%;padding:10px;background:#101b12;border:1px solid #758551;color:#e5edda;font:inherit;border-radius:5px}button{min-height:44px;padding:10px 16px;border:1px solid #758551;border-radius:6px;background:#c4d17d;color:#142016;font:600 15px system-ui;cursor:pointer;box-shadow:0 3px 0 #080e08}button:disabled{opacity:.5;cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #f4b362;outline-offset:4px}.pads button{flex:1;min-height:70px;touch-action:none;user-select:none}.mono{font:16px/1.7 ui-monospace,monospace;overflow-wrap:anywhere}#decoded{display:block;min-height:65px;font:700 26px/1.4 ui-monospace,monospace;overflow-wrap:anywhere;max-height:200px;overflow:auto}#symbols{min-height:24px;max-height:80px;overflow:auto;color:#d8c178}#lamp{float:right;width:18px;height:18px;border-radius:50%;background:#3b4935}#lamp.on{background:#ffb24d;box-shadow:0 0 14px #ffb24d}meter{display:block;width:100%;height:24px}.code{border-top:1px solid #455339;padding:14px 0}.code h3{margin:0}.code p{margin:5px 0}.code small{color:#c1ccb3}.code .row{margin-top:10px}#status{min-height:24px}nav{position:sticky;top:0;background:#101611;padding:12px 0;z-index:1}section{scroll-margin-top:70px}@media(max-width:480px){main{padding:12px}section{padding:16px}header{font-size:14px}.row button{flex:1}}

.mouse-key{min-height:90px;margin-top:16px;display:grid;place-items:center;border:2px solid #f4b362;border-radius:12px;background:#101b12;text-align:center;padding:16px;font-weight:700;user-select:none;touch-action:none}.mouse-key:active{background:#455339}

[hidden]{display:none!important}main{max-width:900px}h1{font-size:clamp(24px,4vw,34px);margin:8px 0}.desk-intro{margin:6px 0 14px;color:#bbc9b3}.freehand-station{padding:18px;margin:12px 0}.station-controls{display:grid;grid-template-columns:1.3fr 1fr 100px;gap:10px}.station-controls label{font-size:12px;margin:0}.station-controls select,.station-controls input{font-size:14px;min-height:44px;padding:8px}.readout{background:#101b12;border:1px solid #455339;border-radius:8px;margin:14px 0;padding:12px}.readout .eyebrow{margin:0 0 4px}#decoded{font-size:24px;min-height:42px;max-height:100px}#symbols{margin:4px 0 0;min-height:27px;max-height:55px}.station-actions{gap:7px}.station-actions button{font-size:12px;padding:8px 10px}.mouse-key{margin-top:12px;min-height:90px}.pads{margin-top:12px}#key-help,#status{font-size:12px;margin:8px 0;line-height:1.45}.station-settings{border:1px solid #455339;border-radius:8px;margin:12px 0;padding:10px 12px;background:#182219}.station-settings summary,.reference-panel>summary{cursor:pointer;min-height:32px;font-weight:600}.station-settings p,.station-settings li{font-size:13px}.reference-panel{margin-top:16px}.desk-note{color:#b5c2ab;font-size:12px}#mic-controls{margin-top:12px}#mic-controls label{font-size:12px}@media(max-width:480px){main{padding:10px}.freehand-station{padding:12px}.station-controls{grid-template-columns:1fr 1fr 72px;gap:6px}.station-controls select{font-size:12px}.station-actions button{flex:1;padding:7px 6px;font-size:11px}header{font-size:12px}.desk-intro{font-size:13px}#decoded{font-size:21px}.mouse-key{font-size:14px;padding:10px}}

/* Keep keying primary and clipboard tools secondary. */
.station-actions{margin-top:12px}.station-actions button{font-size:14px;padding:10px 16px}.copy-tools{gap:8px;justify-content:flex-end}.copy-tools button{background:transparent;color:#b9c590;border:1px solid #455339;box-shadow:none;font-size:12px;padding:5px 10px;min-height:36px}.copy-tools button:hover{background:#293725;color:#e2e9d9}.readout{margin-bottom:8px}#use-draft{margin-top:10px}@media(max-width:480px){.station-actions button{flex:0 1 auto;font-size:14px;padding:10px 16px}.copy-tools button{flex:0 1 auto;min-height:44px}}

.freehand-station{--screen-bg:#0c1b10;--screen-ink:#cfe5b5}.freehand-station[data-screen="amber"]{--screen-bg:#231b0b;--screen-ink:#ffd588}.freehand-station[data-screen="gray"]{--screen-bg:#182129;--screen-ink:#e0e8ef}.readout,.mouse-key{background:var(--screen-bg);color:var(--screen-ink)}.readout{margin-top:0;min-height:130px}#symbols{color:var(--screen-ink)}.mouse-key{min-height:80px;margin-top:8px}.desk-intro{font-size:13px}.station-settings .station-controls{margin-top:14px}

.scratch-screen{display:block;text-align:left;padding:14px;min-height:200px;margin:0;border-radius:10px 10px 0 0;border-color:#69794d;cursor:default}.scratch-screen.keyable{cursor:crosshair}.scratch-screen .readout{border:0;padding:0;margin:0;min-height:145px;background:transparent}.scratch-screen:active{background:var(--screen-bg)}#mouse-hint{font-size:12px;font-weight:400;color:#b9c590;margin:8px 0 0;text-align:center}#decoded::after,#latest-decoded::after{content:"";display:inline-block;width:10px;height:1em;background:var(--screen-ink);margin-left:4px;vertical-align:-2px;animation:cursor-blink 1.1s step-end infinite}@keyframes cursor-blink{50%{opacity:0}}@media(prefers-reduced-motion:reduce){#decoded::after,#latest-decoded::after{animation:none}}.clear-bar{display:block;width:100%;min-height:36px;padding:6px;border-radius:0 0 8px 8px;background:#293725;color:#bccba7;font-size:12px;letter-spacing:1px;box-shadow:none;border-color:#69794d;border-top:0}.clear-bar:hover{background:#394b30}.station-settings .copy-tools{margin:12px 0}@media(max-width:480px){.scratch-screen{padding:12px;min-height:200px}.clear-bar{min-height:44px}}

.scratch-screen{place-items:normal}.scratch-screen .readout{width:100%;text-align:left}

.practice-target{position:relative;border-left:3px solid #c4d17d;background:#152016;padding:10px 36px 10px 12px;margin-bottom:12px;border-radius:6px}.practice-target .eyebrow{margin:0 0 4px;font-size:10px}.practice-target strong{font-size:16px}.practice-target p{margin:4px 0;font-size:12px;line-height:1.4}.practice-target #target-morse{font-size:18px;letter-spacing:0;color:#ead78e}.dismiss-target{position:absolute;right:2px;top:2px;width:32px;min-height:36px;padding:0;font-size:22px;background:transparent;color:#bbc9b3;border:0;box-shadow:none}@media(max-width:480px){.dismiss-target{width:44px;min-height:44px}.practice-target{padding-right:44px}}

.practice-target{padding:8px 12px 10px}.reference-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:4px}.reference-heading .eyebrow{margin:0;letter-spacing:1.5px}.reference-actions{display:flex;align-items:center;gap:2px;flex-shrink:0}.reference-actions button{min-height:36px;box-shadow:none;background:transparent;color:#dce59c}.reference-actions .dismiss-target{position:static;width:36px;padding:0}.listen-target{padding:4px 8px;font-size:12px;border-color:#455339}.listen-target:hover{background:#293725}@media(max-width:480px){.reference-actions button{min-height:44px}.reference-actions .dismiss-target{width:44px}.reference-heading .eyebrow{font-size:9px;letter-spacing:1px}}

.pads button{-webkit-touch-callout:none;-webkit-user-select:none;touch-action:none}

/* Preserve the word space beside the cursor and in copied text. */
#decoded{white-space:pre-wrap}

/* Keep thumb presses from selecting nearby play text or opening iOS callouts.
   Scope this to the activity; settings/search remain editable and page scrolling
   and zoom are not disabled. Explicit Copy actions remain in Settings. */
.practice-target,.scratch-screen,.clear-bar,.pads,.freehand-station button,.freehand-station button *,#key-help,#status,#external-ready{
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
}

#input-hint{font:400 13px/1.45 system-ui,sans-serif;margin:8px 0 0;color:var(--screen-ink);opacity:.85;pointer-events:none}

.pads button.key-down{background:#f4b362;box-shadow:inset 0 3px 0 #405038;transform:translateY(2px)}

#calibration button{min-height:44px}#calibration-prompt{font-size:20px;letter-spacing:2px}#calibration-morse{font-size:17px;overflow-wrap:anywhere}#calibration .row{flex-wrap:wrap}#timing-sync{color:#d4dc9a}#manual-timing h3{margin-top:12px}

.station-settings summary,.station-settings label,.station-settings p,.station-settings h3{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.station-settings input,.station-settings textarea{user-select:text;-webkit-user-select:text}

.beta-label{font:600 13px system-ui;border:1px solid #f4b362;border-radius:5px;padding:3px 7px;color:#f4b362;vertical-align:middle}#symbols,#target-morse{white-space:pre-wrap}

#coach-panel input,#coach-panel select{min-height:44px;width:100%;max-width:100%;font-size:16px;user-select:text;-webkit-user-select:text}#coach-panel button{min-height:44px}#coach-panel .row{flex-wrap:wrap;gap:6px}#coach-panel p{font-size:13px}#coach-feedback,#coach-nudge{color:#f4b362}#coach-panel label{font-size:13px}#coach-panel .reference-heading button{font-size:12px;padding:4px 8px}.coaching .scratch-screen{min-height:100px}.coaching .scratch-screen .readout{min-height:75px}.coaching #input-hint,.coaching #key-help,.coaching #coach-open,.coaching #practice-target{display:none}

/* Coaching is a distinct full-width action below the sending key. */
#coach-open{display:block;width:100%;margin:12px 0 4px;min-height:48px;background:#293725;color:#e2e9d9;border-color:#758551;touch-action:manipulation}
#coach-panel .row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
#coach-panel .row button{width:100%}

.coach-reference{margin:12px 0;padding:10px;border:1px solid #687b49;border-radius:8px}#coach-morse{white-space:pre-wrap;overflow-wrap:anywhere;font-size:20px;letter-spacing:2px;margin:8px 0}

body.radio-embed main>h1,body.radio-embed main>.eyebrow,body.radio-embed main>.small,body.radio-embed .desk-intro{display:none}body.radio-embed main{padding:8px}body.radio-embed #use-draft{width:100%;min-height:44px}

body.radio-embed #coach-open,body.radio-embed #coach-nudge{display:none}

/* Live radio embeds only the actual key. Setup grows when deliberately opened. */
body.live-radio-embed{margin:0;background:transparent}body.live-radio-embed main{padding:0;max-width:none}
body.live-radio-embed header,body.live-radio-embed #clear,body.live-radio-embed #use-draft,body.live-radio-embed .reference-panel,body.live-radio-embed .desk-note,body.live-radio-embed #input-hint,body.live-radio-embed #key-help,body.live-radio-embed #decode-hint,body.live-radio-embed #external-ready,body.live-radio-embed #manual-timing,body.live-radio-embed .copy-tools,body.live-radio-embed #straight-timing-help{display:none!important}
body.live-radio-embed .freehand-station{padding:8px;margin:0;border-radius:8px}
body.live-radio-embed .scratch-screen{min-height:48px;padding:8px}body.live-radio-embed .scratch-screen .readout{min-height:32px;max-height:64px;overflow:auto}
body.live-radio-embed #decoded{font-size:18px}body.live-radio-embed #symbols{font-size:14px}body.live-radio-embed #screen-pads button{min-height:68px;font-size:20px}
body.live-radio-embed #status{font-size:12px;margin:4px 0}body.live-radio-embed .station-settings{margin:4px 0;padding:4px 8px}
body.live-radio-embed .station-settings summary{min-height:40px;padding:8px 0}body.live-radio-embed.radio-paused #screen-pads{opacity:.55}

body.live-radio-embed #decoded{min-height:24px;max-height:32px;margin:0}body.live-radio-embed #symbols{min-height:18px;max-height:22px;margin:0}body.live-radio-embed .scratch-screen .eyebrow{display:none}body.live-radio-embed .pads{margin-top:8px}

/* Build 63: the conversation owns the copy; embed only the input surface. */
body.chat-radio-embed .freehand-station{padding:4px;border:0;box-shadow:none;background:transparent}
body.chat-radio-embed .scratch-screen:not(.keyable),body.chat-radio-embed #status{display:none!important}
body.chat-radio-embed .pads{margin-top:0}body.chat-radio-embed #screen-pads button{min-height:68px}
body.chat-radio-embed .station-settings:not([open]){display:none}body.chat-radio-embed .station-settings[open]{margin-top:8px}
body.chat-radio-embed .scratch-screen.keyable{min-height:68px;border-radius:8px;cursor:crosshair;display:flex;align-items:center;justify-content:center}body.chat-radio-embed .scratch-screen.keyable .readout{display:none}body.chat-radio-embed #mouse-hint{margin:0}
body.chat-radio-embed #external-ready:not([hidden]){display:block!important;margin:4px 0;font-size:13px;min-height:44px}

/* Coaching feedback updates below the key, never under the operator’s finger. */
.coach-feedback-area{display:none}.coaching .coach-feedback-area{display:block}.coaching .scratch-screen .readout{height:120px;overflow:auto}.coaching .scratch-screen{overflow-anchor:none}

/* Compact solo station: the exercise comes before explanatory material. */
body:not(.radio-embed) main{padding:10px;max-width:760px}
body:not(.radio-embed) h1{font-size:23px;margin:6px 0}
body:not(.radio-embed) .freehand-station{margin:8px 0;padding:10px}
body:not(.radio-embed) .scratch-screen{min-height:108px;padding:10px}
body:not(.radio-embed) .scratch-screen .readout{min-height:86px;height:86px;overflow:auto}
body:not(.radio-embed) #decoded{min-height:30px;font-size:21px}
body:not(.radio-embed) #symbols{min-height:24px;margin:2px 0}
/* One vertical scroll area for practice history; nested output scrollbars hid new marks.
   Only mouse keying owns pointer movement. External/screen input can scroll. */
body:not(.radio-embed) .scratch-screen:not(.keyable){touch-action:pan-y pinch-zoom}
body:not(.radio-embed) .scratch-screen .readout{overscroll-behavior-y:contain;overflow-anchor:none}
/* Preserve the full output for accessible text and Copy actions. Solo history
   renders each actual decoded group directly above its original Morse. */
body:not(.radio-embed) #decoded,body:not(.radio-embed) #symbols{position:absolute;width:1px;height:1px;min-height:0;max-height:none;overflow:hidden;clip-path:inset(50%);white-space:nowrap;margin:0}
#latest-row,#pad-history{display:none}
body:not(.radio-embed) #latest-row:not([hidden]){display:flex;align-items:center;gap:6px;position:sticky;top:0;z-index:1;background:var(--screen-bg)}
#latest-row .latest-label{font:400 10px/1 system-ui,sans-serif;flex:none;opacity:.8}
#latest-decoded{display:block;flex:1;min-width:0;height:1.4em;margin:0;font:700 21px/1.4 ui-monospace,monospace;white-space:pre;overflow:hidden;overflow-wrap:normal}
body:not(.radio-embed) .readout.has-latest .eyebrow{display:none}
body:not(.radio-embed) #pad-history{display:flex;flex-wrap:wrap;align-items:start;gap:3px 10px}
.history-group{display:inline-flex;flex-direction:column;align-items:center;flex:none;max-width:100%}
.history-letter{font:700 21px/1.4 ui-monospace,monospace;white-space:pre}
.history-code{font:16px/1.5 ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.history-word-gap{align-self:end;min-width:12px;font:16px/1.5 ui-monospace,monospace}
.history-pending .history-letter{opacity:.65}
#coach-panel{padding:8px;margin:0 0 8px}
#coach-panel label{margin:4px 0;font-size:12px}
#coach-panel .coach-reference{margin:6px 0;padding:6px 8px}
#coach-panel .coach-reference .reference-heading{margin:0}
#coach-panel .coach-reference strong{font-size:13px}
#coach-panel #coach-morse{font-size:17px;line-height:1.35;margin:2px 0;max-height:48px;overflow:auto}
#coach-panel .coach-listen{display:flex;gap:6px}
#coach-panel .coach-listen button{flex:1;font-size:13px}
.coach-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:8px}
#coach-feedback{font-size:13px;line-height:1.4;margin:8px 0}
.coach-more{font-size:12px;margin-top:6px}.coach-more summary{min-height:32px;cursor:pointer}
#key-help{display:none}

.coach-actions{grid-template-columns:1fr}

.coach-feedback-area{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.coach-feedback-area input,.coach-feedback-area textarea,.coach-feedback-area select{user-select:text;-webkit-user-select:text}

/* First external-input tap is an explicit fresh start inside the existing pad. */
.scratch-screen{position:relative}
.scratch-screen .pad-start{position:absolute;inset:0;z-index:2;width:100%;height:100%;padding:16px;border:0;border-radius:8px;background:var(--screen-bg);color:var(--screen-ink);box-shadow:none;white-space:normal;touch-action:manipulation}
.scratch-screen .pad-start:focus-visible{outline:3px solid #f4b362;outline-offset:-4px}

#coach-groups{margin:8px 0;padding-left:24px;max-height:230px;overflow:auto;overscroll-behavior:contain;font-size:13px;line-height:1.4}#coach-groups li{padding:6px 0}#coach-groups .mono{display:block;white-space:pre-wrap;overflow-wrap:anywhere;color:#f4b362}#coach-keyboard-note{margin:6px 0;line-height:1.35}

/* Build 83: one expandable local diagnostic panel, below the activity. */
#input-diagnostics{border:1px solid #455339;border-radius:8px;margin:12px 0;padding:10px 12px;background:#182219}#input-diagnostics summary{cursor:pointer;min-height:32px;font-weight:600}#input-diagnostics p{font-size:13px;line-height:1.45}#input-diagnostic-status{font-variant-numeric:tabular-nums}#diagnostic-save-status:empty{display:none}
