/* ============================================================
   NovaLibre RSS — основные стили
   Переменные тем в themes.css
   Стили режима чтения в reader.css
   ============================================================ */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.2s, color 0.2s;
  /* Безопасные отступы под вырезы/статус-бары (notch, Home Indicator) */
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  transition: all 0.15s;
}

.btn-icon:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.btn-icon-sm:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-group {
  display: flex;
  gap: 4px;
}

.btn-group .btn {
  flex: 1;
}

.btn-group .btn.active {
  background: var(--accent);
  color: #fff;
}

/* ============================================================
   Splash
   ============================================================ */

.splash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg);
  z-index: 9999;
  transition: opacity 0.3s;
}

.splash.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-logo {
  animation: pulse 1.5s ease-in-out infinite;
}

.splash-text {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

/* ============================================================
   Auth screen
   ============================================================ */

.auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
  background-image: radial-gradient(circle at 20% 20%, var(--accent-soft) 0%, transparent 50%),
                    radial-gradient(circle at 80% 80%, var(--accent-soft) 0%, transparent 50%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.auth-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}

.auth-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-tabs {
  display: flex;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.form-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.form-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-field input,
.form-field select,
.select,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  transition: all 0.15s;
}

.form-field input:focus,
.form-field select:focus,
.select:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-secondary);
}

.password-toggle:hover {
  background: var(--surface-3);
  color: var(--text);
}

.form-error {
  min-height: 18px;
  font-size: 13px;
  color: var(--danger);
  padding: 0 4px;
}

.form-error:not(:empty) {
  margin-top: -8px;
}

.auth-footer {
  text-align: center;
  margin-top: 4px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 8px;
}

.link-btn:hover {
  color: var(--accent);
}

/* Spinner */
.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Layout
   ============================================================ */

.app {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.app .sidebar {
  width: 260px;
  flex-shrink: 0;
}

.app .main {
  flex: 1;
  min-width: 0;
}

/* Свернутый сайдбар (десктоп) */
.app.sidebar-collapsed .sidebar {
  margin-left: -260px;
}

/* На мобильном сайдбар — drawer */
@media (max-width: 768px) {
  .app .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 86vw;
    max-width: 320px;
    z-index: 5000;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 2px 0 24px rgba(0,0,0,0.25);
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
    margin-left: 0;
  }
  .app.sidebar-collapsed .sidebar {
    margin-left: 0;
    transform: translateX(-100%);
  }
  /* Открытое состояние */
  .app:not(.sidebar-collapsed) .sidebar {
    transform: translateX(0);
  }
}

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: transform 0.25s, margin-left 0.25s;
  overflow: hidden;
  height: 100vh;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.sidebar-search {
  position: relative;
  padding: 10px 14px;
  flex-shrink: 0;
}

.sidebar-search .search-icon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.sidebar-search input {
  padding: 8px 10px 8px 34px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
}

.sidebar-search input:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.nav-section {
  margin-bottom: 12px;
}

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  transition: all 0.12s;
  text-align: left;
}

