.writing-panel{max-width:1000px;margin:auto}.writing-panel>p{margin-bottom:12px}writing-keyboard{display:block;position:relative;padding:14px;border:1px solid #c3d9ef;border-radius:22px;background:linear-gradient(145deg,#eef8ff,#dcecff);margin-bottom:16px;color:#294f7b}.wk-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}.wk-heading strong{font-size:18px}.wk-heading span{font-size:13px}.wk-grid{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:8px}.wk-grid button,.wk-toolbar button,.wk-accents button{display:flex;align-items:center;justify-content:center;min-width:0;min-height:58px;padding:8px 4px;border:1px solid #b7cee6;border-bottom:4px solid #aec4df;border-radius:14px;background:linear-gradient(#fff,#f6faff);color:#255a94;font:800 clamp(24px,3.6vw,38px)/1.1 system-ui;box-shadow:0 3px 5px #36619412;touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.wk-grid button:active,.wk-toolbar button:active,.wk-accents button:active{background:#cbeaff;transform:translateY(1px)}.wk-toolbar{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}.wk-toolbar button{min-width:64px;font-size:20px;min-height:50px;padding:8px 12px}.wk-toolbar .wk-mode{background:linear-gradient(#368edd,#2464aa);color:white;border-color:#2670b3}.wk-toolbar .wk-space{flex:1}.wk-toolbar [aria-pressed=false]{background:#fff4d8}.wk-numbers{grid-template-columns:repeat(5,minmax(0,1fr))}.wk-symbols{grid-template-columns:repeat(8,minmax(0,1fr))}.wk-symbols button{font-size:27px}.wk-accents{position:absolute;z-index:20;max-width:100%;padding:8px;border:2px solid #5f9ad4;border-radius:16px;background:white;box-shadow:0 6px 20px #264e7d40}.wk-accents>span{display:block;margin-bottom:5px;font-size:13px}.wk-accents>div{display:flex;gap:5px;flex-wrap:wrap}.wk-accents button{min-width:44px;min-height:50px;font-size:26px;padding:5px 10px}.wk-status:empty{display:none}.wk-status{padding-top:8px}.writing-panel #typed-text{font-size:clamp(24px,4vw,36px);min-height:100px;background:#fff;cursor:text}.writing-panel #typed-text:focus{outline:3px solid #75b5ed}writing-keyboard button:focus-visible{outline:3px solid #164e8c;outline-offset:2px}.high-contrast writing-keyboard,.high-contrast writing-keyboard button{background:white;color:#152f4e;border-color:#152f4e}
@media(max-width:600px){writing-keyboard{padding:10px;border-radius:16px}.wk-heading{align-items:flex-start;flex-direction:column;gap:3px}.wk-heading span{font-size:12px}.wk-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.wk-grid button{min-height:48px;font-size:27px;border-radius:11px}.wk-toolbar{gap:6px}.wk-toolbar button{font-size:17px;min-height:48px;min-width:54px;padding:6px 8px}.wk-symbols{grid-template-columns:repeat(5,minmax(0,1fr))}.wk-symbols button{font-size:23px}.wk-accents button{min-width:40px;padding:5px;font-size:24px}.wk-accents{padding:6px}.writing-panel{padding:14px}.writing-panel #typed-text{min-height:94px}}
@media(prefers-reduced-motion:reduce){writing-keyboard *{transition:none!important}}

/* Stable QWERTY rows and semantic color groups. */
.wk-grid.wk-letters{display:flex;flex-direction:column;gap:8px}.wk-qwerty-row{display:flex;gap:8px;justify-content:center;width:100%;margin:auto}.wk-qwerty-row:nth-child(2){width:97%}.wk-qwerty-row:nth-child(3){width:86%}.wk-qwerty-row button{flex:1;min-width:0}.wk-grid .wk-vowel,.wk-legend .wk-vowel{background:#d9efff;color:#214e7a;border-color:#95bfdf}.wk-grid .wk-consonant,.wk-legend .wk-consonant{background:#fff;color:#294f7b}.wk-grid .wk-number,.wk-legend .wk-number{background:#dff3df;color:#295c3e;border-color:#9fc7a6}.wk-grid .wk-symbol,.wk-legend .wk-symbol{background:#fff1c9;color:#65501d;border-color:#d6c17f}.wk-grid .wk-accent,.wk-legend .wk-accent,.wk-accents button:not([data-wk-action=dismiss]),.wk-toolbar [data-wk-action=accents]{background:#eee2ff;color:#634084;border-color:#c3a9df}.wk-toolbar [data-wk-action=space],.wk-toolbar [data-wk-action=case],.wk-toolbar [data-wk-action=letters],.wk-toolbar [data-wk-action=page],.wk-grid [data-wk-action=backspace]{background:#356da9;color:#fff;border-color:#24558c}.wk-legend{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}.wk-legend span{font-size:11px;line-height:1.2;padding:4px 7px;border-radius:7px;border:1px solid #c3d5e5}.wk-accents{background:#faf6ff;border-color:#ac8bcf}
@media(max-width:600px){.wk-grid.wk-letters{gap:7px}.wk-qwerty-row{gap:3px}.wk-qwerty-row button{font-size:clamp(16px,4.6vw,25px);padding:8px 0;min-height:54px;border-radius:8px;border-bottom-width:3px}.wk-qwerty-row:nth-child(2){width:98%}.wk-qwerty-row:nth-child(3){width:88%}.wk-legend{gap:4px}.wk-legend span{font-size:10px;padding:3px 5px}}
.high-contrast writing-keyboard button,.high-contrast .wk-legend span{background:#fff;color:#152f4e;border-color:#152f4e}
