/* ===== Прототип «Формы опросов» — ОБЩИЕ стили (используются на 2+ страницах).
   Стили, нужные только одной странице, вынесены в <style> внутри этой страницы. ===== */

/* Список владельцев опроса (cabinet + builder) */
.owners-list { display: flex; flex-direction: column; gap: 10px; }
.owner-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1.5px solid var(--border-light); border-radius: 12px; background: #fff;
}
.owner-av { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.owner-info { flex: 1; min-width: 0; }
.owner-info b { display: block; font-size: 14.5px; }
.owner-info small { color: var(--text-light); font-size: 13px; }
.owner-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Ветвление — визуальная связь варианта с переходом (builder + form-test) */
.branch-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  color: #7c3aed; background: rgba(124,58,237,0.08); padding: 3px 10px; border-radius: 20px; margin-left: auto; }
.branch-hint i { font-size: 11px; }

/* Заголовок раздела «Администрирование» в меню аккаунта */
.am-admin-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-light); font-weight: 600; padding: 8px 12px 4px; }
.app-menu-nav a .am-badge { margin-left: auto; }

/* Метка-«роль» (cabinet + builder) */
.role-pill { font-size: 11.5px; padding: 2px 9px; border-radius: 10px; font-weight: 600; }
.role-owner { background: rgba(0,27,114,0.10); color: var(--brand-blue); }
.role-editor { background: rgba(124,58,237,0.10); color: #7c3aed; }
.role-viewer { background: var(--light-grey); color: var(--text-light); }

/* Хлебные крошки */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 18px 0 14px; flex-wrap: wrap; }
.crumbs a { color: var(--brand-blue); text-decoration: none; font-weight: 500; }
.crumbs a:hover { text-decoration: underline; }
.crumbs i { color: var(--dark-grey); font-size: 12px; }
.crumbs .cur { color: var(--text-light); }

/* select2 в конструкторе/строках — не схлопывается */
.builder-question .select2-container,
.owner-actions .select2-container { min-width: 170px; }
.owner-actions .select2-container { min-width: 150px; }

