:root {
  /* Surfaces — Mercury-inspired cool grays, layered elevation */
  --ui-bg: #F5F8FB;
  --ui-surface: #ffffff;
  --ui-surface-muted: #f1f4f8;
  --ui-surface-sunken: #eef1f5;
  /* Product sidebars — same tone as in-app pages (settings, company, dashboard) */
  --ui-sidebar-surface: #eef1f5;
  --ui-app-sidebar-width: 220px;
  /* Borders — hairline cool dividers (Mercury/Stripe style) */
  --ui-border: #DCE6F0;
  --ui-border-strong: #DCE6F0;
  /* Text — higher contrast hierarchy */
  --ui-text: #0A2540;
  --ui-text-muted: #5E6B7E;
  /* было #8B97A8 (2.96:1 — провал WCAG AA для текста); #677484 = 4.76:1 на белом,
     остаётся светлее --ui-text-muted, иерархия muted/soft сохранена */
  --ui-text-soft: #677484;
  /* Semantic aliases (ТЗ / дизайн-доки) */
  --color-background-primary: var(--ui-surface);
  --color-background-secondary: var(--ui-sidebar-surface);
  --color-border-tertiary: var(--ui-border);
  --color-text-secondary: var(--ui-text-muted);
  --color-text-primary: var(--ui-text);
  --color-text-tertiary: var(--ui-text-soft);
  /* Brand — keep INN blue, refine soft tint */
  --ui-primary: #2178C9;
  --ui-primary-dark: #14568F;
  --ui-primary-soft: #E8F1FA;
  --ui-primary-tint: #F5F8FB;
  /* Status — slightly muted for financial restraint */
  --ui-success: #15803d;
  --ui-success-soft: #ecfdf5;
  --ui-warning: #b45309;
  --ui-warning-soft: #fef3c7;
  --ui-danger: #b91c1c;
  --ui-danger-soft: #fef2f2;
  /* Elevation — layered subtle shadows instead of one big drop */
  --ui-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --ui-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.04);
  --ui-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.05);
  --ui-shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  /* Radii — tighter, more "professional financial" */
  --ui-radius: 12px;
  --ui-radius-sm: 8px;
  --ui-radius-lg: 16px;
  --ui-page-max: 1760px;
  --ui-page-gutter: clamp(1rem, 2.1vw, 2.75rem);
  --ui-shell-gutter: clamp(1rem, 2.6vw, 3.5rem);
  --ui-content-pad-y: clamp(1.25rem, 2vw, 2rem);
  --ui-content-pad-bottom: clamp(2.5rem, 4vw, 4rem);
  --ui-container: var(--ui-page-max);
  /* Marketing footer — компактный SaaS/legal-tech блок */
  --ui-marketing-footer-bg: #E8F1FA;
  --ui-marketing-footer-border: #DCE6F0;
  --ui-marketing-footer-text: #0A2540;
  --ui-marketing-footer-muted: #5E6B7E;
  --ui-marketing-footer-link: #5E6B7E;
  --ui-marketing-footer-link-hover: #2178C9;
  --ui-marketing-footer-inner-max: 1280px;
  /* Typography tokens */
  --font-ui: "Golos Text", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Onest", "Golos Text", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --type-body-size: 14px;
  --type-body-line: 1.5;
  --type-title-size: 32px;
  --type-subtitle-size: 18px;
  --type-label-size: 11px;
  /* Унифицированная typography scale. 7 ступеней покрывают всё от
     микро-меток (--text-xs, для chip-counters) до большого hero
     заголовка (--text-3xl, для маркетинговой главной). Старые
     --type-* алиасы сохранены чтобы не ломать существующий код. */
  --text-xs:   12px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   22px;
  --text-2xl:  28px;
  --text-3xl:  36px;
  /* 8-pt spacing scale. Все отступы/гэпы/паддинги должны выбираться
     отсюда. Магические значения вида 7px/13px/17px в новых стилях
     запрещены — приводи к ближайшему шагу. */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   24px;
  --space-6:   32px;
  --space-7:   48px;
  --space-8:   64px;
  /* Motion tokens — единый словарь для transition/animation по всему фронту.
     Easings вытащены из Vercel Geist / Linear (квартическая и экспоненциальная
     out-кривые ощущаются «мягче» обычной ease). Spring используется только
     для появления drawer'ов/тостов, где лёгкий overshoot подчёркивает «жест». */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Durations (4 ступени). <150ms — «мгновенно» (hover/bg-swap). 200ms —
     small transforms. 280ms — модалки/drawer'ы. 420ms — body-fade. */
  --duration-instant: 120ms;
  --duration-fast:    200ms;
  --duration-base:    280ms;
  --duration-slow:    420ms;
}

html,
body {
  min-height: 100%;
  font-family: var(--font-ui);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: var(--ui-bg);
  color: var(--ui-text);
}

/* Заголовки — display-шрифт системы (Onest). Страничные стили могут
   переопределять размер/вес, семейство остаётся единым. */
h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

