/* ==========================================================================
   Shinta — новый интерфейс (дизайн-система)
   Каркас: templates/app/base.html. Страницы на новом дизайне наследуют его.
   ========================================================================== */

/* ---------- Токены ---------- */
:root {
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --brand: #4c6fff;
  --brand-hover: #3d5ef0;
  --brand-soft: #eef1ff;
  --brand-soft-text: #2f4fd6;
  /* фирменный градиент из логотипа: бирюза -> синий */
  --grad-1: #17c9b4;
  --grad-2: #4c6fff;
  --brand-grad: linear-gradient(120deg, var(--grad-1), var(--grad-2));

  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-hover: #f1f3f9;
  --border: #e6e8f0;
  --border-strong: #d3d7e3;

  --text: #161a2e;
  --text-2: #5b6178;
  --text-3: #8e93a8;

  --success: #16a34a;
  --success-soft: #e8f7ee;
  --warning: #d97706;
  --warning-soft: #fff4e0;
  --danger: #e5484d;
  --danger-soft: #fdecec;

  --sidebar-bg: #11101d;
  --sidebar-text: #a3a6bd;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, .06);
  --sidebar-active: rgba(76, 111, 255, .22);
  --sidebar-section: #5f6280;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(22, 26, 46, .05);
  --shadow: 0 1px 2px rgba(22, 26, 46, .04), 0 4px 16px rgba(22, 26, 46, .06);
  --shadow-lg: 0 12px 40px rgba(22, 26, 46, .16);

  --sidebar-w: 256px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;

  /* полосы прокрутки: «таблетка» с насечкой посередине (как в старом дизайне) */
  --sb-thumb: #cdd2e0;
  --sb-thumb-hover: #b3b9cc;
  --sb-grip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='7'%3E%3Cpath d='M0 .5h6M0 3.5h6M0 6.5h6' stroke='%23fff' stroke-opacity='.95'/%3E%3C/svg%3E");
  --sb-grip-h: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='6'%3E%3Cpath d='M.5 0v6M3.5 0v6M6.5 0v6' stroke='%23fff' stroke-opacity='.95'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
  --brand: #6b87ff;
  --brand-hover: #819aff;
  --brand-soft: rgba(107, 135, 255, .14);
  --brand-soft-text: #a9b9ff;
  --grad-1: #22d8c2;
  --grad-2: #6b87ff;

  --bg: #0d0e17;
  --surface: #161826;
  --surface-2: #1b1d2d;
  --surface-hover: #212438;
  --border: #272a3d;
  --border-strong: #353950;

  --text: #eceef8;
  --text-2: #a6aac2;
  --text-3: #6f7390;

  --success: #34c26b;
  --success-soft: rgba(52, 194, 107, .14);
  --warning: #f5a524;
  --warning-soft: rgba(245, 165, 36, .14);
  --danger: #f2555a;
  --danger-soft: rgba(242, 85, 90, .14);

  --sidebar-bg: #0a0b13;

  --shadow-sm: none;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .02);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);

  /* полосы прокрутки */
  --sb-thumb: #3a3e57;
  --sb-thumb-hover: #4d5274;
  --sb-grip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='7'%3E%3Cpath d='M0 .5h6M0 3.5h6M0 6.5h6' stroke='%23fff' stroke-opacity='.35'/%3E%3C/svg%3E");
  --sb-grip-h: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='6'%3E%3Cpath d='M.5 0v6M3.5 0v6M6.5 0v6' stroke='%23fff' stroke-opacity='.35'/%3E%3C/svg%3E");

  color-scheme: dark;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Полосы прокрутки ----------
   Chrome, Edge, Safari - ::-webkit-scrollbar (стандартные scrollbar-width / scrollbar-color его отключают, поэтому
   их не задаём нигде, кроме Firefox). Цвета - переменные --sb-* темы, у тёмного меню - свои */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb {
  min-height: 36px; min-width: 36px;
  border: 2px solid transparent; border-radius: 99px; background-clip: padding-box;
  background-color: var(--sb-thumb); background-image: var(--sb-grip);
  background-position: center; background-repeat: no-repeat;
}
::-webkit-scrollbar-thumb:horizontal { background-image: var(--sb-grip-h); }
::-webkit-scrollbar-thumb:hover { background-color: var(--sb-thumb-hover); }
::-webkit-scrollbar-thumb:active { background-color: var(--brand); }
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; }
}
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Каркас ---------- */
.app { display: flex; min-height: 100vh; }

