:root{font:18px/1.3 "Segoe UI",Arial,sans-serif;color:#173957;background:#edf3fa}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0}button,select,textarea,.button{font:inherit}button,.button{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:8px 12px;border:2px solid #a6bdd4;border-radius:12px;background:white;color:#173957;font-weight:650;text-decoration:none;cursor:pointer;touch-action:manipulation}button:disabled{background:#e4e8ed;color:#586472;cursor:not-allowed}button:focus-visible,a:focus-visible,select:focus-visible,textarea:focus-visible{outline:4px solid #bd7400;outline-offset:2px}header{height:60px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 16px;background:#173c69;color:white}header h1{font-size:26px;margin:0}header span{font-size:16px}main{height:calc(100dvh - 60px);padding:10px;display:grid;grid-template-rows:minmax(0,1fr) 108px 86px;gap:10px;max-width:2000px;margin:auto}.communication-top{display:grid;grid-template-columns:42% minmax(0,1fr);gap:12px;min-height:0}.phrase-board{display:grid;grid-template-rows:50px minmax(0,1fr);gap:8px;min-height:0}.phrase-board>section{min-height:0;display:flex}.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr;gap:8px;width:100%;min-height:0}#categories{display:flex;gap:6px;min-width:0}#categories button{flex:1;min-width:0;padding:4px;font-size:clamp(13px,1.2vw,18px)}#categories button[aria-pressed=true]{background:#173c69;color:white}.tile{display:flex;align-items:center;gap:10px;font-size:clamp(17px,1.7vw,25px);padding:8px;min-width:0;min-height:0;overflow-wrap:anywhere;border-bottom-width:5px}.tile .symbol{font-size:27px}.tile[data-color="0"]{background:#e1efff;border-color:#82add4}.tile[data-color="1"]{background:#e5f2d9;border-color:#9ebc7d}.tile[data-color="2"]{background:#ffedce;border-color:#d5af65}.tile[data-color="3"]{background:#f1e5fa;border-color:#bba0cf}.tile[data-color="4"]{background:#ffe6e4;border-color:#d3a09a}.tile.selected{outline:3px solid #173c69;outline-offset:-5px}.keyboard-card{display:grid;grid-template-rows:48px minmax(0,1fr);gap:8px;background:white;border:1px solid #c6d5e6;border-radius:14px;padding:8px;min-height:0}.keyboard-card>.actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.keyboard-card h2{font-size:20px;margin:0}#keyboard{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-rows:1fr;gap:6px;min-height:0}#keyboard button{padding:3px;min-width:0;min-height:0;font-size:clamp(18px,1.8vw,26px)}.space{grid-column:span 4}.backspace{grid-column:span 3}.message-card{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:minmax(0,1fr) 23px;gap:5px 10px;background:white;border:1px solid #c6d5e6;border-radius:14px;padding:8px}.message-card textarea{width:100%;height:100%;resize:none;min-height:0;padding:8px;border:2px solid #90aaca;border-radius:10px;font-size:23px;color:#173957}.message-card .actions{display:flex;gap:7px}.message-card button{padding:8px 12px}.primary{background:#155eaa;color:white;border-color:#155eaa}.stop{background:#a4343d;color:white;border-color:#a4343d}#status{grid-column:1/-1;margin:0;font-size:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.bottom-settings{display:flex;align-items:end;gap:12px;background:#dce8f5;padding:8px;border-radius:12px;min-width:0}.settings-grid{display:grid;grid-template-columns:minmax(110px,.8fr) minmax(0,1.6fr) minmax(140px,1.2fr) minmax(100px,.6fr);gap:10px;flex:1;min-width:0}label{font-size:16px;font-weight:650;min-width:0}select{display:block;width:100%;max-width:100%;min-height:48px;margin-top:3px;border:2px solid #91a9c3;border-radius:10px;background:white;color:#172e48;font-size:17px;padding:6px}#settings-toggle{height:48px;white-space:nowrap}#message-label,#category-title{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}dialog{max-width:850px;width:90vw;max-height:90dvh;overflow:auto;border:2px solid #819ab4;border-radius:18px;padding:20px;color:#173957;background:white}dialog::backdrop{background:#10274099}dialog .actions{display:flex;flex-wrap:wrap;gap:12px}#close-settings{float:right}dialog p{clear:both}.empty{grid-column:1/-1;background:white;padding:16px;border-radius:12px}.high{background:white;color:black}.high .tile,.high section,.high button,.high textarea,.high select{border-color:black}.high header{background:black}.large .tile{font-size:clamp(20px,2vw,30px)}.large #keyboard button{font-size:30px}
@media(max-width:1050px){header span{display:none}.message-card{grid-template-columns:minmax(0,1fr) auto}.message-card button{font-size:16px;padding:5px 8px}.settings-grid{gap:6px}.bottom-settings{gap:6px}select{font-size:15px}#settings-toggle{font-size:15px}.tile .symbol{display:none}}
@media(max-width:800px),(max-height:580px){header{height:auto;min-height:60px}main{height:auto;grid-template-rows:auto auto auto}.communication-top{grid-template-columns:1fr}.phrase-board{min-height:370px}.keyboard-card{min-height:350px}#keyboard{grid-template-columns:repeat(10,minmax(0,1fr))}.message-card{grid-template-columns:1fr;grid-template-rows:70px auto 24px}.message-card .actions{flex-wrap:wrap}.message-card button{flex:1;min-height:48px}.bottom-settings{align-items:stretch;flex-wrap:wrap}.settings-grid{grid-template-columns:repeat(2,minmax(0,1fr));flex-basis:100%}#settings-toggle{width:100%}.tile{min-height:65px}}
@media(max-width:450px){header h1{font-size:22px}#keyboard{grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-rows:50px}.keyboard-card{min-height:0}.phrase-board{min-height:400px}.space,.backspace{grid-column:span 3}#categories{flex-wrap:wrap}.phrase-board{grid-template-rows:auto 1fr}#categories button{min-width:75px}}

.tile>span:not(.symbol){display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}.tile{overflow:hidden}

#keyboard{display:flex;flex-direction:column;gap:5px}.key-row{display:flex;justify-content:center;gap:5px;flex:1;min-height:38px}.key-row button{flex:1;max-width:10%;min-height:38px!important}.key-actions button{max-width:none;flex:1;font-size:16px!important}@media(max-width:800px){.key-row{gap:3px}.key-row button{min-height:44px!important}.key-actions button{font-size:13px!important}}
