/* place — карточка места, мастер добавления и формы редактирования.
   Только токены из app.css (var(--…)) и собственные токены с префиксами --pl- / --wz- / --fx-. */

:root {
  --pl-ok-text: #1f6b43;
  --pl-warn-text: #8a5a00;
  --pl-high: #e0661d;
  --pl-high-text: #a4430a;
  --pl-crit-text: #a50f24;
  --pl-wait-text: #22568f;
  --pl-shade: rgba(20, 8, 9, .86);
  --pl-veil: rgba(247, 243, 241, .72);
}
:root[data-theme=dark] {
  --pl-ok-text: #74d19f;
  --pl-warn-text: #f2c262;
  --pl-high: #f08a48;
  --pl-high-text: #ffab78;
  --pl-crit-text: #ff8090;
  --pl-wait-text: #8dbbf0;
  --pl-shade: rgba(8, 3, 4, .9);
  --pl-veil: rgba(21, 11, 12, .72);
}

.num { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-line; }

/* ============================================================
   КАРТОЧКА МЕСТА
   ============================================================ */

.pl { display: flex; flex-direction: column; }

/* Хлебные крошки */
.pl-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; font-size: 13px; color: var(--muted); }
.pl-crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; padding: 2px 4px; border-radius: 6px; }
.pl-crumbs a:hover { color: var(--brand); text-decoration: none; background: var(--hover); }
.pl-crumbs a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.pl-crumbs svg { width: 14px; height: 14px; }
.pl-crumbs > svg { width: 14px; height: 14px; opacity: .6; }
.pl-crumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* ---------- Герой ---------- */
.pl-hero {
  --pl-st: var(--brand);
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: flex-end;
  min-height: 300px; border-radius: 20px;
  background: var(--grad-ink); color: #fff;
  box-shadow: var(--shadow);
}
.pl-hero.has-photo { min-height: 380px; }
.pl-hero-media { position: absolute; inset: 0; z-index: -2; cursor: zoom-in; outline: none; }
.pl-hero-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.pl-hero.has-photo:hover .pl-hero-media img { transform: scale(1.025); }
.pl-hero-media:focus-visible { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .7); }
.pl-hero-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.pl-hero.has-photo .pl-hero-shade {
  background:
    linear-gradient(180deg, rgba(20, 8, 9, .35) 0%, rgba(20, 8, 9, 0) 28%),
    linear-gradient(90deg, rgba(20, 8, 9, .55) 0%, rgba(20, 8, 9, 0) 65%),
    linear-gradient(180deg, rgba(20, 8, 9, 0) 30%, var(--pl-shade) 100%);
}
.pl-hero.no-photo .pl-hero-shade {
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--pl-st) 58%, transparent) 0%, transparent 60%),
    radial-gradient(70% 90% at 0% 100%, rgba(179, 19, 41, .35) 0%, transparent 65%);
}
.pl-hero-art { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.pl-hero-art::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 75% 20%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 90% at 75% 20%, #000 10%, transparent 75%);
}
.pl-hero-num {
  position: absolute; right: 28px; top: 50%; transform: translateY(-58%);
  font: 700 clamp(140px, 18vw, 240px)/1 var(--font-head); letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .16);
  font-variant-numeric: tabular-nums; user-select: none; white-space: nowrap;
}
.pl-hero-num::before { content: '№'; font-size: .45em; vertical-align: .9em; margin-right: .06em; }
.pl-hero-in {
  position: relative; width: 100%; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  padding: 30px 32px 58px; pointer-events: none;
}
.pl-hero-in button, .pl-hero-in a { pointer-events: auto; }
.pl-hero-main { min-width: 0; max-width: 760px; }
.pl-hero-eyebrow { display: block; font: 700 11px/1 var(--font-head); letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .72); }
.pl-hero h1 { margin: 8px 0 6px; font-size: 46px; line-height: 1; color: #fff; letter-spacing: -.025em; font-variant-numeric: tabular-nums; text-shadow: 0 2px 18px rgba(0, 0, 0, .25); }
.pl-hero-addr { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, .92); }
.pl-hero-addr svg { width: 17px; height: 17px; flex: none; margin-top: 2px; opacity: .85; }
.pl-hero-dist { color: rgba(255, 255, 255, .7); }
.pl-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pl-hero-tags .badge { box-shadow: 0 0 0 2px rgba(255, 255, 255, .22), 0 4px 14px rgba(0, 0, 0, .25); }
.pl-hero-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 13px;
  font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.pl-hero-tag svg { width: 14px; height: 14px; }
.pl-hero-st i { width: 8px; height: 8px; border-radius: 50%; background: var(--pl-st); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.pl-hero-st { font-weight: 700; background: rgba(20, 8, 9, .45); }
.pl-hero-warn { background: rgba(200, 16, 46, .85); border-color: rgba(255, 255, 255, .3); }
.pl-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-glass-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px;
  font-weight: 600; font-size: 13.5px; color: #fff; cursor: pointer; white-space: nowrap;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .26);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background .15s, border-color .15s, transform .15s;
}
.pl-glass-btn svg { width: 17px; height: 17px; }
.pl-glass-btn:hover { background: rgba(255, 255, 255, .24); border-color: rgba(255, 255, 255, .4); }
.pl-glass-btn:focus-visible, .pl-hero .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .55); }
.pl-glass-danger:hover { background: rgba(200, 16, 46, .8); border-color: rgba(255, 255, 255, .35); }
.pl-hero .btn-primary { box-shadow: 0 6px 20px rgba(179, 19, 41, .45); }