/* Шаговый мастер создания (как «Создание анкеты») */
.create-steps { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.create-step { display: inline-flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--text-light); }
.create-step .cs-num { width: 28px; height: 28px; border-radius: 50%; background: var(--light-grey); color: var(--text-light);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.create-step.on { color: var(--brand-blue); font-weight: 600; }
.create-step.on .cs-num { background: var(--brand-blue); color: #fff; }
.create-step .cs-line { width: 28px; height: 2px; background: var(--border-light); }

/* ===== Ревизия 3 — правки по фидбеку ===== */

/* flex-between без space-between */
.flex-between { justify-content: flex-end; }

/* Скрыть номер вопроса в публичной форме */
.survey-question .q-num { display: none; }

/* Скрыть строку логина/почты в меню аккаунта */
.am-mail { display: none; }

/* Стандартизация кнопок — единый размер (btn-lg = обычная кнопка) */
.btn-lg { padding: 12px 22px; font-size: 15px; }

/* Панель сохранения — без подложки (по фидбеку) */
.editor-savebar { background: transparent; }

/* Карточка вопроса — компактнее */
.survey-question { padding: 16px; }

/* Единый заголовок публичной формы */
.form-title { font-size: 24px; color: var(--brand-blue); margin-bottom: 8px; line-height: 1.2; }

/* Иконка @ в чипе логина — единый стиль */
.lt-chip i { font-size: 11px; opacity: .6; }

/* Пройденный шаг мастера — синий */
.create-step.done { color: var(--brand-blue); font-weight: 600; }
.create-step.done .cs-num { background: var(--brand-blue); color: #fff; font-size: 11px; }
.cs-line.done { background: var(--brand-blue); }

/* Заголовок страницы: действия всегда справа (т.к. flex-between без space-between) */
.page-head.flex-between > :last-child { margin-left: auto; }
.ml-auto { margin-left: auto; }

/* Поиск в фильтр-баре — выше */
.dash-search { height: 48px; border-radius: 12px; }
.dash-search input { font-size: 15px; }
.dash-filterbar .select2-container--default .select2-selection--single { height: 48px; }
.dash-filterbar .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 46px; }
.dash-filterbar .select2-container--default .select2-selection--single .select2-selection__arrow { height: 46px; }

/* Шкала — равномерно заполняет ширину и аккуратно переносится */
.scale-row { gap: 8px; }
.scale-row label { flex: 1 1 42px; min-width: 42px; max-width: 64px; width: auto; }

/* Поле ввода логинов с чипами снизу */
.login-tags { }
.lt-input { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--border-light);
  border-radius: 12px; padding: 0 14px; height: 46px; }
.lt-input:focus-within { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(0,27,114,0.10); }
.lt-input i { color: var(--text-light); }
.lt-input input { border: none; outline: none; background: transparent; font-family: 'Stem', sans-serif; font-size: 15px; width: 100%; height: 100%; }
.lt-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lt-list:empty { margin-top: 0; }
.lt-chip { display: inline-flex; align-items: center; gap: 8px; background: rgba(0,27,114,0.08); color: var(--brand-blue);
  border-radius: 20px; padding: 6px 8px 6px 14px; font-size: 14px; font-weight: 500; }
.lt-chip button { border: none; background: rgba(0,27,114,0.12); color: var(--brand-blue); width: 22px; height: 22px;
  border-radius: 50%; cursor: pointer; font-size: 12px; line-height: 1; transition: all .15s ease; }
.lt-chip button:hover { background: var(--brand-red); color: #fff; }

/* Кнопка закрытия меню аккаунта (видна только на мобилке) */
.am-close { display: none; }

/* ===== МОБИЛКА ===== */
@media (max-width: 760px) {
  /* Все основные кнопки — во всю ширину (кроме шапки и круглых) */
  .btn { width: 100%; }
  .site-header .btn, .header-bar .btn, .header-actions .btn { width: auto; }

  /* В колоночном фильтр-баре flex:1 схлопывал высоту поиска — фиксируем */
  .dash-filterbar .dash-search { flex: none; height: 48px; }

  /* ── Раскладка: контейнеры во всю ширину ── */
  .container, .container-narrow { padding-left: 0; padding-right: 0; }

  /* Карточки контента — в самый край экрана, без скруглений */
  .panel, .survey-question, .builder-question, .builder-section,
  .result-block, .qf-consent { border-radius: 0; }
  .data-table.cards-sm tr { border-radius: 0; }

  /* Шапка и «свободные» блоки (заголовки, крошки, кнопки, фильтры, сетки
     мелких карточек) держат боковой отступ 16px и не примыкают к краям */
  .site-header .container,
  .page-head, .crumbs, .create-steps, .editor-tabsbar, .editor-back,
  .dash-filterbar, .action-row, .wizard-nav, .editor-savebar,
  .stat-grid, .landing-features, .landing-grid,
  .section-title, .section-sub, .page-head + .muted,
  .editor-col > .flex,
  .form-main .container-narrow > p,
  .form-main .container-narrow > .flex-between {
    padding-left: 16px; padding-right: 16px;
  }

  /* Статы — аккуратная сетка 2×2 */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* Все селекторы и поля — во всю ширину */
  .form-select:not(.select2-hidden-accessible) { width: 100% !important; }
  .select2-container { width: 100% !important; min-width: 0 !important; }
  /* Инлайновые селекты в строке вопроса конструктора — на свою строку */
  .builder-question .bq-head { flex-wrap: wrap; }
  .builder-question .bq-head .form-select,
  .builder-question .bq-head .select2-container { order: 5; margin-left: 0 !important; }
  .owner-actions { flex-wrap: wrap; }

  /* Авторизация — во всю ширину */
  .auth-wrap { padding: 40px 0; }

  /* Шаги мастера — без переноса вкривь, с прокруткой */
  .create-steps { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .create-steps::-webkit-scrollbar { display: none; }
  .create-step { white-space: nowrap; }

  /* Блокировка прокрутки страницы под полноэкранным меню аккаунта
     (скроллбар обычно на <html>, поэтому фиксируем оба элемента) */
  html.menu-locked, body.menu-locked { overflow: hidden; }

  /* Меню аккаунта на весь экран, без внутреннего скроллбара */
  .user-menu.open .app-menu {
    position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh;
    border-radius: 0; border: none; transform: none; overflow-y: auto;
    -ms-overflow-style: none; scrollbar-width: none;
  }
  .user-menu.open .app-menu::-webkit-scrollbar { display: none; }
  .app-menu-nav a { padding: 16px 14px; font-size: 16px; }
  .am-close {
    display: flex; align-items: center; justify-content: center; position: absolute; top: 14px; right: 14px;
    width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--background-light);
    color: var(--text-dark); font-size: 17px; cursor: pointer; z-index: 5;
  }
}

/* Глазок в поле пароля */
.pw-eye { border: none; background: transparent; color: var(--text-light); cursor: pointer; padding: 0 2px; font-size: 15px; flex-shrink: 0; line-height: 1; }
.pw-eye:hover { color: var(--brand-blue); }

/* Карточки опросов в кабинете */
.cab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; align-items: stretch; margin-bottom: 40px;}
.cab-card { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.cab-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cab-cover { height: 128px; background: linear-gradient(135deg, var(--primary-blue), var(--brand-blue)); position: relative;
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cab-cover img { width: 100%; height: 100%; object-fit: cover; }
.cab-cover .cab-status { position: absolute; top: 10px; right: 10px; }
/* Большая иконка типа + подпись на обложке-заглушке */
.cab-cover-ic { font-size: 46px; color: rgba(255,255,255,.92); }
.cab-cover-type { position: absolute; left: 12px; bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: rgba(255,255,255,.9); background: rgba(0,0,0,.18); padding: 3px 10px; border-radius: 20px; }
/* Декоративный «водяной знак» из той же иконки */
.cab-cover::after { content: ''; position: absolute; right: -20px; bottom: -26px; width: 130px; height: 130px;
  background: rgba(255,255,255,.08); border-radius: 50%; }
/* Градиенты по типам опроса */
.cab-cover.cover-survey { background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.cab-cover.cover-poll   { background: linear-gradient(135deg, #b3001f, #EB002D); }
.cab-cover.cover-test   { background: linear-gradient(135deg, #5b21b6, #7c3aed); }
.cab-cover.cover-quiz   { background: linear-gradient(135deg, #b45309, #f59e0b); }
.cab-cover.cover-blitz  { background: linear-gradient(135deg, #0e7490, #06b6d4); }
.cab-body { padding: 16px 18px; display: flex; flex-direction: column; flex: 1; }
.cab-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cab-card h3 { font-size: 17px; color: var(--text-dark); margin-bottom: 6px; line-height: 1.3; }
.cab-meta { display: flex; gap: 14px; font-size: 13px; color: var(--text-light); margin: 4px 0 14px; flex-wrap: wrap; }
.cab-meta i { color: var(--brand-red); margin-right: 3px; }
.cab-actions { display: flex; gap: 8px; margin-top: auto; align-items: stretch; }
.cab-actions .btn { width: auto; }
.cab-actions .btn:first-child { flex: 1; min-width: 0; }
.cab-actions .btn:not(:first-child) { flex: 0 0 42px; width: 42px; height: 40px; padding: 0; justify-content: center; }

/* Чипы-фильтры на «Я участвую» — прокручиваются как create-steps */
.filter-chips { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: nowrap; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 24px;
  background: #fff; border: 1.5px solid var(--border-light); color: var(--text-dark); cursor: pointer;
  white-space: nowrap; flex: 0 0 auto;
  font-family: 'Stem', sans-serif; font-weight: 500; font-size: 14.5px; transition: all .18s ease; }
.filter-chip:hover { border-color: var(--brand-blue); }
.filter-chip.active { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.filter-chip .fc-count { background: rgba(0,27,114,.1); color: var(--brand-blue); border-radius: 12px; padding: 1px 9px; font-size: 12.5px; font-weight: 600; }
.filter-chip.active .fc-count { background: rgba(255,255,255,.25); color: #fff; }

@media (max-width: 760px) { .cab-grid { grid-template-columns: 1fr; padding: 0 16px;} }

/* Текст кнопок не переносится (две кнопки не должны корёжиться на строке) */
.btn { white-space: nowrap; }

/* Квадратная синяя кнопка «Добавить вопрос» — на всю ширину */
.add-q-btn { width: 100%; border-radius: 12px; padding: 16px; font-size: 16px; justify-content: center; }

/* Действия в модалках — по умолчанию столбиком (primary сверху), без тесноты */
.modal-actions.stack { flex-direction: column-reverse; }
.modal-actions.stack .btn { width: 100%; }

/* ===== Конструктор: страницы (профессиональный вид) ===== */
.builder-pages { display: flex; flex-direction: column; gap: 18px; }
.builder-page { background: #fff; border: 1px solid var(--border-light); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.builder-page > .bp-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: linear-gradient(90deg, rgba(0,27,114,.06), rgba(0,27,114,.01)); border-bottom: 1px solid var(--border-light); }
.bp-num { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; color: var(--brand-blue); white-space: nowrap; }
.bp-title { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 10px;
  font-family: 'Stem', sans-serif; font-size: 14.5px; font-weight: 500; color: var(--text-dark); }
.bp-title:hover { border-color: var(--border-light); }
.bp-title:focus { outline: none; border-color: var(--brand-blue); background: #fff; box-shadow: 0 0 0 3px rgba(0,27,114,.08); }
.bp-title-static { flex: 1; color: var(--text-light); font-size: 13px; }
.bp-del { border: none; background: none; color: var(--brand-red); cursor: pointer; font-size: 14px; width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.bp-del:hover { background: rgba(235,0,45,.08); }
.bp-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.bp-body .builder-question { margin-bottom: 0; }
.bp-empty { color: var(--text-light); font-size: 14px; text-align: center; padding: 16px; border: 1.5px dashed var(--border-light); border-radius: 12px; }
/* «Добавить вопрос» — по форме и ширине как .bp-empty, но со СПЛОШНОЙ рамкой (не пунктир) */
.bp-addq { display: flex; align-items: center; justify-content: center; gap: 8px;
  width: calc(100% - 32px); box-sizing: border-box;
  margin: 0 16px 16px; padding: 16px; border: 1.5px solid var(--brand-blue); border-radius: 12px;
  background: rgba(0,27,114,.03); color: var(--brand-blue); cursor: pointer;
  font-family: 'Stem', sans-serif; font-weight: 600; font-size: 14.5px; transition: background .15s ease; }
.bp-addq:hover { background: rgba(0,27,114,.08); }
/* «Добавить страницу» — та же форма-коробка, допустим пунктир */
.add-page-btn { display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 18px; /*margin-left: 16px; margin-right: 16px;*/ padding: 16px; border-radius: 12px;
  border: 1.5px dashed var(--brand-blue); background: rgba(0,27,114,.02); color: var(--brand-blue);
  font-weight: 600; box-shadow: none; }
.add-page-btn:hover { background: rgba(0,27,114,.06); border-color: var(--brand-blue); color: var(--brand-blue); }

/* Карточка вопроса в конструкторе — мягче */
.builder-page .builder-question { background: var(--background-light); }
.builder-page .builder-question .bq-head { margin-bottom: 10px; }
.builder-page .bq-move button { background: none; border: none; color: var(--text-light); cursor: pointer; width: 30px; height: 30px; border-radius: 8px; }
.builder-page .bq-move button:hover { background: rgba(0,27,114,.07); color: var(--brand-blue); }

/* Модалка вопроса: «бейдж страницы» + поле перехода у варианта */
.q-page-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--brand-blue);
  background: rgba(0,27,114,.07); padding: 5px 12px; border-radius: 20px; margin-bottom: 14px; }
.q-page-pill:empty { display: none; }
.q-opt-row .q-opt-next { width: auto; max-width: 190px; flex-shrink: 0; padding: 8px 10px; font-size: 13px; height: auto; }
@media (max-width: 560px){ .q-opt-row { flex-wrap: wrap; } .q-opt-row .q-opt-next { max-width: none; width: 100%; order: 5; } }

/* Кнопка «Отправить» неактивна, пока не заполнены обязательные */
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.q-opt-row .q-opt-other { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-light); white-space: nowrap; flex-shrink: 0; cursor: pointer; }
.q-opt-row .q-opt-other input { width: 15px; height: 15px; accent-color: var(--brand-blue); }

/* Вариант «Другое» с полем ввода внутри блока */
.option-row.oo-card { flex-direction: column; align-items: stretch; gap: 10px; cursor: default; }
.option-row.oo-card .oo-radio { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.option-row.oo-card .oo-radio input { width: 19px; height: 19px; accent-color: var(--brand-red); flex-shrink: 0; }
.option-row.oo-card .q-other-input { width: 100%; margin: 0; min-height: 52px; padding: 14px 16px; font-size: 15px; }

/* Опшинсы-карточки (доступ, уникальность) вместо выпадающих списков */
.opt-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.opt-card { display: flex; gap: 11px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--border-light);
  border-radius: 12px; cursor: pointer; background: #fff; transition: all .15s ease; }
.opt-card:hover { border-color: var(--brand-blue); }
.opt-card input { margin-top: 2px; accent-color: var(--brand-red); flex-shrink: 0; }
.opt-card:has(input:checked) { border-color: var(--brand-blue); background: rgba(0,27,114,.04); box-shadow: 0 0 0 3px rgba(0,27,114,.08); }
.opt-card .oc-tt b { display: block; font-size: 14px; color: var(--text-dark); margin-bottom: 2px; }
.opt-card .oc-tt small { color: var(--text-light); font-size: 12.5px; line-height: 1.4; }

/* select2-фолбэк шкалы: на десктопе скрыт (кнопки), на мобилке — виден */
.scale-choice .scale-sel, .scale-choice .scale-sel + .select2-container { display: none; }
@media (max-width: 620px) {
  .scale-choice .scale-btns { display: none; }
  .scale-choice .scale-sel + .select2-container { display: block !important; width: 100% !important; }
}

/* Опшинсы доступа: во всю строку (одна колонка) + иконки */
.opt-cards-full { grid-template-columns: 1fr; }
.opt-cards-full .opt-card { align-items: center; padding: 14px 16px; }
.opt-cards-full .opt-card input[type=radio] { margin-top: 0; }
.opt-card .oc-ic { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; }
.oc-ic.blue { background: var(--brand-blue); } .oc-ic.red { background: var(--brand-red); }
.oc-ic.amber { background: #b45309; } .oc-ic.cyan { background: #0891b2; }
.oc-ic.purple { background: #7c3aed; } .oc-ic.grey { background: var(--medium-grey); }
.oc-ic.green { background: #15803d; }

/* ===== Модалки: фон заблокирован, скролл — у самой модалки (не внутри карточки) ===== */
body.modal-lock { position: fixed; width: 100%; overflow: hidden; }
.modal.open { display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; }
.modal-overlay { position: fixed; }
.modal-card, .modal-dialog { position: relative; top: auto; transform: none; margin: 40px auto; max-height: none; overflow: visible; }
@media (max-width: 600px) { .modal-card, .modal-dialog { margin: 16px auto; } }

/* ===== WYSIWYG-редактор ===== */
.rich { border: 1.5px solid var(--border-light); border-radius: 12px; overflow: hidden; background: #fff; }
.rich:focus-within { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(0,27,114,.08); }
.rich-toolbar { display: flex; gap: 2px; padding: 6px; background: var(--background-light); border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
.rich-toolbar button { width: 32px; height: 32px; border: none; background: none; border-radius: 7px; cursor: pointer; color: var(--text-dark); font-size: 13.5px; }
.rich-toolbar button:hover { background: rgba(0,27,114,.08); color: var(--brand-blue); }
.rich-toolbar .rt-sep { width: 1px; background: var(--border-light); margin: 4px 4px; }
.rich-editor { min-height: 96px; max-height: 340px; overflow-y: auto; padding: 12px 14px; font-family: 'Stem', sans-serif; font-size: 15px; color: var(--text-dark); outline: none; line-height: 1.55; }
.rich-editor:empty:before { content: attr(data-placeholder); color: var(--text-light); }
.rich-editor a { color: var(--brand-blue); }

/* Выбор акцентного цвета */
.color-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.color-picker input[type=color] { width: 48px; height: 40px; border: 1.5px solid var(--border-light); border-radius: 10px; padding: 3px; cursor: pointer; background: #fff; }
.color-presets { display: flex; gap: 7px; }
.color-preset { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--border-light); cursor: pointer; padding: 0; transition: transform .15s ease; }
.color-preset:hover { transform: scale(1.15); }

/* ===== Шапка конструктора: действия справа от хлебных крошек ===== */
.crumbs-right { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
@media (max-width: 560px) {
  .crumbs { flex-wrap: wrap; }
  .crumbs-right { width: 100%; margin-left: 0; margin-top: 8px; }
}

/* Дополнительные варианты кнопок */
.btn-grey { background: #eef1f6; color: var(--text-dark, #1f2733); border: 1.5px solid transparent; }
.btn-grey:hover { background: #e3e8f0; }
.btn-ghost-red { background: transparent; color: var(--brand-red); border: 1.5px solid transparent; }
.btn-ghost-red:hover { background: rgba(235,0,45,.08); }

/* ===== Содержимое AJAX-модалок ===== */
.am-body { padding: 0; }
.am-head { text-align: center; }
.am-title { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.am-alert { display: flex; gap: 9px; align-items: flex-start; margin-top: 16px; padding: 11px 14px; border-radius: 11px; background: #fff7ed; color: #9a3412; font-size: 13.5px; line-height: 1.45; border: 1px solid #fed7aa; }
.am-alert i { margin-top: 2px; }
.am-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }

/* Поле «скопировать ссылку» */
.copy-field { display: flex; gap: 8px; }
.copy-field .form-control { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text-light); background: #f7f9fc; }
.copy-field .btn { white-space: nowrap; flex-shrink: 0; }

/* Сводка о доступе в модалке «Поделиться» */
.share-meta { margin-top: 18px; border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; }
.share-meta-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 15px; font-size: 14px; }
.share-meta-row + .share-meta-row { border-top: 1px solid var(--border-light); }
.share-meta-row > span:last-child { font-weight: 600; text-align: right; }

/* ===== Заглавная картинка опроса — внутри первой панели ===== */
/* Без обложки красная полоса сверху даёт .form-main .panel:first-of-type (app.css). */
.form-lead { overflow: hidden; }
/* С обложкой — картинка вверху, а красная полоса ПОД картинкой (не поверх).
   Специфичность выше, чем у .form-main .panel:first-of-type, чтобы убрать верхнюю. */
.form-main .panel.form-lead.has-cover { border-top: none; }
.panel-cover { margin: -28px -28px 20px; line-height: 0; border-bottom: 6px solid var(--accent, var(--brand-red)); }
.panel-cover img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
@media (max-width: 760px) { .panel-cover { margin: -20px -18px 16px; } }

/* Чип «кто проходит» — авторизованный пользователь на опросе со входом */
.form-user { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 14px;
  background: var(--background-light); border: 1px solid var(--border-light); border-radius: 12px; }
.form-user .fu-av { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.form-user .fu-info b { display: block; font-size: 15px; color: var(--text-dark); }
.form-user .fu-info small { color: var(--text-light); font-size: 12.5px; }

/* ===== Панель действий конструктора (перенесена из хлебных крошек) ===== */
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -10px 0 20px; flex-wrap: wrap; }
.editor-toolbar .et-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ===== Загрузчик обложки в конструкторе ===== */
.cover-uploader { display: flex; flex-direction: column; gap: 8px; }
.cover-drop { position: relative; display: flex; align-items: center; justify-content: center; min-height: 120px;
  border: 1.5px dashed var(--border-light); border-radius: 14px; background: var(--background-light);
  cursor: pointer; overflow: hidden; transition: border-color .15s ease, background .15s ease; }
.cover-drop:hover, .cover-drop.is-drag { border-color: var(--brand-blue); background: rgba(0,27,114,.03); }
.cover-drop .cover-hint { display: flex; align-items: center; gap: 8px; color: var(--text-light); font-size: 14px; padding: 20px; text-align: center; }
.cover-drop .cover-img { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.cover-drop.has-img .cover-hint { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.55); color: #fff; justify-content: center; padding: 10px; }
.cover-remove { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-light); cursor: pointer; }
.cover-remove.is-hidden { display: none; }

/* ===== Блиц-таймер: зелёный → жёлтый → красный по мере истечения ===== */
.w-timer { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  color: #15803d; background: rgba(22,163,74,.12); padding: 3px 11px; border-radius: 20px; transition: color .4s ease, background .4s ease; }
.w-timer.t-warn { color: #b45309; background: rgba(217,119,6,.14); }
.w-timer.t-danger { color: var(--brand-red); background: rgba(235,0,45,.12); animation: pulse .9s infinite; }
@keyframes pulse { 50% { opacity: .5; transform: scale(1.04); } }

/* ===== Экран «Ваш ответ»: секции внутри общего .form-sheet, галочка на выборе ===== */
/* .ma-q — секция листа (padding/разделитель даёт .form-sheet .survey-question) */
.ma-q-title { font-family: 'Stem', sans-serif; font-weight: 600; font-size: 17px; margin: 0 0 14px;
  color: var(--brand-blue); line-height: 1.4; }
.ma-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.ma-options { display: flex; flex-direction: column; gap: 9px; }
.ma-opt { display: flex; align-items: flex-start; gap: 11px; padding: 11px 13px; border: 1.5px solid var(--border-light);
  border-radius: 12px; background: #fff; }
.ma-opt.is-mine { border-color: var(--brand-blue); background: rgba(0,27,114,.04); }
.ma-check { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-light);
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; margin-top: 1px; }
.ma-opt.is-mine .ma-check { background: var(--brand-blue); border-color: var(--brand-blue); }
.ma-opt-main { flex: 1; min-width: 0; }
.ma-opt-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ma-opt-label { font-size: 14.5px; }
.ma-opt.is-mine .ma-opt-label { font-weight: 600; }
.ma-opt-num { flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--text-light); white-space: nowrap; }
.ma-bar { margin-top: 7px; height: 6px; background: var(--light-grey); border-radius: 4px; overflow: hidden; }
.ma-bar span { display: block; height: 100%; background: var(--brand-blue); border-radius: 4px; transition: width .5s ease; }
.ma-opt.is-mine .ma-bar span { background: linear-gradient(90deg, var(--brand-blue), var(--accent-blue, #2563eb)); }
.ma-text { padding: 12px 14px; border: 1.5px solid var(--border-light); border-radius: 12px; background: var(--background-light); font-size: 14.5px; line-height: 1.55; }
.ma-actions form { margin: 0; }

/* ===== Результаты: бары + круговой график рядом ===== */
.rb-split { display: grid; grid-template-columns: minmax(0,1fr) 240px; gap: 24px; align-items: start; }
.rb-chart { position: relative; height: 230px; }
@media (max-width: 720px) { .rb-split { grid-template-columns: 1fr; } .rb-chart { height: 220px; margin-top: 8px; } }

/* Аватарки проголосовавших + кнопка «кто голосовал» */
.voter-stack { display: inline-flex; align-items: center; margin-top: 10px; padding: 3px 10px 3px 3px;
  border: none; background: transparent; cursor: pointer; border-radius: 20px; transition: background .15s ease; }
.voter-stack:hover { background: var(--background-light); }
/* Базовый аватар — только форма и цвет; размер задаёт контекст (стеки, чипы, карточки) */
.va-av { border-radius: 50%; background: var(--brand-blue); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
  /* всегда КРУГ: размер по умолчанию + квадратные пропорции (контекст-правила ниже перекрывают size) */
  width: 34px; height: 34px; aspect-ratio: 1; box-sizing: border-box; overflow: hidden; }
/* В накладывающихся стеках — размер + белая окантовка для разделения */
.voter-stack .va-av { width: 28px; height: 28px; font-size: 11px; border: 2px solid #fff; }
.voter-stack .va-av + .va-av { margin-left: -9px; }
.va-more { background: var(--medium-grey); }
.va-label { margin-left: 9px; font-size: 13px; font-weight: 600; color: var(--brand-blue); }

/* Список в модалке «кто голосовал» */
.vm-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; max-height: 50vh; overflow-y: auto; }
.vm-row { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 10px; background: var(--background-light); font-size: 14.5px; }
.vm-row .va-av { width: 32px; height: 32px; font-size: 12px; }

/* ===== Футер приложения — всегда внизу с отступом ===== */
body { min-height: 100vh; display: flex; flex-direction: column; }
.page-wrapper > main { flex: 1 0 auto; }
.app-footer { flex-shrink: 0; margin-top: 48px; padding: 22px 0; border-top: 1px solid var(--border-light); background: #fff; }
.app-footer .container { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-light); }
.app-footer a { color: var(--brand-blue); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }

/* Скрыть (не удалять) бейдж доступа на публичной форме */
.form-lead .badge-red { display: none; }

/* Панель кнопок на экране «Ответ принят» — прозрачная, без карточки */

/* Тест: правильный вариант — зелёный, ошибочный выбор — красный (перебивает синий is-mine) */
.ma-opt.is-correct { border-color: #16a34a; background: rgba(22,163,74,.06); }
.ma-opt.is-correct .ma-check { background: #16a34a; border-color: #16a34a; }
.ma-opt.is-correct .ma-bar span { background: #16a34a; }
.ma-opt.is-wrong { border-color: #EB002D; background: rgba(235,0,45,.05); }
.ma-opt.is-wrong .ma-check { background: #EB002D; border-color: #EB002D; }
.ma-opt.is-wrong .ma-bar span { background: #EB002D; }

/* Аватарки редакторов на карточке кабинета */
.editor-avatars { display: inline-flex; align-items: center; }
.editor-avatars .va-av { width: 26px; height: 26px; font-size: 10.5px; border: 2px solid #fff; }
.editor-avatars .va-av + .va-av { margin-left: -9px; }

/* «Я участвую»: баннер о назначенных непройденных + подсветка строки */
.assigned-alert { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 13px 16px;
  border-radius: 12px; background: rgba(235,0,45,.07); border: 1px solid rgba(235,0,45,.25); color: var(--brand-red); font-size: 14.5px; }
.assigned-alert i { font-size: 16px; }
.data-table tr.row-pending { background: rgba(235,0,45,.04); }
.data-table tr.row-pending td:first-child { box-shadow: inset 3px 0 0 var(--brand-red); }

/* Мобилка: кнопки под «Ответ принят» — как остальные, с боковыми отступами */
@media (max-width: 760px) {
  .ma-actions { padding-left: 16px; padding-right: 16px; }
  .ma-actions .btn, .ma-actions form { width: 100%; }
}

/* ===== Модалка выбора формата выгрузки ===== */
.export-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.export-choice { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--border-light);
  border-radius: 12px; text-decoration: none; color: var(--text-dark); transition: border-color .15s ease, background .15s ease; }
.export-choice:hover { border-color: var(--brand-blue); background: var(--background-light); }
.export-choice i { font-size: 26px; width: 30px; text-align: center; }
.export-choice b { display: block; font-size: 15px; }
.export-choice small { color: var(--text-light); font-size: 13px; }

/* ===== Явка по опросу ===== */
.turnout .turnout-nums { display: flex; gap: 28px; flex-wrap: wrap; }
.to-cell .to-num { font-size: 30px; font-weight: 700; color: var(--brand-blue); line-height: 1.1; }
.turnout-people { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-light); }
.turnout-people .tp-label { font-size: 13.5px; font-weight: 600; color: var(--text-dark); margin-bottom: 9px; }
.turnout-people .tp-list { display: flex; flex-wrap: wrap; gap: 7px; }

/* ===== Метки «верно / ваш ответ» на экране теста ===== */
.ma-tag { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 10px; margin-left: 8px; white-space: nowrap; }
.ma-tag-ok { background: rgba(22,163,74,.14); color: #15803d; }
.ma-tag-no { background: rgba(235,0,45,.10); color: var(--brand-red); }

/* ===== QR-код формы ===== */
.qr-box { display: inline-flex; padding: 18px; background: #fff; border: 1px solid var(--border-light);
  border-radius: 16px; margin: 18px auto 0; box-shadow: var(--shadow-sm); }
.qr-box img, .qr-box canvas { display: block; }

/* ===== Плашка режима «вход под пользователем» (impersonation) =====
   Красный фиксированный футер: виден всегда, чтобы админ не забыл, под кем сидит */
.impersonate-bar { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000;
  background: var(--brand-red); color: #fff; padding: 10px 18px; font-size: 14px;
  box-shadow: 0 -4px 18px rgba(4, 13, 46, 0.18); }
.impersonate-bar b { font-weight: 700; }
.impersonate-bar .btn { background: #fff; color: var(--brand-red); border-color: #fff; padding: 6px 14px; }
.impersonate-bar .btn:hover { background: #ffd7de; }
.impersonate-bar form { margin: 0; }
/* Контент не прячется под фиксированной плашкой */
body:has(.impersonate-bar) .page-wrapper { padding-bottom: 64px; }

/* Аватарка-картинка в шапке/меню/карточках вместо инициалов */
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* Зависимый тумблер, недоступный пока родительский выключен */
.switch-card.is-disabled { opacity: .45; pointer-events: none; }

/* ===== Явка: чипы участников с аватарками ===== */
.tp-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  border: 1px solid var(--border-light); border-radius: 20px; background: #fff; font-size: 13.5px; color: var(--text-dark); }
.tp-chip .va-av { width: 24px; height: 24px; font-size: 10px; border-width: 0; }
.tp-chip.tp-pending { border-color: rgba(235,0,45,.3); background: rgba(235,0,45,.04); }
.va-av.va-grey { background: var(--medium-grey); }
.tp-chip.tp-more { cursor: pointer; border-style: dashed; border-color: var(--brand-blue); color: var(--brand-blue);
  font-weight: 600; padding: 4px 14px; gap: 7px; transition: background .15s ease; font-family: 'Stem', sans-serif; }
.tp-chip.tp-more:hover { background: rgba(0,27,114,.06); }

/* Метки секций в модалке участников */
.pm-label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-dark); margin-top: 16px; }
.pm-label-red { color: var(--brand-red); }
.pm-label + .vm-list { margin-top: 8px; }

/* Длинные названия в хлебных крошках — показываем целиком, с переносом (не обрезаем) */
.crumbs .cur, .crumbs a { white-space: normal; overflow-wrap: anywhere; }

/* Карточка вопроса в конструкторе на мобилке: бейджи переносятся аккуратно,
   кнопки действий закреплены в правом верхнем углу */
.bq-head { flex-wrap: wrap; row-gap: 6px; }
@media (max-width: 760px) {
  .builder-question { position: relative; }
  .builder-question .bq-move { position: absolute; top: 12px; right: 10px; margin-left: 0 !important; }
  .builder-question .bq-head { padding-right: 76px; }
}

/* Файлы-ответы в результатах — кликабельные ссылки */
.file-links { display: flex; flex-wrap: wrap; gap: 8px; }
.file-links a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--border-light);
  border-radius: 10px; background: var(--background-light); color: var(--brand-blue); font-size: 13.5px; text-decoration: none; }
.file-links a:hover { border-color: var(--brand-blue); }

/* ===== Автокомплит людей (соавторы, участники) ===== */
.ac-box { position: relative; }
.ac-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--border-light); border-radius: 12px;
  box-shadow: var(--shadow-md); max-height: 264px; overflow-y: auto; }
.ac-item { display: flex; align-items: center; gap: 11px; padding: 9px 13px; cursor: pointer; transition: background .12s ease; }
.ac-item:hover { background: var(--background-light); }
.ac-item .va-av { width: 32px; height: 32px; font-size: 11.5px; flex-shrink: 0; }
.ac-item b { display: block; font-size: 14px; line-height: 1.25; }
.ac-item small { color: var(--text-light); font-size: 12.5px; }
.ac-empty { padding: 14px; text-align: center; color: var(--text-light); font-size: 13.5px; }
.ac-chosen { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ac-chosen .lt-x { border: none; background: rgba(0,27,114,.12); color: var(--brand-blue); width: 20px; height: 20px;
  border-radius: 50%; cursor: pointer; font-size: 12px; line-height: 1; margin-left: 4px; }
.ac-chosen .lt-x:hover { background: var(--brand-red); color: #fff; }

/* ===== Тип формы (фиксированный) в настройках ===== */
.type-static { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.type-static-badge { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 12px;
  background: rgba(0,27,114,.07); color: var(--brand-blue); font-weight: 600; font-size: 14.5px; }

/* ===== Описание блока (страницы) в конструкторе ===== */
.bp-desc { display: flex; align-items: center; gap: 9px; padding: 8px 16px; border-bottom: 1px solid var(--border-light);
  background: var(--background-light); }
.bp-desc i { color: var(--text-light); font-size: 12px; flex-shrink: 0; }
.bp-desc-input { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; border-radius: 8px;
  padding: 5px 9px; font-family: 'Stem', sans-serif; font-size: 13.5px; color: var(--text-dark); }
.bp-desc-input:hover { border-color: var(--border-light); background: #fff; }
.bp-desc-input:focus { outline: none; border-color: var(--brand-blue); background: #fff; }

/* ===== Информационный блок секции на публичной форме ===== */
.section-intro .si-desc { color: var(--text-light); font-size: 14px; line-height: 1.55; margin: 2px 0 0; }
.panel.section-intro.flat { padding: 18px 22px; border-left: 5px solid var(--brand-blue); }
.panel.section-intro.flat .si-title { font-weight: 700; font-size: 16.5px; color: var(--brand-blue);
  display: flex; align-items: center; gap: 9px; }
.panel.section-intro.flat .si-desc { margin-top: 6px; }

/* ===== Шаг «Публикация» мастера создания ===== */
.publish-step { max-width: 640px; margin: 0 auto; }
.publish-actions { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.publish-actions form { margin: 0; }

/* Кнопка удаления владельца */
.owner-del { border: none; background: none; color: var(--brand-red); cursor: pointer; width: 34px; height: 34px;
  border-radius: 9px; flex-shrink: 0; transition: background .15s ease; }
.owner-del:hover { background: rgba(235,0,45,.09); }

/* ===== Плавающая кнопка «Задать вопрос владельцу» (публичная форма) ===== */
.ask-fab { position: fixed; right: 22px; bottom: 22px; z-index: 900;
  width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand-blue); color: #fff; font-size: 20px;
  box-shadow: 0 8px 24px rgba(0,27,114,.35); transition: transform .15s ease, box-shadow .2s ease; }
.ask-fab:hover { transform: scale(1.08); box-shadow: 0 12px 30px rgba(0,27,114,.45); }
@media (max-width: 760px) { .ask-fab { right: 14px; bottom: 14px; width: 50px; height: 50px; } }

/* Плашка «вопрос от …» для авторизованных в модалке */
.ask-as { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 14px;
  background: var(--background-light); border: 1px solid var(--border-light); border-radius: 12px; font-size: 14px; }
.ask-as .va-av { width: 30px; height: 30px; font-size: 11px; }

/* ===== Вкладка «Сообщения» в конструкторе ===== */
.msg-card { border: 1px solid var(--border-light); border-radius: 14px; padding: 16px; background: #fff; margin-bottom: 14px; }
.msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.msg-head .va-av { width: 32px; height: 32px; font-size: 11.5px; }
.msg-head b { font-size: 14.5px; }
.msg-head .msg-date { margin-left: auto; color: var(--text-light); font-size: 12.5px; white-space: nowrap; }
.msg-body { font-size: 14.5px; line-height: 1.55; padding: 10px 14px; background: var(--background-light); border-radius: 10px; }
.msg-answer { margin-top: 10px; padding: 10px 14px; background: rgba(22,163,74,.07); border-left: 3px solid #16a34a; border-radius: 10px; font-size: 14px; }
.msg-answer small { display: block; color: var(--text-light); margin-top: 6px; font-size: 12.5px; }
.msg-reply { margin-top: 10px; display: flex; gap: 8px; align-items: flex-start; }
.msg-reply textarea { flex: 1; min-height: 44px; }
.msg-new-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-red); }
.ed-tab .tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: 10px; background: var(--brand-red); color: #fff; font-size: 11.5px; font-weight: 700; margin-left: 4px; }

/* Тихая кнопка-ссылка для второстепенных опасных действий */
.btn-link-danger { border: none; background: none; color: var(--text-light); font-size: 12.5px; cursor: pointer;
  font-family: 'Stem', sans-serif; padding: 4px 6px; border-radius: 6px; }
.btn-link-danger:hover { color: var(--brand-red); background: rgba(235,0,45,.06); }

/* Картинки вопроса на публичной форме (может быть несколько) */
.qf-imgs { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.qf-img { display: block; max-width: 100%; max-height: 320px; border-radius: 12px; }
/* Ссылки из rich-пояснений вопросов */
.q-desc a { color: var(--brand-blue); text-decoration: underline; }

/* Вариант «своё» в конструкторе: видно, что при выборе появится поле ввода */
.bo-other-hint { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; font-size: 12px;
  color: var(--text-light); border: 1px dashed var(--dark-grey); border-radius: 8px; padding: 2px 9px; }
.bo-other-hint i { font-size: 10px; }

/* Сводка об опросе под заголовком результатов */
.rh-meta { display: flex; gap: 16px; flex-wrap: wrap; margin: -6px 0 16px; font-size: 13.5px; color: var(--text-light); }
.rh-meta span { display: inline-flex; align-items: center; gap: 7px; }
.rh-meta .rh-on { color: #15803d; font-weight: 600; }

/* «N ответов собрано» — кликабельно у неанонимных */
.to-clickable { cursor: pointer; border-radius: 12px; transition: background .15s ease; }
.to-clickable:hover { background: rgba(0, 27, 114, 0.05); }

/* Ответы по респондентам */
.resp-row { border: 1.5px solid var(--border-light); border-radius: 12px; margin-bottom: 10px; background: #fff; }
.resp-row summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
.resp-row summary::-webkit-details-marker { display: none; }
.resp-row .rr-arrow { color: var(--text-light); font-size: 12px; transition: transform .2s ease; }
.resp-row[open] .rr-arrow { transform: rotate(180deg); }
.resp-row .rr-body { border-top: 1px solid var(--border-light); padding: 6px 16px 12px; }
.rr-qa { padding: 9px 0; border-bottom: 1px dashed var(--border-light); }
.rr-qa:last-child { border-bottom: none; }
.rr-q { font-size: 13px; color: var(--text-light); margin-bottom: 3px; }
.rr-a { font-size: 14.5px; }

/* Ховер-карточка участника (как в Google) */
.hover-card { position: fixed; z-index: 3500; background: #fff; border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(4, 13, 46, 0.22); min-width: 230px; max-width: 300px;
  animation: hcFade .15s ease; }
.hover-card .hc-top { display: flex; align-items: center; gap: 12px; }
.hover-card .hc-av { width: 48px; height: 48px; font-size: 16px; }
.hover-card .hc-info b { display: block; font-size: 15px; }
.hover-card .hc-info small { color: var(--text-light); font-size: 12.5px; }
.hover-card .hc-link { margin-top: 12px; width: 100%; }
@keyframes hcFade { from { opacity: 0; transform: translateY(4px); } }

/* Шкала в результатах: средняя + гистограмма распределения оценок */
.scale-summary { display: flex; align-items: flex-end; gap: 36px; flex-wrap: wrap; }
.scale-dist { display: flex; gap: 10px; align-items: flex-end; }
.sd-col { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 34px; }
.sd-count { font-size: 11.5px; color: var(--text-light); min-height: 15px; }
.sd-bar { width: 100%; height: 74px; background: var(--light-grey); border-radius: 8px; position: relative; overflow: hidden; display: flex; align-items: flex-end; }
.sd-bar i { display: block; width: 100%; background: var(--brand-blue); border-radius: 8px 8px 0 0; min-height: 2px; }
.sd-val { font-size: 12px; font-weight: 600; color: var(--text-dark); }

/* Кнопки статусов заявки в раскрытой строке */
.rr-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 0 4px; }
.rr-actions .btn { width: auto; }

/* Ряд кнопок-действий (results + статистика конструктора) */
.action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.action-row .btn { flex: 0 0 auto; width: auto; }
@media (max-width: 760px) { .action-row .btn { flex: 1 1 45%; } }

/* Автор текстового ответа в результатах: две ровные колонки —
   автор слева фиксированной ширины, текст справа (растягивается) */
.text-answer { display: flex; align-items: center; gap: 12px; }
.text-answer .ta-text { flex: 1; min-width: 0; }
.ta-author { display: inline-flex; align-items: center; gap: 7px; order: -1;
  flex: 0 0 190px; font-size: 12.5px; color: var(--text-light); white-space: nowrap;
  cursor: default; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 620px) { .text-answer { flex-wrap: wrap; } .ta-author { flex-basis: 100%; order: 0; } }

/* СНИЛС: контрольное число не сошлось */
.js-snils.is-invalid-snils { border-color: var(--brand-red); box-shadow: 0 0 0 3px rgba(235, 0, 45, 0.10); }

/* select2 не успел инициализироваться — нативный селект не мелькает.
   Если select2 вовсе недоступен (нет jQuery), forms.js вешает body.no-select2. */
select.js-select2:not(.select2-hidden-accessible) { opacity: 0; }
body.no-select2 select.js-select2 { opacity: 1; }

/* Плашки-обращения у вопросов: информация / осторожно / важно */
.q-callout { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 12px;
  font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.q-callout i { margin-top: 2px; flex-shrink: 0; }
.q-callout-info { background: rgba(0, 27, 114, 0.07); color: var(--brand-blue); }
.q-callout-warning { background: rgba(180, 83, 9, 0.10); color: #92400e; }
.q-callout-warning i { color: #d97706; }
.q-callout-danger { background: rgba(235, 0, 45, 0.08); color: #9f1230; }
.q-callout-danger i { color: var(--brand-red); }

/* Шкала: раскрывающийся список «кто какую оценку поставил» */
.scale-people { margin-top: 14px; border: 1.5px solid var(--border-light); border-radius: 12px; }
.scale-people summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer;
  list-style: none; font-size: 13.5px; color: var(--brand-blue); font-weight: 600; }
.scale-people summary::-webkit-details-marker { display: none; }
.scale-people[open] .rr-arrow { transform: rotate(180deg); }
.scale-people .sp-list { border-top: 1px solid var(--border-light); padding: 8px 14px 10px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 18px; }
.scale-people .sp-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.scale-people .sp-row .ta-author { flex: 1; }
.scale-people .sp-val { color: var(--brand-blue); }
/* ===================== КАЛЕНДАРЬ (flatpickr) — стиль КрасГМУ ===================== */
.flatpickr-calendar {
    font-family: 'Stem', Arial, sans-serif;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(4, 13, 46, 0.18);
    border: 1px solid var(--border-light);
    overflow: hidden;
    /* 7 колонок по 34 px + отступы контейнера: числа не жмутся друг к другу
       и по ним удобно попадать пальцем. Уже этого дни начинают слипаться. */
    width: 262px;
}
.flatpickr-rContainer, .flatpickr-days, .dayContainer { width: 100%; min-width: 0; max-width: none; }
.dayContainer { padding: 6px; justify-content: space-around; }

/* Шапка — тёмно-синяя.
   ВАЖНО: .flatpickr-current-month внутри позиционирован абсолютно, поэтому
   у .flatpickr-month должна быть заданная высота. С height:auto блок
   схлопывался, плашка превращалась в полоску и название месяца исчезало. */
.flatpickr-months { background: var(--brand-blue); padding: 0 2px; align-items: center; }
.flatpickr-months .flatpickr-month { height: 34px; color: #fff !important; }
.flatpickr-current-month,
.flatpickr-current-month .numInputWrapper,
.flatpickr-current-month span.cur-month,
.flatpickr-current-month span.cur-year,
.flatpickr-current-month input.cur-year { color: #fff !important; }
.flatpickr-current-month {
    font-weight: 600; font-size: 13.5px;
    height: 34px; padding: 0; line-height: 34px;
    display: flex; align-items: center; justify-content: center; gap: 2px;
    left: 0; right: 0; width: auto;
}
.flatpickr-current-month input.cur-year { font-weight: 600; font-size: 13.5px; padding: 0; }
.flatpickr-current-month .flatpickr-monthDropdown-months {
    color: #fff !important; font-weight: 600; font-size: 13.5px;
    background: var(--brand-blue); padding: 0 2px; margin: 0; border-radius: 6px;
}
.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { background: var(--brand-blue); color: #fff; }
.numInputWrapper:hover, .flatpickr-current-month .flatpickr-monthDropdown-months:hover { background: rgba(255,255,255,0.14); }
.flatpickr-current-month .numInputWrapper span.arrowUp:after { border-bottom-color: #fff; }
.flatpickr-current-month .numInputWrapper span.arrowDown:after { border-top-color: #fff; }
/* Стрелки месяцев — свои иконки, по высоте плашки, чтобы не срезались */
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    height: 34px; width: 30px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; border-radius: 8px;
}
.flatpickr-months .flatpickr-prev-month i,
.flatpickr-months .flatpickr-next-month i { font-size: 11px; color: #fff; }
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover { background: rgba(255,255,255,0.14); }
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg { fill: #fff; width: 12px; height: 12px; }
/* Дни недели */
.flatpickr-weekdays { background: #fff; padding: 6px 6px 0; height: auto; }
span.flatpickr-weekday { color: var(--text-light); font-weight: 600; font-size: 10.5px; }
.flatpickr-weekdaycontainer span.flatpickr-weekday:nth-child(6),
.flatpickr-weekdaycontainer span.flatpickr-weekday:nth-child(7) { color: var(--brand-red); }
/* Числа */
.flatpickr-day { border-radius: 50%; color: var(--text-dark); font-weight: 500; font-size: 13px; height: 32px; line-height: 32px; max-width: 32px; margin: 1px; }
.flatpickr-day:hover { background: rgba(0,27,114,0.07); border-color: transparent; }
.flatpickr-day.today { border: 1.5px solid var(--brand-blue); color: var(--brand-blue); font-weight: 700; }
.flatpickr-day.today:hover { background: rgba(0,27,114,0.07); }
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected.today {
    background: var(--brand-red); border-color: var(--brand-red); color: #fff; box-shadow: none; font-weight: 600;
}
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--dark-grey); }
.flatpickr-time { border-top: 1px solid var(--border-light); }
.flatpickr-time input { color: var(--text-dark); font-weight: 600; }
.flatpickr-time input:hover, .flatpickr-time .flatpickr-am-pm:hover { background: var(--background-light); }
.numInputWrapper span.arrowUp:after { border-bottom-color: #fff; }
.numInputWrapper span.arrowDown:after { border-top-color: #fff; }
.flatpickr-time .numInputWrapper span.arrowUp:after { border-bottom-color: var(--brand-blue); }
.flatpickr-time .numInputWrapper span.arrowDown:after { border-top-color: var(--brand-blue); }
.flatpickr-calendar.arrowTop:before { border-bottom-color: var(--brand-blue); }
.flatpickr-calendar.arrowTop:after { border-bottom-color: var(--brand-blue); }

/* ===================== ЗАГРУЗКА ФАЙЛОВ В ОТВЕТЕ =====================
   Нативный <input type="file"> оформить нельзя — прячем его и рисуем свою
   зону: клик и перетаскивание делают одно и то же, выбранное показываем
   списком с размером и кнопкой убрать. */
.file-drop { display: flex; flex-direction: column; gap: 10px; }
.file-drop .file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.fd-zone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 116px; padding: 18px 16px; text-align: center; cursor: pointer;
    border: 2px dashed var(--border-light); border-radius: 14px; background: var(--background-light);
    transition: border-color .18s ease, background .18s ease;
}
.fd-zone:hover { border-color: var(--brand-blue); background: rgba(0,27,114,.03); }
/* Класс вешает JS, пока файл тащат над зоной */
.fd-zone.is-drag { border-color: var(--brand-blue); background: rgba(0,27,114,.06); }
.fd-zone i { font-size: 24px; color: var(--brand-blue); }
.fd-text { font-size: 14.5px; color: var(--text-dark); }
.fd-text b { color: var(--brand-blue); text-decoration: underline; }
.fd-hint { font-size: 12.5px; color: var(--text-light); }

.fd-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fd-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border: 1.5px solid var(--border-light); border-radius: 11px; background: #fff;
}
.fd-item i.fd-ico { color: var(--brand-blue); font-size: 16px; flex-shrink: 0; }
.fd-name { flex: 1; min-width: 0; font-size: 14px; color: var(--text-dark);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-size { font-size: 12.5px; color: var(--text-light); flex-shrink: 0; }
.fd-del { border: none; background: none; color: var(--brand-red); cursor: pointer; font-size: 15px; padding: 2px 4px; flex-shrink: 0; }
.fd-del:hover { opacity: .75; }
/* Файл крупнее разрешённого: показываем, но на сервер не отправляем */
.fd-item.is-bad { border-color: var(--brand-red); background: rgba(235,0,45,.04); }
.fd-item.is-bad .fd-size { color: var(--brand-red); font-weight: 500; }

/* Уже загруженные файлы в просмотре ответа */
.fd-saved { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-saved a {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
    border: 1.5px solid var(--border-light); border-radius: 10px;
    color: var(--brand-blue); text-decoration: none; font-size: 14px; background: #fff;
}
.fd-saved a:hover { border-color: var(--brand-blue); background: rgba(0,27,114,.03); }

@media (max-width: 600px) {
    .fd-zone { min-height: 96px; padding: 14px 12px; }
}

/* ===================== ПОЛЕ ДАТЫ (flatpickr) =====================
   Иконка календаря справа, место под неё — в правом отступе.
   Оформление то же, что в конструкторе ботов. */
.js-date-input {
    padding-right: 42px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23001b72' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M8 3v4M16 3v4M3 10h18'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    background-size: 18px 18px;
    cursor: pointer;
}
/* Курсор-стрелка говорит «откроется календарь», но печатать тоже можно */
.js-date-input:focus { cursor: text; }
/* Ввели несуществующую дату или вне разрешённых границ — подсвечиваем и
   не даём мусору уехать на сервер (см. маску в forms.js) */
.js-date-input.is-bad { border-color: var(--brand-red) !important; }

/* ===================== SELECT2: доводка =====================
   Базовое оформление лежит в app.css; здесь то, чего там не хватало.  */

/* Текст и подсказка в поле поиска — как во всех полях сайта, иначе
   строка поиска выглядит инородной (серый системный цвет). */
.select2-container .select2-search__field { color: var(--text-dark); }
.select2-container .select2-search__field::placeholder { color: var(--text-light); opacity: 1; }

/* Чипы выбранных значений: крестик ПОСЛЕ текста, а не перед ним.
   В стандартной вёрстке select2 он идёт первым и выглядит как маркер списка. */
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex; flex-wrap: wrap; align-items: center; padding: 0 4px; gap: 0;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    display: inline-flex !important; align-items: center;
    margin: 3px 5px 0 0 !important; padding: 3px 9px !important; line-height: 1.5;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    order: 1; padding: 0 !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    order: 2; position: static !important; background: transparent !important; border: 0 !important;
    padding: 0 !important; margin: 0 0 0 6px !important; color: #fff !important;
    opacity: .8; font-size: 15px; line-height: 1; cursor: pointer;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: transparent !important; color: #fff !important; opacity: 1;
}

/* В самой анкете выпадающий список должен быть ростом с обычное поле:
   рядом стоят .form-control с padding 12px/14px, и 40px смотрелись мельче. */
.form-body .select2-container--default .select2-selection--single { height: 48px; }
.form-body .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 46px; }
.form-body .select2-container--default .select2-selection--single .select2-selection__arrow { height: 46px; }

/* Выпадающий список select2: та же геометрия, что у полей формы.
   Перенесено из bots-laravel — без этого блока список выглядел системным:
   прямые углы, чёрная рамка у строки поиска, крупные отступы пунктов. */
.select2-container--default .select2-dropdown {
    border: 1.5px solid var(--brand-blue); border-radius: 12px; overflow: hidden;
    box-shadow: 0 12px 30px rgba(4,13,46,.14);
}
.select2-container--default .select2-dropdown--above { border-radius: 12px; }
.select2-container--default .select2-results__option {
    padding: 9px 14px; font-size: 14.5px; color: var(--text-dark);
}
.select2-container--default .select2-results__option--selected { background: var(--background-light); color: var(--text-dark); }
.select2-container--default .select2-search--dropdown { padding: 8px; }
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1.5px solid var(--border-light); border-radius: 10px; padding: 8px 10px;
    font-family: 'Stem', sans-serif; font-size: 14px; outline: none;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: var(--brand-blue); }
.select2-container--default .select2-results > .select2-results__options { max-height: 260px; }