.nav-item:hover {
  background: var(--surface-2);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.nav-item span:not(.nav-badge) {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  background: var(--surface-3);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.nav-item.active .nav-badge {
  background: var(--accent);
  color: #fff;
}

.nav-badge[data-count="0"] {
  visibility: hidden;
}

.nav-feeds,
.nav-categories {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-feed-item,
.nav-category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.12s;
}

.nav-feed-item:hover,
.nav-category-item:hover {
  background: var(--surface-2);
}

.nav-feed-item.active,
.nav-category-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.nav-feed-icon,
.nav-category-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 3px;
  object-fit: cover;
  background: var(--surface-3);
}

.nav-feed-icon.default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.nav-feed-title,
.nav-category-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-category-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-category-toggle svg {
  transition: transform 0.2s;
}

.nav-category.collapsed .nav-category-toggle svg {
  transform: rotate(-90deg);
}

.nav-category.collapsed .nav-feeds-in-category {
  display: none;
}

.nav-feeds-in-category {
  padding-left: 16px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-footer .btn-icon {
  width: 32px;
  height: 32px;
}

/* ============================================================
   Main
   ============================================================ */

.main {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.topbar-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.select-view,
.select {
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.filter-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.mobile-menu {
  display: none;
}

/* ============================================================
   Articles list
   ============================================================ */

.content {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.content::-webkit-scrollbar {
  width: 8px;
}
.content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.articles-list {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Cards view */
.articles-list.view-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  padding: 20px;
}

.articles-list.view-cards .article-card {
  display: flex;
  flex-direction: column;
}

.articles-list.view-cards .article-card .article-image {
  width: 100%;
  height: 180px;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}

.articles-list.view-cards .article-card .article-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Article card */
.article-card {
  display: flex;
  gap: 12px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
}

.article-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.article-card.read {
  opacity: 0.6;
}

.article-card .article-image {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-3);
}

.article-card .article-body {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.article-card .article-feed {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.article-card .article-feed img {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.article-card .article-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card.read .article-title {
  font-weight: 500;
  color: var(--text-secondary);
}

.article-card .article-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  flex: 1;
}

.article-card .article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

.article-card .article-star {
  color: var(--star);
}

/* List view */
.articles-list.view-list .article-card {
  flex-direction: row;
  align-items: flex-start;
}

.articles-list.view-list .article-card .article-image {
  width: 80px;
  height: 80px;
}

.articles-list.view-list .article-card .article-title {
  font-size: 14px;
  -webkit-line-clamp: 2;
}

/* Compact view */
.articles-list.view-compact {
  gap: 2px;
  padding: 8px;
}

.articles-list.view-compact .article-card {
  flex-direction: row;
  align-items: center;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
}

.articles-list.view-compact .article-card:hover {
  background: var(--surface-2);
  border-color: transparent;
  transform: none;
  box-shadow: none;
}

.articles-list.view-compact .article-image,
.articles-list.view-compact .article-summary {
  display: none;
}

.articles-list.view-compact .article-card .article-body {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 0;
}

.articles-list.view-compact .article-title {
  font-size: 14px;
  -webkit-line-clamp: 1;
  margin: 0;
  flex: 1;
}

.articles-list.view-compact .article-meta {
  margin: 0;
  flex-shrink: 0;
}

/* Empty / loading */
.empty-state,
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-secondary);
  text-align: center;
  min-height: 60vh;
  margin: 0 auto;
  max-width: 480px;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  opacity: 0.6;
  margin-bottom: 4px;
}

.empty-state h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.empty-state p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
}

/* ============================================================
   Toasts
   ============================================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  font-size: 14px;
  min-width: 240px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideIn 0.25s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

/* ============================================================
   Modal
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: scaleIn 0.2s;
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.opml-section {
  padding: 12px;
  background: var(--surface-2);
  border-radius: 8px;
}

.opml-section h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.opml-section p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.opml-result {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 6px;
  font-size: 13px;
}

.discover-results {
  padding: 12px;
  background: var(--surface-2);
  border-radius: 8px;
}

.discover-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 500;
}

.discover-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 6px;
  font-size: 13px;
}

.discover-item button {
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================
   Settings panel (reader)
   ============================================================ */

.reader-settings-panel {
  position: fixed;
  top: 60px;
  right: 24px;
  width: 320px;
  max-height: calc(100vh - 120px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  z-index: 8000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.panel-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-group > label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-group .value {
  color: var(--accent);
  font-weight: 600;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
}

.theme-option:hover {
  border-color: var(--accent);
}

.theme-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.swatch-light { background: #ffffff; }
.swatch-dark { background: #1e1e1e; }
.swatch-sepia { background: #f4ecd8; }
.swatch-night { background: #0a0a0a; }
.swatch-contrast { background: #000000; }

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: -4px;
}

.about-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================================
   Responsive (дополнительные мобильные правила)
   ============================================================ */

@media (max-width: 768px) {
  .mobile-menu {
    display: flex;
  }

  .topbar {
    padding: 10px 12px;
    padding-top: calc(10px + var(--safe-area-top));
    padding-left: calc(12px + var(--safe-area-left));
    padding-right: calc(12px + var(--safe-area-right));
  }

  .topbar-actions {
    gap: 8px;
  }

  .filter-toggle span:last-child,
  .hidden-mobile {
    display: none;
  }

  .articles-list.view-cards {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .articles-list {
    padding: 12px;
    /* Свободное место под мобильную нижнюю панель */
    padding-bottom: calc(72px + var(--safe-area-bottom) + 16px);
  }

  .articles-list.view-list .article-card .article-image {
    width: 60px;
    height: 60px;
  }

  .reader-settings-panel {
    right: 12px;
    left: 12px;
    width: auto;
    max-width: 380px;
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .topbar-actions .filter-toggle,
  .topbar-actions #view-mode {
    display: none;
  }
  .articles-list.view-cards .article-card .article-image {
    height: 140px;
  }
  .reader-content {
    padding: 20px !important;
    padding-top: calc(20px + var(--safe-area-top)) !important;
    padding-bottom: calc(40px + var(--safe-area-bottom)) !important;
  }
}

/* ============================================================
   Mobile bottom bar — всегда видимые кнопки
   ============================================================ */

.mobile-bottom-bar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 4px;
    padding: 8px 12px;
    padding-bottom: calc(8px + var(--safe-area-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 4500;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  }

  .mobile-bottom-bar .btn-icon {
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
  }

  .mobile-bottom-bar .btn-icon:hover,
  .mobile-bottom-bar .btn-icon:active {
    color: var(--accent);
    background: var(--surface-2);
  }
}

/* Overlay for sidebar on mobile */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 4000;
  animation: fadeIn 0.2s;
}

/* PWA: использовать всю высоту включая safe-area */
@supports (height: 100dvh) {
  html, body { height: 100dvh; }
  .app { height: 100dvh; }
  .sidebar { height: 100dvh; }
  .main { height: 100dvh; }
  .reader-overlay { height: 100dvh; }
}