/* ---------- Ключевые факты ---------- */
.pl-facts {
  position: relative; z-index: 1; margin: -34px 18px 20px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-hover);
}
.pl-fact { --fc: var(--brand); display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px 17px; background: var(--card); min-width: 0; }
.pl-fact > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pl-fact-ico {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--fc) 13%, var(--card)); color: var(--fc);
}
.pl-fact-ico svg { width: 18px; height: 18px; }
.pl-fact-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.pl-fact-val { font: 700 24px/1.15 var(--font-head); color: var(--ink); letter-spacing: -.01em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pl-fact-val em { font: 600 13px var(--font); font-style: normal; color: var(--muted); letter-spacing: 0; }
.pl-fact-sm { font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-fact small { color: var(--muted); font-size: 12px; }
.pl-fact--warn { --fc: var(--st-reserved); background: color-mix(in srgb, var(--st-reserved) 9%, var(--card)); }
.pl-fact--high { --fc: var(--pl-high); background: color-mix(in srgb, var(--pl-high) 10%, var(--card)); }
.pl-fact--crit { --fc: var(--st-ending); background: color-mix(in srgb, var(--st-ending) 10%, var(--card)); }
.pl-fact--ok { --fc: var(--st-active); }
.pl-fact--warn .pl-fact-val, .pl-fact--warn small { color: var(--pl-warn-text); }
.pl-fact--high .pl-fact-val, .pl-fact--high small { color: var(--pl-high-text); }
.pl-fact--crit .pl-fact-val, .pl-fact--crit small { color: var(--pl-crit-text); }
.pl-fact--warn .pl-fact-val em, .pl-fact--high .pl-fact-val em, .pl-fact--crit .pl-fact-val em { color: inherit; opacity: .85; }
.pl-fact--warn small, .pl-fact--high small, .pl-fact--crit small { font-weight: 600; }

/* ---------- Сетка ---------- */
.pl-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pl-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pl-card { transition: box-shadow .2s, border-color .2s; }
.pl-card:hover { box-shadow: var(--shadow-hover); }
.pl-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 14px 20px; border-bottom: 1px solid var(--line); min-height: 60px; }
.pl-title { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.pl-title-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }
.pl-title-ico svg { width: 16px; height: 16px; }
.pl-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--track); color: var(--ink-2); font: 700 12px var(--font); font-variant-numeric: tabular-nums;
}
.pl-head-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Пустые состояния */
.pl-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 30px 24px; color: var(--muted); }
.pl-empty-ico { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); margin-bottom: 6px; }
.pl-empty-ico svg { width: 24px; height: 24px; }
.pl-empty b { color: var(--ink); font: 700 15px var(--font-head); }
.pl-empty > span:not(.pl-empty-ico) { font-size: 13px; max-width: 380px; }
.pl-empty .btn { margin-top: 10px; }
.pl-empty-sm { padding: 22px 20px; }
.pl-drop-empty { margin: 16px; border: 2px dashed var(--line-2); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.pl-drop-empty:hover, .pl-drop-empty:focus-visible { outline: none; border-color: var(--brand); background: var(--brand-50); }

/* ---------- Договор ---------- */
.pl-contract-body { padding: 18px 20px 20px; }
.pl-contract-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pl-contract-no { font: 700 18px/1.25 var(--font-head); }
.pl-contract-co { color: var(--muted); font-size: 13px; margin-top: 2px; }
.pl-amount {
  position: relative; overflow: hidden; margin: 16px 0 14px; padding: 16px 18px; border-radius: 14px;
  background: linear-gradient(120deg, var(--brand-50) 0%, transparent 85%); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.pl-amount-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pl-amount b { font: 700 34px/1.1 var(--font-head); letter-spacing: -.02em; color: var(--ink); }
.pl-amount-sub { font-size: 13px; color: var(--ink-2); }

.pl-term {
  --tc: var(--st-active); --tt: var(--pl-ok-text);
  padding: 16px 18px 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--tc) 28%, var(--line));
  background: color-mix(in srgb, var(--tc) 6%, var(--card));
}
.pl-term--warn { --tc: var(--st-reserved); --tt: var(--pl-warn-text); }
.pl-term--high { --tc: var(--pl-high); --tt: var(--pl-high-text); }
.pl-term--crit { --tc: var(--st-ending); --tt: var(--pl-crit-text); }
.pl-term--wait { --tc: var(--st-free); --tt: var(--pl-wait-text); }
.pl-term--off { --tc: var(--st-occupied); --tt: var(--ink-2); }
.pl-term-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.pl-term-left { display: flex; align-items: baseline; gap: 8px; }
.pl-term-days { font: 700 40px/1 var(--font-head); color: var(--tt); letter-spacing: -.03em; }
.pl-term-unit { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pl-term-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 14px;
  font-size: 12px; font-weight: 700; color: var(--tt);
  background: color-mix(in srgb, var(--tc) 15%, var(--card)); border: 1px solid color-mix(in srgb, var(--tc) 30%, transparent);
}
.pl-term-chip svg { width: 14px; height: 14px; }
.pl-term--crit .pl-term-chip { animation: pl-pulse 2s ease-in-out infinite; }
.pl-term-track { position: relative; height: 10px; margin: 30px 0 10px; border-radius: 5px; background: var(--track); }
.pl-term-zone {
  position: absolute; top: 0; bottom: 0; right: 0; border-radius: 0 5px 5px 0;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--st-ending) 32%, transparent) 0 4px, transparent 4px 8px);
}
.pl-term-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 5px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 45%, var(--card)), var(--tc));
}
.pl-anim .pl-term-fill { animation: pl-grow 1s cubic-bezier(.2, .8, .2, 1) both .15s; }
.pl-term-today {
  position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--tc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tc) 22%, transparent);
}
.pl-term-today i {
  position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  font: 700 10px/1 var(--font); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--tt); white-space: nowrap;
}
.pl-term-today.edge-r i { left: auto; right: -4px; transform: none; }
.pl-term-today.edge-l i { left: -4px; transform: none; }
.pl-term-dates { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.pl-term-dates > span:not(.pl-term-total) { display: flex; flex-direction: column; gap: 1px; }
.pl-term-dates > span:last-child { text-align: right; }
.pl-term-dates small { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pl-term-dates b { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.pl-term-total { font-size: 12px; color: var(--muted); padding-bottom: 2px; }

/* Свойства (dl) */
.pl-props { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin: 0; padding: 18px 20px 20px; }
.pl-props > div { min-width: 0; }
.pl-props dt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.pl-props dt svg { width: 14px; height: 14px; }
.pl-props dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.pl-props-wide { grid-column: 1 / -1; }
.pl-props--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 16px 2px 0; }

/* История договоров — таймлайн */
.pl-sub-head { display: flex; align-items: center; gap: 8px; padding: 14px 20px 2px; border-top: 1px solid var(--line); }
.pl-sub-head h3 { font-size: 14px; }
.pl-ctl { list-style: none; margin: 0; padding: 6px 16px 12px 20px; }
.pl-ctl-item {
  --dc: var(--st-occupied);
  position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: center;
  padding: 11px 0;
}
.pl-ctl-item::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.pl-ctl-item:first-child::before { top: 50%; }
.pl-ctl-item:last-child::before { bottom: 50%; }
.pl-ctl-item:only-child::before { display: none; }
.pl-ctl--active { --dc: var(--st-active); }
.pl-ctl--upcoming { --dc: var(--st-free); }
.pl-ctl--terminated { --dc: var(--brand); }
.pl-ctl--draft { --dc: var(--muted); }
.pl-ctl-dot { position: relative; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 3px solid var(--dc); }
.pl-ctl-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-ctl-row .badge { height: 22px; font-size: 11px; padding: 0 8px; }
.pl-ctl-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pl-ctl-sum { font: 700 14px var(--font-head); white-space: nowrap; }
.pl-ctl-ops { display: flex; gap: 2px; }

/* ---------- Галерея ---------- */
.pl-gallery { position: relative; }
.pl-mosaic { display: grid; gap: 8px; padding: 14px; grid-auto-rows: 116px; }
.pl-mosaic--1 { grid-template-columns: 1fr; grid-auto-rows: 260px; }
.pl-mosaic--2 { grid-template-columns: 3fr 1fr; }
.pl-mosaic--2 > * { grid-row: span 2; }
.pl-mosaic--3 { grid-template-columns: 2fr 1fr; }
.pl-mosaic--3 > :first-child { grid-row: span 2; }
.pl-mosaic--4, .pl-mosaic--5 { grid-template-columns: 2fr 1fr 1fr; }
.pl-mosaic--4 > :first-child, .pl-mosaic--5 > :first-child { grid-row: span 2; }
.pl-mosaic--4 > :last-child { grid-column: span 2; }
.pl-tile {
  position: relative; overflow: hidden; border-radius: 12px; background: var(--ph-1); cursor: zoom-in; outline: none;
  box-shadow: inset 0 0 0 1px var(--line);
}
.pl-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.pl-tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(20, 8, 9, .55)); opacity: 0; transition: opacity .2s; pointer-events: none; }
.pl-tile:hover img { transform: scale(1.05); }
.pl-tile:hover::after, .pl-tile:focus-within::after { opacity: 1; }
.pl-tile:focus-visible { box-shadow: 0 0 0 3px var(--focus), inset 0 0 0 2px var(--brand); }
.pl-tile.main { box-shadow: inset 0 0 0 2px var(--brand); }
.pl-tag {
  position: absolute; left: 8px; top: 8px; z-index: 1; display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 12px; font-size: 11px; font-weight: 700; color: #fff;
  background: rgba(20, 8, 9, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pl-tag svg { width: 12px; height: 12px; fill: currentColor; color: #ffc94a; }
.pl-ops {
  position: absolute; right: 8px; bottom: 8px; z-index: 1; display: flex; gap: 6px;
  opacity: 0; transform: translateY(4px); transition: opacity .18s, transform .18s;
}
.pl-tile:hover .pl-ops, .pl-tile:focus-within .pl-ops { opacity: 1; transform: none; }
.pl-ops button {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; color: #fff;
  background: rgba(20, 8, 9, .62); border: 1px solid rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .15s;
}
.pl-ops button:hover { background: var(--brand); }
.pl-ops button.danger:hover { background: var(--st-ending); }
.pl-ops button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .6); }
.pl-ops svg { width: 15px; height: 15px; }
.pl-tile-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center;
  border: 2px dashed var(--line-2); border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; padding: 8px;
  transition: border-color .15s, color .15s, background .15s;
}
.pl-tile-add svg { width: 22px; height: 22px; margin-bottom: 2px; }
.pl-tile-add b { font-size: 12.5px; }
.pl-tile-add small { font-size: 11px; }
.pl-tile-add:hover, .pl-tile-add:focus-visible { outline: none; border-color: var(--brand); color: var(--brand); background: var(--brand-50); }

