/* =====================================================================
   GSM Rent — дизайн-система.
   Две темы (html[data-theme="dark|light"]) на одних токенах, мягкие
   анимации, уважение к prefers-reduced-motion. Ни одного цвета вне
   токенов в компонентах.
   ===================================================================== */

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono', Menlo, Consolas, monospace;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: .15s;
  --t: .25s;

  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --grad: linear-gradient(135deg, #7c5cff 0%, #5b8cff 55%, #22d3ee 100%);
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --info: #38bdf8;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08090d;
  --bg-2: #0d0f14;
  --surface: #111319;
  --surface-2: #161922;
  --surface-3: #1c2029;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #eceef3;
  --text-2: #b9bfcc;
  --muted: #858c9c;
  --accent-soft: rgba(124, 92, 255, .14);
  --accent-ink: #b4a3ff;
  --ok-soft: rgba(34, 197, 94, .13);
  --ok-ink: #4ade80;
  --warn-soft: rgba(245, 158, 11, .14);
  --warn-ink: #fbbf24;
  --bad-soft: rgba(239, 68, 68, .14);
  --bad-ink: #f87171;
  --info-soft: rgba(56, 189, 248, .13);
  --info-ink: #7dd3fc;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .75);
  --glass: rgba(13, 15, 20, .72);
  --scrim: rgba(3, 4, 8, .62);
  --glow: radial-gradient(60% 50% at 50% 0%, rgba(124, 92, 255, .18), transparent 70%);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6fa;
  --bg-2: #eef0f6;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --surface-3: #eceff5;
  --line: rgba(15, 23, 42, .08);
  --line-2: rgba(15, 23, 42, .14);
  --text: #0f1424;
  --text-2: #3a4256;
  --muted: #687085;
  --accent-soft: rgba(124, 92, 255, .1);
  --accent-ink: #5b3fe0;
  --ok-soft: rgba(34, 197, 94, .12);
  --ok-ink: #15803d;
  --warn-soft: rgba(245, 158, 11, .14);
  --warn-ink: #b45309;
  --bad-soft: rgba(239, 68, 68, .1);
  --bad-ink: #dc2626;
  --info-soft: rgba(56, 189, 248, .14);
  --info-ink: #0369a1;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-lg: 0 30px 70px -20px rgba(15, 23, 42, .25);
  --glass: rgba(255, 255, 255, .78);
  --scrim: rgba(15, 20, 36, .4);
  --glow: radial-gradient(60% 50% at 50% 0%, rgba(124, 92, 255, .12), transparent 70%);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  /* Страховка от прокрутки вбок на телефоне: clip, а не hidden — sticky-шапка не ломается */
  overflow-x: clip;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 520px;
  background: var(--glow);
  pointer-events: none;
  z-index: 0;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-ink); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--text); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
code { font-size: .9em; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* Свои полосы прокрутки */
/* Стандартные scrollbar-width/color в Chrome включают системные стрелки —
   поэтому они только для Firefox, а Chrome/Edge/Safari рисуют по ::-webkit-* */
@supports (-moz-appearance: none) { * { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; } }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }

.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ok-ink { color: var(--ok-ink); } .warn-ink { color: var(--warn-ink); } .bad-ink { color: var(--bad-ink); } .info-ink { color: var(--info-ink); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

/* ---------- Каркас ---------- */
.container { position: relative; z-index: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }
.main { position: relative; z-index: 1; padding: 32px 0 72px; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
}
/* Стекло — на псевдоэлементе: backdrop-filter на самой шапке делает её
   контейнером для position: fixed, и меню-бургер сжимается до её высоты */
.topbar::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--glass);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; white-space: nowrap; color: var(--text); font-weight: 800; letter-spacing: -.02em; font-size: 16px; line-height: 1.15; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 6px 20px -6px rgba(124, 92, 255, .6);
}
/* Логотип — та же иконка, что у установленного приложения */
.brand-logo { background: none; object-fit: cover; }
.brand small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 1px; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: 12px; }
.nav a {
  position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px;
  color: var(--text-2); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); background: var(--surface-3); }
.nav a svg { opacity: .75; }
.sm-only { display: none !important; }
.nav .nav-logout {
  display: flex; align-items: center; gap: 7px; width: 100%; padding: 13px 14px; border: 0; border-radius: 10px;
  background: transparent; color: var(--bad-ink); font: inherit; font-size: 16px; cursor: pointer;
}
.side-link.nav-logout { width: 100%; border: 0; background: transparent; font: inherit; color: var(--bad-ink); cursor: pointer; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }

.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn.burger { display: none; }
/* Шапка шире контента: меню из базы, подписи на EN/UZ длиннее русских.
   Если всё равно не влезает, скрипт в layout.php ужимает по шагам:
   без иконок пунктов → без имени у аватара → бургер (.nav-collapsed) */
.topbar .container { max-width: 1720px; }
.topbar.tb-noicons:not(.nav-collapsed) .nav a { padding: 8px 10px; }
.topbar.tb-noicons:not(.nav-collapsed) .nav a svg { display: none; }
.topbar.tb-noname .account-meta { display: none; }
.topbar.tb-noname .account-user { padding-right: 1px; }
.topbar.nav-collapsed .nav { display: none; }
.topbar.nav-collapsed .icon-btn.burger { display: inline-grid; }
.topbar.nav-collapsed .nav.open {
  display: flex; flex-direction: column; align-items: stretch; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; margin: 0;
  padding: 16px 20px; gap: 4px; background: var(--bg); overflow-y: auto; animation: fadeIn var(--t) var(--ease); z-index: 49;
}
.topbar.nav-collapsed .nav.open a { padding: 13px 14px; font-size: 16px; }
svg.i { flex: none; }

/* Кнопка-иконка */
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-2); }
.icon-btn:active { transform: scale(.96); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 8px; }

/* Переключатель темы: солнце/луна */
.theme-toggle .i-sun { display: none; }
html[data-theme="light"] .theme-toggle .i-sun { display: block; }
html[data-theme="light"] .theme-toggle .i-moon { display: none; }

/* Язык в шапке: одна кнопка, список по клику */
.lang-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 8px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .03em; cursor: pointer;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.lang-btn:hover { color: var(--text); background: var(--surface-2); }
.lang-menu .dropdown { top: calc(100% + 11px); }
.lang-menu .dropdown { min-width: 180px; }
.dropdown a.active, .dropdown button.active { background: var(--surface-2); color: var(--text); }
.lang-code { width: 24px; font-size: 12px; font-weight: 700; color: var(--muted); }

