/* ========================================= */
/* 1. TOKENS & VARIABLES                     */
/* ========================================= */
:root {
    --c-ink: #111111;
    --c-ink-muted: #6b7280;
    --c-paper: #ffffff;
    --c-paper-soft: #f3f4f6;
    --c-stroke: #e5e7eb;
    
    --c-primary: #007aff;
    --c-success: #34c759;
    --c-danger: #ff3b30;
    --c-warning: #f59e0b;

    --radius-md: 12px;
    --radius-lg: 20px;
    
    --shadow-card: 0 4px 24px rgba(0,0,0,0.15);
    --trans-default: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Z-Index tokens (UI) */
    --z-map: 1;
    --z-ui-panel: 4000;
    --z-ui-drawer: 4500;
    --z-ui-loader: 9999;

    /* Panel tokens */
    --panel-bg: rgba(255,255,255,.92);
    --panel-border: rgba(17,17,17,.10);
    --panel-shadow: var(--shadow-card);
    --panel-gap: 12px;
    --panel-pad: 8px;
    --lvl-btn: 32px;
    --switch-w: 36px;
    --switch-h: 20px;
    --switch-knob: 16px;
    --icon: 18px;
    --tongue-w: 44px;
    --tongue-h: 28px;

    --peak-tail: 7px;

}

/* ========================================= */
/* 2. BASE & LAYOUT                          */
/* ========================================= */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100dvh; overflow: hidden; font-family: system-ui, -apple-system, sans-serif; background: var(--c-paper); }

#map { position: relative; width: 100%; height: 100%; z-index: var(--z-map); background-color: #2b3033; transition: background-color 0.3s ease; }

/* =========================
   GIPS MODE (SAFE & LIGHT)
   ========================= */
html[data-map-bg="gips"]:not(.is-mode-rentals) #map { background-color: #ffffff; }
html[data-map-bg="gips"]:not(.is-mode-rentals) #map img:not(.kp-pin-marker):not(.kp-color-pin) { filter: grayscale(100%) brightness(150%); }