/* Перетаскивание файлов */
.pl-page-veil {
  position: fixed; inset: 0; z-index: 2500; display: none; place-items: center; pointer-events: none;
  background: var(--pl-veil); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.pl-page-veil > div {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 56px; border-radius: 22px;
  border: 2px dashed var(--brand); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg);
}
.pl-page-veil svg { width: 40px; height: 40px; color: var(--brand); }
.pl-page-veil b { font: 700 17px var(--font-head); }
.pl-page-veil span { color: var(--muted); font-size: 13px; }
.pl-dragging .pl-page-veil { display: grid; }
.pl-dragging .pl-gallery { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }

/* ---------- Журнал ---------- */
.pl-log { list-style: none; margin: 0; padding: 10px 20px 8px; }
.pl-log-item { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 14px; padding: 9px 0; }
.pl-log-item::before { content: ''; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.pl-log-item:first-child::before { top: 16px; }
.pl-log-item:last-child::before { bottom: calc(100% - 16px); }
.pl-log-item:only-child::before { display: none; }
.pl-log-dot { position: relative; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--card); border: 2px solid var(--line-2); }
.pl-log-item:first-child .pl-log-dot { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.pl-log-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pl-log-row b { font-size: 13.5px; font-weight: 600; }
.pl-log-row time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pl-log-details { font-size: 13px; color: var(--ink-2); margin-top: 1px; overflow-wrap: anywhere; }
.pl-log-user { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.pl-log-user svg { width: 12px; height: 12px; }
.pl-more {
  display: block; width: calc(100% - 40px); margin: 0 20px 16px; height: 36px; border-radius: 10px; cursor: pointer;
  border: 1px dashed var(--line-2); background: transparent; color: var(--ink-2); font-weight: 600; font-size: 13px;
}
.pl-more:hover { border-color: var(--brand); color: var(--brand); }
.pl-more:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }

/* ---------- Клиент ---------- */
.pl-client { padding: 18px 20px 20px; }
.pl-client-id { display: flex; align-items: center; gap: 14px; }
.pl-avatar {
  width: 54px; height: 54px; flex: none; border-radius: 16px; display: grid; place-items: center;
  background: var(--grad-brand); color: #fff; font: 700 19px var(--font-head); letter-spacing: .02em;
  box-shadow: 0 6px 16px rgba(179, 19, 41, .28), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.pl-client-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pl-client-name b { font: 700 17px/1.25 var(--font-head); overflow-wrap: anywhere; }
.pl-client-name span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.pl-client-name span svg { width: 14px; height: 14px; color: var(--muted); }
.pl-contacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.pl-contact {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; min-width: 0;
  border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--card);
  transition: border-color .15s, background .15s, transform .15s;
}
a.pl-contact:hover { text-decoration: none; border-color: var(--brand); background: var(--hover); }
a.pl-contact:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); border-color: var(--brand); }
.pl-contact-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.pl-contact-ico svg { width: 16px; height: 16px; }
.pl-contact > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.pl-contact small { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.pl-contact b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-contact.is-empty b { color: var(--muted); font-weight: 500; }
.pl-contact.is-empty .pl-contact-ico { background: var(--track); color: var(--muted); }
.pl-note { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--hover); color: var(--ink-2); font-size: 13px; border: 1px solid var(--line); }

