/* مدير إدخال اللمس الموحّد — public/touch-input.js. مفاتيح كبيرة للأصابع، RTL، لوحة واحدة فقط فوق كل النوافذ. */
.ti-panel { position: fixed; z-index: 3000; background: #e2e8f0; padding: 8px; box-shadow: 0 10px 34px #0f172a55; user-select: none; -webkit-user-select: none; touch-action: manipulation; font-family: inherit; box-sizing: border-box; }
.ti-panel[hidden] { display: none !important; }
/* لوحة النص: بعرض الشاشة، مثبتة أسفلها أو أعلاها — الجهة البعيدة عن الحقل */
.ti-text { left: 0; right: 0; max-height: 62vh; overflow-y: auto; }
.ti-text.ti-dock-bottom { bottom: 0; border-radius: 16px 16px 0 0; }
.ti-text.ti-dock-top { top: 0; border-radius: 0 0 16px 16px; }
/* لوحة الأرقام: بطاقة عائمة بجانب الحقل */
.ti-numeric { width: min(330px, calc(100vw - 20px)); border-radius: 18px; border: 1px solid #94a3b8; }
.ti-head { display: flex; align-items: center; gap: 8px; margin: 0 2px 6px; flex-wrap: wrap; }
.ti-caption { flex: 1 1 60%; min-width: 0; color: #0f172a; font-weight: 700; font-size: 15px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti-prompt-value { order: 3; flex: 1 1 100%; box-sizing: border-box; min-height: 56px; margin: 2px 0 0; padding: 6px 10px; border: 2px solid #0f766e; border-radius: 12px; background: #fff; color: #0f172a; font-size: 32px; font-weight: 800; text-align: center; direction: ltr; caret-color: #0f766e; }
.ti-row { display: flex; gap: 6px; max-width: 1040px; margin: 6px auto; justify-content: center; }
.ti-key { flex: 1; min-width: 0; min-height: 54px; max-width: 86px; padding: 6px 2px; border: 1px solid #94a3b8; border-radius: 10px; background: #fff; color: #0f172a; font: 600 22px/1 inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ti-key:active { background: #bfdbfe; transform: translateY(1px); }
.ti-key.ti-wide { max-width: 170px; font-size: 17px; }
.ti-key.ti-space { max-width: 260px; flex: 2.4; }
.ti-key.ti-erase { color: #9f1239; }
.ti-key.ti-done { background: #0f766e; border-color: #0f766e; color: #fff; font-weight: 800; }
.ti-key.ti-done:active { background: #115e59; }
.ti-key.ti-blank { visibility: hidden; }
.ti-close { flex: 0 0 48px; max-width: 48px; min-height: 44px; font-size: 18px; }
.ti-numeric .ti-row { max-width: none; margin: 7px 0; }
.ti-numeric .ti-key { max-width: none; min-height: 64px; font-size: 30px; }
.ti-numeric .ti-actions .ti-key { min-height: 58px; font-size: 19px; }
/* مساحة سفلية حتى يمكن تمرير الحقول فوق لوحة النص المثبتة أسفل الشاشة */
body.ti-reserve-bottom #app:not(.pos-mode) main, body.ti-reserve-bottom .modal-card { padding-bottom: var(--ti-reserve, 380px); }
/* 0.5.23 (المالك): في شاشة البيع لوحة النص المثبتة أسفل الشاشة كانت تغطي شريط الأزرار (تحصيل ذمم، علّق، طباعة…) — تُحجز مساحتها تحت الشاشة فيصغر جدول السلة
   وتبقى الأزرار والملخص ظاهرين فوقها، ومفاتيحها أقصر هناك حتى لا تأكل الشاشة. */
body.ti-reserve-bottom .app.pos-mode #posView { padding-bottom: calc(var(--ti-reserve, 320px) - 10px); }
body:has(.app.pos-mode) .ti-text .ti-key { min-height: 44px; font-size: 19px; }
body:has(.app.pos-mode) .ti-text .ti-row { margin: 4px auto; }
body:has(.app.pos-mode) .ti-text .ti-head { margin-bottom: 4px; }
/* لوحة البيع الخاصة (خانة المبلغ) لا تظهر مع لوحة لمس مفتوحة — لا لوحتا أرقام معًا */
.touch-keyboard-open #posKeypad { visibility: hidden; }
/* زر فتح اللوحة يدويًا (للفأرة) وتخطيط شاشة الدخول */
.touch-keyboard-toggle { position: fixed; z-index: 1100; right: 8px; bottom: 8px; min-height: 44px; padding: 8px 14px; background: #eef2ff; color: #172554; border: 1px solid #94a3b8; border-radius: 10px; }
.touch-keyboard-toggle[hidden] { display: none; }
.login-keyboard-toggle { min-height: 48px; background: #eef2ff; color: #172554; border: 1px solid #c7d2fe; }
.login-window-control { position: static; min-height: 48px; flex-shrink: 0; margin: 4px; background: #fff; color: #172554; border: 1px solid #94a3b8; padding: 10px 16px; border-radius: 10px; }
.login-keyboard-open .login-view { align-items: flex-start; padding-top: 68px; padding-bottom: 370px; height: auto; min-height: 100vh; }
.login-keyboard-open .login-card { margin-top: 0; }
@media (max-height: 760px) {
 .login-keyboard-open .login-view { padding-top: 64px; }
 .login-keyboard-open .login-card { padding: 12px 24px; }
 .login-keyboard-open .login-card h1, .login-keyboard-open .login-card .muted { display: none; }
 .ti-key { min-height: 46px; }
 .ti-numeric .ti-key { min-height: 56px; }
}
@media print { .ti-panel, .touch-keyboard-toggle, .login-window-control, .login-keyboard-toggle { display: none !important; } }
/* 0.4.74: نافذة <dialog> (سبب الإرجاع وغيرها) واللوحة داخلها: النافذة تطلع لفوق وتتقلص فوق اللوحة، فيبقى الحقل وأزرار «تأكيد / رجوع» ظاهرة */
dialog.ti-raised[open]{margin:12px auto auto}
body.touch-keyboard-open dialog.ti-raised[open]{max-height:calc(100dvh - var(--ti-reserve, 50vh) - 24px);overflow:auto}