.app-sidebar {
  --sb-thumb: rgba(255, 255, 255, .12); --sb-thumb-hover: rgba(255, 255, 255, .22);
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  transition: transform .25s var(--ease), width .2s var(--ease);
}
.app-sidebar__logo { display: flex; align-items: center; height: var(--topbar-h); padding: 0 22px; flex-shrink: 0; }
/* в свёрнутом меню от логотипа остаётся только значок (левая часть картинки) */
.app-sidebar__logo-clip { display: block; overflow: hidden; width: 90px; transition: width .2s var(--ease); }
.app-sidebar__logo img { display: block; height: 26px; width: auto; max-width: none; }
.app-sidebar__nav { flex: 1; overflow-x: hidden; overflow-y: auto; padding: 8px 12px 24px; }
.app-sidebar__footer { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .06); }

.nav-section {
  margin: 18px 10px 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--sidebar-section);
}
/* группы меню (аккордеон): заголовок - кнопка, пункты видны у открытой группы */
.nav-section--toggle {
  display: flex; align-items: center; justify-content: space-between; width: calc(100% - 20px);
  padding: 0; border: 0; background: none; font-family: inherit; text-align: left; cursor: pointer;
  transition: color .15s;
}
.nav-section--toggle:hover { color: var(--sidebar-text-active); }
.nav-group__chevron { font-size: 16px; transition: transform .2s var(--ease); }
.nav-group.is-open .nav-group__chevron { transform: rotate(180deg); }
.nav-group__icon, .nav-group__title { display: none; }
.nav-group:not(.is-open) .nav-group__items { display: none; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link i { font-size: 20px; flex-shrink: 0; }
.nav-link span { white-space: nowrap; }
.nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
.nav-link.is-active { background: var(--sidebar-active); color: var(--sidebar-text-active); }
.nav-link.is-active i { color: #8ea3ff; }
.nav-link .nav-badge {
  margin-left: auto; padding: 1px 7px; border-radius: 99px;
  font-size: 10px; font-weight: 700; background: var(--brand); color: #fff;
}

.app-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; transition: margin-left .2s var(--ease); }

/* ---------- Свёрнутое меню (только иконки) — на компьютере ---------- */
@media (min-width: 1025px) {
  .nav-collapsed .app-sidebar { width: var(--sidebar-w-collapsed); }
  .nav-collapsed .app-main { margin-left: var(--sidebar-w-collapsed); }
  .nav-collapsed .app-sidebar__logo-clip { width: 28px; }
  .nav-collapsed .nav-section { height: 1px; margin: 14px 10px; overflow: hidden; color: transparent; background: rgba(255, 255, 255, .08); }
  /* группа - один значок, пункты - поп-ап справа при наведении (меню короткое, без прокрутки) */
  .nav-collapsed .app-sidebar__nav { overflow: visible; }
  .nav-collapsed .nav-group { position: relative; }
  .nav-collapsed .nav-section--toggle {
    display: flex; justify-content: center; width: 100%; height: auto; margin: 0 0 2px; padding: 10px 0;
    border-radius: var(--radius-sm); overflow: visible; background: none;
    color: var(--sidebar-text); text-transform: none; letter-spacing: 0; cursor: default;
  }
  .nav-collapsed .nav-section--toggle span, .nav-collapsed .nav-group__chevron { display: none; }
  .nav-collapsed .nav-group__icon { display: block; font-size: 20px; }
  .nav-collapsed .nav-group:hover .nav-section--toggle,
  .nav-collapsed .nav-group:focus-within .nav-section--toggle { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
  .nav-collapsed .nav-group.has-active .nav-section--toggle { background: var(--sidebar-active); color: var(--sidebar-text-active); }
  .nav-collapsed .nav-group.has-active .nav-group__icon { color: #8ea3ff; }
  .nav-collapsed .nav-group .nav-group__items {
    display: none; position: absolute; top: -6px; left: 100%; z-index: 50;
    min-width: 220px; padding: 6px; margin-left: 18px;
    border-radius: var(--radius); background: var(--sidebar-bg); box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, .08);
  }
  /* мостик через зазор, чтобы поп-ап не закрывался по пути мыши */
  .nav-collapsed .nav-group .nav-group__items::before { content: ''; position: absolute; top: 0; bottom: 0; left: -20px; width: 20px; }
  .nav-collapsed .nav-group:hover .nav-group__items,
  .nav-collapsed .nav-group:focus-within .nav-group__items { display: block; }
  .nav-collapsed .nav-group__title {
    display: block; padding: 6px 10px 8px;
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sidebar-section);
  }
  .nav-collapsed .nav-group__items .nav-link { justify-content: flex-start; padding: 9px 10px; }
  .nav-collapsed .nav-group__items .nav-link span { display: inline; }
  .nav-collapsed .nav-group__items .nav-link .nav-badge {
    display: inline-block; position: static; width: auto; height: auto; padding: 1px 7px; font-size: 10px;
  }
  .nav-collapsed .nav-link { justify-content: center; padding: 10px 0; }
  .nav-collapsed .nav-link span { display: none; }
  .nav-collapsed .nav-link { position: relative; }
  .nav-collapsed .nav-link .nav-badge {
    display: block; position: absolute; top: 6px; right: 8px;
    width: 8px; height: 8px; padding: 0; font-size: 0;
  }
}

.app-topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.app-topbar__title { font-size: 15px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.app-content { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px; }

.balance-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 6px 0 12px;
  border: 1px solid var(--border); border-radius: 99px; background: var(--surface);
  font-weight: 600; font-size: 13px; color: var(--text);
}
.balance-pill .btn { height: 26px; padding: 0 10px; font-size: 12px; }

/* мой тариф в шапке (как balance-pill): «Мои файлы» */
.plan-pill {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  height: 36px; padding: 0 6px 0 12px;
  border: 1px solid var(--border); border-radius: 99px; background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--text);
  transition: border-color .15s;
}
.plan-pill:hover { border-color: var(--brand); }
.plan-pill > i { font-size: 18px; color: var(--brand); }
.plan-pill.is-free > i { color: var(--text-3); }
.plan-pill__label { color: var(--text-3); font-weight: 500; }
.plan-pill b { overflow: hidden; text-overflow: ellipsis; }
.plan-pill__days { color: var(--text-2); font-weight: 500; }
.plan-pill__days.is-soon { color: var(--warning); font-weight: 700; }
.plan-pill .btn { height: 26px; padding: 0 10px; font-size: 12px; }

