/* Кабинет Netpasport — дизайн-система.
 *
 * Одно место, где заданы цвет, шрифт, отступы и геометрия. Экраны собираются
 * из готовых классов и своих стилей не заводят: иначе через полгода в кабинете
 * будет пять оттенков серого и четыре радиуса скругления.
 *
 * Направление: тёмная боковая панель как постоянная точка опоры, светлое поле
 * работы, один акцентный цвет. Карточки держатся на волосяной рамке, а не на
 * тенях — тени оставлены только всплывающим слоям, чтобы отличать «лежит на
 * странице» от «висит над страницей». */

:root {
  /* Поверхности */
  --canvas: #f6f7f9;
  --surface: #ffffff;
  --surface-sunken: #f9fafb;
  --line: #e6e8ec;
  --line-strong: #d3d7de;

  /* Тёмная боковая панель */
  --rail: #0e1420;
  --rail-hover: rgba(255, 255, 255, 0.06);
  --rail-active: rgba(255, 255, 255, 0.1);
  --rail-text: #97a1b0;
  --rail-text-strong: #ffffff;
  --rail-line: rgba(255, 255, 255, 0.08);

  /* Текст */
  --ink: #0e1420;
  --ink-2: #5a6472;
  --ink-3: #8a94a3;

  /* Акцент и семантика */
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eef0ff;
  --ok: #0e7c5a;
  --ok-soft: #e7f6f0;
  --warn: #8a5a0b;
  --warn-soft: #fdf3e3;
  --danger: #b42318;
  --danger-soft: #feecea;

  /* Геометрия */
  --r-card: 14px;
  --r-control: 10px;
  --r-pill: 999px;
  --shadow-pop: 0 14px 34px -12px rgba(14, 20, 32, 0.28), 0 0 0 1px rgba(14, 20, 32, 0.06);
  --shadow-soft: 0 1px 2px rgba(14, 20, 32, 0.04);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 14.5px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

svg { display: block; flex: none; }

/* --- Каркас ---------------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  background: var(--rail);
  color: var(--rail-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.rail__brand {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--rail-line);
}

.rail__mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(150deg, #6366f1, #4338ca);
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
}

.rail__name {
  color: var(--rail-text-strong);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.rail__sub { font-size: 12px; color: var(--rail-text); line-height: 1.3; }

.rail__scroll { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.rail__scroll::-webkit-scrollbar { width: 8px; }
.rail__scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12); border-radius: 8px;
}

.rail__group {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #66707e;
  padding: 16px 10px 7px;
}

.rail__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--rail-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.rail__link:hover { background: var(--rail-hover); color: #d7dce4; text-decoration: none; }

.rail__link.is-active {
  background: var(--rail-active);
  color: var(--rail-text-strong);
  font-weight: 600;
}

.rail__link.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #818cf8;
}

/* Дерево «компания → филиал → разделы филиала» */

.tree__company {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  color: #7d8797;
  font-size: 12.5px;
  font-weight: 600;
}

.tree__branch { margin-bottom: 1px; }

.tree__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px 8px 22px;
  border: 0;
  background: none;
  color: var(--rail-text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  border-radius: 9px;
  cursor: pointer;
}

.tree__toggle:hover { background: var(--rail-hover); color: #d7dce4; }
.tree__toggle.is-current { color: var(--rail-text-strong); font-weight: 600; }

.tree__chevron { transition: transform 0.15s ease; color: #66707e; }
.tree__toggle[aria-expanded="true"] .tree__chevron { transform: rotate(90deg); }

.tree__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree__children { padding: 2px 0 6px; }

.tree__child {
  display: block;
  padding: 6px 10px 6px 44px;
  border-radius: 8px;
  color: #7d8797;
  font-size: 13px;
  cursor: pointer;
}

.tree__child:hover { background: var(--rail-hover); color: #d7dce4; text-decoration: none; }
.tree__child.is-active { background: var(--rail-active); color: #fff; font-weight: 600; }

.rail__foot {
  border-top: 1px solid var(--rail-line);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rail__avatar {
  width: 30px; height: 30px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.1);
  display: grid; place-items: center;
  color: #c3cad4; font-size: 12px; font-weight: 650;
  flex: none;
}

.rail__who {
  flex: 1; min-width: 0;
  font-size: 12.5px; color: #b3bcc8;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.rail__logout {
  border: 0; background: none; padding: 6px; border-radius: 8px;
  color: #7d8797; cursor: pointer;
}
.rail__logout:hover { background: var(--rail-hover); color: #fff; }

/* --- Область работы -------------------------------------------------------- */

.main { min-width: 0; padding: 30px 34px 64px; }
.main__inner { max-width: 1120px; margin: 0 auto; }

.page-head { margin-bottom: 22px; display: flex; align-items: flex-start; gap: 20px; }
.page-head__text { flex: 1; min-width: 0; }

.page-head h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 680;
  letter-spacing: -0.021em;
  line-height: 1.22;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  max-width: 68ch;
}

.crumb {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-3); font-size: 12.5px; font-weight: 550;
  margin-bottom: 10px; cursor: pointer; background: none; border: 0;
  padding: 0; font-family: inherit;
}
.crumb:hover { color: var(--accent); }

/* --- Карточки -------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
}

/* Отступ между карточками, идущими друг за другом в колонке. В сетке
 * расстояние задаёт gap, и этот отступ сдвинул бы все карточки, кроме первой. */
.card + .card { margin-top: 16px; }
.grid > .card + .card, .grid > .card { margin-top: 0; }
.card__body { padding: 20px 22px; }
.card__head { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card__head--flex { display: flex; align-items: center; gap: 16px; }
.card__head h2 { margin: 0; font-size: 16.5px; font-weight: 650; letter-spacing: -0.01em; }
.card__head p { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; }
.card__foot {
  padding: 14px 22px; border-top: 1px solid var(--line);
  background: var(--surface-sunken);
  border-radius: 0 0 var(--r-card) var(--r-card);
  display: flex; align-items: center; gap: 12px;
}

.grid { display: grid; gap: 16px; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; }
  .main { padding: 20px 16px 48px; }
  .grid--4, .grid--3, .grid--2 { grid-template-columns: minmax(0, 1fr); }
}

/* Показатель */

.stat { padding: 17px 19px; position: relative; }

/* Тайл-ссылка. Плитка целиком кликабельна, стрелка проявляется на наведении —
 * до него она только шумела бы рядом с крупной цифрой. */
.stat-link { display: block; color: inherit; text-decoration: none; transition: border-color .12s ease, box-shadow .12s ease; }
.stat-link:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: 0 6px 18px -12px rgba(14, 20, 32, .35); }
.stat-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stat__go { position: absolute; top: 17px; right: 16px; color: var(--ink-3); opacity: 0; transition: opacity .12s ease; }
.stat-link:hover .stat__go, .stat-link:focus-visible .stat__go { opacity: 1; }
.stat__label {
  font-size: 12.5px; color: var(--ink-2); font-weight: 550;
  display: flex; align-items: center; gap: 7px;
}
.stat__value {
  margin-top: 9px; font-size: 27px; font-weight: 660;
  letter-spacing: -0.028em; line-height: 1.1;
}
.stat__note { margin-top: 5px; font-size: 12.5px; color: var(--ink-3); }

/* Карточка филиала на обзоре */

.branch-card { display: flex; flex-direction: column; height: 100%; }
.branch-card__top { padding: 18px 20px 16px; flex: 1; }
.branch-card__name {
  font-size: 15.5px; font-weight: 640; letter-spacing: -0.012em;
  display: flex; align-items: flex-start; gap: 10px;
}
.branch-card__name .grow { flex: 1; min-width: 0; }
.branch-card__addr { margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.branch-card__metrics {
  margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.branch-card__metric { min-width: 0; }
.branch-card__metric .n {
  font-size: 19px; font-weight: 640; letter-spacing: -0.02em; line-height: 1.2;
}
.branch-card__metric .t { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.branch-card__links {
  border-top: 1px solid var(--line); padding: 11px 20px;
  display: flex; gap: 16px; background: var(--surface-sunken);
  border-radius: 0 0 var(--r-card) var(--r-card);
}
.branch-card__links button {
  border: 0; background: none; padding: 0; font: inherit; font-size: 13px;
  font-weight: 570; color: var(--accent); cursor: pointer;
}
.branch-card__links button:hover { text-decoration: underline; }

/* --- Значки состояния ------------------------------------------------------ */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: #f1f3f6; color: var(--ink-2);
}
.pill--ok { background: var(--ok-soft); color: var(--ok); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--danger { background: var(--danger-soft); color: var(--danger); }
.pill--accent { background: var(--accent-soft); color: var(--accent-strong); }
.pill__dot { width: 6px; height: 6px; border-radius: var(--r-pill); background: currentColor; }

/* --- Кнопки ---------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--r-control); border: 1px solid transparent;
  font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.2;
  cursor: pointer; background: var(--accent); color: #fff;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn:hover { background: var(--accent-strong); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { background: var(--surface-sunken); border-color: var(--ink-3); }
.btn--quiet { background: none; color: var(--ink-2); padding: 7px 10px; }
.btn--quiet:hover { background: #eef0f3; color: var(--ink); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--danger:hover { background: #fbdcd9; }
.btn--sm { padding: 6px 11px; font-size: 12.5px; }

/* --- Поля ------------------------------------------------------------------ */

.field { display: block; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field__label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px;
  color: var(--ink);
}
.field__hint {
  display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400;
  margin-top: 3px; line-height: 1.4;
}

.input, .textarea {
  width: 100%; font: inherit; font-size: 14px;
  padding: 9px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-control); background: var(--surface); color: var(--ink);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input::placeholder, .textarea::placeholder { color: #a8b0bc; }
.input:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }

/* Поля в строке выравниваются по низу: пояснения под подписями разной длины,
 * и без этого сами поля ввода стояли бы на разной высоте. */
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 210px; min-width: 0; }
/* Внутри строки расстояние держит gap. Свой нижний отступ поля сбил бы
 * выравнивание по низу: у последнего поля его нет, у остальных есть. */
.row > .field { margin-bottom: 0; }
.row--tight { gap: 10px; }
.row--actions { flex-wrap: nowrap; }
.row--actions > * { flex: none; }

/* Кастомный выпадающий список.
 * Системный select не поддаётся стилизации в разных браузерах одинаково, а
 * здесь он несёт смысл: варианты фиксированы, и список должен выглядеть
 * частью интерфейса, а не элементом операционной системы. */

.select { position: relative; }

.select__button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-control); background: var(--surface);
  font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; text-align: left;
}
.select__button:hover { border-color: var(--ink-3); }
.select__button[aria-expanded="true"] {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}
.select__button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.select__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select__value--empty { color: #a8b0bc; }
.select__caret { color: var(--ink-3); transition: transform 0.15s ease; }
.select__button[aria-expanded="true"] .select__caret { transform: rotate(180deg); }

.select__list {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-pop);
  padding: 5px; margin: 0; list-style: none; max-height: 274px; overflow-y: auto;
}

.select__option {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer;
  color: var(--ink);
}
.select__option:hover, .select__option.is-cursor { background: var(--surface-sunken); }
.select__option.is-selected { color: var(--accent-strong); font-weight: 600; }
.select__option .tick { color: var(--accent); opacity: 0; }
.select__option.is-selected .tick { opacity: 1; }
.select__option .grow { flex: 1; min-width: 0; }
.select__option .side { font-size: 12.5px; color: var(--ink-3); }

/* --- Таблицы --------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13.8px; }

thead th {
  text-align: left; padding: 10px 14px;
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.045em; text-transform: uppercase;
  color: var(--ink-3); background: var(--surface-sunken);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
thead th:first-child { padding-left: 22px; }
thead th:last-child { padding-right: 22px; }

tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody td:first-child { padding-left: 22px; }
tbody td:last-child { padding-right: 22px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfd; }

.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; letter-spacing: 0.02em;
}
.code-strong { font-weight: 650; letter-spacing: 0.08em; font-size: 14.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-2); }

/* --- Сообщения, пустые состояния, загрузка --------------------------------- */

.msg {
  padding: 11px 14px; border-radius: var(--r-control); font-size: 13.5px;
  margin-bottom: 16px; display: flex; align-items: flex-start; gap: 9px;
}
.msg--err { background: var(--danger-soft); color: var(--danger); }
.msg--ok { background: var(--ok-soft); color: var(--ok); }
.msg--info { background: var(--accent-soft); color: var(--accent-strong); }
.msg--warn { background: var(--warn-soft); color: var(--warn); }
.msg:empty { display: none; }

.empty { padding: 44px 22px; text-align: center; }
.empty__icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--surface-sunken);
  display: grid; place-items: center; margin: 0 auto 12px; color: var(--ink-3);
}
.empty__title { font-weight: 620; font-size: 15px; }
.empty__text { margin-top: 5px; color: var(--ink-3); font-size: 13.5px; }

.skeleton {
  background: linear-gradient(90deg, #eef0f3 25%, #f6f7f9 50%, #eef0f3 75%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
  border-radius: 7px; height: 13px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

.skeleton-rows { padding: 20px 22px; display: grid; gap: 13px; }

/* --- Экран входа ----------------------------------------------------------- */

.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 480px at 50% -8%, #e9ebff 0%, rgba(233, 235, 255, 0) 62%),
    var(--canvas);
}
.login__box { width: 100%; max-width: 390px; }
.login__brand {
  display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 8px;
}
.login__brand .rail__mark { width: 36px; height: 36px; border-radius: 10px; }
.login__title {
  text-align: center; font-size: 21px; font-weight: 670; letter-spacing: -0.02em; margin: 0;
}
.login__sub { text-align: center; color: var(--ink-2); font-size: 13.5px; margin: 5px 0 22px; }

/* --- Страницы портала ------------------------------------------------------ */

.screen-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 22px; border-bottom: 1px solid var(--line);
  cursor: pointer; width: 100%; border-left: 0; border-right: 0; border-top: 0;
  background: none; font: inherit; text-align: left; color: inherit;
}
.screen-row:last-child { border-bottom: 0; }
.screen-row:hover { background: #fbfcfd; }
.screen-row__text { flex: 1; min-width: 0; }
.screen-row__name { font-weight: 600; font-size: 14px; }
.screen-row__hint { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.screen-row__key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; color: var(--ink-3);
}

.override-field { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.override-field:last-child { border-bottom: 0; }
.override-field__head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 7px;
}
.override-field__label { font-size: 13px; font-weight: 600; flex: 1; }
.override-field__inherited {
  margin-top: 7px; font-size: 12.5px; color: var(--ink-3);
  display: flex; gap: 7px; align-items: flex-start;
}
.override-field__inherited b { font-weight: 600; color: var(--ink-2); }
.override-field__reset {
  border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px;
  color: var(--accent); cursor: pointer; font-weight: 550;
}
.override-field__reset:hover { text-decoration: underline; }

/* Редактор экрана: слева форма, справа живой предпросмотр. Предпросмотр
 * прилипает к верху — при длинной форме он должен оставаться на виду. */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; align-items: start; }
.editor__form { min-width: 0; }
.editor__preview { position: sticky; top: 22px; }

@media (max-width: 1180px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor__preview { position: static; }
}

.preview-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-soft);
}
.preview-panel__head {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 600; background: var(--surface-sunken);
}
.preview-panel__head .muted { font-weight: 400; font-size: 12.5px; }
.preview-frame {
  display: block; width: 100%; height: 620px; border: 0; background: #e8eef7;
}

