  /* --------------------------------------------------------
      Цветовые переменные 
  -------------------------------------------------------- */
  :root {
    --color-bg: #0D0C1F;
    /* общий фон */
    --color-panel: #1B1A2D;
    /* фон панелей/контейнеров */
    --color-border: #2D2960;
    /* цвет границ (обводок) */
    --color-text: #ffffff;
    /* основной цвет текста */

    --color-accent1: #4C2BD9;
    /* оттенок фиолетового */
    --color-accent2: #6B57E3;
    --color-accent3: #805AE3;
    --color-accent4: #532BC7;

    --slider-thumb-size: 24px;
    --slider-track-height: 12px;
    /* высота трека */
  }

  /* Сброс отступов / box-sizing */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  *::-webkit-scrollbar,
  *::-webkit-scrollbar-thumb {
    color: var(--color-accent3);
    background-color: var(--color-border);
    width: 8px;
    border-radius: 10px;
    background-clip: padding-box;

  }


  *::-webkit-scrollbar-thumb {
    box-shadow: inset 0 0 0 10px;
    border: 2px solid var(--color-border);
  }

  html,
  body {
    height: 100%;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
  }

  a {
    color: var(--text-color);
  }

  /* 
    Контейнер в виде flex-колонки:
      - Верхняя часть: опрос (скроллируется при переполнении)
      - Нижняя часть: блок результатов 
  */
  .wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  #survey-container {
    flex: 1 1 90%;
    overflow-y: auto;
    padding: 20px;
    width: 75%;
    margin: auto;
  }


  /* Блок результатов */
  .result-container {
    flex: 0 0 10%;
    background: var(--color-panel);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    position: relative;
    padding: 10px;
  }

  /* Квадраты для значений */
  .result-box {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--color-border);
    padding: 10px 15px;
    margin-left: 10px;
    border-radius: 8px;
    text-align: center;
    min-width: 80px;
    /* Одинаковая ширина */
    min-height: 60px;
    /* Одинаковая высота */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .result-box span {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.8;
  }

  .result-box strong {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
  }

  .buttons-wrapper {
    display: flex;
  }
  /* Кнопка сброса */
  .reset-btn {
    height: 80px;
    margin-left: auto;
    margin-right: 20px;
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-text);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
  }

  .reset-btn:hover {
    background: var(--color-accent1);
  }

  .result-button-score {
    display: flex;
  }

  .result-addit {
    display: flex;
  }

  /* Стиль для дроби */
  .fraction {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.5rem;
    /* Увеличенный размер */
    font-weight: 700;
    position: relative;
  }

  /* Горизонтальная линия дроби */
  .fraction::after {
    content: "";
    width: 100%;
    height: 2px;
    background: white;
    position: absolute;
    top: 50%;
    left: 0;
  }

  /* Числитель */
  .fraction .numerator {
    padding-bottom: 5px;
    /* Отступ для баланса */
  }

  /* Знаменатель */
  .fraction .denominator {
    padding-top: 5px;
    /* Отступ для баланса */
  }

  /* Процентный знак под дробью */
  .floating-score small {
    font-size: 2rem;
    font-weight: 500;
    opacity: 0.9;
  }


  /* -------------------------------------
    Оформление глав (chapter)
------------------------------------- */
  .chapter {
    border: 1px solid var(--color-border);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
  }

  .chapter h2 {
    margin-top: 0;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
  }

  /* Разные градиенты для разных глав */
  .chapter1 {
    background: linear-gradient(145deg, #201D40, #2D2970);
  }

  .chapter2 {
    background: linear-gradient(145deg, #251A4D, #3B2E72);
  }

  .chapter3 {
    background: linear-gradient(145deg, #1F1F2F, #33336F);
  }

  .chapter4 {
    background: linear-gradient(145deg, #2A203F, #4A3272);
  }

  .chapter5 {
    background: linear-gradient(145deg, #202060, #443C72);
  }

  .chapter6 {
    background: linear-gradient(145deg, #1A224D, #2E3E72);
  }

  .chapter7 {
    background: linear-gradient(145deg, #2D1F4D, #473E72);
  }

  .chapter8 {
    background: linear-gradient(145deg, #1F1F3F, #3D2C7F);
  }

  .chapter9 {
    background: linear-gradient(145deg, #1B1A2D, #362C60);
  }

  .chapter10 {
    background: linear-gradient(145deg, #2F1A47, #55316C);
  }

  .chapter11 {
    background: linear-gradient(145deg, #211850, #483374);
  }

  .chapter12 {
    background: linear-gradient(145deg, #291B58, #5A3C83);
  }

  /* Вопросы */

  .questions-section {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin: auto;
    width: 90%;
    justify-content: space-around;
  }

  .question {
    display: inline-block;
    width: 45%;
    min-width: 200px;
    vertical-align: top;
    margin: 5px 5px;
  }



  /* Делать label нормальным шрифтом */
  .question label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    /* чуть более выделенно, чем текст, но не жирно */
    color: #fff;
  }

  /* -------------------------------------
    Слайдеры
------------------------------------- */
  /* Контейнер для слайдера */
  .slider-container {
    display: flex;
    align-items: center;
    /* Выравниваем элементы в одну строку */
    flex-grow: 1;
    /* Позволяет контейнеру растягиваться */
    gap: 10px;
    /* Промежуток между слайдером и значением */
  }

  /* Толще слайдер */
  .custom-slider {
    -webkit-appearance: none;
    width: 100%;
    /* Толщина слайдера */
    background: linear-gradient(to right, #4C2BD9, #6B57E3);
    border-radius: 6px;
    outline: none;
    transition: 0.3s;
  }

  /* Ползунок */
  .custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    background: url('https://cdn-icons-png.flaticon.com/512/5987/5987137.png') center / contain no-repeat;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
  }

  .custom-slider::-moz-range-thumb {
    width: 30px;
    height: 30px;
    background: url('https://cdn-icons-png.flaticon.com/512/5987/5987137.png') center / contain no-repeat;
    border-radius: 50%;
    cursor: pointer;
  }

  /* Поле ввода числа (справа от слайдера) */
  .slider-input {
    width: 50px;
    height: 30px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 5px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Стили для поля ввода при фокусе */
  .slider-input:focus {
    background: rgba(255, 255, 255, 0.2);
  }

  /* Толще слайдер */
  input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 20px;
    /* Толщина слайдера */
    background: linear-gradient(to right, #4C2BD9, #6B57E3);
    border-radius: 6px;
    outline: none;
    transition: 0.3s;
  }

  /* Ползунок */
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    background: url('https://cdn-icons-png.flaticon.com/512/5987/5987137.png') center / contain no-repeat;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
  }

  input[type="range"]::-moz-range-thumb {
    width: 30px;
    height: 30px;
    background: url('https://cdn-icons-png.flaticon.com/512/5987/5987137.png') center / contain no-repeat;
    border-radius: 50%;
    cursor: pointer;
  }

  /* При наведении ползунок немного увеличивается */
  input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.1);
  }

  input[type="range"]:hover::-moz-range-thumb {
    transform: scale(1.1);
  }

  /* Трек */
  input[type=range]::-webkit-slider-runnable-track {
    height: var(--slider-track-height);
    background: linear-gradient(to right, var(--color-accent1), var(--color-accent2));
    border-radius: 3px;
    border: none;
  }

  input[type=range]::-moz-range-track {
    height: var(--slider-track-height);
    background: linear-gradient(to right, var(--color-accent1), var(--color-accent2));
    border-radius: 3px;
    border: none;
  }

  /* Ползунок (thumb) */
  input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: var(--slider-thumb-size);
    width: var(--slider-thumb-size);
    background: #fff url('https://cdn-icons-png.flaticon.com/512/5987/5987137.png') center/60% no-repeat;
    border-radius: 50%;
    border: 2px solid var(--color-accent1);
    margin-top: calc(var(--slider-track-height)/-2);
    cursor: pointer;
    transition: 0.2s;
  }

  input[type=range]::-moz-range-thumb {
    height: var(--slider-thumb-size);
    width: var(--slider-thumb-size);
    background: #fff url('https://cdn-icons-png.flaticon.com/512/5987/5987137.png') center/60% no-repeat;
    border-radius: 50%;
    border: 2px solid var(--color-accent1);
    cursor: pointer;
    transition: 0.2s;
  }

  input[type=range]::-webkit-slider-thumb:hover,
  input[type=range]::-moz-range-thumb:hover {
    border-color: var(--color-accent3);
  }

  input[type=range]:focus::-webkit-slider-thumb,
  input[type=range]:focus::-moz-range-thumb {
    outline: none;
    border-color: var(--color-accent4);
  }

  /* Select */

  /* Стили для селекта */
  .custom-select {
    appearance: none;
    /* Убираем стандартные стили браузера */
    width: 100%;
    background: linear-gradient(to right, #4C2BD9, #6B57E3);
    border: 1px solid var(--color-border);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 12px;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    transition: background 0.3s, border-color 0.3s;
  }

  /* При наведении */
  .custom-select:hover {
    background: linear-gradient(to right, #6B57E3, #805AE3);
  }

  /* При фокусе */
  .custom-select:focus {
    background: linear-gradient(to right, #805AE3, #532BC7);
    border-color: var(--color-accent3);
  }

  /* Стрелочка у select */
  .custom-select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
  }

  .custom-select-wrapper::after {
    content: "▼";
    font-size: 0.8rem;
    color: #ffffff;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
  }

  /* Стилизация выпадающего списка */
  .custom-select option {
    background: var(--color-bg);
    color: #ffffff;
    font-weight: 500;
  }

  /* Делаем dropdown темным */
  .custom-select:focus option {
    background: var(--color-panel);
  }

  /* Контейнер для радио-кнопок */
  .radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Отступ между кнопками */
  }

  /* Скрываем стандартное оформление радио */
  .radio-group input[type="radio"] {
    display: none;
  }

  /* Кастомная метка (имитируем кнопку) */
  .radio-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(to right, #4C2BD9, #6B57E3);
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
  }

  /* Кастомная радио-кнопка (кружок) */
  .radio-group label::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    display: inline-block;
    transition: 0.3s;
  }

  /* Если радио выбрано — градиентный акцент */
  .radio-group input[type="radio"]:checked+label {
    background: linear-gradient(to right, #6B57E3, #805AE3);
  }

  /* Когда радио выбрано — закрашиваем кружок */
  .radio-group input[type="radio"]:checked+label::before {
    background: white;
  }

  /* Эффект при наведении */
  .radio-group label:hover {
    background: linear-gradient(to right, #805AE3, #532BC7);
  }


  /* -------------------------------------
  Нижний блок с результатом
------------------------------------- */
  .result-container>div {
    font-size: 0.9rem;
    font-weight: 400;
    /* обычный вес */
  }

  .result-container .reset-btn {
    margin-left: auto;
  }

  /* Пример плавающего блока итога */
  .floating-score {
    padding: 10px;
    height: 80px;
    border-radius: 10px;
    background: var(--color-accent1);
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    flex-wrap: wrap;
    flex-direction: column;
  }

  #maxScore {
    filter: blur(10px);
    transition: .3s ease;
  }

  #maxScore:hover {
    filter: blur(0px);
    transition: .3s ease;
  }

  /* Стили для поля ввода имени */
  .name-field {
    padding: 8px 12px;
    border: 1px solid var(--color-text);
    border-radius: 6px;
    background: transparent;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 500;
    margin-right: 10px;
    height: 80px;
    margin-left: auto;
  }

  /* Стили для кнопки печати (по аналогии с reset-btn) */
  .print-btn,
  .load-btn,
  .save-btn,
  .download-receipt-btn,
  .analyse-btn,
  .reset-btn {
    height: 80px;
    min-width: 5vw;
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-text);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
    margin-right: 10px;
  }

  .print-btn:hover,
  .load-btn:hover,
  .save-btn:hover,
  .download-receipt-btn:hover,
  .analyse-btn:hover {
    background: var(--color-accent1);
  }

  .print-header,
  .print-footer {
    display: none;
  }



  /* Стили для модального окна */


  .modal {
    /* Затемнение фона */
    display: none;
    /* Или block/flex, когда показываете окно */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    /* Если хотите, чтобы вся страница прокручивалась при переполнении,
       можно убрать overflow: auto; Но обычно modal не прокручивают всю страницу.
    */
  }

  /* Родительский контейнер внутри модального слоя */
  /* Сам блок-затемнение */
  .modal {
    display: none;
    /* по умолчанию скрыт, меняем на block/flex через JS */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
  }

  /* Контейнер модалки */
  .modal-content {
    display: flex;
    flex-direction: column;

    /* Фиксированная (или ограниченная) высота,
     чтобы модалка умещалась по вертикали */
    max-height: 80vh;
    width: 70%;
    margin: 10vh auto;
    /* чтобы было по центру экрана */

    background-color: var(--color-bg);
    color: var(--color-text);
    border-radius: 6px;

    /* Важно! overflow: hidden — чтобы полоса прокрутки
     была только у .modal-body, а не «высовывалась» */
    overflow: hidden;
  }

  /* Шапка (кнопка закрытия и, возможно, заголовок) */
  .modal-header {
    flex: 0 0 auto;
    /* не растягивается */
    padding: 10px;
    background: var(--color-panel);
    position: relative;
  }

  /* Основная часть, которая скроллится при избытке контента */
  .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 15px 25px 15px 25px;
    background: var(--color-panel);
    white-space: break-spaces
  }

  .modal-buttons-addons {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    gap: 1vw;
  }

  #religiousAnalysisLink,
  #downloadText {
    cursor: pointer;
    color: rgb(213, 213, 213);
    border: 1px solid;
    padding: 8px;
    border-radius: 10px;
    transition: background 0.2s;
  }

  #religiousAnalysisLink:hover,
  #downloadText:hover {
    background: var(--color-accent1);
  }

  /* Подвал (кнопки), тоже фикс.высоты */
  .modal-footer {
    flex: 0 0 auto;
    padding: 10px;
    background: var(--color-panel);

    /* Можно как-то красиво расположить кнопки */
    display: flex;
    gap: 10px;
    justify-content: center;
  }

  /* Кнопка закрытия (крестик) */
  .modal-close {
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    position: absolute;
    /* «прижимаем» к правому верхнему углу */
    top: 10px;
    right: 10px;
  }



  @media print {

    /* 1) Разворачиваем всю страницу на печать, убираем flex, скроллы */
    html,
    body,
    .wrapper,
    #survey-container {
      height: auto !important;
      overflow: visible !important;
      margin: 0 !important;
      padding: 0 !important;
    }

    .wrapper {
      display: block !important;
    }

    #survey-container {
      flex: none !important;
      padding: 0 !important;
    }

    /* 2) Включаем цветную печать как есть */
    body {
      -webkit-print-color-adjust: exact;
    }

    /* 3) Не разрывать главу и не разрывать вопрос */
    .chapter {
      page-break-inside: avoid;
    }

    .question {
      page-break-inside: avoid;
      break-inside: avoid;
    }

    /* 4) Блоки для печати (header/footer) делаем видимыми */
    .print-header,
    .print-footer {
      display: block !important;
      text-align: center;
      margin: 20px 0;
      font-size: 12pt;
      font-weight: 500;
      color: #fff;
      /* или #000, если нужно контрастнее */
    }

    /* Если хотите, чтобы они выводились белым текстом на чёрном фоне 
     (в стиле всего сайта), можно дополнительно:
     background: #000 !important;
     color: #fff !important;
  */

    /* Если наоборот хотите, чтобы 
     при печати был светлый фон:
    .print-header, .print-footer {
      background: #fff !important;
      color: #000 !important;
    }
  */

    /* 5) Увеличиваем общий размер шрифта или убираем анимации */
    .chapter,
    .question,
    .result-container,
    .questions-section,
    .result-box,
    .fraction,
    .question label,
    .chapter h2 {
      font-size: 12pt !important;
      opacity: 1 !important;
      transition: none !important;
    }

    /* 6) Если хотите скрыть интерактивные кнопки при печати */
    /*
  .reset-btn, .print-btn, .name-field {
    display: none !important;
  }
  */
  }




  /* Media query for screens smaller than 768px (or adjust as needed) */
  @media (max-width: 768px) {}





  /* Media query for mobile phones in portrait mode */
  @media (max-width: 768px) and (orientation: portrait) {
    .result-container {
      flex-wrap: wrap;
    }

    .result-addit {
      display: flex;
      width: 100%;
      justify-content: space-around;
    }

    .result-box {
      margin-left: 0px !important;
      min-width: 20vw;
    }

    .name-field {
      height: auto !important;
      padding: 8px 12px;
      color: var(--color-text);
      font-size: 2vh;
      width: 95%;
      margin: auto;
    }

    .result-button-score {
      display: flex;
      width: 100%;
    }

    .buttons-wrapper {
      display: flex;
      flex: 1 1 75%;
      overflow-y: hidden;
      flex-wrap: wrap;
      justify-content: center;
      align-items: center;
    }

    .floating-score {
      flex: 0 0 25%;
    }

    .print-btn,
    .load-btn,
    .save-btn,
    .download-receipt-btn,
    .analyse-btn,
    .reset-btn {
      height: 4vh;
      background: transparent;
      color: var(--color-text);
      border: 1px solid var(--color-text);
      border-radius: 6px;
      padding: 4px 6px;
      cursor: pointer;
      font-size: 1rem;
      font-weight: 500;
      transition: background 0.2s;
      margin-right: 10px;
      min-width: 20vw;
    }

    .reset-btn {
      margin-left: 0px !important;
    }


    #survey-container {
      width: 100%;
      padding: 10px;
    }

    .questions-section {
      width: 100%;
    }

    .question {
      width: 95%;
    }

    .modal-content {
      width: 95%;
    }

  }