#cesi-routemap{
    --accent:#FF6A00; --ink:#1a1a1a; --muted:#5b6570;
    --bg:#F7F9FC; --peach:#FFF4EC; --card:#fff; --border:#e3e9f0; --r:12px;
  }
#cesi-routemap{box-sizing:border-box;margin:0;padding:0}
#cesi-routemap, #cesi-routemap{background:var(--bg);color:var(--ink);
    font-family:'Montserrat',system-ui,-apple-system,'Segoe UI',sans-serif}
#cesi-routemap .wrap{max-width:1280px;margin:0 auto;padding:26px 20px 48px}
#cesi-routemap header h1{font-size:clamp(22px,3vw,30px);font-weight:700;line-height:1.2}
#cesi-routemap header .sub{margin-top:8px;color:var(--muted);font-size:14.5px;line-height:1.55;max-width:900px}
#cesi-routemap .addr-badge{display:inline-block;margin-top:10px;background:var(--peach);
    border:1px solid #ffd9bd;border-radius:10px;padding:7px 14px;font-size:13.5px;font-weight:600}
#cesi-routemap .layout > *{min-width:0}
#cesi-routemap .layout{display:grid;grid-template-columns:1fr;gap:14px;margin-top:22px;
    grid-template-areas:"list" "ctrl" "map" "card"}
#cesi-routemap #cesi-rm-stationsBox{grid-area:list;background:var(--card);border:1px solid var(--border);
    border-radius:var(--r);padding:12px}
#cesi-routemap #cesi-rm-stationsBox h2{font-size:14px;font-weight:700;text-transform:uppercase;
    letter-spacing:.05em;color:var(--muted);margin:2px 4px 10px}
#cesi-routemap #cesi-rm-stationList{list-style:none;display:flex;flex-direction:column;gap:4px;min-width:0}
#cesi-routemap #cesi-rm-stationList li{min-width:0}
#cesi-routemap #cesi-rm-stationList button{min-width:0}
#cesi-routemap #cesi-rm-stationList button{width:100%;display:flex;align-items:center;gap:9px;text-align:left;
    font:inherit;font-size:14px;color:inherit;background:none;border:1px solid transparent;
    border-radius:9px;padding:8px 10px;cursor:pointer;transition:background .12s,border-color .12s}
#cesi-routemap #cesi-rm-stationList button:hover{background:var(--bg)}
#cesi-routemap #cesi-rm-stationList button:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
#cesi-routemap #cesi-rm-stationList button.active{background:var(--peach);border-color:var(--accent);font-weight:600}
#cesi-routemap .st-dot{flex:none;width:13px;height:13px;border-radius:50%;background:#fff;
    border:3.5px solid var(--c,#888)}
#cesi-routemap .st-dot.sq{border-radius:4px}
#cesi-routemap .st-mode{margin-left:auto;flex:none;font-size:10.5px;font-weight:700;color:var(--muted);
    text-transform:uppercase;letter-spacing:.04em}
#cesi-routemap .var-row{display:none;gap:6px;flex-wrap:wrap;padding:6px 10px 8px 32px}
#cesi-routemap .var-row.open{display:flex}
#cesi-routemap .var-row button{width:auto;font:inherit;font-size:12px;font-weight:600;cursor:pointer;
    border:1.5px solid var(--border);background:#fff;border-radius:8px;padding:4px 9px;
    transition:border-color .12s}
#cesi-routemap .var-row button:hover{border-color:var(--accent)}
#cesi-routemap .var-row button.active{border-color:var(--accent);background:var(--peach)}
#cesi-routemap .var-row button:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
#cesi-routemap #cesi-rm-controls{grid-area:ctrl}
#cesi-routemap #cesi-rm-playBtn{width:100%;font:inherit;font-size:14px;font-weight:600;cursor:pointer;
    background:var(--accent);color:#fff;border:0;border-radius:10px;padding:11px 14px}
#cesi-routemap #cesi-rm-playBtn[disabled]{opacity:.5;cursor:default}
#cesi-routemap #cesi-rm-playBtn:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
#cesi-routemap #cesi-rm-card{grid-area:card;background:var(--card);border:1px solid var(--border);
    border-radius:var(--r);padding:16px;align-self:start}
#cesi-routemap #cesi-rm-card h3{font-size:16px;font-weight:700;margin-bottom:2px}
#cesi-routemap #cesi-rm-card .mode-tag{display:inline-block;font-size:11px;font-weight:700;letter-spacing:.04em;
    text-transform:uppercase;border-radius:6px;padding:3px 8px;margin-bottom:9px;color:#fff}
#cesi-routemap #cesi-rm-card .how{margin-top:8px;font-size:13px;line-height:1.55;color:var(--muted)}
#cesi-routemap #cesi-rm-card .legs{margin-top:10px;display:flex;flex-direction:column;gap:8px}
#cesi-routemap #cesi-rm-card .leg{font-size:13px;line-height:1.5}
#cesi-routemap #cesi-rm-card .dist{margin-top:10px;font-size:12.5px;color:var(--muted);line-height:1.55;
    border-top:1px solid var(--border);padding-top:9px}
