/* SwanLit v5.3 — «Тёмный бутик-издательство» (по мотивам Apple Books / Storytel) */
/* Тёплая «бумажная» светлая тема (Ivory White) — базовая */
:root {
  --bg-page: #F5F0E6;
  --bg-surface: #FDFBF7;
  --bg-card: #FDFBF7;
  --bg-card-hover: #EFE8DA;
  --bg-input: #EFE8DA;
  --line: #E3DACA;
  --line-strong: #C5A059;
  --text-main: #1B3239;
  --text-muted: #61767C;
  --accent: #A07E3B;
  --accent-hover: #9E7D37;
  --accent-light: #F6EDDA;
  --gold: #C5A059;
  --gold-light: #F6EDDA;
  --blue: #16353E;
  --blue-light: #EBF3F5;
  --sl-teal: #7A9A95;
  --sl-sage: #8FA882;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 8px rgba(27,50,57,0.05);
  --shadow-md: 0 12px 28px -6px rgba(27,50,57,0.10);
  --shadow-lg: 0 22px 44px -14px rgba(27,50,57,0.14);
  --book-shadow: 0 16px 36px -10px rgba(27,50,57,0.24), 0 0 0 1px rgba(197,160,89,0.18);
  --glow-gold: radial-gradient(900px 420px at 12% -6%, rgba(197,160,89,0.10) 0%, transparent 60%);
  --glow-teal: radial-gradient(800px 480px at 88% 4%, rgba(122,154,149,0.10) 0%, transparent 55%);
}

/* «Тёмный бутик» — основная премиум-тема */
[data-site-theme="dark"] {
  --bg-page: #0A1B21;
  --bg-surface: #0F2830;
  --bg-card: rgba(255,255,255,0.035);
  --bg-card-hover: rgba(255,255,255,0.06);
  --bg-input: rgba(255,255,255,0.05);
  --line: rgba(253,251,247,0.09);
  --line-strong: rgba(223,191,122,0.35);
  --text-main: #F4EFE6;
  --text-muted: #93A9AE;
  --accent: #DFBF7A;
  --accent-hover: #C5A059;
  --accent-light: rgba(223,191,122,0.12);
  --gold: #DFBF7A;
  --gold-light: rgba(223,191,122,0.12);
  --blue: #7A9A95;
  --blue-light: rgba(122,154,149,0.15);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.35);
  --shadow-md: 0 14px 34px rgba(0,0,0,0.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.55);
  --book-shadow: 0 20px 44px rgba(0,0,0,0.65), 0 0 0 1px rgba(223,191,122,0.22);
  --glow-gold: radial-gradient(900px 420px at 12% -6%, rgba(197,160,89,0.14) 0%, transparent 60%);
  --glow-teal: radial-gradient(800px 480px at 88% 4%, rgba(122,154,149,0.12) 0%, transparent 55%);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Глобальная защита от горизонтального скролла на всех смартфонах */
html, body {
  margin: 0; padding: 0; background: var(--bg-page); color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.5; transition: background-color .2s, color .2s;
  overflow-x: hidden; max-width: 100vw; width: 100%;
}
/* Композиция фона: золотое свечение сверху слева, бирюзовое — справа */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--glow-gold), var(--glow-teal), var(--bg-page);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, .hero-title, .book-page-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  letter-spacing: 0.2px;
}

/* Контейнер */
#app, .app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
}
.main-view {
  flex: 1 0 auto;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}
footer.swanlit-footer {
  margin-top: auto;
  width: 100%;
}

/* Шапка */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg-surface) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(223,191,122,0.12);
  padding: 12px 24px;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; width: 100%;
}
.logo-group {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.logo-badge {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--sl-teal), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; color: #ffffff;
  box-shadow: 0 4px 14px rgba(197,160,89,0.35); flex-shrink: 0;
}
.logo-badge-img {
  width: 40px; height: 40px; border-radius: 10px; object-fit: contain;
  flex-shrink: 0; filter: drop-shadow(0 2px 6px rgba(22,53,62,0.18));
}
.logo-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 24px; font-weight: 700; letter-spacing: 0.2px; line-height: 1.1;
  color: var(--text-main);
}
.logo-tag {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 10px; font-weight: 800; background: var(--gold-light); color: var(--gold);
  border: 1px solid var(--accent);
  padding: 2px 7px; border-radius: 6px; text-transform: uppercase; margin-left: 6px;
  letter-spacing: 0.05em; vertical-align: middle;
}

