/* собрано из prototype/v3.html: node scripts/build-ui.js */
/* Шахматка Maison v3 — «тёмный лес и бумага».
   Почти монохром: тёплая бумага, глубокий зелёный Maison как единственный акцент, янтарь только для броней.
   Главный экран — обложка проекта и генплан с виллами; шахматка как рабочий вид. Плитки свободных вилл белые и «поднимаются»
   над бумагой, занятые уходят в фон. Шкала шрифта 44/28/20/16/14/12, скругления 8 / 12 / 20, кнопки 52 и 40. */
:root {
  --bg: #f3f0e8; --surface: #fffdf8; --surface-2: #ece8de; --line: #e0dacd; --line-2: #cfc8b8;
  --text: #171c18; --muted: #5a605a; --faint: #5b6159;
  --accent: #1b4331; --accent-2: #24573f; --on-accent: #ffffff; --accent-text: #1d5139; --accent-soft: #dfe8df;
  --free: #2b6a45; --book: #8a5300; --book-bg: #f2e3c4; --sold: #6a6f68;
  --free-bg: #dfe8df; --sold-bg: #e4e0d6;
  --scrim: rgba(16, 20, 17, .5);
  --f: "Onest", "Helvetica Neue", Arial, sans-serif;
  --fs0: 44px; --fs1: 28px; --fs2: 20px; --fs3: 16px; --fs4: 14px; --fs5: 12px;
  --r-s: 8px; --r-m: 12px; --r-l: 20px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --lift: 0 1px 2px rgba(40, 34, 20, .06), 0 8px 24px -12px rgba(40, 34, 20, .18);
  --focus: 0 0 0 3px rgba(27, 67, 49, .28);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1311; --surface: #171c19; --surface-2: #1f2521; --line: #2a312c; --line-2: #3a423c;
  --text: #ece9e1; --muted: #a7ada6; --faint: #959c95;
  --accent: #2f7a56; --accent-2: #38906a; --accent-text: #8fd2ad; --accent-soft: #1d3326;
  --free: #8fd2ad; --book: #f0bd6e; --book-bg: #3a2c14; --sold: #9aa09a; --free-bg: #1d3326; --sold-bg: #232824;
  --scrim: rgba(0, 0, 0, .62); --lift: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
  --focus: 0 0 0 3px rgba(143, 210, 173, .35); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0f1311; --surface: #171c19; --surface-2: #1f2521; --line: #2a312c; --line-2: #3a423c;
  --text: #ece9e1; --muted: #a7ada6; --faint: #959c95;
  --accent: #2f7a56; --accent-2: #38906a; --accent-text: #8fd2ad; --accent-soft: #1d3326;
  --free: #8fd2ad; --book: #f0bd6e; --book-bg: #3a2c14; --sold: #9aa09a; --free-bg: #1d3326; --sold-bg: #232824;
  --scrim: rgba(0, 0, 0, .62); --lift: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
  --focus: 0 0 0 3px rgba(143, 210, 173, .35); color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--bg); margin: 0; }
body { color: var(--text); font-family: var(--f); font-size: var(--fs4); line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.num { font-variant-numeric: tabular-nums; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wrap { max-width: 1440px; margin: 0 auto; padding-block: 20px 112px;
  padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }

/* шапка: слово-логотип, проекты текстом, сделка справа */
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-bottom: 20px; min-height: 52px; }
.brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand b { font-size: 17px; font-weight: 700; letter-spacing: .32em; }
.brand span { font-size: var(--fs5); color: var(--muted); letter-spacing: .04em; }
.projects { display: flex; gap: 4px; }
.projects button { position: relative; display: inline-flex; align-items: baseline; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: var(--r-s); background: none; color: var(--muted); font-size: var(--fs4); font-weight: 500; white-space: nowrap; transition: color .2s, background .2s; }
.projects button:hover { color: var(--text); background: var(--surface-2); }
.projects button small { font-size: var(--fs5); color: var(--faint); font-variant-numeric: tabular-nums; }
.projects button[aria-pressed="true"] { color: var(--text); }
.projects button[aria-pressed="true"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 1px; background: var(--accent); }
.sp { flex: 1; }
.deal { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 6px 0 18px; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--lift); font-size: var(--fs4); min-width: 0; }
.deal > span:first-child { color: var(--muted); }
.deal b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal i { font-style: normal; color: var(--accent-text); font-weight: 600; }
.deal button { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 10px; border: 0; border-radius: var(--r-s); background: var(--surface-2); color: var(--text); font-size: var(--fs5); font-weight: 600; white-space: nowrap; }
.deal button svg { width: 16px; height: 16px; }
.iconbtn { width: 52px; height: 52px; border-radius: var(--r-m); border: 0; background: var(--surface); box-shadow: var(--lift); color: var(--muted); display: grid; place-items: center; }

