:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1a2330;
  --ink-soft: #4a5568;
  --line: #d9dee5;
  --accent: #1a5fb4;
  --accent-ink: #ffffff;
  --good: #1b7a3d;
  --bad: #b3261e;
  --radius: 6px;
  font-size: 15px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.2rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.topbar h1 { font-size: 1.05rem; margin: 0; font-weight: 650; }
.topbar-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
#project-name {
  min-width: 16rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 1.2rem 0;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  overflow-x: auto;
}
.tab {
  border: 1px solid transparent;
  border-bottom: none;
  background: none;
  padding: 0.5rem 0.9rem;
  font: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active {
  background: var(--bg);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 600;
}

main { padding: 1.1rem 1.2rem 3.5rem; max-width: 1280px; margin: 0 auto; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.pane-head, .pane-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.2rem 0 0.8rem;
}
.pane-foot { justify-content: flex-start; margin-top: 1rem; }
.hint { color: var(--ink-soft); font-size: 0.85rem; max-width: 70ch; margin: 0; }

.btn {
  font: inherit;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { color: var(--accent-ink); filter: brightness(1.08); }
.btn-quiet { border-color: transparent; color: var(--ink-soft); }
select { font: inherit; padding: 0.35rem; border: 1px solid var(--line); border-radius: var(--radius); }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th, td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; }
th { background: #eef0f3; font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.section-row td { background: #f0f3f7; font-weight: 600; }
.col-name { min-width: 18rem; }

td input, td select {
  width: 100%;
  min-width: 3.5rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font: inherit;
  padding: 0.15rem 0.3rem;
  background: transparent;
}
td input:hover, td select:hover { border-color: var(--line); }
td input:focus, td select:focus { border-color: var(--accent); outline: none; background: #fff; }
td input.wide { min-width: 16rem; }
.row-del { border: none; background: none; color: var(--ink-soft); cursor: pointer; font-size: 1rem; }
.row-del:hover { color: var(--bad); }

.totals-grid, .results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 0.6rem;
  margin-top: 0.9rem;
}
.total-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
}
.total-card .label { font-size: 0.78rem; color: var(--ink-soft); }
.total-card .value { font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.total-card.accent { background: #eaf1fa; }
.total-card.accent .value { color: var(--accent); }
.pos { color: var(--good); }
.neg { color: var(--bad); }

.scenario { display: grid; grid-template-columns: minmax(320px, 5fr) minmax(300px, 4fr); gap: 1rem; }
@media (max-width: 900px) { .scenario { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}
.card h3 { margin: 0 0 0.6rem; font-size: 0.92rem; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem 0.9rem; }
.field { display: flex; flex-direction: column; gap: 0.15rem; }
.field label { font-size: 0.76rem; color: var(--ink-soft); }
.field input {
  font: inherit;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.field input:focus { border-color: var(--accent); outline: none; }

.result-rows { width: 100%; font-size: 0.87rem; }
.result-rows td { border-bottom: 1px solid var(--line); padding: 0.3rem 0.2rem; }
.result-rows td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.result-rows tr.head td { font-weight: 650; background: #f0f3f7; }
.result-rows tr.sum td { font-weight: 700; border-top: 2px solid var(--ink); }

.settings-group { margin-bottom: 1rem; }
.status { font-size: 0.82rem; color: var(--ink-soft); }

/* --- дашборд --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.95rem;
}
.kpi .label { font-size: 0.76rem; color: var(--ink-soft); }
.kpi .value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi .sub { font-size: 0.76rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.kpi.hero { background: var(--accent); border-color: var(--accent); }
.kpi.hero .label, .kpi.hero .sub { color: #cfe0f5; }
.kpi.hero .value { color: #fff; font-size: 1.75rem; }

.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 980px) { .dash-cols { grid-template-columns: 1fr; } }
.card-h, .card h2 { margin: 0 0 0.6rem; font-size: 0.95rem; font-weight: 650; }
.dash-controls-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }

.stackbar { display: flex; height: 34px; border-radius: 5px; overflow: hidden; margin: 0.5rem 0 0.9rem; }
.stackbar div { min-width: 2px; }
.sb-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem 1rem; font-size: 0.82rem; }
.sb-legend .li { display: flex; align-items: center; gap: 0.45rem; justify-content: space-between; }
.sb-legend .li .nm { display: flex; align-items: center; gap: 0.45rem; }
.sb-legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sb-legend .val { font-variant-numeric: tabular-nums; color: var(--ink-soft); white-space: nowrap; }

.slider-card { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.slider-card:last-child { border-bottom: none; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.slider-head label { font-size: 0.83rem; color: var(--ink-soft); }
.slider-head output {
  font-weight: 650; font-variant-numeric: tabular-nums; font-size: 0.95rem;
  min-width: 5.5rem; text-align: right;
}
.slider-card input[type="range"] { width: 100%; accent-color: var(--accent); margin: 0.25rem 0 0; }
.slider-decode { font-size: 0.74rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; margin-top: 0.15rem; min-height: 0.9rem; }

.switch { display: flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0; font-size: 0.86rem; }
.switch input { width: 2.4rem; height: 1.3rem; accent-color: var(--accent); }

.conditions { margin-top: 0.7rem; font-size: 0.83rem; }
.badge {
  display: inline-block; background: #e8eef7; color: #23446e; border-radius: 999px;
  padding: 0.12rem 0.6rem; margin: 0.15rem 0.25rem 0.15rem 0; font-size: 0.78rem;
}

/* --- слайдер: точное поле --- */
.slider-num {
  width: 5.5rem;
  font: inherit;
  font-variant-numeric: tabular-nums;
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}

/* --- подсказки --- */
.tip-wrap {
  position: relative;
  color: var(--accent);
  cursor: help;
  font-size: 0.8rem;
  outline: none;
}
.tip {
  display: none;
  position: absolute;
  left: 0;
  top: 1.4rem;
  z-index: 40;
  width: 22rem;
  max-width: 70vw;
  background: #22303f;
  color: #f2f5f9;
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(20, 28, 40, 0.35);
  white-space: normal;
  font-weight: 400;
}
.tip-wrap:hover .tip, .tip-wrap:focus .tip { display: block; }

/* --- детализация статей --- */
.hint-inline { font-size: 0.76rem; font-weight: 400; color: var(--ink-soft); margin-left: 0.6rem; }
.slider-group {
  font-size: 0.74rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0.7rem 0 0.1rem;
}
.slider-group:first-child { margin-top: 0; }

.dp-table { width: 100%; font-size: 0.87rem; }
.dp-table td { padding: 0.45rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dp-cell-check { width: 1.6rem; }
.dp-cell-name { }
.dp-sub { font-size: 0.73rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.dp-cell-val { text-align: right; white-space: nowrap; width: 11rem; }
.dp-val { font-weight: 650; font-variant-numeric: tabular-nums; padding: 0.12rem 0.5rem; border-radius: 4px; display: inline-block; }
.dp-val-blue { background: #eef4fc; color: #164a8a; border: 1px solid #9db8dc; }
.dp-val-red { background: #fdf1f0; color: #8f2b23; border: 1px solid #d8a5a1; }
.dp-val-pct { background: #eef0f3; color: var(--ink); border: 1px solid var(--line); }
.dp-val-off { background: none; color: var(--ink-soft); text-decoration: line-through; }
.dp-src { display: block; font-size: 0.7rem; color: var(--ink-soft); margin-top: 0.1rem; }
.dp-cell-gear { width: 2.2rem; text-align: right; }
.gear-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.15rem 0.45rem;
  color: var(--ink-soft);
}
.gear-btn:hover { color: var(--accent); border-color: var(--accent); }
tr.dp-off .dp-cell-name { color: var(--ink-soft); }

.dp-modal-choice { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.modal-wide { max-width: 980px; }

.dp-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.dp-label { min-width: 17rem; font-size: 0.88rem; }
.dp-choice, .dp-mode { display: flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; }
.dp-blue, .dp-red {
  width: 9rem;
  font: inherit;
  font-variant-numeric: tabular-nums;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  text-align: right;
}
.dp-blue { border: 1px solid #9db8dc; background: #eef4fc; color: #164a8a; }
.dp-red { border: 1px solid #d8a5a1; background: #fdf1f0; color: #8f2b23; }
.dp-red:focus { outline: none; border-color: var(--bad); }
.dp-info { font-size: 0.76rem; color: var(--ink-soft); padding: 0 0 0.3rem 2rem; }
.dp-drivers { padding: 0.4rem 0 0.7rem 2rem; border-bottom: 1px solid var(--line); }

/* --- модалки --- */
.modal-backdrop[hidden] { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 28, 40, 0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4rem 1rem 2rem; z-index: 50; overflow-y: auto;
}
.modal {
  background: var(--panel); border-radius: 8px; max-width: 720px; width: 100%;
  padding: 1rem 1.3rem 1.3rem; box-shadow: 0 12px 40px rgba(20, 28, 40, 0.25);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.modal textarea { width: 100%; min-height: 10rem; font: 0.82rem/1.4 ui-monospace, monospace; padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); }
.check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 1rem; margin: 0.4rem 0 0.8rem; }
.check-list label { display: flex; gap: 0.45rem; align-items: center; font-size: 0.86rem; }
.picker-list { max-height: 24rem; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.picker-item {
  display: flex; justify-content: space-between; gap: 0.8rem; width: 100%;
  padding: 0.45rem 0.7rem; border: none; border-bottom: 1px solid var(--line);
  background: none; font: inherit; text-align: left; cursor: pointer;
}
.picker-item:hover { background: #eef3fa; }
.picker-item .meta { color: var(--ink-soft); font-size: 0.8rem; white-space: nowrap; }
.picker-cap { padding: 0.35rem 0.7rem; background: #eef0f3; font-weight: 650; font-size: 0.8rem; }

/* --- смета: подпозиции --- */
.expander { border: none; background: none; cursor: pointer; font-size: 0.85rem; color: var(--ink-soft); width: 1.4rem; }
.expander.has-subs { color: var(--accent); font-weight: 700; }
tr.subrow > td { background: #f7f9fc; padding: 0.5rem 0.8rem 0.7rem 2.2rem; }
.subs-table { width: auto; min-width: 60%; }
.subs-table td, .subs-table th { border-bottom: 1px solid var(--line); font-size: 0.82rem; }
td input:disabled { color: var(--ink-soft); background: #f1f3f6; }

/* --- базы --- */
.db-section { margin-bottom: 1rem; }
.db-section-head {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem;
  background: #e9edf3; border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.db-section-head input { font-weight: 650; border: 1px solid transparent; background: transparent; font: inherit; flex: 1; padding: 0.15rem 0.3rem; border-radius: 4px; }
.db-section-head input:focus { border-color: var(--accent); background: #fff; outline: none; }
.mini-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 4px; cursor: pointer; font-size: 0.78rem; padding: 0.12rem 0.45rem; color: var(--ink-soft); }
.mini-btn:hover { color: var(--accent); border-color: var(--accent); }
#norms-search { font: inherit; padding: 0.38rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); min-width: 15rem; }
.btn-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.btn-row .btn { text-decoration: none; }

.settings-panel { margin-top: 1rem; }
.settings-panel > summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 0.95rem;
  list-style: none;
}
.settings-panel > summary::before { content: "▸ "; color: var(--accent); }
.settings-panel[open] > summary::before { content: "▾ "; }
.settings-panel[open] > summary { margin-bottom: 0.8rem; }

.dash-kpi-head { display: flex; gap: 0.7rem; align-items: flex-start; }
.dash-kpi-head .kpi-grid { flex: 1; }
.dash-kpi-side { display: flex; flex-direction: column; gap: 0.5rem; min-width: 15rem; }
#btn-trace { white-space: nowrap; }
.kpi-agreed input {
  width: 100%;
  font: inherit;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.kpi-agreed .sub { margin-top: 0.15rem; }

/* --- смета: зона КП и подгонка --- */
th.kp-col, td.kp-col { background: #f4f8fd; }
thead .zone-cap { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); border-bottom: none; }
th.kp-border, td.kp-border { border-right: 2px solid #9db8dc; }
td.kp-border { font-variant-numeric: tabular-nums; font-weight: 600; }
td.calc-sum { color: #164a8a; }
input.calc-price::placeholder { color: #6e93c4; font-style: italic; }
.row-add { border: none; background: none; color: var(--ink-soft); cursor: pointer; font-size: 1rem; width: 1.2rem; }
.row-add:hover { color: var(--good); }
.agreed-bar {
  margin: 0 0 0.6rem;
  padding: 0.5rem 0.8rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
.agreed-bar.ok { border-color: var(--good); }
.agreed-bar.hl { border-color: var(--accent); box-shadow: 0 0 0 2px #d6e4f5; }
.dp-formula { border-top: 1px solid var(--line); padding-top: 0.5rem; }
.db-arrow {
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  font-size: 0.8rem;
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: transform 0.12s;
}
details[open] > summary .db-arrow { transform: rotate(90deg); }

.trace h3 { margin: 0.9rem 0 0.3rem; font-size: 0.9rem; }
.trace h3:first-child { margin-top: 0; }
.trace-li {
  font-size: 0.86rem;
  padding: 0.28rem 0 0.28rem 0.9rem;
  border-left: 2px solid var(--line);
  margin-left: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.db-sec { margin-bottom: 0.8rem; }
.db-sec > summary { list-style: none; cursor: pointer; }
.db-sec > summary::-webkit-details-marker { display: none; }
.db-sub { margin: 0.4rem 0 0.4rem 1.2rem; }
.db-sub > summary { list-style: none; cursor: pointer; }
.db-sub-head {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.5rem; background: #f0f3f7;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.db-sub-head input { font-weight: 600; border: 1px solid transparent; background: transparent; font: inherit; flex: 0 1 22rem; padding: 0.1rem 0.3rem; border-radius: 4px; }
.db-sub-head input:focus { border-color: var(--accent); background: #fff; outline: none; }
.db-sub .table-wrap { margin-top: 0.3rem; }

/* --- стартовая страница --- */
.home-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin: 0.4rem 0 1.1rem;
  flex-wrap: wrap;
}
.home-hero h2 { margin: 0 0 0.3rem; font-size: 1.55rem; letter-spacing: -0.01em; }
.home-hero .hint { max-width: 56ch; }
.btn-lg { font-size: 1rem; padding: 0.6rem 1.3rem; }

.home-stats { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 1rem; }
.hs {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  min-width: 9rem;
}
.hs .v { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hs .l { font-size: 0.76rem; color: var(--ink-soft); }

.home-filter { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.7rem; }
#home-search {
  flex: 1;
  min-width: 16rem;
  font: inherit;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}
#home-search:focus { border-color: var(--accent); outline: none; }
.home-filter select { padding: 0.45rem 0.6rem; border-radius: 8px; }

.home-clients { margin-bottom: 1rem; display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.client-chip {
  font: inherit;
  font-size: 0.82rem;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
}
.client-chip span { color: var(--ink-soft); font-size: 0.75rem; }
.client-chip:hover, .client-chip.on { border-color: var(--accent); color: var(--accent); }

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0.9rem;
}
.pcard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1.05rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pcard:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(26, 45, 74, 0.1);
}
.pcard-top { display: flex; justify-content: space-between; gap: 0.8rem; align-items: flex-start; }
.pcard h3 { margin: 0; font-size: 1rem; line-height: 1.35; }
.pstatus {
  flex: none;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--st);
  border: 1px solid color-mix(in srgb, var(--st) 45%, transparent);
  background: color-mix(in srgb, var(--st) 9%, transparent);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  white-space: nowrap;
}
.pcard-meta { display: flex; gap: 0.8rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--ink-soft); }
.pcard-systems { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.syschip {
  font-size: 0.72rem;
  background: #e8eef7;
  color: #23446e;
  border-radius: 4px;
  padding: 0.14rem 0.5rem;
}
.pcard-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 0.5rem;
  margin-top: auto;
  font-variant-numeric: tabular-nums;
}
.home-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-soft);
  padding: 3rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

/* --- режимы приложения --- */
.proj-only { display: none !important; }
body.project-open .proj-only { display: revert !important; }
body.project-open .tabs .proj-only { display: inline-block !important; }
/* таб-бар скрыт на стартовой; появляется при открытом расчёте или глобальном разделе */
.tabs { display: none; }
body.project-open .tabs, body.section-open .tabs { display: flex; }
.sec-tab { display: none; }
body.project-open .sec-tab, body.section-open .sec-tab { display: inline-block; }
#tab-btn-home { font-weight: 650; }

.home-sec { font-size: 1.05rem; margin: 1.6rem 0 0.7rem; }
.home-globals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.8rem;
}
.gcard {
  font: inherit;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
}
.gcard:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(26, 45, 74, 0.1);
}
.gcard .gi { font-size: 1.3rem; }
.gcard .gt { font-weight: 650; }
.gcard .gs { font-size: 0.82rem; color: var(--ink); }
.gcard .gh { font-size: 0.75rem; color: var(--ink-soft); }

.statusline {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 0.35rem 1.2rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* --- карточки компаний в настройках --- */
.comp-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 0.6rem;
  padding: 0.55rem 0.8rem;
  background: #fafbfc;
}
.comp-card > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.comp-card > summary::-webkit-details-marker { display: none; }
.comp-card[open] > summary { margin-bottom: 0.6rem; }
