/* One optional touch keyboard for editable fields, including dialog forms. */
body .ma-touch-keyboard,body .ma-touch-keyboard *{box-sizing:border-box}
body .ma-dialog.ma-touch-keyboard{width:760px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);margin:auto;padding:20px;box-sizing:border-box;overflow:auto;overscroll-behavior:contain;border:1px solid #e3e9e2;border-radius:22px;background:#fff;color:#253c37;box-shadow:0 22px 80px #253c3730;font-family:'IBM Plex Sans Arabic',Tahoma,Arial,sans-serif;line-height:1.6;scroll-padding-top:86px}
body .ma-dialog.ma-touch-keyboard[data-kind=numeric]{width:380px}
body .ma-touch-keyboard[hidden],body .ma-touch-keyboard [hidden],body .ma-field-keyboard[hidden]{display:none!important}
body .ma-touch-keyboard::backdrop{background:#253c3766;backdrop-filter:blur(2px)}
body #maKeyboardDialog>.ma-dialog-head{display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;z-index:2;margin:0 0 14px;padding:0 0 14px;gap:10px;background:#fff;border-bottom:1px solid #e3e9e2}
body #maKeyboardDialog>.ma-dialog-head::before{content:"";position:absolute;inset-inline:0;top:-20px;height:20px;background:inherit;pointer-events:none}
body .ma-touch-keyboard .ma-dialog-head h3{margin:0;color:inherit;font-size:20px;font-weight:700;line-height:1.5;overflow-wrap:anywhere}
body .ma-touch-keyboard .ma-dialog-head button{flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0!important;border:0!important;border-radius:50%!important;background:#f5f6f2!important;color:#253c37;font-size:25px!important;line-height:1}
body .ma-touch-keyboard button{font-family:inherit;touch-action:manipulation;cursor:pointer}
body .ma-touch-keyboard .ma-keyboard-input{display:block;width:100%;height:56px;min-height:56px;box-sizing:border-box;margin:0;padding:10px 14px;border:1px solid #aac9b9;border-radius:12px;background:#f4f8f5;color:#253c37;font-family:inherit;font-size:22px;font-weight:600;line-height:1.5;outline:none}
body .ma-touch-keyboard .ma-keyboard-input:focus{border-color:#528c73;box-shadow:0 0 0 3px #dcebe3}
body .ma-touch-keyboard .ma-keyboard-multiline{height:108px;min-height:96px;max-height:180px;resize:vertical}
body .ma-touch-keyboard[data-kind=numeric] .ma-keyboard-input{direction:ltr;text-align:center;font-size:28px;font-variant-numeric:tabular-nums}
body .ma-touch-keyboard .ma-keyboard-modes{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:14px 0}
body .ma-touch-keyboard .ma-keyboard-modes button{min-width:56px;min-height:44px;padding:8px 14px;border:1px solid #dce6df;border-radius:10px;background:#f5f7f4;color:#476355;font-size:15px;font-weight:600}
body .ma-touch-keyboard .ma-keyboard-modes button[aria-pressed=true]{background:#e4f1e9;border-color:#78aa91;color:#225d46}
body .ma-touch-keyboard[data-kind=numeric] .ma-keyboard-modes{display:none}
body .ma-touch-keyboard .ma-keyboard-keys{display:grid;gap:7px;margin-top:14px;direction:ltr}
body .ma-touch-keyboard .ma-keyboard-row,body .ma-touch-keyboard .ma-keyboard-actions{display:flex;gap:7px;justify-content:center}
body .ma-touch-keyboard .ma-keyboard-key{display:flex;align-items:center;justify-content:center;flex:1 1 0;min-width:0;min-height:48px;padding:8px 5px;border:1px solid #d7e2d9;border-radius:10px;background:#fff;color:#29463a;box-shadow:0 3px 0 #e0e7df;font-size:21px;font-weight:600;line-height:1.25;user-select:none}
body .ma-touch-keyboard .ma-keyboard-key:is([data-action],[data-keyboard-action]){background:#edf3ee;color:#426455;font-size:15px}
body .ma-touch-keyboard .ma-keyboard-key:is([data-action=space],[data-keyboard-action=space]){flex-grow:3}
body .ma-touch-keyboard .ma-keyboard-key:hover{background:#eaf4ed;border-color:#93b7a1}
body .ma-touch-keyboard .ma-keyboard-key:active{transform:translateY(2px);box-shadow:none}
body .ma-touch-keyboard button:focus-visible{outline:2px solid #528c73;outline-offset:2px}
body .ma-touch-keyboard .ma-keyboard-keys[data-layout=numeric]{width:100%;max-width:420px;margin-inline:auto}
body .ma-touch-keyboard .ma-keyboard-keys[data-layout=numeric] .ma-keyboard-key{min-height:54px;font-size:23px}
body .ma-touch-keyboard .ma-keyboard-keys[data-layout=numeric] .ma-keyboard-key:is([data-action],[data-keyboard-action]){font-size:15px}
body .ma-touch-keyboard .ma-keyboard-error{margin:14px 0 0;padding:10px 12px;border-radius:10px;background:#fff0f3;color:#9b263b;font-size:14px}
body .ma-touch-keyboard .ma-keyboard-footer{display:flex;gap:12px;justify-content:space-between;margin-top:18px;padding-top:14px;border-top:1px solid #e3e9e2}
body .ma-touch-keyboard .ma-keyboard-footer .btn{display:inline-flex;align-items:center;justify-content:center;flex:1;min-height:48px;width:auto;margin:0;padding:10px 16px;border:1px solid #e3e9e2;border-radius:12px;font-size:16px;font-weight:600}
body .ma-touch-keyboard .ma-keyboard-footer .btn-primary{background:#276e5b;color:#fff;border-color:#276e5b}
body .ma-touch-keyboard .ma-keyboard-footer .btn-outline-secondary{background:#fff;color:#253c37}

/* Launchers are positioned by the field's geometry, without changing form markup. */
body [data-keyboard-host]{position:fixed;inset:0;z-index:1080;display:block;margin:0;padding:0;border:0;background:transparent;overflow:visible;pointer-events:none}
body dialog>[data-keyboard-host]{position:absolute;z-index:30}
body .ma-keyboard-enabled-field{padding-inline-end:52px!important}
body .ma-field-keyboard{position:absolute;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;min-width:40px;min-height:40px;box-sizing:border-box;margin:0;padding:0;border:1px solid #d5e6dc;border-radius:10px;background:#eaf3ee;color:#276e5b;box-shadow:0 2px 0 #d8e5dc;pointer-events:auto;cursor:pointer;touch-action:manipulation;font-family:inherit;line-height:1}
body .ma-field-keyboard.ma-field-keyboard-floating{position:fixed;width:44px;height:44px;min-width:44px;min-height:44px;box-shadow:0 3px 0 #d8e5dc,0 6px 18px #253c3726}
body .ma-field-keyboard>svg{display:block;width:23px;height:23px;pointer-events:none}
body .ma-field-keyboard:hover{background:#dcebe3;border-color:#82ac9a}
body .ma-field-keyboard:active{box-shadow:none}
body .ma-field-keyboard:focus-visible{outline:2px solid #276e5b;outline-offset:2px}
@media(pointer:coarse){body .ma-field-keyboard{width:44px;height:44px;min-width:44px;min-height:44px}}

html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body .ma-dialog.ma-touch-keyboard{background:var(--night-panel,#1c272c);color:var(--night-ink,#e2ede8);border-color:var(--night-line,#38494f);color-scheme:dark}
html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body .ma-touch-keyboard::backdrop{background:#050b10a6}
html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body #maKeyboardDialog>.ma-dialog-head{background:var(--night-panel,#1c272c);border-color:var(--night-line,#38494f)}
html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body .ma-touch-keyboard .ma-dialog-head button{background:var(--night-raised,#243239)!important;color:var(--night-ink,#e2ede8)!important}
html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body .ma-touch-keyboard .ma-keyboard-input{background:var(--night-input,#172126);color:var(--night-ink,#e2ede8);border-color:var(--night-line,#38494f)}
html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body .ma-touch-keyboard .ma-keyboard-input:focus{border-color:#82ac9a;box-shadow:0 0 0 3px #82ac9a26}
html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body .ma-touch-keyboard :is(.ma-keyboard-key,.ma-keyboard-modes button){background:var(--night-raised,#243239);color:var(--night-ink,#e2ede8);border-color:var(--night-line,#38494f);box-shadow:0 3px 0 #0005}
html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body .ma-touch-keyboard :is(.ma-keyboard-key:hover,.ma-keyboard-modes button[aria-pressed=true]){background:var(--night-soft,#243d35);color:var(--night-green,#9bd7b8);border-color:#6d9a82}
html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body .ma-touch-keyboard .ma-keyboard-footer{border-color:var(--night-line,#38494f)}
html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body .ma-touch-keyboard .ma-keyboard-footer .btn-outline-secondary{background:var(--night-raised,#243239);color:var(--night-ink,#e2ede8);border-color:var(--night-line,#38494f)}
html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body .ma-touch-keyboard .ma-keyboard-error{background:#422832;color:#ffc0cc!important}
html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body .ma-field-keyboard{background:var(--night-raised,#243239);color:var(--night-ink,#e2ede8);border-color:var(--night-line,#38494f);box-shadow:0 2px 0 #0005}
html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body .ma-field-keyboard:hover{background:var(--night-soft,#243d35);border-color:#82ac9a}
html:is([data-maleka-theme=dark],[data-maleka-theme=oled]) body :is(.ma-touch-keyboard button,.ma-field-keyboard):focus-visible{outline-color:#82ac9a}

@media(max-width:540px){
 body .ma-dialog.ma-touch-keyboard{max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:8px;border-radius:16px}
 body #maKeyboardDialog>.ma-dialog-head{padding:4px 4px 10px;margin-bottom:12px}
 body #maKeyboardDialog>.ma-dialog-head::before{top:-8px;height:8px}
 body .ma-touch-keyboard .ma-dialog-head h3{font-size:18px}
 body .ma-touch-keyboard .ma-keyboard-modes{gap:5px}
 body .ma-touch-keyboard .ma-keyboard-modes button{min-width:44px;padding:8px 10px}
 body .ma-touch-keyboard .ma-keyboard-keys:not([data-layout=numeric]){grid-template-columns:repeat(8,minmax(0,1fr));gap:4px}
 body .ma-touch-keyboard .ma-keyboard-keys:not([data-layout=numeric]) :is(.ma-keyboard-row,.ma-keyboard-actions){display:contents}
 body .ma-touch-keyboard .ma-keyboard-key{width:100%;justify-self:stretch;min-height:44px;padding:8px 2px;font-size:18px;border-radius:7px}
 body .ma-touch-keyboard .ma-keyboard-keys:not([data-layout=numeric]) .ma-keyboard-key:is([data-action],[data-keyboard-action]){grid-column:span 2;font-size:13px}
 body .ma-touch-keyboard .ma-keyboard-keys:not([data-layout=numeric]) .ma-keyboard-key:is([data-action=space],[data-keyboard-action=space]){grid-column:span 4}
 body .ma-touch-keyboard .ma-keyboard-footer{gap:8px;margin-top:14px;padding-top:12px}
}
@media print{body .ma-touch-keyboard,body [data-keyboard-host],body .ma-field-keyboard{display:none!important}}
