/* ============================================================
   ПоискОК — дизайн-система (стиль Apple)
   ============================================================ */

/* Атрибут hidden должен побеждать display у классов (формы, панели, модалки). */
[hidden] { display: none !important; }

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f0f0f2;
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --tertiary: #aeaeb2;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --accent: #23dfa3;
  /* тёмный вариант зелёного для светлого фона */
  --accent-green: #23dfa3;
  --accent-cyan: #65cff0;
  --grad: linear-gradient(135deg, #23dfa3 0%, #65cff0 100%);
  --grad-text: #ffffff;
  --danger: #ff3b30;
  --warning: #ff9500;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.05), 0 12px 32px rgba(0, 0, 0, 0.12);
  --shadow-3: 0 4px 8px rgba(0, 0, 0, 0.06), 0 24px 64px rgba(0, 0, 0, 0.18);
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 200ms;
  --t-med: 300ms;
  --t-slow: 350ms;
  --header-h: 56px;
  /* --- T1: плотность/компактность (пункты 1, 19, 23). Отступы ужаты на 15–20% --- */
  --pad-page-x: 14px;
  /* горизонтальные поля страницы (было 16–20) */
  --pad-page-y: 12px;
  /* вертикальные поля страниц/секций (было 14–16) */
  --pad-card: 14px;
  /* внутренний отступ карточки (было 16–18) */
  --pad-card-sm: 10px 12px;
  /* компактная карточка-строка (было 12/14) */
  --pad-modal-x: 18px;
  /* горизонтальные поля модалки (было 22) */
  --pad-modal-y: 14px;
  /* вертикальные поля модалки (было 18) */
  --pad-admin: 11px 13px 22px;
  --gap: 10px;
  /* базовый gap сеток/списков (было 12) */
  --gap-sm: 6px;
  --h-control: 38px;
  /* высота поля ввода/кнопки по умолчанию */
  --h-error: 18px;
  /* фикс. высота строки ошибки поля */
  --h-modal-error: 22px;
  /* фикс. высота области ошибки модалки */
  --h-head: 46px;
  /* фикс. высота шапки модалки */
  --modal-max-h: 86dvh;
  /* фикс. max-height модалок */
  /* --- T1: бренд-цвета (пункт 16) — переопределяются через JS (lib/theme.ts) --- */
  --brand: var(--accent-green);
  --brand-2: var(--accent-cyan);
  --brand-grad: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-cyan) 100%);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

html[data-theme='dark'] {
  color-scheme: dark;
  /* нативные контролы (select/date/скроллбары) в тёмном оформлении */
  --bg: #0b0d10;
  --surface: #17191e;
  --surface-2: #121418;
  --text: #e6e8eb;
  --secondary: #9aa0a8;
  --tertiary: #5c626b;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent: #2ee6a6;
  --accent-green: #2ee6a6;
  --accent-cyan: #4fc8e8;
  --grad: linear-gradient(135deg, #2ee6a6 0%, #4fc8e8 100%);
  --grad-text: #ffffff;
  --danger: #ff5d52;
  --warning: #ffa940;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.55);
  --shadow-3: 0 4px 8px rgba(0, 0, 0, 0.45), 0 24px 64px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
}

html {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  height: 100%;
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* color: inherit — иначе <button> берёт UA-цвет «buttontext» (чёрный) и в тёмной теме
   текст на кнопках-карточках (например, .org-mini в списке организаций) становится невидимым. */
button {
  font-family: var(--font);
  color: inherit;
}

input,
textarea,
select {
  font-family: var(--font);
}

/* T1 (пункт 4): textarea не тянется мышью нигде — высоту задаёт layout, а не пользователь
   (иначе «прыгает» вёрстка и кнопки). Глобально с !important — перебивает .textarea. */
textarea {
  resize: none !important;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

/* ---------- Скроллбары (T1, пункт 5): thumb #00f58b, track прозрачный, 8px, обе темы ----------
   Chrome/Edge/Safari — точная толщина 8px через ::-webkit-scrollbar (вертикальный
   и горизонтальный). Firefox — стандартные свойства внутри @supports(-moz-appearance),
   иначе Chrome переключается на нативные скроллбары и игнорирует 8px. */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #00f58b;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #00d97b;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

@supports (-moz-appearance: none) {
  * {
    scrollbar-width: thin;
    scrollbar-color: #00f58b transparent;
  }
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  scrollbar-width: none;
}

/* ---------- Карточки и поверхности ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.card-hover {
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.card-hover:hover {
  border-color: var(--border-strong);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: var(--r-md);
  padding: 9px 16px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
  user-select: none;
  line-height: 1.2;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--grad);
  color: var(--grad-text);
}

.btn-primary:hover:not(:disabled) {
  filter: saturate(1.15) brightness(1.04);
}

.btn-surface {
  background: var(--surface-2);
  color: var(--text);
}

.btn-surface:hover:not(:disabled) {
  background: var(--border-strong);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-ghost {
  background: transparent;
  color: var(--secondary);
  padding: 7px 10px;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: rgba(255, 59, 48, 0.12);
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(255, 59, 48, 0.2);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
  border-radius: var(--r-sm);
}

.btn-lg {
  padding: 12px 22px;
  font-size: 16px;
  border-radius: var(--r-lg);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  padding: 7px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
}

/* ---------- Поля ввода ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--secondary);
}

.input,
.textarea,
.select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 14.5px;
  color: var(--text);
  outline: none;
  transition: border var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--tertiary);
}

.textarea {
  resize: none;
  min-height: 68px;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--secondary) 50%), linear-gradient(135deg, var(--secondary) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
  cursor: pointer;
}

/* T1 (пункт 1): строка ошибки/подсказки фиксированной высоты — текст не двигает кнопки. */
.field-error {
  text-align: center;
  font-size: 12.5px;
  color: var(--danger);
  min-height: var(--h-error);
  line-height: var(--h-error);
}

.field-hint {
  font-size: 12px;
  color: var(--tertiary);
  min-height: var(--h-error);
  line-height: var(--h-error);
}

/* ---------- Кастомные чекбоксы/радио ---------- */
input[type='checkbox'],
input[type='radio'] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  position: relative;
  vertical-align: middle;
}

input[type='checkbox'] {
  border-radius: 6px;
}

input[type='radio'] {
  border-radius: 50%;
}

input[type='checkbox']:hover,
input[type='radio']:hover {
  border-color: var(--accent);
}

input[type='checkbox']:checked,
input[type='radio']:checked {
  border-color: var(--accent);
  background: var(--accent);
}

input[type='checkbox']:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2.2px 2.2px 0;
  transform: rotate(45deg);
}

html[data-theme='light'] input[type='checkbox']:checked::after {
  border-color: #fff;
}

html[data-theme='dark'] input[type='checkbox']:checked::after {
  border-color: #0b0d10;
}

input[type='radio']:checked::after {
  content: '';
  position: absolute;
  left: 5.5px;
  top: 5.5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
}

html[data-theme='dark'] input[type='radio']:checked::after {
  background: #0b0d10;
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--secondary);
}

.checkbox-row input {
  margin-top: 1px;
}

/* ---------- Шапка ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  display: flex;
  align-items: center;
}

.logo:hover {
  text-decoration: none;
}

.logo-accent {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 12px;
}

.nav-link {
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  transition: background var(--t-fast) var(--ease);
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-link:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.nav-link.active {
  font-weight: 700;
}

.header-spacer {
  flex: 1;
}

.header-btn {
  color: var(--text);
}

.hint-dot {
  position: absolute;
  top: 4px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg);
}

/* Выпадающее меню */
.dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  z-index: 70;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  padding: 6px;
  animation: pop var(--t-med) var(--ease);
}

.dropdown-panel::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

/* «мост» для hover */
.dropdown-panel.left {
  right: auto;
  left: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}