.app-backdrop { display: none; }

@media (max-width: 1024px) {
  .app-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .app.is-nav-open .app-sidebar { transform: none; }
  .app.is-nav-open .app-backdrop {
    display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10, 11, 19, .45);
  }
  .app-main { margin-left: 0; }
  .app-topbar { padding: 0 16px; }
  .app-content { padding: 20px 16px; }
  .hide-mobile { display: none !important; }
}

/* ---------- Заголовок страницы ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 26px; line-height: 1.25; }
.page-head p { margin-top: 6px; color: var(--text-2); max-width: 640px; }
.page-head__meta { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn i { font-size: 18px; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(76, 111, 255, .3); }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.94); color: #fff; }
.btn-grad { background: var(--brand-grad); color: #fff; box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--grad-2) 70%, transparent); }
.btn-grad:hover { color: #fff; filter: brightness(1.06); }
.btn-soft { background: var(--brand-soft); color: var(--brand-soft-text); }
.btn-soft:hover { filter: brightness(.97); color: var(--brand-soft-text); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--surface-hover); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }

.btn.is-loading::after {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Карточки ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title i { font-size: 20px; color: var(--brand); }
.card-body { padding: 20px; }

/* ---------- Бейджи ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 99px; white-space: nowrap;
  font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.badge i { font-size: 14px; }
.badge-brand { background: var(--brand-soft); color: var(--brand-soft-text); border-color: transparent; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ---------- Формы ---------- */
.field + .field { margin-top: 20px; }
.field-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--text);
}
.field-label .hint { font-weight: 500; color: var(--text-3); }
.field-help { margin-top: 6px; font-size: 12px; color: var(--text-3); }

