*{box-sizing:border-box}body{margin:0;background:#f1f5f9;color:#17283b;font:15px system-ui,sans-serif}header{background:#142e48;color:white;padding:20px;position:sticky;top:0;z-index:2}header h1{margin:0;font-size:24px}header small{color:#b9d0e5}main{max-width:1100px;margin:auto;padding:16px}button,input,select,textarea{font:inherit;border:1px solid #cbd5e1;border-radius:9px;padding:11px;background:white;color:inherit}button{cursor:pointer}button.primary{background:#17674e;color:white;border:0}button.nav{background:#ffe04b;border:0}button.active{background:#142e48;color:white}input,textarea,select{max-width:100%}textarea{width:100%;min-height:75px} .bar{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.bar input{flex:1;min-width:180px}.stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.stat,article,.panel{background:white;border:1px solid #e0e6ed;border-radius:14px;padding:14px}.stat b{font-size:25px;display:block}.items{display:grid;grid-template-columns:repeat(auto-fit,minmax(275px,1fr));gap:10px}article h3{margin:7px 0;font-size:17px}article p{margin:7px 0;color:#526477}.tag{display:inline-block;padding:4px 8px;border-radius:20px;font-size:12px;color:white}dialog{border:0;border-radius:16px;width:min(94vw,560px);max-height:90vh;overflow:auto;padding:20px;box-shadow:0 10px 60px #0005}dialog::backdrop{background:#12253a99}label{display:block;margin:10px 0;font-size:13px;color:#526477}label input,label textarea,label select{display:block;width:100%;margin-top:4px;color:#17283b}a{color:#145c94}#map{height:420px;background:#e4ebf1;border-radius:12px}.mapFallback{height:100%;display:flex;align-items:center;justify-content:center;text-align:center;padding:24px;color:#526477;background:linear-gradient(180deg,#eef3f8,#e2e8f0);border:1px dashed #b8c6d6;border-radius:12px}.mapFallbackInner{max-width:520px}.mapFallbackInner b{display:block;color:#17283b;font-size:18px;margin-bottom:8px}.mapFallbackInner p{margin:6px 0}#map:empty:after{content:'Для отображения карты подключите API-ключ Яндекса';display:block;padding:30px;text-align:center} .muted{color:#64748b;font-size:13px} .hidden{display:none} .routeRow{display:flex;align-items:center;gap:8px;padding:8px;border-bottom:1px solid #ddd}.routeRow span{flex:1} @media(max-width:500px){header{padding:14px}main{padding:10px}.stat{padding:9px}.stat b{font-size:21px}}

.stat{text-align:left;min-width:0;cursor:pointer;color:#17283b}.stat[aria-pressed=true]{border-color:#285779;background:#e8f1f9;box-shadow:inset 0 0 0 1px #285779}.stat[data-stat=done] b{color:#16834f}.stat[data-stat=remaining] b{color:#a65016}.stat small{font-size:13px}.items article{cursor:pointer;transition:border-color .12s}.items article:focus-visible,.stat:focus-visible{outline:3px solid #397cb7;outline-offset:2px}.items article:hover{border-color:#8ba9c5}.items article .bar{margin:10px 0 0}.items article h3{padding-right:15px;position:relative}.items article h3:after{content:'›';position:absolute;right:0;color:#64748b}.picked{background:#e7f4ec;border-color:#16834f;color:#14633e}#map:empty:after{content:none}#map{height:clamp(340px,60vh,650px);overflow:hidden}#map iframe{border:0;width:100%;height:100%;display:block}.mapHelp{margin:8px 0 12px;padding:12px;background:white;border:1px solid #dce4eb;border-radius:12px}.mapHelp p{margin:6px 0}.mapHelp a{display:inline-block;padding:8px 0}.mapLegend{display:flex;gap:10px;flex-wrap:wrap;font-size:12px;margin:9px 0}.mapLegend i{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:4px}.mapMessage{padding:24px;text-align:center}.mapHelp input{width:100%}@media(max-width:500px){.stat small{font-size:12px}.stat{padding:9px 7px}.items article{padding:13px}header{position:static}.items{grid-template-columns:1fr}}

.objectFields{margin:12px 0}.objectFields dt{font-size:12px;color:#64748b;margin:12px 0 3px}.objectFields dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.doneToggle{background:white;color:#111827;border:1px solid #111827;font-weight:650}.doneToggle.completed{background:#16834f;color:white;border-color:#16834f}.editDetails{border-top:1px solid #dce4eb;padding:12px 0;margin:10px 0}.editDetails summary{cursor:pointer;font-weight:600}.diagRow{border-top:1px solid #e0e6ed;padding:10px 0}.diagRow p{margin:4px 0;overflow-wrap:anywhere}.diagRow button{margin:4px 4px 0 0}.diagnostics summary{cursor:pointer;font-weight:600}.diagnostics{margin:10px 0}.warningText{color:#93520b}.mapGroupButton{display:block;text-align:left;width:100%;margin:5px 0}#visitNote{min-height:55px}.objectSection{margin:14px 0}.sectionLabel{font-size:12px;color:#64748b;margin-bottom:4px}.sectionValue{font-size:18px;line-height:1.35;white-space:pre-wrap;overflow-wrap:anywhere}.objectHeadRow{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.sectionActions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;min-width:min(44%,240px)}.sectionActions button{flex:1 1 110px}.contactValue a{font-weight:600}.contactValue{font-size:17px}@media(max-width:560px){.objectHeadRow{flex-direction:column}.sectionActions{width:100%;min-width:0;justify-content:flex-start}.sectionActions button{flex:1 1 140px}}

.stats{gap:6px}.stat{padding:6px 9px;border-radius:9px;display:flex;align-items:center;justify-content:space-between;gap:5px;min-height:38px}.stat small{font-size:12px;line-height:1.15}.stat b{font-size:18px;line-height:1.15}.periodButtons{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:8px 0}.periodBtn{padding:9px 6px;font-size:14px;font-weight:600;min-height:40px}.periodBtn.monthly{color:#a94c0b;border-color:#ea7622;background:#fff5e9}.periodBtn.quarterly{color:#6935b1;border-color:#8747d9;background:#f6efff}.periodBtn.monthly[aria-pressed=true]{color:white;background:#b65311;border-color:#b65311}.periodBtn.quarterly[aria-pressed=true]{color:white;background:#7432c4;border-color:#7432c4}.periodBtn:focus-visible{outline:3px solid #397cb7;outline-offset:2px}@media(max-width:500px){.stat{padding:6px 5px;gap:3px}.stat small{font-size:11px}.stat b{font-size:16px}}@media(max-width:350px){.stat{flex-direction:column;justify-content:center}}

/* Explicit light palette: prevent inherited dark-dialog colours on Android. */
:root{color-scheme:only light;background:#f1f5f9;color:#17283b}
body{color-scheme:only light;background:#f1f5f9;color:#17283b}
button,input,select,textarea{color-scheme:only light;background-color:#fff;color:#17283b}
input::placeholder,textarea::placeholder{color:#526477;opacity:1}
button.primary,button.active{color:#fff}
button.nav{background:#ffe04b;color:#17283b}
dialog#dlg{color-scheme:only light;background:#fff;color:#17283b}
#dlg h2,#dlg h3,#dlg summary,#dlg .objectFields dd{color:#17283b}
#dlg .objectFields dt,#dlg label,#dlg .muted{color:#526477}
#dlg button,#dlg input,#dlg select,#dlg textarea{background:#fff;color:#17283b;border:1px solid #b7c3d1}
#dlg button.nav{background:#ffe04b;color:#17283b;border-color:#d5b530}
#dlg button.doneToggle{background:#fff;color:#111827;border-color:#111827}
#dlg button.doneToggle.completed{background:#16834f;color:#fff;border-color:#16834f}
#dlg .tag{color:#fff;align-self:center}
#dlg #closeDlg{min-width:42px;min-height:42px;line-height:1;font-size:20px;font-weight:600}
#dlg .bar{align-items:center}
#dlg a{color:#145c94}
#dlg button:focus-visible,#dlg summary:focus-visible{outline:3px solid #397cb7;outline-offset:2px}

/* Settings stays in the header layout on every screen size. */
header{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:12px;align-items:center;padding-right:20px}
header .headerText{min-width:0}
header .headerText small{display:block;line-height:1.35}
header .settingsGear{position:static;transform:none;width:44px;height:44px;display:grid;place-items:center;padding:0;background:#ffe04b!important;color:#142e48!important;border:1px solid #ffe04b;border-radius:10px;align-self:start;justify-self:end;color-scheme:only light;forced-color-adjust:none}
header .settingsGear svg{display:block;stroke:#142e48!important;fill:none;pointer-events:none}
header .settingsGear.active{background:#fff!important;border-color:#ffe04b;box-shadow:inset 0 0 0 2px #ffe04b}
header .settingsGear:focus-visible{outline:2px solid #fff;outline-offset:3px}
@media(max-width:500px){header{padding:14px;gap:10px}header .headerText small{font-size:12px}}
.mapPeriods{grid-template-columns:repeat(3,minmax(0,1fr))}.mapPeriods button{min-width:0;padding:9px 3px;font-size:12px;overflow-wrap:normal}.mapPeriods .all[aria-pressed=true]{background:#142e48;color:#fff;border-color:#142e48}.mapCheck{padding:10px;border:1px solid #dce4eb;border-radius:9px;background:#f8fafc;overflow-wrap:anywhere}.mapCheck p{margin:5px 0}.mapCheck strong{color:#17283b}
#mapHelpText:empty{display:none}#mapView .mapPeriods{margin-top:0}
/* Route points use the same object dialog as the main list. */
#routeItems .routeRow{padding:8px;border:1px solid #dce4eb;border-radius:12px;margin:8px 0;background:#fff;gap:6px;align-items:center}
#routeItems .routeOpen{flex:1;min-width:0;display:flex;gap:9px;align-items:center;text-align:left;padding:8px 5px;background:#fff;color:#17283b;border:0;border-radius:7px}
#routeItems .routeOpen:hover{background:#f1f5f9}#routeItems .routeOpen:focus-visible{outline:2px solid #397cb7;outline-offset:1px}
#routeItems .routeNumber{flex:0 0 26px;text-align:center;font-size:16px}
#routeItems .routeText{flex:1;min-width:0;overflow-wrap:anywhere}#routeItems .routeText strong{display:block;font-size:15px;line-height:1.3}#routeItems .routeText small{display:block;color:#526477;margin-top:3px;line-height:1.3}#routeItems .routeStatus{display:block;font-size:11px;font-weight:600;margin-top:4px}#routeItems .routeChevron{flex:0 0 auto;color:#64748b;font-size:23px}
#routeItems .routeControls{display:flex;gap:4px;flex-shrink:0}#routeItems .routeControls button{padding:0;width:40px;min-height:44px;color:#17283b;background:#fff}#routeItems .routeControls button:disabled{opacity:.35;cursor:default}
@media(max-width:520px){#routeItems .routeRow{flex-wrap:wrap}#routeItems .routeOpen{flex:1 1 100%}#routeItems .routeControls{margin-left:auto}#routeItems .routeControls button{width:44px}}

.routeDateBar{display:flex;align-items:end;gap:8px;flex-wrap:wrap;margin:8px 0}.routeDateBar label{flex:1;min-width:145px;margin:0}.routeDateBar button{min-height:44px}.plannedDays{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0 12px}.plannedDays button{padding:7px 10px;font-size:13px}.plannedDays button[aria-pressed=true]{background:#142e48;color:white}.routeNotice{font-size:13px;color:#526477;margin:4px 0 10px}#routeItems .routeControls{flex-wrap:wrap;justify-content:flex-end;max-width:100%}#routeItems .routeControls .moveDate{width:auto;padding:8px 10px;font-size:13px;white-space:normal;flex:0 1 auto;color:#145c94;border-color:#94b4ce}#moveDlg{background:#fff;color:#17283b}#moveDlg h2{margin-top:0}#moveDlg .bar{justify-content:flex-end}#routeDayHint[hidden],#plannedDays[hidden],#routeNotice[hidden]{display:none}

.routeLaunchStatus{padding:10px 12px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#17283b;margin:8px 0;font-size:14px;overflow-wrap:anywhere}.routeLaunchStatus[hidden],#startNavigator[hidden]{display:none}.routeLaunchStatus a{display:inline-block;margin:8px 10px 0 0;color:#145c94;font-weight:600}.routeLaunchStatus.error{border-color:#d97706}.routeLaunchStatus p{margin:4px 0}.routeLaunchStatus button{margin-top:8px}
#routeItems .routeRow{min-width:0}#routeItems .routeControls{display:flex;flex-wrap:nowrap;gap:4px;max-width:100%;min-width:0;align-items:center}#routeItems .routeControls button{flex:0 0 40px;width:40px;min-height:44px;padding:0}#routeItems .routeControls .moveDate{flex:1 1 auto;min-width:62px;width:auto;white-space:nowrap;padding:4px 6px;font-size:13px}@media(max-width:520px){#routeItems .routeControls{width:100%;margin-left:0}#routeItems .routeControls button{flex-basis:40px;width:40px}#routeItems .routeRow{padding:8px}#routeItems .routeOpen{min-width:0}}@media(max-width:340px){#routeItems .routeControls button{flex-basis:34px;width:34px}#routeItems .routeControls .moveDate{min-width:54px;font-size:12px}}

#routeItems .routeRow{flex-wrap:wrap}#routeItems .routeOpen{flex:1 1 100%}#routeItems .routeControls{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,.8fr) repeat(3,minmax(32px,40px));gap:4px;width:100%;margin-left:0;align-items:center}#routeItems .routeControls button,#routeItems .routeControls .moveDate{width:100%;min-width:0;min-height:44px;padding:4px;font-size:12px;white-space:nowrap}#routeItems .routeControls .notifyBtn{color:#145c94;border-color:#94b4ce}#notifyDlg{background:#fff;color:#17283b}#notifyDlg h2{margin-top:0}#notifyDlg .bar{justify-content:flex-end}#notifyDlg .notifyScript{padding:10px;border:1px solid #dce4eb;border-radius:8px;white-space:pre-wrap;overflow-wrap:anywhere}#notifyDlg .notifyWarning{color:#93520b}#notifyDlg select{width:100%}

header{grid-template-columns:minmax(0,1fr) 40px;align-items:center}header .brand{display:flex;align-items:center;gap:10px;min-width:0}header .brandMark{width:42px;height:42px;flex:none;display:block;object-fit:contain;background:#fff;border-radius:4px}header .settingsGear{width:40px;height:40px;border-radius:9px;align-self:center}header .settingsGear svg{width:21px;height:21px}.routeLaunchStatus a.navLaunchLink{display:block;text-align:center;padding:11px 8px;border-radius:9px;background:#ffe04b;color:#142e48;text-decoration:none;margin:10px 0 0}.routeLaunchStatus a.navLaunchLink:focus-visible{outline:2px solid #142e48;outline-offset:2px}@media(max-width:500px){header .brandMark{width:36px;height:36px}header .brand{gap:8px}header h1{font-size:21px}}

#routeItems .routeControls{grid-template-columns:repeat(2,minmax(0,1fr)) minmax(0,1.35fr) repeat(3,minmax(0,.8fr));gap:4px}
#routeItems .routeControls button{display:flex;align-items:center;justify-content:center;min-height:44px;padding:3px;line-height:1;font-size:16px}
#routeItems .routeControls button svg{display:block;flex:none;pointer-events:none}
#routeItems .routeControls .smsBtn{color:#145c94;background:#e8f3ff;border-color:#95b9de}
#routeItems .routeControls .callBtn{color:#157443;background:#e7f6ec;border-color:#95c7aa}
#routeItems .routeControls .moveDate{font-size:12px;padding:2px;white-space:nowrap}
#routeItems .routeControls button:focus-visible{outline:2px solid #285779;outline-offset:1px}
[hidden]{display:none!important}
.signin{max-width:440px;margin:36px auto}
.syncBar{display:flex;justify-content:space-between;gap:6px;align-items:center;margin:0 0 10px;color:#526477;font-size:13px}
.syncBar button{padding:6px 8px;font-size:13px}
.check{display:flex;gap:8px;align-items:center}.check input{width:auto;margin:0}
#conflict{margin:10px 0}pre{white-space:pre-wrap;overflow-wrap:anywhere}
.employee{border-top:1px solid #dce4eb;padding:8px 0}
#visitNote{width:100%}
#historyItems p{white-space:pre-wrap;overflow-wrap:anywhere}
.mapList{height:100%;overflow:auto;padding:8px}