.dropdown-item:hover {
  background: var(--surface-2);
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Мобильная панель ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  z-index: 90;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
  pointer-events: none;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 300px;
  max-width: 84vw;
  z-index: 100;
  background: var(--surface);
  box-shadow: var(--shadow-3);
  transform: translateX(-102%);
  transition: transform var(--t-slow) var(--ease);
  display: flex;
  flex-direction: column;
  border-radius: 0 var(--r-xl) var(--r-xl) 0;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.drawer-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- Нижняя панель вкладок (мобильная) ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-inner {
  display: flex;
}

.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 2px 10px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.tabbar-item.active {
  color: var(--accent);
}

.tabbar-item:hover {
  text-decoration: none;
  background: var(--surface-2);
}

.tabbar-badge {
  position: absolute;
  top: 4px;
  left: 50%;
  margin-left: 8px;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

@media (max-width: 860px) {
  .tabbar {
    display: block;
  }

  .desktop-nav {
    display: none !important;
  }

  .logo-desktop {
    display: none !important;
  }

  .logo-mobile {
    display: flex !important;
  }

  .burger-btn {
    display: inline-flex !important;
  }

  .header-user-name {
    display: none;
  }

  body {
    padding-bottom: 56px;
  }
}

@media (min-width: 861px) {
  .logo-mobile {
    display: none !important;
  }

  .burger-btn {
    display: none !important;
  }
}

/* ---------- Модалки (T1, пункт 23) ----------
   Фиксированные размеры по классу: .modal-sm 420 / .modal-md 560 /
   .modal-lg 760 / .modal-xl 980. Высота ограничена 86dvh, скроллится только
   .modal-body; шапка (.modal-head) и футер (.modal-foot) не скроллятся.
   Область ошибки .modal-error имеет фикс. высоту — кнопки не двигаются. */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadein var(--t-med) var(--ease);
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 0;
  box-sizing: border-box;
}

@keyframes fadein {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  width: 100%;
  max-width: 560px;
  /* дефолт = .modal-md */
  max-height: var(--modal-max-h);
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: pop var(--t-med) var(--ease);
  border: 1px solid var(--border);
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
}

/* Классы размера (max-width — чтобы на узких экранах окно сжималось). */
.modal.modal-sm {
  max-width: 420px;
}

.modal.modal-md {
  max-width: 560px;
}

.modal.modal-lg {
  max-width: 760px;
}

.modal.modal-xl {
  max-width: 980px;
}

.modal-sm,
.modal-md,
.modal-lg,
.modal-xl {
  max-height: var(--modal-max-h);
}

@media (max-width: 640px) {
  .modal-layer {
    padding: 10px;
  }

  .modal {
    max-width: 100%;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--pad-modal-y) var(--pad-modal-x) 6px;
  flex-shrink: 0;
  min-width: 0;
  min-height: var(--h-head);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}

.modal-body {
  padding: 4px var(--pad-modal-x) 16px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  box-sizing: border-box;
}

.modal-body>* {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.modal-foot {
  padding: 0 var(--pad-modal-x) 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Область ошибки модалки: ровно 22px, чтобы появление текста не сдвигало кнопки. */
.modal-error {
  min-height: var(--h-modal-error);
  line-height: 1.35;
  font-size: 12.5px;
  color: var(--danger);
  overflow: hidden;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--secondary);
  cursor: pointer;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- Тосты (T1, пункт 7): persistent, правый нижний угол, зелёный акцент ---------- */
.toast-wrap {
  position: fixed;
  z-index: 400;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  width: min(380px, calc(100vw - 32px));
  max-width: 380px;
  max-height: calc(100dvh - var(--header-h) - 32px);
  overflow: hidden;
  pointer-events: none;
  /* контент под уведомлениями остаётся доступным */
}

@media (max-width: 860px) {
  .toast-wrap {
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    /* Вплотную к нижнему меню: уведомление не должно висеть над ним. */
    bottom: var(--tabbar-space, 58px);
    border-radius: 0;
  }

  /* Мобильные уведомления — прямоугольные (task-16, п.16): цвет, тень и
     акцентная полоса остаются, скругление убираем. */
  .toast,
  .toast-accent,
  .toast-timer {
    border-radius: 0;
  }

  /* Когда меню скрыто клавиатурой/фокусом, прижимаем к краю экрана. */
  body.form-focus .toast-wrap,
  body.keyboard-open .toast-wrap {
    bottom: 8px;
  }
}

.toast {
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  cursor: default;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-3);
  padding: 11px 12px 11px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  animation: toast-in var(--t-slow) var(--ease);
}

.toast-clickable {
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.toast-clickable:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border-strong));
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
}

.toast-clickable:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Зелёный акцент: вертикальная полоса слева (у error/warning — свой цвет). */
.toast-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand);
  border-radius: 3px 0 0 3px;
}

.toast-accent.success {
  background: var(--accent-green);
}

.toast-accent.warning {
  background: var(--warning);
}

.toast-accent.error {
  background: var(--danger);
}

.toast-accent.info {
  background: var(--accent-cyan);
}

.toast-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-icon.success {
  color: var(--accent);
}

.toast-icon.warning {
  color: var(--warning);
}

.toast-icon.error {
  color: var(--danger);
}

.toast-icon.info {
  color: var(--accent-cyan);
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.3;
  padding-right: 18px;
}

.toast-body {
  font-size: 12.5px;
  color: var(--secondary);
  margin-top: 3px;
  line-height: 1.35;
}

.toast-action {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}

.toast-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--tertiary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.toast-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.toast-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--brand-grad);
  animation: toast-timer 5s linear forwards;
  border-radius: 0 0 0 3px;
}

.toast-warning .toast-timer {
  background: var(--warning);
}

.toast-error .toast-timer {
  background: var(--danger);
}

.toast-success .toast-timer {
  background: var(--accent-green);
}

@keyframes toast-timer {
  from {
    width: 100%;
  }

  to {
    width: 0;
  }
}

/* ---------- Главная ---------- */
/* T1 (пункт 19/20): страница = фикс. каркас на весь вьюпорт, скролл — только в .scroll-area.
   height:100dvh + padding-top (border-box) = содержимое ровно calc(100dvh - header),
   без margin (margin-top у первого ребёнка body даёт лишний overflow у документа). */
.page-home {
  height: 100dvh;
  padding-top: var(--header-h);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.home-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 22px 14px 16px;
  min-height: 0;
}

.home-hero {
  text-align: center;
}

.home-hero h1 {
  font-size: clamp(23px, 3.8vw, 34px);
  letter-spacing: -0.03em;
}

.home-hero p {
  color: var(--secondary);
  font-size: clamp(13.5px, 1.7vw, 16px);
  margin-top: 5px;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Блок локации */
.loc-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  height: 36px;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.loc-chip:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.loc-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 14px;
  font-size: 14px;
  box-shadow: var(--shadow-1);
  height: 36px;
  white-space: nowrap;
  flex-shrink: 0;
}

.loc-hint .btn {
  font-size: 13px;
  padding: 5px 12px;
}

/* Строка поиска */
.composer {
  width: 100%;
  max-width: 860px;
  position: relative;
}

.composer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.composer-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 10px 10px 10px 16px;
  box-shadow: var(--shadow-2);
  transition: border-color var(--t-med) var(--ease);
}

.search-box:focus-within {
  border-color: var(--accent);
}