/* ---------- Местоположение ---------- */
.pl-coords {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 500;
}
.pl-coords svg { width: 13px; height: 13px; color: var(--muted); }
.pl-coords:hover { border-color: var(--brand); color: var(--brand); }
.pl-coords:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.pl-minimap { position: relative; }
.pl-minimap #mini-map { height: 240px; }
.pl-minimap::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 8px 12px -10px rgba(20, 8, 9, .25), inset 0 -8px 12px -10px rgba(20, 8, 9, .25); z-index: 500; }
.pl-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.pl-link {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 8px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: 13px;
  transition: border-color .15s, background .15s;
}
.pl-link:hover { text-decoration: none; border-color: var(--line-2); background: var(--hover); }
.pl-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.pl-link > svg:last-child { width: 13px; height: 13px; color: var(--muted); }
.pl-link-mark { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; font: 700 12px var(--font-head); }
.pl-link-y { background: #e8391a; }
.pl-link-g { background: #3b78e7; }
.pl-link-route { margin-left: auto; padding: 0 14px; background: var(--brand); border-color: var(--brand); color: #fff; }
.pl-link-route svg { width: 16px; height: 16px; }
.pl-link-route:hover { background: var(--brand-600); border-color: var(--brand-600); }

/* Появление */
.pl-anim > * { animation: pl-rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.pl-anim > :nth-child(2) { animation-delay: .03s; }
.pl-anim > :nth-child(3) { animation-delay: .09s; }
.pl-anim .pl-col > * { animation: pl-rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.pl-anim .pl-col > :nth-child(1) { animation-delay: .14s; }
.pl-anim .pl-col > :nth-child(2) { animation-delay: .2s; }
.pl-anim .pl-col > :nth-child(3) { animation-delay: .26s; }

@keyframes pl-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pl-grow { from { width: 0; } }
@keyframes pl-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--st-ending) 35%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--st-ending) 0%, transparent); }
}

/* ============================================================
   ФОРМЫ (forms.js) — модальные окна и мастер
   ============================================================ */
