/* Страница дашборда: только токены темы. */
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: 0; }

/* шапка: тёмная полоса от края до края */
.masthead { padding-block: clamp(20px, 3vw, 36px) clamp(24px, 3vw, 40px); }
.masthead-inner { display: grid; gap: 18px; }
.masthead-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand-line { color: var(--on-ink-muted); font-size: var(--fs-small); }
.masthead .display { max-width: 22ch; }
.masthead .lead { color: var(--on-ink-muted); max-width: 70ch; }
.theme-btn, .reset-btn { min-height: 44px; padding: 0 16px; border-radius: var(--radius-button); border: 1px solid var(--on-ink-muted); background: transparent; color: var(--on-ink); font-weight: 500; cursor: pointer; }
.theme-btn:hover, .reset-btn:hover { background: color-mix(in srgb, var(--on-ink) 10%, transparent); }
.filters { display: grid; gap: 12px 16px; grid-template-columns: 1fr 1fr; align-items: end; margin-top: 8px; padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--on-ink) 18%, transparent); }
.filter { display: grid; gap: 6px; min-width: 0; }
.filter-wide { grid-column: 1 / -1; }
.filter label { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: var(--tr-eyebrow); color: var(--on-ink-muted); }
.filters select, .filters input { min-height: 44px; width: 100%; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--on-ink) 30%, transparent); background: color-mix(in srgb, var(--on-ink) 8%, var(--ink-field)); color: var(--on-ink); color-scheme: dark; }
.filters .reset-btn { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .filters { grid-template-columns: 1.1fr 1.8fr 1fr 1fr auto; }
  .filter-wide, .filters .reset-btn { grid-column: auto; }
}

/* плитки: колонки с волосяными линиями, без карточек */
.tiles-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 20px; }
.tiles { display: grid; grid-template-columns: 1fr; }
.tile { padding: 22px 0 26px; border-top: 1px solid var(--line-strong); display: grid; align-content: start; gap: 10px; }
@media (min-width: 760px) {
  .tiles { grid-template-columns: 1fr 1fr; column-gap: 32px; }
}
@media (min-width: 1200px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 0; border-top: 1px solid var(--line-strong); }
  .tile { border-top: 0; padding: 22px 24px 8px; border-left: 1px solid var(--line); }
  .tile:first-child { border-left: 0; padding-left: 0; }
}
.tile-code { color: var(--accent-text); font-weight: 500; }
.tile-name { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; min-height: 2.6em; }
.tile-value { font-size: clamp(2.6rem, 2rem + 2vw, 3.4rem); }
.is-assumed { text-decoration: underline dashed var(--mark); text-decoration-thickness: 3px; text-underline-offset: 8px; }
.tile-sub { color: var(--muted-strong); font-size: var(--fs-small); line-height: 1.5; }
.tile-facts { display: grid; gap: 6px; font-size: var(--fs-small); margin-top: 4px; }
.tile-facts div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px dotted var(--line); }
.tile-facts dt { color: var(--muted); }
.tile-facts dd { margin: 0; text-align: right; white-space: nowrap; }
.cov { display: grid; gap: 6px; margin-top: 6px; }
.cov-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.cov-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.cov-text { font-size: var(--fs-micro); color: var(--muted); line-height: 1.45; }
.caveats { display: grid; gap: 6px; font-size: var(--fs-micro); color: var(--muted-strong); line-height: 1.45; }
.caveats li { padding-left: 14px; position: relative; }
.caveats li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 1px; background: var(--muted); }

.tag { display: inline-block; font-family: var(--font-mono); font-size: var(--fs-micro); line-height: 1.3; padding: 2px 8px; border-radius: 4px; vertical-align: 1px; white-space: nowrap; }
.tag-mark { background: var(--mark-soft); color: var(--mark-ink); box-shadow: inset 0 -2px 0 var(--mark); }
.tag-ok { background: var(--accent-soft); color: var(--accent-text); }

/* графики */
.charts { display: grid; gap: 40px; }
@media (min-width: 980px) { .charts { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; } }
.chart-col { min-width: 0; }
.chart-head { display: grid; gap: 4px; margin-bottom: 10px; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--bar); }
.chart .bar-muted { fill: var(--bar-muted); }
.chart .hit { fill: transparent; }
.chart .bar-g:hover .bar { fill: var(--accent-text); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .baseline { stroke: var(--line-strong); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.chart .val { fill: var(--ink); font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.tbl { margin-top: 8px; font-size: var(--fs-small); }
.tbl summary { cursor: pointer; color: var(--accent-text); min-height: 32px; display: inline-flex; align-items: center; }
.trend-switch { display: flex; gap: 6px; margin-bottom: 14px; }
.trend-switch button { min-height: 40px; min-width: 52px; padding: 0 12px; border-radius: var(--radius-button); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-family: var(--font-mono); cursor: pointer; }
.trend-switch button[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent-on-fill); border-color: var(--accent-fill); }

/* таблицы и две панели */
.panel { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); padding: clamp(14px, 2vw, 24px); min-width: 0; }
.split-top { display: grid; gap: 20px; }
@media (min-width: 980px) { .split-top { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 56px; } }
.intro-side { display: grid; gap: 10px; align-content: start; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line-strong); }
table.data td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data .r { text-align: right; white-space: nowrap; }
.panel > p { margin-top: 12px; }

/* оценка затрат: тонированное поле «разметка» */
.cost-band { background: var(--field-2); color: var(--field-2-ink); padding-block: clamp(32px, 4vw, 56px); }
.cost-band h2 { margin-bottom: 16px; }
.cost-row { display: grid; gap: 20px; margin-bottom: 14px; }
@media (min-width: 760px) { .cost-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cost-row dt { font-size: var(--fs-small); }
.cost-row dd { margin: 4px 0 0; }
.cost-row .num { font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.4rem); }
.cost-empty { max-width: 70ch; }

/* панель «Допущения» */
.assume-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 12px; }
.assume-head .lead { margin-top: 10px; }
.reset-quiet { border-color: var(--line-strong); color: var(--ink); }
.reset-quiet:hover { background: var(--surface-2); }
.fields { margin-top: 18px; display: grid; gap: 28px; }
.fgroup { border: 0; margin: 0; padding: 0; min-width: 0; }
.fgroup legend { padding: 0 0 8px; color: var(--accent-text); }
.frow { display: grid; gap: 10px; padding: 14px 0 14px 14px; border-top: 1px solid var(--line); border-left: 3px solid transparent; }
.frow.is-assumption { border-left-color: var(--mark); }
.flabel label { font-weight: 500; }
.fsrc { color: var(--muted); font-size: var(--fs-micro); margin-top: 4px; }
.finput input, .finput select, .finput textarea { width: 100%; min-height: 44px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); }
.finput textarea { resize: vertical; }
.fstatus { display: flex; flex-wrap: wrap; gap: 6px; align-content: start; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--radius-button); border: 1px solid var(--line-strong); font-size: var(--fs-small); }
.seg input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (min-width: 900px) { .frow { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 4fr); align-items: start; gap: 20px; } }

.foot { background: var(--surface-2); padding-block: 36px; margin-top: 48px; }
.foot-inner { display: grid; gap: 14px; font-size: var(--fs-small); color: var(--muted-strong); max-width: 90ch; }
@media print { .filters, .theme-btn, .reset-btn, .trend-switch, .fstatus { display: none; } }
