[hidden] { display: none !important; }
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.rail { background: #000; border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brandmark { display: flex; gap: 10px; align-items: center; color: var(--ink); }
.brandmark { text-decoration: none; }
.brandmark b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -0.03em; }
.brandmark span { display: block; font-size: 12px; color: var(--ink-3); }
.wide { width: 100%; justify-content: center; }
.rail-h { margin-top: 8px; color: var(--ink-2); font-size: 12.5px; }
.projects { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.projects button { all: unset; display: block; width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; }
.projects button:hover { background: var(--surface-2); }
.projects button:focus-visible { outline: 2px solid var(--accent); }
.projects button.active { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.projects b { display: block; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projects span { display: block; font-size: 11.5px; opacity: .65; }

.main { padding: 40px 40px 80px; max-width: 1320px; width: 100%; }
.page-h { margin-bottom: 32px; }
.page-h h1 { font-size: 40px; font-weight: 450; letter-spacing: -0.06em; line-height: 1.05; }
.page-h p { margin: 12px 0 0; max-width: 60ch; font-size: 16px; }
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { padding: 22px 24px; }
.step-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.num { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--ink-2); display: grid; place-items: center; font: 500 12px var(--mono); }
.step-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.choice { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background-color .15s, transform .18s var(--ease); }
.choice:hover { border-color: var(--line-2); background: var(--surface-3); }
.choice:active { transform: scale(.985); }
.choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice[aria-pressed="true"] { border-color: var(--ink); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--ink); }
.choice svg { width: 64px; height: 48px; }
.choice b { display: block; font-weight: 500; font-size: 13.5px; line-height: 1.3; }
.choice small { display: block; color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.choice .badge { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--warn); }
.tpl-logo { width: 64px; height: 48px; border-radius: 6px; background: var(--surface-3); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 11px; text-align: center; line-height: 1.1; padding: 4px; }
.empty { color: var(--ink-3); padding: 8px 2px; }

.run-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.summary { color: var(--ink-2); }
.summary b { color: var(--ink); }
.run-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.res-h { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.res-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.progress { padding: 14px 18px; margin-bottom: 14px; }
.progress ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.progress li { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.progress li.done { color: var(--ok); }
.progress li.now { color: var(--ink); }
.progress li.now::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .progress li.now::before { animation: none; } }
.log { margin: 10px 0 0; max-height: 120px; overflow: auto; font: 11.5px/1.5 var(--mono); color: var(--ink-2); white-space: pre-wrap; }

.hero { overflow: hidden; position: relative; aspect-ratio: 16 / 9; background: #050505; }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.hero-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 10px 0 18px; }
.thumbs button { all: unset; cursor: zoom-in; border-radius: var(--r-sm); overflow: hidden; position: relative; aspect-ratio: 16 / 9; background: #050505; box-shadow: inset 0 0 0 1px var(--line); }
.thumbs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.thumbs button:hover img { transform: scale(1.03); }
.thumbs span { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, .72); color: #fff; font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 4px; }

.cols { display: grid; grid-template-columns: 1fr 320px; gap: 14px; margin-bottom: 14px; }
.block { padding: 16px 18px; }
.block-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.plan-wrap { overflow: auto; background: #000; border-radius: var(--r-sm); }
.plan-wrap img { display: block; width: 100%; height: auto; filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(1.05); }
.side h2 { margin-bottom: 12px; }
.metrics { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; margin: 0 0 14px; }
.metrics dt { color: var(--ink-2); }
.metrics dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.metrics .total dt, .metrics .total dd { font-size: 18px; color: var(--ink); font-weight: 500; letter-spacing: -0.03em; padding-top: 6px; border-top: 1px solid var(--line); }
.warn-box { border-left: 2px solid var(--warn); background: rgba(245, 165, 36, .08); color: var(--ink-2); padding: 8px 10px; border-radius: 0 6px 6px 0; font-size: 12.5px; margin-top: 6px; }

table.est { width: 100%; border-collapse: collapse; font-size: 13px; }
table.est td, table.est th { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.est th { color: var(--ink-3); font-weight: 500; font-size: 12px; }
table.est .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.est tr.sec td { background: var(--surface-2); font-weight: 500; }
table.est tr.tot td { font-weight: 500; font-size: 17px; letter-spacing: -0.02em; border-top: 1px solid var(--ink-2); border-bottom: 0; }

dialog { border: 1px solid var(--line); padding: 0; max-width: 96vw; background: #000; border-radius: 12px; }
dialog img { display: block; max-width: 96vw; max-height: 88vh; }
dialog .btn { position: absolute; top: 10px; right: 10px; }
dialog::backdrop { background: rgba(0, 0, 0, .85); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: 18px 16px 40px; }
  .cols { grid-template-columns: 1fr; }
  .thumbs { grid-template-columns: 1fr 1fr; }
}

.offline { margin-bottom: 18px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--ink-2); }
.offline b { color: var(--ink); font-weight: 500; }
.block h2, .step-h h2 { font-weight: 500; }

/* справочник подрядчиков */
.sup-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.sup-tabs button { all: unset; cursor: pointer; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; transition: color .15s, background-color .15s; }
.sup-tabs button:hover { color: var(--ink); }
.sup-tabs button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sup-tabs button:active { transform: scale(.97); }
.sup-tabs button[aria-selected="true"] { background: #ededed; color: #0a0a0a; border-color: #ededed; }
.sup-tabs .n { font: 500 11.5px var(--mono); opacity: .7; }
.sup-list { display: grid; gap: 8px; }
.sup-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.sup-card b { font-weight: 500; font-size: 15px; }
.sup-card .meta { color: var(--ink-2); font-size: 13px; }
.sup-card .note { grid-column: 1 / -1; color: var(--ink-3); font-size: 13px; }
.sup-card a { color: var(--ink); }
.sup-form { display: grid; gap: 10px; }
.sup-form label { display: grid; gap: 5px; }
.sup-form textarea { height: auto; padding: 8px 10px; resize: vertical; }
.sup-match { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 12px; }
.sup-col { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; display: grid; gap: 8px; align-content: start; }
.sup-col h3 { font-size: 14px; font-weight: 500; }
.sup-col .rows { color: var(--ink-3); font-size: 12.5px; display: grid; gap: 2px; }
.sup-col .rows span { display: flex; justify-content: space-between; gap: 8px; }
.sup-col .c { padding-top: 8px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; }
.sup-col .c div { display: grid; }
.sup-col .c small { color: var(--ink-3); }
.sup-col .rows i { font-style: normal; }
.sup-col .rows b { white-space: nowrap; font-weight: 500; color: var(--ink-2); }

/* поиск помещений */
.find-bar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding: 16px 18px; }
.find-bar label { display: grid; gap: 5px; }
.find-bar .pair { display: flex; gap: 6px; }
.find-bar .pair input { width: 78px; }
.find-bar input[name="priceMax"] { width: 130px; }
.find-bar .chk { display: flex; align-items: center; gap: 8px; height: 34px; font-size: 13px; color: var(--ink); cursor: pointer; }
.find-bar .chk input { width: 16px; height: 16px; accent-color: #ededed; margin: 0; }
.find-bar .btn.primary { margin-left: auto; }
.find-req { margin: 12px 2px 0; max-width: 110ch; }
.find-status { margin: 14px 2px; color: var(--ink-2); font-size: 13px; display: flex; align-items: center; gap: 8px; min-height: 20px; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.find-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lst { display: grid; grid-template-columns: 220px 1fr 380px; gap: 18px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.lst .ph { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-3); color: var(--ink-3); }
.lst .ph span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; }
.lst .ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.lst .ph:hover img { transform: scale(1.03); }
.lst .ph em { position: absolute; left: 6px; bottom: 6px; font-style: normal; font-size: 11.5px; background: rgba(0, 0, 0, .72); color: #fff; padding: 2px 7px; border-radius: 4px; }
.lst .info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lst h3 { font-size: 16px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; }
.lst .metro { margin: -4px 0 0; color: var(--ink-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.lst .metro i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); justify-content: start; gap: 8px 28px; margin: 2px 0 0; }
.facts dt { color: var(--ink-3); font-size: 12px; }
.facts dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.facts small { display: block; color: var(--ink-3); font-weight: 400; font-size: 11.5px; }
.lst .fmt { margin: 0; color: var(--ink-2); font-size: 12.5px; }
.lst .desc { margin: 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 75ch; }
.lst .act, .approx .act { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; padding-top: 4px; }
.fit { --c: var(--warn); border-left: 1px solid var(--line); padding-left: 18px; display: grid; gap: 6px; align-content: start; }
.fit.ok { --c: var(--ok); } .fit.bad { --c: var(--err); }
.fit .score { display: flex; align-items: baseline; gap: 6px; }
.fit .score b { font-size: 34px; font-weight: 450; letter-spacing: -0.05em; line-height: 1; color: var(--c); font-variant-numeric: tabular-nums; }
.fit .score span { color: var(--ink-3); font-size: 12px; }
.fit .verdict { margin: 0; font-weight: 500; }
.fit .bar { height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.fit .bar i { display: block; height: 100%; background: var(--c); }
.checks { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 5px; font-size: 12.5px; }
.checks li { position: relative; padding-left: 15px; color: var(--ink-2); line-height: 1.45; }
.checks li::before { content: ''; position: absolute; left: 0; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.checks li.ok::before { background: var(--ok); }
.checks li.warn::before { background: var(--warn); }
.checks li.bad::before { background: var(--err); }
.checks li.unknown::before { background: transparent; box-shadow: inset 0 0 0 1px var(--ink-3); }
.checks b { font-weight: 500; color: var(--ink); margin-right: 6px; }
.find-more { display: flex; justify-content: center; margin-top: 14px; }
.approx { display: grid; grid-template-columns: 1fr auto; gap: 18px; padding: 16px 18px; margin-bottom: 14px; border-color: rgba(245, 165, 36, .35); }
.approx h2 { color: var(--warn); margin-bottom: 6px; }
.approx p { margin: 0 0 6px; color: var(--ink-2); max-width: 90ch; }
.approx-plan { display: grid; gap: 4px; width: 200px; color: var(--ink-3); font-size: 12px; text-decoration: none; }
.approx-plan img { width: 200px; height: 140px; object-fit: contain; background: #fff; border-radius: var(--r-sm); }
@media (max-width: 1100px) { .lst { grid-template-columns: 180px 1fr; } .fit { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; } }
@media (max-width: 640px) {
  .lst { grid-template-columns: 1fr; } .find-bar .btn.primary { margin-left: 0; width: 100%; }
  .approx { grid-template-columns: 1fr; } .approx-plan, .approx-plan img { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
@media (max-width: 640px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
