/* AptPicker — выбор квартиры «схема → план». Дизайн-система «Известняк».
   Все цвета заданы явно: страница одна, светлая, смотрят её с телефона на
   солнце, поэтому никаких тем и никакой зависимости от prefers-color-scheme. */
.apt-picker{
  --ap-paper:#f4f0e7; --ap-sand:#e5ddcd; --ap-ink:#23211d; --ap-mut:#655f56;
  --ap-laurel:#3d4a3a; --ap-brass:#8a6f3d; --ap-line:#d6cdb9;
  position:relative;
  display:grid;                       /* оба экрана в одной ячейке: высота = max, страница не прыгает */
  color:var(--ap-ink);
  font-family:'Manrope','Noto Sans Georgian',system-ui,sans-serif;
  font-size:15px;line-height:1.45;
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;
}
.apt-picker *,.apt-picker *::before,.apt-picker *::after{box-sizing:border-box}
:where(.apt-picker) :where(button){font:inherit;color:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer;touch-action:manipulation}
.apt-picker button:focus-visible{outline:2px solid var(--ap-laurel);outline-offset:2px}

/* ---------- экраны и кроссфейд ---------- */
.apt-screen{
  grid-area:1/1;                       /* экраны лежат друг на друге */
  min-width:0;
  opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .25s ease,visibility 0s linear .25s;
}
.apt-screen.is-on{opacity:1;visibility:visible;pointer-events:auto;transition:opacity .25s ease,visibility 0s}
.apt-picker.is-busy .apt-screen{pointer-events:none}

