/* Новый вид Alegria · Контракты (решение владельца 2026-11-12): меню слева и два стиля — Costa (светлый) и Noche (тёмный).
   Включается атрибутом <html data-shell> (view.js); без него программа выглядит как раньше (app.css + styles.css).
   Правила: сначала устройство экрана, потом краски; цвет только для смысла (красный = просрочено и «нет оплаты»,
   оранжевый = фирменный и главное действие); анимации короткие; шрифты только системные, ничего не скачивается.
   Обоснование: docs/ИССЛЕДОВАНИЕ_ИНТЕРФЕЙСА.md, макет: design/redesign2.html. */

/* запасные значения, чтобы поиск (Ctrl+K) работал и в прежнем виде */
:root { --hover: var(--orange-soft); --line-strong: var(--input-line); --side: var(--card); --title: var(--font); --shadow: 0 12px 32px -12px rgba(0, 0, 0, .3); --ease: cubic-bezier(.2, .8, .2, 1); }
.sh-menu { display: none; }

/* ───────── общее для нового вида ───────── */
:root[data-shell] {
  --side-w: 15rem; --radius: 6px; --line-w: 1px; --rowpad: .625rem;
  /* текст — спокойный Segoe; заголовки, подписи и цифры — Bahnschrift (как на дорожных указателях): простой, но узнаваемый */
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --title: Bahnschrift, "DIN Alternate", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
}
:root[data-shell][data-size="l"] { font-size: 17px; }
:root[data-shell][data-size="xl"] { font-size: 19px; }
:root[data-shell][data-density="dense"] { font-size: 13.5px; --rowpad: .375rem; }
:root[data-shell][data-density="dense"][data-size="l"] { font-size: 15px; }
:root[data-shell][data-density="dense"][data-size="xl"] { font-size: 17px; }

/* ───────── Costa: светлый тёплый ───────── */
:root[data-shell][data-style="costa"] {
  --bg: #FAF8F5; --card: #FFFFFF; --side: #F4F0EA; --hover: #F1ECE4;
  --text: #1F1B16; --muted: #6A6258; --faint: #857C70; --placeholder: #A39A8E;
  --line: #E7E0D6; --line-soft: #F0EBE3; --line-strong: #D5CCBF; --input-bg: #FFFFFF; --input-line: #D5CCBF;
  --orange: #E8631A; --orange-text: #B9480F; --orange-dark: #CF5412; --orange-soft: #FBEEE4; --orange-line: #F0CDB4; --on-orange: #FFFFFF;
  --bar-bg: rgba(255, 255, 255, .96); --photo-bg: #F7F3EE;
  --red: #B42318; --red-soft: #FDECEA; --red-line: #F3C4BE;
  --yellow: #8A5B00; --yellow-soft: #FFF4D6; --yellow-line: #EDD9A0;
  --green: #2F7D4F; --green-soft: #E8F4EC; --green-line: #BFDFCB;
  --shadow: 0 12px 32px -12px rgba(60, 40, 20, .28);
  color-scheme: light;
}
/* ───────── Noche: тёмный спокойный, без свечения ───────── */
:root[data-shell][data-style="noche"] {
  --bg: #0F1113; --card: #15181B; --side: #0B0D0E; --hover: #1D2226;
  --text: #E4E7EA; --muted: #98A0A8; --faint: #7A838B; --placeholder: #5F676F;
  --line: #23282D; --line-soft: #1C2024; --line-strong: #343B42; --input-bg: #101315; --input-line: #343B42;
  --orange: #E8631A; --orange-text: #F59A62; --orange-dark: #F0742C; --orange-soft: #2A1D14; --orange-line: #5A371F; --on-orange: #FFFFFF;
  --bar-bg: rgba(21, 24, 27, .96); --photo-bg: #1B1F23;
  --red: #F0685C; --red-soft: #2A1513; --red-line: #5C2A25;
  --yellow: #D9A53B; --yellow-soft: #2A2210; --yellow-line: #54431A;
  --green: #57B77E; --green-soft: #12261A; --green-line: #24523A;
  --shadow: 0 16px 40px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

:root[data-shell] body { padding-left: var(--side-w); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; transition: background-color .2s, color .2s; }
:root[data-shell] a:focus-visible, :root[data-shell] button:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
svg.i { width: 1.0625rem; height: 1.0625rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
kbd { font: .6875rem Consolas, "Cascadia Mono", monospace; color: var(--faint); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 .3rem; white-space: nowrap; }

/* ───────── меню слева ───────── */
:root[data-shell] .top {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); z-index: 30; min-height: 0;
  display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: .75rem .5rem .5rem;
  background: var(--side); border: 0; border-right: 1px solid var(--line);
}
:root[data-shell] .top > .logo, :root[data-shell] .top > .sections { display: none; }
:root[data-shell] .sh-menu { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; padding: 0 .125rem; margin: 0 -.125rem; }
.sh-brand { display: flex; align-items: center; gap: .5rem; padding: .125rem .375rem .75rem; text-decoration: none; color: var(--text); border-radius: var(--radius); }
.sh-sun { width: 1.875rem; height: 1.875rem; flex: none; transition: transform .7s var(--ease); }
.sh-brand:hover .sh-sun { transform: rotate(40deg); }
.sh-brand b { font: 600 1.1875rem/1 var(--title); letter-spacing: .02em; }
/* прикол: 10 быстрых нажатий на солнце (sunfun.js) — заставка «Рассвет» или «Волна», оформление — в app.css (.ld-splash) */
.sh-find {
  display: flex; align-items: center; gap: .5rem; width: 100%; height: 2.125rem; padding: 0 .5rem; margin-bottom: .125rem; flex: none;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--muted);
  font: inherit; font-size: .875rem; text-align: left; cursor: pointer; transition: border-color .12s, color .12s;
}
.sh-find span { flex: 1; }
.sh-find:hover { border-color: var(--line-strong); color: var(--text); }
.sh-nav { display: flex; flex-direction: column; gap: 1px; }
.sh-grp { font: 600 .6875rem/1.2 var(--title); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 1rem .5rem .3125rem; }
.sh-it {
  position: relative; display: flex; align-items: center; gap: .5625rem; height: 2.125rem; padding: 0 .5rem; flex: none;
  border-radius: var(--radius); color: var(--muted); text-decoration: none; font-size: .9375rem; white-space: nowrap;
  transition: background-color .12s, color .12s;
}
.sh-it:hover { background: var(--hover); color: var(--text); }
.sh-it.on { background: var(--hover); color: var(--text); font-weight: 600; }
.sh-it::before { content: ""; position: absolute; left: -.5rem; top: .4375rem; bottom: .4375rem; width: 3px; border-radius: 0 2px 2px 0; background: var(--orange); transform: scaleY(0); transition: transform .18s var(--ease); }
.sh-it.on::before { transform: scaleY(1); }
.sh-it.on svg { color: var(--orange-text); }
.sh-c { margin-left: auto; font-style: normal; font-size: .75rem; font-weight: 500; color: var(--faint); }
.sh-c.alert { color: var(--red); font-weight: 700; }
.sh-c[hidden] { display: none; }

