:root {
  --paper: #eef2f4;
  --ink: #14212b;
  --muted: #536271;
  --line: #dce4e9;
  --forest: #224f70;
  --navy: #1d3647;
  --blue: #2e669d;
}

.wrap { width: min(100% - 2.8rem, 1512px); }
.site-header { position: relative; z-index: 2; }
.header-inner { min-height: 57px; }
.brand img { width: 33px; height: 33px; }
.header-inner nav { gap: clamp(.7rem, 2vw, 1.8rem); }
.panorama { background: #fff; }
.panorama-scene { aspect-ratio: 3; min-height: 0; }
.panorama-scene > img { object-fit: cover; }
.panorama-scene:focus-within > img { transform: none; }
.panorama-title { position: absolute; z-index: 1; top: 5.5%; left: 2.5%; color: #12202a; }
.panorama-title h1 { font-size: clamp(2rem, 4.35vw, 4.2rem); line-height: 1; letter-spacing: -.058em; font-weight: 850; }
.panorama-subtitle { margin-top: .3rem; font-size: clamp(.92rem, 1.5vw, 1.38rem); font-weight: 730; }
.panorama-location { margin-top: .62rem; font-size: clamp(.72rem, 1.06vw, 1rem); font-weight: 610; }
.panorama-location span { margin-inline: .15rem; color: #617184; }
.map-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.map-lines g { filter: drop-shadow(0 1px 2px #17212b85); }
.map-lines path { stroke: #fff; stroke-width: 1.5; fill: none; }
.map-lines ellipse { fill: #fff; }
.map-lines .is-highlighted path { stroke-width: 2.75; }
.callout {
  position: absolute;
  left: var(--left);
  top: var(--top);
  z-index: 1;
  display: grid;
  justify-items: start;
  padding: .42rem .6rem .42rem .66rem;
  border: 1px solid #ffffffb5;
  border-left: 3px solid var(--tone);
  border-radius: 6px;
  background: #fbfdffef;
  box-shadow: 0 4px 16px #14212b33;
  line-height: 1.18;
  text-align: left;
  pointer-events: auto;
  transform: translateY(-50%);
  transition: background .16s, box-shadow .16s;
}
.callout:hover, .callout.is-highlighted { background: #fff; box-shadow: 0 0 0 2px var(--tone), 0 6px 18px #14212b55; z-index: 2; }
.callout span { font-size: clamp(.74rem, 1.02vw, .99rem); font-weight: 710; }
.callout strong { margin-top: .12rem; font-size: clamp(.91rem, 1.37vw, 1.32rem); font-weight: 800; letter-spacing: -.035em; white-space: nowrap; }
.callout small { margin-top: .13rem; font-size: .78rem; color: #344a5b; }
.panorama-toolbar { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding-block: .38rem; }
.panorama-toolbar .switch { background: #edf2f6; }
.panorama-toolbar .switch button { padding-block: .24rem; }
.panorama-toolbar .button { min-height: 32px; font-size: .82rem; }
.snapshot-date { color: var(--muted); font-size: .85rem; }

.overview { margin-top: .65rem; scroll-margin-top: .65rem; }
.overview-grid { display: grid; grid-template-columns: 1.14fr .91fr 1.19fr; gap: .64rem; }
.overview-grid > *, .forecast-grid > * { min-width: 0; }
.dashboard-card { min-width: 0; background: #fff; border: 1px solid #dce5eb; border-radius: 8px; box-shadow: 0 2px 8px #12233209; }
.dashboard-heading {
  padding: .47rem .7rem;
  color: #fff;
  background: var(--navy);
  border-radius: 7px 7px 0 0;
  font-size: .9rem;
  font-weight: 750;
  line-height: 1.28;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.dashboard-content { padding: .6rem .7rem; }
.budget-total, .forecast-total, .metrics-grid dd { font-variant-numeric: tabular-nums; letter-spacing: -.052em; font-weight: 830; line-height: 1.08; }
.budget-total { font-size: clamp(1.65rem, 3.14vw, 3.24rem); }
.budget-caption { display: flex; align-items: baseline; flex-wrap: wrap; gap: .14rem .55rem; color: var(--muted); font-size: .83rem; margin-block: .36rem .74rem; }
.budget-caption a, .dashboard-note a { color: var(--forest); }
.budget-breakdown { display: grid; grid-template-columns: minmax(102px, .92fr) minmax(0, 1.18fr); gap: .75rem; align-items: center; }
.donut { min-width: 0; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--segments, #dce5eb 0% 100%)); display: grid; place-items: center; }
.donut > span { width: 63%; aspect-ratio: 1; display: grid; align-content: center; justify-items: center; color: var(--ink); background: #fff; border-radius: 50%; line-height: 1.15; }
.donut strong { font-size: clamp(1.05rem, 2.35vw, 2.15rem); letter-spacing: -.06em; }
.donut small { margin-top: .15rem; color: var(--muted); font-size: .78rem; }
.budget-legend { margin: 0; padding: 0; list-style: none; }
.budget-legend li { display: grid; grid-template-columns: .58rem minmax(0,1fr) auto; align-items: start; gap: .35rem; padding: .29rem 0; border-bottom: 1px solid #edf1f4; font-size: .82rem; line-height: 1.26; }
.budget-legend li:last-child { border-bottom: 0; }
.budget-legend strong { display: block; font-size: .94rem; font-weight: 780; white-space: nowrap; }
.budget-legend i, .table-category i { width: .56rem; height: .56rem; border-radius: 2px; background: var(--tone); margin-top: .23rem; flex: none; }
.budget-legend b { font-variant-numeric: tabular-nums; color: #344e65; white-space: nowrap; }

.cost-details .dashboard-content { padding-top: .23rem; }
.cost-table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.cost-table td, .cost-table th { padding: .26rem 0 .26rem .38rem; text-align: right; border-bottom: 1px solid #e9eff3; white-space: nowrap; }
.cost-table th:first-child { text-align: left; padding: 0; white-space: normal; }
.cost-table thead th { font-size: .78rem; font-weight: 760; color: var(--muted); }
.cost-table tbody th { font-weight: 630; }
.cost-table tbody tr:hover { background: #f0f5f9; }
.table-category { display: flex; width: 100%; min-height: 1.58rem; align-items: baseline; gap: .4rem; text-align: left; padding: .16rem .2rem; border: 0; border-radius: 3px; background: transparent; line-height: 1.26; }
.table-category.is-highlighted, .table-category:hover { color: #164b76; text-decoration: underline; }
.dashboard-note { margin-top: .44rem; color: var(--muted); font-size: .78rem; line-height: 1.36; }

.dashboard-side { display: grid; align-content: start; gap: .65rem; }
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .46rem .64rem; }
.metrics-grid > div { padding-bottom: .39rem; border-bottom: 1px solid #e9eff3; }
.metrics-grid dt { font-size: .8rem; color: var(--muted); }
.metrics-grid dd { margin-top: .19rem; font-size: clamp(.98rem, 1.53vw, 1.47rem); white-space: nowrap; }
.forecast-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: .65rem; }
.forecast-line { display: flex; justify-content: space-between; align-items: baseline; column-gap: .3rem; padding-block: .19rem; border-bottom: 1px solid #edf1f4; font-size: .82rem; }
.forecast-line button { padding: 0; border: 0; text-align: left; background: transparent; }
.forecast-line button:hover { color: var(--forest); text-decoration: underline; }
.forecast-line strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.payment-total { border: 0; font-weight: 790; }
.forecast-card { background: #fff0c9; border-color: #efdfb4; }
.forecast-card .dashboard-heading { background: #ffe7aa; color: #33230f; }
.forecast-total { font-size: clamp(1.12rem, 1.95vw, 1.97rem); white-space: nowrap; }
.forecast-unit { margin-top: .24rem; color: #503b22; font-size: .93rem; font-weight: 720; }
.forecast-card .dashboard-note { color: #57452e; }

.overview-bottom { margin-top: .65rem; }
.trend-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .48rem; }
.trend-summary strong { font-size: 1.25rem; font-weight: 800; }
.trend-summary span { color: var(--muted); font-size: .8rem; }
.trend-chart { --chart-height: 119px; display: grid; grid-template-columns: 2.4rem 1fr; gap: .4rem; margin-top: .52rem; font-variant-numeric: tabular-nums; }
.trend-chart::before { content: "тыс. ₽"; grid-column: 1 / -1; color: var(--muted); font-size: .75rem; }
.trend-axis { height: var(--chart-height); display: flex; flex-direction: column; align-items: end; justify-content: space-between; color: var(--muted); font-size: .74rem; line-height: 1; }
.trend-columns { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); align-items: end; gap: .13rem; }
.trend-columns::before { content: ""; position: absolute; inset: 0 0 auto; height: var(--chart-height); border-bottom: 1px solid #9cabb5; background: repeating-linear-gradient(to top, #dbe4eb 0 1px, transparent 1px 25%); pointer-events: none; }
.trend-month { position: relative; min-width: 0; padding: 0; border: 0; background: transparent; }
.trend-month:disabled { cursor: default; }
.trend-bar-wrap { height: var(--chart-height); display: flex; align-items: end; justify-content: center; }
.trend-bar-wrap i { display: block; width: 73%; height: var(--height); background: var(--blue); border-radius: 3px 3px 0 0; }
.trend-month:hover:not(:disabled) .trend-bar-wrap i, .trend-month:focus-visible .trend-bar-wrap i { background: #163b5b; }
.trend-label { display: block; padding-top: .28rem; color: var(--muted); font-size: clamp(.55rem,.82vw,.76rem); }
.trend-month:disabled .trend-label { color: #65727b; }
.rank-list { margin: 0; list-style: none; }
.rank-list li + li { border-top: 1px solid #eef1f4; }
.rank-list button { width: 100%; display: grid; grid-template-columns: 1.1rem minmax(0,1fr) auto; align-items: baseline; gap: .13rem .38rem; padding: .24rem 0; border: 0; color: inherit; background: transparent; text-align: left; line-height: 1.24; }
.rank-list button:hover { color: var(--forest); }
.rank-index { display: inline-grid; place-items: center; min-width: 1.1rem; height: 1.1rem; align-self: start; background: #e9eff5; color: #324d64; border-radius: 50%; font-size: .69rem; font-weight: 750; grid-row: span 2; }
.rank-name { font-size: .8rem; }
.rank-name::first-letter { text-transform: uppercase; }
.rank-list strong { font-size: .78rem; white-space: nowrap; }
.rank-bar { grid-column: 2 / -1; height: 3px; background: #edf2f5; border-radius: 3px; }
.rank-bar i { display: block; width: var(--width); height: 100%; border-radius: inherit; background: #5083ab; }
.rank-list li:nth-child(2) .rank-bar i { background: #df912f; }
.brief-list { margin: 0; padding: 0; list-style: none; }
.brief-list li { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: .6rem; padding: .34rem 0; border-bottom: 1px solid #edf1f4; font-size: .83rem; }
.brief-list a { color: #234764; }
.brief-list strong { font-size: .78rem; white-space: nowrap; }
.questions { margin-top: .64rem; padding: .46rem .62rem; background: #eaf2fa; border-radius: 5px; }
.questions h3 { font-size: .9rem; }
.questions .brief-list li { border-color: #dce8f4; }
.questions > a { display: inline-block; margin-top: .4rem; font-size: .79rem; color: var(--forest); }

@media (max-width: 1120px) {
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-side { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .corrections-card { grid-column: 1 / -1; }
  .corrections-card .dashboard-content { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; align-items: start; }
  .questions { margin-top: 0; }
}

@media (max-width: 850px) {
  .wrap { width: calc(100% - 1.6rem); }
  .overview-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .dashboard-side { grid-template-columns: 1fr; }
  .callout { left: var(--anchor-x); top: var(--anchor-y); width: 24px; height: 24px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--tone); transform: translate(-50%,-50%); }
  .callout span, .callout strong, .callout small, .map-lines { display: none; }
  .callout:hover, .callout.is-highlighted { background: var(--tone); }
  .budget-breakdown { gap: .54rem; }
}

@media (max-width: 620px) {
  .header-inner nav { overflow-x: auto; gap: .85rem; }
  .header-inner nav a { flex: none; }
  .panorama-scene { aspect-ratio: auto; overflow: visible; }
  .panorama-title { position: static; padding: .75rem .8rem .58rem; background: #f1f5f7; }
  .panorama-title h1 { font-size: clamp(1.85rem, 8.4vw, 2.65rem); }
  .panorama-location { margin-top: .32rem; }
  .panorama-scene > img { position: static; height: auto; aspect-ratio: 3; }
  .panorama-scene .map-points { inset: auto 0 0; height: auto; aspect-ratio: 3; }
  .panorama-toolbar { flex-wrap: wrap; }
  .snapshot-date { order: 3; width: 100%; font-size: .78rem; }
  .overview-grid { grid-template-columns: minmax(0,1fr); }
  .budget-total { font-size: clamp(1.8rem, 8.6vw, 2.68rem); }
  .budget-breakdown { grid-template-columns: minmax(92px,.8fr) minmax(0,1.2fr); }
  .dashboard-side, .corrections-card { grid-column: auto; }
  .corrections-card .dashboard-content { display: block; }
  .forecast-grid { gap: .48rem; }
  .questions { margin-top: .6rem; }
}

@media (max-width: 380px) {
  .forecast-grid { grid-template-columns: minmax(0,1fr); }
  .dashboard-heading { padding-inline: .54rem; }
  .dashboard-content { padding-inline: .54rem; }
  .budget-legend li { font-size: .76rem; }
}
