.tp-touch-keyboard{position:fixed;left:50%;bottom:8px;z-index:120000;width:min(560px,calc(100vw - 28px));transform:translate(-50%,110%);opacity:0;pointer-events:none;background:linear-gradient(180deg,var(--bg1,#121215),var(--bg2,#18181c));border:1px solid var(--br2,rgba(255,255,255,.12));border-radius:12px;box-shadow:0 18px 44px rgba(0,0,0,.45);padding:6px;display:grid;gap:4px;transition:transform .14s ease,opacity .14s ease;color:var(--t1,#fafafa)}
.tp-touch-keyboard.is-visible{transform:translate(-50%,0);opacity:1;pointer-events:auto}
.tp-touch-keyboard *{box-sizing:border-box}
.tp-touch-kb-head{display:flex;align-items:center;gap:5px}
.tp-touch-kb-tabs{display:flex;gap:4px;flex:1}
.tp-touch-kb-tab,.tp-touch-key{height:27px;border:1px solid var(--br,rgba(255,255,255,.08));background:var(--bg2,#18181c);color:var(--t1,#fafafa);border-radius:8px;font-size:11px;font-weight:850;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;user-select:none;-webkit-user-select:none;touch-action:manipulation}
.tp-touch-kb-tab{padding:0 8px;min-width:38px;color:var(--t2,#a1a1aa)}
.tp-touch-kb-tab.is-active{background:rgba(37,99,235,.22);border-color:rgba(96,165,250,.48);color:#93c5fd}
.tp-touch-kb-close{width:30px;padding:0}
.tp-touch-kb-row{display:grid;grid-template-columns:repeat(var(--cols,10),minmax(0,1fr));gap:4px}
.tp-touch-key{height:31px;min-width:0;font-size:13px}
.tp-touch-key:active,.tp-touch-kb-tab:active{transform:translateY(1px);background:rgba(37,99,235,.28)}
.tp-touch-key.action{font-size:12px;color:#bfdbfe;background:rgba(37,99,235,.14);border-color:rgba(96,165,250,.34)}
.tp-touch-key.danger{color:#fecaca;background:rgba(239,68,68,.13);border-color:rgba(248,113,113,.30)}
.tp-touch-key.wide{grid-column:span 2}
.tp-touch-key.space{grid-column:span 4}
.tp-touch-key.enter{grid-column:span 2;color:#bbf7d0;background:rgba(16,185,129,.14);border-color:rgba(52,211,153,.34)}
body.tp-touch-keyboard-open .work{padding-bottom:182px}
body.auth-body.tp-touch-keyboard-open .auth-shell{padding-bottom:180px}
body.auth-body .tp-touch-keyboard{--bg1:var(--auth-panel,#121215);--bg2:var(--auth-panel-2,#18181c);--br:var(--auth-line,rgba(255,255,255,.08));--br2:var(--auth-line-2,rgba(255,255,255,.16));--t1:var(--auth-text,#fafafa);--t2:var(--auth-muted,#a1a1aa)}
.light .tp-touch-keyboard,body.auth-light .tp-touch-keyboard{--bg1:#ffffff;--bg2:#f1f5f9;--br:#e2e8f0;--br2:#cbd5e1;--t1:#09090b;--t2:#475569;box-shadow:0 18px 48px rgba(0,0,0,.08)}
.light .tp-touch-key.action,body.auth-light .tp-touch-key.action{background:#dbeafe;color:#1d4ed8;border-color:#93c5fd}
.light .tp-touch-key.enter,body.auth-light .tp-touch-key.enter{background:#ccfbf1;color:#0f766e;border-color:#5eead4}
.light .tp-touch-key.danger,body.auth-light .tp-touch-key.danger{background:#fee2e2;color:#dc2626;border-color:#fca5a5}
.tp-touch-keyboard[data-mode="num"]{width:min(300px,calc(100vw - 24px));left:auto;right:16px;transform:translate(0,110%)}
.tp-touch-keyboard[data-mode="num"].is-visible{transform:translate(0,0)}
.tp-touch-keyboard[data-mode="num"] .tp-touch-kb-row{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.tp-touch-keyboard[data-mode="num"] .tp-touch-key.space,.tp-touch-keyboard[data-mode="num"] .tp-touch-key.enter,.tp-touch-keyboard[data-mode="num"] .tp-touch-key.wide{grid-column:span 1}
.touch-toggle-btn.is-active{border-color:rgba(245,158,11,.75)!important;background:rgba(245,158,11,.14)!important;color:#f59e0b!important}
@media(max-width:700px){.tp-touch-keyboard{bottom:6px;width:calc(100vw - 12px);border-radius:12px;padding:6px}.tp-touch-key{height:30px;font-size:12px}.tp-touch-kb-row{gap:4px}.tp-touch-kb-tab{height:27px;padding:0 7px}.tp-touch-keyboard .hide-sm{display:none}.tp-touch-keyboard[data-mode="num"]{width:min(290px,calc(100vw - 12px));right:6px}}
@media(max-height:650px){.tp-touch-key{height:28px}.tp-touch-keyboard{gap:3px;padding:5px}body.tp-touch-keyboard-open .work{padding-bottom:165px}body.auth-body.tp-touch-keyboard-open .auth-shell{padding-bottom:165px}}
