:root{
 --bg:#f4f7f5;--ink:#14251d;--muted:#75847c;--line:#e4ebe6;--green:#16734f;--green-dark:#10583d;--purple:#8152c7;
 --green-soft:#e8f4ed;--white:#fff;--amber:#b7791f;--red:#b83232;--shadow:0 18px 50px rgba(25,55,40,.08);
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,"Segoe UI",Arial,sans-serif}
.app-bg{position:fixed;inset:0;pointer-events:none;background:radial-gradient(ellipse at 12% 12%,rgba(39,132,91,.09),transparent 35%),radial-gradient(ellipse at 90% 4%,rgba(117,155,131,.10),transparent 30%)}
.shell{position:relative;max-width:1580px;margin:auto;padding:0 34px 32px}
.topbar{height:82px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);margin-bottom:34px}
.brand{display:flex;align-items:center;gap:13px;letter-spacing:1.5px}
.brand-icon{width:42px;height:42px;border-radius:14px;background:linear-gradient(145deg,#1c7652,#10452f);color:#fff;display:grid;place-items:center;font-weight:850;font-size:21px;box-shadow:0 8px 20px rgba(22,115,79,.2)}
.brand b{font-size:14px;letter-spacing:2px}.brand small{display:block;color:#8b9891;font-size:9px;letter-spacing:2px;margin-top:4px}
.header-user{color:var(--muted);font-size:12px;font-weight:600}
.auth-layout{min-height:72vh;display:grid;grid-template-columns:1.15fr .85fr;align-items:center;gap:8vw;max-width:1150px;margin:0 auto;padding:10px 0 60px}
.intro h1,.welcome-row h1{font-size:clamp(38px,5vw,60px);line-height:1.04;letter-spacing:-2.5px;margin:17px 0}
.intro h1 em{font-style:normal;color:var(--green)}
.intro p{color:var(--muted);font-size:15px;line-height:1.8;max-width:570px}
.eyebrow,.section-kicker{font-size:9px;font-weight:850;letter-spacing:2.2px;color:var(--green)}
.feature-row{display:flex;gap:9px;flex-wrap:wrap;margin-top:25px}
.feature-row span{background:#fff;border:1px solid var(--line);border-radius:30px;padding:9px 12px;font-size:10px;color:#456353;font-weight:650}
.privacy-note{margin-top:27px;background:#e8f4ed;color:#275b43;padding:15px 17px;border-radius:12px;font-size:12px;line-height:1.6;max-width:550px}
.panel{background:rgba(255,255,255,.96);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:23px}
.auth-panel{max-width:440px;width:100%;justify-self:end;padding:30px}
.form-mark{width:39px;height:39px;border-radius:12px;background:var(--green-soft);color:var(--green);display:grid;place-items:center;font-size:20px;margin-bottom:18px}
.panel h2{font-size:17px;margin:0 0 6px;letter-spacing:-.3px}
.muted{color:var(--muted);font-size:11px;line-height:1.6;margin:5px 0 16px}
label{display:block;font-size:11px;font-weight:700;color:#53645b;margin:15px 0}
input,select{display:block;width:100%;border:1px solid #dfe8e2;background:#fbfdfb;border-radius:10px;padding:13px 14px;margin-top:7px;font:inherit;font-size:13px;color:var(--ink);outline:none;transition:.18s}
input:focus,select:focus{border-color:#63a889;box-shadow:0 0 0 3px #e6f4eb;background:#fff}
button{font:inherit;cursor:pointer;border:0;border-radius:10px;padding:12px 15px;font-weight:750;transition:transform .15s,background .15s,box-shadow .15s}
button:active{transform:translateY(1px)}
.primary{background:linear-gradient(135deg,#197b54,#125d40);color:#fff;width:100%;margin-top:12px;box-shadow:0 7px 16px rgba(22,115,79,.15)}
.primary:hover{background:var(--green-dark);box-shadow:0 9px 20px rgba(22,115,79,.22)}
.secondary{background:#edf3ef;color:#315342}.secondary:hover{background:#e1ece5}
.danger{background:#fff0ee;color:#a3312c;width:100%;margin-top:9px}
.hidden{display:none!important}
.error{color:var(--red);font-size:11px;min-height:18px;margin-top:12px;line-height:1.5}
.auth-switch{text-align:center;color:var(--muted);font-size:11px;margin:19px 0 0}
.text-button{background:none;color:var(--green);padding:0;font-size:11px;font-weight:800}
.welcome-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}
.welcome-row h1{font-size:31px;margin:7px 0 4px;letter-spacing:-1px}
.welcome-row .muted{margin:0}
.content-grid{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(315px,.78fr);gap:19px;align-items:start}
.map-panel{padding:0;overflow:hidden}
.panel-head{display:flex;justify-content:space-between;align-items:center;padding:20px 22px 15px;gap:15px}
.panel-head h2{margin-top:5px}.panel-head .muted{margin:4px 0 0}
.panel-head.compact{padding:0 0 12px}
.layer-control{min-width:155px;margin:0;font-size:8px;letter-spacing:1.4px;color:#718078}
.layer-control select{margin-top:6px;padding:10px 12px;font-size:12px;letter-spacing:0;color:#263b30}
#map{height:650px;width:100%;background:#e8eeea}
.legend{display:flex;gap:19px;flex-wrap:wrap;padding:14px 20px;color:var(--muted);font-size:10px}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px}
.green{background:#1c9a65}.gray{background:#9aa7a0}.amber{background:#d99b34}
.side-column{display:flex;flex-direction:column;gap:16px}
.sharing-status{background:#f2f6f3;padding:13px 14px;border-radius:10px;font-size:12px;font-weight:650;margin:5px 0 10px;color:#617168}
.sharing-status.active{background:#e8f5ee;color:#176e4c}
.small{font-size:10px}
.people-list{display:flex;flex-direction:column;gap:0}
.person{display:flex;align-items:center;gap:10px;padding:12px 0;border-top:1px solid #edf1ee;cursor:pointer}
.person:hover .person-name{color:var(--green)}
.avatar{width:36px;height:36px;border-radius:12px;background:#e9f0eb;color:#35644c;display:grid;place-items:center;font-size:11px;font-weight:850;flex-shrink:0}
.person-main{min-width:0;flex:1}
.person-name{font-size:11px;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.person-meta{font-size:9px;color:var(--muted);margin-top:4px}
.state{font-size:9px;padding:6px 8px;border-radius:20px;background:#f0f2f1;color:#69766f;white-space:nowrap}
.state.online{background:#e7f5ed;color:#18734e}.state.stale{background:#fff4df;color:#9a681c}
.icon-btn{padding:6px 10px;background:#f0f4f1;color:#41604f;font-size:18px}
.admin-panel{border-color:#d2e5d9;background:linear-gradient(145deg,#fff,#f8fcf9)}
.full{width:100%}
.footer-note{text-align:center;color:#8a968f;font-size:10px;margin:22px 0}
@media(max-width:980px){.auth-layout{grid-template-columns:1fr;gap:25px;padding:20px 0 40px}.auth-panel{justify-self:stretch;max-width:none}.intro h1{font-size:42px}.content-grid{grid-template-columns:1fr}.side-column{display:grid;grid-template-columns:1fr 1fr}.admin-panel{grid-column:1/-1}#map{height:540px}}
@media(max-width:620px){.shell{padding:0 14px 20px}.topbar{height:70px;margin-bottom:18px}.header-user{font-size:10px}.auth-layout{padding-top:12px}.intro h1{font-size:36px}.intro p{font-size:13px}.auth-panel{padding:22px}.side-column{display:flex}.welcome-row{align-items:flex-start;gap:12px}.welcome-row h1{font-size:25px}.welcome-row .secondary{font-size:10px;padding:10px}#map{height:430px}.panel{padding:17px}.panel-head{padding:17px}.layer-control{min-width:120px}.legend{gap:10px;font-size:9px}}

.map-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 20px 14px;flex-wrap:wrap}
.map-search{display:flex;gap:7px;flex:1;min-width:230px}
.map-search input{margin:0;max-width:420px;background:#f8fbf9;padding:10px 12px;font-size:11px}
.map-search button{padding:10px 14px;font-size:10px}
.marker-fio-search{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:1 0 100%;min-width:0;margin-top:1px}
.marker-fio-search-controls{display:flex;align-items:center;gap:7px;flex:1;min-width:0}
.marker-fio-search-controls input{flex:1;min-width:160px;max-width:520px;margin:0;padding:10px 12px;border:1px solid #dce7df;border-radius:9px;background:#f8fbf9;color:#24352b;font-size:11px}
.marker-fio-search-controls button{padding:10px 13px;font-size:10px;white-space:nowrap}
.marker-fio-search-info{font-size:10px;color:var(--muted);white-space:nowrap}
.map-actions{display:flex;gap:7px}
.map-tool-btn{background:#edf3ef;color:#365a47;padding:10px 12px;font-size:10px}
.map-tool-btn:hover{background:#e0ece4}
.auto-gps{display:flex;align-items:center;gap:8px;background:#f6f9f7;padding:10px 11px;border-radius:9px;font-size:10px;line-height:1.4;margin:9px 0 12px}
.auto-gps input{display:inline-block;width:15px;height:15px;margin:0;padding:0;border:0;box-shadow:none;accent-color:#16734f;flex-shrink:0}
.admin-users-list{margin-top:12px}
.admin-user-row{display:flex;align-items:center;justify-content:space-between;gap:9px;padding:11px 0;border-top:1px solid #eaf0ec}
.admin-user-info{display:flex;flex-direction:column;gap:4px;min-width:0}
.admin-user-info b{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.admin-user-info small{font-size:9px;color:var(--muted)}
.mini-danger,.mini-secondary{font-size:9px;padding:7px 9px;white-space:nowrap}
.mini-danger{background:#fff0ee;color:#a3312c}
.mini-secondary{background:#e9f4ed;color:#176e4c}
button:disabled{opacity:.55;cursor:wait}
@media(max-width:620px){.map-tools{padding:0 14px 12px}.map-search{min-width:100%}.map-search input{min-width:0}.map-actions{width:100%}.map-tool-btn{flex:1}.marker-fio-search{align-items:stretch;flex-direction:column}.marker-fio-search-controls{width:100%;flex-wrap:wrap}.marker-fio-search-controls input{flex:1 0 100%;max-width:none}.marker-fio-search-controls button{flex:1}.marker-fio-search-info{white-space:normal}.admin-user-row{align-items:flex-start}}

.dot.red{background:#df3f3a}.legend-hint{color:#7a8981}.marker-add-btn.placing{background:#176e4c;color:#fff;box-shadow:0 0 0 3px #d8eee2}

/* Физ.Розыск Новигатор  — dashboard refinements */
.brand b{font-size:13px;letter-spacing:1.25px}
.brand small{letter-spacing:1.55px}
.brand-icon{font-size:13px;letter-spacing:-.5px;background:linear-gradient(145deg,#8152c7,#493078);box-shadow:0 8px 20px rgba(91,58,143,.22)}
.dot.purple{background:#8b5cf6}
.stats-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 18px}
.stat-card{background:rgba(255,255,255,.96);border:1px solid var(--line);border-radius:14px;padding:14px 16px;box-shadow:0 8px 25px rgba(25,55,40,.045);display:flex;flex-direction:column;gap:5px;min-width:0}
.stat-card span{font-size:10px;color:#64746b;font-weight:700}
.stat-card strong{font-size:25px;letter-spacing:-1px;color:#1b2e24}
.stat-card small{font-size:9px;color:#89958e}
button:focus-visible,.person:focus-visible{outline:3px solid rgba(129,82,199,.3);outline-offset:2px}
@media(max-width:760px){.stats-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.stat-card{padding:12px}.stat-card strong{font-size:21px}}
@media(max-width:420px){.brand b{font-size:10px}.brand small{font-size:8px}.brand-icon{width:38px;height:38px}}

/* Русскоязычная географическая справка */
.place-info{margin:0 16px 10px;padding:17px 19px;background:linear-gradient(145deg,#fff,#faf8ff);border-color:#e7e0f2;box-shadow:none}
.place-info-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.place-info h3{font-size:16px;margin:5px 0 0;color:#253329}
.place-kind{display:inline-flex;align-items:center;border-radius:20px;background:#f0eafa;color:#69439e;padding:6px 10px;font-size:9px;font-weight:750;white-space:nowrap}
.place-address{font-size:11px;color:#5c6d62;line-height:1.55;margin:10px 0}
.place-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px;margin:10px 0}
.place-fact{display:flex;flex-direction:column;gap:4px;background:#f6f8f6;border:1px solid #edf0ed;border-radius:9px;padding:9px 10px;min-width:0}
.place-fact span{font-size:9px;color:#829087}
.place-fact b{font-size:11px;color:#293d30;overflow-wrap:anywhere}
.place-description{font-size:11px;line-height:1.65;color:#64746b;margin:9px 0 4px}
.place-wiki{font-size:10px;font-weight:750;color:#69439e;text-decoration:none}
.place-wiki:hover{text-decoration:underline}
@media(max-width:620px){.place-info{margin:0 10px 10px;padding:14px}.place-info-head{flex-direction:column;gap:7px}}

/* Premium authentication and dashboard polish */
:root{--ink:#17251e;--green:#176b49;--line:#e5ece7}
body{background:#f3f6f4;color:var(--ink)}
.app-bg{background:radial-gradient(ellipse at 12% 8%,rgba(111,79,170,.10),transparent 34%),radial-gradient(ellipse at 88% 22%,rgba(37,137,94,.09),transparent 32%)}
.shell{max-width:1540px}
.topbar{border-bottom:1px solid rgba(220,230,223,.8)}
.brand-icon{border-radius:14px;width:46px;height:46px;font-weight:900}
.auth-layout{gap:clamp(34px,7vw,110px);min-height:calc(100vh - 110px);align-items:center;padding-top:35px;padding-bottom:55px}
.intro{max-width:650px}
.intro .eyebrow,.eyebrow,.section-kicker{letter-spacing:2px;font-weight:850}
.intro h1{font-size:clamp(42px,5.3vw,70px);line-height:1.03;letter-spacing:-2.6px;margin:18px 0 20px}
.intro h1 em{font-style:normal;background:linear-gradient(100deg,#7651ad,#176b49);-webkit-background-clip:text;background-clip:text;color:transparent}
.intro p{font-size:15px;line-height:1.85;max-width:590px;color:#63736a}
.feature-row{display:flex;flex-wrap:wrap;gap:9px;margin:28px 0}
.feature-row span,.auth-benefits span{padding:10px 13px;border:1px solid #e3eae5;border-radius:30px;background:rgba(255,255,255,.75);font-size:11px;font-weight:750;color:#456252}
.privacy-note{max-width:570px;padding:16px 18px;border:1px solid #dcebe1;border-radius:15px;background:linear-gradient(120deg,#f1f8f3,#faf8ff);font-size:12px;line-height:1.7;color:#456252}
.auth-panel{width:min(100%,460px);padding:34px;border:1px solid rgba(221,230,224,.9);border-radius:24px;box-shadow:0 24px 70px rgba(31,55,41,.10);background:rgba(255,255,255,.96);backdrop-filter:blur(16px)}
.auth-panel h2{font-size:25px;letter-spacing:-.7px;margin:10px 0 8px}
.auth-panel .muted{font-size:12px;line-height:1.7;margin-bottom:23px}
.form-mark{width:46px;height:46px;border-radius:15px;display:grid;place-items:center;background:linear-gradient(145deg,#f0eafa,#e9f5ed);color:#654394;font-size:22px;font-weight:800}
.auth-panel label{display:block;font-size:11px;font-weight:800;color:#53645a;margin:15px 0}
.auth-panel input{width:100%;margin-top:8px;padding:14px 15px;border:1px solid #e0e8e2;border-radius:12px;background:#f9fbf9;font-size:13px;transition:.2s}
.auth-panel input:focus{outline:none;border-color:#8d72b4;box-shadow:0 0 0 4px rgba(129,82,199,.10);background:#fff}
.auth-panel button.primary{width:100%;padding:14px 16px;border-radius:12px;font-size:13px;font-weight:850;box-shadow:0 8px 18px rgba(23,107,73,.16);margin-top:9px}
.auth-panel button.primary:hover{transform:translateY(-1px);filter:brightness(1.04)}
.auth-benefits{display:flex;gap:7px;flex-wrap:wrap;margin:-8px 0 18px}
.auth-benefits span{font-size:9px;padding:7px 9px;background:#f7faf8}
.form-hint{padding:12px 14px;background:#f5f8f6;border-radius:11px;border:1px solid #e8eee9;font-size:10px;line-height:1.6;color:#66766d;margin:16px 0 7px}
.auth-switch{font-size:12px!important;margin-top:20px!important}
.error{font-size:11px}
.panel,.stat-card{border-radius:17px;box-shadow:0 8px 28px rgba(27,52,38,.045)}
#map{border-top:1px solid #edf1ee}
@media(max-width:980px){.auth-layout{min-height:0}.auth-panel{max-width:520px;justify-self:center}}
@media(max-width:620px){.auth-panel{padding:23px;border-radius:19px}.intro h1{letter-spacing:-1.7px}.feature-row{margin:19px 0}.auth-layout{gap:20px}}

/* Admin roles and account management */
.admin-create-form{display:grid;grid-template-columns:1fr 1fr;gap:8px 12px;padding:14px;margin:14px 0;border:1px solid #e3ebe5;border-radius:13px;background:#fbfdfb}
.admin-create-form h3{grid-column:1/-1;margin:0 0 4px;font-size:13px}
.admin-create-form label{display:flex;flex-direction:column;gap:6px;font-size:10px;font-weight:750;color:#53645a}
.admin-create-form input,.admin-create-form select,.admin-role-select{width:100%;min-width:0;padding:10px;border:1px solid #dfe8e1;border-radius:9px;background:#fff;color:#26352c;font:inherit;font-size:11px}
.admin-create-form button{grid-column:1/-1}
.admin-list-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px}
.admin-list-head h3{font-size:13px;margin:0}
.admin-user-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.admin-role-select{max-width:180px}
@media(max-width:620px){.admin-create-form{grid-template-columns:1fr}.admin-create-form h3,.admin-create-form button{grid-column:1}.admin-user-row{flex-direction:column}.admin-user-actions{width:100%;justify-content:flex-start}.admin-role-select{max-width:100%}}


/* Team chat: high-visibility message window and composer */
.chat-panel{margin:0 0 18px;padding:22px 24px;background:#fff}
.chat-head{margin-bottom:16px;align-items:center}
.chat-head h2{font-size:20px}
.chat-layout{display:grid;grid-template-columns:minmax(210px,260px) minmax(0,1fr);gap:16px;min-height:470px}
.chat-sidebar{padding:15px;border:1px solid #dce6df;border-radius:14px;background:#f6f9f7}
.chat-sidebar label{display:flex;flex-direction:column;gap:8px;font-size:12px;font-weight:800;color:#405448;margin:0}
.chat-sidebar select{width:100%;padding:13px;border:1px solid #cbd9cf;border-radius:10px;background:#fff;color:#172a20;font:inherit;font-size:13px;min-height:46px}
.chat-privacy{margin-top:14px;padding:12px;border-radius:10px;background:#f0eafa;color:#59417c;font-size:11px;line-height:1.65}
.chat-main{display:flex;flex-direction:column;min-width:0;min-height:470px}
.chat-messages{height:360px;min-height:280px;flex:1;overflow:auto;display:flex;flex-direction:column;gap:11px;padding:18px;border:1px solid #d9e3dc;border-radius:14px;background:#f7faf8;scroll-behavior:smooth}
.chat-message{max-width:min(84%,680px);align-self:flex-start;padding:12px 15px;border:1px solid #dce6df;border-radius:14px 14px 14px 4px;background:#fff;overflow-wrap:anywhere;box-shadow:0 2px 7px rgba(20,45,30,.045)}
.chat-message.own{align-self:flex-end;background:#f1eaff;border-color:#d9c9f3;border-radius:14px 14px 4px 14px}
.chat-message-meta{display:flex;gap:14px;align-items:center;justify-content:space-between;color:#66766d;font-size:11px}
.chat-message-meta b{color:#263c2e}.chat-message-meta time{font-size:10px;white-space:nowrap}
.chat-message p{margin:7px 0 0;color:#172a20;font-size:14px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.chat-empty{margin:auto;text-align:center;font-size:13px;color:#64746b}
.chat-compose{display:flex;gap:12px;margin-top:12px;align-items:flex-end;padding:13px;border:1px solid #d9e3dc;border-radius:14px;background:#fff;box-shadow:0 5px 18px rgba(20,45,30,.055)}
.chat-input-wrap{display:flex;flex:1;min-width:0;flex-direction:column;gap:7px;margin:0;color:#52665a}
.chat-input-label{font-size:10px;font-weight:850;letter-spacing:1.2px;color:#53685b}
.chat-compose textarea{display:block;width:100%;min-width:0;min-height:76px;max-height:190px;resize:vertical;margin:0;padding:13px 14px;border:1.5px solid #cbd9cf;border-radius:11px;background:#fff;color:#14251d!important;-webkit-text-fill-color:#14251d;caret-color:#16734f;font:500 14px/1.55 Inter,"Segoe UI",Arial,sans-serif;outline:none;box-shadow:none;opacity:1}
.chat-compose textarea::placeholder{color:#849289;opacity:1;-webkit-text-fill-color:#849289}
.chat-compose textarea:focus{border-color:#8152c7;box-shadow:0 0 0 4px rgba(129,82,199,.13);background:#fff}
.chat-input-hint{font-size:10px;color:#829087}
.chat-send-btn{display:flex;align-items:center;justify-content:center;gap:9px;min-width:142px;min-height:48px;padding:13px 18px;margin:0 0 2px;border-radius:11px;background:linear-gradient(135deg,#8152c7,#5d3696);color:#fff;font-size:13px;font-weight:800;box-shadow:0 7px 16px rgba(91,54,150,.2)}
.chat-send-btn:hover{background:linear-gradient(135deg,#7042b5,#4d2b83)}
.chat-send-btn span{font-size:16px}
.chat-send-btn:disabled{opacity:.55;cursor:wait}
#chatError{margin:8px 2px 0}
@media(max-width:700px){.chat-panel{padding:15px}.chat-layout{grid-template-columns:1fr;min-height:0}.chat-sidebar{padding:11px}.chat-main{min-height:0}.chat-messages{height:44vh;min-height:260px;max-height:480px;padding:12px}.chat-compose{flex-direction:column;align-items:stretch;padding:10px}.chat-compose textarea{min-height:88px;font-size:16px}.chat-send-btn{width:100%;min-height:48px}.chat-message{max-width:96%}.chat-message p{font-size:14px}.chat-head{align-items:flex-start}}
/* Оптимизированные автомобильные маркеры сотрудников */
.employee-car-marker{background:transparent!important;border:0!important;overflow:visible!important}
.employee-car-pin{display:grid;place-items:center;width:36px;height:48px;transform:translateZ(0);transform-origin:50% 50%;filter:drop-shadow(0 2px 2px rgba(0,0,0,.38));transition:filter .14s ease,transform .14s ease;pointer-events:none}
.employee-car-pin svg{display:block;width:36px;height:48px;overflow:visible}
.employee-car-marker:hover .employee-car-pin,.employee-car-marker:focus .employee-car-pin{transform:translateZ(0);filter:drop-shadow(0 2px 2px rgba(0,0,0,.38))}
.employee-car-marker:focus-visible{outline:2px solid #2563eb;outline-offset:2px;border-radius:9px}
@media(prefers-reduced-motion:reduce){.employee-car-pin{transition:none}}

/* Фиолетовый значок автомобиля в легенде карты */
.legend-car{display:inline-flex;width:18px;height:23px;vertical-align:middle;align-items:center;margin-right:4px;filter:drop-shadow(0 1px 1px rgba(0,0,0,.25))}.legend-car svg{width:18px;height:23px;display:block}


/* Yandex Maps integration */
#map{position:relative;overflow:hidden}
.ymaps-2-1-79-map{width:100%!important;height:100%!important}
.ymaps-2-1-79-balloon__content{font-family:Inter,"Segoe UI",Arial,sans-serif}
.yandex-circle-marker{pointer-events:auto}


/* Общий список присутствия участников */
.online-panel .online-count{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 7px;border-radius:999px;background:#e8f7ee;color:#167344;font-size:12px;vertical-align:middle}
.online-person{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid rgba(120,130,145,.16)}
.online-person:last-child{border-bottom:0}
.presence-state{display:inline-flex;align-items:center;gap:6px;margin-left:auto;white-space:nowrap;font-size:12px;color:#7b8491}
.presence-state i{width:8px;height:8px;border-radius:50%;background:#9299a3;display:inline-block}
.presence-state.online{color:#16834f}
.presence-state.online i{background:#20a464;box-shadow:0 0 0 3px rgba(32,164,100,.13)}
#clearMarkersBtn{color:#b42318;border-color:rgba(180,35,24,.3)}

.marker-popup{min-width:150px;max-width:260px;overflow-wrap:anywhere}
.marker-popup small{display:inline-block;margin-top:3px;font-size:11px;color:#52645a}
.marker-popup .mini-danger{display:block;width:100%;margin-top:9px;min-height:36px;font-size:12px;font-weight:700;cursor:pointer}

/* ULTRA EDITION — unified premium interface layer */
:root{--ink:#e9edf7;--muted:#9aa6bc;--line:rgba(148,163,184,.16);--green:#a78bfa;--green-dark:#8b5cf6;--green-soft:rgba(139,92,246,.16);--red:#fb7185;--shadow:0 18px 55px rgba(0,0,0,.28)}
html{color-scheme:dark}body{background:#090d18;color:var(--ink)}.app-bg{background:radial-gradient(ellipse at 12% 0%,rgba(91,60,170,.28),transparent 38%),radial-gradient(ellipse at 92% 12%,rgba(22,119,130,.16),transparent 34%),#090d18}
.shell{max-width:1600px}.topbar{border-bottom:1px solid rgba(148,163,184,.13)}.brand b{color:#f3f5ff}.brand small{color:#98a4bc}.header-user{color:#c7cce0}
.panel,.stat-card{background:linear-gradient(155deg,rgba(23,30,48,.97),rgba(15,21,36,.97));border:1px solid rgba(148,163,184,.16);box-shadow:var(--shadow);color:var(--ink)}
.panel h2,.panel h3,.welcome-row h1,.intro h1{color:#f4f5ff}.muted,.small,.footer-note{color:var(--muted)}.eyebrow,.section-kicker{color:#a78bfa;letter-spacing:1.5px}
input,select,textarea{background:#0c1323;border:1px solid #29344c;color:#eef2ff}input:focus,select:focus,textarea:focus{border-color:#8b5cf6;box-shadow:0 0 0 3px rgba(139,92,246,.18);background:#10182b}
button{border-radius:12px}.primary,.chat-send-btn{background:linear-gradient(135deg,#8b5cf6,#6d45c5);box-shadow:0 9px 24px rgba(109,69,197,.24)}.primary:hover{background:linear-gradient(135deg,#9b72ff,#7953d6)}.secondary,.map-tool-btn,.icon-btn{background:#202a40;color:#dbe4f5}.secondary:hover,.map-tool-btn:hover,.icon-btn:hover{background:#2b3854;color:#fff}.danger,.mini-danger{background:rgba(244,63,94,.14);color:#fda4af}
.auth-panel{background:linear-gradient(155deg,rgba(25,32,52,.98),rgba(13,19,33,.98))}.intro p,.privacy-note{color:#b8c3d8}.feature-row span{background:rgba(28,39,62,.9);border-color:#303b55;color:#cdd6e8}.privacy-note{background:rgba(139,92,246,.12);border:1px solid rgba(167,139,250,.2)}
.stat-card span,.stat-card small{color:#9eabc3}.stat-card strong{color:#f4f5ff}.sharing-status,.auto-gps,.chat-privacy{background:#182238;color:#c5d0e5}.sharing-status.active{background:rgba(16,185,129,.13);color:#6ee7b7}.avatar{background:#30264e;color:#d8c9ff}.person,.admin-user-row{border-color:rgba(148,163,184,.13)}.state{background:#263148;color:#bac6da}.state.online{background:rgba(16,185,129,.14);color:#6ee7b7}.state.stale{background:rgba(245,158,11,.14);color:#fcd34d}
.admin-panel{background:linear-gradient(145deg,#1b2238,#111a2c);border-color:rgba(167,139,250,.24)}.map-panel{background:#111a2c}.map-tools{background:#111a2c}.map-search input{background:#0c1323}.marker-fio-search-controls input{background:#0c1323;color:#f1f5f9;border-color:#334155}.marker-fio-search-info{color:#9eabc3}.place-info{background:linear-gradient(145deg,#172139,#111a2c);border-color:#2b3854}.place-info h3{color:#f4f5ff}.place-kind{background:rgba(139,92,246,.17);color:#d6c7ff}.place-address,.place-description{color:#c1cce0}.place-fact{background:#10192c;border-color:#2a3650}.place-fact span{color:#9eabc3}.place-fact b{color:#e5eaff}.legend{color:#a9b5cb}
.welcome-actions{display:flex;align-items:center;gap:10px}.chat-open-btn{display:inline-flex;align-items:center;gap:9px;padding:12px 19px;color:#fff;background:linear-gradient(135deg,#8b5cf6,#5b46ba);box-shadow:0 10px 28px rgba(109,69,197,.28)}.chat-open-btn:hover{filter:brightness(1.12);transform:translateY(-1px)}
.chat-backdrop{position:fixed;inset:0;background:rgba(2,6,18,.72);backdrop-filter:blur(7px);z-index:9998}.chat-panel{position:fixed;z-index:9999;right:22px;bottom:22px;width:min(760px,calc(100vw - 32px));height:min(760px,calc(100vh - 44px));margin:0;padding:22px;display:flex;flex-direction:column;border-color:rgba(167,139,250,.28);box-shadow:0 28px 100px rgba(0,0,0,.6)}.chat-panel.hidden{display:none!important}.chat-head{flex-shrink:0}.chat-head-actions{display:flex;align-items:center;gap:9px}.chat-close-btn{width:38px;height:38px;padding:0;font-size:25px;line-height:1;background:#29344c;color:#e9edfa}.chat-layout{display:grid;grid-template-columns:190px minmax(0,1fr);gap:16px;min-height:0;flex:1}.chat-sidebar,.chat-main{min-height:0}.chat-main{display:flex;flex-direction:column}.chat-messages{flex:1;min-height:120px;overflow:auto;background:#0b1221;border:1px solid #29344c;border-radius:14px;padding:13px}.chat-message{background:#1a2740;border:1px solid #2a3854;border-radius:13px;padding:10px 12px;margin:0 0 9px;color:#e8edfa}.chat-message.own{background:rgba(109,69,197,.22);border-color:rgba(167,139,250,.26)}.chat-message-meta{color:#aab6cd}.chat-message p{color:#edf1ff}.chat-compose{display:flex;align-items:flex-end;gap:10px;margin-top:12px}.chat-input-wrap{flex:1;margin:0}.chat-input-wrap textarea{resize:vertical;min-height:78px}.chat-send-btn{padding:13px 17px;color:#fff;white-space:nowrap}.chat-input-hint{color:#8492ac}.chat-privacy{border:1px solid #29344c;border-radius:12px;padding:12px;font-size:11px;line-height:1.5}
body.chat-is-open{overflow:hidden}
@media(max-width:700px){.welcome-row{flex-wrap:wrap}.welcome-actions{width:100%;justify-content:flex-end}.chat-panel{right:8px;bottom:8px;width:calc(100vw - 16px);height:calc(100dvh - 16px);padding:15px}.chat-layout{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);gap:8px}.chat-sidebar label{margin:0}.chat-sidebar .chat-privacy{display:none}.chat-compose{gap:7px}.chat-send-btn{padding:12px}.chat-head{padding:0 0 10px}.welcome-actions button{flex:1}.welcome-actions #logoutBtn{flex:1}}
@media(max-width:420px){.chat-compose{flex-direction:column;align-items:stretch}.chat-send-btn{width:100%}.chat-panel{padding:12px}.chat-messages{padding:9px}}

/* Unified update: arrival notifications, unread badge and marker actions */
.unread-badge{display:inline-flex;align-items:center;justify-content:center;min-width:19px;height:19px;padding:0 5px;border-radius:99px;background:#f04452;color:#fff;font-size:10px;font-weight:800;line-height:1}.unread-badge.hidden{display:none}
.admin-notifications{margin:16px 0;padding:14px;border:1px solid #e8e4fb;border-radius:14px;background:#fbfaff}.notification-count{display:inline-flex;min-width:22px;height:22px;align-items:center;justify-content:center;border-radius:99px;background:#eeeaff;color:#614bc8;font-size:11px;padding:0 6px}.admin-notifications-list{display:grid;gap:8px;max-height:310px;overflow:auto}.admin-notification{padding:11px 12px;border:1px solid #e7eaf2;border-radius:12px;background:#fff}.admin-notification.unread{border-color:#d9d0ff;background:#faf9ff}.admin-notification.read{opacity:.76}.admin-notification-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.admin-notification-head b{font-size:12px;color:#28324a}.admin-notification-head time{font-size:10px;color:#8992a6;white-space:nowrap}.admin-notification p{margin:7px 0 4px;font-size:12px;color:#4d5871}.admin-notification small{font-size:10px;color:#16845b}.admin-notifications .admin-list-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.admin-notifications .admin-list-head h3{display:flex;align-items:center;gap:8px}.admin-notifications .admin-list-head button{font-size:10px;padding:8px 10px}
@media(max-width:600px){.admin-notification-head{flex-direction:column;gap:3px}.admin-notifications .admin-list-head{align-items:flex-start;flex-direction:column}.unread-badge{min-width:17px;height:17px}}


/* Admin help guide */
.admin-help-guide{margin:14px 0 18px;border:1px solid #d9e2ef;border-radius:14px;background:#f7f9fd;color:#263247;overflow:hidden}
.admin-help-guide>details>summary{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:14px 16px;cursor:pointer;font-weight:800;list-style:none}
.admin-help-guide summary::-webkit-details-marker{display:none}
.admin-help-guide>details>summary:after{content:'⌄';font-size:18px;margin-left:auto}
.admin-help-guide>details[open]>summary:after{content:'⌃'}
.admin-help-guide summary small{font-size:11px;font-weight:500;color:#64748b}
.admin-help-content{padding:0 14px 14px;display:grid;gap:8px}
.admin-help-lead{margin:0 0 4px;color:#52627a;font-size:12px;line-height:1.55}
.admin-help-content details{border:1px solid #e0e7f0;border-radius:10px;background:#fff;overflow:hidden}
.admin-help-content details>summary{padding:11px 12px;cursor:pointer;font-size:12px;font-weight:800;list-style:none}
.admin-help-content details[open]>summary{border-bottom:1px solid #edf1f6;background:#f2f6fc}
.admin-help-content ul{margin:9px 14px 12px;padding-left:18px;display:grid;gap:7px;color:#46556b;font-size:11px;line-height:1.55}
.admin-help-content li b{color:#263247}
.admin-help-note{padding:11px 12px;border-left:3px solid #8b5cf6;border-radius:8px;background:#f1edff;color:#493b70;font-size:11px;line-height:1.55}
@media(prefers-color-scheme:dark){.admin-help-guide{background:#111a2c;border-color:#34415b;color:#edf2ff}.admin-help-guide summary small,.admin-help-lead,.admin-help-content ul{color:#b8c4da}.admin-help-content details{background:#172139;border-color:#34415b}.admin-help-content details[open]>summary{background:#202d47;border-color:#34415b}.admin-help-content li b{color:#edf2ff}.admin-help-note{background:#29234a;color:#ddd4ff}}

.admin-manage-btn{display:inline-flex;align-items:center;gap:8px;background:linear-gradient(135deg,#7251d1,#5136a8);color:#fff;box-shadow:0 8px 22px rgba(91,54,168,.22)}.admin-manage-btn:hover{filter:brightness(1.1);transform:translateY(-1px)}#adminPanel{scroll-margin-top:18px}


/* DARK_ADMIN_CHAT_WINDOWS_V1 — dark chat and administration surfaces */
:root{color-scheme:dark}
.chat-panel,.admin-panel,.admin-notifications,.admin-help-guide,.admin-create-form,.admin-help-content details,.admin-notification,.admin-notification.unread,.admin-notification.read{background:linear-gradient(155deg,#19243a 0%,#111a2c 100%)!important;color:#e8edfa!important;border-color:#34415b!important;box-shadow:0 16px 42px rgba(0,0,0,.28)!important}
.chat-panel h2,.chat-panel h3,.admin-panel h2,.admin-panel h3,.admin-notifications h2,.admin-notifications h3,.admin-help-guide summary,.admin-help-content details>summary,.admin-notification-head b,.admin-user-info b{color:#f1f4ff!important}
.chat-sidebar,.chat-compose,.chat-privacy,.admin-help-content details[open]>summary,.admin-help-note,.admin-create-form,.admin-notifications-list{background:#121d31!important;color:#d8e1f3!important;border-color:#34415b!important}
.chat-sidebar label,.chat-input-label,.chat-input-hint,.chat-empty,.admin-help-lead,.admin-help-content ul,.admin-notification p,.admin-notification-head time,.admin-user-info small,.admin-help-guide summary small{color:#aebbd2!important}
.chat-sidebar select,.chat-compose textarea,.admin-panel input,.admin-panel select,.admin-panel textarea,.admin-create-form input,.admin-create-form select,.admin-role-select{background:#0b1425!important;color:#eef2ff!important;border:1px solid #3a4967!important;-webkit-text-fill-color:#eef2ff!important;caret-color:#c4b5fd!important}
.chat-sidebar select option,.admin-panel select option,.admin-create-form select option{background:#111a2c!important;color:#eef2ff!important}
.chat-compose textarea::placeholder,.admin-panel input::placeholder{color:#8493ad!important;-webkit-text-fill-color:#8493ad!important}
.chat-messages{background:#080f1d!important;border-color:#34415b!important}.chat-message{background:#1a2942!important;border-color:#3a4967!important;color:#edf2ff!important}.chat-message.own{background:#302454!important;border-color:#6952a0!important}.chat-message-meta,.chat-message-meta b,.chat-message p{color:#edf2ff!important}
.admin-notification.unread{border-color:#6654a0!important}.admin-notification.read{opacity:.85}.admin-help-note{border-left-color:#a78bfa!important}.admin-user-row{border-color:#34415b!important}.admin-user-actions button,.admin-panel button.secondary{color:#e7eaff}.admin-panel .mini-secondary{background:#203b38!important;color:#9ce6c3!important}.admin-panel .mini-danger{background:#48232e!important;color:#ffb4c0!important}.admin-notifications .notification-count{background:#35295b!important;color:#ddd2ff!important}.chat-panel .chat-close-btn{background:#29344c!important;color:#f1f4ff!important}
@media(max-width:700px){.chat-panel{background:#111a2c!important}.chat-compose{background:#121d31!important}}

/* MALoy_ signature identity layer */

/* MALoy_ signature identity layer */
:root{--maloy-violet:#9b7bff;--maloy-cyan:#5ee7df;--maloy-gold:#d7b879;--maloy-panel:rgba(18,25,43,.96)}
body{background-color:#080c16}
.app-bg{background-image:radial-gradient(ellipse at 8% 4%,rgba(111,76,206,.22),transparent 34%),radial-gradient(ellipse at 94% 8%,rgba(35,180,180,.11),transparent 29%),linear-gradient(rgba(124,145,190,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(124,145,190,.025) 1px,transparent 1px),linear-gradient(145deg,#080c16,#0b1120 58%,#090e1b);background-size:auto,auto,34px 34px,34px 34px,auto}
.topbar{position:relative;border-bottom:1px solid rgba(155,123,255,.24);box-shadow:0 1px 0 rgba(94,231,223,.035)}
.topbar:after{content:'';display:inline-flex;align-items:center;gap:8px;margin-left:auto;margin-right:18px;padding:7px 11px;border:1px solid rgba(155,123,255,.23);border-radius:999px;background:linear-gradient(100deg,rgba(155,123,255,.12),rgba(94,231,223,.055));color:#b8a6ff;font:800 9px/1 Inter,'Segoe UI',sans-serif;letter-spacing:1.45px;white-space:nowrap}
.brand{gap:14px}.brand-icon{position:relative;isolation:isolate;width:48px;height:48px;border-radius:15px 15px 15px 5px;background:linear-gradient(145deg,#a58aff 0%,#6544bb 52%,#263d67 100%);box-shadow:0 0 0 1px rgba(195,177,255,.3),0 8px 28px rgba(111,76,206,.35),inset 0 1px 0 rgba(255,255,255,.28);font-size:15px;letter-spacing:.5px}
.brand-icon:after{content:'142';position:absolute;right:-7px;bottom:-6px;z-index:2;padding:3px 5px;border:1px solid #0c1425;border-radius:6px;background:linear-gradient(135deg,#5ee7df,#238e9b);color:#07131d;font:900 8px/1 Inter,'Segoe UI',sans-serif;letter-spacing:.3px;box-shadow:0 3px 10px rgba(0,0,0,.35)}
.brand b{font-weight:900;letter-spacing:2.1px;text-shadow:0 0 22px rgba(155,123,255,.18)}.brand small{color:#a99bd6;letter-spacing:1.75px}
.header-user{padding:8px 12px;border:1px solid rgba(148,163,184,.17);border-radius:999px;background:rgba(17,26,45,.72)}
.eyebrow,.section-kicker{color:#a995ff}.welcome-row h1{letter-spacing:-.45px}.welcome-row h1:after{content:'';font-size:10px;vertical-align:middle;letter-spacing:1.4px;color:#7e8ca9;font-weight:800}
.panel{backdrop-filter:blur(12px)}.admin-panel{border-color:rgba(155,123,255,.32);box-shadow:0 18px 55px rgba(0,0,0,.3),inset 0 1px 0 rgba(195,177,255,.055)}
.admin-panel>.panel-head{border-bottom:1px solid rgba(155,123,255,.16);margin-bottom:14px}.admin-panel>.panel-head:before{content:'M';display:grid;place-items:center;flex:0 0 34px;height:34px;margin-right:9px;border-radius:11px;background:linear-gradient(145deg,#8d6bea,#3d326e);color:#fff;font-weight:900;box-shadow:0 5px 18px rgba(111,76,206,.24)}
.chat-panel{border-color:rgba(155,123,255,.4);background:linear-gradient(155deg,rgba(22,29,49,.99),rgba(10,16,29,.99));box-shadow:0 28px 100px rgba(0,0,0,.68),0 0 0 1px rgba(94,231,223,.06)}
.chat-head .section-kicker:after{content:'';color:#5ee7df;font-size:9px;letter-spacing:1px}
.primary,.chat-send-btn,.chat-open-btn{background:linear-gradient(120deg,#8762e8,#6246b4 58%,#287f91);border:1px solid rgba(198,183,255,.2)}
.primary:hover,.chat-send-btn:hover,.chat-open-btn:hover{filter:brightness(1.12);box-shadow:0 10px 28px rgba(111,76,206,.3)}
.admin-help-guide,.admin-notifications,.admin-help-content details,.admin-notification{background:#111a2c!important;border-color:rgba(148,163,184,.18)!important;color:#e7edff!important}
.admin-help-guide summary small,.admin-help-lead,.admin-help-content ul,.admin-notification p,.admin-notification-head b{color:#c0cbe0!important}.admin-help-content details[open]>summary,.admin-notification.unread{background:#202b45!important;border-color:rgba(155,123,255,.3)!important}.admin-help-note{background:rgba(111,76,206,.17)!important;color:#e0d7ff!important;border-left-color:#9b7bff!important}
.footer-note{padding:14px 10px 8px;border-top:1px solid rgba(148,163,184,.1);letter-spacing:.35px}.footer-note:after{content:none}.footer-brand-signature{display:block;margin-top:8px;color:#b8a6ff;font-size:9px;font-weight:800;letter-spacing:1.55px;text-transform:uppercase}
@media(max-width:760px){.topbar:after{display:none}.brand{gap:10px}.brand b{font-size:11px;letter-spacing:1.2px}.brand small{font-size:8px;letter-spacing:1px}.brand-icon{width:42px;height:42px}.header-user{font-size:10px;padding:6px 8px}.welcome-row h1:after{display:block;margin-top:5px}}

/*  logo: remove numeric badge */
.brand-icon:after{content:none!important;display:none!important}


/* Yandex Maps marker compatibility styles */
#map { position:relative; overflow:hidden; }
#map canvas { outline:none; }
#map [class*="control"] { border-radius:10px; }


.frn-map-marker { cursor:pointer; user-select:none; }
.frn-map-circle { cursor:pointer; box-shadow:0 1px 4px rgba(0,0,0,.3); }
.frn-default-pin { display:block; width:16px; height:16px; border-radius:50%; background:#7c3aed; border:2px solid #fff; }
#routeMapBtn.placing { background:#7c3aed; color:#fff; }
#routeProfile { max-width:145px; }
@media(max-width:640px) {
  #routeProfile { max-width:120px; min-width:0; }
  #map [class*="control"] { max-width:calc(100vw - 24px); }
}


/* Yandex map controls */
.ymaps-2-1-79-map { border-radius: inherit; }


/* FULLSCREEN MAP — expand the map workspace to the full viewport */
#mapPanel:fullscreen,
#mapPanel.is-fullscreen{
  position:fixed!important;inset:0!important;z-index:99999!important;
  width:100vw!important;height:100vh!important;height:100dvh!important;
  max-width:none!important;max-height:none!important;margin:0!important;
  border:0!important;border-radius:0!important;overflow:auto!important;
  display:flex!important;flex-direction:column!important;background:#0b1120!important;
}
#mapPanel:fullscreen .panel-head,
#mapPanel.is-fullscreen .panel-head{padding-top:12px;padding-bottom:10px;flex:0 0 auto}
#mapPanel:fullscreen .map-tools,
#mapPanel.is-fullscreen .map-tools{flex:0 0 auto;padding-bottom:10px}
#mapPanel:fullscreen #map,
#mapPanel.is-fullscreen #map{flex:1 1 0;height:auto!important;min-height:260px;max-height:none;border-top:1px solid rgba(148,163,184,.16)}
#mapPanel:fullscreen .place-info,
#mapPanel.is-fullscreen .place-info{flex:0 0 auto;max-height:22vh;overflow:auto;margin-top:8px}
#mapPanel:fullscreen .legend,
#mapPanel.is-fullscreen .legend{flex:0 0 auto;padding-top:8px;padding-bottom:10px}
#mapPanel:fullscreen .map-fullscreen-btn,
#mapPanel.is-fullscreen .map-fullscreen-btn{background:#6d4bc3;color:#fff}
body.map-fullscreen-open{overflow:hidden}
@media(max-width:700px){
  #mapPanel:fullscreen .panel-head,
  #mapPanel.is-fullscreen .panel-head{align-items:flex-start;gap:8px;padding:10px}
  #mapPanel:fullscreen .panel-head .muted,
  #mapPanel.is-fullscreen .panel-head .muted{display:none}
  #mapPanel:fullscreen .layer-control,
  #mapPanel.is-fullscreen .layer-control{min-width:105px;max-width:125px}
  #mapPanel:fullscreen .map-tools,
  #mapPanel.is-fullscreen .map-tools{padding-left:10px;padding-right:10px}
  #mapPanel:fullscreen .map-actions,
  #mapPanel.is-fullscreen .map-actions{flex-wrap:wrap}
  #mapPanel:fullscreen .map-tool-btn,
  #mapPanel.is-fullscreen .map-tool-btn{flex:1 1 auto;min-width:92px;padding:9px 7px}
  #mapPanel:fullscreen .place-info,
  #mapPanel.is-fullscreen .place-info{max-height:17vh}
}


/* Modern personal profile */
.profile-open-btn{display:inline-flex;align-items:center;gap:9px;border:1px solid rgba(167,139,250,.35);background:rgba(124,58,237,.12);color:var(--text,#f4f0ff);border-radius:14px;padding:9px 13px;font-weight:700;cursor:pointer}
.profile-button-avatar{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;overflow:hidden;background:linear-gradient(135deg,#7c3aed,#4c1d95);color:#fff;font-size:12px;font-weight:800}
.profile-button-avatar img{width:100%;height:100%;object-fit:cover}
.profile-modal{position:fixed;inset:0;z-index:10000;background:rgba(5,7,18,.78);backdrop-filter:blur(10px);display:flex;align-items:center;justify-content:center;padding:18px;overflow:auto}
.profile-modal.hidden{display:none}
.profile-card{width:min(680px,100%);max-height:min(92vh,900px);overflow:auto;background:linear-gradient(145deg,#17152b,#101321 72%);border:1px solid rgba(167,139,250,.25);border-radius:24px;box-shadow:0 28px 90px rgba(0,0,0,.5);padding:clamp(18px,4vw,30px);color:#f5f3ff}
.profile-modal-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:22px}
.profile-modal-head h2{margin:5px 0;font-size:25px}
.profile-close{border:0;background:rgba(255,255,255,.08);color:#fff;width:38px;height:38px;border-radius:12px;font-size:25px;cursor:pointer}
.profile-photo-row{display:flex;align-items:center;gap:18px;padding:17px;border:1px solid rgba(167,139,250,.2);background:rgba(124,58,237,.08);border-radius:18px;margin-bottom:20px}
.profile-avatar{width:86px;height:86px;flex:0 0 86px;border-radius:24px;background:linear-gradient(135deg,#7c3aed,#312e81);object-fit:cover;display:grid;place-items:center;color:#fff;font-size:24px;font-weight:800;overflow:hidden}.profile-avatar img{width:100%;height:100%;object-fit:cover}

.profile-photo-actions{display:flex;flex-direction:column;gap:6px}
.profile-photo-actions strong{font-size:15px}
.profile-photo-actions .muted{font-size:12px;color:#aaa6c3}
.profile-upload-btn{display:inline-flex;align-items:center;justify-content:center;width:max-content;margin-top:5px;padding:9px 13px;border-radius:11px;background:#6d35d4;color:#fff;font-weight:700;cursor:pointer}
.profile-fields{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.profile-fields label,.profile-password-block label{display:flex;flex-direction:column;gap:7px;color:#c9c4df;font-size:13px;font-weight:650}
.profile-fields input,.profile-password-block input{width:100%;box-sizing:border-box;border:1px solid rgba(167,139,250,.22);border-radius:12px;background:#0c1020;color:#fff;padding:12px 13px;outline:none}
.profile-fields input:focus,.profile-password-block input:focus{border-color:#9b75f5;box-shadow:0 0 0 3px rgba(124,58,237,.15)}
.profile-fields input[readonly]{opacity:.65}
.profile-password-block{margin-top:22px;padding:17px;border:1px solid rgba(167,139,250,.18);border-radius:17px;background:rgba(255,255,255,.025);display:grid;grid-template-columns:1fr 1fr;gap:13px}
.profile-password-block h3{grid-column:1/-1;margin:0;color:#fff;font-size:15px}
.profile-message{min-height:20px;margin:12px 0;color:#c4b5fd;font-size:13px}
.profile-actions{display:flex;gap:10px;justify-content:flex-end}
.profile-actions button{min-width:140px}
body.profile-modal-open{overflow:hidden}
@media(max-width:620px){
 .profile-fields,.profile-password-block{grid-template-columns:1fr}
 .profile-password-block h3{grid-column:auto}
 .profile-actions{flex-direction:column}
 .profile-actions button{width:100%}
 .profile-open-btn{padding:7px 9px;font-size:12px}
 .profile-modal{padding:8px}
 .profile-card{max-height:96vh;border-radius:19px}
}


/* Панель управления в личном профиле главного администратора */
.profile-admin-section{
  margin:18px 0;
  padding:18px;
  border:1px solid rgba(139,92,246,.38);
  border-radius:16px;
  background:linear-gradient(135deg,rgba(91,33,182,.16),rgba(30,41,59,.55));
}
.profile-admin-section h3{margin:6px 0 8px}
.profile-admin-section .primary{width:100%;margin-top:10px}


/* Встроенное администрирование непосредственно в окне профиля */
.profile-card{
  max-height:calc(100vh - 28px);
  overflow-y:auto;
  overscroll-behavior:contain;
}
.profile-admin-content{
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid rgba(148,163,184,.22);
}
.profile-admin-content #adminPanel{
  display:block;
  width:100%;
  max-width:100%;
  margin:0;
  position:static;
  max-height:none;
  overflow:visible;
}
.profile-admin-content #adminPanel.hidden{display:none!important}


/* Кнопка выхода из аккаунта в личном профиле */
.profile-logout-btn{
  display:block;
  width:100%;
  margin-top:12px;
  padding:12px 16px;
  border:1px solid rgba(239,68,68,.45);
  border-radius:12px;
  background:rgba(127,29,29,.18);
  color:#fca5a5;
  font:inherit;
  font-weight:600;
  cursor:pointer;
}
.profile-logout-btn:hover{background:rgba(127,29,29,.3)}
.profile-logout-btn:focus-visible{outline:2px solid #f87171;outline-offset:2px}


/* Скрываем старую кнопку выхода на главной странице.
   Выход остаётся доступен через кнопку в окне «Мой профиль». */
#logoutBtn{
  display:none !important;
}


/* Раздел «Личные данные» в окне профиля */
.profile-data-section{
  margin:0 0 18px;
  padding:18px;
  border:1px solid rgba(167,139,250,.22);
  border-radius:18px;
  background:rgba(255,255,255,.025);
}
.profile-section-heading{margin-bottom:15px}
.profile-section-heading h3{margin:5px 0 6px;color:#fff;font-size:19px}
.profile-section-heading p{margin:0;color:#aaa6c3;font-size:13px}
.profile-data-section .profile-photo-row{margin-bottom:17px}
.profile-password-block{margin-top:0}
@media(max-width:600px){
  .profile-data-section{padding:14px}
  .profile-data-section .profile-fields{grid-template-columns:1fr}
  .profile-password-block{grid-template-columns:1fr}
  .profile-password-block h3{grid-column:1}
}


/* PROFILE OPTIMIZATION — compact hierarchy, clearer fields and mobile ergonomics */
.profile-modal{
  align-items:flex-start;
  padding:clamp(10px,2.5vh,26px) 14px;
}
.profile-card{
  width:min(760px,100%);
  max-height:calc(100dvh - 28px);
  padding:clamp(16px,3vw,28px);
  border-radius:22px;
  scrollbar-width:thin;
  scrollbar-color:rgba(167,139,250,.45) transparent;
}
.profile-modal-head{
  position:sticky;
  top:calc(-1 * clamp(16px,3vw,28px));
  z-index:3;
  padding:8px 0 14px;
  margin:calc(-1 * clamp(16px,3vw,28px)) 0 16px;
  background:linear-gradient(180deg,#17152b 78%,rgba(23,21,43,.94));
  border-bottom:1px solid rgba(167,139,250,.14);
}
.profile-modal-head h2{font-size:clamp(22px,3vw,27px);letter-spacing:-.025em}
.profile-modal-head .muted{margin:5px 0 0;font-size:12px}
.profile-account-strip{
  display:flex;align-items:center;gap:11px;
  padding:12px 14px;margin:0 0 16px;
  border:1px solid rgba(167,139,250,.18);
  border-radius:15px;
  background:linear-gradient(110deg,rgba(124,58,237,.13),rgba(30,41,59,.35));
}
.profile-account-icon{
  display:grid;place-items:center;flex:0 0 34px;height:34px;
  border-radius:11px;background:rgba(124,58,237,.25);color:#c4b5fd;font-weight:900;
}
.profile-account-strip strong{display:block;color:#f5f3ff;font-size:13px}
.profile-account-strip small{display:block;margin-top:3px;color:#aaa6c3;font-size:11px}
.profile-role-badge{
  margin-left:auto;padding:6px 9px;border-radius:999px;
  border:1px solid rgba(167,139,250,.28);
  background:rgba(124,58,237,.15);color:#ddd6fe;
  font-size:10px;font-weight:800;white-space:nowrap;
}
.profile-data-section{
  padding:clamp(14px,2.5vw,21px);
  border-color:rgba(167,139,250,.2);
  background:linear-gradient(145deg,rgba(30,27,55,.62),rgba(15,23,42,.7));
}
.profile-section-heading{margin-bottom:18px}
.profile-section-heading .section-kicker{font-size:9px;letter-spacing:.18em;color:#a78bfa;font-weight:900}
.profile-section-heading h3{font-size:20px;letter-spacing:-.02em}
.profile-section-heading p{font-size:12px;line-height:1.5}
.profile-photo-row{
  align-items:center;gap:15px;padding:14px;margin-bottom:18px;
  border-color:rgba(167,139,250,.18);background:rgba(124,58,237,.07);
}
.profile-avatar{
  width:76px;height:76px;flex-basis:76px;border-radius:20px;
  box-shadow:0 8px 24px rgba(0,0,0,.22);font-size:22px;
}
.profile-photo-actions strong{font-size:13px}
.profile-upload-btn{padding:9px 12px;border-radius:10px;font-size:12px}
.profile-fields{gap:14px}
.profile-fields label,.profile-password-block label{gap:6px;font-size:12px}
.profile-fields input,.profile-password-block input{
  min-height:43px;padding:11px 12px;border-radius:11px;
  font:inherit;font-size:14px;transition:border-color .16s,box-shadow .16s;
}
.profile-fields input::placeholder,.profile-password-block input::placeholder{color:#77738e}
.profile-password-block{
  margin-top:17px;padding:15px;border-radius:15px;
  background:rgba(8,12,27,.42);gap:12px;
}
.profile-password-block h3{font-size:14px}
.profile-message{min-height:18px;margin:10px 0 6px}
.profile-actions{
  position:sticky;bottom:-1px;z-index:2;
  padding:12px 0 2px;margin-top:8px;
  background:linear-gradient(180deg,rgba(23,21,43,.88),#17152b 35%);
  border-top:1px solid rgba(167,139,250,.14);
}
.profile-actions button{min-height:44px;border-radius:12px}
.profile-admin-section{padding:16px;border-radius:15px}
.profile-admin-content{padding-top:14px}
.profile-logout-btn{min-height:43px;margin-top:14px}
.profile-close:hover,.profile-upload-btn:hover,.profile-open-btn:hover{filter:brightness(1.12)}
.profile-card :focus-visible{outline:2px solid #a78bfa;outline-offset:2px}
@media(max-width:620px){
  .profile-modal{padding:6px;align-items:flex-start}
  .profile-card{max-height:calc(100dvh - 12px);padding:14px;border-radius:17px}
  .profile-modal-head{top:-14px;margin:-14px 0 12px;padding:8px 0 12px}
  .profile-account-strip{padding:10px;gap:8px}
  .profile-account-strip small{max-width:180px;line-height:1.35}
  .profile-role-badge{font-size:9px;padding:5px 7px}
  .profile-data-section{padding:13px}
  .profile-photo-row{padding:11px;gap:12px}
  .profile-avatar{width:66px;height:66px;flex-basis:66px;border-radius:17px}
  .profile-fields{gap:11px}
  .profile-fields input,.profile-password-block input{min-height:44px;font-size:16px}
  .profile-actions{flex-direction:column}
  .profile-actions button{width:100%;min-height:46px}
}
@media(prefers-reduced-motion:reduce){
  .profile-fields input,.profile-password-block input{transition:none}
}


/* FIX: employee profile photos and fullscreen avatar viewer */
.avatar-photo{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 36px!important;width:36px!important;min-width:36px!important;max-width:36px!important;
  height:36px!important;min-height:36px!important;max-height:36px!important;
  padding:0!important;margin:0!important;border:1px solid rgba(167,139,250,.28)!important;
  border-radius:50%!important;overflow:hidden!important;background:#30264e!important;
  line-height:0!important;box-shadow:none!important;vertical-align:middle!important;
}
.avatar-photo img{
  display:block!important;width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;
  max-width:none!important;max-height:none!important;object-fit:cover!important;border:0!important;
  border-radius:50%!important;margin:0!important;padding:0!important;
}
.person>.avatar-photo,.online-person>.avatar-photo,.admin-user-row .avatar-photo,.chat-avatar.avatar-photo{flex-shrink:0!important}
.chat-avatar{width:30px!important;height:30px!important;flex-basis:30px!important;min-width:30px!important;max-width:30px!important}
.chat-avatar img{width:100%!important;height:100%!important;object-fit:cover!important}
.user-avatar-viewer{
  position:fixed!important;inset:0!important;z-index:20000!important;display:none!important;
  align-items:center!important;justify-content:center!important;padding:24px!important;
  background:rgba(3,6,16,.88)!important;backdrop-filter:blur(8px)!important;overflow:auto!important;
}
.user-avatar-viewer.open{display:flex!important}
.user-avatar-viewer>img{
  display:block!important;width:auto!important;height:auto!important;
  max-width:min( min(90vw,720px), calc(100vw - 48px) )!important;
  max-height:calc(100dvh - 48px)!important;object-fit:contain!important;
  border-radius:16px!important;box-shadow:0 24px 80px rgba(0,0,0,.55)!important;
}
.user-avatar-viewer-close{
  position:fixed!important;top:18px!important;right:18px!important;z-index:1!important;
  display:grid!important;place-items:center!important;width:44px!important;height:44px!important;
  min-width:44px!important;padding:0!important;border:1px solid rgba(255,255,255,.25)!important;
  border-radius:50%!important;background:rgba(20,24,40,.9)!important;color:#fff!important;
  font-size:28px!important;line-height:1!important;cursor:pointer!important;
}
@media(max-width:620px){
 .avatar-photo{width:36px!important;height:36px!important;flex-basis:36px!important}
 .user-avatar-viewer{padding:12px!important}
 .user-avatar-viewer>img{max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important}
 .user-avatar-viewer-close{top:10px!important;right:10px!important}
}


/* PROFILE ALL SECTIONS — unified premium violet profile layout */
.profile-card{width:min(820px,100%);background:radial-gradient(ellipse at 8% 0%,rgba(124,58,237,.20),transparent 38%),linear-gradient(155deg,#17152b 0%,#101321 70%);border:1px solid rgba(167,139,250,.28);box-shadow:0 30px 100px rgba(0,0,0,.58)}
.profile-modal-head{align-items:center}.profile-modal-head .eyebrow{color:#b9a1ff;font-weight:900;letter-spacing:.18em}.profile-modal-head h2{font-size:clamp(25px,4vw,31px);font-weight:850}
.profile-account-strip{padding:14px 16px;border-radius:17px;background:linear-gradient(110deg,rgba(124,58,237,.19),rgba(49,46,129,.12));border-color:rgba(167,139,250,.24)}
.profile-account-icon{width:38px;height:38px;flex-basis:38px;border-radius:13px;background:linear-gradient(135deg,#8b5cf6,#5b21b6);color:#fff;box-shadow:0 7px 20px rgba(91,33,182,.28)}.profile-role-badge{font-size:11px;padding:7px 11px}
.profile-form{display:flex;flex-direction:column;gap:15px}.profile-panel{position:relative;padding:clamp(16px,2.8vw,22px);border:1px solid rgba(167,139,250,.20);border-radius:19px;background:linear-gradient(145deg,rgba(35,31,64,.74),rgba(12,17,34,.78));box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 10px 28px rgba(0,0,0,.12)}.profile-data-section{margin:0}
.profile-section-heading{margin-bottom:17px}.profile-section-heading .section-kicker,.profile-panel-heading .section-kicker{font-size:9px;letter-spacing:.19em;color:#b69aff;font-weight:900}.profile-section-heading h3,.profile-panel-heading h3{margin:5px 0;color:#fff;font-size:20px;font-weight:850;letter-spacing:-.025em}.profile-section-heading p,.profile-panel-heading p{margin:0;color:#aaa6c3;font-size:12px;line-height:1.55}
.profile-photo-row{padding:14px;border-radius:16px;border:1px solid rgba(167,139,250,.17);background:linear-gradient(110deg,rgba(124,58,237,.12),rgba(255,255,255,.025))}.profile-avatar{width:82px;height:82px;flex-basis:82px;border-radius:23px;border:2px solid rgba(196,181,253,.55);box-shadow:0 9px 25px rgba(0,0,0,.3)}.profile-upload-btn{background:linear-gradient(135deg,#8b5cf6,#6d28d9);box-shadow:0 6px 16px rgba(109,40,217,.22)}
.profile-fields{gap:13px}.profile-fields label,.profile-password-block label,.profile-email-label{font-size:12px;font-weight:750;color:#d6d1e8}.profile-fields input,.profile-password-block input,.profile-email-label input{min-height:46px;padding:12px 14px;border:1px solid rgba(167,139,250,.22);border-radius:13px;background:rgba(7,11,25,.72);color:#fff;font-size:14px;transition:border-color .18s,box-shadow .18s,background .18s}.profile-fields input:focus,.profile-password-block input:focus,.profile-email-label input:focus{border-color:#a78bfa;background:#0b1022;box-shadow:0 0 0 3px rgba(139,92,246,.18);outline:none}.profile-fields input[readonly]{background:rgba(255,255,255,.035);border-style:dashed;color:#aaa6c3}
.profile-panel-heading{display:flex;align-items:flex-start;gap:12px;margin-bottom:17px}.profile-panel-icon{display:grid;place-items:center;flex:0 0 42px;width:42px;height:42px;border-radius:14px;background:linear-gradient(145deg,rgba(139,92,246,.28),rgba(91,33,182,.18));border:1px solid rgba(167,139,250,.24);color:#d8caff;font-size:20px}.profile-security-icon{background:linear-gradient(145deg,rgba(14,165,233,.20),rgba(79,70,229,.18));color:#a5d8ff;border-color:rgba(125,211,252,.2)}
.profile-email-label{display:flex;flex-direction:column;gap:8px;margin-bottom:13px}.profile-email-status{display:flex;align-items:center;gap:11px;padding:13px;border-radius:15px;border:1px solid rgba(245,158,11,.25);background:rgba(245,158,11,.075)}.profile-email-status-icon{display:grid;place-items:center;flex:0 0 31px;width:31px;height:31px;border-radius:50%;background:rgba(245,158,11,.16);color:#fbbf24;font-weight:900}.profile-email-status-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:3px}.profile-email-status-copy strong{color:#fde68a;font-size:12px}.profile-email-status-copy span{color:#b9b2c9;font-size:11px;line-height:1.45}.profile-email-status-badge{white-space:nowrap;padding:6px 9px;border-radius:999px;background:rgba(245,158,11,.12);color:#fcd34d;font-size:10px;font-weight:850}
.profile-email-status.is-verified{border-color:rgba(52,211,153,.25);background:rgba(16,185,129,.075)}.profile-email-status.is-verified .profile-email-status-icon{background:rgba(16,185,129,.17);color:#6ee7b7}.profile-email-status.is-verified .profile-email-status-copy strong{color:#6ee7b7}.profile-email-status.is-verified .profile-email-status-badge{background:rgba(16,185,129,.13);color:#6ee7b7}
.profile-email-verify-btn{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;min-height:45px;margin-top:12px;border:1px solid rgba(167,139,250,.28);border-radius:13px;background:linear-gradient(110deg,#7c3aed,#5b21b6);color:#fff;font-weight:800;cursor:pointer;box-shadow:0 8px 20px rgba(91,33,182,.2)}.profile-email-verify-btn:hover{filter:brightness(1.12);transform:translateY(-1px)}.profile-email-verify-btn:disabled{background:rgba(16,185,129,.12);border-color:rgba(52,211,153,.22);color:#6ee7b7;box-shadow:none;cursor:default;transform:none}
.profile-password-block{margin:0;grid-template-columns:1fr 1fr;gap:13px}.profile-password-block h3{grid-column:auto}.profile-message{padding:0 3px;line-height:1.5}.profile-actions{position:sticky;bottom:-1px;display:flex;gap:10px;padding:13px 0 3px;margin-top:0;background:linear-gradient(180deg,rgba(23,21,43,.88),#17152b 40%);border-top:1px solid rgba(167,139,250,.16)}.profile-actions button{min-height:47px;border-radius:13px;font-weight:800}.profile-actions .primary{box-shadow:0 8px 22px rgba(109,40,217,.24)}
.profile-admin-section{margin-top:0;border-color:rgba(167,139,250,.26);background:linear-gradient(135deg,rgba(91,33,182,.17),rgba(15,23,42,.8))}.profile-admin-section .primary{width:100%;min-height:45px;border-radius:13px;margin-top:5px}.profile-logout-btn{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;min-height:44px;margin:0;padding:10px;border:1px solid rgba(248,113,113,.22);border-radius:13px;background:rgba(127,29,29,.10);color:#fca5a5;font-weight:800}.profile-logout-btn:hover{background:rgba(127,29,29,.22)}
@media(max-width:620px){.profile-card{width:100%;padding:13px;border-radius:18px}.profile-form{gap:11px}.profile-panel{padding:14px;border-radius:16px}.profile-photo-row{align-items:center}.profile-avatar{width:68px;height:68px;flex-basis:68px;border-radius:19px}.profile-email-status{align-items:flex-start;flex-wrap:wrap}.profile-email-status-badge{margin-left:42px}.profile-password-block{grid-template-columns:1fr}.profile-actions{flex-direction:column}.profile-actions button{width:100%}}

/* ===== PROFILE LAYOUT REPAIR 2026-11 =====
   Stabilizes the profile dialog header and section spacing on desktop/mobile.
*/
#profileModal.profile-modal{
  box-sizing:border-box;
  align-items:flex-start;
  justify-content:center;
  padding:clamp(12px,3vh,28px) 14px;
  overflow-y:auto;
  overflow-x:hidden;
}
#profileModal .profile-card{
  box-sizing:border-box;
  width:min(780px,100%);
  max-height:calc(100dvh - 2 * clamp(12px,3vh,28px));
  overflow-x:hidden;
  overflow-y:auto;
  padding:clamp(18px,2.6vw,26px);
  border-radius:22px;
  color:#f7f5ff;
  background:
    radial-gradient(ellipse at 8% 0%,rgba(124,58,237,.18),transparent 42%),
    linear-gradient(155deg,#19172d 0%,#111426 72%);
  border:1px solid rgba(167,139,250,.30);
  box-shadow:0 24px 80px rgba(0,0,0,.52);
}
#profileModal .profile-modal-head{
  position:relative;
  inset:auto;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  min-width:0;
  margin:0 0 18px;
  padding:0 0 16px;
  background:transparent;
  border-bottom:1px solid rgba(167,139,250,.18);
}
#profileModal .profile-modal-head > div{min-width:0}
#profileModal .profile-modal-head .eyebrow{
  margin:0 0 7px;
  color:#b9a4ff!important;
  font-size:10px;
  line-height:1.35;
  font-weight:850;
  letter-spacing:.18em;
}
#profileModal .profile-modal-head h2{
  margin:0;
  color:#fff!important;
  font-size:clamp(23px,3.4vw,30px);
  line-height:1.15;
  font-weight:850;
  letter-spacing:-.035em;
  overflow-wrap:anywhere;
}
#profileModal .profile-modal-head .muted{
  margin:7px 0 0;
  color:#aaa6c3!important;
  font-size:12px;
  line-height:1.5;
}
#profileModal .profile-close{
  flex:0 0 40px;
  width:40px;height:40px;min-width:40px;
  display:grid;place-items:center;
  margin:0;padding:0;
  border:1px solid rgba(196,181,253,.18);
  border-radius:12px;
  background:rgba(255,255,255,.07);
  color:#eee9ff;
  font-size:24px;
  line-height:1;
}
#profileModal .profile-account-strip{margin:0 0 16px;min-width:0}
#profileModal .profile-form{min-width:0;gap:13px}
#profileModal .profile-panel{min-width:0;box-sizing:border-box}
#profileModal .profile-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
#profileModal .profile-fields label,
#profileModal .profile-password-block label,
#profileModal .profile-email-label{display:flex;flex-direction:column;min-width:0;gap:7px}
#profileModal input{box-sizing:border-box;max-width:100%;min-width:0}
#profileModal .profile-photo-row{min-width:0;flex-wrap:wrap}
#profileModal .profile-photo-actions{min-width:0}
#profileModal .profile-email-status{min-width:0}
#profileModal .profile-email-status-copy{overflow-wrap:anywhere}
#profileModal .profile-email-status-badge{flex-shrink:0}
#profileModal .profile-actions{
  position:relative;
  bottom:auto;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:2px;
  padding:14px 0 0;
  background:transparent;
  border-top:1px solid rgba(167,139,250,.16);
}
#profileModal .profile-actions button{flex:1 1 180px;min-width:0}
@media(max-width:620px){
  #profileModal.profile-modal{padding:8px;align-items:flex-start}
  #profileModal .profile-card{
    width:100%;
    max-height:calc(100dvh - 16px);
    padding:15px;
    border-radius:18px;
  }
  #profileModal .profile-modal-head{gap:10px;margin-bottom:13px;padding-bottom:12px}
  #profileModal .profile-modal-head h2{font-size:23px}
  #profileModal .profile-modal-head .muted{font-size:11px}
  #profileModal .profile-close{width:36px;height:36px;min-width:36px;flex-basis:36px}
  #profileModal .profile-account-strip{padding:10px;gap:8px}
  #profileModal .profile-account-strip small{max-width:none}
  #profileModal .profile-fields{grid-template-columns:minmax(0,1fr);gap:11px}
  #profileModal .profile-panel{padding:13px;border-radius:15px}
  #profileModal .profile-photo-row{padding:10px;gap:11px}
  #profileModal .profile-avatar{width:64px;height:64px;flex-basis:64px}
  #profileModal .profile-email-status{align-items:flex-start;flex-wrap:wrap}
  #profileModal .profile-email-status-badge{margin-left:42px}
  #profileModal .profile-password-block{grid-template-columns:minmax(0,1fr)}
  #profileModal .profile-actions{flex-direction:column}
  #profileModal .profile-actions button{width:100%;flex:1 1 auto}
}



/* PROFILE STABLE LAYOUT FIX 2026-11-20 */
#profileModal.profile-modal {
  box-sizing: border-box;
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
}

#profileModal.profile-modal * {
  box-sizing: border-box;
}

#profileModal .profile-card {
  width: min(780px, 100%);
  max-width: 100%;
  max-height: none;
  min-width: 0;
  margin: 0 auto;
  overflow: visible;
}

#profileModal .profile-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  gap: 14px;
}

#profileModal .profile-panel,
#profileModal .profile-data-section,
#profileModal .profile-email-section {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

#profileModal .profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  gap: 14px;
}

#profileModal .profile-fields > label,
#profileModal .profile-password-block > label {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

#profileModal .profile-fields input,
#profileModal .profile-password-block input,
#profileModal .profile-email-label input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

#profileModal .profile-password-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
}

#profileModal .profile-password-block > .profile-panel-heading {
  grid-column: 1 / -1;
  min-width: 0;
}

#profileModal .profile-photo-row {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}

#profileModal .profile-photo-actions {
  min-width: 0;
  overflow-wrap: anywhere;
}

#profileModal .profile-account-strip {
  min-width: 0;
  flex-wrap: wrap;
}

#profileModal .profile-modal-head {
  min-width: 0;
}

#profileModal .profile-actions {
  position: static;
  display: flex;
  flex-wrap: wrap;
}

@media (max-width: 620px) {
  #profileModal.profile-modal {
    padding: 7px;
  }

  #profileModal .profile-card {
    width: 100%;
    padding: 14px;
    border-radius: 17px;
  }

  #profileModal .profile-fields,
  #profileModal .profile-password-block {
    grid-template-columns: minmax(0, 1fr);
  }

  #profileModal .profile-password-block > .profile-panel-heading {
    grid-column: 1;
  }

  #profileModal .profile-actions {
    flex-direction: column;
  }

  #profileModal .profile-actions button {
    width: 100%;
  }

  #profileModal .profile-email-status {
    flex-wrap: wrap;
  }

  #profileModal .profile-role-badge {
    margin-left: auto;
  }
}



/* Карточка сервисного маркера: подробности открываются только по нажатию на точку */
.marker-modal{position:fixed;inset:0;z-index:5000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(4,8,18,.72);backdrop-filter:blur(7px)}
.marker-modal.hidden{display:none!important}
.marker-modal-card{width:min(560px,100%);max-height:min(88vh,850px);overflow:auto;border:1px solid rgba(148,163,184,.24);border-radius:20px;background:#101827;color:#f8fafc;box-shadow:0 24px 90px rgba(0,0,0,.45)}
.marker-modal-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;background:#101827;border-bottom:1px solid rgba(148,163,184,.18)}
.marker-modal-head h2{margin:0;font-size:19px;line-height:1.3;color:#fff}
.marker-modal-close{width:36px;height:36px;flex:0 0 36px;border:0;border-radius:11px;background:rgba(148,163,184,.14);color:#fff;font-size:25px;line-height:1;cursor:pointer}
.marker-modal-content{padding:20px}
.marker-detail-photo{display:block;width:100%;max-height:280px;object-fit:contain;border-radius:14px;background:#080d16;margin:0 0 16px}
.marker-detail-status{display:inline-flex;align-items:center;padding:7px 11px;border-radius:999px;font-size:12px;font-weight:800;margin-bottom:14px}
.marker-detail-status.free{background:rgba(220,65,59,.16);color:#ffaaa5}
.marker-detail-status.occupied{background:rgba(21,148,95,.18);color:#78e0ae}
.marker-detail-list{display:grid;gap:0;margin:0}
.marker-detail-list>div{display:grid;grid-template-columns:112px minmax(0,1fr);gap:12px;padding:11px 0;border-bottom:1px solid rgba(148,163,184,.15)}
.marker-detail-list dt{font-size:12px;color:#9caec4}
.marker-detail-list dd{margin:0;min-width:0;font-size:14px;line-height:1.5;color:#f1f5f9;overflow-wrap:anywhere}
.marker-description{white-space:normal}
.marker-form{display:grid;gap:15px}
.marker-form label{display:grid;gap:7px;color:#cbd5e1;font-size:13px;font-weight:700}
.marker-form input:not([type="file"]):not([type="checkbox"]),.marker-form textarea{width:100%;box-sizing:border-box;border:1px solid rgba(148,163,184,.28);border-radius:11px;padding:11px 12px;background:#0b1220;color:#f8fafc;font:inherit;font-weight:400;outline:none}
.marker-form textarea{resize:vertical;min-height:100px}
.marker-form input:focus,.marker-form textarea:focus{border-color:#8b5cf6;box-shadow:0 0 0 3px rgba(139,92,246,.16)}
.marker-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.marker-photo-field input{width:100%;font-size:12px;color:#cbd5e1}
.marker-current-photo{display:grid;gap:10px}
.marker-current-photo img{width:100%;max-height:220px;object-fit:contain;border-radius:12px;background:#080d16}
.marker-form .marker-remove-photo{display:flex;align-items:center;gap:8px;font-weight:500}
.marker-remove-photo input{width:16px;height:16px}
.marker-form-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:9px;margin-top:5px}
.marker-form-actions button{min-height:40px;padding:9px 14px;border-radius:10px;cursor:pointer}
.marker-form-actions button:disabled{opacity:.55;cursor:wait}
.marker-form-error{margin:0;color:#ffaaa5;font-size:13px;min-height:1em}
body.marker-modal-open{overflow:hidden}
@media(max-width:560px){
 .marker-modal{padding:8px;align-items:flex-end}
 .marker-modal-card{max-height:92vh;border-radius:18px 18px 12px 12px}
 .marker-modal-content{padding:15px}
 .marker-modal-head{padding:15px}
 .marker-form-grid{grid-template-columns:1fr}
 .marker-detail-list>div{grid-template-columns:90px minmax(0,1fr);gap:8px}
 .marker-form-actions{display:grid;grid-template-columns:1fr 1fr}
 .marker-form-actions button{width:100%}
}


/* Chat attachments */
.chat-compose{flex-wrap:wrap}
.chat-compose-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;width:100%}
.chat-file-input{display:none!important}
.chat-attach-btn{min-height:44px;padding:10px 15px;border:1px solid #8b6bc5;border-radius:11px;background:#f2ecff;color:#583a8a;font-size:12px;font-weight:800;cursor:pointer}
.chat-attach-btn:disabled{opacity:.55;cursor:wait}
.chat-attachment-preview{min-width:0;flex:1;color:#66508d;font-size:11px;overflow-wrap:anywhere}
.chat-attachment-card{display:flex;align-items:center;gap:11px;max-width:100%;margin-top:10px;padding:9px;border:1px solid #d8ccef;border-radius:11px;background:rgba(255,255,255,.72)}
.chat-image-link{display:block;flex:0 0 auto;max-width:190px}
.chat-image-link img{display:block;max-width:190px;max-height:150px;object-fit:cover;border-radius:8px}
.chat-file-icon{display:grid;place-items:center;flex:0 0 48px;height:48px;border-radius:9px;background:#e9e1f8;color:#5d3b91;font-size:10px;font-weight:900}
.chat-attachment-details{display:flex;flex-direction:column;gap:4px;min-width:0;overflow-wrap:anywhere}
.chat-attachment-details b{font-size:11px;color:#29364b}
.chat-attachment-details small{font-size:10px;color:#778397}
.chat-attachment-details a{font-size:11px;font-weight:800;color:#6845a5;text-decoration:underline}
@media(max-width:700px){.chat-compose-actions{gap:7px}.chat-attachment-preview{flex-basis:100%;order:3}.chat-attach-btn,.chat-send-btn{flex:1}.chat-image-link,.chat-image-link img{max-width:150px}}
/* Dark chat palette */
.chat-attach-btn{background:#25213b!important;color:#d9caff!important;border-color:#65528e!important}
.chat-attachment-card{background:#111d31!important;border-color:#3a4967!important}
.chat-file-icon{background:#30264d!important;color:#d9caff!important}
.chat-attachment-details b{color:#edf2ff!important}
.chat-attachment-details small{color:#aab7ce!important}
.chat-attachment-details a,.chat-attachment-preview{color:#c6aaff!important}


/* Chat mobile refresh 2026-11-20 */
.chat-panel{
  width:min(900px,calc(100vw - 28px));
  height:min(820px,calc(100dvh - 32px));
  max-height:calc(100dvh - 32px);
  overflow:hidden;
}
.chat-layout{flex:1;min-height:0;grid-template-columns:210px minmax(0,1fr)}
.chat-main{min-height:0;overflow:hidden}
.chat-messages{
  min-height:0;height:auto;max-height:none;flex:1;
  overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
  scrollbar-gutter:stable;
}
.chat-load-older{
  align-self:center;flex:0 0 auto;min-height:36px;margin:0 0 8px;
  padding:7px 14px;border:1px solid rgba(155,123,255,.35);
  border-radius:999px;background:rgba(132,98,220,.12);
  color:#cbbaff;font-size:12px;font-weight:750;cursor:pointer;
}
.chat-load-older:disabled{opacity:.55;cursor:wait}
.chat-load-older.hidden{display:none!important}
.chat-attachment-remove{
  flex:0 0 30px;width:30px;height:30px;border:1px solid rgba(255,130,150,.35);
  border-radius:9px;background:rgba(239,68,68,.12);color:#ff9aa9;
  font-size:20px;line-height:1;cursor:pointer
}
.chat-attachment-preview{display:flex;align-items:center;justify-content:space-between;gap:8px}
.chat-attachment-details a{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:34px;margin-top:4px;padding:6px 10px;
  border:1px solid rgba(155,123,255,.35);border-radius:8px;
  background:rgba(132,98,220,.12);font-weight:800;text-decoration:none
}
.chat-attachment-details a:active{transform:scale(.98)}
.chat-message{min-width:0}
.chat-message-meta{min-width:0}
.chat-message-meta b{overflow-wrap:anywhere}
.chat-image-link img{max-width:min(220px,42vw);max-height:190px}
.chat-compose{flex:0 0 auto}
@media(max-width:700px){
  body.chat-is-open{overflow:hidden;overscroll-behavior:none}
  .chat-backdrop{backdrop-filter:none}
  .chat-panel{
    inset:0!important;right:0!important;bottom:0!important;
    width:100vw!important;height:100dvh!important;max-height:100dvh!important;
    min-height:0;margin:0!important;padding:
      max(10px,env(safe-area-inset-top))
      max(10px,env(safe-area-inset-right))
      max(10px,env(safe-area-inset-bottom))
      max(10px,env(safe-area-inset-left))!important;
    border-radius:0!important;display:flex;flex-direction:column;
  }
  .chat-head{gap:8px;padding:3px 0 10px!important;margin:0 0 8px}
  .chat-head h2{font-size:18px;line-height:1.2}
  .chat-head p{font-size:11px;margin:3px 0 0}
  .chat-head-actions{gap:6px}
  #chatRefreshBtn{min-height:38px;padding:8px 10px;font-size:11px}
  .chat-close-btn{width:38px;height:38px;flex:0 0 38px}
  .chat-layout{
    display:flex!important;flex:1;flex-direction:column;gap:8px;
    min-height:0;overflow:hidden;
  }
  .chat-sidebar{flex:0 0 auto;padding:8px!important;border-radius:12px}
  .chat-sidebar label{gap:5px;font-size:11px}
  .chat-sidebar select{min-height:42px;padding:9px 12px;font-size:14px}
  .chat-sidebar .chat-privacy{display:none!important}
  .chat-main{display:flex;flex:1;min-height:0;overflow:hidden;gap:0}
  .chat-load-older{min-height:32px;margin:0 auto 6px;font-size:11px}
  .chat-messages{
    flex:1 1 0;height:auto!important;min-height:0!important;max-height:none!important;
    padding:10px!important;border-radius:12px;gap:9px;
    overscroll-behavior-y:contain;touch-action:pan-y;
  }
  .chat-message{max-width:94%;padding:10px 12px;border-radius:13px}
  .chat-message p{font-size:14px;line-height:1.48}
  .chat-message-meta{gap:7px;font-size:10px}
  .chat-message-meta time{font-size:9px}
  .chat-avatar{width:25px;height:25px}
  .chat-attachment-card{gap:8px;padding:8px}
  .chat-image-link{max-width:112px}
  .chat-image-link img{max-width:112px;max-height:112px}
  .chat-file-icon{flex-basis:38px;height:42px}
  .chat-attachment-details{font-size:11px}
  .chat-attachment-details b{font-size:10px}
  .chat-attachment-details a{min-height:38px;padding:7px 9px;font-size:12px}
  .chat-compose{
    flex:0 0 auto;display:flex;flex-direction:column;gap:8px;
    align-items:stretch;margin-top:8px;padding:9px!important;
    border-radius:13px;box-shadow:0 -4px 16px rgba(0,0,0,.16);
  }
  .chat-input-wrap{gap:4px}
  .chat-input-label{font-size:9px}
  .chat-compose textarea{
    min-height:54px!important;max-height:112px!important;height:54px;
    resize:none;padding:10px 11px;font-size:16px!important;line-height:1.4;
    border-radius:10px;overscroll-behavior:contain;
  }
  .chat-input-hint{font-size:9px;line-height:1.3}
  .chat-compose-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);gap:7px}
  .chat-attach-btn,.chat-send-btn{
    width:100%;min-width:0;min-height:44px;flex:auto;margin:0;
    padding:9px 10px;border-radius:10px;font-size:12px
  }
  .chat-attachment-preview{grid-column:1/-1;order:3;flex-basis:auto;font-size:10px}
  #chatError{flex:0 0 auto;margin:5px 2px 0;font-size:11px}
}
@media(max-width:380px){
  .chat-panel{padding-left:8px!important;padding-right:8px!important}
  .chat-head h2{font-size:16px}
  .chat-head p{display:none}
  .chat-compose textarea{min-height:48px!important;height:48px}
  .chat-message{max-width:97%}
}
@media(orientation:landscape) and (max-height:520px) and (max-width:900px){
  .chat-panel{padding-top:max(5px,env(safe-area-inset-top))!important;padding-bottom:max(5px,env(safe-area-inset-bottom))!important}
  .chat-head{padding-bottom:4px!important;margin-bottom:4px}
  .chat-head p,.chat-input-hint{display:none}
  .chat-sidebar{padding:5px!important}
  .chat-sidebar select{min-height:36px}
  .chat-compose textarea{min-height:42px!important;height:42px}
}


/* Отчёты сотрудников по выездам на маркеры */
.marker-reports{margin:20px 0 8px;padding:16px;border:1px solid rgba(148,163,184,.2);border-radius:16px;background:rgba(15,23,42,.38)}
.marker-reports-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.marker-reports-heading h3{margin:0;font-size:17px;color:#f8fafc}
.marker-report-item{padding:12px 0;border-bottom:1px solid rgba(148,163,184,.16)}
.marker-report-item:last-child{border-bottom:0}
.marker-report-meta{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:13px;color:#e2e8f0}
.marker-report-meta time{color:#94a3b8;font-size:12px}
.marker-report-item p{margin:8px 0 0;color:#e2e8f0;font-size:14px;line-height:1.55;overflow-wrap:anywhere}
.marker-report-hint{font-size:12px;line-height:1.45;margin:10px 0}
.marker-report-form{display:grid;gap:10px;margin-top:12px}
.marker-report-form label{display:grid;gap:7px;font-size:13px;color:#dbeafe}
.marker-report-form textarea{width:100%;min-height:110px;resize:vertical;border:1px solid rgba(148,163,184,.3);border-radius:12px;background:#0b1220;color:#f8fafc;padding:11px;font:inherit}
.marker-report-form button{justify-self:start}


/* AUTH_DARK_WINDOWS_ */
#authView .auth-panel {
    background: linear-gradient(145deg, #17151f, #0d0c13) !important;
    color: #f5f2ff !important;
    border: 1px solid rgba(151, 105, 255, .35) !important;
    box-shadow: 0 24px 70px rgba(0,0,0,.48),
                0 0 35px rgba(116,65,210,.12) !important;
}

#authView .auth-panel h2,
#authView .auth-panel label {
    color: #f5f2ff !important;
}

#authView .auth-panel .muted,
#authView .auth-panel .form-hint,
#authView .auth-panel .auth-benefits,
#authView .auth-panel .auth-switch {
    color: #aaa4bb !important;
}

#authView .auth-panel input,
#authView .auth-panel select {
    background: #0b0a10 !important;
    color: #ffffff !important;
    border: 1px solid #393344 !important;
    border-radius: 10px;
}

#authView .auth-panel input::placeholder {
    color: #777184 !important;
}

#authView .auth-panel input:focus,
#authView .auth-panel select:focus {
    border-color: #9461ed !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(148,97,237,.18) !important;
}

#authView .auth-panel .form-mark {
    color: #b38aff !important;
}

#authView .auth-panel .primary {
    background: linear-gradient(135deg, #7541c8, #54269b) !important;
    color: white !important;
    border: 1px solid #9565e5 !important;
}

#authView .auth-panel .primary:hover {
    filter: brightness(1.15);
}

#authView .auth-panel .text-button {
    color: #b995ff !important;
}

#authView .auth-panel .text-button:hover {
    color: #d5c0ff !important;
}


/* MOBILE_CANCEL_ROUTE_BUTTON_V1 */
@media (max-width:700px) {
  .map-actions {
    width:100%;
    display:flex;
    flex-wrap:wrap;
    gap:7px;
  }
  .map-actions .map-tool-btn {
    flex:1 1 calc(50% - 7px);
    min-width:0;
    min-height:42px;
    white-space:normal;
  }
  #cancelRouteBtn:not(.hidden) {
    display:block!important;
    flex:1 1 100%;
    order:99;
    min-height:48px;
    padding:12px 14px;
    background:#b83232!important;
    color:#fff!important;
    font-size:13px;
    font-weight:850;
    box-shadow:0 5px 14px rgba(184,50,50,.22);
  }
}


/* Результаты адресного поиска 2ГИС */
.map-search-results{margin:0 20px 12px;border:1px solid #dfe6e1;border-radius:11px;background:#fff;overflow:hidden;max-height:260px;overflow-y:auto}
.map-search-results.hidden{display:none}
.map-search-results-heading{padding:9px 12px;background:#f5f7f5;color:#64746b;font-size:10px;font-weight:750}
.map-search-result{display:flex;width:100%;flex-direction:column;align-items:flex-start;gap:4px;padding:10px 12px;border:0;border-top:1px solid #edf0ed;border-radius:0;background:#fff;color:#26372d;text-align:left;cursor:pointer}
.map-search-result:hover{background:#f4f0fb}
.map-search-result strong{font-size:11px;font-weight:750;line-height:1.4}
.map-search-result span{font-size:9px;color:#718077;line-height:1.45}
@media(max-width:620px){.map-search-results{margin:0 10px 10px;max-height:220px}.map-search-result{padding:11px}}


/* Техническая поддержка Maloy */
.support-telegram-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff !important;
  background: linear-gradient(135deg, #8067e9, #5140b8);
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(105,84,217,.2);
  transition: .2s;
}
.support-telegram-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 11px 23px rgba(105,84,217,.3);
}
@media(max-width:700px) {
  .support-telegram-btn {
    width: 100%;
    padding: 10px 12px;
    font-size: 11px;
  }
}

.marker-report-photo-preview,.marker-report-photos{display:flex;flex-wrap:wrap;gap:9px;margin-top:10px}
.marker-report-photo-preview span{font-size:12px;color:#cbd5e1;background:rgba(100,116,139,.2);padding:6px 9px;border-radius:8px;overflow-wrap:anywhere}
.marker-report-photos img{display:block;width:112px;height:112px;object-fit:cover;border-radius:10px;border:1px solid rgba(148,163,184,.25)}
.marker-report-form input[type=file]{max-width:100%;color:#cbd5e1;font:inherit}


/* Исправление размеров окна проверки */
#markerModal {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  padding: 8px;
  box-sizing: border-box;
  overflow: hidden;
}

#markerModal .marker-modal-card {
  width: 100%;
  max-width: 560px;
  min-width: 0;
  max-height: 92dvh;
  margin: auto;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
}

#markerModal .marker-modal-content,
#markerModal .marker-detail-list,
#markerModal .marker-detail-list > div,
#markerModal .marker-detail-list dd,
#markerModal .marker-reports,
#markerModal #markerReportsList,
#markerModal .marker-report-item,
#markerModal .marker-report-form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#markerModal .marker-report-item,
#markerModal .marker-report-item p,
#markerModal .marker-detail-list dd {
  overflow-wrap: anywhere;
  word-break: break-word;
}

#markerModal .marker-report-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
}

#markerModal .marker-report-photos a {
  display: block;
  min-width: 0;
  max-width: 100%;
}

#markerModal .marker-report-photos img,
#markerModal .marker-report-photo-preview img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

#markerModal .marker-report-form textarea,
#markerModal .marker-report-form input[type="file"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 560px) {
  #markerModal .marker-modal-card {
    max-height: 92dvh;
  }

  #markerModal .marker-modal-content {
    padding: 12px;
  }

  #markerModal .marker-detail-list > div {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 8px;
  }
}

/* Компактная кнопка сворачивания участников онлайн */
.online-panel-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.online-collapse-btn {
  flex:0 0 24px;
  width:24px;
  height:24px;
  min-height:24px;
  padding:0;
  display:grid;
  place-items:center;
  border:1px solid rgba(148,163,184,.28);
  border-radius:7px;
  background:rgba(148,163,184,.10);
  color:#d8c5ff;
  font-size:17px;
  line-height:1;
  cursor:pointer;
}
.online-collapse-btn:active { transform:scale(.94); }
.online-panel #onlineParticipantsList {
  overflow:hidden;
  transition:max-height .22s ease, opacity .18s ease;
  max-height:1200px;
  opacity:1;
}
.online-panel.is-collapsed #onlineParticipantsList {
  max-height:0;
  opacity:0;
  display:none;
}

/* Компактное сворачивание списка сотрудников */
.employees-panel-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.employees-panel-actions { display:flex; align-items:center; gap:6px; flex:0 0 auto; }
.employees-panel #peopleList { overflow:hidden; }
.employees-panel.is-collapsed #peopleList { display:none; }


/* Отдельный статус независимого подтверждения координат GPS */
.gps-confirm-button{min-height:40px;padding:9px 14px;border-radius:10px;cursor:pointer}
.gps-confirm-button:disabled,.gps-permission-button:disabled{opacity:.55;cursor:wait}

.gps-employee-select-label{display:grid;gap:6px;margin:0 0 10px;font-size:13px}.gps-employee-select-label select{width:100%;min-height:40px;padding:8px 10px;border:1px solid var(--line,#555);border-radius:9px;background:var(--panel,#20242b);color:inherit}

/* ===== Красивое отдельное меню статистики операторов ===== */
#operatorStatsPanel {
  position: relative;
  overflow: hidden;
  padding: 0 !important;
  margin: 18px 0 22px !important;
  border: 1px solid rgba(155,123,255,.32) !important;
  border-radius: 22px !important;
  background: linear-gradient(145deg,#18233a 0%,#10182a 65%,#17152e 100%) !important;
  box-shadow: 0 22px 65px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.04) !important;
}
#operatorStatsPanel:before {
  content:"";
  display:block;
  height:4px;
  background:linear-gradient(90deg,#8b5cf6,#5ee7df,#8b5cf6);
}
#operatorStatsPanel.hidden { display:none !important; }

.operator-stats { padding:25px; color:#edf1ff; }
.operator-stats-heading {
  display:flex;
  align-items:center;
  gap:16px;
  margin-bottom:24px;
}
.operator-stats-icon {
  display:grid;
  place-items:center;
  flex:0 0 58px;
  width:58px;
  height:58px;
  border-radius:18px;
  font-size:27px;
  background:linear-gradient(145deg,rgba(139,92,246,.32),rgba(94,231,223,.12));
  border:1px solid rgba(167,139,250,.3);
  box-shadow:0 8px 25px rgba(109,69,197,.2);
}
.operator-stats-title { flex:1; min-width:0; }
.operator-stats-kicker {
  color:#a99aff;
  font-size:9px;
  font-weight:900;
  letter-spacing:2px;
}
.operator-stats-title h2 {
  margin:5px 0;
  color:#f4f2ff !important;
  font-size:21px;
  font-weight:850;
  letter-spacing:-.5px;
}
.operator-stats-title p {
  margin:0;
  color:#98a7c2;
  font-size:12px;
}
.operator-stats-close {
  width:38px;
  height:38px;
  border-radius:12px;
  color:#cbd5e1;
  background:#26334d;
  border:1px solid #394765;
  cursor:pointer;
  font-size:16px;
}
.operator-stats-close:hover {
  color:white;
  background:#49366e;
}
.operator-stats-search {
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 16px;
  height:52px;
  margin-bottom:20px;
  border:1px solid #354361;
  border-radius:15px;
  background:rgba(8,15,30,.72);
  color:#a995ff;
  font-size:23px;
  transition:.2s;
}
.operator-stats-search:focus-within {
  border-color:#9677f5;
  box-shadow:0 0 0 3px rgba(139,92,246,.15);
}
.operator-stats-search input {
  width:100%;
  min-width:0;
  border:0 !important;
  outline:0 !important;
  background:transparent !important;
  color:#f1f5ff !important;
  box-shadow:none !important;
  font-size:13px;
}
.operator-stats-search input::placeholder { color:#7786a2 !important; }
.operator-stats-list-heading {
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:0 14px 11px;
  color:#8191ad;
  font-size:9px;
  font-weight:900;
  letter-spacing:1.3px;
}
#operatorMarkerStatsList {
  display:flex;
  flex-direction:column;
  gap:8px;
}
#operatorMarkerStatsList > div {
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  min-height:55px;
  padding:11px 15px !important;
  border:1px solid rgba(129,149,184,.14) !important;
  border-radius:13px;
  background:linear-gradient(100deg,rgba(39,51,78,.72),rgba(24,34,57,.72)) !important;
  color:#e7ecfa;
  transition:transform .18s,border-color .18s,background .18s;
}
#operatorMarkerStatsList > div:hover {
  transform:translateY(-2px);
  border-color:rgba(155,123,255,.5) !important;
  background:linear-gradient(100deg,rgba(57,48,94,.8),rgba(27,43,68,.85)) !important;
}
#operatorMarkerStatsList > div span {
  color:#e4e9f8;
  font-size:12px;
  font-weight:650;
}
#operatorMarkerStatsList > div strong {
  display:grid;
  place-items:center;
  min-width:43px;
  height:34px;
  padding:0 10px;
  border:1px solid rgba(167,139,250,.25);
  border-radius:10px;
  background:rgba(139,92,246,.17);
  color:#c9baff;
  font-size:15px;
  font-weight:900;
}
.operator-stats-footer {
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px;
  margin-top:19px;
  padding-top:15px;
  border-top:1px solid rgba(148,163,184,.13);
  color:#71819e;
  font-size:10px;
}
#operatorStatsToggleBtn {
  border:1px solid rgba(167,139,250,.35) !important;
  border-radius:12px !important;
  padding:11px 15px !important;
  color:#e7ddff !important;
  background:linear-gradient(135deg,#49377e,#302956) !important;
  box-shadow:0 7px 20px rgba(75,55,130,.24);
  font-weight:800;
  transition:transform .2s,box-shadow .2s;
}
#operatorStatsToggleBtn:hover {
  transform:translateY(-2px);
  box-shadow:0 11px 25px rgba(109,69,197,.3);
}
@media(max-width:700px) {
  .operator-stats { padding:16px; }
  .operator-stats-heading { gap:11px; }
  .operator-stats-icon { width:45px;height:45px;flex-basis:45px;border-radius:14px;font-size:22px; }
  .operator-stats-title h2 { font-size:16px; }
  .operator-stats-title p { font-size:10px; }
  .operator-stats-list-heading { font-size:8px; }
  .operator-stats-footer { font-size:9px; }
}


/* COMPACT ADMIN HELP */
.admin-help-guide{
  margin:8px 0 12px!important;
  border-radius:12px!important;
}
.admin-help-guide>details>summary{
  min-height:38px;
  padding:9px 12px!important;
  gap:8px;
  font-size:12px!important;
}
.admin-help-guide>details>summary span{
  font-size:12px;
  font-weight:800;
}
.admin-help-guide summary small{
  font-size:10px!important;
}
.admin-help-content{
  padding:0 9px 9px!important;
  gap:5px!important;
}
.admin-help-lead{
  margin:2px 2px 6px!important;
  font-size:10px!important;
  line-height:1.4!important;
}
.admin-help-content details{
  border-radius:8px!important;
}
.admin-help-content details>summary{
  min-height:32px;
  padding:8px 10px!important;
  font-size:11px!important;
  line-height:1.3;
}
.admin-help-content ul{
  margin:6px 10px 9px!important;
  padding-left:16px!important;
  gap:4px!important;
  font-size:10px!important;
  line-height:1.4!important;
}
.admin-help-note{
  padding:8px 10px!important;
  font-size:10px!important;
  line-height:1.4!important;
}
@media(max-width:600px){
  .admin-help-guide>details>summary{
    align-items:flex-start;
  }
  .admin-help-guide summary small{
    flex-basis:100%;
  }
}

/* FIX: доступность аналитики маркеров */
#operatorStatsToggleBtn:not(.hidden) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  white-space: nowrap;
}


/* MOBILE APP DOWNLOAD CARD */
.mobile-app-download {
  position: relative;
  overflow: hidden;
  margin-top: 16px !important;
  padding: 22px !important;
  color: #f4f0ff !important;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(139,92,246,.22), transparent 55%),
    linear-gradient(145deg, #17172b, #211a38 65%, #171c30) !important;
  border: 1px solid rgba(167,139,250,.3) !important;
  border-radius: 20px !important;
  box-shadow: 0 14px 36px rgba(0,0,0,.2);
}

.mobile-app-top {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mobile-app-icon {
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  color: #c4a7ff;
  background: linear-gradient(145deg, #493276, #30234e);
  border: 1px solid rgba(196,167,255,.24);
  border-radius: 17px;
}

.mobile-app-heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mobile-app-kicker {
  color: #b99bea;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.mobile-app-heading h2 {
  margin: 0;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.4px;
}

.mobile-app-platform {
  color: #a9a4bd;
  font-size: 12px;
}

.mobile-app-description {
  margin: 19px 0 !important;
  color: #d0cadd !important;
  font-size: 13px;
  line-height: 1.65;
}

.mobile-app-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 49px;
  box-sizing: border-box;
  padding: 13px 16px;
  color: #fff !important;
  background: linear-gradient(110deg, #8958df, #6842bd);
  border: 1px solid rgba(210,190,255,.2);
  border-radius: 13px;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(105,66,189,.3);
  transition: transform .2s, filter .2s, box-shadow .2s;
}

.mobile-app-download-btn:hover {
  color: #fff !important;
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 12px 27px rgba(105,66,189,.4);
}

.mobile-app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 15px;
  color: #9690aa;
  font-size: 10px;
  letter-spacing: .3px;
}

.mobile-app-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8b70d5;
  box-shadow: 0 0 9px rgba(139,112,213,.65);
}

@media(max-width:700px) {
  .mobile-app-download {
    padding: 18px !important;
    border-radius: 17px !important;
  }
  .mobile-app-heading h2 {
    font-size: 19px;
  }
  .mobile-app-description {
    font-size: 12px;
  }
}


/* ANDROID_WEBVIEW_MOBILE_LAYOUT_V1
   Mobile-only layout refinements. Desktop rules remain unchanged. */
@media screen and (max-width: 700px) {
  html {
    width: 100%;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-bottom: 24px;
  }

  body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    overscroll-behavior-x: none;
  }

  button, a, input, select, textarea {
    touch-action: manipulation;
  }

  button, .map-tool-btn, .icon-btn {
    min-height: 42px;
  }

  input, select, textarea {
    font-size: 16px !important;
    max-width: 100%;
  }

  .shell {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 12px;
    padding-right: 12px;
    overflow-x: clip;
  }

  .topbar {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 8px;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand b, .brand small, .header-user {
    overflow-wrap: anywhere;
  }

  .header-user {
    max-width: 42vw;
  }

  .welcome-row {
    min-width: 0;
  }

  .welcome-actions {
    min-width: 0;
    flex-wrap: wrap;
  }

  .content-grid,
  .side-column,
  .panel,
  .map-panel {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  #map {
    height: min(58dvh, 520px);
    min-height: 330px;
    max-height: 520px;
    width: 100%;
    touch-action: pan-x pan-y;
  }

  .map-tools {
    min-width: 0;
    gap: 8px;
  }

  .map-search,
  .map-actions {
    min-width: 0;
    max-width: 100%;
  }

  .map-search input {
    min-width: 0;
    width: 100%;
  }

  .map-actions .map-tool-btn {
    min-height: 44px;
  }

  #mapPanel:fullscreen,
  #mapPanel.is-fullscreen {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  #mapPanel:fullscreen #map,
  #mapPanel.is-fullscreen #map {
    min-height: 0;
    height: auto !important;
    max-height: none !important;
    flex: 1 1 0;
  }

  .chat-panel {
    box-sizing: border-box;
    max-width: 100vw;
    max-height: 100dvh;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  .chat-layout,
  .chat-main,
  .chat-messages {
    min-height: 0;
    min-width: 0;
  }

  .chat-messages {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .chat-compose textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  .profile-modal,
  #markerModal {
    box-sizing: border-box;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }

  .profile-card {
    max-height: calc(100dvh - 16px);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .panel, .profile-card, .chat-panel {
    overflow-wrap: anywhere;
  }
}

@media screen and (max-width: 380px) {
  .shell {
    padding-left: 9px;
    padding-right: 9px;
  }

  .welcome-row h1 {
    font-size: 22px;
  }

  #map {
    min-height: 300px;
    height: 52dvh;
  }
}

@media screen and (orientation: landscape) and (max-height: 520px) and (max-width: 900px) {
  #map {
    height: 62dvh;
    min-height: 220px;
  }
}

/* ================================================================
   FRN /  — DESKTOP INTERFACE 2026
   Visual layer only: existing IDs, API hooks and application logic stay intact.
   ================================================================ */
:root{
  --frn-bg:#070b14;
  --frn-surface:#101827;
  --frn-surface-2:#141f32;
  --frn-surface-3:#1a2740;
  --frn-border:rgba(153,170,205,.16);
  --frn-border-strong:rgba(157,130,255,.32);
  --frn-text:#edf2ff;
  --frn-muted:#91a0bb;
  --frn-violet:#9878ff;
  --frn-cyan:#55d8dc;
  --frn-green:#35c995;
  --frn-shadow:0 22px 65px rgba(0,0,0,.34);
}
html{scroll-behavior:smooth}
body{background:var(--frn-bg);color:var(--frn-text);font-family:Inter,"Segoe UI",Arial,sans-serif;letter-spacing:.005em}
.app-bg{background:
  radial-gradient(ellipse at 8% 0%,rgba(116,83,220,.22),transparent 34%),
  radial-gradient(ellipse at 92% 10%,rgba(39,169,184,.12),transparent 30%),
  linear-gradient(rgba(137,157,201,.025) 1px,transparent 1px),
  linear-gradient(90deg,rgba(137,157,201,.025) 1px,transparent 1px),
  linear-gradient(145deg,#070b14,#0a1220 58%,#080e19);
  background-size:auto,auto,36px 36px,36px 36px,auto}
.shell{max-width:1880px;padding-left:30px;padding-right:30px}
.topbar{height:78px;margin-bottom:25px;border-bottom:1px solid var(--frn-border-strong);backdrop-filter:blur(18px)}
.brand{gap:15px}
.brand-icon{width:46px;height:46px;border-radius:15px;background:linear-gradient(145deg,#a48aff,#6449c4 62%,#28536e);box-shadow:0 8px 30px rgba(119,91,221,.32),inset 0 1px 0 rgba(255,255,255,.22)}
.brand b{font-size:13px;letter-spacing:1.8px;color:#f7f8ff}
.brand small{font-size:9px;letter-spacing:1.8px;color:#a9b4d0}
.topbar:after{margin-right:20px;border-color:rgba(85,216,220,.2);background:linear-gradient(100deg,rgba(152,120,255,.14),rgba(85,216,220,.07));color:#c5b9ff}
.header-user{border:1px solid var(--frn-border);background:rgba(18,28,47,.8);color:#d8e0f3;padding:9px 14px}
.welcome-row{align-items:center;margin-bottom:20px;gap:22px}
.welcome-row h1{font-size:34px;letter-spacing:-1.1px;margin:6px 0 2px}
.welcome-row .eyebrow{color:var(--frn-cyan)}
.welcome-actions{gap:8px;flex-wrap:wrap;justify-content:flex-end}
.welcome-actions button,.welcome-actions a{min-height:42px;border-radius:12px;font-size:11px}
.profile-open-btn,.admin-manage-btn,.support-telegram-btn,.welcome-actions .secondary{border:1px solid var(--frn-border);background:rgba(20,31,50,.92);color:#dce5f8}
.profile-open-btn:hover,.admin-manage-btn:hover,.support-telegram-btn:hover,.welcome-actions .secondary:hover{border-color:rgba(152,120,255,.48);background:#1a2942}
.content-grid{grid-template-columns:minmax(0,1fr) 365px;gap:18px;align-items:start}
.panel{border:1px solid var(--frn-border);border-radius:19px;background:linear-gradient(155deg,rgba(19,29,47,.97),rgba(12,19,33,.98));box-shadow:var(--frn-shadow);backdrop-filter:blur(16px)}
.panel h2,.panel h3{color:#f2f5ff}
.muted,.small,.footer-note{color:var(--frn-muted)}
.eyebrow,.section-kicker{color:#a995ff;letter-spacing:1.7px}
.map-panel{overflow:hidden;border-color:rgba(152,120,255,.24);box-shadow:0 25px 75px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.025)}
.map-panel>.panel-head{padding:21px 23px 16px;border-bottom:1px solid rgba(153,170,205,.1);background:linear-gradient(110deg,rgba(24,35,58,.78),rgba(14,22,38,.3))}
.map-panel>.panel-head h2{font-size:19px;letter-spacing:-.45px}
.map-panel>.panel-head .muted{max-width:760px;font-size:10px;line-height:1.55}
.layer-control{min-width:170px;color:#aab7d1;font-size:9px}
.layer-control select{background:#0b1424;border:1px solid #33415d;color:#eaf0ff;border-radius:11px;padding:11px 13px}
.map-tools{display:grid;grid-template-columns:minmax(260px,1fr) auto;gap:11px 14px;padding:15px 19px 13px;background:#0e1727;border-bottom:1px solid rgba(153,170,205,.1)}
.map-search{min-width:0;align-items:center}
.map-search input,.marker-fio-search-controls input{max-width:none;min-height:42px;background:#091321;border:1px solid #2c3a55;color:#edf2ff;border-radius:11px;padding:11px 14px;font-size:12px}
.map-search input::placeholder,.marker-fio-search-controls input::placeholder{color:#74839e}
.map-search button,.marker-fio-search-controls button{min-height:42px;padding:10px 16px;font-size:11px}
.map-actions{flex-wrap:wrap;justify-content:flex-end;gap:7px}
.map-tool-btn{min-height:40px;border:1px solid #2b3954;background:#18253b;color:#dce5f8;border-radius:10px;padding:9px 12px;font-size:10px}
.map-tool-btn:hover{background:#243653;border-color:rgba(152,120,255,.42);color:#fff}
.marker-fio-search{grid-column:1/-1;margin:0;padding-top:2px}
.marker-fio-search-controls input{max-width:560px;min-width:220px}
.marker-fio-search-info{color:#8292ae;font-size:10px}
#map{height:clamp(520px,64vh,760px);min-height:520px;max-height:760px;background:#111c2c}
.map-search-results{margin:0 18px 12px;border:1px solid var(--frn-border);border-radius:12px;background:#111d30;color:#eaf0ff;overflow:hidden}
.place-info{margin:14px 16px 12px;padding:17px 19px;background:linear-gradient(145deg,#17243a,#111b2e);border:1px solid #2a3a57;border-radius:15px}
.place-info h3{font-size:15px}
.place-kind{background:rgba(152,120,255,.16);color:#d7ccff;border:1px solid rgba(152,120,255,.2)}
.place-address,.place-description{color:#c3cde1}
.place-fact{background:#0e192b;border-color:#2a3852}
.legend{padding:13px 19px 16px;color:#9eabc3;font-size:10px;border-top:1px solid rgba(153,170,205,.08)}
.side-column{gap:14px;position:sticky;top:16px;max-height:calc(100vh - 32px);overflow:auto;padding-right:3px;scrollbar-width:thin;scrollbar-color:#344362 transparent}
.side-column>.panel{padding:19px 19px 17px;border-radius:17px}
.side-column .panel h2{font-size:16px}
.side-column .panel-head.compact{padding:0 0 11px}
.share-panel{border-color:rgba(85,216,220,.2);background:linear-gradient(145deg,rgba(17,37,49,.98),rgba(13,23,38,.98))}
.sharing-status{background:#17253b;border:1px solid #2d3d59;color:#c7d3e9;border-radius:11px;padding:12px 13px;font-weight:750;font-size:12px}
.sharing-status.active{background:rgba(34,185,133,.12);border-color:rgba(53,201,149,.25);color:#78e4bd}
.auto-gps{background:#111e31;border:1px solid #293954;color:#c2cde2;border-radius:11px;padding:11px 12px}
.auto-gps input{accent-color:#9878ff}
.share-panel .primary{min-height:43px}
.share-panel .danger{min-height:42px;background:rgba(244,63,94,.13);border:1px solid rgba(244,63,94,.2);color:#ff9cac}
.employees-panel{border-color:rgba(152,120,255,.22)}
.employees-panel-head{border-bottom:1px solid rgba(153,170,205,.1);margin-bottom:8px}
.online-count{background:rgba(85,216,220,.13);color:#70e0df;border:1px solid rgba(85,216,220,.17);border-radius:99px;padding:3px 8px;font-size:10px}
.person,.admin-user-row,.online-person{border-color:rgba(153,170,205,.12)}
.person{padding:11px 8px;border-radius:11px;transition:background .18s,border-color .18s}
.person:hover{background:rgba(152,120,255,.08);border-color:rgba(152,120,255,.2)}
.person-name{color:#edf2ff;font-size:12px}
.person-meta{color:#8e9db8;font-size:10px}
.avatar{background:linear-gradient(145deg,#3b3262,#1c3450);color:#e0d7ff;border:1px solid rgba(178,158,255,.2)}
.state{background:#202d44;color:#b9c6dd}
.state.online{background:rgba(53,201,149,.13);color:#77e3bd}
.state.stale{background:rgba(240,180,75,.13);color:#f3cc7b}
.icon-btn,.online-collapse-btn{background:#1b2941;color:#dce5f8;border:1px solid #30415e}
.mobile-app-download{border-color:rgba(85,216,220,.2);background:linear-gradient(145deg,#142c3b,#111c30)}
.admin-panel{background:linear-gradient(145deg,#17213a,#10192c);border-color:rgba(152,120,255,.32)}
.admin-panel h2{font-size:18px}
.admin-panel input,.admin-panel select,.admin-panel textarea,.admin-create-form input,.admin-create-form select{background:#091321!important;border-color:#33415d!important;color:#edf2ff!important}
.admin-help-guide,.admin-notifications,.admin-help-content details,.admin-notification{background:#101b2d!important;border-color:#2b3a55!important;color:#eaf0ff!important}
.admin-help-content details[open]>summary,.admin-notification.unread{background:#1b2942!important;border-color:rgba(152,120,255,.35)!important}
.stats-row{gap:13px;margin-bottom:18px}
.stat-card{background:linear-gradient(145deg,#17243a,#101a2c);border:1px solid var(--frn-border);border-radius:16px;padding:16px 18px;box-shadow:0 14px 32px rgba(0,0,0,.2)}
.stat-card span{color:#aab7d0}.stat-card strong{color:#f4f6ff;font-size:27px}.stat-card small{color:#8190ab}
input,select,textarea{background:#0b1424;border:1px solid #2d3b56;color:#edf2ff;border-radius:11px}
input:focus,select:focus,textarea:focus{border-color:#9878ff;box-shadow:0 0 0 3px rgba(152,120,255,.16);background:#101a2d}
button{border-radius:11px;transition:transform .16s ease,filter .16s ease,border-color .16s ease,background .16s ease}
button:hover{filter:brightness(1.08)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--frn-cyan);outline-offset:3px}
.primary,.chat-send-btn,.chat-open-btn{background:linear-gradient(120deg,#9271f2,#6449c1 62%,#247e91);border:1px solid rgba(190,175,255,.23);color:#fff;box-shadow:0 9px 24px rgba(105,75,194,.22)}
.secondary{background:#1c2a42;border:1px solid #30415e;color:#dce5f8}
.danger{background:rgba(244,63,94,.14);border:1px solid rgba(244,63,94,.22);color:#ff9eae}
.profile-card,.chat-panel,.marker-modal-card{background:linear-gradient(155deg,#17233a,#0d1627);border:1px solid rgba(152,120,255,.3);box-shadow:0 30px 100px rgba(0,0,0,.65)}
.chat-panel{border-radius:20px}
.chat-messages{background:#091321!important;border-color:#2b3b58!important}
.chat-message{background:#182640!important;border-color:#30415d!important}
.chat-message.own{background:rgba(105,76,184,.25)!important;border-color:rgba(152,120,255,.3)!important}
.footer-note{border-top:1px solid var(--frn-border);margin-top:26px;padding-top:17px;color:#7585a1}

@media(min-width:1500px){
  .content-grid{grid-template-columns:minmax(0,1fr) 390px;gap:20px}
  .side-column>.panel{padding:21px}
}
@media(max-width:1250px) and (min-width:981px){
  .shell{padding-left:20px;padding-right:20px}
  .content-grid{grid-template-columns:minmax(0,1fr) 330px;gap:14px}
  .welcome-actions{max-width:62%}
  .map-actions{justify-content:flex-start}
}
@media(max-width:980px){
  .shell{padding-left:16px;padding-right:16px}
  .side-column{position:static;max-height:none;overflow:visible;padding:0}
  .map-tools{display:flex}
  #map{height:540px;min-height:400px;max-height:620px}
}
@media(max-width:620px){
  .shell{padding-left:12px;padding-right:12px}
  .topbar{height:68px;margin-bottom:16px}
  .brand b{font-size:10px;letter-spacing:1px}
  .brand small{font-size:7px;letter-spacing:.8px}
  .welcome-actions{justify-content:stretch}
  .welcome-actions button,.welcome-actions a{min-height:42px}
  .map-panel>.panel-head{padding:15px}
  .map-tools{padding:12px;gap:9px}
  .map-search{min-width:100%}
  .map-actions{width:100%;justify-content:stretch;flex-wrap:wrap}
  .map-actions .map-tool-btn{flex:1 1 30%;min-height:42px}
  .marker-fio-search{flex-direction:column;align-items:stretch}
  .marker-fio-search-controls{flex-wrap:wrap}
  .marker-fio-search-controls input{flex:1 0 100%;max-width:none}
  #map{height:52dvh;min-height:340px;max-height:560px}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{transition:none!important;animation:none!important}}


/* MAP EXPANSION + MOBILE APP VISIBILITY — 2026-11-27 */
@media (min-width: 981px) {
  .shell { max-width: 2040px; padding-left: 24px; padding-right: 24px; }
  .content-grid { grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; }
  #map { height: clamp(660px, 76vh, 980px); min-height: 660px; max-height: 980px; }
  .side-column { max-height: calc(100vh - 28px); }
}
@media (min-width: 1500px) {
  .content-grid { grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; }
}
.mobile-app-download {
  order: -1;
  margin: 0 0 14px !important;
  padding: 20px !important;
  border: 1px solid rgba(85,216,220,.42) !important;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(85,216,220,.18), transparent 58%),
    linear-gradient(145deg, #172a3c, #171b35 70%, #111c30) !important;
  box-shadow: 0 14px 38px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.04) !important;
}
.mobile-app-download::before {
  content: "ДЛЯ ANDROID";
  display: inline-flex;
  margin-bottom: 13px;
  padding: 5px 9px;
  border: 1px solid rgba(85,216,220,.25);
  border-radius: 999px;
  color: #77e5e2;
  background: rgba(85,216,220,.08);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.2px;
}
.mobile-app-download-btn {
  min-height: 52px;
  background: linear-gradient(110deg, #9271f2, #6449c1 62%, #247e91);
  box-shadow: 0 9px 24px rgba(105,75,194,.28);
}
@media (max-width: 980px) {
  #map { height: 64dvh; min-height: 440px; max-height: 760px; }
  .mobile-app-download { order: -1; }
}
@media (max-width: 620px) {
  #map { height: 60dvh; min-height: 380px; max-height: 620px; }
  .mobile-app-download { margin-bottom: 12px !important; }
}



/* FIX: полный список сотрудников без вложенной прокрутки */
.side-column {
  position: static !important;
  top: auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding-right: 0 !important;
}
.employees-panel {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
.employees-panel #peopleList,
.employees-panel .people-list {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  padding-bottom: 16px !important;
  box-sizing: border-box !important;
}
.employees-panel #peopleList > .person:last-child {
  margin-bottom: 8px !important;
}

/* Скрыть общий список участников онлайн для всех ролей */
.online-panel {
    display: none !important;
}

/* Независимая прокрутка боковой панели */
@media (min-width: 981px) {
  .side-column {
    position: sticky !important;
    top: 14px !important;
    align-self: start !important;
    height: calc(100vh - 28px) !important;
    max-height: calc(100vh - 28px) !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #596b91 #171d2a;
    padding: 0 7px 14px 0 !important;
    box-sizing: border-box !important;
  }

  .side-column::-webkit-scrollbar {
    width: 7px;
  }

  .side-column::-webkit-scrollbar-track {
    background: #171d2a;
    border-radius: 10px;
  }

  .side-column::-webkit-scrollbar-thumb {
    background: #596b91;
    border-radius: 10px;
  }

  .side-column::-webkit-scrollbar-thumb:hover {
    background: #8298c4;
  }
}

/* На телефонах боковая панель идёт обычным потоком */
@media (max-width: 980px) {
  .side-column {
    position: static !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }
}

/* ANDROID CARD: исправление обрезания */
#mobileAppSection.mobile-app-download {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  padding: 16px !important;
}

#mobileAppSection .mobile-app-top {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  min-width: 0 !important;
}

#mobileAppSection .mobile-app-icon {
  flex: 0 0 48px !important;
  width: 48px !important;
  height: 48px !important;
}

#mobileAppSection .mobile-app-heading {
  flex: 1 1 150px !important;
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
}

#mobileAppSection .mobile-app-heading h2 {
  font-size: 19px !important;
  line-height: 1.25 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

#mobileAppSection .mobile-app-kicker,
#mobileAppSection .mobile-app-platform {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

#mobileAppSection .mobile-app-description {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  margin: 14px 0 !important;
}

#mobileAppSection .mobile-app-download-btn {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 50px !important;
  box-sizing: border-box !important;
  white-space: normal !important;
  flex-wrap: wrap !important;
  text-align: center !important;
  overflow-wrap: anywhere !important;
}

#mobileAppSection .mobile-app-download-btn span {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

#mobileAppSection .mobile-app-footer {
  flex-wrap: wrap !important;
  text-align: center !important;
}


/* Android: закреплённая карточка вне прокрутки боковой панели */
@media (min-width: 981px) {
  .side-column {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 28px) !important;
    max-height: calc(100vh - 28px) !important;
    overflow: hidden !important;
    gap: 12px !important;
  }

  #mobileAppSection {
    position: relative !important;
    flex: 0 0 auto !important;
    order: -1 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .side-column > #mobileAppSection ~ .panel {
    flex: 0 0 auto;
  }

  .side-column {
    overflow-y: auto !important;
  }

  .side-column > #mobileAppSection {
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
  }
}

/* Android-карточка в самом низу боковой панели */
@media (min-width: 981px) {
  .side-column {
    display: flex !important;
    flex-direction: column !important;
  }

  .side-column > #mobileAppSection {
    order: 999 !important;
    position: static !important;
    top: auto !important;
    flex: 0 0 auto !important;
    margin-top: 14px !important;
  }
}

@media (max-width: 980px) {
  .side-column > #mobileAppSection {
    order: 999 !important;
    position: static !important;
    margin-top: 14px !important;
  }
}

/* ===== ANDROID / MOBILE INTERFACE ===== */
@media (max-width: 980px) {
  html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
  body { overflow-x:hidden; }
  .shell {
    width:100%; max-width:100%; box-sizing:border-box;
    padding-left:max(12px,env(safe-area-inset-left));
    padding-right:max(12px,env(safe-area-inset-right));
    padding-bottom:max(16px,env(safe-area-inset-bottom));
  }
  .topbar,.welcome-row { min-width:0; flex-wrap:wrap; gap:12px; }
  .brand { min-width:0; max-width:100%; }
  .brand b,.brand small { overflow-wrap:anywhere; }
  .welcome-actions {
    display:flex; width:100%; max-width:100%;
    flex-wrap:wrap; gap:8px;
  }
  .welcome-actions>button,.welcome-actions>a {
    min-height:44px; max-width:100%; box-sizing:border-box;
  }
  .content-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; }
  .map-panel,.side-column,.panel { min-width:0; max-width:100%; box-sizing:border-box; }
  .map-panel { overflow:hidden; }
  .map-panel>.panel-head { align-items:flex-start; flex-wrap:wrap; gap:10px; }
  .layer-control { max-width:100%; }
  .map-tools { display:flex; flex-direction:column; align-items:stretch; min-width:0; }
  .map-search,.marker-fio-search-controls {
    display:flex; width:100%; min-width:0; gap:8px;
  }
  .map-search input,.marker-fio-search-controls input {
    flex:1 1 0; width:1%; min-width:0;
  }
  .map-search button,.marker-fio-search-controls button { flex:0 0 auto; min-width:66px; }
  .map-actions { display:flex; flex-wrap:wrap; align-items:stretch; gap:8px; min-width:0; }
  .map-actions>button,.map-actions>select {
    flex:1 1 auto; min-width:105px; min-height:44px;
    max-width:100%; box-sizing:border-box;
  }
  #map {
    width:100%; height:58dvh; min-height:350px;
    max-height:680px; touch-action:pan-x pan-y;
  }
  .legend { display:flex; flex-wrap:wrap; gap:8px 12px; }
  .side-column { display:flex; flex-direction:column; gap:12px; }
  .side-column>.panel { width:100%; margin-left:0; margin-right:0; }
  .side-column>#mobileAppSection { order:999 !important; }
  button,select,input,textarea,a { touch-action:manipulation; }
  input,select,textarea { max-width:100%; font-size:16px !important; }
  .chat-panel {
    width:calc(100vw - 20px); max-width:calc(100vw - 20px);
    max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    box-sizing:border-box;
  }
  .chat-layout,.chat-main,.chat-messages { min-width:0; }
  .chat-messages { overflow-y:auto; overscroll-behavior:contain; }
  .chat-compose { gap:8px; }
  .chat-compose textarea { min-width:0; font-size:16px !important; }
  .profile-card,.marker-modal-card {
    width:calc(100vw - 20px); max-width:620px;
    max-height:calc(100dvh - 20px); overflow-y:auto; box-sizing:border-box;
  }
  #mapPanel:fullscreen,#mapPanel.is-fullscreen {
    width:100vw !important; height:100dvh !important;
    max-width:none !important; max-height:none !important;
    border-radius:0 !important; padding:0 !important;
  }
  #mapPanel:fullscreen #map,#mapPanel.is-fullscreen #map {
    height:100dvh !important; min-height:100dvh !important; max-height:none !important;
  }
}

@media (max-width:620px) {
  .shell {
    padding-left:max(9px,env(safe-area-inset-left));
    padding-right:max(9px,env(safe-area-inset-right));
  }
  .topbar { align-items:flex-start; }
  .brand b { font-size:13px; }
  .brand small { font-size:9px; }
  .welcome-row h1 { font-size:clamp(23px,7vw,32px); }
  .welcome-actions>button,.welcome-actions>a {
    flex:1 1 calc(50% - 8px); text-align:center; justify-content:center;
  }
  .map-panel>.panel-head { padding:13px; }
  .map-tools { padding:10px; gap:9px; }
  .map-search input { min-height:44px; }
  .map-search button { min-width:64px; padding-left:10px; padding-right:10px; }
  .map-actions>button,.map-actions>select {
    flex:1 1 calc(50% - 8px); min-width:0; padding-left:8px; padding-right:8px;
  }
  .marker-fio-search-controls { flex-wrap:wrap; }
  .marker-fio-search-controls input { flex-basis:100%; width:100%; }
  .marker-fio-search-controls button { flex:1 1 calc(50% - 8px); }
  #map { height:56dvh; min-height:320px; max-height:580px; }
  .side-column>.panel { padding:14px !important; }
  .chat-panel { width:calc(100vw - 12px); max-width:calc(100vw - 12px); }
}

@media (max-width:380px) {
  .welcome-actions>button,.welcome-actions>a { flex-basis:100%; }
  .map-actions>button,.map-actions>select { flex-basis:100%; }
  #map { min-height:300px; }
}

@media (orientation:landscape) and (max-width:980px) and (max-height:520px) {
  #map { height:72dvh; min-height:250px; max-height:none; }
  #mapPanel:fullscreen #map,#mapPanel.is-fullscreen #map { height:100dvh !important; }
}
/* ===== END ANDROID / MOBILE INTERFACE ===== */

/* ANDROID HEADER BOUNDS FIX */
@media screen and (max-width: 700px) {
  .topbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100% !important;
    gap: 12px !important;
    padding-bottom: 12px;
  }

  .brand {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 1 auto !important;
  }

  #headerUser {
    position: static !important;
    display: block !important;
    width: fit-content !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.4 !important;
  }

  .shell, .topbar, .brand, #appView {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
}
/* END ANDROID HEADER BOUNDS FIX */

/* FULLSCREEN: показываем только саму карту */
#mapPanel:fullscreen,
#mapPanel.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  display: block !important;
  background: #0b1120 !important;
}

#mapPanel:fullscreen > :not(#map):not(#mapFullscreenExitBtn):not(#markerModal),
#mapPanel.is-fullscreen > :not(#map):not(#mapFullscreenExitBtn):not(#markerModal) {
  display: none !important;
}

#mapPanel:fullscreen > #map,
#mapPanel.is-fullscreen > #map {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

body.map-fullscreen-open {
  overflow: hidden !important;
}


/* Кнопка выхода из полноэкранной карты */
#mapFullscreenExitBtn {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  z-index: 1000001 !important;
  padding: 11px 16px !important;
  border: 1px solid rgba(255,255,255,.35) !important;
  border-radius: 9px !important;
  background: #6d4bc3 !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 3px 14px rgba(0,0,0,.35) !important;
}
#mapFullscreenExitBtn[hidden] {
  display: none !important;
}

/* Карточки маркеров поверх полноэкранной карты */
#mapPanel:fullscreen .leaflet-pane,
#mapPanel.is-fullscreen .leaflet-pane {
  z-index: auto;
}

#mapPanel:fullscreen .leaflet-popup-pane,
#mapPanel.is-fullscreen .leaflet-popup-pane {
  z-index: 1000002 !important;
}

#mapPanel:fullscreen .leaflet-popup,
#mapPanel.is-fullscreen .leaflet-popup {
  z-index: 1000003 !important;
  max-width: min(420px, calc(100vw - 30px)) !important;
}

#mapPanel:fullscreen .leaflet-popup-content-wrapper,
#mapPanel.is-fullscreen .leaflet-popup-content-wrapper {
  max-width: min(420px, calc(100vw - 30px)) !important;
  max-height: min(70vh, 650px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

#mapPanel:fullscreen .leaflet-popup-content,
#mapPanel.is-fullscreen .leaflet-popup-content {
  max-width: min(380px, calc(100vw - 65px)) !important;
  max-height: none !important;
  overflow: visible !important;
  overflow-wrap: anywhere;
}

#mapPanel:fullscreen .leaflet-popup-content img,
#mapPanel.is-fullscreen .leaflet-popup-content img {
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain;
}

#mapPanel:fullscreen .leaflet-popup-close-button,
#mapPanel.is-fullscreen .leaflet-popup-close-button {
  z-index: 1000004 !important;
}


/* Карточка служебного маркера внутри полноэкранной карты */
#mapPanel:fullscreen > #markerModal.is-open,
#mapPanel.is-fullscreen > #markerModal.is-open {
  display: flex !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1000000 !important;
  width: 100% !important;
  height: 100% !important;
  box-sizing: border-box !important;
  overflow: auto !important;
  padding: max(18px, env(safe-area-inset-top))
           max(18px, env(safe-area-inset-right))
           max(18px, env(safe-area-inset-bottom))
           max(18px, env(safe-area-inset-left)) !important;
  align-items: center !important;
  justify-content: center !important;
}

#mapPanel:fullscreen #markerModal .marker-modal-card,
#mapPanel.is-fullscreen #markerModal .marker-modal-card {
  width: min(560px, 100%) !important;
  max-width: 560px !important;
  max-height: 88vh !important;
  max-height: 88dvh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

#mapPanel:fullscreen #mapFullscreenExitBtn,
#mapPanel.is-fullscreen #mapFullscreenExitBtn {
  z-index: 1000005 !important;
}

/* Выбор цвета маркера */
.marker-form select[name="marker_color"]{
  width:100%;box-sizing:border-box;border:1px solid rgba(148,163,184,.28);
  border-radius:11px;padding:11px 12px;background:#0b1220;color:#f8fafc;
  font:inherit;font-weight:500;outline:none;
}
.marker-form select[name="marker_color"]:focus{
  border-color:#8b5cf6;box-shadow:0 0 0 3px rgba(139,92,246,.16);
}

/* ===== Современные карточки статистики операторов ===== */
#operatorMarkerStatsList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  padding: 14px 0;
}

#operatorMarkerStatsList .operator-stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 17px;
  overflow: hidden;
  border: 1px solid var(--border, rgba(130,145,165,.22));
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(120,140,170,.035));
  box-shadow: 0 5px 18px rgba(0,0,0,.08);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

#operatorMarkerStatsList .operator-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,.14);
  border-color: rgba(90,145,220,.5);
}

.operator-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.operator-stat-name {
  min-width: 0;
  font-size: 15px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.operator-stat-total {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 11px;
  background: rgba(90,145,220,.15);
  color: var(--text, inherit);
  font-size: 13px;
  font-weight: 800;
}

.operator-stat-total small {
  display: block;
  font-size: 9px;
  font-weight: 650;
  opacity: .7;
  text-transform: uppercase;
  letter-spacing: .7px;
}

.operator-stat-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
}

.operator-stat-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  padding: 11px 5px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.operator-stat-metric strong {
  font-size: 22px;
  line-height: 1;
  font-weight: 850;
}

.operator-stat-metric.green {
  color: #15945f;
  background: rgba(21,148,95,.12);
}

.operator-stat-metric.yellow {
  color: #bd8b0a;
  background: rgba(242,194,48,.16);
}

.operator-stat-metric.red {
  color: #df3f3a;
  background: rgba(223,63,58,.11);
}

@media (max-width: 520px) {
  #operatorMarkerStatsList {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #operatorMarkerStatsList .operator-stat-card {
    padding: 14px;
  }
}

/* ==========================================
   PREMIUM OPERATOR ANALYTICS
   ========================================== */

#operatorStatsPanel {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
}

#operatorMarkerStats {
  position: relative;
}

#operatorMarkerStats .operator-stats-heading {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border, rgba(130,145,165,.2));
}

#operatorMarkerStats .operator-stats-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: linear-gradient(145deg, #477eea, #8055d9);
  color: white;
  font-size: 25px;
  box-shadow: 0 7px 22px rgba(80,105,220,.3);
}

#operatorMarkerStats .operator-stats-kicker {
  color: #7297ed;
  font-weight: 850;
  letter-spacing: 2px;
  font-size: 10px;
}

#operatorMarkerStats .operator-stats-title h2 {
  font-size: clamp(19px, 3vw, 25px);
  font-weight: 850;
  letter-spacing: -.5px;
}

#operatorMarkerStats .operator-stats-title p {
  opacity: .65;
  font-size: 13px;
}

#operatorMarkerStats .operator-stats-search {
  margin: 18px 0;
  border-radius: 15px;
  transition: border-color .2s, box-shadow .2s;
}

#operatorMarkerStats .operator-stats-search:focus-within {
  border-color: #668ff0;
  box-shadow: 0 0 0 4px rgba(102,143,240,.13);
}

#operatorMarkerStats .operator-stats-list-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 15px;
  border-radius: 11px;
  background: rgba(110,130,165,.08);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1px;
  opacity: .72;
}

#operatorMarkerStatsList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
  padding: 16px 0;
}

#operatorMarkerStatsList .operator-stat-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 17px;
  min-width: 0;
  padding: 19px;
  overflow: hidden;
  border: 1px solid rgba(125,145,180,.22);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(90,125,220,.13), transparent 55%),
    linear-gradient(145deg, rgba(120,145,190,.10), rgba(120,145,190,.025));
  box-shadow:
    0 8px 24px rgba(0,0,0,.075),
    inset 0 1px 0 rgba(255,255,255,.10);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  animation: operatorCardAppear .45s ease both;
}

#operatorMarkerStatsList .operator-stat-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, #5688ee, #9a70ec, #43b8bd);
  opacity: .9;
}

#operatorMarkerStatsList .operator-stat-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 130px;
  height: 130px;
  right: -65px;
  bottom: -75px;
  border-radius: 50%;
  background: rgba(90,130,230,.09);
  filter: blur(3px);
}

#operatorMarkerStatsList .operator-stat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(100,145,235,.55);
  box-shadow:
    0 15px 34px rgba(35,75,145,.16),
    0 0 0 1px rgba(100,145,235,.08);
}

.operator-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.operator-stat-name {
  min-width: 0;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.4;
  letter-spacing: .1px;
  overflow-wrap: anywhere;
}

.operator-stat-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 76px;
  min-height: 65px;
  padding: 8px 12px;
  border: 1px solid rgba(105,145,230,.25);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(85,130,230,.19), rgba(125,95,210,.10));
  color: var(--text, inherit);
  font-size: 25px;
  line-height: 1.1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.operator-stat-total small {
  margin-bottom: 5px;
  font-size: 9px;
  font-weight: 800;
  opacity: .65;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.operator-stat-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 9px;
}

.operator-stat-metric {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 14px 4px;
  border: 1px solid transparent;
  border-radius: 15px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .15px;
  transition: transform .2s ease, filter .2s ease;
}

.operator-stat-metric:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.operator-stat-metric strong {
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.operator-stat-metric.green {
  color: #19a96c;
  border-color: rgba(25,169,108,.18);
  background: linear-gradient(145deg, rgba(25,169,108,.17), rgba(25,169,108,.055));
}

.operator-stat-metric.yellow {
  color: #c79512;
  border-color: rgba(220,175,40,.2);
  background: linear-gradient(145deg, rgba(242,194,48,.20), rgba(242,194,48,.055));
}

.operator-stat-metric.red {
  color: #e05252;
  border-color: rgba(224,82,82,.18);
  background: linear-gradient(145deg, rgba(224,82,82,.17), rgba(224,82,82,.055));
}

#operatorMarkerStats .operator-stats-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border, rgba(130,145,165,.2));
  font-size: 11px;
  opacity: .58;
}

@keyframes operatorCardAppear {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  #operatorMarkerStatsList {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #operatorMarkerStatsList .operator-stat-card {
    padding: 16px;
  }

  .operator-stat-metric {
    padding: 12px 3px;
  }

  #operatorMarkerStats .operator-stats-footer {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  #operatorMarkerStatsList .operator-stat-card {
    animation: none;
    transition: none;
  }
}


/* Нажимаемые показатели статистики */
button.operator-stat-metric {
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  border-style: solid;
}
button.operator-stat-total {
  cursor: pointer;
  font-family: inherit;
}
button.operator-stat-metric:focus-visible,
button.operator-stat-total:focus-visible {
  outline: 3px solid #668ff0;
  outline-offset: 3px;
}
button.operator-stat-metric:active,
button.operator-stat-total:active {
  transform: scale(.96);
}

/* ===== PREMIUM OPERATOR CARDS FINAL DESIGN ===== */

#operatorMarkerStatsList {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  align-items: stretch;
}

#operatorMarkerStatsList .operator-stat-card {
  border: 1px solid rgba(115,145,205,.24);
  border-radius: 22px;
  padding: 20px;
  background:
    radial-gradient(circle at 95% 5%, rgba(91,126,225,.17), transparent 42%),
    linear-gradient(145deg, rgba(35,48,75,.96), rgba(19,27,43,.98));
  color: #f1f5ff;
  box-shadow: 0 12px 32px rgba(0,0,0,.20);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

#operatorMarkerStatsList .operator-stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(110,155,255,.65);
  box-shadow: 0 18px 38px rgba(30,70,150,.25);
}

#operatorMarkerStatsList .operator-stat-name {
  color: #f5f7ff;
  font-size: 15px;
  font-weight: 800;
}

#operatorMarkerStatsList .operator-stat-total {
  min-width: 88px;
  min-height: 70px;
  border: 1px solid rgba(115,155,255,.35);
  border-radius: 16px;
  background: linear-gradient(145deg, #315ba8, #5946a0);
  color: #fff;
  box-shadow: 0 6px 18px rgba(60,90,180,.25);
}

#operatorMarkerStatsList .operator-stat-total small {
  color: rgba(255,255,255,.75);
}

#operatorMarkerStatsList .operator-stat-metrics {
  gap: 10px;
}

#operatorMarkerStatsList .operator-stat-metric {
  min-height: 86px;
  border-radius: 16px;
  background: rgba(255,255,255,.045);
  backdrop-filter: blur(8px);
}

#operatorMarkerStatsList .operator-stat-metric.green {
  color: #48e0a0;
  border: 1px solid rgba(45,210,140,.25);
  background: linear-gradient(145deg, rgba(25,180,115,.20), rgba(25,180,115,.06));
}

#operatorMarkerStatsList .operator-stat-metric.yellow {
  color: #ffd45e;
  border: 1px solid rgba(255,205,65,.25);
  background: linear-gradient(145deg, rgba(230,175,35,.20), rgba(230,175,35,.06));
}

#operatorMarkerStatsList .operator-stat-metric.red {
  color: #ff7777;
  border: 1px solid rgba(245,85,85,.25);
  background: linear-gradient(145deg, rgba(220,65,65,.20), rgba(220,65,65,.06));
}

#operatorMarkerStatsList .operator-stat-metric strong {
  font-size: 27px;
  text-shadow: 0 2px 12px currentColor;
}

#operatorMarkerStatsList .operator-stat-metric span {
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

#operatorMarkerStatsList button {
  cursor: pointer;
  font-family: inherit;
}

#operatorMarkerStatsList button:focus-visible {
  outline: 3px solid #8db3ff;
  outline-offset: 3px;
}

@media (max-width: 520px) {
  #operatorMarkerStatsList {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #operatorMarkerStatsList .operator-stat-card {
    padding: 16px;
  }
}

/* Финальное выделение выбранной карточки и активного фильтра */
#operatorMarkerStatsList .operator-stat-card.is-selected {
  border-color: #75a3ff;
  box-shadow: 0 0 0 2px rgba(90,140,255,.22),
              0 15px 38px rgba(35,75,145,.24);
}

#operatorMarkerStatsList .operator-stat-metric.is-active,
#operatorMarkerStatsList .operator-stat-total.is-active {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  filter: brightness(1.18);
}

#operatorStatsFilterResetBtn:not(.hidden) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 17px;
  border: 1px solid rgba(105,145,230,.4);
  border-radius: 12px;
  background: linear-gradient(135deg,#315ba8,#5946a0);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(60,90,180,.2);
}

/* Краткие пояснения к цветам точек */
#operatorMarkerStatsList .operator-stat-hint {
  display: block;
  max-width: 150px;
  min-height: 26px;
  margin-top: 3px;
  color: currentColor;
  opacity: .72;
  font-size: 9px;
  font-weight: 550;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  letter-spacing: 0;
}

#operatorMarkerStatsList .operator-stat-metric {
  min-height: 105px;
  padding: 12px 5px;
}

/* ===== ОБЩАЯ СТАТИСТИКА ВСЕХ МАРКЕРОВ ===== */
.global-marker-summary {
  margin: 18px 0;
  padding: 17px;
  border: 1px solid rgba(115,145,205,.25);
  border-radius: 19px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(90,125,220,.14), transparent 65%),
    linear-gradient(145deg, rgba(35,48,75,.96), rgba(19,27,43,.98));
  box-shadow: 0 9px 25px rgba(0,0,0,.13);
}

.global-marker-summary-title {
  margin-bottom: 13px;
  color: #dce6ff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 1.5px;
  text-align: center;
}

.global-marker-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}

.global-marker-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 13px 6px;
  border: 1px solid transparent;
  border-radius: 15px;
  text-align: center;
}

.global-marker-total strong {
  font-size: clamp(25px,4vw,34px);
  line-height: 1;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.global-marker-total span {
  font-size: 11px;
  font-weight: 800;
}

.global-marker-total.green {
  color: #48e0a0;
  border-color: rgba(45,210,140,.25);
  background: rgba(25,180,115,.13);
}

.global-marker-total.yellow {
  color: #ffd45e;
  border-color: rgba(255,205,65,.25);
  background: rgba(230,175,35,.13);
}

.global-marker-total.red {
  color: #ff7777;
  border-color: rgba(245,85,85,.25);
  background: rgba(220,65,65,.13);
}

@media(max-width:480px) {
  .global-marker-summary {
    padding: 12px;
  }
  .global-marker-summary-grid {
    gap: 7px;
  }
  .global-marker-total {
    padding: 12px 3px;
  }
  .global-marker-total span {
    font-size: 9px;
  }
}


/* =========================================================
   DARK NAVY THEME — visual-only overrides, 2026-12-04
   Functional styles and map layers are intentionally unchanged.
   ========================================================= */
:root{
  color-scheme:dark;
  --bg:#071426;
  --ink:#e8f0fb;
  --muted:#9aacc3;
  --line:#203650;
  --green:#4b9dff;
  --green-dark:#287bd8;
  --purple:#7baeff;
  --green-soft:#142d49;
  --white:#10243b;
  --amber:#f2bd62;
  --red:#ff777e;
  --shadow:0 18px 50px rgba(0,0,0,.28);
}
html,body{background:#071426;color:#e8f0fb}
body{background:linear-gradient(145deg,#071426 0%,#0a1b31 52%,#0c2038 100%);color:#e8f0fb}
.app-bg{background:radial-gradient(ellipse at 12% 12%,rgba(40,115,190,.20),transparent 36%),radial-gradient(ellipse at 90% 4%,rgba(30,80,140,.18),transparent 32%)}
.topbar{border-color:#203650}
.brand-icon{background:linear-gradient(145deg,#287bd8,#164b86);box-shadow:0 8px 20px rgba(25,105,190,.28)}
.brand b,.welcome-row h1,.panel h2,.panel-head h2{color:#edf4ff}
.brand small,.header-user,.muted,.legend,.legend-hint{color:#9aacc3}
.eyebrow,.section-kicker{color:#78b5ff}
.panel,.stat-card,.auth-panel,.place-info,.modal,.dialog,.dropdown-menu,.chat-panel,.side-panel{
  background:#10243b;color:#e8f0fb;border-color:#29415e;
  box-shadow:0 14px 36px rgba(0,0,0,.24)
}
.panel-head,.topbar,.section-head{border-color:#29415e}
.feature-row span{background:#122b47;border-color:#29415e;color:#c8dcf5}
.privacy-note{background:#122d4b;color:#b9d8fb;border:1px solid #294b70}
.form-mark{background:#17385d;color:#8fc1ff}
label{color:#c2d2e6}
input,select,textarea{
  background:#091a2d!important;color:#edf4ff!important;
  border:1px solid #29415e!important;
}
input::placeholder,textarea::placeholder{color:#8298b4}
input:focus,select:focus,textarea:focus{
  border-color:#4b9dff!important;box-shadow:0 0 0 3px rgba(75,157,255,.18)!important;
  background:#0c2038!important
}
button.primary,.primary,.chat-open-btn,.marker-add-btn{
  background:linear-gradient(135deg,#287bd8,#18569a)!important;color:#fff!important;
  box-shadow:0 7px 18px rgba(20,95,170,.28)
}
button.primary:hover,.primary:hover,.chat-open-btn:hover{background:#226bb8!important}
button.secondary,.secondary,.welcome-actions .secondary{
  background:#193451!important;color:#d7e8fb!important;border:1px solid #315171!important
}
button.secondary:hover,.secondary:hover{background:#224466!important}
.text-button{color:#83bdff}
.stat-card span,.stat-card small{color:#9aacc3}
.stat-card strong{color:#edf4ff}
.layer-control,.layer-control select,.map-search input{color:#dce9f8}
.layer-control select,.map-search input{background:#0a1d32!important;border-color:#29415e!important}
.map-search button,.map-tool-btn{
  background:#173656!important;color:#a9d1ff!important;border:1px solid #31577e!important
}
.map-search button:hover,.map-tool-btn:hover{background:#21486e!important}
#map{border-color:#29415e}
.place-info{background:#10243b!important;border-color:#29415e!important}
.place-kind,.place-fact{background:#173656!important;color:#c7e0ff!important}
table th,table td{border-color:#29415e}
th{background:#17314d;color:#dceaff}
td{color:#d4e1f1}
tr:nth-child(even){background:rgba(31,59,88,.28)}
hr,.divider{border-color:#29415e}
a{color:#83bdff}
a:hover{color:#b5d8ff}
.badge,.chip,.tag{background:#173656;color:#c7e0ff;border-color:#31577e}
.toast,.notice,.alert{background:#142d49;color:#e8f0fb;border-color:#315171}
.modal-backdrop,.overlay{background:rgba(2,8,17,.76)}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:#091a2d}
::-webkit-scrollbar-thumb{background:#294767;border-radius:10px;border:2px solid #091a2d}
::-webkit-scrollbar-thumb:hover{background:#3b6590}
@media(max-width:700px){
  .shell{padding-left:14px;padding-right:14px}
  .panel,.stat-card{background:#10243b}
}
