:root{--paper:#f5f3eb;--ink:#242c29;--muted:#70756b;--line:#d9ddd1;--orange:#c94725;--orange-dark:#a8351b;--lime:#e4eabf;--white:#fffef9;--serif:Georgia,'Times New Roman',serif;--sans:'Segoe UI',Arial,sans-serif;--mono:'Cascadia Code',Consolas,monospace}
*{box-sizing:border-box} [hidden]{display:none!important} body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--sans);font-size:16px;-webkit-font-smoothing:antialiased}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer;color:inherit}button:disabled{cursor:default;opacity:.45}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--orange);outline-offset:5px}button{transition:background .18s,transform .18s}button:active:not(:disabled){transform:translateY(1px)}a{color:inherit}p{line-height:1.65}h1,h2,h3,p{margin-top:0}h1,h2{font-family:var(--serif);font-weight:400}h1{font-size:clamp(52px,7.6vw,100px);line-height:.99;letter-spacing:-4px;margin:25px 0}h1 em{color:var(--orange);font-weight:400}h2{font-size:43px;letter-spacing:-1.7px;margin:18px 0}h3{font-size:18px;font-weight:600;margin:0 0 8px}svg{width:22px;height:22px}.app-shell{max-width:1320px;margin:auto;padding:0 56px}.site-header{height:116px;display:flex;align-items:center;gap:28px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;font-weight:750;font-size:34px;letter-spacing:-1.8px;text-decoration:none}.brand-period{color:var(--orange)}.brand-icon{display:flex;align-items:center;gap:4px;margin-right:12px}.brand-icon i{display:block;height:10px;width:10px;border-radius:8px;background:var(--orange)}.brand-icon i+i{width:25px}.header-caption{font-family:var(--mono);font-size:10px;letter-spacing:1.4px;margin-left:auto}.header-actions{display:flex;align-items:center;gap:10px}.icon-button{border:1px solid var(--line);border-radius:50%;width:40px;height:40px;background:transparent;display:inline-flex;align-items:center;justify-content:center;font-size:21px}.icon-button:hover{background:var(--lime)}.text-button{border:0;background:none;padding:10px 4px;font-size:14px}.eyebrow{font-family:var(--mono);font-size:11px;letter-spacing:1.5px;line-height:1.5;font-weight:500}.status-dot{display:inline-block;width:7px;height:7px;background:var(--orange);border-radius:50%;margin-right:8px}.intro-copy{color:var(--muted);font-size:17px;line-height:1.65}.mono{font-family:var(--mono)}.tiny{font-size:10px;letter-spacing:1px}.login-layout{min-height:calc(100svh - 198px);display:grid;grid-template-columns:1.3fr 1fr;gap:9%;align-items:center;padding:64px 0 70px}.login-intro .intro-copy{margin:30px 0}.signal-art{display:flex;gap:14px;align-items:center;margin:40px 0 28px}.signal-art span{width:28px;height:28px;border-radius:25px;background:var(--ink)}.signal-art .dash{width:91px}.signal-art span:nth-child(3){background:var(--orange)}.access-card{background:var(--white);border:1px solid var(--line);padding:42px;border-radius:4px;box-shadow:9px 9px 0 #e8e9dd}.access-card h2{font-size:48px;margin-bottom:16px}.access-card>p{color:var(--muted);font-size:15px;margin-bottom:30px}label{display:block;font-size:13px;font-weight:600;margin-bottom:10px}input[type=password],input[type=text]{width:100%;border:1px solid var(--line);border-radius:3px;background:var(--paper);height:54px;padding:12px 60px 12px 14px}input:focus{border-color:var(--ink)}.password-field{position:relative}.password-field button{position:absolute;right:8px;top:7px;height:40px;background:none;border:0;font-size:13px;padding:0 9px}.form-message{font-size:13px!important;line-height:1.5;min-height:24px;color:var(--muted);margin:10px 0 18px!important}.form-message.error{color:var(--orange-dark)}.button{min-height:52px;border:0;border-radius:3px;display:inline-flex;justify-content:space-between;align-items:center;gap:22px;padding:16px 23px;font-weight:600;font-size:14px}.primary{background:var(--orange);color:var(--white)}.primary:hover:not(:disabled){background:var(--orange-dark)}.ink{background:var(--ink);color:var(--white)}.ink:hover:not(:disabled){background:#3d4a41}.secondary{background:transparent;border:1px solid var(--line)}.secondary:hover{background:var(--lime)}.wide{width:100%}.access-note{display:block;text-align:center;font-size:11px;color:var(--muted);margin-top:21px}.access-note span{font-size:7px;margin-right:5px}.home-heading{display:flex;justify-content:space-between;align-items:flex-end;padding:51px 0 34px}.home-heading h1{font-size:80px;margin:19px 0 0}.home-heading .intro-copy{margin:0 0 4px}.mode-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px}.mode-card{border:1px solid var(--line);border-radius:4px;text-align:left;padding:30px 32px 0;background:var(--lime);display:flex;flex-direction:column;min-width:0}.transmit-card{background:var(--orange);color:var(--white);border-color:var(--orange)}.mode-card:hover{transform:translateY(-4px);box-shadow:0 8px 20px #242c2910}.mode-top{display:flex;align-items:center;justify-content:space-between}.round-arrow{border:1px solid currentColor;border-radius:50%;height:34px;width:34px;display:grid;place-items:center;font-size:22px;opacity:.8}.mode-art{display:flex;align-items:center;height:112px;gap:10px}.transmit-art i{height:23px;width:23px;display:block;border-radius:16px;background:currentColor}.transmit-art i.long{width:85px}.wave-art{display:flex;align-items:center;gap:8px}.wave-art i{width:7px;height:22px;background:currentColor;border-radius:9px}.wave-art i:nth-child(2n){height:47px}.wave-art i:nth-child(3n){height:65px}.wave-art i:nth-child(5n){height:85px}.mode-name{font:400 39px/1.2 var(--serif);letter-spacing:-1.2px}.mode-description{font-size:14px;line-height:1.7;margin-top:13px;margin-bottom:28px}.mode-bottom{display:flex;justify-content:space-between;font-size:13px;font-weight:650;border-top:1px solid #242c292a;padding:19px 0}.transmit-card .mode-bottom{border-color:#fff5}.mode-bottom>span{font-size:21px;line-height:.8}.home-bottom{display:flex;align-items:center;gap:25px;padding:31px 0 38px}.level-control label{font:10px var(--mono);letter-spacing:1px;color:var(--muted)}select{background:var(--white);color:var(--ink);border:1px solid var(--line);border-radius:3px;padding:12px 32px 12px 12px;max-width:100%;font-size:13px}.progress-summary{display:flex;align-items:center;gap:12px;margin-left:auto;font-size:12px}.progress-summary>span{font:43px var(--serif)}.progress-summary small{display:block;font-size:10px;color:var(--muted);margin-top:5px}.text-link{background:none;border:0;padding:12px 0;text-align:left;text-decoration:underline;text-underline-offset:5px;font-size:13px;font-weight:500}.text-link:hover{color:var(--orange-dark)}.site-footer{border-top:1px solid var(--line);min-height:82px;display:flex;align-items:center;justify-content:space-between;gap:20px;font:9px var(--mono);letter-spacing:.8px;color:var(--muted)}.footer-signal{font-size:16px;color:var(--ink);letter-spacing:1px}.game-top{display:flex;justify-content:space-between;align-items:center;padding:24px 0 15px}.round-count{font:12px var(--mono);color:var(--muted)}.round-count strong{color:var(--ink);font-size:16px}.progress-track{height:5px;width:100%;background:var(--line)}progress{display:block;height:5px;width:100%;border:0;appearance:none;background:var(--line);color:var(--orange)}progress::-webkit-progress-bar{background:var(--line)}progress::-webkit-progress-value{background:var(--orange);transition:width .25s}progress::-moz-progress-bar{background:var(--orange)}.game-layout{display:grid;grid-template-columns:1fr 1.18fr;gap:8%;padding:40px 0;min-height:600px}.question-panel{text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center}.target-letter{font-family:var(--serif);font-size:190px;line-height:1;margin:5px 0;letter-spacing:-8px}.question-hint{font-size:13px;color:var(--muted);margin:10px 0}.feedback{min-height:83px;width:100%;padding-top:18px}.feedback>span{font-size:19px;font-weight:600}.feedback p{margin:7px 0;font-size:14px;color:var(--muted)}.feedback.correct>span{color:#3b6446}.feedback.incorrect>span{color:var(--orange-dark)}.game-score{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--muted);margin-top:auto;padding-top:20px}.game-score .status-dot{margin:0}.score-divider{margin:0 7px;color:var(--line)}.sequence-row{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:51px;margin-bottom:12px}.sequence-row .eyebrow{font-size:10px}.sequence-row output{font:30px var(--mono);letter-spacing:1px;white-space:nowrap}.sequence-row .text-button{font-size:12px}.exact-controls{display:flex;align-items:center;justify-content:center;gap:15px;margin:22px 0 16px}.exact-controls>span{font-size:11px;color:var(--muted)}.symbol-button{border:1px solid var(--line);background:none;border-radius:3px;padding:3px 9px;font:24px var(--mono);display:flex;align-items:center;gap:6px;min-height:38px}.symbol-button small{font:11px var(--sans)}.symbol-button:hover{background:var(--lime)}.listening-visual{height:235px;display:flex;align-items:center;justify-content:center;color:var(--orange)}.listening-visual .wave-art{gap:11px}.listening-visual .wave-art i{width:10px;height:45px}.listening-visual .wave-art i:nth-child(2n){height:85px}.listening-visual .wave-art i:nth-child(3n){height:120px}.is-playing .listening-visual .wave-art i{animation:wave .65s ease-in-out infinite alternate}.is-playing .wave-art i:nth-child(2n){animation-delay:.15s}.is-playing .wave-art i:nth-child(3n){animation-delay:.3s}@keyframes wave{to{transform:scaleY(.45)}}.letter-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin:20px 0}.letter-grid.beginner{grid-template-columns:repeat(4,1fr)}.letter-button{background:var(--white);border:1px solid var(--line);border-radius:4px;min-height:65px;font:32px var(--serif)}.beginner .letter-button{min-height:120px;font-size:46px}.letter-button:hover:not(:disabled){background:var(--lime);border-color:var(--ink)}.letter-button.correct{background:var(--lime);border-color:#698051;opacity:1}.letter-button.incorrect{background:#f8d5c9;border-color:var(--orange);opacity:1}.keyboard-note{font-size:12px;color:var(--muted)}.next-button{margin-top:19px}.result-view{text-align:center;max-width:700px;margin:auto;padding:60px 0}.result-view h1{font-size:72px}.result-score{display:flex;align-items:center;justify-content:center;gap:19px;margin:28px 0}.result-score>strong{font:110px/.9 var(--serif);letter-spacing:-6px}.result-score>span{font:28px var(--serif);text-align:left}.result-score small{display:block;font:12px var(--sans);color:var(--muted);margin-top:9px}.result-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:13px;margin-top:27px}.review-box{background:var(--lime);border-radius:4px;padding:22px;margin-top:26px}.review-box p{font-size:12px;margin:12px 0 0;color:#565c43}#review-letters{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:15px}.review-letter{background:var(--white);border:1px solid #c7ceb0;border-radius:3px;padding:8px 12px;font-size:16px}.review-letter span{display:block;font:14px var(--mono);margin-top:4px}.global-message{padding:14px 18px;border:1px solid #d9aa91;border-radius:3px;background:#fff4e8;font-size:14px;margin:15px 0 24px}.skip-link{position:absolute;left:20px;top:-80px;background:var(--ink);color:white;padding:12px;z-index:9}.skip-link:focus{top:10px}dialog{border:1px solid var(--line);border-radius:7px;background:var(--paper);color:var(--ink);padding:32px;max-width:500px;width:calc(100% - 32px);max-height:88svh;box-shadow:0 25px 100px #0003}dialog::backdrop{background:#17291ec0;backdrop-filter:blur(3px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:15px}.dialog-head .eyebrow{font-size:10px}dialog>p{font-size:14px;color:var(--muted)}dialog label{margin-top:25px}dialog select{width:100%;height:49px}dialog input[type=range]{width:100%;accent-color:var(--orange);height:30px}dialog output{float:right;color:var(--muted);font-weight:400}.dialog-note{font-size:12px;line-height:1.7;color:var(--muted);margin-top:18px}.help-step{display:flex;gap:20px;margin-top:28px}.help-step>span{font:13px var(--mono);color:var(--orange);padding-top:4px}.help-step p{font-size:13px;color:var(--muted);margin:0}.help-install{border-top:1px solid var(--line);margin-top:28px;padding-top:24px}.help-install p{font-size:13px;color:var(--muted);margin:0}.alphabet-dialog{max-width:650px}.alphabet-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.alphabet-letter{border:1px solid var(--line);border-radius:3px;background:var(--white);padding:12px 5px;font:24px var(--serif)}.alphabet-letter span{display:block;font:13px var(--mono);color:var(--muted);margin-top:8px;white-space:nowrap}.alphabet-letter:hover,.alphabet-letter.playing{background:var(--lime)}.noscript{padding:25px;text-align:center;background:var(--orange);color:white}
@media(min-width:1400px){.login-layout{min-height:690px}.game-layout{min-height:640px}}
@media(max-width:1000px){.app-shell{padding:0 30px}.header-caption{display:none}.header-actions{margin-left:auto}.login-layout{gap:5%}.access-card{padding:30px}h1{font-size:72px}.home-heading h1{font-size:70px}.home-bottom{flex-wrap:wrap;gap:20px}.home-bottom>.text-link{margin-left:auto}.mode-name{font-size:33px}.game-layout{gap:5%}.target-letter{font-size:170px}.letter-grid{gap:6px}.letter-button{min-height:57px}}
@media(max-width:680px){.app-shell{padding:0 20px}.site-header{height:80px;gap:10px}.brand{font-size:29px}.brand-icon{margin-right:8px}.brand-icon i{width:8px;height:8px}.brand-icon i+i{width:19px}.header-actions{gap:7px}.icon-button{width:35px;height:35px}.login-layout{display:block;min-height:0;padding:42px 0}.login-intro h1{font-size:65px;letter-spacing:-3.5px;margin-top:22px}.login-intro .intro-copy{font-size:14px;margin:22px 0}.login-intro .tiny,.signal-art{display:none}.access-card{padding:27px;margin-top:32px;box-shadow:5px 5px 0 #e8e9dd}.access-card h2{font-size:39px}.access-card>p{margin-bottom:23px}.site-footer{min-height:80px;font-size:8px;line-height:1.6;gap:15px}.site-footer>span:last-child{display:none}.footer-signal{font-size:12px;white-space:nowrap}.home-heading{padding:35px 0 28px;align-items:center}.home-heading h1{font-size:61px;letter-spacing:-3px}.home-heading .intro-copy{font-size:11px;text-align:right;max-width:110px;margin-top:40px}.eyebrow{font-size:10px;letter-spacing:1.1px}.mode-grid{grid-template-columns:1fr;gap:16px}.mode-card{padding:23px 25px 0;position:relative}.mode-art{height:65px;margin:4px 0}.mode-name{font-size:34px}.mode-description{margin:10px 0 18px;font-size:13px}.mode-bottom{padding:16px 0}.mode-art.wave-art i{height:15px;width:5px}.mode-art.wave-art i:nth-child(2n){height:27px}.mode-art.wave-art i:nth-child(3n){height:37px}.mode-art.wave-art i:nth-child(5n){height:49px}.transmit-art i{height:17px;width:17px}.transmit-art i.long{width:65px}.home-bottom{padding:24px 0 28px;gap:22px}.level-control{width:100%}.level-control select{width:100%}.progress-summary{margin-left:0}.home-bottom>.text-link{font-size:11px}.game-top{padding-top:17px}.game-layout{display:flex;flex-direction:column;gap:15px;padding:20px 0 30px;min-height:0}.question-panel{position:relative}.target-letter{font-size:91px;letter-spacing:-3px;margin:3px 0}.question-hint{font-size:11px;margin:6px 0}.feedback{min-height:0;padding-top:0}.feedback>span:empty,.feedback>p:empty{display:none}.feedback>span{font-size:17px}.feedback p{font-size:12px;margin:5px 0}.game-score{padding-top:10px;font-size:10px}.sequence-row{margin:0 0 10px;min-height:41px}.sequence-row output{font-size:26px}.exact-controls{margin:18px 0 14px;gap:12px}.exact-controls>span{font-size:10px}.exact-controls .symbol-button{min-height:40px}.listening-visual{height:120px}.listening-visual .wave-art{gap:8px}.listening-visual .wave-art i{width:7px;height:28px}.listening-visual .wave-art i:nth-child(2n){height:53px}.listening-visual .wave-art i:nth-child(3n){height:75px}.letter-grid{grid-template-columns:repeat(6,1fr);gap:7px;margin-top:14px}.letter-button{font-size:28px;min-height:53px}.beginner .letter-button{min-height:86px;font-size:38px}.keyboard-note{text-align:center;font-size:10px}.next-button{margin-top:12px}.result-view{padding:40px 0}.result-view h1{font-size:60px;letter-spacing:-3px}.result-view .intro-copy{font-size:14px}.result-score>strong{font-size:95px}.result-actions .button{flex:1;justify-content:center;gap:5px;padding:15px;font-size:12px}.review-box{padding:20px 15px}dialog{padding:24px}dialog h2{font-size:37px}.alphabet-grid{grid-template-columns:repeat(4,1fr)}.alphabet-letter span{font-size:12px}.header-actions .text-button{font-size:12px}.global-message{font-size:12px}}
.free-mode-card{display:flex;align-items:center;gap:25px;width:100%;margin-top:22px;padding:25px 30px;border:1px solid var(--line);border-radius:4px;background:var(--white);text-align:left}
.free-mode-card:hover{background:#ecefdf}
.free-mode-mark{font:38px var(--mono);white-space:nowrap;color:var(--orange)}
.free-mode-card strong{display:block;font:30px var(--serif);letter-spacing:-.7px;margin:6px 0}
.free-mode-description{font-size:13px;line-height:1.6;color:var(--muted)}
.free-mode-card>.round-arrow{margin-left:auto;flex-shrink:0}
.home-heading{position:relative}
.home-heading::after{content:"";position:absolute;left:0;right:0;bottom:3px;height:30px;background:url('/assets/icons/telegraph-wire.svg') center/100% 100% no-repeat;pointer-events:none}
.mode-card,.free-mode-card{border-radius:16px}
#alphabet-button{display:inline-flex;align-items:center;gap:8px;text-decoration:none;white-space:nowrap}
#alphabet-button .alphabet-icon{width:25px;height:25px;flex:none;color:var(--orange)}
.alphabet-grid.focused{display:block}
.alphabet-letter.selected{width:100%;min-height:320px;padding:30px;font-size:140px;background:var(--lime);border-color:#698051}
.alphabet-letter.selected .morse-code{--morse-size:16px;height:auto;margin:28px 0 0}
.alphabet-letter.selected .morse-word{justify-content:center}
.free-composer{display:flex;align-items:center;gap:6px;min-height:56px;padding:5px 6px;border:1px solid var(--line);border-radius:9px;background:var(--white);box-shadow:0 3px 12px #242c2908}
.free-message-copy{display:flex;flex:1;min-width:70px;flex-direction:column;overflow:hidden;padding:0 7px}
.free-message-copy .eyebrow{color:var(--muted);font-size:9px;letter-spacing:1px}
#free-message{display:block;min-width:0;overflow:auto hidden;color:var(--ink);font:600 16px/1.45 var(--mono);letter-spacing:.4px;white-space:pre;scrollbar-width:none}
#free-message::-webkit-scrollbar{display:none}
.free-tool{display:grid;place-items:center;flex:none;min-width:44px;height:44px;padding:0 10px;border:1px solid var(--line);border-radius:5px;background:transparent;font-size:13px;font-weight:600}
.free-tool:hover:not(:disabled){background:var(--lime)}
.free-mode .feedback p{overflow-wrap:anywhere}
.free-mode .question-panel{justify-content:flex-start;padding-top:35px}
@media(max-width:680px){
  .free-mode-card{padding:20px;gap:15px;flex-wrap:wrap}
  .free-mode-mark{font-size:26px}
  .free-mode-card>span:nth-child(2){flex:1;min-width:175px}
  .free-mode-card strong{font-size:26px}
  .free-mode-card>.round-arrow{display:none}
  .free-mode-description{font-size:12px}
  .free-mode .question-panel{padding-top:0}
  .free-message-copy .eyebrow{display:none}
}
/* Physical telegraph key: a fixed metal bezel and a moving, domed cap. */
.telegraph-mount{padding:18px 14px 4px;text-align:center}
.telegraph-key{
  display:block;position:relative;isolation:isolate;margin:0 auto;
  width:min(100%,360px);height:auto;aspect-ratio:1;padding:19px;
  border:1px solid #90958c;border-radius:50%;color:var(--white);
  background:linear-gradient(145deg,#f8f9f2 2%,#c1c5bb 24%,#7e877d 51%,#dfe2d7 78%,#b9beb3);
  box-shadow:inset 0 2px 2px #ffffffd9,inset 0 -3px 4px #333f3466,
    0 5px 0 #6a7368,0 10px 0 #414c43,0 12px 2px #27382a66,
    0 20px 22px -5px #23312855,0 30px 38px -15px #23312840;
  touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;
}
.telegraph-key::before{
  content:"";position:absolute;inset:12px;border-radius:50%;z-index:-1;
  background:#3d2921;box-shadow:inset 0 3px 8px #0009,0 1px 1px #fff9;
}
.key-face{
  position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;
  width:100%;height:100%;gap:7px;border-radius:50%;transform:translateY(-7px);
  border:1px solid #a13b1d;
  background:radial-gradient(ellipse at 35% 12%,#ed8251 0%,#dc5c32 28%,#ca4725 60%,#a83018 100%);
  box-shadow:inset 0 3px 3px #ffc094cc,inset 0 -5px 10px #6d150c66,
    inset 2px 0 5px #ffa57988,inset -2px 0 5px #68140644,
    0 9px 0 #8c2815,0 11px 0 #661d11,0 13px 7px #1e160f99;
  text-shadow:0 1px 1px #71200f;transition:transform 80ms ease-out,box-shadow 80ms ease-out;
}
.key-face::before{
  content:"";position:absolute;inset:5% 16% auto;height:29%;border-radius:50%;
  background:linear-gradient(#ffd2a92e,#ffd2a900);pointer-events:none;
}
button.telegraph-key:active:not(:disabled),.telegraph-key.held{transform:none}
.telegraph-key.held .key-face{
  transform:translateY(2px);
  box-shadow:inset 0 2px 3px #ffd1ac80,inset 0 -2px 8px #6d150c66,
    inset 2px 0 5px #ffa57966,inset -2px 0 5px #68140644,
    0 2px 0 #752110,0 3px 4px #1e160f99;
}
.telegraph-key:disabled{opacity:.55}
.key-status{font:10px var(--mono);letter-spacing:1.4px;position:relative}
.key-symbol{font:88px/1 var(--mono);height:94px;display:flex;align-items:center;justify-content:center;white-space:pre;position:relative}
.key-instruction{font-size:14px;line-height:1.5;text-align:center;position:relative}
.key-bottom{display:flex;justify-content:center;gap:28px;margin-top:32px;font:9px var(--mono);letter-spacing:.6px;color:var(--muted)}
@media(max-width:680px){
  .telegraph-mount{padding:16px 8px 0}
  .telegraph-key{width:min(100%,340px);padding:17px}
  .telegraph-key::before{inset:11px}
  .key-status{font-size:9px;letter-spacing:1px}
  .key-symbol{font-size:76px;height:82px}
  .key-instruction{font-size:13px}
  .key-bottom{font-size:8px;margin-top:30px}
  .key-bottom span:last-child{display:none}
}
/* Full-resolution photographic layers: only the lever and spring move. */
.telegraph-art{display:none}
.telegraph-key[data-style="telegraph"]{
  width:min(100%,500px);height:auto;aspect-ratio:auto;padding:0;
  border:0;border-radius:12px;background:transparent;box-shadow:none;color:var(--ink);
}
.telegraph-key[data-style="telegraph"]::before{display:none}
.telegraph-key[data-style="telegraph"] .key-face{display:none}
.telegraph-key[data-style="telegraph"] .telegraph-art{display:block}
.telegraph-key[data-style="telegraph"]:disabled{opacity:.65}
.telegraph-scene{display:block;width:100%;height:auto;overflow:visible;pointer-events:none}
.telegraph-lever{transform-box:view-box;transform-origin:800px 420px;transform:matrix(1,0,0,1,0,0);transition:transform 140ms cubic-bezier(.16,.9,.28,1.18)}
.telegraph-spring{transform-box:view-box;transform-origin:760px 623px;transform:scaleY(1);transition:transform 140ms ease-out}
.telegraph-key.held .telegraph-lever{transform:matrix(1,-.07,0,1,0,0);transition:transform 65ms ease-out}
.telegraph-key.held .telegraph-spring{transform:scaleY(.96);transition:transform 65ms ease-out}
.telegraph-parts{opacity:0;transition:opacity 0s 145ms}
.telegraph-rest-cover{opacity:1;transition:opacity 0s 145ms}
.telegraph-key.held .telegraph-parts{opacity:1;transition:none}
.telegraph-key.held .telegraph-rest-cover{opacity:0;transition:none}
.telegraph-readout{display:flex;justify-content:center;align-items:center;gap:17px;margin-top:12px;font:10px var(--mono);letter-spacing:1px;color:var(--muted)}
#telegraph-signal{font-size:25px;line-height:1;min-width:52px;color:var(--orange);white-space:pre}
.telegraph-instruction{display:block;margin-top:12px;font-size:13px;line-height:1.5}
.pulsator-options{border:0;padding:0;margin:25px 0}
.pulsator-options legend{font-size:13px;font-weight:600;margin-bottom:12px}
dialog .pulsator-choice{display:flex;align-items:center;gap:12px;padding:12px;margin:9px 0 0;border:1px solid var(--line);border-radius:4px;cursor:pointer;background:var(--white)}
.pulsator-choice:has(input:checked){border-color:#6e7a55;background:var(--lime)}
.pulsator-choice input{accent-color:var(--orange);margin:0;width:17px;height:17px;flex-shrink:0}
.pulsator-choice>img,.pulsator-choice>.round-preview{width:52px;height:52px;flex-shrink:0;object-fit:contain}
.pulsator-choice>.round-preview{width:39px;height:39px;margin:0 6.5px;border-radius:50%;border:3px solid #c5cabe;background:radial-gradient(circle at 35% 20%,#ed8251,#c94725 65%,#8c2815);box-shadow:0 3px 0 #555f53,inset 0 2px 3px #ffd2a9}
.pulsator-choice strong{display:block;font-weight:600;font-size:13px}
.pulsator-choice small{display:block;font-weight:400;font-size:11px;color:var(--muted);margin-top:4px;line-height:1.4}
@media(max-width:680px){
  .telegraph-key[data-style="telegraph"]{width:100%}
  .telegraph-readout{font-size:9px;gap:10px}
  .telegraph-instruction{font-size:12px}
}
.round-arrow{flex-shrink:0;line-height:1}
.round-arrow svg{display:block;width:18px;height:18px}
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.game-progress-history{width:100%}
.round-history{list-style:none;display:grid;grid-template-columns:repeat(10,1fr);gap:5px;width:100%;margin:0;padding:0}
.history-step{height:20px;border:1px solid transparent;border-radius:10px;background:var(--line);color:var(--muted);display:grid;place-items:center;font:9px/1 var(--mono)}
.history-step.current{border-color:var(--ink);background:var(--white);color:var(--ink)}
.history-step.correct{background:#5f7b5d;color:var(--white);font:700 13px/1 var(--sans)}
.history-step.incorrect{background:var(--orange);color:var(--white);font:700 15px/1 var(--sans)}
.result-history{margin:2px auto 12px;max-width:520px}
.answered .sequence-row #erase-button{display:none}
.answered #send-question,.answered #listen-question{display:none}
.answered .feedback{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"status status" "code listen";align-items:center;gap:12px 18px;min-height:112px;padding:18px 18px 18px 72px;border:2px solid;border-radius:6px;text-align:left}
.answered .feedback::before{position:absolute;left:16px;top:50%;width:34px;height:34px;transform:translateY(-50%);border-radius:50%;display:grid;place-items:center;color:var(--white);font:700 21px/1 var(--sans)}
.answered .feedback.correct{border-color:#698051;background:#edf2d4}
.answered .feedback.correct::before{content:"✓";background:#5f7b5d}
.answered .feedback.incorrect{border-color:var(--orange);background:#fae1d6}
.answered .feedback.incorrect::before{content:"×";background:var(--orange)}
.answered .feedback>span{grid-area:status;font-size:21px}
.answered .feedback p{grid-area:code;color:var(--ink);margin:0}
.answered #feedback-detail.morse-code{justify-content:flex-start;gap:12px}
.answered #feedback-detail .morse-prefix{font:52px/.85 var(--serif);letter-spacing:-2px}
.answered #play-answer{grid-area:listen;align-self:center;min-height:44px;margin:0;padding:9px 12px;border:1px solid currentColor;border-radius:3px;text-decoration:none;text-align:center;white-space:nowrap}
.result-correct .sequence-row{border-color:#698051;background:#f6f8e8}
.result-incorrect .sequence-row{border-color:var(--orange);background:#fff3ed}
.icon-button{padding:0;display:inline-grid;place-items:center;line-height:1}
.icon-button>svg{display:block;width:20px;height:20px;flex:none}
.dialog-head .icon-button{width:40px;height:40px;padding:0;border:1px solid var(--line);border-radius:50%;display:grid;place-items:center}
/* Every displayed signal is vector geometry, never a font character. */
.morse-code{--morse-size:8px;display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px 20px;vertical-align:middle;line-height:1}
.morse-code .morse-word{display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:inherit;gap:12px;max-width:100%;min-width:0;margin:0}
.morse-code .morse-glyph{display:block;flex:none;width:auto;height:var(--morse-size);max-width:100%;fill:currentColor;overflow:visible}
.morse-code .morse-prefix{font:inherit;line-height:1;margin:0}
#sequence{--morse-size:12px;min-width:0;min-height:24px}
#key-symbol{--morse-size:.22em}
#telegraph-signal{--morse-size:8px}
#feedback-detail.morse-code,.form-message.morse-code{--morse-size:6px;display:flex;gap:8px;min-height:18px;justify-content:center}
.alphabet-letter .morse-code,.review-letter .morse-code{display:flex;--morse-size:5px;gap:0;margin:8px 0 0;width:100%;height:9px}
.alphabet-letter .morse-word,.review-letter .morse-word{width:100%;justify-content:center}
.free-mode-mark{--morse-size:12px}
.footer-signal{--morse-size:4px}
.mono.tiny .morse-code{--morse-size:4px;margin-right:8px}
.telegraph-hit-zone{display:none}
.telegraph-key[data-style=telegraph]{pointer-events:none;cursor:default;touch-action:auto}
.telegraph-key[data-style=telegraph] .telegraph-hit-zone{display:block;position:absolute;left:26.7%;top:51.5%;width:30%;height:22%;min-width:44px;min-height:44px;transform:translate(-50%,-50%);border-radius:50%;pointer-events:auto;touch-action:none;cursor:pointer}
.telegraph-key[data-style=telegraph]:disabled .telegraph-hit-zone{pointer-events:none}
.telegraph-key[data-style=telegraph]:focus-visible{outline:none}
.telegraph-key[data-style=telegraph]:focus-visible .telegraph-hit-zone{outline:3px solid var(--orange);outline-offset:4px}
.sequence-row{border:1px solid var(--line);background:var(--white);border-radius:32px;padding:6px;gap:8px;box-shadow:0 3px 12px #242c2908}
.sequence-row output{flex:1;min-width:0;justify-content:center}
.sequence-row #erase-button{display:grid;place-items:center;width:44px;height:44px;min-height:44px;flex:none;padding:0;border-radius:0;border-left:1px solid var(--line)}
.sequence-row #erase-button:hover:not(:disabled){color:var(--orange-dark)}
.sequence-row #erase-button svg{width:21px;height:21px}
.sequence-row .button{width:auto;flex:none;min-height:44px;padding:10px 16px;margin:0;border-radius:24px;justify-content:center;gap:8px}
.sequence-row .button svg{width:17px;height:17px}
#check-button{display:flex;align-self:center;width:min(100%,190px);min-height:46px;justify-content:center;margin:4px auto 2px;gap:8px}
#check-button svg{width:17px;height:17px}
/* Reserve the action space so revealing Comprobar never moves the telegraph. */
#check-button:disabled{visibility:hidden}
.answered #check-button{visibility:hidden}
/* Compact phone workspace. The instrument takes the remaining height; nothing is
   cropped or locked behind overflow:hidden. Large text can still scroll if needed. */
@media(max-width:680px), (max-width:960px) and (max-height:500px){
  .app-shell{height:100svh;height:var(--app-height,100dvh);min-height:0;padding:env(safe-area-inset-top) max(14px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));display:flex;flex-direction:column}
  .site-header{height:56px;min-height:56px;gap:8px}
  .brand{font-size:28px}
  .brand-icon{margin-right:7px}
  .brand-icon i{width:7px;height:7px}
  .brand-icon i+i{width:17px}
  .header-actions{margin-left:auto;gap:2px}
  .icon-button{width:40px;height:44px;border:0;border-radius:6px}
  .header-actions .text-button{min-height:44px;padding:8px;font-size:12px}
  .header-caption,.site-footer,.home-heading,.login-intro,.access-note,
  .access-card>.eyebrow,.access-card>p:not(.form-message),.mode-description,.mode-bottom,
  .mode-top .eyebrow,.free-mode-mark,.free-mode-card .eyebrow,.free-mode-description,.progress-summary,
  .question-hint,#question-eyebrow,#listen-question>.eyebrow,.game-score,.key-bottom,.key-instruction,
  .key-status,.telegraph-instruction,.exact-controls>span,.keyboard-note,#listen-controls>.eyebrow{display:none}
  #main{display:flex;flex:1;min-height:0;flex-direction:column}
  #main>[data-view]{flex:1;min-height:0}
  .button{min-height:44px;padding:10px 16px;font-size:14px;gap:8px}
  .text-button,.text-link{min-height:44px}
  input[type=password],input[type=text],select{font-size:16px}
  .global-message{flex:none;margin:6px 0 0;padding:8px 10px;font-size:12px;line-height:1.35}
  .login-layout{display:flex;align-items:center;justify-content:center;padding:18px 0}
  .access-card{width:100%;max-width:380px;padding:24px;margin:0;box-shadow:none}
  .access-card h2{font-size:36px;margin:0 0 22px}
  .access-card .form-message{margin:8px 0!important;min-height:0}
  .form-message:empty{display:none}
  [data-view=home]{display:flex;flex-direction:column;justify-content:center;gap:12px;padding:18px 0 0}
  .mode-grid{display:grid;grid-template-columns:1fr;gap:12px;flex:2;min-height:204px;max-height:320px}
  .mode-card{position:relative;padding:12px 52px 12px 20px;justify-content:center;min-height:96px}
  .mode-card:hover{transform:none;box-shadow:none}
  .mode-card .mode-art{display:flex;flex:none;height:clamp(24px,4.6svh,38px);margin:0 0 8px;gap:7px}
  .mode-card .transmit-art i{width:14px;height:14px;flex:none}
  .mode-card .transmit-art i.long{width:54px}
  .mode-card .mode-art.wave-art i{width:5px;height:28%;flex:none}
  .mode-card .mode-art.wave-art i:nth-child(2n){height:55%}
  .mode-card .mode-art.wave-art i:nth-child(3n){height:75%}
  .mode-card .mode-art.wave-art i:nth-child(5n){height:100%}
  .mode-top{position:absolute;right:16px;top:50%;transform:translateY(-50%)}
  .round-arrow{width:28px;height:28px;font-size:20px}
  .round-arrow svg{width:16px;height:16px}
  .mode-name{font-size:30px;letter-spacing:-.8px}
  .free-mode-card{position:relative;flex:1;max-height:126px;min-height:72px;flex-wrap:nowrap;padding:18px 52px 18px 20px;margin:0;gap:8px}
  .free-mode-card>span:nth-child(2){min-width:0}
  .free-mode-card strong{font-size:30px;margin:0}
  .free-mode-card>.round-arrow{display:grid;position:absolute;right:16px;top:50%;transform:translateY(-50%);margin:0}
  .home-bottom{display:flex;flex:none;flex-wrap:nowrap;gap:12px;padding:4px 0 0}
  .level-control{flex:1;min-width:0;width:auto}
  .level-control label{font:12px var(--sans);letter-spacing:0;margin:0 0 5px}
  .level-control select{width:100%;height:44px;padding:8px 24px 8px 8px;font-size:12px}
  .home-bottom>.text-link{align-self:flex-end;font-size:13px;padding:12px 2px}
  [data-view=game]{display:flex;flex-direction:column}
  .game-top{flex:none;padding:0;min-height:44px}
  .game-top .eyebrow{font-size:10px;letter-spacing:1px}
  .progress-track,progress{height:3px;flex:none}
  .game-layout{display:flex;flex:1;flex-direction:column;min-height:0;padding:6px 0 0;gap:6px}
  .question-panel,.free-mode .question-panel{display:grid;grid-template-columns:80px 1fr;column-gap:12px;flex:none;min-height:76px;padding:0;text-align:left;align-items:center;justify-content:center}
  #send-question{grid-column:1;grid-row:1 / 3;text-align:center}
  .target-letter{font-size:76px;line-height:1;margin:0;letter-spacing:-3px}
  .question-panel:has(#feedback-label:empty),.free-mode .question-panel:has([data-free-status=match]),.free-mode .question-panel:has([data-free-status=empty]){display:flex;text-align:center}
  .feedback{grid-column:2;min-height:0;padding:0}
  .feedback>span{font-size:15px;line-height:1.25}
  .feedback p{font-size:14px;margin:4px 0 0;line-height:1.3}
  .game-progress-history{flex:none}
  .round-history{gap:3px}
  .history-step{height:17px;border-radius:9px;font-size:8px}
  .history-step.correct{font-size:11px}
  .history-step.incorrect{font-size:13px}
  .answered .question-panel{display:block;width:100%;min-height:0}
  .answered .feedback{grid-column:1 / -1;min-height:104px;padding:12px 14px;border-width:1px;gap:8px 12px}
  .answered #feedback.feedback{width:calc(100% - 12px);min-height:112px;margin:8px auto 12px;padding:14px 16px;border-radius:12px;gap:10px 14px}
  .answered .feedback::before{display:none}
  .answered .feedback>span{display:block;font-size:16px;line-height:1.3}
  .answered .feedback p{font-size:12px;line-height:1.35;margin:0}
  .answered #feedback-detail .morse-prefix{font-size:44px}
  .answered #play-answer{min-height:44px;padding:8px 10px;font-size:12px}
  .free-mode #feedback-detail,.free-mode [data-free-status=match],.free-mode [data-free-status=empty]{display:none}
  .interaction-panel{display:flex;flex:1;flex-direction:column;min-height:0}
  #send-controls{position:relative;display:flex;flex:1;flex-direction:column;min-height:0;gap:6px}
  .sequence-row{flex:none;min-height:56px;margin:0;gap:4px}
  .answered .sequence-row{width:calc(100% - 12px);margin:0 auto 10px}
  .sequence-row .button{padding:10px 12px;font-size:12px}
  .sequence-row>.eyebrow{display:none}
  .sequence-row output{font-size:28px;flex:1;text-align:center}
  #erase-button{width:44px;min-height:44px;font-size:24px;padding:4px}
  #erase-button span{display:none}
  .telegraph-mount{flex:1;min-height:100px;padding:10px 8px 18px;display:grid;place-items:center;container-type:size}
  .telegraph-key,.telegraph-key[data-style=telegraph]{width:min(100cqw,100cqh,360px);height:min(100cqw,100cqh,360px);aspect-ratio:1;margin:0}
  .telegraph-key{padding:clamp(10px,5cqh,19px)}
  .telegraph-key::before{inset:7px}
  .key-symbol{font-size:clamp(38px,26cqh,80px);height:auto}
  .telegraph-key[data-style=telegraph]{padding:0}
  .telegraph-art,.telegraph-scene{width:100%;height:100%}
  .telegraph-readout{position:absolute;left:50%;bottom:0;transform:translateX(-50%);margin:0;pointer-events:none}
  #telegraph-state{display:none}
  #telegraph-signal{font-size:22px;min-width:0}
  .telegraph-key:not(.held) .telegraph-readout{visibility:hidden}
  .exact-controls{flex:none;gap:8px;margin:0}
  .exact-controls .symbol-button{justify-content:center;flex:1;min-height:44px;gap:10px}
  .exact-controls small{font-size:12px}
  #check-button,.free-composer{flex:none}
  .free-composer{gap:4px;padding:5px}
  .free-message-copy{min-width:40px;padding:0 5px}
  #free-message{font-size:14px}
  .free-tool{padding:0 7px}
  .next-button{flex:none;margin:6px 0 0}
  .answered #check-button{visibility:hidden}
  [data-mode=listen] .question-panel{display:flex;flex-direction:column;gap:6px;text-align:center;min-height:0}
  #listen-question{width:100%;display:flex;flex-direction:column;align-items:center}
  [data-mode=listen]:not(.answered) .listening-visual{height:62px;margin:12px 0 14px}
  .listening-visual .wave-art i{height:20px}
  .listening-visual .wave-art i:nth-child(2n){height:36px}
  .listening-visual .wave-art i:nth-child(3n){height:52px}
  #replay-button{justify-content:center;min-width:180px}
  [data-mode=listen].answered .listening-visual{display:none}
  #listen-controls{display:flex;flex-direction:column;flex:1;min-height:0;justify-content:center}
  .letter-grid,.letter-grid.beginner{gap:6px;margin:8px 0;grid-template-columns:repeat(6,1fr)}
  .letter-grid.beginner{grid-template-columns:repeat(4,1fr)}
  .letter-button,.beginner .letter-button{min-height:44px;font-size:25px}
  .beginner .letter-button{min-height:64px;font-size:32px}
  [data-mode=listen].answered #listen-controls{justify-content:flex-start}
  [data-mode=listen].answered #listen-controls>.eyebrow,[data-mode=listen].answered .keyboard-note{display:none}
  [data-mode=listen].answered .letter-grid,[data-mode=listen].answered .letter-grid.beginner{width:100%;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));margin:8px 0 0}
  [data-mode=listen].answered .letter-button:not(.correct):not(.incorrect){display:none}
  [data-mode=listen].answered .letter-button,[data-mode=listen].answered .beginner .letter-button{min-height:52px}
  [data-mode=listen].answered .next-button{margin-top:auto}
  .result-view{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;padding:12px 0;margin:auto;gap:12px}
  .result-view>.eyebrow,.result-view h1,.result-view>.intro-copy,.result-score small{display:none}
  .result-score{margin:0;gap:14px}
  .result-score>strong{font-size:82px}
  .result-score>span{font-size:28px}
  .review-box{width:100%;margin:0;padding:12px}
  .review-box p{margin:8px 0 0;font-size:11px;line-height:1.3}
  #review-letters{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;margin:8px 0 0}
  .review-letter{min-height:48px;padding:5px 2px;font-size:19px}
  .review-letter span{font-size:11px;white-space:nowrap;margin-top:2px}
  .alphabet-letter .morse-code,.review-letter .morse-code{--morse-size:4px;margin:5px 0 0;height:6px}
  .result-actions{width:100%;margin:0;gap:8px;flex-wrap:nowrap}
  .result-actions .button{min-height:44px;font-size:12px;padding:10px 8px;justify-content:center;flex:1}
  dialog{padding:18px;max-height:calc(100svh - 24px);max-height:calc(100dvh - 24px);width:calc(100% - 24px)}
  .dialog-head{position:absolute;top:0;left:0;right:0;height:0}
  .dialog-head .eyebrow{display:none}
  .dialog-head [data-close]{position:absolute;right:8px;top:7px}
  dialog h2{font-size:30px;letter-spacing:-1px;margin:0 36px 16px 0;line-height:1.15}
  dialog>p{font-size:13px;line-height:1.4;margin-bottom:12px}
  dialog .dialog-note,.pulsator-choice small{display:none}
  .pulsator-options{margin:0 0 12px}
  .pulsator-options legend{margin-bottom:0;font-size:12px}
  dialog .pulsator-choice{padding:5px 9px;gap:10px;margin-top:6px;min-height:54px}
  .pulsator-choice>img{width:42px;height:42px}
  .pulsator-choice>.round-preview{width:32px;height:32px;margin:0 5px}
  .pulsator-choice strong{font-size:12px}
  dialog label{margin:12px 0 6px;font-size:12px}
  dialog select{height:44px;padding:8px;font-size:14px}
  dialog input[type=range]{height:30px;margin:0}
  #test-audio{margin-top:14px}
  dialog .form-message{min-height:0;margin:8px 0 0!important;font-size:12px!important}
  .help-step{gap:12px;margin:14px 0 0}
  .help-step h3,.help-install h3{font-size:15px;margin-bottom:4px}
  .help-step p,.help-install p{font-size:12px;line-height:1.4}
  .help-install{margin:16px 0 0;padding:12px 0 0}
  .alphabet-grid{grid-template-columns:repeat(5,1fr);gap:5px}
  .alphabet-dialog>p:not(.form-message){display:none}
  .alphabet-letter{min-height:48px;font-size:21px;padding:5px 1px}
  .alphabet-letter span{font-size:10px;margin-top:2px}
  .alphabet-grid.focused{display:block}
  .alphabet-letter.selected{min-height:min(300px,60dvh);padding:20px;font-size:clamp(88px,24dvh,150px)}
  .alphabet-letter.selected .morse-code{--morse-size:12px;height:auto;margin:22px 0 0}
  #leave-dialog .result-actions{margin-top:16px}
  #feedback-detail.morse-code{justify-content:flex-start}
  main.result-view{flex:1}
  main.result-view h1{display:block;font-size:44px;letter-spacing:-2px;margin:0}
  main.result-view>.intro-copy{display:block;font-size:14px;margin:0}
}
/* Keep the target compact on short portrait screens. */
@media(max-width:479px) and (max-height:600px){
  [data-mode=send]:not(.answered) .game-layout{position:relative}
  [data-mode=send]:not(.answered) .question-panel{min-height:64px}
  [data-mode=send]:not(.answered) .target-letter{font-size:64px}
  .free-mode .question-panel{min-height:56px}
  .free-mode .target-letter{font-size:56px}
  [data-mode=listen]:not(.answered) .listening-visual{height:52px;margin:6px 0 8px}
}
@media(max-width:479px){
  [data-mode=send]:not(.answered) .game-layout{padding-top:18px}
  [data-mode=send]:not(.answered) .question-panel{margin-top:16px;margin-bottom:14px}
  [data-mode=send]:not(.answered) .sequence-row{margin-top:12px}
}
/* Landscape phones use two columns so the keyboard and instrument remain usable. */
@media(max-width:960px) and (max-height:500px) and (min-width:480px){
  .site-header{height:48px;min-height:48px}
  [data-view=home]{display:grid;grid-template-columns:2fr 1fr;grid-template-rows:1fr auto;gap:12px;padding-top:12px}
  .mode-grid{grid-template-columns:1fr 1fr;min-height:0;max-height:none;height:100%}
  .mode-card{padding:14px 52px 14px 14px}
  .mode-card .mode-art{gap:5px}
  .mode-card .mode-art.wave-art i{width:4px}
  .mode-card .transmit-art i{width:12px;height:12px}
  .mode-card .transmit-art i.long{width:42px}
  .mode-name{font-size:26px}
  .mode-top{top:50%;right:16px}
  .free-mode-card{height:100%;max-height:none;min-height:0;padding:14px 52px 14px 14px}
  .free-mode-card strong{font-size:26px}
  .home-bottom{grid-column:1 / -1;width:100%}
  .level-control{max-width:350px}
  .game-top{min-height:36px}
  .game-layout{display:grid;grid-template-columns:minmax(150px,1fr) minmax(0,1.5fr);gap:20px;padding-top:1px}
  .history-step{height:12px;border-radius:6px;font-size:7px}
  .history-step.correct{font-size:9px}
  .history-step.incorrect{font-size:10px}
  .question-panel,.free-mode .question-panel{display:flex;flex-direction:column;justify-content:center;text-align:center}
  .target-letter{font-size:100px}
  .interaction-panel{height:100%}
  #send-controls{display:flex;flex-direction:column;gap:6px}
  .sequence-row{grid-column:1 / -1}
  .telegraph-mount{grid-column:1;grid-row:2 / 4;padding:6px 8px 14px}
  .exact-controls{grid-column:2;grid-row:2;flex-direction:column;align-items:stretch;justify-content:center}
  .exact-controls .symbol-button{flex:none}
  #check-button,.free-composer{grid-column:2;grid-row:3}
  #check-button{min-height:44px;margin:0 auto}
  .free-composer{gap:3px}
  .free-message-copy{min-width:52px;padding:0 3px}
  #free-message{font-size:12px}
  .free-tool{width:40px;min-width:40px;height:40px;padding:0;font-size:12px}
  .answered #send-controls{grid-template-rows:44px minmax(100px,1fr)}
  .answered .telegraph-mount{grid-row:2}
  .answered #feedback.feedback{gap:8px;padding:14px 16px}
  .answered #feedback-detail.morse-code{gap:8px}
  .answered #feedback-detail .morse-prefix{font-size:40px}
  .answered #play-answer{padding:8px 7px;font-size:11px}
  .letter-grid{margin:0;grid-template-columns:repeat(7,1fr);gap:4px}
  .letter-button{min-height:44px;font-size:22px}
  .beginner .letter-button{min-height:64px}
  .result-view{display:grid;grid-template-columns:1fr 2fr;align-content:center;gap:12px}
  .result-score{grid-column:1;grid-row:1}
  .result-history{grid-column:1;grid-row:2;margin:0;max-width:none;align-self:start}
  .review-box{grid-column:2;grid-row:1 / 3}
  .result-actions{grid-column:1 / -1;grid-row:3}
  .result-view:not(:has(.review-box:not([hidden]))){display:flex}
  dialog{max-width:740px;padding:16px}
  #settings-dialog[open]{display:grid;grid-template-columns:1fr 1fr;column-gap:22px}
  #settings-dialog h2{grid-column:1 / -1;grid-row:1}
  #settings-dialog .pulsator-options{grid-column:1;grid-row:2 / 7;margin:0}
  #settings-dialog>label,#settings-dialog>input,#settings-dialog>select,#test-audio,#settings-message{grid-column:2;margin-top:4px}
  #settings-dialog>label{margin-bottom:2px}
  #settings-dialog #test-audio{margin-top:8px}
  #help-dialog[open]{display:grid;grid-template-columns:1fr 1fr;column-gap:22px}
  #help-dialog h2{grid-column:1 / -1;margin-bottom:0}
  #help-dialog .help-install{border:0;padding:0;margin-top:14px}
  .alphabet-grid{grid-template-columns:repeat(9,1fr)}
  .alphabet-letter{min-height:48px}
  .access-card{padding:16px 24px}
  .access-card h2{margin-bottom:12px;font-size:28px}
}
@media(max-width:680px){
  .keyboard-open .login-layout{padding:8px 0}
  .keyboard-open .access-card{padding:12px 18px}
  .keyboard-open .access-card h2{display:none}
  .keyboard-open .telegraph-mount,.keyboard-open .exact-controls{display:none}
  .keyboard-open .free-mode .target-letter{font-size:44px}
  .keyboard-open .free-mode .question-panel{min-height:44px}
  .keyboard-open .free-mode #send-controls{justify-content:center;flex:none}
  .keyboard-open .free-mode .interaction-panel{justify-content:center}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}


/* Completed rounds are read-only links to their result, with generous hit areas. */
.round-history{align-items:center;grid-auto-rows:44px;grid-template-columns:repeat(10,minmax(44px,1fr))}
.history-slot{min-width:0;height:44px}
.history-button{display:grid;align-items:center;width:100%;height:44px;padding:0;border:0;background:transparent;border-radius:10px}
.history-button .history-step{width:100%}
.history-button:hover .history-step{box-shadow:0 0 0 2px var(--ink)}
.history-button:focus-visible{outline-offset:1px}
#history-dialog{max-width:540px}
#history-dialog .dialog-head [data-close]{min-width:44px;min-height:44px}
#history-dialog .history-status{display:inline-block;padding:6px 12px;border-radius:20px;font-weight:600;margin:0 0 18px;color:var(--white)}
#history-dialog .history-status.correct{background:#5f7b5d}
#history-dialog .history-status.incorrect{background:var(--orange-dark)}
.history-detail{display:grid;gap:12px;margin:0 0 16px}
.history-detail>div{padding:14px;border:1px solid var(--line);border-radius:5px;background:var(--white)}
.history-detail dt{font-size:12px;font-weight:600;color:var(--muted);margin-bottom:12px}
.history-detail dd{margin:0;min-height:34px;justify-content:flex-start;gap:14px;--morse-size:8px}
.history-detail .morse-prefix{font:38px/1 var(--serif)}
#history-dialog .history-note{font-size:13px;line-height:1.5}
.history-actions{display:flex;flex-wrap:wrap;gap:10px}
.history-actions .button{flex:1;justify-content:center;min-height:44px;font-size:13px;padding:12px}
@media(max-width:600px){.round-history{grid-template-columns:repeat(5,minmax(44px,1fr));row-gap:0}.history-actions .button{flex-basis:100%}}
@media(max-height:500px) and (min-width:480px){.history-detail{grid-template-columns:1fr 1fr}.history-actions .button{flex-basis:auto}}

/* The isolated telegraph sits beside the mobile brand without changing desktop. */
.mobile-header-art{display:none}
@media(max-width:680px) and (min-height:501px){
  .mobile-header-art{display:flex;flex:none;align-items:center;width:clamp(34px,12vw,58px);height:40px;overflow:hidden;transform:translateY(3px)}
  .mobile-header-art img{display:block;width:100%;height:auto;object-fit:contain}
  [data-view=home]{justify-content:flex-start;padding-top:18px}
}
@media(max-width:680px), (max-width:960px) and (max-height:500px){
  .global-message.subtle{position:fixed;left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));z-index:30;margin:0;padding:6px 9px;min-height:0;font-size:10px!important;line-height:1.3;border-radius:3px;box-shadow:0 4px 16px #242c2920;pointer-events:none}
}

/* Transmit: keep the signal centered directly below its letter, without a field. */
[data-mode=send]:not(.answered) #question-eyebrow,[data-mode=send]:not(.answered) #send-hint,[data-mode=send]:not(.answered) #score-summary{display:none}
[data-mode=send]:not(.answered) #send-question{display:flex;flex-direction:column;align-items:center}
[data-mode=send] #send-question .sequence-row{width:100%;min-height:34px;margin:0 auto 10px;padding:0;justify-content:center;border:0;border-radius:0;background:transparent;box-shadow:none}
[data-mode=send] #sequence{display:flex;flex:none;width:100%;justify-content:center;text-align:center}
[data-mode=send] #sequence .morse-word{flex-wrap:nowrap;justify-content:center}
[data-mode=send] .telegraph-mount{position:relative}
.send-toolbox{position:absolute;right:2px;bottom:18px;z-index:2;display:flex;flex-direction:column;gap:8px}
/* .button spreads content apart by default; round actions center their grid track explicitly. */
.send-toolbox #erase-button,.send-toolbox #check-button{display:grid;place-items:center;align-content:center;justify-content:center;gap:0;width:48px;height:48px;min-height:48px;margin:0;padding:0;border-radius:50%;box-shadow:0 3px 12px #242c2925}
.send-toolbox #erase-button{border:1px solid var(--line);background:var(--white)}
.send-toolbox #erase-button svg,.send-toolbox #check-button svg{width:21px;height:21px}
[data-mode=send] .send-toolbox #check-button:disabled{visibility:visible}
[data-mode=send].answered .send-toolbox{display:none}
@media(max-width:680px), (max-width:960px) and (max-height:500px){
  [data-mode=send]:not(.answered) .game-layout{padding-top:6px}
  [data-mode=send]:not(.answered) .question-panel{margin-top:4px;margin-bottom:0}
  [data-mode=send] #send-question .sequence-row{min-height:30px;margin:0}
  [data-mode=send] #sequence{--morse-size:10px}
  .send-toolbox{right:0;bottom:14px;gap:7px}
  .send-toolbox #erase-button,.send-toolbox #check-button{width:44px;height:44px;min-height:44px}
  [data-view=game].answered .game-layout{padding-bottom:66px}
  [data-view=game].answered #next-button{position:fixed;left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));z-index:10;width:auto;margin:0;box-shadow:0 4px 16px #242c2930}
}

/* Station header and footer from the supplied reference. */
.morse-header{height:auto;min-height:154px;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:0;padding:10px 0 18px}
.header-main{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:82px}
.brand-logo{position:relative;display:block;flex:none;width:min(46vw,520px);height:78px;overflow:hidden}
.brand-logo img{position:absolute;left:-8%;top:50%;width:110%;max-width:none;height:auto;transform:translateY(-50%)}
.morse-header .header-actions{margin-left:auto;gap:10px}
.morse-header .header-actions::before{content:"";display:block;width:1px;height:42px;margin-right:12px;background:#c9c7b9}
.morse-header .header-actions .icon-button{width:48px;height:48px;border:0;border-radius:4px}
.morse-header .header-actions .icon-button svg{width:26px;height:26px}
.morse-header .header-actions #logout-button{padding:10px 6px;font:21px var(--serif)}
.header-subline{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;min-height:44px}
.header-station{color:#533e32;font:600 15px/1.3 var(--serif);letter-spacing:5px;white-space:nowrap}
.footer-morse{color:#aa9978;white-space:nowrap;flex-wrap:nowrap;--morse-size:6px;gap:8px}
.footer-morse .morse-word{flex-wrap:nowrap;gap:7px}
.footer-menu button:hover{color:var(--orange-dark);text-decoration:underline;text-underline-offset:4px}
.morse-footer{display:flex;min-height:112px;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:16px 0 12px;color:#594a3c}
.footer-ornament{display:flex;align-items:center;justify-content:center;gap:15px;width:100%}
.footer-rule{height:1px;flex:1;max-width:125px;background:#b0a184}
.footer-telegraph{position:relative;display:block;flex:none;width:78px;height:30px;overflow:hidden}
.footer-telegraph img{position:absolute;left:50%;top:50%;width:145px;max-width:none;height:auto;transform:translate(-50%,-50%);filter:sepia(.85) saturate(.55);opacity:.5}
.footer-menu{display:flex;align-items:center;justify-content:center;gap:12px}
.footer-menu button{min-height:44px;padding:6px 8px;border:0;background:transparent;color:inherit;font:400 18px var(--serif);letter-spacing:-.4px}
.footer-menu>span{font-size:16px}
@media(max-width:680px), (max-width:960px) and (max-height:500px){
  .morse-header{height:auto;min-height:90px;padding:0 0 7px}
  .header-main{min-height:50px;gap:4px}
  .brand-logo{width:clamp(135px,42vw,186px);height:48px}
  .morse-header .header-actions{gap:0}
  .morse-header .header-actions::before{display:none}
  .morse-header .header-actions .icon-button{width:40px;height:44px}
  .morse-header .header-actions .icon-button svg{width:21px;height:21px}
  .morse-header .header-actions #logout-button{min-height:44px;padding:8px 3px;font:15px var(--serif)}
  .header-subline{min-height:26px;gap:0;align-items:center}
  .header-station{font-size:9px;letter-spacing:1.4px}
  .morse-footer{min-height:94px;gap:2px;padding:8px 0}
  .footer-ornament{gap:6px}
  .footer-rule{max-width:32px}
  .footer-morse{--morse-size:3px;gap:2px}
  .footer-morse .morse-word{gap:2px}
  .footer-telegraph{width:62px;height:24px}
  .footer-telegraph img{width:112px}
  .footer-menu{gap:5px}
  .footer-menu button{font-size:15px;padding:6px}
  body:has([data-view=home]:not([hidden])) .app-shell{height:auto;min-height:100svh}
  body:has([data-view=home]:not([hidden])) .morse-footer{display:flex}
  body:not(:has([data-view=home]:not([hidden]))) .morse-footer{display:none}
}

/* Free mode: the signal shares its letter's center line and the key tools. */
.game-top{position:relative}
.game-top-left{display:flex;align-items:center;gap:12px}
.game-top-right{display:flex;align-items:center;gap:10px}
.resolve-button{display:grid;place-items:center;flex:none;width:40px;height:40px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--white);color:var(--orange-dark)}
.resolve-button:hover{background:var(--lime)}
.resolve-button svg{width:21px;height:21px}
[data-view=game].answered .resolve-button{visibility:hidden}
#free-dictionary-wrap{display:grid;place-items:center;width:48px;height:48px}
#free-dictionary-open{display:grid;place-items:center;width:48px;height:48px;min-height:48px;margin:0;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--white);color:var(--orange-dark);box-shadow:0 3px 12px #242c2925}
#free-dictionary-open svg{display:block;width:21px;height:21px;margin:0}
#free-dictionary-open[aria-expanded=true],#free-dictionary-open:hover{background:var(--lime)}
.free-dictionary-popover{position:fixed;left:50%;top:50%;z-index:40;width:min(390px,calc(100vw - 28px));max-height:min(72svh,560px);overflow:auto;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--paper);box-shadow:0 16px 45px #242c2938;transform:translate(-50%,-50%)}
.free-dictionary-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.free-dictionary-head strong{font:24px var(--serif)}
.free-dictionary-head .icon-button{width:32px;height:32px;flex:none}
.free-dictionary-popover p{margin:3px 0 12px;color:var(--muted);font-size:12px}
.free-dictionary-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.free-dictionary-letter{display:flex;min-width:0;min-height:56px;flex-direction:column;align-items:center;justify-content:center;padding:5px;border:1px solid var(--line);border-radius:7px;background:var(--white)}
.free-dictionary-letter:hover,.free-dictionary-letter:focus-visible{background:var(--lime)}
.free-dictionary-letter strong{font:23px var(--serif)}
.free-dictionary-letter .morse-code{--morse-size:3px;display:flex;width:100%;min-height:7px;gap:0;margin-top:4px}
.free-dictionary-letter .morse-word{flex-wrap:nowrap;gap:2px;justify-content:center;width:100%}
.free-dictionary-grid.focused{display:block}
.free-dictionary-letter.selected{width:100%;min-height:160px;padding:16px}
.free-dictionary-letter.selected strong{font-size:68px}
.free-dictionary-letter.selected .morse-code{--morse-size:10px;margin-top:14px}
.free-dictionary-popover #free-dictionary-message:empty{display:none}
[data-mode=free] #send-question{display:flex;flex-direction:column;align-items:center}
[data-mode=free] #send-question .sequence-row{width:100%;min-height:34px;margin:0 auto 10px;padding:0;justify-content:center;border:0;border-radius:0;background:transparent;box-shadow:none}
[data-mode=free] #sequence{display:flex;flex:none;width:100%;justify-content:center;text-align:center}
[data-mode=free] #sequence .morse-word{flex-wrap:nowrap;justify-content:center}
[data-mode=free] .telegraph-mount{position:relative}
[data-mode=free] #feedback-detail{display:none}
.send-toolbox #free-add-letter{display:grid;place-items:center;align-content:center;justify-content:center;gap:0;width:48px;height:48px;min-height:48px;margin:0;padding:0;border-radius:50%;box-shadow:0 3px 12px #242c2925}
.send-toolbox #free-add-letter svg{display:block;width:21px;height:21px;margin:0}
.send-toolbox #free-add-letter:disabled{visibility:visible}
[data-mode=free] .send-toolbox{position:static;display:grid;grid-template-columns:repeat(3,48px);align-items:center;justify-content:center;gap:14px;width:100%;height:48px;transform:none}
[data-mode=free] .send-toolbox #erase-button{grid-column:1}
[data-mode=free] .send-toolbox #free-add-letter{grid-column:2;gap:0;line-height:0}
[data-mode=free] .send-toolbox #free-dictionary-wrap{grid-column:3}
#free-preview-dialog{max-width:600px}
.free-preview-word{max-height:4em;overflow:auto;margin:0 0 16px;color:var(--ink);font:600 19px/1.4 var(--mono);overflow-wrap:anywhere}
.free-preview-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:8px;max-height:min(55svh,440px);overflow:auto}
.free-preview-letter{display:flex;min-width:0;min-height:86px;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:9px 4px;border:1px solid var(--line);border-radius:7px;background:var(--white)}
.free-preview-letter strong{font:32px/1 var(--serif)}
.free-preview-letter .morse-code{--morse-size:5px;display:flex;max-width:100%;min-height:10px}
.free-preview-letter .morse-word{flex-wrap:nowrap;gap:3px;justify-content:center}
@media(max-width:680px), (max-width:960px) and (max-height:500px){
  .game-top-left{gap:3px}
  .game-top-right{gap:5px}
  .resolve-button{width:44px;height:44px}
  #free-dictionary-wrap,#free-dictionary-open{width:44px;height:44px;min-height:44px}
  .free-mode #game-mode{display:none}
  .free-dictionary-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .free-dictionary-letter{min-height:48px}
  .free-dictionary-letter.selected{min-height:130px}
  .free-dictionary-letter.selected strong{font-size:56px}
  [data-mode=free] .question-panel{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:112px;text-align:center}
  [data-mode=free] #send-question{gap:12px}
  [data-mode=free] #send-question .sequence-row{min-height:30px;margin:0}
  [data-mode=free] #sequence{--morse-size:10px}
  [data-mode=free] .feedback{min-height:0}
  .send-toolbox #free-add-letter{width:44px;height:44px;min-height:44px}
  [data-mode=free] .telegraph-mount{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:0 8px 2px}
  [data-mode=free] .telegraph-key,[data-mode=free] .telegraph-key[data-style=telegraph]{flex:none;width:min(100cqw,calc(100cqh - 52px),320px);height:min(100cqw,calc(100cqh - 52px),320px)}
  [data-mode=free] .send-toolbox{display:grid;flex:none;grid-template-columns:repeat(3,44px);gap:14px;width:100%;height:44px}
  .free-preview-grid{grid-template-columns:repeat(3,minmax(0,1fr));max-height:55svh}
}

/* Mobile spacing: size the practice group, rather than stretching its children.
   Keep minimum touch areas and allow natural scrolling when text needs more room. */
@media(max-width:680px), (max-width:960px) and (max-height:500px){
  .app-shell{--mobile-edge:clamp(16px,4.5vw,24px);--mobile-gap:clamp(12px,2svh,20px);height:auto;min-height:var(--app-height,100dvh);padding:env(safe-area-inset-top) max(var(--mobile-edge),env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(var(--mobile-edge),env(safe-area-inset-left))}
  .morse-header{flex:none}
  #main{flex:1}
  [data-view=home]{gap:14px;padding:20px 0 12px}
  .mode-grid{flex:none;min-height:0;max-height:none;gap:14px}
  .mode-card{min-height:clamp(104px,17svh,154px);padding:16px 54px 16px 20px}
  .mode-name,.free-mode-card strong{font-size:clamp(24px,7.5vw,30px)}
  .free-mode-card{flex:none;min-height:clamp(76px,12svh,104px);max-height:none;padding:18px 54px 18px 20px}
  .home-bottom{padding:4px 0 0;gap:14px}
  .morse-footer{flex:none;margin-top:auto;padding:14px 0 0;min-height:94px}
  .game-top{min-height:56px;gap:8px}
  .game-top-right{gap:8px}
  .round-history{column-gap:6px;margin:0}
  .game-layout{flex:1;justify-content:center;gap:var(--mobile-gap);padding:12px 0;min-height:min-content}
  .question-panel,.free-mode .question-panel{flex:none;min-height:0;margin:0;padding:0}
  .interaction-panel{flex:none;min-height:0;width:100%;gap:16px}
  #send-controls{flex:none;gap:16px}
  [data-mode=send]:not(.answered) .game-layout{padding-top:12px}
  [data-mode=send]:not(.answered) .question-panel{margin:0}
  [data-mode=send]:not(.answered) #send-question{gap:6px}
  .target-letter{font-size:clamp(60px,10svh,80px)}
  [data-mode=send] #send-question .sequence-row,[data-mode=free] #send-question .sequence-row{min-height:30px;margin:0}
  .telegraph-mount{--instrument-size:min(320px,calc(100vw - 2 * var(--mobile-edge) - 24px),max(160px,calc(var(--app-height,100dvh) - 440px)));flex:none;container-type:normal;min-height:0;padding:0 12px 16px}
  .telegraph-key,.telegraph-key[data-style=telegraph]{width:var(--instrument-size);height:var(--instrument-size);padding:16px;margin:0 auto}
  .telegraph-key[data-style=telegraph]{padding:0}
  .key-symbol{font-size:clamp(38px,12vw,70px)}
  [data-mode=send] .send-toolbox{right:0;bottom:16px;gap:12px}
  [data-mode=free] .question-panel{position:relative;min-height:0;padding-bottom:20px}
  [data-mode=free] #send-question{gap:8px}
  [data-mode=free] .feedback{position:absolute;left:0;right:0;bottom:0;height:16px;padding:0;text-align:center}
  [data-mode=free] .feedback>span{font-size:11px;line-height:16px;font-weight:400}
  [data-mode=free] .telegraph-mount{--instrument-size:min(320px,calc(100vw - 2 * var(--mobile-edge) - 24px),max(160px,calc(var(--app-height,100dvh) - 480px)));gap:24px;padding:0 12px}
  [data-mode=free] .telegraph-key,[data-mode=free] .telegraph-key[data-style=telegraph]{width:var(--instrument-size);height:var(--instrument-size)}
  [data-mode=free] .send-toolbox{gap:18px}
  .free-composer{min-height:60px;gap:6px;padding:7px}
  .free-tool{width:44px;min-width:44px;height:44px;padding:0;line-height:1}
  .free-message-copy{padding:0 4px}
  [data-mode=listen] .question-panel{gap:0}
  [data-mode=listen]:not(.answered) #listen-question{display:flex;flex-direction:column;align-items:center;gap:16px}
  .listening-visual{height:clamp(52px,9svh,76px);margin:0}
  [data-mode=listen] #listen-controls{flex:none;justify-content:flex-start}
  .letter-grid,.letter-grid.beginner{gap:8px;margin:0}
  .letter-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
  .letter-grid.beginner{grid-template-columns:repeat(4,minmax(0,1fr))}
  .letter-button{min-height:44px}
  .beginner .letter-button{min-height:clamp(48px,8svh,68px)}
  [data-view=game].answered .game-layout{padding:16px 0;gap:16px}
  .answered #feedback.feedback{width:100%;min-height:112px;margin:0;padding:14px;gap:10px 12px}
  [data-mode=send].answered .telegraph-mount{--instrument-size:min(280px,calc(100vw - 2 * var(--mobile-edge) - 24px),max(120px,calc(var(--app-height,100dvh) - 510px)))}
  [data-mode=listen].answered .letter-grid,[data-mode=listen].answered .letter-grid.beginner{margin:0}
  [data-view=game].answered #next-button{position:static;width:100%;min-height:48px;margin:0;box-shadow:none}
  .result-view{flex:1;min-height:min-content;padding:24px 0;gap:18px}
  .review-box{padding:16px 12px}
  #review-letters{gap:8px;margin-top:12px}
  .review-box p{margin-top:12px}
  .result-actions{gap:12px}
  .free-dictionary-popover{max-height:calc(100dvh - 40px);width:min(390px,calc(100vw - 32px));padding:18px}
  .free-dictionary-head .icon-button{width:44px;height:44px}
  .free-dictionary-grid{gap:8px}
  dialog{width:calc(100% - 32px);max-height:calc(100dvh - 40px);padding:20px}
  .dialog-head [data-close]{width:44px;height:44px;right:8px;top:8px}
  dialog h2{margin-right:36px;margin-bottom:20px}
}
/* Short portrait screens keep the same controls, with a smaller but stable key. */
@media(max-width:680px) and (max-height:650px) and (orientation:portrait){
  .morse-header{min-height:80px;padding-bottom:3px}
  .game-top{min-height:52px}
  .game-layout{gap:10px;padding:10px 0}
  [data-mode=listen] #listen-question{gap:12px}
  [data-mode=listen]:not(.answered) .game-layout{gap:16px}
  [data-mode=free] .telegraph-mount{--instrument-size:min(280px,calc(100vw - 2 * var(--mobile-edge) - 24px),max(132px,calc(var(--app-height,100dvh) - 440px)));gap:24px}
  #send-controls{gap:12px}
  .free-composer{min-height:56px;padding:5px}
  [data-view=game].answered .game-layout{padding:8px 0;gap:12px}
  [data-mode=send].answered .telegraph-mount{padding-bottom:4px}
  .result-view{gap:12px;padding:12px 0}
}
@media(max-width:360px){
  .level-control select{font-size:11px;padding-left:6px;padding-right:20px}
  .home-bottom{gap:8px}
  .letter-grid:not(.beginner){gap:4px}
}
@media(max-width:340px){
  .letter-grid:not(.beginner){grid-template-columns:repeat(5,minmax(44px,1fr))}
}
/* Wide, low screens get two balanced columns without fixed overlays. */
@media(max-width:960px) and (max-height:500px) and (min-width:480px){
  .morse-header{min-height:60px;padding-bottom:3px}
  .header-main{min-height:44px}
  .brand-logo{height:40px}
  .header-subline{min-height:12px}
  .game-top{min-height:48px}
  [data-view=home]{grid-template-columns:2fr 1fr;gap:16px;padding-top:16px}
  .mode-grid{grid-template-columns:1fr 1fr;gap:16px;height:100%}
  .mode-card,.free-mode-card{min-height:112px;height:100%;padding-left:16px}
  .game-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);align-items:center;gap:24px;padding:8px 0}
  [data-view=game].answered .game-layout{padding:8px 0}
  .interaction-panel{height:auto}
  .game-progress-history .round-history{grid-template-columns:repeat(10,minmax(0,1fr))}
  .telegraph-mount,[data-mode=free] .telegraph-mount,[data-mode=send].answered .telegraph-mount{--instrument-size:clamp(120px,calc(var(--app-height,100dvh) - 270px),220px)}
  [data-mode=free] .telegraph-mount{gap:14px}
  [data-mode=free] .question-panel{min-height:0}
  #send-controls{gap:12px}
  .free-composer{min-height:56px;padding:5px}
  [data-mode=listen] #listen-question{gap:14px}
  .letter-grid{grid-template-columns:repeat(auto-fit,minmax(44px,1fr));gap:6px}
  .letter-grid.beginner{grid-template-columns:repeat(5,minmax(0,1fr))}
  .beginner .letter-button{min-height:48px}
  .result-view{gap:16px;padding:20px 0}
  .result-history{grid-template-columns:repeat(5,minmax(44px,1fr))}
}

/* Access and footer controls. */
.password-field .floating-label{position:absolute;left:14px;top:50%;z-index:1;display:flex;max-width:calc(100% - 70px);align-items:center;gap:9px;margin:0;color:var(--muted);font-size:13px;font-weight:600;line-height:1;pointer-events:none;transform:translateY(-50%);transition:top .16s ease,left .16s ease,color .16s ease,font-size .16s ease}
.password-field input:focus+.floating-label,.password-field input:not(:placeholder-shown)+.floating-label{left:9px;top:0;padding:0 6px;background:var(--white);color:var(--ink);font-size:11px}
.login-secret-morse.morse-code{--morse-size:4px;display:inline-flex;flex:none;min-width:56px;gap:0;color:var(--orange)}
.login-secret-morse .morse-word{flex-wrap:nowrap;gap:3px}
.password-field input:focus+.floating-label .login-secret-morse,.password-field input:not(:placeholder-shown)+.floating-label .login-secret-morse{--morse-size:3px;min-width:44px}
.password-field button{display:grid;place-items:center;width:40px;padding:0;color:var(--muted)}
.password-field button svg{display:block;width:22px;height:22px}
.password-field button[aria-pressed=true]{color:var(--orange-dark)}
.footer-menu #footer-sound{display:inline-flex;align-items:center;gap:7px}
.sound-state{display:grid;place-items:center;width:21px;height:21px;flex:none}
.sound-state svg{display:block;width:21px;height:21px}
.sound-state .sound-off{display:none}
#footer-sound.is-muted{color:var(--orange-dark)}
#footer-sound.is-muted .sound-on{display:none}
#footer-sound.is-muted .sound-off{display:block}

/* In free mode, the decoded letter, its signal and the key form one unit. */
[data-mode=free] .game-layout{display:block;min-height:0;padding:20px 0 32px}
[data-mode=free] .question-panel{display:none}
[data-mode=free] .interaction-panel{width:min(100%,620px);height:auto;margin:0 auto}
[data-mode=free] #send-controls{gap:14px}
[data-mode=free] .telegraph-mount{display:flex;flex:none;min-height:0;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;padding:0 12px 4px;container-type:normal}
[data-mode=free] #send-question{display:flex;flex:none;min-height:88px;flex-direction:row;align-items:center;justify-content:center;gap:20px;margin:0;text-align:center}
[data-mode=free] #question-eyebrow,[data-mode=free] #send-hint{display:none}
[data-mode=free] .target-letter{flex:none;min-width:.75em;margin:0;font-size:clamp(72px,8vw,108px);line-height:.85;letter-spacing:-4px}
[data-mode=free] #send-question .sequence-row{flex:none;width:auto;min-width:116px;min-height:34px;margin:0;padding:0;justify-content:flex-start}
[data-mode=free] #sequence{width:auto;justify-content:flex-start;text-align:left}
[data-mode=free] .telegraph-key,[data-mode=free] .telegraph-key[data-style=telegraph]{flex:none}
[data-mode=free] .feedback{position:static;width:100%;height:auto;min-height:22px;margin:0;padding:0;text-align:center}
[data-mode=free] .feedback>span{font-size:12px;line-height:1.4;font-weight:500}
[data-mode=free] .send-toolbox{flex:none}
[data-mode=free] .free-composer{margin-top:22px}

@media(max-width:680px), (max-width:960px) and (max-height:500px){
  [data-mode=free] .game-layout{padding:8px 0 20px}
  [data-mode=free] .interaction-panel{width:100%}
  [data-mode=free] #send-controls{gap:10px}
  [data-mode=free] .telegraph-mount{gap:6px;padding:0 8px}
  [data-mode=free] #send-question{min-height:64px;gap:14px}
  [data-mode=free] .target-letter{font-size:clamp(56px,9svh,76px)}
  [data-mode=free] #send-question .sequence-row{min-width:96px;min-height:28px}
  [data-mode=free] #sequence{--morse-size:9px}
  [data-mode=free] .feedback{min-height:18px}
  [data-mode=free] .feedback>span{font-size:11px;line-height:18px}
  [data-mode=free] .free-composer{margin-top:18px}
}