/* Shell: контент + футер внутри .inn-shell-stack (скрипты вне — не ломают flex). React: #root + footer; статические: header + main + footer. */
.inn-shell-stack {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.inn-shell-stack > main {
  min-height: 0;
}

.inn-shell-stack > #root {
  flex: 1 0 auto;
  min-height: auto;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

/* Общий маркетинговый футер: не сжимать и не наезжать на контент (порядок в DOM = низ страницы) */
footer.inn-marketing-footer,
footer[data-shell-footer] {
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

/* ── In-app left sidebar (настройки, карточка компании, legacy company layout) ─ */
.ui-app-sidebar {
  box-sizing: border-box;
  flex: 0 0 var(--ui-app-sidebar-width);
  width: var(--ui-app-sidebar-width);
  align-self: stretch;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--ui-sidebar-surface);
  border-right: 1px solid var(--color-border-tertiary);
  font-family: var(--font-ui);
  overflow: hidden;
}

.ui-app-sidebar__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.ui-app-sidebar__scroll::-webkit-scrollbar {
  width: 4px;
}

.ui-app-sidebar__scroll::-webkit-scrollbar-thumb {
  background: #d0d7de;
  border-radius: 4px;
}

.ui-app-sidebar__section-title {
  flex-shrink: 0;
  padding: 1.25rem 0.875rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ui-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ui-app-sidebar__head {
  flex-shrink: 0;
  padding: 1rem 0.875rem;
  border-bottom: 1px solid var(--color-border-tertiary);
}

.ui-app-sidebar__head-name {
  margin: 0 0 0.2rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ui-text);
  line-height: 1.35;
}

.ui-app-sidebar__head-meta {
  margin: 0 0 0.75rem;
  font-size: 0.6875rem;
  color: var(--ui-text-soft);
  font-variant-numeric: tabular-nums;
}

.ui-app-sidebar__nav-inner {
  display: flex;
  flex-direction: column;
  padding: 0 0.5rem 0.75rem;
}

.ui-app-sidebar__group {
  margin-bottom: 0.25rem;
}

.ui-app-sidebar__group-label {
  padding: 0.5rem 0.625rem 0.2rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ui-text-soft);
}

.ui-app-sidebar__item {
  display: flex;
  align-items: center;
  gap: 0.5625rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.4375rem 0.625rem;
  margin-bottom: 0.125rem;
  border: none;
  border-radius: 0.4375rem;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--ui-text-muted);
  font-size: 0.8125rem;
  font-weight: 400;
  font-family: inherit;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background-color 100ms ease, color 100ms ease, border-color 100ms ease;
}

.ui-app-sidebar__item .bi {
  flex-shrink: 0;
  color: var(--ui-text-soft);
}

.ui-app-sidebar__item:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ui-text);
}

.ui-app-sidebar__item:hover .bi {
  color: var(--ui-text-muted);
}

.ui-app-sidebar__item--active {
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  font-weight: 600;
  border-left-color: var(--ui-primary);
}

.ui-app-sidebar__item--active .bi {
  color: var(--ui-primary);
}

.ui-app-sidebar__cta {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.4375rem;
  border: none;
  background: var(--ui-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.ui-app-sidebar__cta:hover {
  background: var(--ui-primary-dark);
}

.ui-app-sidebar__footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 0.625rem 0.75rem;
  border-top: 1px solid var(--color-border-tertiary);
}

.ui-app-sidebar__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  width: 100%;
  padding: 0.375rem 0.25rem;
  border: none;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ui-text-muted);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: color 100ms ease;
}

.ui-app-sidebar__link:hover {
  color: var(--ui-text);
}

.hidden {
  display: none !important;
}

.shell-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 0.5px solid rgba(226, 232, 240, 0.5);
}

/* Skeleton-placeholder для пустого header'а пока mountPartial(...) фетчит
   /static/shared/partials/header.html. Без этого правила header «появляется
   из ниоткуда» после VT-перехода — воспринимается как мигание. С правилом
   на месте header'а сразу стоит белая полоса той же высоты (4rem). */
header[data-shell-header]:empty {
  display: block;
  position: fixed;
  inset: 0 0 auto 0;
  height: 4rem;
  background: #fff;
  border-bottom: 0.5px solid rgba(226, 232, 240, 0.5);
  z-index: 1000;
}

.shell-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 4rem;
  max-width: var(--ui-page-max);
  margin: 0 auto;
  padding: 0 var(--ui-shell-gutter);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.shell-header__brand {
  display: inline-flex;
  align-items: center;
  width: 178px;
  height: 34px;
  overflow: hidden;
  text-decoration: none;
}

.shell-header__brand-logo {
  display: block;
  width: 178px;
  height: 34px;
  object-fit: contain;
  object-position: left center;
}

.shell-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.shell-header__nav-link {
  color: #8B97A8;
  text-decoration: none;
  transition: color 160ms ease;
}

.shell-header__nav-link:hover {
  color: #185fa5;
}

.shell-header__nav-link--active {
  color: #185fa5;
  border-bottom: 2px solid #185fa5;
  padding-bottom: 0.25rem;
}

.shell-header__actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 1rem;
  position: relative;
}

.shell-header__account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8B97A8;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.shell-header__account:hover {
  background: #f8fafc;
  color: #185fa5;
}

.shell-account-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 220px;
  max-width: 300px;
  padding: 0.35rem;
  border: 0.5px solid var(--color-border-tertiary, rgba(171, 179, 183, 0.42));
  border-radius: 10px;
  background: var(--color-background-primary, #fff);
  box-shadow: var(--ui-shadow-lg);
  z-index: 110;
  /* Открытие: anchor сверху, чтобы scale «выезжал» из триггера. */
  transform-origin: top right;
  /* Open state — анимация контейнера + cascade пунктов внутри. */
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  animation: ui-dropdown-in var(--duration-fast) var(--ease-out-quart);
  transition:
    opacity   var(--duration-fast) var(--ease-out-quart),
    transform var(--duration-fast) var(--ease-out-quart),
    visibility 0s linear 0s;
}

/* Close state: переопределяем дефолтное .hidden { display:none !important }
   через большую specificity + !important. Меню остаётся в потоке (display:block),
   но opacity:0 + visibility:hidden + лёгкий «уход вверх». Visibility отложен
   до конца fade — иначе элемент исчезнет до завершения transition. */