.header-search { flex: 1; max-width: 460px; position: relative; }
.header-search input {
  width: 100%; padding: 10px 16px 10px 40px; border-radius: 999px;
  background: var(--bg-input); border: 1px solid var(--line); color: var(--text-main);
  font-size: 14px; outline: none; transition: all .2s;
}
.header-search input:focus { border-color: var(--accent); background: var(--bg-surface); box-shadow: 0 0 0 3px rgba(197,160,89,0.2); }
.header-search .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: .5; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-btn {
  width: 36px; height: 36px; border-radius: 50%; background: var(--bg-input);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-main); transition: all .15s; flex-shrink: 0;
}
.theme-btn:hover { background: var(--line); }

.btn-author-mode {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; font-weight: 700; font-size: 13.5px; padding: 9px 16px;
  border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(245,158,11,0.3); transition: transform .15s, box-shadow .15s; flex-shrink: 0;
}
.btn-author-mode:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(245,158,11,0.45); }
.studio-rate-badge {
  background: #fff; color: #d97706; font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 900;
}
.header-admin-btn {
  padding: 8px 14px; font-size: 13px; border-color: rgba(59,130,246,0.4); color: var(--blue);
}

/* Нижняя навигация */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
  background: var(--bg-surface); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  display: flex; justify-content: center; padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
}
.nav-inner { max-width: 650px; width: 100%; display: flex; justify-content: space-around; }
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; color: var(--text-muted); font-size: 11.5px; font-weight: 700;
  border-radius: var(--radius-sm); transition: color .15s;
}
.nav-item.active { color: var(--accent); }
.nav-item { position: relative; }
.nav-badge { position: absolute; top: 0; right: calc(50% - 22px); min-width: 17px; height: 17px; padding: 0 4px; align-items: center; justify-content: center; border-radius: 999px; background: #ef4444; color: #fff; font-size: 9px; line-height: 1; }

/* Основной контент */
.main-view { padding: 24px; flex: 1; width: 100%; max-width: 100%; }

/* ---------- ВИТРИНА / КАТАЛОГ ---------- */
.hero-banner {
  background:
    radial-gradient(600px 300px at 78% 0%, rgba(197,160,89,0.22) 0%, transparent 60%),
    linear-gradient(128deg, #0A1B21 0%, #122E37 52%, #143A3E 100%);
  border: 1px solid rgba(223,191,122,0.28);
  border-radius: 24px; padding: 36px; margin-bottom: 36px;
  display: flex; gap: 32px; align-items: center; box-shadow: var(--shadow-lg);
  color: #F4EFE6; position: relative; overflow: hidden; width: 100%;
}
.hero-banner::after {
  content: ''; position: absolute; right: -80px; bottom: -80px; width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(122,154,149,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-cover {
  width: 176px; height: 264px; aspect-ratio: 2 / 3; border-radius: 12px; flex-shrink: 0;
  background-size: cover; background-position: center;
  box-shadow: var(--book-shadow); border: 1px solid rgba(223,191,122,0.35);
  transform: rotate(-2deg);
}
.hero-info { flex: 1; z-index: 1; min-width: 0; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(223,191,122,0.12); border: 1px solid rgba(223,191,122,0.4); color: #DFBF7A;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 999px; margin-bottom: 14px;
}
.hero-title { font-size: 34px; font-weight: 700; line-height: 1.18; margin: 0 0 10px; color: #FDFBF7; }
.hero-author { font-size: 15.5px; color: #DFBF7A; font-weight: 700; margin-bottom: 14px; }
.hero-desc { font-size: 14.5px; color: rgba(244,239,230,0.82); line-height: 1.65; margin-bottom: 22px; max-width: 680px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.btn-primary {
  background: linear-gradient(135deg, #E8C77E, #C5A059);
  color: #12262C !important; font-weight: 800; font-size: 14.5px; padding: 12px 24px;
  border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(197,160,89,0.35); transition: all .15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(197,160,89,0.5); }
[data-site-theme="light"] .btn-primary { color: #FDFBF7 !important; }

.btn-secondary {
  background: var(--bg-surface); border: 1px solid var(--line-strong);
  color: var(--text-main); font-weight: 700; font-size: 14px; padding: 11px 20px;
  border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-sm); transition: all .15s;
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--accent); }

/* Пустой результат каталога */
.catalog-empty {
  width: 100%; text-align: center; padding: 60px 20px; background: var(--bg-card);
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.catalog-empty-icon { font-size: 44px; }
.catalog-empty h3 { margin: 6px 0 0; font-size: 18px; font-weight: 800; color: var(--text-main); }
.catalog-empty p { margin: 0 0 16px; color: var(--text-muted); font-size: 14px; }

/* Сортировка и фильтры */
.catalog-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 24px; width: 100%;
}
.genre-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; max-width: 100%; }
.pill {
  padding: 8px 18px; border-radius: 999px; background: var(--bg-surface);
  border: 1px solid var(--line); font-size: 13.5px; font-weight: 700; color: var(--text-muted);
  box-shadow: var(--shadow-sm); white-space: nowrap; transition: all .15s;
}
.pill.active, .pill:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

.sort-select {
  padding: 8px 14px; border-radius: var(--radius-sm); background: var(--bg-surface);
  border: 1px solid var(--line); color: var(--text-main); font-size: 13.5px; font-weight: 700; outline: none;
}
.catalog-toolbar-actions { display: flex; align-items: center; gap: 10px; }
.catalog-view-toggle { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-surface); }
.catalog-view-btn { width: 34px; height: 30px; border-radius: 6px; color: var(--text-muted); font-size: 18px; font-weight: 800; transition: all .15s; }
.catalog-view-btn:hover, .catalog-view-btn.active { background: var(--accent); color: #fff; }

/* Сетка книг — СТРОГО ВЫРОВНЕННАЯ */
.book-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 16px; width: 100%;
}
.book-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: all .22s ease; position: relative; height: 100%;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.book-card:hover {
  transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--line-strong);
}
.book-card-cover-wrap {
  position: relative; width: 100%; aspect-ratio: 2 / 3; background: #070d18; overflow: hidden;
}
.book-card-cover {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  background-size: cover; background-position: center; transition: transform .3s;
}
.book-card:hover .book-card-cover { transform: scale(1.04); }
.book-card-badge {
  position: absolute; top: 12px; left: 12px;
  background: rgba(22,53,62,0.92); color: #DFBF7A; border: 1px solid rgba(223,191,122,0.3);
  font-size: 11.5px; font-weight: 800; padding: 4px 9px; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.book-card-like-btn {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25); transition: transform .15s;
}
.book-card-like-btn:hover { transform: scale(1.15); }

.book-card-body { padding: 13px; flex: 1; display: flex; flex-direction: column; }
.book-card-genre { font-size: 11px; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.book-card-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16.5px; font-weight: 700; line-height: 1.28; margin: 0 0 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 2.65em;
}
.book-card-author {
  font-size: 12.5px; color: var(--text-muted); margin-bottom: 9px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.book-card-stats {
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted);
  margin-bottom: 10px; flex-wrap: wrap;
}
.stat-star { color: #f59e0b; font-weight: 800; display: inline-flex; align-items: center; gap: 4px; }

.book-card-footer {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.book-card-price { font-weight: 900; font-size: 15px; color: var(--gold); }
.book-card-tag { font-size: 11px; color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

/* Компактный список с предпросмотром книги справа */
.catalog-list-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.book-list { display: flex; flex-direction: column; gap: 8px; }
.book-list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 13px 16px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); cursor: pointer; transition: all .16s; }
.book-list-row:hover { border-color: var(--accent); background: var(--bg-card-hover); transform: translateX(3px); }
.book-list-main { min-width: 0; }
.book-list-main h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-list-main div { color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-list-rating { color: #f59e0b; font-size: 12px; font-weight: 800; white-space: nowrap; }
.book-list-rating span { color: var(--text-muted); }
.book-list-price { color: var(--gold); font-size: 14px; font-weight: 900; white-space: nowrap; }
.catalog-preview { position: sticky; top: 82px; padding: 18px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.catalog-preview-cover { width: 154px; aspect-ratio: 2 / 3; margin: 0 auto 15px; border-radius: 10px; background-size: cover; background-position: center; box-shadow: var(--book-shadow); }
.catalog-preview-title { margin: 5px 0 6px; font-size: 18px; line-height: 1.3; }
.catalog-preview-author { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
.catalog-preview-description { color: var(--text-muted); font-size: 12.5px; line-height: 1.55; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.catalog-preview-meta { display: flex; align-items: center; gap: 12px; padding-top: 12px; margin-bottom: 14px; border-top: 1px solid var(--line); font-size: 12px; }
.catalog-preview-meta strong { margin-left: auto; color: var(--gold); font-size: 15px; }
.catalog-preview-open { width: 100%; justify-content: center; }
.catalog-preview-empty { color: var(--text-muted); text-align: center; padding: 40px 10px; }

/* Библиотека и центр уведомлений */
.reader-loading { padding: 80px 20px; text-align: center; color: var(--text-muted); font-weight: 700; }
.reader-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.reader-section-head h1 { margin: 0 0 5px; font-size: 28px; }
.reader-section-head p { margin: 0; color: var(--text-muted); font-size: 13.5px; }
.reader-feature-gate, .reader-empty { max-width: 580px; margin: 70px auto; padding: 36px; text-align: center; background: var(--bg-card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-md); }
.reader-feature-icon, .reader-empty > div { font-size: 46px; margin-bottom: 10px; }
.reader-feature-gate h2, .reader-empty h2 { margin: 0 0 8px; }
.reader-feature-gate p, .reader-empty p { margin: 0 0 20px; color: var(--text-muted); }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.library-card { display: flex; min-width: 0; overflow: hidden; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); cursor: pointer; transition: all .18s; }
.library-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.library-cover { width: 106px; min-height: 159px; flex-shrink: 0; background-size: cover; background-position: center; }
.library-info { display: flex; flex-direction: column; min-width: 0; flex: 1; padding: 14px; }
.library-info h3 { margin: 3px 0 4px; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.library-info p { margin: 0 0 8px; color: var(--text-muted); font-size: 12px; }
.following-label { color: var(--accent); font-size: 11px; font-weight: 800; margin-bottom: 9px; }
.library-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.library-progress-label { color: var(--text-muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.library-progress-track { height: 4px; margin: 5px 0 9px; overflow: hidden; border-radius: 999px; background: var(--line); }
.library-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.library-continue { padding: 7px 10px; border-radius: 7px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; }
.library-status { min-width: 0; flex: 1; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-input); color: var(--text-main); font-size: 11.5px; font-weight: 700; }
.library-remove { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 7px; color: var(--text-muted); }
.library-remove:hover { border-color: #ef4444; color: #ef4444; }
.reader-action-active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.notifications-list { display: flex; flex-direction: column; gap: 9px; max-width: 840px; }
.notification-item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 15px 17px; text-align: left; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.notification-item:hover { border-color: var(--accent); }
.notification-item.unread { background: var(--accent-light); border-color: rgba(197,160,89,.4); }
.notification-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 10px; background: var(--bg-surface); font-size: 20px; }
.notification-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.notification-body strong { font-size: 14px; }
.notification-body span { color: var(--text-muted); font-size: 12.5px; }
.notification-body small { color: var(--text-muted); font-size: 10.5px; margin-top: 4px; }
.notification-item i { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--accent); }

@media (max-width: 900px) {
  .catalog-list-layout { grid-template-columns: 1fr; }
  .catalog-preview { display: none; }
}
@media (max-width: 600px) {
  .catalog-toolbar-actions { width: 100%; justify-content: space-between; }
  .sort-select { min-width: 0; max-width: calc(100% - 86px); }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .book-list-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .book-list-rating { display: none; }
  .reader-section-head { align-items: stretch; flex-direction: column; }
  .reader-section-head h1 { font-size: 23px; }
  .library-grid { grid-template-columns: 1fr; }
  .reader-feature-gate, .reader-empty { margin: 35px auto; padding: 25px 18px; }
  .notification-item { padding: 12px; gap: 10px; }
}

/* ---------- СТРАНИЦА КНИГИ ---------- */
.book-page { max-width: 1040px; margin: 0 auto; width: 100%; }
.book-header-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 20px;
  padding: 36px; display: flex; gap: 36px; box-shadow: var(--shadow-md); margin-bottom: 28px; width: 100%;
}
.book-page-cover {
  width: 250px; height: 375px; aspect-ratio: 2 / 3; border-radius: 14px; flex-shrink: 0;
  background-size: cover; background-position: center; box-shadow: var(--book-shadow);
}
.book-page-info { flex: 1; min-width: 0; }
.book-page-title { font-size: 28px; font-weight: 900; line-height: 1.25; margin: 0 0 12px; word-break: break-word; }
.book-page-author {
  font-size: 18px; color: var(--gold); font-weight: 800; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.book-meta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.meta-tag {
  background: var(--bg-input); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 12px; font-size: 12.5px; color: var(--text-muted); font-weight: 700;
}
.meta-tag.highlight { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }

.book-pricing-box {
  background: var(--bg-input); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 24px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.price-tag-big { font-size: 28px; font-weight: 900; color: var(--text-main); }
.price-tag-big span { font-size: 14px; font-weight: 600; color: var(--text-muted); }

/* Оглавление */
.chapters-section {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; margin-bottom: 28px; box-shadow: var(--shadow-sm); width: 100%;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 8px;
}
.section-header h3 { margin: 0; font-size: 20px; font-weight: 800; }
.chapters-list { display: flex; flex-direction: column; gap: 10px; }
.chapter-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: var(--bg-page); border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; transition: all .15s;
}
.chapter-item:hover { background: var(--bg-card-hover); border-color: var(--line-strong); }
.chapter-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.chapter-num {
  width: 32px; height: 32px; border-radius: 50%; background: var(--bg-surface);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: var(--text-muted); flex-shrink: 0;
}
.chapter-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.badge-free-ch {
  background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent);
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 800;
}
.badge-locked-ch {
  background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
}

/* Файлы книги с защитой */
.files-vault-box {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 28px; box-shadow: var(--shadow-sm); width: 100%;
}
.files-vault-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.files-vault-header h4 { margin: 0; font-size: 17px; font-weight: 800; }
.vault-badge-locked {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold-light); color: var(--gold); font-size: 12px; font-weight: 800;
  padding: 3px 10px; border-radius: 6px;
}
.vault-badge-unlocked {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-light); color: var(--accent); font-size: 12px; font-weight: 800;
  padding: 3px 10px; border-radius: 6px;
}
.vault-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; }
.vault-card {
  padding: 16px; border-radius: var(--radius-sm); background: var(--bg-page);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: all .15s;
}
.vault-card:hover { border-color: var(--accent); }

/* Отзывы и рецензии */
.reviews-section {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm); width: 100%;
}
.review-card {
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.review-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.review-author { font-weight: 700; font-size: 14.5px; }
.review-rating { color: #f59e0b; font-size: 14px; }
.review-text { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ---------- УНИВЕРСАЛЬНЫЙ МУЛЬТИФОРМАТНЫЙ РИДЕР ---------- */
.reader-container {
  position: fixed; inset: 0; z-index: 60; background: var(--r-bg, #ffffff);
  color: var(--r-text, #0f172a); display: flex; flex-direction: column; overflow: hidden;
  width: 100vw; max-width: 100vw;
}
.reader-topbar {
  padding: 12px 24px; background: var(--r-bg, #ffffff);
  border-bottom: 1px solid var(--r-line, #e2e8f0);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  width: 100%;
}
.reader-title { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.reader-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-control {
  padding: 7px 14px; background: var(--r-btn-bg, #f1f5f9); border: 1px solid var(--r-line, #cbd5e1);
  border-radius: 8px; font-size: 13.5px; font-weight: 700; color: inherit;
}
.btn-control:hover { opacity: .85; }

.reader-progress-bar { height: 3px; background: var(--r-line, #e2e8f0); width: 100%; flex-shrink: 0; }
.reader-progress-fill { height: 100%; width: 0%; background: var(--accent); }

.reader-scroll-area { flex: 1; overflow-y: auto; padding: 40px 24px 100px; width: 100%; }
.reader-bookmarks-drawer { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); padding: 20px; transform: translateX(105%); transition: transform .22s ease; background: var(--r-bg, #fff); color: var(--r-text, #0f172a); border-left: 1px solid var(--r-line, #e2e8f0); box-shadow: -12px 0 34px rgba(15,23,42,.18); }
.reader-bookmarks-drawer.open { transform: translateX(0); }
.reader-bookmarks-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 20px; }
.reader-bookmarks-head button { width: 34px; height: 34px; border-radius: 8px; background: var(--r-btn-bg, #f1f5f9); }
.reader-add-bookmark { width: 100%; padding: 11px; margin-bottom: 14px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 800; }
.reader-bookmarks-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 115px); overflow-y: auto; }
.reader-bookmark-item { display: flex; align-items: stretch; overflow: hidden; border: 1px solid var(--r-line, #e2e8f0); border-radius: 9px; }
.reader-bookmark-jump { flex: 1; min-width: 0; padding: 11px; text-align: left; }
.reader-bookmark-jump strong, .reader-bookmark-jump span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-bookmark-jump strong { font-size: 12.5px; }
.reader-bookmark-jump span { color: var(--text-muted); font-size: 11px; margin-top: 3px; }
.reader-bookmark-delete { width: 38px; border-left: 1px solid var(--r-line, #e2e8f0); color: #ef4444; }
.reader-bookmarks-empty { padding: 30px 10px; text-align: center; color: var(--text-muted); font-size: 13px; }
.reader-article {
  max-width: 740px; margin: 0 auto; width: 100%;
  font-family: 'Literata', 'Georgia', serif; font-size: var(--r-fs, 19px); line-height: 1.8;
}
.reader-article.comic-mode {
  max-width: 900px;
}
.reader-article.comic-mode p {
  text-indent: 0;
}
.reader-article h2 {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 26px; font-weight: 900; margin-bottom: 32px; line-height: 1.3;
}
.reader-article p { margin-bottom: 1.3em; text-indent: 1.6em; }
.reader-article p:first-of-type { text-indent: 0; }

/* Поддержка иллюстраций и графики в ридере */
.reader-fig {
  margin: 32px 0; text-align: center;
}
.reader-zoom-img {
  max-width: 100%; height: auto; border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.2); border: 1px solid var(--r-line, #e2e8f0);
  cursor: zoom-in; transition: transform .2s; display: inline-block;
}
.reader-zoom-img:hover { transform: scale(1.015); }
.reader-fig figcaption {
  font-size: 13.5px; color: var(--text-muted); margin-top: 10px; font-style: italic;
  font-family: -apple-system, sans-serif;
}

/* Темы ридера */
.reader-container[data-theme="light"] {
  --r-bg: #ffffff; --r-text: #0f172a; --r-line: #e2e8f0; --r-btn-bg: #f8fafc;
}
.reader-container[data-theme="sepia"] {
  --r-bg: #fbf0d9; --r-text: #2d261e; --r-line: #e4d5b7; --r-btn-bg: #ecd9b7;
}
.reader-container[data-theme="dark"] {
  --r-bg: #0b1120; --r-text: #e2e8f0; --r-line: #1e293b; --r-btn-bg: #1e293b;
}

.reader-footer {
  padding: 14px 24px; background: var(--r-bg, #ffffff);
  border-top: 1px solid var(--r-line, #e2e8f0);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  width: 100%;
}

/* ==================== КАБИНЕТ АВТОРА / СТУДИЯ 2.0 ==================== */
.author-studio { max-width: 1040px; margin: 0 auto; width: 100%; }

/* Навигационное выпадающее меню студии */
.studio-nav-dropdown-wrapper {
  position: relative;
  margin-bottom: 24px;
  width: 100%;
}
.studio-nav-selector-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}
.studio-nav-selector-btn:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}
.studio-nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(12px);
  box-sizing: border-box;
}
.studio-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}
.studio-nav-item:hover {
  background: var(--bg-surface);
  color: var(--accent);
}
.studio-nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* Навигационные вкладки студии (десктоп) */
.studio-tabs {
  display: flex; gap: 8px; margin-bottom: 24px; overflow-x: auto; padding-bottom: 4px;
}
.studio-tab-btn {
  padding: 10px 20px; border-radius: var(--radius-sm); background: var(--bg-surface);
  border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: all .15s;
}
.studio-tab-btn:hover { background: var(--bg-card-hover); color: var(--text-main); }
.studio-tab-btn.active {
  background: var(--accent-light); color: var(--accent); border-color: var(--accent);
}

.studio-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 20px;
  padding: 32px; box-shadow: var(--shadow-sm); margin-bottom: 24px; width: 100%; box-sizing: border-box;
}

/* Сетка книг автора в кабинете */
.author-books-list { display: flex; flex-direction: column; gap: 16px; }
.author-book-item {
  background: var(--bg-page); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; gap: 20px; align-items: center; transition: all .15s;
}
.author-book-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.author-book-thumb {
  width: 80px; height: 120px; aspect-ratio: 2 / 3; border-radius: 8px; flex-shrink: 0;
  background-size: cover; background-position: center; box-shadow: var(--shadow-sm);
}
.author-book-details { flex: 1; min-width: 0; }
.author-book-title { font-size: 18px; font-weight: 800; margin: 0 0 4px; word-break: break-word; }
.author-book-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.author-book-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Панель инструментов редактора текста */
.editor-toolbar {
  display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px; background: var(--bg-page);
  border: 1px solid var(--line); border-bottom: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tb-btn {
  padding: 6px 12px; border-radius: 6px; background: var(--bg-surface);
  border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--text-main);
  transition: all .15s;
}
.tb-btn:hover { background: var(--line); }
.tb-btn.highlight { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

.editor-textarea {
  width: 100%; padding: 16px; background: var(--bg-input); border: 1px solid var(--line);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); color: var(--text-main);
  font-family: 'Literata', 'Georgia', serif; font-size: 16px; line-height: 1.7; outline: none;
  min-height: 380px; resize: vertical; box-sizing: border-box;
}
.editor-textarea:focus { border-color: var(--accent); }

/* Шаги мастера создания: на десктопе в ряд, на мобильных в сетку БЕЗ сдвига! */
.studio-wizard-steps {
  display: flex; justify-content: space-between; gap: 8px; margin-bottom: 24px;
  background: var(--bg-card); padding: 14px 20px; border-radius: var(--radius);
  border: 1px solid var(--line); width: 100%; box-sizing: border-box;
}
.step-item {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700;
  color: var(--text-muted); min-width: 0;
}
.step-item.active { color: var(--accent); }
.step-item .circle {
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg-input);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.step-item.active .circle { background: var(--accent); color: #fff; }
.step-item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Формы */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; width: 100%; }
.form-group label { font-size: 13.5px; font-weight: 700; color: var(--text-main); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--text-main); font-size: 14px; outline: none; transition: border-color .15s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--accent); }
.password-wrap { position: relative; width: 100%; }
.password-wrap input { padding-right: 46px; }
.password-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 8px; border: none;
  background: transparent; cursor: pointer; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center; opacity: .75; transition: opacity .15s;
}
.password-toggle:hover { opacity: 1; background: var(--bg-card-hover); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; }

/* Презентационный ридер прямо в студии */
.live-preview-box {
  background: var(--bg-page); border: 2px dashed var(--accent); border-radius: var(--radius);
  padding: 24px; margin-top: 24px; width: 100%; box-sizing: border-box;
}
.live-preview-box h4 { margin: 0 0 12px; font-size: 16px; font-weight: 800; color: var(--accent); }

/* Модалки и Лайтбокс */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 20px;
  max-width: 500px; width: 100%; padding: 32px; box-shadow: var(--shadow-lg); position: relative;
}
.modal-close { position: absolute; top: 20px; right: 20px; font-size: 20px; color: var(--text-muted); }

.lightbox-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out;
}
.lightbox-img {
  max-width: 95vw; max-height: 92vh; object-fit: contain; border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

/* Адаптив под мобильные телефоны (iPhone, Android) */
@media (max-width: 768px) {
  .header { padding: 10px 14px; }
  .header-inner { gap: 8px; }
  .header-actions { gap: 6px; }
  .header-actions .lbl { display: none; }
  .logo-text { font-size: 18px; }
  .logo-tag { display: none; }
  .btn-author-mode { padding: 9px; gap: 4px; }
  .btn-author-mode .studio-rate-badge { display: none; }
  .header-admin-btn { padding: 8px 11px !important; }
  .user-profile-btn { padding: 6px 10px; }
  .btn-auth-header { padding: 8px 12px; }
  .main-view { padding: 14px; }
  .hero-banner { flex-direction: column; align-items: flex-start; padding: 20px; gap: 16px; border-radius: 16px; }
  .hero-cover { width: 120px; height: 180px; align-self: center; }
  .hero-title { font-size: 22px; text-align: center; }
  .hero-author { text-align: center; }
  .hero-cta { justify-content: center; width: 100%; }

  .book-header-card { flex-direction: column; align-items: center; text-align: center; padding: 20px 14px; }
  .book-page-cover { width: 190px; height: 285px; }
  .book-page-title { font-size: 22px; }
  .book-meta-row { justify-content: center; }
  .form-row { grid-template-columns: 1fr; }
  .header-search { order: 3; max-width: 100%; width: 100%; margin-top: 4px; }

  /* Устраняем сдвиг шагов мастера на смартфонах */
  .studio-wizard-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 12px;
  }
  .step-item { font-size: 12px; }
  .step-item .circle { width: 22px; height: 22px; font-size: 11px; }

  .author-book-item { flex-direction: column; align-items: flex-start; }
  .author-book-thumb { width: 100px; height: 150px; align-self: center; }

  .studio-card { padding: 20px 14px; border-radius: 16px; }
  .reader-topbar { padding: 10px 14px; }
  .reader-title { display: none; }
  .reader-controls { gap: 4px; min-width: 0; }
  .reader-controls .btn-control { padding: 6px 8px; font-size: 12px; }
  #r-back-btn span, #r-mode-toggle { display: none; }
  #r-audio-toggle { padding: 6px 9px !important; }
  .reader-scroll-area { padding: 24px 14px 80px; }
  .reader-article h2 { font-size: 22px; margin-bottom: 20px; }
}

/* ==================== АВТОРИЗАЦИЯ И ПОЛЬЗОВАТЕЛИ ==================== */
.btn-auth-header {
  padding: 8px 16px; border-radius: 999px; background: var(--bg-surface);
  border: 1px solid var(--line-strong); font-size: 13.5px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px; color: var(--text-main);
  transition: all .15s; flex-shrink: 0; box-shadow: var(--shadow-sm);
}
.btn-auth-header:hover { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }

.user-profile-menu {
  position: relative; display: inline-flex; align-items: center;
}
.user-profile-btn {
  padding: 6px 14px; border-radius: 999px; background: var(--bg-input);
  border: 1px solid var(--line); font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px; color: var(--text-main);
}
.role-badge {
  font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 6px; text-transform: uppercase;
}
.role-badge.admin { background: #ef4444; color: #fff; }
.role-badge.editor { background: #3b82f6; color: #fff; }
.role-badge.author { background: var(--gold-light); color: var(--gold); }
.role-badge.reader { background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--line); }

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); min-width: 220px; padding: 8px; display: flex; flex-direction: column; gap: 4px;
}
.user-dropdown-item {
  padding: 8px 12px; border-radius: 6px; font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; text-align: left; transition: all .15s;
}
.user-dropdown-item:hover { background: var(--bg-page); color: var(--accent); }
.ud-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 800;
}

/* Баннер режима помощи администратора */
.impersonate-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a); border-bottom: 2px solid #f59e0b;
  color: #78350f; padding: 8px 24px; font-size: 13.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 55;
  box-shadow: 0 2px 8px rgba(245,158,11,0.2);
}
.btn-exit-impersonate {
  background: #78350f; color: #fff; padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 800;
}

/* Переключатель роли при регистрации */
.auth-role-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px;
}
.auth-role-card {
  padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--bg-page); cursor: pointer; text-align: center; transition: all .15s;
}
.auth-role-card.active {
  border-color: var(--accent); background: var(--accent-light); color: var(--accent);
}
.auth-role-card .role-title { font-weight: 800; font-size: 14px; margin-bottom: 2px; }
.auth-role-card .role-desc { font-size: 11.5px; opacity: .8; }

/* Быстрые кнопки демо-входа для тестирования */
.demo-logins-box {
  margin-top: 20px; padding: 14px; background: var(--bg-page); border: 1px dashed var(--line);
  border-radius: var(--radius-sm); font-size: 12px;
}
.demo-logins-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.btn-demo-login {
  padding: 6px 10px; background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: 6px; font-size: 11.5px; font-weight: 700; text-align: left;
}
.btn-demo-login:hover { border-color: var(--accent); }

/* ==================== АДМИНКА РУКОВОДИТЕЛЯ И РЕДАКТОРА (#/admin) ==================== */
.admin-dashboard { max-width: 1140px; margin: 0 auto; width: 100%; }
.admin-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px;
}
.admin-stat-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.admin-stat-card .label { font-size: 12.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.admin-stat-card .val { font-size: 28px; font-weight: 900; color: var(--text-main); margin: 6px 0; }
.admin-stat-card .sub { font-size: 12.5px; color: var(--accent); font-weight: 700; }

.admin-table-wrap {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 28px; overflow-x: auto;
}
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px; text-align: left; min-width: 700px;
}
.admin-table th {
  padding: 12px 14px; border-bottom: 2px solid var(--line); font-size: 12px;
  font-weight: 800; color: var(--text-muted); text-transform: uppercase;
}
.admin-table td {
  padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.admin-table tr:hover td { background: var(--bg-page); }

.btn-assist-user {
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05));
  border: 1px solid var(--gold); color: var(--gold); font-weight: 800; font-size: 12px;
  padding: 5px 12px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px;
}
.btn-assist-user:hover { background: var(--gold); color: #fff; }