.fx-groups { display: flex; flex-direction: column; gap: 18px; }
.fx-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.fx-group + .fx-group, .fx-groups + .fx-group { padding-top: 18px; border-top: 1px solid var(--line); }
.fx-group-head { display: flex; align-items: center; gap: 10px; padding: 0; margin: 0 0 12px; width: 100%; float: left; }
.fx-group-head + * { clear: both; }
.fx-chip { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.fx-chip svg { width: 16px; height: 16px; }
.fx-group-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fx-group-title b { font: 700 14px/1.2 var(--font-head); color: var(--ink); }
.fx-group-title small { font-size: 12px; color: var(--muted); }
.fx-nolabel > span:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fx-group .field input, .fx-group .field select, .fx-group .field textarea, .fx-lead .field select, .wz .field select { background: var(--surface-2); }
.fx-group .field input:hover, .fx-group .field select:hover, .fx-group .field textarea:hover { border-color: var(--muted); }
.fx-group .field input:focus, .fx-group .field select:focus, .fx-group .field textarea:focus { border-color: var(--brand); }
.field > span.fx-affix { position: relative; display: block; font: inherit; color: inherit; }
.fx-affix input { padding-right: 52px; font-variant-numeric: tabular-nums; }
.fx-affix em {
  position: absolute; top: 1px; right: 1px; bottom: 1px; width: 42px; display: grid; place-items: center;
  font-style: normal; font-weight: 700; color: var(--ink-2); background: var(--track); border-left: 1px solid var(--line-2);
  border-radius: 0 9px 9px 0; pointer-events: none;
}
.fx-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; }
.fx-range-sep { height: 40px; display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.fx-presets { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: -2px; }
.fx-duration { font-size: 12.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fx-duration.bad { color: var(--brand); }
.fx-preset-list { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.fx-preset {
  height: 28px; padding: 0 11px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 12px;
  transition: border-color .15s, color .15s, background .15s;
}
.fx-preset:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.fx-preset:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.fx-lead { padding-bottom: 4px; }
.modal-body > .fx-groups, .modal-body > [data-company-fields] { margin-top: 2px; }

/* ============================================================
   МАСТЕР ДОБАВЛЕНИЯ
   ============================================================ */
.wz { display: flex; flex-direction: column; }
.wz-head {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 24px 28px; margin-bottom: 18px; border-radius: 20px;
  background: var(--grad-ink); color: #fff; box-shadow: var(--shadow);
}
.wz-head::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%); mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
}
.wz-head::after {
  content: ''; position: absolute; z-index: -1; width: 420px; height: 420px; right: -120px; top: -220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 33, 61, .55), transparent 65%);
}
.wz-eyebrow { display: inline-flex; align-items: center; gap: 6px; font: 700 11px/1 var(--font-head); letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .72); }
.wz-eyebrow svg { width: 14px; height: 14px; }
.wz-head h1 { margin: 10px 0 0; font-size: 28px; color: #fff; }
.wz-head-num { color: rgba(255, 255, 255, .55); font-variant-numeric: tabular-nums; }
.wz-head p { margin: 6px 0 0; color: rgba(255, 255, 255, .75); font-size: 13.5px; }
.wz-cancel { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .26); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.wz-cancel:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .4); }
.wz-cancel:focus-visible { box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); }

/* Степпер */
.wz-stepper { margin-bottom: 18px; }
.wz-steps { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 4px 0; }
.wz-line { position: absolute; left: calc(100% / 14); right: calc(100% / 14); top: 21px; height: 3px; border-radius: 2px; background: var(--line-2); }
.wz-line > span { display: block; height: 100%; width: var(--wz-prog, 0%); border-radius: inherit; background: var(--grad-brand); transition: width .55s cubic-bezier(.2, .8, .2, 1); }
.wz-steps .wz-step {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 0;
  padding: 0 4px; margin: 0; border: 0; border-radius: 10px; background: none; box-shadow: none; text-align: center;
  color: var(--muted); cursor: default; font: inherit;
}
.wz-steps .wz-step .wz-dot {
  width: 36px; height: 36px; margin: 0; border-radius: 50%; display: grid; place-items: center;
  font: 700 14px/1 var(--font-head); color: var(--muted);
  background: var(--card); border: 2px solid var(--line-2);
  transition: background .3s, border-color .3s, color .3s, box-shadow .3s, transform .2s;
}
.wz-steps .wz-step .wz-dot::after { content: none; }
.wz-steps .wz-step .wz-dot svg { width: 17px; height: 17px; stroke-width: 3; }
.wz-steps .wz-step > span { display: block; font-size: 12px; font-weight: 600; line-height: 1.25; max-width: 130px; }
.wz-steps .wz-step.done { color: var(--ink-2); cursor: pointer; }
.wz-steps .wz-step.done .wz-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.wz-steps .wz-step.done:first-of-type { cursor: default; }
.wz-steps .wz-step.done:not(:first-of-type):hover .wz-dot { transform: scale(1.08); box-shadow: 0 0 0 4px var(--focus); }
.wz-steps .wz-step.current { background: none; color: var(--ink); box-shadow: none; }
.wz-steps .wz-step.current .wz-dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 5px var(--focus); animation: wz-pop .45s cubic-bezier(.2, .9, .3, 1.4); }
.wz-steps .wz-step:focus-visible { outline: none; }
.wz-steps .wz-step:focus-visible .wz-dot { box-shadow: 0 0 0 4px var(--focus); }
.wz-compact { display: none; }

