* { box-sizing: border-box; margin:0; padding:0; }
html, body { height:100%; }
body { font-family: 'Segoe UI', Arial, sans-serif; background:#f3f4f6; color:#1f2937; }

.phone { max-width:420px; margin:0 auto; background:#fff; min-height:100vh; height:100vh; display:flex; flex-direction:column; overflow:hidden; }
#screen-root { flex:1 1 auto; display:flex; flex-direction:column; overflow:hidden; min-height:0; }

.hdr { background:#1e3a8a; color:#fff; padding:calc(16px + env(safe-area-inset-top)) 20px 16px; flex-shrink:0; }
.hdr h1 { font-size:18px; }
.hdr .sub { font-size:12px; opacity:0.85; margin-top:2px; }
.hdr.small { padding:14px 20px; }
.back-row { display:flex; align-items:center; gap:10px; }
.back-btn { background:rgba(255,255,255,0.15); color:#fff; border:none; padding:6px 10px; border-radius:8px; font-size:12px; cursor:pointer; }

.section-title { padding: 12px 16px 6px; font-size:14px; font-weight:700; color:#1e3a8a; display:flex; justify-content:space-between; align-items:center; flex-shrink:0; }
.section-title .count { background:#dc2626; color:#fff; font-size:11px; padding:2px 8px; border-radius:10px; min-width:18px; text-align:center; }

.feed { flex:1 1 auto; overflow-y:auto; padding: 8px 16px 16px; min-height:0; }

.card { border:1px solid #e5e7eb; border-left:4px solid #f97316; border-radius:10px; padding:12px 14px; margin-bottom:10px; background:#fff; cursor:pointer; }
.card.urgent { border-left-color:#dc2626; background:#fef2f2; }
.card.info { border-left-color:#1e3a8a; background:#eef2ff; cursor:default; }
.card .row1 { display:flex; justify-content:space-between; gap:8px; font-size:13px; font-weight:700; }
.card .row2 { font-size:12px; color:#6b7280; margin-top:4px; }
.card .tag { font-size:11px; padding:2px 8px; border-radius:10px; background:#fde68a; color:#92400e; font-weight:600; white-space:nowrap; flex-shrink:0; }
.card.urgent .tag { background:#fecaca; color:#991b1b; }
.card.info .tag { background:#c7d2fe; color:#1e3a8a; }

.record-dock { flex-shrink:0; padding: 10px 16px 14px; }
.record-btn { width:100%; padding:16px; border-radius:16px; background: linear-gradient(145deg, #f97316, #ea580c); color:#fff; border:none; font-size:17px; font-weight:700; box-shadow: 0 8px 20px rgba(249,115,22,0.4); display:flex; align-items:center; justify-content:center; gap:10px; cursor:pointer; }
.record-btn:active { transform: scale(0.97); }

.secondary-btn { background:#eef2ff; color:#1e3a8a; border:none; padding:10px 14px; border-radius:10px; font-weight:600; font-size:13px; cursor:pointer; }
.secondary-btn.full { width:100%; padding:12px; }
.dock-bottom { flex-shrink:0; padding:10px 16px 14px; border-top:1px solid #e5e7eb; }

.search-input { width:calc(100% - 32px); margin: 10px 16px 0; padding:12px 14px; border-radius:10px; border:1px solid #d1d5db; font-size:14px; }
textarea.search-input { width:100%; margin:0; resize:vertical; }
.client-pick { display:flex; flex-direction:column; gap:10px; }
.client-pick input { width:100%; padding:12px 14px; border-radius:10px; border:1px solid #d1d5db; font-size:14px; }
#client-search-results { display:flex; flex-direction:column; gap:0; }
#client-search-results .card { margin-bottom:8px; }

.day-tabs { display:flex; gap:8px; padding:10px 16px; overflow-x:auto; flex-shrink:0; }
.day-tabs button { border:1px solid #d1d5db; background:#fff; padding:8px 14px; border-radius:20px; font-size:13px; white-space:nowrap; cursor:pointer; }
.day-tabs button.active { background:#1e3a8a; color:#fff; border-color:#1e3a8a; }

.slot { display:flex; justify-content:space-between; align-items:center; gap:10px; border:1px solid #e5e7eb; border-radius:10px; padding:12px 14px; margin-bottom:10px; }
.slot.busy { background:#fff7ed; }
.slot.free { background:#f0fdf4; }

.more-item { padding:14px 16px; border-bottom:1px solid #e5e7eb; font-size:15px; cursor:pointer; }

/* Прайс */
.price-cat { border:1px solid #e5e7eb; border-radius:10px; margin-bottom:12px; overflow:hidden; }
.price-cat-hdr { background:#eef2ff; padding:10px 14px; font-weight:700; font-size:14px; color:#1e3a8a; display:flex; justify-content:space-between; align-items:center; cursor:pointer; }
.price-cat-hdr .del-cat { color:#dc2626; font-size:12px; background:none; border:none; cursor:pointer; }
.price-cat-body { padding:8px 12px; }
.price-cat-body.collapsed { display:none; }
.price-row { display:grid; grid-template-columns: 1fr 60px 70px 30px; gap:6px; align-items:center; padding:6px 0; border-bottom:1px solid #f3f4f6; font-size:12px; }
.price-row input { width:100%; padding:6px; border:1px solid #d1d5db; border-radius:6px; font-size:12px; }
.price-row .del-row { color:#dc2626; background:none; border:none; font-size:16px; cursor:pointer; }
.add-row-btn { margin-top:8px; font-size:12px; padding:8px; }

/* Оборудование */
.equip-card { border:1px solid #e5e7eb; border-radius:10px; padding:12px; margin-bottom:10px; display:flex; gap:12px; align-items:center; }
.equip-photo { width:52px; height:52px; background:#eef2ff; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:24px; flex-shrink:0; }
.equip-info { flex:1; min-width:0; }
.equip-info .name { font-weight:700; font-size:13px; }
.equip-info .meta { font-size:12px; color:#6b7280; margin-top:2px; }
.equip-info .price { font-weight:700; color:#f97316; margin-top:2px; }
.equip-actions { display:flex; flex-direction:column; gap:6px; }
.equip-actions button { font-size:11px; padding:6px 8px; }

/* Калькулятор */
.object-card { background:#eef2ff; border-radius:10px; padding:12px 14px; font-size:13px; }
.object-card b { display:block; font-size:14px; margin-bottom:2px; }
.freq-row { display:flex; gap:8px; overflow-x:auto; padding-bottom:6px; }
.freq-chip { flex-shrink:0; background:#fff7ed; border:1px solid #fdba74; color:#c2410c; padding:8px 12px; border-radius:20px; font-size:12px; white-space:nowrap; cursor:pointer; }
.room-block { border:1px solid #e5e7eb; border-radius:10px; margin-top:12px; overflow:hidden; }
.room-hdr { background:#f3f4f6; padding:10px 14px; font-weight:700; font-size:13px; display:flex; justify-content:space-between; cursor:pointer; }
.room-body { padding:10px 12px; }
.room-body.collapsed { display:none; }
.room-item-row { display:grid; grid-template-columns: 1fr 50px 70px 60px 24px; gap:6px; align-items:center; padding:5px 0; font-size:11px; border-bottom:1px solid #f3f4f6; }
.room-item-row input { width:100%; padding:5px; border:1px solid #d1d5db; border-radius:6px; font-size:11px; }
.room-sum { text-align:right; font-weight:700; font-size:12px; padding:6px 0; color:#1e3a8a; }
.cat-mini { margin-top:8px; }
.cat-mini-hdr { background:#eef2ff; padding:6px 10px; border-radius:6px; font-size:12px; font-weight:600; color:#1e3a8a; cursor:pointer; }
.cat-mini-body { padding:4px 0; }
.cat-mini-body.collapsed { display:none; }
.cat-item-btn { display:block; width:100%; text-align:left; background:none; border:none; padding:6px 4px; font-size:12px; border-bottom:1px solid #f3f4f6; cursor:pointer; }
.manual-item-btn { margin-top:8px; font-size:12px; }
.room-photo-row { display:flex; gap:6px; overflow-x:auto; margin-top:8px; }
.room-photo-thumb { width:50px; height:50px; border-radius:8px; object-fit:cover; flex-shrink:0; }
.totals-block { background:#1e3a8a; color:#fff; border-radius:10px; padding:14px; margin-top:12px; }
.totals-block .row { display:flex; justify-content:space-between; font-size:13px; margin-bottom:6px; }
.totals-block .row input { width:70px; padding:4px 6px; border-radius:6px; border:none; text-align:right; font-size:13px; }
.totals-block .grand { font-size:17px; font-weight:800; border-top:1px solid rgba(255,255,255,0.3); padding-top:8px; margin-top:4px; }

/* Модальное окно (создание нового клиента и т.п.) */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.5); display:flex; align-items:center; justify-content:center; z-index:1000; padding:20px; }
.modal-card { background:#fff; border-radius:14px; padding:18px; width:100%; max-width:360px; }
.modal-card h3 { margin-bottom:4px; color:#1e3a8a; font-size:16px; }
.modal-actions { display:flex; gap:8px; margin-top:14px; }
.modal-actions button { flex:1; }

/* Договор/Акт */
.doc-text { font-size:12px; line-height:1.6; background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:14px; white-space:pre-wrap; }
.doc-table { width:100%; border-collapse:collapse; font-size:11px; margin-top:10px; }
.doc-table th, .doc-table td { border:1px solid #d1d5db; padding:4px 6px; text-align:left; }
.sign-block { margin-top:14px; }
.sign-label { font-size:12px; font-weight:700; margin-bottom:6px; }
.sign-canvas { width:100%; height:120px; border:1px dashed #9ca3af; border-radius:10px; background:#fafafa; touch-action:none; }
.sign-actions { display:flex; gap:8px; margin-top:6px; }
.checklist-item { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid #f3f4f6; font-size:13px; }

/* Настройки */
.settings-field { margin-bottom:12px; }
.settings-field label { display:block; font-size:12px; color:#6b7280; margin-bottom:4px; }
.settings-field input, .settings-field textarea { width:100%; padding:10px; border:1px solid #d1d5db; border-radius:8px; font-size:13px; }
.settings-field textarea { height:80px; resize:vertical; }

nav#bottom-nav { display:flex; border-top:1px solid #e5e7eb; background:#fff; flex-shrink:0; padding-bottom: env(safe-area-inset-bottom); }
nav#bottom-nav button { flex:1; border:none; background:none; padding:10px 4px; font-size:11px; color:#6b7280; display:flex; flex-direction:column; align-items:center; gap:4px; cursor:pointer; }
nav#bottom-nav button.active { color:#1e3a8a; font-weight:700; }
nav#bottom-nav .ic { font-size:20px; }

input, textarea, select { font-size:16px !important; }