/* FAQ: раскрывающиеся разделы */
.faq-item { scroll-margin-top: 80px; }
.faq-item > summary { cursor: pointer; list-style: none; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item:not([open]) > summary { border-bottom: 0; }
.faq-chev { color: var(--muted); transition: transform var(--t-fast) var(--ease); }
.faq-item[open] .faq-chev { transform: rotate(180deg); }

/* Пилюли в шапке: баланс, таймер аренды */
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.pill .mono { font-weight: 700; }
.pill:hover { color: var(--text); border-color: var(--line-2); }
.pill-live { padding: 0 12px; background: var(--ok-soft); border-color: transparent; color: var(--ok-ink); }
.pill-live:hover { color: var(--ok-ink); }
.pill-add { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.pill-add:hover { background: var(--accent); color: #fff; }

/* Пульсирующая точка */
.live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.live::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: currentColor; opacity: .35; animation: livePulse 2s var(--ease) infinite; }
@keyframes livePulse { 0% { transform: scale(.5); opacity: .45; } 80%, 100% { transform: scale(1.8); opacity: 0; } }

/* Плашки шапки: настройки (баланс · язык · тема) и пользователь (кто · кабинет · админка · выход) */
.prefs, .account {
  display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 3px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); white-space: nowrap;
}
.prefs-sep { width: 1px; height: 20px; margin: 0 3px; background: var(--line-2); flex: none; }
.prefs-balance { padding: 0 6px 0 8px; font-size: 14px; font-weight: 700; color: var(--text); }
.prefs-balance:hover { color: var(--accent-ink); }
.prefs-btn, .account-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-2); cursor: pointer; transition: color var(--t-fast), background-color var(--t-fast);
}
.prefs-btn:hover, .account-btn:hover { color: var(--text); background: var(--surface-2); }
/* «Приложение» — отдельно от разделов: золотая плашка с пробегающим бликом */
.nav .nav-install, .nav .nav-install:hover {
  margin-left: 12px; overflow: hidden; isolation: isolate; color: #3b2a00; font-weight: 600;
  background: linear-gradient(135deg, #fde68a 0%, #f5b82e 48%, #e09b12 100%);
  box-shadow: 0 4px 16px -6px rgba(245, 184, 46, .75), inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.nav .nav-install svg { opacity: 1; }
.nav .nav-install:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -6px rgba(245, 184, 46, .9), inset 0 1px 0 rgba(255, 255, 255, .6); }
.nav .nav-install::before {
  content: ''; position: absolute; inset: 0; z-index: -1; transform: translateX(-120%);
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%);
  animation: goldShine 3.4s var(--ease) infinite;
}
@keyframes goldShine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.nav.open .nav-install { margin: 10px 0 0; }
.account form { margin: 0; display: contents; }
.account-admin { color: var(--accent-ink); }
.account-admin:hover { color: var(--accent-ink); background: var(--accent-soft); }
.account-logout:hover { color: var(--bad-ink); background: var(--bad-soft); }
.account-user { display: inline-flex; align-items: center; gap: 9px; height: 32px; padding: 0 10px 0 1px; border-radius: 9px; color: var(--text); }
.account-user:hover { color: var(--text); background: var(--surface-2); }
.account-meta { display: flex; flex-direction: column; line-height: 1.2; }
.account-meta b { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.account-meta span { font-size: 11px; color: var(--muted); }

/* Пользователь и выпадающие списки */
.menu { position: relative; }
.avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 13px; font-weight: 800; flex: none; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; padding: 6px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; pointer-events: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); z-index: 60;
}
.menu.open .dropdown { opacity: 1; transform: none; pointer-events: auto; }
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; border: 0;
  background: transparent; color: var(--text-2); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); color: var(--text); }
.dropdown .danger:hover { color: var(--bad-ink); }