/* Карточка шага */
.wz-card { overflow: hidden; }
.wz-body { padding: 26px 28px 28px; }
.wz-in-fwd { animation: wz-in-r .38s cubic-bezier(.2, .8, .2, 1); }
.wz-in-back { animation: wz-in-l .38s cubic-bezier(.2, .8, .2, 1); }
.wz-step-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.wz-step-ico { width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--grad-brand); color: #fff; box-shadow: 0 8px 18px rgba(179, 19, 41, .25); }
.wz-step-ico svg { width: 22px; height: 22px; }
.wz-step-kicker { font: 700 11px/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.wz-step-head h2 { font-size: 21px; margin-top: 5px; }
.wz-step-head p { margin: 4px 0 0; color: var(--muted); }
.wz-error { margin: 0 28px 16px; }
.wz-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 28px; border-top: 1px solid var(--line); background: var(--surface-2); }
.wz-foot-count { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.wz-foot-right { display: flex; gap: 8px; }
.wz-next { min-width: 120px; }
.wz-next svg { width: 16px; height: 16px; transition: transform .15s; }
.wz-next:hover svg { transform: translateX(2px); }

/* Шаг 2 — карта */
.wz-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; align-items: start; }
.wz-picker .picker-map { height: 460px; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.wz-map-side { display: flex; flex-direction: column; gap: 14px; }
.wz-tips { list-style: none; margin: 0; padding: 4px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.wz-tips li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wz-tips li:last-child { border-bottom: 0; }
.wz-tip-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.wz-tip-ico svg { width: 16px; height: 16px; }
.wz-tips div { display: flex; flex-direction: column; }
.wz-tips b { font-size: 13.5px; }
.wz-tips span { font-size: 12.5px; color: var(--muted); }
.wz-point {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px;
  border: 1.5px dashed var(--line-2); background: var(--surface-2); transition: border-color .25s, background .25s;
}
.wz-point-ico { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--track); color: var(--muted); transition: background .25s, color .25s; }
.wz-point-ico svg { width: 17px; height: 17px; }
.wz-point > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wz-point small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wz-point b { font-size: 14px; font-variant-numeric: tabular-nums; }
.wz-point .muted { font-size: 12.5px; overflow-wrap: anywhere; }
.wz-point.is-set { border-style: solid; border-color: color-mix(in srgb, var(--st-active) 55%, var(--line)); background: color-mix(in srgb, var(--st-active) 7%, var(--card)); }
.wz-point.is-set .wz-point-ico { background: var(--st-active); color: #fff; animation: wz-pop .4s cubic-bezier(.2, .9, .3, 1.4); }
.wz-point.is-set small { color: var(--pl-ok-text); }

/* Шаг 4 — фото */
.wz-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 38px 20px; border-radius: 16px;
  border: 2px dashed var(--line-2); background: var(--surface-2); color: var(--muted); transition: border-color .15s, background .15s, color .15s;
}
.wz-drop b { color: var(--brand); }
.wz-drop > div { color: var(--ink-2); font-size: 14.5px; }
.wz-drop small { font-size: 12px; }
.wz .wz-drop .wz-drop-ico { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); margin-bottom: 6px; transition: transform .2s; }
.wz .wz-drop .wz-drop-ico svg { width: 26px; height: 26px; margin: 0; }
.wz-drop:hover .wz-drop-ico, .wz-drop.over .wz-drop-ico { transform: translateY(-3px); }
.wz-drop:focus-within { box-shadow: 0 0 0 3px var(--focus); }
.wz-photos-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 20px; font-size: 13px; }
.wz-previews { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 10px; }
.wz-previews .preview { border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line), var(--shadow); background: var(--ph-1); outline: none; transition: transform .15s, box-shadow .15s; }
.wz-previews .preview:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.wz-previews .preview.main { box-shadow: 0 0 0 3px var(--brand), var(--shadow); }
.wz-previews .preview:focus-visible { box-shadow: 0 0 0 3px var(--brand), 0 0 0 6px var(--focus); }
.wz-previews .preview .tag { display: inline-flex; align-items: center; gap: 4px; left: 8px; top: 8px; border-radius: 12px; padding: 3px 9px; }
.wz-previews .preview .tag svg { width: 11px; height: 11px; fill: currentColor; }
.wz-make-main {
  position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 700; color: #fff;
  background: rgba(20, 8, 9, .62); opacity: 0; transition: opacity .15s;
}
.wz-previews .preview:hover .wz-make-main, .wz-previews .preview:focus-visible .wz-make-main { opacity: 1; }
.wz-previews .preview .x {
  width: 28px; height: 28px; right: 8px; top: 8px; display: grid; place-items: center; padding: 0; color: #fff;
  background: rgba(20, 8, 9, .62); border: 1px solid rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.wz-previews .preview .x:hover { background: var(--st-ending); }
.wz-previews .preview .x svg { width: 14px; height: 14px; }

/* Шаг 5 — режим компании */
.wz-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wz-mode {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px; text-align: left;
  border: 1.5px solid var(--line-2); border-radius: 16px; background: var(--card); color: var(--ink); cursor: pointer;
  transition: border-color .15s, box-shadow .2s, transform .15s, background .15s;
}
.wz-mode:hover { border-color: var(--muted); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.wz-mode:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.wz-mode.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, var(--card)); box-shadow: 0 0 0 3px var(--focus); }
.wz-mode-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--track); color: var(--ink-2); margin-bottom: 8px; transition: background .2s, color .2s; }
.wz-mode-ico svg { width: 20px; height: 20px; }
.wz-mode.on .wz-mode-ico { background: var(--grad-brand); color: #fff; }
.wz-mode b { font: 700 15px var(--font-head); }
.wz-mode small { font-size: 12.5px; color: var(--muted); }
.wz-mode-check { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); color: transparent; transition: background .15s, border-color .15s; }
.wz-mode-check svg { width: 13px; height: 13px; stroke-width: 3; }
.wz-mode.on .wz-mode-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.wz-sub { margin-top: 20px; animation: wz-in-r .3s cubic-bezier(.2, .8, .2, 1); }
.wz-note { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--hover); color: var(--ink-2); border: 1px solid var(--line); }
.wz-note svg { width: 18px; height: 18px; flex: none; color: var(--muted); margin-top: 1px; }