.search-textarea {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  font-size: 16px;
  color: var(--text);
  line-height: 1.4;
  /* Высота 34px, строка 22.4px: (34−22.4)/2 = 5.8 — текст ровно по центру поля. */
  padding: 5.8px 0;
  height: 34px;
  min-height: 34px;
  /* До 4 строк высоту считает JS (fitRequestTextarea), дальше — вертикальный скролл. */
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.search-textarea::placeholder {
  color: var(--tertiary);
}

.typewriter-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.typewriter {
  position: absolute;
  left: 0;
  /* Должен совпадать с padding-top .search-textarea, чтобы подсказка стояла как текст. */
  top: 5.8px;
  right: 0;
  pointer-events: none;
  font-size: 16px;
  color: var(--tertiary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.typewriter .tw-cursor {
  display: inline-block;
  width: 2px;
  height: 17px;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: -3px;
  animation: tw-blink 0.9s steps(1) infinite;
}

@keyframes tw-blink {
  50% {
    opacity: 0;
  }
}

.attach-btn {
  background: transparent;
  border: none;
  color: var(--secondary);
  cursor: pointer;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  flex-shrink: 0;
}

.attach-btn:hover {
  background: var(--surface-2);
  color: var(--accent);
}

.send-btn {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  color: #fff;
}

.send-btn svg {
  stroke-width: 2;
}

.composer-hint {
  font-size: 12.5px;
  color: var(--tertiary);
  padding: 8px 16px 0;
  text-align: center;
}

/* Превью вложений */
.attach-preview-row {
  display: flex;
  gap: 10px;
  padding: 12px 8px 0;
  flex-wrap: wrap;
}

.attach-preview {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.attach-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attach-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
}

.attach-preview:hover .attach-remove {
  display: flex;
}

.attach-progress {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
}

.circular-progress {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(#00f58b var(--p, 0%), rgba(255, 255, 255, 0.25) 0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.circular-progress::after {
  content: '';
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
}

/* Drag & drop оверлей */
.dnd-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadein var(--t-fast) var(--ease);
}

.dnd-center {
  text-align: center;
  color: #f5f5f7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border: 2px dashed color-mix(in srgb, var(--accent-cyan) 70%, transparent);
  border-radius: var(--r-xl);
  padding: 56px 48px;
  background: rgba(255, 255, 255, 0.05);
}

.dnd-center .dnd-icon {
  width: 64px;
  height: 64px;
  color: var(--accent-cyan);
  animation: floaty 2.2s ease-in-out infinite;
}

@keyframes floaty {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.dnd-title {
  font-size: 20px;
  font-weight: 700;
}

.dnd-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

/* Двухпанельный селектор категорий */
.cat-picker {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  display: flex;
  height: 380px;
  overflow: hidden;
  animation: pop var(--t-med) var(--ease);
}

.cat-col {
  overflow-y: auto;
  padding: 6px;
}

.cat-col.left {
  width: 46%;
  border-right: 1px solid var(--border);
}

.cat-col.right {
  flex: 1;
  background: var(--surface-2);
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}

.cat-item:hover {
  background: var(--surface-2);
  color: var(--accent-green);
}

.cat-item.selected {
  background: var(--surface-2);
  font-weight: 700;
}

.cat-item .cat-ico {
  color: var(--accent);
  flex-shrink: 0;
}

.cat-crumb {
  padding: 8px 12px 4px;
  font-size: 12.5px;
  color: var(--secondary);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--surface-2);
  z-index: 2;
}

/* ---------- «Как это работает» ---------- */
.how-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .how-grid {
    grid-template-columns: 1fr;
  }
}

.how-card {
  display: flex;
  gap: 16px;
  padding: 16px 18px;
  align-items: stretch;
}

.how-ico {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--grad);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
}

.how-ico svg {
  stroke-width: 2;
}

.how-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.how-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.how-card h3 {
  font-size: 15px;
  margin-bottom: 0;
}

.how-card .step-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.how-card p {
  font-size: 13px;
  color: var(--secondary);
}

/* ---------- Страница запросов (мессенджер) ---------- */
/* T1 (пункт 10): .page-shell — фикс. высота вьюпорта, страница НЕ скроллится.
   height:100dvh + padding-top (border-box) = содержимое calc(100dvh - header-h).
   Скроллятся вложенные .scroll-area (списки/таблицы), тулбар — .toolbar-sticky. */
.page-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding-top: var(--header-h);
  box-sizing: border-box;
  overflow: hidden;
  min-height: 0;
}

.shell-head {
  padding: var(--pad-page-y) var(--pad-page-x) 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 48px;
}

.shell-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.shell-body {
  flex: 1;
  display: flex;
  min-height: 0;
  padding: 0 10px 10px;
  gap: 10px;
}

.req-list {
  width: 30%;
  min-width: 260px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  min-height: 0;
}

.req-list-head {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 42px;
}

.req-list-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  overflow-anchor: none;
}

.req-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
  position: relative;
}

.req-item:hover {
  background: var(--surface-2);
}

.req-item.selected {
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--accent);
}

.req-item-text {
  font-size: 13.5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.req-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--secondary);
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
}

.badge-unread {
  background: var(--danger);
  color: #fff;
}

.badge-muted {
  background: var(--surface-2);
  color: var(--secondary);
}

.badge-accent {
  background: rgba(0, 245, 139, 0.16);
  color: var(--accent);
}

.badge-cyan {
  background: color-mix(in srgb, var(--accent-cyan) 16%, transparent);
  color: var(--accent-cyan);
}

html[data-theme='light'] .badge-cyan,
html:not([data-theme]) .badge-cyan {
  color: #1d7fa8;
}

.req-item .dots-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
}

.req-item:hover .dots-btn {
  opacity: 1;
}

.req-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  min-width: 0;
  box-shadow: var(--shadow-1);
}

.req-detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--secondary);
  padding: 24px;
  text-align: center;
}

.org-mini-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
}

.org-mini {
  padding: 14px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.org-mini:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.org-mini-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.org-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--grad);
  color: var(--grad-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.org-mini-name {
  font-weight: 700;
  font-size: 14px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-mini-preview {
  font-size: 13px;
  color: var(--secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.org-mini-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--tertiary);
}

/* Чат */
.chat-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 54px;
}

.chat-head-title {
  flex: 1;
  min-width: 0;
}

.chat-head-name {
  font-weight: 700;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-head-name-btn {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text);
  cursor: pointer;
  max-width: 100%;
}

.chat-head-name-btn:hover:not(:disabled) {
  color: var(--accent);
}

.chat-head-name-btn:disabled {
  cursor: default;
}

.chat-head-sub {
  font-size: 11.5px;
  color: var(--secondary);
}

.chat-link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  word-break: break-all;
}

.chat-link:hover {
  text-decoration: none;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  overflow-anchor: none;
}

.msg-row {
  display: flex;
}

.msg-row.mine {
  justify-content: flex-end;
}

.msg-bubble {
  max-width: min(72%, 560px);
  padding: 9px 13px;
  border-radius: var(--r-md);
  position: relative;
  font-size: 14.5px;
  line-height: 1.4;
  word-break: break-word;
}

.msg-row.mine .msg-bubble {
  background: var(--grad);
  color: var(--grad-text);
  border-bottom-right-radius: 6px;
}

.msg-row.theirs .msg-bubble {
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 6px;
}

.msg-bubble .msg-img {
  max-width: 300px;
  border-radius: 10px;
  cursor: pointer;
  display: block;
  margin: 4px 0;
}

.msg-bubble .msg-img-above {
  margin: 6px 0 2px;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  margin-top: 3px;
  justify-content: flex-end;
  color: var(--tertiary);
}

.msg-row.mine .msg-meta {
  color: rgba(255, 255, 255, 0.75);
}

.msg-actions {
  position: absolute;
  top: -10px;
  right: 8px;
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  box-shadow: var(--shadow-2);
  z-index: 5;
}

.msg-row:hover .msg-actions {
  display: flex;
}