/* ---------- экран 1: схема здания ---------- */
.apt-scheme{position:relative}
.apt-scheme-stage{position:relative;width:100%;padding-top:49.125%;overflow:hidden}/* 786/1600 — тот же viewBox, что у полос */
.apt-scheme-stage img,.apt-scheme-stage svg{position:absolute;left:0;top:0;width:100%;height:100%;display:block}
.apt-scheme-stage img{object-fit:fill;pointer-events:none;user-select:none;-webkit-user-select:none}
.apt-scheme-stage svg{overflow:visible}
.apt-stripe{
  fill:rgba(61,74,58,0);stroke:rgba(244,240,231,0);stroke-width:1;
  vector-effect:non-scaling-stroke;   /* контур 1px независимо от растяжения viewBox */
  cursor:pointer;
  transition:fill .15s ease,stroke .15s ease;
}
.apt-stripe.is-hover{fill:rgba(61,74,58,.3);stroke:#f4f0e7}
.apt-stripe.is-none{fill:rgba(35,33,29,.28);cursor:default}
.apt-stripe.is-none.is-hover{fill:rgba(35,33,29,.4);stroke:rgba(244,240,231,.6)}
.apt-stripe.is-current{stroke:#f4f0e7;stroke-dasharray:4 3}

/* панель-подсказка справа поверх схемы */
.apt-hint{
  position:absolute;right:24px;top:24px;max-width:260px;
  padding:16px 20px;
  background:rgba(244,240,231,.92);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
  border-radius:4px;
  font-size:14px;color:var(--ap-mut);
}
.apt-hint b{display:block;font-size:18px;font-weight:600;color:var(--ap-ink);letter-spacing:-.01em;margin-bottom:2px}
.apt-hint .apt-hint-n{color:var(--ap-laurel);font-weight:600}
.apt-hint .apt-hint-arrow{display:inline-block;margin-left:4px;transform:translateY(1px)}

/* мобильная замена схемы: табы + чипы этажей */
.apt-floors{display:none}
.apt-picker.is-narrow .apt-scheme-stage,.apt-picker.is-narrow .apt-scheme .apt-hint{display:none}
.apt-picker.is-narrow .apt-floors{display:block}
.apt-floors-hint{font-size:14px;color:var(--ap-mut);margin:14px 0 0}
.apt-chips{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:16px}
.apt-chip{
  height:52px;border:1px solid var(--ap-line);border-radius:4px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  line-height:1.1;font-variant-numeric:tabular-nums;
}
.apt-chip b{font-size:17px;font-weight:600}
.apt-chip small{font-size:11px;color:var(--ap-mut);margin-top:3px;letter-spacing:.02em}
.apt-chip:hover,.apt-chip.is-current{border-color:var(--ap-laurel);background:var(--ap-laurel);color:var(--ap-paper)}
.apt-chip:hover small,.apt-chip.is-current small{color:rgba(244,240,231,.75)}
.apt-chip.is-none{opacity:.4;cursor:default}
.apt-chip.is-none:hover{background:none;color:inherit;border-color:var(--ap-line)}
.apt-chip.is-none:hover small{color:var(--ap-mut)}

/* ---------- общие: табы блоков ---------- */
.apt-tabs{display:flex;gap:24px;border-bottom:1px solid var(--ap-line)}
.apt-tab{
  padding:12px 0 11px;margin-bottom:-1px;
  font-size:16px;font-weight:600;color:var(--ap-mut);
  border-bottom:2px solid transparent;
  transition:color .15s,border-color .15s;
}
.apt-tab:hover{color:var(--ap-ink)}
.apt-tab[aria-selected="true"]{color:var(--ap-ink);border-bottom-color:var(--ap-laurel)}

/* ---------- экран 2: план этажа ---------- */
.apt-plan{display:flex;flex-direction:column;gap:16px}
.apt-plan-head{display:flex;align-items:center;justify-content:space-between;gap:12px 20px;flex-wrap:wrap}
.apt-plan-head .apt-tabs{border-bottom:0}
.apt-plan-head .apt-tab{border-bottom-width:2px}
.apt-floornav{display:flex;align-items:center;gap:4px;font-size:18px;font-weight:600;letter-spacing:-.01em;font-variant-numeric:tabular-nums}
.apt-floornav-label{min-width:6.5ch;text-align:center}
.apt-arrow{width:44px;height:44px;border-radius:4px;font-size:26px;line-height:1;display:inline-flex;align-items:center;justify-content:center;color:var(--ap-ink)}
.apt-arrow:hover{background:var(--ap-sand)}
.apt-arrow[disabled]{opacity:.3;cursor:default;background:none}
.apt-back{
  height:48px;padding:0 20px;border:1px solid var(--ap-line);border-radius:4px;
  font-size:15px;font-weight:600;letter-spacing:.02em;display:inline-flex;align-items:center;gap:8px;
  transition:border-color .15s,background .15s;
}
.apt-back:hover{border-color:var(--ap-ink)}

.apt-legend{display:flex;flex-wrap:wrap;gap:8px 22px;font-size:13px;color:var(--ap-mut)}
.apt-legend span{display:inline-flex;align-items:center;gap:8px}
.apt-legend i{display:inline-block;width:14px;height:14px;border:1px solid var(--ap-ink);background:transparent}
.apt-legend i.is-res{border-color:transparent;background:repeating-linear-gradient(-45deg,rgba(229,221,205,.6) 0 3px,rgba(138,111,61,.5) 3px 5px)}
.apt-legend i.is-sold{border-color:transparent;background:rgba(101,95,86,.45)}

.apt-plan-wrap{display:flex;justify-content:center}
.apt-picker.is-narrow .apt-plan-wrap{justify-content:flex-start;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;scrollbar-width:thin}
.apt-plan-scrollhint{display:none;margin:-8px 0 0;font-size:12px;color:var(--ap-mut)}
.apt-picker.is-narrow .apt-plan-scrollhint{display:block}
.apt-picker.is-narrow .apt-plan-stage{max-width:none}
.apt-plan-stage{position:relative;flex:none;width:100%;max-width:100%;overflow:hidden}/* ширину и высоту в px задаёт JS по viewBox группы */
.apt-plan-stage img,.apt-plan-stage svg{position:absolute;left:0;top:0;width:100%;height:100%;display:block}
.apt-plan-stage img{object-fit:fill;pointer-events:none;user-select:none;-webkit-user-select:none;mix-blend-mode:multiply}/* белый фон PNG сливается с бумагой — без «карточки» */
.apt-plan-stage svg{overflow:visible}
.apt-plan-stage svg{transition:opacity .2s}
.apt-plan-stage.is-loading svg{opacity:0}

.apt-unit{stroke:#23211d;stroke-width:1;vector-effect:non-scaling-stroke;fill:rgba(61,74,58,0);cursor:pointer;transition:fill .15s ease}
.apt-unit.is-free.is-hover{fill:rgba(61,74,58,.35)}
.apt-unit.is-res{fill:url(#apt-hatch);cursor:default}
.apt-unit.is-sold{fill:rgba(101,95,86,.45);cursor:default}
.apt-unit.is-selected,.apt-unit.is-selected.is-hover{fill:rgba(61,74,58,.6)}

.apt-selected{
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px 24px;
  padding-top:16px;border-top:1px solid var(--ap-line);min-height:64px;
}
.apt-selected-text{font-size:16px;color:var(--ap-mut);font-variant-numeric:tabular-nums}
.apt-selected-text b{font-size:20px;font-weight:600;color:var(--ap-ink);margin-right:6px;letter-spacing:-.01em}
.apt-selected-text .apt-status{color:var(--ap-laurel);font-weight:600}
.apt-actions{display:flex;flex-wrap:wrap;gap:12px}
.apt-actions:empty,.apt-actions[hidden]{display:none}

/* список доступных квартир — только на узких экранах */
.apt-free{display:none}
.apt-picker.is-narrow .apt-free{display:block}
.apt-free[hidden]{display:none}
.apt-free-title{margin:0 0 10px;font-size:12px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--ap-laurel)}
.apt-free-list{display:flex;flex-wrap:wrap;gap:8px}
.apt-free-chip{font:inherit;min-height:44px;padding:6px 12px;border:1px solid var(--ap-line);border-radius:4px;background:transparent;color:var(--ap-ink);cursor:pointer;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;line-height:1.2;font-variant-numeric:tabular-nums;transition:border-color .15s,background .15s}
.apt-free-chip b{font-weight:600;font-size:14px}
.apt-free-chip small{font-size:12px;color:var(--ap-mut)}
.apt-free-chip.is-selected{background:var(--ap-laurel);border-color:var(--ap-laurel);color:#f4f0e7}
.apt-free-chip.is-selected small{color:rgba(244,240,231,.75)}

/* ---------- tooltip (в body, за курсором) ---------- */
.apt-tip{
  position:fixed;left:0;top:0;z-index:9999;pointer-events:none;
  padding:8px 12px;border-radius:3px;
  background:rgba(35,33,29,.94);color:#f4f0e7;
  font-family:'Manrope','Noto Sans Georgian',system-ui,sans-serif;font-size:13px;line-height:1.35;
  white-space:nowrap;opacity:0;transition:opacity .12s;
  font-variant-numeric:tabular-nums;
}
.apt-tip.is-on{opacity:1}
.apt-tip .apt-tip-n{display:block;font-size:24px;font-weight:600;line-height:1.1;margin-top:2px}
.apt-tip .apt-tip-dim{opacity:.7}

/* ---------- узкие контейнеры ---------- */
.apt-picker.is-narrow .apt-plan-head{gap:12px}
.apt-picker.is-narrow .apt-plan-head .apt-tabs{width:100%;justify-content:space-between;order:-1;border-bottom:1px solid var(--ap-line)}
.apt-picker.is-narrow .apt-plan-head .apt-tab{flex:1;text-align:center}
.apt-picker.is-narrow .apt-back{height:44px;padding:0 14px}
.apt-picker.is-narrow .apt-selected-text{font-size:14px}
.apt-picker.is-narrow .apt-selected-text b{font-size:18px;display:block;margin:0 0 2px}
.apt-picker.is-narrow .apt-actions{width:100%}
.apt-picker.is-narrow .apt-actions>*{flex:1}
@media (prefers-reduced-motion:reduce){
  .apt-screen,.apt-stripe,.apt-unit,.apt-tip{transition:none}
}