#cesi-routemap .bus{display:inline-block;background:#fff;border:1.5px solid var(--accent);
    font-weight:700;font-size:12px;border-radius:6px;padding:1px 7px;margin-right:3px;white-space:nowrap}
#cesi-routemap .map-wrap{grid-area:map;position:relative;min-width:0;background:var(--card);
    border:1px solid var(--border);border-radius:var(--r);overflow:hidden;height:680px}
#cesi-routemap #cesi-rm-map{width:100%;height:100%}
#cesi-routemap #cesi-rm-mapFallback{display:none;position:absolute;inset:0;z-index:5;background:var(--bg);
    color:var(--muted);font-size:14px;line-height:1.6;padding:40px;text-align:center;
    align-items:center;justify-content:center}
#cesi-routemap .maplegend{position:absolute;left:12px;bottom:12px;z-index:4;background:rgba(255,255,255,.94);
    border:1px solid var(--border);border-radius:10px;padding:8px 12px;display:flex;gap:16px;
    font-size:12px;color:var(--muted);align-items:center}
#cesi-routemap .maplegend .li{display:flex;align-items:center;gap:6px}
#cesi-routemap /* Метки на карте */
  .mk-college{position:absolute;transform:translate(-50%,-50%);background:var(--accent);
    color:#fff;font-weight:700;font-size:13px;font-family:inherit;padding:7px 10px;
    border-radius:10px;box-shadow:0 2px 8px rgba(0,0,0,.28);white-space:nowrap}
#cesi-routemap .mk-station{position:absolute;transform:translate(-50%,-50%);width:20px;height:20px;
    border-radius:50%;background:#fff;border:5px solid var(--c,#555);
    box-shadow:0 1px 5px rgba(0,0,0,.3)}
#cesi-routemap .mk-stop{position:absolute;transform:translate(-50%,-50%);width:16px;height:16px;
    border-radius:5px;background:var(--peach);border:2.5px solid var(--accent);
    box-shadow:0 1px 4px rgba(0,0,0,.25)}
#cesi-routemap .mk-lbl{position:absolute;transform:translate(-50%,10px);background:rgba(255,255,255,.95);
    border:1px solid var(--border);color:var(--ink);font-size:11.5px;font-weight:600;
    font-family:inherit;padding:2px 7px;border-radius:7px;white-space:nowrap;
    box-shadow:0 1px 4px rgba(0,0,0,.15)}
#cesi-routemap .mk-bus{position:absolute;transform:translate(-50%,-50%);background:#fff;
    border:2px solid var(--accent);color:var(--ink);border-radius:8px;
    font-family:inherit;font-weight:700;font-size:13px;padding:3px 8px;white-space:nowrap;
    box-shadow:0 2px 7px rgba(0,0,0,.3)}
#cesi-routemap .mk-bus::before{content:'🚌 '}
#cesi-routemap .mk-walk{position:absolute;transform:translate(-50%,-50%);width:26px;height:26px;
    border-radius:50%;background:#fff;border:2px solid var(--muted);display:flex;
    align-items:center;justify-content:center;font-size:14px;
    box-shadow:0 2px 6px rgba(0,0,0,.3)}
#cesi-routemap .routes{margin-top:26px}
#cesi-routemap .routes h2{font-size:19px;font-weight:700;margin-bottom:6px}
#cesi-routemap .routes .note{color:var(--muted);font-size:13px;margin-bottom:14px;line-height:1.55}
#cesi-routemap .routes ul{list-style:none;display:grid;grid-template-columns:1fr 1fr;gap:12px}
#cesi-routemap .routes button{width:100%;text-align:left;font:inherit;color:inherit;cursor:pointer;
    background:var(--card);border:1px solid var(--border);border-radius:var(--r);
    padding:13px 15px;transition:border-color .15s}
#cesi-routemap .routes button:hover{border-color:var(--accent)}
#cesi-routemap .routes button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#cesi-routemap .routes button.active{border-color:var(--accent);background:var(--peach)}
#cesi-routemap .routes .r-head{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
#cesi-routemap .routes .r-name{font-weight:700;font-size:14.5px}
#cesi-routemap .routes .r-mode{font-size:10.5px;font-weight:700;text-transform:uppercase;
    letter-spacing:.05em;color:var(--accent)}
#cesi-routemap .routes .r-body{margin-top:6px;font-size:13px;line-height:1.6;color:var(--muted)}
#cesi-routemap .routes .r-body b{color:var(--ink);font-weight:600}
#cesi-routemap footer{margin-top:24px;color:var(--muted);font-size:12px;line-height:1.6}
@media (max-width:920px){#cesi-routemap .wrap{padding:18px 12px 40px}
#cesi-routemap .layout{grid-template-columns:1fr;grid-template-rows:none;
      grid-template-areas:"list" "ctrl" "map" "card"}