.msg-act-btn {
  background: transparent;
  border: none;
  color: var(--secondary);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.msg-act-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.msg-deleted {
  font-style: italic;
  color: var(--tertiary);
}

.msg-date-sep {
  text-align: center;
  font-size: 11.5px;
  color: var(--tertiary);
  padding: 6px 0;
}

.chat-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 13px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input .textarea {
  min-height: 38px;
  max-height: 120px;
}

/* Тайпинг/статусы */
.status-sent,
.status-delivered {
  color: var(--tertiary);
}

.status-read {
  color: #0091ff;
}

.ticks {
  letter-spacing: -3px;
  font-size: 12px;
}

.ticks .t2 {
  margin-left: -1px;
}

/* ---------- Лайтбокс (общий: чат, «Мои запросы», поддержка, главная) ----------
   Основное фото занимает почти всю высоту/ширину экрана (object-fit: contain,
   не «мелкое по центру»), миниатюры — отдельная вертикальная колонка справа
   с собственной прокруткой. На узких экранах колонка уходит вниз и становится
   горизонтальной лентой. Админский `.admin-lightbox` (admin-page.css) не затронут. */
.lightbox-layer {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  animation: fadein var(--t-fast) var(--ease);
}

.lightbox-top {
  padding: 12px 18px 10px;
  color: #f5f5f7;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-shrink: 0;
}

.lightbox-top .cat-label {
  font-size: 12px;
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lightbox-top .req-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.lightbox-top-actions {
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lightbox-main {
  flex: 1;
  display: flex;
  min-height: 0;
  min-width: 0;
  padding: 0 18px 10px;
  gap: 14px;
}

.lightbox-big {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

/* width/height 100% + contain: даже маленькое фото растягивается на всю сцену,
   но ограничено 90vw × 88vh и не выходит за пределы модалки. */
.lightbox-big img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: min(90vw, 100%);
  max-height: min(88vh, 100%);
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}

.lightbox-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.lightbox-nav:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

.lightbox-prev {
  left: 10px;
}

.lightbox-next {
  right: 10px;
}

.lightbox-thumbs {
  flex: 0 0 92px;
  width: 92px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.lightbox-thumb {
  width: 100%;
  height: 60px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: rgba(255, 255, 255, 0.06);
  transition: border-color var(--t-fast) var(--ease);
}

.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lightbox-thumb.active {
  border-color: var(--accent-green);
}

.lightbox-thumb:hover {
  border-color: var(--border-strong);
}

.lightbox-thumb:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

.lightbox-msg-text {
  margin: 0 auto;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  padding: 0 18px 12px;
  max-width: min(70%, 760px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Узкие экраны: миниатюры — горизонтальная лента под основным фото. */
@media (max-width: 760px) {
  .lightbox-top {
    padding: 10px 12px 8px;
  }

  .lightbox-main {
    flex-direction: column;
    gap: 8px;
    padding: 0 10px 8px;
  }

  .lightbox-thumbs {
    flex: 0 0 auto;
    width: 100%;
    max-height: none;
    flex-direction: row;
    gap: 6px;
    padding: 0 0 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-gutter: auto;
  }

  .lightbox-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 54px;
  }

  .lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  .lightbox-prev {
    left: 6px;
  }

  .lightbox-next {
    right: 6px;
  }

  .lightbox-msg-text {
    max-width: 100%;
    padding: 0 12px 10px;
  }
}

/* ---------- Табы (T1, пункт 1): жирность НЕ меняется, активный — цветом ---------- */
.tabs {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  height: 34px;
  flex-shrink: 0;
  /* фикс. высота: переключение не «прыгает» */
}

.tab-btn {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0 13px;
  height: 28px;
  font-size: 13px;
  color: var(--secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-1);
}

html[data-theme='light'] .tab-btn.active,
html:not([data-theme]) .tab-btn.active {
  color: var(--accent);
}

/* ---------- Информационные страницы (fixed, без скролла страницы) ---------- */
.page-fixed {
  height: 100dvh;
  padding-top: var(--header-h);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.page-fixed-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;
}

.page-fixed-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 22px 16px 40px;
}

.page-scroll {
  min-height: 100dvh;
  padding-top: var(--header-h);
}

.page-scroll .content {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.hero-banner {
  text-align: center;
  padding: 10px 0 24px;
}

.hero-banner h1 {
  font-size: clamp(26px, 4vw, 40px);
}

.hero-banner p {
  color: var(--secondary);
  font-size: 16px;
  max-width: 620px;
  margin: 12px auto 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.info-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-card .how-ico {
  width: 46px;
  height: 46px;
}

.info-card h3 {
  font-size: 16px;
}

.info-card p {
  font-size: 14px;
  color: var(--secondary);
}

.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

/* «Проблема → решение» на /about */
.ps-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.ps-problem,
.ps-solution {
  flex: 1;
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border);
}

.ps-problem {
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}

.ps-solution {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.ps-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ps-problem .ps-label {
  color: var(--danger);
}

.ps-solution .ps-label {
  color: var(--accent);
}

.ps-arrow {
  align-self: center;
  color: var(--tertiary);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .ps-row {
    flex-direction: column;
  }

  .ps-arrow {
    transform: rotate(90deg);
  }
}

/* FAQ в две колонки */
.faq-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 22px;
  align-items: start;
}

.faq-col {
  min-height: 0;
  overflow-y: auto;
  max-height: 100%;
  padding-right: 6px;
}

@media (max-width: 760px) {
  .faq-cols {
    grid-template-columns: 1fr;
  }

  .faq-col {
    max-height: none;
  }
}

/* ---------- Комбобоксы (выпадающие панели поверх контента) ---------- */
.combo {
  position: relative;
}

.combo-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 80;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
  animation: pop var(--t-fast) var(--ease);
}

.combo-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}

.combo-opt:hover {
  background: var(--surface-2);
}

.combo-opt.selected {
  font-weight: 700;
}

.combo-opt .check {
  margin-left: auto;
  color: var(--accent);
}

/* ---------- FAQ ---------- */
.faq-group {
  margin-top: 10px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 4px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
}

.faq-q .chev {
  transition: transform var(--t-med) var(--ease);
  color: var(--secondary);
  flex-shrink: 0;
}

.faq-q.open .chev {
  transform: rotate(180deg);
}

.faq-a {
  overflow: hidden;
  animation: faqopen var(--t-med) var(--ease);
  padding: 0 4px 16px;
  font-size: 14.5px;
  color: var(--secondary);
  white-space: pre-line;
}

@keyframes faqopen {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Документы (legal) ---------- */
.doc {
  padding: 30px 0 80px;
}

.doc h1 {
  font-size: 30px;
  margin-bottom: 20px;
}

.doc h2 {
  font-size: 21px;
  margin: 26px 0 12px;
}

.doc p {
  margin: 10px 0;
  color: var(--text);
}

.doc li {
  margin: 6px 0;
}

.doc strong {
  font-weight: 700;
}

.doc em {
  font-style: italic;
}

/* ---------- Админка (T5, пункт 10; T1) ----------
   .admin-shell/.admin-body — фикс. каркас; .admin-content НЕ скроллится:
   скролл живёт в .admin-content-inner (fallback для текущей разметки),
   .admin-scroll или .table-wrap. Фильтры/тулбары — .admin-toolbar (не скроллятся). */
.admin-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding-top: var(--header-h);
  box-sizing: border-box;
  overflow: hidden;
  min-height: 0;
}

.admin-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.admin-side {
  width: 246px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-anchor: none;
  padding: 8px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-side-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.admin-side-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.admin-side-link.active {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
}

.admin-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: var(--pad-admin);
}

.admin-content-inner {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  padding-bottom: 6px;
}

/* Единственный вертикальный скролл-контейнер контента админки (T5). */
.admin-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
}

/* Липкий тулбар/фильтры админки: не скроллится вместе с контентом. */
.admin-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: 2px 0 8px;
  min-height: 38px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.kpi-card {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kpi-value {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi-label {
  font-size: 11.5px;
  color: var(--secondary);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.table th {
  text-align: left;
  color: var(--secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 6px 9px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table tr:hover td {
  background: var(--surface-2);
}

.table tr:last-child td {
  border-bottom: none;
}

/* компактные карточки-строки в админке */
.admin-row-card {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 160px;
  padding: 8px 0;
}

.chart-bar {
  flex: 0 0 auto;
  min-width: 6px;
  background: var(--grad);
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: opacity var(--t-fast) var(--ease);
}

.chart-bar:hover {
  opacity: 0.75;
}

.chart-bar .chart-val {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--secondary);
  font-weight: 700;
}

.chart-bar-title {
  font-size: 11px;
  color: var(--secondary);
  text-align: center;
  margin-top: 6px;
}

.tree-node {
  padding-left: 4px;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 8px;
}

.tree-row:hover {
  background: var(--surface-2);
}

.tree-children {
  margin-left: 22px;
  border-left: 1px solid var(--border);
  padding-left: 8px;
}

/* ---------- Пустые состояния ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--secondary);
  text-align: center;
}

.empty-ico {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tertiary);
}

.empty-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.empty-sub {
  font-size: 13.5px;
  max-width: 360px;
}

/* ---------- Прочее ---------- */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grow {
  flex: 1;
}

.muted {
  color: var(--secondary);
}

.small {
  font-size: 12.5px;
}

.strong {
  font-weight: 700;
}

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.divider {
  height: 1px;
  background: var(--border);
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.center-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding-top: var(--header-h);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 560px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.step-indicator {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background var(--t-fast) var(--ease);
}

.step-dot.active {
  background: var(--accent);
}

.alert-box {
  border-radius: var(--r-md);
  padding: 12px 15px;
  font-size: 13.5px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alert-info {
  background: color-mix(in srgb, var(--accent-cyan) 10%, transparent);
  color: var(--accent-cyan);
}

.alert-warn {
  background: rgba(255, 149, 0, 0.12);
  color: var(--warning);
}

.alert-error {
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
}

html[data-theme='light'] .alert-info,
html:not([data-theme]) .alert-info {
  color: #1d7fa8;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  height: 36px;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  user-select: none;
}

.cat-chip:hover {
  background: var(--surface-2);
}

.cat-chip.selected {
  background: rgba(0, 245, 139, 0.14);
  border-color: var(--accent);
  color: var(--accent);
}

.rating-stars {
  color: var(--warning);
  letter-spacing: 1px;
}

/* ============================================================
   T1. Фундамент дизайн-системы (пункты 1,2,4,5,7,10,19,20,23)
   ------------------------------------------------------------
   Контракты для feature-агентов (не дублируйте эти правила в компонентах):
   • .page-shell / .page-home / .page-fixed / .admin-shell — фикс. каркас:
     height:100dvh + padding-top:var(--header-h) (контентная высота =
     calc(100dvh - var(--header-h))), overflow: hidden; страница не скроллится.
   • .scroll-area — вертикальный скролл (списки/карточки), .scroll-area-x —
     горизонтальный, .scroll-area-both — оба; .no-scrollbar — скрыть полосу.
   • .toolbar / .toolbar-sticky — фильтры и тулбары, НЕ скроллятся.
   • .modal + .modal-sm|md|lg|xl — фикс. размеры (420/560/760/980, max-h 86dvh),
     скроллится только .modal-body; .modal-error — область ошибки 22px.
   • .field-error / .field-hint — строка ошибки/подсказки фикс. высоты (18px).
   • .tabs/.tab-btn — жирность всегда 600, активный — цветом (без сдвига).
   • .example-cards — примеры запросов grid 1fr на всю ширину родителя.
   • .hint-area — фикс. слот подсказок (≈96px), не сдвигает layout.
   ============================================================ */

/* ---------- Единые отступы T1: используйте переменные, а не «магические» px ----------
   .card базово БЕЗ padding (исторически карточки задают его классами/инлайном),
   компактный padding — через .card-pad/.card-pad-sm или var(--pad-card). */
.card-pad {
  padding: var(--pad-card);
}

.card-pad-sm {
  padding: var(--pad-card-sm);
}

.page-pad {
  padding: var(--pad-page-y) var(--pad-page-x);
}

.card {
  border-radius: var(--r-md);
}

/* ---------- Базовые скролл-контейнеры ---------- */
.scroll-area {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  overscroll-behavior: contain;
}

.scroll-area-x {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.scroll-area-both {
  min-height: 0;
  overflow: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
}

/* ---------- Тулбары/фильтры: не участвуют в скролле контента ---------- */
.toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: var(--h-control);
}

.toolbar-sticky {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--bg);
  min-height: var(--h-control);
  padding: 2px 0 8px;
}

.toolbar-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 2px;
}

/* ---------- Анти-сдвиг ---------- */
.anti-shift {
  overflow-anchor: none;
}

.fixed-h-error {
  min-height: var(--h-error);
}

/* Фикс. слот подсказок на главной (T4: картинки-подсказки под поиском). */
.hint-area {
  height: 96px;
  min-height: 96px;
  flex-shrink: 0;
  overflow: hidden;
}

.hint-area-sm {
  height: 64px;
  min-height: 64px;
  flex-shrink: 0;
  overflow: hidden;
}

/* Фикс. высота «шапок» внутри контента: переключение/ошибки не двигают layout. */
.shell-head {
  min-height: 48px;
}

.chat-head {
  min-height: 54px;
}

.req-list-head {
  min-height: 42px;
}

.modal-head {
  min-height: var(--h-head);
}

/* ---------- Примеры запросов (T4, пункт 19): 1 колонка на всю ширину ---------- */
.example-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
}

.example-cards>* {
  width: 100%;
  min-width: 0;
}

.example-card {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.example-card:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

/* ---------- Бренд-цвета (T5/пункт 16): --brand/--brand-2 ставит lib/theme.ts ---------- */
.brand-grad {
  background: var(--brand-grad);
}

.brand-text {
  color: var(--brand);
}

.brand-border {
  border-color: var(--brand);
}

/* ---------- Компактность базовых блоков (пункт 1): −15–20% ---------- */
.how-grid {
  gap: 11px;
}

.how-card {
  padding: 13px 15px;
  gap: 13px;
}

.how-ico {
  width: 56px;
  height: 56px;
  border-radius: 13px;
}

.info-card {
  padding: 17px;
  gap: 8px;
}

.info-grid {
  gap: 12px;
  margin-top: 18px;
}

.org-mini-list {
  gap: 10px;
  padding: 13px;
}

.org-mini {
  padding: 11px;
  gap: 7px;
}

.empty-state {
  padding: 32px 18px;
}

.faq-q {
  padding: 13px 4px;
  font-size: 15px;
}

.faq-a {
  padding: 0 4px 13px;
  font-size: 14px;
}

.page-scroll .content {
  padding: 32px 16px 64px;
}

.hero-banner {
  padding: 8px 0 18px;
}

.hero-banner p {
  font-size: 15px;
  margin: 10px auto 0;
}

.cta-row {
  margin-top: 22px;
  gap: 10px;
}

.ps-problem,
.ps-solution {
  padding: 13px 15px;
  gap: 7px;
}

.drawer-head {
  padding: 14px 16px;
}

.drawer-body {
  padding: 10px;
}

.dropdown-item {
  padding: 8px 10px;
  font-size: 13.5px;
}

.dropdown-panel {
  padding: 5px;
}

.msg-bubble {
  font-size: 14px;
  padding: 8px 12px;
}

.loc-chip,
.loc-hint,
.cat-chip {
  height: 34px;
}

.loc-chip {
  padding: 0 14px;
  font-size: 13.5px;
}

.composer-top {
  margin-bottom: 8px;
}

.composer-hint {
  font-size: 12px;
  padding: 6px 14px 0;
  min-height: 24px;
}

.search-box {
  padding: 8px 8px 8px 14px;
}

.how-card,
.info-card {
  border-radius: var(--r-md);
}

.table-wrap.card {
  padding: 8px;
}

@media (max-width: 860px) {
  .req-list {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .shell-body {
    flex-direction: column;
  }

  .req-list {
    flex: 1;
    min-height: 200px;
  }

  .req-detail {
    flex: 1.6;
  }

  .chat-messages {
    padding: 10px;
  }

  .msg-bubble {
    max-width: 84%;
  }
}

/* ============================================================
   ==== ADMIN (T5) ====
   Админка: компактные карточки модерации с dropdown, лайтбокс-превью,
   модалки полных профилей (юзер/орг), настройки по группам, поддержка, чат.
   Дополняет базовые .admin-shell/.admin-toolbar/.table-wrap из T1.
   ============================================================ */

/* ---------- утилиты ---------- */
.tiny {
  font-size: 11px;
  line-height: 1.45;
}

.mono {
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
}

.admin-icon-btn {
  width: 26px;
  height: 26px;
  padding: 0;
}

.admin-section {
  min-height: 0;
}

.admin-list {
  min-height: 0;
}

.admin-title-row {
  min-height: 32px;
}

.admin-pagination {
  padding-top: 2px;
}

/* ---------- тулбар/фильтры ---------- */
.admin-toolbar {
  border-bottom: 1px solid transparent;
}

.admin-toolbar h2 {
  margin: 0;
  line-height: 1.2;
}

.admin-search {
  max-width: 300px;
}

.admin-filter-sm {
  height: 30px;
  padding: 4px 24px 4px 9px;
  font-size: 12.5px;
  width: auto;
}

input.admin-filter-sm[type='date'] {
  padding: 4px 8px;
  max-width: 150px;
}

select.admin-filter-sm {
  min-width: 130px;
}

.admin-toolbar .input:not(.admin-filter-sm):not([type='date']) {
  height: 30px;
}

/* ---------- боковое меню ---------- */
.admin-side-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 10px;
  color: var(--secondary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

/* ---------- dropdown действий (п.9) ---------- */
.admin-menu-btn {
  gap: 4px;
}

.admin-menu-btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
}

.admin-menu-panel {
  position: fixed;
  z-index: 260;
  width: 216px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  animation: fadein var(--t-fast) var(--ease);
}

.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  border-radius: var(--r-sm);
  text-align: left;
}

.admin-menu-item:hover {
  background: var(--surface-2);
}

.admin-menu-item.danger {
  color: var(--danger);
}

.admin-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}

/* ---------- карточка модерации запроса (п.9) ---------- */
.admin-request-card {
  position: relative;
  padding: 9px 11px;
}

.admin-req-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
}

.admin-req-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.admin-req-author {
  font-weight: 600;
  font-size: 12.5px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-req-text {
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Категория запроса в карточке модерации: видна и в очереди, и в архиве. */
.admin-req-category {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--secondary);
}

.admin-req-category-name {
  min-width: 0;
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-thumb {
  width: 92px;
  height: 68px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface-2);
  cursor: zoom-in;
  transition: border-color var(--t-fast) var(--ease);
}

.admin-thumb:hover {
  border-color: var(--accent);
}

.admin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-reject-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.admin-reject-form .field {
  gap: 4px;
}

.admin-quarantine-thumb {
  width: 76px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface-2);
  cursor: zoom-in;
}

.admin-quarantine-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-ticket-text {
  margin: 0;
  font-size: 13.5px;
  white-space: pre-wrap;
}

/* ---------- таблицы ---------- */
.table-hover tbody tr {
  cursor: pointer;
}

.table-wrap.card {
  border-radius: var(--r-md);
}

/* ---------- модалка полного профиля (п.11, п.30) ---------- */
.admin-profile {
  display: flex;
  gap: 12px;
  min-height: 0;
  height: min(66dvh, 600px);
}

.admin-profile-side {
  width: 172px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--border);
  padding-right: 10px;
  min-height: 0;
}

.admin-profile-person {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.admin-profile-tabs {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
}

.admin-profile-tab {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.admin-profile-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.admin-profile-tab.active {
  background: var(--surface-2);
  color: var(--accent);
}

.admin-profile-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding-right: 2px;
}

.admin-info-row {
  display: flex;
  gap: 10px;
  padding: 3px 0;
  font-size: 12.5px;
  align-items: baseline;
}

.admin-info-label {
  color: var(--secondary);
  flex: 0 0 132px;
}

.admin-info-value {
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-card-pad {
  padding: 10px 12px;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}

.admin-stat-card {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-stat-value {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-hash-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding: 6px 9px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  font-size: 12px;
}

.admin-hash-box code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, Consolas, monospace;
}

.admin-temp-pass {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--accent);
  border-radius: var(--r-sm);
  background: rgba(0, 245, 139, 0.07);
}

.admin-temp-pass code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- настройки (п.15–18) ---------- */
.admin-settings-card {
  padding: 0;
  overflow: hidden;
}

.admin-settings-head {
  padding: 10px 13px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.admin-settings-fields {
  padding: 4px 13px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  min-height: 46px;
}

.admin-setting-row:last-child {
  border-bottom: none;
}

.admin-setting-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.admin-setting-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-setting-control-wide {
  flex: 1;
  max-width: 340px;
}

.admin-setting-control-wide .input,
.admin-setting-control-wide .textarea {
  min-width: 0;
  flex: 1;
}

.admin-setting-field-block {
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.admin-setting-field-block:last-child {
  border-bottom: none;
}

.admin-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px 12px;
  align-items: end;
}

.admin-inline-grid .field {
  gap: 3px;
}

.admin-inline-grid .input,
.admin-inline-grid .select {
  height: 30px;
  font-size: 12.5px;
}

.admin-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-color-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.admin-color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.admin-color-input {
  width: 34px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
}

.admin-color-hex {
  width: 96px;
  height: 30px;
  padding: 4px 8px;
  font-size: 12.5px;
}

.admin-brand-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  color: #04241a;
  font-size: 12.5px;
  font-weight: 700;
}

html[data-theme='dark'] .admin-brand-preview {
  color: #02150f;
}

.admin-brand-preview-btn {
  border: none;
  border-radius: var(--r-sm);
  padding: 6px 14px;
  color: #04241a;
  font-weight: 800;
  font-size: 12.5px;
  cursor: default;
}

.admin-section-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.admin-section-chip {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--secondary);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.admin-section-chip.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 245, 139, 0.1);
}

.admin-icon-preview {
  margin-top: 6px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.admin-form-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 620px;
}

.admin-doc-editor {
  font-size: 13px;
  line-height: 1.5;
}

.admin-json-editor {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
}

/* тумблер */
.admin-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

.admin-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--secondary);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.admin-toggle.on {
  background: rgba(0, 245, 139, 0.22);
  border-color: var(--accent);
}

.admin-toggle.on .admin-toggle-knob {
  transform: translateX(18px);
  background: var(--accent);
}

.admin-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- чат (поддержка/админ-просмотр) ---------- */
.admin-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: min(62dvh, 560px);
  min-height: 300px;
}

