@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
/* Глобальный z-index для всех слоев */



* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #ec4899;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #0f172a;
  --light: #f8fafc;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  overflow-x: hidden;
}


/* Layout */
.app-shell {
  display: flex;
  height: 100%;
}

.sidebar {
  width: 280px;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  border-right: 1px solid rgba(148, 163, 184, 0.3);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
  flex: 0 0 auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.sidebar__logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-weight: 800;
  font-size: 20px;
}

.sidebar__title {
  font-weight: 800;
  font-size: 16px;
}

.sidebar__subtitle {
  font-size: 11px;
  color: rgba(226, 232, 240, 0.7);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.navlink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  background: rgba(226, 232, 240, 0.05);
  color: rgba(226, 232, 240, 0.9);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.navlink:hover {
  background: rgba(226, 232, 240, 0.12);
  transform: translateX(3px);
}

.sidebar__footer {
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(226, 232, 240, 0.08);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot--ok {
  background: #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Main content */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Pages */
.page {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.page.hidden {
  display: none;
}

/* Buttons */
.btn {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: var(--dark);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  color: white;
}

.btn--secondary {
  background: white;
  border-color: var(--primary);
  color: var(--primary);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(148, 163, 184, 0.3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Panels */
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.5);
}

.panel-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.5);
}

.panel-title {
  font-weight: 800;
  font-size: 16px;
  color: var(--dark);
}

.panel-subtitle {
  font-size: 12px;
  color: rgba(15, 23, 42, 0.6);
  margin-top: 2px;
}

.section-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--dark);
  margin-bottom: 12px;
}

/* Inputs */
.label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.7);
  display: block;
  margin-bottom: 6px;
}

.input, select.input, textarea.input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.input:focus, select.input:focus, textarea.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea.input {
  resize: vertical;
  min-height: 60px;
}

.auto-resize {
  overflow: hidden;
  resize: none;
}

/* Post output */
.post-output {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
}

.post-output:focus {
  outline: none;
  border-color: var(--primary);
}

/* Ideas list */
.ideas-list {
  max-height: 500px;
  overflow-y: auto;
}

.idea-card {
  transition: all 0.2s ease;
  cursor: pointer;
}

.idea-card:hover {
  transform: translateX(2px);
}

.idea-badge {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Calendar */
.calendar-grid {
  min-height: 500px;
}

.calendar-day {
  transition: all 0.2s ease;
}

.calendar-day:hover {
  background: #f8fafc !important;
}

.calendar-item {
  transition: all 0.2s ease;
  cursor: grab;
}

.calendar-item:active {
  cursor: grabbing;
}

/* Stats */
.stat-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--dark);
}

.stat-label {
  font-size: 12px;
  color: rgba(15, 23, 42, 0.6);
  margin-top: 6px;
  font-weight: 500;
}

/* Modal */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal-root.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-backdrop.show {
  opacity: 1;
}

.modal-content {
  position: relative;
  margin: 10vh auto;
  width: min(600px, 90%);
  background: white;
  border-radius: 20px;
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}

@media (max-width: 800px) {
  .page {
    overflow-y: auto !important;
  }
  .ideas-list,
  .templates-list {
    max-height: none !important;
    overflow-y: visible !important;
  }
  .modal-content {
    max-height: calc(100vh - 24px);
  }
}

@media (max-width: 480px) {
  .modal-content {
    margin: 6vh auto;
    width: 95%;
    padding: 16px;
    max-height: calc(100vh - 24px);
  }
}



/* Scrollbar (под дизайн сайта) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.35), rgba(236, 72, 153, 0.25));
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.55), rgba(236, 72, 153, 0.35));
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.6) rgba(255, 255, 255, 0.12);
}


/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    width: 80px;
    padding: 16px 12px;
  }
  
  .sidebar__title,
  .sidebar__subtitle,
  .navlink span {
    display: none;
  }
  
  .navlink {
    justify-content: center;
    padding: 12px;
  }
}

/* Mobile tap targets */
.btn {
  min-height: 44px;
}

@media (max-width: 480px) {
  .btn {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 12px;
  }
}


/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* Добавьте в конец файла style.css */

