/* Compact, scoped Hangul builder. */
body:has(.hb-app) .sec.tight{padding:20px 0 12px}
body:has(.hb-app) .sec.tight h1{font-size:clamp(26px,4vw,34px)!important;margin-bottom:5px!important}
body:has(.hb-app) .sec.tight p:last-child{font-size:14px!important;max-width:none!important}
body:has(.hb-app) .sec:has(.hb-app){padding-top:12px!important;padding-bottom:24px}
body:has(.hb-app) .wrap.narrow{max-width:1080px}
body:has(.hb-app) .crumb{margin:0 0 8px;font-size:11px}
.hb-app{--hc:#c14a20;--hcl:#fff0e8;--hv:#176b82;--hvl:#e8f6fa;color:#26333e}
.hb-app button{font:inherit;touch-action:manipulation;cursor:pointer}
.hb-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;font-size:12px}
.hb-top p{margin:0;color:#65717d}.hb-options{display:flex;gap:14px;flex-wrap:wrap}.hb-options label{display:flex;align-items:center;gap:5px;cursor:pointer}.hb-options input{accent-color:#c14a20;width:16px;height:16px;margin:0}
.hb-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,1.3fr) minmax(0,1fr);gap:16px;align-items:stretch}
.hb-panel{padding:16px;border:1px solid #e3e7ea;border-radius:20px;background:#fff;min-width:0}
.hb-panel h2{display:flex;align-items:center;gap:8px;margin:0 0 14px;font-size:15px;font-weight:750}.hb-step{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;font-size:12px;background:#f1f2f4}
.hb-consonants h2{color:var(--hc)}.hb-vowels h2{color:var(--hv)}
.hb-letters{display:grid;gap:7px}.hb-consonants .hb-letters{grid-template-columns:repeat(4,minmax(0,1fr))}.hb-vowels .hb-letters{grid-template-columns:repeat(3,minmax(0,1fr))}
.hb-key{min-width:0;min-height:54px;border:1px solid #e3e7ea;border-radius:11px;background:#fff;color:#27333d;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.05;padding:6px 2px;gap:3px}
.hb-key span{font-size:26px;font-family:'Noto Sans KR',sans-serif;font-weight:650}.hb-key small{font-size:10px;color:#65717d;line-height:1}
.hb-consonants .hb-key[aria-pressed=true]{background:var(--hcl);color:var(--hc);border:2px solid var(--hc);padding:5px 1px}
.hb-vowels .hb-key[aria-pressed=true]{background:var(--hvl);color:var(--hv);border:2px solid var(--hv);padding:5px 1px}
.hb-key:hover{background:#f8f8f8}.hb-app button:focus-visible,.hb-app summary:focus-visible{outline:3px solid #7755d0;outline-offset:3px}
.hb-stage{border:1px solid #e5dfd7;border-radius:22px;padding:16px 12px;background:linear-gradient(140deg,#fff9f1,#fff);text-align:center;display:flex;flex-direction:column;justify-content:center;min-width:0}
.hb-formula{font-size:22px;font-weight:700;display:flex;align-items:center;justify-content:center;gap:12px;line-height:1.2}.hb-formula b:first-child{color:var(--hc)}.hb-formula b:last-child{color:var(--hv)}.hb-formula span{font-size:17px;font-weight:400;color:#7c858c}
.hb-assembly{display:flex;align-items:center;justify-content:center;gap:12px;margin:15px 0 10px}
.hb-map{display:grid;grid-template-columns:1fr 1fr;gap:3px;width:88px;height:88px;padding:4px;border:1px dashed #c9c2b8;border-radius:13px;background:#fff}
.hb-map.stacked{grid-template-columns:1fr;grid-template-rows:1fr 1fr}
.hb-map span{border-radius:6px;display:grid;place-items:center;font-size:32px;line-height:1;color:var(--hc);background:var(--hcl);font-family:'Noto Sans KR',sans-serif}.hb-map span+span{color:var(--hv);background:var(--hvl)}
.hb-map.stacked span{font-size:29px}.hb-arrow{color:#aaa198;font-size:20px}.hb-result{min-width:100px}.hb-syllable{font-family:'Noto Sans KR',sans-serif;font-size:86px;font-weight:750;line-height:1.12;display:block;color:#28343a}.hb-roman{font-size:15px;color:#63717b;height:20px;display:block;line-height:20px}
.hb-rule{font-size:13px;line-height:1.45;min-height:38px;margin:0 auto 10px;max-width:260px;color:#596773}.hb-rule b{color:#26333e}.hb-listen{border:0;border-radius:100px;background:#263c45;color:white;padding:11px 25px;min-height:44px;font-weight:700!important;align-self:center;display:flex;align-items:center;gap:8px}.hb-listen svg{width:18px;height:18px}.hb-listen:hover{background:#13556a}.hb-listen[aria-busy=true]{background:#176b82}
.hb-status{font-size:11px;line-height:1.35;min-height:30px;margin:8px 0 0;color:#626d75}.hb-status[data-error=true]{color:#a13021}
.hb-tip{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0 0;padding:12px 16px;background:#edf5f5;border-radius:14px;font-size:13px;line-height:1.5}.hb-tip p{margin:0}.hb-tip button{flex-shrink:0;background:white;color:#18586a;border:1px solid #b9d4d8;border-radius:30px;padding:8px 13px;font-size:12px;min-height:40px}
.hb-help{margin-top:14px;border-top:1px solid #e7e7e7;padding-top:12px;font-size:13px;line-height:1.7}.hb-help summary{cursor:pointer;font-weight:650;color:#56646e}.hb-help p{margin:10px 0}.hb-links{display:flex;justify-content:space-between;gap:10px;font-size:12px;margin-top:16px}
.hb-app.hide-roman .hb-key small{display:none}.hb-app.hide-roman .hb-roman{visibility:hidden}
@keyframes hb-arrive{from{opacity:.3;transform:scale(.88)}to{opacity:1;transform:scale(1)}}.hb-pop{animation:hb-arrive .22s ease-out}
@media(max-width:760px){
body:has(.hb-app) .wrap{padding-left:16px;padding-right:16px}
body:has(.hb-app) .sec.tight{padding:12px 0 4px}
body:has(.hb-app) .sec.tight h1{font-size:26px!important}
body:has(.hb-app) .sec.tight p:last-child{font-size:12px!important;line-height:1.4!important}
body:has(.hb-app) .crumb{display:none}
.hb-top{margin-bottom:8px;justify-content:flex-end;font-size:11px}.hb-top>p{display:none}.hb-options{gap:16px;min-height:24px}
.hb-workspace{grid-template-columns:1fr;gap:8px}.hb-panel{padding:10px 12px;border-radius:15px}.hb-panel h2{font-size:12px;margin-bottom:7px;gap:6px}.hb-step{width:19px;height:19px;font-size:10px}
.hb-consonants .hb-letters{grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.hb-vowels .hb-letters{grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
.hb-key{min-height:44px;padding:4px 1px;border-radius:8px;gap:2px}.hb-key span{font-size:23px}.hb-key small{font-size:9px}.hb-consonants .hb-key[aria-pressed=true],.hb-vowels .hb-key[aria-pressed=true]{padding:3px 0}
.hb-stage{padding:9px 12px;border-radius:16px;display:grid;grid-template-columns:1fr auto;column-gap:10px;align-items:center}
.hb-formula{grid-column:1/-1;font-size:19px;gap:10px}.hb-assembly{grid-column:1;grid-row:2/5;margin:4px 0;gap:8px}.hb-map{height:67px;width:67px}.hb-map span{font-size:27px}.hb-map.stacked span{font-size:23px}.hb-arrow{font-size:16px}.hb-result{min-width:74px}.hb-syllable{font-size:65px}.hb-roman{font-size:12px;height:16px;line-height:16px}
.hb-rule{grid-column:2;grid-row:2;font-size:11px;max-width:135px;min-height:0;margin:3px 0 6px}.hb-listen{grid-column:2;grid-row:3;font-size:12px!important;min-height:40px;padding:8px 18px;justify-self:center}.hb-status{grid-column:1/-1;grid-row:5;font-size:10px;min-height:14px;margin:3px 0 0}
.hb-tip{font-size:11px;margin-top:8px;padding:8px 10px;gap:8px}.hb-tip button{font-size:11px;padding:6px 9px;min-height:36px}.hb-help{margin-top:10px;padding-top:9px;font-size:12px}.hb-links{font-size:11px;margin-top:12px}
}
@media(prefers-reduced-motion:reduce){.hb-pop{animation:none}}
@media(max-width:760px){.hb-rule{max-width:115px}}
@media(max-width:360px){.hb-map{width:54px;height:54px}.hb-map span{font-size:23px}.hb-map.stacked span{font-size:20px}.hb-result{min-width:60px}.hb-syllable{font-size:56px}.hb-assembly{gap:6px}.hb-arrow{font-size:12px}.hb-rule{max-width:104px}.hb-stage{column-gap:6px}.hb-listen{padding:8px 14px}}
.hb-app .hb-key{line-height:1}.hb-app .hb-key span{line-height:1}.hb-app .hb-listen{line-height:1.2}
@media(max-width:760px){.hb-panel h2{line-height:1.2}}
@media(max-width:360px){.hb-panel{padding:8px 10px}.hb-stage{padding:7px 10px}.hb-rule{font-size:10px;line-height:1.3}.hb-top{margin-bottom:6px}}