.admin-chat-actions {
  flex-shrink: 0;
  min-height: 30px;
}

.admin-chat-messages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.admin-chat-messages .msg-row {
  padding: 0 8px;
}

.admin-chat-system {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 82%;
  font-size: 11.5px;
  color: var(--secondary);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  padding: 3px 10px;
}

.admin-chat-system.rating {
  color: var(--warning);
  border-color: var(--warning);
}

.admin-chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.admin-chat-composer .textarea {
  flex: 1;
  min-height: 38px;
  max-height: 120px;
  resize: none;
}

.admin-chat-closed {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--secondary);
  font-size: 12.5px;
}

.admin-chat-title {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

/* ---------- поддержка: оценки ---------- */
.admin-rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
}

.admin-avg-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 150px;
}

.admin-avg-value {
  font-size: 27px;
  font-weight: 800;
  color: var(--warning);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* ---------- аналитика: горизонтальные бары ---------- */
.admin-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  font-size: 12px;
}

.admin-bar-label {
  flex: 0 0 190px;
}

.admin-bar-track {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.admin-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--grad);
}

.admin-bar-value {
  flex: 0 0 36px;
  text-align: right;
  font-weight: 700;
  color: var(--secondary);
}

/* ---------- дашборд: статистика отключена ---------- */
.admin-stats-off {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-stats-off>button {
  margin-left: auto;
}

/* ---------- компактность на узких экранах ---------- */
@media (max-width: 760px) {
  .admin-profile {
    flex-direction: column;
    height: auto;
    max-height: none;
  }

  .admin-profile-side {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0 0 8px;
  }

  .admin-profile-tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .admin-profile-tab {
    width: auto;
  }

  .admin-profile-content {
    max-height: 52dvh;
  }

  .admin-setting-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-setting-control {
    width: 100%;
  }

  .admin-bar-label {
    flex-basis: 110px;
  }

  .admin-req-head {
    flex-direction: column;
    align-items: stretch;
  }
}

.admin-reject-form .input,
.admin-reject-form .select,
.admin-reject-form .textarea {
  background: var(--surface);
}

/* T5: compact tables inside profile modal */
.table-fixed {
  table-layout: fixed;
}

.admin-profile-content .table {
  font-size: 12px;
}

.admin-profile-content .table th {
  padding: 5px 6px;
}

.admin-profile-content .table td {
  padding: 6px;
}

.admin-profile-content .table th:last-child {
  width: 84px;
}

/* T5: chat bubble contrast in admin thread */
.admin-chat-messages {
  background: var(--bg);
}

.admin-chat-messages .msg-row.theirs .msg-bubble {
  background: var(--surface);
}

/* T5: profile modal table headers wrap instead of colliding */
.admin-profile-content .table th {
  white-space: normal;
  line-height: 1.25;
}

.admin-profile-content .table th:last-child {
  width: 84px;
}

/* T5: размер картинок в общем лайтбоксе задаёт секция «Лайтбокс» выше
   (width/height 100% + object-fit: contain), отдельный min-size не нужен. */

/* T5: denser settings grids and analytics labels */
.admin-inline-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.admin-inline-grid .field-label {
  font-size: 11.5px;
  line-height: 1.25;
}

.admin-bar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   Правки по фидбеку заказчика (2026-11-25)
   - выделение активных элементов — фирменным цветом (без жирного и фона с тенью);
   - ссылки без подчёркивания;
   - как-это-работает: блок с номером по высоте = заголовок + две строки текста.
   ============================================================ */
a,
a:hover,
a:focus {
  text-decoration: none;
}

.chat-link,
.chat-link:hover {
  text-decoration: none;
}

/* Активные состояния — фирменный цвет */
.nav-link.active {
  font-weight: inherit;
  color: var(--brand);
}

.tabbar-item.active {
  color: var(--brand);
}

.tab-btn.active {
  background: transparent;
  box-shadow: none;
  font-weight: inherit;
  color: var(--brand);
}

html[data-theme='light'] .tab-btn.active,
html:not([data-theme]) .tab-btn.active {
  color: var(--brand);
}

.cat-item.selected {
  background: transparent;
  font-weight: inherit;
  color: var(--brand);
}

.cat-item.selected .cat-ico {
  color: var(--brand);
}

.req-item.selected {
  background: transparent;
  box-shadow: none;
}

.req-item.selected .req-item-text {
  color: var(--brand);
}

.combo-opt.selected {
  font-weight: inherit;
  color: var(--brand);
}

.admin-side-link.active {
  background: transparent;
  font-weight: inherit;
  color: var(--brand);
}

.admin-profile-tab.active {
  background: transparent;
  color: var(--brand);
}

.admin-section-chip.selected {
  border-color: var(--brand);
  color: var(--brand);
  background: transparent;
}

.cat-chip.selected {
  border-color: var(--brand);
  color: var(--brand);
  background: transparent;
}

.org-chat-item.selected,
.chat-item.selected,
.chat-list-item.selected {
  background: transparent;
  box-shadow: none;
  color: var(--brand);
}

/* «Как это работает»: блок нумерации — высотой с заголовок + две строки текста */
.how-grid {
  width: min(60vw, 940px);
  max-width: 100%;
  flex-shrink: 0;
  gap: 10px;
}

.how-card {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  align-items: stretch;
}

.how-num {
  border-radius: 100%;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: stretch;
  width: 54px;
  height: 54px;
}

.how-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.how-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.how-text {
  line-height: 1.35;
}
/* ============================================================
   Кастомные выпадающие списки (компонент select.js)
   ============================================================ */
.custom-select {
  position: relative;
  display: inline-block;
  min-width: 0;
  vertical-align: middle;
}

.field > .custom-select,
.form-grid > .custom-select {
  width: 100%;
}

.custom-select-native {
  display: none !important;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  position: relative;
}

.custom-select-trigger.select {
  background-image: none;
  padding-right: 34px;
}

.custom-select-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-caret {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--secondary);
  pointer-events: none;
  transition: transform var(--t-fast) var(--ease);
}

