/**
 * Task 9 — страница решения (как task_2: правая панель сверху)
 * task-solve__right — условие справа, выровнено по верху (как в task/2/)
 */

/* Переопределяем пропорции колонок: 61% слева (+5%), 39% справа (−5%) */
.task-9-page.task-solve-page {
  grid-template-columns: minmax(0, 61%) 1fr;
}

.task-9-page.task-solve-page .header--task {
  grid-column: 1 / -1;
}

.task-9-page .task-solve__right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-self: start;
  grid-row: 2 / 3;
  margin-top: -0.75rem;
}

.task-9-page .task-solve__right--py.task-9-side-placeholder {
  align-self: stretch;
  min-height: min(40vh, 280px);
  justify-content: flex-start;
}

.task-9-side-placeholder__inner {
  padding: 1rem 0.75rem;
  text-align: center;
  background: var(--card-bg, rgba(30, 35, 40, 0.5));
  border: 1px dashed var(--border, rgba(255, 255, 255, 0.15));
  border-radius: 10px;
  opacity: 0.85;
}

.task-9-side-placeholder__icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.task-9-side-placeholder__title {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.task-9-side-placeholder__hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
}

[data-theme="light"] .task-9-side-placeholder__inner {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
}

.task-9-statement-wrap {
  padding: 1rem 1.25rem;
}

/* Высота таблицы Univer до нижнего края экрана */
.task-9-page .task-solve-main {
  padding-top: 0.15rem;
  padding-bottom: 0.5rem;
  min-height: 0;
}

.task-9-page .task-solve__left {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.task-9-page .calc-widget--univer {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.task-9-page .univer-calc-container {
  flex: 1;
  min-height: 0;
}

.task-9-page .univer-calc-container #univer-calc-app {
  flex: 1;
  min-height: 0;
}

.task-9-statement mjx-container {
  display: inline-block;
  margin: 0 0.05em;
  vertical-align: middle;
}

/* Таблица ответа 1×2 (задание 26, «Показать ответ») */
.task26-answer-table {
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  margin: 0.15rem 0 0;
}

.task26-answer-table td {
  border: 1px solid #333;
  min-width: 3.5rem;
  padding: 0.35rem 0.65rem;
  text-align: center;
  vertical-align: middle;
}

.task26-answer-table__corner {
  background: #b4c7e7;
  border: 1px solid #333;
}

.task26-answer-table__head {
  background: #b4c7e7;
  font-weight: 600;
}

.task26-answer-table__value {
  background: #fff;
  font-weight: 600;
}

body.libreoffice-page-task26 .libreoffice-task9-answer-peek__value.task26-answer-peek__value,
body.variant-exam-body .libreoffice-task9-answer-peek__value.task26-answer-peek__value {
  display: inline-block;
  vertical-align: middle;
}

body.variant-exam-body .variant-exam__peek-tools .libreoffice-task9-answer-peek[aria-expanded="true"] {
  align-items: flex-start;
}

[data-theme="light"] .task26-answer-table__corner,
[data-theme="light"] .task26-answer-table__head {
  background: #b4c7e7;
}

[data-theme="light"] .task26-answer-table__value {
  background: #fff;
}

/* Текстовое решение — скриншоты на всю ширину панели */
.libreoffice-page-task26 .task-solution-html-wrap__inner .task-wysiwyg__figure--task26-sheet,
.task-26-solve-page .task-solution-html-wrap__inner .task-wysiwyg__figure--task26-sheet {
  margin: 0.75rem auto 1rem;
  width: 100%;
}

.libreoffice-page-task26 .task-solution-html-wrap__inner .task-wysiwyg__image--task26-sheet,
.task-26-solve-page .task-solution-html-wrap__inner .task-wysiwyg__image--task26-sheet,
.libreoffice-page-task26 .task-wysiwyg__image--task26-sheet,
.task-wysiwyg-solution--premium .task-wysiwyg__image--task26-sheet {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: min(80vh, 840px);
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
}

[data-theme="light"] .libreoffice-page-task26 .task-solution-html-wrap__inner .task-wysiwyg__image--task26-sheet {
  border-color: rgba(15, 23, 42, 0.12);
}

/* HTML-таблицы в solution_html (вместо PNG-скриншотов Calc) */
.task26-sheet-table-wrap {
  margin: 0 auto;
  overflow-x: auto;
  width: 100%;
}

.task26-sheet-table {
  border-collapse: collapse;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  min-width: 20rem;
  width: 100%;
}

.task26-sheet-table td {
  border: 1px solid #94a3b8;
  min-width: 2.75rem;
  padding: 0.28rem 0.45rem;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.task26-sheet-table__corner,
.task26-sheet-table__head,
.task26-sheet-table__row-head {
  background: #b4c7e7;
  color: #1e293b;
  font-weight: 600;
}

.task26-sheet-table__value {
  background: #fff;
  color: #0f172a;
}

.task26-sheet-table__highlight {
  background: #fff2cc;
  font-weight: 600;
}

.task26-sheet-table__tail {
  color: #64748b;
  font-size: 0.78rem;
  margin: 0.35rem 0 0;
  text-align: right;
}

[data-theme="light"] .task-wysiwyg-solution--premium .task26-sheet-table td {
  border-color: rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .task-wysiwyg-solution--premium .task26-sheet-table__corner,
[data-theme="light"] .task-wysiwyg-solution--premium .task26-sheet-table__head,
[data-theme="light"] .task-wysiwyg-solution--premium .task26-sheet-table__row-head {
  background: #b4c7e7;
}

[data-theme="light"] .task-wysiwyg-solution--premium .task26-sheet-table__value {
  background: #fff;
}

[data-theme="light"] .task-wysiwyg-solution--premium .task26-sheet-table__highlight {
  background: #fff2cc;
}

.task26-python-solutions-switcher-mount:not([hidden]) {
  display: contents;
}

.task26-python-solution-switcher-btn--active {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(59, 130, 246, 0.18);
}

[data-theme="light"] .task26-python-solution-switcher-btn--active {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(59, 130, 246, 0.12);
}
