:root {
  --page: #101723;
  --header: #111a28;
  --surface: #182334;
  --surface-strong: #273757;
  --surface-deep: #131d2b;
  --line: #34445c;
  --line-strong: #5963a1;
  --text: #f4f6fb;
  --muted: #aebbd0;
  --muted-dark: #8190aa;
  --violet: #8d7dff;
  --green: #81d2a8;
  --amber: #f4c574;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

button,
input,
select { font: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.dashboard-shell {
  display: grid;
  grid-template-rows: 78px auto;
  min-height: max(620px, 100dvh);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(235px, 1.1fr) minmax(145px, .72fr) auto minmax(145px, .65fr);
  gap: 22px;
  align-items: center;
  padding: 10px clamp(24px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--header);
}

.brand p,
.screen-kicker,
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.brand h1,
.center-picker select {
  margin: 2px 0 0;
  font-size: clamp(21px, 1.9vw, 28px);
  line-height: 1.05;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.center-picker {
  position: relative;
  display: block;
  width: min(100%, 330px);
}

.center-picker::after {
  position: absolute;
  right: 1px;
  bottom: 3px;
  color: var(--muted-dark);
  content: "⌄";
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
}

.center-picker select {
  display: block;
  width: 100%;
  padding: 0 22px 0 0;
  border: 0;
  border-radius: 3px;
  outline: 0;
  appearance: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.center-picker select:disabled {
  cursor: wait;
  opacity: 1;
}

.center-picker select:hover:not(:disabled),
.center-picker select:focus-visible {
  background: rgba(52, 68, 92, .28);
  box-shadow: 0 0 0 1px var(--line);
}

.center-picker option {
  background: var(--header);
  color: var(--text);
  font-size: 14px;
  letter-spacing: normal;
}

.report-name {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.report-name span,
.report-name small,
.freshness span,
.freshness strong {
  display: block;
}

.report-name span {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.report-name small,
.freshness span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.period-picker {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
}

.period-picker label {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.period-picker input {
  width: 132px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: none;
  background: #151f2e;
  color: var(--text);
  color-scheme: dark;
  font-size: 11px;
}

.period-picker select {
  width: 116px;
  height: 34px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: none;
  appearance: none;
  background: #151f2e;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
}

.month-picker { position: relative; }

.month-picker::after {
  position: absolute;
  right: 9px;
  color: var(--muted-dark);
  content: "⌄";
  pointer-events: none;
}

.period-picker select:hover:not(:disabled),
.period-picker select:focus-visible,
.period-picker input:hover,
.period-picker input:focus-visible { border-color: #647392; }

.period-picker select:disabled { cursor: wait; }

.period-dash { color: var(--muted-dark); }

.freshness {
  justify-self: end;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  text-align: right;
}

.freshness strong {
  margin-top: 2px;
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
}

/* Компактная шапка основной витрины. */
.layout-card-compact .dashboard-shell {
  grid-template-rows: 64px auto;
}

.layout-card-compact .topbar {
  gap: 18px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.layout-card-compact .brand p {
  font-size: 9px;
}

.layout-card-compact .brand h1,
.layout-card-compact .center-picker select {
  margin-top: 1px;
  font-size: clamp(19px, 1.55vw, 24px);
}

.layout-card-compact .report-name,
.layout-card-compact .freshness {
  padding-left: 15px;
}

.layout-card-compact .report-name span {
  font-size: 12px;
}

.layout-card-compact .report-name small,
.layout-card-compact .freshness span {
  margin-top: 1px;
  font-size: 9px;
}

.layout-card-compact .period-picker {
  gap: 6px;
}

.layout-card-compact .period-picker label {
  gap: 5px;
  font-size: 9px;
}

.layout-card-compact .period-picker input {
  width: 124px;
  height: 30px;
  font-size: 10px;
}

.layout-card-compact .freshness strong {
  margin-top: 1px;
  font-size: 10px;
}

.report-screen {
  position: relative;
  min-height: 0;
  padding: 15px clamp(24px, 3vw, 48px) 22px;
}

.dashboard-state {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: #151f2e;
}

.dashboard-state[hidden] { display: none; }

.dashboard-state > div {
  display: grid;
  gap: 2px;
}

.dashboard-state span {
  color: var(--muted-dark);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.dashboard-state strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.35;
}

.dashboard-state[data-state="partial"],
.dashboard-state[data-state="stale"] { border-color: rgba(244, 197, 116, .52); }

.dashboard-state[data-state="partial"] span,
.dashboard-state[data-state="stale"] span { color: var(--amber); }

.dashboard-state[data-state="error"] { border-color: rgba(233, 143, 153, .58); }

.dashboard-state[data-state="error"] span { color: #e98f99; }

.dashboard-state button {
  flex: none;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 10px;
  transition: border-color 170ms ease, background-color 170ms ease, transform 170ms ease;
}

.dashboard-state button:hover,
.dashboard-state button:focus-visible {
  border-color: #647392;
  outline: 0;
  background: var(--surface-strong);
}

.dashboard-state button:active { transform: translateY(1px); }

.app-not-ready .dashboard-grid {
  pointer-events: none;
  user-select: none;
}

.app-not-ready .dashboard-grid .card { position: relative; }

.app-not-ready .dashboard-grid .card > * { opacity: 0; }

.app-not-ready .dashboard-grid .card::after {
  position: absolute;
  inset: 18px;
  background: linear-gradient(100deg, rgba(52, 68, 92, .16) 20%, rgba(89, 99, 161, .22) 42%, rgba(52, 68, 92, .16) 64%);
  background-size: 240% 100%;
  content: "";
  animation: dashboard-loading 1.4s ease-in-out infinite;
}

@keyframes dashboard-loading {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.screen-topline {
  display: flex;
  min-height: 40px;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 11px;
}

.screen-topline h2 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -.035em;
}

.period-summary { text-align: right; }

.period-summary strong,
.period-summary span { display: block; }

.period-summary strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.period-summary span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows:
    clamp(238px, 39vh, 300px)
    clamp(205px, 34vh, 250px)
    clamp(215px, 34vh, 250px);
  align-content: start;
  gap: 12px;
  height: auto;
}

/* Основная трёхрядная витрина: плотнее по вертикали, без потери масштаба данных. */
.layout-card-compact .report-screen {
  padding-top: 18px;
  padding-bottom: 16px;
}

.layout-card-compact .screen-topline {
  min-height: 36px;
  margin-bottom: 9px;
}

.layout-card-compact .dashboard-grid {
  grid-template-rows:
    clamp(250px, 28vh, 320px)
    clamp(220px, 24vh, 270px)
    clamp(245px, 23vh, 270px);
}

.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }

.layout-source-priority .dashboard-grid > .card:nth-child(2) { grid-column: span 6; }
.layout-source-priority .dashboard-grid > .card:nth-child(3) {
  grid-column: 7 / span 3;
  grid-row: 2;
}
.layout-source-priority .dashboard-grid > .card:nth-child(4) {
  grid-column: 10 / span 3;
  grid-row: 2;
}
.layout-source-priority .dashboard-grid > .card:nth-child(5) {
  display: none;
}
.layout-source-priority .dashboard-grid > .card:nth-child(6) {
  grid-column: 1 / span 6;
  grid-row: 2;
}

.layout-source-priority .source-list--overview > div {
  grid-template-columns: minmax(118px, .58fr) minmax(80px, 1fr) 34px;
}

.layout-source-priority .validity-share { margin-top: 9px; }

.card {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  justify-content: space-between;
  padding: 13px 14px 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
}

.card--hero {
  border-color: var(--line-strong);
  background: var(--surface-strong);
  container-type: inline-size;
}

.layout-card-compact .card--hero {
  position: relative;
}

.is-clickable { cursor: pointer; }

.is-clickable:hover,
.is-clickable:focus-visible {
  border-color: #697797;
  outline: none;
}

.card--hero:hover,
.card--hero:focus-visible { border-color: #7b7fd0; }

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.plan-slider-head {
  display: flex;
  min-height: 26px;
  flex: none;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.plan-slider-head h3 {
  margin: 0;
  padding: 0;
  font-size: clamp(17px, 1.45vw, 21px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.card h3 {
  margin: 5px 0 5px;
  font-size: clamp(17px, 1.45vw, 21px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.layout-card-compact .card-title-row h3 {
  min-width: 0;
  flex: 1;
  margin: 0 0 5px;
}

.layout-card-compact .card-title-row .truth {
  flex: none;
}

.card-copy {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.truth,
.route {
  color: var(--green);
  font-size: 10px;
  line-height: 1;
}

.truth {
  padding: 4px 6px;
  border: 1px solid #3a7660;
  border-radius: 4px;
  white-space: nowrap;
}

.slider-head { min-height: 25px; }

.layout-card-compact .slider-head {
  position: absolute;
  z-index: 1;
  top: 13px;
  right: 14px;
  min-height: 21px;
  justify-content: flex-end;
}

.layout-card-compact .card--hero .slide h3 {
  margin-top: 0;
  padding-right: 104px;
}

.slider-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.slider-controls button {
  display: grid;
  width: 24px;
  height: 22px;
  place-items: center;
  padding: 0;
  border: 1px solid #5b6990;
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  line-height: 1;
}

.slider-controls button:hover,
.slider-controls button:focus-visible {
  border-color: var(--violet);
  outline: none;
}

.slider-controls span {
  min-width: 30px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.slider-controls b { color: var(--text); }

.slides {
  display: grid;
  min-height: 0;
  flex: 1;
}

.slide {
  grid-area: 1 / 1;
  min-height: 0;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.slide.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.plan-slide {
  display: grid;
  min-height: 0;
  grid-template-rows: auto 1fr;
}

.plan-slide--overall,
.plan-slide--channel,
.plan-slide--attendance {
  grid-template-rows: auto auto minmax(44px, .72fr);
  row-gap: clamp(6px, 1vh, 10px);
}

.plan-slide-label {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.plan-overview-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 24px);
  align-self: center;
}

.plan-kpi {
  min-width: 0;
  padding-left: clamp(9px, 1vw, 14px);
  border-left: 2px solid var(--violet);
}

.plan-kpi__label,
.plan-channel-primary > .plan-kpi__label {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-kpi__numbers {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: baseline;
  margin-top: 2px;
}

.plan-kpi__numbers strong {
  font-size: clamp(25px, 2.15vw, 34px);
  line-height: 1;
  letter-spacing: -.055em;
}

.plan-kpi__numbers > span {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.plan-kpi__numbers b {
  color: var(--text);
  font-size: 13px;
}

.plan-progress {
  position: relative;
  height: 4px;
  overflow: hidden;
  margin-top: 8px;
  background: #26344b;
}

.plan-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--violet);
  transition: width 180ms ease;
}

.plan-progress.is-unavailable,
.validity-share__track.is-unavailable {
  background: repeating-linear-gradient(
    90deg,
    rgba(129, 144, 170, .12) 0,
    rgba(129, 144, 170, .12) 8px,
    rgba(129, 144, 170, .03) 8px,
    rgba(129, 144, 170, .03) 14px
  );
}

.plan-kpi > small,
.plan-channel-primary > small {
  display: block;
  margin-top: 5px;
  color: #d2daea;
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
}

.plan-channel-layout {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(160px, .85fr) minmax(0, 2.15fr);
  gap: clamp(18px, 2.3vw, 34px);
  align-self: center;
  align-items: center;
}

.plan-channel-primary {
  min-width: 0;
  padding-right: clamp(16px, 2vw, 28px);
  border-right: 1px solid #465774;
}

.plan-kpi__numbers--large strong {
  font-size: clamp(32px, 3vw, 44px);
}

.plan-kpi__numbers--large b {
  font-size: clamp(14px, 1.3vw, 18px);
}

.plan-support-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.plan-support-grid > div {
  min-width: 0;
  padding: 4px clamp(8px, 1vw, 14px);
  border-left: 1px solid #465774;
}

.plan-support-grid > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.plan-support-grid span,
.plan-support-grid strong,
.plan-support-grid small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-support-grid span,
.plan-support-grid small {
  color: var(--muted);
  font-size: 9px;
}

.plan-support-grid strong {
  margin: 4px 0 3px;
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1;
  letter-spacing: -.04em;
}

.plan-attendance-layout {
  display: grid;
  width: 100%;
  grid-template-columns: .75fr .9fr 1.8fr;
  gap: clamp(18px, 2.4vw, 36px);
  align-self: center;
  align-items: center;
}

.plan-attendance-primary,
.plan-attendance-target {
  min-width: 0;
  padding-left: clamp(10px, 1vw, 14px);
  border-left: 2px solid var(--violet);
}

.plan-attendance-target {
  border-left-color: #596983;
}

.plan-attendance-primary > span,
.plan-attendance-target > span,
.plan-attendance-primary > small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.plan-attendance-primary > strong,
.plan-attendance-target > strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1;
  letter-spacing: -.05em;
}

.plan-attendance-primary > small {
  margin-top: 7px;
  color: #d2daea;
}

.plan-progress--attendance {
  margin-top: 9px;
}

.plan-attendance-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-attendance-detail > div {
  min-width: 0;
  padding: 4px clamp(8px, 1vw, 14px);
  border-left: 1px solid #465774;
}

.plan-attendance-detail span,
.plan-attendance-detail strong {
  display: block;
}

.plan-attendance-detail span {
  min-height: 21px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.15;
}

.plan-attendance-detail strong {
  margin-top: 4px;
  font-size: clamp(18px, 1.55vw, 23px);
  line-height: 1;
}

.plan-dynamics-strip {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(104px, .72fr) minmax(0, 2.28fr);
  gap: clamp(12px, 1.8vw, 24px);
  align-items: end;
  padding-top: 8px;
  border-top: 1px solid #465774;
}

.plan-dynamics-caption span,
.plan-dynamics-caption strong,
.plan-dynamics-caption small {
  display: block;
}

.plan-dynamics-caption span,
.plan-dynamics-caption small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.2;
}

.plan-dynamics-caption strong {
  margin: 3px 0 2px;
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.card--hero .slide[data-slide="0"] {
  display: grid;
  grid-template-rows: auto 1fr;
}

.card--hero .slide[data-slide="0"] h3 {
  margin-bottom: 0;
}

.card--hero .slide[data-slide="0"] .funnel-values {
  align-self: center;
  width: 100%;
  margin-top: 0;
}

.funnel-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: clamp(14px, 2.5vh, 24px);
}

.funnel-values > div {
  min-width: 0;
  padding: 3px 7px 2px 10px;
  border-left: 2px solid var(--violet);
}

.funnel-values span,
.funnel-values small,
.funnel-values strong { display: block; }

.funnel-values span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnel-values strong {
  margin-top: 1px;
  font-size: clamp(26px, 2.25vw, 34px);
  line-height: 1;
  letter-spacing: -.055em;
}

.funnel-values small {
  margin-top: 6px;
  color: #d2daea;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.source-list {
  display: grid;
  gap: 2px;
  margin-top: 6px;
}

.source-list > div {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) 31px;
  gap: 8px;
  align-items: center;
  min-height: 14px;
  font-size: 10px;
}

.source-list span {
  overflow: hidden;
  color: #e1e7f2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-list i {
  display: block;
  width: var(--bar-width);
  min-width: 2px;
  height: 6px;
  background: var(--violet);
  opacity: .85;
}

.source-list b { text-align: right; }

.source-list--overview {
  gap: 0;
  margin-top: 9px;
}

.source-list--overview > div {
  grid-template-columns: minmax(76px, .8fr) minmax(34px, 1fr) 28px;
  min-height: 24px;
  border-bottom: 1px solid #314056;
}

.source-list--overview span { font-size: 9px; }
.source-list--overview i { height: 5px; }
.source-list--overview b { font-size: 10px; }

.layout-card-compact .dashboard-grid > .card:nth-child(2) .card-copy,
.layout-card-compact .dashboard-grid > .card:nth-child(3) .card-copy {
  font-size: 12px;
  line-height: 1.4;
}

.layout-card-compact .dashboard-grid > .card:nth-child(2) .truth,
.layout-card-compact .dashboard-grid > .card:nth-child(3) .truth {
  font-size: 11px;
}

.layout-card-compact .dashboard-grid > .card:nth-child(2) .source-list--overview > div {
  min-height: 26px;
  font-size: 11px;
}

.layout-card-compact .dashboard-grid > .card:nth-child(2) .source-list--overview span,
.layout-card-compact .dashboard-grid > .card:nth-child(2) .source-list--overview b {
  font-size: 11px;
}

.layout-card-compact .dashboard-grid > .card:nth-child(3) .schema-list > div {
  min-height: 26px;
  font-size: 12px;
}

.layout-card-compact .dashboard-grid > .card:nth-child(2) .card-footer,
.layout-card-compact .dashboard-grid > .card:nth-child(3) .card-footer {
  font-size: 10px;
}

.mini-bars {
  display: grid;
  height: clamp(44px, 7.4vh, 64px);
  gap: 3px;
  align-items: end;
  margin-top: 10px;
}

.mini-bars i {
  display: block;
  min-height: 2px;
  background: var(--violet);
  opacity: .78;
}

.plan-mini-bars {
  position: relative;
  isolation: isolate;
  height: 100%;
  min-height: 44px;
  overflow: hidden;
  margin-top: 0;
}

.plan-mini-bars.has-plan::after {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: var(--plan-level, 50%);
  left: 0;
  border-top: 1px dashed rgba(210, 218, 234, .55);
  content: "";
  pointer-events: none;
}

.data-unavailable {
  display: flex;
  min-height: 48px;
  align-items: center;
  margin: 0;
  color: var(--muted-dark);
  font-size: 10px;
  line-height: 1.4;
}

.mini-bars > .data-unavailable {
  grid-column: 1 / -1;
  align-self: center;
  justify-content: center;
}

.plan-mini-bars i {
  position: relative;
  z-index: 1;
}

@container (max-width: 620px) {
  .plan-slide--overall,
  .plan-slide--channel,
  .plan-slide--attendance {
    row-gap: 5px;
  }

  .plan-overview-grid {
    gap: 6px;
  }

  .plan-kpi {
    padding-left: 7px;
  }

  .plan-kpi__numbers {
    gap: 4px;
  }

  .plan-kpi__numbers strong {
    font-size: clamp(23px, 7cqw, 29px);
  }

  .plan-kpi__numbers > span {
    font-size: 8px;
  }

  .plan-kpi__numbers b {
    font-size: 10px;
  }

  .plan-kpi > small,
  .plan-channel-primary > small {
    font-size: 8px;
  }

  .plan-channel-layout {
    grid-template-columns: minmax(125px, .75fr) minmax(0, 1.25fr);
    gap: 14px;
  }

  .plan-channel-primary {
    padding-right: 12px;
  }

  .plan-support-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 14px;
  }

  .plan-support-grid > div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .plan-support-grid strong {
    font-size: 17px;
  }

  .plan-attendance-layout {
    grid-template-columns: .8fr 1fr;
    gap: 12px;
  }

  .plan-attendance-detail {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #465774;
  }

  .plan-attendance-detail > div:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .plan-dynamics-strip {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    padding-top: 6px;
  }

  .plan-mini-bars {
    min-height: 38px;
  }
}

.schema-list {
  display: grid;
  gap: 0;
  margin-top: 8px;
}

.schema-list > div {
  display: flex;
  min-height: 24px;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #314056;
  font-size: 11px;
}

.schema-list span { color: var(--muted); }
.schema-list b { font-weight: 650; }

.schema-list .accent-row span,
.schema-list .accent-row b { color: var(--green); }

.schema-list .conversion-row span,
.schema-list .conversion-row b { color: #b2a7ff; }

.reason-overview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reason-summary { margin-top: 9px; }

.site-source-tree {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  margin-top: 10px;
}

.site-source-tree > div {
  display: flex;
  gap: 7px;
  align-items: baseline;
}

.site-source-tree strong,
.channel-total strong {
  font-size: 30px;
  line-height: .95;
  letter-spacing: -.055em;
}

.site-source-tree span,
.channel-total span {
  color: var(--muted);
  font-size: 11px;
}

.site-source-tree .tree-branch {
  padding-left: 14px;
  border-left: 2px solid var(--violet);
}

.site-source-tree .tree-branch strong { color: #b2a7ff; }

.metric-caption {
  margin: 12px 0 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.channel-total {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-top: 12px;
}

.channel-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 8px;
  border-top: 1px solid #4a5c79;
  background: #141f30;
}

.channel-kpis > div {
  min-width: 0;
  padding: 8px 9px 7px;
  border-right: 1px solid #34445c;
}

.channel-kpis > div:last-child { border-right: 0; }

.channel-kpis strong,
.channel-kpis span { display: block; }

.channel-kpis strong {
  font-size: 21px;
  line-height: 1;
  letter-spacing: -.045em;
}

.channel-kpis span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.channel-note { margin-top: 8px; }

.source-list--results {
  gap: 0;
  margin-top: 7px;
}

.source-list--results > div {
  grid-template-columns: minmax(72px, .72fr) minmax(40px, 1fr) 28px;
  min-height: 21px;
  border-bottom: 1px solid #314056;
}

.source-list--results span,
.source-list--results b { font-size: 10px; }

.trial-list { margin-top: 7px; }

.validity-share {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #314056;
}

.validity-share__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.validity-share__head span {
  color: var(--muted);
  font-size: 11px;
}

.validity-share__head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}

.validity-share__track {
  position: relative;
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 1px;
  background: #26344a;
}

.validity-share__track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--violet);
  transition: width 180ms ease;
}

.work-stage-list {
  display: grid;
  margin-top: 4px;
}

.work-stage-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 22px;
  border-bottom: 1px solid #314056;
  color: var(--muted);
  font-size: 10px;
}

.work-stage-list b {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.work-stage-list__focus span,
.work-stage-list__focus b {
  color: var(--green);
}

.work-stage-list__return span,
.work-stage-list__return b {
  color: #d9c598;
}

.work-stage-list__visited span,
.work-stage-list__visited b {
  color: var(--green);
}

.work-stage-list__closed span,
.work-stage-list__closed b {
  color: #8f9bb0;
}

@media (min-width: 1200px) and (min-height: 850px) {
  .layout-card-compact .report-screen {
    padding-top: 30px;
    padding-bottom: 28px;
  }

  .layout-card-compact .dashboard-grid {
    grid-template-rows:
      clamp(285px, 29vh, 350px)
      clamp(240px, 25vh, 295px)
      clamp(260px, 24vh, 290px);
    gap: 18px;
  }

  .layout-card-compact .card {
    padding: 20px 21px 18px;
  }

  .layout-card-compact .card-title-row h3 {
    margin-bottom: 10px;
  }

  .layout-card-compact .dashboard-grid > .card:nth-child(2) .source-list--overview > div,
  .layout-card-compact .dashboard-grid > .card:nth-child(3) .schema-list > div {
    min-height: 30px;
  }

  .schema-list > div,
  .reason-overview > div,
  .work-stage-list > div {
    min-height: 29px;
  }

  .source-list--results > div {
    min-height: 26px;
  }

  .channel-kpis > div {
    padding: 12px 12px 11px;
  }

  .layout-card-compact .funnel-values {
    margin-top: 30px;
  }

  .layout-card-compact .site-source-tree,
  .layout-card-compact .channel-total {
    margin-top: 16px;
  }

  .layout-card-compact .validity-share {
    margin-top: 18px;
    padding-top: 14px;
  }
}

.card-footer {
  display: flex;
  min-height: 18px;
  gap: 10px;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted-dark);
  font-size: 9px;
  line-height: 1.2;
}

/* Период и источник уже заданы в шапке; действие доступно кликом по всей карточке. */
.layout-card-compact .card-footer {
  display: none;
}

.card-footer > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route {
  flex: none;
  color: #b8c4d8;
  white-space: nowrap;
}

@media (max-width: 1050px), (max-height: 619px) {
  html,
  body { overflow: auto; }

  .dashboard-shell {
    display: block;
    height: auto;
    min-height: 100%;
  }

  .topbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .period-picker { justify-self: start; }
  .freshness { justify-self: end; }

  .report-screen { min-height: 760px; }
}

@media (max-width: 760px) {
  .topbar { display: flex; flex-wrap: wrap; }
  .report-name { display: none; }
  .freshness { margin-left: auto; }
  .period-picker { order: 3; width: 100%; }
  .period-picker label { flex: 1; }
  .period-picker select,
  .period-picker input { width: 100%; }
  .center-picker { width: min(75vw, 330px); }
  .report-screen { min-height: 0; padding: 16px; }
  .screen-topline { align-items: flex-start; }
  .dashboard-grid { grid-template-columns: 1fr; grid-template-rows: none; height: auto; }
  .layout-card-compact .dashboard-grid { grid-template-rows: none; }
  .span-6,
  .span-4,
  .span-3 { grid-column: span 1; }
  .layout-source-priority .dashboard-grid > .card:nth-child(n) {
    grid-column: span 1;
    grid-row: auto;
  }
  .card { min-height: 250px; }
  .funnel-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }

  .app-not-ready .dashboard-grid .card::after { animation: none; }
}