.shell-account-menu.hidden {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px) scale(0.98);
  animation: none;
  transition:
    opacity    var(--duration-fast) var(--ease-out-quart),
    transform  var(--duration-fast) var(--ease-out-quart),
    visibility 0s linear var(--duration-fast);
}

/* Cascade открытия: пункты появляются по очереди с шагом ~22мс. Группы
   и разделители — без задержки, чтобы скелет меню был на месте сразу,
   а пункты «дозаливали» сверху-вниз. */
.shell-account-menu:not(.hidden) .shell-account-menu__item {
  opacity: 0;
  transform: translateY(-2px);
  animation: ui-fade-in var(--duration-fast) var(--ease-out-quart) forwards;
}
.shell-account-menu:not(.hidden) .shell-account-menu__item:nth-child(1)  { animation-delay: 30ms; }
.shell-account-menu:not(.hidden) .shell-account-menu__item:nth-child(2)  { animation-delay: 52ms; }
.shell-account-menu:not(.hidden) .shell-account-menu__item:nth-child(3)  { animation-delay: 74ms; }
.shell-account-menu:not(.hidden) .shell-account-menu__item:nth-child(4)  { animation-delay: 96ms; }
.shell-account-menu:not(.hidden) .shell-account-menu__item:nth-child(5)  { animation-delay: 118ms; }
.shell-account-menu:not(.hidden) .shell-account-menu__item:nth-child(6)  { animation-delay: 140ms; }
.shell-account-menu:not(.hidden) .shell-account-menu__item:nth-child(7)  { animation-delay: 162ms; }
.shell-account-menu:not(.hidden) .shell-account-menu__item:nth-child(8)  { animation-delay: 184ms; }
.shell-account-menu:not(.hidden) .shell-account-menu__item:nth-child(9)  { animation-delay: 206ms; }
.shell-account-menu:not(.hidden) .shell-account-menu__item:nth-child(10) { animation-delay: 228ms; }
.shell-account-menu:not(.hidden) .shell-account-menu__item:nth-child(n+11) { animation-delay: 250ms; }

.shell-account-menu__divider {
  height: 0.5px;
  margin: 0.2rem 0.35rem;
  background: var(--color-border-tertiary, rgba(171, 179, 183, 0.42));
}

.shell-account-menu__group {
  margin: 0.15rem 0.5rem 0.15rem;
  padding: 0.35rem 0.5rem 0.15rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-tertiary, #94a3b8);
}

.shell-account-menu__item {
  display: flex;
  width: 100%;
  min-height: 2.25rem;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border: 0;
  background: transparent;
  color: var(--color-text-primary, var(--ui-text));
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.shell-account-menu__item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ui-primary);
}

.shell-account-menu__item--nested {
  padding-left: 1.35rem;
  font-size: 12.5px;
}

.shell-account-menu__item--logout {
  color: var(--color-text-secondary, var(--ui-text-muted));
}

.shell-account-menu__item--logout:hover {
  color: var(--ui-text);
}

/* Marketing footer — компактный горизонтальный блок */
/* ─── Marketing footer ──────────────────────────────────────────────────── */

.inn-marketing-footer {
  width: 100%;
  margin-top: 0;
  box-sizing: border-box;
  background: var(--ui-marketing-footer-bg);
  border-top: 1px solid var(--ui-marketing-footer-border);
  color: var(--ui-marketing-footer-text);
  font-family: var(--font-ui);
}

.inn-marketing-footer__inner {
  max-width: var(--ui-marketing-footer-inner-max);
  width: 100%;
  margin: 0 auto;
  padding: 52px 40px 32px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Main 4-column grid */
.inn-marketing-footer__main {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1.3fr 1fr;
  column-gap: clamp(2rem, 4vw, 4rem);
  row-gap: 2.5rem;
  padding-bottom: 40px;
}

/* Brand column */
.inn-marketing-footer__brand-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.inn-marketing-footer__brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inn-marketing-footer__emblem {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  object-fit: contain;
  opacity: 0.95;
}

.inn-marketing-footer__brand-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ui-marketing-footer-text);
}

.inn-marketing-footer__brand-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ui-marketing-footer-muted);
  max-width: 280px;
}

.inn-marketing-footer__mailto {
  display: inline-block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-marketing-footer-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

.inn-marketing-footer__mailto:hover {
  color: var(--ui-marketing-footer-link-hover);
}

/* Nav columns */
.inn-marketing-footer__nav-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.inn-marketing-footer__col-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ui-marketing-footer-text);
  opacity: 0.5;
}

.inn-marketing-footer__nav-col nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inn-marketing-footer__nav-link {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ui-marketing-footer-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

.inn-marketing-footer__nav-link:hover {
  color: var(--ui-marketing-footer-link-hover);
}

/* Meta/requisites list */
.inn-marketing-footer__meta-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ui-marketing-footer-muted);
}

/* Bottom bar */
.inn-marketing-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--ui-marketing-footer-border);
  flex-wrap: wrap;
}

.inn-marketing-footer__copyright {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ui-marketing-footer-muted);
}

