/* Чип за града в горната лента, малкото меню и лентата след смяна (еднакъв файл в Bus Plovdiv, Bus Varna и Bus Sofia) */
.top .brand { min-width: 0; }
.top .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cchip { display: inline-flex; align-items: center; gap: 3px; flex: none; margin-right: auto; min-height: 32px; padding: 3px 8px 3px 10px; border: 1px solid var(--md-outline-variant);
  border-radius: var(--sh-s, 8px); background: transparent; color: var(--md-on-surface-variant); font: inherit; font-size: .84em; font-weight: 700; cursor: pointer; position: relative; }
.cchip::before { content: ""; position: absolute; inset: -8px -2px; }
.cchip i { font-style: normal; font-size: .8em; opacity: .8; }
.cchip:hover { background: var(--md-surface-high); }
.cchip[aria-expanded="true"] { background: var(--md-secondary-container); color: var(--md-on-secondary-container); border-color: transparent; }
.cmenu { position: fixed; z-index: 3100; min-width: 230px; max-width: calc(100vw - 16px); padding: 6px 0; background: var(--md-surface-c); color: var(--md-on-surface);
  border-radius: var(--sh-s, 8px); box-shadow: var(--el3); }
.cmenu hr { border: 0; border-top: 1px solid var(--md-outline-variant); margin: 6px 0; }
.cmi { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 8px 16px; border: 0; background: transparent; color: inherit;
  font: inherit; text-align: left; cursor: pointer; }
