/* «Кобальт»: тема оформления платформы — тёмное стекло и синий свет.
   Плавающее меню и верхняя строка, стеклянные карточки, синий акцент, спокойное движение.

   Подключается последней. Тема задаёт значения переменных, которые читают стили разделов
   (var(--имя, прежнее значение)), и форму оболочки: меню, верхнюю строку, плитки, карточки,
   таблицы, кнопки, поля. Логику страниц тема не трогает.

   Новые стили разделов пишите на переменных из блока ниже, без жёстко заданных цветов:
   тогда раздел сразу выглядит правильно. Страница входа живёт по своим стилям (login.css). */

/* ================= Переменные ================= */

:root:not([data-screen="login"]) {
  color-scheme: dark;
  accent-color: #5282ff;

  /* Акцент */
  --accent: #5282ff;
  --accent-rgb: 82 130 255;
  --accent-strong: #3b63f3;
  --accent-hi: #9db8ff;
  --on-accent: #fff;
  --teal: #34d5a3;
  --amber: #f5b84a;

  /* Основа: прежние имена остаются, значения — темы */
  --ink: #050917;
  --ink-raised: rgb(255 255 255 / 0.06);
  --line: rgb(150 172 232 / 0.14);
  --text-on-ink: #eef2fc;
  --muted-on-ink: #8a97ba;
  --gold: var(--accent);
  --gold-deep: var(--accent-hi);
  --danger: #ff8f9a;
  --paper: #070d20;
  --font-display: var(--font);
  --glow: rgb(var(--accent-rgb) / 0.45);

  /* Стекло */
  --glass: linear-gradient(180deg, rgb(124 152 255 / 0.11), rgb(124 152 255 / 0.045));
  --glass-line: rgb(150 172 232 / 0.17);
  --glass-line-strong: rgb(150 172 232 / 0.32);
  --glass-shadow: 0 24px 48px -32px rgb(0 0 0 / 0.9), inset 0 1px 0 rgb(255 255 255 / 0.07);
  --depth-1: 0 18px 36px -28px rgb(0 0 0 / 0.9), inset 0 1px 0 rgb(255 255 255 / 0.05);
  --depth-2: 0 26px 50px -28px rgb(0 0 0 / 0.95), inset 0 1px 0 rgb(255 255 255 / 0.08);
  --lift-shadow: var(--depth-1);

  /* Рабочая область */
  --page-text: #e9eefb;
  --page-muted: #8d9abc;
  --page-line: rgb(150 172 232 / 0.15);
  --page-surface: #0b1431;
  --link: #8fb0ff;

  /* Поверхности: все непрозрачные, чтобы закреплённые колонки и окна не просвечивали */
  --field-bg: #070e24;
  --field-line: rgb(150 172 232 / 0.27);
  --pop-bg: #0e1838;
  --pop-line: rgb(150 172 232 / 0.26);
  --raised-bg: color-mix(in srgb, #fff 5%, var(--page-surface));
  --bar-bg: color-mix(in srgb, #fff 3%, var(--page-surface));
  --sunken-bg: #081026;
  --group-bg: color-mix(in srgb, #fff 4.5%, var(--page-surface));
  --hover-bg: color-mix(in srgb, #fff 6%, var(--page-surface));
  --menu-hover: color-mix(in srgb, #fff 8%, var(--pop-bg));

  /* Отметки и состояния */
  --accent-soft: color-mix(in srgb, var(--accent) 17%, var(--page-surface));
  --accent-soft-strong: color-mix(in srgb, var(--accent) 34%, var(--page-surface));
  --accent-line: rgb(var(--accent-rgb) / 0.45);
  --mark-bg: rgb(245 184 74 / 0.42);
  --info-bg: color-mix(in srgb, var(--accent) 16%, var(--page-surface));
  --info-bg-strong: color-mix(in srgb, var(--accent) 30%, var(--page-surface));
  --info-text: #a9c0ff;
  --info-line: rgb(var(--accent-rgb) / 0.5);
  --warn-bg: color-mix(in srgb, #f5b84a 17%, var(--page-surface));
  --warn-text: #f7cf85;
  --bad-bg: color-mix(in srgb, #ff6b7a 17%, var(--page-surface));
  --bad-text: #ff9da8;
  --bad-line: rgb(255 107 122 / 0.45);
  --good-bg: color-mix(in srgb, #34d5a3 15%, var(--page-surface));
  --good-text: #72e4c0;
  --violet-bg: color-mix(in srgb, #a78bfa 18%, var(--page-surface));
  --violet-text: #c7b8ff;
  --neutral-bg: color-mix(in srgb, #fff 10%, var(--page-surface));
  --neutral-text: #c8d1e6;

  /* Свет сцены (studio.css) */
  --studio-grid: transparent;
  --edge: rgb(var(--accent-rgb) / 0.7);

  /* Значки разделов: маска, цвет берётся из текста */
  --icon-grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='3.5' width='7' height='7' rx='1.8'/%3E%3Crect x='13.5' y='3.5' width='7' height='7' rx='1.8'/%3E%3Crect x='3.5' y='13.5' width='7' height='7' rx='1.8'/%3E%3Crect x='13.5' y='13.5' width='7' height='7' rx='1.8'/%3E%3C/svg%3E");
  --icon-director: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 20h18M6.5 20v-8M12 20V5M17.5 20v-5'/%3E%3C/svg%3E");
  --icon-finance: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5.5' width='18' height='13' rx='2.5'/%3E%3Cpath d='M3 10h18M15 14.5h3'/%3E%3C/svg%3E");
  --icon-accounting: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4.5h11a3 3 0 0 1 3 3V20H8a3 3 0 0 1-3-3V4.5Z'/%3E%3Cpath d='M5 17a3 3 0 0 1 3-3h11'/%3E%3C/svg%3E");
  --icon-leasing: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0'/%3E%3Cpath d='M16 4.7a3.5 3.5 0 0 1 0 6.6M18.5 14.3a6.5 6.5 0 0 1 3 5.7'/%3E%3C/svg%3E");
  --icon-staff: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2.5'/%3E%3Ccircle cx='9' cy='11' r='2'/%3E%3Cpath d='M6 16a3 3 0 0 1 6 0M15 10h3M15 14h3'/%3E%3C/svg%3E");
  --icon-recruiting: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='8' r='3.5'/%3E%3Cpath d='M3.5 20a6.5 6.5 0 0 1 13 0M19 8v6M16 11h6'/%3E%3C/svg%3E");
  --icon-colleagues: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H10l-5 4v-4H4V5Z'/%3E%3Cpath d='M8 9.5h8M8 12.5h5'/%3E%3C/svg%3E");
  --icon-requests: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13l3-8h12l3 8v6H3v-6Z'/%3E%3Cpath d='M3 13h5l1 3h6l1-3h5'/%3E%3C/svg%3E");
  --icon-meetings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3Cpath d='M8 14h4v4H8z'/%3E%3Cpath d='m12 15.5 3.5-1.7v4.4L12 16.5'/%3E%3C/svg%3E");
  --icon-administration: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 3v6c0 4.5-3.2 8-8 9-4.8-1-8-4.5-8-9V6l8-3Z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E");
  --icon-settings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h8M16 7h4M4 17h4M12 17h8'/%3E%3Ccircle cx='14' cy='7' r='2'/%3E%3Ccircle cx='10' cy='17' r='2'/%3E%3C/svg%3E");
  --icon-pulse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13h3.5l2.5-7 4 12 2.5-5H21'/%3E%3C/svg%3E");
  --icon-exit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 4H6.5A2.5 2.5 0 0 0 4 6.5v11A2.5 2.5 0 0 0 6.5 20H10M15 8l4 4-4 4M19 12H9.5'/%3E%3C/svg%3E");
  --icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E");
}

[data-section="director"] { --section-icon: var(--icon-director); }
[data-section="finance"] { --section-icon: var(--icon-finance); }
[data-section="accounting"] { --section-icon: var(--icon-accounting); }
[data-section="leasing"] { --section-icon: var(--icon-leasing); }
[data-section="staff"] { --section-icon: var(--icon-staff); }
[data-section="recruiting"] { --section-icon: var(--icon-recruiting); }
[data-section="colleagues"] { --section-icon: var(--icon-colleagues); }
[data-section="requests"] { --section-icon: var(--icon-requests); }
[data-section="meetings"] { --section-icon: var(--icon-meetings); }
[data-section="administration"] { --section-icon: var(--icon-administration); }
[data-section="settings"] { --section-icon: var(--icon-settings); }

@property --pill-top { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --pill-bottom { syntax: "<length>"; inherits: false; initial-value: 0px; }

/* ================= Фон и основа ================= */

body.shell-page {
  background:
    radial-gradient(54% 60% at 36% 42%, rgb(34 78 222 / 0.5), transparent 72%),
    radial-gradient(40% 46% at 94% 24%, rgb(18 160 150 / 0.15), transparent 72%),
    radial-gradient(46% 52% at 2% 104%, rgb(40 70 190 / 0.34), transparent 72%),
    linear-gradient(180deg, #060b1c, #04070f);
  background-attachment: fixed;
  color: var(--page-text);
}

/* Страница внутри окна и окно выбора: ровный тёмный фон без света сцены. */
body.shell-page.in-frame,
body.popup-page { background: var(--paper); }

.shell-page, .popup-page {
  scrollbar-color: rgb(150 172 232 / 0.28) transparent;
  scrollbar-width: thin;
}

.shell-page ::selection, .popup-page ::selection { background: rgb(var(--accent-rgb) / 0.45); color: #fff; }
.shell-page ::placeholder, .popup-page ::placeholder { color: #66749a; opacity: 1; }

/* ================= Оболочка ================= */

.shell {
  grid-template-columns: 268px minmax(0, 1fr);
  column-gap: 16px;
  padding: 14px 16px 0 14px;
}

.in-frame .shell { padding: 0; }

.shell .workspace { background: none; }
.shell .workspace::before { content: none; }

/* ---------- Меню слева: плавающая стеклянная панель ---------- */

.shell .sidebar {
  top: 14px;
  height: calc(100vh - 28px);
  height: calc(100dvh - 28px);
  padding: 16px 12px 12px;
  border: 1px solid var(--glass-line);
  border-radius: 24px;
  background: var(--glass);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
}

.shell .sidebar::before,
.shell .sidebar::after { content: none; }

.shell .sidebar .logo {
  padding: 0 6px;
  font-size: 1.375rem;
  letter-spacing: 0.03em;
  text-shadow: none;
  white-space: nowrap;
}

.shell .sidebar .logo::before {
  content: "";
  display: inline-block;
  width: 40px;
  height: 40px;
  margin-right: 12px;
  border-radius: 13px;
  background: var(--icon-pulse) center / 22px no-repeat, linear-gradient(160deg, #73a0ff, #3b63f3);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.38), 0 12px 24px -10px rgb(var(--accent-rgb) / 0.9);
  vertical-align: middle;
}

.shell .sidebar .logo__accent { color: var(--accent-hi); text-shadow: none; animation: none; }

.shell .menu { margin-top: 22px; margin-right: -4px; margin-left: -4px; padding: 0 4px 8px; }

.shell .menu__back {
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px 4px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.04);
  color: var(--muted-on-ink);
  font-size: 0.78rem;
}

.shell .menu__back:hover { border-color: var(--glass-line-strong); color: #fff; }

/* Заголовок раздела: плашка со значком и название. */
.shell .menu__title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 4px 10px;
  padding: 0 2px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-on-ink);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.shell .menu__title::before {
  content: "";
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid rgb(var(--accent-rgb) / 0.35);
  border-radius: 10px;
  background: rgb(var(--accent-rgb) / 0.16);
}

/* Значок рисуется маской, поэтому лежит отдельным слоем поверх плашки. */
.shell .menu__title::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 10px;
  width: 18px;
  height: 18px;
  background: var(--accent-hi);
  -webkit-mask: var(--section-icon, var(--icon-grid)) center / contain no-repeat;
  mask: var(--section-icon, var(--icon-grid)) center / contain no-repeat;
  pointer-events: none;
}

.shell .menu__title a:hover { color: var(--accent-hi); }

.shell .nav { position: relative; }

.shell .nav__link {
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  color: #c5cfe8;
  font-size: 0.9rem;
  font-weight: 500;
}

.shell .nav--sub {
  margin: 2px 0 6px 14px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.shell .nav--sub .nav__link {
  min-height: 34px;
  padding: 6px 10px;
  color: var(--muted-on-ink);
  font-size: 0.85rem;
}

.shell .nav__link:hover { color: #fff; transform: none; }
.shell .nav__link::before { background: rgb(255 255 255 / 0.07); transform: none; transition: opacity .25s; }
.shell .nav__link:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 1px; }

.shell .nav__link--current,
.shell .nav--sub .nav__link--current { color: #fff; }

/* Текущая страница: синяя плашка с полосой слева. */
.shell .nav a[aria-current="page"]:not(:has(+ ul [aria-current="page"])) {
  background: linear-gradient(90deg, rgb(var(--accent-rgb) / 0.3), rgb(var(--accent-rgb) / 0.12));
  box-shadow: inset 3px 0 0 var(--accent);
  color: #fff;
}

/* Плашку ведёт cobalt.js: она переезжает от прежнего пункта к новому, передний край
   идёт быстрее заднего. Тогда у самой ссылки фона нет. */
.has-pill .shell .nav a[aria-current="page"]:not(:has(+ ul [aria-current="page"])) {
  background: none;
  box-shadow: none;
  view-transition-name: none;
}

.nav-pill {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, rgb(var(--accent-rgb) / 0.32), rgb(var(--accent-rgb) / 0.12));
  box-shadow: inset 3px 0 0 var(--accent);
  clip-path: inset(var(--pill-top) 0 var(--pill-bottom) 0 round 12px);
  opacity: 0;
  pointer-events: none;
}

.nav-pill.is-on { opacity: 1; }

.nav-pill.is-moving[data-dir="down"] {
  transition: --pill-bottom .36s cubic-bezier(0.215, 0.61, 0.355, 1), --pill-top .55s cubic-bezier(0.645, 0.045, 0.355, 1), left .45s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.nav-pill.is-moving[data-dir="up"] {
  transition: --pill-top .36s cubic-bezier(0.215, 0.61, 0.355, 1), --pill-bottom .55s cubic-bezier(0.645, 0.045, 0.355, 1), left .45s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.count,
.shell .nav .count,
.shell .bell .count { background: var(--accent); color: #fff; }

/* Низ меню: пользователь, «Анимации», выход */
.shell .account {
  margin: 0 2px;
  padding: 12px 4px 2px;
  border-top-color: var(--line);
}

.shell .account__name { color: var(--text-on-ink); font-weight: 600; }
.shell .account__country { color: var(--muted-on-ink); }

.shell .account__exit,
.motion-toggle {
  border-color: var(--glass-line);
  border-radius: 10px;
  background: rgb(255 255 255 / 0.04);
}

.shell .account__exit:hover,
.motion-toggle:hover { border-color: var(--accent-hi); color: #fff; }

.motion-toggle[aria-pressed="true"] {
  border-color: rgb(var(--accent-rgb) / 0.55);
  color: var(--accent-hi);
}

/* ---------- Узкая панель: Главная и страницы вне разделов ---------- */

/* Слева нет списка пунктов, поэтому панель сужается до полосы со значками, как на образце:
   знак платформы сверху, возврат в главное меню, внизу «Анимации» и выход. */
@media (min-width: 761px) {
  .shell:not(:has(.menu .nav)) { grid-template-columns: 72px minmax(0, 1fr); }

  .shell:not(:has(.menu .nav)) .sidebar { align-items: center; padding: 16px 0 14px; }
  .shell:not(:has(.menu .nav)) .sidebar .logo { padding: 0; font-size: 0; }
  .shell:not(:has(.menu .nav)) .sidebar .logo::before { margin-right: 0; }

  .shell:not(:has(.menu .nav)) .menu { margin: 18px 0 0; padding: 0; }

  .shell:not(:has(.menu .nav)) .menu__back {
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    font-size: 0;
  }

  .shell:not(:has(.menu .nav)) .menu__back::before {
    content: "";
    width: 19px;
    height: 19px;
    background: currentColor;
    -webkit-mask: var(--icon-grid) center / contain no-repeat;
    mask: var(--icon-grid) center / contain no-repeat;
  }

  .shell:not(:has(.menu .nav)) .account {
    flex-direction: column;
    gap: 8px;
    width: 44px;
    margin: 0;
    padding: 12px 0 0;
  }

  .shell:not(:has(.menu .nav)) .account__who { display: none; }
  .shell:not(:has(.menu .nav)) .motion-toggle { width: 40px; height: 40px; border-radius: 12px; }

  .shell:not(:has(.menu .nav)) .account__exit {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    font-size: 0;
  }

  .shell:not(:has(.menu .nav)) .account__exit::before {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--icon-exit) center / contain no-repeat;
    mask: var(--icon-exit) center / contain no-repeat;
  }
}

/* ---------- Меню раздела: раскрывается при наведении, булавка закрепляет ---------- */

/* По умолчанию меню раздела свёрнуто в узкую полосу со значками, как на Главной, и раскрывается
   поверх страницы, пока на нём мышь или фокус с клавиатуры. Булавка справа от знака закрепляет
   меню открытым, как было раньше: страница тогда стоит правее. Выбор (html[data-sidebar]: auto
   или pinned) и раскрытие (html[data-sidebar-open]) ведёт cobalt.js, выбор помнит браузер.
   Пока панель раскрывается, содержимое не перестраивается: ширина у него постоянная,
   лишнее скрыто краем панели. На телефоне и на сенсорном экране меню всегда открыто. */

.sidebar-pin { display: none; }

@media (min-width: 761px) and (hover: hover) and (pointer: fine) {
  .shell {
    --rail: 72px;
    --rail-wide: 268px;
    --rail-inner: calc(var(--rail-wide) - 26px); /* без полей 2 × 12 и рамки 2 × 1 */
  }

  /* Булавка: наклонена — меню открывается при наведении; стоит и залита — закреплено. */
  .shell .sidebar > .sidebar-pin {
    position: absolute;
    top: 20px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--glass-line);
    border-radius: 10px;
    background: rgb(255 255 255 / 0.04);
    color: var(--muted-on-ink);
    cursor: pointer;
    transition: opacity .2s, visibility .2s, color .2s, border-color .2s;
  }

  .shell .sidebar > .sidebar-pin[aria-pressed="true"] { border-color: rgb(var(--accent-rgb) / 0.55); color: var(--accent-hi); }
  .shell .sidebar > .sidebar-pin:hover { border-color: var(--accent-hi); color: #fff; }
  .shell .sidebar > .sidebar-pin:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
  .sidebar-pin svg { transform: rotate(45deg); transition: transform .3s var(--ease-out), fill .2s; }
  .sidebar-pin[aria-pressed="true"] svg { transform: none; }
  .sidebar-pin[aria-pressed="true"] svg path:first-child { fill: currentColor; }

  /* Открепленное меню: под него остаётся только полоса, раскрытое ложится поверх страницы. */
  [data-sidebar="auto"] .shell:has(.menu .nav) { grid-template-columns: var(--rail) minmax(0, 1fr); }

  [data-sidebar="auto"] .shell:has(.menu .nav) .sidebar {
    z-index: 30; /* выше строки сверху и меню «Ещё», ниже окон и кнопки «Собрать» */
    justify-self: start;
    width: var(--rail);
    transition: width .32s var(--ease-out), background-color .32s, box-shadow .32s;
  }

  [data-sidebar="auto"] .shell:has(.menu .nav) .sidebar .logo {
    width: var(--rail-inner);
    padding: 0 3px; /* знак — посередине полосы */
    transition: color .2s;
  }

  [data-sidebar="auto"] .shell:has(.menu .nav) .sidebar .logo__accent,
  [data-sidebar="auto"] .shell:has(.menu .nav) .menu__title { transition: color .2s; }
  [data-sidebar="auto"] .shell:has(.menu .nav) .menu { width: calc(var(--rail-inner) + 8px); }
  [data-sidebar="auto"] .shell:has(.menu .nav) .account { width: calc(var(--rail-inner) - 4px); }
  [data-sidebar="auto"] .shell:has(.menu .nav) .menu__back { height: 32px; }
  [data-sidebar="auto"] .shell:has(.menu .nav) .nav { transition: opacity .25s, visibility .25s; }

  [data-sidebar="auto"][data-sidebar-open] .shell:has(.menu .nav) .sidebar,
  [data-sidebar="auto"] .shell:has(.menu .nav) .sidebar:has(:focus-visible) {
    width: var(--rail-wide);
    background-color: color-mix(in srgb, var(--pop-bg) 84%, transparent);
    box-shadow: 28px 0 56px -28px rgb(0 0 0 / 0.85), var(--glass-shadow);
  }

  /* Свёрнутое меню: знак, «Главное меню» и значок раздела; внизу «Анимации» и выход.
     Высота строк та же, что у раскрытого, поэтому плашка текущего пункта стоит на месте. */
  [data-sidebar="auto"]:not([data-sidebar-open]) .shell:has(.menu .nav) .sidebar:not(:has(:focus-visible)) :is(.logo, .logo__accent, .menu__title, .menu__title a) {
    color: transparent;
  }

  [data-sidebar="auto"]:not([data-sidebar-open]) .shell:has(.menu .nav) .sidebar:not(:has(:focus-visible)) .nav,
  [data-sidebar="auto"]:not([data-sidebar-open]) .shell:has(.menu .nav) .sidebar:not(:has(:focus-visible)) > .sidebar-pin {
    opacity: 0;
    visibility: hidden;
  }

  [data-sidebar="auto"]:not([data-sidebar-open]) .shell:has(.menu .nav) .sidebar:not(:has(:focus-visible)) .menu__back {
    justify-content: center;
    width: 40px;
    margin-left: 3px;
    padding: 0;
    border-radius: 12px;
    font-size: 0;
  }

  [data-sidebar="auto"]:not([data-sidebar-open]) .shell:has(.menu .nav) .sidebar:not(:has(:focus-visible)) .menu__back::before {
    content: "";
    width: 19px;
    height: 19px;
    background: currentColor;
    -webkit-mask: var(--icon-grid) center / contain no-repeat;
    mask: var(--icon-grid) center / contain no-repeat;
  }

  [data-sidebar="auto"]:not([data-sidebar-open]) .shell:has(.menu .nav) .sidebar:not(:has(:focus-visible)) .account {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-left: 1px;
  }

  [data-sidebar="auto"]:not([data-sidebar-open]) .shell:has(.menu .nav) .sidebar:not(:has(:focus-visible)) .account__who { display: none; }

  [data-sidebar="auto"]:not([data-sidebar-open]) .shell:has(.menu .nav) .sidebar:not(:has(:focus-visible)) .motion-toggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  [data-sidebar="auto"]:not([data-sidebar-open]) .shell:has(.menu .nav) .sidebar:not(:has(:focus-visible)) .account__exit {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    font-size: 0;
  }

  [data-sidebar="auto"]:not([data-sidebar-open]) .shell:has(.menu .nav) .sidebar:not(:has(:focus-visible)) .account__exit::before {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--icon-exit) center / contain no-repeat;
    mask: var(--icon-exit) center / contain no-repeat;
  }
}

/* ---------- Верхняя строка: плавающее стекло ---------- */

.shell .topbar {
  top: 14px;
  flex-wrap: nowrap;
  gap: 10px 12px;
  min-height: 60px;
  padding: 9px 10px;
  border: 1px solid var(--glass-line);
  border-radius: 20px;
  background: var(--glass);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
}

/* Полоска над строкой: прокрученная страница не видна в зазоре сверху. */
.shell .topbar::before {
  content: "";
  position: absolute;
  top: -15px;
  right: -16px;
  left: -16px;
  height: 14px;
  background: #060b1c;
  pointer-events: none;
}

/* Вкладки стран: одна группа. Если строке тесно, вкладки переносятся внутри группы. */
.shell .country-tabs {
  flex: 0 1 auto;
  min-width: 0;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--glass-line);
  border-radius: 13px;
  background: rgb(3 8 22 / 0.36);
}

.shell .country-tab {
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--muted-on-ink);
  font-size: 0.84rem;
}

.shell .country-tab:hover {
  border-color: transparent;
  background: rgb(255 255 255 / 0.07);
  color: #fff;
  box-shadow: none;
  transform: none;
}

.shell .country-tab--current,
.shell .country-tab--current:hover {
  border-color: var(--glass-line-strong);
  background: rgb(255 255 255 / 0.13);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.14);
  color: #fff;
}

.country-tab:focus-visible,
.bell:focus-visible,
.topbar__search:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

.topbar__end { display: flex; flex: none; align-items: center; gap: 8px; margin-left: auto; }

/* Страна входа (только на Главной): зелёная точка и название. */
.topbar__live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px 0 10px;
  border: 1px solid rgb(52 213 163 / 0.3);
  border-radius: 999px;
  background: rgb(52 213 163 / 0.1);
  color: #7fe8c6;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.topbar__live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgb(52 213 163 / 0.2);
}

.topbar__search {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: clamp(150px, 16vw, 300px);
  height: 40px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: rgb(3 8 22 / 0.42);
  color: var(--muted-on-ink);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, color .2s, background-color .2s;
}

.topbar__search::before {
  content: "";
  flex: none;
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask: var(--icon-search) center / contain no-repeat;
  mask: var(--icon-search) center / contain no-repeat;
}

.topbar__search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__search:hover { border-color: var(--glass-line-strong); color: #fff; }

.topbar__search kbd,
.palette__hint kbd {
  flex: none;
  padding: 2px 7px;
  border: 1px solid var(--glass-line);
  border-radius: 7px;
  background: rgb(255 255 255 / 0.07);
  color: var(--muted-on-ink);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
}

.shell .bell {
  position: relative;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: 0;
  padding: 0;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.04);
  color: #dbe3f6;
}

.shell .bell:hover,
.shell .bell--current { border-color: var(--glass-line-strong); color: #fff; }

.shell .bell .count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  padding: 0 5px;
  border: 2px solid #0a1230;
  font-size: 0.68rem;
  line-height: 15px;
}

.topbar__avatar {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(160deg, #f1f5ff, #b7c7f3);
  color: #0b1431;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.topbar__avatar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border: 2px solid #0a1230;
  border-radius: 50%;
  background: var(--teal);
}

/* ================= Страница ================= */

.shell .page { max-width: 1560px; padding: 26px 6px 96px; }
.in-frame .shell .page { max-width: none; padding: 18px 22px 28px; }

.shell .page h1 {
  color: #fff;
  font-size: clamp(1.75rem, 1.35rem + 1vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.shell .page h1::after { content: none; }
.in-frame .shell .page h1 { font-size: 1.375rem; }

.page h2 { color: var(--page-text); font-weight: 650; letter-spacing: -0.01em; }
.page a:hover { color: #b9ccff; }
.crumbs a { color: var(--page-muted); }
.crumbs a:hover { color: #fff; }

.studio-greeting { margin-bottom: 6px; color: var(--page-muted); }
.studio-greeting b { color: var(--accent-hi); font-weight: 600; }
.stub { color: var(--page-muted); }

/* ---------- Главная: плитки разделов ---------- */

.shell .tiles { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 22px; }

.shell .tile,
.shell .page a.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  min-height: 150px;
  padding: 18px 20px 20px;
  border: 1px solid var(--glass-line);
  border-radius: 20px;
  background:
    radial-gradient(120% 130% at 0% 0%, rgb(var(--accent-rgb) / 0.24), transparent 60%),
    linear-gradient(180deg, rgb(124 152 255 / 0.12), rgb(124 152 255 / 0.04));
  box-shadow: var(--glass-shadow);
  color: var(--text-on-ink);
}

.shell .tile:hover,
.shell .page a.tile:hover {
  border-color: rgb(var(--accent-rgb) / 0.55);
  box-shadow: var(--depth-2), 0 0 44px -14px rgb(var(--accent-rgb) / 0.7);
  color: #fff;
}

.shell .tile::before {
  background: conic-gradient(from var(--spin), transparent 0deg 210deg, rgb(var(--accent-rgb) / 0.95) 300deg, #dfe8ff 330deg, transparent 360deg);
}

.shell .tile:focus-visible { outline-color: var(--accent-hi); }

.tile__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(var(--accent-rgb) / 0.38);
  border-radius: 14px;
  background: rgb(var(--accent-rgb) / 0.17);
  color: var(--accent-hi);
  transform: translateZ(22px);
  transition: background-color .3s, color .3s, border-color .3s;
}

.tile__icon::before {
  content: "";
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: var(--section-icon, var(--icon-grid)) center / contain no-repeat;
  mask: var(--section-icon, var(--icon-grid)) center / contain no-repeat;
}

.shell .tile:hover .tile__icon { border-color: transparent; background: var(--accent); color: #fff; }

.shell .tile__index {
  top: 20px;
  right: 20px;
  bottom: auto;
  color: var(--muted-on-ink);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  -webkit-text-stroke: 0;
}

.shell .tile:hover .tile__index { color: var(--accent-hi); text-shadow: none; }

.shell .tile__title {
  padding-right: 0;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.012em;
}

.shell .tile__title::after {
  content: "→";
  display: inline-block;
  margin-left: 8px;
  color: var(--accent-hi);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .3s, transform .4s var(--ease-out);
}

.shell .tile:hover .tile__title::after { opacity: 1; transform: none; }

/* ---------- Карточки и панели ---------- */

.shell .page a.card,
.page a.acc-kpi,
.acc-card,
.shell .hr-group,
.note {
  border-color: var(--glass-line);
  border-radius: 16px;
  background: var(--glass);
  box-shadow: var(--depth-1);
}

/* Карточки справочников, конструкций и блоки настроек — то же стекло. */
.shell .ref-card,
.shell .build-card,
.shell .build-panel,
.shell .cfg-card {
  border-color: var(--glass-line);
  background: var(--glass);
}

.shell .page a.card:hover,
.page a.acc-kpi:hover {
  border-color: rgb(var(--accent-rgb) / 0.55);
  box-shadow: var(--depth-2), 0 0 36px -16px rgb(var(--accent-rgb) / 0.7);
}

.shell .page a.card::before { background: linear-gradient(180deg, var(--accent-hi), var(--accent)); }
.shell .page a.card:focus-visible { outline-color: var(--accent-hi); }
.page a.acc-kpi--accent { border-color: rgb(var(--accent-rgb) / 0.6); }
.acc-kpi__value { font-size: 1.625rem; font-weight: 650; letter-spacing: -0.02em; }
.page a.acc-card__title:hover { color: var(--accent-hi); }

.shell .table-wrap,
.shell .facts {
  border-color: var(--glass-line);
  border-radius: 16px;
  box-shadow: var(--depth-1);
}

.shell .hr-group:hover { box-shadow: var(--depth-2); }
.hr-panel { align-items: start; }

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

.shell .table th { color: var(--page-muted); font-weight: 650; }
.shell .table tbody tr:hover > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.row--backdated td { color: var(--page-text); }

/* ---------- Вкладки, метки, сообщения ---------- */

.page a.tab--current { border-bottom-color: var(--accent); color: #fff; }
.shell .page a.tab:hover { color: #fff; }
.shell .page a.tab::after { background: var(--accent); }
.shell .page a.tab--current::after { box-shadow: 0 0 12px rgb(var(--accent-rgb) / 0.9); }

.badge { border-radius: 999px; }
.deadline { border-radius: 999px; }
.notice { border: 1px solid var(--glass-line); border-radius: 12px; }
.notice--success { border-color: rgb(52 213 163 / 0.35); }
.notice--error { border-color: var(--bad-line); }

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

.shell .page .button,
.shell .page .button:hover {
  border: 1px solid rgb(160 186 255 / 0.55);
  border-radius: 11px;
  background: linear-gradient(180deg, #6a93ff, #3f68f5);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 12px 26px -14px rgb(var(--accent-rgb) / 0.95);
  color: #fff;
}

.shell .page .button:hover {
  background: linear-gradient(180deg, #7ba0ff, #4a72ff);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.36), 0 16px 30px -14px rgb(var(--accent-rgb) / 1);
}

.shell .page .button::before { background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.35), transparent); }
.shell .page .button:active { box-shadow: inset 0 2px 6px rgb(0 0 0 / 0.35); }
.page .button:focus-visible { outline-color: var(--accent-hi); }

.shell .page .button--quiet,
.shell .page .button--quiet:hover {
  border-color: var(--glass-line-strong);
  background: rgb(255 255 255 / 0.05);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.07);
  color: var(--page-text);
}

.shell .page .button--quiet:hover { border-color: var(--accent-hi); background: rgb(255 255 255 / 0.09); color: #fff; }
.shell .page .button--quiet::before { background: linear-gradient(90deg, transparent, rgb(var(--accent-rgb) / 0.3), transparent); }

.shell .page .button--danger,
.shell .page .button--danger:hover {
  border-color: rgb(255 150 160 / 0.55);
  background: linear-gradient(180deg, #f0606c, #cf3a47);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 12px 26px -14px rgb(240 80 95 / 0.9);
  color: #fff;
}

.page .link-button { color: var(--bad-text); }

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

/* Поля и кнопки без своих стилей: вместо серых системных — в цветах темы.
   :where() не добавляет веса, поэтому любой стиль раздела остаётся главнее. */
:where(.shell-page, .popup-page) :where(select, textarea, input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"])) {
  border: 1px solid var(--field-line);
  border-radius: 9px;
  background-color: var(--field-bg);
  color: var(--page-text);
}

:where(.shell-page, .popup-page) :where(button, input[type="submit"], input[type="button"], input[type="reset"]) {
  border: 1px solid var(--glass-line-strong);
  border-radius: 9px;
  background-color: var(--raised-bg);
  color: var(--page-text);
}

:where(.shell-page, .popup-page) :where(select, textarea, input, button):focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 1px;
}

.form input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
.form select,
.form textarea,
.reject textarea { border-radius: 10px; }

.form label, .reject label { color: #cdd6ec; }
.shell-page input[type="file"], .popup-page input[type="file"] { color: var(--page-muted); }

/* Автозаполнение браузера не красит поле в светлое. */
.shell-page input:-webkit-autofill,
.popup-page input:-webkit-autofill {
  -webkit-text-fill-color: var(--page-text);
  box-shadow: 0 0 0 1000px var(--field-bg) inset;
  caret-color: var(--page-text);
}

/* ================= Списки, меню, окна (их стили подключаются позже темы) ================= */

:root .list-search__input,
:root .list-dialog input[type="text"],
:root .list-dialog input[type="date"],
:root .list-dialog select { border-radius: 10px; }

:root .more__menu,
:root .lf-more__menu {
  border-color: var(--pop-line);
  border-radius: 14px;
  box-shadow: 0 24px 50px -18px rgb(0 0 0 / 0.85), inset 0 1px 0 rgb(255 255 255 / 0.07);
}

:root .page .more__menu [role="menuitem"]:hover,
:root .page .more__menu [role="menuitemcheckbox"]:hover { background: var(--menu-hover); }

:root .chip { border-color: var(--accent-line); color: var(--page-text); }
:root .list-copy { border-color: var(--accent-line); background: linear-gradient(90deg, var(--accent-soft), transparent); }
:root .list-selection__sums { color: var(--accent-hi); }
:root .sort__mark { color: var(--accent-hi); }

:root .list-dialog,
:root .lf,
:root .lf-add {
  border: 1px solid var(--pop-line);
  background: var(--pop-bg);
  box-shadow: 0 40px 90px -20px rgb(0 0 0 / 0.9), inset 0 1px 0 rgb(255 255 255 / 0.07);
}

:root .list-dialog { border-radius: 18px; }
:root .lf, :root .lf-add { border-radius: 18px; }

:root .list-dialog::backdrop,
:root .lf::backdrop,
:root .lf-add::backdrop,
:root .palette::backdrop {
  background: rgb(2 5 14 / 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

:root .lf-head { background: linear-gradient(90deg, #0a1230, #142457); }
:root .lf-btn--main { border-color: rgb(160 186 255 / 0.55); background: linear-gradient(180deg, #6a93ff, #3f68f5); color: #fff; }
:root .lf-node.is-selected { border-color: var(--accent); }
:root .lf-add__group h3 { color: var(--accent-hi); }

/* Окна как в 1С */
:root .win {
  border-color: var(--pop-line);
  border-radius: 16px;
  box-shadow: 0 34px 80px -18px rgb(0 0 0 / 0.9), 0 0 0 1px rgb(255 255 255 / 0.03);
}

:root .win--active { border-color: rgb(var(--accent-rgb) / 0.7); }
:root .win--max { border-radius: 0; }
:root .win__head { background: #0a1230; }
:root .win--active .win__head { background: linear-gradient(90deg, #0a1230, #1a2f73); }
:root .win__btn:hover { color: #fff; }
:root .win-bar { border-top-color: var(--glass-line); background: rgb(5 9 23 / 0.94); }
:root .win-bar__item, :root .win-bar__close { border-color: var(--glass-line); background: rgb(255 255 255 / 0.05); }
:root .win-bar__item.is-active { border-color: var(--accent); color: #fff; }

/* «Собрать»: главная синяя кнопка платформы */
:root .dock__button {
  border-color: rgb(160 186 255 / 0.55);
  background: linear-gradient(180deg, #6a93ff, #3f68f5);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 16px 34px -14px rgb(var(--accent-rgb) / 0.95);
  animation: none;
}

:root .dock__button:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.36), 0 22px 40px -14px rgb(var(--accent-rgb) / 1); }
:root .dock__button[aria-expanded="true"] { background: linear-gradient(180deg, #7ba0ff, #4a72ff); }
:root .dock__cube i { border-color: #fff; background: rgb(255 255 255 / 0.22); }
:root .dock__cube i:nth-child(2) { background: rgb(255 255 255 / 0.38); }
:root .dock__cube i:nth-child(3) { background: rgb(255 255 255 / 0.6); }
:root .dock .count { background: #fff; color: var(--accent-strong); }

:root .dock__panel {
  border-color: var(--glass-line-strong);
  background: rgb(10 18 44 / 0.9);
}

:root .dock__here b,
:root .dock__links a { color: var(--accent-hi); }

/* Конструктор и настройки */
:root .studio-kicker,
:root .lay-group__title,
:root .fs-path { color: var(--accent-hi); }

:root .fs-dialog__head { background: linear-gradient(90deg, #0a1230, #142457); }
:root .switch__track { background: rgb(255 255 255 / 0.16); }

/* ================= Быстрый переход (Ctrl+K) ================= */

.palette {
  width: min(600px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 80px));
  margin-top: 12vh;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--glass-line-strong);
  border-radius: 20px;
  background: rgb(11 19 46 / 0.94);
  box-shadow: 0 50px 110px -24px rgb(0 0 0 / 0.95), inset 0 1px 0 rgb(255 255 255 / 0.08);
  color: var(--page-text);
  font-family: var(--font);
}

.palette[open] { display: flex; flex-direction: column; animation: palette-in .32s var(--ease-out); }

@keyframes palette-in { from { opacity: 0; transform: translate3d(0, -10px, 0) scale(0.98); } }

.palette__field {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.palette__field::before {
  content: "";
  flex: none;
  width: 19px;
  height: 19px;
  background: var(--muted-on-ink);
  -webkit-mask: var(--icon-search) center / contain no-repeat;
  mask: var(--icon-search) center / contain no-repeat;
}

.palette__input {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  outline: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
}

.palette__list { flex: 1; min-height: 0; margin: 0; padding: 8px; overflow-y: auto; list-style: none; }

.palette__item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--page-text);
  text-decoration: none;
  cursor: pointer;
}

.palette__item[aria-selected="true"] {
  background: linear-gradient(90deg, rgb(var(--accent-rgb) / 0.3), rgb(var(--accent-rgb) / 0.12));
  box-shadow: inset 3px 0 0 var(--accent);
  color: #fff;
}

.palette__title { font-weight: 600; }
.palette__path { margin-left: auto; overflow: hidden; color: var(--muted-on-ink); font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.palette__title mark { border-radius: 3px; background: rgb(var(--accent-rgb) / 0.4); color: inherit; }
.palette__empty { margin: 0; padding: 22px 18px; color: var(--muted-on-ink); font-size: 0.9rem; }

.palette__hint {
  display: flex;
  flex: none;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted-on-ink);
  font-size: 0.75rem;
}

/* ================= Сцена: мягкий синий свет ================= */

.studio-stage { inset: 0; }
.studio-stage__floor { display: none; }
.studio-stage__light { opacity: 0.55; }
.studio-stage__light--a { background: radial-gradient(closest-side, rgb(48 96 255 / 0.3), transparent); }
.studio-stage__light--b { background: radial-gradient(closest-side, rgb(20 180 170 / 0.14), transparent); }
.studio-stage__light--c { background: radial-gradient(closest-side, rgb(96 88 255 / 0.2), transparent); }

.spotlight { background: radial-gradient(closest-side, rgb(110 150 255 / 0.13), rgb(110 150 255 / 0.04) 45%, transparent 100%); }

/* ================= Переходы между страницами ================= */

/* Панель слева меняет ширину (Главная ↔ раздел): снимок не тянется, а открывается. */
::view-transition-group(sidebar) { overflow: clip; border-radius: 24px; }
::view-transition-old(sidebar),
::view-transition-new(sidebar) { inline-size: auto; block-size: 100%; }

/* Меню того же раздела сменяется сразу: плашка текущего пункта переезжает сама. */
::view-transition-old(.menu):not(:only-child) { animation-duration: .14s; }
::view-transition-new(.menu):not(:only-child) { animation-duration: .14s; }

/* ================= Узкий экран ================= */

/* Вкладкам стран нужно место: поиск сворачивается до значка. */
@media (max-width: 1560px) {
  .topbar:has(.country-tabs) .topbar__search { justify-content: center; width: 40px; padding: 0; }
  .topbar:has(.country-tabs) .topbar__search span,
  .topbar:has(.country-tabs) .topbar__search kbd { display: none; }
}

@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 10px 10px 0; row-gap: 10px; }
  .shell .topbar { flex-wrap: wrap; }
  .shell .country-tabs { flex: 1 1 100%; }
  .topbar__live { display: none; }

  .shell .sidebar {
    top: 0;
    height: auto;
    padding: 14px 12px 12px;
    border-radius: 20px;
  }

  .shell .topbar { top: 8px; padding: 8px; border-radius: 16px; }
  .shell .topbar::before { display: none; }
  .shell .page { padding: 18px 2px 96px; }
  .topbar__search { width: auto; flex: 1; }
  .topbar__search kbd { display: none; }
  .shell .tile, .shell .page a.tile { min-height: 112px; gap: 16px; }
}

/* ================= Без движения ================= */

:root[data-motion="off"] .nav-pill,
:root[data-motion="off"] .palette { animation: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .nav-pill, .palette { animation: none !important; transition: none !important; }
}

@media (forced-colors: active) {
  .nav-pill { display: none; }
  .shell .sidebar, .shell .topbar { border-color: CanvasText; }
}

/* ================= Печать ================= */

/* На бумаге — светлый лист и тёмный текст, без меню, строки сверху и свечения. */
@media print {
  :root:not([data-screen="login"]) {
    color-scheme: light;
    --page-text: #18202e;
    --page-muted: #5d6675;
    --page-line: #cfcbc0;
    --page-surface: #fff;
    --paper: #fff;
    --link: #1d4e9e;
    --accent-hi: #2f55d4;
    --glass: none;
    --glass-line: #cfcbc0;
    --glass-line-strong: #b9b4a6;
    --glass-shadow: none;
    --depth-1: none;
    --depth-2: none;
    --field-bg: #fff;
    --field-line: #b9b4a6;
    --pop-bg: #fff;
    --pop-line: #b9c3d6;
    --raised-bg: #fff;
    --bar-bg: #f8f6f0;
    --sunken-bg: #fcfbf8;
    --group-bg: #f3efe4;
    --hover-bg: #fff;
    --accent-soft: #e8eefc;
    --accent-soft-strong: #d5e0fb;
    --mark-bg: #f9e08b;
    --info-bg: #e3ecfb;
    --info-bg-strong: #dbe5f6;
    --info-text: #1d3f7a;
    --warn-bg: #fbe9b7;
    --warn-text: #6b4e00;
    --bad-bg: #f9d4cd;
    --bad-text: #8a1f10;
    --good-bg: #d6ecd9;
    --good-text: #1f5a2c;
    --violet-bg: #ece4ff;
    --violet-text: #4a2fa0;
    --neutral-bg: #d9d9d9;
    --neutral-text: #444;
  }

  body.shell-page,
  body.popup-page { background: #fff; color: #18202e; }

  .shell { display: block; padding: 0; }

  .shell .sidebar,
  .shell .topbar,
  .studio-stage,
  .spotlight,
  .win-layer,
  .win-bar { display: none !important; }

  .shell .page { max-width: none; padding: 0; }

  .shell .page h1,
  .page h2,
  .page a.tab--current,
  .form label,
  .reject label { color: #18202e; }

  .shell .page .button,
  .shell .page .button--quiet,
  .shell .page .button--danger {
    border-color: #b9b4a6;
    background: #fff;
    box-shadow: none;
    color: #18202e;
  }

  .shell .page > *,
  .shell .table tbody tr,
  .shell .cards > li,
  .shell .tiles > li { animation: none !important; }
}