/* обложка проекта */
.hero { position: relative; height: 300px; border-radius: var(--r-l); overflow: hidden; margin-bottom: 20px; background: #233026; color: #fff; isolation: isolate; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transform: scale(1.03); animation: heroIn 1.2s var(--ease) both; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,14,11,.05) 20%, rgba(10,14,11,.35) 55%, rgba(10,14,11,.82) 100%); }
.hero-in { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 32px; flex-wrap: wrap; }
.hero small { display: block; font-size: var(--fs5); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.78); margin-bottom: 8px; }
.hero h1 { margin: 0; font-size: 56px; line-height: 1; font-weight: 600; letter-spacing: -.035em; }
.hero p { margin: 12px 0 0; max-width: 56ch; color: rgba(255,255,255,.85); font-size: var(--fs4); }
.hstats { display: flex; gap: 32px; margin-top: 20px; }
.hstats div b { display: block; font-size: var(--fs2); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hstats div span { font-size: var(--fs5); color: rgba(255,255,255,.75); }
.vseg { display: inline-flex; padding: 4px; border-radius: var(--r-m); background: rgba(255,255,255,.14); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.vseg button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-s); background: none; color: rgba(255,255,255,.88); font-size: var(--fs4); font-weight: 500; transition: background .25s var(--ease), color .25s; }
.vseg button[aria-pressed="true"] { background: #fff; color: #171c18; }
.vseg .ico { width: 16px; height: 16px; }

/* панель фильтров */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-bottom: 20px; }
.fbar { display: inline-flex; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--lift); overflow: hidden; }
.fbar select { height: 40px; padding: 0 34px 0 16px; border: 0; background: transparent; color: var(--text); appearance: none; font-size: var(--fs4);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 19px) 18px, calc(100% - 14px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.fbar select + select { border-left: 1px solid var(--line); }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs4); border: 0; background: none; padding: 0; min-height: 40px; }
.toggle i { position: relative; width: 40px; height: 24px; border-radius: 12px; background: var(--line-2); transition: background .25s var(--ease); }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .3s var(--ease); }
.toggle[aria-checked="true"] i { background: var(--accent); }
.toggle[aria-checked="true"] i::after { transform: translateX(16px); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: var(--fs5); margin-left: auto; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; }
.lg-free { background: var(--free); } .lg-hold { box-shadow: inset 0 0 0 2px var(--book); } .lg-book { background: var(--book); } .lg-sold { background: var(--line-2); }

/* раскладка */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 32px; align-items: start; }
.main { min-width: 0; }