.inn-marketing-footer__payments {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inn-marketing-footer__payments img {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.inn-marketing-footer__payments img:hover {
  opacity: 0.9;
}

.inn-marketing-footer .payment-logo-mir {
  width: 56px;
  height: 17px;
}

.inn-marketing-footer .payment-logo-visa {
  width: auto;
  height: 16px;
}

.inn-marketing-footer .payment-logo-mastercard {
  width: auto;
  height: 20px;
}

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 1023px) {
  .inn-marketing-footer__inner {
    padding: 40px 28px 24px;
  }

  .inn-marketing-footer__main {
    grid-template-columns: 1fr 1fr;
    padding-bottom: 32px;
  }

  .inn-marketing-footer__brand-col {
    grid-column: span 2;
  }

  .inn-marketing-footer__brand-desc {
    max-width: none;
  }
}

@media (max-width: 599px) {
  .inn-marketing-footer__inner {
    padding: 32px 20px 20px;
  }

  .inn-marketing-footer__main {
    grid-template-columns: 1fr;
  }

  .inn-marketing-footer__brand-col {
    grid-column: span 1;
  }

  .inn-marketing-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

.ui-page {
  max-width: none;
  width: min(calc(100% - (var(--ui-page-gutter) * 2)), var(--ui-page-max));
  margin: 0 auto;
}

.ui-page-main {
  padding: var(--ui-content-pad-y) 0 var(--ui-content-pad-bottom);
}

.ui-fluid-frame {
  width: min(calc(100% - (var(--ui-page-gutter) * 2)), var(--ui-page-max));
  margin: 0 auto;
}

.ui-shell-frame {
  width: 100%;
  max-width: var(--ui-page-max);
  margin: 0 auto;
  padding-left: var(--ui-shell-gutter);
  padding-right: var(--ui-shell-gutter);
}

.ui-page-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ui-page-header--split {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.ui-page-header--hero {
  align-items: center;
  text-align: center;
}

.ui-page-header__title {
  margin: 0;
  font-size: 2rem;
  line-height: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.ui-page-header__subtitle {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 0.95rem;
  line-height: 1.5rem;
}

.ui-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ui-summary-strip {
  display: grid;
  gap: 1rem;
}

.ui-summary-panel {
  min-height: 132px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  border-left: 4px solid transparent;
}

.ui-summary-panel--primary {
  border-left-color: var(--ui-primary);
}

.ui-summary-panel--success {
  border-left-color: var(--ui-success);
}

.ui-summary-panel--warning {
  border-left-color: var(--ui-warning);
}

.ui-summary-panel--muted {
  border-left-color: #8a98a9;
}

.ui-summary-panel__label {
  color: var(--ui-text-muted);
  font-size: 0.72rem;
  line-height: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.ui-summary-panel__value {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.ui-summary-panel__meta {
  font-size: 0.82rem;
  font-weight: 600;
}

.ui-summary-panel__progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf2f7;
}

.ui-summary-panel__progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.ui-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ui-section-header__title {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ui-section-header__subtitle {
  margin: 0.35rem 0 0;
  color: var(--ui-text-muted);
  font-size: 0.92rem;
  line-height: 1.5rem;
}

.ui-section-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ui-stack-32 {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.ui-stack-24 {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ui-grid-2 {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ui-grid-3 {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ui-grid-4 {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ui-card {
  background: var(--ui-surface);
  border: 0.5px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
}

.ui-panel {
  background: var(--ui-surface);
  border: 0.5px solid var(--ui-border);
  border-radius: var(--ui-radius);
  overflow: hidden;
}

.shell-notifications {
  position: relative;
}

.shell-notifications__trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8B97A8;
  transition: background-color 160ms ease, color 160ms ease;
}

.shell-notifications__trigger:hover,
.shell-notifications__trigger[aria-expanded="true"] {
  background: rgba(241, 245, 249, 0.9);
  color: #2178C9;
}

.shell-notifications__badge {
  position: absolute;
  top: 0.3rem;
  right: 0.32rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #2178C9;
  box-shadow: 0 0 0 2px #fff;
}

.shell-notifications__panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  width: min(24rem, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--ui-shadow-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 110;
  transform-origin: top right;
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  animation: ui-dropdown-in var(--duration-fast) var(--ease-out-quart);
  transition:
    opacity   var(--duration-fast) var(--ease-out-quart),
    transform var(--duration-fast) var(--ease-out-quart),
    visibility 0s linear 0s;
}

/* Closed state: тот же паттерн, что и у account-menu — opacity-fade
   с лёгким уходом вверх, display:none переопределяем. */
.shell-notifications__panel.hidden {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px) scale(0.98);
  animation: none;
  transition:
    opacity    var(--duration-fast) var(--ease-out-quart),
    transform  var(--duration-fast) var(--ease-out-quart),
    visibility 0s linear var(--duration-fast);
}

.shell-notifications__panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.shell-notifications__eyebrow {
  margin: 0 0 0.15rem;
  color: var(--ui-text-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shell-notifications__title {
  margin: 0;
  color: var(--ui-text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.shell-notifications__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  min-height: 1.6rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(212, 227, 255, 0.92);
  color: #2178C9;
  font-size: 0.7rem;
  font-weight: 800;
}

.shell-notifications__list {
  display: grid;
  gap: 0.55rem;
}

.shell-notifications__item {
  display: block;
  padding: 0.8rem 0.85rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.72);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.shell-notifications__item:hover {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(25, 96, 166, 0.18);
  transform: translateY(-1px);
}

.shell-notifications__item--critical {
  border-left: 3px solid rgba(220, 38, 38, 0.82);
}

.shell-notifications__item--warning {
  border-left: 3px solid rgba(217, 119, 6, 0.82);
}

.shell-notifications__item--neutral {
  border-left: 3px solid rgba(148, 163, 184, 0.7);
}

.shell-notifications__item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.shell-notifications__item-title {
  margin: 0;
  color: var(--ui-text);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.shell-notifications__item-meta {
  margin: 0;
  color: var(--ui-text-soft);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.shell-notifications__item-copy {
  margin: 0.32rem 0 0;
  color: var(--ui-text-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.shell-notifications__empty {
  padding: 0.75rem 0.1rem 0.25rem;
}

.shell-notifications__empty-title {
  margin: 0;
  color: var(--ui-text);
  font-size: 0.84rem;
  font-weight: 700;
}

.shell-notifications__empty-copy {
  margin: 0.25rem 0 0;
  color: var(--ui-text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.ui-panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 0.5px solid rgba(171, 179, 183, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ui-panel-body {
  padding: 1.5rem;
}

.ui-kicker {
  margin: 0;
  color: var(--ui-text-soft);
  font-size: 0.72rem;
  line-height: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.ui-title {
  margin: 0;
  font-size: 1.875rem;
  line-height: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.ui-subtitle {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 0.95rem;
  line-height: 1.5rem;
}

.ui-metric {
  padding: 1.5rem;
  min-height: 136px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ui-metric-value {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.ui-metric-meta {
  font-size: 0.82rem;
  font-weight: 600;
}

.ui-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf2f7;
}

.ui-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--ui-radius);
  border: 0.5px solid transparent;
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ui-btn:hover {
  transform: translateY(-1px);
}

.ui-btn-primary {
  background: var(--ui-primary);
  color: #f6f7ff;
}

.ui-btn-primary:hover {
  background: var(--ui-primary-dark);
}

.ui-btn-secondary {
  background: var(--ui-surface);
  color: var(--ui-text);
  border-color: var(--ui-border);
}

.ui-btn-secondary:hover {
  background: var(--ui-surface-muted);
}

.ui-btn-ghost {
  background: transparent;
  color: var(--ui-primary);
}

.ui-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 26px;
  padding: 0 var(--space-3);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
}

.ui-badge-success {
  background: var(--ui-success-soft);
  color: var(--ui-success);
}

.ui-badge-warning {
  background: var(--ui-warning-soft);
  color: var(--ui-warning);
}

.ui-badge-danger {
  background: var(--ui-danger-soft);
  color: var(--ui-danger);
}

.ui-badge-info {
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
}

.ui-alert {
  border-radius: 14px;
  padding: 1rem 1.1rem;
  border: 0.5px solid transparent;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.ui-alert-info {
  background: #f1f7ff;
  border-color: rgba(25, 96, 166, 0.16);
}

.ui-alert-warning {
  background: #fff8ef;
  border-color: rgba(217, 119, 6, 0.16);
}

.ui-alert-danger {
  background: #fff3f2;
  border-color: rgba(180, 35, 24, 0.16);
}

.ui-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.5rem;
  border: 0.5px dashed rgba(171, 179, 183, 0.8);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(241, 244, 246, 0.92));
}

.ui-state-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.ui-state-copy {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 0.92rem;
  line-height: 1.5rem;
}

.ui-skeleton {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #eef2f5 0%, #F5F8FB 50%, #eef2f5 100%);
  background-size: 200% 100%;
  animation: ui-skeleton-wave 1.6s linear infinite;
  border-radius: 10px;
}

.ui-skeleton-line {
  height: 14px;
}

.ui-skeleton-block {
  height: 110px;
}

/* Skeleton table-row для reports/billing/dashboard на время fetch.
   Используем как <tr class="ui-skeleton-row"><td colspan="N"></td></tr> ×5. */
.ui-skeleton-row td {
  padding: 14px 16px;
}
.ui-skeleton-row td > div {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef2f5 0%, #F5F8FB 50%, #eef2f5 100%);
  background-size: 200% 100%;
  animation: ui-skeleton-wave 1.6s linear infinite;
}
.ui-skeleton-row td:nth-child(2) > div { max-width: 70%; }
.ui-skeleton-row td:nth-child(3) > div { max-width: 50%; }

@keyframes ui-skeleton-wave {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes ui-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ui-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ui-slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Soft-motion: дополнительные keyframes ─────────────────────────────────
   Используются для модалок/драверов/тостов и плавного hide-without-snap.
   Старые ui-dropdown-in / ui-fade-in / ui-slide-up оставлены без изменений
   для обратной совместимости. */

@keyframes ui-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes ui-modal-out {
  from { opacity: 1; transform: translateY(0)    scale(1); }
  to   { opacity: 0; transform: translateY(4px)  scale(0.99); }
}

@keyframes ui-toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Auth verify-modal: когда .hidden убран и .flex добавлен — overlay fade-in,
   внутренняя панель slide-in. Кэптчим через :not(.hidden), потому что
   display:none не транзишинится. */
#verify-modal:not(.hidden) {
  animation: ui-fade-in var(--duration-base) var(--ease-out-quart);
}
#verify-modal:not(.hidden) > div {
  animation: ui-modal-in var(--duration-base) var(--ease-spring);
}

@keyframes ui-pulse-soft {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* Body-level fade-in убран после жалоб «страница мигает при переходе».
   Корень был в конфликте с View Transitions API: VT-snapshot новой страницы
   делался когда body keyframe только стартовал (opacity ≈ 0), и юзер видел
   белый «провал» между старой и новой страницами. View Transitions сами
   анимируют enter новой страницы через ui-vt-new-in (см. ниже), а в
   Safari/Firefox страница просто появляется без анимации — что лучше
   мигания. Старый ui-body-in keyframe оставлен для возможных будущих
   inline-вызовов через style.animation. */
@keyframes ui-body-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* View Transitions API — браузер сам делает cross-fade между страницами,
   если перехватили навигацию через document.startViewTransition. Мы только
   подменяем дефолтные duration/easing на наши tokens, чтобы переход
   укладывался в общий ритм интерфейса. */
@supports (view-transition-name: root) {
  /* Cross-document View Transitions для same-origin навигации.
     Chromium 126+ сам делает snapshot + cross-fade при переходе между
     страницами без участия JS. На неподдерживающих браузерах правило
     просто игнорируется — обычная навигация + progress bar.
     navigation: auto = браузер сам решает когда активировать VT;
     types: cross-document = метка чтобы можно было таргетировать
     специальные стили для межстраничных переходов отдельно от SPA. */
  @view-transition {
    navigation: auto;
  }

  /* Только opacity-cross-fade без translate/scale/blur. Любое движение
     по Y или scale при VT воспринимается как «страницу дёрнуло за верёвку»,
     потому что снапшот старой страницы и новой одновременно анимируются
     поверх вьюпорта. Чистый fade — самое нейтральное, что можно сделать. */
  @keyframes ui-vt-old-out { to   { opacity: 0; } }
  @keyframes ui-vt-new-in  { from { opacity: 0; } }

  ::view-transition-old(root) {
    animation: ui-vt-old-out 140ms linear both;
  }
  ::view-transition-new(root) {
    animation: ui-vt-new-in 180ms linear both;
  }

  /* Persist shell: шапка и футер не должны перерисовываться при каждом
     переходе. Получают свой именованный transition с opacity-only fade
     (без translate — иначе они «прыгают» на месте). */
  .shell-header,
  [data-shell-header],
  footer[data-shell-footer],
  footer.inn-marketing-footer {
    view-transition-name: shell-persistent;
  }
  ::view-transition-old(shell-persistent),
  ::view-transition-new(shell-persistent) {
    animation: ui-fade-in 140ms linear;
  }

  /* Sidebar (на страницах с .ui-app-sidebar — settings, company) тоже
     persistent: переключение между разделами не должно дёргать nav. */
  .ui-app-sidebar {
    view-transition-name: app-sidebar;
  }
  ::view-transition-old(app-sidebar),
  ::view-transition-new(app-sidebar) {
    animation: ui-fade-in 140ms linear;
  }
}

/* ── Sticky save bar ─────────────────────────────────────────────────────
   Полоса снизу viewport, всплывает когда в форме есть unsaved changes.
   Активируется через body.has-unsaved классы. Содержимое (счётчик
   изменений + кнопки) рендерит конкретная страница через div.ui-save-bar.
   В пейдже-React можно просто условно показывать <div class="ui-save-bar">
   когда формы dirty — visibility/transform управляются здесь. */
.ui-save-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  z-index: 950;
  margin: 0 auto;
  width: min(640px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border-strong);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity    var(--duration-base) var(--ease-out-quart),
    transform  var(--duration-base) var(--ease-spring),
    visibility 0s linear var(--duration-base);
}
.ui-save-bar.is-revealed {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition:
    opacity    var(--duration-base) var(--ease-out-quart),
    transform  var(--duration-base) var(--ease-spring),
    visibility 0s linear 0s;
}
.ui-save-bar__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ui-text);
  font-weight: 500;
}
.ui-save-bar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ui-warning);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.14);
}
.ui-save-bar__actions { display: inline-flex; gap: 8px; }

/* ── Top progress bar для page navigation ─────────────────────────────────
   Работает во ВСЕХ браузерах (не только Chromium): тонкая полоса 2px вверху
   страницы, синяя градиентная заливка, плавно растёт во время перехода.
   Управление — через JS в shared/layout.js (классы add/remove на body). */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 9999;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms var(--ease-out-quart);
}

.nav-progress::before {
  content: '';
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,
    var(--ui-primary) 0%,
    color-mix(in srgb, var(--ui-primary) 60%, transparent) 50%,
    var(--ui-primary) 100%);
  background-size: 200% 100%;
  box-shadow: 0 0 8px var(--ui-primary);
  /* Кривая ease-out-expo: быстро стартует, замедляется к 90% — даёт
     ощущение «почти готово», даже если страница ещё грузится. */
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
  animation: nav-progress-shimmer 1.4s linear infinite;
}

@keyframes nav-progress-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

body.nav-progress-active .nav-progress {
  opacity: 1;
}
body.nav-progress-active .nav-progress::before {
  width: 88%;
}
body.nav-progress-done .nav-progress {
  opacity: 0;
  transition: opacity 200ms var(--ease-out-quart) 120ms;
}
body.nav-progress-done .nav-progress::before {
  width: 100%;
  transition: width 160ms var(--ease-out-quart);
}

/* ── Soft-hidden утилита ──────────────────────────────────────────────────
   Замена `display: none` для модалок/дропдаунов/алертов: плавно гасим
   opacity + visibility + transform, потом скрываем по visibility (а не по
   display, иначе HTML-flow дёрнется). Использование:
     <div class="js-modal is-revealed">…</div>   // показано
     <div class="js-modal">…</div>                // спрятано
   В JS: el.classList.toggle("is-revealed", show).
   Если нужен мгновенный hide без анимации — можно дополнительно поставить
   .is-instant и сбросить transition. */
.soft-hidden,
[data-soft-hidden] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity     var(--duration-fast) var(--ease-out-quart),
    transform   var(--duration-fast) var(--ease-out-quart),
    visibility  0s linear var(--duration-fast);
}

.soft-hidden.is-revealed,
[data-soft-hidden].is-revealed {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity     var(--duration-fast) var(--ease-out-quart),
    transform   var(--duration-fast) var(--ease-out-quart),
    visibility  0s;
}

/* ── Stagger utility: плавное появление списков по очереди ─────────────────
   Применение: добавить .ui-stagger на родителя (tbody / ul / .grid). Каждый
   прямой потомок (≤20) появится с шагом 30мс. Старается работать «дёшево»:
   только opacity + translateY, без layout-thrash.

   Ограничение: фиксированные nth-child(1..20) — для длинных списков (50+)
   stagger вырождается в одновременное появление последних строк, что
   как раз ОК (длинная пачка не должна играть полминуты). */
.ui-stagger > * {
  opacity: 0;
  transform: translateY(6px);
  animation: ui-slide-up var(--duration-base) var(--ease-out-quart) forwards;
}
.ui-stagger > *:nth-child(1)  { animation-delay: 20ms;  }
.ui-stagger > *:nth-child(2)  { animation-delay: 50ms;  }
.ui-stagger > *:nth-child(3)  { animation-delay: 80ms;  }
.ui-stagger > *:nth-child(4)  { animation-delay: 110ms; }
.ui-stagger > *:nth-child(5)  { animation-delay: 140ms; }
.ui-stagger > *:nth-child(6)  { animation-delay: 170ms; }
.ui-stagger > *:nth-child(7)  { animation-delay: 200ms; }
.ui-stagger > *:nth-child(8)  { animation-delay: 230ms; }
.ui-stagger > *:nth-child(9)  { animation-delay: 260ms; }
.ui-stagger > *:nth-child(10) { animation-delay: 290ms; }
.ui-stagger > *:nth-child(11) { animation-delay: 320ms; }
.ui-stagger > *:nth-child(12) { animation-delay: 350ms; }
.ui-stagger > *:nth-child(13) { animation-delay: 380ms; }
.ui-stagger > *:nth-child(14) { animation-delay: 410ms; }
.ui-stagger > *:nth-child(15) { animation-delay: 440ms; }
.ui-stagger > *:nth-child(n+16) { animation-delay: 470ms; }

/* ── prefers-reduced-motion ───────────────────────────────────────────────
   Полностью убираем transform/scale/translate, оставляем opacity-only
   (короткий duration), чтобы пользователи с вестибулярной чувствительностью
   всё равно видели state-change, но без «уезжающих» элементов. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .soft-hidden,
  [data-soft-hidden],
  .ui-skeleton {
    transition-duration: 150ms !important;
  }
}

.ui-table {
  width: 100%;
  border-collapse: collapse;
}

.ui-table th {
  font-size: var(--text-xs);
  color: var(--ui-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  background: rgba(241, 244, 246, 0.72);
}

.ui-table th,
.ui-table td {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  border-bottom: 0.5px solid rgba(171, 179, 183, 0.18);
}

.ui-table tr:last-child td {
  border-bottom: 0;
}

.ui-table tbody tr td {
  transition: background-color var(--duration-instant) var(--ease-out-quart);
}

.ui-table tr:hover td {
  background: rgba(241, 244, 246, 0.55);
}

.ui-empty-hero {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
}

.ui-footer-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

@media (max-width: 1100px) {
  .ui-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ui-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --ui-page-gutter: 1rem;
    --ui-shell-gutter: 1rem;
  }

  .shell-header__inner {
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
  }

  .shell-header__nav {
    display: none;
  }


  .ui-page-header--split {
    flex-direction: column;
  }

  .ui-grid-2,
  .ui-grid-4 {
    grid-template-columns: 1fr;
  }

  .ui-title {
    font-size: 1.5rem;
    line-height: 1.9rem;
  }

  .ui-page-header__title {
    font-size: 1.5rem;
    line-height: 1.9rem;
  }

  .ui-panel-header,
  .ui-panel-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Адаптивный масштаб на больших экранах: вёрстка фиксированная (px/rem), иначе на крупных
   мониторах всё мелкое. zoom на .inn-shell-stack масштабирует контент и навбар; порталы шелла
   (дропдауны уведомлений/аккаунта, тост) остаются в body — позиционируются по визуальным
   координатам якоря через getBoundingClientRect и НЕ смещаются (проверено эмпирически),
   просто рендерятся нативного размера. */
@media (min-width: 1700px) { .inn-shell-stack { zoom: 1.10; } }
@media (min-width: 2000px) { .inn-shell-stack { zoom: 1.18; } }
@media (min-width: 2560px) { .inn-shell-stack { zoom: 1.30; } }
@media (min-width: 3200px) { .inn-shell-stack { zoom: 1.45; } }

/* ════════════════════════════════════════════════════════════════════════
   MOBILE FOUNDATION  (shared, added in the responsive pass)
   Everything below is scoped to ≤767.98px and must NOT affect desktop ≥768px.
   Page-local stylesheets build on the helper classes defined here.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Visibility utilities (work at any width) ──────────────────────────── */
.ui-only-mobile { display: none; }
@media (max-width: 767.98px) {
  .ui-only-desktop { display: none !important; }
  .ui-only-mobile { display: revert; }
  .ui-only-mobile.ui-only-mobile--flex { display: flex; }
}

/* ── Responsive table helpers (use one per data table) ─────────────────── */
/* (a) horizontal scroll — keep table intact, scroll inside its own box */
.ui-table--responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ui-table--responsive:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; }

/* ── Global keyboard focus ring (a11y, WCAG 2.4.7 / 2.4.11) ────────────────
   Видимое фокус-кольцо на всём интерактиве. :focus-visible показывается ТОЛЬКО
   при навигации с клавиатуры — мышиные клики/тач не затрагиваются. Страницы
   могут переопределить точечно более специфичным селектором. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[role="link"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ui-primary);
  outline-offset: 2px;
}
/* (b) stacked cards — each row becomes a card; add data-label="<header>" to every <td> */
@media (max-width: 767.98px) {
  .ui-table--cards thead {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .ui-table--cards,
  .ui-table--cards tbody,
  .ui-table--cards tr,
  .ui-table--cards td { display: block; width: 100%; }
  .ui-table--cards tr {
    border: 0.5px solid var(--ui-border);
    border-radius: 12px;
    margin-bottom: 12px;
    background: var(--ui-surface);
    overflow: hidden;
  }
  .ui-table--cards td {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 14px; padding: 10px 14px; text-align: right;
    border: 0; border-bottom: 0.5px solid rgba(171, 179, 183, 0.18);
  }
  .ui-table--cards tr td:last-child { border-bottom: 0; }
  .ui-table--cards td::before {
    content: attr(data-label);
    font-weight: 600; color: var(--ui-text-muted);
    text-align: left; flex: 0 0 auto;
  }
  .ui-table--cards td[data-label=""]::before { content: none; }

  /* (b2) тот же карточный паттерн для div-grid «таблиц» React-страниц
     (раскладка колонок задана inline style={{display:'grid',…}}, поэтому
     здесь нужен !important — иначе inline-стили побеждают).
     Разметка: контейнер получает .ui-table--cards, строка-шапка —
     .ui-table-cards__head, строка данных — .ui-table-cards__row, каждая
     ячейка — .ui-table-cards__cell + data-label="<заголовок колонки>".
     В отличие от <tr>-варианта строка НЕ становится отдельной карточкой:
     div-таблицы уже живут внутри карточки-контейнера со своей шапкой,
     карточка-в-карточке дала бы двойные рамки. Строки разделяются своим
     существующим border-bottom. */
  .ui-table--cards .ui-table-cards__head { display: none !important; }
  .ui-table--cards .ui-table-cards__row {
    display: block !important;
    width: 100% !important;
    padding: 4px 0 !important;
  }
  .ui-table--cards .ui-table-cards__cell {
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline;
    justify-content: space-between !important;
    gap: 14px;
    width: 100%;
    padding: 6px 16px !important;
    text-align: right;
    font-size: 14px !important;
    /* длинные названия компаний переносятся по словам, не по буквам */
    overflow-wrap: anywhere;
  }
  .ui-table--cards .ui-table-cards__cell::before {
    content: attr(data-label);
    font-weight: 600; color: var(--ui-text-muted);
    text-align: left; flex: 0 0 auto;
  }
  .ui-table--cards .ui-table-cards__cell[data-label=""]::before { content: none; }

  /* (b3) ячейка-действия (общая для <td> и div-варианта): ссылки/кнопки
     строки складываются колонкой во всю ширину с тап-таргетом ≥44px.
     Метка (data-label) остаётся первой строкой, как в /reports/. */
  .ui-table--cards .ui-table-cards__actions {
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    text-align: left !important;
    white-space: normal !important;
  }
  .ui-table--cards .ui-table-cards__actions a,
  .ui-table--cards .ui-table-cards__actions button,
  .ui-table--cards .ui-table-cards__actions [aria-disabled="true"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px;
    padding: 0 14px !important;
    margin: 0 !important;
    border: 0.5px solid var(--ui-border) !important;
    border-radius: 8px;
    font-size: 14px !important;
    text-decoration: none !important;
  }
}

/* ── Off-canvas page sidebar primitive (e.g. company sections) ─────────── */
/* Page wires a toggle button that sets [data-mobile-open="true"] + a backdrop. */
.ui-sidebar-backdrop { display: none; }
@media (max-width: 767.98px) {
  .ui-app-sidebar.ui-app-sidebar--offcanvas {
    position: fixed; top: 52px; bottom: 0; left: 0;
    width: min(86vw, 320px);
    transform: translateX(-100%);
    transition: transform 0.28s var(--ease-out-quart, ease);
    z-index: 1200;
    box-shadow: 0 18px 44px rgba(18, 35, 52, 0.22);
    will-change: transform;
  }
  .ui-app-sidebar.ui-app-sidebar--offcanvas[data-mobile-open="true"] { transform: translateX(0); }
  .ui-sidebar-backdrop {
    display: block; position: fixed; inset: 52px 0 0 0;
    background: rgba(15, 23, 42, 0.42); z-index: 1199;
    opacity: 0; pointer-events: none; transition: opacity 0.28s ease;
  }
  .ui-sidebar-backdrop[data-mobile-open="true"] { opacity: 1; pointer-events: auto; }
  /* alternative: horizontal tab strip for short section lists */
  .ui-app-sidebar.ui-app-sidebar--tabs {
    position: static; width: 100%; flex: 0 0 auto;
    display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
    gap: 6px; padding: 6px 0; border-bottom: 0.5px solid var(--ui-border);
  }
  .ui-app-sidebar.ui-app-sidebar--tabs .ui-app-sidebar__scroll { display: flex; gap: 6px; }
}

/* ── Hamburger / toggle button (44px tap target) ───────────────────────── */
.ui-nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0.5px solid var(--ui-border);
  border-radius: var(--ui-radius); background: var(--ui-surface);
  color: var(--ui-text); cursor: pointer;
}

/* ── Global mobile safeguards ──────────────────────────────────────────── */
@media (max-width: 767.98px) {
  /* media never breaks layout width */
  img, svg, video, canvas, iframe { max-width: 100%; }
  /* prevent iOS auto-zoom on focus (16px min), low specificity so pages can opt out */
  :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"])),
  :where(select),
  :where(textarea) { font-size: 16px; }
  /* comfortable tap targets for small interactive controls */
  .ui-icon-btn, .ui-chip, .ui-tab, .ui-app-sidebar__nav-inner a, .ui-footer-links a {
    min-height: 44px;
  }
  /* fluid main headings */
  .ui-title { font-size: clamp(1.25rem, 5.2vw, 1.5rem); line-height: 1.25; }
  .ui-page-header__title { font-size: clamp(1.25rem, 5.2vw, 1.5rem); line-height: 1.25; }
  /* tighter card padding on phones */
  .ui-card { padding: var(--space-4); }
  /* full-width primary actions read better on phones */
  .ui-btn--block-mobile { width: 100%; }
}