.cmi:hover, .cmi:focus-visible { background: var(--md-surface-high); outline: none; }
.cmi.on { font-weight: 700; }
.cmi b { color: var(--md-primary); min-width: 1em; text-align: right; }
.ctog span { display: flex; flex-direction: column; }
.ctog small { font-size: .78em; color: var(--md-on-surface-variant); font-weight: 400; }
.ctog input { width: 22px; height: 22px; flex: none; accent-color: var(--md-primary); }
.csnack { --cs-acc: #ffb4a8; display: flex; flex-direction: column; gap: 4px; padding: 10px 40px 10px 16px; }
html.dark .csnack { --cs-acc: #b3000f; }
.cs-row { display: flex; align-items: center; justify-content: space-between; gap: 2px 12px; flex-wrap: wrap; }
.cs-b { border: 0; background: transparent; color: var(--cs-acc); font: inherit; font-weight: 800; min-height: 40px; padding: 4px 8px; margin-left: auto; cursor: pointer; border-radius: var(--sh-s, 8px); }
.cs-x { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border: 0; background: transparent; color: inherit; font-size: 20px; cursor: pointer; border-radius: 50%; }

/* Карта на целия екран (2026-10-28): картата между горната лента и навигацията, детайлите в лист отдолу (на компютър: панел вляво) */
.mx-stage { display: none; }
body.mx { --vbar-h: 0px; --nav-h: 52px; overflow: hidden; padding-bottom: 0; height: 100dvh; }
html:has(body.mx) { overflow: hidden; }
body.mx .vbar { display: none; }
body.mx .navb .ni i { height: 26px; }
body.mx .mx-stage { display: block; position: fixed; left: 0; right: 0; top: var(--mx-top, 52px); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 1; }
body.mx .mx-stage > div { height: 100%; }
body.mx .mx-stage .map, body.mx .mx-stage .map.full, body.mx .mx-stage .map.pl-map { height: 100% !important; min-height: 0 !important; margin: 0 !important; border-radius: 0 !important; }
/* бутоните на картата (мястото, мащабът) и „i“ вдясно, винаги над листа */
body.mx .mx-stage .leaflet-top.leaflet-left { top: auto; left: auto; right: 0; bottom: calc(var(--mx-sh, 0px) + 40px); transition: bottom .3s var(--emph); }
body.mx .mx-stage .leaflet-top.leaflet-left .leaflet-control { float: right; clear: both; margin: 8px 10px 0 0; }
body.mx .mx-stage .leaflet-bottom { bottom: var(--mx-sh, 0px); transition: bottom .3s var(--emph); }
body.mx .toast { bottom: calc(var(--nav-h) + var(--mx-sh, 0px) + 12px + env(safe-area-inset-bottom)); }

/* картата: малки чипове отгоре вместо заглавие, подсказка и голям ред */
body.mx-map main#app { position: fixed; left: 0; right: 0; top: var(--mx-top, 52px); z-index: 1300; max-width: none; padding: 8px 10px 0; margin: 0; pointer-events: none; }
body.mx-map main#app > h1, body.mx-map main#app > p.muted { display: none; }
body.mx-map .map-bar { pointer-events: auto; display: inline-flex; flex-wrap: nowrap; gap: 6px; align-items: center; max-width: 100%; }
body.mx-map .map-bar .toggle, body.mx-map .map-bar #meBtn { min-height: 34px; padding: 0 12px; border-radius: var(--sh-full); background: var(--md-surface-lowest); color: var(--md-on-surface);
  box-shadow: 0 1px 4px rgba(0,0,0,.3); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; border: 0; white-space: nowrap; flex: none; }
body.mx-map .map-bar #meBtn svg { width: 18px; height: 18px; }
body.mx-map .map-bar .toggle input { width: 16px; height: 16px; margin: 0; }
body.mx-map .map-bar #cnt { font-size: 11px; line-height: 1; padding: 5px 8px; border-radius: var(--sh-full); background: color-mix(in srgb, var(--md-surface-lowest) 85%, transparent);
  color: var(--md-on-surface-variant); box-shadow: 0 1px 3px rgba(0,0,0,.2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.mx-map #cnt:empty { display: none; }
body.mx-map .near-card { pointer-events: auto; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); max-height: 50dvh; overflow-y: auto; }

/* избраната кола: свит лист (ред 1: линия, посока, ×; ред 2: следваща спирка и малки бутони); докосване или плъзгане нагоре го разгъва */
body.mx-map .sel-card { pointer-events: auto; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); animation: mxUp .28s var(--emph-in) both; cursor: pointer; }
body.mx-map .sel-card:not(.open) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; align-items: center; padding: 0 6px 6px 12px; }
body.mx-map .sel-card[hidden] { display: none !important; }
body.mx-map .sel-card:not(.open)::before { grid-column: 1 / -1; margin: 4px auto 2px; }
body.mx-map .sel-card:not(.open) .nc-h { display: contents; }
body.mx-map .sel-card:not(.open) .sc-t { grid-column: 1; min-width: 0; font-size: 14px; }
body.mx-map .sel-card:not(.open) .sc-t span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; min-width: 0; }
body.mx-map .sel-card:not(.open) .nc-h > .tbtn, body.mx-map .sel-card:not(.open) .nc-h > .spin { grid-column: 2; justify-self: end; min-width: 40px; min-height: 40px; }
body.mx-map .sel-card:not(.open) p.sc-l { grid-column: 1; margin: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.mx-map .sel-card:not(.open) p.sc-l:not(:first-of-type) { display: none; }
body.mx-map .sel-card:not(.open) .sc-a { grid-column: 2; margin: 0; flex-wrap: nowrap; gap: 2px; justify-self: end; }
body.mx-map .sel-card:not(.open) .sc-a .btn { font-size: 0; width: 40px; min-height: 40px; padding: 0; justify-content: center; gap: 0; }
body.mx-map .sel-card:not(.open) .sc-a .btn svg { width: 20px; height: 20px; }
body.mx-map .sel-card:not(.open) .sc-a a.btn::before { content: ""; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4.5 20.3l.7.7L12 18l6.8 3 .7-.7z'/%3E%3C/svg%3E") center / 20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4.5 20.3l.7.7L12 18l6.8 3 .7-.7z'/%3E%3C/svg%3E") center / 20px no-repeat; }
body.mx-map .sel-card.open { max-height: 60dvh; overflow-y: auto; }
@keyframes mxUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* „Следи“, линия, пътуване, /r/, маршрут: детайлите в лист отдолу; дръжката (докосване или плъзгане) го разгъва */
body.mx-sheet main#app { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 1300; max-width: none; margin: 0;
  max-height: 30dvh; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 12px; background: var(--md-surface); border-radius: 20px 20px 0 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,.18); transition: max-height .32s var(--emph); animation: mxUp .3s var(--emph-in) both; }
