/* Часть стилей ЗамерПро. Исходный public/css/app.css разбит для надёжной загрузки через туннель. */
.viewer-toolbar,
.mo-tabs,
.mo-filters,
.viewer-hint-filters {
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  flex-wrap: nowrap !important;
  scrollbar-width: thin;
}
.viewer-toolbar::-webkit-scrollbar,
.mo-tabs::-webkit-scrollbar,
.mo-filters::-webkit-scrollbar,
.viewer-hint-filters::-webkit-scrollbar { height: 5px; }
.viewer-toolbar::-webkit-scrollbar-thumb,
.mo-tabs::-webkit-scrollbar-thumb,
.mo-filters::-webkit-scrollbar-thumb,
.viewer-hint-filters::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }

/* цвета: обычная / наведение / нажата / выбрана */
.viewer-hint-filters button,
.mo-filters button,
.mo-tabs button {
  flex: 0 0 auto;
  transition: background .12s, color .12s, border-color .12s, transform .08s;
}
.viewer-hint-filters button { background: rgba(148,163,184,.14); color: #cbd5e1; border-color: #64748b; }
.viewer-hint-filters button:hover { background: rgba(148,163,184,.28); color: #fff; }
.viewer-hint-filters button:active { transform: scale(.96); background: #1e40af; color: #fff; }
.viewer-hint-filters button.is-active { background: #2563eb !important; border-color: #1d4ed8 !important; color: #fff !important; }

.mo-filters button { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.mo-filters button:hover { background: #e2e8f0; }
.mo-filters button:active { transform: scale(.96); background: #1e40af; color: #fff; }
.mo-filters button.is-active { background: #2563eb !important; border-color: #1d4ed8 !important; color: #fff !important; }

.mo-tabs button:active { transform: scale(.96); }

/* ---------- Виджеты обозначений: компактные, без прокрутки, синий = видно / белый = скрыто ---------- */
.viewer-toolbar,
.mo-tabs,
.mo-filters,
.viewer-hint-filters {
  overflow: visible !important;
  flex-wrap: nowrap !important;
}
.viewer-hint-filters,
.mo-filters { gap: 4px !important; }

.viewer-hint-filters .vf-label,
.mo-filters .mo-filters-label { font-size: 10px !important; }

.viewer-hint-filters button,
.mo-filters button {
  padding: 3px 9px !important;
  font-size: 10.5px !important;
  line-height: 1.25 !important;
  border-radius: 999px !important;
  border: 1.5px solid #94a3b8 !important;
  background: #ffffff !important;
  color: #334155 !important;
  font-weight: 700 !important;
  white-space: nowrap;
  transition: background .1s, color .1s, border-color .1s, transform .07s;
}
.viewer-hint-filters button:hover,
.mo-filters button:hover { background: #e2e8f0 !important; }
.viewer-hint-filters button:active,
.mo-filters button:active { transform: scale(.95); }

/* активный (размеры видны) — синий */
.viewer-hint-filters button.is-active,
.mo-filters button.is-active,
.mo-filters button[data-group="all"]:hover {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

/* ---------- Ещё компактнее: виджеты и верхняя строка 3D ---------- */
.viewer-toolbar { gap: 4px !important; padding: 5px 8px !important; }
.viewer-toolbar button,
.viewer-toolbar .tool-btn,
.viewer-tabs button {
  padding: 4px 9px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
}
.viewer-hint-filters { padding: 5px 8px !important; gap: 3px !important; }
.viewer-hint-filters .vf-label { font-size: 9.5px !important; }
.viewer-hint-filters button,
.mo-filters button {
  padding: 2px 7px !important;
  font-size: 9.5px !important;
  border-width: 1px !important;
}
@media (max-width: 1360px) {
  .viewer-hint-filters button,
  .mo-filters button { padding: 2px 5px !important; font-size: 9px !important; }
  .viewer-hint-filters .vf-label,
  .mo-filters .mo-filters-label { display: none !important; }
}

/* ---------- Виджеты: белые по умолчанию, синие при нажатии, «Все»/«Скрыть все» — оранжевые ---------- */
.viewer-hint-filters button,
.mo-filters button {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1.5px solid #94a3b8 !important;
}
.viewer-hint-filters button:hover,
.mo-filters button:hover { background: #f1f5f9 !important; }

/* нажатая (обозначения скрыты) — синяя */
.viewer-hint-filters button.is-off,
.mo-filters button.is-off {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

/* «Все» и «Скрыть все» — оранжевые */
.viewer-hint-filters button.chip-action,
.mo-filters button.chip-action {
  background: #f97316 !important;
  border-color: #ea580c !important;
  color: #ffffff !important;
}
.viewer-hint-filters button.chip-action:hover,
.mo-filters button.chip-action:hover { background: #fb923c !important; }

/* ---------- Сворачиваемая колонка иерархии ---------- */
.nav-collapse-btn { display: inline-flex; }
.app-shell.nav-collapsed .sidebar { display: none !important; }
.app-shell.nav-collapsed .drawer-veil { display: none !important; }
@media (min-width: 901px) { .menu-btn { display: none !important; } }

/* Колонка скрыта — страница на весь экран */
.app-shell.nav-collapsed { grid-template-columns: minmax(0, 1fr) !important; }
.app-shell.nav-collapsed .main { width: 100%; }
.nav-collapse-btn { display: inline-flex !important; }

/* ---------- Импорт документации: предпросмотр ---------- */
.imp-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.imp-count { font-size: 12px; font-weight: 700; color: var(--accent-hi, #2563eb); }
.imp-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.imp-floor { margin-bottom: 12px; }
.imp-floor-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.imp-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 3px 10px; }
.imp-room { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 4px; border-radius: 6px; cursor: pointer; }
.imp-room:hover { background: var(--surface-2, #eef2f7); }
.imp-num { font-weight: 700; }
.imp-area { color: var(--muted, #64748b); font-size: 11px; }

/* Сворачивание этажей в импорте */
.imp-floor-head { cursor: pointer; user-select: none; }
.imp-caret { width: 14px; display: inline-block; transition: transform .15s; font-size: 11px; color: var(--muted, #64748b); }
.imp-floor.is-collapsed .imp-caret { transform: rotate(-90deg); }
.imp-floor.is-collapsed .imp-rooms { display: none; }
.imp-floor-all { margin-left: auto; font-size: 11px; display: inline-flex; align-items: center; gap: 4px; color: var(--muted, #64748b); cursor: pointer; }

/* Удаление кабинета в списке импорта */
.imp-room { position: relative; padding-right: 22px; }
.imp-drop {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 5px; border: 1px solid transparent;
  background: transparent; color: var(--muted, #94a3b8); font-size: 11px; line-height: 1;
  cursor: pointer; opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.imp-room:hover .imp-drop { opacity: 1; }
.imp-drop:hover { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

/* Удаление этажа в списке импорта */
.imp-floor-head { position: relative; }
.imp-drop-floor { position: static !important; transform: none !important; opacity: .55 !important; margin-left: 6px; }
.imp-drop-floor:hover { opacity: 1 !important; }

/* Удаление кабинета в списке школы */
.row-item-wrap { position: relative; }
.row-item-wrap .row-del {
  position: absolute; right: 34px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--muted, #94a3b8); display: grid; place-items: center;
  cursor: pointer; opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.row-item-wrap:hover .row-del { opacity: 1; }
.row-item-wrap .row-del:hover { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

/* Выпадающие меню в шапках */
.btn-menu, .tool-menu { position: relative; display: inline-block; }
.btn-menu > summary, .tool-menu > summary { list-style: none; cursor: pointer; }
.btn-menu > summary::-webkit-details-marker, .tool-menu > summary::-webkit-details-marker { display: none; }
.btn-menu-list, .tool-menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 190px;
  background: var(--surface-2, #fff); border: 1px solid var(--line, #cbd5e1); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, .18); padding: 5px; display: flex; flex-direction: column;
}
.btn-menu-list button, .tool-menu-list button {
  text-align: left; padding: 7px 10px; border: 0; background: transparent; border-radius: 7px;
  font-size: 12.5px; color: var(--ink, #0f172a); cursor: pointer; white-space: nowrap;
}
.btn-menu-list button:hover, .tool-menu-list button:hover { background: var(--surface-3, #eef2f7); }

/* Логотип в сайдбаре — кнопка возврата к иерархии объектов */
.brand { width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer; font: inherit; color: inherit; }
.brand:hover .brand-title { color: var(--accent-hi, #2563eb); }

/* На узком экране верхняя панель должна быть выше затемнения, иначе кнопка «три полосы» перекрыта */
@media (max-width: 900px) {
  .topbar { z-index: 30; }
  .app-shell.nav-open .drawer-veil { z-index: 25; }
}

/* Кнопка «три полосы» работает на любом экране: открывает/закрывает колонку */
@media (max-width: 900px) {
  /* на узком экране колонка показывается, пока не свёрнута */
  .app-shell:not(.nav-collapsed) .sidebar { transform: none; }
  .app-shell:not(.nav-collapsed) .drawer-veil { display: block; position: fixed; inset: 0; background: rgba(4, 7, 12, .6); z-index: 25; }
  .app-shell:not(.nav-collapsed) .topbar { z-index: 30; }
  .nav-collapse-btn { display: inline-flex !important; }
}

/* Поле «Сколько окон добавить» — контрастный текст */
#win-count {
  color: #0b1220 !important;
  background: #ffffff !important;
  border: 1.5px solid #94a3b8 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-align: center;
  caret-color: #2563eb;
  -webkit-text-fill-color: #0b1220;
  opacity: 1 !important;
}
#win-count:focus { outline: none; border-color: #2563eb !important; box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.modal-body label { color: var(--ink, #0f172a); }

/* Поиск и фильтр кабинетов на странице школы */
.school-room-filters { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; flex-wrap: wrap; }
.school-room-search { display: flex; align-items: center; gap: 7px; flex: 1 1 280px; max-width: 420px;
  background: var(--surface-2, #fff); border: 1px solid var(--line, #cbd5e1); border-radius: 10px; padding: 6px 10px; }
.school-room-search input { flex: 1; border: 0; outline: none; background: transparent; font: inherit; font-size: 13px; color: var(--ink, #0f172a); }
.school-room-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--line, #cbd5e1); background: var(--surface-2, #fff); color: var(--ink, #0f172a);
  font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.school-room-toggle:hover { background: var(--surface-3, #eef2f7); }
.school-room-toggle.is-active { background: #2563eb; border-color: #1d4ed8; color: #fff; }
.school-room-count { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px;
  background: rgba(37, 99, 235, .12); color: #1d4ed8; }
.school-room-toggle.is-active .school-room-count { background: rgba(255,255,255,.22); color: #fff; }

/* Кнопка выбора типа школы, когда тип ещё не задан */
.chip-add-type { border: 1px dashed var(--line, #cbd5e1); background: transparent; color: var(--muted, #64748b); }
.chip-add-type:hover { border-color: #2563eb; color: #2563eb; background: rgba(37,99,235,.06); }

/* Режим замера на телефоне и планшете: одна колонка, без горизонтальной прокрутки */
