/* V1.3.29 — لوحة مفاتيح عربية افتراضية لمستخدمي الكمبيوتر */
.tahadi-arabic-keyboard-trigger-wrap{
    display:flex;
    justify-content:flex-start;
    margin:0 0 14px;
    direction:rtl;
}
.tahadi-arabic-keyboard-trigger{
    appearance:none;
    border:1px solid #bfdbfe;
    background:#eff6ff;
    color:#1d4ed8;
    border-radius:12px;
    padding:10px 15px;
    min-height:44px;
    font:700 15px/1.2 inherit;
    cursor:pointer;
    transition:transform .15s ease,box-shadow .15s ease,background .15s ease;
}
.tahadi-arabic-keyboard-trigger:hover{background:#dbeafe;box-shadow:0 4px 12px rgba(37,99,235,.12)}
.tahadi-arabic-keyboard-trigger:active{transform:translateY(1px)}
.tahadi-arabic-keyboard{
    position:fixed;
    z-index:99990;
    left:50%;
    bottom:18px;
    transform:translateX(-50%);
    width:min(520px,calc(100vw - 20px));
    min-width:260px;
    min-height:120px;
    --kb-scale:1;
    max-width:calc(100vw - 12px);
    max-height:calc(100vh - 12px);
    resize:none;
    touch-action:none;
    padding:calc(9px * var(--kb-scale));
    background:#ffffff;
    border:1px solid #cbd5e1;
    border-radius:calc(14px * var(--kb-scale));
    box-shadow:0 18px 55px rgba(15,23,42,.25);
    direction:rtl;
}
.tahadi-arabic-keyboard[hidden]{display:none!important}
.tahadi-arabic-keyboard-head{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:calc(10px * var(--kb-scale));margin-bottom:calc(7px * var(--kb-scale));color:#0f172a;cursor:move;user-select:none}
.tahadi-arabic-keyboard-head strong{font-size:calc(16px * var(--kb-scale));white-space:nowrap}
.tahadi-arabic-keyboard-hint{font-size:calc(12px * var(--kb-scale));color:#64748b;text-align:center}
.tahadi-keyboard-close{width:calc(34px * var(--kb-scale));height:calc(34px * var(--kb-scale));border:0;border-radius:calc(9px * var(--kb-scale));background:#f1f5f9;color:#334155;font-size:22px;line-height:1;cursor:pointer}
.tahadi-arabic-key-row{display:flex;justify-content:center;gap:calc(5px * var(--kb-scale));margin:calc(5px * var(--kb-scale)) 0;direction:rtl}
.tahadi-arabic-key{flex:1;min-width:0;height:calc(36px * var(--kb-scale));border:1px solid #cbd5e1;border-radius:9px;background:#f8fafc;color:#0f172a;font:700 calc(17px * var(--kb-scale))/1 "Cairo","Tajawal",Arial,sans-serif;cursor:pointer;box-shadow:0 1px 1px rgba(15,23,42,.04)}
.tahadi-arabic-key:hover{background:#e0f2fe;border-color:#93c5fd}
.tahadi-arabic-key:active{transform:translateY(1px);background:#bfdbfe}
.tahadi-arabic-keyboard-actions{display:flex;gap:7px;margin-top:8px}
.tahadi-key-action,.tahadi-key-wide{border:1px solid #cbd5e1;border-radius:9px;min-height:calc(34px * var(--kb-scale));padding:calc(6px * var(--kb-scale)) calc(10px * var(--kb-scale));background:#f8fafc;color:#334155;font-weight:700;cursor:pointer}
.tahadi-key-wide{flex:1}
.tahadi-key-action{min-width:calc(78px * var(--kb-scale))}
.tahadi-key-danger{color:#991b1b;background:#fff1f2;border-color:#fecdd3}
@media(max-width:700px){
    .tahadi-arabic-keyboard{bottom:8px;width:calc(100vw - 12px);padding:9px;border-radius:15px}
    .tahadi-arabic-keyboard-head{grid-template-columns:1fr auto}
    .tahadi-arabic-keyboard-head strong{font-size:14px}
    .tahadi-arabic-keyboard-hint{display:none}
    .tahadi-arabic-key{height:42px;font-size:18px;border-radius:8px}
    .tahadi-arabic-key-row{gap:3px;margin:3px 0}
    .tahadi-key-action{min-width:80px}
}
@media(max-width:430px){
    .tahadi-arabic-key{height:38px;font-size:16px}
    .tahadi-key-action,.tahadi-key-wide{min-height:40px;padding:6px 9px;font-size:13px}
}

.tahadi-arabic-keyboard.is-dragging{cursor:grabbing;user-select:none}
.tahadi-arabic-keyboard.is-dragging .tahadi-arabic-keyboard-head{cursor:grabbing}
.tahadi-arabic-keyboard.is-resizing{user-select:none}
.tahadi-keyboard-resize-handle{
    position:absolute;
    left:4px;
    bottom:4px;
    width:calc(22px * var(--kb-scale));
    height:calc(22px * var(--kb-scale));
    cursor:nwse-resize;
    border-left:3px solid #94a3b8;
    border-bottom:3px solid #94a3b8;
    border-radius:0 0 0 7px;
    opacity:.75;
    touch-action:none;
}
.tahadi-keyboard-resize-handle:hover{opacity:1;border-color:#2563eb}
@media(max-width:700px){
    .tahadi-arabic-keyboard{min-width:0;min-height:0;}
}


/* V1.3.32 — زر لوحة مفاتيح مستقل بجانب كل حقل نص */
.tahadi-arabic-keyboard-field-wrap{
    display:flex!important;
    align-items:center;
    gap:5px;
    flex:1 1 auto;
    min-width:0;
}
.tahadi-arabic-keyboard-field-wrap > input,
.tahadi-arabic-keyboard-field-wrap > textarea{
    flex:1 1 auto!important;
    min-width:0;
}
.tahadi-arabic-keyboard-field-button{
    flex:0 0 32px;
    width:32px;
    height:32px;
    padding:0;
    border:1px solid #bfdbfe;
    border-radius:8px;
    background:#eff6ff;
    color:#1d4ed8;
    font-size:17px;
    line-height:1;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
}
.tahadi-arabic-keyboard-field-button:hover{background:#dbeafe;border-color:#93c5fd}
.tahadi-arabic-keyboard-field-button:active{transform:translateY(1px)}
/* In the room answer rows the keyboard button belongs beside the input,
   while HELP remains a separate action. */
.room-answer-row .tahadi-arabic-keyboard-field-wrap{order:1}
@media(max-width:700px){
    .tahadi-arabic-keyboard-field-button{flex-basis:29px;width:29px;height:29px;font-size:15px}
}