/* низ меню: кто вошёл и «Вид» */
:root[data-shell] .top-actions { margin: .5rem 0 0; padding: .5rem .25rem 0; border-top: 1px solid var(--line); gap: .375rem; flex-wrap: wrap; flex: none; }
:root[data-shell] .me-chip { flex: 1 1 auto; margin: 0; min-width: 0; font-size: .875rem; }
:root[data-shell] .me-chip #me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root[data-shell] .me-chip .link { font-size: .75rem; color: var(--faint); }
:root[data-shell] #btn-view { padding: .25rem .625rem; font-size: .8125rem; font-weight: 500; color: var(--muted); border-color: var(--line); background: none; }
:root[data-shell] #btn-view:hover { background: var(--hover); color: var(--text); }
:root[data-shell] .view-panel { left: 0; right: auto; top: auto; bottom: calc(100% + .5rem); max-height: calc(100vh - 5rem); overflow-y: auto; box-shadow: var(--shadow); border-radius: 8px; }
:root[data-shell] .view-panel h3 { color: var(--muted); font-family: var(--title); }
:root[data-shell] .font-sample { background: var(--hover); }

/* «Вид»: образцы новых стилей и блок прежнего вида (есть в любом стиле) */
.view-panel #view-style { grid-template-columns: repeat(3, 1fr); }
.sw-costa { background: linear-gradient(135deg, #FAF8F5 45%, #E8631A 46%); }
.sw-noche { background: linear-gradient(135deg, #0F1113 45%, #E8631A 46%); }
.view-legacy { margin: 0 0 16px; border-top: var(--line-w) solid var(--line-soft); padding-top: 10px; }
.view-legacy summary { cursor: pointer; font-size: .875rem; font-weight: 600; color: var(--muted); padding: 2px 0 10px; }
.view-legacy .field:last-child { margin-bottom: 0; }

/* ───────── заголовок страницы: название, вкладки, главное действие ───────── */
:root[data-shell] .subnav {
  position: sticky; top: 0; z-index: 8; max-width: none; margin: 0; padding: 0 1.5rem; min-height: 3.25rem; gap: 0 1.5rem;
  background: var(--bg); border-bottom: 1px solid var(--line); transition: box-shadow .2s;
}
:root[data-shell] body.sh-scrolled .subnav { box-shadow: 0 6px 14px -12px rgba(0, 0, 0, .5); }
:root[data-shell] .subnav .top-title { font: 600 1.1875rem/1.2 var(--title); letter-spacing: .01em; padding: .875rem 0; }
:root[data-shell] .subnav .top-title span { font: 400 .875rem/1.2 var(--font); letter-spacing: 0; color: var(--muted); }
:root[data-shell] .subnav .tabs { align-self: stretch; gap: 1.375rem; margin: 0; min-height: 2.5rem; }
:root[data-shell] .tab {
  position: relative; display: flex; align-items: center; padding: 0 .0625rem; border-radius: 0; background: none;
  color: var(--muted); font-weight: 500; font-size: .9375rem; white-space: nowrap; transition: color .12s;
}
:root[data-shell] .tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--orange); transform: scaleX(0); transition: transform .18s var(--ease); }
:root[data-shell] .tab:hover { background: none; color: var(--text); }
:root[data-shell] .tab.active { background: none; color: var(--text); font-weight: 600; box-shadow: none; }
:root[data-shell] .tab.active::after { transform: scaleX(1); }
:root[data-shell] .sub-actions { padding: .5rem 0; gap: .5rem; }
:root[data-shell] .sub-actions .btn { padding: .375rem .75rem; font-size: .875rem; }
/* вкладки, которые в новом виде стали пунктами меню слева */
:root[data-shell] .subnav .tabs[data-sec="home"], :root[data-shell] .subnav .tabs[data-sec="tasks"], :root[data-shell] .subnav .tabs[data-sec="obj"],
:root[data-shell] #tab-offeedback, :root[data-shell] body[data-view="offeedback"] .subnav .tabs[data-sec="office"],
:root[data-shell] #tab-acccash, :root[data-shell] body[data-view="acccash"] .subnav .tabs[data-sec="acc"],
:root[data-shell] #tab-links, :root[data-shell] body[data-view="links"] .subnav .tabs[data-sec="office"],
:root[data-shell] body[data-view="acccash"] #btn-acc-refresh { display: none !important; }
:root[data-shell] .tk-remind { margin: .75rem 1.5rem 0; width: auto; max-width: 81rem; border-radius: var(--radius); padding: .5rem .875rem; }

/* ───────── страницы ───────── */
:root[data-shell] .deals-view { max-width: 84rem; margin: 0; padding: 1.25rem 1.5rem 4rem; }
:root[data-shell] .layout { max-width: 92rem; margin: 0; padding: 1.25rem 1.5rem 4rem; gap: 1.25rem; }
:root[data-shell] .side, :root[data-shell] .steps { top: 4.5rem; }
:root[data-shell] main:not([hidden]) { animation: sh-in .18s ease-out; }
@keyframes sh-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
:root[data-shell] .bar { left: var(--side-w); padding: .625rem 1rem; box-shadow: none; }
:root[data-shell] .bar .btn.primary { padding: .5625rem 1.75rem; }

:root[data-shell] .card { border-radius: var(--radius); padding: 1rem 1.125rem 1.125rem; margin-bottom: .875rem; }
:root[data-shell] .card h2 { font: 600 .75rem/1.3 var(--title); letter-spacing: .08em; color: var(--muted); margin-bottom: .75rem; }
:root[data-shell] .card h2 .count { font-family: var(--font); font-weight: 400; color: var(--faint); }
:root[data-shell] h3, :root[data-shell] .dlg-title, :root[data-shell] .hm-hi, :root[data-shell] .cal-title { font-family: var(--title); font-weight: 600; letter-spacing: .01em; }

/* кнопки: оранжевая — только главное действие, остальные спокойные */
:root[data-shell] .btn {
  font-size: .9375rem; font-weight: 600; padding: .5rem .875rem; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--card); color: var(--text);
  transition: background-color .12s, border-color .12s, color .12s, transform .08s;
}
:root[data-shell] .btn:active { transform: translateY(1px); }
:root[data-shell] .btn.ghost { color: var(--text); }
:root[data-shell] .btn.ghost:hover { background: var(--hover); }
:root[data-shell] .btn.primary { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
:root[data-shell] .btn.primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
:root[data-shell] .btn.primary.danger { background: var(--red); border-color: var(--red); color: #fff; }
:root[data-shell] .btn.small { padding: .3125rem .625rem; font-size: .8125rem; }
:root[data-shell] .with-btn .btn { padding: 0 .875rem; }
:root[data-shell] .link { text-underline-offset: 2px; }

/* поля */
:root[data-shell] .field { font-weight: 500; font-size: .8125rem; }
:root[data-shell] .field input:not([type=radio]):not([type=checkbox]), :root[data-shell] .field select, :root[data-shell] .field textarea,
:root[data-shell] .search, :root[data-shell] .inline .day, :root[data-shell] .item-row input, :root[data-shell] .item-row select {
  font-size: 1rem; padding: .5rem .625rem; border-radius: var(--radius); border-color: var(--line-strong); transition: border-color .12s;
}
:root[data-shell] .field input:hover, :root[data-shell] .field select:hover, :root[data-shell] .search:hover { border-color: var(--faint); }
:root[data-shell] .search { margin-bottom: .75rem; }
:root[data-shell] .th-filters .search { margin-bottom: 0; }
:root[data-shell] .fl-filters2 select, :root[data-shell] .th-st { border-radius: var(--radius); border-color: var(--line-strong); padding: .3125rem .5rem; }
:root[data-shell] .words { border-radius: var(--radius); padding: .5rem .625rem; min-height: 2.25rem; background: var(--hover); }
:root[data-shell] .words:empty { background: transparent; }

/* переключатели: выбранное — мягкий оранжевый, без заливки во всю силу */
:root[data-shell] .seg { border-radius: var(--radius); border-color: var(--line-strong); background: var(--input-bg); padding: 2px; gap: 2px; overflow: visible; }
:root[data-shell] .seg span { padding: .375rem .75rem; font-size: .9375rem; border: 0; border-radius: 4px; background: none; color: var(--muted); transition: background-color .12s, color .12s; }
:root[data-shell] .seg label:hover span { color: var(--text); }
:root[data-shell] .seg input:checked + span { background: var(--orange-soft); color: var(--orange-text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--orange-line); }
:root[data-shell] .view-panel .seg { padding: 0; border: 0; background: none; gap: 6px; }
:root[data-shell] .view-panel .seg span, :root[data-shell] .view-panel .seg label:last-child span { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .4375rem .5rem; }
:root[data-shell] .view-panel .seg input:checked + span { border-color: var(--orange); box-shadow: none; }
:root[data-shell] .chips span { padding: .5rem .75rem; border-radius: var(--radius); border-color: var(--line-strong); font-size: .9375rem; transition: border-color .12s, background-color .12s; }
:root[data-shell] .chips input:checked + span { background: var(--orange-soft); border-color: var(--orange); color: var(--orange-text); font-weight: 600; }
:root[data-shell] .chip-btn { border-radius: var(--radius); font-weight: 600; border-color: var(--line-strong); }
:root[data-shell] .chip-btn.on { background: var(--orange-soft); border-color: var(--orange); color: var(--orange-text); }

/* списки: строки таблицы, наведение серым, шапка столбцов мелкими прописными */
:root[data-shell] .deal-row { padding: var(--rowpad) .5rem; border-top-color: var(--line); border-radius: 0; transition: background-color .1s; }
:root[data-shell] .deal-head { font: 600 .6875rem/1.3 var(--title); letter-spacing: .08em; color: var(--faint); padding-top: .75rem; padding-bottom: .375rem; }
:root[data-shell] .deal-row.fl-row:not(.deal-head):hover, :root[data-shell] .deal-row.fl-row:focus-visible,
:root[data-shell] .deal-row.am-row:not(.deal-head):hover, :root[data-shell] .deal-row.am-row:focus-visible,
:root[data-shell] .deal-row.pl-row:not(.deal-head):hover, :root[data-shell] .deal-row.pl-row:focus-visible,
:root[data-shell] button.fp-item:hover, :root[data-shell] button.fp-item:focus-visible,
:root[data-shell] .tk-item.open > .tk-line, :root[data-shell] .tk-line:hover,
:root[data-shell] .obj-item:hover, :root[data-shell] .obj-item.active, :root[data-shell] .fp-menu button:hover, :root[data-shell] .step:hover { background: var(--hover); }
:root[data-shell] .fp-item { padding: var(--rowpad) .375rem; border-radius: 0; border-top-color: var(--line); }
:root[data-shell] .tk-line { padding: var(--rowpad) .25rem; border-radius: 0; }
:root[data-shell] .tk-item { border-top-color: var(--line); }
:root[data-shell] .tk-check { width: 1.375rem; height: 1.375rem; border-width: 1.5px; font-size: .75rem; transition: border-color .12s, background-color .15s; }
:root[data-shell] .tk-gh { font: 600 .6875rem/1.3 var(--title); letter-spacing: .08em; text-transform: uppercase; }
:root[data-shell] .fl-addr, :root[data-shell] .deal-row .d-date, :root[data-shell] .fl-rent { font-weight: 600; }
:root[data-shell] .tag { font-weight: 600; }
:root[data-shell] .box, :root[data-shell] .banner, :root[data-shell] .catastro, :root[data-shell] .stale, :root[data-shell] .tenant, :root[data-shell] .tp-desc { border-radius: var(--radius); }
:root[data-shell] .obj-results, :root[data-shell] .fp-menu { border-radius: var(--radius); box-shadow: var(--shadow); }
:root[data-shell] .acc-totals > div, :root[data-shell] .acc-table-wrap, :root[data-shell] .dr-docs { border-radius: var(--radius); }
:root[data-shell] .acc-totals b, :root[data-shell] .hm-pay-nums b { font-family: var(--title); font-weight: 600; }
:root[data-shell] .acc-table th { font: 600 .6875rem/1.3 var(--title); letter-spacing: .08em; color: var(--faint); }

/* календарь */
:root[data-shell] .cal-cell { border-radius: 4px; transition: border-color .12s; }
:root[data-shell] .cal-cell:hover { border-color: var(--faint); }
:root[data-shell] .cal-cell.today { border: 1px solid var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
:root[data-shell] .cal-wd { font: 600 .6875rem/1.3 var(--title); letter-spacing: .08em; }
:root[data-shell] .cal-wd.wknd { color: var(--faint); }
:root[data-shell] .cal-num { font-family: var(--title); font-weight: 600; }

/* ───────── «Сегодня»: одна очередь работы (строит home.js) ─────────
   В прежнем виде остаётся главная с карточками, очередь и её кнопка в заголовке скрыты. */
.hq, :root:not([data-shell]) #btn-home-task { display: none; }
:root[data-shell] #view-home:not([hidden]) { display: block; max-width: 86rem; }
:root[data-shell] #view-home > .form, :root[data-shell] #view-home > .side { display: none; }
:root[data-shell] .hq { display: block; }
.hq-head { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem; flex-wrap: wrap; margin: .25rem 0 1.5rem; }
.hq-date { font: 600 1.625rem/1.15 var(--title); letter-spacing: .01em; margin: 0; }
.hq-date::first-letter { text-transform: uppercase; }
.hq-sum { margin: .4375rem 0 0; color: var(--muted); font-size: .9375rem; line-height: 1.5; }
.hq-sum b { color: var(--text); font-family: var(--title); font-weight: 600; }
.hq-sum .bad { color: var(--red); font-weight: 600; }
.hq-note { margin: .25rem 0 0; color: var(--faint); font-size: .8125rem; }
.hq-acts { display: flex; gap: .5rem; }
.hq-cols { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 2.5rem; align-items: start; }
.hq-group { margin-bottom: 1.625rem; }
.hq-h { display: flex; align-items: baseline; gap: .375rem; margin: 0 0 .4375rem; font: 600 .6875rem/1.3 var(--title); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.hq-h span { font: 400 .8125rem/1.2 var(--font); letter-spacing: 0; text-transform: none; }
.hq-list { border-top: 1px solid var(--line); }
.hq-row {
  position: relative; display: grid; grid-template-columns: 1.375rem minmax(0, 2.4fr) minmax(0, 1.3fr) 11.5rem; gap: .75rem; align-items: center;
  min-height: 2.5rem; padding: var(--rowpad) .5rem; border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color .1s;
}
.hq-row { border-left: 3px solid transparent; }
.hq-row:hover, .hq-row:focus-visible { background: var(--hover); }
/* просроченное — красная полоса и лёгкая заливка; сегодняшнее — оранжевая полоса, крупнее и жирнее; остальное спокойнее */
.hq-hot .hq-h { color: var(--red); }
.hq-hot .hq-row { background: var(--red-soft); border-left-color: var(--red); }
.hq-hot .hq-row:hover { background: var(--red-soft); filter: brightness(.97); }
.hq-today .hq-h { color: var(--orange-text); }
.hq-today .hq-row { min-height: 3.125rem; border-left-color: var(--orange); }
.hq-today .hq-t { font-size: 1.0625rem; font-weight: 600; }
.hq-today .hq-w { color: var(--orange-text); font: 600 1rem/1 var(--title); text-align: right; }
.hq-rest .hq-t { font-weight: 400; color: var(--muted); }
.hq-rest > summary { display: flex; align-items: baseline; gap: .375rem; padding: .5rem 0; cursor: pointer; list-style: none; border-bottom: 1px solid var(--line); transition: color .12s; }
.hq-rest > summary::-webkit-details-marker { display: none; }
.hq-rest > summary::before { content: "▸"; display: inline-block; width: .875rem; color: var(--faint); transition: transform .15s; }
.hq-rest[open] > summary::before { transform: rotate(90deg); }
.hq-rest > summary:hover { color: var(--text); }
.hq-rest[open] > .hq-list { border-top: 0; }
.hq-row:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.hq-ic { display: flex; color: var(--faint); }
.hq-t, .hq-o, .hq-w { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hq-t { font-weight: 500; }
.hq-o, .hq-w { color: var(--muted); font-size: .9375rem; }
.hq-w { font-variant-numeric: tabular-nums; }
.hq-row.bad .hq-w { color: var(--red); font-weight: 600; }
.hq-row.more .hq-t { color: var(--muted); font-weight: 400; }
.hq-row .tag { margin-left: .25rem; vertical-align: 1px; }
:root[data-shell] .hq-a { position: absolute; right: .375rem; top: 50%; transform: translateY(-50%); opacity: 0; pointer-events: none; transition: opacity .12s; box-shadow: 0 0 0 .375rem var(--hover); }
:root[data-shell] .hq-row:hover .hq-a, :root[data-shell] .hq-row:focus-within .hq-a { opacity: 1; pointer-events: auto; }
:root[data-shell] .hq-a:active { transform: translateY(calc(-50% + 1px)); }
.hq-chk { position: relative; width: 1.125rem; height: 1.125rem; padding: 0; border: 1.5px solid var(--line-strong); border-radius: 50%; background: none; cursor: pointer; transition: border-color .12s, background-color .15s; }
.hq-chk::before { content: ""; position: absolute; inset: -.5rem; }                 /* удобнее попасть */
.hq-chk:hover { border-color: var(--orange); }
.hq-row.done .hq-chk { background: var(--green); border-color: var(--green); }
.hq-row.done .hq-chk::after { content: ""; position: absolute; left: 22%; top: 27%; width: 46%; height: 24%; border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(-45deg); }
.hq-row.done .hq-t { color: var(--faint); text-decoration: line-through; }
.hq-empty { margin: 0; padding: 1rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.hq-block { margin-bottom: 1.75rem; }
.hq-bar { display: flex; gap: 2px; height: .5rem; margin: .5rem 0 .75rem; border-radius: 3px; overflow: hidden; background: var(--line); }
.hq-bar i { display: block; min-width: 0; }
.hq-bar .ok, .hq-st.ok i { background: var(--green); }
.hq-bar .wait, .hq-st.wait i { background: var(--yellow); }
.hq-bar .bad, .hq-st.bad i { background: var(--red); }
.hq-kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3125rem .75rem; margin: 0 0 .625rem; font-size: .9375rem; }
.hq-kv dd { margin: 0; text-align: right; font: 600 .9375rem/1.4 var(--title); font-variant-numeric: tabular-nums; }
.hq-kv .dim { color: var(--faint); font-size: .8125rem; font-weight: 400; }
.hq-duty dd { font-family: var(--font); }
.hq-duty .bad { color: var(--red); }
:root[data-shell] .sc-h, :root[data-shell] .sc-per { font-family: var(--title); }
:root[data-shell] .sc-box, :root[data-shell] .sc-late, :root[data-shell] .sc-sat, :root[data-shell] .sc-off, :root[data-shell] .sc-closed { border-radius: 3px; }
.hq-st { display: inline-flex; align-items: center; gap: .4375rem; }
.hq-st i { width: .4375rem; height: .4375rem; border-radius: 50%; background: var(--faint); flex: none; }
.hq-st.bad { color: var(--red); font-weight: 600; }
.hq-link { font-size: .875rem; }
.hq-agenda { border-top: 1px solid var(--line); }
.hq-ag { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: .5rem; width: 100%; padding: .4375rem .375rem; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color .1s; }
.hq-ag:hover, .hq-ag:focus-visible { background: var(--hover); }
.hq-ag .d { font: 600 .8125rem/1.5 var(--title); color: var(--muted); }
.hq-ag .d::first-letter { text-transform: uppercase; }
.hq-ag.wknd .d { color: var(--faint); }
.hq-ag.now .d { color: var(--orange-text); }
.hq-ag .e { display: flex; flex-direction: column; gap: .125rem; min-width: 0; font-size: .875rem; }
.hq-ag .e span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hq-ag .e .m { color: var(--muted); }
.hq-ag .e .none { color: var(--faint); }
/* окно программы не во весь экран: «Оплаты» и «Неделя» уходят под очередь двумя колонками */
@media (max-width: 1240px) {
  .hq-cols { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .hq-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.5rem; }
}
@media (max-width: 760px) {
  .hq-side { grid-template-columns: minmax(0, 1fr); }
  .hq-row { grid-template-columns: 1.375rem minmax(0, 1fr) auto; row-gap: .125rem; }
  .hq-row > :first-child { grid-row: 1 / span 2; align-self: start; margin-top: .1875rem; }
  .hq-t { grid-column: 2; grid-row: 1; white-space: normal; }
  .hq-o { grid-column: 2 / span 2; grid-row: 2; font-size: .8125rem; }
  .hq-o:empty { display: none; }
  .hq-w { grid-column: 3; grid-row: 1; align-self: start; margin-top: .1875rem; font-size: .8125rem; }
  .hq-a { display: none; }
}

/* окна */
:root[data-shell] .modal .dlg { border-radius: 8px; box-shadow: var(--shadow); padding: 1.25rem 1.375rem 1rem; }
:root[data-shell] .dlg-title { font-size: 1.125rem; }
:root[data-shell] .login-card { border-radius: 8px; box-shadow: var(--shadow); }
:root[data-shell] .fb-fab { right: 1rem; bottom: 1rem; padding: .375rem .625rem; border-radius: var(--radius); border: 1px solid var(--line-strong); color: var(--muted); font-size: .8125rem; font-weight: 600; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .4); transition: background-color .12s, color .12s; }
:root[data-shell] .fb-fab:hover { background: var(--hover); color: var(--text); }
:root[data-shell] body[data-view="deal"] .fb-fab, :root[data-shell] body[data-view="ticket"] .fb-fab { bottom: 4.5rem; }

/* ───────── поиск по всему (Ctrl+K) ───────── */
.pal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .32); display: flex; align-items: flex-start; justify-content: center; padding: 14vh 16px 0; animation: pal-fade .12s; }
.pal[hidden] { display: none; }
@keyframes pal-fade { from { opacity: 0; } }
.pal-box { width: 36rem; max-width: 100%; background: var(--card); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; animation: pal-in .16s var(--ease); }
@keyframes pal-in { from { transform: translateY(-8px) scale(.985); opacity: 0; } }
.pal-box input { display: block; width: 100%; height: 3rem; border: 0; border-bottom: 1px solid var(--line); padding: 0 1rem; background: none; color: var(--text); outline: none; font: inherit; font-size: 1.0625rem; }
.pal-list { max-height: min(24rem, 52vh); overflow-y: auto; padding: .375rem; }
.pal-cap { font: 600 .6875rem/1.3 var(--title); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: .5rem .625rem .1875rem; }
.pal-it { display: flex; gap: .625rem; align-items: center; width: 100%; min-height: 2.25rem; padding: .25rem .625rem; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: .9375rem; text-align: left; cursor: pointer; }
.pal-it.on { background: var(--hover); }
.pal-it svg { color: var(--faint); }
.pal-it .pal-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-it .pal-k { margin-left: auto; padding-left: .75rem; color: var(--faint); font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; flex: none; }
.pal-none { padding: 1rem .75rem; color: var(--muted); }
.pal-foot { display: flex; gap: 1rem; padding: .4375rem .875rem; border-top: 1px solid var(--line); font-size: .75rem; color: var(--faint); }

/* ───────── «Квартиры»: таблица с видами и панелью справа (строит flats.js) ─────────
   В прежнем виде остаётся список карточкой, таблица и панель скрыты. */
.ft, .ft-drawer { display: none; }
:root[data-shell] .ft { display: block; container-type: inline-size; }
:root[data-shell] #view-flats > .card { display: none; }
:root[data-shell] #view-flats { max-width: none; padding-top: .375rem; transition: padding-right .22s var(--ease); }
.ft-tabs { display: flex; gap: 1.375rem; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.ft-tab { position: relative; flex: none; padding: .6875rem .0625rem; border: 0; background: none; color: var(--muted); font: 500 .9375rem/1.2 var(--font); white-space: nowrap; cursor: pointer; transition: color .12s; }
.ft-tab:hover { color: var(--text); }
.ft-tab.on { color: var(--text); font-weight: 600; }
.ft-tab .n { margin-left: .375rem; color: var(--faint); font: 400 .8125rem/1 var(--title); }
.ft-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--orange); transform: scaleX(0); transition: transform .18s var(--ease); }
.ft-tab.on::after { transform: scaleX(1); }
.ft-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.125rem; padding: .75rem 0; }
.ft-q, .ft-f select { height: 2.125rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--input-bg); color: var(--text); font: inherit; font-size: .9375rem; transition: border-color .12s; }
.ft-q { flex: 1 1 18rem; min-width: 12rem; max-width: 28rem; padding: 0 .625rem; }
.ft-f select { padding: 0 .375rem; }
.ft-q:hover, .ft-f select:hover { border-color: var(--faint); }
.ft-q:focus, .ft-f select:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: var(--orange); }
.ft-f { display: inline-flex; align-items: center; gap: .4375rem; color: var(--muted); font-size: .875rem; cursor: pointer; }
.ft-f input { accent-color: var(--orange); }
.ft-n { margin-left: auto; color: var(--faint); font-size: .875rem; }
.ft-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.ft-table col.col-tenant { width: 20%; } .ft-table col.col-rent { width: 6.5rem; } .ft-table col.col-pay { width: 15rem; }
.ft-table col.col-due { width: 5rem; } .ft-table col.col-inq { width: 5.5rem; } .ft-table col.col-tasks { width: 4.5rem; } .ft-table col.col-open { width: 5.25rem; }
.ft-table th { position: sticky; top: calc(3.25rem + 1px); z-index: 2; height: 2.125rem; padding: 0; background: var(--bg); border-bottom: 1px solid var(--line-strong); text-align: left; }
.ft-table th button { display: flex; align-items: center; gap: .3125rem; width: 100%; height: 2.125rem; padding: 0 .625rem; border: 0; background: none; color: var(--faint); font: 600 .6875rem/1 var(--title); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; cursor: pointer; transition: color .12s; }
.ft-table th.num button { justify-content: flex-end; }
.ft-table th button:hover, .ft-table th.sorted button { color: var(--text); }
.ft-table th i { width: 0; height: 0; border: .25rem solid transparent; flex: none; }
.ft-table th i.up { border-bottom-color: var(--orange); margin-top: -.25rem; }
.ft-table th i.down { border-top-color: var(--orange); margin-bottom: -.25rem; }
.ft-table td { height: calc(1.375rem + var(--rowpad, .625rem) * 2); padding: 0 .625rem; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-table td.num, .ft-table th.num { text-align: right; }
.ft-table td.addr { font-weight: 600; }
.ft-table tbody tr { cursor: pointer; transition: background-color .1s; }
.ft-table tbody tr:hover { background: var(--hover); }
.ft-table tbody tr.sel, .ft-table tbody tr.sel:hover { background: var(--orange-soft); }
.ft-table tbody tr:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.ft-table tr.none { cursor: default; } .ft-table tr.none td { color: var(--muted); height: 4rem; }
.ft .dim, .ft-drawer .dim { color: var(--faint); }
.ft-st { display: inline-flex; align-items: center; gap: .4375rem; max-width: 100%; }
.ft-st i { width: .4375rem; height: .4375rem; border-radius: 50%; background: var(--faint); flex: none; }
.ft-st.ok i { background: var(--green); } .ft-st.wait i { background: var(--yellow); } .ft-st.bad i { background: var(--red); }
.ft-st.bad { color: var(--red); font-weight: 600; }
.ft #ft-status { margin-top: .875rem; }
/* мало места (узкое окно или открыта панель): сначала уходят «Срок», «Отв.», «Заявки», потом «Рента» и «Дела» */
@container (max-width: 880px) { .ft-table .c-m { display: none; } }
@container (max-width: 620px) { .ft-table .c-s { display: none; } .ft-table col.col-pay { width: 46%; } .ft-table col.col-tenant { display: none; } .ft-table td:nth-child(2), .ft-table th:nth-child(2) { display: none; } }
/* панель справа */
:root[data-shell] body[data-view="flats"] .ft-drawer {
  display: flex; flex-direction: column; position: fixed; top: calc(3.25rem + 1px); right: 0; bottom: 0; width: 26rem; max-width: 100vw; z-index: 7;
  background: var(--card); color: var(--text); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translateX(105%); visibility: hidden; transition: transform .22s var(--ease), visibility 0s .22s;
}
:root[data-shell] body[data-view="flats"] .ft-drawer.open { transform: none; visibility: visible; transition: transform .22s var(--ease); }
.ftd-head { display: flex; align-items: flex-start; gap: .5rem; padding: 1rem .75rem .875rem 1.25rem; border-bottom: 1px solid var(--line); }
.ftd-head h3 { flex: 1; margin: 0; font: 600 1.125rem/1.25 var(--title); letter-spacing: .01em; }
.ftd-x { display: grid; place-items: center; width: 2rem; height: 2rem; flex: none; border: 0; border-radius: var(--radius); background: none; color: var(--muted); cursor: pointer; transition: background-color .12s, color .12s; }
.ftd-x:hover { background: var(--hover); color: var(--text); }
.ftd-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.ftd-body section { margin-top: 1.375rem; }
.ftd-body section p { margin: 0; font-size: .9375rem; }
.ftd-dl { display: grid; grid-template-columns: 8.75rem minmax(0, 1fr); gap: .5rem .75rem; margin: 0; font-size: .9375rem; }
.ftd-dl dt { color: var(--muted); }
.ftd-dl dd { margin: 0; overflow-wrap: anywhere; }
.ftd-dl .dim { font-size: .875rem; margin-top: .0625rem; }
.ftd-mini { display: flex; justify-content: space-between; gap: .75rem; width: 100%; padding: .4375rem .375rem; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; font-size: .9375rem; text-align: left; cursor: pointer; transition: background-color .1s; }
.ftd-mini:first-of-type { border-top: 1px solid var(--line); }
.ftd-mini:hover { background: var(--hover); }
.ftd-mini span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftd-mini .w { flex: none; color: var(--muted); font-size: .875rem; }
.ftd-mini .w.bad { color: var(--red); font-weight: 600; }
.ftd-foot { display: flex; gap: .5rem; padding: .75rem 1.25rem; border-top: 1px solid var(--line); }
:root[data-shell] body.ft-with-drawer[data-view="flats"] .fb-fab { display: none; }       /* не закрывать кнопки панели */
@media (min-width: 1200px) { :root[data-shell] body.ft-with-drawer #view-flats { padding-right: 27.5rem; } }
@media (max-width: 900px) {
  .ft-table th { position: static; }
  :root[data-shell] body[data-view="flats"] .ft-drawer { top: 0; z-index: 30; width: 100vw; border-left: 0; }
}

/* ───────── карточка квартиры: шапка с полосой фактов и лента истории (flatprofile.js) ───────── */
:root:not([data-shell]) #fp-history { display: none; }
#fp-history:empty { display: none; }
.fc-title { margin: 0; font: 600 1.5rem/1.2 var(--title); letter-spacing: .01em; }
.fc-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .75rem; margin-top: .5rem; font-size: .9375rem; }
.fc-tags > span:empty { display: none; }
.fc-tags .mono { font-family: Consolas, "Cascadia Mono", monospace; font-weight: 400; }
.fc-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 1rem 0 .875rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fc-facts > div { min-width: 0; padding: .625rem 1rem; border-left: 1px solid var(--line); }
.fc-facts > div:first-child { padding-left: 0; border-left: 0; }
.fc-facts > div > span { display: block; font: 600 .6875rem/1.3 var(--title); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.fc-facts b { display: block; margin-top: .1875rem; font: 600 1.0625rem/1.3 var(--title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-facts em { display: block; font-style: normal; font-size: .8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-terms { margin-bottom: .75rem; }
:root[data-shell] #view-fprofile .side .fp-two { display: block; }
:root[data-shell] #view-fprofile .side .fp-two > div + div { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.fh-year { margin-top: .875rem; padding: .25rem 0; border-bottom: 1px solid var(--line-strong); font: 600 .6875rem/1.3 var(--title); letter-spacing: .08em; color: var(--faint); }
.fh-year:first-child { margin-top: 0; }
.fh-row { display: grid; grid-template-columns: 3rem 1.125rem minmax(0, 1fr) auto; gap: .625rem; align-items: center; width: 100%; padding: var(--rowpad, .5rem) .25rem; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; }
button.fh-row { cursor: pointer; transition: background-color .1s; }
button.fh-row:hover, button.fh-row:focus-visible { background: var(--hover); }
.fh-row .d { color: var(--muted); font-variant-numeric: tabular-nums; }
.fh-row .ic { display: flex; color: var(--faint); }
.fh-row .x { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh-row .m { color: var(--muted); }
.fh-row .r { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* карточка квартиры: кнопки группами и вкладки (2026-11-17) */
.fc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .25rem; }
.fc-dd { position: relative; }
.fc-dd > summary { list-style: none; cursor: pointer; user-select: none; }
.fc-dd > summary::-webkit-details-marker { display: none; }
.fc-dd > summary::after { content: ""; display: inline-block; width: .375rem; height: .375rem; margin: 0 0 .1875rem .5rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .15s; }
.fc-dd[open] > summary::after { transform: translateY(.1875rem) rotate(-135deg); }
.fc-dd .fp-menu { min-width: 19rem; margin-top: .25rem; padding: .25rem 0; }
.fc-dd .fp-menu button { padding: .5rem .875rem; }
.fc-dd .fp-menu .d-sub { display: block; font-weight: 400; font-size: .8125rem; color: var(--muted); }
.fc-tabs { position: sticky; z-index: 6; display: flex; gap: 1.75rem; margin: 0 0 1rem; padding: 0 .125rem; overflow-x: auto; scrollbar-width: none;
  background: var(--bg); border-bottom: 1px solid var(--line); }
.fc-tabs::-webkit-scrollbar { display: none; }
.fc-tab { position: relative; flex: none; display: flex; align-items: center; gap: .375rem; padding: .8125rem 0 .75rem; border: 0; background: none;
  color: var(--muted); font: 500 .9375rem/1.2 var(--font); cursor: pointer; transition: color .12s; }
.fc-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--orange); transform: scaleX(0); transition: transform .18s var(--ease); }
.fc-tab:hover { color: var(--text); }
.fc-tab[aria-selected="true"] { color: var(--text); font-weight: 600; }
.fc-tab[aria-selected="true"]::after { transform: scaleX(1); }
.fc-tab:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 2px; }
.fc-tab i { font: 500 .75rem/1 var(--title); font-style: normal; color: var(--faint); padding: .1875rem .375rem; border-radius: 4px; background: var(--line-soft); }
.fc-tab i.alert { color: var(--text); background: var(--hover); font-weight: 600; }
#view-fprofile .fp-off { display: none !important; }
:root[data-shell] #fp > .tp-back { margin-bottom: .5rem; }
@media (max-width: 900px) { .fc-tabs { gap: 1.25rem; } }
@media (max-width: 900px) { .fc-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fc-facts > div { padding-left: 0; border-left: 0; } .fh-row .x { white-space: normal; } }

/* ───────── «Оплаты месяца»: статистика кольцом (accounting.js) ───────── */
.am-stat { display: flex; align-items: center; gap: 1.25rem; margin: .25rem 0 1rem; }
.am-stat:empty { display: none; }
.am-ring { position: relative; display: grid; place-content: center; width: 5.75rem; height: 5.75rem; flex: none; text-align: center; }
.am-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.am-ring circle { fill: none; stroke-width: 3.4; }
.am-ring .bg { stroke: var(--line); }
.am-ring .ok { stroke: var(--green); } .am-ring .wait { stroke: var(--yellow); } .am-ring .bad { stroke: var(--red); } .am-ring .off { stroke: var(--muted); opacity: .45; }
.am-ring b { font: 600 1.375rem/1 var(--title); }
.am-ring span { margin-top: .125rem; font-size: .6875rem; color: var(--muted); }
.am-legend { display: grid; grid-template-columns: repeat(2, auto); gap: .125rem 1.25rem; justify-content: start; }
.am-leg { display: flex; align-items: center; gap: .4375rem; padding: .25rem .375rem; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: .9375rem; cursor: pointer; transition: background-color .12s; }
.am-leg:hover { background: var(--hover); }
.am-leg i { width: .5rem; height: .5rem; border-radius: 50%; flex: none; background: var(--muted); opacity: .45; }
.am-leg i.ok { background: var(--green); opacity: 1; } .am-leg i.wait { background: var(--yellow); opacity: 1; } .am-leg i.bad { background: var(--red); opacity: 1; }
.am-leg b { margin-left: .25rem; font: 600 1rem/1 var(--title); font-variant-numeric: tabular-nums; }

/* ───────── «Касса» (cash.js); работает и в прежнем виде ───────── */
.cs-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin: .25rem 0 1rem; }
.cs-facts { display: grid; grid-template-columns: 1.6fr repeat(5, minmax(0, 1fr)); margin-bottom: 1.5rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs-facts > div { min-width: 0; padding: .75rem 1rem; border-left: 1px solid var(--line); }
.cs-facts > div:first-child { padding-left: 0; border-left: 0; }
.cs-facts span { display: block; font: 600 .6875rem/1.3 var(--title); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.cs-facts b { display: block; margin-top: .25rem; font: 600 1.25rem/1.2 var(--title); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-facts .big b { font-size: 1.875rem; }
.cs-facts .bad b { color: var(--red); }
.cs-facts em { display: block; font-style: normal; font-size: .8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-cols { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 2.5rem; align-items: start; }
.cs-block { margin-bottom: 1.75rem; }
.cs-legend { display: flex; gap: 1.25rem; font-size: .875rem; color: var(--muted); margin: .25rem 0 .375rem; }
.cs-legend span, .cs-tip span { display: inline-flex; align-items: center; gap: .375rem; }
.cs-legend i, .cs-tip i { width: .625rem; height: .625rem; border-radius: 2px; }
.cs-plot { position: relative; }
.cs-plot svg { display: block; width: 100%; height: auto; }
.cs-b1 { fill: var(--orange); background: var(--orange); }
.cs-b2 { fill: var(--muted); background: var(--muted); }
.cs-grid { stroke: var(--line); stroke-width: 1; }
.cs-ax { fill: var(--faint); font: 11px var(--title); }
.cs-hit { fill: transparent; cursor: default; }
.cs-hit:hover { fill: var(--hover); fill-opacity: .55; }
.cs-tip { position: absolute; top: 0; z-index: 3; display: flex; flex-direction: column; gap: .1875rem; padding: .5rem .625rem; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); box-shadow: var(--shadow); font-size: .8125rem; pointer-events: none; white-space: nowrap; }
.cs-tip[hidden] { display: none; }
.cs-tip b { font-family: var(--title); }
.cs-tablev { margin-top: .5rem; font-size: .875rem; }
.cs-tablev summary { cursor: pointer; color: var(--muted); }
.cs-table th:nth-child(3) { width: 7.5rem; }
.cs-table.only-cash th:nth-child(2), .cs-table.only-cash td:nth-child(2) { display: none; }
.cs-table td.cs-bal { font: 600 .9375rem/1 var(--title); font-variant-numeric: tabular-nums; }
.cs-table td.cs-bal.neg { color: var(--red); }
.cs-table tr.cs-nokey { cursor: default; color: var(--muted); }
.cs-table th:nth-child(2), .cs-table th:nth-child(6) { width: 7.5rem; } .cs-table th:nth-child(4), .cs-table th:nth-child(5) { width: 8rem; }
.cs-side .ftd-mini[disabled] { cursor: default; opacity: .7; }
@media (max-width: 1240px) { .cs-cols { grid-template-columns: minmax(0, 1fr); gap: 0; } .cs-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cs-facts > div:nth-child(4) { padding-left: 0; border-left: 0; } }
@media (max-width: 760px) { .cs-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cs-facts > div { padding-left: 0; border-left: 0; } .cs-table .c-m, .cs-table .c-s { display: none; } }

/* ───────── «Туризм» (tourist.js): квартиры «info tur» и листы CONTABILIDAD TURISTICA ───────── */
.cs-facts .warn b { color: var(--yellow); }
/* касса начальника (cashbook.js): журнал и «ждёт подтверждения» — ширина по содержимому, текст переносится */
.ft-table.cb-table { table-layout: auto; }
.ft-table.cb-table td { white-space: normal; height: auto; padding: .4375rem .625rem; overflow: visible; text-overflow: clip; }
.ft-table.cb-table td.c-m, .ft-table.cb-table td.num, .ft-table.cb-table td.cb-btns { white-space: nowrap; }
.ft-table.cb-table td.cb-btns { display: table-cell; }
.tu-table tr[data-id] { cursor: pointer; }
.tu-table tr.tu-on td { background: var(--hover); }
.tu-table td.tu-id { font: 600 .9375rem/1 var(--title); font-variant-numeric: tabular-nums; width: 3.5rem; }
.tu-table td.cs-bal { font: 600 .9375rem/1 var(--title); font-variant-numeric: tabular-nums; }
.tu-table td.cs-bal.neg { color: var(--red); }
.tu-table th:nth-child(1) { width: 4rem; } .tu-table th:nth-child(3) { width: 6.5rem; } .tu-table th:nth-child(4) { width: 7.5rem; }
.tu-table th:nth-child(5), .tu-table th:nth-child(6) { width: 9.5rem; } .tu-table th:nth-child(7) { width: 8.5rem; } .tu-table th:nth-child(8) { width: 7rem; }
.tu-table tr.tu-det td { background: var(--hover); padding: .25rem 1rem 1rem; cursor: default; white-space: normal; height: auto; }
.tu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .5rem 1.5rem; margin: .25rem 0 .75rem; }
.tu-grid span { display: block; font: 600 .6875rem/1.3 var(--title); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.tu-grid b { display: block; font-weight: 500; }
.tu-acts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
#tu-loose { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0 1.5rem; }
@media (max-width: 760px) { .tu-table .c-m, .tu-table .c-s { display: none; } }

/* ───────── временный раздел «Связи» (links.js); работает и в прежнем виде ───────── */
.sh-c.sh-tmp { color: var(--faint); background: none; font-weight: 500; }
.lk-intro { margin: .25rem 0 1rem; font-size: .9375rem; line-height: 1.5; }
.lk-refresh { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem 1rem; margin: 0 0 1rem; font-size: .875rem; }
.lk-progress { font-weight: 600; color: var(--orange-text); }
.lk-busy { opacity: .55; pointer-events: none; }
.lk-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 1rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lk-sum > div { min-width: 0; padding: .625rem 1rem; border-left: 1px solid var(--line); }
.lk-sum > div:first-child { padding-left: 0; border-left: 0; }
.lk-sum span { display: block; font: 600 .6875rem/1.3 var(--title); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.lk-sum b { display: block; margin-top: .1875rem; font: 600 1.375rem/1.2 var(--title); }
.lk-sum em { display: block; font-style: normal; font-size: .8125rem; color: var(--muted); }
.lk-table td { white-space: normal; vertical-align: top; padding-top: .5rem; padding-bottom: .5rem; height: auto; overflow: visible; }
.lk-table th:first-child { width: 26%; }
.lk-table tbody tr { cursor: default; }
.lk-flat { font-weight: 600; text-align: left; }
.lk-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: .125rem .5rem; padding: .25rem 0; border-bottom: 1px dashed var(--line); }
.lk-item:last-of-type { border-bottom: 0; }
.lk-name { font-weight: 500; overflow-wrap: anywhere; }
.lk-how { font-size: .75rem; font-weight: 600; padding: 0 .375rem; border-radius: 4px; background: var(--line-soft, var(--hover)); color: var(--muted); white-space: nowrap; }
.lk-how.ok { color: var(--green); background: var(--green-soft); } .lk-how.warn { color: var(--yellow); background: var(--yellow-soft); } .lk-how.bad { color: var(--red); background: var(--red-soft); }
.lk-acts { display: inline-flex; gap: .375rem; margin-left: auto; white-space: nowrap; }
.lk-btn, .lk-add { padding: .0625rem .5rem; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--card); color: var(--muted); font: inherit; font-size: .8125rem; cursor: pointer; transition: border-color .12s, color .12s; }
.lk-btn:hover, .lk-add:hover { border-color: var(--orange); color: var(--text); }
.lk-add { margin-top: .25rem; border-style: dashed; }
.lk-orph td.lk-acts { display: table-cell; text-align: right; }
@media (max-width: 900px) { .lk-sum { grid-template-columns: 1fr; } .lk-sum > div { padding-left: 0; border-left: 0; } }

/* статус оплаты вручную (accounting.js): маленький выбор под значком оплаты; в любом стиле */
select.pay-set { display: block; margin-top: .3125rem; max-width: 100%; padding: .125rem .25rem; border: 1px solid var(--line-strong, var(--input-line)); border-radius: 5px;
  background: var(--input-bg, var(--card)); color: var(--muted); font: inherit; font-size: .8125rem; cursor: pointer; }
select.pay-set:hover, select.pay-set:focus { color: var(--text); border-color: var(--orange); }
.pay-hand { font-style: normal; font-weight: 600; color: var(--orange-text); }

/* «Окно оплаты: с … по …» — узкие поля в строку (в новом виде растягивались на всю ширину; замечено при записи видео 2026-11-15) */
.field .inline input.day:not(#_) { display: inline-block; width: 4.5rem; margin: 0; text-align: center; }

/* IBAN: блоки по 4 знака, цифры одной ширины — проще сверять */
.field input[name="iban"] { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
:root[data-shell] .field input[name="iban"] { font-family: var(--title); font-size: 1.0625rem; }
.with-btn input.dp { flex: 0 1 11rem; }

/* ───────── поле даты и всплывающий календарь (datepick.js); работает в любом стиле ───────── */
input.dp {
  padding-right: 2rem; font-variant-numeric: tabular-nums;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8A8A' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16v14H4zM4 10.5h16M8 3.5V8M16 3.5V8'/%3E%3C/svg%3E");
  background-repeat: no-repeat !important; background-position: right .5rem center !important; background-size: 1.0625rem !important;
}
input.dp:not(#_) { padding-right: 2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8A8A' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16v14H4zM4 10.5h16M8 3.5V8M16 3.5V8'/%3E%3C/svg%3E"); }   /* поверх фона полей */
input.dp.dp-bad { border-color: var(--red) !important; }
.dp-pop {
  position: fixed; z-index: 80; width: 18rem; padding: .625rem .625rem .5rem; background: var(--card); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow); font: .9375rem/1.2 var(--font);
  user-select: none; transform-origin: 1.5rem top; animation: dp-in .18s var(--ease);
}
.dp-pop[hidden] { display: none; }
.dp-pop[data-side="above"] { transform-origin: 1.5rem bottom; animation-name: dp-in-up; }
@keyframes dp-in { from { opacity: 0; transform: translateY(-6px) scale(.95); } }
@keyframes dp-in-up { from { opacity: 0; transform: translateY(6px) scale(.95); } }
.dp-pop button { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.dp-head { display: flex; align-items: center; gap: .25rem; margin-bottom: .25rem; }
.dp-title { flex: 1; height: 2.125rem; border-radius: 8px; font: 600 1rem/1 var(--title) !important; letter-spacing: .01em; transition: background-color .12s; }
.dp-nav { display: grid; place-items: center; width: 2.125rem; height: 2.125rem; border-radius: 8px; color: var(--muted) !important; transition: background-color .12s, color .12s; }
.dp-nav svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dp-title:hover, .dp-nav:hover { background: var(--hover); color: var(--text) !important; }
.dp-wd, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dp-wd span { padding: .3125rem 0; text-align: center; font: 600 .6875rem/1 var(--title); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.dp-d { height: 2.25rem; border-radius: 9px; font-variant-numeric: tabular-nums; transition: background-color .1s; }
.dp-d.dp-we { color: var(--muted) !important; }
.dp-d.out { color: var(--faint) !important; opacity: .6; }
.dp-d:hover, .dp-m:hover { background: var(--hover); }
.dp-d.today, .dp-m.today { box-shadow: inset 0 0 0 1.5px var(--orange); color: var(--orange-text) !important; font-weight: 600; opacity: 1; }
.dp-d.on, .dp-d.on:hover, .dp-m.on, .dp-m.on:hover { background: var(--orange); color: var(--on-orange, #fff) !important; font-weight: 600; opacity: 1; box-shadow: none; }
.dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; padding: .25rem 0 .125rem; }
.dp-m { height: 2.75rem; border-radius: 9px; transition: background-color .1s; }
.dp-moved { animation: dp-move .14s ease-out; }
@keyframes dp-move { from { opacity: 0; } }
.dp-foot { display: flex; justify-content: space-between; margin-top: .375rem; padding-top: .375rem; border-top: 1px solid var(--line); }
.dp-link { padding: .3125rem .5rem !important; border-radius: 7px; color: var(--orange-text) !important; font-size: .875rem !important; font-weight: 600 !important; transition: background-color .12s; }
.dp-link.quiet { color: var(--muted) !important; font-weight: 400 !important; }
.dp-link:hover { background: var(--hover); }
/* выбор времени: циферблат (час → минуты) */
input.dp-time:not(#_) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8A8A' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7v5l3.5 2'/%3E%3C/svg%3E"); }
.dp-pop.dp-tpop { width: 16.5rem; }
.dp-time { display: flex; align-items: center; justify-content: center; gap: .25rem; margin: .125rem 0 .5rem; }
.dp-time i { font: 600 1.5rem/1 var(--title); font-style: normal; color: var(--faint); }
.dp-seg { min-width: 3.5rem; height: 2.75rem; border-radius: 9px; font: 600 1.625rem/1 var(--title) !important; font-variant-numeric: tabular-nums; color: var(--muted) !important; transition: background-color .12s, color .12s; }
.dp-seg:hover { background: var(--hover); }
.dp-seg.on { background: var(--orange-soft); color: var(--orange-text) !important; }
.dp-clock { position: relative; width: 14.5rem; height: 14.5rem; margin: 0 auto; border-radius: 50%; background: var(--hover); }
.dp-clock svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dp-clock line { stroke: var(--orange); stroke-width: .8; stroke-linecap: round; }
.dp-clock circle { fill: var(--orange); }
.dp-n { position: absolute; width: 2.125rem; height: 2.125rem; margin: -1.0625rem 0 0 -1.0625rem; border-radius: 50%; font-variant-numeric: tabular-nums; transition: background-color .1s; }
.dp-n.in { font-size: .8125rem !important; color: var(--muted) !important; }
.dp-n:hover { background: var(--card); }
.dp-n.on, .dp-n.on:hover { background: var(--orange); color: var(--on-orange, #fff) !important; font-weight: 600 !important; }
.dp-tip { align-self: center; padding-left: .25rem; font-size: .75rem; color: var(--faint); }
@media (prefers-reduced-motion: reduce) { .dp-pop, .dp-moved { animation: none; } }

/* ───────── узкий экран: меню становится строкой сверху ───────── */
@media (max-width: 900px) {
  :root[data-shell] body { padding-left: 0; }
  :root[data-shell] .top { position: sticky; top: 0; bottom: auto; width: auto; flex-direction: row; align-items: center; gap: .375rem; padding: .375rem .5rem; border-right: 0; border-bottom: 1px solid var(--line); }
  :root[data-shell] .sh-menu { flex-direction: row; align-items: center; gap: .25rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .sh-nav { flex-direction: row; gap: .125rem; }
  .sh-grp, .sh-brand b, .sh-status, .sh-find span, .sh-find kbd, .sh-it::before { display: none; }
  .sh-brand { padding: 0 .25rem; }
  .sh-find { width: 2.125rem; margin: 0; justify-content: center; }
  .sh-c { margin-left: .125rem; }
  :root[data-shell] .top-actions { margin: 0; padding: 0; border: 0; flex-wrap: nowrap; }
  :root[data-shell] .me-chip #me-name { display: none; }
  :root[data-shell] .view-panel { position: fixed; left: .5rem; right: .5rem; top: 3.25rem; bottom: auto; width: auto; max-width: none; }
  :root[data-shell] .subnav { position: static; padding: 0 1rem; }
  :root[data-shell] .subnav .top-title span { display: none; }
  :root[data-shell] .deals-view, :root[data-shell] .layout { padding: 1rem 1rem 4rem; }
  :root[data-shell] .tk-remind { margin: .75rem 1rem 0; }
  :root[data-shell] .bar { left: 0; }
  :root[data-shell] .side, :root[data-shell] .steps { top: auto; }
}
@media (prefers-reduced-motion: reduce) {
  :root[data-shell] *, :root[data-shell] *::before, :root[data-shell] *::after, .pal, .pal-box { animation: none !important; transition: none !important; }
}