.banner-preview {
  display: block; max-width: 320px; width: 100%; border-radius: 10px;
  border: 1px solid var(--line); margin-top: 4px;
}

/* Переключатель «да/нет». Своя отрисовка вместо системной галочки: та выглядит
 * по-разному в каждой ОС и теряется рядом с остальными полями. */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; margin: 0; width: 38px; height: 22px; flex: none;
  border-radius: var(--r-pill); background: var(--line-strong); position: relative;
  cursor: pointer; transition: background .15s ease; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: var(--r-pill); background: #fff;
  transition: transform .15s ease; box-shadow: 0 1px 3px rgba(14,20,32,.3); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-list { display: grid; gap: 12px; margin-bottom: 18px; }

/* Цвет: палитра рядом с точным значением. Палитра не умеет rgba(), а схема его
 * допускает, поэтому текстовое поле остаётся главным. */
.color-row { display: flex; gap: 10px; align-items: center; }
.color-dot { width: 42px; height: 40px; padding: 3px; flex: none; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--surface); }
.color-row .input { flex: 1; min-width: 0; }

/* Картинки: один слот или три под размеры экрана. */
.media-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .media-slots { grid-template-columns: minmax(0, 1fr); } }
.media-slot { min-width: 0; }
.media-slot__head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.media-slot__empty { padding: 22px 12px; text-align: center; border: 1px dashed var(--line-strong);
  border-radius: 10px; color: var(--ink-3); font-size: 12.5px; }

/* Выбор способа авторизации: три взаимоисключающих варианта, все на виду. */
.mode-options { display: grid; gap: 10px; }
.mode-option { display: flex; align-items: flex-start; gap: 11px; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-control);
  transition: border-color .12s ease, background .12s ease; }
.mode-option:hover { border-color: var(--ink-3); }
.mode-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mode-option.is-blocked { opacity: .55; cursor: default; }
.mode-option input { appearance: none; margin: 1px 0 0; width: 18px; height: 18px; flex: none;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); }
.mode-option input:checked { border: 5px solid var(--accent); }
.mode-option input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode-option__text { display: block; }
.mode-option__label { display: block; font-size: 14px; font-weight: 550; }
.mode-option__hint { display: block; font-size: 12.5px; color: var(--warn); margin-top: 2px; }

/* --- Разное ---------------------------------------------------------------- */

.stack { display: grid; gap: 16px; }
.inline { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.pager {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--line);
}
.pager__info { flex: 1; font-size: 13px; color: var(--ink-2); }