body.mx-sheet.v-plan main#app, body.mx-sheet.v-ride main#app, body.mx-sheet.v-share main#app { max-height: 40dvh; }
body.mx-sheet main#app.open { max-height: 78dvh; }
body.mx-sheet main#app > * { animation: none; }
.mx-grab { display: block; position: sticky; top: 0; z-index: 5; width: calc(100% + 32px); height: 22px; margin: 0 -16px 2px; border: 0; padding: 0; cursor: grab; touch-action: none;
  background: var(--md-surface); border-radius: 20px 20px 0 0; }
.mx-grab::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; margin: 8px auto 0; background: var(--md-on-surface-variant); opacity: .5; }
.mx-grab::after { content: ""; position: absolute; inset: -6px 0 -6px; }
body.mx-sheet main#app h1 { font-size: 1.2em; margin: 2px 0; }
body.mx-sheet .ride { margin: 0; }
body.mx-sheet .rsheet { margin: 0; padding: 0; box-shadow: none; background: none; border-radius: 0; }
body.mx-sheet .pl-fol { top: 22px; }
@media (min-width: 900px) {
  body.mx-sheet main#app { top: var(--mx-top, 52px); right: auto; width: 400px; max-height: none !important; border-radius: 0; box-shadow: 2px 0 10px rgba(0,0,0,.12); padding-top: 8px; }
  body.mx-sheet .mx-stage { left: 400px; }
  .mx-grab { display: none !important; }
  body.mx-map .sel-card, body.mx-map .near-card { left: 12px; right: auto; width: 380px; top: calc(var(--mx-top, 52px) + 56px); bottom: auto; margin: 0; max-height: calc(100dvh - var(--mx-top, 52px) - var(--nav-h) - 80px); overflow-y: auto; border-radius: 16px; }
  body.mx-map .sel-card:not(.open) { display: block; padding: 4px 14px 10px; }
  body.mx-map .sel-card:not(.open) .nc-h { display: flex; }
  body.mx-map .sel-card:not(.open) p.sc-l { white-space: normal; margin: 4px 0 0; font-size: 14px; }
  body.mx-map .sel-card:not(.open) p.sc-l:not(:first-of-type) { display: block; }
  body.mx-map .sel-card:not(.open) .sc-a { flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  body.mx-map .sel-card:not(.open) .sc-a .btn { font-size: inherit; width: auto; padding: 0 10px; gap: 4px; }
  body.mx-map .sel-card:not(.open) .sc-a a.btn::before { display: none; }
  body.mx-map .sel-card::before, body.mx-map .near-card::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { body.mx-sheet main#app, body.mx-map .sel-card { animation: none; transition: none; } }

/* въртене на картата (maprot.js): компас и третото състояние на „Моето място“ (посоката нагоре) */
.leaflet-control.mr-compass { width: 40px; height: 40px; margin: 10px 0 0 10px; border: 0; border-radius: 12px; background: var(--md-surface-container-high, #fff); color: var(--md-on-surface-variant, #444);
  box-shadow: 0 1px 4px rgba(0,0,0,.35); display: grid; place-items: center; cursor: pointer; position: relative; padding: 0; }
.leaflet-control.mr-compass[hidden] { display: none; }
.leaflet-control.mr-compass::after { content: ''; position: absolute; inset: -4px; }
.leaflet-control.mr-compass svg { transition: transform .15s linear; }
.leaflet-control.loc-btn.head { background: #1a73e8; color: #fff; box-shadow: 0 0 0 3px rgba(26,115,232,.35), 0 1px 4px rgba(0,0,0,.35); }
.mr-live .vm-p, .mr-live .flow-a, .mr-live .me-dot i { visibility: hidden; }
.mr-live .me-h { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .leaflet-control.mr-compass svg { transition: none; } }
