﻿:root { --ink:#15263a; --muted:#6b7b8c; --line:#dce4eb; --paper:#fff; --ground:#f4f7fa; --brand:#247a60; --brand-dark:#14513f; --success:#247a60; --success-dark:#14513f; --success-soft:#dff4ea; --success-wash:#f0fbf4; --success-line:#8fc8b5; --danger:#b42318; }
* { box-sizing:border-box; } body { margin:0; color:var(--ink); font:15px/1.45 Inter,Segoe UI,Arial,sans-serif; background:var(--ground); } button,input,select { font:inherit; } button { cursor:pointer; border:0; border-radius:8px; background:var(--brand); color:#fff; padding:10px 15px; font-weight:650; } button:hover { background:var(--brand-dark); } button.secondary { color:var(--ink); background:#e8eef3; } button.secondary:hover { background:#dce6ee; } .login-shell { min-height:100vh; display:grid; place-items:center; padding:24px; background:linear-gradient(135deg,#e5f2f5,#f9fbfc 55%); } .card { background:var(--paper); border:1px solid var(--line); border-radius:16px; box-shadow:0 20px 50px #17354a1f; } .login-card { width:min(100%,440px); padding:32px; display:grid; gap:15px; } h1,h2,p { margin:0; } h1 { font-size:28px; line-height:1.15; } h2 { font-size:21px; } .eyebrow { color:var(--brand-dark); font-size:12px; font-weight:750; letter-spacing:.1em; } label { display:grid; gap:6px; font-weight:650; } input,select { width:100%; padding:10px 11px; border:1px solid #bfcbd5; border-radius:8px; background:#fff; color:var(--ink); } input:focus,select:focus { outline:3px solid #b8e1eb; border-color:var(--brand); } .form-error { color:var(--danger); font-weight:600; } .app-shell { min-height:100vh; display:grid; grid-template-columns:236px 1fr; } .sidebar { padding:22px 14px; color:#eaf7fa; background:#102b3d; display:flex; flex-direction:column; gap:28px; } .brand { display:flex; gap:9px; align-items:center; font-size:18px; letter-spacing:.04em; padding:0 10px; } .brand span { display:grid; place-items:center; width:29px; height:29px; color:#102b3d; background:#8dd4df; border-radius:7px; } nav { display:grid; gap:5px; } .nav-item,.logout { width:100%; padding:10px; text-align:left; color:#cde0e8; background:transparent; } .nav-item:hover,.nav-item.active { color:#fff; background:#24516a; } .logout { margin-top:auto; color:#f0c6c1; } .content { min-width:0; padding:30px clamp(18px,4vw,58px); } .topbar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:28px; } .stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin-bottom:25px; } .stat { padding:20px; } .stat strong { display:block; margin-top:7px; font-size:27px; } .section { margin-top:25px; } .section-heading { display:flex; justify-content:space-between; align-items:center; gap:14px; margin-bottom:10px; } .table-wrap { overflow:auto; border:1px solid var(--line); border-radius:11px; background:#fff; } table { width:100%; border-collapse:collapse; white-space:nowrap; } th,td { padding:12px 14px; text-align:left; border-bottom:1px solid var(--line); } th { color:var(--muted); background:#f8fafb; font-size:12px; letter-spacing:.04em; text-transform:uppercase; } tr:last-child td { border-bottom:0; } tbody tr { cursor:pointer; } tbody tr:hover { background:#f0f8fa; } .empty { padding:30px; color:var(--muted); text-align:center; background:#fff; border:1px solid var(--line); border-radius:11px; } dialog { border:0; padding:0; background:transparent; } dialog::backdrop { background:#0c2234a6; } .editor-card { width:min(92vw,620px); padding:24px; border-radius:14px; background:#fff; box-shadow:0 20px 55px #0b213bb0; } .editor-heading,.editor-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; } .editor-heading { margin-bottom:18px; } .editor-actions { justify-content:flex-end; margin-top:20px; } .icon-button { padding:0; width:32px; height:32px; color:var(--ink); background:#edf2f5; font-size:23px; line-height:1; } .field-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; } .field-grid .full { grid-column:1/-1; } pre { max-height:65vh; overflow:auto; padding:15px; border-radius:8px; color:#244; background:#f2f6f8; } .lookup-results { position:relative; z-index:5; margin-top:.35rem; overflow:hidden; border:1px solid var(--line); border-radius:8px; background:#fff; box-shadow:0 .6rem 1.5rem #17354a24; } .lookup-choice { display:flex; width:100%; flex-direction:column; gap:.15rem; padding:.65rem .75rem; border:0; border-bottom:1px solid var(--line); border-radius:0; background:#fff; color:var(--ink); text-align:left; font:inherit; } .lookup-choice:last-child { border-bottom:0; } .lookup-choice:hover,.lookup-choice:focus { background:#edf7fa; } .lookup-choice span,.lookup-empty { color:var(--muted); font-size:.84rem; } .lookup-empty { margin:0; padding:.65rem .75rem; } @media (max-width:700px) { .app-shell { grid-template-columns:1fr; } .sidebar { gap:12px; padding:12px; } nav { grid-template-columns:repeat(4,1fr); } .nav-item { font-size:12px; text-align:center; } .logout { margin:0; } .content { padding:22px 16px; } .field-grid { grid-template-columns:1fr; } }

[hidden] { display: none !important; }
.cell-wrap { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; word-break:normal; }

.list-search { max-width:430px; margin:0 0 14px; color:var(--muted); }
.section-description { margin-top:4px; color:var(--muted); }
.operational-filters { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); padding:14px; border:1px solid var(--line); border-radius:11px; background:#fff; }
.operational-filters .editor-actions { align-self:end; margin-top:0; }
.operational-search { grid-column:span 2; }
.contextual-actions { justify-content:flex-start; flex-wrap:wrap; }
.profile-actions { display:flex; flex-wrap:nowrap; gap:.34rem; margin:0 0 .6rem; overflow-x:auto; padding-bottom:.1rem; }
.profile-actions button { flex:0 0 auto; padding:.38rem .52rem; white-space:nowrap; font-size:.84rem; }
.profile-actions .danger-soft { background:#fee2e2; color:#991b1b; }
.profile-actions .danger-soft:hover { background:#fecaca; }
button.danger-soft { background:#fee2e2; color:#991b1b; }
button.danger-soft:hover { background:#fecaca; }
.profile-action-feedback { margin:0 0 .75rem; padding:.7rem .85rem; border:1px solid #b7e4c7; border-radius:8px; background:#ecfdf3; color:#166534; font-weight:700; }
.customer-row--qualified { background:#f0fdfa; }
.customer-row--donotcontact { background:#f3f4f6; color:#111827; }
.customer-row--donotcontact td { border-bottom-color:#d1d5db; }
.customer-row--lead { background:#eff6ff; }
.customer-row--inactive30 { background:#fff7ed; }
.customer-row--inactive60 { background:#fef2f2; }
.customer-status-banner { display:grid; gap:.15rem; margin:0 0 .85rem; padding:.8rem .95rem; border-radius:8px; border:1px solid var(--line); }
.customer-status-banner strong { font-size:.95rem; }
.customer-status-banner span { color:var(--muted); font-size:.9rem; }
.customer-status-banner--qualified { border-color:#99f6e4; background:#f0fdfa; color:#0f766e; }
.customer-status-banner--lead { border-color:#bfdbfe; background:#eff6ff; color:#1d4ed8; }
.customer-status-banner--inactive30 { border-color:#fed7aa; background:#fff7ed; color:#9a3412; }
.customer-status-banner--inactive60 { border-color:#fecaca; background:#fef2f2; color:#991b1b; }
.customer-status-banner--danger { border-color:#fecdd3; background:#fff1f2; color:#be123c; }
.column-settings { margin:0 0 1rem; padding:1rem; border:1px solid var(--line); border-radius:.7rem; background:#fff; }
.column-settings-heading { display:flex; justify-content:space-between; align-items:center; gap:.75rem; margin-bottom:.65rem; }
.column-config-row { display:flex; justify-content:space-between; align-items:center; gap:.75rem; padding:.35rem 0; border-top:1px solid #edf1f3; }
.column-config-row label { display:block; font-weight:600; }
.column-config-row input { width:auto; margin-right:.35rem; }
.column-config-row span { display:flex; gap:.35rem; }
.column-config-row button { min-width:2.15rem; padding:.3rem .5rem; }
.row-actions { display:flex; gap:.4rem; }
#detail .editor-card { max-height:88vh; overflow:auto; width:min(96vw,1120px); }

.commission-desk .section-heading { align-items: flex-start; }
.commission-stats small { display: block; margin-top: .4rem; color: var(--muted); font-weight: 600; }
.commission-status { display: inline-flex; padding: .25rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.commission-status-pending { background: #fff4ce; color: #755400; }
.commission-status-approved { background: #dbeafe; color: #174e96; }
.commission-status-paid { background: #dff7e7; color: #176b38; }
.commission-status-cancelled { background: #f1f3f5; color: #59636e; }
.commission-table td { vertical-align: middle; }
.commission-split { display:grid; gap:.65rem; padding:.85rem; border:1px solid var(--line); border-radius:8px; background:#fbfcfd; }
.commission-split-head,.commission-base-line { display:flex; align-items:center; justify-content:space-between; gap:.75rem; }
.commission-split h3 { margin:0; font-size:1rem; }
.commission-split p { color:var(--muted); font-size:.9rem; }
.commission-base-line { padding:.55rem .65rem; border-radius:6px; background:#fff7df; }
.commission-split-rules { display:flex; flex-wrap:wrap; gap:.4rem; }
.commission-split-rules span { padding:.25rem .45rem; border-radius:6px; background:#eef3f5; font-size:.82rem; font-weight:650; }
.commission-split.muted { color:var(--muted); }
.commission-rules-editor { grid-column:1/-1; display:grid; grid-template-columns:minmax(0,1fr) minmax(140px,.35fr); gap:.7rem .8rem; max-width:100%; min-width:0; max-height:min(54vh,520px); padding:.9rem; border:1px solid #d9e4dd; border-radius:8px; background:#f7fbf8; overflow-y:auto; overflow-x:hidden; scroll-margin:18px; box-shadow:0 12px 28px rgba(17,45,36,.08); }
.commission-rules-editor[hidden] { display:none !important; }
.commission-rules-editor .full { grid-column:1/-1; }
.commission-rule-list { display:grid; gap:.5rem; min-width:0; }
.commission-rule-row { display:grid; grid-template-columns:34px minmax(0,1.35fr) 76px minmax(0,1fr) max-content; gap:.5rem; align-items:center; min-width:0; }
.commission-rule-row input,.commission-rule-row select { width:100%; min-width:0; }
.commission-rule-drag { width:34px; min-width:34px; height:36px; padding:0; display:inline-grid; place-items:center; cursor:grab; color:var(--success-dark); background:var(--success-wash); border-color:var(--success-line); justify-self:stretch; touch-action:none; user-select:none; }
.commission-rule-drag:active,.commission-rule-row.is-dragging .commission-rule-drag { cursor:grabbing; }
.commission-rule-row.is-dragging { opacity:.55; background:#e9f5ef; }
.commission-rule-row.is-dragging input,.commission-rule-row.is-dragging select,.commission-rule-row.is-dragging button:not(.commission-rule-drag) { pointer-events:none; }
.commission-rule-row button { white-space:nowrap; justify-self:end; }
.commission-rule-actions { position:static; z-index:1; display:flex; justify-content:flex-end; gap:.5rem; margin:.35rem 0 0; padding:.75rem 0 0; border-top:1px solid #d9e4dd; background:transparent; }
@media (max-width:900px) { .commission-rules-editor { grid-template-columns:1fr; } .commission-rule-row { grid-template-columns:1fr; } .commission-rule-row button,.commission-rule-drag { justify-self:start; } .commission-rule-actions { justify-content:flex-start; flex-wrap:wrap; } }
.assistant-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
.assistant-tabs .active { color:#fff; background:var(--brand-dark); }
.compact-form { align-items:end; margin-bottom:18px; }
.view-toggle { display:inline-flex; gap:4px; padding:4px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.view-toggle button { padding:7px 10px; border:0; box-shadow:none; }
.view-toggle button.active { color:#fff; background:var(--nav); }
.calendar-shell { display:grid; gap:16px; }
.calendar-toolbar { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; padding:16px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow); }
.calendar-toolbar h2 { margin:0 0 4px; font-size:18px; }
.calendar-toolbar p { color:var(--muted); font-size:13px; }
.calendar-step { width:38px; padding-inline:0; font-size:20px; line-height:1; }
.calendar-layout { display:grid; grid-template-columns:280px minmax(0,1fr); gap:16px; align-items:start; }
.calendar-layout aside { display:grid; gap:10px; padding:15px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow); }
.calendar-layout aside h3 { margin:0; font-size:15px; }
.calendar-agenda { display:grid; gap:8px; max-height:520px; overflow:auto; }
.calendar-agenda article { display:grid; gap:2px; padding:9px 10px; border-left:3px solid var(--brand); border-radius:8px; background:#f7f8f5; }
.calendar-agenda time,.calendar-agenda span { color:var(--muted); font-size:11px; }
.calendar-agenda strong { font-size:13px; }
.compact-empty { padding:16px; }
.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(140px,1fr)); min-height:610px; overflow:auto; border:1px solid var(--line); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow); }
.calendar-grid.is-day { grid-template-columns:1fr; }
.calendar-day { min-width:140px; border-right:1px solid var(--line); }
.calendar-day:last-child { border-right:0; }
.calendar-day header,.calendar-month-day header { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:11px 12px; border-bottom:1px solid var(--line); background:#fafbf9; }
.calendar-day header strong { text-transform:capitalize; }
.calendar-day header span { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:#efe7d8; color:#5f4b27; font-weight:800; }
.calendar-slots { display:grid; align-content:start; gap:8px; min-height:550px; padding:10px; background:linear-gradient(#fff 47px,#edf0ed 48px); background-size:100% 48px; }
.calendar-slots>p { margin:6px 0 0; color:var(--muted); text-align:center; font-size:12px; }
.calendar-event { width:100%; display:grid; gap:3px; padding:8px 9px; border-left:4px solid var(--brand); border-radius:8px; background:#f3efe6; color:var(--ink); text-align:left; box-shadow:none; }
.calendar-event:hover { background:#ebe2d2; transform:none; box-shadow:none; }
.calendar-event span,.calendar-event small { color:#71695d; font-size:11px; }
.calendar-event strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.calendar-event--task { border-left-color:#39745b; background:#edf7f1; }
.calendar-event--viewing { border-left-color:#147d9a; background:#edf7fa; }
.calendar-event--activity { border-left-color:#927747; background:#f7f3ea; }
.calendar-month { display:grid; grid-template-columns:repeat(7,minmax(125px,1fr)); overflow:auto; border:1px solid var(--line); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow); }
.calendar-month-day { min-height:128px; padding:8px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.calendar-month-day.is-outside { opacity:.5; background:#fafbf9; }
.calendar-month-day header { margin:-8px -8px 8px; }
.calendar-month-day .calendar-event { margin-bottom:6px; padding:6px 7px; }
.calendar-more { color:var(--muted); font-size:11px; font-weight:700; }
.process-map { margin-top:26px; }
.process-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; }
.process-card { display:grid; gap:12px; align-content:start; padding:16px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow); }
.process-card>div { display:flex; align-items:center; gap:10px; }
.process-card span { display:grid; place-items:center; width:34px; height:34px; border-radius:9px; color:#271f13; background:var(--brand); font-weight:800; }
.process-card h3 { margin:0; font-size:15px; }
.process-card ul { display:grid; gap:7px; margin:0; padding-left:18px; color:#4f5a55; font-size:12px; }
.process-card button { justify-self:start; align-self:end; margin-top:2px; }
textarea { width:100%; resize:vertical; padding:10px 11px; border:1px solid #bfcbd5; border-radius:8px; font:inherit; }
.kanban-help { color:var(--muted); margin-bottom:14px; }
.kanban-board { display:flex; gap:14px; overflow-x:auto; padding-bottom:12px; align-items:flex-start; }
.kanban-column { flex:0 0 245px; min-height:185px; padding:12px; border:1px solid var(--line); border-radius:11px; background:#edf3f6; }
.kanban-column h3 { display:flex; justify-content:space-between; margin:0 0 10px; font-size:14px; }
.kanban-column h3 span { color:var(--muted); }
.kanban-card { display:grid; gap:7px; margin:0 0 10px; padding:12px; cursor:pointer; border:1px solid var(--line); border-radius:9px; background:#fff; box-shadow:0 2px 6px #17354a14; }
.kanban-card-head { display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; }
.kanban-card-head strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.kanban-chip { flex:0 0 auto; padding:3px 7px; border:1px solid #d8ded8; border-radius:999px; background:#f6f7f4; color:var(--muted); font-size:11px; font-weight:700; }
.kanban-chip--done { border-color:#bfe8cb; background:#e8f8ee; color:#216638; }
.kanban-card span,.kanban-card small,.kanban-card em { color:var(--muted); font-style:normal; }
.kanban-card label { color:var(--ink); font-size:12px; }
.kanban-card select { padding:7px; font-size:13px; }
.kanban-empty { color:var(--muted); font-size:13px; text-align:center; }
.detail-profile { white-space:normal; color:var(--ink); }
.detail-summary { border-bottom:1px solid var(--line); padding-bottom:.55rem; margin-bottom:.55rem; }
.detail-summary h2 { margin:0 0 .25rem; }
.detail-summary > p { margin:0 0 .45rem; color:var(--muted); }
.detail-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.38rem; }
.detail-item { border:1px solid var(--line); border-radius:.42rem; padding:.36rem .48rem; display:grid; gap:.05rem; min-width:0; }
.detail-item.full { grid-column:1/-1; }
.detail-item strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.89rem; }
.detail-item span { font-size:.78rem; }
.detail-item span,.detail-list small,.detail-list span { color:var(--muted); }
.detail-section { margin-top:.58rem; }
.detail-section h3 { margin:0 0 .28rem; font-size:.92rem; }
.detail-list { margin:0; padding:0; list-style:none; display:grid; gap:.28rem; }
.detail-list li { border-left:3px solid var(--brand); background:#f4f8fa; padding:.42rem .55rem; display:grid; gap:.12rem; }
.requirement-item-head { display:flex; align-items:center; justify-content:space-between; gap:.65rem; }
.requirement-item-actions { display:flex; flex:0 0 auto; gap:.35rem; align-items:center; }
.requirement-edit { padding:.32rem .55rem; font-size:.82rem; }
.requirement-delete { padding:.32rem .55rem; font-size:.82rem; }
.lead-score-text { color:#177245; font-size:.86rem; font-weight:800; }
.lead-score-breakdown-item { border-left-color:#1d8f57 !important; background:#f0fbf4 !important; }
.timeline-entry { grid-template-columns: 1fr; }
.timeline-kind { display:inline-grid; place-items:center; width:1.45rem; height:1.45rem; margin-right:.25rem; border-radius:999px; background:#e7eef0; color:var(--ink); font-weight:800; }
.timeline-entry--document { border-left-color:#2563eb !important; background:#f2f7ff !important; }
.timeline-entry--contract { border-left-color:#7c3aed !important; background:#f7f3ff !important; }
.timeline-entry--commission { border-left-color:#16a34a !important; background:#f2fbf5 !important; }
.timeline-entry--expense { border-left-color:#dc2626 !important; background:#fff5f5 !important; }
.detail-empty { color:var(--muted); margin:0; }
.detail-description { white-space:pre-wrap; color:var(--ink) !important; }
@media (max-width:900px) { .detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:640px) { .detail-grid { grid-template-columns:1fr; } }

.property-editor { width:min(96vw,1100px); padding:24px; border-radius:14px; background:#fff; box-shadow:0 20px 55px #0b213bb0; }
.property-editor-body { max-height:72vh; overflow:auto; }
.property-section { margin:0 0 1.25rem; padding:1rem; border:1px solid var(--line); border-radius:.7rem; background:#fcfdfe; }
.property-section-title { margin-bottom:.8rem; }
.property-section-title h3 { margin:0 0 .2rem; font-size:1.05rem; }
.property-section-title p,.property-info,.muted { color:var(--muted); font-size:.9rem; margin:.1rem 0; }
.property-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.75rem; }
.property-grid .field { display:grid; gap:.3rem; }
.property-grid .field span { font-size:.85rem; font-weight:700; color:var(--ink); }
.property-grid .field-wide { grid-column:1 / -1; }
.property-grid textarea { min-height:92px; resize:vertical; }
.quick-owner-section .quick-owner-toggle { justify-self:start; }
.quick-owner-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.75rem; margin-top:.8rem; padding:.85rem; border:1px dashed var(--line); border-radius:.7rem; background:#fff; }
.quick-owner-fields[hidden] { display:none; }
.quick-owner-fields .field { display:grid; gap:.3rem; }
.quick-owner-fields .field span { font-size:.85rem; font-weight:700; color:var(--ink); }
.detail-edit-form .detail-item { display:grid; gap:.35rem; align-content:start; }
.detail-edit-form select,.detail-edit-form input { width:100%; min-height:38px; border:1px solid var(--line); border-radius:8px; padding:.55rem .65rem; background:#fff; color:var(--ink); font:inherit; }
.detail-edit-form .editor-actions { justify-content:flex-end; margin-top:1rem; }
.address-suggestions { display:grid; gap:.35rem; margin:.45rem 0; }
.address-suggestions button { padding:.55rem .65rem; text-align:left; color:var(--ink); border:1px solid var(--line); background:#fff; border-radius:.4rem; cursor:pointer; }
.address-suggestions button:hover { border-color:var(--brand); background:#eff8fb; }
.address-selected { padding:.55rem .65rem; border-radius:.4rem; color:#165c3d; background:#edf9f0; font-size:.9rem; }
.property-map-layout { display:grid; grid-template-columns:minmax(0,4fr) minmax(220px,3fr); gap:.8rem; align-items:start; }
.property-map { padding:.25rem; border:1px solid #a8d8e8; border-radius:.55rem; background:#eef9fd; }
.property-map iframe { display:block; width:100%; aspect-ratio:4 / 3; height:auto; min-height:0; border:0; border-radius:.4rem; }
.property-map-meta { padding:.8rem; border:1px solid var(--line); border-radius:.55rem; background:#fff; }
.property-map-meta h4 { margin:0 0 .65rem; font-size:.95rem; }
.property-map-meta dl { display:grid; gap:.45rem; margin:0; }
.property-map-meta dl div { display:flex; justify-content:space-between; gap:.75rem; border-bottom:1px solid #edf1f3; padding-bottom:.35rem; }
.property-map-meta dt { color:var(--muted); font-size:.82rem; }
.property-map-meta dd { margin:0; text-align:right; font-size:.85rem; font-weight:700; }
.property-map-meta p { margin:.7rem 0 0; color:var(--muted); font-size:.78rem; line-height:1.35; }
.property-map-empty { padding:.7rem; border-radius:.5rem; color:var(--muted); background:#f3f6f8; }
.amenities-picker { display:flex; flex-wrap:wrap; gap:.5rem; }
.amenity-option { display:inline-flex; align-items:center; gap:.45rem; min-height:38px; padding:.38rem .7rem .38rem .42rem; border:1px solid #cad7d5; border-radius:999px; background:linear-gradient(180deg,#ffffff,#f6faf9); color:#263b43; cursor:pointer; font:inherit; font-size:.87rem; font-weight:650; box-shadow:0 1px 2px rgba(24,42,49,.05); }
.amenity-option:hover { border-color:#8ba7ad; background:#eef5f5; color:#18343d; transform:translateY(-1px); }
.amenity-option.is-selected { border-color:#8aa99d; background:#e8f2ee; color:#173c35; box-shadow:inset 0 0 0 1px rgba(92,128,113,.16), 0 2px 6px rgba(24,42,49,.07); }
.property-gallery-upload form { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; margin-bottom:.8rem; }
.property-gallery-group { margin:.8rem 0; }
.property-media-list { display:grid; gap:.35rem; margin-top:.3rem; }
.property-media-item { display:flex; gap:.8rem; justify-content:space-between; align-items:center; padding:.5rem .65rem; border:1px solid var(--line); border-radius:.4rem; background:#fff; }
.property-media-preview { width:88px; height:62px; display:grid; place-items:center; overflow:hidden; border-radius:.35rem; background:#edf3f6; }
.property-media-preview img,.property-local-preview img { width:100%; height:100%; object-fit:cover; display:block; }
.property-media-actions { display:flex; align-items:center; gap:.45rem; margin-left:auto; }
.property-media-actions button.secondary { padding:.4rem .55rem; font-size:.82rem; }
.property-local-preview { width:180px; height:120px; margin:.35rem 0 .75rem; overflow:hidden; border-radius:.45rem; }
.property-local-preview p { margin:0 0 .3rem; color:var(--muted); font-size:.85rem; }
.link-danger { color:#bd2617; border:0; background:none; cursor:pointer; font-weight:700; }
.property-detail { max-width:900px; }
.property-detail-actions { display:flex; gap:.6rem; margin-bottom:1rem; }
.website-publishing { background:linear-gradient(145deg,#f8fbfa,#fff); border-color:#cddbd5; }
.website-quality { display:grid; grid-template-columns:auto 1fr; gap:.7rem 1rem; align-items:center; padding:1rem; margin-bottom:1rem; border:1px solid #dce6e1; border-radius:12px; background:#fff; }
.website-quality>div:first-child { display:flex; flex-direction:column; }
.website-quality strong { color:#0d3128; font-size:1.65rem; line-height:1; }
.website-quality span,.website-quality p { color:#687771; font-size:.82rem; }
.website-quality p { grid-column:1/-1; margin:0; }
.quality-track { height:9px; overflow:hidden; border-radius:999px; background:#e5ece9; }
.quality-track i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#c39b50,#23785f); }
.website-status-row { display:flex; justify-content:space-between; align-items:center; gap:.75rem; margin-bottom:1rem; }
.website-settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.85rem; }
.website-settings-grid label { display:flex; flex-direction:column; gap:.35rem; color:#52605b; font-size:.78rem; font-weight:700; }
.website-settings-grid input,.website-settings-grid textarea { width:100%; padding:.7rem .75rem; border:1px solid #d6dfdb; border-radius:8px; background:#fff; color:#13211c; font:inherit; font-weight:400; }
.website-settings-grid .field-wide { grid-column:1/-1; }
.website-settings-grid .check-line { flex-direction:row; align-items:center; padding:.7rem; border:1px solid #dce5e1; border-radius:8px; background:#fff; }
.website-settings-grid .check-line input { width:auto; }
.website-actions { flex-wrap:wrap; margin-top:1rem; }
.workflow-rejection { padding:.75rem; color:#8b3c31; background:#fff2ef; border-radius:8px; }
.workflow-history { margin-top:.8rem; border-top:1px solid #dde5e1; padding-top:.8rem; }
.workflow-history summary { cursor:pointer; font-weight:700; }
.workflow-history ol { padding-left:1.2rem; }
.workflow-history li { display:grid; grid-template-columns:1fr auto; gap:.2rem 1rem; padding:.45rem 0; border-bottom:1px solid #edf1ef; }
.workflow-history li span,.workflow-history li small { color:#72807a; font-size:.78rem; }
.workflow-history li small { grid-column:1/-1; }
@media(max-width:700px){.website-settings-grid{grid-template-columns:1fr}.website-settings-grid .field-wide{grid-column:auto}.website-status-row{align-items:flex-start;flex-direction:column}}
.property-summary { display:flex; flex-wrap:wrap; gap:.45rem; margin:1rem 0; }
.property-summary span { padding:.3rem .55rem; color:#0d5f7c; background:#e7f5fa; border-radius:999px; font-size:.85rem; font-weight:700; }
.property-details-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.55rem; margin:1rem 0; }
.property-details-grid div { display:grid; gap:.2rem; padding:.55rem; border:1px solid var(--line); border-radius:.45rem; }
.property-details-grid span { color:var(--muted); font-size:.78rem; }
@media (max-width:800px) { .property-grid,.property-details-grid,.quick-owner-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:800px) { .property-map-layout { grid-template-columns:1fr; } }
@media (max-width:560px) { .property-grid,.property-details-grid,.quick-owner-fields { grid-template-columns:1fr; } }
.topbar-actions,.voice-controls { display:flex; gap:.65rem; align-items:center; }
.topbar { display:none; }
.app-section-header {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 1rem;
  margin-bottom: .9rem;
}
.app-section-header h2 {
  font-size: 21px;
  letter-spacing: -.025em;
}
.app-section-voice {
  justify-self: center;
}
.app-section-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
  flex-wrap: wrap;
}
.section-voice-control {
  white-space: nowrap;
}
.voice-editor { width:min(760px,calc(100vw - 2rem)); }
.voice-intro { color:var(--muted); line-height:1.55; }
.voice-status { padding:.8rem 1rem; border-radius:.6rem; background:#edf7fa; color:#12455a; font-weight:600; }
.voice-transcript { min-height:1.3rem; color:var(--muted); font-style:italic; }
.voice-controls #voice-listen.is-listening { background:#b42318; box-shadow:0 0 0 .25rem #fee4e2; }
.voice-assistant-fab { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 40; width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--brand); color: #fff; font-size: 1.4rem; cursor: pointer; box-shadow: 0 .3rem .9rem rgba(0,0,0,.25); }
.voice-assistant-fab.is-listening { background: #b42318; box-shadow: 0 0 0 .3rem #fee4e2, 0 .3rem .9rem rgba(0,0,0,.25); }

/* Property Photo Studio (property-gallery.js) */
.photo-dropzone { padding: 1.1rem; border: 2px dashed var(--line); border-radius: .7rem; background: #fbfdfe; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.photo-dropzone:hover, .photo-dropzone.is-dragover { border-color: var(--brand); background: #eef8fb; }
.photo-dropzone p { margin: .2rem 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; margin-top: .9rem; }
.photo-thumb { position: relative; display: flex; flex-direction: column; gap: .4rem; padding: .5rem; border: 1px solid var(--line); border-radius: .6rem; background: #fff; cursor: grab; }
.photo-thumb.is-dragging { opacity: .45; }
.photo-thumb.is-main { border-color: var(--brand); box-shadow: 0 0 0 2px #147d9a33; }
.photo-thumb.is-error { border-color: var(--danger); }
.photo-thumb-badge { position: absolute; top: .4rem; left: .4rem; z-index: 1; padding: .18rem .5rem; border-radius: 999px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; }
.status-badge { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; line-height: 1.4; }
.status-badge--open { background: #fef3c7; color: #92400e; }
.status-badge--done { background: #dcfce7; color: #166534; }
.status-badge--cancelled { background: #f1f1ef; color: #6b7280; }
.status-badge--warning { background: #ffedd5; color: #9a3412; }
.status-badge--danger { background: #fee2e2; color: #991b1b; }
.status-badge--black { background: #111827; color: #fff; border: 1px solid #111827; }
.status-badge--info { background: #dbeafe; color: #1e40af; }
.status-badge--purple { background: #ede9fe; color: #5b21b6; }
.status-badge--teal { background: #ccfbf1; color: #0f766e; }
.property-bonita { display:inline-flex; color:#b7791f; font-weight:800; white-space:nowrap; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin: 1rem 0; }
.stat-card { padding: 1rem; border: 1px solid var(--line); border-radius: .7rem; background: #fff; }
.stat-card strong { display: block; font-size: 1.4rem; margin-top: .3rem; }
.stat-card span { font-size: .8rem; color: #6b7280; }
.bank-card-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; margin: 1rem 0; }
.bank-card { padding: .8rem; border: 1px solid var(--line); border-radius: .6rem; background: #fff; cursor: pointer; text-align: left; }
.bank-card.selected { border-color: var(--brand); box-shadow: 0 0 0 2px #147d9a33; }
.bank-card strong { display: block; }
.bank-card small { color: #6b7280; }
.mortgage-slider-row { display: flex; align-items: center; gap: .6rem; }
.mortgage-slider-row input[type="range"] { flex: 1; }
.mortgage-slider-row input[type="number"] { width: 6.5rem; }
.bank-comparison-best { background: #dff7e7; font-weight: 650; }
.amortization-details { margin-top: 1rem; }
.amortization-details summary { cursor: pointer; font-weight: 650; padding: .5rem 0; }
.mortgage-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; align-items: start; }
@media screen and (max-width: 900px) { .mortgage-layout { grid-template-columns: 1fr; } }
.mortgage-calc-card, .mortgage-banks-card { padding: 1rem 1.2rem; }
.mortgage-studio { display:grid; gap:18px; }
.mortgage-top { min-height:190px; display:flex; align-items:flex-end; justify-content:space-between; gap:18px; padding:28px; color:#fff; border-radius:16px; background:linear-gradient(105deg,#0e2b26 0%,#123b37 48%,#0b645e 100%); box-shadow:0 20px 50px rgba(7,38,34,.22); overflow:hidden; position:relative; }
.mortgage-top::after { content:""; position:absolute; right:24px; top:22px; width:310px; height:190px; border:1px solid rgba(255,255,255,.16); border-radius:22px; background:linear-gradient(135deg,rgba(255,255,255,.16),rgba(255,255,255,.03)); transform:rotate(-5deg); }
.mortgage-top>div,.mortgage-top>button { position:relative; z-index:1; }
.mortgage-top-actions { position:relative; z-index:1; display:flex; gap:10px; align-items:center; flex-shrink:0; }
/* Hlavná akcia stránky — zlatý akcent (rovnaký ako prstenec LTV a poradie
   v rebríčku), aby vystúpil z tmavozelenej hlavičky. */
.mortgage-print-cta { color:#3b2d0c; background:#d8b46c; font-weight:750;
  box-shadow:0 6px 18px rgba(216,180,108,.38); }
.mortgage-print-cta:hover { background:#e8c885; }
/* Samostatné tlačidlo pod panelom Argument pre klienta — stojí mimo neho. */
.mortgage-print-standalone { width:100%; padding:14px; font-size:16px; }
.mortgage-top h2 { margin:4px 0; font-size:38px; line-height:1; }
.mortgage-top p:not(.eyebrow) { max-width:620px; color:#d7ebe7; }
.mortgage-main,.mortgage-side { display:grid; gap:14px; }
.mortgage-panel { padding:18px; border:1px solid var(--line); border-radius:14px; background:#fff; box-shadow:0 14px 34px rgba(29,47,43,.08); }
.mortgage-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.mortgage-form-grid label { padding:12px; border:1px solid #dfe8e5; border-radius:12px; background:#fbfcfb; }
.mortgage-form-grid input[type="range"] { accent-color:#0f766e; }
.bank-card-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:10px; margin-top:8px; }
.bank-card { min-height:76px; display:grid; gap:5px; align-content:center; color:#102b25; background:#f8fbfa; border:1px solid #dce8e4; text-align:left; }
.bank-card.selected,.bank-card:hover { color:#fff; background:#102b25; border-color:#102b25; }
.bank-card small { color:inherit; opacity:.72; }
.mortgage-hero-card { display:grid; grid-template-columns:1.1fr 150px 180px; gap:14px; align-items:center; padding:20px; border-radius:16px; color:#fff; background:linear-gradient(135deg,#102b25,#0f766e); box-shadow:0 18px 40px rgba(12,71,65,.22); }
.mortgage-hero-card>div:first-child span,.mortgage-hero-card small { color:#bfe8e0; }
.mortgage-hero-card>div:first-child strong { display:block; margin:3px 0; font-size:42px; line-height:1; }
.mortgage-ring { width:136px; height:136px; display:grid; place-items:center; justify-self:center; border-radius:50%; background:conic-gradient(#d8b46c calc(var(--ltv)*1%),rgba(255,255,255,.18) 0); position:relative; }
.mortgage-ring::after { content:""; position:absolute; inset:14px; border-radius:50%; background:#123b37; }
.mortgage-ring b,.mortgage-ring span { position:relative; z-index:1; }
.mortgage-ring b { align-self:end; font-size:25px; }.mortgage-ring span { align-self:start; color:#bfe8e0; font-size:11px; font-weight:800; }
.mortgage-risk { justify-self:start; padding:10px 12px; border-radius:999px; font-weight:800; }
.mortgage-risk--ok { background:#dcfce7; color:#14532d; }.mortgage-risk--warn { background:#fef3c7; color:#854d0e; }.mortgage-risk--danger { background:#fee2e2; color:#991b1b; }
.mortgage-kpi-grid { grid-column:1/-1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.mortgage-kpi-grid article { padding:12px; border-radius:12px; background:rgba(255,255,255,.1); }
.mortgage-kpi-grid span { display:block; color:#cdebe5; font-size:12px; }.mortgage-kpi-grid strong { font-size:19px; }
.mortgage-chart { padding:18px; border:1px solid var(--line); border-radius:14px; background:#fff; box-shadow:0 14px 34px rgba(29,47,43,.08); }
.mortgage-chart>div { display:flex; justify-content:space-between; margin-bottom:8px; }.mortgage-chart span { color:var(--muted); font-size:12px; }
.mortgage-chart svg { width:100%; height:auto; display:block; }.mortgage-chart text { fill:#7b8b84; font-size:12px; }
.mortgage-ranking { display:grid; gap:9px; }
.mortgage-rank { position:relative; display:grid; grid-template-columns:32px 1fr 58px 92px 128px; align-items:center; gap:10px; overflow:hidden; color:#102b25; background:#f8fbfa; border:1px solid #dce8e4; text-align:left; }
.mortgage-rank>* { position:relative; z-index:1; }.mortgage-rank i { position:absolute; left:0; bottom:0; height:4px; background:#0f766e; }
.mortgage-rank span { display:grid; place-items:center; width:28px; height:28px; border-radius:8px; background:#d8b46c; font-weight:900; }
.mortgage-rank.active,.mortgage-rank:hover { background:#ecf8f6; border-color:#0f766e; }
.mortgage-rank small { color:#61736d; }
.bank-admin-card dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:8px 0 0; padding-top:8px; border-top:1px solid #eef2f1; }
.bank-admin-card dt { color:var(--muted); font-size:10px; letter-spacing:.03em; text-transform:uppercase; }
.bank-admin-card dd { margin:0; font-weight:800; font-size:13px; }
.mortgage-client-note p { color:#42514c; line-height:1.55; }
/* Tlač Hypokalkulačky: zachová vizuál aplikácie (zelený header, tmavá karta
   splátky, LTV prstenec, graf, rebríček bánk), len ho zhutní na A4 a odstráni
   navigáciu a ovládacie prvky. Skryté sú IBA akčné tlačidlá — karty bánk a
   riadky rebríčka sú tiež <button>, tie musia zostať viditeľné. */
@media print {
  @page { size: A4 portrait; margin: 10mm 12mm; }
  html, body { background:#fff !important; font-size:9.5pt;
    -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }

  .sidebar, .topbar, #app-error, dialog, .voice-assistant-fab,
  .mortgage-studio input[type="range"], .amortization-details,
  .mortgage-chart { display:none !important; }
  /* Len akčné ovládanie, nie dátové karty. */
  .mortgage-top-actions, #add-mortgage-bank, .mortgage-print-cta, #refresh-mortgage-rates,
  .icon-button, .bank-edit, .bank-delete { display:none !important; }
  /* Z bočného stĺpca sa tlačí len argument pre klienta. */
  .mortgage-side>.mortgage-panel:not(.mortgage-client-note) { display:none !important; }

  .app-shell { display:block !important; }
  .content { padding:0 !important; }
  .mortgage-studio { gap:4mm; }
  .mortgage-layout { display:block !important; }
  .mortgage-main, .mortgage-side { display:block !important; }
  .mortgage-panel { padding:0; border:0; border-radius:0; box-shadow:none !important;
    margin-bottom:4mm; break-inside:avoid; }
  .section-heading { margin-bottom:1.5mm; }
  .mortgage-panel h3 { font-size:10.5pt; }
  .section-description { display:none; }

  /* Zelená hlavička — nižšia, bez dekoračného obdĺžnika. */
  .mortgage-top { min-height:0; display:flex; align-items:center; padding:5mm 6mm;
    border-radius:3mm; box-shadow:none; break-inside:avoid; }
  .mortgage-top::after { display:none; }
  .mortgage-top h2 { font-size:20pt; margin:0.5mm 0; }
  .mortgage-top p:not(.eyebrow) { max-width:none; font-size:8.5pt; }
  .eyebrow { font-size:7pt; }

  /* Parametre úveru: 4 hodnoty v rade, bez posuvníkov. */
  .mortgage-form-grid { grid-template-columns:repeat(4,1fr); gap:2.5mm; margin-bottom:3mm; }
  .mortgage-form-grid label { padding:2mm 2.5mm; border-radius:2mm; font-size:7.5pt; }
  .mortgage-form-grid input[type="number"] { padding:0; border:0; background:none;
    font-size:12pt; font-weight:800; color:#102b25; }

  /* Karty bánk pod parametrami — kompaktný pás, vybraná zostáva tmavá. */
  .bank-card-row { grid-template-columns:repeat(6,1fr); gap:1.5mm; margin-top:1.5mm; }
  .bank-card { min-height:0; padding:2mm; border-radius:2mm; font-size:7.5pt; gap:1mm; }
  .bank-card strong { font-size:8pt; }
  .bank-card small { font-size:6.8pt; }

  /* Karta splátky ostáva tmavá — je to vizuálny ťahák ponuky. Musí prebiť
     responzívne pravidlá, preto sú rozmery držané cez !important. */
  .mortgage-hero-card { grid-template-columns:1fr 78px 128px !important; gap:2.5mm;
    padding:3mm 3.5mm; border-radius:2.5mm; box-shadow:none; break-inside:avoid; }
  .mortgage-hero-card>div:first-child strong { font-size:20pt; margin:0.5mm 0; }
  .mortgage-hero-card>div:first-child span, .mortgage-hero-card small { font-size:7.5pt; }
  .mortgage-ring { width:68px; height:68px; }
  .mortgage-ring::after { inset:7px; }
  .mortgage-ring b { font-size:12pt; } .mortgage-ring span { font-size:6pt; }
  .mortgage-risk { padding:1mm 2.5mm; font-size:7.5pt; }
  .mortgage-kpi-grid { grid-template-columns:repeat(6,1fr) !important; gap:1.2mm; margin-top:1.5mm; }
  .mortgage-kpi-grid article { padding:1.5mm; border-radius:1.2mm; }
  .mortgage-kpi-grid span { font-size:6.2pt; } .mortgage-kpi-grid strong { font-size:8.5pt; }

  /* Rebríček všetkých bánk. */
  #mortgage-comparison { break-inside:avoid; }
  .mortgage-ranking { gap:1mm; }
  .mortgage-rank { padding:1.8mm 2mm; border-radius:2mm; font-size:8.5pt; break-inside:avoid; }
  .mortgage-rank span { width:22px; height:22px; font-size:8pt; }
  .mortgage-rank i { height:2px; }

  .mortgage-client-note { margin-top:3mm; padding-top:2.5mm;
    border-top:1px solid #dce8e4 !important; break-inside:avoid; }
  .mortgage-client-note h3 { font-size:10pt; }
  .mortgage-client-note p { font-size:8.5pt; line-height:1.45; }

  .table-wrap { border:0; overflow:visible; }
  table { font-size:8pt; } th, td { padding:1.2mm 2mm; }
  thead { display:table-header-group; } tr { break-inside:avoid; }
}
@media screen and (max-width: 900px) { .mortgage-top { align-items:flex-start; flex-direction:column; }.mortgage-hero-card,.mortgage-form-grid,.mortgage-kpi-grid { grid-template-columns:1fr; }.mortgage-rank { grid-template-columns:28px 1fr; }.mortgage-rank em,.mortgage-rank b,.mortgage-rank small { grid-column:2; } }
.bank-admin-list { display:grid; gap:10px; }
.bank-admin-card { display:block; padding:12px 14px; border:1px solid #dce8e4; border-radius:12px; background:#fbfcfb; }
.bank-admin-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.bank-admin-head strong { font-size:14px; line-height:1.25; }
.bank-admin-rate { display:flex; align-items:baseline; gap:5px; margin:6px 0 0; }
.bank-admin-rate b { color:#0f766e; font-size:26px; font-weight:800; line-height:1; font-variant-numeric:tabular-nums; }
.bank-admin-rate span { color:var(--muted); font-size:12px; font-weight:700; }
.bank-admin-actions { display:flex; gap:.3rem; flex-shrink:0; }
.icon-button { border:1px solid var(--line); background:#fff; border-radius:.4rem; width:2rem; height:2rem; line-height:1; cursor:pointer; }
.icon-button:hover { background:#f3f4f6; }
.lead-score-badge-wrap { position: relative; display: inline-block; }
.info-box { margin-top: 1.2rem; padding: 1rem; border: 1px solid var(--line); border-radius: .7rem; background: #f8faf9; font-size: .9rem; }
.photo-thumb-preview { width: 100%; height: 120px; display: grid; place-items: center; overflow: hidden; border-radius: .45rem; background: #edf3f6; }
.photo-thumb-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb-error { margin: 0; color: var(--danger); font-size: .78rem; }
.photo-thumb-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.photo-thumb-actions button { padding: .35rem .5rem; font-size: .78rem; }

/* Media grid (Médiá nehnuteľností, grouped by property) */
.media-library { display: grid; gap: 14px; }
.media-library-toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) auto auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.media-library-toolbar label { gap: 5px; }
.media-library-stats { min-width: 150px; padding: 10px 12px; border: 1px solid #d9e6de; border-radius: 8px; background: #f5faf7; }
.media-library-stats strong { display: block; font-size: 22px; line-height: 1; }
.media-library-stats span { color: var(--muted); font-size: 12px; }
.media-property-group { margin: 0 0 1rem; padding: 14px; border: 1px solid #cfded4; border-left: 5px solid var(--brand); border-radius: 10px; background: #f8fbf8; box-shadow: 0 8px 24px rgba(22,33,29,.045); }
.media-property-group h3 { margin: 0; font-size: 16px; }
.media-property-heading { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #dfe8e2; }
.media-property-heading p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.media-property-heading span { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: #e4f4ef; color: #0d5d47; font-size: 12px; font-weight: 750; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; }
.media-card { display: flex; flex-direction: column; gap: .4rem; padding: .5rem; border: 1px solid #d8e2dc; border-radius: .6rem; background: #fff; }
.media-thumb { width: 100%; height: 120px; object-fit: cover; border-radius: .45rem; background: #edf3f6; display: block; }
.media-thumb-file { display: grid; place-items: center; gap: .2rem; font-size: 1.6rem; color: var(--muted); }
.media-thumb-file small { font-size: .72rem; }
.media-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 600; }
.media-card-actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.media-card-actions button { padding: .3rem .5rem; font-size: .76rem; }
@media (max-width: 900px) { .media-library-toolbar { grid-template-columns: 1fr; } .media-library-stats { min-width: 0; } }

/* Document library */
.document-library { display: grid; gap: 14px; }
.document-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(220px, 320px) auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.document-toolbar label { gap: 5px; }
.document-table td { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-table .mail-actions { max-width: none; white-space: nowrap; }
@media (max-width: 900px) { .document-toolbar { grid-template-columns: 1fr; } }

/* Reusable image editor dialog */
.image-editor-card { width: min(94vw, 780px); }
.image-editor-body { display: flex; flex-direction: column; gap: .8rem; }
.image-editor-canvas-wrap { max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: .5rem; background: #edf3f6; display: grid; place-items: center; }
.image-editor-canvas-wrap canvas { max-width: 100%; cursor: crosshair; }
.image-editor-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; }
.image-editor-controls label { display: flex; align-items: center; gap: .4rem; font-weight: 600; }
.image-editor-controls input[type="range"] { width: 140px; }

/* Column settings: drag handle + width input */
.column-config-row[draggable="true"] { cursor: grab; }
.column-config-row.dragging { opacity: .4; }
.column-drag-handle { color: var(--muted); cursor: grab; }
.column-width-label { display: flex; align-items: center; gap: .3rem; font-weight: 500; font-size: .8rem; color: var(--muted); }
.column-width-label input { width: 4.5rem; }
.column-settings--compact { margin:.55rem 0 .65rem; padding:.5rem .6rem; border-radius:10px; }
.column-settings-bar { display:flex; align-items:center; gap:.65rem; min-width:0; }
.column-settings-bar strong { flex:0 0 auto; font-size:.86rem; }
.column-chip-row { display:flex; flex:1 1 auto; gap:.4rem; min-width:0; overflow-x:auto; padding:.1rem 0 .2rem; scrollbar-width:thin; }
.column-chip { flex:0 0 auto; display:flex; align-items:center; gap:.35rem; height:34px; padding:.25rem .35rem; border:1px solid #cfd9d4; border-radius:8px; background:#fff; cursor:grab; }
.column-chip.dragging { opacity:.45; }
.column-chip.is-hidden { opacity:.55; background:#f3f5f2; }
.column-chip-toggle { display:grid; place-items:center; width:22px; height:22px; min-width:22px; padding:0; border-radius:6px; color:#fff; background:var(--brand); font-size:.75rem; }
.column-chip.is-hidden .column-chip-toggle { color:#5f6f67; background:#e4ebe7; }
.column-chip-label { max-width:135px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:700; font-size:.82rem; }
.column-chip input { width:58px; height:24px; padding:.15rem .35rem; border-radius:6px; font-size:.78rem; }
.column-reset-compact { flex:0 0 auto; padding:.42rem .65rem; }

/* Customer "Správa" voice recording row */
.voice-message-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.voice-message-row audio { max-width: 260px; }

.photo-editor-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1rem; background: #0c2234c9; }
.photo-editor { width: min(96vw, 980px); max-height: 92vh; display: flex; flex-direction: column; border-radius: .9rem; background: #fff; box-shadow: 0 25px 60px #0b213bc4; overflow: hidden; }
.photo-editor-heading { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.photo-editor-heading h3 { margin: 0; }
.photo-editor-body { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(220px, 1fr); gap: 1rem; padding: 1rem 1.1rem; overflow: auto; }
.photo-editor-stage { display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.photo-editor-canvas-wrap { position: relative; display: inline-block; margin: 0 auto; max-width: 100%; background: #12283a; border-radius: .5rem; overflow: hidden; touch-action: none; }
.photo-editor-canvas-wrap canvas { display: block; max-width: 100%; height: auto; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 999px #00000073; cursor: move; }
.crop-handle { position: absolute; width: 14px; height: 14px; margin: -7px; border: 2px solid var(--brand); border-radius: 50%; background: #fff; }
.crop-handle[data-handle="nw"] { top: 0; left: 0; cursor: nwse-resize; }
.crop-handle[data-handle="ne"] { top: 0; right: 0; margin-right: -7px; cursor: nesw-resize; }
.crop-handle[data-handle="sw"] { bottom: 0; left: 0; margin-bottom: -7px; cursor: nesw-resize; }
.crop-handle[data-handle="se"] { bottom: 0; right: 0; margin-bottom: -7px; margin-right: -7px; cursor: nwse-resize; }
.photo-editor-toolbar { display: flex; flex-wrap: wrap; gap: .45rem; }
.photo-editor-toolbar button { padding: .45rem .65rem; font-size: .84rem; }
.photo-editor-controls { display: flex; flex-direction: column; gap: .7rem; align-content: start; }
.slider-row { display: grid; grid-template-columns: 1fr; gap: .25rem; font-weight: 650; font-size: .85rem; }
.slider-row input[type="range"] { width: 100%; }
.slider-row output { color: var(--muted); font-weight: 600; font-size: .78rem; }
.photo-editor-hint { margin: .4rem 0 0; color: var(--muted); font-size: .8rem; line-height: 1.4; }
@media (max-width: 760px) { .photo-editor-body { grid-template-columns: 1fr; } }

/* REBOS professional interface */
:root {
  --ink:#17211e; --muted:#6d7773; --line:#e4e8e5; --paper:#fff;
  --ground:#f5f6f3; --brand:#b69a68; --brand-dark:#927747; --nav:#111d1a;
  --nav-soft:#1c2a26; --danger:#b04438; --success:#39745b;
  --shadow:0 12px 34px rgba(22,33,29,.07); --radius:14px;
}
html { scroll-behavior:smooth; }
body { color:var(--ink); font-family:"DM Sans",Segoe UI,sans-serif; background:var(--ground); letter-spacing:-.01em; }
h1,h2,h3,.brand { font-family:Manrope,"DM Sans",sans-serif; }
button { border-radius:9px; background:var(--nav); padding:10px 16px; transition:transform .18s,box-shadow .18s,background .18s; }
button:hover { background:#293a35; transform:translateY(-1px); box-shadow:0 7px 18px #111d1a1c; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline:3px solid #c8ad7d66; outline-offset:2px; }
button.secondary { color:var(--ink); border:1px solid var(--line); background:#fff; }
button.secondary:hover { background:#f2f3f0; }
.eyebrow { color:var(--brand-dark); font-size:11px; font-weight:800; letter-spacing:.16em; }
.card { border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }

.login-shell { min-height:100vh; grid-template-columns:minmax(420px,1.15fr) minmax(420px,.85fr); place-items:stretch; padding:0; background:#fff; }
.login-story { position:relative; display:flex; min-height:100vh; padding:48px clamp(48px,7vw,110px); flex-direction:column; justify-content:space-between; overflow:hidden; color:#f4f2ec; background:linear-gradient(145deg,#0c1714 0%,#182823 62%,#233830 100%); }
.login-story::before { content:""; position:absolute; width:560px; height:560px; right:-230px; top:10%; border:1px solid #b69a6840; border-radius:50%; box-shadow:0 0 0 95px #b69a6812,0 0 0 190px #b69a680b; }
.login-story::after { content:""; position:absolute; inset:auto 0 0; height:36%; opacity:.18; background:linear-gradient(155deg,transparent 30%,#b69a68 31%,transparent 31.5%),linear-gradient(25deg,transparent 48%,#fff 48.5%,transparent 49%); }
.login-brand,.mobile-login-brand { position:relative; z-index:1; display:flex; align-items:center; gap:12px; font:800 20px/1 Manrope,sans-serif; letter-spacing:.08em; }
.brand-mark { display:grid; place-items:center; width:38px; height:38px; flex:none; color:var(--nav); border-radius:10px; background:linear-gradient(145deg,#d5c096,#a78954); font:800 12px/1 Manrope,sans-serif; }
.login-copy { position:relative; z-index:1; max-width:620px; }
.eyebrow.light { color:#cdb98e; }
.login-copy h1 { margin:18px 0 24px; color:#fff; font-size:clamp(42px,5.3vw,76px); line-height:1.04; letter-spacing:-.055em; }
.login-copy h1 em { color:#c8ad7d; font-style:normal; }
.login-copy>p:last-child { max-width:520px; color:#bfc8c4; font-size:17px; line-height:1.7; }
.login-proof { position:relative; z-index:1; display:flex; gap:28px; color:#d5dbd8; font-size:13px; }
.login-card { align-self:center; width:min(100% - 72px,470px); justify-self:center; padding:0; display:grid; gap:18px; border:0; box-shadow:none; }
.mobile-login-brand { display:none; }
.login-heading { margin-bottom:12px; }
.login-heading h2 { margin:8px 0 10px; font-size:31px; letter-spacing:-.035em; }
.login-heading>p:last-child,.login-help { color:var(--muted); }
.login-card label { color:#3d4844; font-size:13px; }
.login-card input { height:48px; }
.connection-fields { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:13px; border:1px solid var(--line); border-radius:12px; background:#f7f8f6; }
.login-submit { display:flex; height:50px; align-items:center; justify-content:space-between; margin-top:4px; padding-inline:20px; }
.quiet { border:0!important; color:var(--muted)!important; background:transparent!important; box-shadow:none!important; }
.login-help { margin-top:8px; text-align:center; font-size:12px; }
.login-help a { color:var(--brand-dark); font-weight:700; }

.app-shell { min-height:100vh; grid-template-columns:264px minmax(0,1fr); }
.sidebar { position:sticky; top:0; height:100vh; padding:24px 16px 18px; gap:24px; overflow-y:hidden; color:#eef1ef; background:var(--nav); }
#navigation { flex:1 1 auto; min-height:0; overflow-y:auto; }
.brand { gap:11px; padding:0 10px 10px; }
.brand>div { display:grid; gap:3px; }
.brand strong { font-size:18px; letter-spacing:.09em; }
.brand small { color:#7f918a; font:600 8px/1 "DM Sans"; letter-spacing:.18em; }
.brand .brand-mark { width:36px; height:36px; }
#navigation { gap:3px; }
.nav-label { margin:17px 12px 7px; color:#63756e; font-size:9px; font-weight:800; letter-spacing:.15em; }
.nav-item,.logout { position:relative; padding:10px 12px 10px 18px; border-radius:8px; color:#aebbb6; font-size:13px; font-weight:600; }
.nav-item::before { content:none; }
.nav-item:hover,.nav-item.active { color:#fff; background:var(--nav-soft); box-shadow:none; transform:none; }
.nav-item.active::after { content:""; position:absolute; left:0; top:8px; bottom:8px; width:3px; border-radius:3px; background:var(--brand); }
.nav-badge { float:right; padding:2px 5px; color:#231f16; border-radius:4px; background:var(--brand); font-size:8px; }
/* Avatar, meno a DVE ikony (prepnúť používateľa, odhlásiť sa) v jednom riadku.
   S troma stĺpcami padalo štvrté tlačidlo pod ne. */
.sidebar-footer { display:grid; grid-template-columns:34px 1fr 26px 26px; gap:7px; align-items:center; margin-top:8px; padding:14px 8px 0; border-top:1px solid #283a34; }
.frontoffice-switch { display:grid; grid-template-columns:30px 1fr; align-items:center; gap:9px; margin-top:auto; padding:11px 10px; color:#e8e1d2; border:1px solid #4e4635; border-radius:9px; background:#282a22; text-decoration:none; }
.frontoffice-switch>span { display:grid; width:30px; height:30px; place-items:center; color:#1a211e; border-radius:7px; background:var(--brand); font-weight:800; }
.frontoffice-switch>div { display:grid; }.frontoffice-switch strong { font-size:10px; }.frontoffice-switch small { color:#9e9b8f; font-size:8px; }
.frontoffice-switch:hover { border-color:#867550; background:#34352b; }
.user-avatar { display:grid; place-items:center; width:34px; height:34px; color:#e4d6b8; border:1px solid #826f4b; border-radius:50%; background:#3b382d; font-size:11px; font-weight:800; }
.sidebar-footer>div:nth-child(2) { display:grid; overflow:hidden; }
.sidebar-footer strong { overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-footer small { color:#7e9189; font-size:9px; }
.logout { width:26px; padding:6px 0; color:#81938b; text-align:center; }
.content { min-width:0; padding:38px clamp(26px,4vw,64px) 70px; }
.topbar { padding-bottom:25px; margin-bottom:25px; border-bottom:1px solid var(--line); }
.topbar h1 { margin-top:5px; font-size:31px; letter-spacing:-.04em; }
.page-subtitle { margin-top:6px; color:var(--muted); font-size:13px; }
.topbar-actions { align-self:flex-start; }
.icon-action { width:41px; height:41px; padding:0; color:var(--ink); border:1px solid var(--line); background:#fff; font-size:19px; }
.app-alert { margin-bottom:18px; padding:12px 15px; border:1px solid #eed1cd; border-radius:9px; background:#fff3f1; }

.stat-grid { grid-template-columns:repeat(auto-fit,minmax(175px,1fr)); gap:12px; margin-bottom:28px; }
.stat { position:relative; min-height:118px; padding:19px 20px; overflow:hidden; }
.stat::after { content:""; position:absolute; right:-20px; bottom:-28px; width:76px; height:76px; border-radius:50%; background:#b69a680d; }
.stat span { color:var(--muted); font-size:12px; font-weight:600; }
.stat strong { margin-top:15px; font:800 27px/1 Manrope,sans-serif; letter-spacing:-.035em; }
.stat:first-child { color:#f7f6f2; border-color:var(--nav); background:var(--nav); }
.stat:first-child span { color:#aab7b2; }
.section { margin-top:30px; }
.section-heading { margin-bottom:13px; }
.section-heading h2 { font-size:17px; letter-spacing:-.025em; }
.section-description { font-size:12px; }
.table-wrap { border-color:var(--line); border-radius:var(--radius); box-shadow:0 4px 20px rgba(22,33,29,.035); }
th,td { padding:14px 16px; }
th { color:#7b8581; background:#fafbf9; font-size:9px; letter-spacing:.11em; }
td { font-size:13px; }
tbody tr { transition:background .15s; }
tbody tr:hover { background:#f7f8f5; }
.empty { border-radius:var(--radius); }
input,select,textarea { border-color:#d9dfdb; border-radius:9px; color:var(--ink); }
input:focus,select:focus,textarea:focus { outline:3px solid #b69a6835; border-color:var(--brand); }
dialog::backdrop { background:#07100dcc; backdrop-filter:blur(4px); }
.editor-card,.property-editor { border:1px solid #ffffff55; border-radius:18px; box-shadow:0 26px 80px #07100d70; }
.editor-heading { padding-bottom:14px; border-bottom:1px solid var(--line); }
.icon-button { border-radius:50%; }
.kanban-column { border-color:#dde2de; background:#eef0ec; }
.kanban-card { border:0; box-shadow:0 4px 15px #17211e12; }
.commission-status { border-radius:6px; }

@media (max-width:1000px) {
  .login-shell { grid-template-columns:1fr; }
  .login-story { display:none; }
  .login-card { min-height:100vh; align-content:center; padding:40px 0; }
  .mobile-login-brand { display:flex; margin-bottom:25px; }
  .app-shell { grid-template-columns:82px minmax(0,1fr); }
  .sidebar { padding-inline:12px; }
  .brand { justify-content:center; padding-inline:0; }.brand>div,.nav-label,.nav-item:not(.active)::after,.sidebar-footer>div:nth-child(2),.nav-item .nav-badge { display:none; }
  .nav-item { height:auto; padding:8px 6px; overflow:hidden; text-align:center; text-overflow:ellipsis; font-size:11px; }
  .frontoffice-switch { grid-template-columns:1fr; justify-items:center; padding:7px; }.frontoffice-switch>div { display:none; }
  /* Zbalený bočný panel: avatar a obe ikony pod sebou v jednom stĺpci. */
  .sidebar-footer { grid-template-columns:1fr; justify-items:center; margin-top:8px; }.logout { margin:0; }
  .sidebar-footer #switch-user, .sidebar-footer #logout { width:26px; }
}
@media (max-width:700px) {
  .app-shell { display:block; padding-bottom:70px; }
  .sidebar { position:fixed; z-index:30; top:auto; bottom:0; width:100%; height:64px; padding:8px 10px; overflow:visible; }
  .sidebar .brand,.sidebar-footer,.frontoffice-switch,.nav-label { display:none; }
  #navigation { display:grid; grid-template-columns:repeat(5,1fr); gap:3px; }
  .nav-item { display:none; }.nav-item[data-route="dashboard"],.nav-item[data-route="customers"],.nav-item[data-route="properties"],.nav-item[data-route="opportunities"],.nav-item[data-route="calendar"] { display:block; }
  .nav-item.active { background:#273731; }
  .content { padding:24px 16px 40px; }
  .topbar { align-items:flex-start; }.topbar h1 { font-size:26px; }.page-subtitle { display:none; }
  .topbar-actions .secondary { width:auto; padding:8px 10px; overflow:hidden; font-size:11px; }
  .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.stat { min-height:105px;padding:16px; }.stat strong { font-size:22px; }
  .field-grid,.connection-fields { grid-template-columns:1fr; }.operational-search { grid-column:auto; }
  .login-card { width:min(100% - 36px,470px); }.login-heading h2 { font-size:26px; }
}

/* CRM calendar planner and process map */
.task-category-picker { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.task-category { min-height:82px; display:grid; place-items:center; gap:6px; padding:10px; border:1px solid var(--line); border-radius:12px; color:var(--ink); background:#fff; box-shadow:none; }
.task-category:hover,.task-category.active { color:#fff; background:var(--nav); transform:none; box-shadow:0 8px 18px rgba(17,29,26,.14); }
.task-category span { font-size:22px; line-height:1; }
.task-category strong { font-size:12px; }
.mail-table td.cell-wrap { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; line-height:1.35; }
.mail-process-editor { display:grid; gap:10px; }
.mail-process-picker { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px; }
.mail-process { min-height:58px; display:flex; align-items:center; gap:8px; justify-content:flex-start; text-align:left; color:var(--ink); background:#fff; border:1px solid var(--line); }
.mail-process:hover,.mail-description-choice:hover { color:var(--ink); background:#edf7fa; border-color:#b9d7df; }
.mail-process span { display:grid; place-items:center; flex:0 0 28px; width:28px; height:28px; border-radius:8px; background:var(--brand); color:#271f13; font-weight:800; }
.mail-process.active,.mail-process.active:hover,.mail-description-choice.active,.mail-description-choice.active:hover,.mail-process:focus-visible,.mail-description-choice:focus-visible { color:#fff; background:var(--nav); border-color:var(--nav); }
.mail-process.active span { color:#102b3d; background:#8dd4df; }
.mail-description-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:8px; max-height:230px; overflow:auto; padding:2px; }
.mail-description-choice { min-height:44px; text-align:left; white-space:normal; line-height:1.3; color:var(--ink); background:#f8fafb; border:1px solid var(--line); }
.mail-actions { display:flex; gap:8px; }
.view-toggle { display:inline-flex; gap:4px; padding:4px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.view-toggle button { padding:7px 10px; border:0; box-shadow:none; }
.view-toggle button.active { color:#fff; background:var(--nav); }
.calendar-shell { display:grid; gap:16px; }
.calendar-toolbar { display:grid; grid-template-columns:minmax(240px,1fr) minmax(320px,460px) auto; align-items:start; gap:14px; padding:16px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow); }
.calendar-toolbar h2 { margin:0 0 4px; font-size:18px; }
.calendar-toolbar p { color:var(--muted); font-size:13px; }
.calendar-filter-inline { display:grid; grid-template-columns:minmax(160px,1fr) minmax(140px,.75fr) auto; gap:8px; align-items:end; margin:0; padding:10px; border:1px solid var(--line); border-radius:12px; background:#fafbf9; }
.calendar-filter-inline label { gap:4px; color:var(--muted); font-size:11px; }
.calendar-filter-inline input,.calendar-filter-inline select { min-height:38px; padding:8px 9px; font-size:13px; }
.calendar-filter-inline button { min-height:38px; padding:8px 12px; }
.calendar-step { width:38px; padding-inline:0; font-size:20px; line-height:1; }
.calendar-layout { display:grid; grid-template-columns:280px minmax(0,1fr); gap:16px; align-items:start; }
.calendar-layout aside { display:grid; gap:10px; padding:15px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow); }
.calendar-layout aside h3 { margin:0; font-size:15px; }
.calendar-agenda { display:grid; gap:8px; max-height:520px; overflow:auto; }
.calendar-agenda article { display:grid; gap:2px; padding:9px 10px; border-left:3px solid var(--brand); border-radius:8px; background:#f7f8f5; }
.calendar-agenda time,.calendar-agenda span { color:var(--muted); font-size:11px; }
.calendar-agenda strong { font-size:13px; }
.compact-empty { padding:16px; }
.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(140px,1fr)); min-height:610px; overflow:auto; border:1px solid var(--line); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow); }
.calendar-grid.is-day { grid-template-columns:1fr; }
.calendar-day { min-width:180px; border-right:1px solid var(--line); }
.calendar-day.is-drop-target,.calendar-month-day.is-drop-target,.calendar-all-day.is-drop-target,.calendar-time-slot.is-drop-target { outline:3px solid #147d9a55; outline-offset:-3px; background:#eef9fd; }
.calendar-day:last-child { border-right:0; }
.calendar-day header,.calendar-month-day header { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:11px 12px; border-bottom:1px solid var(--line); background:#fafbf9; }
.calendar-day header strong { text-transform:capitalize; }
.calendar-day header span { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:#efe7d8; color:#5f4b27; font-weight:800; }
.calendar-all-day { display:grid; gap:7px; min-height:58px; padding:8px 10px; border-bottom:1px solid var(--line); background:#f5fbf6; }
.calendar-all-day>strong { color:#607069; font-size:11px; text-transform:uppercase; letter-spacing:.08em; }
.calendar-all-day>p { margin:0; color:var(--muted); font-size:12px; }
.calendar-slots { display:grid; align-content:start; min-height:500px; background:#fff; }
.calendar-time-slot { display:grid; grid-template-columns:44px minmax(0,1fr); gap:8px; min-height:48px; padding:4px 8px 4px 0; border-bottom:1px solid #edf0ed; background:linear-gradient(90deg,#fafbf9 0,#fafbf9 44px,#fff 44px); }
.calendar-time-slot:nth-child(2n) { border-bottom-color:#f4f5f2; }
.calendar-time-slot>time { padding-top:3px; color:#7b8780; font-size:11px; text-align:center; }
.calendar-time-slot>div { display:grid; gap:5px; align-content:start; min-width:0; }
.calendar-event { width:100%; display:grid; gap:3px; padding:8px 9px; border-left:4px solid var(--brand); border-radius:8px; background:#f3efe6; color:var(--ink); text-align:left; box-shadow:none; }
.calendar-event:hover { background:#ebe2d2; transform:none; box-shadow:none; }
.calendar-event span,.calendar-event small,.calendar-event em { color:#71695d; font-size:11px; font-style:normal; line-height:1.35; }
.calendar-event strong { white-space:normal; overflow-wrap:anywhere; font-size:12px; line-height:1.3; }
.calendar-event em { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.calendar-event.is-priority { border-left-width:5px; box-shadow:0 5px 14px rgba(20,125,154,.12); }
.calendar-event--task { border-left-color:#39745b; background:#edf7f1; }
.calendar-event--viewing { border-left-color:#147d9a; background:#edf7fa; }
.calendar-event--activity { border-left-color:#927747; background:#f7f3ea; }
.calendar-month { display:grid; grid-template-columns:repeat(7,minmax(125px,1fr)); overflow:auto; border:1px solid var(--line); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow); }
.calendar-month-day { min-height:128px; padding:8px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.calendar-month-day.is-outside { opacity:.5; background:#fafbf9; }
.calendar-month-day header { margin:-8px -8px 8px; }
.calendar-month-day .calendar-event { margin-bottom:6px; padding:6px 7px; }
.calendar-month-day .calendar-event em,.calendar-month-day .calendar-event small { display:none; }
.calendar-more { color:var(--muted); font-size:11px; font-weight:700; }
.calendar-empty-hint { margin:0 0 10px; padding:10px 12px; border:1px dashed var(--line); border-radius:8px; color:var(--muted); background:#fafbf9; font-size:13px; }
.embedded-calendar.is-compact { padding:16px; }
.embedded-calendar.is-compact .section-heading { margin-bottom:10px; }
.embedded-calendar.is-compact .section-description { margin:.2rem 0 0; font-size:12px; }
.embedded-calendar.is-compact .embedded-calendar-body { max-height:600px; overflow:auto; border:1px solid var(--line); border-radius:8px; background:#fff; }
.embedded-calendar.is-compact .calendar-grid { min-height:0; border:0; border-radius:0; box-shadow:none; }
.embedded-calendar.is-compact .calendar-day { min-width:150px; }
.embedded-calendar.is-compact .calendar-day header { position:sticky; top:0; z-index:2; padding:8px 10px; }
.embedded-calendar.is-compact .calendar-day header span { width:24px; height:24px; font-size:12px; }
.embedded-calendar.is-compact .calendar-all-day { min-height:42px; padding:6px 8px; }
.embedded-calendar.is-compact .calendar-time-slot { grid-template-columns:38px minmax(0,1fr); min-height:34px; padding:3px 6px 3px 0; background:linear-gradient(90deg,#fafbf9 0,#fafbf9 38px,#fff 38px); }
.embedded-calendar.is-compact .calendar-time-slot>time { font-size:10px; }
.embedded-calendar.is-compact .calendar-event { padding:5px 7px; gap:1px; border-radius:6px; }
.embedded-calendar.is-compact .calendar-event span,.embedded-calendar.is-compact .calendar-event small,.embedded-calendar.is-compact .calendar-event em { font-size:10px; }
.embedded-calendar.is-compact .calendar-event strong { font-size:11px; }
.embedded-calendar.is-compact .calendar-month { border:0; border-radius:0; box-shadow:none; }
.embedded-calendar.is-compact .calendar-month-day { min-height:96px; }
.viewing-list-heading { align-items:end; gap:16px; }
.viewing-list-heading .section-intro { margin:.25rem 0 0; }
.viewing-controls { display:grid; grid-template-columns:minmax(260px,1fr) minmax(150px,220px) auto; align-items:end; gap:10px; margin-bottom:14px; }
.viewing-controls label { display:grid; gap:5px; margin:0; color:var(--muted); font-size:12px; font-weight:700; }
.viewing-controls input,.viewing-controls select { min-height:38px; }
.viewing-controls button { min-height:38px; white-space:nowrap; }
.process-map { margin-top:26px; }
.process-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; }
.process-card { display:grid; gap:12px; align-content:start; padding:16px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow); }
.process-card>div { display:flex; align-items:center; gap:10px; }
.process-card span { display:grid; place-items:center; width:34px; height:34px; border-radius:9px; color:#271f13; background:var(--brand); font-weight:800; }
.process-card h3 { margin:0; font-size:15px; }
.process-card ul { display:grid; gap:7px; margin:0; padding-left:18px; color:#4f5a55; font-size:12px; }
.process-card button { justify-self:start; align-self:end; margin-top:2px; }
@media (max-width:1250px) { .calendar-toolbar { grid-template-columns:1fr; } .calendar-toolbar .editor-actions { justify-content:flex-start; flex-wrap:wrap; margin-top:0; } }
@media (max-width:1250px) { .viewing-list-heading { align-items:start; } .viewing-controls { width:100%; grid-template-columns:1fr 180px auto auto; } }
@media (max-width:1100px) { .calendar-layout { grid-template-columns:1fr; } .calendar-grid,.calendar-month { min-width:760px; } #calendar-results { overflow:auto; } }
@media (max-width:700px) { .calendar-filter-inline { grid-template-columns:1fr; } .process-grid { grid-template-columns:1fr; } .viewing-controls { grid-template-columns:1fr; } }
@media (max-width:700px) { .task-category-picker { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* Kompaktné tabuľky: stĺpce sa môžu zúžiť, text ostáva v jednom riadku a celý obsah je dostupný cez hover tooltip. */
.table-wrap {
  max-width: 100%;
  overflow-x: hidden;
}
.table-wrap table {
  width: 100%;
  table-layout: fixed;
}
.table-wrap th,
.table-wrap td,
.table-wrap td.cell-wrap,
.mail-table td.cell-wrap {
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  vertical-align: middle;
}
.table-wrap th {
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-wrap td .status-badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-wrap .row-actions,
.table-wrap .mail-actions {
  display: flex;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.table-wrap .row-actions button,
.table-wrap .mail-actions button {
  flex: 0 1 auto;
  min-width: 0;
  padding: .38rem .52rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .78rem;
}

/* Akčný stĺpec je ovládanie, nie dátový text: musí zostať čitateľný aj pri úzkych tabuľkách. */
.table-wrap th:last-child,
.table-wrap td:last-child {
  width: 168px;
  min-width: 140px;
}
.table-wrap td:last-child {
  overflow: visible;
  text-overflow: clip;
}
.table-wrap .row-actions,
.table-wrap .mail-actions {
  justify-content: flex-end;
}
.table-wrap .row-actions button,
.table-wrap .mail-actions button {
  flex: 0 0 auto;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
.table-wrap th.table-actions-cell,
.table-wrap td.table-actions-cell {
  min-width: 92px;
  overflow: visible;
  text-overflow: clip;
}
.table-wrap th.table-actions-cell {
  text-align: right;
}
.table-wrap td.table-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
}
.table-wrap.table-scroll-x th.table-actions-cell,
.table-wrap.table-scroll-x td.table-actions-cell {
  min-width: 92px;
}
.compact-form:not(.operational-filters) {
  grid-template-columns: minmax(260px,1fr) minmax(150px,220px) minmax(150px,220px) auto;
}
.compact-form:not(.operational-filters) > label:first-child {
  grid-column: auto;
}
.operational-filters {
  grid-template-columns: minmax(260px,1fr) minmax(150px,220px) minmax(150px,220px) auto;
}
.operational-search {
  grid-column: auto;
}
.operational-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}
.operational-titlebar .editor-actions {
  margin-top: 0;
  flex-wrap: wrap;
}
.viewing-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 220px) auto;
  align-items: end;
  gap: .75rem;
  margin-bottom: .75rem;
}
.viewing-toolbar label {
  display: grid;
  gap: .35rem;
}
.viewing-toolbar button {
  white-space: nowrap;
}
.viewing-list-section {
  margin-top: 0;
}
.content:has(.viewings-page) {
  padding-top: 18px;
}
.viewings-page {
  display: grid;
  /* Bez určenej šírky stĺpca sa mriežka roztiahne na šírku najširšieho dieťaťa —
     a tabuľka obhliadok má cez dvadsať stĺpcov. Stránka tak narástla do šírky,
     pri načítaní bola odrolovaná vpravo a tlačidlá ani ikona stĺpcov neboli
     vidieť. Tabuľka si teraz roluje sama vo svojom rámčeku. */
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}
.viewings-page > *,
.viewing-list-section > * { min-width: 0; }
.viewings-page > .embedded-calendar.is-compact {
  margin-top: 0;
}
.viewings-page > .embedded-calendar.is-compact:has(.embedded-calendar-body[hidden]) {
  display: none;
}
.viewing-list-header {
  grid-template-columns: minmax(130px, 1fr) auto auto auto;
  margin-bottom: 10px;
  width: 100%;
  min-width: 0;
}
.viewing-list-header .viewing-calendar-header-action {
  justify-self: center;
}
.viewing-list-header .app-section-voice {
  justify-self: center;
}
.viewing-list-header .app-section-actions {
  justify-self: end;
  flex-wrap: nowrap;
  min-width: 0;
}
.viewing-list-header .app-section-actions #create-viewing {
  white-space: nowrap;
}
.customer-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(145px, 200px) minmax(145px, 200px);
  align-items: end;
  gap: .75rem;
  margin-bottom: .75rem;
}
.customer-toolbar h2 {
  align-self: center;
  white-space: nowrap;
}
.customer-toolbar label {
  display: grid;
  gap: .35rem;
}
.customer-toolbar button {
  white-space: nowrap;
}
@media (max-width: 900px) {
  .app-section-header {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .app-section-voice,
  .app-section-actions,
  .viewing-list-header .viewing-calendar-header-action {
    justify-self: start;
  }
  .compact-form:not(.operational-filters),
  .operational-filters,
  .viewing-controls,
  .viewing-toolbar,
  .customer-toolbar { grid-template-columns: 1fr; }
  .operational-titlebar { align-items: flex-start; flex-direction: column; }
}

/* Široká pracovná tabuľka pre Nehnuteľnosti: dátové stĺpce aj Akcie sa posúvajú spolu. */
.table-wrap.table-scroll-x {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
}
.properties-table-shell {
  position: relative;
}
.properties-table-shell .table-scroll-top {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 16px;
  margin-bottom: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(22,33,29,.06);
}
.properties-table-shell .table-scroll-top > div {
  height: 1px;
}
.properties-table-shell .table-wrap.table-scroll-x th,
.properties-table-shell .table-wrap.table-scroll-x td {
  min-width: 0;
  max-width: none;
}
.properties-table-shell .table-wrap.table-scroll-x table {
  width: auto;
  min-width: 0;
}
.properties-table-shell .table-wrap.table-scroll-x col {
  min-width: 0;
}
.properties-table-shell .table-wrap.table-scroll-x th:last-child,
.properties-table-shell .table-wrap.table-scroll-x td:last-child,
.properties-table-shell .table-wrap.table-scroll-x th.table-actions-cell,
.properties-table-shell .table-wrap.table-scroll-x td.table-actions-cell,
.properties-table-shell .table-wrap.table-scroll-x th.table-actions-cell:last-child,
.properties-table-shell .table-wrap.table-scroll-x td.table-actions-cell:last-child {
  min-width: 0;
}
.properties-table-shell .table-wrap.table-scroll-x td.table-actions-cell {
  overflow: hidden;
}
.properties-table-shell .table-wrap.table-scroll-x .mail-actions button {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.customer-table-shell {
  position: relative;
}
.customer-table-shell .table-scroll-top {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 16px;
  margin-bottom: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(22,33,29,.06);
}
.customer-table-shell .table-scroll-top > div {
  height: 1px;
}
.customer-table-shell .table-wrap.table-scroll-x {
  overflow-x: auto;
  overflow-y: hidden;
}
.customer-table-shell .table-wrap.table-scroll-x table {
  width: auto;
  min-width: 0;
  table-layout: fixed;
}
.customer-table-shell .table-wrap.table-scroll-x th,
.customer-table-shell .table-wrap.table-scroll-x td,
.customer-table-shell .table-wrap.table-scroll-x th:last-child,
.customer-table-shell .table-wrap.table-scroll-x td:last-child,
.customer-table-shell .table-wrap.table-scroll-x th.table-actions-cell,
.customer-table-shell .table-wrap.table-scroll-x td.table-actions-cell,
.customer-table-shell .table-wrap.table-scroll-x th.table-actions-cell:last-child,
.customer-table-shell .table-wrap.table-scroll-x td.table-actions-cell:last-child {
  min-width: 0;
  max-width: none;
}
.customer-table-shell .table-wrap.table-scroll-x td.table-actions-cell {
  overflow: hidden;
}
.table-sort-button {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  letter-spacing: inherit;
}
.table-sort-button:hover,
.table-sort-button.is-active {
  background: transparent;
  color: var(--brand-dark);
}
.table-sort-button span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  min-width: 2.4em;
  letter-spacing: 0;
  text-transform: none;
  text-align: right;
}
.table-wrap.table-scroll-x table {
  width: max-content;
  min-width: max(100%, 1780px);
  table-layout: fixed;
}
.table-wrap.table-scroll-x th,
.table-wrap.table-scroll-x td {
  width: 130px;
}
.table-wrap.table-scroll-x th:first-child,
.table-wrap.table-scroll-x td:first-child {
  width: 210px;
}
.table-wrap.table-scroll-x th:last-child,
.table-wrap.table-scroll-x td:last-child {
  width: 170px;
  min-width: 170px;
}
.table-wrap.table-scroll-x th.table-actions-cell,
.table-wrap.table-scroll-x td.table-actions-cell {
  min-width: 92px;
}
.table-wrap.table-scroll-x th.table-actions-cell:last-child,
.table-wrap.table-scroll-x td.table-actions-cell:last-child {
  min-width: 92px;
}
.app-shell .topbar {
  display: none !important;
}

.deal-progress-panel {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  align-items: center;
  gap: 1rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: #fff;
  margin: .7rem 0;
}
.deal-progress-panel strong { display: block; font-size: 1.9rem; line-height: 1; margin: .2rem 0; }
.deal-progress-panel small, .detail-kicker { color: var(--muted); font-size: .78rem; }
.deal-progress-bar, .deal-mini-progress { height: .55rem; border-radius: 999px; background: #eef2f1; overflow: hidden; }
.deal-progress-bar i, .deal-mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.deal-phase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .55rem; margin-bottom: .9rem; }
.deal-phase-card { border: 1px solid var(--line); border-radius: .55rem; padding: .65rem; background: #fbfcfb; display: grid; gap: .35rem; }
.deal-phase-card strong { font-size: .86rem; }
.deal-phase-card span { color: var(--muted); font-size: .76rem; }
.deal-mini-progress { height: .32rem; }
.deal-workflow-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(240px, .85fr); gap: 1rem; align-items: start; }
.deal-workflow-layout h4 { margin: .25rem 0 .65rem; font-size: .92rem; }
.deal-step-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.deal-step-item { display: grid; grid-template-columns: 2rem 1fr; gap: .65rem; }
.deal-step-index { width: 2rem; height: 2rem; border-radius: 999px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--brand); }
.deal-step-body { border: 1px solid var(--line); border-left-width: 4px; border-radius: .6rem; padding: .7rem; background: #fff; display: grid; gap: .45rem; }
.deal-step-item--done .deal-step-body { border-left-color: #16a34a; }
.deal-step-item--info .deal-step-body { border-left-color: #2563eb; }
.deal-step-item--danger .deal-step-body { border-left-color: #dc2626; }
.deal-step-item--cancelled .deal-step-body { border-left-color: #9ca3af; }
.deal-step-head { display: flex; justify-content: space-between; gap: .75rem; align-items: start; }
.deal-step-head small { display: block; color: var(--muted); font-size: .72rem; margin-bottom: .15rem; }
.deal-step-head strong { display: block; }
.deal-step-meta { display: flex; flex-wrap: wrap; gap: .4rem .6rem; color: var(--muted); font-size: .78rem; }
.deal-step-body p { margin: 0; white-space: pre-wrap; color: var(--ink); }
.deal-step-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.deal-step-actions button { min-height: 2rem; padding: .35rem .65rem; }
@media (max-width: 900px) {
  .deal-progress-panel, .deal-workflow-layout { grid-template-columns: 1fr; }
}

.deal-documents-section {
  margin-top: 1rem;
}
.deal-documents-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
}
.deal-documents-head h3 {
  margin: 0;
}
.deal-documents-head span {
  color: var(--muted);
  font-size: .8rem;
}
.deal-documents-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: .65rem;
}
.deal-document-card {
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: #fff;
  padding: .75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
}
.deal-document-card small,
.deal-document-card span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
}
.deal-document-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: .15rem 0;
}
.deal-document-card button {
  white-space: nowrap;
}

.deal-case-summary {
  display: grid;
  gap: .8rem;
  margin-bottom: 1rem;
}
.deal-case-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: #fbfcfb;
}
.deal-case-title h2 {
  margin: .15rem 0;
  font-size: 1.15rem;
}
.deal-case-title p {
  margin: 0;
  color: var(--muted);
}
.deal-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .55rem;
}
.deal-case-grid .detail-item {
  min-width: 0;
}
.deal-case-grid .detail-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deal-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: .8rem;
  margin-top: 1rem;
}
.deal-related-section {
  min-width: 0;
}
.deal-related-list {
  display: grid;
  gap: .55rem;
}
.deal-related-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: #fff;
}
.deal-related-card small,
.deal-related-card span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
}
.deal-related-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: .12rem 0;
}
.deal-related-card button {
  white-space: nowrap;
}

/* Obchodné prípady - cockpit hlavnej pipeline */
.deal-cockpit { display: grid; gap: 14px; }
.deal-cockpit-stats { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; }
.deal-stat { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px 14px; }
.deal-stat span { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; }
.deal-stat strong { display: block; margin-top: 4px; font-size: 1.35rem; }
.deal-process-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.deal-process-strip span { min-height: 48px; display: grid; align-content: center; gap: 3px; padding: 7px 8px; border: 1px solid #dfe7e3; border-radius: 7px; background: #f8faf9; font-size: .76rem; white-space: normal; }
.deal-process-strip b { color: var(--brand-dark); font-size: .72rem; }
.deal-board { display: grid; grid-template-columns: repeat(6, minmax(160px, 1fr)); gap: 10px; overflow: visible; align-items: stretch; }
.deal-card { gap: 7px; }
.deal-card-progress { height: 6px; border-radius: 999px; overflow: hidden; background: #edf2ef; }
.deal-card-progress i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.deal-card span b { font-weight: 800; }
.deal-card-actions { display: grid; gap: 7px; margin-top: 4px; }
.deal-card-actions label { gap: 4px; font-size: .78rem; }
.deal-card-actions select { min-height: 34px; padding: 6px 8px; }
.deal-card-actions button { width: 100%; min-height: 34px; padding: 7px 9px; }
@media (max-width: 1100px) { .deal-cockpit-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .deal-cockpit-stats { grid-template-columns: 1fr; } }

.deal-execution-summary {
  margin: .9rem 0 1rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: #fbfcfb;
}
.deal-execution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .55rem;
}
.deal-execution-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: #fff;
  padding: .7rem;
}
.deal-execution-grid small,
.deal-execution-grid span {
  display: block;
  color: var(--muted);
  font-size: .75rem;
}
.deal-execution-grid strong {
  display: block;
  margin: .18rem 0;
  font-size: 1.15rem;
}
.deal-step-quick {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px auto auto;
  gap: .45rem;
  align-items: end;
  margin-top: .45rem;
  padding-top: .55rem;
  border-top: 1px dashed var(--line);
}
.deal-step-quick input {
  min-height: 2.1rem;
  padding: .4rem .55rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  min-width: 0;
}
.deal-step-quick button {
  min-height: 2.1rem;
  padding: .38rem .65rem;
  white-space: nowrap;
}
@media (max-width: 820px) {
  .deal-step-quick { grid-template-columns: 1fr; }
}
.deal-demand-strip {
  align-items: center;
  background: #f7f5ef;
  border: 1px solid #e2d7bd;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 14px 0;
  padding: 10px 12px;
}
.deal-demand-strip > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.deal-list-overview {
  margin-top: 18px;
}
.deal-list-overview h3 {
  font-size: 16px;
  margin: 0 0 10px;
}
.deal-list-overview table td,
.deal-list-overview table th {
  white-space: nowrap;
}

.customer-requirement-field {
  background: #f7f5ef;
  border: 1px solid #e2d7bd;
  border-radius: 8px;
  padding: 10px;
}
.client-requirement-info,
.client-requirement-info strong,
.client-requirement-info span,
.client-requirement-info small {
  color: #177245 !important;
}
.client-requirement-info {
  border-left-color: #1d8f57 !important;
}
.client-requirement-info button,
.client-requirement-info button:hover {
  color: var(--ink) !important;
}
.requirement-existing-notice {
  display: grid;
  gap: .15rem;
  padding: .75rem .85rem;
  border: 1px solid #b7e4c7;
  border-radius: 8px;
  background: #ecfdf3;
  color: #166534;
}
.requirement-existing-notice span {
  color: #166534;
  font-size: .9rem;
  font-weight: 600;
}
.customer-requirement-field::before {
  content: "Požiadavka klienta";
  display: block;
  margin-bottom: 6px;
  color: #8f6f34;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.opportunity-row {
  cursor: pointer;
}
.opportunity-row:hover td {
  background: #f7f5ef;
}
.deal-board .kanban-column {
  min-width: 0;
  flex: initial;
}
.deal-case-switcher {
  margin: 0 0 1rem;
  padding: .75rem;
  border: 1px solid #e2d7bd;
  border-radius: .65rem;
  background: #f7f5ef;
}
.detail-bottom-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: .75rem;
  background: linear-gradient(#ffffff00, #fff 28%, #fff);
}
@media (max-width: 1280px) {
  .deal-board { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
}
@media (max-width: 760px) {
  .deal-process-strip,
  .deal-board { grid-template-columns: 1fr; }
}
/* Obchodné prípady - aktívny prípad priamo na ploche */
.active-deal-panel {
  display: grid;
  gap: .8rem;
  padding: .95rem;
  border: 1px solid #d9caa8;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 10px 26px rgba(31, 45, 40, .08);
}
.active-deal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.active-deal-head h3 {
  margin: .1rem 0 .2rem;
  font-size: 1.08rem;
}
.active-deal-head p {
  margin: 0;
  color: var(--muted);
}
.active-deal-actions {
  flex: 0 0 auto;
}
.active-deal-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
}
.active-deal-metrics article {
  min-width: 0;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.active-deal-metrics span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}
.active-deal-metrics strong {
  display: block;
  margin-top: .12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-deal-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .45rem;
}
.active-deal-step {
  min-width: 0;
  display: grid;
  gap: .12rem;
  padding: .5rem .55rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.active-deal-step:hover { border-color: #b99a5b; box-shadow: 0 0 0 2px rgba(185, 154, 91, .16); }
.active-deal-step b {
  color: #8b6b2f;
  font-size: .68rem;
}
.active-deal-step strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .78rem;
}
.active-deal-step small {
  color: var(--muted);
  font-size: .68rem;
}
.active-deal-step--done { border-color: #bde6ca; background: #f1fbf4; }
.active-deal-step--active { border-color: #9fd5e4; background: #eef9fc; }
.active-deal-step--blocked { border-color: #f2b8b5; background: #fff4f3; }
.active-deal-step--muted { opacity: .62; }
.deal-step-evidence { margin-top: 1.1rem; }
.deal-step-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.deal-step-evidence-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: .85rem;
}
.deal-step-evidence-card.is-highlighted {
  border-color: #b99a5b;
  box-shadow: 0 0 0 3px rgba(185, 154, 91, .18);
}
.deal-step-evidence-card header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}
.deal-step-evidence-card header b {
  background: #b99a5b;
  border-radius: 7px;
  padding: .28rem .42rem;
}
.deal-step-evidence-card header strong { flex: 1; }
.deal-step-evidence-card ul { margin: .35rem 0 .65rem 1rem; color: var(--muted); }
.deal-table-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  justify-content: flex-end;
  white-space: nowrap;
}
.deal-table-actions button {
  padding: .42rem .58rem;
  font-size: .78rem;
}
@media (max-width: 1100px) {
  .active-deal-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .active-deal-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .active-deal-head { flex-direction: column; }
  .active-deal-metrics,
  .active-deal-steps { grid-template-columns: 1fr; }
}
.active-deal-step em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: .68rem;
  font-style: normal;
}
.active-deal-panel .kanban-chip--done {
  margin-left: .3rem;
  vertical-align: middle;
}
.active-deal-workspace {
  display: grid;
  gap: .9rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 33, 28, .08);
}
.active-deal-workspace > h3 {
  margin: 0;
}
.active-deal-workspace .deal-progress-panel,
.active-deal-workspace .deal-execution-summary {
  margin: 0;
}
.active-deal-workspace .deal-phase-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.active-deal-workspace .deal-workflow-layout {
  margin-top: .35rem;
}
.deal-cockpit .kanban-help {
  margin-top: .25rem;
}
@media (max-width: 1100px) {
  .active-deal-workspace .deal-phase-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .active-deal-workspace .deal-phase-grid { grid-template-columns: 1fr; }
}
.deal-list-scroll {
  max-height: 470px;
  overflow: auto;
}
.deal-list-scroll table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.active-step-actions {
  display: flex;
  gap: .35rem;
  margin-top: .25rem;
}
.active-step-actions button {
  flex: 1 1 0;
  min-height: 1.75rem;
  padding: .25rem .35rem;
  font-size: .68rem;
}
.active-deal-state,
.active-deal-timeline {
  display: grid;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.active-deal-timeline h3,
.active-deal-state h3 {
  margin: 0;
}
.deal-cockpit > .deal-list-overview {
  order: 2;
}
.deal-cockpit > .active-deal-panel {
  order: 3;
}
.deal-cockpit > .deal-execution-summary,
.deal-cockpit > .active-deal-state {
  order: 4;
}
.deal-cockpit > .active-deal-timeline {
  order: 5;
}
/* Podrobnosti podľa krokov patria úplne na koniec. Kockpit je mriežka s poradím
   určeným v CSS, takže sekcia bez `order` dostala predvolenú nulu a predbehla
   všetko ostatné — hoci v kóde sa skladá ako posledná. Preto to nepomohlo
   presúvať ju v JavaScripte. */
.deal-cockpit > .deal-step-evidence {
  order: 9;
}
/* Skupinové menu a nastavenia workflow */
.sidebar {
  gap: 16px;
}
#navigation {
  display: block;
  overflow-y: auto;
  padding-right: 4px;
}
.nav-group {
  margin: 0 0 8px;
}
.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  color: #8fb2bd;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.nav-group-toggle:hover {
  background: rgba(255,255,255,.06);
  color: #eaf7fa;
}
.nav-group-toggle::after {
  content: '+';
  font-size: 14px;
  line-height: 1;
}
.nav-group.is-open .nav-group-toggle::after {
  content: '-';
}
.nav-group-items {
  display: none;
  gap: 4px;
  padding: 2px 0 4px;
}
.nav-group.is-open .nav-group-items {
  display: grid;
}
.nav-group .nav-item {
  min-height: 36px;
  padding: 8px 10px 8px 18px;
  border-left: 3px solid transparent;
  border-radius: 7px;
}
.nav-group .nav-item.active {
  border-left-color: #c3a15d;
  background: #1b3a32;
}
.workflow-settings {
  display: grid;
  gap: 14px;
}
.settings-intro {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.settings-intro article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.settings-intro strong {
  display: block;
  margin-bottom: 4px;
}
.settings-intro p {
  color: var(--muted);
  font-size: .86rem;
}
.template-form {
  display: grid;
  grid-template-columns: minmax(160px, 210px) minmax(150px, 190px) minmax(260px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.template-form button {
  white-space: nowrap;
}
@media (max-width: 1050px) {
  .settings-intro,
  .template-form {
    grid-template-columns: 1fr;
  }
}.template-form {
  grid-template-columns: minmax(150px, 190px) minmax(150px, 210px) minmax(260px, 1fr) minmax(95px, 120px) auto;
}
.workflow-settings .table-actions-cell {
  min-width: 185px;
}
.workflow-settings .table-actions-cell button {
  margin-left: .25rem;
}
@media (max-width: 1180px) {
  .template-form { grid-template-columns: 1fr 1fr; }
  .template-form .template-name { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .template-form { grid-template-columns: 1fr; }
}
.activity-calendar-screen {
  display: grid;
  gap: 12px;
  margin-top: 0;
}
.content:has(.activity-calendar-screen) {
  padding-top: 18px;
}
.content:has(.communication-route-section),
.content:has(.mail-section) {
  padding-top: 18px;
}
.communication-route-section {
  margin-top: 0;
}
.activity-calendar-topline {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 12px;
}
.activity-calendar-topline h2 {
  margin: 0;
  font-size: 21px;
}
.activity-calendar-topline > #create-activities {
  justify-self: end;
}
.activity-calendar-filter {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 230px) minmax(150px, 210px) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.activity-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  justify-self: center;
}
.activity-calendar-screen .embedded-calendar-body {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: #fff;
}
@media (max-width: 1000px) {
  .activity-calendar-topline { grid-template-columns: 1fr; }
  .activity-calendar-topline > #create-activities { justify-self: start; }
  .activity-calendar-filter { grid-template-columns: 1fr 1fr; }
  .activity-calendar-toolbar { justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .activity-calendar-filter { grid-template-columns: 1fr; }
}
.contracts-documents-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.merged-panel {
  min-width: 0;
}

.contracts-documents-page .table-wrap {
  max-width: 100%;
}

.workflow-taxonomy {
  margin-bottom: 16px;
}

.compact-template-form {
  grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr) auto;
}

.workflow-settings .table-wrap th:first-child,
.workflow-settings .table-wrap td:first-child,
.workflow-taxonomy .table-wrap th:first-child,
.workflow-taxonomy .table-wrap td:first-child {
  min-width: 170px;
}

.content:has(.dashboard-tasks-first) {
  padding-top: 18px;
}
.dashboard-tasks-first {
  margin-top: 0;
}
.dashboard-tasks-first .dashboard-task-toolbar {
  flex-wrap: nowrap;
  align-items: flex-end;
  margin: 0 0 14px;
}
.dashboard-tasks-first .list-toolbar-title {
  min-width: 110px;
}
.dashboard-tasks-first .list-toolbar-search {
  flex: 1 1 auto;
  min-width: 360px;
}
@media (max-width: 980px) {
  .dashboard-tasks-first .dashboard-task-toolbar {
    flex-wrap: wrap;
  }
  .dashboard-tasks-first .list-toolbar-search {
    min-width: 240px;
  }
}

.dashboard-overview-block {
  display: block;
}

.properties-list-section {
  margin-top: 0;
}
.properties-page-toolbar {
  flex-wrap: nowrap;
  align-items: flex-end;
  margin: 0 0 14px;
}
.properties-page-toolbar .list-toolbar-title {
  min-width: 170px;
}
.properties-page-toolbar .list-toolbar-search {
  flex: 1 1 auto;
  min-width: 360px;
}
.properties-page-toolbar > label:not(.list-toolbar-search) {
  flex: 0 0 150px;
}
.properties-page-toolbar > .secondary:not(.icon-action) {
  white-space: nowrap;
}
@media (max-width: 1250px) {
  .properties-page-toolbar {
    flex-wrap: wrap;
  }
  .properties-page-toolbar .list-toolbar-search {
    min-width: 280px;
  }
}

/* Workflow and task-template drag sorting */
.sortable-workflow-category,
.sortable-task-template,
.workflow-step-row {
  cursor: grab;
}
.sortable-workflow-category.dragging,
.sortable-task-template.dragging,
.workflow-step-row.dragging {
  opacity: .45;
}
.sortable-workflow-category.drag-over,
.sortable-task-template.drag-over,
.workflow-step-row.drag-over {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.drag-cell {
  width: 32px;
  text-align: center;
  color: var(--muted);
}
.row-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: grab;
  user-select: none;
}
.document-types-table {
  table-layout: fixed;
}
.document-types-table .doctype-drag-column {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  padding-left: 8px;
  padding-right: 6px;
  text-align: center;
}
/* Šírky určuje <colgroup> podľa nastavenia stĺpcov, nie poradie v tabuľke.
   Predtým tu boli pevné šírky pre pôvodných päť stĺpcov (36 %, 40 %, 120 px);
   po pridaní ďalších sa na Určenie, Poznámku a Stav neušlo nič a zmizli. */
.sortable-step-editor {
  display: grid;
  gap: 10px;
}
#workflow-step-sorter {
  display: grid;
  gap: 8px;
}
.workflow-step-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.workflow-step-row input {
  min-width: 0;
}
/* 16-step CRM process: compact readable cards in process sections. */
.process-grid--sixteen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.process-grid--sixteen .process-card {
  min-height: 0;
}
.process-grid--sixteen .process-card h3 {
  font-size: 15px;
  line-height: 1.25;
}
.process-grid--sixteen .process-card ul {
  max-height: 118px;
  overflow: auto;
  padding-right: 4px;
}
.process-grid--sixteen .process-card li {
  line-height: 1.35;
}
.active-deal-steps {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
/* Leady --------------------------------------------------------------- */
.lead-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 16px 0;
}
.lead-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #6b7280);
}
.lead-filters .checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
}
.meeting-slot-picker {
  margin-top: 8px;
}
#editor .editor-card:has(.meeting-slot-picker) {
  width: min(1320px, calc(100vw - 44px));
  max-height: calc(100vh - 36px);
  overflow: hidden;
}
#editor .editor-card:has(.meeting-slot-picker) .field-grid {
  max-height: calc(100vh - 178px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  align-content: start;
  align-items: start;
}
#editor .editor-card:has(.meeting-slot-picker) label {
  align-self: start;
}
.meeting-slot-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf7;
}
.meeting-slot-summary strong {
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0;
}
.meeting-slot-summary button {
  min-height: 38px;
}
.meeting-weeks {
  display: grid;
  gap: 12px;
}
.meeting-week-title {
  margin: 4px 0 7px;
  color: var(--muted, #6b7280);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.meeting-day-grid,
.meeting-time-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}
.meeting-time-grid {
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.meeting-day-option,
.meeting-time-option {
  min-height: 50px;
  padding: 8px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(22, 37, 53, .04);
}
.meeting-day-option:hover,
.meeting-time-option:hover {
  border-color: var(--success-line, #bfd8ce);
  background: var(--success-wash, #f7fbf8);
  color: var(--success-dark, #2f5f50);
}
.meeting-day-option span {
  display: block;
  color: var(--muted, #6b7280);
  font-size: 0.68rem;
  line-height: 1;
  text-transform: uppercase;
}
.meeting-day-option strong {
  display: block;
  margin-top: 5px;
  font-size: 0.95rem;
}
.meeting-time-option {
  min-height: 44px;
  font-size: 0.95rem;
}
.meeting-day-option.is-selected,
.meeting-time-option.is-selected {
  border-color: var(--success-line, #bfd8ce);
  color: var(--success-dark, #2f5f50);
  background: var(--success-soft, #e8f3ee);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent), 0 6px 14px color-mix(in srgb, var(--brand) 12%, transparent);
}
.meeting-day-option.is-selected span {
  color: var(--success-dark, #2f5f50);
  opacity: .78;
}
.meeting-calendar-alternative {
  margin-top: 14px;
}
.meeting-availability-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(21, 38, 58, .08);
}
.meeting-availability-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
}
.meeting-availability-head div {
  display: grid;
  gap: 2px;
  text-align: center;
}
.meeting-availability-head strong {
  font-size: 1rem;
}
.meeting-availability-head span,
.meeting-availability-help {
  color: var(--muted, #6b7280);
  font-size: .84rem;
}
.meeting-availability-help {
  margin: 0;
}
.meeting-week-nav {
  min-height: 38px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
}
.meeting-availability-calendar {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.meeting-availability-calendar .calendar-grid {
  grid-template-columns: repeat(7, minmax(128px, 1fr));
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.meeting-availability-calendar .calendar-day {
  min-width: 128px;
}
.meeting-availability-calendar .calendar-day header {
  padding: 8px 9px;
}
.meeting-availability-calendar .calendar-all-day {
  min-height: 44px;
  padding: 6px 8px;
}
.meeting-availability-calendar .calendar-time-slot {
  grid-template-columns: 39px minmax(0, 1fr);
  min-height: 36px;
  padding: 3px 5px 3px 0;
  background: linear-gradient(90deg,#fafbf9 0,#fafbf9 39px,#fff 39px);
}
.meeting-availability-calendar .calendar-time-slot {
  cursor: pointer;
}
.meeting-availability-calendar .calendar-time-slot:hover {
  background: linear-gradient(90deg,#f4f7f2 0,#f4f7f2 39px,var(--success-wash, #f7fbf8) 39px);
}
.meeting-availability-calendar .calendar-time-slot.is-selected-slot {
  position: relative;
  outline: 0;
  background: linear-gradient(90deg,#edf4ef 0,#edf4ef 39px,#f5fbf8 39px);
}
.meeting-availability-calendar .calendar-time-slot.is-selected-slot:not(.is-selected-slot-start) {
  box-shadow: inset 3px 0 0 var(--success-line, #bfd8ce);
}
.meeting-availability-calendar .calendar-time-slot.is-selected-slot-start::after {
  content: attr(data-meeting-preview);
  display: block;
  grid-column: 2;
  min-height: 30px;
  padding: 6px 8px;
  border-left: 4px solid var(--brand, #4f8b78);
  border-radius: 6px;
  background: #fff;
  color: var(--success-dark, #2f5f50);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--brand) 14%, transparent);
}
.meeting-time-correction {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}
.meeting-time-correction-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.meeting-time-correction-head span,
.meeting-time-correction-head b {
  color: var(--success-dark, #2f5f50);
  font-size: 1.1rem;
  font-weight: 800;
}
.meeting-range-control {
  position: relative;
  min-height: 34px;
  display: grid;
  align-items: center;
}
.meeting-range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #dce4eb;
  pointer-events: none;
}
.meeting-range-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: var(--brand, #4f8b78);
}
.meeting-range-control input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--brand, #4f8b78);
  pointer-events: none;
  z-index: 2;
}
.meeting-range-control input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
}
.meeting-range-control input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
}
.meeting-time-correction button {
  min-height: 36px;
  white-space: nowrap;
}
.meeting-duration-field {
  margin-top: 2px;
}
.meeting-duration-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf7;
}
.meeting-duration-picker button {
  min-height: 40px;
  color: var(--ink) !important;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  box-shadow: none;
}
.meeting-duration-picker button:hover {
  border-color: var(--success-line, #bfd8ce) !important;
  background: var(--success-wash, #f7fbf8) !important;
}
.meeting-duration-picker button.is-selected {
  border-color: var(--success-line, #bfd8ce) !important;
  background: var(--success-soft, #e8f3ee) !important;
  color: var(--success-dark, #2f5f50) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 16%, transparent);
}
.meeting-calendar-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(21, 38, 58, .08);
}
.meeting-calendar-head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.meeting-calendar-head strong {
  text-align: center;
  text-transform: capitalize;
}
.meeting-calendar-nav {
  min-height: 36px;
  padding: 0;
  font-size: 1.3rem;
  line-height: 1;
}
.meeting-calendar-weekdays,
.meeting-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.meeting-calendar-weekdays span {
  color: var(--muted, #6b7280);
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}
.meeting-calendar-day {
  min-height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f8faf7;
  color: var(--ink);
  font-weight: 750;
}
.meeting-calendar-day:hover {
  border-color: var(--success-line, #bfd8ce);
  background: var(--success-wash, #f7fbf8);
  color: var(--success-dark, #2f5f50);
}
.meeting-calendar-day.is-outside {
  opacity: .45;
  background: #f3f5f1;
}
.meeting-calendar-day.is-today {
  border-color: #c9b77c;
  background: #fff7df;
}
.meeting-calendar-day.is-selected {
  border-color: var(--success-line, #bfd8ce);
  background: var(--success-soft, #e8f3ee);
  color: var(--success-dark, #2f5f50);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 20%, transparent);
}
@media (max-width: 720px) {
  .meeting-day-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .meeting-time-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .meeting-calendar-panel { padding: 10px; }
  #editor .editor-card:has(.meeting-slot-picker) {
    width: min(100vw - 16px, 1320px);
  }
  .meeting-availability-calendar .calendar-grid {
    min-width: 900px;
  }
  .meeting-time-correction {
    grid-template-columns: 1fr;
  }
  .meeting-duration-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.acquisition-demo-note { margin: 0 0 1rem; }
.acquisition-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.acquisition-flow article {
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.acquisition-flow strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}
.acquisition-flow span {
  display: block;
  color: var(--muted, #6b7280);
  font-size: 0.9rem;
  line-height: 1.45;
}
.lead-actions { white-space: nowrap; }
.lead-actions button { margin-right: 4px; }
.lead-score {
  display: inline-block;
  min-width: 34px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-weight: 600;
  text-align: center;
}
/* SLA semafor: zelená = v termíne, jantárová = posledná pol hodina, červená = prekročené. */
.sla-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  white-space: nowrap;
}
.sla-ok { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.sla-warning { background: rgba(217, 119, 6, 0.15); color: #b45309; }
.sla-breached { background: rgba(220, 38, 38, 0.15); color: #b91c1c; font-weight: 600; }
.sla-done { background: rgba(100, 116, 139, 0.15); color: #475569; }
.sla-none { background: rgba(100, 116, 139, 0.1); color: #64748b; }
tr.row-alert > td { background: rgba(220, 38, 38, 0.04); }
.stat-card-alert { border-color: rgba(220, 38, 38, 0.45); }
.stat-card-alert strong { color: #b91c1c; }
.timeline-list { list-style: none; margin: 0; padding: 0; }
.timeline-list li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.9rem;
}

/* Rozdiely medzi dopytom a ponukou v tabuľke párovania. */
.match-diffs { display: flex; flex-wrap: wrap; gap: 4px; max-width: 22rem; }
.match-diffs .sla-pill { font-size: 0.72rem; }

/* Sticky modal headers keep the close action reachable in long cards. */
.editor-card > .editor-heading,
.property-editor > .modal-header,
.photo-editor-heading,
.modal-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
}
.editor-card > .editor-heading {
  margin: -24px -24px 18px;
  padding: 24px 24px 14px;
}
.property-editor > .modal-header {
  margin: -24px -24px 0;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
}
.editor-card > .editor-heading .icon-button,
.property-editor > .modal-header .close-modal,
.photo-editor-heading .icon-button,
.modal-head button {
  flex: 0 0 auto;
}

/* Tlačidlo Médiá pri nehnuteľnosti, ktorá už nejaké súbory má. */
button.property-media-record.has-media {
  background: #e8f3e6;
  border-color: #7ba86f;
  color: #2f5227;
  font-weight: 600;
}

.communication-table th.table-actions-cell,
.communication-table td.table-actions-cell,
.communication-table th.table-actions-cell:last-child,
.communication-table td.table-actions-cell:last-child {
  width: 1%;
  min-width: 0;
  white-space: nowrap;
}
.communication-table td.table-actions-cell {
  padding-left: .55rem;
  padding-right: .55rem;
}
.communication-table .row-actions,
.communication-table .mail-actions {
  width: max-content;
  min-width: max-content;
}


.participant-select {
  display: grid;
  gap: .45rem;
}
.participant-select span {
  font-weight: 700;
}
.participant-select select[multiple] {
  min-height: 108px;
  padding: .45rem .55rem;
  line-height: 1.35;
}
.participant-select option {
  padding: .35rem .45rem;
}

/* Editor fotografií — nástroje v riadkoch nad posuvníkmi. */
.image-editor-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.image-editor-tools button { font-size: 0.82rem; padding: 6px 10px; }
#image-editor-hint { font-size: 0.8rem; margin-top: 10px; }
.media-property-heading .editor-actions { display: flex; align-items: center; gap: 10px; }

.amenity-icon {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 8px;
  background: #e6eef1;
  color: #315667;
  box-shadow: inset 0 0 0 1px rgba(49,86,103,.12);
}
.amenity-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.amenity-option:nth-child(2n) .amenity-icon,
.amenity-option:nth-child(5n) .amenity-icon {
  background: #e7efea;
  color: #486b60;
  box-shadow: inset 0 0 0 1px rgba(72,107,96,.13);
}
.amenity-option.is-selected .amenity-icon {
  background: #d5e6df;
  color: #24584d;
}
.amenity-label {
  line-height: 1.15;
}


.commission-step-assignment {
  display: grid;
  gap: .6rem;
  margin-top: .8rem;
}
.commission-step-assignment h4 {
  margin: 0;
  font-size: .98rem;
}
.commission-step-row small {
  display: block;
  margin-top: .18rem;
  color: var(--muted);
  font-weight: 650;
}
.commission-step-row select {
  min-width: 210px;
}
.commission-step-row .check-line {
  align-items: center;
  margin: 0;
  white-space: nowrap;
}

.contracts-documents-page {
  margin-top: 0;
  min-width: 0;
}
.contracts-documents-shell {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.contracts-documents-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid #dde6e1;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff, #f4f8f6);
  box-shadow: 0 14px 35px rgba(23, 33, 30, .07);
}
.contracts-documents-title h1 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.15;
}
.contracts-documents-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: .9rem;
}
.contracts-documents-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef3f0;
  box-shadow: inset 0 1px 2px rgba(23, 33, 30, .05);
}
.contracts-documents-tab {
  background: transparent;
  color: var(--ink);
  border: 0;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 800;
}
.contracts-documents-tab:hover {
  background: #dde9e3;
  color: var(--ink);
}
.contracts-documents-tab.active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 5px 14px rgba(23, 33, 30, .16);
}
.contracts-documents-actions,
.contracts-documents-panel-head .editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin: 0;
  flex-wrap: wrap;
}
.contracts-documents-toolbar {
  padding: 14px;
  border: 1px solid #e0e7e3;
  border-radius: 12px;
  background: #fff;
}
.contracts-documents-toolbar .list-search {
  max-width: none;
}
.contracts-documents-toolbar input {
  min-height: 42px;
}
.contracts-documents-pane {
  display: grid;
  /* Bez pevnej šírky stĺpca sa mriežka roztiahne na šírku najširšieho dieťaťa.
     Lišta nastavenia stĺpcov je široká cez dva a pol tisíc pixelov, takže
     rozhodila celú stránku — obsah sa posunul a bočné menu zmizlo z obrazovky. */
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #dde6e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(23, 33, 30, .055);
}
.contracts-documents-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf1ee;
}
.contracts-documents-panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
}
.contracts-documents-pane .table-wrap {
  border-radius: 10px;
  max-width: 100%;
  min-width: 0;
}
.contracts-documents-page .table-actions-cell,
.contracts-documents-page td:last-child {
  width: 1%;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .contracts-documents-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .contracts-documents-tabs,
  .contracts-documents-actions {
    justify-self: start;
  }
  .contracts-documents-panel-head {
    flex-direction: column;
  }
}.linked-records-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #dce5e1;
  border-left: 4px solid #2f8f6b;
  border-radius: 8px;
  background: #f7fbf9;
}
.linked-records-head,
.linked-record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.linked-records-head h3 {
  margin: 0;
  font-size: 1rem;
}
.linked-record-row {
  padding: 10px 0;
  border-top: 1px solid #e1ebe7;
}
.linked-record-row:first-of-type {
  border-top: 0;
}
.linked-record-row span {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compact-empty {
  margin: 8px 0 0;
}
.contracts-documents-page .table-actions-cell {
  white-space: nowrap;
}

#editor .editor-card:has(#commission-split-preview) {
  width: min(98vw, 1080px);
}
.commission-step-table-wrap {
  overflow-x: hidden;
}
.commission-step-table-wrap table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
  white-space: normal;
}
.commission-step-table-wrap th:first-child,
.commission-step-table-wrap td:first-child {
  width: 96px;
}
.commission-step-table-wrap th:nth-child(2),
.commission-step-table-wrap td:nth-child(2) {
  width: 38%;
}
.commission-step-table-wrap th:nth-child(3),
.commission-step-table-wrap td:nth-child(3) {
  width: auto;
}
.commission-agent-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.commission-agent-choice {
  min-width: 0;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #cbd8dc;
  border-radius: 999px;
  background: #f8faf9;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  box-shadow: none;
}
.commission-agent-choice:hover {
  background: var(--success-wash);
}
.commission-agent-choice.is-selected {
  border-color: var(--brand);
  background: var(--success-soft);
  color: var(--success-dark);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 20%, transparent);
}
.commission-step-row:has(.commission-agent-choice.is-selected) {
  background: var(--success-wash);
}

.commission-calculation-note {
  margin: .35rem 0 .65rem;
  padding: .55rem .7rem;
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  background: var(--success-wash);
  color: var(--success-dark) !important;
  font-weight: 750;
}


/* Plátno editora fotografií sa pri priblížení posúva rolovaním rámu. */
.image-editor-canvas-wrap { overflow: auto; max-height: 62vh; }
.image-editor-canvas-wrap canvas { display: block; width: 100%; height: auto; }
/* Skryté tlačidlá musia ostať skryté aj proti globálnym štýlom tlačidiel. */
.image-editor-tools button[hidden] { display: none !important; }


#editor .editor-card:has(#commission-split-preview) {
  max-height: min(92vh, 980px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#editor .editor-card:has(#commission-split-preview) #editor-fields {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}
#editor .editor-card:has(#commission-split-preview) .editor-actions {
  position: sticky;
  bottom: 0;
  z-index: 30;
  margin: 12px -24px -24px;
  padding: 12px 24px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}
#editor .editor-card:has(#commission-split-preview) .commission-split {
  max-height: none;
}

/* Commission editor must expose the split calculation and keep actions reachable. */
#editor .editor-card:has(#commission-split-preview) {
  width: min(98vw, 1120px) !important;
  max-height: 92vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
#editor .editor-card:has(#commission-split-preview) .field-grid {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  align-content: start;
}
#editor .editor-card:has(#commission-split-preview) .participant-picker {
  max-height: 82px;
  overflow: auto;
}
#commission-split-preview {
  display: block;
  min-height: 260px;
}
#editor .editor-card:has(#commission-split-preview) .commission-split {
  margin-top: 4px;
}
#editor .editor-card:has(#commission-split-preview) .editor-actions {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 30;
  margin: 10px -24px -24px;
  padding: 12px 24px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

/* Detail provízie: výpočet má byť čitateľný bez horizontálneho scrollovania. */
.commission-audit-table-wrap {
  overflow-x: hidden;
}
.commission-audit-table-wrap table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  white-space: normal;
  font-size: .88rem;
}
.commission-audit-table-wrap th,
.commission-audit-table-wrap td {
  padding: .55rem .65rem;
  min-width: 0;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
}
.commission-audit-table-wrap th:nth-child(1),
.commission-audit-table-wrap td:nth-child(1) { width: 9%; }
.commission-audit-table-wrap th:nth-child(2),
.commission-audit-table-wrap td:nth-child(2) { width: 27%; }
.commission-audit-table-wrap th:nth-child(3),
.commission-audit-table-wrap td:nth-child(3) { width: 17%; }
.commission-audit-table-wrap th:nth-child(4),
.commission-audit-table-wrap td:nth-child(4) { width: 18%; }
.commission-audit-table-wrap th:nth-child(5),
.commission-audit-table-wrap td:nth-child(5) { width: 12%; }
.commission-audit-table-wrap th:nth-child(6),
.commission-audit-table-wrap td:nth-child(6) { width: 17%; }
.commission-audit .commission-calculation-note {
  font-size: .86rem;
  line-height: 1.35;
}
@media (max-width: 900px) {
  .commission-audit-table-wrap table { font-size: .82rem; }
  .commission-audit-table-wrap th,
  .commission-audit-table-wrap td { padding: .45rem .5rem; }
}

/* Zrozumiteľný výber viacerých spolupracujúcich maklérov. */
.participant-picker.participant-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .75rem;
  background: #fbfcfd;
}
.participant-picker legend {
  padding: 0 .25rem;
  font-weight: 800;
}
.participant-picker p {
  margin: 0 0 .55rem;
  color: var(--muted);
  font-size: .86rem;
}
.participant-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .45rem;
}
.participant-choice {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  padding: .58rem .7rem;
  border: 1px solid #ccd8dd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 750;
}
.participant-choice input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  accent-color: var(--brand);
}
.participant-choice span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.participant-choice:hover {
  background: var(--success-wash);
  border-color: var(--success-line);
}
.participant-choice.is-selected,
.participant-choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--success-soft);
  color: var(--success-dark);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent);
}
.participant-count {
  display: block;
  margin-top: .5rem;
  color: var(--muted);
  font-weight: 700;
}
#editor .editor-card:has(#commission-split-preview) .participant-picker {
  max-height: none;
  overflow: visible;
}


/* Unified theme interaction language across REBOS. */
:root {
  --accent:var(--brand);
  --success:var(--brand);
  --success-dark:var(--brand-dark);
  --success-soft:color-mix(in srgb, var(--brand) 14%, #fff);
  --success-wash:color-mix(in srgb, var(--brand) 6%, #fff);
  --success-line:color-mix(in srgb, var(--brand) 38%, #fff);
}
button:not(.secondary):not(.danger-soft),
.button:not(.button-secondary),
.primary-action {
  background: var(--success);
  color: #fff;
}
button:not(.secondary):not(.danger-soft):hover,
.button:not(.button-secondary):hover,
.primary-action:hover {
  background: var(--success-dark);
}
button.secondary.active,
.view-toggle button.active,
.assistant-tabs .active,
.contracts-documents-tab.active {
  background: var(--success-dark) !important;
  color: #fff !important;
  border-color: var(--success-dark) !important;
}

/* Hlavička tabuľky nie je tlačidlo na akciu — sýta zelená plocha s bielym
   textom v nej robí z jednoduchého zoradenia nečitateľnú škvrnu. Aktívny
   stĺpec sa označí jemným podfarbením, tučným písmom a šípkou. */
.table-sort-button {
  background: transparent !important;
  color: inherit !important;
  font: inherit !important;
  padding: 2px 6px !important;
  border: 0 !important;
}
.table-sort-button.is-active {
  background: var(--success-soft) !important;
  color: var(--success-dark) !important;
  font-weight: 800;
  border-radius: 6px;
  padding: 2px 6px !important;
}
.table-sort-button.is-active span { color: var(--brand); font-weight: 700; }
.table-sort-button:hover { background: var(--success-wash) !important; border-radius: 6px; }
.table-sort-button span { min-width: 2.4em; text-align: right; opacity: .55; }
.table-sort-button.is-active span { opacity: 1; }

/* Udalosti v kalendári: mäkké podfarbenie a tmavý text. Globálne pravidlo pre
   tlačidlá (button:not(.secondary)) im inak dá sýto zelené pozadie. */
.calendar-event,
.calendar-event:hover {
  color: var(--ink) !important;
  border: 1px solid var(--line);
  border-left-width: 4px;
  box-shadow: none;
}
.calendar-event { background: #f7f5ef !important; }
.calendar-event:hover { background: #efeadd !important; }
.calendar-event--task { background: #eef6f1 !important; border-left-color: #39745b; }
.calendar-event--task:hover { background: #e2efe8 !important; }
.calendar-event--viewing { background: #eaf4f8 !important; border-left-color: #147d9a; }
.calendar-event--viewing:hover { background: #dcedf4 !important; }
.calendar-event--activity { background: #faf5ea !important; border-left-color: #927747; }
.calendar-event--activity:hover { background: #f4ecd9 !important; }
.calendar-event strong { color: #23302a; font-weight: 700; }
.calendar-event span, .calendar-event small, .calendar-event em { color: #5f6a63 !important; }
input:focus,
select:focus,
textarea:focus {
  outline-color: rgba(36,122,96,.24) !important;
  border-color: var(--success) !important;
}
tbody tr:hover td,
.table-wrap tbody tr:hover td,
.opportunity-row:hover td {
  background: var(--success-wash) !important;
}
tr.is-selected td,
tr.selected td,
.table-row-selected td,
.customer-row--qualified td,
.row-active td,
.linked-record-row.is-selected {
  background: var(--success-wash) !important;
  color: var(--success-dark);
}
.customer-row--lead td {
  background: #f3faf6 !important;
}
.customer-status-banner--qualified,
.profile-action-feedback,
.voice-status,
.address-selected,
.client-requirement-info,
.commission-calculation-note,
.active-deal-step--done,
.deal-step-item--done .deal-step-body,
.lead-score-breakdown-item {
  border-color: var(--success-line) !important;
  background: var(--success-wash) !important;
  color: var(--success-dark) !important;
}
.status-badge--done,
.status-badge--teal,
.commission-status-paid,
.kanban-chip--done,
.lead-score,
.lead-score-text,
.property-summary span {
  background: var(--success-soft) !important;
  color: var(--success-dark) !important;
  border-color: var(--success-line) !important;
}
.status-badge--info,
.commission-status-approved,
.active-deal-step--active {
  background: #e7f6ef !important;
  color: var(--success-dark) !important;
  border-color: var(--success-line) !important;
}
.lookup-choice:hover,
.lookup-choice:focus,
.address-suggestions button:hover,
.amenity-option:hover,
.commission-agent-choice:hover,
.participant-choice:hover {
  background: var(--success-wash) !important;
  border-color: var(--success-line) !important;
}
.amenity-option.is-selected,
.commission-agent-choice.is-selected,
.participant-choice.is-selected,
.participant-choice:has(input:checked),
.commission-step-row:has(.commission-agent-choice.is-selected) {
  border-color: var(--success) !important;
  background: var(--success-soft) !important;
  color: var(--success-dark) !important;
  box-shadow: inset 0 0 0 1px rgba(36,122,96,.18), 0 2px 8px rgba(36,122,96,.08) !important;
}
.column-settings,
.info-panel,
.notice-panel,
.active-deal-panel,
.deal-execution-summary,
.commission-split,
.participant-picker.participant-select {
  border-color: #d6e7df;
}
.photo-thumb-badge,
.quality-track i,
.deal-progress-bar i,
.deal-mini-progress i {
  background: linear-gradient(90deg, var(--success), var(--success-dark)) !important;
}
.nav-item:hover,
.nav-item.active,
.nav-group .nav-item.active {
  background: #1b3a32 !important;
  color: #fff !important;
}
.nav-group .nav-item.active {
  border-left-color: #8fc8b5 !important;
}


/* Audit chips: vznik záznamu a posledná editácia v jednom kompaktnom stĺpci. */
.audit-stack {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-width: 0;
}
.audit-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #d6e1dd;
  border-radius: 999px;
  background: #f7faf8;
  color: #52625b;
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}
.audit-chip b {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.audit-chip--created {
  border-color: var(--success-line);
  background: var(--success-wash);
  color: var(--success-dark);
}
.audit-chip--updated {
  border-color: #c9b77c;
  background: #fff7df;
  color: #5f4710;
}
td .audit-stack {
  max-width: 240px;
}

/* Výber lokalít: zoznam po okresoch + schematická mapa Petržalky. */
.locality-picker { display: grid; gap: 14px; }
/* Desiatky obcí v úzkom dialógu sú neprehľadné — karta výberu je preto
   dvojnásobne široká a zostáva v strede obrazovky (šírku musí dostať karta,
   nie samotný <dialog>, inak sa roztiahne len podklad a karta ostane vľavo). */
#editor:has(.locality-picker) .editor-card { width: min(1240px, 96vw); margin-inline: auto; }
/* Okres = jedna karta: hlavička s názvom a akciami, pod ňou lokality.
   Hlavička drží všetko na jednom riadku — text sa nesmie lámať, inak vznikne
   ten neprehľadný trojriadkový popis. */
.locality-group { border: 1px solid var(--line, #ddd6c9); border-radius: 12px; overflow: hidden; background: #fff; }
.locality-group.is-whole { border-color: #6f9c63; box-shadow: 0 0 0 1px #6f9c6355; }
/* Názov vľavo, akcie v strede — mriežka 1fr auto 1fr drží akcie v strede karty
   bez ohľadu na dĺžku názvu okresu; pri úzkom okne sa riadok zalomí. */
.locality-group-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 9px 14px; background: #f3f6f1; border-bottom: 1px solid var(--line, #ddd6c9); }
.locality-group-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.locality-group-actions { grid-column: 2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 900px) {
  .locality-group-head { grid-template-columns: 1fr; }
  .locality-group-actions { grid-column: 1; justify-content: flex-start; }
}
.locality-group.is-whole .locality-group-head { background: #e8f3e6; }
.locality-note-inline {
  display: inline;
  margin-left: 6px;
  white-space: nowrap;
  font-size: 0.88em;
}
.content:has(.localities-screen) {
  padding-top: 18px;
}
.localities-screen {
  display: grid;
  gap: 10px;
  margin-top: 0;
}
.localities-heading {
  margin-bottom: 0;
}
.localities-heading .editor-actions {
  margin-top: 0;
}
.localities-toolbar {
  margin: 0;
}
.localities-toolbar .list-search {
  max-width: none;
}
.localities-screen .column-settings {
  margin: 0;
}
.localities-table-wrap {
  margin-top: 0;
}
.localities-table-wrap td:first-child {
  white-space: nowrap;
}
.localities-table-wrap td:nth-child(2) {
  white-space: nowrap;
}
.localities-table-wrap td:first-child strong,
.locality-note-inline {
  display: inline;
  white-space: nowrap;
}
.locality-note-inline {
  margin-left: 6px;
}
.locality-group-head > strong { font-size: 0.98rem; white-space: nowrap; }
.locality-group-head > .muted { white-space: nowrap; font-size: 0.82rem; }
.locality-district { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 0 auto;
  padding: 4px 10px; border: 1px solid var(--line, #ddd6c9); border-radius: 999px; background: #fff;
  font-size: 0.84rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.locality-district:hover { border-color: #6f9c63; }
.locality-district input { margin: 0; flex: 0 0 auto; }
.locality-open-map { flex: 0 0 auto; padding: 4px 12px; font-size: 0.84rem; white-space: nowrap; border-radius: 999px; }
.locality-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; }
/* Prepínač máp: prvý riadok Bratislava, druhý ostatné okresy — bez skrolovania. */
.locality-map-tabs-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); margin-right: 4px; }
/* Bez toho by sa zaškrtávatko v globálnej mriežke odtrhlo nad svoj popis. */
.locality-picker .checkbox-row { display: flex; justify-content: flex-start; align-items: center;
  gap: 8px; margin: 6px 0; font-size: 0.9rem; font-weight: 600; }
.locality-picker .checkbox-row input { flex: 0 0 auto; margin: 0; }
.locality-picker { max-width: 100%; overflow-x: hidden; }
.locality-chip { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; border: 1px solid var(--line, #ddd6c9); border-radius: 999px; padding: 3px 10px; font-size: 0.82rem; cursor: pointer; }
.locality-chip:hover { border-color: #6f9c63; background: #f6faf4; }
.locality-chip.is-selected { background: #6f9c63; border-color: #4c7043; color: #fff; font-weight: 600; }
.locality-chip.is-selected input { accent-color: #fff; }
/* Schované menu: bočný panel sa zbalí a obsah dostane celú šírku obrazovky.
   Skrýva sa ikonou pri logu, vracia ikonou v hlavičke stránky — inak by sa
   skryté menu nedalo vrátiť. */
.topbar-heading { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
/* Logo vľavo, ikona na schovanie menu úplne vpravo; názov musí zostať na
   jednom riadku, inak sa „SLOVAKIA REAL“ zalomí a hlavička poskočí. */
.brand { position: relative; justify-content: flex-start; padding-left: 6px; padding-right: 4px; gap: 9px; }
.brand > div { min-width: 0; }
.brand strong { display: block; white-space: nowrap; font-size: 16px; letter-spacing: .06em; }
.brand small { white-space: nowrap; }
.menu-toggle {
  flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border-radius: 8px; background: rgba(255,255,255,.12) !important; color: #eaf7fa !important;
  font-size: 17px; line-height: 1;
}
.menu-toggle:hover { background: rgba(255,255,255,.22) !important; }
.brand .menu-toggle { margin-left: auto; width: 26px; height: 26px; font-size: 14px; }
/* Plávajúce tlačidlo na vrátenie menu — drží sa vľavo hore nad obsahom. */
.menu-show {
  display: none; position: fixed; top: 14px; left: 12px; z-index: 60;
  background: #16302a !important; color: #eaf7fa !important;
  box-shadow: 0 6px 16px rgba(12,34,26,.28);
}
.menu-show:hover { background: #234a3f !important; }
body.menu-hidden .menu-show { display: grid; }
body.menu-hidden .content { padding-left: 58px; }
/* Schovaný panel je vybratý z mriežky (position:fixed), preto má mriežka jediný
   stĺpec a obsah v ňom musí byť výslovne umiestnený — inak sa scvrkne. */
body.menu-hidden .app-shell { grid-template-columns: minmax(0, 1fr) !important; }
body.menu-hidden .content { grid-column: 1 / -1; }
/* Schované menu čaká za ľavým okrajom. Keď tam prídeš myšou, vysunie sa ako
   plávajúci panel — sekciu zmeníš bez toho, aby si menu musel natrvalo vrátiť. */
body.menu-hidden .sidebar {
  position: fixed; top: 0; left: 0; z-index: 70;
  width: 264px; height: 100vh; transform: translateX(-100%);
  transition: transform .18s ease; box-shadow: 0 0 32px rgba(8,22,18,.45);
}
body.menu-hidden.menu-peek .sidebar { transform: translateX(0); }
/* Neviditeľný pruh pri okraji, ktorý vysunutie spúšťa aj bez presného trafenia. */
body.menu-hidden .menu-peek-zone { display: block; }
.menu-peek-zone { display: none; position: fixed; top: 0; left: 0; width: 8px; height: 100vh; z-index: 65; }

/* Dátum vzniku záznamu — jemné podfarbenie, nech je v zozname na očiach. */
.created-chip { display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: #eef2f8; color: #33506b; font-weight: 600; white-space: nowrap; }

/* Menu sa má zmestiť bez vlastnej posuvnej lišty: kompaktnejšie riadky a
   odkaz na frontoffice až celkom dole nad pätičkou. */
.sidebar { gap: 10px !important; }
.nav-group { margin: 0 0 2px !important; }
.nav-group-items { gap: 2px !important; }
.nav-group-toggle { min-height: 26px !important; padding: 5px 10px !important; font-size: 11px !important; }
.nav-item, .logout, .nav-group .nav-item {
  min-height: 27px !important; padding: 5px 10px 5px 14px !important; font-size: 12px !important;
}
.frontoffice-switch { margin-top: auto !important; padding: 8px 10px !important; }
#navigation { overflow-y: auto; scrollbar-gutter: stable; }

/* Kontakt v tabuľke: pokojný štítok namiesto modrého podčiarknutého odkazu. */
.contact-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 3px 10px; border: 1px solid var(--line) !important; border-radius: 999px;
  background: var(--success-wash) !important; color: var(--success-dark) !important; font: inherit !important;
  font-size: 0.85rem !important; font-weight: 600 !important; text-decoration: none !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.contact-chip:hover { background: var(--success-soft) !important; border-color: var(--success-line) !important; }
.contact-chip--mail { color: #24506f !important; background: #eef3f8 !important; }
.contact-chip--mail:hover { background: #e0eaf4 !important; border-color: #7ba0c4 !important; }
.contact-chip span { opacity: .7; }
/* Voľba spôsobu hovoru: kompaktná karta bez vlastného scrollu. */
.call-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.call-choice button { justify-content: flex-start; gap: 8px; min-height: 42px; padding: 9px 12px; font-size: 0.92rem; }
.call-choice button:last-child { grid-column: 1 / -1; }
.call-choice-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.call-choice-notes p { margin: 0; padding: 9px 11px; border: 1px solid var(--line, #dfe6e2); border-radius: 8px; background: #f7faf8; color: var(--muted, #6d7772); font-size: 12.5px; line-height: 1.35; }
.call-softphone-url input { min-height: 38px; padding: 8px 10px; }
.call-softphone-url small { font-size: 12px; line-height: 1.3; }
#editor .editor-card:has(.call-choice) { width: min(720px, 96vw); max-height: min(86vh, 760px); }
#editor .editor-card:has(.call-choice) #editor-fields { overflow: visible; display: grid; gap: 10px; padding-right: 0; }
#editor .editor-card:has(.call-choice) .editor-heading { margin-bottom: 12px; }
#editor .editor-card:has(.call-choice) .editor-actions { margin-top: 12px; }

/* Rýchla oprava údajov klienta priamo v karte záznamu. */
.customer-inline-edit { display: grid; gap: 10px; }
.customer-inline-edit > button { justify-self: start; }
#customer-inline-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9f6; }

/* Termín splnenia úlohy z komunikácie; po termíne musí byť vidieť na prvý pohľad. */
.activity-due { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #eef3ec; color: #2f5a3d; font-weight: 600; white-space: nowrap; }
.activity-due.is-overdue { background: #fbe9e7; color: #a3372c; }
.activity-due.is-done { background: #e3f0e0; color: #2f5a3d; text-decoration: line-through; }
/* Akcie v riadku: jemné pastelové odlíšenie podľa významu — úprava modrá,
   uzavretie zelené, delegovanie okrové. Sýte plochy by z tabuľky urobili pútač. */
.communication-table .action-edit { background: #eaf1f8 !important; border-color: #c3d7ea !important; color: #24506f !important; }
.communication-table .action-edit:hover { background: #dbe8f4 !important; }
.communication-table .action-complete { background: #e9f4ea !important; border-color: #c2ddc6 !important; color: #2f6136 !important; }
.communication-table .action-complete:hover { background: #dcecdf !important; }
.communication-table .action-complete.is-done { background: #f4f1e6 !important; border-color: #ddd3b8 !important; color: #6f5f33 !important; }
.communication-table .action-delegate { background: #fbf1e4 !important; border-color: #e8d5b8 !important; color: #7a5626 !important; }
.communication-table .action-delegate:hover { background: #f6e7d2 !important; }
.communication-table .table-actions-cell button { font-weight: 600; border-radius: 8px; }
/* Dátum splnenia je zároveň odkaz na opravu — vyzerá ako text, správa sa ako tlačidlo. */
.communication-table .link-like {
  background: transparent !important; border: 0 !important; padding: 0 !important;
  color: #2f5a3d !important; font: inherit !important; font-weight: 600 !important;
  text-decoration: underline dotted; cursor: pointer;
}
.communication-table .link-like:hover { color: #24506f !important; text-decoration: underline; }

/* Šírku stĺpca určuje nastavenie, nie dĺžka textu: pevné rozloženie tabuľky
   + orezanie tromi bodkami. Celý text je v tooltipe (title na bunke). */
.communication-table table { table-layout: fixed; }
/* Spoločné pravidlo pre vodorovne posuvné tabuľky vynucuje min-width 1780 px —
   stĺpce by sa potom roztiahli späť a zúženie by nemalo efekt. */
.table-wrap.communication-table.table-scroll-x table { width: auto; min-width: 0; }
/* Spoločné pravidlo dáva každému stĺpcu 130 px (prvému 210 px) — to by prebilo
   šírku nastavenú v „Nastaviť stĺpce“, preto ho tu rušíme. */
.table-wrap.communication-table.table-scroll-x th,
.table-wrap.communication-table.table-scroll-x td,
.table-wrap.communication-table.table-scroll-x th:first-child,
.table-wrap.communication-table.table-scroll-x td:first-child { width: auto; }
.communication-table td.cell-clip,
.communication-table th {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: normal;
}
.communication-table td.cell-clip .activity-due { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* Zúžený stĺpec Akcie tlačidlá zalomí namiesto toho, aby pretiekli do suseda. */
.communication-table td.mail-actions,
.communication-table td.row-actions { overflow: hidden; }
.communication-table td.mail-actions,
.communication-table td.row-actions { display: table-cell; }
.communication-table td.mail-actions > button,
.communication-table td.row-actions > button { margin: 1px 2px 1px 0; }

/* Akcie sa nelepia k okraju: pri pevných šírkach stĺpcov sa lepivá bunka
   odtrhne od tabuľky a nechá pred sebou prázdny pás. Stĺpec preto ostáva
   normálnou súčasťou riadka a doscrolluje sa k nemu ako ku každému inému. */

/* Obrys okresu: obce ležia v ňom, takže mapa má tvar okresu a nie štvorca. */
.locality-outline { fill: #f5f2e9; stroke: #8d8577; stroke-width: 0.8; stroke-linejoin: round; }
.locality-map { width: 100%; max-height: 46vh; background: #fbfaf7; border: 1px solid var(--line, #ddd6c9); border-radius: 8px; }
.locality-zone path { fill: #efece4; stroke: #8d8577; stroke-width: 0.35; cursor: pointer; transition: fill .12s ease; }
.locality-zone:hover path { fill: #ddd6c9; }
.locality-zone.is-selected path { fill: #6f9c63; stroke: #4c7043; }
/* Okresné mesto sa odlíši farbou aj hrubším rámom — na mape musí byť hneď vidieť. */
.locality-zone.mesto path { fill: #e3ded0; stroke: #8a7f66; stroke-width: 0.6; }
.locality-zone.mesto text { font-weight: 800; }
.locality-zone.mesto.is-selected path { fill: #55803f; }
.locality-zone rect { fill: #efece4; stroke: #b9b1a1; stroke-width: 0.3; cursor: pointer; transition: fill .12s ease; }
.locality-zone text { font-size: 2.4px; text-anchor: middle; fill: #5a5347; pointer-events: none; font-weight: 600; }
.locality-zone:hover rect { fill: #ddd6c9; }
.locality-zone.is-selected rect { fill: #6f9c63; stroke: #4c7043; }
.locality-zone.is-selected text { fill: #fff; }

/* Theme-aware interaction palette. Keep colors tied to appearance variables. */
:root {
  --accent:var(--brand);
  --success:var(--brand);
  --success-dark:var(--brand-dark);
  --success-soft:color-mix(in srgb, var(--brand) 14%, #fff);
  --success-wash:color-mix(in srgb, var(--brand) 6%, #fff);
  --success-line:color-mix(in srgb, var(--brand) 38%, #fff);
}

button:not(.secondary):not(.danger-soft),
.button:not(.button-secondary),
.primary-action {
  background:var(--brand);
  color:#fff;
}

button:not(.secondary):not(.danger-soft):hover,
.button:not(.button-secondary):hover,
.primary-action:hover {
  background:var(--brand-dark);
}

.nav-group-toggle:hover,
.sidebar .nav-item:hover,
.sidebar .nav-item.active,
.sidebar .nav-group .nav-item.active {
  background:color-mix(in srgb, var(--brand) 28%, transparent) !important;
  color:#f7fbf8 !important;
}

.sidebar .nav-item.active::after,
.sidebar .nav-group .nav-item.active {
  border-left-color:var(--success-line) !important;
}

.frontoffice-switch>span,
.nav-badge {
  background:var(--brand) !important;
}

tbody tr:hover td,
.table-wrap tbody tr:hover td,
.opportunity-row:hover td {
  background:var(--row-hover, var(--success-wash)) !important;
}

.status-badge--done,
.status-badge--teal,
.commission-status-paid,
.kanban-chip--done,
.lead-score,
.lead-score-text,
.property-summary span,
.audit-chip--created {
  background:var(--success-soft) !important;
  color:var(--success-dark) !important;
  border-color:var(--success-line) !important;
}

.amenity-option:hover,
.commission-agent-choice:hover,
.participant-choice:hover {
  background:var(--success-wash) !important;
  border-color:var(--success-line) !important;
}

.amenity-option.is-selected,
.commission-agent-choice.is-selected,
.participant-choice.is-selected,
.participant-choice:has(input:checked),
.commission-step-row:has(.commission-agent-choice.is-selected) {
  border-color:var(--brand) !important;
  background:var(--success-soft) !important;
  color:var(--success-dark) !important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--brand) 16%, transparent), 0 2px 8px color-mix(in srgb, var(--brand) 8%, transparent) !important;
}

.participant-choice input {
  accent-color:var(--brand);
}

/* Compact, calmer sidebar menu. */
.sidebar {
  padding:18px 14px 14px !important;
  gap:14px !important;
}

#navigation {
  scrollbar-width:thin;
}

.nav-label {
  margin:10px 10px 4px !important;
  color:#7f968d !important;
}

.nav-group {
  margin:0 0 4px !important;
}

.nav-group-toggle {
  min-height:30px !important;
  padding:7px 10px !important;
  border-radius:7px !important;
  background:color-mix(in srgb, var(--brand) 18%, transparent) !important;
  color:#d7e4df !important;
  letter-spacing:.08em !important;
}

.nav-group-toggle:hover {
  background:color-mix(in srgb, var(--brand) 25%, transparent) !important;
}

.nav-group-items {
  gap:3px !important;
}

.nav-item,
.logout,
.nav-group .nav-item {
  min-height:30px !important;
  padding:7px 10px 7px 16px !important;
  border-radius:7px !important;
  font-size:12.5px !important;
  line-height:1.15 !important;
  background:rgba(255,255,255,.025) !important;
  color:#c9d7d2 !important;
}

.nav-item:hover,
.nav-item.active,
.nav-group .nav-item.active {
  background:color-mix(in srgb, var(--brand) 22%, transparent) !important;
  color:#f3faf7 !important;
}

.nav-item.active::after {
  top:6px !important;
  bottom:6px !important;
  background:var(--success-line) !important;
}

.frontoffice-switch {
  margin-top:10px !important;
  padding:9px 10px !important;
  border-color:rgba(191,216,206,.28) !important;
  background:rgba(255,255,255,.055) !important;
}

.frontoffice-switch>span,
.sidebar-footer .logout {
  background:var(--brand) !important;
}

.sidebar-footer {
  margin-top:6px !important;
  padding-top:10px !important;
}

/* Väčšia mapa s plnými názvami a prepínačom okresov. */
.locality-map { max-height: 62vh; min-height: 340px; }
.locality-picker .locality-map {
  max-height: 80vh;
  min-height: 442px;
}
.locality-zone text { font-size: inherit; }
.locality-map-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.locality-map-tabs button { font-size: 0.8rem; padding: 5px 10px; }
.locality-map-tabs button.is-active { background: #6f9c63; border-color: #4c7043; color: #fff; font-weight: 600; }

/* Orientačné body a komunikácie na mape lokalít. */
.locality-road { fill: none; stroke-linecap: round; }
.locality-road.voda { stroke: #7fb4d8; stroke-width: 1.2; }
.locality-road.cesta-hlavna { stroke: #d8a24a; stroke-width: 1.1; }
.locality-road.cesta { stroke: #cbbfa6; stroke-width: 0.7; stroke-dasharray: 2 1.4; }
.locality-place circle { fill: #fff; stroke: #8d8577; stroke-width: 0.25; }
.locality-place .locality-place-icon { font-size: 2px; text-anchor: middle; }
.locality-place .locality-place-name { font-size: 1.7px; text-anchor: middle; fill: #6b6355; }
.locality-place.nemocnica circle { stroke: #c2504b; }
.locality-place.skola circle { stroke: #4b7bc2; }
.locality-place.obchod circle { stroke: #b58b2e; }
.locality-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.78rem; color: #6b6355; margin-top: 6px; }

/* Orientačné body: na mape iba ikona, názvy v zozname pod mapou. */
.locality-place circle { fill: #fff; fill-opacity: .92; stroke-width: .3; }
.locality-place .locality-place-icon { font-size: 1.8px; text-anchor: middle; }
.locality-place:hover circle { stroke-width: .6; }
.locality-legend { display: grid; gap: 4px; font-size: 0.78rem; color: #6b6355; margin-top: 8px; line-height: 1.45; }
.locality-legend-icon { font-size: 0.9rem; }

/* Mapa lokalít vo vrstvách ako bežná mapa: podklad, zeleň, voda, cesty, plochy. */
.locality-basemap { fill: #f3f0e9; }
.locality-area.zelen { fill: #d8e8cd; }
.locality-area.voda { fill: #b6d8ee; }
.locality-road.dialnica { stroke: #f0b25a; stroke-width: 2.2; fill: none; stroke-linecap: round; }
.locality-road.hlavna { stroke: #fdfcf8; stroke-width: 1.6; fill: none; stroke-linecap: round; }
.locality-road.vedlajsia { stroke: #fdfcf8; stroke-width: 0.9; fill: none; stroke-linecap: round; }
.locality-zone.zelen rect { fill: #c6ddb8; stroke: #93b586; }
.locality-zone.voda rect { fill: #a7cfe8; stroke: #6ea6c7; }
.locality-zone.zelen text, .locality-zone.voda text { fill: #3f4c38; }
.locality-place .locality-place-name {
  font-size: 1.9px; fill: #3c3a33; font-weight: 600;
  paint-order: stroke; stroke: #fffdf7; stroke-width: 0.9; stroke-linejoin: round;
}
.locality-place.jazero circle { stroke: #4b93c2; }
.locality-place.zabava circle { stroke: #9a5fbd; }
.locality-place.park circle { stroke: #5d9152; }

/* Vodné plochy a zeleň sa nedajú vyberať — nemajú rámik ani kurzor ruky. */
.locality-area { pointer-events: none; }
.locality-area-name { font-size: 1.9px; text-anchor: middle; pointer-events: none; font-style: italic; }
.locality-area-name.voda { fill: #3d7ea6; }
.locality-area-name.zelen { fill: #4a7040; }
/* Podfarbenie inštitúcií ako v mapových aplikáciách. */
.locality-footprint { pointer-events: none; }
.locality-footprint.nemocnica { fill: #f6d9de; }
.locality-footprint.lekaren { fill: #f8dfe2; }
.locality-footprint.obchod { fill: #f4e6c6; }
.locality-place.nemocnica circle { fill: #e05a63; stroke: #b53d47; }
.locality-place.nemocnica .locality-place-icon { fill: #fff; font-weight: 700; font-size: 2.1px; }
.locality-place.lekaren circle { fill: #fff; stroke: #d04b57; }
.locality-place.lekaren .locality-place-icon { fill: #d04b57; font-weight: 700; }

/* Map landmarks must not cover locality names. Keep the point small and let the
   landmark name sit beside it with its own white stroke. */
.locality-place circle {
  r: 1.35;
}
.locality-place .locality-place-icon {
  font-size: 1.35px;
  pointer-events: none;
}
.locality-place.nemocnica .locality-place-icon {
  font-size: 1.45px;
}
.locality-place .locality-place-name {
  font-size: 1.65px;
  paint-order: stroke;
  stroke: #fffdf7;
  stroke-width: 1.25;
  stroke-linejoin: round;
  pointer-events: none;
}


/* Bratislava locality map overlay on real map background. */
.locality-map .locality-basemap-image {
  opacity: .58;
  filter: saturate(.86) contrast(.92) brightness(1.05);
}
.locality-map .locality-basemap-overlay {
  fill: rgba(250, 248, 242, .34);
}
.locality-map .locality-zone path {
  fill: rgba(255, 255, 255, .48);
  stroke: rgba(50, 54, 49, .82);
  stroke-width: .72;
  vector-effect: non-scaling-stroke;
}
.locality-map .locality-zone:hover path {
  fill: rgba(216, 235, 226, .72);
  stroke: #4f8b78;
  stroke-width: 1.05;
}
.locality-map .locality-zone.is-selected path {
  fill: rgba(111, 168, 147, .48);
  stroke: #2f6f5e;
  stroke-width: 1.25;
}
.locality-map .locality-zone text {
  fill: #24332e;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, .86);
  stroke-width: .42px;
  font-weight: 800;
}
.locality-map .locality-zone.is-selected text {
  fill: #123f34;
  stroke: rgba(255, 255, 255, .9);
}
.locality-map[data-map-district="Celá Bratislava"] .locality-zone text {
  font-size: 4.4px;
  stroke: rgba(255, 255, 255, .96);
  stroke-width: .68px;
  font-weight: 900;
}
.locality-map[data-map-district="Celá Bratislava"] .locality-zone.is-selected text {
  stroke-width: .72px;
}
.locality-map-tabs .is-active,
#locality-pick-bratislava.is-active {
  background: #dceee7;
  border-color: #8cb9a9;
  color: #245c4d;
}


/* V?ber lokal?t - horn? p?s m?p a kompaktnej?ie akcie okresov. */
.locality-picker-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, auto) 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line, #ddd6c9);
  border-radius: 12px;
  background: #f8faf7;
}
.locality-picker-toolbar .muted { margin: 2px 0 0; }
.locality-map-tabs-main {
  display: grid;
  gap: 6px;
  margin: 0;
}
.locality-map-tabs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.locality-picker-actions { margin-top: -4px; }
.locality-group-head {
  grid-template-columns: minmax(180px, 1fr) auto !important;
  justify-content: space-between;
}
.locality-group-actions {
  grid-column: auto !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}
.locality-district {
  margin-left: 0 !important;
  min-width: 0;
  max-width: 360px;
}
.locality-district span {
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 900px) {
  .locality-picker-toolbar { grid-template-columns: 1fr; }
  .locality-group-actions { justify-content: flex-start !important; }
}

/* Commission rules editor: keep rule editing readable inside the commission modal. */
#editor .editor-card:has(#commission-split-preview) {
  width: min(1180px, calc(100vw - 44px)) !important;
  max-height: calc(100vh - 36px) !important;
  overflow: hidden !important;
}
#editor .editor-card:has(#commission-split-preview) .field-grid {
  max-height: calc(100vh - 178px);
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0 12px 128px 0;
  align-content: start;
}
#editor .editor-card:has(#commission-split-preview) .commission-rules-editor {
  grid-column: 1 / -1;
  position: static !important;
  z-index: 1;
  max-height: none;
  overflow: visible;
  margin: 10px 0 16px;
  background: #f7fbf8;
}
#editor .editor-card:has(#commission-split-preview) .commission-rules-editor[hidden] {
  display: none !important;
}
#editor .editor-card:has(#commission-split-preview) .commission-rules-editor .commission-rule-actions {
  position: static;
  bottom: auto;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin: .35rem 0 0;
  padding: .8rem 0 0;
  border-top: 1px solid #d9e4dd;
  background: transparent;
}
#editor .editor-card:has(#commission-split-preview) #commission-split-preview {
  grid-column: 1 / -1;
  min-height: 0;
}
#editor .editor-card:has(#commission-split-preview) .commission-split {
  position: relative;
  z-index: 0;
}


/* V províznom kroku je tmavozelený iba maklér, ktorý danú úlohu vykoná. */
#commission-split-preview .commission-step-row .commission-agent-choice {
  background: var(--success-wash) !important;
  border-color: var(--success-line) !important;
  color: var(--success-dark) !important;
  box-shadow: none !important;
}
#commission-split-preview .commission-step-row .commission-agent-choice:hover {
  background: var(--success-soft) !important;
  border-color: var(--brand) !important;
}
#commission-split-preview .commission-step-row .commission-agent-choice.is-selected {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 4px 12px color-mix(in srgb, var(--brand) 22%, transparent) !important;
}
#commission-split-preview .commission-step-row .commission-agent-choice.is-selected:hover {
  background: var(--brand-dark) !important;
}
#commission-split-preview .commission-step-row:has(.commission-agent-choice.is-selected) {
  background: var(--success-wash) !important;
}

/* Kompaktne bocne menu - na konci suboru, aby prebilo skorsie pravidla s !important.
   Ciel: cele menu sa zmesti bez vlastnej posuvnej listy a odkaz na frontoffice
   sedi az dole nad paticku. */
.sidebar { gap: 9px !important; }
.nav-group { margin: 0 0 2px !important; }
.nav-group-items { gap: 2px !important; }
.nav-group-toggle { min-height: 24px !important; padding: 4px 10px !important; font-size: 10.5px !important; }
.nav-item, .logout, .nav-group .nav-item { min-height: 26px !important; padding: 4px 10px 4px 14px !important; font-size: 12px !important; }
.frontoffice-switch { margin-top: auto !important; padding: 7px 10px !important; }
.sidebar-footer { margin-top: 4px !important; padding-top: 8px !important; }

/* ===== Jednotná typografia tabuliek a nastaviteľný vzhľad =====
   Veľkosť písma aj výška riadkov idú z premenných, takže sa dajú meniť
   v Nastaveniach → Vzhľad systému bez zásahu do kódu. */
:root { --table-font: 13px; --table-head-font: 11px; --row-pad-y: 7px; --row-pad-x: 12px; }
body[data-density="compact"] { --row-pad-y: 4px; }
body[data-density="cozy"]    { --row-pad-y: 7px; }
body[data-density="airy"]    { --row-pad-y: 12px; }
body[data-fontsize="s"] { --table-font: 12px; --table-head-font: 10px; }
body[data-fontsize="m"] { --table-font: 13px; --table-head-font: 11px; }
body[data-fontsize="l"] { --table-font: 14.5px; --table-head-font: 12px; }
table th, table td { padding: var(--row-pad-y) var(--row-pad-x) !important; font-size: var(--table-font) !important; line-height: 1.25 !important; }
table th { font-size: var(--table-head-font) !important; }
body[data-zebra="on"] tbody tr:nth-child(even) > td { background: var(--zebra, #f7f9f6); }
.customer-table td, .communication-table td { vertical-align: middle; }

/* Obrazovka Vzhľad systému. */
.appearance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.appearance-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.appearance-swatch { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line) !important; border-radius: 10px; background: #fff !important; color: var(--ink) !important; font-weight: 600; }
.appearance-swatch span { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0,0,0,.12); }
.appearance-swatch.is-active { border-color: var(--brand) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 22%, transparent); }
.appearance-preview-title { margin: 6px 0 8px; font-size: 15px; }

/* Jedna veľkosť písma v celej tabuľke: štítky, pilulky aj tlačidlá v bunkách
   dedia veľkosť z riadku, odlišujú sa len farbou a pozadím. */
table td .status-badge, table td .contact-chip, table td .created-chip, table td .activity-due,
table td .audit-chip, table td .link-like, table td .lead-score, table td a, table td button,
table td small, table td strong, table td span {
  font-size: var(--table-font) !important;
}
table td .status-badge, table td .created-chip, table td .activity-due, table td .contact-chip {
  padding: 2px 8px !important; line-height: 1.3 !important;
}
table td button { padding: 3px 9px !important; }

.compact-settings-table th,
.compact-settings-table td {
  padding-top: 3px !important;
  padding-bottom: 3px !important;
  line-height: 1.12 !important;
  vertical-align: middle !important;
}

.compact-settings-table td {
  height: 28px;
}

.compact-settings-table td strong,
.compact-settings-table td span,
.compact-settings-table td small {
  line-height: 1.12 !important;
}

.compact-settings-table td small {
  display: block;
  margin-top: 1px;
}

.compact-settings-table .editor-actions {
  gap: 6px;
  margin: 0;
  align-items: center;
}

.compact-settings-table td button {
  min-height: 22px !important;
  padding: 2px 8px !important;
  border-radius: 7px;
  line-height: 1.05 !important;
}
table th .table-sort-button, table th span { font-size: var(--table-head-font) !important; }

/* Riadok pod myšou aj pásikovanie berú farbu z nastavenia Vzhľadu. */
body[data-hover="on"] tbody tr:hover > td { background: var(--row-hover, #eef2ec) !important; }
body[data-zebra="on"] tbody tr:nth-child(even) > td { background: var(--zebra, #f7f9f6); }

/* Zvýraznenie stĺpca tlačidlom „B“ v hlavičke. */
td.is-emphasis, th.is-emphasis { font-weight: 800 !important; color: var(--brand-dark) !important; }
.table-emphasis-button { margin-left: 4px; padding: 0 5px !important; border: 0 !important; background: transparent !important; color: var(--muted) !important; font-weight: 800 !important; line-height: 1; opacity: .55; }
.table-emphasis-button:hover { opacity: 1; color: var(--brand-dark) !important; }
.table-emphasis-button.is-active { opacity: 1; color: var(--brand-dark) !important; background: color-mix(in srgb, var(--brand) 14%, transparent) !important; border-radius: 5px; }

/* Jednotný pracovný riadok nad tabuľkou: hľadanie, filtre, ikona stĺpcov
   a hlavná akcia vpravo. Používa sa v zoznamoch naprieč systémom. */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 14px; }
.list-toolbar > label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.list-toolbar > label select, .list-toolbar > label input { min-height: 34px; }
.list-toolbar-search { flex: 1 1 320px; min-width: 220px; }
.list-toolbar > button { min-height: 34px; }
.list-toolbar .icon-action { width: 34px; padding: 0 !important; font-size: 15px; }
.list-toolbar-primary { margin-left: auto; }
.list-toolbar button.is-active { background: var(--brand) !important; color: #fff !important; }


.list-toolbar-title { margin: 0 6px 6px 0; font-size: 20px; white-space: nowrap; align-self: flex-end; }

/* Tlačidlo „B“ sa musí zmestiť vedľa názvu stĺpca — tlačidlo zoradenia preto
   nesmie zaberať celú šírku hlavičky, inak sa „B“ orezalo mimo bunky. */
th .table-sort-button { width: auto !important; max-width: calc(100% - 26px); }
th:has(.table-emphasis-button) { white-space: nowrap; }

/* Priradenie okresov maklérovi: chipy s okresmi a pod nimi výber ďalšieho. */
.ag-territory-cell { min-width: 260px; }
.ag-territory-add-row { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.ag-territory-add-row select { min-height: 30px; font-size: 12px; }
.ag-territory-remove { margin: 0 4px 4px 0; padding: 2px 8px !important; font-size: 12px !important; }

/* Karta oprávnení: sekcie pod sebou, každá s vlastnou tabuľkou práv. */
.permission-groups { display: grid; gap: 14px; max-height: 60vh; overflow-y: auto; }
.permission-group h4 { margin: 0 0 6px; font-size: 14px; }
.permission-override { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #eef3f8; color: #24506f; font-weight: 600; }

/* Matica rolí: prvý stĺpec so zoznamom práv drží šírku, roly sú úzke stĺpce so zaškrtávatkom. */
.role-matrix-title { margin: 18px 0 6px; font-size: 15px; }
.role-matrix th:first-child, .role-matrix td:first-child { width: 32%; text-align: left; }
.role-matrix th { text-align: center; vertical-align: top; }
.role-matrix th button { margin-top: 4px; padding: 2px 8px; font-size: 11px; }
.role-matrix td.role-cell { text-align: center; }
.role-matrix td.role-cell.is-custom { background: #fff6e0; }
.role-matrix input[type="checkbox"] { width: 16px; height: 16px; }
.permission-state .permission-reset { margin-left: 6px; padding: 1px 8px; font-size: 11px; }

/* Prístup a vlastný účet. */
.access-flag { display: inline-block; margin-right: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.access-flag.is-on { background: #e8f3ec; color: #2b6b45; }
.access-flag.is-off { background: #f0f1f2; color: #5d6570; }
.access-flag.is-locked { background: #fdecec; color: #9b2f2f; }
.access-flag.is-warn { background: #fff6e0; color: #8a6100; }
.account-card { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line, #e3e7ea); border-radius: 10px; }
.account-card > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
#account-button { cursor: pointer; }
#account-button:hover strong { text-decoration: underline; }

/* Presuny medzi kartami (heslo, prístup) vnútri karty makléra. */
.editor-inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Pevný rozvrh: až vďaka nemu sa šírka stĺpca zadaná v nastaveniach naozaj použije.
   Text, ktorý sa do stĺpca nezmestí, sa oreže — celý je v bublinke po najdení myšou. */
table.is-fixed-layout { table-layout: fixed; }
table.is-fixed-layout td, table.is-fixed-layout th { overflow: hidden; text-overflow: ellipsis; }
table.is-fixed-layout td.table-actions-cell { overflow: visible; white-space: normal; }

/* Matching weights: keep inline editors compact so controls do not collide. */
#page-content .section:has(#match-weight-add) .table-wrap {
  overflow-x: auto;
}
#page-content .section:has(#match-weight-add) table {
  table-layout: fixed;
  min-width: 1180px;
}
#page-content .section:has(#match-weight-add) th:nth-child(1) { width: 18%; }
#page-content .section:has(#match-weight-add) th:nth-child(2) { width: 90px; }
#page-content .section:has(#match-weight-add) th:nth-child(3) { width: 240px; }
#page-content .section:has(#match-weight-add) th:nth-child(4) { width: 90px; text-align: center; }
#page-content .section:has(#match-weight-add) th:nth-child(5) { width: 270px; }
#page-content .section:has(#match-weight-add) th:nth-child(6) { width: 210px; }
#page-content .section:has(#match-weight-add) td {
  vertical-align: middle;
}
#page-content .section:has(#match-weight-add) td:nth-child(1) {
  white-space: normal;
  overflow-wrap: anywhere;
}
#page-content .section:has(#match-weight-add) td:nth-child(2) input {
  width: 76px;
  min-width: 76px;
}
#page-content .section:has(#match-weight-add) td:nth-child(3) select,
#page-content .section:has(#match-weight-add) td:nth-child(5) input {
  width: 100%;
  min-width: 0;
}
#page-content .section:has(#match-weight-add) td:nth-child(4) {
  text-align: center;
}
#page-content .section:has(#match-weight-add) td:nth-child(6).editor-actions,
#page-content .section:has(#match-weight-add) td:nth-child(6) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 210px;
  overflow: visible;
}
#page-content .section:has(#match-weight-add) td:nth-child(6) button {
  padding: 8px 10px;
  white-space: nowrap;
}

.matching-criteria-settings .table-wrap {
  overflow-x: auto;
}
.matching-criteria-table {
  table-layout: fixed;
  min-width: 1180px;
}
.matching-criteria-table th:nth-child(1) { width: 22%; }
.matching-criteria-table th:nth-child(2) { width: 120px; }
.matching-criteria-table th:nth-child(3) { width: 115px; }
.matching-criteria-table th:nth-child(4) { width: 80px; }
.matching-criteria-table th:nth-child(5) { width: 230px; }
.matching-criteria-table th:nth-child(6) { width: 250px; }
.matching-criteria-table th:nth-child(7) { width: 250px; }
.matching-criteria-table td {
  vertical-align: middle;
}
.matching-criteria-table td:nth-child(1),
.matching-criteria-table td:nth-child(5),
.matching-criteria-table td:nth-child(6) {
  white-space: normal;
  overflow-wrap: anywhere;
}
.matching-criteria-table td:nth-child(7).editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  overflow: visible;
}
.matching-criteria-table td:nth-child(7) button {
  padding: 8px 10px;
  white-space: nowrap;
}

/* Hromadné akcie nad označenými riadkami. */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; padding: 10px 14px; border: 1px solid var(--line, #e3e7ea); border-radius: 8px; background: var(--zebra, #f4f6f5); }
.bulk-bar strong { margin-right: 6px; }
tr.row-dirty { background: #fff6e0; }
tr.row-dirty td:first-child::before { content: '•'; margin-right: 6px; color: #8a6100; font-weight: 700; }

/* Schránka: zoznam vlákien vľavo, otvorené vlákno vpravo. */
.mail-counters .mail-counter { cursor: pointer; text-align: left; border: 1px solid var(--line, #e3e7ea); background: var(--surface, #fff); }
.mail-counters .mail-counter.is-active { border-color: var(--brand, #1d5c44); box-shadow: inset 0 0 0 1px var(--brand, #1d5c44); }
.mail-layout {
  --mail-list-width: 380px;
  display: grid;
  grid-template-columns: minmax(280px, var(--mail-list-width)) 12px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  min-width: 0;
}
.mail-list { display: grid; gap: 6px; max-height: 70vh; overflow-y: auto; min-width: 0; }
.mail-layout-resizer {
  width: 12px;
  min-width: 12px;
  align-self: stretch;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: col-resize;
  position: relative;
  padding: 0;
}
.mail-layout-resizer::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--line, #dfe6e2);
}
.mail-layout-resizer:hover::before,
.mail-layout.is-resizing .mail-layout-resizer::before {
  width: 4px;
  background: var(--brand, #1d5c44);
}
.mail-resizing {
  cursor: col-resize;
  user-select: none;
}
.mail-row { display: grid; gap: 3px; padding: 10px 12px; text-align: left; border: 1px solid var(--line, #e3e7ea); border-radius: 8px; background: var(--surface, #fff); cursor: pointer; }
.mail-row:hover { background: var(--row-hover, #f2f5f4); }
.mail-row.is-open { border-color: var(--brand, #1d5c44); }
.mail-row.is-unread strong { font-weight: 700; }
.mail-row.is-unread::before { content: ''; }
.mail-row-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.mail-row-subject { font-size: 13px; }
.mail-row-preview { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; }
.mail-thread { border: 1px solid var(--line, #e3e7ea); border-radius: 10px; padding: 16px; background: var(--surface, #fff); min-height: 200px; min-width: 0; }
.mail-thread-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line-soft, #eef1f0); padding-bottom: 12px; margin-bottom: 12px; }
.mail-thread-head h3 { margin: 0; font-size: 17px; }
.mail-messages { display: grid; gap: 12px; max-height: 60vh; overflow-y: auto; }
.mail-message { border: 1px solid var(--line-soft, #eef1f0); border-radius: 8px; padding: 12px 14px; }
.mail-message.is-inbound { background: var(--zebra, #f6f8f7); }
.mail-message.is-outbound { border-left: 3px solid var(--brand, #1d5c44); }
.mail-message header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mail-message-to { font-size: 11px; margin: 2px 0 8px; }
.mail-body { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; }
@media (max-width: 900px) {
  .mail-layout { grid-template-columns: minmax(0, 1fr); }
  .mail-layout-resizer { display: none; }
}
.mail-ok { color: #2a6a46; }
.mail-bad { color: #9d2620; }

/* Číslo v karte hovoru — musí sa dať prečítať a odpísať na diaľku. */
.call-number { margin: 4px 0 0; font-size: 22px; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
#editor .editor-card:has(.call-choice) .call-number { margin: 0; font-size: 20px; line-height: 1.15; }

/* ---------- Pošta: zlúčená sekcia ---------- */
.mail-section { display: grid; gap: 12px; margin-top: 0; }

.mail-hero {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 18px;
  padding: 14px 22px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, var(--brand-dark, #14402f) 0%, var(--brand, #1d5c44) 60%, color-mix(in srgb, var(--brand, #1d5c44) 70%, #2f8f6a) 100%);
}
.mail-hero .eyebrow { margin: 0 0 4px; font-size: 11px; letter-spacing: .16em; opacity: .75; }
.mail-hero h2 { margin: 0; font-size: 26px; line-height: 1.1; }
.mail-hero-text p { margin: 6px 0 0; max-width: 58ch; font-size: 13.5px; opacity: .85; }
.mail-hero-stats { display: flex; gap: 10px; }
.mail-hero-stats > div {
  min-width: 88px; padding: 8px 12px; border-radius: 8px;
  background: rgba(255, 255, 255, .12); backdrop-filter: blur(2px);
}
.mail-hero-stats strong { display: block; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mail-hero-stats span { font-size: 11px; opacity: .85; }
.mail-hero-stats .is-late { background: rgba(255, 138, 128, .28); }

.mail-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.mail-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 10px; background: var(--zebra, #f1f4f3); }
.mail-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-soft, #55635c); font-size: 13px; cursor: pointer;
}
.mail-tab:hover { background: rgba(0, 0, 0, .05); }
.mail-tab.is-active { background: var(--surface, #fff); color: var(--brand, #1d5c44); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.mail-tab span { padding: 0 6px; border-radius: 999px; background: var(--brand, #1d5c44); color: #fff; font-size: 11px; }
.mail-toolbar-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mail-toolbar-right input[type="search"] { min-width: 220px; }

.mail-list { display: grid; gap: 8px; max-height: 68vh; overflow-y: auto; padding-right: 4px; }
.mail-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 12px 14px; border: 1px solid var(--line, #e3e7ea); border-left: 3px solid transparent;
  border-radius: 12px; background: var(--surface, #fff); cursor: pointer; transition: border-color .12s, transform .12s;
}
.mail-row:hover { border-left-color: var(--brand, #1d5c44); transform: translateX(2px); }
.mail-row.is-open { border-color: var(--brand, #1d5c44); border-left-color: var(--brand, #1d5c44); }
.mail-row.is-unread { background: color-mix(in srgb, var(--brand, #1d5c44) 5%, var(--surface, #fff)); }
.mail-row.is-unread .mail-row-head strong { font-weight: 700; }
.mail-row.is-done { opacity: .6; }
.mail-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand, #1d5c44) 12%, transparent); color: var(--brand-dark, #14402f);
  font-size: 13px; font-weight: 700;
}
.mail-row-main { min-width: 0; display: grid; gap: 2px; }
.mail-row-head { display: flex; justify-content: space-between; gap: 10px; }
.mail-row-head strong { font-size: 14px; }
.mail-when { font-size: 12px; color: var(--ink-faint, #7d8a84); white-space: nowrap; }
.mail-row-subject { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-preview { font-size: 12px; color: var(--ink-faint, #7d8a84); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.mail-row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.mail-row:hover .mail-row-actions, .mail-row.is-open .mail-row-actions { opacity: 1; }
.mail-row-actions button { padding: 4px 9px; font-size: 13px; line-height: 1.2; }

.mail-chip { padding: 1px 8px; border-radius: 999px; background: var(--zebra, #f1f4f3); color: var(--ink-soft, #55635c); font-size: 11px; }
.mail-chip.is-note { background: #eef1fb; color: #3a4a86; }
.mail-chip.is-done { background: #e3efe8; color: #2a6a46; }
.mail-chip.is-late { background: #f9e3e1; color: #9d2620; }
.mail-chip.is-today { background: #fbf0d8; color: #8a5c06; }
.mail-chip.is-planned { background: #eaf0ee; color: #4a5b54; }

.mail-empty { display: grid; place-items: center; gap: 8px; padding: 48px 16px; color: var(--ink-faint, #7d8a84); text-align: center; }
.mail-empty span { font-size: 34px; opacity: .35; }
.mail-thread { border-radius: 12px; }

#editor .editor-card:has(.mail-composer) {
  width: min(1120px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
#editor .editor-card:has(.mail-composer) #editor-fields {
  display: block;
  overflow: auto;
  padding-right: 2px;
}
.mail-composer {
  display: grid;
  gap: 14px;
}
.mail-composer-panel {
  padding: 14px;
  border: 1px solid var(--line, #dfe6e2);
  border-radius: 10px;
  background: var(--zebra, #f5f7f6);
}
.mail-composer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.mail-composer-body {
  display: grid;
  gap: 8px;
}
.mail-composer-body textarea {
  /* Pole rástlo na pevných 340 px a spolu s hlavičkou vytlačilo diktovanie aj
     poznámku pod spodnú hranu okna. Teraz sa prispôsobí výške obrazovky. */
  min-height: clamp(180px, 34vh, 340px);
  resize: vertical;
  line-height: 1.55;
  padding: 14px;
  border: 1px solid var(--line, #dfe6e2);
  border-radius: 10px;
  background: #fff;
}
.mail-composer-note {
  padding: 10px 12px;
  border: 1px solid var(--line, #dfe6e2);
  border-radius: 8px;
  background: #fafbf9;
}
@media (max-width: 760px) {
  .mail-composer-grid { grid-template-columns: 1fr; }
  .mail-composer-body textarea { min-height: 260px; }
}

/* Prílohy v správe a diktovanie. */
.mail-attachments { display: grid; gap: 6px; margin-top: 10px; }
.mail-attachment {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--line, #e3e7ea); border-radius: 8px; background: var(--surface, #fff);
}
.mail-attachment-icon { font-size: 15px; }
.mail-attachment-name { flex: 1 1 200px; display: grid; font-size: 13px; }
.mail-attachment-name small { font-size: 11px; }
.mail-attachment button { padding: 3px 10px; font-size: 12px; }
.mail-composer-tools { display: flex; align-items: center; gap: 10px; margin-top: 8px; }

/* Diktovanie — rovnaký pruh nad každým poľom, ktoré sa dá nadiktovať:
   pošta, záznam stretnutia, poznámka aj záznam z obhliadky. Je nad poľom preto,
   aby ho nezatlačil dlhý text pod spodnú hranu okna. */
.dictation-bar { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; }
/* V spodnej lište editora stojí diktovanie vľavo, ďaleko od Uložiť/Odoslať. */
.dictation-bar--footer { margin: 0 auto 0 0; }

/* Dlhý formulár (nové stretnutie, obhliadka) predtým pretiekol cez spodok
   obrazovky aj s tlačidlami. Teraz sa roluje iba vnútro — nadpis a spodná lišta
   s Uložiť, Zrušiť a diktovaním zostávajú na očiach. */
#editor .editor-card { max-height: 92vh; display: flex; flex-direction: column; }
#editor .editor-card > #editor-fields { overflow-y: auto; min-height: 0; padding-right: 4px; }
#editor .editor-card > .editor-heading,
#editor .editor-card > .editor-error,
#editor .editor-card > .editor-actions { flex: none; }

.dictation-button { white-space: nowrap; padding: 6px 12px; font-size: 13px; }
.dictation-button.is-recording { background: #9d2620; border-color: #9d2620; color: #fff; }
.dictation-status { font-size: 13px; }

/* Prílohy celého vlákna nad konverzáciou — bývajú na poslednej správe. */
.mail-thread-attachments {
  display: grid; gap: 6px; margin-bottom: 12px; padding: 10px 12px;
  border: 1px solid var(--line, #e3e7ea); border-radius: 10px;
  background: color-mix(in srgb, var(--brand, #1d5c44) 5%, var(--surface, #fff));
}
.mail-attachments-title { margin: 0 0 2px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint, #7d8a84); }

/* Lead, pri ktorom systém stranu obchodu iba odhadol. */
.lead-guess { padding: 1px 7px; border-radius: 999px; background: #fbf0d8; color: #8a5c06; font-weight: 600; }
.lead-classify-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.lead-classify-choice button { display: grid; gap: 2px; padding: 12px 14px; text-align: left; height: auto; }
.lead-classify-choice strong { font-size: 14px; }
.lead-classify-choice span { font-size: 11.5px; opacity: .75; }
.lead-classify-message {
  max-height: 180px; overflow-y: auto; padding: 10px 12px; white-space: pre-wrap;
  border: 1px solid var(--line, #e3e7ea); border-radius: 8px; background: var(--zebra, #f5f7f6); font-size: 12.5px;
}

/* Neznámy odosielateľ — výzva na zaradenie priamo v pošte. */
.mail-unknown {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 12px; padding: 12px 14px; border: 1px solid #f0d9a8; border-radius: 10px; background: #fdf6e6;
}
.mail-unknown strong { color: #8a5c06; }
.mail-unknown p { margin: 2px 0 0; max-width: 62ch; font-size: 12.5px; }

/* Text správy priamo v karte — aby sa údaje dali overiť bez zatvárania okna. */
.mail-source-text summary { cursor: pointer; font-size: 12px; color: var(--ink-soft, #55635c); padding: 4px 0; }
.mail-source-text[open] summary { margin-bottom: 6px; }

/* Locality picker polish: compact district switcher and readable map markers. */
.locality-picker-toolbar {
  align-items: start;
  gap: 12px;
}
.locality-map-tabs-main {
  display: grid;
  gap: 8px;
}
.locality-map-tabs-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}
.locality-map-tabs-row .secondary {
  margin: 0 4px 6px 0;
  white-space: nowrap;
}
.locality-map-tabs-label {
  padding-top: 7px;
}
.locality-place .locality-place-icon {
  pointer-events: none;
}
.locality-place .locality-place-name {
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 1.25px;
  stroke-linejoin: round;
  dominant-baseline: middle;
}

/* FINAL locality picker override - keep buttons compact and landmark labels off icons. */
.locality-picker-toolbar {
  display: grid !important;
  grid-template-columns: 260px minmax(0, 1fr) !important;
  gap: 14px !important;
  align-items: start !important;
  padding: 12px 14px !important;
}
.locality-map-tabs-main {
  display: grid !important;
  gap: 8px !important;
  margin: 0 !important;
}
.locality-map-tabs-row {
  display: grid !important;
  grid-template-columns: 92px minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: start !important;
}
.locality-map-tabs-row button.secondary {
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 5px 6px 0 !important;
  padding: 6px 11px !important;
  white-space: nowrap !important;
}
.locality-map-tabs-label {
  padding-top: 7px !important;
}
.locality-place .locality-place-icon {
  font-size: 1.25px !important;
  text-anchor: middle !important;
  pointer-events: none !important;
}
.locality-place.nemocnica .locality-place-icon {
  font-size: 1.35px !important;
}
.locality-place .locality-place-name {
  font-size: 1.55px !important;
  text-anchor: middle !important;
  dominant-baseline: hanging !important;
  paint-order: stroke !important;
  stroke: #fff !important;
  stroke-width: 1.3px !important;
  stroke-linejoin: round !important;
  fill: #2f332f !important;
  pointer-events: none !important;
}
@media (max-width: 900px) {
  .locality-picker-toolbar { grid-template-columns: 1fr !important; }
  .locality-map-tabs-row { grid-template-columns: 1fr !important; }
}

/* Compact customer edit dialog: show the whole profile without internal scrolling on desktop. */
#editor .editor-card:has(#edit-customer-requirement) {
  width: min(1280px, calc(100vw - 80px)) !important;
  max-height: calc(100vh - 96px) !important;
  padding: 18px 24px 16px !important;
  overflow: visible !important;
}
#editor .editor-card:has(#edit-customer-requirement) .editor-heading {
  margin-bottom: 12px !important;
}
#editor .editor-card:has(#edit-customer-requirement) #editor-title {
  font-size: 22px !important;
}
#editor .editor-card:has(#edit-customer-requirement) #editor-fields {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 9px 14px !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 0 !important;
  align-content: start !important;
}
#editor .editor-card:has(#edit-customer-requirement) #editor-fields label {
  gap: 3px !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
}
#editor .editor-card:has(#edit-customer-requirement) #editor-fields input,
#editor .editor-card:has(#edit-customer-requirement) #editor-fields select {
  min-height: 34px !important;
  height: 34px !important;
  padding: 6px 10px !important;
  border-radius: 7px !important;
  font-size: 13px !important;
}
#editor .editor-card:has(#edit-customer-requirement) .form-action-strip {
  grid-column: 1 / -1 !important;
  display: flex !important;
  justify-content: flex-start !important;
  margin: 0 0 4px !important;
}
#editor .editor-card:has(#edit-customer-requirement) .form-action-strip button {
  min-height: 32px !important;
  padding: 6px 14px !important;
  font-size: 13px !important;
}
#editor .editor-card:has(#edit-customer-requirement) .editor-actions {
  margin-top: 12px !important;
}
#editor .editor-card:has(#edit-customer-requirement) .editor-actions button {
  min-height: 34px !important;
  padding: 7px 15px !important;
}

@media (max-width: 1180px) {
  #editor .editor-card:has(#edit-customer-requirement) #editor-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 820px) {
  #editor .editor-card:has(#edit-customer-requirement) {
    width: min(96vw, 720px) !important;
    max-height: 92vh !important;
    overflow: auto !important;
  }
  #editor .editor-card:has(#edit-customer-requirement) #editor-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 560px) {
  #editor .editor-card:has(#edit-customer-requirement) #editor-fields {
    grid-template-columns: 1fr !important;
  }
}

/* Compact client requirement dialog opened from customer editor. */
#editor .editor-card:has(#client-requirement-editor-marker) {
  width: min(1320px, calc(100vw - 72px)) !important;
  max-height: calc(100vh - 90px) !important;
  padding: 18px 24px 16px !important;
  overflow: visible !important;
}
#editor .editor-card:has(#client-requirement-editor-marker) .editor-heading {
  margin-bottom: 12px !important;
}
#editor .editor-card:has(#client-requirement-editor-marker) #editor-title {
  font-size: 22px !important;
}
#editor .editor-card:has(#client-requirement-editor-marker) #editor-fields {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px 14px !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 0 !important;
  align-content: start !important;
}
#editor .editor-card:has(#client-requirement-editor-marker) #editor-fields label {
  gap: 3px !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
}
#editor .editor-card:has(#client-requirement-editor-marker) #editor-fields input,
#editor .editor-card:has(#client-requirement-editor-marker) #editor-fields select {
  min-height: 34px !important;
  height: 34px !important;
  padding: 6px 10px !important;
  border-radius: 7px !important;
  font-size: 13px !important;
}
#editor .editor-card:has(#client-requirement-editor-marker) #editor-fields textarea {
  min-height: 70px !important;
  max-height: 84px !important;
  padding: 8px 10px !important;
  border-radius: 7px !important;
  font-size: 13px !important;
  resize: vertical !important;
}
#editor .editor-card:has(#client-requirement-editor-marker) .editor-actions {
  margin-top: 12px !important;
}
#editor .editor-card:has(#client-requirement-editor-marker) .editor-actions button {
  min-height: 34px !important;
  padding: 7px 15px !important;
}

@media (max-width: 1180px) {
  #editor .editor-card:has(#client-requirement-editor-marker) #editor-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 820px) {
  #editor .editor-card:has(#client-requirement-editor-marker) {
    width: min(96vw, 760px) !important;
    max-height: 92vh !important;
    overflow: auto !important;
  }
  #editor .editor-card:has(#client-requirement-editor-marker) #editor-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 560px) {
  #editor .editor-card:has(#client-requirement-editor-marker) #editor-fields {
    grid-template-columns: 1fr !important;
  }
}

/* Final locality picker map layout: compact controls and visible default map. */
#editor.locality-editor .editor-card {
  width: min(1240px, 96vw) !important;
  max-height: min(88vh, 900px) !important;
}

#editor.locality-editor .editor-heading {
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 0 !important;
}

#editor.locality-editor #editor-title {
  margin-right: auto !important;
}

.locality-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.locality-header-actions button {
  min-height: 34px;
  padding: 7px 15px;
}

#editor.locality-editor .editor-actions[hidden] {
  display: none !important;
}

#editor.locality-editor #editor-fields {
  padding-right: 0 !important;
}

#editor.locality-editor .locality-picker {
  gap: 10px !important;
}

.locality-map-layout {
  display: grid !important;
  grid-template-columns: 190px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
  min-height: 0 !important;
}

#editor.locality-editor #locality-picker-map {
  min-height: 0 !important;
  overflow: hidden !important;
}

#editor.locality-editor #locality-picker-map .locality-map {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: min(70vh, 720px) !important;
}

#editor.locality-editor #locality-picker-groups {
  display: none !important;
}

#editor.locality-editor .locality-legend {
  display: none !important;
}

.locality-picker-toolbar {
  display: block !important;
  align-items: start !important;
  gap: 0 !important;
  align-self: stretch !important;
  padding: 12px !important;
  border: 1px solid var(--line, #ddd6c9) !important;
  border-radius: 8px !important;
  background: #fbfcfa !important;
}

.locality-map-tabs-main {
  display: grid !important;
  gap: 14px !important;
}

.locality-map-tabs-row {
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: start !important;
  gap: 7px !important;
}

.locality-map-button-grid {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 7px;
}

.locality-map-button-grid button.secondary {
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
  justify-content: flex-start;
  text-align: left;
}

.locality-all-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line, #ddd6c9);
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand, #6f9c63) 10%, #fff);
  color: var(--text, #1d261f);
  font-weight: 800;
  line-height: 1.15;
  cursor: pointer;
}

.locality-all-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand, #6f9c63);
  flex: 0 0 auto;
}

.locality-all-toggle:has(input:checked) {
  background: var(--brand, #6f9c63);
  border-color: var(--brand-dark, #4c7043);
  color: #fff;
}

#editor.locality-editor .locality-map .locality-zone text {
  font-size: 1em !important;
  fill: #17251f;
  stroke-width: .68px;
  font-weight: 900;
}

#editor.locality-editor .locality-map .locality-zone.is-selected text {
  fill: #0f332b;
}

.locality-place-icon {
  font-size: 2.1px !important;
  dominant-baseline: central;
  text-anchor: middle;
  pointer-events: none;
}

.locality-place-name {
  paint-order: stroke;
  stroke: #fff;
  stroke-width: .95px;
  stroke-linejoin: round;
  font-size: var(--place-label-size, 1.95px) !important;
  font-weight: 700;
  pointer-events: none;
}

@media (max-width: 1000px) {
  .locality-map-layout {
    grid-template-columns: 1fr !important;
  }

  .locality-map-button-grid {
    grid-template-columns: repeat(3, minmax(104px, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .locality-map-tabs-row {
    grid-template-columns: 1fr !important;
  }

  .locality-map-button-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Nahrávanie telefonátu -----------------------------------------------------
   Pruh počas nahrávania je zámerne nápadný a nedá sa odkliknúť: kým sa nahráva,
   musí to byť vidieť. Skryté nahrávanie by bolo voči klientovi neslušné. */
.call-recording-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-radius: 999px; color: #fff; background: #9d2620;
  box-shadow: 0 14px 34px #0b213b66;
}
.call-recording-bar .muted { color: #ffffffc4; }
.call-recording-bar button { background: #ffffff26; }
.call-recording-bar button:hover { background: #ffffff40; }
.call-recording-dot { width: 11px; height: 11px; border-radius: 50%; background: #fff; animation: call-pulse 1.2s infinite; }
.call-recording-dot.is-working { animation-duration: 2.4s; }
@keyframes call-pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* Súhlas klienta — veta na prečítanie je hlavný obsah okna, nie drobné písmo. */
.call-consent { display: grid; gap: 10px; }
.call-consent-lead { margin: 0; }
.call-consent-sentence {
  margin: 0; padding: 14px 16px; border-left: 4px solid var(--brand, #1f6f5c);
  border-radius: 0 8px 8px 0; background: var(--zebra, #f5f7f6);
  font-size: 17px; font-weight: 650;
}
.call-consent-check { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.call-consent-check input { width: auto; }

/* Revízia hovoru. Poradie zhora nadol: podklady (prepis, doplnenie), krátke
   povinné údaje, a až naspodku dlhý zápis cez celú šírku. Polia rastú podľa
   obsahu, takže krátky hovor nezaberá pol obrazovky prázdnotou. */
.call-review { display: grid; gap: 12px; }
.call-review-send { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.call-review-send input { width: auto; }
#editor .editor-card:has(.call-review) { width: min(1180px, 96vw); }
#editor .editor-card:has(.call-consent) { width: min(680px, 96vw); }

/* Revízia hovoru — hlavičky stĺpcov s akciou vpravo. */
.call-review-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.call-review-head h3 { margin: 0; font-size: 14px; }
.call-review-head button { padding: 5px 10px; font-size: 12px; }
.call-review-head-buttons { display: flex; gap: 6px; }
.call-review-block { display: grid; gap: 6px; }
.call-review-block textarea {
  width: 100%; padding: 12px; line-height: 1.5; overflow-y: auto; resize: vertical;
  border: 1px solid var(--line, #dfe6e2); border-radius: 8px; background: #fff;
}
/* Zápis je posledný a cez celú šírku — je najdlhší a nesmie vytlačiť klienta,
   dátum ani tlačidlá mimo obrazovky, ako to robil vedľa prepisu. */
.call-review-record { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line, #dfe6e2); }
/* Samostatné pole na doplnenie — diktovaný text musí byť vidieť hneď. */
.call-review-addition { padding: 12px; border: 1px dashed var(--line, #dfe6e2); border-radius: 8px; background: var(--zebra, #f5f7f6); }
.call-review-audio { margin: 0; }
.link-button { padding: 0; background: none; color: var(--brand-dark, #1f6f5c); text-decoration: underline; font-weight: 650; }
.link-button:hover { background: none; color: var(--danger, #9d2620); }
/* Pauza: pruh stmavne, aby bolo na prvý pohľad jasné, že sa práve nenahráva. */
.call-recording-bar.is-paused { background: #4a5b66; }
.call-recording-bar.is-paused .call-recording-dot { animation: none; opacity: .5; }
/* Nespracované hovory: jeden riadok nad tabuľkou, nie druhá tabuľka.
   Tabuľka Telefonovanie je od zápisov hovorov a má tak aj vyzerať. */
.call-pending {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 10px 0; padding: 10px 14px;
  border: 1px solid #e0c48a; border-radius: 10px; background: #fdf7ea;
}
.call-pending-dot { width: 9px; height: 9px; border-radius: 50%; background: #c8892b; }
.call-pending .muted { flex: 1 1 240px; font-size: 13px; }
.call-pending button { padding: 6px 12px; font-size: 13px; }

/* Značka pri klientovi: k zápisu patrí nahratý hovor s prepisom. */
.call-badge {
  margin-left: 6px; padding: 0 4px; border-radius: 5px;
  background: #e8f1ee; color: inherit; font-size: 12px; line-height: 1.6;
}
.call-badge:hover { background: var(--brand, #1f6f5c); }

/* Komunikačný editor (telefonát, stretnutie, poznámka) potrebuje šírku: má dva
   stĺpce polí a pod nimi dlhý záznam. V úzkom okne sa všetko zlepilo. */
/* Poznámka a telefonát: stredná šírka. Stretnutie má vlastnú, širšiu — nesie
   kalendár, preto ho tu vynímame, nech ho toto pravidlo neprebije. */
#editor .editor-card:has(#editor-fields textarea[name="description"]):not(:has(#editor-fields [name="meetingDurationMinutes"])) { width: min(940px, 96vw); }

/* Hodnotenie a skóre: skupiny podľa toho, čo sa hodnotí. */
.score-group { margin-top: 22px; }
.score-group h3 { margin: 0 0 4px; }
.score-group .section-description { margin: 0 0 10px; }
.score-points { font-weight: 700; white-space: nowrap; }
.score-points.is-negative { color: var(--danger, #9d2620); }

/* Štítky SLA v tabuľke s pevnou šírkou stĺpcov. Chip má nowrap, takže dlhší
   text („po termíne o 3 d 5 h“) prečnieval a `overflow: hidden` mu odrezal
   koniec. V bunke sa preto smie zalomiť — riadok narastie, text zostane celý. */
table.is-fixed-layout td:has(.sla-pill),
table.is-fixed-layout td:has(.mail-chip) { white-space: normal; }
table.is-fixed-layout td .sla-pill,
table.is-fixed-layout td .mail-chip { white-space: normal; }

/* Prvá sekcia stránky nemá dôvod odsadzovať sa od horného okraja. */
.section.section-flush { margin-top: 0; }

/* Okresy makléra priamo v jeho karte. */
.agent-territories { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line, #dfe6e2); }
.agent-territories h3 { margin: 0 0 2px; font-size: 14px; }
.agent-territories .muted { margin: 0 0 8px; }
.agent-territory-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.agent-territory {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 6px 3px 10px; border-radius: 999px;
  background: var(--zebra, #f5f7f6); border: 1px solid var(--line, #dfe6e2); font-weight: 650;
}
.agent-territory .link-button { text-decoration: none; font-size: 15px; line-height: 1; }
.agent-territory-add { display: flex; align-items: flex-end; gap: 8px; }
.agent-territory-add label { flex: 1 1 auto; }

/* Login musí fungovať aj so starším HTML pomenovaním tried. Prihlasovacia stránka
   používa login-hero/login-hero-copy, novší štýl mal login-story/login-copy. */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(420px, .85fr);
  place-items: stretch;
  padding: 0;
  background: #fff;
}
.login-hero,
.login-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: 48px clamp(48px, 7vw, 110px);
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: #f4f2ec;
  background: linear-gradient(145deg, #0c1714 0%, #182823 62%, #233830 100%);
}
.login-hero::before,
.login-story::before {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  right: -230px;
  top: 10%;
  border: 1px solid #b69a6840;
  border-radius: 50%;
  box-shadow: 0 0 0 95px #b69a6812, 0 0 0 190px #b69a680b;
}
.login-hero::after,
.login-story::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  opacity: .18;
  background: linear-gradient(155deg, transparent 30%, #b69a68 31%, transparent 31.5%), linear-gradient(25deg, transparent 48%, #fff 48.5%, transparent 49%);
}
.login-hero-copy,
.login-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
}
.login-hero-copy h1,
.login-copy h1 {
  margin: 18px 0 24px;
  color: #fff;
  font-size: clamp(42px, 5.3vw, 76px);
  line-height: 1.04;
  letter-spacing: 0;
}
.login-hero-copy h1 em,
.login-copy h1 em {
  color: #c8ad7d;
  font-style: normal;
}
.login-hero-copy > p:last-child,
.login-copy > p:last-child {
  max-width: 520px;
  color: #d8e0dd;
  font-size: 17px;
  line-height: 1.7;
}
.login-panel {
  display: grid;
  min-height: 100vh;
  align-items: center;
  padding: 48px clamp(32px, 6vw, 96px);
  background: #fff;
}
.login-card {
  align-self: center;
  width: min(100%, 470px);
  justify-self: center;
  padding: 0;
  display: grid;
  gap: 18px;
  border: 0;
  box-shadow: none;
}
.login-card form {
  display: grid;
  gap: 15px;
}
.login-grid,
.connection-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f8f6;
}
.login-proof {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 28px;
  color: #d5dbd8;
  font-size: 13px;
}
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero,
  .login-story { min-height: auto; padding: 28px; }
  .login-panel { min-height: auto; padding: 32px 22px; }
  .login-grid,
  .connection-fields { grid-template-columns: 1fr; }
}

/* Prepnutie používateľa vedľa odhlásenia: rovnaký tvar, tlmenejšia farba —
   odhlásenie je koniec práce, prepnutie len výmena človeka pri klávesnici. */
.sidebar-footer #switch-user { color: #cde0e8; }
.sidebar-footer #switch-user:hover { color: #fff; background: #24516a; }

/* Poistka pre všetky mriežkové panely: položka mriežky má predvolene
   min-width:auto, teda smie narásť na šírku obsahu a pretiahnuť stránku.
   Lišta nastavenia stĺpcov si skroluje sama, nesmie tlačiť do rozloženia. */
.contracts-documents-pane > *,
.contracts-documents-shell > *,
.merged-panel > * { min-width: 0; }
[data-column-settings-key] { min-width: 0; max-width: 100%; overflow: hidden; }

/* Typy dokumentov: krok v procese a rozlíšenie zmluva/dokument. */
.doctype-step-column { width: 62px; text-align: center; color: var(--muted, #6b7d75); font-weight: 700; }
.doctype-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #eef2f0; font-size: 12px; font-weight: 650; }
.doctype-badge.is-contract { background: #e2efe9; color: #1f6f5c; }

/* Jedna spoločná poistka proti roztiahnutej stránke.
   Mriežka bez určenej šírky stĺpca použije `auto`, čo znamená „nech je taký
   široký ako obsah“ — a široká tabuľka tak roztiahne celú stránku. Sekcie
   s tabuľkami preto majú stĺpec pevne obmedzený a ich obsah sa smie zmenšiť.
   Rolovať má tabuľka vo svojom rámčeku, nie celá stránka. */
.mail-section,
.contracts-documents-shell {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}
.mail-section > *,
.contracts-documents-shell > * { min-width: 0; }

/* Časová os krokov — vodorovná dráha ako v bežných pipeline nástrojoch.
   Predtým to bol dlhý stĺpec kartičiek, v ktorom nebolo vidieť postup. */
.deal-track-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.deal-track-head h3 { margin: 0; }
.deal-track { position: relative; overflow-x: auto; padding: 6px 2px 10px; }
.deal-track-list {
  position: relative; display: flex; gap: 0; margin: 0; padding: 0; list-style: none; min-width: max-content;
}
/* Podkladová čiara a jej vyplnená časť ukazujú, kam obchod dobehol. */
.deal-track-list::before,
.deal-track-list::after {
  content: ''; position: absolute; top: 15px; left: 0; height: 3px; border-radius: 2px;
}
.deal-track-list::before { right: 0; background: var(--line, #dfe6e2); }
.deal-track-list::after { width: var(--deal-track-progress, 0%); background: var(--brand, #1f6f5c); transition: width .3s ease; }
.deal-track-step {
  position: relative; z-index: 1; display: grid; justify-items: center; gap: 3px;
  min-width: 118px; padding: 0 6px; text-align: center;
}
.deal-track-dot {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--line, #dfe6e2); background: #fff;
  font-size: 13px; font-weight: 750; line-height: 1;
}
.deal-track-name { font-size: 12px; font-weight: 700; line-height: 1.25; }
.deal-track-state { font-size: 11px; color: var(--muted, #6b7d75); }
.deal-track-when { font-size: 11px; color: var(--muted, #6b7d75); }

.deal-track-step--done .deal-track-dot { border-color: var(--brand, #1f6f5c); background: var(--brand, #1f6f5c); color: #fff; }
.deal-track-step--active .deal-track-dot { border-color: var(--brand, #1f6f5c); color: var(--brand-dark, #14402f); box-shadow: 0 0 0 4px rgba(31,111,92,.15); }
.deal-track-step--missing .deal-track-dot { border-color: #9d2620; background: #9d2620; color: #fff; }
.deal-track-step--missing .deal-track-state { color: #9d2620; font-weight: 750; }
.deal-track-step--blocked .deal-track-dot { border-color: #b45309; color: #b45309; }
.deal-track-step--muted .deal-track-dot { border-style: dashed; color: var(--muted, #6b7d75); }
.deal-track-step--muted .deal-track-name { color: var(--muted, #6b7d75); font-weight: 600; }

/* Krok, ktorý zaostal a je zmluvný — v prehľade krokov musí biť do očí. */
.active-deal-step--missing { border-color: #9d2620; background: #fdf2f1; }
.active-deal-step--missing small { color: #9d2620; font-weight: 750; }

/* Sprievodca krokmi v samostatnom okne. */
#editor .editor-card:has(.step-guide) { width: min(860px, 96vw); }
.step-guide-list { display: grid; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.step-guide-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 10px 12px; border: 1px solid var(--line, #dfe6e2); border-radius: 10px; }
.step-guide-item.is-required { border-color: #cbb27a; background: #fdfaf2; }
.step-guide-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--zebra, #f5f7f6); font-weight: 750; }
.step-guide-item.is-required .step-guide-number { background: #efe0bd; }
.step-guide-item p { margin: 2px 0 0; color: var(--muted, #6b7d75); font-size: 13px; }

/* Dráha po ôsmich krokoch v riadku; šípka vedie na pokračovanie nižšie. */
.deal-track { display: grid; gap: 18px; overflow-x: auto; padding: 6px 2px 10px; }
.deal-track-row { position: relative; display: flex; align-items: flex-start; gap: 6px; }
.deal-track-row .deal-track-list { flex: 1 1 auto; }
.deal-track-wrap {
  align-self: flex-start; margin-top: 4px; padding: 4px 6px;
  color: var(--brand-dark, #14402f); font-size: 20px; line-height: 1; font-weight: 700;
}
.deal-track-step { min-width: 0; flex: 1 1 0; }

/* Zavretie kroku. Odlíšené od „Úloha/Aktivita“ — tie krok neuzavrú, len k nemu
   niečo pripíšu. Kroky, ktoré zavrie doklad, tlačidlo nemajú. */
.active-step-done { padding: 4px 9px; font-size: 12px; background: var(--brand, #1f6f5c); color: #fff; }
.active-step-done:hover { background: var(--brand-dark, #14402f); }
.active-step-actions { display: flex; flex-wrap: wrap; gap: 5px; }

/* Doklady pri kroku: konkrétny záznam s odkazom, alebo cesta, kde ho doplniť. */
.deal-step-evidence-card header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.step-state { margin-left: auto; font-size: 12px; font-weight: 650; color: var(--muted, #6b7d75); }
.step-state--done { color: var(--brand-dark, #14402f); }
.step-state--muted { color: #8a968f; }
.step-state--missing { color: #9d2620; }
.step-records { display: grid; gap: 6px; margin-top: 8px; }
.step-record {
  display: grid; gap: 2px; width: 100%; padding: 8px 10px; text-align: left;
  border: 1px solid var(--line, #dfe6e2); border-radius: 8px; background: #fff; color: inherit;
}
.step-record:hover { background: var(--zebra, #f5f7f6); }
.step-record strong { font-size: 13px; }
.step-record span { color: var(--muted, #6b7d75); font-size: 12px; }
.step-record-add {
  margin-top: 8px; padding: 6px 11px; font-size: 12px;
  background: #eef3f1; color: var(--brand-dark, #14402f); border: 1px dashed var(--brand, #1f6f5c);
}
.step-record-add:hover { background: var(--brand, #1f6f5c); color: #fff; }

/* Rýchle akcie v riadku zoznamu — ponuka nad tabuľkou, nie v nej,
   aby ju neorezal rámček s vlastným rolovaním. */
.quick-action-menu {
  position: absolute; z-index: 80; min-width: 190px; padding: 6px;
  display: grid; gap: 2px;
  border: 1px solid var(--line, #dfe6e2); border-radius: 10px; background: #fff;
  box-shadow: 0 14px 34px rgba(11, 33, 59, .18);
}
.quick-action-menu button {
  width: 100%; padding: 8px 10px; text-align: left;
  background: transparent; color: var(--ink, #17211e); font-size: 13px; font-weight: 650;
}
.quick-action-menu button:hover { background: var(--zebra, #f5f7f6); }
.quick-action-open { white-space: nowrap; padding: 5px 10px; font-size: 12px; }
.active-step-fill { padding: 4px 9px; font-size: 12px; background: #eef3f1; color: var(--brand-dark, #14402f); border: 1px dashed var(--brand, #1f6f5c); }
.active-step-fill:hover { background: var(--brand, #1f6f5c); color: #fff; }

/* Odsúhlasenie provízie: podpis vľavo, tlačidlo pred Zrušiť. */
.commission-signoff-note { margin-right: auto; color: var(--brand-dark, #14402f); font-size: 13px; font-weight: 650; }
.commission-signoff { white-space: nowrap; }
/* Splnený krok: stav, nie tlačidlo — nedá sa naň klikať. */
.active-step-status { display: inline-block; padding: 4px 9px; border-radius: 6px; background: #e2efe9; color: var(--brand-dark, #14402f); font-size: 12px; font-weight: 750; }

/* Okná obhliadky a stretnutia: širšie a s tesnejšími riadkami nad výberom
   termínu. Kalendár v nich potrebuje šírku, formulár nad ním nie — preto sa
   polia nad termínom zbalia do kompaktnej mriežky. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) { width: min(1180px, 96vw); }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields { gap: 8px 14px; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label { gap: 3px; font-size: 13px; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label > input,
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label > select { padding: 7px 9px; }
/* Voľba dĺžky: štyri tlačidlá v jednom tesnom rade. */
.meeting-duration-field [data-meeting-duration] { padding: 6px 10px; font-size: 13px; }

/* Kompaktné rozloženie okien Nové stretnutie / Nová obhliadka.
   Šesťstĺpcová mriežka dovolí uložiť tri polia do jedného riadku: klient,
   úprava jeho údajov a maklér hore; dĺžka a termín spolu nižšie. Predtým každé
   pole zaberalo pol okna a formulár sa naťahoval na štyri obrazovky. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) .editor-heading { margin-bottom: 10px; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
}
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label { grid-column: span 2; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label.full,
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > .full { grid-column: 1 / -1; }
/* Tlačidlo „Upraviť údaje klienta“ patrí do prvého riadku, nie na vlastný. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > .customer-inline-edit { grid-column: span 2; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > .customer-inline-edit:has(#customer-inline-fields:not([hidden])) { grid-column: 1 / -1; }
/* Dĺžka a termín zdieľajú jeden riadok. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label.meeting-duration-field { grid-column: span 3; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label.full:has(.meeting-slot-picker) { grid-column: span 3; }
/* Kalendár sa nezmestí do polovice riadku — po rozbalení zaberie celú šírku,
   inak z neho vidno len ľavý okraj a zvyšok je odrezaný. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label.full:has(.meeting-calendar-alternative:not([hidden])),
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > .full:has(.meeting-calendar-alternative:not([hidden])) { grid-column: 1 / -1; }
#editor .meeting-calendar-alternative:not([hidden]) { width: 100%; overflow-x: auto; }
/* Vytiahnutý kalendár je vlastný riadok pod dvojicou Dĺžka + Dátum a čas. */
#editor #editor-fields > .meeting-calendar-detached {
  grid-column: 1 / -1;
  margin-top: 4px;
  /* Kalendár roluje sám v sebe. Bez tohto je taký vysoký, že odtlačí prvé
     riadky formulára mimo viditeľnú časť okna. */
  max-height: 46vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* Voľba dĺžky sa zmestí do polovice riadku. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) .meeting-duration-field [data-meeting-duration] { padding: 6px 4px; font-size: 12px; }

/* Zbalené riadkové akcie (Leady, Párovanie). */
.row-action-open { white-space: nowrap; }
.row-action-pop {
  position: absolute;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
  margin-top: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface, #fff);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .16);
}
.row-action-pop button { width: 100%; justify-content: flex-start; text-align: left; }
td.table-actions-cell:has(.row-action-pop), td.editor-actions:has(.row-action-pop) { position: relative; overflow: visible; }

/* Okno Nové stretnutie / Nová obhliadka: menej prázdneho miesta, viac kalendára. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) { padding: 14px 18px 12px; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) .editor-heading { margin-bottom: 6px; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) .editor-heading h2 { margin: 0; }
/* Dĺžka a termín delia jeden riadok aj s otvoreným kalendárom — ten je pod nimi. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label.full:has(.meeting-calendar-alternative:not([hidden])),
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > .full:has(.meeting-slot-picker) { grid-column: span 3; }
#editor #editor-fields > .meeting-calendar-detached { grid-column: 1 / -1; max-height: none; overflow: visible; }
#editor .meeting-calendar-detached .embedded-calendar-body { max-height: 52vh; }
/* Hlavička kalendára na jeden riadok namiesto troch. */
#editor .meeting-calendar-detached .meeting-availability-help { display: none; }
#editor .meeting-calendar-detached .embedded-calendar-head { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
#editor .meeting-calendar-detached .embedded-calendar-head h3,
#editor .meeting-calendar-detached .embedded-calendar-head strong { font-size: 14px; margin: 0; }

/* Termín vedľa obchodného prípadu, jazdec času vedľa dĺžky. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > .meeting-slot-field { grid-column: span 2; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > .meeting-time-correction-field { grid-column: span 3; align-self: end; }
#editor .meeting-time-correction-field { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
#editor .meeting-time-correction-field .meeting-time-correction-head { margin-bottom: 6px; }
/* Prepínač kalendára sedí v hlavičke okna vedľa nadpisu. */
#editor .editor-heading .meeting-calendar-toggle-in-heading { margin-left: auto; margin-right: 8px; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) .editor-heading { display: flex; align-items: center; gap: 10px; }

/* Staršie pravidlo pre .full malo vyššiu prednosť a vracalo termínu celý riadok. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label.full.meeting-slot-field.meeting-slot-field { grid-column: span 2; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > .meeting-time-correction-field.meeting-time-correction-field { grid-column: span 3; }

/* Zarovnanie termínu a jazdca času s vedľajšími poľami. */
#editor .meeting-slot-field .meeting-slot-picker { margin-top: 0; }
#editor .meeting-slot-field .meeting-slot-summary {
  margin: 0;
  padding: 7px 10px;
  min-height: 38px;
  border-radius: 8px;
  font-size: 14px;
}
/* Jazdec času má rovnaký rám aj výšku ako voľba dĺžky. */
#editor #editor-fields > .meeting-time-correction-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 10px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
#editor .meeting-time-correction-field .meeting-time-correction-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
}
#editor .meeting-time-correction-field .meeting-range-control { flex: 1 1 auto; min-width: 0; }
#editor .meeting-time-correction-field > button { flex: 0 0 auto; white-space: nowrap; }
/* Presne ten istý rám aj výška ako pri voľbe dĺžky. */
#editor #editor-fields > .meeting-time-correction-field {
  padding: 8px;
  min-height: 58px;
  background: #f8faf7;
}
#editor .meeting-time-correction-field > button { min-height: 40px; }

/* Popis „Čas stretnutia“ ide nad rám, nech má bežec celú šírku. */
#editor #editor-fields > .meeting-time-correction-field {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "head head" "range button";
  align-items: center;
  gap: 6px 10px;
  padding: 0;
  min-height: 0;
  border: 0;
  background: none;
}
#editor .meeting-time-correction-field .meeting-time-correction-head {
  grid-area: head;
  padding: 0 2px;
  font-size: 13px;
}
#editor .meeting-time-correction-field .meeting-range-control {
  grid-area: range;
  padding: 8px 10px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf7;
}
#editor .meeting-time-correction-field > button { grid-area: button; min-height: 58px; }
/* Bez tlačidla „Potvrdiť čas“ patrí bežcu celá šírka bloku. */
#editor #editor-fields > .meeting-time-correction-field { grid-template-columns: 1fr; grid-template-areas: "head" "range"; }

/* Vybraný pás termínu musí byť vidieť celý, nielen prvý polhodinový riadok. */
#editor .meeting-availability-calendar .calendar-time-slot.is-selected-slot {
  background: linear-gradient(90deg,#e4efe7 0,#e4efe7 39px,#eef7f1 39px);
  box-shadow: inset 3px 0 0 var(--brand, #8a6b3f);
}
#editor .meeting-availability-calendar .calendar-time-slot.is-selected-slot-start { box-shadow: inset 3px 0 0 var(--brand, #8a6b3f), inset 0 2px 0 var(--brand, #8a6b3f); }
/* Ťahanie kartičky v mriežke termínov. */
#editor .meeting-availability-calendar .calendar-time-slot.is-selected-slot-start { cursor: grab; }
#editor .meeting-availability-calendar .calendar-time-slot.is-selected-slot:not(.is-selected-slot-start) { cursor: ns-resize; }
#editor .meeting-availability-calendar.is-dragging { cursor: grabbing; user-select: none; }
#editor .meeting-calendar-detached .embedded-calendar-body { overflow-y: auto; }
/* Krížik na kartičke vybraného termínu. */
#editor .meeting-availability-calendar .calendar-time-slot { position: relative; }
#editor .meeting-slot-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 3;
  width: 20px;
  height: 20px;
  padding: 0;
  line-height: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #8a3f3f;
  font-size: 14px;
  cursor: pointer;
}
#editor .meeting-slot-remove:hover { background: #f7e9e9; }
/* Krížik na uloženej udalosti v kalendári termínov. */
#editor .calendar-event { position: relative; }
#editor .calendar-event-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #8a3f3f;
  font-size: 13px;
  cursor: pointer;
}
#editor .calendar-event-remove:hover { background: #f7e9e9; }

/* Obhliadka nemá obchodný prípad — termín a dĺžka delia riadok, bežec je pod nimi. */
#editor #editor-fields:not(:has(select[name="dealId"])) > label.full.meeting-slot-field.meeting-slot-field { grid-column: span 3; }
#editor #editor-fields:not(:has(select[name="dealId"])) > .meeting-time-correction-field.meeting-time-correction-field { grid-column: 1 / -1; }

/* Bežec má vlastný riadok cez celú šírku, s popisom osi a časom na guľôčkach. */
#editor #editor-fields > .meeting-time-correction-field.meeting-time-correction-field { grid-column: 1 / -1; }
#editor .meeting-time-correction-field .meeting-range-control { position: relative; padding-top: 22px; }
#editor .meeting-range-bubble {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
#editor .meeting-range-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  padding: 0 2px;
  color: var(--muted, #7a7a72);
  font-size: 11px;
}
/* V stretnutí os popisovať netreba — časy sú na guľôčkach aj v termíne hore. */
#editor #editor-fields:has(select[name="dealId"]) .meeting-range-ticks { display: none; }

/* Bežec a kalendár idú vždy až za všetky polia — bez ohľadu na to, kde ich
   v štruktúre okna zrovna vložíme. Poradie určuje mriežka, nie poloha v kóde. */
#editor #editor-fields > .meeting-time-correction-field { order: 50; grid-column: 1 / -1; }
#editor #editor-fields > .meeting-calendar-detached { order: 60; grid-column: 1 / -1; }
/* Vyššia prednosť než skoršie „span 3“ — inak si bežec sadne vedľa dĺžky. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > .meeting-time-correction-field.meeting-time-correction-field.meeting-time-correction-field { order: 50; grid-column: 1 / -1; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > .meeting-calendar-detached.meeting-calendar-detached.meeting-calendar-detached { order: 60; grid-column: 1 / -1; }

/* Stĺpec Akcie ostáva pri pravom okraji aj pri širokej tabuľke — inak
   „Aktivity“ ujde mimo obrazovku a treba k nemu rolovať. */
.table-wrap.table-scroll-x table.is-fixed-layout th.table-actions-cell,
.table-wrap.table-scroll-x table.is-fixed-layout td.table-actions-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--surface, #fff);
  box-shadow: -6px 0 8px -6px rgba(0, 0, 0, .18);
}
.table-wrap.table-scroll-x table.is-fixed-layout tr:nth-child(even) td.table-actions-cell { background: var(--zebra, #faf9f6); }

/* Stav, Miesto a Záznam patria až za kalendár — vypĺňajú sa po ňom. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label:has(select[name="status"]),
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label:has(select[name="locationChoice"]),
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label:has(input[name="locationCustom"]) { order: 70; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label:has(textarea[name="notes"]),
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > label:has(textarea[name="description"]) { order: 71; grid-column: 1 / -1; }

/* ---------------------------------------------------------------------------
   Bežec „Upresniť čas“ — jediné platné pravidlo. Predchádzajúce úpravy sa
   navrstvili (grid-areas, flex, absolútne umiestnenie vnútri) a blok sa
   vykresľoval mimo svojho riadku. Preto sa tu všetko výslovne resetuje. */
#editor #editor-fields > .meeting-time-correction-field.meeting-time-correction-field.meeting-time-correction-field {
  order: 50;
  grid-column: 1 / -1;
  grid-row: auto;
  display: block;
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  min-height: 0;
  inset: auto;
  transform: none;
}
#editor .meeting-time-correction-field > .meeting-time-correction-head {
  display: block;
  grid-area: auto;
  margin: 0 0 4px;
  padding: 0 2px;
  font-size: 13px;
}
#editor .meeting-time-correction-field > .meeting-range-control {
  display: block;
  position: relative;
  grid-area: auto;
  margin: 0;
  padding: 26px 12px 10px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf7;
}
#editor .meeting-time-correction-field > .meeting-range-ticks { grid-area: auto; }
/* Trochu nižšie — nech bežec nelipne na riadku s termínom a dĺžkou. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields > .meeting-time-correction-field.meeting-time-correction-field.meeting-time-correction-field { margin-top: 72px; }
/* Voľba dĺžky vypĺňa svoju polovicu riadku až po okraj okna. */
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) .meeting-duration-picker { width: 100%; }
/* Bez obchodného prípadu: termín zaberá dva stĺpce, dĺžka zvyšok až po okraj. */
#editor #editor-fields:not(:has(select[name="dealId"])) > label.full.meeting-duration-field.meeting-duration-field { grid-column: 3 / -1; }
#editor .editor-card:has(#editor-fields [name="meetingDurationMinutes"]) #editor-fields:not(:has(select[name="dealId"])) > label.meeting-duration-field.meeting-duration-field.meeting-duration-field { grid-column: 3 / -1; }

/* Akútne hľadanie v požiadavke klienta. */
.requirement-urgent-field { gap: 4px; }
.requirement-urgent-field > span { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.requirement-urgent-field input[type="checkbox"] { width: 16px; height: 16px; }

/* Plocha editora v pomere A4 — na zmluve sa inak nedá nič rovnať podľa okraja. */
.image-editor-canvas-wrap { aspect-ratio: 1 / 1.414; max-height: 68vh; place-items: start center; }
.image-editor-canvas-wrap canvas { max-width: 100%; width: auto; height: auto; }

.document-case-box {
  display: grid;
  gap: 12px;
}
.document-picker-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}
.document-picker-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line, #d9dfd8);
  border-radius: 8px;
  background: #fff;
}
.document-picker-row strong,
.document-picker-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.document-picker-row small {
  color: var(--muted, #68736d);
  margin-top: 3px;
}
/* Väčší výber dokumentov na odoslanie a editáciu: pri zmluvách s mnohými stranami musí byť vidno zoznam bez vnútorného skrolovania. */
#editor .editor-card:has(.document-send-box),
#editor .editor-card:has(.document-edit-box) {
  width: min(1240px, 96vw);
  min-height: min(78vh, 860px);
  display: flex;
  flex-direction: column;
}
#editor .editor-card:has(.document-send-box) .field-grid,
#editor .editor-card:has(.document-send-box) #editor-fields,
#editor .editor-card:has(.document-edit-box) .field-grid,
#editor .editor-card:has(.document-edit-box) #editor-fields {
  min-height: 0;
  overflow: visible;
}
#editor .editor-card:has(.document-send-box) .document-picker-list,
#editor .editor-card:has(.document-edit-box) .document-picker-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: none;
  overflow: visible;
}
#editor .editor-card:has(.document-send-box) .document-picker-row,
#editor .editor-card:has(.document-edit-box) .document-picker-row {
  min-height: 54px;
}
#editor .editor-card:has(.document-send-box) .editor-actions,
#editor .editor-card:has(.document-edit-box) .editor-actions {
  margin-top: auto;
}
@media (max-width: 860px) {
  #editor .editor-card:has(.document-send-box),
  #editor .editor-card:has(.document-edit-box) { width: min(96vw, 720px); min-height: auto; }
  #editor .editor-card:has(.document-send-box) .document-picker-list,
  #editor .editor-card:has(.document-edit-box) .document-picker-list { grid-template-columns: 1fr; }
}
/* Zbalená ponuka visí nad stránkou, nie v bunke — musí byť nad tabuľkou. */
.row-action-pop { z-index: 60; }
/* Prilepený stĺpec akcií nesmie prekryť susedný „Upravil“. */
.table-wrap.table-scroll-x table.is-fixed-layout th.table-actions-cell,
.table-wrap.table-scroll-x table.is-fixed-layout td.table-actions-cell { z-index: 3; }


/* A4 editor nafotených zmlúv: celé strany sa majú zmestiť do okna a zoom má pracovať v pixeloch. */
#image-editor .image-editor-card {
  width: min(96vw, 980px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#image-editor .image-editor-body {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
#image-editor .image-editor-canvas-wrap {
  width: min(100%, 780px);
  aspect-ratio: 1 / 1.414;
  max-height: calc(100vh - 330px);
  min-height: min(680px, calc(100vh - 330px));
  margin-inline: auto;
  overflow: auto;
  display: grid;
  place-items: start center;
  scrollbar-gutter: stable both-edges;
  overscroll-behavior: contain;
}
#image-editor .image-editor-canvas-wrap canvas {
  max-width: none;
  width: auto;
  height: auto;
}
#image-editor .image-editor-controls {
  flex: 0 0 auto;
}
#image-editor .editor-actions {
  flex: 0 0 auto;
}
@media (max-height: 850px) {
  #image-editor .image-editor-canvas-wrap {
    min-height: min(520px, calc(100vh - 310px));
    max-height: calc(100vh - 310px);
  }
}

/* Editor fotografie na šírku: strana A4 vľavo, ovládanie vpravo.
   Predtým boli ovládacie prvky pod obrázkom a brali mu výšku — na zmluve tak
   ostalo miesta len na pár riadkov textu. */
#image-editor .image-editor-card { width: min(98vw, 1500px); }
#image-editor .image-editor-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
#image-editor .image-editor-canvas-wrap {
  width: 100%;
  margin-inline: 0;
  max-height: calc(100vh - 190px);
  min-height: min(820px, calc(100vh - 190px));
}
#image-editor .image-editor-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding-right: 4px;
}
#image-editor .image-editor-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#image-editor .image-editor-tools button { width: 100%; }
#image-editor .image-editor-controls label { display: grid; gap: 4px; font-size: 13px; }
#image-editor .image-editor-controls input[type="range"] { width: 100%; }
#image-editor .image-editor-hint { font-size: 12px; }
@media (max-width: 1180px) {
  #image-editor .image-editor-body { grid-template-columns: minmax(0, 1fr); }
  #image-editor .image-editor-controls { max-height: none; }
}
@media (max-height: 850px) {
  #image-editor .image-editor-canvas-wrap {
    min-height: min(560px, calc(100vh - 180px));
    max-height: calc(100vh - 180px);
  }
}
/* Šírku plochy odvodíme z dostupnej výšky, aby strana ostala v pomere A4
   a nezmenila sa na širokú nízku plochu. */
#image-editor .image-editor-canvas-wrap {
  width: min(100%, calc((100vh - 190px) / 1.414));
  min-height: 0;
  margin-inline: auto;
}
/* Ponuka mimo tabuľky musí byť čitateľná sama o sebe. */
body > .row-action-pop { z-index: 1200; box-shadow: 0 16px 34px rgba(0,0,0,.22); }
body > .row-action-pop button { background: #fff; color: var(--ink); border: 1px solid var(--line); }
body > .row-action-pop button:hover { background: var(--zebra, #f4f2ed); }
/* Nadpis a lišta okna sú nízke, aby na stranu ostalo čo najviac miesta. */
#image-editor .image-editor-card { padding: 10px 16px 12px; }
#image-editor .editor-heading { margin-bottom: 6px; }
#image-editor .editor-heading h2 { margin: 0; font-size: 18px; }
#image-editor .editor-actions { margin-top: 8px; }
#image-editor .image-editor-canvas-wrap {
  max-height: calc(100vh - 140px);
  width: min(100%, calc((100vh - 140px) / 1.414));
}
#image-editor .image-editor-controls { max-height: calc(100vh - 140px); }

/* Nadpis okna do pravého stĺpca nad ovládanie — strana tak dostane celú výšku
   aj šírku ľavej časti. `display: contents` pustí obsah tela priamo do mriežky
   karty, takže nadpis, plocha a ovládanie sedia v jednom rozvrhu. */
#image-editor .image-editor-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  grid-template-rows: auto 1fr auto auto;
  gap: 8px 16px;
  align-items: start;
}
#image-editor .editor-heading { grid-column: 2; grid-row: 1; margin: 0; }
#image-editor .image-editor-body { display: contents; }
#image-editor .image-editor-canvas-wrap {
  grid-column: 1;
  grid-row: 1 / span 2;
  max-height: calc(100vh - 110px);
  min-height: 0;
  width: min(100%, calc((100vh - 110px) / 1.414));
}
#image-editor .image-editor-controls {
  grid-column: 2;
  grid-row: 2;
  max-height: calc(100vh - 190px);
}
#image-editor #image-editor-error { grid-column: 1 / -1; }
#image-editor .editor-actions { grid-column: 1 / -1; grid-row: 4; justify-content: flex-end; }
/* Posuvníky: popis a jazdec v jednom riadku, nie pod sebou. */
#image-editor .image-editor-controls > label {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

/* Editor zmluvy: dokument má mať prioritu pred dekoratívnym A4 rámom.
   Otvára sa na šírku dostupnej pracovnej plochy a spodok strany sa rieši
   normálnym scrollom v ľavom okne editora. */
#image-editor .image-editor-card {
  width: min(98vw, 1660px);
  height: min(96vh, 1120px);
  max-height: none;
  display: grid;
  grid-template-columns: minmax(760px, 1fr) 330px;
  grid-template-rows: auto 1fr auto;
  gap: 8px 16px;
  align-items: start;
}
#image-editor .editor-heading { grid-column: 2; grid-row: 1; margin: 0; }
#image-editor .image-editor-body { display: contents; }
#image-editor .image-editor-canvas-wrap {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 100%;
  height: calc(min(96vh, 1120px) - 90px);
  max-height: none;
  min-height: 0;
  aspect-ratio: auto;
  margin-inline: 0;
  overflow: auto;
  display: grid;
  place-items: start center;
  background: #eef4f4;
}
#image-editor .image-editor-controls {
  grid-column: 2;
  grid-row: 2;
  max-height: calc(min(96vh, 1120px) - 150px);
  overflow-y: auto;
}
#image-editor #image-editor-error { grid-column: 1 / -1; }
#image-editor .editor-actions { grid-column: 1 / -1; grid-row: 3; justify-content: flex-end; }
@media (max-width: 1180px) {
  #image-editor .image-editor-card {
    width: 96vw;
    height: auto;
    grid-template-columns: 1fr;
  }
  #image-editor .editor-heading,
  #image-editor .image-editor-canvas-wrap,
  #image-editor .image-editor-controls,
  #image-editor .editor-actions,
  #image-editor #image-editor-error { grid-column: 1; grid-row: auto; }
  #image-editor .image-editor-canvas-wrap { height: min(72vh, 900px); }
  #image-editor .image-editor-controls { max-height: none; }
}
.document-page-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.document-page-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line, #dfe5df);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}
.document-page-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#editor .editor-card:has(.document-pages-box) {
  width: min(96vw, 1180px);
  min-height: min(82vh, 760px);
}
@media (max-width: 820px) {
  .document-page-list { grid-template-columns: 1fr; }
  .document-page-row { grid-template-columns: 1fr; align-items: stretch; }
}
/* Komfortný editor nafotenej zmluvy: dokument ostáva čitateľný a nástroje sú stále na očiach. */
#image-editor .image-editor-card {
  width: min(98vw, 1780px);
  height: min(96vh, 1120px);
  max-height: none;
  display: grid;
  grid-template-columns: minmax(820px, 1fr) 430px;
  grid-template-rows: auto 1fr auto;
  gap: 10px 18px;
  align-items: start;
  overflow: hidden;
}
#image-editor .editor-heading {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
}
#image-editor .image-editor-body { display: contents; }
#image-editor .image-editor-canvas-wrap {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 100%;
  height: calc(min(96vh, 1120px) - 90px);
  max-height: none;
  min-height: 0;
  aspect-ratio: auto;
  margin-inline: 0;
  overflow: auto;
  display: grid;
  place-items: start center;
  background: #eef4f4;
  scrollbar-gutter: stable both-edges;
}
#image-editor .image-editor-canvas-wrap canvas {
  max-width: none;
  width: auto;
  height: auto;
}
#image-editor .image-editor-controls {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
#image-editor .image-editor-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
#image-editor .image-editor-tools button {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  line-height: 1.15;
  white-space: normal;
}
#image-editor .image-editor-tools button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
#image-editor .image-editor-tools button.active-tool {
  background: #b88a44;
  border-color: #b88a44;
  color: #fff;
}
#image-editor .image-editor-controls > label {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
#image-editor .image-editor-controls input[type="range"] { width: 100%; }
#image-editor #image-editor-hint {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.35;
}
#image-editor #image-editor-error { grid-column: 1 / -1; }
#image-editor .editor-actions {
  grid-column: 1 / -1;
  grid-row: 3;
  justify-content: flex-end;
  margin-top: 0;
}
@media (max-width: 1250px) {
  #image-editor .image-editor-card {
    width: 96vw;
    height: auto;
    grid-template-columns: 1fr;
    overflow: auto;
  }
  #image-editor .editor-heading,
  #image-editor .image-editor-canvas-wrap,
  #image-editor .image-editor-controls,
  #image-editor .editor-actions,
  #image-editor #image-editor-error { grid-column: 1; grid-row: auto; }
  #image-editor .image-editor-canvas-wrap { height: min(72vh, 900px); }
}
/* Strany dokumentu: očíslované karty, aby bolo na prvý pohľad jasné koľko strán dokument má. */
.document-pages-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--success-line, #8fc8b5);
  border-radius: 10px;
  background: var(--success-wash, #f0fbf4);
}
.document-pages-count {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand, #247a60);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
}
.document-pages-title { display: grid; gap: 2px; min-width: 0; }
.document-pages-title strong { color: var(--brand-dark, #14513f); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-pages-title small { color: var(--muted); font-weight: 600; }
.document-page-row {
  border-left: 4px solid var(--brand, #247a60);
  background: #fbfdfc;
  transition: background .12s ease, box-shadow .12s ease;
}
.document-page-row:hover { background: var(--success-wash, #f0fbf4); box-shadow: 0 6px 16px #17354a14; }
.document-page-badge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--success-soft, #dff4ea);
  color: var(--brand-dark, #14513f);
  font-size: 14px;
  font-weight: 800;
}
.document-page-name { display: grid; gap: 1px; min-width: 0; }
.document-page-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.document-page-name small { color: var(--muted); font-size: 12px; font-weight: 650; }
.document-page-row .document-page-open { background: var(--brand, #247a60); color: #fff; }
.document-page-row .document-page-open:hover { background: var(--brand-dark, #14513f); }
.document-page-row .merged-document-download { background: #e8eef3; color: var(--ink); }
.document-page-row .merged-document-download:hover { background: #dce6ee; }

/* Nástroje editora fotografie v troch stĺpcoch — desať tlačidiel pod sebou
   v dvoch stĺpcoch tlačilo posuvníky mimo obrazovku. */
#image-editor .image-editor-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
#image-editor .image-editor-tools button {
  min-height: 36px;
  padding: 7px 8px;
  font-size: 12px;
  hyphens: auto;
}
/* Hlavné automatické akcie (orez na papier, vyrovnanie skenu) sú farebné,
   aby sa nestratili medzi pomocnými tlačidlami. */
#image-editor .image-editor-tools button:not(.secondary) {
  background: var(--brand, #247a60);
  color: #fff;
}
#image-editor .image-editor-tools button:not(.secondary):hover {
  background: var(--brand-dark, #14513f);
}
@media (max-width: 1450px) {
  #image-editor .image-editor-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Okno vizualizácie miestnosti. */
#room-visualizer::backdrop { background: #0c2234c9; }
.room-visualizer-card {
  display: grid;
  gap: 12px;
  width: min(96vw, 1120px);
  max-height: 90vh;
  overflow-y: auto;
}
.room-visualizer-card p.muted { font-size: 13px; line-height: 1.45; }
.room-visualizer-card .editor-actions { margin-top: 4px; }
.room-visualizer-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(360px, .95fr);
  gap: 18px;
  align-items: start;
}
.room-visualizer-layout.is-disabled .room-visualizer-source {
  border-color: #d8b36a;
  background: #fff8e8;
}
.room-visualizer-panel {
  display: grid;
  gap: 11px;
}
.room-visualizer-source {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line, #dce4eb);
  border-radius: 12px;
  background: #f7faf9;
}
.room-visualizer-source strong {
  font-size: 13px;
}
.room-visualizer-source img {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  border-radius: 8px;
  background: #eef3f1;
}
.room-visualizer-source p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
#room-visualizer-run:disabled { opacity: .55; cursor: progress; }
@media (max-width: 900px) {
  .room-visualizer-layout { grid-template-columns: 1fr; }
  .room-visualizer-source img { max-height: 320px; }
}

/* Okno simulácie vizualizácie. */
#room-simulation::backdrop { background: #0c2234c9; }
.room-simulation-card {
  display: grid;
  gap: 12px;
  width: min(94vw, 720px);
}
.room-simulation-card p.muted { font-size: 13px; line-height: 1.45; }
.room-simulation-preview {
  border: 1px solid var(--line, #dce4eb);
  border-radius: 10px;
  overflow: hidden;
  background: #f4f7fa;
}
.room-simulation-preview canvas { display: block; width: 100%; height: auto; }
#room-simulation-save:disabled { opacity: .55; cursor: progress; }

/* Okno na vloženie vizualizácie vygenerovanej v ChatGPT. */
#visualization-import::backdrop { background: #0c2234c9; }
.visualization-import-card {
  display: grid;
  gap: 11px;
  width: min(94vw, 700px);
  max-height: 92vh;
  overflow-y: auto;
}
.visualization-import-card p.muted { font-size: 13px; line-height: 1.45; }
.visualization-import-steps {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.visualization-import-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.visualization-import-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.visualization-import-card textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #bfcbd5;
  border-radius: 8px;
  font: 12px/1.45 ui-monospace, Consolas, monospace;
  resize: vertical;
}
.visualization-import-preview {
  border: 1px solid var(--line, #dce4eb);
  border-radius: 10px;
  overflow: hidden;
  background: #f4f7fa;
}
.visualization-import-preview canvas { display: block; width: 100%; height: auto; }
@media (max-width: 620px) {
  .visualization-import-row { grid-template-columns: 1fr; }
}

/* Náhľady strán a hromadná úprava v okne „Strany dokumentu“. */
.document-pages-batch {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--zebra, #f7f5f0);
}
.document-pages-batch-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.document-page-thumb {
  display: grid;
  place-items: center;
  width: 54px;
  height: 74px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
  color: var(--muted, #7a7a72);
}
.document-page-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.document-page-thumb--missing::after { content: '—'; }
.document-page-row { align-items: center; gap: 10px; }

/* Otázka pred zatvorením okna klávesou Esc. */
.confirm-close-window {
  width: min(92vw, 420px);
  padding: 24px;
  border: 1px solid #ffffff55;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 26px 80px #07100d70;
}
.confirm-close-window::backdrop { background: #07100d66; }
.confirm-close-title { margin: 0 0 8px; font-size: 20px; }
.confirm-close-text { margin: 0; color: var(--muted); }
.confirm-close-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* Fotenie priamo do karty nehnuteľnosti. */
.photo-studio-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 4px; }
.photo-studio-hint { font-size: 13px; }
.photo-capture-dialog {
  width: min(94vw, 760px);
  padding: 20px;
  border: 1px solid #ffffff55;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 26px 80px #07100d70;
}
.photo-capture-dialog::backdrop { background: #07100dcc; }
.photo-capture-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.photo-capture-head h2 { font-size: 21px; }
.photo-capture-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  overflow: hidden;
  border-radius: 12px;
  background: #0d1a15;
}
.photo-capture-video { display: block; width: 100%; max-height: 56vh; object-fit: contain; }
.photo-capture-video.is-mirrored { transform: scaleX(-1); }
.photo-capture-message { max-width: 420px; padding: 24px; color: #eaf3ee; text-align: center; }
.photo-capture-message button { margin-top: 14px; }
.photo-capture-strip { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; }
.photo-capture-strip:not(.has-shots) { display: none; }
.photo-capture-thumb { position: relative; flex: 0 0 auto; width: 74px; height: 56px; overflow: hidden; border-radius: 8px; }
.photo-capture-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-capture-thumb span {
  position: absolute; right: 3px; bottom: 3px;
  padding: 0 5px; border-radius: 6px;
  background: #0d1a15c0; color: #fff; font-size: 11px; font-weight: 700;
}
.photo-capture-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.photo-capture-shutter {
  width: 62px; height: 62px; padding: 0;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand);
}
.photo-capture-shutter:disabled { background: #9fb0a8; box-shadow: 0 0 0 3px #9fb0a8; cursor: not-allowed; }
.photo-capture-shutter.is-firing { transform: scale(.92); }

/* 360° prehliadka — vstup z karty nehnuteľnosti. */
.property-tour-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

/* Editor prehliadky. */
.tour-editor-dialog {
  width: min(96vw, 1180px);
  padding: 20px;
  border: 1px solid #ffffff55;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 26px 80px #07100d70;
}
.tour-editor-dialog::backdrop { background: #07100dcc; }
.tour-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tour-editor-head h2 { font-size: 21px; }
.tour-editor-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; }
.tour-scene-list { display: flex; flex-direction: column; min-height: 0; }
.tour-scene-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.tour-scene-list-head h3 { margin: 0; font-size: 15px; }
.tour-scenes { display: grid; gap: 8px; max-height: 58vh; overflow-y: auto; padding-right: 4px; }
.tour-scene {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
}
.tour-scene.is-active { border-color: var(--brand); box-shadow: 0 0 0 2px #b8e1eb; }
.tour-scene img { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; background: #e8eef3; }
.tour-scene-meta { display: grid; gap: 4px; min-width: 0; }
.tour-scene-meta input[type="text"] { padding: 5px 7px; font-size: 13px; }
.tour-scene-start { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tour-scene-start input { width: auto; }
.tour-stage { position: relative; display: flex; flex-direction: column; min-width: 0; }
.tour-canvas {
  display: block; width: 100%; height: 58vh;
  border-radius: 12px; background: #0d1a15; cursor: grab; touch-action: none;
}
.tour-canvas:active { cursor: grabbing; }
.tour-hotspots { position: absolute; inset: 0 0 auto 0; height: 58vh; pointer-events: none; }
.tour-hotspot { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; }
.tour-hotspot-dot {
  display: block; width: 26px; height: 26px;
  border: 3px solid #fff; border-radius: 50%;
  background: var(--brand); box-shadow: 0 2px 10px #07100d80;
}
.tour-hotspot-panel {
  position: absolute; left: 50%; top: 32px; transform: translateX(-50%);
  display: none; align-items: center; gap: 6px;
  padding: 6px; border-radius: 10px; background: #fffffff2; box-shadow: 0 6px 20px #07100d50; white-space: nowrap;
}
.tour-hotspot:hover .tour-hotspot-panel, .tour-hotspot:focus-within .tour-hotspot-panel { display: flex; }
.tour-hotspot-panel select { width: auto; min-width: 130px; padding: 5px 7px; font-size: 13px; }
.tour-hotspot-panel .icon-button { width: 26px; height: 26px; font-size: 17px; }
.tour-stage-note { min-height: 20px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.tour-stage-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.tour-stage-bar .is-active { background: var(--brand); color: #fff; }
.tour-stage-hint { font-size: 12px; }
.tour-error { min-height: 18px; margin: 10px 0 0; }
.tour-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.tour-editor-foot-actions { display: flex; gap: 10px; }

/* Výber panoramatických fotiek do prehliadky. */
.tour-picker-dialog {
  /* Šesť dlaždíc v rade a päť radov naraz — pri jedenástich fotkách z bytu
     nemá zmysel rolovať po štyroch. */
  --tour-pick-image: 90px;
  --tour-pick-row: calc(var(--tour-pick-image) + 45px);
  width: min(96vw, 1240px); padding: 22px;
  border: 1px solid #ffffff55; border-radius: 16px; background: #fff; color: var(--ink);
  box-shadow: 0 26px 80px #07100d70;
}
.tour-picker-dialog::backdrop { background: #07100dcc; }
.tour-picker-dialog h3 { margin: 0 0 4px; font-size: 18px; }
.tour-picker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tour-picker-bulk { display: flex; gap: 8px; flex-shrink: 0; }
.tour-picker-tip { margin: 10px 0 0; font-size: 13px; }
.tour-picker-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px;
  max-height: min(72vh, calc(5 * var(--tour-pick-row) + 4 * 10px));
  overflow-y: auto; margin: 12px 0 14px; padding-right: 4px;
  /* Bez tohto ťahanie myšou cez dlaždice označuje text a mriežka zmodrie. */
  user-select: none; -webkit-user-select: none;
}
.tour-picker-item {
  position: relative; display: grid; gap: 4px; padding: 6px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
}
.tour-picker-item:focus-visible { outline: 3px solid #b8e1eb; outline-offset: 2px; }
.tour-picker-item.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px #b8e1eb; }
.tour-picker-item img {
  width: 100%; height: var(--tour-pick-image); object-fit: cover;
  border-radius: 6px; background: #e8eef3; pointer-events: none;
}
.tour-picker-name { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.tour-picker-mark {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  width: 22px; height: 22px;
  border: 2px solid #fff; border-radius: 6px; background: #0d1a1566;
  box-shadow: 0 1px 6px #07100d60;
}
.tour-picker-item.is-selected .tour-picker-mark { background: var(--brand); }
.tour-picker-item.is-selected .tour-picker-mark::after {
  content: ''; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.tour-picker-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.tour-picker-actions .tour-picker-count { margin-right: auto; font-size: 13px; }

@media (max-width: 1100px) { .tour-picker-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) { .tour-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 900px) {
  .tour-editor-body { grid-template-columns: 1fr; }
  .tour-scenes { max-height: 26vh; }
  .tour-canvas, .tour-hotspots { height: 42vh; }
}

/* Voľba predlohy scény (bežná fotka / panoráma / plná 360°). */
.tour-projection-bar {
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  margin-top: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #f8fafb;
}
.tour-projection-bar:empty { display: none; }
.tour-projection-field { display: grid; gap: 4px; font-size: 12px; }
.tour-projection-field select { width: auto; min-width: 220px; padding: 6px 8px; font-size: 13px; }
.tour-projection-range { min-width: 220px; }
.tour-projection-range input[type="range"] { width: 100%; padding: 0; }
.tour-projection-note { flex: 1 1 200px; font-size: 12px; }

/* Náhľad prehliadky — tak, ako ju uvidí klient. */
.tour-viewer-dialog {
  width: min(96vw, 1280px); max-width: 96vw; padding: 0;
  border: 0; border-radius: 16px; background: #0d1a15; overflow: hidden;
  box-shadow: 0 26px 80px #07100d90;
}
.tour-viewer-dialog::backdrop { background: #07100de6; }
/* Výška patrí scéne, nie plátnu. Filmový režim plátno skrýva a keď od neho
   závisela výška, celá scéna sa zložila na nulu — prekrytie s fotkou malo
   „inset: 0“ z prázdneho rámu a okno ostalo čierne. */
.tour-viewer-stage { position: relative; height: min(78vh, 720px); }
.tour-viewer-canvas { display: block; width: 100%; height: 100%; background: #0d1a15; cursor: grab; touch-action: none; }
.tour-viewer-canvas:active { cursor: grabbing; }
.tour-viewer-hotspots { position: absolute; inset: 0; pointer-events: none; }
.tour-viewer-hotspot {
  position: absolute; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 5px;
  padding: 0; border: 0; background: none; pointer-events: auto;
}
.tour-viewer-dot {
  width: 34px; height: 34px;
  border: 3px solid #fff; border-radius: 50%;
  background: #ffffff33; box-shadow: 0 2px 12px #07100d90;
  transition: transform .15s ease, background .15s ease;
}
.tour-viewer-hotspot:hover .tour-viewer-dot { transform: scale(1.12); background: var(--brand); }
.tour-viewer-label {
  padding: 3px 9px; border-radius: 8px;
  background: #07100dcc; color: #fff; font-size: 12px; font-weight: 650; white-space: nowrap;
}
.tour-viewer-topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(#07100dcc, #07100d00);
}
.tour-viewer-title { color: #fff; font-size: 17px; font-weight: 700; text-shadow: 0 1px 6px #07100d; }
.tour-viewer-topbar .icon-button { background: #ffffff26; color: #fff; }
.tour-viewer-message {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; max-width: 70%; color: #eaf3ee; text-align: center;
}
.tour-viewer-message:empty { display: none; }
.tour-viewer-rooms {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 22px 14px 12px;
  background: linear-gradient(#07100d00, #07100dcc);
}
.tour-viewer-room {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 8px;
  background: #ffffff26; color: #fff; font-size: 13px; font-weight: 650;
}
.tour-viewer-room:hover { background: #ffffff40; }
.tour-viewer-room.is-active { background: var(--brand); }
.tour-canvas.is-locked, .tour-viewer-canvas.is-locked { cursor: zoom-in; }
.tour-canvas.is-locked:active, .tour-viewer-canvas.is-locked:active { cursor: zoom-in; }

/* Filmová obhliadka — zábery po sebe s pomalým priblížením. */
.tour-film-stage { position: absolute; inset: 0; overflow: hidden; background: #0d1a15; }
.tour-film-layer {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  /* contain = fotka sa nikdy neoreže ani nenatiahne, len sa zmestí do rámu */
  object-fit: contain;
  opacity: 0; transition: opacity .9s ease;
  will-change: transform, opacity;
}
.tour-film-layer.is-visible { opacity: 1; }
.tour-film-layer.is-animating { animation: tour-kenburns var(--dur, 4s) ease-out forwards; }
@keyframes tour-kenburns {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(var(--zoom, 1.1)) translate(var(--tx, 0), var(--ty, 0)); }
}
@media (prefers-reduced-motion: reduce) {
  .tour-film-layer.is-animating { animation: none; }
}
.tour-film-controls {
  position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px; background: #07100dcc;
}
.tour-film-button {
  width: 34px; height: 34px; padding: 0;
  border-radius: 50%; background: #ffffff26; color: #fff; font-size: 13px; line-height: 1;
}
.tour-film-button:hover { background: #ffffff40; }
.tour-film-progress { padding: 0 6px; color: #fff; font-size: 12px; font-weight: 650; }
.tour-viewer-modes { display: flex; gap: 6px; margin-left: auto; margin-right: 10px; }
.tour-viewer-mode {
  padding: 5px 11px; border-radius: 999px;
  background: #ffffff26; color: #fff; font-size: 12px; font-weight: 650;
}
.tour-viewer-mode:hover { background: #ffffff40; }
.tour-viewer-mode.is-active { background: var(--brand); }

/* Porovnanie „pred / po“ s bežcom. */
.photo-compare-dialog {
  width: min(94vw, 1100px); padding: 20px;
  border: 1px solid #ffffff55; border-radius: 18px; background: #fff; color: var(--ink);
  box-shadow: 0 26px 80px #07100d70;
}
.photo-compare-dialog::backdrop { background: #07100de0; }
.photo-compare-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.photo-compare-head h2 { font-size: 19px; }
.photo-compare-stage {
  position: relative; overflow: hidden;
  border-radius: 12px; background: #0d1a15;
  cursor: ew-resize; user-select: none; -webkit-user-select: none; touch-action: none;
}
.photo-compare-stage:focus-visible { outline: 3px solid #b8e1eb; outline-offset: 2px; }
.photo-compare-before, .photo-compare-after {
  display: block; width: 100%; max-height: 66vh; object-fit: contain; pointer-events: none;
}
.photo-compare-after-wrap { position: absolute; inset: 0; }
.photo-compare-after { height: 100%; }
.photo-compare-tag {
  position: absolute; top: 12px;
  padding: 4px 10px; border-radius: 999px;
  background: #07100dcc; color: #fff; font-size: 11px; font-weight: 750; letter-spacing: .04em;
}
.photo-compare-tag-before { left: 12px; }
.photo-compare-tag-after { right: 12px; }
.photo-compare-handle {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: #fff; box-shadow: 0 0 10px #07100d80; transform: translateX(-1px); pointer-events: none;
}
.photo-compare-handle span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 42px; height: 42px;
  border: 2px solid #fff; border-radius: 50%;
  background: #07100dcc; color: #fff; font-size: 17px;
}
.photo-compare-hint { margin: 12px 0 0; font-size: 13px; }

/* Video obhliadka. */
.video-tour-dialog {
  width: min(96vw, 1280px); padding: 0;
  border: 0; border-radius: 16px; background: #07100d; overflow: hidden;
  box-shadow: 0 26px 80px #07100d90;
}
.video-tour-dialog::backdrop { background: #07100de6; }
.video-tour-stage { position: relative; background: #07100d; }
.video-tour-player { display: block; width: 100%; height: min(76vh, 700px); background: #07100d; cursor: pointer; }
.video-tour-topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: linear-gradient(#07100dcc, #07100d00);
}
.video-tour-title { color: #fff; font-size: 16px; font-weight: 700; text-shadow: 0 1px 6px #07100d; }
.video-tour-topbar .icon-button { background: #ffffff26; color: #fff; }
.video-tour-message {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; max-width: 72%; color: #eaf3ee; text-align: center;
}
.video-tour-controls {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 12px; background: #07100dcc;
}
.video-tour-button {
  padding: 6px 10px; border-radius: 8px;
  background: #ffffff26; color: #fff; font-size: 12px; font-weight: 650; line-height: 1;
}
.video-tour-button:hover { background: #ffffff40; }
.video-tour-play { min-width: 42px; font-size: 15px; padding: 8px 12px; }
.video-tour-seek { flex: 1 1 160px; width: auto; min-width: 120px; padding: 0; accent-color: var(--brand); }
.video-tour-time { color: #fff; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* Video v galérii nehnuteľnosti. */
.photo-thumb.is-video .photo-thumb-preview { background: #0d1a15; }
.photo-thumb-badge-video { background: #07100dcc; color: #fff; }
.photo-thumb.is-video .photo-thumb-badge-video { left: auto; right: 8px; }
.photo-thumb-videoicon {
  display: grid; place-items: center;
  width: 46px; height: 46px; border: 2px solid #ffffffaa; border-radius: 50%;
  color: #fff; font-size: 18px;
}
.photo-thumb.is-video .photo-thumb-preview::after {
  content: '▶';
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border: 2px solid #ffffffcc; border-radius: 50%;
  background: #07100d80; color: #fff; font-size: 15px;
  pointer-events: none;
}
.photo-thumb.is-video .photo-thumb-preview { position: relative; }

/* Video obhliadka ako samostatná sekcia galérie. */
.gallery-video { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.gallery-video-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.gallery-video-head h4 { margin: 0; font-size: 15px; }
.gallery-video-hint { font-size: 13px; }
.gallery-video-list { display: grid; gap: 10px; }
.gallery-video-list:empty { display: none; }
.gallery-video-item {
  display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.gallery-video-item.is-error { border-color: var(--danger); }
.gallery-video-poster {
  position: relative; display: grid; place-items: center;
  height: 104px; overflow: hidden; border-radius: 8px; background: #0d1a15;
}
.gallery-video-poster img { width: 100%; height: 100%; object-fit: cover; }
.gallery-video-poster::after {
  content: '▶';
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 2px solid #ffffffcc; border-radius: 50%;
  background: #07100d80; color: #fff; font-size: 14px; pointer-events: none;
}
.gallery-video-icon { color: #ffffffaa; font-size: 20px; }
.gallery-video-state {
  position: absolute; left: 8px; bottom: 8px;
  padding: 2px 8px; border-radius: 999px;
  background: #07100dcc; color: #fff; font-size: 11px; font-weight: 650;
}
.gallery-video-meta { display: grid; gap: 5px; min-width: 0; }
.gallery-video-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-video-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* Rozlíšenie druhu média v knižnici aj v dialógu nehnuteľnosti. */
.media-card { position: relative; }
.media-card-kind {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  padding: 2px 8px; border-radius: 999px;
  background: #07100dcc; color: #fff; font-size: 10px; font-weight: 750; letter-spacing: .04em;
}
.media-card-video .media-card-kind { background: #1f6f4a; }
.media-card-tour .media-card-kind { background: #7a5b1f; }
.media-thumb-video, .media-thumb-tour { color: #fff; }
.media-thumb-video { background: #16241d; }
.media-thumb-video span { font-size: 26px; }
.media-thumb-tour { background: #241d16; }
.media-thumb-tour span { font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.media-thumb-video small, .media-thumb-tour small { color: #ffffffb0; }

/* Pôdorys — sekcia v karte a rozlíšenie v knižnici médií. */
.gallery-plan .gallery-video-head { justify-content: flex-start; }
.gallery-plan .gallery-plan-add { margin-left: auto; }
.gallery-plan-list { display: grid; gap: 10px; }
.gallery-plan-list:empty { display: none; }
.gallery-plan-item {
  display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.gallery-plan-item.is-error { border-color: var(--danger); }
.gallery-plan-preview {
  display: grid; place-items: center; height: 118px;
  overflow: hidden; border-radius: 8px; background: #f2f6f8;
}
.gallery-plan-preview img { width: 100%; height: 100%; object-fit: contain; }
.media-card-floorplan .media-card-kind { background: #1f4a6f; }

/* Úprava odfoteného pôdorysu. */
.floorplan-dialog {
  width: min(96vw, 1100px); padding: 20px;
  border: 1px solid #ffffff55; border-radius: 18px; background: #fff; color: var(--ink);
  box-shadow: 0 26px 80px #07100d70;
}
.floorplan-dialog::backdrop { background: #07100de0; }
.floorplan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.floorplan-head h2 { font-size: 20px; }
.floorplan-stage {
  display: grid; place-items: center;
  max-height: 62vh; overflow: auto;
  border-radius: 12px; background: #eef2f4;
}
.floorplan-canvas { display: block; max-width: 100%; max-height: 62vh; object-fit: contain; }
.floorplan-bar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.floorplan-field { display: grid; gap: 4px; min-width: 240px; font-size: 12px; }
.floorplan-field input[type="range"] { width: 100%; padding: 0; accent-color: var(--brand); }
.floorplan-hint { margin: 8px 0 0; font-size: 13px; }
.floorplan-error { min-height: 18px; margin: 8px 0 0; }
.floorplan-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.floorplan-holder { position: relative; display: inline-block; line-height: 0; }
.floorplan-canvas { cursor: crosshair; touch-action: none; }
.floorplan-crop {
  position: absolute; pointer-events: none;
  border: 2px dashed #fff; outline: 2px dashed #07100d80;
  background: #b8e1eb26;
}
.floorplan-bar + .floorplan-bar { margin-top: 8px; }

/* Zostavenie porovnania „pred a po“. */
.gallery-compare .gallery-compare-add { margin-left: auto; }
.gallery-compare-list { display: grid; gap: 10px; }
.gallery-compare-list:empty { display: none; }
.gallery-compare-item {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.gallery-compare-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.gallery-compare-pair img {
  width: 100%; height: 82px; object-fit: cover;
  border-radius: 6px; background: #e8eef3;
}
.compare-builder-dialog {
  width: min(96vw, 1080px); padding: 22px;
  border: 1px solid #ffffff55; border-radius: 18px; background: #fff; color: var(--ink);
  box-shadow: 0 26px 80px #07100d70;
}
.compare-builder-dialog::backdrop { background: #07100de0; }
.compare-builder-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.compare-builder-head h2 { font-size: 20px; }
.compare-builder-hint { margin: 6px 0 14px; font-size: 13px; }
.compare-builder-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare-builder-cols h3 { margin: 0 0 8px; font-size: 14px; }
.compare-builder-strip {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px;
  max-height: 40vh; overflow-y: auto; padding-right: 4px;
}
.compare-builder-item {
  display: grid; gap: 4px; padding: 5px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-align: left;
}
.compare-builder-item.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px #b8e1eb; }
.compare-builder-item img { width: 100%; height: 74px; object-fit: cover; border-radius: 6px; background: #e8eef3; }
.compare-builder-item span { overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.compare-builder-bar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.compare-builder-field { display: grid; gap: 4px; font-size: 12px; }
.compare-builder-field select { width: auto; min-width: 240px; padding: 6px 8px; font-size: 13px; }
.compare-builder-state { font-size: 13px; }
.compare-builder-error { min-height: 18px; margin: 8px 0 0; }
.compare-builder-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
@media (max-width: 820px) { .compare-builder-cols { grid-template-columns: 1fr; } }

/* Zostavenie porovnania — opravy vzhľadu.
   Dlaždice sú <button>, takže preberali brandové pozadie a výber (brandový
   rámček) na ňom zanikol. Preto vyššia špecifickosť a jednoznačná značka ✓. */
.compare-builder-dialog { max-height: 92vh; display: flex; flex-direction: column; }
.compare-builder-dialog .compare-builder-cols { flex: 1 1 auto; min-height: 0; }
.compare-builder-dialog .compare-builder-strip {
  max-height: 34vh; align-content: start;
  padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafb;
}
.compare-builder-dialog .compare-builder-item {
  position: relative;
  background: #fff; color: var(--ink);
  border: 2px solid var(--line); box-shadow: none;
  cursor: pointer;
}
.compare-builder-dialog .compare-builder-item:hover { border-color: #bfd6df; background: #fff; }
.compare-builder-dialog .compare-builder-item.is-selected {
  border-color: var(--brand); background: #eaf6f9; box-shadow: 0 0 0 3px #b8e1eb;
}
.compare-builder-dialog .compare-builder-name { color: var(--ink); }
.compare-builder-tick {
  position: absolute; top: 6px; right: 6px; z-index: 1;
  display: none; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 800;
}
.compare-builder-item.is-selected .compare-builder-tick { display: grid; }

/* Hotové porovnania v spodnej časti okna. */
.compare-builder-done { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.compare-builder-done h3 { margin: 0 0 8px; font-size: 14px; }
.compare-builder-done-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px;
  max-height: 24vh; overflow-y: auto;
}
.compare-builder-done-list:empty { display: none; }
.compare-builder-done-item {
  display: grid; gap: 6px; padding: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.compare-builder-done-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.compare-builder-done-pair img { width: 100%; height: 68px; object-fit: cover; border-radius: 6px; background: #e8eef3; }
.compare-builder-done-meta { display: grid; gap: 5px; min-width: 0; }
.compare-builder-done-meta strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.media-card-visualization .media-card-kind { background: #6b3fa0; }
#room-visualizer-manual code {
  padding: 1px 5px; border-radius: 4px;
  background: #f2f6f8; color: var(--ink); font-size: 12px;
}

/* Ručný postup cez ChatGPT, keď automatická vizualizácia neprejde. */
.room-visualizer-manual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}
#room-visualizer-chatgpt-hint { font-size: 12px; line-height: 1.45; margin: 0 0 6px; }
#room-visualizer-manual textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #bfcbd5;
  border-radius: 8px;
  font: 12px/1.45 ui-monospace, Consolas, monospace;
  resize: vertical;
}

/* Ručný postup je v okne vždy, len zbalený — aby neprekážal a zároveň sa naň
   dalo siahnuť bez toho, aby maklér musel najprv naraziť na chybu. */
.room-visualizer-manual-box {
  margin: 10px 0 4px;
  padding: 10px 12px;
  border: 1px solid var(--line, #dce4eb);
  border-radius: 9px;
  background: #f8fafb;
}
.room-visualizer-manual-box > summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 13px;
  color: var(--brand-dark, #14513f);
  list-style-position: inside;
}
.room-visualizer-manual-box[open] > summary { margin-bottom: 9px; }
.room-visualizer-manual-box label { display: grid; gap: 5px; font-size: 13px; }

/* Pretiahnutie súborov na kartu nehnuteľnosti v Médiách. */
.media-property-group { position: relative; transition: box-shadow .12s ease, background .12s ease; }
.media-property-group.is-drop-target {
  outline: 2px dashed var(--brand, #247a60);
  outline-offset: 4px;
  background: var(--success-wash, #f0fbf4);
}
.media-property-group.is-drop-target::after {
  content: 'Pustite súbory sem — pridajú sa k tejto nehnuteľnosti';
  position: absolute;
  inset: auto 0 8px 0;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-dark, #14513f);
  pointer-events: none;
}
.media-property-group.is-uploading { opacity: .75; }
.media-drop-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.media-drop-status { margin: 8px 0 0; color: var(--brand-dark, #14513f); font-size: 13px; font-weight: 650; }

/* Hromadná vizualizácia — výber viacerých fotiek jednej miestnosti. */
#room-batch::backdrop { background: #0c2234c9; }
.room-batch-card { display: grid; gap: 11px; width: min(96vw, 860px); max-height: 92vh; overflow-y: auto; }
.room-batch-card p.muted { font-size: 13px; line-height: 1.45; }
.room-batch-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 9px;
  max-height: 260px;
  overflow-y: auto;
  padding: 9px;
  border: 1px solid var(--line, #dce4eb);
  border-radius: 9px;
  background: #f8fafb;
}
.room-batch-item { display: grid; gap: 4px; cursor: pointer; font-size: 11px; color: var(--muted); }
.room-batch-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 7px; background: #e8eef3; }
.room-batch-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-batch-item input { width: auto; justify-self: start; }
.room-batch-item:has(input:checked) img { outline: 3px solid var(--brand, #247a60); outline-offset: -3px; }
.room-batch-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.room-batch-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.room-batch-card textarea {
  width: 100%; padding: 9px 10px; border: 1px solid #bfcbd5; border-radius: 8px;
  font: 12px/1.45 ui-monospace, Consolas, monospace; resize: vertical;
}
@media (max-width: 640px) { .room-batch-row { grid-template-columns: 1fr; } }

/* Návrat hotových vizualizácií v hromadnom okne. */
.room-batch-return { display: grid; gap: 5px; font-size: 13px; padding: 10px 12px; border: 1px dashed var(--brand, #247a60); border-radius: 9px; background: var(--success-wash, #f0fbf4); }
#room-batch-return-status { margin: 0; color: var(--brand-dark, #14513f); font-weight: 650; font-size: 13px; }

/* Voľba, kto dopĺňa popisok „Vizualizácia“. */
.room-batch-caption { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.room-batch-caption input { width: auto; margin-top: 2px; }

/* Text úlohy — voľné pole vedľa pomôcky s prednastavenými predmetmi. */
#editor-fields textarea[name="description"] {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #bfcbd5;
  border-radius: 8px;
  font: inherit;
  resize: vertical;
  min-height: 68px;
}
#task-subject-picker { width: 100%; }

/* Priorita úlohy farebne — v zozname sa maklér rozhoduje podľa naliehavosti. */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: .22rem .55rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}
.priority-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.priority-badge--critical { background: #fee2e2; color: #991b1b; }
.priority-badge--high { background: #ffedd5; color: #9a3412; }
.priority-badge--normal { background: #e8eef3; color: #44525f; }
.priority-badge--low { background: #eef4ee; color: #5c6b5f; }
