#tof-root { all: initial; display: block; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 15px; line-height: 1.5; color: #1e293b; }
#tof-root * { box-sizing: border-box; }
.tof-wrapper { max-width: 600px; margin: 0 auto; padding: 28px 22px; background: #fff; border-radius: 22px; box-shadow: 0 4px 6px rgba(0,0,0,.04), 0 20px 48px rgba(0,0,0,.09); }
.tof-step { display: none; animation: tofIn .3s ease; }
.tof-step.active { display: block; }
@keyframes tofIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.tof-step-header { text-align: center; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 2px solid #f1f5f9; }
.tof-step-header h2 { margin: 0; font-size: 22px; font-weight: 800; color: #0f172a; letter-spacing: -.3px; }
.tof-step-header p { margin: 6px 0 0; color: #94a3b8; font-size: 14px; }
.tof-progress { display: flex; gap: 6px; margin-bottom: 28px; }
.tof-progress-dot { flex: 1; height: 4px; border-radius: 99px; background: #e2e8f0; transition: .3s; }
.tof-progress-dot.active { background: #3b82f6; }
.tof-progress-dot.done { background: #10b981; }
.tof-label { display: block; font-size: 13px; font-weight: 700; color: #64748b; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.tof-select { width: 100%; padding: 14px 16px; border: 2px solid #e2e8f0; border-radius: 12px; font-size: 16px; background: #f8fafc; color: #0f172a; outline: none; transition: .2s; font-family: inherit; }
.tof-select:focus { border-color: #3b82f6; background: #fff; box-shadow: 0 0 0 4px rgba(59,130,246,.12); }
.tof-textarea { width: 100%; padding: 14px 16px; border: 2px solid #e2e8f0; border-radius: 12px; font-size: 15px; background: #f8fafc; font-family: inherit; resize: vertical; min-height: 90px; outline: none; transition: .2s; }
.tof-textarea:focus { border-color: #3b82f6; background: #fff; box-shadow: 0 0 0 4px rgba(59,130,246,.12); }
.tof-section { margin-bottom: 32px; }
.tof-section h3 { display: flex; align-items: center; font-size: 17px; color: #1e293b; margin: 0 0 14px; font-weight: 800; }
.tof-icon { display: inline-flex; align-items: center; justify-content: center; background: #f1f5f9; border-radius: 10px; padding: 7px 11px; margin-right: 10px; font-size: 20px; transition: .3s; }
.tof-icon.icon-update { opacity: .4; transform: scale(.85); }
.tof-row { background: #fff; border: 2px solid #e2e8f0; border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; transition: .15s; }
.tof-row:hover { border-color: #bfdbfe; box-shadow: 0 2px 12px rgba(59,130,246,.08); }
.tof-row > span { flex: 1; font-size: 15px; font-weight: 500; color: #334155; line-height: 1.35; padding-right: 12px; }
.tof-input-group-inline { display: flex; align-items: center; }
.tof-unit { font-size: 13px; color: #94a3b8; font-weight: 700; margin-left: 7px; min-width: 26px; }
.tof-qty { width: 72px; height: 44px; border: 2px solid #e2e8f0; border-radius: 10px; text-align: center; font-size: 17px; font-weight: 700; color: #0f172a; background: #f8fafc; outline: none; transition: .2s; font-family: inherit; }
.tof-qty:focus { border-color: #3b82f6; background: #fff; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.tof-qty::-webkit-inner-spin-button, .tof-qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tof-qty[type=number] { -moz-appearance: textfield; }
.tof-row-multi { flex-direction: column; align-items: stretch; }
.tof-row-multi > span { margin-bottom: 12px; font-size: 16px; }
.tof-multi-inputs { display: flex; gap: 6px; }
.tof-multi-group { display: flex; flex-direction: column; align-items: center; flex: 1; }
.tof-multi-group label { font-size: 12px; color: #94a3b8; font-weight: 700; margin-bottom: 5px; white-space: nowrap; }
.tof-multi-group .tof-qty { width: 100%; min-width: 42px; }
.tof-snack-row { background: #fff; border: 2px solid #e2e8f0; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tof-input { flex: 1; min-width: 130px; height: 44px; padding: 0 14px; border: 2px solid #e2e8f0; border-radius: 10px; font-size: 15px; background: #f8fafc; outline: none; font-family: inherit; color: #0f172a; }
.tof-input:focus { border-color: #3b82f6; background: #fff; }
.tof-btn-add { background: transparent; border: 2px dashed #cbd5e1; color: #94a3b8; padding: 14px; width: 100%; border-radius: 12px; cursor: pointer; transition: .2s; font-size: 15px; font-weight: 600; margin-top: 4px; font-family: inherit; }
.tof-btn-add:hover { background: #f1f5f9; border-color: #94a3b8; color: #475569; }
.tof-nav { display: flex; gap: 12px; margin-top: 32px; }
.tof-btn { flex: 1; height: 54px; border: none; border-radius: 14px; font-size: 15px; font-weight: 700; cursor: pointer; transition: .2s; display: flex; align-items: center; justify-content: center; outline: none; font-family: inherit; }
.tof-btn-prev { background: #f1f5f9; color: #475569; }
.tof-btn-prev:hover { background: #e2e8f0; color: #1e293b; }
.tof-btn-next { background: #3b82f6; color: #fff; box-shadow: 0 4px 14px rgba(59,130,246,.35); }
.tof-btn-next:hover { background: #2563eb; transform: translateY(-1px); }
.tof-btn-submit { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 4px 14px rgba(16,185,129,.35); }
.tof-btn-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(16,185,129,.4); }
.tof-btn-submit.loading { background: #94a3b8 !important; cursor: not-allowed; box-shadow: none !important; transform: none !important; }

/* Оверлеи */
#tof-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; z-index: 2147483647; background: rgba(241,245,249,.96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#tof-overlay.show { display: table; }
.tof-ov-cell { display: table-cell; vertical-align: middle; text-align: center; padding: 24px; }
.tof-ov-card { display: inline-block; background: #fff; border-radius: 24px; padding: 44px 40px 36px; max-width: 400px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.15); text-align: center; animation: tofCardIn .35s cubic-bezier(.34,1.46,.64,1) both; }
@keyframes tofCardIn { from { transform: scale(.8) translateY(24px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.tof-ov-icon { font-size: 76px; display: block; margin-bottom: 16px; line-height: 1; }
.tof-ov-title { font-size: 24px; font-weight: 800; margin: 0 0 10px; letter-spacing: -.3px; }
.tof-ov-title.ok { color: #065f46; }
.tof-ov-title.err { color: #991b1b; }
.tof-ov-sub { font-size: 14px; color: #64748b; margin: 0 0 28px; line-height: 1.65; }
.tof-ov-btn { display: block; width: 100%; padding: 16px; border: none; border-radius: 14px; font-size: 16px; font-weight: 800; cursor: pointer; font-family: inherit; transition: .2s; }
.tof-ov-btn.ok { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 4px 18px rgba(16,185,129,.4); }
.tof-ov-btn.ok:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,185,129,.4); }
.tof-ov-btn.err { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; box-shadow: 0 4px 14px rgba(239,68,68,.3); }

/* Плюшка */
#tof-prank-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 999999; display: flex; align-items: center; justify-content: center; pointer-events: none; visibility: hidden; }
#tof-prank-content { font-size: min(80vw, 80vh); line-height: 1; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.3)); opacity: 0; transform: scale(0.1); }
.prank-animate-in #tof-prank-content { animation: prankZoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.prank-animate-out #tof-prank-content { animation: prankZoomOut 0.5s ease-in forwards; }
@keyframes prankZoomIn { 0% { transform: scale(0.1); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes prankZoomOut { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.1); opacity: 0; } }

/* =========================================
   УНИВЕРСАЛЬНАЯ КЛАВИАТУРА (OSK) ДЛЯ СЕНСОРНЫХ ЭКРАНОВ
   ========================================= */
#tof-osk {
    display: none; position: fixed; bottom: 0; left: 0; width: 100%;
    background: #cbd5e1; padding: 10px 6px; box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    z-index: 2147483647; user-select: none; -webkit-user-select: none;
}
#tof-osk.active { display: block; animation: oskSlideUp 0.3s cubic-bezier(0.34, 1.46, 0.64, 1) forwards; }
@keyframes oskSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.osk-panel { display: none; max-width: 900px; margin: 0 auto; }
.osk-panel.active { display: block; }

/* Сетка Numpad (уменьшена) */
.osk-np-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 320px; margin: 0 auto; }

/* Строки текстовой клавиатуры */
.osk-row { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }

/* Общие стили кнопок */
.osk-btn {
    background: #fff; border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.7);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-family: inherit; color: #0f172a; transition: 0.1s;
}
.osk-btn:active { background: #94a3b8; color: #fff; transform: translateY(1px); box-shadow: none; }

/* Размеры Numpad */
.osk-np-btn { font-size: 26px; font-weight: 700; height: 54px; }
.osk-np-btn.action { background: #94a3b8; color: #fff; font-size: 20px; font-weight: 600; }

/* Размеры QWERTY (текст) */
.osk-text-btn { font-size: 20px; font-weight: 500; flex: 1; height: 48px; max-width: 60px; }
.osk-btn.wide { flex: 1.5; max-width: 80px; font-size: 15px; font-weight: 600; background: #94a3b8; color: #fff; }
.osk-btn.space { flex: 4; max-width: 320px; }
.osk-btn.primary { background: #3b82f6; color: #fff; font-weight: 700; }
.osk-btn.primary:active { background: #2563eb; color: #fff; }
.osk-btn.shift-active { background: #fff; color: #3b82f6; box-shadow: 0 0 0 2px #3b82f6 inset; }

@media (max-width: 1023px) {
    #tof-osk { display: none !important; }
}