/* Loader */
.kp-loader{ position: fixed; inset: 0; z-index: var(--z-ui-loader); background: var(--c-paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; transition: opacity 240ms ease; }
.kp-loader.is-hiding{ opacity: 0; pointer-events: none; }
.kp-loader__spinner{ width: 40px; height: 40px; border: 4px solid var(--c-paper-soft); border-top-color: var(--c-primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0; }

@keyframes spin{
  100%{ transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce){
  .kp-loader__spinner{ animation: none; }
}

.kp-loader-error{ width: min(520px, calc(100vw - 32px)); padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid var(--c-stroke); background: var(--c-paper); box-shadow: var(--shadow-card); color: var(--c-ink); text-align: center; line-height: 1.35; }
.kp-loader-error small{ display: block; margin-top: 6px; color: var(--c-ink-muted); font-size: 12px; line-height: 1.25; word-break: break-word; }

/* ========================================= */
/* 3. MAP MARKERS (ОБНОВЛЕННЫЙ СТИЛЬ)        */
/* ========================================= */

/* === СТАТУС ==== */
.kp-status{ font-weight: 800; }
.kp-status.is-open{ color: var(--c-success); }
.kp-status.is-closed{ color: var(--c-danger); }

.kp-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0s;
  z-index: 100;
  
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.kp-pin:hover,
.kp-pin.is-highlighted,
.kp-pin.is-selected {
  transform: translate(-50%, -50%) scale(1.3);
  z-index: 1000 !important;
  filter: brightness(1.08);
}

.kp-pin--run {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--pin-color, #999);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Закрытая трасса */
.kp-pin--run.is-closed {
  opacity: 0.5;
  filter: grayscale(0.2);
  box-shadow: none;
  border-color: #eee;
}

.kp-pin--rental {
  width: 32px;
  height: 32px;
  background: #fff;
  border-radius: 50%;
  color: #111;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  font-size: 14px;
  font-weight: bold;
}

.kp-pin--rental svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2;
}

.kp-pin--rental.is-partner {
  background: #f0fdf4;
  color: #15803d;
  border: 2px solid #10b981;
}

.kp-pin--parking {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  font-size: 13px;
  font-weight: 700;
}
.kp-pin--parking.is-ev { background: #10b981; }
.kp-pin--parking.is-car { background: #f97316; }

/* Lift Labels */
.lift-label {
    background: rgba(20, 20, 20, 0.9); color: #fff;
    padding: 2px 6px; border-radius: 4px;
    display: flex; align-items: center; gap: 5px;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    opacity: 1;
    transition: opacity 180ms ease, transform 180ms ease;
    will-change: opacity, transform;
    cursor: pointer; 
    user-select: none;
}

.lift-label:hover { transform: translate(-50%, -50%) scale(1.1);background: #000; }
.lift-label.is-closed { opacity: 0.45; }
html:not(.is-closed-lifts-visible) .lift-label.is-closed { opacity: 0; display: none; pointer-events: none; }

.lift-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-ink-muted); }
.lift-status-dot.status-open { background: var(--c-success); }
.lift-status-dot.status-closed { background: var(--c-danger); }
.lift-status-dot.status-walking { background: var(--c-warning); }

.lift-label__info { display: flex; flex-direction: column; line-height: 1; }
.lift-label__name { font-size: 12px; font-weight: 700; }
.lift-label__time { font-size: 9px; opacity: 0.8; margin-top: 1px; }

/* Hubs (FIXED SQUASHING) */
.pin-hub-wrapper {
    background: #fff; padding: 4px 10px 4px 4px; border-radius: 8px;
    display: flex; align-items: center; gap: 8px;
    box-shadow: none;
    transform: translate(-50%, -50%);
    min-width: max-content;
}
.pin-hub__icon { 
    width: 24px; height: 24px; background: #000; border-radius: 50%; padding: 4px; fill: #fff; 
    flex-shrink: 0;
}
.pin-hub__title { font-size: 12px; font-weight: bold; color: #000; white-space: nowrap; }
.pin-hub__alt { font-size: 9px; color: #666; }

/* ========================================= */
/* PEAKS (Стиль: Комикс / Обводка)           */
/* ========================================= */

.kp-peak-label { 
    position: absolute; 
    pointer-events: none; 
    z-index: 10;
    transform: translate(-50%, calc(-100% - 14px)); 
    transition: opacity 200ms ease, transform 200ms ease; 
    will-change: opacity, transform; 
}

html.is-peaks-hidden .kp-peak-label { 
    opacity: 0; 
    visibility: hidden; 
    transform: translate(-50%, -150%); 
}

.kp-peak-label__bubble {
    position: relative;
    background: #fff; 
    color: #111;
    padding: 3px 8px; 
    border-radius: 5px;
    font-size: 11px; 
    font-weight: 700; 
    text-transform: uppercase;
    text-align: center;
    border: 1px solid #111;
    box-shadow: none;
    white-space: nowrap;
    max-width: none;
    overflow: visible;
}

.kp-peak-label__bubble::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    z-index: 0;
    border-width: 13px 7px 0 7px; 
    border-color: #111 transparent transparent transparent;
    bottom: -13px; 
}

.kp-peak-label__bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    z-index: 1;
    border-width: 12px 6px 0 6px;
    border-color: #fff transparent transparent transparent;
    bottom: -11px; 
}

/* ========================================= */
/* 4. UI CONTROLS                            */
/* ========================================= */
.kp-panel{
  position: fixed;
  z-index: var(--z-ui-panel);
  background: var(--panel-bg, rgba(255,255,255,.92));
  border: 1px solid var(--panel-border, rgba(17,17,17,.10));
  box-shadow: var(--panel-shadow, var(--shadow-card));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform var(--trans-default);
}

/* SR helper */
.kp-sr{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* === Status (НЕ ТРОГАЕМ ЛОГИКУ) === */
.kp-sys-status{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:8px;
  margin-right:12px;
  min-width:140px;
}
.mode-skiing .kp-sys-status { background:#ecfdf5; color:#15803d; }
.mode-walking .kp-sys-status{ background:#fffbeb; color:#b45309; }
.mode-closed .kp-sys-status { background:#fef2f2; color:#991b1b; }
.kp-sys-status__dot{ width:8px; height:8px; border-radius:50%; background:currentColor; }
.kp-sys-status__title{ font-size:12px; font-weight:700; }
.kp-sys-status__desc{ font-size:10px; opacity:.9; }

/* Grid */
.kp-panel__grid{
  display:flex;
  align-items:center;
  gap: var(--panel-gap, 12px);
  flex-wrap: nowrap; /* В ОДНУ ЛИНИЮ */
}

.kp-panel__item{ flex:0 0 auto; display:flex; align-items:center; }
.kp-panel__item--full{
  display:flex;
  align-items:center;
  gap: 8px;
  flex: 0 0 auto;
}
/* Separator inside panel grid */
.kp-panel__sep{
  width: 1px;
  height: 22px;
  background: rgba(17,17,17,0.16);
  border-radius: 1px;
  flex: 0 0 auto;
  opacity: .9;
}

/* Generic button for panel (rentals mode etc.) */
.kp-panel-btn{
  height: var(--lvl-btn, 32px);
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--c-stroke);
  background: var(--c-paper);
  color: var(--c-ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.kp-panel-btn:active{ transform: scale(.98); }
.kp-panel-btn.is-active{
  background: #eff6ff;
  border-color: rgba(0,81,255,0.22);
  color: var(--c-primary);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}


/* Levels */
.kp-btn-level{
  width: var(--lvl-btn, 32px);
  height: var(--lvl-btn, 32px);
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  flex-shrink: 0;
}
.kp-btn-level.is-active{
  transform: scale(1.08);
  border-color: rgba(255,255,255,.95);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.kp-btn-level[data-level="green"] { background: var(--c-success); }
.kp-btn-level[data-level="blue"]  { background: var(--c-primary); }
.kp-btn-level[data-level="red"]   { background: var(--c-danger); }
.kp-btn-level[data-level="black"] { background: #000; }

/* Switch: ICON + TOGGLE (в ОДНУ СТРОКУ, без переносов) */
.kp-switch{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  line-height: 1;
  font-size: 13px;
  font-weight: 600;
}

.kp-switch__icon{
  width: var(--icon, 18px);
  height: var(--icon, 18px);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  opacity: .92;
  flex: 0 0 auto;
}
.kp-switch__icon svg{
  width:100%;
  height:100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* IMPORTANT: input must be adjacent sibling to track */
.kp-switch__input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.kp-switch__track{
  width: var(--switch-w, 36px);
  height: var(--switch-h, 20px);
  background: var(--c-stroke);
  border-radius: 999px;
  position: relative;
  transition: background 160ms ease;
  flex: 0 0 auto;
}
.kp-switch__track::after{
  content:"";
  position:absolute;
  top: 2px; left: 2px;
  width: var(--switch-knob, 16px);
  height: var(--switch-knob, 16px);
  background: #fff;
  border-radius: 50%;
  transition: transform 160ms ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.kp-switch__input:checked + .kp-switch__track{ background: var(--c-success); }
.kp-switch__input:checked + .kp-switch__track::after{
  transform: translateX(calc(var(--switch-w, 36px) - var(--switch-knob, 16px) - 4px));
}

/* Tongue icons state (X when open, chevron when hidden) */
.kp-panel__tongue{ display:none; }
.kp-tongue__icon{ width:18px; height:18px; display:block; }
.kp-panel:not(.is-hidden) .kp-tongue__icon--closed{ display:none; }
.kp-panel.is-hidden .kp-tongue__icon--open{ display:none; }

/* ========================================= */
/* 5. DRAWER (Z-INDEX FIXED)                 */
/* ========================================= */
.kp-drawer {
    position: fixed;
    z-index: var(--z-ui-drawer);
    background: #fff; 
    display: flex; 
    flex-direction: column;
    transition: transform var(--trans-default); 
    box-shadow: var(--shadow-card); 
    overflow: hidden;
    padding-top: 40px;
}

.kp-drawer__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 12px;
    background: #f3f4f6;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s ease;
}

.kp-drawer__close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kp-drawer__close:hover {
    background: #f3f4f6;
    color: #111;
    transform: rotate(90deg);
}

.kp-drawer__inner { 
  padding: 0;                
  overflow-y: auto;          
  overflow-x: hidden;        
  height: auto; 
  position: relative; 
  flex: 1 1 auto;            
  min-height: 0;             

  scrollbar-width: none;     
  -ms-overflow-style: none;  
}
.kp-drawer__inner::-webkit-scrollbar{
  width: 0; height: 0;
  display: none;             
}

.kp-drawer.is-level2 .kp-drawer__inner > *:not(.kp-level2) {
    display: none !important;
}

.kp-drawer__inner > * { padding: 20px; }
.kp-drawer__inner > .kp-rental-card { padding: 0; }

.kp-rental-card > .kp-card-header { padding: 20px 20px 0; }
.kp-rental-block[data-block="meta"],
.kp-rental-block[data-block="contacts"],
.kp-rental-block[data-block="prices"],
.kp-rental-block[data-block="promo"] { padding: 0 20px; }
.kp-rental-block[data-block="gallery"] { padding: 12px 12px 0 12px; }

/* Card Inner */
.kp-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

.kp-card-badge { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.kp-card-badge.is-rental{ background: #0ea5e9; }
.kp-card-badge.is-ev{ background: #10b981; }
.kp-card-badge.is-car{ background: #f97316; }
.kp-card-badge.is-parking{ background: #3b82f6; }

.kp-card-title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; }
.kp-card-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: #f9fafb; padding: 8px; border-radius: 8px; margin-bottom: 12px; }
.kp-meta-item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.kp-meta-item span { font-size: 10px; text-transform: uppercase; color: #888; margin-bottom: 2px; }
.kp-meta-item b { font-size: 13px; font-weight: 600; }
.kp-card-desc { font-size: 14px; line-height: 1.5; color: #444; margin-bottom: 16px; }

/* 6. PRICES & BUTTONS (COMIC) */
.kp-price-title {
    font-size: 13px; font-weight: 700; color: #6b7280; text-transform: uppercase;
    margin-top: 16px; margin-bottom: 8px; border-bottom: 1px solid #e5e7eb; padding-bottom: 4px;
}
.kp-price-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px dashed #e5e7eb;
}
.kp-price-row:last-child { border-bottom: none; }
.kp-price-name { font-size: 14px; font-weight: 600; color: #111; line-height: 1.2; }

/* Price widget: seasons */
.kp-price-group { display: none; }
.kp-price-group.is-active { display: block; }

.kp-season { margin-top: 6px; }
.kp-season-select{
  width: 100%;
  max-width: 320px;
  padding: 10px 12px;
  padding-right: 44px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-weight: 800;

  /* нативный select + кастомный chevron справа */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 18px 18px;
  background-position: right 14px center;
}
@media (max-width: 768px){
  .kp-season-select{
    max-width: 100%;
    padding: 8px 10px;
    padding-right: 36px;
    font-size: 13px;
    background-position: right 10px center;
  }
}

/* =========== ДИСКОНТ ===========*/
.kp-price-discount { color: var(--c-danger); font-weight: 900; }

.kp-val-new--plain { color: var(--c-ink); font-weight: 900; }

.kp-price-sub { font-size: 11px; color: #9ca3af; font-weight: 400; }
.kp-price-vals { text-align: right; }
.kp-val-old { font-size: 12px; text-decoration: line-through; color: #9ca3af; }
.kp-val-new { font-size: 16px; font-weight: 800; color: var(--c-success); }

/* Buttons */
.kp-actions-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.btn.comic-primary, .btn.comic-white {
    height: 52px; border-radius: 14px; font-size: 15px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    text-decoration: none;
}
.btn.comic-primary:active, .btn.comic-white:active { transform: scale(0.98); }
.btn svg { width: 22px; height: 22px; stroke-width: 2px; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.btn.comic-primary { background: #007aff; color: #fff; box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3); }
.btn.comic-primary:hover { background: #0062cc; }
.btn.comic-primary svg { stroke: #fff; }

.btn.comic-white { background: #fff; color: #1f2937; border: 1px solid #e5e7eb; }
.btn.comic-white:hover { background: #f9fafb; border-color: #d1d5db; }
.btn.comic-white svg { stroke: #1f2937; }

.btn-cam-toggle {
    width: 100%; background: #fff; border: 1px dashed #9ca3af; color: #4b5563;
    padding: 10px; border-radius: 12px; font-size: 13px; font-weight: 600;
    cursor: pointer; margin-top: 12px; margin-bottom: 12px;
}
.btn-cam-toggle:hover { border-color: var(--c-primary); color: var(--c-primary); background: #eff6ff; }

/* ========================================= */
/* 7. RESPONSIVE                             */
/* ========================================= */
@media (max-width: 768px) {
  .kp-pin--run { width: 12px; height: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
  .kp-pin--rental, .kp-pin--parking { width: 28px; height: 28px; font-size: 12px; }
  .kp-pin--rental svg { width: 15px; height: 15px; }
  #map.is-interactive-hover{ cursor: pointer; }

  .kp-panel{
    top: 0; left: 0; right: 0;
    padding: var(--panel-pad, 8px);
    border-radius: 0 0 16px 16px;
    display:flex;
    flex-direction: column;
  }
  .kp-panel.is-hidden{ transform: translateY(-100%); }

  /* ONE LINE: уровни / закрытые / лифты (всё в ряд) */
  .kp-panel__grid{
    display:flex;
    align-items:center;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .kp-panel__grid::-webkit-scrollbar{ height: 0; }

  .kp-panel__item--full{ flex:0 0 auto; }

  /* статусник сверху */
  .kp-sys-status{
    width: 100%;
    margin: 0 0 8px 0;
    justify-content: center;
  }

  /* Tongue */
  .kp-panel__tongue{
    position: absolute;
    bottom: calc(-1 * var(--tongue-h, 28px));
    left: 50%;
    transform: translateX(-50%);
    width: var(--tongue-w, 44px);
    height: var(--tongue-h, 28px);
    background: var(--panel-bg, rgba(255,255,255,.92));
    border: 1px solid var(--panel-border, rgba(17,17,17,.10));
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor: pointer;
  }

  .kp-drawer { bottom: 0; left: 0; right: 0; max-height: 80vh; border-radius: 16px 16px 0 0; transform: translateY(110%); }
  .kp-drawer.is-open { transform: translateY(0); }
  .kp-drawer__close { top: 12px; right: 12px; background: #f3f4f6; }

  .kp-actions-stack { display: none; }
  .kp-action-bar { display: flex; gap: 8px; margin-top: 10px; }
  .kp-action-btn { flex: 1; height: 40px; background: var(--c-paper-soft); border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--c-ink); font-size: 11px; font-weight: 600; }
  .kp-action-btn.is-primary { background: #eff6ff; color: var(--c-primary); }
  .kp-action-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
}

.kp-promo-block { background: #f9fafb; padding: 12px; border-radius: 8px; border: 1px dashed #ccc; margin-top: 12px; }
.kp-promo-input-group { display: flex; gap: 6px; }
.kp-input-code { flex: 1; padding: 8px; border: 1px solid #ddd; border-radius: 6px; text-align: center; font-weight: bold; }
.kp-btn-copy { width: 40px; border: 1px solid #ddd; background: #fff; border-radius: 6px; cursor: pointer; }

/* ========================================= */
/* 8.4 CARD ACTIONS (RUN/LIFT)               */
/* ========================================= */

.kp-card-actions{
  margin-top: 12px;
  gap: 10px;
}

/* Desktop: base grid (2 / 1 / 1) */
.kp-card-actions.is-desktop{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

/* Инструкторы + Прокаты (3..4) на всю ширину */
.kp-card-actions.is-desktop > :where(.kp-action-btn, .kp-rental-contactBtn):nth-child(n+3){
  grid-column: 1 / -1;
}

/* Base button reset + унификация */
.kp-card-actions :where(.kp-action-btn, .kp-rental-contactBtn){
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(17,17,17,.10);
  background: var(--c-paper-soft, #f3f4f6);
  color: var(--c-ink, #111);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;

  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;
  user-select: none;

  transition: transform .10s ease, background .15s ease, box-shadow .20s ease;
}

.kp-card-actions :where(.kp-action-btn, .kp-rental-contactBtn):active{
  transform: scale(.99);
}

.kp-card-actions :where(.kp-action-btn, .kp-rental-contactBtn) svg{
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Variants */
.kp-card-actions .kp-action-btn.is-white{
  background: #fff;
  color: #111;
  border-color: #e5e7eb;
}
.kp-card-actions .kp-action-btn.is-white:hover{ background: #f9fafb; }

.kp-card-actions .kp-action-btn.is-primary{
  background: #eff6ff;
  color: var(--c-primary, #007aff);
  border-color: rgba(0,122,255,.18);
}
.kp-card-actions .kp-action-btn.is-primary:hover{ background: #dbeafe; }

.kp-card-actions .kp-action-btn.is-tg{
  background: #eff6ff;
  color: #007aff;
  border-color: rgba(0,122,255,.18);
}
.kp-card-actions .kp-action-btn.is-tg:hover{ background: #dbeafe; }

.kp-card-actions .kp-action-btn.is-wa{
  background: #f0fdf4;
  color: #15803d;
  border-color: rgba(21,128,61,.18);
}
.kp-card-actions .kp-action-btn.is-wa:hover{ background: #dcfce7; }

/* Layouts */

/* Mobile (< 768px): схема 3 / 2 (6 колонок) */
@media (max-width: 768px){
  .kp-card-actions.is-mobile:not(.is-prices){
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    width: 100%;
  }

  /* 1-й ряд: Ски‑пассы + Инструкторы + Прокаты (1..3) */
  .kp-card-actions.is-mobile:not(.is-prices) > :where(.kp-action-btn, .kp-rental-contactBtn):nth-child(-n+3){
    grid-column: span 2;
    min-height: 40px;
    padding: 0 8px;
    font-size: 11px;
    gap: 6px;
  }

  /* 2-й ряд: TG + WA (4..5) */
  .kp-card-actions.is-mobile:not(.is-prices) > :where(.kp-action-btn, .kp-rental-contactBtn):nth-child(n+4){
    grid-column: span 3;
  }
}

/* Прайс-окно: только TG/WA — компактно */
.kp-card-actions.is-mobile.is-prices{
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Desktop (>= 769px): схема 2 / 1 / 1 */
@media (min-width: 769px){
  .kp-card-actions.is-desktop{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  /* Инструкторы + Прокаты (3..4) на всю ширину */
  .kp-card-actions.is-desktop > :where(.kp-action-btn, .kp-rental-contactBtn):nth-child(n+3){
    grid-column: 1 / -1;
  }

  .kp-card-actions.is-desktop :where(.kp-action-btn, .kp-rental-contactBtn){
    min-height: 42px;
    font-size: 11px;
    font-weight: 800;
    padding: 0 10px;
  }
}

/* Safety: если desktop-экшены попадут на мобилку — пусть не ломают сетку */
@media (max-width: 768px){
  .kp-card-actions.is-desktop{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .kp-card-actions.is-desktop > :where(.kp-action-btn, .kp-rental-contactBtn){
    grid-column: span 1;
  }
}

/* 8.5 MOBILE PRICES SHEET (BOTTOM SHEET)    */
/* ========================================= */

.kp-price-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0, 0.5);
    z-index: 4999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}
.kp-price-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.kp-price-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5000;
    
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    transform: translateY(110%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.kp-price-sheet.is-visible {
    transform: translateY(0);
}

/* --- Внутренности шторки --- */
.kp-sheet-header {
    flex: 0 0 auto;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 12px;
}

.kp-sheet-back {
    border: none;
    background: #f3f4f6;
    color: #111;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
.kp-sheet-back:active {
    background: #e5e7eb;
    transform: scale(0.96);
}

.kp-sheet-title { 
    font-size: 18px; 
    font-weight: 800; 
    color: #111; 
}

.kp-sheet-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    min-height: 30vh;
}

.kp-sheet-footer {
    flex: 0 0 auto;
    padding: 16px 20px;
    border-top: 1px solid #f3f4f6;
    background: #fff;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); 
}

/* ========================================= */
/* 9. WEBCAMS (WRAPPER + IFRAME)             */
/* ========================================= */
.kp-cam-wrapper{
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.kp-cam-iframe{
  width: 100%;
  height: 220px;
  border: 0;
  display: block;
}
@media (max-width: 768px){
  .kp-cam-iframe{ height: 200px; }
}

/* ========================================= */
/* 10. LABEL VISIBILITY BY ZOOM (CSS ONLY)   */
/* ========================================= */

html[data-zoom-level="1"] .lift-label {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.98);
}

.lift-label.is-selected {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translate(-50%, -50%) scale(1) !important;
  z-index: 6000; /* Поверх всего */
}

/* Hover highlight */
.lift-label.is-highlighted {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: none;
  z-index: 5500;
}

.btn-cam-toggle.is-active{ border-style: solid; border-color: var(--c-primary); color: var(--c-primary); background: #eff6ff; }

/* ========================================= */
/* 11. CLEANUP + MOBILE TOP BAR LAYOUT       */
/* ========================================= */

.lift-label{
  box-shadow: none !important;
}

/* ==== CURSOR === */ 
a[href],
button,
[role="button"],
.kp-btn,
.kp-btn-level,
.kp-switch,
.kp-panel__tongue,
.kp-pin,
.kp-card,
.kp-card *[data-action],
.btn-cam-toggle,
.kp-contact-footer a {
    cursor: pointer;
}

.is-interactive-hover,
.is-interactive-hover canvas {
  cursor: pointer !important;
}

/* Mobile Top Bar: group track filters (left) + system toggles (right) */
@media (max-width: 768px){
  .kp-topbar-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }
  .kp-topbar-row__tracks{
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .kp-topbar-row__tracks::-webkit-scrollbar{ display:none; }

  .kp-topbar-row__system{
    display: flex;
    align-items: center;
    gap: 10px; /* удобнее попасть пальцем */
    flex: 0 0 auto;
  }

  /* Mini emoji inside switch icon */
  .kp-switch__emoji{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
  }
}

.kp-btn-level.is-inactive{ opacity: 0.5; }

.kp-loader{ transition: opacity 240ms ease; }
.kp-loader.is-hiding{ opacity: 0; }

.kp-loading-inline{ font-size: 12px; color: #6b7280; padding: 10px; }
.kp-loading-inline--center{ padding: 20px; text-align: center; }

/* ========================================= */
/* RENTAL CARD (Responsive Layout)           */
/* ========================================= */
.kp-rental-card{ display: flex; flex-direction: column; gap: 12px; }

.kp-rental-gallery {
    position: relative;
}

.kp-rental-galleryTrack { 
    display: flex; 
    gap: 10px; 
    overflow-x: auto; 
    scroll-snap-type: x mandatory; 
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    padding-bottom: 10px; 
}
.kp-rental-galleryTrack::-webkit-scrollbar { display: none; width: 0; height: 0; }

.kp-rental-gallerySlide {
    flex: 0 0 100%; 
    height: 180px; 
    
    border-radius: 16px; 
    overflow: hidden; 
    scroll-snap-align: start; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.06); 
    background: none; 
}

.kp-rental-galleryImg{ width: 100%; height: 100%; display: block; object-fit: cover; }

/* === СТИЛИ СТРЕЛОК (Остаются прежними) === */
.kp-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
    transition: all 0.2s ease;
    opacity: 0;
}

.kp-gallery-arrow.is-prev {
    left: 16px; 
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 18L9 12L15 6' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.kp-gallery-arrow.is-next {
    right: 16px; 
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 18L15 12L9 6' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.kp-rental-gallery:hover .kp-gallery-arrow { opacity: 1; }
.kp-gallery-arrow:hover { background-color: #fff; transform: translateY(-50%) scale(1.1); }
.kp-gallery-arrow:active { transform: translateY(-50%) scale(0.95); }

/* Мета-данные (без изменений) */
.kp-rental-metaGrid{ display: grid; gap: 8px; background: #f8fafc; padding: 10px; border-radius: 10px; }
.kp-rental-metaRow span{ display: block; font-size: 11px; text-transform: uppercase; color: #6b7280; margin-bottom: 2px; }
.kp-rental-metaRow b{ display: block; font-size: 14px; font-weight: 600; color: #111827; }

/* ========================================= */
/* АККОРДЕОН ЦЕН (ИСПРАВЛЕННЫЙ)              */
/* ========================================= */

/* 1. Кнопка с флексом для стрелки */
.kp-rental-pricesToggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 800;
  color: #111;
  cursor: pointer;
  transition: background 0.15s ease;
}

.kp-rental-pricesToggle:active {
  background: #f9fafb;
}

/* 2. Рисуем стрелку (Шеврон) */
.kp-rental-pricesToggle::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotate(0deg);
}

.kp-rental-prices.is-open .kp-rental-pricesToggle::after {
  transform: rotate(180deg);
}

.kp-rental-pricesContent {
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 0;
}

/* 5. Раскрытие */
.kp-rental-prices.is-open .kp-rental-pricesContent {
  max-height: 1000px;
}

.kp-rental-priceTable{
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.kp-rental-priceTable th,
.kp-rental-priceTable td{
  padding: 10px;
  font-size: 13px;
  border-bottom: 1px solid #e5e7eb;
}
.kp-rental-priceTable th{
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: #6b7280;
  background: #f9fafb;
}
.kp-rental-priceVal{
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
}
.kp-rental-priceEmpty{
  text-align: center;
  color: #6b7280;
}

/* ========================================= */
/* СТИЛИ ПРОМОКОДА (50/50 в одну строку)     */
/* ========================================= */

.kp-rental-promoInner { display: block; }

/* Общие стили для кнопок в этом блоке */
.kp-rental-promoBtn,
.kp-rental-promoCopy {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 12px;
  
  /* Фиксируем высоту и центруем контент */
  height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
}

/* Кнопка "Получить промокод" (исходная) */
.kp-rental-promoBtn { width: 100%; }
.kp-rental-promoBtn.is-loading { opacity: 0.7; pointer-events: none; }
.kp-rental-promoBtn:active { transform: scale(0.98); background: #f9fafb; }

.kp-rental-promoReveal.is-hidden { display: none; }
.kp-rental-promoRow {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.kp-rental-promoInput {
  flex: 1;
  width: 0;
  min-width: 0;
  
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  
  height: 44px;
  padding: 0 10px;
  
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  color: #111;
  letter-spacing: 0.5px;
}

.kp-rental-promoCopy {
  flex: 1;
  width: 0;
  min-width: 0;
  white-space: nowrap;
}

.kp-rental-promoCopy:active { background: #f3f4f6; }
.kp-rental-promoCopy[disabled] { opacity: 0.5; cursor: default; }

/* Подсказки и ошибки */
.kp-rental-promoHint { margin-top: 6px; font-size: 12px; color: #6b7280; text-align: center; }
.kp-rental-promoError { margin-top: 8px; font-size: 13px; color: #b91c1c; text-align: center; }
.kp-rental-promoError.is-hidden { display: none; }

/* ========================================= */
/* НОВЫЙ СТИЛЬ КОНТАКТОВ (СЕТКА + ЦВЕТА)     */
/* ========================================= */

.kp-rental-contactsGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

/* Базовая кнопка */
.kp-rental-contactBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  
  height: 44px; 
  padding: 0 12px;
  border-radius: 12px;
  
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
  
  transition: transform 0.1s ease, background 0.15s ease;
  cursor: pointer;
  
  /* Дефолтный стиль */
  background: #f3f4f6; 
  color: #111;
  border: 1px solid transparent;
}
.kp-rental-contactBtn:active { transform: scale(0.97); }

/* Иконки внутри кнопок */
.kp-rental-contactBtn svg {
  width: 20px; height: 20px;
  stroke-width: 2px;
  fill: none; stroke: currentColor;
}

/* --- TELEGRAM --- */
.kp-rental-contactBtn.is-tg {
  background: #eff6ff; 
  color: #007aff; 
  border: 1px solid rgba(0, 122, 255, 0.15);
}
.kp-rental-contactBtn.is-tg:hover { background: #dbeafe; }

/* --- WHATSAPP --- */
.kp-rental-contactBtn.is-wa {
  background: #f0fdf4; 
  color: #15803d; 
  border: 1px solid rgba(21, 128, 61, 0.15);
}
.kp-rental-contactBtn.is-wa:hover { background: #dcfce7; }

/* --- ПОЗВОНИТЬ (На всю ширину) --- */
.kp-rental-contactBtn.is-call {
  grid-column: 1 / -1; 
  background: #fff;
  color: #111;
  border: 1px solid #e5e7eb;
}
.kp-rental-contactBtn.is-call:hover { background: #f9fafb; }

/*============================*/
/*===== max-width: 768px ====*/
/*===========================*/

@media (max-width: 768px){

.kp-peak-label__bubble {
    font-size: 10px;
    padding: 2px 5px;
    line-height: 1.1;
    max-width: 110px;
  }

  /* Уменьшаем стрелку (хвостик), чтобы она была пропорциональна */
  .kp-peak-label__bubble::before {
    border-width: 9px 5px 0 5px;
    bottom: -9px;
  }
  
  .kp-peak-label__bubble::after {
    border-width: 8px 4px 0 4px;
    bottom: -7px;
  }

  .kp-gallery-arrow { opacity: 1; width: 28px; height: 28px; }

  /* Mobile order */
  .kp-rental-block[data-block="gallery"]{ order: 1; }
  .kp-rental-block[data-block="meta"]{ order: 2; }
  .kp-rental-block[data-block="contacts"]{ order: 3; }
  .kp-rental-block[data-block="prices"]{ order: 4; }
  .kp-rental-block[data-block="promo"]{ order: 5; }
}

/* ========================================= */
/* 7. RESPONSIVE (DESKTOP)                   */
/* ========================================= */
@media (min-width: 769px) {
  .kp-panel { bottom: 30px; left: 50%; transform: translateX(-50%); border-radius: var(--radius-lg); padding: 10px 24px; display: flex; align-items: center; gap: 20px; width: max-content; max-width: 98vw; white-space: nowrap; }
  .kp-sys-status { margin: 0; flex-shrink: 0; }
  .kp-topbar-row { display: flex; align-items: center; gap: 16px; }
  .kp-topbar-row__tracks,
  .kp-topbar-row__system { display: flex; align-items: center; gap: 12px; }
  .kp-rental-gallerySlide{ flex: 0 0 100%; height: 220px; }

  /* Скрываем ненужные элементы */
  .kp-panel__tongue { display: none; }
  .kp-action-bar { display: none; }
  .kp-drawer { top: 0; bottom: 0; left: 0; width: 360px; transform: translateX(-100%); border-right: 1px solid var(--c-stroke); }
  .kp-drawer.is-open { transform: translateX(0); }
  
  /* Порядок блоков в карточке аренды */
  .kp-rental-block[data-block="gallery"] { order: 1; }
  .kp-rental-block[data-block="meta"] { order: 2; }
  .kp-rental-block[data-block="prices"] { order: 3; }
  .kp-rental-block[data-block="promo"] { order: 4; }
  .kp-rental-block[data-block="contacts"] { order: 5; }
}

/* ================================
   Price Bottom Sheet (tweaks)
   ================================ */
.kp-price-backdrop{
  z-index: calc(var(--z-ui-loader) - 2);
}

.kp-price-sheet{
  z-index: calc(var(--z-ui-loader) - 1);
  background: var(--c-paper);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kp-sheet-close{
  margin-left: auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: var(--c-paper-soft);
  color: var(--c-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.kp-sheet-close svg{
  width: 18px;
  height: 18px;
}

.is-price-sheet-open body{
  overflow: hidden;
}


/* Price sheet: reserve height during first async load to avoid "jump" */
.kp-price-loading{
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-weight: 700;
}


/* === ЛОГИКА ЗАТЕМНЕНИЯ (SELECTION DIMMING) === */

/* 1. Всё невыбранное становится тусклым */
#map.is-selection-active .kp-pin:not(.is-selected),
#map.is-selection-active .kp-hub-pin:not(.is-selected),
#map.is-selection-active .kp-peak-label:not(.is-selected),
#map.is-selection-active .lift-label:not(.is-selected) {
  opacity: 0.4;
  filter: grayscale(0.5);
  transition: opacity .15s ease, filter .15s ease;
  pointer-events: none;
}

/* 2. Выбранный элемент остается ярким */
#map.is-selection-active .kp-pin.is-selected,
#map.is-selection-active .kp-hub-pin.is-selected,
#map.is-selection-active .kp-peak-label.is-selected,
#map.is-selection-active .lift-label.is-selected {
  opacity: 1;
  filter: none;
  z-index: 2000 !important;
}

/* =========================================================
   User Location: синяя точка + пульсация + кнопка центрирования
   ========================================================= */
.kp-loc-control {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kp-loc-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 19, 20, 0.78);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.kp-loc-btn svg { display: block; }

.kp-loc-btn.is-active {
  box-shadow: 0 0 0 2px rgba(30, 136, 255, 0.35);
}

.kp-loc-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.kp-user-location {
  width: 18px;
  height: 18px;
  position: relative;
  transform: translate(-50%, -50%);
}

.kp-user-location__dot {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #1e88ff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95);
}

.kp-user-location__pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(30, 136, 255, 0.25);
  animation: kp-user-pulse 1.8s ease-out infinite;
}

@keyframes kp-user-pulse {
  0%   { transform: scale(0.6); opacity: 0.6; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { opacity: 0; }
}

/* =========================================================
   v132 Location UI: mount in panel OR right-middle overlay + toast
   ========================================================= */

/* Overlay position: right edge / center */
.kp-loc-control--mid {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

/* Panel mount (inside filter bar) */
.kp-loc-control--panel {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
}

.kp-loc-control--panel .kp-loc-btn{
  width: var(--lvl-btn, 32px);
  height: var(--lvl-btn, 32px);
  border-radius: 999px;
  border: 1px solid var(--c-stroke);
  background: var(--c-paper);
  color: var(--c-ink);
  backdrop-filter: none;
}

/* Мини-тост */
.kp-loc-toast{
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 10000;
  max-width: min(520px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(17, 19, 20, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.kp-loc-toast.is-show{
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

/* ========================================= */
/* DEV TOAST (SELF PROMO + BUTTON FIXES)     */
/* ========================================= */

.kp-dev-toast {
  position: fixed;
  left: 50%;
  bottom: 120px; 
  transform: translateX(-50%) translateY(10px);
  
  opacity: 0;
  z-index: calc(var(--z-ui-loader) + 2);
  width: min(540px, calc(100vw - 24px));
  
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px);
  
  /* 2. СДЕЛАЛ ПОБОЛЬШЕ */
  padding: 16px 20px; 
  
  pointer-events: auto;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.kp-dev-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.kp-dev-toast__row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.kp-dev-toast__title {
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  color: #111;
  margin-bottom: 6px;
}

.kp-dev-toast__text {
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
}

.kp-dev-toast__actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.kp-dev-toast__close {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.kp-dev-toast__close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.kp-dev-toast__close:hover {
  background: #f3f4f6;
  color: #111;
  transform: rotate(90deg);
}


/* --- КНОПКИ (УЖЕ НАСТРОЕНЫ, ПОВТОРЯЕМ ДЛЯ НАДЕЖНОСТИ) --- */
.kp-dev-toast .kp-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;           
    padding: 0 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.2s ease;
    white-space: nowrap;
}
.kp-dev-toast .kp-action-btn:active { transform: scale(0.97); }

.kp-dev-toast .kp-action-btn.is-primary {
    background: #007aff;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 122, 255, 0.2);
}

.kp-dev-toast .kp-action-btn.is-white {
    background: #ffffff;
    color: #111111;
    border-color: #e5e7eb;
}
.kp-dev-toast .kp-action-btn.is-white:hover { background: #f9fafb; }

.kp-dev-toast .kp-action-btn svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
    fill: currentColor;
    stroke: none;
}
.kp-dev-toast .kp-action-btn svg:has(path[stroke]) {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}