/* ---------- Кнопки ---------- */
.btn {
  --btn-bg: var(--surface-2); --btn-fg: var(--text); --btn-bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; user-select: none;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), background-color var(--t-fast), border-color var(--t-fast), opacity var(--t-fast);
}
.btn:hover { color: var(--btn-fg); border-color: var(--muted); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { --btn-bg: var(--grad); --btn-fg: #fff; --btn-bd: transparent; background: var(--grad); box-shadow: 0 8px 24px -10px rgba(124, 92, 255, .7); }
.btn-primary:hover { border-color: transparent; box-shadow: 0 12px 30px -10px rgba(124, 92, 255, .85); transform: translateY(-1px); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }
.btn-danger { --btn-bg: var(--bad-soft); --btn-fg: var(--bad-ink); --btn-bd: transparent; }
.btn-danger:hover { background: var(--bad); color: #fff; border-color: transparent; }
.btn-success { --btn-bg: var(--ok-soft); --btn-fg: var(--ok-ink); --btn-bd: transparent; }
.btn-tg { --btn-bg: #229ed9; --btn-fg: #fff; --btn-bd: transparent; box-shadow: 0 8px 24px -10px rgba(34, 158, 217, .7); }
.btn-tg:hover { transform: translateY(-1px); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; gap: 6px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none; }
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn.is-busy::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 {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card-head h2 svg, .card-head h3 svg { color: var(--accent-ink); }
.card-body { padding: 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.card + .card, .card + .grid, .grid + .card, .stats + .card, .stats + .grid { margin-top: 20px; }
/* В сетке и стопке расстояние задаёт gap — иначе соседняя карточка съезжает вниз */
.grid > .card, .grid > .grid, .stack > .card { margin-top: 0; }
.card-accent { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border: 1px solid transparent; }
.card-hover { transition: transform var(--t) var(--ease), border-color var(--t), box-shadow var(--t); }
.card-hover:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.count { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1500px) { .grid-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1250px) { .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.grid-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }

/* ---------- Заголовок страницы ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.03em; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 640px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 10px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.back:hover { color: var(--text); }

/* ---------- Метрики ---------- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { position: relative; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
a.stat { color: inherit; transition: transform var(--t) var(--ease), border-color var(--t); }
a.stat:hover { transform: translateY(-2px); border-color: var(--line-2); color: inherit; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat-value { margin-top: 10px; font-size: 28px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-value.sm { font-size: 20px; }
.stat-hint { margin-top: 6px; font-size: 13px; color: var(--muted); }
.stat-icon { position: absolute; right: 16px; top: 16px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.stat[data-tone="ok"] .stat-icon { background: var(--ok-soft); color: var(--ok-ink); }
.stat[data-tone="warn"] .stat-icon { background: var(--warn-soft); color: var(--warn-ink); }
.stat[data-tone="bad"] .stat-icon { background: var(--bad-soft); color: var(--bad-ink); }
.stat[data-tone="accent"] .stat-icon { background: var(--accent-soft); color: var(--accent-ink); }
.stat[data-tone="info"] .stat-icon { background: var(--info-soft); color: var(--info-ink); }

/* ---------- Бейджи и статусы ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge-ok { background: var(--ok-soft); color: var(--ok-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge-bad { background: var(--bad-soft); color: var(--bad-ink); }
.badge-info { background: var(--info-soft); color: var(--info-ink); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge-outline { background: transparent; border: 1px solid currentColor; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.dot-new { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); margin-left: 6px; vertical-align: middle; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table tbody tr { transition: background-color var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn { margin-left: 6px; }
.table tr.off td { opacity: .5; }
.table .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.table-dense td { padding-top: 9px; padding-bottom: 9px; }
.table tfoot td { border-top: 1px solid var(--line-2); font-weight: 700; background: var(--surface-2); }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field + .field { margin-top: 16px; }
.label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.label .req { color: var(--bad-ink); }
.hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
}
.textarea { height: auto; min-height: 96px; padding: 11px 14px; line-height: 1.5; resize: vertical; }
.textarea.code { font-family: var(--mono); font-size: 13px; min-height: 180px; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: .6; cursor: not-allowed; }
.select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23858c9c' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
input[type="color"].input { padding: 4px; cursor: pointer; }
/* Свой выпадающий список поверх <select> (app.js): системный на Windows белый с голубым */
.cselect { position: relative; }
.filters .cselect { min-width: 150px; }
.cselect-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.cselect-btn { display: block; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cselect.open .cselect-btn { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.cselect-list { left: 0; right: 0; min-width: 0; max-height: 280px; overflow-y: auto; }
.cselect-list button:disabled { opacity: .45; cursor: default; }
.cselect-group { padding: 10px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cselect-group ~ button { padding-left: 18px; }
/* В модалке тело прокручивается и обрезает всплывающее — список раскрывается в потоке */
.modal .cselect-list { position: fixed; display: none; opacity: 1; transform: none; pointer-events: auto; z-index: 260; max-height: 260px; }
.modal .cselect.open .cselect-list { display: block; }
input[type="date"].input, input[type="datetime-local"].input { padding-right: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid .field + .field { margin-top: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .input, .filters .select { width: auto; min-width: 150px; height: 36px; font-size: 13px; border-radius: 9px; }

/* Чекбокс и радио */
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.check input { appearance: none; flex: none; width: 18px; height: 18px; margin: 1px 0 0; border-radius: 5px; border: 1.5px solid var(--line-2); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; transition: background-color var(--t-fast), border-color var(--t-fast); }
.check input::after { content: ''; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform var(--t-fast) var(--ease); }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { transform: rotate(-45deg) scale(1); }
.check-plain input { margin: 0; }

/* Выбор тарифа/причины плитками */
.choice { display: grid; gap: 8px; }
.choice label {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer;
  transition: border-color var(--t-fast), background-color var(--t-fast), box-shadow var(--t-fast);
}
.choice label:hover { border-color: var(--muted); }
.choice input { appearance: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); margin: 0 10px 0 0; vertical-align: -4px; transition: border var(--t-fast); }
.choice input:checked { border: 5px solid var(--accent); }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Сегменты и вкладки */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg a, .seg button { padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; transition: background-color var(--t-fast), color var(--t-fast); }
.seg a:hover, .seg button:hover { color: var(--text); }
.seg a.active, .seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.lang-tabs { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--surface-2); margin-left: 8px; vertical-align: middle; }
.lang-tabs button { border: 0; background: transparent; padding: 2px 8px; border-radius: 6px; font: inherit; font-size: 11px; font-weight: 800; color: var(--muted); cursor: pointer; }
.lang-tabs button.active { background: var(--accent); color: #fff; }

/* Пары «ключ — значение» */
/* Разделители — тенью на ячейках, а не фоном сетки: иначе незаполненный
   хвост последнего ряда заливается серым */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); background: var(--surface); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.kv > div { padding: 12px 14px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.kv dt { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 4px; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ---------- Сообщения и пустые состояния ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; font-size: 14px; background: var(--accent-soft); color: var(--text); border: 1px solid transparent; }
.alert svg { flex: none; margin-top: 2px; color: var(--accent-ink); }
.alert-warn { background: var(--warn-soft); } .alert-warn svg { color: var(--warn-ink); }
.alert-bad { background: var(--bad-soft); } .alert-bad svg { color: var(--bad-ink); }
.alert-ok { background: var(--ok-soft); } .alert-ok svg { color: var(--ok-ink); }
.empty { padding: 48px 24px; text-align: center; }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.empty h3 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 440px; margin: 0 auto; }
.empty .btn { margin-top: 18px; }

/* ---------- Пагинация ---------- */
.pager { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); }
.pager-note { margin: 0 auto 0 0; }

/* ---------- Модалки ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn var(--t) var(--ease);
}
.modal {
  width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
  animation: modalIn .28s var(--ease);
}
.modal.wide { max-width: 680px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 16px; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-body { padding: 4px 22px 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- Тосты ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 14px; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); color: var(--text);
  animation: toastIn .35s var(--ease);
}
.toast.out { animation: toastOut .25s var(--ease) forwards; }
.toast-icon { width: 24px; height: 24px; flex: none; border-radius: 8px; display: grid; place-items: center; }
.toast-success .toast-icon { background: var(--ok-soft); color: var(--ok-ink); }
.toast-error .toast-icon { background: var(--bad-soft); color: var(--bad-ink); }
.toast-warning .toast-icon { background: var(--warn-soft); color: var(--warn-ink); }
.toast-info .toast-icon { background: var(--accent-soft); color: var(--accent-ink); }
.toast p { flex: 1; padding-top: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* ---------- Появление при прокрутке (в меру) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .06s; } .reveal-d2 { transition-delay: .12s; } .reveal-d3 { transition-delay: .18s; }
.fade-up { animation: fadeUp .5s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }

/* =====================================================================
   Публичные страницы
   ===================================================================== */

/* Герой главной */
/* Свечение шире экрана телефона — обрезаем по горизонтали, без прокрутки вбок */
.hero { position: relative; padding: 76px 0 40px; text-align: center; overflow-x: clip; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); box-shadow: var(--shadow);
}
.hero-pill .live { color: var(--ok); }
.hero h1 { margin: 22px auto 0; max-width: 900px; font-size: clamp(34px, 6vw, 64px); font-weight: 800; letter-spacing: -.045em; line-height: 1.04; }
.hero-lead { margin: 20px auto 0; max-width: 680px; font-size: clamp(16px, 2vw, 19px); color: var(--text-2); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.hero-notes { display: flex; gap: 8px 20px; justify-content: center; flex-wrap: wrap; margin-top: 22px; font-size: 13.5px; color: var(--muted); }
.hero-notes span { display: inline-flex; align-items: center; gap: 7px; }
.hero-notes svg { color: var(--ok-ink); }
.hero-stats { margin-top: 52px; text-align: left; }
.hero-glow { position: absolute; left: 50%; top: -120px; width: min(900px, 100vw); height: 500px; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(closest-side, rgba(124, 92, 255, .22), transparent), radial-gradient(closest-side at 70% 60%, rgba(34, 211, 238, .14), transparent); filter: blur(10px); z-index: -1; }

.section { padding: 64px 0; position: relative; z-index: 1; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 36px); font-weight: 800; letter-spacing: -.035em; max-width: 680px; }
.section-head p { color: var(--muted); max-width: 440px; }

/* Шаги */
.step { padding: 22px; }
.step-num { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.step h3 { margin-top: 16px; font-size: 16px; }
.step p { margin-top: 8px; font-size: 14px; color: var(--muted); }
.step-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ok-ink); }

/* Карточка программы */
.soft { display: flex; flex-direction: column; padding: 20px; height: 100%; }
.soft-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.soft-logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; color: var(--accent-ink); font-weight: 800; }
.soft-logo img { width: 100%; height: 100%; object-fit: cover; }
.soft h3 { margin-top: 16px; font-size: 18px; letter-spacing: -.02em; }
.soft-desc { margin-top: 6px; font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.soft-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.soft-state { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.prices { margin-top: 14px; display: grid; gap: 6px; }
.tsel { position: relative; display: block; }
.tsel-cur { border-color: var(--accent); background: var(--accent-soft); }
.tsel-cur[disabled] { opacity: 1; }
.tsel-r { display: inline-flex; align-items: center; gap: 8px; }
.tsel-r svg { color: var(--muted); transition: transform var(--t-fast); }
.tsel.open .tsel-r svg { transform: rotate(180deg); }
.tsel-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; gap: 4px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg);
  max-height: 260px; overflow-y: auto; overscroll-behavior: contain;
}
.tsel-list[hidden] { display: none; }
.tsel-list .price-row { background: transparent; }
.tsel-list .price-row:hover { background: var(--surface-2); }
.tsel-list .price-row[aria-pressed="true"] { background: var(--accent-soft); }
[data-card]:has(.tsel.open), .soft:has(.tsel.open) { position: relative; z-index: 30; }
/* Открытый список тарифов выше футера и соседних блоков */
.main:has(.tsel.open) { position: relative; z-index: 50; }
.price-row { flex-wrap: wrap; gap: 2px 8px; padding: 8px 10px; font-size: 13px; }
.prices .price-row:only-child { grid-column: 1 / -1; }
.price-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid transparent; font-size: 13.5px; cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.price-row:hover { border-color: var(--line-2); }
.price-row[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.price-row .mono { font-weight: 700; }
.price-row s { color: var(--muted); font-weight: 500; margin-left: 6px; font-size: 12px; }
.price-row[disabled] { cursor: default; }
.soft-action { margin-top: auto; padding-top: 18px; }
.soft-from { font-size: 12px; color: var(--muted); }

/* Состояние пула */
.pool { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.pool .live { width: 7px; height: 7px; }
.pool-free { color: var(--ok-ink); } .pool-busy { color: var(--warn-ink); } .pool-hold { color: var(--info-ink); } .pool-none { color: var(--muted); }

/* Таймлайн кулдауна */
.track + .track { margin-top: 18px; }
.track-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; margin-bottom: 8px; }
.track-bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; display: flex; }
.track-bar span { display: block; height: 100%; border-radius: 999px; transform-origin: left; animation: grow 1.1s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.formula { font-family: var(--mono); font-size: 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); color: var(--accent-ink); overflow-x: auto; white-space: nowrap; }

/* Подвал */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--line); padding: 44px 0 30px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer ul a { color: var(--text-2); font-size: 14px; }
.footer ul a:hover { color: var(--text); }
.footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Документы (страницы, правила) */
.doc { line-height: 1.75; color: var(--text-2); }
.doc h2 { font-size: 20px; color: var(--text); margin: 28px 0 10px; }
.doc h3 { font-size: 17px; color: var(--text); margin: 22px 0 8px; }
.doc h2:first-child, .doc h3:first-child { margin-top: 0; }
.doc p, .doc ul, .doc ol { margin: 0 0 14px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc strong { color: var(--text); }
.doc a { text-decoration: underline; text-underline-offset: 3px; }
.rules-box { max-height: 240px; overflow-y: auto; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.65; margin: 14px 0; color: var(--text-2); }

/* Вход */
.auth { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 20px; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 440px; padding: 34px 30px; text-align: center; }
.auth-icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 20px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 16px 40px -14px rgba(124, 92, 255, .8); }
.auth-icon.tg { background: #229ed9; box-shadow: 0 16px 40px -14px rgba(34, 158, 217, .8); }
.auth-icon.ok { background: var(--ok); } .auth-icon.bad { background: var(--bad); }
.auth-card h1 { font-size: 23px; }
.auth-lead { margin-top: 8px; color: var(--muted); font-size: 14.5px; }
.qr { display: inline-block; margin: 20px auto 6px; padding: 12px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.qr svg { width: 168px; height: 168px; }
.auth-timer { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 6px; }

/* Драйверы */
.driver { padding: 20px; display: flex; flex-direction: column; height: 100%; }
.driver h3 { font-size: 16px; margin-top: 12px; }
.driver p { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.driver-actions { margin-top: auto; padding-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.howto { margin-top: 12px; }
.howto summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent-ink); list-style: none; }
.howto summary::-webkit-details-marker { display: none; }
.howto .doc { font-size: 13.5px; margin-top: 10px; }

/* =====================================================================
   Кабинет мастера
   ===================================================================== */
.rental { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.clock { font-family: var(--mono); font-weight: 800; font-size: clamp(44px, 8vw, 72px); letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ok-ink); transition: color var(--t); }
.clock.warn { color: var(--warn-ink); animation: softBlink 1.6s ease-in-out infinite; }
.clock.over { color: var(--bad-ink); }
@keyframes softBlink { 50% { opacity: .55; } }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 18px; }
.progress span { display: block; height: 100%; background: var(--grad); border-radius: inherit; transition: width 1s linear; }
.cred { display: flex; align-items: center; gap: 10px; padding: 11px 12px 11px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.cred + .cred { margin-top: 10px; }
.cred-label { width: 74px; flex: none; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.cred-value { flex: 1; min-width: 0; font-family: var(--mono); font-weight: 700; font-size: 15px; word-break: break-all; }
.cred-value.plain { font-family: var(--font); font-weight: 500; font-size: 14px; }
.secret { filter: blur(7px); user-select: none; transition: filter var(--t) var(--ease); }

/* Чат */
.chat { display: flex; flex-direction: column; gap: 12px; min-height: 320px; max-height: 62vh; overflow-y: auto; padding: 22px; background: var(--bg-2); }
.msg { max-width: min(78%, 620px); padding: 11px 15px; border-radius: 16px; border-bottom-left-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; animation: fadeUp .3s var(--ease); }
.msg.mine { align-self: flex-end; background: var(--accent-soft); border-color: transparent; border-bottom-left-radius: 16px; border-bottom-right-radius: 6px; }
.msg.system { align-self: center; background: transparent; border: 0; color: var(--muted); font-size: 12.5px; }
.msg-meta { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.msg-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.msg-files img { max-width: 200px; max-height: 150px; border-radius: 10px; }
.msg-files a { font-size: 13px; }
.msg-files .msg-img { cursor: zoom-in; }

/* Сайт внутри Telegram (Mini App, tgapp.js). Подвал, «Приложение» и
   «Выйти» не нужны: окно — уже приложение, а вход — по Telegram, и
   после выхода он тут же случился бы снова */
.tg-app .footer, .tg-app .nav-install,
.tg-app form:has(.account-logout), .tg-app form:has(.nav-logout) { display: none !important; }
/* Экран загрузки, пока идёт вход; если скрипт не ответил — сам уходит через 10 с */
.tg-gate { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; background: var(--bg); animation: tgGate 0s 10s forwards; }
.tg-gate span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes tgGate { to { visibility: hidden; } }

/* Визуальный редактор текста (admin.js, textarea[data-rich]) */
.rte { position: relative; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface-2); overflow: hidden; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.rte:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface); }
.rte-btn { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; transition: background-color var(--t-fast), color var(--t-fast); }
.rte-btn:hover { background: var(--surface-2); color: var(--text); }
.rte-btn.active { background: var(--accent-soft); color: var(--accent-ink); }
.rte-txt { font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.rte-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--line-2); }
.rte-area { min-height: 220px; max-height: 560px; overflow-y: auto; padding: 14px 16px; outline: none; color: var(--text); font-size: 14.5px; }
.rte-area > :first-child { margin-top: 0; }
/* textarea остаётся в форме (значение, required), но в визуальном режиме не видна */
.rte > textarea { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; opacity: 0; pointer-events: none; }
.rte.rte-source .rte-area { display: none; }
.rte.rte-source > textarea { position: static; height: auto; min-height: 260px; opacity: 1; pointer-events: auto; border: 0; border-radius: 0; box-shadow: none; }

/* Просмотр картинок с лупой (app.js) */
.lb { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; background: rgba(5, 6, 10, .92); animation: fadeIn var(--t) var(--ease); }
.lb-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; }
.lb-bar .icon-btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #fff; }
.lb-bar .icon-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.lb-zoom { min-width: 52px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .85); }
.lb-stage { flex: 1; display: grid; place-items: center; overflow: hidden; touch-action: none; cursor: zoom-in; }
.lb-stage.zoomed { cursor: grab; }
.lb-stage.dragging { cursor: grabbing; }
.lb-img { max-width: calc(100vw - 32px); max-height: calc(100vh - 92px); border-radius: 8px; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); user-select: none; transform-origin: center; will-change: transform; }
.composer { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.composer .textarea { flex: 1 1 260px; min-height: 44px; max-height: 160px; }
.is-dragover { outline: 2px dashed var(--accent); outline-offset: -6px; }
.previews { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.previews:empty { display: none; }
.preview { position: relative; display: flex; align-items: center; padding: 6px 30px 6px 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; animation: fadeUp .25s var(--ease); }
.preview img { height: 48px; border-radius: 6px; }
.preview button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.preview button:hover { background: var(--surface-3); color: var(--text); }

/* Баннер установки PWA */

/* =====================================================================
   Админка
   ===================================================================== */
.admin { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; position: relative; z-index: 1; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px; background: var(--bg-2); border-right: 1px solid var(--line); }
.sidebar .brand { padding: 4px 8px 18px; }
.side-group { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 500; transition: background-color var(--t-fast), color var(--t-fast); }
.side-link svg { opacity: .7; flex: none; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--line); }
.side-link.active svg { color: var(--accent-ink); opacity: 1; }
.side-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sidebar-foot { margin-top: auto; padding-top: 14px; }
.admin-main { min-width: 0; }
.admin-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 28px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.admin-top h1 { font-size: 17px; font-weight: 700; }
.admin-content { padding: 28px; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 140px; }
.bars span { flex: 1; min-height: 3px; border-radius: 5px 5px 2px 2px; background: var(--grad); opacity: .85; transform-origin: bottom; animation: barUp .8s var(--ease) both; transition: opacity var(--t-fast); }
.bars span:hover { opacity: 1; }
@keyframes barUp { from { transform: scaleY(0); } }
.bars-x { display: flex; gap: 5px; margin-top: 6px; font-size: 10.5px; color: var(--muted); }
.bars-x span { flex: 1; text-align: center; }
.json { font-family: var(--mono); font-size: 11.5px; white-space: pre-wrap; word-break: break-all; color: var(--muted); max-width: 380px; max-height: 160px; overflow: auto; margin: 0; }
.color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.sticky-actions { position: sticky; bottom: 16px; z-index: 5; margin-top: 20px; display: flex; gap: 10px; padding: 12px; border-radius: 16px; background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--line); box-shadow: var(--shadow-lg); width: fit-content; max-width: 100%; flex-wrap: wrap; }

/* =====================================================================
   Адаптив
   ===================================================================== */
@media (max-width: 1240px) {
  .topbar .nav { display: none; }
  .topbar .icon-btn.burger { display: inline-grid; }
  .topbar .nav.open {
    display: flex; flex-direction: column; align-items: stretch; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; margin: 0;
    padding: 16px 20px; gap: 4px; background: var(--bg); overflow-y: auto; animation: fadeIn var(--t) var(--ease); z-index: 49;
  }
  .topbar .nav.open a { padding: 13px 14px; font-size: 16px; }
}
@media (max-width: 1080px) {
  .nav { display: none; }
  .icon-btn.burger { display: inline-grid; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; margin: 0;
    padding: 16px 20px; gap: 4px; background: var(--bg); overflow-y: auto; animation: fadeIn var(--t) var(--ease); z-index: 49;
  }
  .nav.open a { padding: 13px 14px; font-size: 16px; }
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 120; transform: translateX(-100%); transition: transform var(--t) var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .admin-top { padding: 0 16px; }
  .admin-content { padding: 20px 16px; }
}
@media (max-width: 820px) {
  /* minmax(0, …): длинная строка без переноса (формула) не раздвигает колонку */
  .grid-2, .grid-main, .rental, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .hide-md { display: none !important; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .container { padding: 0 16px; }
  .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  .sm-only { display: flex !important; }
  .topbar-inner { gap: 8px; }
  .account-meta { display: none; }
  .account-user { padding-right: 1px; }
  .prefs-balance { padding: 0 4px 0 6px; }
  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
  .hero { padding-top: 48px; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; max-height: 92vh; }
  .toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; }
  /* Статистика по две в ряд: восемь карточек столбиком — это экраны прокрутки */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat-icon { width: 28px; height: 28px; right: 10px; top: 10px; border-radius: 8px; }
  .stat-icon svg { width: 15px; height: 15px; }
  .stat-label { padding-right: 30px; font-size: 10.5px; letter-spacing: .06em; }
  .stat-value { margin-top: 8px; font-size: 22px; }
  .stat-hint { font-size: 12px; }
  /* Подвал: ссылки в две колонки */
  .footer { padding: 32px 0 24px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  /* Сегменты — одной строкой с прокруткой, а не коробкой в два ряда */
  .seg { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
}

/* Меньше движения — по желанию системы */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Длительность тарифа: число + единица и пресеты */
.dur-in { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; }
.dur-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dur-presets .chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font: inherit; font-size: 12.5px; color: inherit; cursor: pointer; }
.dur-presets .chip:hover { border-color: var(--line-2); }
.dur-presets .chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

/* Живой поиск мастера */
.upick { position: relative; }
.upick-list { left: 0; right: 0; min-width: 0; max-height: 300px; overflow-y: auto; display: none; }
.upick.open .upick-list { display: block; opacity: 1; transform: none; pointer-events: auto; }
.upick-list button { display: block; width: 100%; text-align: left; }

/* Календарь */
.dpick { position: relative; }
.dpick-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.dpick-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; white-space: nowrap; }
.dpick-btn svg { color: var(--muted); flex: none; }
.dpick.open .dpick-btn { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dpick-pop { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 270; width: 292px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lg); }
.dpick.open .dpick-pop { display: block; animation: fadeIn var(--t-fast) var(--ease); }
.dpick-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.dpick-head .icon-btn { font-size: 18px; line-height: 1; }
.dpick-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dpick-wd { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.dpick-grid button { height: 34px; border-radius: 9px; border: 1px solid transparent; background: none; font: inherit; font-size: 13.5px; color: inherit; cursor: pointer; }
.dpick-grid button:hover { background: var(--surface-2); }
.dpick-grid button.today { border-color: var(--line-2); font-weight: 700; }
.dpick-grid button.sel { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.dpick-time { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dpick-time span { margin-right: auto; }
.dpick-time .input { width: 52px; text-align: center; padding: 6px; }
.dpick-foot { display: flex; justify-content: space-between; margin-top: 10px; }
.filters .dpick { min-width: 150px; }
[data-ask-field][hidden] { display: none !important; }

/* Кнопка «наверх» */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface, var(--bg)); color: var(--text, inherit);
  box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .2s, transform .2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--accent, currentColor); }
@media (max-width: 640px) { .to-top { right: 16px; bottom: 16px; } }

/* Ракета в кнопке «наверх» — в стиле сайта: градиент акцента, линейная иконка.
   Выхлоп (плазма в цветах --grad) рисует canvas в app.js */
.to-top { width: 46px; height: 46px; border-radius: var(--r); border: 0; color: #fff; overflow: visible;
  background: var(--grad); box-shadow: 0 10px 28px -10px rgba(124, 92, 255, .8); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t); }
.to-top:hover { border: 0; box-shadow: 0 14px 34px -10px rgba(124, 92, 255, .95), 0 0 0 4px var(--accent-soft); }
.to-top.show:hover { transform: translateY(-2px); }
.to-top .rk { display: block; transition: transform var(--t) var(--ease); }
.to-top:hover .rk { animation: rk-idle .1s linear infinite; }
.to-top.flying .rk { visibility: hidden; }
@keyframes rk-idle { 0%,100% { transform: translate(0,-1px); } 50% { transform: translate(.4px,-1.6px); } }
.rk-fly { position: fixed; left: 0; top: 0; z-index: 9999; color: #fff; pointer-events: none; will-change: transform;
  filter: drop-shadow(0 0 6px rgba(124, 92, 255, .9)) drop-shadow(0 0 14px rgba(34, 211, 238, .5)); }
.rk-fx { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 9998; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .to-top .rk { animation: none !important; } }

/* Виджет техподдержки (Telegram) — над ним появляется кнопка «наверх» */
.sup-fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--grad); text-decoration: none;
  box-shadow: 0 10px 28px -10px rgba(124, 92, 255, .8); transition: transform var(--t) var(--ease), box-shadow var(--t); }