/* Шаг 6 — договор */
.wz-toggle {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer;
  border: 1.5px solid var(--line-2); border-radius: 16px; background: var(--card); transition: border-color .15s, background .15s;
}
.wz-toggle:hover { border-color: var(--muted); }
.wz-toggle:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, var(--card)); }
.wz-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.wz-switch { position: relative; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--line-2); transition: background .2s; }
.wz-switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .22s cubic-bezier(.2, .9, .3, 1.3); }
.wz-toggle input:checked + .wz-switch { background: var(--brand); }
.wz-toggle input:checked + .wz-switch::after { transform: translateX(18px); }
.wz-toggle input:focus-visible + .wz-switch { box-shadow: 0 0 0 3px var(--focus); }
.wz-toggle > span:last-child { display: flex; flex-direction: column; }
.wz-toggle b { font: 700 15px var(--font-head); }
.wz-toggle small { color: var(--muted); font-size: 12.5px; }

/* Шаг 7 — итог */
.wz-summary { display: flex; flex-direction: column; gap: 16px; }
.wz-sum-hero {
  position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: center;
  padding: 16px; border-radius: 18px; background: var(--grad-ink); color: #fff;
}
.wz-sum-hero::after {
  content: ''; position: absolute; z-index: -1; width: 360px; height: 360px; right: -120px; bottom: -200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 33, 61, .5), transparent 65%);
}
.wz-sum-photo {
  aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .07); border: 1px dashed rgba(255, 255, 255, .25); color: rgba(255, 255, 255, .7); font-size: 12px; font-weight: 600;
}
.wz-sum-hero.has-photo .wz-sum-photo { border: 0; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
.wz-sum-photo img { width: 100%; height: 100%; object-fit: cover; }
.wz-sum-photo svg { width: 28px; height: 28px; }
.wz-sum-main { min-width: 0; }
.wz-sum-main h3 { font-size: 34px; color: #fff; margin: 6px 0 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.wz-sum-main p { display: flex; gap: 6px; align-items: flex-start; margin: 0; color: rgba(255, 255, 255, .88); }
.wz-sum-main p svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.wz-sum-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.wz-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 13px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); }
.wz-st { gap: 7px; font-weight: 700; background: rgba(20, 8, 9, .45); }
.wz-st i { width: 8px; height: 8px; border-radius: 50%; background: var(--wz-st); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.wz-review { gap: 14px; }
.wz-sec { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); min-width: 0; }
.wz-sec header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.wz-sec h4 { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.wz-sec h4 svg { width: 16px; height: 16px; color: var(--brand); }
.wz-edit { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 4px 6px; border-radius: 7px; color: var(--brand); font-weight: 600; font-size: 12px; cursor: pointer; }
.wz-edit svg { width: 13px; height: 13px; }
.wz-edit:hover { background: var(--brand-50); }
.wz-edit:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.wz-dl { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 13.5px; }
.wz-dl dt { color: var(--muted); }
.wz-dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.wz-sum-amount { font: 700 17px var(--font-head); }
.wz-small { margin: 0; font-size: 13px; }
.wz-sum-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.wz-sum-thumbs span { aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: var(--ph-1); }
.wz-sum-thumbs span.main { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--brand); }
.wz-sum-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.wz-co { display: flex; align-items: center; gap: 12px; }
.wz-co-av { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--grad-brand); color: #fff; font: 700 17px var(--font-head); }
.wz-co > div { display: flex; flex-direction: column; min-width: 0; }
.wz-co b { overflow-wrap: anywhere; }
.wz-co small { color: var(--muted); font-size: 12.5px; }