.input {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input::placeholder { color: var(--text-3); }
.input-group { display: flex; align-items: center; gap: 8px; }
.input-group .sep { color: var(--text-3); }

/* сегментированный переключатель */
.segmented {
  display: flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.segmented button {
  flex: 1; height: 32px; padding: 0 8px;
  border: 0; border-radius: 7px; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(22, 26, 46, .12); }
:root[data-theme="dark"] .segmented button.is-active { background: var(--surface-hover); }

/* чипы */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 30px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 99px; background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--text-2); cursor: pointer;
  transition: all .15s;
}
a.chip { display: inline-flex; align-items: center; text-decoration: none; }  /* чип-ссылка (полоска разделов админки) - как кнопка */
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-soft-text); }

/* переключатель */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  position: relative; flex-shrink: 0; width: 40px; height: 22px; border-radius: 99px;
  background: var(--border-strong); transition: background .2s;
}
.switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  transition: transform .2s var(--ease);
}
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch__text { font-size: 13px; font-weight: 700; }
.switch__text small { display: block; font-weight: 500; color: var(--text-3); font-size: 12px; }

/* ползунок */
.range { width: 100%; accent-color: var(--brand); height: 20px; }

/* ---------- Выпадающее меню ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  min-width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.dropdown.is-open .dropdown-menu { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 7px; background: none;
  font-size: 13px; font-weight: 500; color: var(--text); text-align: left; cursor: pointer;
}
.dropdown-item i { font-size: 18px; color: var(--text-3); }
.dropdown-item:hover { background: var(--surface-hover); color: var(--text); }
.dropdown-divider { height: 1px; margin: 6px 0; background: var(--border); }

/* ---------- Модальное окно ----------
   <div class="modal" hidden><div class="modal__backdrop" data-close></div><div class="modal__card">...</div></div> */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(10, 11, 19, .5); animation: fade .2s; }
.modal__card {
  position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 28px;
  border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); animation: pop .2s var(--ease);
}
.modal__card--wide { max-width: 640px; }
.modal__card h3 { font-size: 20px; }
.modal__card > p { margin-top: 6px; font-size: 14px; }
.modal__close { position: absolute; top: 14px; right: 14px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Уведомления ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 40px); }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  width: 360px; max-width: 100%; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: toast-in .25s var(--ease);
}
.toast { cursor: pointer; }
.toast i { font-size: 20px; flex-shrink: 0; }
.toast--success i { color: var(--success); }
.toast--error i { color: var(--danger); }
.toast--info i { color: var(--brand); }
.toast.is-hiding { opacity: 0; transform: translateY(8px); transition: all .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Пустое состояние ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 40px 20px; color: var(--text-2);
}
.empty i { font-size: 36px; color: var(--text-3); }
.empty strong { color: var(--text); font-size: 15px; }