.sup-fab::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--grad); opacity: .55; z-index: -1;
  animation: sup-pulse 2.4s var(--ease) infinite; }
.sup-fab svg { transform: translateX(-1px); }
.sup-fab:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 14px 34px -10px rgba(124, 92, 255, .95), 0 0 0 4px var(--accent-soft); }
.sup-fab-tip { position: absolute; right: calc(100% + 10px); top: 50%; transform: translate(6px, -50%); white-space: nowrap;
  padding: 7px 12px; border-radius: var(--r-sm); background: var(--surface); color: var(--text); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity var(--t-fast), transform var(--t-fast); }
.sup-fab:hover .sup-fab-tip { opacity: 1; transform: translate(0, -50%); }
@keyframes sup-pulse { 0% { transform: scale(1); opacity: .5; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
.to-top { bottom: 84px; right: 23px; }
@media (max-width: 640px) { .sup-fab { right: 16px; bottom: 16px; } .to-top { right: 19px; bottom: 80px; } .sup-fab-tip { display: none; } }
@media (prefers-reduced-motion: reduce) { .sup-fab::before { animation: none; display: none; } }

/* Виджеты справа по центру высоты: поддержка, под ней ракета «наверх» */
.sup-fab { top: calc(50% - 26px); bottom: auto; }
.to-top { top: calc(50% + 38px); bottom: auto; }
@media (max-width: 640px) { .sup-fab { bottom: auto; } .to-top { bottom: auto; } }
/* Ракета «наверх» — внизу справа */
.to-top { top: auto; bottom: 20px; right: 23px; }
@media (max-width: 640px) { .to-top { top: auto; bottom: 16px; right: 19px; } }

/* ===== Кабинет мастера ===== */
.cab-hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 26px 28px; }
.cab-hero-glow { position: absolute; inset: 0; background: var(--glow); pointer-events: none; }
.cab-id { position: relative; display: flex; align-items: center; gap: 18px; min-width: 0; }
.cab-avatar { flex: none; width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; font-size: 28px; font-weight: 800; color: #fff; background: var(--grad); box-shadow: 0 12px 30px -12px rgba(124, 92, 255, .8); }
.cab-who h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; overflow-wrap: anywhere; }
.cab-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cab-tags .badge { display: inline-flex; align-items: center; gap: 5px; }
.cab-wallet { position: relative; min-width: 240px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.cab-balance { margin-top: 6px; font-size: clamp(28px, 4vw, 36px); font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.cab-perks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.cab-perk { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13px; min-width: 0; }
.cab-perk span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cab-perk b { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cab-perk svg { color: var(--accent-ink); flex: none; }
.cab-rentals { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 0 22px 22px; }
.cab-rental { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: border-color var(--t-fast), transform var(--t-fast); }
.cab-rental:hover { border-color: var(--line-2); transform: translateY(-1px); }
.cab-rental-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cab-rental-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cab-bar { display: block; height: 4px; margin-top: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.cab-bar span { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.cab-left { font-size: 17px; font-weight: 800; white-space: nowrap; }
.cab-rental.is-low .cab-left { color: var(--warn-ink); }
.cab-rental.is-low .cab-bar span { background: var(--warn); }
.cab-logo { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); overflow: hidden; }
.cab-logo img { width: 100%; height: 100%; object-fit: contain; }
.cab-chart { display: flex; align-items: flex-end; gap: 10px; height: 190px; }
.cab-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.cab-col-bar { width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, var(--accent) 35%, transparent); transition: background var(--t-fast); }
.cab-col.is-now .cab-col-bar, .cab-col:hover .cab-col-bar { background: var(--grad); }
.cab-col-val { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cab-col-lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.cab-col.is-now .cab-col-lbl { color: var(--text); }
.cab-list { display: flex; flex-direction: column; padding: 0 12px 12px; }
.cab-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r); color: inherit; text-decoration: none; }
a.cab-item:hover, .cab-item:hover { background: var(--surface-2); }
.cab-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cab-item-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cab-tx-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.cab-tx-ic.is-in { background: var(--ok-soft); color: var(--ok-ink); }
.cab-tx-ic.is-out { background: var(--accent-soft); color: var(--accent-ink); }
.cab-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cab-q { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: border-color var(--t-fast), transform var(--t-fast); }
.cab-q svg { color: var(--accent-ink); margin-bottom: 6px; }
.cab-q span { color: var(--muted); font-size: 13px; }
.cab-q:hover { border-color: var(--line-2); transform: translateY(-2px); }
@media (max-width: 900px) { .cab-perks, .cab-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .cab-hero { padding: 20px 16px; }
  .cab-wallet { min-width: 0; width: 100%; }
  .cab-avatar { width: 54px; height: 54px; font-size: 22px; border-radius: 16px; }
  .cab-rentals { padding: 0 14px 14px; grid-template-columns: 1fr; }
  .cab-chart { gap: 6px; height: 160px; }
  .cab-col-val { display: none; }
}

/* ===== Экран аренды ===== */
.rt-card { position: relative; overflow: hidden; padding: 0; }
.rt-glow { position: absolute; inset: 0; background: var(--glow); pointer-events: none; }
.rt-head { position: relative; display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.rt-logo { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; overflow: hidden; background: var(--surface-3); color: var(--accent-ink); font-weight: 800; font-size: 14px; }
.rt-logo img { width: 100%; height: 100%; object-fit: contain; }
.rt-logo.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 11px; }
.rt-title { flex: 1; min-width: 0; }
.rt-title h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-alert { margin: 16px 24px 0; }
.rt-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 0; }
.rt-timer { padding: 26px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; border-right: 1px solid var(--line); }
.rt-ring { position: relative; width: min(250px, 100%); aspect-ratio: 1; }
.rt-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rt-ring circle { fill: none; stroke-width: 7; }
.rt-ring-bg { stroke: var(--surface-3); }
.rt-ring-fg { stroke-linecap: round; transition: stroke-dashoffset 1s linear; filter: drop-shadow(0 0 6px rgba(124, 92, 255, .45)); }
.rt-card.is-warn .rt-ring-fg { stroke: var(--warn); filter: drop-shadow(0 0 6px rgba(245, 158, 11, .5)); }
.rt-card.is-over .rt-ring-fg { stroke: var(--bad); }
.rt-ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.rt-ring-lbl { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.rt-ring .clock { font-size: clamp(30px, 4.4vw, 42px); }
.rt-times { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.rt-times > div { padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); text-align: left; }
.rt-times span { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.rt-times b { display: block; margin-top: 4px; font-size: 14px; }
.rt-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.rt-vault { padding: 26px 24px; display: flex; flex-direction: column; }
.rt-vault-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.rt-vault-head svg { color: var(--ok-ink); }
.rt-vault .cred { padding-top: 14px; padding-bottom: 14px; }
.rt-vault .cred-value { font-size: 16px; }
.rt-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 14px; }
.rt-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: inherit; text-decoration: none; transition: border-color var(--t-fast), transform var(--t-fast); }
.rt-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.rt-link svg { flex: none; color: var(--accent-ink); }
.rt-link span { display: flex; flex-direction: column; min-width: 0; }
.rt-link small { color: var(--muted); font-size: 12px; }
.rt-note { display: flex; gap: 8px; align-items: flex-start; margin-top: auto; padding-top: 16px; font-size: 12.5px; color: var(--muted); }
.rt-note svg { flex: none; margin-top: 2px; }
.rt-empty .empty { padding: 64px 24px; }
.rt-empty-ic { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 14px 34px -12px rgba(124, 92, 255, .8); }
.rt-wl { display: grid; gap: 10px; padding: 0 22px 22px; }
.rt-wl-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.rt-wl-item.is-res { border-color: var(--info); background: var(--info-soft); }
.rt-wl-pos { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; background: var(--surface-3); }
.rt-wl-item.is-res .rt-wl-pos { background: var(--info); color: #fff; }
.rt-wl-main { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 2px; }
.rt-hist-prog { display: flex; align-items: center; gap: 10px; }
.rt-hist-prog > span:last-child { display: flex; flex-direction: column; }
@media (max-width: 860px) {
  .rt-grid { grid-template-columns: 1fr; }
  .rt-timer { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .rt-head, .rt-timer, .rt-vault { padding-left: 16px; padding-right: 16px; }
  .rt-alert { margin: 14px 16px 0; }
  .rt-ring { width: min(210px, 100%); }
  .rt-actions .btn { flex: 1 1 auto; }
  .rt-wl { padding: 0 14px 14px; }
}
@media (prefers-reduced-motion: reduce) { .rt-ring-fg { transition: none; } }

/* ===== Баланс ===== */
.bl-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.bl-wallet { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 26px 28px; border-radius: var(--r-xl); color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, rgba(34, 211, 238, .55), transparent 55%), linear-gradient(135deg, #5b3df5 0%, #7c5cff 45%, #3f6dff 100%);
  box-shadow: 0 24px 60px -24px rgba(124, 92, 255, .85); min-height: 230px; }
.bl-wallet-shine { position: absolute; inset: -40% -10% auto auto; width: 70%; height: 140%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.16) 50%, transparent 60%); transform: rotate(8deg); pointer-events: none; animation: bl-shine 7s ease-in-out infinite; }
@keyframes bl-shine { 0%, 70% { transform: translateX(-120%) rotate(8deg); } 100% { transform: translateX(140%) rotate(8deg); } }
.bl-wallet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bl-chip { width: 42px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #f7e7a1, #c9a64a); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); position: relative; }
.bl-chip::after { content: ""; position: absolute; inset: 7px 9px; border: 1px solid rgba(0,0,0,.22); border-radius: 4px; }
.bl-wallet-cap { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; opacity: .85; }
.bl-amount { margin-top: auto; padding-top: 22px; font-size: clamp(36px, 6vw, 54px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; text-shadow: 0 2px 18px rgba(0,0,0,.18); }
.bl-rate { margin-top: 6px; font-size: 13px; opacity: .8; }
.bl-wallet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.bl-seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(0,0,0,.22); backdrop-filter: blur(6px); }
.bl-seg a { padding: 6px 14px; border-radius: 8px; color: rgba(255,255,255,.8); font-size: 13px; font-weight: 600; text-decoration: none; }
.bl-seg a.active { background: #fff; color: #3b2bb5; }
.bl-topup { background: #fff; color: #3b2bb5; border-color: transparent; font-weight: 700; }
.bl-topup:hover { background: #fff; color: #3b2bb5; transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(0,0,0,.4); }
.bl-req { display: flex; flex-direction: column; }
.bl-steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 4px; }
.bl-steps li { position: relative; display: flex; gap: 12px; padding: 8px 0; }
.bl-steps li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 38px; bottom: -6px; width: 2px; background: var(--line-2); }
.bl-steps li > span { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--surface-3); color: var(--muted); position: relative; z-index: 1; }
.bl-steps li.done > span { background: var(--ok-soft); color: var(--ok-ink); }
.bl-steps li.now > span { background: var(--warn-soft); color: var(--warn-ink); box-shadow: 0 0 0 4px var(--warn-soft); }
.bl-steps b { display: block; font-size: 14px; }
.bl-steps small { color: var(--muted); font-size: 12.5px; }
.bl-pending { margin-top: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.bl-pending > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bl-pending-sum { font-size: 24px; font-weight: 800; }
.bl-hist-head { flex-wrap: wrap; gap: 12px; }
.bl-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.bl-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 500; text-decoration: none; transition: border-color var(--t-fast), color var(--t-fast); }
.bl-chips a:hover { border-color: var(--line-2); color: var(--text); }
.bl-chips a.active { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.bl-feed { padding: 0 14px 14px; }
.bl-day { position: sticky; top: 0; z-index: 1; padding: 14px 10px 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: var(--surface); }
.bl-row { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: var(--r); }
.bl-row:hover { background: var(--surface-2); }
.bl-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.bl-ic.is-in { background: var(--ok-soft); color: var(--ok-ink); }
.bl-ic.is-out { background: var(--accent-soft); color: var(--accent-ink); }
.bl-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bl-row-main > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-row-sum { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.bl-row-sum b { font-size: 15px; }
@media (max-width: 860px) { .bl-top { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .bl-wallet { padding: 22px 18px; min-height: 200px; }
  .bl-feed { padding: 0 6px 10px; }
  .bl-row { gap: 10px; }
  .bl-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .bl-chips::-webkit-scrollbar { display: none; }
  .bl-chips a { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .bl-wallet-shine { animation: none; display: none; } }

/* Код сверки на экране входа */
.auth-code { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px dashed var(--line-2); }
.auth-code-lbl { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.auth-code-val { display: inline-flex; align-items: center; font-size: 34px; font-weight: 800; letter-spacing: .08em; line-height: 1; color: var(--accent-ink); }
.auth-code-val i { display: inline-block; width: 10px; }
.auth-code .hint { text-align: center; max-width: 320px; }

/* Заметка админа к аккаунту: длинный текст прокручивается внутри блока */
.rt-notes { align-items: flex-start; max-height: 150px; overflow-y: auto; overscroll-behavior: contain; }
.rt-notes > span { min-width: 0; overflow-wrap: anywhere; }

/* ===== Каталог ===== */
.cat-hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 28px 30px; margin-bottom: 16px; }
.cat-hero-glow { position: absolute; inset: 0; background: var(--glow); pointer-events: none; }
.cat-hero-text { position: relative; flex: 1 1 340px; min-width: 0; }
.cat-hero h1 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; letter-spacing: -.03em; margin-top: 6px; }
.cat-hero p { color: var(--muted); margin-top: 6px; max-width: 620px; }
.cat-stats { position: relative; display: flex; gap: 10px; }
.cat-stats > div { min-width: 96px; padding: 12px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.cat-stats b { font-size: 26px; font-weight: 800; line-height: 1.1; }
.cat-stats span { font-size: 12px; color: var(--muted); }
.cat-stats .is-free b { color: var(--ok-ink); }
.cat-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.cat-search { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--muted); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.cat-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cat-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.cat-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 500; user-select: none; }
.cat-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cat-switch-track { position: relative; flex: none; width: 40px; height: 22px; border-radius: 22px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background var(--t-fast); }
.cat-switch-track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform var(--t-fast); }
.cat-switch input:checked + .cat-switch-track { background: var(--ok); border-color: transparent; }
.cat-switch input:checked + .cat-switch-track::after { transform: translateX(18px); }
.cat-switch input:focus-visible + .cat-switch-track { box-shadow: 0 0 0 3px var(--accent-soft); }
.soft-meter { height: 4px; margin-top: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.soft-meter span { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width var(--t); }
.soft-meter.is-busy span { background: var(--warn); }
.soft-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; }
.soft-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); text-decoration: none; }
.soft-links a:hover { color: var(--accent-ink); }
#catalogGrid [data-card] { display: flex; }
#catalogGrid [data-card][hidden] { display: none; }
#catalogGrid .soft { width: 100%; }
#catalogGrid .soft:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
@media (max-width: 640px) {
  .cat-hero { padding: 20px 16px; }
  .cat-stats { width: 100%; }
  .cat-stats > div { flex: 1; min-width: 0; padding: 10px 12px; }
  .cat-stats b { font-size: 22px; }
  .cat-tools .cat-search { flex-basis: 100%; }
}

/* ===== Драйверы ===== */
.cat-stats b svg { display: block; }
.drv-group { margin-top: 22px; }
.drv-group[hidden], .drv-wrap[hidden] { display: none; }
.drv-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 18px; font-weight: 700; }
.drv-title svg { color: var(--accent-ink); }
.drv-wrap { display: flex; min-width: 0; }
.drv-wrap .driver { width: 100%; }
.drv-wrap .driver:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.drv-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.drv-top h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.drv-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.drv-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.drv-howto { margin-top: 12px; }
.drv-howto summary { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); }
.drv-howto .doc { max-height: 220px; overflow-y: auto; overscroll-behavior: contain; margin-top: 8px; overflow-wrap: anywhere; }

/* ===== FAQ ===== */
.faq-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.faq-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; }
.faq-nav { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.faq-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.faq-nav a svg { flex: none; }
.faq-nav a:hover { background: var(--surface-2); color: var(--text); }
.faq-nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.faq-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.faq-cta p { color: var(--muted); font-size: 13px; }
.faq-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.faq-main .faq-item[hidden], .faq-main #faqNone[hidden] { display: none; }
.faq-item > summary h2 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.faq-ic { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.faq-item .doc { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .faq-layout { grid-template-columns: 1fr; }
  .faq-side { position: static; display: contents; }
  .faq-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .faq-nav::-webkit-scrollbar { display: none; }
  .faq-nav a { flex: none; }
  .faq-cta { order: 3; }
}

/* ===== Поддержка ===== */
.bl-chips button { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.bl-chips button:hover { border-color: var(--line-2); color: var(--text); }
.bl-chips button.active { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.tk-list { display: flex; flex-direction: column; padding: 4px 12px 12px; }
.tk-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: var(--r); color: inherit; text-decoration: none; transition: background var(--t-fast); }
.tk-row[hidden] { display: none; }
.tk-row:hover { background: var(--surface-2); }
.tk-row.is-new { background: var(--accent-soft); }
.tk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tk-main b, .tk-main > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tk-none { padding: 24px 10px; text-align: center; }
.tk-tg { display: flex; align-items: center; gap: 12px; margin: 0 16px 16px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); color: inherit; text-decoration: none; transition: border-color var(--t-fast); }
.tk-tg:hover { border-color: var(--accent); }
.tk-tg > svg { flex: none; color: var(--muted); }
@media (max-width: 640px) {
  .tk-row { flex-wrap: wrap; }
  .tk-row .tk-main { flex-basis: calc(100% - 60px); }
  .tk-side { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ===== Переписка ===== */
.chat-card { overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chat-title { flex: 1 1 200px; min-width: 0; }
.chat-title h2 { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.chat { gap: 4px; min-height: 380px; background: var(--bg-2); scroll-behavior: smooth; }
.chat-day { align-self: center; margin: 12px 0 8px; padding: 3px 12px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 600; }
.msg { margin-top: 8px; padding: 9px 13px 7px; white-space: normal; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.msg.cont { margin-top: 0; }
.msg-text { display: block; white-space: pre-wrap; }
.msg-text:empty { display: none; }
.msg-who { display: block; margin-bottom: 2px; font-size: 12.5px; font-weight: 700; color: var(--accent-ink); }
.msg-meta { margin-top: 3px; text-align: right; font-size: 11px; }
.msg.mine { background: var(--grad); color: #fff; }
.msg.mine .msg-meta { color: rgba(255, 255, 255, .75); }
.msg.mine a { color: #fff; }
.msg.system { box-shadow: none; text-align: center; }
.msg.system .msg-meta { text-align: center; }
.msg-file { display: inline-flex; gap: 6px; padding: 7px 10px; border-radius: 10px; background: rgba(127, 127, 127, .14); text-decoration: none; }
.composer { align-items: flex-end; gap: 8px; padding: 12px 14px; border-radius: 0; }
.composer .textarea { flex: 1 1 200px; min-width: 0; min-height: 44px; resize: none; }
.composer-btn { flex: none; width: 44px; height: 44px; cursor: pointer; }
.composer-send { flex: none; height: 44px; }
.composer-hint { width: 100%; margin: 0; font-size: 11.5px; color: var(--muted); text-align: right; }
@media (max-width: 640px) {
  .chat { padding: 14px 10px; min-height: 300px; }
  .msg { max-width: 88%; }
  .chat-head { padding: 14px; }
}

/* ===== Главная v2 (home_v2.php) ===== */
.hv-hero { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 84px) 0 clamp(32px, 5vw, 56px); }
.hv-grid-bg { position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(70% 80% at 50% 20%, #000, transparent); mask-image: radial-gradient(70% 80% at 50% 20%, #000, transparent); pointer-events: none; }
.hv-orb { position: absolute; right: -8%; top: -24%; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(circle, rgba(124, 92, 255, .3), rgba(34, 211, 238, .08) 50%, transparent 70%); pointer-events: none; }
.hv-hero-in { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hv-copy h1 { margin-top: 18px; font-size: clamp(30px, 4.4vw, 52px); font-weight: 800; letter-spacing: -.035em; line-height: 1.08; }
.hv-copy > p { margin-top: 16px; max-width: 580px; font-size: clamp(15px, 1.5vw, 18px); color: var(--text-2); }
.hv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hv-notes { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 20px; font-size: 13.5px; color: var(--muted); }
.hv-notes span { display: inline-flex; align-items: center; gap: 6px; }
.hv-notes svg { color: var(--ok-ink); }
.hv-panel { padding: 8px; border-radius: var(--r-xl); background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); min-width: 0; }
.hv-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; font-size: 13.5px; font-weight: 700; }
.hv-panel-head > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hv-panel-head a { color: var(--muted); display: flex; }
.hv-panel-empty { padding: 20px 14px; }
.hv-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); color: inherit; text-decoration: none; transition: background var(--t-fast); }
.hv-row:hover { background: var(--surface-2); }
.hv-logo { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; overflow: hidden; background: var(--surface-3); color: var(--accent-ink); font-size: 13px; font-weight: 800; }
.hv-logo img { width: 100%; height: 100%; object-fit: contain; }
.hv-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hv-row-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.hv-meter { display: block; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hv-meter span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.hv-meter.is-busy span { background: var(--warn); }
.hv-row-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.hv-row-side small { font-size: 11.5px; }
.hv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.hv-stats > div { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.hv-stats span { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.hv-stats b { font-size: 22px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.hv-stats b.hv-rate { font-size: 15px; }
.hv-stats small { color: var(--muted); font-size: 12.5px; }
.hv-head { max-width: 760px; margin: 0 auto 30px; text-align: center; }
.hv-head h2, .hv-split h2 { margin-top: 8px; font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.hv-head p { margin-top: 10px; color: var(--muted); }
.hv-steps { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; counter-reset: st; }
.hv-steps::before { content: ""; position: absolute; left: 6%; right: 6%; top: 25px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: .4; }
.hv-steps li { position: relative; }
.hv-step-ic { position: relative; width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 10px 24px -10px rgba(124, 92, 255, .8); }
.hv-steps h3 { margin-top: 16px; font-size: 16px; font-weight: 700; }
.hv-steps p { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.hv-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 48px); align-items: center; }
.hv-split > div > p { margin-top: 10px; }
.hv-checks { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.hv-checks li { display: flex; gap: 10px; }
.hv-checks svg { flex: none; margin-top: 3px; color: var(--ok-ink); }
.hv-checks b, .hv-checks small { display: block; }
.hv-checks small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.hv-tl-title { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 15px; }
.hv-final { position: relative; overflow: hidden; margin-top: 32px; padding: clamp(32px, 5vw, 56px) 24px; border-radius: var(--r-xl); text-align: center; color: #fff; background: var(--grad); }
.hv-final h2 { max-width: 760px; margin: 0 auto; font-size: clamp(22px, 3vw, 32px); font-weight: 800; letter-spacing: -.02em; }
.hv-final .hv-actions { justify-content: center; }
.hv-final .btn-primary { background: #fff; color: #3b2bb5; box-shadow: none; }
@media (max-width: 960px) {
  .hv-hero-in, .hv-split { grid-template-columns: 1fr; }
  .hv-stats, .hv-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hv-steps::before { display: none; }
}
@media (max-width: 520px) {
  .hv-stats > div { padding: 12px; column-gap: 10px; }
  .hv-steps { grid-template-columns: 1fr; }
  .hv-actions .btn { flex: 1 1 100%; }
}

/* Фон-сеть на всех страницах (рисует app.js). Под контентом и не ловит клики */
.bg-net { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }
.section-alt { background: color-mix(in srgb, var(--bg-2) 55%, transparent); }

/* ===== Обращения в админке ===== */
.tk-ava { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--grad); }
.tk-ava.lg { width: 48px; height: 48px; font-size: 18px; }
.tk-adm:hover { background: var(--surface-2); }
.tk-link { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-link:hover b { color: var(--accent-ink); }
.tk-assigned { flex: none; display: inline-flex; align-items: center; gap: 5px; }
.tk-adm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.tk-adm-layout > aside { position: sticky; top: 80px; }
.tk-adm-layout .chat { max-height: calc(100vh - 300px); }
.tk-profile { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.tk-status { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; overflow: visible; flex-wrap: wrap; }
.tk-status button { white-space: normal; }
@media (max-width: 1050px) {
  .tk-adm-layout { grid-template-columns: minmax(0, 1fr); }
  .tk-adm-layout > aside { position: static; }
}
@media (max-width: 640px) { .tk-assigned { display: none; } }

/* ===== Разделы админки в новом стиле ===== */
.admin-content a.stat { color: inherit; text-decoration: none; transition: border-color var(--t-fast), transform var(--t-fast); }
.admin-content a.stat:hover { border-color: var(--line-2); transform: translateY(-2px); }
.dep-row, .rn-row { flex-wrap: wrap; }
.dep-row .tk-main, .rn-row .tk-main { flex: 1 1 200px; }
.dep-sum { flex: none; min-width: 90px; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.dep-sum b { font-size: 15px; }
.dep-sum small { font-size: 11.5px; }
.dep-acts { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: flex-end; }
.rn-times { flex: none; display: flex; flex-direction: column; gap: 2px; }
.rn-times span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.rn-live { display: grid; gap: 6px; margin-bottom: 18px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.rn-live b { font-size: 28px; font-weight: 800; line-height: 1.1; }
.adm-stats > div { flex: 1; }
.tk-row .drv-ic { font-size: 13px; font-weight: 800; }
.adm-wallet { padding: 12px 18px; border-radius: var(--r-lg); color: #fff; background: var(--grad); box-shadow: 0 12px 30px -14px rgba(124, 92, 255, .8); }
@media (max-width: 640px) { .dep-acts { width: 100%; justify-content: flex-start; } .rn-times { width: 100%; flex-direction: row; gap: 12px; flex-wrap: wrap; } }

/* ===== Мастера, аккаунты, очередь, отчёты ===== */
.is-off { opacity: .55; }
.row-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.ac-list { display: flex; flex-direction: column; padding: 4px 12px 12px; }
.ac-row { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(130px, 1fr) minmax(90px, .8fr) minmax(90px, .8fr) minmax(120px, .9fr) auto; gap: 12px; align-items: center; padding: 12px 10px; border-radius: var(--r); }
.ac-row:hover { background: var(--surface-2); }
.ac-row + .ac-row { border-top: 1px solid var(--line); }
.ac-login, .ac-status { min-width: 0; overflow-wrap: anywhere; }
.ac-lbl { display: block; margin-bottom: 2px; font-size: 11px; color: var(--muted); }
.ac-acts { display: flex; justify-content: flex-end; gap: 2px; }
.rep-bars { height: 130px; }
@media (max-width: 1100px) {
  .ac-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-acts { grid-column: 1 / -1; }
}
@media (max-width: 640px) { .ac-row { grid-template-columns: minmax(0, 1fr); } .ac-acts { justify-content: flex-start; } }

/* Строки списков админки: столбцы одной ширины, чтобы данные шли ровно друг под другом */
.gr-row { display: grid; align-items: center; column-gap: 14px; }
.gr-row .tk-main { min-width: 0; }
.gr-rent { grid-template-columns: 40px minmax(0, 1fr) 56px 160px 96px 210px; }
.gr-user { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 260px) 70px 150px; }
.gr-wait { grid-template-columns: 40px minmax(0, 1fr) 190px 160px 130px; }
.gr-dep { grid-template-columns: 40px minmax(0, 1fr) 150px minmax(0, 420px); }
.gr-tick { grid-template-columns: 40px minmax(0, 1fr) 44px 130px 200px; }
.gr-end { display: flex; justify-content: flex-end; }
.gr-row .dep-sum { min-width: 0; }
.gr-row .rn-times { width: auto; }
@media (max-width: 1100px) {
  .gr-row { display: flex; flex-wrap: wrap; }
  .gr-row .tk-main { flex: 1 1 calc(100% - 60px); }
  .gr-row .gr-slot:empty { display: none; }
}