@keyframes wz-in-r { from { opacity: 0; transform: translateX(18px); } }
@keyframes wz-in-l { from { opacity: 0; transform: translateX(-18px); } }
@keyframes wz-pop { 0% { transform: scale(.7); } 100% { transform: scale(1); } }

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 1280px) {
  .wz-steps .wz-step > span { font-size: 11.5px; }
}
@media (max-width: 1100px) {
  .pl-grid { display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
  .pl-col { display: contents; }
  .pl-contract { order: 1; }
  .pl-client-card { order: 2; }
  .pl-gallery { order: 3; }
  .pl-info-card { order: 4; }
  .pl-loc { order: 5; }
  .pl-log-card { order: 6; }
  .wz-map-layout { grid-template-columns: 1fr; }
  .wz-map-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 900px) {
  .pl-crumbs { margin-top: 0; }
  .pl-hero { min-height: 250px; border-radius: 18px; }
  .pl-hero.has-photo { min-height: 320px; }
  .pl-hero.has-photo .pl-hero-shade { background: linear-gradient(180deg, rgba(20, 8, 9, .3) 0%, rgba(20, 8, 9, .55) 35%, var(--pl-shade) 70%); }
  .pl-hero-in { padding: 20px 18px 48px; gap: 14px; }
  .pl-hero h1 { font-size: 36px; }
  .pl-hero-addr { font-size: 14px; }
  .pl-hero-num { right: 10px; top: 36%; }
  .pl-hero-actions { width: 100%; }
  .pl-hide-sm { display: none; }
  .pl-facts { margin: -28px 10px 16px; }
  .pl-props--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-amount b { font-size: 28px; }
  .pl-mosaic { grid-auto-rows: 96px; }
  .pl-mosaic--1 { grid-auto-rows: 210px; }
  .pl-ops { opacity: 1; transform: none; }
  .pl-tile::after { opacity: 1; }
  .pl-page-veil > div { padding: 28px 24px; margin: 0 16px; text-align: center; }

  .wz-head { padding: 18px; border-radius: 18px; }
  .wz-head h1 { font-size: 22px; }
  .wz-head p { display: none; }
  .wz-cancel { height: 34px; padding: 0 12px; }
  .wz-steps { display: none; }
  .wz-compact {
    display: block; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .wz-compact-row { display: flex; gap: 6px; align-items: baseline; font-size: 13.5px; margin-bottom: 9px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wz-compact-row b { color: var(--brand); font-family: var(--font-head); }
  .wz-compact-row span:last-child { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
  .wz-compact-bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
  .wz-compact-bar span { display: block; height: 100%; border-radius: inherit; background: var(--grad-brand); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
  .wz-body { padding: 18px 16px 20px; }
  .wz-step-head { margin-bottom: 16px; gap: 12px; }
  .wz-step-ico { width: 40px; height: 40px; border-radius: 11px; }
  .wz-step-ico svg { width: 19px; height: 19px; }
  .wz-step-kicker { display: none; }
  .wz-step-head h2 { font-size: 18px; margin-top: 0; }
  .wz-step-head p { font-size: 13px; }
  .wz-error { margin: 0 16px 14px; }
  .wz-foot { padding: 12px 16px; }
  .wz-foot-count { display: none; }
  .wz-picker .picker-map { height: 340px; }
  .wz-map-side { grid-template-columns: 1fr; }
  .wz-tips { display: none; }
  .wz-modes { grid-template-columns: 1fr; gap: 8px; }
  .wz-mode { display: grid; grid-template-columns: 42px minmax(0, 1fr); column-gap: 12px; row-gap: 0; align-items: center; padding: 12px 44px 12px 12px; }
  .wz-mode-ico { grid-row: span 2; margin: 0; }
  .wz-mode-check { top: 50%; margin-top: -11px; }
  .wz-sum-hero { grid-template-columns: 1fr; gap: 14px; }
  .wz-sum-photo { aspect-ratio: 16 / 9; }
  .wz-sum-main h3 { font-size: 28px; }
  .wz-dl { grid-template-columns: 104px minmax(0, 1fr); }
  .fx-range { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fx-range-sep { display: none; }
}
@media (max-width: 560px) {
  .pl-btn-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pl-head-actions .btn-ghost { width: 32px; padding: 0; }
  .pl-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-fact { padding: 12px; gap: 10px; flex-direction: column; }
  .pl-fact-ico { width: 30px; height: 30px; border-radius: 9px; }
  .pl-fact-ico svg { width: 15px; height: 15px; }
  .pl-fact-val { font-size: 19px; }
  .pl-fact-sm { font-size: 14px; }
  .pl-card-head { padding: 12px 14px 12px 16px; min-height: 54px; }
  .pl-contract-body, .pl-client { padding: 16px; }
  .pl-props { grid-template-columns: 1fr 1fr; padding: 16px; gap: 14px; }
  .pl-props--3 { padding: 14px 0 0; }
  .pl-contacts { grid-template-columns: 1fr; }
  .pl-term { padding: 14px; }
  .pl-term-days { font-size: 34px; }
  .pl-ctl { padding: 4px 12px 10px 16px; }
  .pl-ctl-item { grid-template-columns: 14px minmax(0, 1fr) auto; }
  .pl-ctl-sum { grid-column: 2; grid-row: 2; font-size: 13px; }
  .pl-ctl-ops { grid-column: 3; grid-row: 1 / span 2; }
  .pl-log { padding: 8px 16px 6px; }
  .pl-log-row { flex-direction: column; gap: 0; }
  .pl-links { padding: 12px; }
  .pl-link-route { margin-left: 0; flex: 1 1 100%; justify-content: center; }
  .pl-link { flex: 1; justify-content: center; }
  .pl-coords { display: none; }
  .pl-mosaic { padding: 10px; gap: 6px; }
  .pl-mosaic--3, .pl-mosaic--4, .pl-mosaic--5 { grid-template-columns: 1fr 1fr; }
  .pl-mosaic--3 > :first-child, .pl-mosaic--4 > :first-child, .pl-mosaic--5 > :first-child { grid-column: span 2; grid-row: span 2; }
  .pl-hero-actions .pl-glass-btn, .pl-hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .pl-glass-danger { flex: 0 0 auto !important; }
}

@media (prefers-reduced-motion: reduce) {
  .pl-anim > *, .pl-anim .pl-col > *, .pl-anim .pl-term-fill, .pl-term--crit .pl-term-chip,
  .wz-in-fwd, .wz-in-back, .wz-sub, .wz-steps .wz-step.current .wz-dot, .wz-point.is-set .wz-point-ico { animation: none !important; }
  .pl-hero-media img, .pl-tile img, .wz-line > span, .wz-compact-bar span, .wz-switch::after { transition: none !important; }
  .pl-hero.has-photo:hover .pl-hero-media img, .pl-tile:hover img, .wz-mode:hover, .wz-previews .preview:hover { transform: none; }
}
