
/* Нормализация переноса заголовка для предотвращения общего переполнения страницы */
#strategy-answer > h2 {
  white-space: normal !important;
}


/* Гарантия отсутствия горизонтального скролла на уровне страницы */
html {
  overflow-x: clip;
}

#strategy-operations {
  max-width: 100%;
  overflow-x: clip;
}

/* b01.css – Стили блока 01 «Как бизнес зарабатывает и выплачивает деньги» в единой системе с блоком 00 */

/* 1. Главный контейнер панели блока 01 (идентично .s00-scenarios-panel) */
.b01-panel {
  margin: 0 0 28px;
  padding: 20px 22px 24px;
  background: #f9fbf9;
  border: 1px solid #d1d7d4;
  border-radius: 10px;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

/* 2. Сегментированные переключатели */
.b01-controls-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8e4;
}

.b01-ctrl-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.b01-ctrl-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #626d77);
  min-width: 95px;
}

.b01-btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  background: #eaeee5;
  padding: 3px;
  border-radius: 6px;
  gap: 2px;
}

.b01-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink, #080e1b);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.25;
  white-space: nowrap;
  font-family: inherit;
}

.b01-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink, #080e1b);
}

.b01-btn:focus-visible {
  outline: 2px solid var(--focus, #3d5947);
  outline-offset: 1px;
}

.b01-btn.is-active,
.b01-btn[aria-pressed="true"] {
  background: #ffffff;
  color: #121d17;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Селектор года */
.b01-year-selector {
  display: inline-flex;
  align-items: center;
  background: #eaeee5;
  padding: 2px 4px;
  border-radius: 6px;
  gap: 6px;
}

.b01-btn-step {
  padding: 4px 8px;
  font-size: 11px;
  min-width: 26px;
}

.b01-year-display {
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #121d17;
  min-width: 44px;
  text-align: center;
}

/* Строка состояния и сброс */
.b01-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12.5px;
  color: var(--muted, #626d77);
  margin-top: 4px;
}

.b01-status-text {
  font-weight: 500;
}

.b01-reset-btn {
  background: none;
  border: none;
  color: var(--focus, #3d5947);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 12.5px;
  padding: 0;
  font-weight: 600;
  font-family: inherit;
}

.b01-reset-btn:hover {
  color: var(--ink, #080e1b);
}

/* 3. Четыре динамические плитки KPI */
.b01-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

@media (max-width: 1180px) {
  .b01-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .b01-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.b01-kpi-grid .deck-kpi-card {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.b01-kpi-grid .deck-kpi-details {
  margin-top: auto;
  padding-top: 8px;
}

.b01-chip-neutral {
  background: #eaeff2 !important;
  color: #4a5a52 !important;
  border: 1px solid #c9d3cd !important;
  font-size: 10.5px !important;
  padding: 2px 6px !important;
}

.b01-chip-neutral.is-high {
  background: #e3efe6 !important;
  color: #244e38 !important;
  border-color: #a3cbb1 !important;
}

.b01-subline {
  font-size: 16px;
  margin: 0 0 24px;
  color: var(--muted, #626d77);
  line-height: 1.55;
}

/* 4. Графики (столбики + водопад) */
.b01-chart-block {
  margin-bottom: 20px;
}

.b01-chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink, #080e1b);
  margin: 0 0 4px;
}

.b01-waterfall-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted, #626d77);
  margin: 0 0 8px;
}

.b01-chart-canvas-wrap {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.b01-chart-canvas-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Легенда графика столбиков */
.b01-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  padding-top: 8px;
  font-size: 11.5px;
  color: var(--muted, #626d77);
}

.b01-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.b01-chart-legend i {
  display: inline-block;
  width: 12px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.b01-legend-reserve {
  background: repeating-linear-gradient(45deg, #b37d2e, #b37d2e 2px, #fbf7ef 2px, #fbf7ef 5px) !important;
  border: 1px solid #b37d2e;
}

.b01-legend-mrc-line {
  background: var(--ink, #080e1b) !important;
  height: 2px !important;
  width: 16px !important;
  border-radius: 1px;
}

/* 5. Динамический текст под графиками (идентично блоку 00) */
.b01-dynamic-text-wrap {
  background: #eaeee5;
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.b01-dynamic-text {
  font-size: 14.5px !important;
  line-height: 1.6 !important;
  color: var(--ink, #080e1b) !important;
  margin: 0 !important;
}

.b01-permanent-footnote {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted, #626d77);
  margin-top: 8px;
  margin-bottom: 0;
}

/* 6. Спойлер и таблицы */
.b01-spoiler {
  margin: 28px 0 20px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.b01-spoiler > summary {
  list-style: none;
}

.b01-spoiler > summary::-webkit-details-marker {
  display: none;
}

.b01-spoiler > summary::marker {
  content: "";
  display: none;
}

.b01-spoiler .deck-spoiler-body {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.b01-spoiler-h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink, #080e1b);
  margin: 24px 0 12px;
}

.b01-spoiler-h3:first-of-type {
  margin-top: 6px;
}

.b01-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 14px 0 18px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--line-dark, #a9b2ac) var(--paper, #f7f7f4);
  -webkit-overflow-scrolling: touch;
}

.b01-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  text-align: right;
  margin: 0;
  box-sizing: border-box;
}

.b01-data-table caption {
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted, #626d77);
  padding-bottom: 8px;
}

.b01-data-table th,
.b01-data-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line, #d1d7d4);
  white-space: nowrap;
}

.b01-data-table thead th {
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #626d77);
  border-top: 1px solid var(--line-dark, #a9b2ac);
  border-bottom: 1px solid var(--line-dark, #a9b2ac);
  background: var(--paper, #f7f7f4);
  text-transform: none;
}

.b01-data-table thead th:first-child,
.b01-data-table tbody th[scope="row"] {
  text-align: left;
  font-weight: 600;
  color: var(--ink, #080e1b);
}

.b01-data-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

.b01-table-total th,
.b01-table-total td {
  border-top: 1px solid var(--line-dark, #a9b2ac);
  border-bottom: 2px solid var(--line-dark, #a9b2ac);
  font-weight: 700;
}

.b01-table-note {
  font-size: 12px;
  color: var(--muted, #626d77);
  margin: -8px 0 16px;
  line-height: 1.45;
}

/* Ячейка доходности в таблице индексации */
.b01-irr-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.b01-irr-main {
  font-weight: 700;
  font-size: 13px;
}

.b01-irr-sub {
  font-size: 11px;
  color: var(--muted, #626d77);
  font-weight: 500;
}

.b01-data-table td.b01-v-high {
  background: #2e5c3e !important;
  color: #ffffff !important;
  font-weight: 700;
  border-radius: 4px;
}

.b01-data-table td.b01-v-high .b01-irr-sub {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* SVG интерактивность */
.b01-svg-bar-group {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.b01-svg-bar-group:focus-visible rect {
  outline: 2px solid var(--focus, #3d5947);
}

/* Адаптивность под мобильные экраны (400 px) */
@media (max-width: 760px) {
  .b01-panel {
    padding: 14px 16px 18px;
  }
  .b01-controls-wrap {
    padding-bottom: 12px;
    gap: 10px;
  }
  .b01-btn {
    padding: 5px 9px;
    font-size: 12px;
  }
  .b01-ctrl-label {
    min-width: 80px;
  }
}

@media (max-width: 480px) {
  .b01-ctrl-group {
    width: 100%;
    justify-content: space-between;
  }
  .b01-btn-group {
    width: 100%;
    justify-content: stretch;
  }
  .b01-btn-group .b01-btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .b01-chart-legend {
    gap: 6px 12px;
    font-size: 11px;
  }
}

/* Печать */
@media print {
  .b01-controls-wrap,
  .b01-reset-btn,
  .b01-chart-legend {
    display: none !important;
  }
  .b01-chart-block {
    break-inside: avoid;
    margin-bottom: 20px;
    border: none;
    padding: 0;
  }
}