/* шахматка */
.rows { display: grid; gap: 4px; }
.row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; padding: 20px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 4px; }
.row-l b { display: block; font-size: var(--fs2); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.row-l span { display: block; font-size: var(--fs5); color: var(--muted); margin-top: 4px; }
.row-l .from { font-size: var(--fs4); color: var(--text); font-weight: 500; margin-top: 12px; font-variant-numeric: tabular-nums; }
.av2 { height: 4px; border-radius: 2px; background: var(--line); margin-top: 12px; overflow: hidden; max-width: 140px; }
.av2 i { display: block; height: 100%; background: var(--free); border-radius: 2px; }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.cell { position: relative; display: grid; align-content: space-between; min-height: 84px; padding: 12px 14px; border: 0; border-radius: var(--r-m); text-align: left; background: transparent;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .2s, opacity .3s; }
.cell b { font-size: var(--fs3); font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.cell .st { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs5); color: var(--muted); }
.cell .st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cell .pr { font-size: var(--fs5); color: var(--muted); font-variant-numeric: tabular-nums; }
.cell em { position: absolute; top: -8px; right: 10px; padding: 2px 7px; border-radius: 6px; background: var(--accent); color: #fff; font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: .03em; white-space: nowrap; }
.cell.sel em { background: #fff; color: var(--accent); }
.c-free { background: var(--surface); box-shadow: var(--lift); }
.c-free .st { color: var(--free); }
.c-free:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(40,34,20,.06), 0 16px 32px -14px rgba(40,34,20,.28); }
.c-hold, .c-book { box-shadow: inset 0 0 0 1px var(--line-2); }
.c-hold { background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--book-bg) 70%, transparent) 7px 9px); }
.c-hold b, .c-book b { color: var(--muted); font-weight: 500; }
.c-hold .st, .c-book .st { color: var(--book); }
.c-hold .st::before { background: none; box-shadow: inset 0 0 0 1.5px currentColor; }
.c-sold, .c-off { background: var(--sold-bg); }
.c-sold b, .c-off b { color: var(--faint); font-weight: 400; }
.c-sold .st::before, .c-off .st::before { background: var(--line-2); }
.cell:not(.c-free):hover { box-shadow: inset 0 0 0 1px var(--muted); }
.cell.sel { background: var(--accent); box-shadow: 0 12px 28px -12px rgba(27, 67, 49, .6); transform: translateY(-2px); }
.cell.sel b, .cell.sel .st, .cell.sel .pr, .cell.sel em { color: #fff; }
.cell.sel .st::before { background: #fff; box-shadow: none; }
.cell.mine:not(.sel) { box-shadow: inset 0 0 0 2px var(--accent); }
.cell.dim { opacity: .35; }
.stag .cell { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 14ms); }

/* генплан */
.gp { position: relative; border-radius: var(--r-l); overflow: hidden; background: #1c2a20; box-shadow: var(--lift); }
.gp.tall { background: #e8e4da; }
.gpw.tall { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 28px; align-items: start; }
.gpw.tall .gp-list { grid-template-columns: 1fr; margin-top: 0; }
.gpw.tall .gp-list > b { line-height: 1.4; }
.gpw.tall .gp-cap span:first-child { display: none; }
.gp-in { position: relative; width: 100%; }
.gp-in { overflow: hidden; }
.gp-in > img { position: absolute; max-width: none; display: block; }
.gp-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 20px; align-items: start; margin-top: 20px; }
.gp-list > b { font-size: var(--fs4); font-weight: 600; line-height: 36px; }
.gp-list > div { display: flex; flex-wrap: wrap; gap: 8px; }
.gp-list button { display: inline-flex; align-items: baseline; gap: 8px; height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-s); background: var(--surface); box-shadow: var(--lift); font-size: var(--fs4); font-weight: 600; transition: transform .25s var(--ease), background .2s; }
.gp-list button span { font-size: var(--fs5); font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.gp-list button:hover { transform: translateY(-1px); }
.gp-list button[aria-pressed="true"] { background: var(--accent); color: #fff; } .gp-list button[aria-pressed="true"] span { color: rgba(255,255,255,.8); }
@media (max-width: 1180px) { .gpw.tall { grid-template-columns: minmax(0, 1fr); } .gpw.tall .gp { max-width: 420px; } }
@media (max-width: 640px) { .gp-list { grid-template-columns: 1fr; } .gp-list > b { line-height: 1.4; } }
.gp.anim .gp-in > img { animation: fadeIn .8s ease both; }
.dot { position: absolute; z-index: 1; transform: translate(-50%, -50%); width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; transition: transform .3s var(--ease), box-shadow .3s; }
.gp.anim .dot { animation: pop .5s var(--ease) both; animation-delay: calc(200ms + var(--i, 0) * 22ms); }
.dot span { pointer-events: none; }
.d-free { background: #fffdf8; color: #1b4331; box-shadow: 0 0 0 3px rgba(255,255,255,.35), 0 4px 10px rgba(0,0,0,.35); }
.d-free::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85); animation: pulse 2.6s ease-out infinite; animation-delay: calc(var(--i, 0) * 90ms); pointer-events: none; }
.d-book { background: #b87512; color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.35); }
.d-hold { background: rgba(20,16,8,.55); color: #ffd796; box-shadow: inset 0 0 0 2px #e7a64a, 0 4px 10px rgba(0,0,0,.3); }
.d-sold, .d-off { background: rgba(20,24,21,.62); color: rgba(255,255,255,.62); width: 22px; height: 22px; font-size: 10px; }
.dot:hover, .dot:focus-visible { transform: translate(-50%, -50%) scale(1.18); z-index: 3; }
.dot.sel { z-index: 2; background: var(--accent); color: #fff; width: 34px; height: 34px; font-size: 12px; box-shadow: 0 0 0 4px #fff, 0 8px 18px rgba(0,0,0,.45); }
.dot.sel::after { display: none; }
.dot.mine:not(.sel) { box-shadow: 0 0 0 3px var(--accent), 0 0 0 5px #fff; }
.dot.dim { opacity: .28; }
.tip { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translate(-50%, 4px); white-space: nowrap; padding: 6px 10px; border-radius: var(--r-s); background: rgba(16,20,17,.92); color: #fff; font-size: var(--fs5); font-weight: 500; font-style: normal; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); }
.dot:hover .tip, .dot:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }
.gp-cap { position: absolute; left: 16px; bottom: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; pointer-events: none; }
.gp-cap span { padding: 6px 10px; border-radius: var(--r-s); background: rgba(16,20,17,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: rgba(255,255,255,.9); font-size: var(--fs5); }
.gp.tall .gp-cap span { background: rgba(16,20,17,.75); }
.gp-note { display: none; }

/* карточка виллы */
.card { position: sticky; top: 20px; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--lift); overflow: hidden; max-height: calc(100vh - 40px); overflow-y: auto; scrollbar-width: thin; }
.card.in { animation: cardIn .55s var(--ease) both; }
.cbody { padding: 24px 28px 28px; display: grid; grid-auto-rows: max-content; gap: 20px; }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.card-h small { display: block; color: var(--muted); font-size: var(--fs5); letter-spacing: .12em; text-transform: uppercase; }
.card-h h2 { margin: 6px 0 0; font-size: var(--fs1); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 14px; font-size: var(--fs5); font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-free { background: var(--free-bg); color: var(--free); } .b-book { background: var(--book-bg); color: var(--book); }
.b-hold { background: var(--book-bg); color: var(--book); } .b-hold::before { background: none; box-shadow: inset 0 0 0 1.5px currentColor; }
.b-sold, .b-off { background: var(--sold-bg); color: var(--sold); }
.close { display: none; }
.media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.card.in .media img { animation: fadeIn .5s ease both; }
.media.plan img { object-fit: contain; background: #fff; padding: 16px; }
.media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 72px; background: linear-gradient(transparent, rgba(0,0,0,.35)); pointer-events: none; }
.media.plan::after { display: none; }
.mseg { position: absolute; z-index: 1; left: 16px; top: 16px; display: inline-flex; padding: 4px; border-radius: var(--r-m); background: rgba(255,255,255,.18); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.media.plan .mseg { background: rgba(23,28,24,.08); box-shadow: none; }
.mseg button { height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-s); background: none; color: #fff; font-size: var(--fs5); font-weight: 600; }
.media.plan .mseg button { color: #171c18; }
.mseg button[aria-pressed="true"] { background: #fff; color: #171c18; }
.mnav button { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); color: #171c18; display: grid; place-items: center; opacity: 0; transition: opacity .25s; }
.mnav button:first-child { left: 12px; } .mnav button:last-child { right: 12px; }
.media:hover .mnav button, .mnav button:focus-visible { opacity: 1; }
.pdots { position: absolute; z-index: 1; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; }
.pdots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.55); transition: width .3s var(--ease), background .3s; }
.pdots i.on { width: 18px; background: #fff; }
.price b { display: block; font-size: 40px; font-weight: 600; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.psub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 10px; color: var(--muted); font-size: var(--fs4); }
.yline { padding: 0; border: 0; background: none; color: var(--accent-text); font-size: var(--fs4); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--r-m); overflow: hidden; }
.specs div { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--surface); font-size: var(--fs4); min-width: 0; }
.specs .ico { color: var(--accent-text); }
.specs b { font-weight: 500; }
.specs div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.cta1 { display: grid; gap: 4px; }
.cta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-m); border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-size: var(--fs4); font-weight: 600; white-space: nowrap; transition: background .2s, transform .15s var(--ease); }
.btn.big { height: 52px; font-size: var(--fs3); }
.cta .btn { height: 52px; }
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn:active, .cell:active, .dot:active { scale: .98; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.full { grid-column: 1 / -1; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.linkbtn { justify-self: center; height: 40px; padding: 0 8px; border: 0; background: none; color: var(--accent-text); font-size: var(--fs4); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.note { font-size: var(--fs5); color: var(--muted); }
.cta1 + .note { text-align: center; margin-top: -12px; }
.status { display: grid; gap: 10px; padding: 16px 18px; border-radius: var(--r-m); background: var(--book-bg); color: var(--book); font-size: var(--fs4); }
.status.sold { background: var(--sold-bg); color: var(--sold); }
.status .row2 { display: flex; justify-content: space-between; gap: 8px; }
.status b { font-weight: 600; }
.bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.55); overflow: hidden; } .bar i { display: block; height: 100%; background: currentColor; border-radius: 2px; }
.acc { border-top: 1px solid var(--line); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary { display: flex; justify-content: space-between; align-items: center; min-height: 56px; cursor: pointer; list-style: none; font-weight: 500; font-size: var(--fs3); }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .3s var(--ease); }
.acc details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.acc details[open] .in { animation: fadeIn .35s ease both; }
.acc .in { padding: 0 0 20px; display: grid; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 16px; font-size: var(--fs4); }
.kv span { color: var(--muted); } .kv b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.kv.total { padding-top: 10px; border-top: 1px solid var(--line); } .kv.total span, .kv.total b { color: var(--text); font-weight: 600; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts button { height: 40px; padding: 0 14px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface); font-size: var(--fs5); font-weight: 500; transition: background .2s, color .2s, border-color .2s; }
.opts button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.lbl { font-size: var(--fs5); color: var(--muted); }
.yield { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.yield div { padding: 14px 16px; border-radius: var(--r-m); background: var(--accent); color: #fff; }
.yield b { display: block; font-size: var(--fs1); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; } .yield span { font-size: var(--fs5); color: rgba(255,255,255,.8); }

/* диалог */
.back { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: grid; place-items: center; padding: 16px; animation: fadeIn .25s ease both; }
.dlg { width: min(500px, 100%); max-height: calc(100% - 16px); overflow: auto; background: var(--surface); border-radius: var(--r-l); padding: 28px; display: grid; grid-auto-rows: max-content; gap: 18px; animation: cardIn .45s var(--ease) both; }
.dlg h3 { margin: 0; font-size: var(--fs2); font-weight: 600; letter-spacing: -.01em; }
.dlg .sub { color: var(--muted); font-size: var(--fs4); margin-top: 4px; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg2 button { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--surface); }
.seg2 button b { font-weight: 600; } .seg2 button span { font-size: var(--fs5); color: var(--muted); }
.seg2 button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs4); }
.chk input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.will { padding: 16px; border-radius: var(--r-m); background: var(--surface-2); display: grid; gap: 8px; font-size: var(--fs4); }
.toast { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80; padding: 12px 20px; border-radius: 24px; background: var(--text); color: var(--surface); font-size: var(--fs4); max-width: calc(100% - 32px); animation: rise .4s var(--ease) both; }

/* демо-переключатель: плавающая пилюля, в продукте её нет */
.demo { position: fixed; z-index: 40; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 14px; border-radius: 16px; background: rgba(23,28,24,.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: rgba(255,255,255,.65); font-size: var(--fs5); box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); max-width: calc(100% - 24px); }
.demo .opts { flex-wrap: nowrap; gap: 2px; }
.demo .opts button { height: 36px; min-height: 0; border: 0; background: none; color: rgba(255,255,255,.8); border-radius: 12px; white-space: nowrap; }
.demo .opts button[aria-pressed="true"] { background: #fff; color: #171c18; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes heroIn { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: scale(1.03); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) { .layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; } .row { grid-template-columns: 150px minmax(0, 1fr); } .hero h1 { font-size: 48px; } }
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .card { position: fixed; inset: auto 0 0 0; top: auto; z-index: 50; max-height: 92%; border-radius: var(--r-l) var(--r-l) 0 0; animation: sheetIn .45s var(--ease) both; }
  .card.in { animation: sheetIn .45s var(--ease) both; }
  .cbody { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
  .card.closed { display: none; }
  .close { display: grid; position: absolute; z-index: 2; right: 16px; top: 16px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: #171c18; place-items: center; }
  .scrim { position: fixed; inset: 0; z-index: 45; background: var(--scrim); animation: fadeIn .25s ease both; }
  .legend { margin-left: 0; }
  .mnav button { opacity: 1; }
}
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-top: 12px; }
  .head { gap: 8px 12px; margin-bottom: 16px; }
  .projects { order: 5; width: 100%; overflow-x: auto; }
  #projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  #projects button { flex-direction: column; align-items: center; justify-content: center; gap: 0; height: 48px; padding: 0 4px; min-width: 0; }
  #projects button::after { left: 25%; right: 25%; }
  .deal { order: 6; width: 100%; justify-content: space-between; }
  .iconbtn { width: 44px; height: 44px; }
  .hero { height: 360px; }
  .hero-in { padding: 20px; gap: 16px; }
  .hero h1 { font-size: 40px; }
  .hero p { display: none; }
  .hstats { gap: 20px; margin-top: 14px; }
  .fbar { width: 100%; } .fbar select { flex: 1; min-width: 0; padding-left: 12px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px 0; }
  .row-l { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
  .row-l b { font-size: var(--fs3); width: 100%; } .row-l span, .row-l .from { margin-top: 0; } .av2 { display: none; }
  .cells { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cell { min-height: 72px; padding: 10px 12px; }
  .cell em { right: 6px; padding: 1px 5px; font-size: 9px; }
  .gp:not(.tall) { overflow-x: auto; scrollbar-width: none; } .gp:not(.tall) .gp-in { width: 760px; }
  .gp-cap { display: none; } .gp-note { display: block; margin: 10px 0 0; font-size: var(--fs5); color: var(--muted); }
  .dot { width: 26px; height: 26px; font-size: 10px; } .d-sold, .d-off { width: 18px; height: 18px; font-size: 0; }
  .gpw.tall .dot { width: 22px; height: 22px; font-size: 9px; }
  .gp-list > div { display: grid; grid-template-columns: 1fr 1fr; } .gp-list button { justify-content: space-between; }
  .tip { display: none; }
  .cbody { padding: 20px 20px 28px; }
  .price b { font-size: 34px; }
  .demo { padding: 3px; } .demo > span { display: none; } .demo .opts button { padding: 0 10px; font-size: 11px; }
}
@media (pointer: coarse) { .opts button, .mseg button, .deal button { min-height: 40px; } }

/* роли: руководитель и кабинет агента */
.title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin: 12px 0 28px; }
.title h1 { margin: 0; font-size: var(--fs0); line-height: 1.05; font-weight: 600; letter-spacing: -.03em; }
.title p { margin: 10px 0 0; color: var(--muted); font-size: var(--fs4); }
.h2 { margin: 0 0 16px; font-size: var(--fs2); font-weight: 600; letter-spacing: -.01em; }
.strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); box-shadow: var(--lift); border-radius: var(--r-l); margin-bottom: 32px; overflow: hidden; }
.strip div { padding: 20px 24px; min-width: 0; }
.strip div + div { border-left: 1px solid var(--line); }
.strip b { display: block; font-size: var(--fs1); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.strip span { font-size: var(--fs5); color: var(--muted); }
.strip .warn { background: var(--book-bg); } .strip .warn b, .strip .warn span { color: var(--book); }
.panel { background: var(--surface); box-shadow: var(--lift); border-radius: var(--r-l); padding: 24px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.tbl-wrap { overflow-x: auto; margin: 0 -24px -24px; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs4); font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: var(--fs5); font-weight: 500; color: var(--muted); padding: 8px 24px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 14px 24px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl tr[data-go], .tbl tr[data-golot] { cursor: pointer; } .tbl tr[data-go]:hover td, .tbl tr[data-golot]:hover td { background: var(--surface-2); }
.tbl tr[data-go] td:last-child, .tbl tr[data-golot] td:last-child { position: relative; padding-right: 44px; }
.tbl tr[data-go] td:last-child::after, .tbl tr[data-golot] td:last-child::after { content: "›"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 20px; line-height: 1; color: var(--muted); }
.mut { color: var(--muted); }
.avail { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); min-width: 96px; }
.avail i { display: block; height: 100%; } .avail .f { background: var(--free); } .avail .b { background: var(--book); }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: var(--fs5); font-weight: 600; white-space: nowrap; }
.p-free { background: var(--free-bg); color: var(--free); } .p-book { background: var(--book-bg); color: var(--book); } .p-hold { background: repeating-linear-gradient(135deg, var(--book-bg) 0 6px, color-mix(in srgb, var(--book-bg) 55%, var(--surface)) 6px 10px); color: var(--book); } .p-sold { background: var(--sold-bg); color: var(--sold); }
.p-urgent { background: #f6dcdc; color: #9b2c2c; }
:root[data-theme="dark"] .p-urgent { background: #3d1f20; color: #f2a6a6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .p-urgent { background: #3d1f20; color: #f2a6a6; } }
.list { display: grid; }
.li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.li:first-child { padding-top: 0; } .li:last-child { border-bottom: 0; padding-bottom: 0; }
.li b { display: block; font-weight: 600; } .li small { display: block; color: var(--muted); font-size: var(--fs5); }
.av { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; font-size: var(--fs5); font-weight: 600; color: var(--accent-text); }
.li-r { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.btn.sm { height: 40px; font-size: var(--fs5); }
.tl { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 16px 0 8px; }
.tl div { display: grid; gap: 8px; font-size: var(--fs5); color: var(--faint); }
.tl i { height: 4px; border-radius: 2px; background: var(--line); }
.tl .done i { background: var(--accent); } .tl .now i { background: var(--book); } .tl .done, .tl .now { color: var(--text); }
.deal-h { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.deal-h img { width: 72px; height: 54px; border-radius: var(--r-s); object-fit: cover; display: block; }
.deal-h b { display: block; font-weight: 600; } .deal-h small { color: var(--muted); font-size: var(--fs5); }
.chat { display: grid; gap: 8px; margin-top: 16px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: var(--r-m); background: var(--surface-2); font-size: var(--fs4); }
.msg small { display: block; font-size: var(--fs5); color: var(--muted); }
.msg.me { justify-self: end; background: var(--accent); color: var(--on-accent); } .msg.me small { color: rgba(255,255,255,.7); }
.chat-in { display: flex; gap: 8px; } .chat-in input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--surface); }
.comm { display: flex; justify-content: space-between; gap: 8px; padding: 12px 16px; border-radius: var(--r-m); background: var(--surface-2); font-size: var(--fs4); }
.comm b { font-variant-numeric: tabular-nums; }
.field { display: grid; gap: 8px; font-size: var(--fs5); color: var(--muted); }
.field input, .field select { height: 44px; padding: 0 12px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: var(--fs4); }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.res { display: grid; gap: 8px; padding: 16px; border-radius: var(--r-m); font-size: var(--fs4); }
.res.ok { background: var(--free-bg); color: var(--free); } .res.bad { background: #f6dcdc; color: #9b2c2c; }
.res b { font-size: var(--fs3); }
.hint { font-size: var(--fs5); color: var(--muted); padding: 8px 12px; border: 1px dashed var(--line-2); border-radius: var(--r-s); }
.pick { display: grid; gap: 8px; }
.pick button { display: flex; justify-content: space-between; gap: 8px; padding: 12px 16px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--surface); text-align: left; }
.pick button span { color: var(--muted); font-size: var(--fs5); }
.pick button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
@media (max-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1fr); } .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .strip div:nth-child(odd) { border-left: 0; } .strip div:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 640px) { .title h1 { font-size: 32px; } .tl div span { display: none; } .li { grid-template-columns: 40px minmax(0, 1fr); } .li-r { grid-column: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; } .f2 { grid-template-columns: 1fr; } .hide-sm { display: none; } .panel { padding: 16px; } .tbl-wrap { margin: 0 -16px -16px; } .tbl th, .tbl td { padding-left: 16px; padding-right: 16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
