/* Дизайн в духе zakaz.wflo.ru: светлая тема, белые карточки, тёмная верхняя полоса и выдвижное меню. */
:root {
  --bg: #f4f4f5; --card: #fff; --text: #18181b; --muted: #71717a; --line: #e4e4e7; --line2: #d4d4d8;
  --dark: #18181b; --dark2: #27272a; --link: #2563eb; --green: #16a34a; --green-bg: #dcfce7; --green-fg: #166534;
  --red: #dc2626; --top-h: 52px; --side-w: 250px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); }
a { color: var(--link); text-decoration: none; }
h1 { font-size: 22px; margin: .2em 0 .5em; }
h2 { font-size: 16px; margin: 1.2em 0 .4em; }
.muted, .hint { color: var(--muted); font-size: 14px; }
.hint { margin-top: 3px; }

/* каркас */
.main { min-height: 100vh; transition: margin-left .2s ease; }
.top { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 12px;
  padding: 0 12px; background: var(--dark); color: #fff; }
.top b { font-size: 16px; } .top b a { color: #fff; }
.top .topuser { margin-left: auto; color: #d4d4d8; font-size: 14px; }
.burger { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: #fff; font-size: 24px; cursor: pointer; border-radius: 8px; }
.burger:hover { background: var(--dark2); }
.wrap { max-width: 640px; margin: 0 auto; padding: 12px; }
.sidenav { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); background: var(--dark); color: #e4e4e7;
  transform: translateX(-100%); transition: transform .2s ease; z-index: 40; overflow-y: auto; display: flex; flex-direction: column; }
html.nav-open .sidenav { transform: translateX(0); }
.sidenav-head { padding: 15px 16px; font-weight: 700; border-bottom: 1px solid var(--dark2); }
.sidenav-head a { color: #fff; }
.nlinks { flex: 1; padding: 8px 0; }
.nlinks a { display: flex; align-items: center; gap: 12px; padding: 13px 18px; color: #d4d4d8; font-size: 16px; }
.nlinks a:hover { background: var(--dark2); color: #fff; }
.nlinks a.on { background: var(--dark2); color: #fff; box-shadow: inset 3px 0 0 var(--green); }
.nlinks .ic { width: 24px; text-align: center; }
.side-foot { border-top: 1px solid var(--dark2); padding: 14px 16px; display: grid; gap: 10px; font-size: 14px; }
.side-foot small { display: block; color: #a1a1aa; }
.side-foot a { color: #d4d4d8; }
.side-foot form { margin: 0; }
.side-foot button { width: 100%; background: var(--dark2); color: #fff; border: 1px solid #3f3f46; }
.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
html.nav-open .scrim { display: block; }

/* кнопки и поля */
button, .btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 16px; border: 1px solid var(--line2); border-radius: 12px; background: #fff;
  color: var(--text); font-weight: 600; cursor: pointer; }
button:hover, .btn:hover { background: #fafafa; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: #15803d; }
.btn-danger { color: var(--red); border-color: #fca5a5; }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 54px; font-size: 17px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row > * { flex: 1 1 140px; }
.btn-row form { margin: 0; }
label { display: block; font-weight: 600; margin: 14px 0 5px; }
input[type=text], input[type=password], input[type=tel], input[type=number], input[type=search], select, textarea {
  font: inherit; color: var(--text); width: 100%; min-height: 48px; padding: 10px 12px; background: #fff;
  border: 1px solid var(--line2); border-radius: 10px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #93c5fd; outline-offset: 1px; }

/* карточки и списки */
.card { background: var(--card); border-radius: 14px; padding: 14px; margin: 10px 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
a.card { display: block; color: inherit; } a.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.grid { display: grid; gap: 10px; } .grid > .card { margin: 0; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--muted); flex: none; max-width: 50%; }
.row .v { text-align: right; font-weight: 600; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--line); color: #3f3f46; white-space: nowrap; }
.st-new { background: #dbeafe; color: #1e40af; } .st-sale { background: var(--green-bg); color: var(--green-fg); }
.st-deposit { background: #fef9c3; color: #a16207; } .st-sold { background: var(--line); color: #3f3f46; }
.st-admin { background: #ede9fe; color: #5b21b6; }
.price { font-size: 19px; font-weight: 700; }
.obj-title { font-weight: 700; font-size: 17px; }
.obj-addr { color: var(--muted); font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.stat { background: #fff; border-radius: 12px; padding: 12px 6px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat b { display: block; font-size: 26px; line-height: 1.2; } .stat span { color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
.chip { flex: none; padding: 8px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--line2); color: var(--text); font-weight: 600; }
.chip.on { background: var(--dark); border-color: var(--dark); color: #fff; }
.flash { padding: 12px 14px; border-radius: 10px; margin: 8px 0 12px; font-weight: 600; }
.flash.ok { background: #f0fdf4; color: var(--green-fg); } .flash.warn { background: #fef9c3; color: #854d0e; }
.flash.err { background: #fef2f2; color: #991b1b; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.page-head h1 { margin: 0; }
.narrow { max-width: 560px; }

/* шаги формы, выбор, фото */
details.step, .help details { background: #fff; border-radius: 14px; margin: 10px 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
details.step > summary, .help summary { list-style: none; cursor: pointer; padding: 15px; font-weight: 700; display: flex; align-items: center; gap: 12px; min-height: 54px; }
details > summary::-webkit-details-marker { display: none; }
details.step > summary::after, .help summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
details[open] > summary::after { content: "▴"; }
.num { width: 30px; height: 30px; border-radius: 50%; background: var(--dark); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 15px; }
.step-body, .help .body { padding: 0 15px 15px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choices { display: grid; gap: 8px; margin-top: 4px; }
.choice { margin: 0; font-weight: 600; } .choice input { position: absolute; opacity: 0; }
.choice span { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 10px 14px; background: #fff; border: 2px solid var(--line2); border-radius: 12px; }
.choice input:checked + span { border-color: var(--green); background: #f0fdf4; }
.choice input:focus-visible + span { outline: 3px solid #93c5fd; }
.photo-add { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 80px; margin: 6px 0; padding: 12px; text-align: center;
  background: #fff; border: 1px dashed #a1a1aa; border-radius: 12px; color: #52525b; font-weight: 600; cursor: pointer; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.photo-add:focus-within, .btn:focus-within { outline: 3px solid #93c5fd; outline-offset: 1px; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumb { aspect-ratio: 1; border-radius: 10px; background: var(--line); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.timeline { border-left: 2px solid var(--line2); margin: 8px 0 0 6px; padding-left: 16px; }
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: -23px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg); }
.tl-item small { display: block; color: var(--muted); }

/* инструкция, вход, пароль */
.help ol { padding-left: 1.3rem; margin: 0 0 8px; } .help li { margin-bottom: 9px; }
.help .tip { background: #f0fdf4; color: var(--green-fg); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.help .warn { background: #fef9c3; color: #854d0e; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.login-box { max-width: 400px; margin: 7vh auto 0; padding: 0 14px; }
.pw-box { font: 700 30px ui-monospace, Menlo, monospace; letter-spacing: .08em; text-align: center; padding: 16px; background: #fff; border: 2px dashed var(--green); border-radius: 14px; margin: 12px 0; user-select: all; }

/* карта */
.map-page { padding: 0 !important; max-width: none !important; }
#map { width: 100%; height: calc(100dvh - var(--top-h) - 38px); min-height: 340px; }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 14px; font-size: 13px; color: #52525b; background: #fff; border-bottom: 1px solid var(--line); }
.map-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; }
.wflo-div-icon { background: transparent; border: 0; }
.mk { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 4px solid #fff; border-radius: 50%; color: #fff; font-size: 15px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.leaflet-popup-content-wrapper { padding: 0; overflow: hidden; border-radius: 12px; }
.leaflet-popup-content { margin: 0 !important; width: 250px !important; }
.mp-head { padding: 6px 13px; font-weight: 700; color: #fff; font-size: 13px; }
.mp-addr { padding: 10px 13px 2px; font-weight: 700; line-height: 1.3; }
.mp-body { padding: 4px 13px 12px; color: var(--muted); font-size: 14px; }
.mp-body .btn { margin-top: 10px; min-height: 44px; width: 100%; color: #fff; }

/* десктоп: компактные кнопки, сетки, меню раздвигает контент */
@media (min-width: 900px) {
  html.nav-open .main { margin-left: var(--side-w); }
  html.nav-open .scrim { display: none; }
  .wrap { max-width: none; margin: 0; padding: 20px 28px 40px; }
  h1 { font-size: 22px; }
  button, .btn { min-height: 40px; padding: 7px 14px; font-size: 14px; border-radius: 8px; }
  .btn-lg { min-height: 42px; font-size: 15px; }
  .btn-block { display: inline-flex; width: auto; min-width: 180px; }
  .btn-row > * { flex: 0 0 auto; }
  input[type=text], input[type=password], input[type=tel], input[type=number], input[type=search], select, textarea { min-height: 42px; font-size: 15px; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .stats { max-width: 520px; }
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-items: start; }
  .cols > div > h2:first-child { margin-top: 0; }
  .choices { grid-template-columns: repeat(2, 1fr); }
  .choice span { min-height: 44px; }
  .help { max-width: 820px; }
  .thumbs { max-width: 420px; }
  .chips { flex-wrap: wrap; overflow: visible; }
  #map { height: calc(100dvh - var(--top-h) - 38px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- фото: сетка, просмотр, добавление, редактор ---- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid img, .pv { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--line); display: block; cursor: zoom-in; }
.photo-grid .ph-btn { padding: 0; border: 0; background: none; min-height: 0; border-radius: 10px; }
.photo-grid .ph-btn:hover { background: none; opacity: .92; }
.photo-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.photo-actions > * { flex: 1 1 150px; }
.photo-new { display: none; margin-top: 10px; }
[data-photo-block].has-new .photo-new { display: block; }
.photo-new .pvs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.photo-new .pv { cursor: default; }
.pvs:empty { display: none; }
.photo-add + .pvs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-add + .pvs:empty { display: none; }
.photo-add + .pvs .pv { cursor: default; }

.lb-overlay { display: none; position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.93); align-items: center; justify-content: center; }
.lb-overlay.open { display: flex; }
.lb-img { max-width: 96vw; max-height: 84vh; object-fit: contain; border-radius: 6px; background: #000; }
.lb-close { position: absolute; top: 10px; right: 10px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; border: 0; font-size: 22px; padding: 0; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; background: rgba(255,255,255,.15); color: #fff; border: 0; font-size: 34px; padding: 0; border-radius: 10px; }
.lb-prev { left: 8px; } .lb-next { right: 8px; }
.lb-overlay.single .lb-nav { display: none; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.28); }
.lb-cap { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #e4e4e7; font-size: 14px; }
body.lb-lock { overflow: hidden; }

.pe-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; padding: 10px; }
.pe-box { background: var(--dark); border-radius: 12px; max-width: 94vw; max-height: 96vh; width: 640px; display: flex; flex-direction: column; overflow: hidden; }
.pe-title { color: #fff; padding: 10px 14px 0; font-weight: 700; }
.pe-imgwrap { flex: 1 1 auto; min-height: 260px; max-height: 60vh; background: #000; margin-top: 8px; }
.pe-imgwrap .pe-img { display: block; max-width: 100%; }
.pe-controls { padding: 10px 14px 14px; color: #fff; display: flex; flex-direction: column; gap: 10px; }
.pe-rotatelabel { font-size: 14px; display: flex; flex-direction: column; gap: 4px; margin: 0; font-weight: 400; }
.pe-rotatelabel input[type=range] { width: 100%; min-height: 0; padding: 0; }
.pe-quickrotate, .pe-actions { display: flex; gap: 8px; }
.pe-quickrotate button, .pe-actions button { flex: 1; min-height: 46px; background: var(--dark2); color: #fff; border-color: #3f3f46; }
.pe-actions .btn-primary { background: var(--green); border-color: var(--green); }
.pe-hint { font-size: 12px; color: #a1a1aa; text-align: center; }

/* карточка объекта: раскладка и блок показов */
.obj-layout { display: grid; gap: 0; grid-template-areas: "ph" "ow" "fa"; }
.obj-layout .ph { grid-area: ph; } .obj-layout .ow { grid-area: ow; } .obj-layout .fa { grid-area: fa; }
.obj-layout h2:first-child { margin-top: 1em; }
.showings { background: #27272a; color: #f4f4f5; border-radius: 16px; padding: 4px 14px 14px; margin-top: 22px; }
.showings h2 { color: #fff; }
.showings .muted { color: #a1a1aa; }
.sh-card { background: #18181b; border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.sh-card .row { border-color: #3f3f46; } .sh-card .row .k { color: #a1a1aa; } .sh-card .row .v { color: #fff; }
.sh-head { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 6px; }
.sh-head span { color: #a1a1aa; font-size: 14px; }
.sh-res { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #3f3f46; }
.showings .btn { background: var(--green); border-color: var(--green); color: #fff; }
@media (min-width: 900px) {
  .obj-layout { grid-template-columns: minmax(0, 1fr) 420px; column-gap: 28px; grid-template-rows: auto 1fr;
    grid-template-areas: "fa ow" "fa ph"; align-items: start; }
  .obj-layout h2:first-child { margin-top: 0; }
  .showings { padding: 4px 18px 18px; }
  .showings-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 0 14px; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
}

/* фильтры, история показов, цвета итогов */
.filters { display: grid; gap: 10px; margin: 10px 0 8px; }
.filters .f label { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.filters .f-btn { display: flex; gap: 8px; align-items: end; }
.filters .f-btn > * { flex: 1; }
.sh-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.res-interested { background: #dbeafe; color: #1e40af; } .res-thinking { background: #fef9c3; color: #a16207; }
.res-bargain { background: #ffedd5; color: #9a3412; } .res-refused { background: #fee2e2; color: #991b1b; }
.res-takes { background: var(--green-bg); color: var(--green-fg); }
.steps { display: grid; gap: 0 16px; }
@media (min-width: 900px) {
  .filters { grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(200px, 260px); align-items: end; max-width: 1000px; }
  .wide-form { max-width: none; }
  .steps { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); align-items: start; }
  .steps details.step { margin: 0 0 14px; }
  .narrow { max-width: 720px; }
  .grid-wide { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
  .help { max-width: 900px; }
}

/* переключатель «плитки / список» */
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.viewbar { display: inline-flex; align-items: center; gap: 6px; }
.viewbar button { min-height: 40px; padding: 6px 12px; font-size: 14px; border-radius: 8px; }
.viewbar button[aria-pressed=true] { background: var(--dark); border-color: var(--dark); color: #fff; }
.card.item, .item { display: grid; gap: 2px 10px; align-items: center; align-content: start; }
.i-title { grid-area: t; } .i-badge { grid-area: b; justify-self: end; } .i-addr { grid-area: a; }
.i-price { grid-area: p; } .i-meta { grid-area: m; }
.s-date { grid-area: d; } .s-agent { grid-area: g; justify-self: end; } .s-obj { grid-area: o; }
.s-buyer { grid-area: u; } .s-res { grid-area: r; justify-self: start; } .s-comm { grid-area: c; }
.item-obj { grid-template-columns: 1fr auto; grid-template-areas: "t b" "a a" "p g"; }
.i-agent { grid-area: g; justify-self: end; color: var(--muted); font-size: 14px; text-align: right; }
.card.item .i-agent::before { content: "👤 "; }
.list-head .i-agent::before { content: none; }
.item-owner { grid-template-columns: 1fr; grid-template-areas: "t" "a" "m"; }
.item-show { grid-template-columns: 1fr auto; grid-template-areas: "d g" "o o" "u r" "c c" "x x"; row-gap: 6px; }
.list-head { display: none; }
html[data-view=rows] .items.grid { display: flex; flex-direction: column; gap: 6px; }
html[data-view=rows] .items > .card { padding: 10px 14px; border-radius: 10px; }
html[data-view=rows] .items .item-obj { grid-template-areas: "t p" "a a" "g b"; }
html[data-view=rows] .items .item-obj .i-agent { justify-self: start; }
html[data-view=rows] .items .item-obj .i-price { justify-self: end; font-size: 16px; }
html[data-view=rows] .items .s-comm { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 900px) {
  html[data-view=rows] .items .item-obj, html[data-view=rows] .list-head.item-obj {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 130px minmax(0, 1.4fr) 124px; grid-template-areas: "t a p g b"; }
  html[data-view=rows] .items .item-obj .i-agent::before { content: none; }
  html[data-view=rows] .items .item-owner, html[data-view=rows] .list-head.item-owner {
    grid-template-columns: minmax(200px, 2fr) minmax(160px, 1.5fr) minmax(220px, 2fr); grid-template-areas: "t a m"; }
  html[data-view=rows] .items .item-show, html[data-view=rows] .list-head.item-show {
    grid-template-columns: 150px minmax(200px, 1.6fr) minmax(130px, 1fr) minmax(130px, 1fr) 130px minmax(200px, 2fr) 44px;
    grid-template-areas: "d o u g r c x"; row-gap: 0; }
  html[data-view=rows] .items .s-del { margin: 0; justify-self: stretch; }
  html[data-view=rows] .items .s-del button { width: 100%; padding: 2px 0; }
  html[data-view=rows] .items .item-obj .i-price { justify-self: start; font-size: 17px; }
  html[data-view=rows] .items .item-show .s-agent { justify-self: start; }
  html[data-view=rows] .items .item-show .s-buyer .muted { display: none; }
  html[data-view=rows] .list-head { display: grid; gap: 2px 10px; padding: 0 14px 4px; color: var(--muted); font-size: 12px;
    font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
  html[data-view=rows] .items .item-obj .i-badge { justify-self: start; }
}

/* ---- форма объекта: подсказки, собственник, окно, ракурсы фото ---- */
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin: 4px 0 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-height: 300px; overflow-y: auto; }
.combo-list[hidden] { display: none; }
.combo-list li { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.combo-list li b { display: block; }
.combo-list li small { display: block; color: var(--muted); }
.combo-list li:hover, .combo-list li.on { background: #f4f4f5; }
.combo-list li.combo-empty { cursor: default; color: var(--muted); }
.addr-status { margin: 8px 0 2px; padding: 0; font-size: 14px; border-radius: 10px; }
.addr-status.ok, .addr-status.warn, .addr-status.wait { padding: 9px 12px; }
.addr-status.ok { background: #f0fdf4; color: var(--green-fg); } .addr-status.warn { background: #fef9c3; color: #854d0e; }
.addr-status.wait { background: var(--line); color: #3f3f46; }
.addr-status .muted { color: inherit; opacity: .8; }
.owner-chosen { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 10px 12px;
  background: #f0fdf4; border: 1px solid #86efac; border-radius: 10px; }
.owner-chosen[hidden] { display: none; }
.owner-chosen button { min-height: 38px; padding: 4px 12px; flex: none; }
dialog#owner-dialog { border: 0; border-radius: 16px; padding: 18px; width: min(520px, 94vw); max-height: 94vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog#owner-dialog::backdrop { background: rgba(0,0,0,.5); }
.field-err { color: #991b1b; font-size: 14px; margin-top: 4px; } .field-err[hidden] { display: none; }
.photo-counter { display: inline-block; padding: 6px 12px; border-radius: 999px; background: #fef9c3; color: #854d0e; font-weight: 600; margin-bottom: 8px; }
.photo-counter.enough { background: var(--green-bg); color: var(--green-fg); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.slot { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; margin: 0; padding: 0; overflow: hidden;
  background: #fff; border: 2px dashed #a1a1aa; border-radius: 12px; cursor: pointer; text-align: center; }
.slot-empty { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; font-weight: 600; font-size: 14px; }
.slot-empty small { color: var(--muted); font-weight: 400; } .slot-ic { font-size: 26px; }
.slot-opt { border-color: var(--line2); }
.slot .pvs { position: absolute; inset: 0; display: none !important; }
.slot.has-new { border-style: solid; border-color: var(--green); }
.slot.has-new .slot-empty { display: none; }
.slot.has-new .pvs { display: block !important; } .slot .pvs .pv { height: 100%; aspect-ratio: auto; border-radius: 0; cursor: pointer; }
.slot-label { display: none; position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 600; }
.slot.has-new .slot-label { display: block; }
.slot:focus-within { outline: 3px solid #93c5fd; outline-offset: 1px; }
.review-badge { background: #fef9c3; color: #854d0e; }
@media (min-width: 900px) { .slots { grid-template-columns: repeat(3, 1fr); max-width: 520px; } }

.i-flags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sh-del { min-height: 36px; padding: 4px 12px; font-size: 14px; background: transparent; border-color: #7f1d1d; color: #fca5a5; }
.s-del { grid-area: x; justify-self: end; margin: 4px 0 0; }
.s-x { grid-area: x; }
.s-del button { min-height: 34px; padding: 2px 10px; }
}
.combo-list li.combo-empty button { margin-top: 8px; min-height: 42px; width: 100%; }

.card.item { color: inherit; }
.card.item .i-title, .card.item .s-obj, .card.item .i-addr, .card.item .i-meta, .card.item .s-comm { min-width: 0; overflow-wrap: anywhere; }

.obj-actions { margin: 0 0 6px; max-width: 760px; }
.obj-actions form { margin: 0; }
.last-change { margin: 2px 0 12px; color: var(--muted); font-size: 14px; }
.hist { display: grid; gap: 10px; max-width: 820px; }
.hist-item { margin: 0; border-left: 4px solid var(--green); }
.hist-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.hist-who { color: #3f3f46; }
.hist-act { font-weight: 600; margin: 2px 0 6px; }
.hist-change { display: grid; grid-template-columns: 160px 1fr 24px 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); align-items: start; }
.hc-label { color: var(--muted); } .hc-old { color: #991b1b; text-decoration: line-through; opacity: .85; overflow-wrap: anywhere; }
.hc-arrow { text-align: center; color: var(--muted); } .hc-new { color: var(--green-fg); font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 640px) { .hist-change { grid-template-columns: 1fr 24px 1fr; } .hc-label { grid-column: 1 / -1; font-weight: 600; } }

.owner-locked .lock-msg { background: #f4f4f5; border-radius: 10px; padding: 12px; margin-bottom: 6px; color: #3f3f46; }
.mine-badge { background: #dbeafe; color: #1e40af; }

/* ---- форма объекта: обязательные поля, ручной адрес, телефон, торг ---- */
.req { color: #dc2626; font-weight: 700; }
.invalid { border-color: #dc2626 !important; background: #fef2f2 !important; }
.err-list { margin: 6px 0 0; padding-left: 1.2em; font-weight: 500; }
.linklike { background: none; border: 0; min-height: 0; padding: 0; color: var(--link); font-weight: 600; text-decoration: underline; cursor: pointer; display: inline; font-size: inherit; }
.linklike:hover { background: none; }
.manual-box { background: #fafafa; border: 1px dashed var(--line2); border-radius: 12px; padding: 4px 12px 12px; margin: 8px 0; }
.manual-box[hidden], #bargain-box[hidden], #bargain-min-box[hidden], #mortgage-box[hidden], #enc-note-box[hidden], #bank-other-box[hidden] { display: none; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .three { grid-template-columns: 1fr 1fr; } .three > :first-child { grid-column: 1 / -1; } }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 8px 0 4px; cursor: pointer; }
label.check input { width: 22px; height: 22px; min-height: 0; flex: none; }
.phone-hint { padding: 10px 12px; border-radius: 10px; margin: 8px 0; } .phone-hint[hidden] { display: none; }
.phone-hint.ok { background: #f0fdf4; color: var(--green-fg); } .phone-hint.warn { background: #fef9c3; color: #854d0e; }
.phone-hint button { margin-top: 8px; width: 100%; min-height: 44px; }
#owner-fields[hidden] { display: none; }
input.auto { background: #f0fdf4; border-style: dashed; }
#area-hint.bad { color: #991b1b; font-weight: 600; }
.slot-plan { border-color: var(--green); background: #f0fdf4; }
dialog#owner-dialog button:disabled { opacity: .5; cursor: not-allowed; }

/* заголовки колонок в режиме «Список» выровнены по левому краю ячейки, как и значения под ними */
html[data-view=rows] .list-head > * { justify-self: start; }
.dist-badge { background: #e4e4e7; color: #3f3f46; }

/* ---- массовая загрузка фото ---- */
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 12px; margin: 6px 0; text-align: center; cursor: pointer;
  background: #fff; border: 2px dashed #a1a1aa; border-radius: 14px; font-weight: 400; }
.drop b { font-size: 17px; } .drop small { color: var(--muted); font-size: 14px; } .drop-ic { font-size: 32px; }
.drop.over { border-color: var(--green); background: #f0fdf4; }
.drop:focus-within { outline: 3px solid #93c5fd; outline-offset: 1px; }
.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.plist:empty { display: none; }
.pcard { background: #fff; border: 2px solid var(--line2); border-radius: 12px; overflow: hidden; }
.pcard.plan { border-color: var(--green); background: #f0fdf4; }
.pcard img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--line); }
.pcard.busy img { opacity: .5; }
.pbar { display: grid; grid-template-columns: 1fr auto auto; gap: 4px; padding: 6px; }
.pbar select { min-height: 42px; padding: 4px 6px; font-size: 14px; min-width: 0; }
.pbar button { min-height: 42px; width: 42px; padding: 0; font-size: 16px; }
.existing-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.existing-photos figure { margin: 0; } .existing-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.existing-photos figcaption { font-size: 12px; color: var(--muted); text-align: center; }
.pe-box select { background: #27272a; color: #fff; border: 1px solid #3f3f46; min-height: 44px; }
input.money { font-variant-numeric: tabular-nums; }

small.vt, small.offer { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
small.offer { color: #9a3412; font-weight: 600; }

/* ---- таблица сотрудников ---- */
.table-wrap { background: #fff; border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th { text-align: left; padding: 11px 14px; background: #fafafa; color: var(--muted); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.users-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.users-table tbody tr:last-child td { border-bottom: 0; }
.users-table tbody tr:hover { background: #fafafa; }
.users-table tr.off { opacity: .6; }
.users-table code { font-size: 14px; background: #f4f4f5; padding: 2px 6px; border-radius: 6px; }
.users-table .actions { white-space: nowrap; }
.users-table .actions form { display: inline-block; margin: 0 6px 0 0; }
.tbtn { min-height: 36px; padding: 4px 12px; font-size: 14px; border-radius: 8px; }
.pw-wait { background: #fef9c3; color: #854d0e; }
@media (max-width: 800px) {
  .users-table thead { position: absolute; left: -9999px; }
  .users-table, .users-table tbody, .users-table tr, .users-table td { display: block; width: 100%; }
  .users-table tr { padding: 10px 0; border-bottom: 6px solid var(--bg); }
  .users-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 14px; border: 0; text-align: right; }
  .users-table td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; flex: none; }
  .users-table td.actions { justify-content: flex-end; flex-wrap: wrap; white-space: normal; }
  .users-table td.actions::before { display: none; }
  .users-table td.actions form { margin: 4px 0 4px 6px; }
}

.users-table td[data-label="Телефон"], .users-table td[data-label="Логин"] { white-space: nowrap; }
.users-table td[data-label="ФИО"] { min-width: 200px; }
/* карточка фото: список комнаты на всю ширину, кнопки под ним */
.pbar { grid-template-columns: 1fr 1fr; }
.pbar .ptag { grid-column: 1 / -1; }
.pbar button { width: 100%; }

/* ---- блок адреса: ровные ряды и спокойный порядок ---- */
.two > div, .three > div { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.manual-box label { font-size: 14px; color: #52525b; }
.manual-box .two, .manual-box .three { margin-top: 0; }
.three.compact { grid-template-columns: 1.3fr 1fr 1fr; }
@media (max-width: 520px) { .three.compact { grid-template-columns: 1fr 1fr 1fr; gap: 8px; } .three.compact > :first-child { grid-column: auto; } }
.addr-actions { margin: 4px 0 8px; }
.addr-status:empty { display: none; }
.hint + .addr-status.ok, .hint + .addr-status.warn, .hint + .addr-status.wait { margin-top: 6px; }
/* ---- фото: заголовки разделов, отдельная планировка ---- */
.photo-h { font-size: 16px; margin: 16px 0 4px; }
.drop-plan { border-color: var(--green); background: #f0fdf4; }
.drop[hidden], .pcard[hidden] { display: none; }
#plan-card { max-width: 260px; margin: 6px 0 4px; }
#plan-card .pbar { grid-template-columns: 1fr 42px 42px; align-items: center; }
.plan-cap { font-weight: 600; padding-left: 4px; }

/* ---- логотип, вход по центру ---- */
.brand-link { display: inline-flex; align-items: center; gap: 10px; color: inherit; }
.logo { display: block; flex: none; }
.top b a.brand-link span, .sidenav-head a.brand-link span { font-weight: 700; }
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; max-width: none !important; margin: 0 !important; padding: 24px 16px !important; }
.login-box { width: 100%; max-width: 400px; margin: 0; padding: 28px 24px; background: #fff; border-radius: 18px; box-shadow: 0 6px 30px rgba(24,24,27,.10); }
.login-head { text-align: center; margin-bottom: 8px; }
.login-head h1 { margin: 10px 0 4px; font-size: 26px; }
.login-logo { width: 96px; height: 96px; display: inline-block; filter: drop-shadow(0 6px 10px rgba(35,26,120,.25)); }
@media (max-width: 440px) { .login-box { padding: 22px 16px; box-shadow: none; background: transparent; } }
/* ---- цена в карточке объекта ---- */
.price-chip { display: inline-flex; flex-direction: column; align-items: flex-end; padding: 8px 18px 9px; border-radius: 16px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff); border: 1px solid #c7d2fe; color: #1e1b6e; line-height: 1.15; }
.price-chip small { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #4f46e5; }
.price-chip b { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .price-chip { align-items: flex-start; } .price-chip b { font-size: 24px; } }
/* ---- чередование строк в таблицах «О квартире» и «Деньги и документы» ---- */
.card.striped { padding: 6px; }
.striped .row { padding: 9px 10px; border-bottom: 0; border-radius: 8px; }
.striped .row:nth-child(even) { background: #f5f5f6; }
.empty-mine { text-align: left; }
.login-box .btn-block { display: flex; width: 100%; min-width: 0; }

/* логотип из файла заказчика: на входе — полный (с надписью ИЖИ), в шапке и меню — только знак на белой плитке */
.login-logo { width: min(280px, 78%); height: auto; filter: none; border-radius: 14px; }
.login-head h1 { margin: 6px 0 4px; font-size: 22px; }
.logo { border-radius: 8px; background: #fff; }
@media (max-width: 440px) { .login-box { padding: 22px 16px; background: #fff; box-shadow: 0 4px 20px rgba(24,24,27,.08); } }

/* ---- окошко маркера на карте: карусель фото и стоимость ---- */
.leaflet-popup-content { width: 280px !important; }
.mc { position: relative; overflow: hidden; background: #e4e4e7; aspect-ratio: 4 / 3; outline: none; touch-action: pan-y; user-select: none; }
.mc:focus-visible { outline: 3px solid #93c5fd; outline-offset: -3px; }
.mc-track { display: flex; height: 100%; transition: transform .25s ease; }
.mc-slide { flex: 0 0 100%; margin: 0; position: relative; height: 100%; }
.mc-slide img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; -webkit-user-drag: none; }
.mc-slide figcaption { position: absolute; left: 8px; bottom: 8px; padding: 2px 9px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; }
.mc-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  background: rgba(24,24,27,.55); color: #fff; font-size: 24px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.mc-btn:hover { background: rgba(24,24,27,.8); }
.mc-prev { left: 6px; } .mc-next { right: 6px; }
.mc-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.mc-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55); pointer-events: auto; cursor: pointer; }
.mc-dots i.on { background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.mc-count { position: absolute; top: 8px; right: 8px; padding: 2px 9px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; }
.mc-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }
.mp-price { padding: 10px 13px 0; font-size: 22px; font-weight: 800; color: #1e1b6e; font-variant-numeric: tabular-nums; }
.mp-addr { padding-top: 2px !important; }
.mc-slide figcaption { bottom: 26px; }

.opt { font-weight: 400; color: var(--muted); font-size: 14px; }
#contract-under-box[hidden], #contract-sum-box[hidden] { display: none; }

.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.head-actions .btn { min-width: 0; }
@media print {
  .sidenav, .top, .scrim, .burger, .viewbar, .filters, .chips, .head-actions, .btn, button { display: none !important; }
  .main { margin-left: 0 !important; } body { background: #fff; }
  .wrap { padding: 0; max-width: none; }
}

/* ---- выбор типа объекта ---- */
.kind-q { font-size: 20px; margin: 6px 0 2px; }
.kinds { display: grid; gap: 10px; margin-top: 12px; max-width: 760px; }
.kind-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; background: #fff; border: 2px solid var(--line); border-radius: 16px; color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.08); min-height: 78px; }
.kind-card:hover, .kind-card:focus-visible { border-color: var(--green); background: #f0fdf4; }
.kind-ic { font-size: 38px; line-height: 1; flex: none; width: 56px; text-align: center; }
.kind-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.kind-txt b { font-size: 18px; } .kind-txt small { color: var(--muted); font-size: 14px; }
.kind-go { font-size: 30px; color: var(--muted); }
@media (min-width: 900px) { .kinds { grid-template-columns: repeat(2, 1fr); max-width: 980px; } }
.kind-chip { display: inline-block; vertical-align: middle; font-size: 14px; font-weight: 600; padding: 3px 12px; border-radius: 999px; background: #eef2ff; color: #1e1b6e; border: 1px solid #c7d2fe; margin-left: 6px; }
.kind-chip.small { font-size: 12px; padding: 1px 9px; margin-left: 2px; }
.kind-badge { background: #eef2ff; color: #1e1b6e; }

/* форма: чекбоксы в столбик, коммуникации */
.flags-col { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
fieldset.comms { border: 1px solid var(--line, #e4e4e7); border-radius: 12px; padding: 12px 14px; margin: 14px 0; }
fieldset.comms legend { font-weight: 700; padding: 0 6px; }
.two.flags { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .two.flags { grid-template-columns: 1fr; } }

/* раздел «О сервисе» */
.side-foot .side-btn { display: block; margin-bottom: 10px; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; text-decoration: none; font-weight: 600; }
.side-foot .side-btn.on, .side-foot .side-btn:hover { background: rgba(255,255,255,.2); }
.svc-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.svc-toc a { padding: 7px 12px; border: 1px solid var(--line, #e4e4e7); border-radius: 999px; text-decoration: none; background: #fff; }
.svc-sec { margin-top: 22px; scroll-margin-top: 12px; }
.svc-table-wrap { overflow-x: auto; }
.svc-table { width: 100%; border-collapse: collapse; }
.svc-table th, .svc-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e4e4e7; vertical-align: top; }
.svc-table th { background: #f5f5f6; }
.svc-table .p1 { color: #b91c1c; font-weight: 700; } .svc-table .p2 { color: #b45309; font-weight: 700; } .svc-table .p3 { color: #52525b; font-weight: 700; }
.flow { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 12px 0; }
.fnode { padding: 10px 16px; border-radius: 12px; border: 2px solid #18181b; background: #fff; font-weight: 600; text-align: center; max-width: 100%; }
.fnode.start { background: #18181b; color: #fff; } .fnode.q { background: #fef3c7; border-color: #b45309; } .fnode.check { background: #e0f2fe; border-color: #0369a1; } .fnode.ok { background: #dcfce7; border-color: #15803d; }
.farrow { color: #71717a; font-size: 18px; line-height: 1; }
.fbranch { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.fcol { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.kflow { margin-top: 0; } .kflow h3 { margin: 0 0 6px; } .kflow ol { margin: 0; padding-left: 20px; } .kflow li { margin: 4px 0; }

.mail-form { display: flex; gap: 6px; align-items: center; } .mail-form input { min-width: 170px; margin: 0; }