/* Notifications */
@keyframes slide-in {
    from {
      opacity: 0;
      transform: translateX(100%);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  @keyframes slide-out {
    from {
      opacity: 1;
      transform: translateX(0);
    }
    to {
      opacity: 0;
      transform: translateX(100%);
    }
  }
  
  .animate-slide-in {
    animation: slide-in 0.3s ease forwards;
  }
  
  /* Modal animations */
  .modal-content {
    animation: fadeInScale 0.2s ease;
  }
  
  @keyframes fadeInScale {
    from {
      opacity: 0;
      transform: scale(0.95);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  /* Добавьте в конец файла */

/* Auto-resize textareas */
.auto-resize {
    overflow-y: hidden;
    transition: height 0.1s ease;
  }
  
  /* Post output styling */
  .post-output {
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    resize: vertical;
  }
  
  .post-output:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  }
  
  /* Animations */
  @keyframes slide-in {
    from {
      opacity: 0;
      transform: translateX(100%);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  @keyframes slide-out {
    from {
      opacity: 1;
      transform: translateX(0);
    }
    to {
      opacity: 0;
      transform: translateX(100%);
    }
  }
  
  .animate-slide-in {
    animation: slide-in 0.3s ease forwards;
  }
  
  /* Modal animation */
  .modal-content {
    animation: fadeInScale 0.2s ease;
  }
  
  @keyframes fadeInScale {
    from {
      opacity: 0;
      transform: scale(0.95);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
  
  /* Line clamp utilities */
  .line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Добавьте в конец style.css */

/* ============ КАЛЕНДАРЬ ============ */
#calendar-grid {
    max-width: 100%;
    margin: 0 auto;
  }

@media (max-width: 480px) {
  .calendar-grid {
    min-height: 0;
  }
  .calendar-day {
    min-height: 90px;
    padding: 6px;
  }
  .calendar-item {
    font-size: 10px;
    padding: 3px 6px;
  }
  .calendar-item .item-title {
    max-width: 42px;
  }
}

  
  .calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .calendar-month-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: capitalize;
  }
  
  .calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 8px;
  }
  
  .weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    padding: 8px;
  }
  
  .calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
  }
  
  .calendar-day {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    min-height: 120px;
    padding: 8px;
    transition: all 0.2s ease;
  }
  
  .calendar-day:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
  }
  
  .calendar-day.empty {
    background: #f8fafc;
    opacity: 0.5;
  }
  
  .calendar-day.today {
    border: 2px solid #6366f1;
    background: #f0f9ff;
  }
  
  .calendar-day-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-align: right;
    margin-bottom: 8px;
  }
  
  .calendar-day.today .calendar-day-number {
    color: #6366f1;
    font-weight: 700;
  }
  
  .calendar-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  
  .calendar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    padding: 4px 6px;
    border-radius: 8px;
    background: #f1f5f9;
    cursor: grab;
    transition: all 0.2s ease;
    border-left: 3px solid;
    overflow: hidden;
  }
  
  .calendar-item:active {
    cursor: grabbing;
  }
  
  .calendar-item.published {
    background: #e2e8f0;
    opacity: 0.7;
    text-decoration: line-through;
  }
  
  .calendar-item .item-icon {
    font-size: 0.65rem;
  }
  
  .calendar-item .item-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .published-badge {
    background: #10b981;
    color: white;
    border-radius: 10px;
    padding: 0px 4px;
    font-size: 0.6rem;
    font-weight: bold;
  }
  
  .calendar-item.empty-slot {
    background: transparent;
    border: 1px dashed #cbd5e1;
    cursor: default;
    min-height: 28px;
  }
  
  .calendar-more {
    font-size: 0.65rem;
    color: #64748b;
    text-align: center;
    padding: 2px;
  }
  
  .drag-over {
    background: #f0f9ff;
    border: 2px dashed #6366f1;
  }
  
  /* ============ МОДАЛЬНОЕ ОКНО ПОСТА ============ */
  .post-modal {
    max-width: 600px;
  }
  
  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
  }
  
  .modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .modal-icon {
    font-size: 1.25rem;
  }
  
  .modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
  }
  
  .modal-close:hover {
    color: #ef4444;
  }
  
  .modal-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
  }
  
  .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
  }
  
  .meta-label {
    font-weight: 600;
    color: #64748b;
  }
  
  .meta-value {
    color: #1e293b;
  }
  
  .status-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
  }
  
  .status-badge.published {
    background: #d1fae5;
    color: #065f46;
  }
  
  .status-badge.draft {
    background: #fef3c7;
    color: #92400e;
  }
  
  .modal-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 16px 0;
  }
  
  .modal-section {
    margin-bottom: 16px;
  }
  
  .section-title {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
    font-size: 0.875rem;
  }
  
  .post-content {
    background: #f8fafc;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
  }
  
  .notes-content {
    background: #fef3c7;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    color: #92400e;
  }
  
  .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
  }
  
  .btn--success {
    background: #10b981;
    color: white;
    border: none;
  }
  
  .btn--success:hover {
    background: #059669;
  }
  
  .btn--warning {
    background: #f59e0b;
    color: white;
    border: none;
  }
  
  .btn--warning:hover {
    background: #d97706;
  }
  
  /* ============ ШАБЛОНЫ ============ */
  .template-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    transition: all 0.2s ease;
  }
  
  .template-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
  }
  
  .template-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  
  .template-badges {
    display: flex;
    gap: 8px;
  }
  
  .template-tag, .template-direction {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: #f1f5f9;
  }
  
  .template-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #0f172a;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .template-preview {
    font-size: 0.75rem;
    color: #a9bbd3;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .template-use {
    width: 100%;
    padding: 8px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4f46e5;
    border: none;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .template-use:hover {
    background: #e0e7ff;
  }
  
  .template-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
  }
  
  .template-delete:hover {
    opacity: 1;
  }
  
  .empty-templates {
    text-align: center;
    padding: 48px;
    background: #f8fafc;
    border-radius: 16px;
  }
  
  .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
  }
  
  .empty-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 8px;
  }
  
  /* ============ ХЭШТЕГИ ============ */
  .hashtags-modal {
    max-width: 500px;
  }
  
  .hashtags-categories {
    max-height: 400px;
    overflow-y: auto;
  }
  
  .hashtag-category {
    margin-bottom: 16px;
  }
  
  .category-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #0f172a;
    margin-bottom: 8px;
  }
  
  .category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .hashtag-btn {
    padding: 4px 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .hashtag-btn:hover {
    background: #e0e7ff;
    border-color: #6366f1;
  }
  
  .custom-hashtag {
    display: flex;
    gap: 8px;
    margin: 16px 0;
  }
  
  .custom-hashtag .input {
    flex: 1;
  }
  
  /* ============ АНИМАЦИИ ============ */
  @keyframes slideIn {
    from {
      opacity: 0;
      transform: translateX(100%);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  @keyframes slideOut {
    from {
      opacity: 1;
      transform: translateX(0);
    }
    to {
      opacity: 0;
      transform: translateX(100%);
    }
  }
  
  @keyframes fadeInScale {
    from {
      opacity: 0;
      transform: scale(0.95);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
  
  .modal-content {
    animation: fadeInScale 0.2s ease;
  }
  
  /* Responsive */
  @media (max-width: 768px) {
    .calendar-day {
      min-height: 80px;
    }
    
    .calendar-item .item-title {
      display: none;
    }
    
    .modal-meta {
      grid-template-columns: 1fr;
    }
  }

  /* Добавьте в конец style.css */

/* ============ КАСТОМНЫЕ ДИАЛОГИ ============ */
.custom-dialog {
    max-width: 420px;
    margin: 0 auto;
    text-align: center;
}

.dialog-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.dialog-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
}

.dialog-message {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 24px;
    white-space: pre-wrap;
}

.dialog-input-wrapper {
    margin-bottom: 24px;
}

.dialog-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.dialog-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.dialog-btn {
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.dialog-btn-primary {
    background: #6366f1;
    color: white;
}

.dialog-btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.dialog-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.dialog-btn-secondary:hover {
    background: #e2e8f0;
}

/* Модальные окна */
.custom-modal {
    max-width: 500px;
    margin: 0 auto;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    border: none;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

.modal-body {
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* Формы в модалках */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Диалоговая модалка */
.dialog-modal .modal-content {
    max-width: 450px;
    text-align: center;
}

/* Пустое состояние для идей */
.empty-ideas {
    text-align: center;
    padding: 40px 20px;
    background: #f8fafc;
    border-radius: 16px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-ideas p {
    color: #64748b;
    font-size: 14px;
}

.empty-hint {
    font-size: 12px;
    margin-top: 8px;
    color: #94a3b8;
}

/* Стили для карточек идей */
.idea-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    transition: all 0.2s ease;
}

.idea-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.idea-card-header {
    margin-bottom: 10px;
}

.idea-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.idea-tag {
    font-size: 11px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 20px;
}

.idea-direction {
    font-size: 11px;
    padding: 2px 8px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 20px;
}

.idea-title {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 6px;
    line-height: 1.4;
}

.idea-details {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}

.idea-actions {
    display: flex;
    gap: 8px;
}

.idea-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.idea-btn-generate {
    background: #6366f1;
    color: white;
}

.idea-btn-generate:hover {
    background: #4f46e5;
}

.idea-btn-view {
    background: #10b981;
    color: white;
}

.idea-btn-view:hover {
    background: #059669;
}

.idea-btn-delete {
    background: #fee2e2;
    color: #ef4444;
    flex: 0 0 auto;
    padding: 8px 16px;
}

.idea-btn-delete:hover {
    background: #fecaca;
}

/* Статистика */
.stat-tag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.stat-tag-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.stat-tag-count {
    font-weight: 700;
    color: #0f172a;
}

/* Анимации для модалок */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    animation: fadeInScale 0.2s ease;
}

/* Добавьте в конец style.css */

/* ============ ПОЛНЫЙ АДАПТИВ БЛОКА С ПОСТОМ ============ */
#post-output {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
    min-height: 535px;
    max-height: none;
    height: auto;
    overflow-y: auto;
}

#post-output:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#post-output[readonly] {
    background: #f8fafc;
    cursor: default;
}

/* Контейнер для правой панели */
.planner-preview {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.planner-preview .flex-1 {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Автоматическое изменение высоты textarea */
.auto-resize {
    overflow-y: auto;
    resize: vertical;
    min-height: 60px;
    max-height: 300px;
}

/* Стили для календаря */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: white;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.calendar-nav-btn:hover {
    background: #f1f5f9;
    transform: scale(1.05);
}

.calendar-month-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: capitalize;
    flex: 1;
    text-align: center;
}

.calendar-today-btn {
    padding: 8px 16px;
    border-radius: 10px;
    background: #6366f1;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.calendar-today-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.weekday {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    padding: 10px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    min-height: 110px;
    padding: 8px;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.calendar-day.empty {
    background: #f8fafc;
    opacity: 0.5;
}

.calendar-day.today {
    border: 2px solid #6366f1;
    background: #f0f9ff;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-align: right;
    margin-bottom: 8px;
}

.calendar-day.today .calendar-day-number {
    color: #6366f1;
    font-weight: 700;
}

.calendar-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    padding: 5px 8px;
    border-radius: 8px;
    background: #f1f5f9;
    cursor: grab;
    transition: all 0.2s ease;
    border-left: 3px solid;
    overflow: hidden;
}

.calendar-item:active {
    cursor: grabbing;
}

.calendar-item.published {
    background: #e2e8f0;
    opacity: 0.7;
    text-decoration: line-through;
}

.calendar-item .item-icon {
    font-size: 11px;
}

.calendar-item .item-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.published-badge {
    background: #10b981;
    color: white;
    border-radius: 10px;
    padding: 0px 4px;
    font-size: 10px;
    font-weight: bold;
}

.calendar-item.empty-slot {
    background: transparent;
    border: 1px dashed #cbd5e1;
    cursor: default;
    min-height: 28px;
}

.calendar-more {
    font-size: 10px;
    color: #64748b;
    text-align: center;
    padding: 4px;
}

.drag-over {
    background: #f0f9ff;
    border: 2px dashed #6366f1;
}

/* Статистика */
.stat-tag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
}

.stat-tag-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.stat-tag-count {
    font-weight: 700;
    color: #0f172a;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
}

/* Кнопка редактирования в модалке */
.btn-edit-inline {
    background: none;
    border: none;
    color: #6366f1;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-edit-inline:hover {
    background: #eef2ff;
}

.btn-edit-inline.btn-edit-active {
    background: #10b981;
    color: white;
}

.btn-edit-inline.btn-edit-active:hover {
    background: #059669;
}

/* Поле редактирования поста */
.post-content-editable {
    background: #fefce8;
    border: 2px solid #6366f1 !important;
    outline: none;
}

.post-content-editable:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ============ МОБИЛЬНАЯ АДАПТАЦИЯ ============ */

/* Планшеты (768px - 1024px) */
@media (max-width: 1024px) {
  .sidebar {
      width: 80px;
      padding: 16px 12px;
  }
  
  .sidebar__title,
  .sidebar__subtitle,
  .navlink span {
      display: none;
  }
  
  .navlink {
      justify-content: center;
      padding: 12px;
  }
  
  .navlink i {
      font-size: 1.25rem;
  }
  
  .topbar {
      padding: 12px 16px;
  }
  
  .topbar__left h1 {
      font-size: 1.125rem;
  }
  
  .topbar__left p {
      font-size: 0.7rem;
  }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
  /* Общие */
  .app-shell {
      flex-direction: column;
  }
  
  .sidebar {
      width: 100%;
      flex-direction: row;
      padding: 10px 16px;
      gap: 16px;
      align-items: center;
      border-right: none;
      border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  }
  
  .sidebar__brand {
      padding-bottom: 0;
      border-bottom: none;
  }
  
  .sidebar__nav {
      flex-direction: row;
      gap: 4px;
      flex: 1;
  }
  
  .navlink {
      padding: 8px 12px;
  }
  
  .navlink span {
      display: none;
  }
  
  .navlink i {
      font-size: 1.1rem;
  }
  
  .sidebar__footer {
      flex-direction: row;
      padding-top: 0;
      border-top: none;
      gap: 8px;
  }
  
  .status-badge span:last-child {
      display: none;
  }
  
  /* Topbar */
  .topbar {
      padding: 10px 12px;
  }
  
  .topbar__left h1 {
      font-size: 1rem;
  }
  
  .topbar__left p {
      display: none;
  }
  
  .btn--primary {
      padding: 6px 10px;
      font-size: 11px;
  }
  
  /* Панели на главной */
  .grid-cols-1.lg\:grid-cols-2 {
      grid-template-columns: 1fr !important;
      gap: 12px !important;
  }
  
  .page .h-full.p-4 {
      padding: 8px;
  }
  
  .panel-header {
      padding: 12px;
  }
  
  .panel-title {
      font-size: 14px;
  }
  
  .panel-subtitle {
      font-size: 10px;
  }
  
  /* Календарь */
  .calendar-header {
      flex-wrap: wrap;
      gap: 8px;
  }
  
  .calendar-month-title {
      font-size: 1rem;
      order: 1;
      width: 100%;
      text-align: center;
  }
  
  .calendar-nav-btn {
      width: 32px;
      height: 32px;
      font-size: 12px;
  }
  
  .calendar-today-btn {
      padding: 6px 12px;
      font-size: 11px;
  }
  
  .calendar-day {
      min-height: 80px;
      padding: 4px;
  }
  
  .calendar-day-number {
      font-size: 10px;
  }
  
  .calendar-item {
      padding: 2px 4px;
      font-size: 9px;
  }
  
  .calendar-item .item-icon {
      font-size: 9px;
  }
  
  .calendar-item .item-title {
      max-width: 40px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
  }
  
  .weekday {
      font-size: 10px;
      padding: 4px;
  }
  
  /* Статистика */
  .grid-cols-1.md\:grid-cols-4 {
      grid-template-columns: repeat(2, 1fr) !important;
      gap: 10px;
  }
  
  .stat-card {
      padding: 12px;
  }
  
  .stat-value {
      font-size: 24px;
  }
  
  .stat-label {
      font-size: 10px;
  }
  
  /* Шаблоны */
  .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
      grid-template-columns: 1fr !important;
  }
  
  /* Модальные окна */
  .modal-content {
      width: 95%;
      margin: 5vh auto;
      padding: 16px;
  }
  
  .modal-meta {
      grid-template-columns: 1fr;
      gap: 8px;
  }
  
  .modal-actions {
      flex-wrap: wrap;
  }
  
  .modal-actions .btn {
      flex: 1;
      justify-content: center;
  }
  
  /* Идеи */
  .idea-card {
      padding: 10px;
  }
  
  .idea-title {
      font-size: 12px;
  }
  
  .idea-tag, .idea-direction {
      font-size: 9px;
  }
  
  .idea-btn {
      padding: 6px 8px;
      font-size: 10px;
  }
  
  /* Пост */
  #post-output {
      min-height: 150px;
      font-size: 12px;
  }
  
  .post-output {
      font-size: 12px;
  }
  
  /* Хэштеги */
  .hashtag-category .category-title {
      font-size: 12px;
  }
  
  .hashtag-btn {
      font-size: 10px;
      padding: 3px 8px;
  }
}

/* Очень маленькие телефоны (до 480px) */
@media (max-width: 480px) {
  .sidebar {
      padding: 8px 12px;
  }
  
  .sidebar__logo {
      width: 90px;
      height: 90px;
      font-size: 8px;
  }
  
  .navlink {
      padding: 6px 8px;
  }
  
  .btn-sm {
      padding: 4px 8px;
      font-size: 10px;
  }
  
  .calendar-day {
      min-height: 70px;
  }
  
  .calendar-day-number {
      font-size: 9px;
  }
  
  .stat-value {
      font-size: 20px;
  }
  
  .modal-title {
      font-size: 14px;
  }
  
  .meta-item {
      font-size: 11px;
  }
  
  .post-content {
      font-size: 11px;
      max-height: 200px;
  }
}

/* Гамбургер-меню для мобильных (опционально) */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
}

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

/* ============ МОБИЛЬНАЯ АДАПТАЦИЯ С ПРОКРУТКОЙ ============ */

/* Базовые исправления для мобильных */
@media (max-width: 768px) {
  /* Убираем overflow hidden на body и main */
  body {
      height: auto;
      min-height: 100vh;
      overflow-y: auto !important;
      overflow-x: hidden;
  }
  
  .app-shell {
      flex-direction: column;
      height: auto;
      min-height: 100vh;
  }
  
  .main {
      flex: 1;
      min-height: 0;
      overflow-y: auto !important;
      overflow-x: hidden;
  }
  
  .page {
      overflow-y: auto !important;
      min-height: calc(100vh - 120px);
  }
  
  /* Убираем ограничения по высоте */
  .h-screen, .h-full, .min-h-0, .flex-1 {
      height: auto !important;
      min-height: auto !important;
      overflow: visible !important;
  }
  
  /* Контейнеры с прокруткой */
  .ideas-list, .templates-list, .calendar-days {
      max-height: none !important;
      overflow-y: visible !important;
  }
  
  /* Панели на главной */
  .grid-cols-1.lg\:grid-cols-2 {
      display: flex !important;
      flex-direction: column !important;
      gap: 16px !important;
      height: auto !important;
  }
  
  .flex.flex-col.rounded-2xl {
      max-height: none !important;
      height: auto !important;
  }
  
  .overflow-y-auto {
      overflow-y: visible !important;
  }
  
  /* Календарь на мобилках */
  .calendar-days {
      display: grid;
      gap: 6px;
      overflow-x: auto;
      padding-bottom: 16px;
  }
  
  .calendar-day {
      min-height: 100px;
  }
  
  /* Исправление для контента */
  .p-4 {
      padding: 12px !important;
  }
  
  .h-full.p-4 {
      padding: 12px !important;
      height: auto !important;
  }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
  .calendar-day {
      min-height: 90px;
  }
  
  .calendar-item .item-title {
      max-width: 35px;
      font-size: 8px;
  }
  
  .idea-actions {
      flex-wrap: wrap;
  }
  
  .idea-btn {
      padding: 6px 8px;
      font-size: 10px;
  }
  
  .modal-actions {
      flex-direction: column;
  }
  
  .modal-actions .btn {
      width: 100%;
  }
}

/* Глобальные исправления для скролла на всех устройствах */
body, .main, .page {
  -webkit-overflow-scrolling: touch; /* плавный скролл на iOS */
}

/* Убедимся, что контент не обрезается */
.overflow-hidden {
  overflow: visible !important;
}

.h-screen {
  min-height: 100vh;
  height: auto;
}

/* ============ ФИЛЬТРЫ ДЛЯ ШАБЛОНОВ ============ */
.filter-bar {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select,
.filter-input {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  outline: none;
  transition: border-color 0.2s;
  min-width: 160px;
}

.filter-select:focus,
.filter-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-input {
  min-width: 200px;
}

.template-date {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Обновлённый empty state */
.col-span-full {
  grid-column: 1 / -1;
}

/* Логотип в сайдбаре */
.sidebar__logo-img {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
}

/* Кнопка лайка */
#btn-like-post:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ============ МОБИЛЬНАЯ АДАПТАЦИЯ ДЛЯ КЛАВИАТУРЫ ============ */
@media (max-width: 768px) {
  /* Фикс для клавиатуры на iOS/Android */
  body.keyboard-open {
    position: fixed;
    height: 100%;
    width: 100%;
    overflow: hidden;
  }
  
  body.keyboard-open .main {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  
  /* При открытой клавиатуре скроллим к активному полю */
  .input:focus, textarea:focus, .form-input:focus {
    scroll-margin-top: 80px;
  }
  
  /* Улучшенные мобильные отступы */
  .page .h-full.p-4 {
    padding: 8px !important;
  }
  
  /* Мобильный sidebar - горизонтальная прокрутка */
  .sidebar {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 12px;
    padding: 8px 12px;
  }
  
  .sidebar__brand {
    flex-shrink: 0;
  }
  
  .sidebar__nav {
    flex-shrink: 0;
    flex-direction: row !important;
    gap: 4px;
  }
  
  .navlink {
    flex-shrink: 0;
    padding: 8px 10px;
  }
  
  .sidebar__footer {
    flex-shrink: 0;
    flex-direction: row !important;
    gap: 8px;
    border-top: none;
    padding-top: 0;
  }
  
  /* Логотип на мобилках - компактный */
  .sidebar__logo-img {
    width: 40px !important;
    height: 40px !important;
  }
  
  .sidebar__title {
    font-size: 12px !important;
  }
  
  .sidebar__subtitle {
    font-size: 9px !important;
  }
  
  /* Кнопки экспорта - компактно */
  .sidebar__footer .flex.gap-2 {
    flex-wrap: nowrap !important;
  }
  
  .sidebar__footer .btn--ghost {
    padding: 6px 10px !important;
    font-size: 11px !important;
    min-width: auto !important;
  }
  
  /* Мобильная тема - кнопка с выпадашкой */
  .theme-mobile {
    position: relative;
  }
  
  .theme-mobile__wrap {
    position: relative;
  }
  
  .theme-mobile__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
  }
  
  .theme-mobile__btn i {
    font-size: 10px;
    transition: transform 0.2s;
  }
  
  .theme-mobile__btn[aria-expanded="true"] i {
    transform: rotate(180deg);
  }
  
  
  .theme-mobile__item {
    padding: 10px 14px;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-primary, white);
    transition: background 0.2s;
  }
  
  .theme-mobile__item:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .theme-mobile__item[aria-checked="true"] {
    background: var(--accent-primary, #6366f1);
    color: white;
  }
  
  /* Модалки на мобилках - полный экран при фокусе */
  .modal-content {
    margin: 5vh auto !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
  }
  
  /* При фокусе на поле - подсветка */
  .input:focus, textarea:focus {
    border-color: var(--accent-primary, #6366f1) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
  }
  
  /* Drag-over фикс */
  .calendar-day.drag-over {
    background: rgba(99, 102, 241, 0.15);
  }
}

/* ============ МОБИЛЬНАЯ АДАПТАЦИЯ (ИСПРАВЛЕННАЯ) ============ */
@media (max-width: 768px) {
  /* Фикс для всего приложения - убираем горизонтальный скролл */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    scroll-behavior: smooth;
  }
  
  .app-shell {
    overflow-x: hidden !important;
    width: 100%;
  }
  
  /* Сайдбар - фиксированная ширина, без горизонтальной прокрутки */
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    overflow-x: visible;
  }
  
  .sidebar__brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .sidebar__logo-img {
    width: 36px !important;
    height: 36px !important;
  }
  
  .sidebar__title {
    font-size: 11px !important;
  }
  
  .sidebar__subtitle {
    font-size: 8px !important;
  }
  
  .sidebar__nav {
    flex-direction: row !important;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .navlink {
    padding: 6px 10px !important;
    font-size: 12px;
  }
  
  .navlink span {
    display: inline !important;
    font-size: 11px;
  }
  
  .sidebar__footer {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    border-top: none;
    padding-top: 0;
  }
  
  /* Кнопки экспорта - компактные */
  .sidebar__footer .btn--ghost {
    padding: 5px 8px !important;
    font-size: 10px !important;
    min-width: auto !important;
  }
  
  /* Топбар - не должен вылезать */
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .topbar__left h1 {
    font-size: 14px;
  }
  
  .topbar__left p {
    font-size: 10px;
  }
  
  /* Главный контент */
  .main {
    overflow-x: hidden;
  }
  
  .page .h-full.p-4 {
    padding: 8px !important;
  }
  
  /* Мобильная кнопка темы */
  .theme-mobile__btn {
    padding: 5px 8px !important;
    font-size: 11px !important;
  }
  
  .theme-mobile__text {
    display: inline;
  }
  
  
  /* Календарь */
  .calendar-days {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .calendar-day {
    min-width: 100px;
  }
  
  /* Исправление для модалок на мобилках */
  .modal-content {
    width: 95% !important;
    margin: 10vh auto !important;
    max-height: 80vh !important;
  }
}

/* Очень маленькие экраны (до 480px) */
@media (max-width: 480px) {
  .sidebar {
    padding: 6px 8px;
  }
  
  .sidebar__logo-img {
    width: 30px !important;
    height: 30px !important;
  }
  
  .navlink {
    padding: 5px 6px !important;
  }
  
  .navlink span {
    display: none !important;
  }
  
  .navlink i {
    font-size: 16px;
  }
  
  .sidebar__title, .sidebar__subtitle {
    display: none;
  }
  
  /* .theme-mobile__text {
    display: none;
  } */
  
  .theme-mobile__btn {
    padding: 6px 8px !important;
  }
}

/* ============ ИСПРАВЛЕНИЕ ВЫСОТЫ САЙДБАРА НА МОБИЛКАХ ============ */
@media (max-width: 768px) {
  /* Сайдбар - компактная версия */
  .sidebar {
    padding: 6px 12px !important;
    gap: 8px !important;
    min-height: auto !important;
    height: 55px !important;
    flex-wrap: wrap !important;
  }
  
  /* Бренд - компактно */
  .sidebar__brand {
    padding-bottom: 0 !important;
    border-bottom: none !important;
    gap: 6px !important;
  }
  
  .sidebar__logo-img {
    width: 32px !important;
    height: 32px !important;
  }
  
  .sidebar__title {
    font-size: 10px !important;
    line-height: 1.2 !important;
  }
  
  .sidebar__subtitle {
    font-size: 7px !important;
    line-height: 1.2 !important;
  }
  
  /* Навигация - компактные кнопки */
  .sidebar__nav {
    gap: 4px !important;
    flex-wrap: wrap !important;
  }
  
  .navlink {
    padding: 5px 8px !important;
    font-size: 11px !important;
    gap: 6px !important;
  }
  
  .navlink i {
    font-size: 12px !important;
  }
  
  .navlink span {
    font-size: 10px !important;
  }
  
  /* Футер сайдбара - компактно */
  .sidebar__footer {
    gap: 6px !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  
  .status-badge {
    padding: 4px 8px !important;
    font-size: 9px !important;
  }
  
  .status-dot {
    width: 6px !important;
    height: 6px !important;
  }
  
  /* Кнопка темы */
  .theme-mobile__btn {
    padding: 4px 8px !important;
    font-size: 10px !important;
  }
  
  .theme-mobile__text {
    font-size: 9px !important;
  }
  
  /* Кнопки экспорта */
  .sidebar__footer .btn--ghost {
    padding: 4px 6px !important;
    font-size: 9px !important;
  }
}

/* Для очень маленьких экранов (до 480px) - ещё компактнее */
@media (max-width: 480px) {
  .sidebar {
    padding: 4px 8px !important;
    gap: 6px !important;
  }
  
  .sidebar__logo-img {
    width: 28px !important;
    height: 49px !important;
  }
  
  .sidebar__title {
    display: none !important;
  }
  
  .sidebar__subtitle {
    display: none !important;
  }
  
  .navlink {
    padding: 4px 6px !important;
  }
  
  .navlink span {
    display: none !important;
  }
  
  .navlink i {
    font-size: 14px !important;
    margin: 0 !important;
  }
  
  .status-badge span:last-child {
    display: none !important;
  }
  
  /* .theme-mobile__text {
    display: none !important;
  } */
  
  .theme-mobile__btn {
    padding: 5px 8px !important;
  }
  
  .theme-mobile__icon {
    font-size: 12px !important;
  }
  
  .sidebar__footer .btn--ghost {
    padding: 4px 5px !important;
    font-size: 8px !important;
  }
}


/* ============ МОБИЛЬНЫЙ КАЛЕНДАРЬ – КОМПАКТНЫЙ ============ */
@media (max-width: 768px) {
  /* Уменьшаем сетку и ячейки */
  .calendar-days {
    gap: 4px !important;
  }
  
  .calendar-day {
    min-height: 70px !important;
    padding: 4px !important;
    border-radius: 10px !important;
  }
  
  .calendar-day-number {
    font-size: 10px !important;
    margin-bottom: 4px !important;
  }
  
  .calendar-items {
    gap: 2px !important;
  }
  
  .calendar-item {
    padding: 2px 4px !important;
    font-size: 9px !important;
    gap: 3px !important;
    border-left-width: 2px !important;
  }
  
  .calendar-item .item-icon {
    font-size: 8px !important;
  }
  
  .calendar-item .item-title {
    font-size: 8px !important;
    max-width: 50px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .published-badge {
    font-size: 7px !important;
    padding: 0px 3px !important;
  }
  
  .calendar-more {
    font-size: 8px !important;
    padding: 2px !important;
  }
  
  /* Заголовки недели компактнее */
  .weekday {
    font-size: 9px !important;
    padding: 4px !important;
  }
  
  /* Кнопки навигации календаря меньше */
  .calendar-nav-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 11px !important;
  }
  
  .calendar-month-title {
    font-size: 14px !important;
  }
  
  .calendar-today-btn {
    padding: 4px 10px !important;
    font-size: 10px !important;
  }
}

/* ============ ТЕКСТ ПОСТОВ В КАЛЕНДАРЕ – ВИДИМЫЙ ============ */
/* Основной цвет текста для элементов календаря (перекрываем возможные темы) */
.calendar-item,
.calendar-item .item-title,
.calendar-item .item-icon,
.calendar-item .published-badge {
  color: #1866e2 !important; /* тёмно-серый, почти чёрный */
}

/* Если элемент опубликован – делаем текст серым, но всё ещё читаемым */
.calendar-item.published,
.calendar-item.published .item-title,
.calendar-item.published .item-icon {
  color: #475569 !important;
  text-decoration: line-through;
}

/* Сам фон ячейки оставляем светлым, но если он где-то белый – текст не сольётся */
.calendar-day {
  background: #ffffff !important;
}

/* Для пустых ячеек фон чуть серый */
.calendar-day.empty {
  background: #f8fafc !important;
}

/* Дополнительно: на случай тёмной темы (если вдруг есть) – принудительно светлый фон для календаря */
.calendar-day,
.calendar-item {
  background-color: #ffffff;
}

.calendar-item {
  background: #f1f5f9 !important;
}

/* Показываем текст постов в календаре на мобилках */
@media (max-width: 768px) {
  .calendar-item .item-title {
    display: block !important;        /* возвращаем текст */
    font-size: 9px !important;
    max-width: 55px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Чтобы строка не была слишком высокой, можно ограничить */
  .calendar-item {
    flex-wrap: nowrap;
    min-width: 0;
  }
}


@media (max-width: 768px) {
  .calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(42px, 1fr)); /* минимальная ширина 42px */
    gap: 3px;
    overflow-x: auto;  /* если всё же не влезает — будет скролл, но обычно влезает */
  }
  
  .calendar-day {
    min-height: 65px;
    padding: 4px;
  }
  
  .calendar-day-number {
    font-size: 9px;
  }
}

/* PWA Install button – только на мобилках */
.pwa-install-mobile {
  display: none;
}
@media (max-width: 768px) {
  .pwa-install-mobile {
    display: block;
  }
}

/* ============ МЕНЮ ТЕМ (ФИНАЛЬНАЯ РАБОЧАЯ ВЕРСИЯ) ============ */
.theme-mobile {
  position: relative;
}

.theme-mobile__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
}

.theme-mobile__btn i {
  font-size: 10px;
  transition: transform 0.2s;
}

.theme-mobile__btn[aria-expanded="true"] i {
  transform: rotate(180deg);
}

/* Меню на десктопе — над кнопкой, выровнено влево */
.theme-mobile__menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 200px;
  background: #1e293b;
  border-radius: 12px;
  display: none;
  flex-direction: column;
  z-index: 9999;
  margin-bottom: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.theme-mobile__menu.show {
  display: flex;
}

.theme-mobile__item {
  padding: 12px 16px;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: white;
  transition: background 0.2s ease;
}

.theme-mobile__item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.theme-mobile__item[aria-checked="true"] {
  background: #6366f1;
  color: white;
}

/* Мобилки: меню ПОД кнопкой, выровнено по ПРАВОМУ краю */
@media (max-width: 768px) {
  .theme-mobile__menu {
    bottom: auto;
    top: calc(100% + 5px);
    left: auto;
    right: 0;
    margin-bottom: 0;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin {
  animation: spin 1s linear infinite;
}

/* AI анимация генерации */
.ai-status-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #667eea15, #764ba215);
  border-radius: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #667eea;
  border: 1px solid #667eea30;
  backdrop-filter: blur(4px);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
      opacity: 0;
      transform: translateY(-10px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

.ai-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #e2e8f0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.ai-status-text {
  font-weight: 500;
}

.ai-dots::after {
  content: '';
  animation: dots 1.5s steps(4) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

.ai-steps {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.ai-step {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #94a3b8;
  transition: all 0.3s ease;
  opacity: 0.5;
}

.ai-step.active {
  background: #667eea;
  color: white;
  opacity: 1;
  transform: scale(1.05);
}

/* Анимация поля во время генерации */
.post-output.generating {
  background: linear-gradient(90deg, #f8fafc, #f1f5f9, #f8fafc);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  transition: all 0.3s ease;
}

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

/* Анимация готовности */
.post-output.generated {
  animation: pulse 0.5s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.01); background: #ecfdf5; }
  100% { transform: scale(1); }
}

/* Стили для сообщения об ошибке */
.ai-error-message {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 1px solid #fecaca;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
  animation: slideDown 0.3s ease;
}

.ai-error-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.ai-error-text {
  color: #dc2626;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 16px;
}

.ai-error-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.ai-suggestion {
  background: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: #4b5563;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.ai-error-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-error-btn:hover {
  background: #5a67d8;
  transform: scale(1.02);
}


.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s;
}

.settings-header:hover {
  color: #667eea;
}

.settings-header i {
  transition: transform 0.3s ease;
}

.settings-header.open i {
  transform: rotate(180deg);
}

.settings-body {
  padding: 12px 0;
  animation: slideDown 0.3s ease;
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.setting-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
}

.setting-hint {
  font-size: 11px;
  color: #94a3b8;
  margin: 0;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #667eea;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Select стили */
.setting-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.setting-select:hover {
  border-color: #667eea;
}

.setting-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px #667eea20;
}

/* Анимация */
@keyframes slideDown {
  from {
      opacity: 0;
      transform: translateY(-10px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ НАСТРОЙКИ ===== */
.generation-settings {
  margin-top: 20px;
  border-top: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc, #ffffff);
  border-radius: 16px;
  overflow: hidden;
}

/* Кнопка-переключатель */
.settings-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  color: #475569;
}

.settings-toggle:hover {
  background: #05e0f62b;
  color: #667eea;
}

.settings-toggle-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-toggle-left i {
  font-size: 18px;
  color: #667eea;
}

.settings-toggle-left span {
  font-size: 14px;
}

.settings-badge {
  background: #e2e8f0;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  transition: all 0.3s ease;
}

.settings-toggle:hover .settings-badge {
  background: #667eea20;
  color: #667eea;
}

.settings-chevron {
  transition: transform 0.3s ease;
  font-size: 14px;
  color: #94a3b8;
}

.settings-toggle.open .settings-chevron {
  transform: rotate(180deg);
}

.settings-toggle.open {
  background: #00fff324;
  border-bottom: 1px solid #b8d7ff;
}

/* Тело настроек */
.settings-body {
  padding: 16px;
  animation: slideDown 0.3s ease;
}

/* Карточка настройки */
.setting-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: white;
  border-radius: 14px;
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.setting-card:hover {
  border-color: #667eea40;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
  transform: translateX(4px);
}

.setting-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Иконки настроек */
.setting-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 20px;
  transition: all 0.2s;
}

.emoji-icon {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #d97706;
}

.hashtag-icon {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4f46e5;
  font-weight: bold;
  font-size: 18px;
}

.length-icon {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #059669;
}

.tone-icon {
  background: linear-gradient(135deg, #fce7f3, #fbcfe8);
  color: #db2777;
}

.setting-info {
  flex: 1;
}

.setting-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

.setting-desc {
  font-size: 11px;
  color: #94a3b8;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #667eea;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Select стили */
.setting-select-wrapper {
  flex-shrink: 0;
  min-width: 200px;
}

.setting-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.setting-select:hover {
  border-color: #667eea;
  background: #f8fafc;
}

.setting-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px #667eea20;
}

/* Футер настроек */
.settings-footer {
  margin-top: 16px;
  padding: 10px 14px;
  background: #ecfdf5;
  border-radius: 12px;
  animation: fadeIn 0.3s ease;
}

.settings-footer-text {
  font-size: 12px;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-footer-text i {
  font-size: 14px;
}

/* Анимации */
@keyframes slideDown {
  from {
      opacity: 0;
      transform: translateY(-10px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

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

/* Активный статус для карточек */
.setting-card.active {
  border-color: #667eea;
  background: #f5f3ff;
}

/* Минимальное рабочее решение */
.app-shell {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 260px;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  overflow-y: auto;
  height: 100vh;
}

/* Телефоны */
@media (max-width: 768px) {
  .app-shell {
      flex-direction: column;
      height: 100vh;
  }
  
  .sidebar {
      width: 100%;
      height: auto;
      max-height: 60px;
  }
  
  .sidebar:hover {
      max-height: 100%;
  }
  
  .main {
      height: calc(100vh - 60px);
  }
}

/* Основной контент - добавляем прокрутку */
.main {
  overflow-y: auto;
  height: 100vh;
  scroll-behavior: smooth;
}

/* Красивый скролл для основного контента */
.main::-webkit-scrollbar {
  width: 8px;
}

.main::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.main::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.main::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Контент внутри main не должен ломать прокрутку */
.page {
  min-height: 100%;
  height: auto;
}

/* Для гридов и контента внутри */
.h-full {
  height: auto;
  min-height: 100%;
}

/* ===== КОМПАКТНЫЕ НАСТРОЙКИ ===== */
.generation-settings {
  margin-top: 12px;
  border-top: 1px solid #549eff;
  background-color: #549eff;
}

.settings-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}

.settings-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-toggle-left i {
  font-size: 14px;
  color: #667eea;
}

.settings-chevron {
  transition: transform 0.2s;
  font-size: 12px;
}

.settings-toggle.open .settings-chevron {
  transform: rotate(180deg);
}

.settings-body {
  padding: 10px 0;
}

.settings-compact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.setting-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px;
  background: #001cff36;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
  margin-left: 5px;
  margin-right: 5px;
}

/* Компактный toggle */
.toggle-switch-compact {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 18px;
}

.toggle-switch-compact input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider-compact {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 18px;
}

.toggle-slider-compact:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.toggle-switch-compact input:checked + .toggle-slider-compact {
  background-color: #667eea;
}

.toggle-switch-compact input:checked + .toggle-slider-compact:before {
  transform: translateX(18px);
}

/* Компактный select */
.setting-select-compact {
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 11px;
  background: white;
  cursor: pointer;
  width: auto;
}

/* Левая панель - ограничиваем высоту и добавляем скролл */
.left-panel-scroll {
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

/* Уменьшаем отступы в левой панели */
.panel-header {
  padding: 12px 16px;
  border-radius: 1rem;
}

/* Theme menu (fixed - over everything) */
.theme-mobile {
  position: relative;
}
.theme-mobile__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
}
.theme-mobile__btn i {
  font-size: 10px;
  transition: transform 0.2s;
}
.theme-mobile__btn[aria-expanded="true"] i {
  transform: rotate(180deg);
}
.theme-mobile__menu {
  position: fixed;
  bottom: auto;
  top: 46px;
  right: 8px;
  left: auto;
  width: 200px;
  background: #1e293b;
  border-radius: 12px;
  display: none;
  flex-direction: column;
  z-index: 999999;
  margin-bottom: 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.theme-mobile__menu.show {
  display: flex;
}
.theme-mobile__item {
  padding: 12px 16px;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: white;
  transition: background 0.2s;
}
.theme-mobile__item:hover {
  background: rgba(255, 255, 255, 0.1);
}
.theme-mobile__item[aria-checked="true"] {
  background: #6366f1;
}

@media (max-width: 768px) {
  .theme-mobile__menu {
    position: fixed;
    bottom: auto;
    top: 54px;
    right: 10px;
    left: auto;
    width: 200px;
    background: #1e293b;
    border-radius: 12px;
    display: none;
    flex-direction: column;
    z-index: 999999;
    margin-bottom: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;      /* меню ПОД кнопкой */
  }
}

/* Для ПК (от 769px) */
@media (min-width: 769px) {
  .theme-mobile__menu {
    position: absolute;
    bottom: auto;
    top: -185px;
    right: 28px;
    left: auto;
    width: 200px;
    background: #1e293b;
    border-radius: 12px;
    display: none;
    flex-direction: column;
    z-index: 999999;
    margin-bottom: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;     /* меню НАД кнопкой */
  }
}

/* Альтернативный вариант через grid (более плавный) */
.settings-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease-out;
}

.settings-body:not(.hidden) {
  grid-template-rows: 1fr;
}

.settings-body > * {
  overflow: hidden;
}