#cesi-routemap #cesi-rm-stationList{display:grid;grid-template-columns:1fr 1fr;gap:4px}
#cesi-routemap .var-row{padding-left:10px}
#cesi-routemap .map-wrap{height:430px}
#cesi-routemap .routes ul{grid-template-columns:1fr}
#cesi-routemap .maplegend{left:8px;top:8px;bottom:auto;padding:6px 9px;gap:10px;font-size:11px}

  }



/* --- защита от стилей шаблона Aspro --- */
#cesi-routemap, #cesi-routemap * { box-sizing: border-box; }
#cesi-routemap li:before, #cesi-routemap li:after,
#cesi-routemap li::before, #cesi-routemap li::after { content: none !important; display: none !important; }
#cesi-routemap ul, #cesi-routemap li { list-style: none !important; }
#cesi-routemap ul { margin: 0; padding: 0; }
#cesi-routemap button { font-family: inherit; box-shadow: none !important; text-transform: none; }
#cesi-routemap button:before, #cesi-routemap button:after,
#cesi-routemap button::before, #cesi-routemap button::after { content: none !important; display: none !important; }
#cesi-routemap h3 { text-transform: none; }
#cesi-routemap .rm-footnote { font-size: 13px; line-height: 1.5; color: #6b7480; margin: 18px 0 0; }
#cesi-routemap [class*="ymaps"] img { max-width: none !important; }


/* --- блок живёт в колонке страницы (~720px), поэтому одна колонка на всех ширинах:
       станции сеткой сверху, карта во всю доступную ширину --- */
#cesi-routemap #cesi-rm-stationList{
    display:grid; grid-template-columns:repeat(auto-fit, minmax(210px, 1fr)); gap:6px; align-items:start}
#cesi-routemap #cesi-rm-stationsBox{max-height:none}
#cesi-routemap .map-wrap{height:520px}
#cesi-routemap #cesi-rm-card{margin-top:0}
@media (max-width: 920px){
    #cesi-routemap #cesi-rm-stationList{grid-template-columns:1fr 1fr}
    #cesi-routemap .map-wrap{height:430px}
}
@media (max-width: 560px){
    #cesi-routemap #cesi-rm-stationList{grid-template-columns:1fr}
    #cesi-routemap .map-wrap{height:360px}
}


/* --- посадка блока в колонку страницы: кнопка не должна кричать, сетка — не рыхлить --- */
#cesi-routemap #cesi-rm-controls{display:flex;justify-content:flex-end;margin-top:-4px}
#cesi-routemap #cesi-rm-playBtn{
    width:auto !important; padding:7px 14px; font-size:13px; border-radius:8px;
    background:#fff !important; color:#c05500 !important; border:1px solid #ffcfa8 !important}
#cesi-routemap #cesi-rm-playBtn:hover{background:var(--peach) !important; border-color:var(--accent) !important}
#cesi-routemap .var-row{padding:4px 8px 6px 30px}
#cesi-routemap #cesi-rm-stationList{gap:4px 10px}
#cesi-routemap #cesi-rm-stationList button{padding-top:7px;padding-bottom:7px}
@media (max-width: 560px){
    #cesi-routemap #cesi-rm-controls{justify-content:stretch}
    #cesi-routemap #cesi-rm-playBtn{width:100% !important}
}


/* --- на телефоне список из 10 станций отодвигал карту за экран: карта первой --- */
@media (max-width: 920px){
    #cesi-routemap .layout{grid-template-areas:"map" "card" "ctrl" "list"}
    #cesi-routemap #cesi-rm-controls{justify-content:center;margin-top:0}
    #cesi-routemap #cesi-rm-stationsBox > h3{margin-top:0}
}


/* --- финиш маршрута совпадает с точкой колледжа: поднимаем подпись,
       иначе иконка автобуса/пешехода перекрывает текст --- */
#cesi-routemap .mk-college{transform:translate(-50%, calc(-50% - 34px)) !important; z-index:3}


/* --- карта Aspro со страницы убрана, колонка получила всю ширину строки:
       на широком экране возвращаем список слева, карту справа --- */
@media (min-width: 1200px){
    #cesi-routemap .layout{
        grid-template-columns:340px minmax(0,1fr);
        grid-template-rows:auto auto 1fr;
        grid-template-areas:"list map" "ctrl map" "card map";
        gap:18px}
    #cesi-routemap #cesi-rm-stationList{grid-template-columns:1fr}
    #cesi-routemap .map-wrap{height:100%; min-height:560px}
    #cesi-routemap #cesi-rm-controls{justify-content:stretch}
    #cesi-routemap #cesi-rm-playBtn{width:100% !important}
}

/* автобус/пешеход финишируют в точке колледжа — держим их под подписью */
#cesi-routemap .mk-bus, #cesi-routemap .mk-walk{z-index:1}

/* внизу слева у Яндекса своя ссылка «Открыть в Яндекс Картах» — легенду уводим наверх */
#cesi-routemap .maplegend{top:12px; right:12px; bottom:auto; left:auto}
@media (max-width: 560px){
    #cesi-routemap .maplegend{top:8px; right:8px; font-size:11px; padding:6px 9px; gap:10px}
}