.custom-select.open .custom-select-caret {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select.is-disabled,
.custom-select-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Панель списка: фиксированная, ограничена по высоте, а скроллится не она,
   а .custom-select-options — строка поиска и «грабер» остаются на месте. */
.custom-select-panel {
  position: fixed;
  top: auto;
  right: auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  max-height: min(340px, 62vh);
  overflow: hidden;
  animation: pop var(--t-fast) var(--ease);
}

.custom-select-search {
  position: relative;
  top: 0;
  z-index: 3;
  flex-shrink: 0;
  padding: 2px 2px 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 12px -12px rgba(0, 0, 0, 0.45);
}

.custom-select-search .input {
  height: 32px;
  padding-top: 0;
  padding-bottom: 0;
}

.custom-select-options {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.custom-select-option {
  padding: 8px 10px;
  font-size: 13.5px;
  border-radius: 8px;
}

.custom-select-option.selected {
  color: var(--brand);
  font-weight: 600;
  background: var(--surface-2);
}

.custom-select-option .grow {
  min-width: 0;
}

.custom-select-check {
  display: inline-flex;
  color: var(--brand);
  flex-shrink: 0;
}

.custom-select-empty {
  padding: 10px;
}

/* ============================================================
   Иконка поиска в input
   ============================================================ */
.input.input-search {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px 50%;
  background-size: 16px 16px;
  padding-left: 38px;
}

.input.input-search:focus {
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px 50%;
  background-size: 16px 16px;
}

.pub-combo-input.input-search {
  padding-left: 38px;
}

/* ============================================================
   Мобильный раунд 2026-11-28
   Модалки-листы, клавиатура, формы 16px/44px, глазик пароля,
   кастомные селекты-«шторки», safe-area.
   ============================================================ */

/* ---------- Глазик пароля (глобальный помощник site.js) ---------- */
.pw-host {
  position: relative;
}

.pw-input {
  padding-right: 46px;
}

.pw-eye {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--secondary);
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.pw-eye:hover {
  color: var(--text);
  background: var(--surface-2);
}

.pw-eye:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.pw-eye svg {
  display: block;
  pointer-events: none;
}

@media (max-width: 640px) {
  .pw-eye {
    width: 44px;
    height: 44px;
  }
}

/* ---------- Мобильные модалки: фиксированная верхняя позиция (пункт 14) ----------
   Не bottom-sheet: окно всегда начинается от верхнего края (с учётом safe-area),
   поэтому при появлении/скрытии клавиатуры оно не «скачет». Скроллится только
   .modal-body; высота ограничена visual viewport. */
@keyframes pok-sheet-in {
  from {
    transform: translateY(30px);
    opacity: 0.6;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

@media (max-width: 860px) {
  .modal-layer {
    align-items: flex-start;
    justify-content: center;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    height: auto;
    padding: calc(env(safe-area-inset-top) + 8px) 6px 8px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }

  .modal-layer > .modal {
    width: 100%;
    max-width: 100%;
    /* Верх зафиксирован — окно растёт вниз до visual viewport и не уезжает. */
    max-height: calc(var(--vvh, 100dvh) - env(safe-area-inset-top) - 16px);
    margin: 0 auto;
    border-radius: 18px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
    animation: pop var(--t-med) var(--ease);
    transform-origin: top center;
  }

  /* Пока модалка открыта, шапка и меню под затемнением не перехватывают нажатия. */
  body:has(.modal-layer) .header,
  body:has(.modal-layer) .tabbar {
    pointer-events: none;
  }

  .modal-head {
    padding: 12px 16px 6px;
    gap: 8px;
    min-height: 46px;
  }

  .modal-title {
    font-size: 16.5px;
  }

  .modal-close {
    width: 38px;
    height: 38px;
  }

  .modal-body {
    padding: 2px 16px 14px;
    gap: 10px;
    overscroll-behavior: contain;
  }

  .modal-foot {
    padding: 0 16px 14px;
  }

  /* Клавиатура: окно остаётся сверху, но поджимается по visual viewport. */
  body.keyboard-open .modal-layer > .modal {
    max-height: calc(var(--vvh, 100dvh) - 10px);
  }

  body.keyboard-open .modal-layer {
    padding-bottom: 6px;
  }

  /* Кнопка отправки длинной формы остаётся доступной при скролле тела модалки. */
  .modal-submit-sticky {
    position: sticky;
    bottom: 0;
    z-index: 4;
    box-shadow: 0 -10px 16px -14px rgba(0, 0, 0, 0.55);
  }

  /* В auth-модалке submit идёт после согласий: sticky-кнопка перекрывала
     чекбоксы, поэтому здесь она остаётся в потоке. */
  .pub-auth-modal .modal-submit-sticky {
    position: static;
    bottom: auto;
    z-index: auto;
    box-shadow: none;
  }
}

/* ---------- Формы и поля на телефоне ---------- */
@media (max-width: 640px) {
  /* На телефоне — один столбец; на планшете сетки остаются двухколоночными. */
  .info-grid,
  .pub-business-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .field {
    gap: 4px;
  }

  .field-label {
    font-size: 12px;
  }

  /* 16px — иначе iOS Safari зумит страницу при фокусе. */
  .input,
  .textarea,
  .select,
  .custom-select-trigger.select,
  .input-search {
    font-size: 16px;
  }

  .input,
  .select,
  .custom-select-trigger.select {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .select,
  .custom-select-trigger.select {
    padding-right: 38px;
  }

  .textarea {
    min-height: 84px;
  }

  .modal .btn:not(.btn-sm):not(.btn-icon):not(.modal-close),
  .auth-page-form .btn:not(.btn-sm):not(.btn-icon),
  .modal-actions .btn:not(.btn-sm):not(.btn-icon) {
    min-height: 44px;
  }

  .checkbox-row {
    font-size: 14px;
    line-height: 1.35;
  }

  .checkbox-row input {
    width: 22px;
    height: 22px;
  }

  .input[type='date'] {
    min-height: 44px;
  }

  .modal-error {
    font-size: 13px;
  }

  .modal-body > .form-grid,
  .pub-auth-modal .form-grid {
    gap: 10px;
  }

  .modal-body > .btn + .small,
  .modal-body > .small + .btn {
    margin-top: 0;
  }
}

/* ---------- Кастомные селекты: мобильная «шторка» ---------- */
.custom-select-panel {
  z-index: 340;
  background: var(--surface);
  isolation: isolate;
  overscroll-behavior: contain;
}

/* Раньше у панели был прозрачный «мостик» для hover — в списке он мешал. */
.custom-select-panel::before {
  display: none;
}

/* Строку поиска и её непрозрачный фон задаёт правило выше (.custom-select-search). */

.custom-select-backdrop {
  position: fixed;
  inset: 0;
  z-index: 335;
  background: rgba(0, 0, 0, 0.34);
  animation: fadein var(--t-fast) var(--ease);
}

.custom-select-grabber {
  width: 38px;
  height: 4px;
  margin: 2px auto 8px;
  border-radius: 999px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.custom-select-panel--sheet {
  position: fixed;
  top: auto;
  right: auto;
  left: 8px;
  right: 8px;
  bottom: calc(var(--tabbar-space, 58px) + 8px);
  width: auto;
  min-width: 0 !important;
  max-height: min(55dvh, 480px);
  /* padding: 0 — иначе при прокрутке элементы списка выглядывают в полоске
     над строкой поиска (пункт 8). Отступы задают поиск/список/граббер. */
  padding: 0;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-3);
  /* Скроллится только список options — граббер и поиск фиксированы. */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
  animation: pok-sheet-in var(--t-med) var(--ease);
  touch-action: pan-y;
}

.custom-select-panel--sheet .custom-select-grabber {
  flex-shrink: 0;
  margin: 8px auto 0;
}

.custom-select-panel--sheet .custom-select-search {
  flex-shrink: 0;
  position: relative;
  top: 0;
  z-index: 3;
  margin: 0;
  padding: 10px 10px 8px;
  border-radius: 20px 20px 0 0;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 12px -12px rgba(0, 0, 0, 0.45);
}

.custom-select-panel--sheet .custom-select-options {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 2px 8px 8px;
}

.custom-select-panel--sheet .custom-select-option {
  min-height: 46px;
  padding: 12px;
  font-size: 16px;
  border-radius: 12px;
}

.custom-select-panel--sheet .custom-select-empty {
  padding: 14px 10px;
  font-size: 14px;
}

body.keyboard-open .custom-select-panel--sheet {
  bottom: calc(100dvh - var(--vvh, 100dvh) - var(--vv-top, 0px) + 8px);
  max-height: min(46dvh, calc(var(--vvh, 100dvh) - 110px));
}

/* ---------- Главная и публичные страницы: жидкие отступы ---------- */
@media (max-width: 860px) {
  .home-center {
    justify-content: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
    gap: 10px;
    padding: 14px 12px 18px;
  }

  .pub-composer-tools {
    width: 100%;
  }

  .home-hero h1 {
    font-size: clamp(21px, 6.4vw, 30px);
  }

  .home-hero p {
    font-size: clamp(13px, 3.6vw, 15px);
    padding: 0 6px;
  }

  .how-grid {
    width: 100%;
    gap: 8px;
  }

  .how-card {
    padding: 10px;
  }

  .how-num {
    width: 46px;
    height: 46px;
    font-size: 22px;
  }

  .search-box {
    padding: 8px 8px 8px 12px;
  }

  .pub-composer-send {
    height: 40px;
    padding: 0 12px;
    font-size: 13.5px;
  }

  .pub-composer-photo-btn {
    width: 40px;
    height: 40px;
  }

  .hint-area {
    height: 48px;
    min-height: 48px;
  }

  /* На телефоне системные скроллбары не нужны — скролл и так очевиден. */
  .page-fixed-scroll,
  .page-scroll,
  .home-center,
  .modal-body,
  .req-list-scroll,
  .scroll-area,
  .lightbox-thumbs {
    scrollbar-width: none;
  }

  .page-fixed-scroll::-webkit-scrollbar,
  .page-scroll::-webkit-scrollbar,
  .home-center::-webkit-scrollbar,
  .modal-body::-webkit-scrollbar,
  .req-list-scroll::-webkit-scrollbar,
  .scroll-area::-webkit-scrollbar,
  .lightbox-thumbs::-webkit-scrollbar {
    display: none;
  }

  /* Текстовые поля на телефоне: тонкий ненавязчивый скроллбар, чтобы было
     видно, что внутри поля есть ещё строки (textarea запроса/чата). */
  textarea,
  .search-textarea,
  .chat-textarea {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
  }

  textarea::-webkit-scrollbar,
  .search-textarea::-webkit-scrollbar,
  .chat-textarea::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }

  textarea::-webkit-scrollbar-thumb,
  .search-textarea::-webkit-scrollbar-thumb,
  .chat-textarea::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
  }

  textarea::-webkit-scrollbar-track,
  .search-textarea::-webkit-scrollbar-track,
  .chat-textarea::-webkit-scrollbar-track {
    background: transparent;
  }

  .hero-banner {
    padding: 4px 0 14px;
  }

  .hero-banner h1 {
    font-size: clamp(22px, 7vw, 34px);
  }

  .hero-banner p {
    font-size: 14.5px;
    margin-top: 8px;
  }

  .page-fixed-inner {
    padding: 14px 12px 24px;
  }

  .info-grid {
    gap: 10px;
    margin-top: 16px;
  }

  .pub-about-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
  }

  .pub-about-stat-card {
    padding: 10px 8px;
    min-width: 0;
  }

  .pub-about-stat-value {
    font-size: 23px;
  }

  .pub-about-support {
    margin-top: 18px;
  }

  .pub-business-grid {
    gap: 10px;
  }

  .pub-business-card {
    flex-direction: row;
    align-items: center;
  }

  .pub-business-cta {
    margin-top: 18px;
    padding: 22px 16px;
  }

  .pub-faq-cols {
    height: auto;
  }

  .faq-col {
    max-height: none;
    overflow: visible;
  }

  .ps-row {
    flex-direction: column;
  }

  .ps-arrow {
    transform: rotate(90deg);
  }

  .lightbox-layer {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 400px) {
  .page-shell .shell-head {
    padding-left: 10px;
    padding-right: 10px;
  }

  .pub-business-card {
    align-items: flex-start;
  }
}

/* ================= Мобильная плотность модалок (task-16, п.21) =================
   Модалки на телефоне: текст примерно на четверть мельче, отступы минимальные,
   кнопки/поля компактнее. Важные ограничения:
   • поля ввода остаются 16px (iOS не зумит страницу при фокусе);
   • тач-цели главных кнопок/полей — больше 40px (42px).
   Блок стоит последним в base.css, чтобы перебивать более ранние мобильные
   правила форм; область/профиль/авторизация уточняют его у себя. */
@media (max-width: 860px) {
  .modal-layer {
    padding-top: calc(env(safe-area-inset-top) + 6px);
    padding-left: 6px;
    padding-right: 6px;
    padding-bottom: 6px;
  }

  .modal-head {
    padding: 8px 12px 2px;
    min-height: 36px;
    gap: 6px;
  }

  .modal-title {
    font-size: 14px;
    line-height: 1.25;
  }

  .modal-close {
    width: 42px;
    height: 42px;
  }

  .modal-body {
    padding: 0 12px 8px;
    gap: 7px;
    /* Основной текст модалки мельче (было 14.5px), но остаётся читаемым. */
    font-size: 13px;
    line-height: 1.35;
  }

  .modal-foot {
    padding: 0 12px 8px;
    gap: 6px;
  }

  .modal .field,
  .field {
    gap: 3px;
  }

  .modal .field-label,
  .field-label {
    font-size: 11px;
    line-height: 1.2;
  }

  .modal .small {
    font-size: 11.5px;
  }

  .modal .input,
  .modal .textarea,
  .modal .select,
  .modal .custom-select-trigger.select,
  .custom-select-trigger.select {
    /* font-size не трогаем: 16px обязательны для iOS. */
    min-height: 42px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .modal .textarea {
    min-height: 76px;
  }

  .modal .btn:not(.btn-sm):not(.btn-icon):not(.modal-close),
  .modal-actions .btn:not(.btn-sm):not(.btn-icon) {
    min-height: 42px;
    font-size: 13.5px;
    padding: 7px 12px;
  }

  .modal .btn-sm {
    min-height: 36px;
    padding: 5px 9px;
  }

  .modal-actions {
    margin-top: 8px;
    gap: 6px;
  }

  .modal-error {
    font-size: 12px;
    min-height: 18px;
  }

  .modal .checkbox-row {
    font-size: 12.5px;
    gap: 8px;
  }

  .modal .form-grid {
    gap: 8px;
  }

  .modal .divider {
    margin: 4px 0;
  }
}

/* Телефон: прямоугольные уведомления (task-16, п.16). Правило стоит последним,
   чтобы перебивать базовое скругление .toast/.toast-accent/.toast-timer. */
@media (max-width: 860px) {
  .toast-wrap,
  .toast,
  .toast-accent,
  .toast-timer {
    border-radius: 0;
  }
}