/* ---------- Скелетон ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Колокольчик: новости и уведомления (static/js/app/news.js) ---------- */
.news > .btn { position: relative; }
.news__badge {
  position: absolute; top: 9px; right: 10px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg);
}
.news__panel { width: 380px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.news__head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.news__head b { font-size: 15px; }
.news__head span { font-size: 12px; }
.news__list { max-height: min(520px, calc(100vh - 140px)); overflow-y: auto; }
.news__empty { padding: 28px 16px; text-align: center; }
.news__item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.news__item:last-child { border-bottom: 0; }
.news__item.is-unread { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.news__item.is-unread .news__title::before {
  content: ''; display: inline-block; width: 7px; height: 7px; margin: 0 7px 2px 0;
  border-radius: 50%; background: var(--brand); vertical-align: middle;
}
.news__icon { flex-shrink: 0; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--success-soft); color: var(--success); font-size: 20px; }
.news__body { min-width: 0; flex: 1; }
.news__title { font-weight: 700; font-size: 13px; }
.news__text { margin-top: 4px; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.news__text a { text-decoration: underline; }
.news__action { margin-top: 10px; }
.news__date { margin-top: 6px; font-size: 11px; }
@media (max-width: 1024px) {
  .news { position: static; }
  .news__panel { right: 12px; left: 12px; width: auto; max-width: none; top: calc(var(--topbar-h) - 4px); }
}

/* ---------- Окно «Подключено» после покупки (Shinta.congrats в app.js) ---------- */
.congrats { overflow: hidden; z-index: 120; }
.congrats__card { max-width: 480px; text-align: center; padding-top: 32px; z-index: 1; }
.congrats__emoji { font-size: 52px; line-height: 1; margin-bottom: 10px; animation: congrats-pop .6s var(--ease) both; }
.congrats__item {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 14px;
  border-radius: 999px; background: var(--brand-soft); color: var(--brand-soft-text); font-size: 14px;
}
.congrats__item i { font-size: 20px; }
.congrats__card > p { margin-top: 14px; }
.congrats__list { margin: 12px 0 0; padding: 0; list-style: none; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.congrats__list li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.congrats__list i { flex: none; margin-top: 1px; font-size: 18px; color: var(--success); }
.congrats .modal__actions { justify-content: center; flex-wrap: wrap; }

/* парящие иконки и эмодзи по бокам окна */
.congrats__float { position: absolute; inset: 0; pointer-events: none; }
.congrats__fi, .congrats__fe { position: absolute; animation: congrats-float 6s ease-in-out infinite; opacity: .9; }
.congrats__fi { font-size: 44px; color: #fff; text-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.congrats__fe { font-size: 40px; }
.congrats__fi--1 { left: 8%;  top: 14%; color: #ffd166; }
.congrats__fi--2 { left: 16%; top: 62%; color: #a78bfa; animation-delay: -1.2s; font-size: 56px; }
.congrats__fi--3 { left: 4%;  top: 84%; color: #60a5fa; animation-delay: -2.4s; }
.congrats__fi--4 { left: 20%; top: 34%; color: #fbbf24; animation-delay: -3.6s; font-size: 34px; }
.congrats__fi--5 { right: 8%;  top: 16%; color: #f472b6; animation-delay: -.6s; font-size: 56px; }
.congrats__fi--6 { right: 18%; top: 70%; color: #fb7185; animation-delay: -1.8s; }
.congrats__fi--7 { right: 4%;  top: 46%; color: #34d399; animation-delay: -3s; font-size: 34px; }
.congrats__fi--8 { right: 14%; top: 88%; color: #4ade80; animation-delay: -4.2s; }
.congrats__fe--1 { left: 26%; top: 8%;  animation-delay: -.9s; }
.congrats__fe--2 { left: 9%;  top: 44%; animation-delay: -2.7s; }
.congrats__fe--3 { right: 24%; top: 6%;  animation-delay: -1.5s; }
.congrats__fe--4 { right: 9%;  top: 32%; animation-delay: -3.9s; }
@keyframes congrats-float {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-18px) rotate(6deg); }
}
@keyframes congrats-pop { 0% { transform: scale(.3) rotate(-20deg); opacity: 0; } 70% { transform: scale(1.15) rotate(6deg); } }
@media (max-width: 720px) {
  .congrats__fi, .congrats__fe { font-size: 28px; opacity: .6; }
}
@media (prefers-reduced-motion: reduce) {
  .congrats__fi, .congrats__fe, .congrats__emoji { animation: none; }
}
