/* ============================================================
   ECTC AI — Components
   All UI components for Aurora Vivid & Night
   ============================================================ */

/* Утилита для 3D монетки */
.coin-icon {
  width: 0.9em;
  height: 0.9em;
  max-width: 32px;
  max-height: 32px;
  vertical-align: middle;
  margin-left: 4px;
  margin-bottom: 2px;
  object-fit: contain;
  display: inline-block;
}

/* ============================================================
   1. HEADER
   ============================================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: box-shadow var(--transition-normal), background var(--transition-normal);
}

[data-theme="dark"] .header {
  background: rgba(38,37,58,0.85);
}

.header.scrolled {
  box-shadow: var(--shadow-sm);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.header__logo-mark {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.5)) drop-shadow(0 0 20px rgba(236, 72, 153, 0.25));
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

div.header__logo-mark {
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding-top: 2px;
}

.header__logo:hover .header__logo-mark {
  transform: scale(1.08);
  filter: drop-shadow(0 0 14px rgba(168, 85, 247, 0.75)) drop-shadow(0 0 26px rgba(236, 72, 153, 0.45));
}

.logo-ai-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: var(--accent);
  font-weight: 800;
  display: inline-block;
}


.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-7);
}

.header__nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.header__nav-link:hover {
  color: var(--text-primary);
}

.header__nav-link.active {
  color: var(--accent);
}

.header__nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--accent);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header__balance {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 12px;
  background: var(--surface-hover);
  border-radius: var(--radius-full);
}

.header__balance-icon {
  font-size: 14px;
}

.header__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

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

.header__burger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
}

.header__burger:hover {
  background: var(--surface-hover);
}

/* ============================================================
   1B. SMART SEARCH (COMMAND PALETTE)
   ============================================================ */

/* Trigger Button in Header */
.search-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0 var(--space-3);
  height: 36px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-left: var(--space-2);
}
.search-trigger:hover {
  background: var(--surface);
  border-color: var(--text-muted);
  color: var(--text-primary);
}
.search-trigger__text {
  flex: 1;
  text-align: left;
  min-width: 140px;
}
.search-trigger__kbd {
  font-size: 11px;
  font-weight: 600;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Modal Overlay */
.cmd-palette {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10vh;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}
.cmd-palette.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.cmd-palette__backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
[data-theme="dark"] .cmd-palette__backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.cmd-palette__container {
  position: relative;
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  overflow: hidden;
  transform: scale(0.98) translateY(-10px);
  transition: transform var(--transition-fast);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}
.cmd-palette.open .cmd-palette__container {
  transform: scale(1) translateY(0);
}

.cmd-palette__header {
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border);
  height: 60px;
  color: var(--text-muted);
}
.cmd-palette__input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0 var(--space-3);
  font-size: 18px;
  color: var(--text-primary);
  outline: none;
  height: 100%;
}
.cmd-palette__input::placeholder {
  color: var(--text-muted);
}
.cmd-palette__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: var(--bg);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.cmd-palette__close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.cmd-palette__body {
  overflow-y: auto;
  padding: var(--space-3);
}

.cmd-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-2);
  margin-top: var(--space-2);
}
.cmd-section-title:first-child { margin-top: 0; }

.cmd-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2);
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition-fast);
  cursor: pointer;
}
.cmd-item:hover, .cmd-item.active {
  background: var(--surface-hover);
}

/* Avatar is precisely scaled */
.cmd-item__avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.cmd-item__info {
  flex: 1;
  min-width: 0;
}
.cmd-item__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmd-item__desc {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.cmd-item__cat {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.cmd-empty {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--text-muted);
}
.cmd-empty svg {
  margin: 0 auto var(--space-3);
  opacity: 0.5;
}

@media (max-width: 639px) {
  .header {
    height: 56px;
    padding: 0 var(--space-4);
  }
  .header__nav { display: none; }
  .header__burger { display: flex; }
  .header__balance { display: none; }
  .header__user-name { display: none; }
  .header__logo-text { display: none !important; }
  
  .search-trigger {
    flex: 1;
    margin-right: var(--space-2);
  }
  .search-trigger__text { display: none; }
  .search-trigger__kbd { display: none; }
  
  /* Modal takes full screen on mobile */
  .cmd-palette {
    padding-top: 0;
    align-items: flex-end;
  }
  .cmd-palette__container {
    max-height: 90vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
    transform: translateY(100%);
  }
  .cmd-palette.open .cmd-palette__container {
    transform: translateY(0);
  }
  .cmd-item__avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

@media (max-width: 767px) {
  .header__burger { display: flex; }
  .header__nav { display: none; }
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header__user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text-primary);
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

.header__user:hover {
  background: var(--surface-hover);
}

.header__user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.header__logo-text {
  display: flex;
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}


/* ============================================================
   2. BOTTOM TAB BAR (Mobile Navigation)
   ============================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav__items {
  display: flex;
  height: 100%;
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  transition: color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item:active {
  transform: scale(0.92);
}

.bottom-nav__item.active {
  color: var(--accent);
}

.bottom-nav__item-icon {
  font-size: 22px;
  line-height: 1;
}

@media (max-width: 639px) {
  .bottom-nav { display: block; }
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0)); }
}

/* ============================================================
   3. HERO
   ============================================================ */
.hero {
  position: relative;
  padding: 120px 0 var(--space-10);
  overflow: hidden;
  text-align: center;
}

.hero__aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.hero__aurora--violet {
  width: 400px;
  height: 400px;
  background: rgba(var(--accent-rgb), 0.06);
  top: -100px;
  right: 10%;
}

.hero__aurora--pink {
  width: 350px;
  height: 350px;
  background: rgba(236, 72, 153, 0.04);
  bottom: -50px;
  left: 5%;
}

[data-theme="dark"] .hero__aurora--violet { opacity: 1.5; }
[data-theme="dark"] .hero__aurora--pink { opacity: 1.5; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: var(--space-6);
}

.hero__title {
  max-width: 600px;
  margin: 0 auto var(--space-4);
}

.hero__subtitle {
  max-width: 520px;
  margin: 0 auto var(--space-7);
  font-size: 17px;
  color: var(--text-secondary);
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}

.hero__cards {
  display: flex;
  gap: var(--space-6);
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 639px) {
  .hero { padding: 96px 0 var(--space-8); }
  .hero__subtitle { font-size: 15px; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; }
  .hero__cards { overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; padding: 0 var(--space-4); scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .hero__cards > * { flex: 0 0 240px; scroll-snap-align: center; }
}

/* ============================================================
   4. CHARACTER CARD
   ============================================================ */
.char-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100%;
}

.char-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.char-card:active {
  transform: scale(0.97);
  transition: transform var(--transition-fast);
}

.char-card__aura {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.char-card__aura img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%; /* Смещаем фокус кадрирования ближе к верхней части (где обычно лица) */
}

.char-card__badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.char-card__info {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.char-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  gap: var(--space-2);
}

.char-card__name {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.char-card__desc {
  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-bottom: var(--space-3);
}

.char-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-2);
}

.char-card__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--success);
  margin-top: auto;
  padding-top: var(--space-2);
  white-space: nowrap;
}

.char-card__footer .char-card__status {
  margin-top: 0;
  padding-top: 0;
}

.char-card__status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--success);
  flex-shrink: 0;
}

/* Smart Hybrid Activity / CTA Badge: Концепция «Тихая роскошь» */
.char-card__activity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--transition-normal);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

[data-theme="light"] .char-card__activity {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

.char-card__activity-count {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  transition: color var(--transition-normal);
}

.char-card__activity i.ph {
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0.85;
  transition: transform var(--transition-normal), color var(--transition-normal), opacity var(--transition-normal);
}

.char-card__activity-new {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1;
  transition: color var(--transition-normal);
}

.char-card__activity-arrow {
  font-size: 10px !important;
  color: var(--text-muted);
  opacity: 0.4;
  transform: translateX(0);
  transition: all var(--transition-normal) !important;
}

/* Micro-interaction on card hover */
.char-card:hover .char-card__activity {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .char-card:hover .char-card__activity {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.char-card:hover .char-card__activity-count,
.char-card:hover .char-card__activity-new {
  color: var(--text-primary);
}

.char-card:hover .char-card__activity i.ph-chat-circle-dots,
.char-card:hover .char-card__activity i.ph-sparkle {
  transform: scale(1.1);
  color: var(--accent-hover);
  opacity: 1;
}

.char-card:hover .char-card__activity-arrow {
  opacity: 0.9;
  color: var(--text-primary);
  transform: translateX(2px);
}

/* Dark theme card glow on hover */
[data-theme="dark"] .char-card:hover {
  box-shadow: var(--shadow-lg), var(--shadow-glow-violet);
}

/* ============================================================
   5. CHARACTER AVATAR
   ============================================================ */
.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.avatar--xs { width: 32px; height: 32px; }
.avatar--sm { width: 40px; height: 40px; }
.avatar--md { width: 48px; height: 48px; }
.avatar--lg { width: 72px; height: 72px; }
.avatar--xl { width: 100px; height: 100px; }

.avatar--online {
  box-shadow: 0 0 0 2.5px var(--success), 0 0 0 4.5px var(--surface);
}

.avatar--selected {
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 5px var(--surface);
}

/* ============================================================
   6. CATEGORY CHIP
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 12px 5px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: default;
  white-space: nowrap;
}

.chip--friend     { background: rgba(20,187,166,0.10); color: #0E9A86; }
.chip--romantic    { background: rgba(124,58,237,0.10); color: #7C3AED; }
.chip--romantic-alt{ background: rgba(236,72,153,0.10); color: #DB2777; }
.chip--therapist   { background: rgba(99,102,241,0.10); color: #4F46E5; }
.chip--assistant   { background: rgba(59,130,246,0.10); color: #2563EB; }
.chip--bold        { background: rgba(245,158,11,0.10); color: #D97706; }
.chip--education   { background: rgba(59,130,246,0.10); color: #2563EB; }
.chip--health      { background: rgba(34,197,94,0.10); color: #16A34A; }
.chip--expert      { background: rgba(234,179,8,0.10); color: #CA8A04; }
.chip--creative    { background: rgba(217,70,239,0.10); color: #C026D3; }
.chip--travel      { background: rgba(14,165,233,0.10); color: #0284C7; }

[data-theme="dark"] .chip--friend     { background: rgba(34,211,187,0.15); color: #22D3BB; }
[data-theme="dark"] .chip--romantic    { background: rgba(139,92,246,0.15); color: #A78BFA; }
[data-theme="dark"] .chip--romantic-alt{ background: rgba(236,72,153,0.15); color: #F472B6; }
[data-theme="dark"] .chip--therapist   { background: rgba(99,102,241,0.15); color: #818CF8; }
[data-theme="dark"] .chip--assistant   { background: rgba(59,130,246,0.15); color: #60A5FA; }
[data-theme="dark"] .chip--bold        { background: rgba(245,158,11,0.15); color: #FBBF24; }
[data-theme="dark"] .chip--education   { background: rgba(59,130,246,0.15); color: #60A5FA; }
[data-theme="dark"] .chip--health      { background: rgba(34,197,94,0.15); color: #4ADE80; }
[data-theme="dark"] .chip--expert      { background: rgba(234,179,8,0.15); color: #FACC15; }
[data-theme="dark"] .chip--creative    { background: rgba(217,70,239,0.15); color: #E879F9; }
[data-theme="dark"] .chip--travel      { background: rgba(14,165,233,0.15); color: #38BDF8; }

.chip--clickable { cursor: pointer; }
.chip--clickable:hover { filter: brightness(0.95); }
.chip--clickable.active { color: #fff !important; }
.chip--clickable.active.chip--friend { background: #14BBA6; }
.chip--clickable.active.chip--romantic { background: #7C3AED; }
.chip--clickable.active.chip--therapist { background: #6366F1; }
.chip--clickable.active.chip--assistant { background: #3B82F6; }
.chip--clickable.active.chip--bold { background: #F59E0B; }
.chip--clickable.active.chip--education { background: #3B82F6; }
.chip--clickable.active.chip--health    { background: #22C55E; }
.chip--clickable.active.chip--expert    { background: #EAB308; }
.chip--clickable.active.chip--creative  { background: #D946EF; }
.chip--clickable.active.chip--travel    { background: #0EA5E9; }

/* ============================================================
   7. BUTTON
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }
.btn:disabled, .btn.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Primary (Gradient) */
.btn--primary {
  background: var(--accent-gradient);
  color: #FFFFFF;
  border: none;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  filter: brightness(1.05);
  box-shadow: var(--shadow-md), 0 4px 16px rgba(var(--accent-rgb), 0.2);
}
[data-theme="dark"] .btn--primary:hover {
  box-shadow: var(--shadow-md), var(--shadow-glow-violet);
}

/* Secondary (Outline) */
.btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn--secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn--ghost:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* Danger */
.btn--danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1.5px solid var(--danger);
}
.btn--danger:hover {
  background: var(--danger);
  color: #fff;
}

/* Icon Button */
.btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
}
.btn--icon:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* Sizes */
.btn--sm { height: 36px; padding: 0 var(--space-4); font-size: 13px; }
.btn--lg { height: 52px; padding: 0 var(--space-7); font-size: 16px; }
.btn--pill { border-radius: var(--radius-full); }
.btn--full { width: 100%; }

/* ============================================================
   8. INPUT
   ============================================================ */
.input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 var(--space-4);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input::placeholder { color: var(--text-muted); }

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.input--error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}

.input:disabled {
  opacity: 0.5;
  background: var(--bg);
  cursor: not-allowed;
}

.textarea {
  min-height: 100px;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
  border-radius: var(--radius-md);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.input-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.input-error-text {
  font-size: 12px;
  color: var(--danger);
}

/* ============================================================
   9. CHAT BUBBLE
   ============================================================ */
.chat-area {
  background: var(--bg);
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.chat-msg {
  display: flex;
  gap: var(--space-2);
  max-width: 70%;
  animation: fadeInUp 0.3s ease-out;
}

.chat-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg--ai {
  align-self: flex-start;
}

.chat-bubble {
  padding: var(--space-3) var(--space-4);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  position: relative;
  word-wrap: break-word;
}

.chat-msg--user .chat-bubble {
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
}

[data-theme="dark"] .chat-msg--user .chat-bubble {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.18);
}

.chat-msg--ai .chat-bubble {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
}

.chat-msg__name {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.chat-msg__time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--space-1);
  text-align: center;
}

.chat-msg__actions {
  display: none;
  position: absolute;
  top: -28px;
  right: 0;
  background: var(--surface-elevated);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 4px;
  gap: 2px;
}

.chat-bubble:hover .chat-msg__actions {
  display: flex;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.chat-typing__dots {
  display: flex;
  gap: 4px;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
  box-shadow: var(--shadow-sm);
}

.chat-typing__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
  animation: typingBounce 1.4s ease-in-out infinite;
}

.chat-typing__dot:nth-child(2) { animation-delay: 0.1s; }
.chat-typing__dot:nth-child(3) { animation-delay: 0.2s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 639px) {
  .chat-msg { max-width: 82%; }
}

/* ============================================================
   10. CHAT COMPOSER
   ============================================================ */
.composer {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.composer__input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 120px;
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--radius-2xl);
  font-size: 15px;
  color: var(--text-primary);
  resize: none;
  line-height: 1.5;
  transition: border-color var(--transition-fast);
}

.composer__input:focus {
  border-color: rgba(var(--accent-rgb), 0.2);
}

.composer__input::placeholder {
  color: var(--text-muted);
}

.composer__send {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  color: var(--text-muted);
  font-size: 18px;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.composer__send.active {
  background: var(--accent-gradient);
  color: #fff;
}

.composer__send.active:hover {
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3);
}

[data-theme="dark"] .composer__send.active:hover {
  box-shadow: var(--shadow-glow-violet);
}

/* ============================================================
   11. SIDEBAR (Chat List)
   ============================================================ */
.sidebar {
  width: 300px;
  height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

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

.sidebar__title {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.sidebar__list {
  flex: 1;
  overflow-y: auto;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-left: 3px solid transparent;
  min-height: 72px;
}

.sidebar__item:hover {
  background: var(--surface-hover);
}

.sidebar__item.active {
  background: rgba(var(--accent-rgb), 0.06);
  border-left-color: var(--accent);
}

.sidebar__item-info {
  flex: 1;
  min-width: 0;
}

.sidebar__item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.sidebar__item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar__item-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar__item-msg {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__item.unread .sidebar__item-name {
  font-weight: 700;
}

.sidebar__item.unread .sidebar__item-msg {
  color: var(--text-primary);
}

@media (max-width: 639px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 340px;
    height: 100dvh;
    z-index: 200;
    transition: left var(--transition-smooth);
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
  }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
}

/* ============================================================
   12. MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(8px);
  transition: transform var(--transition-smooth);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--space-6) 0;
}

.modal__body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6) var(--space-6);
  border-top: 1px solid var(--border);
}

@media (max-width: 639px) {
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0 !important;
    align-self: flex-end;
    transform: translateY(100%);
  }
  .modal-overlay.open .modal { transform: translateY(0); }
  .modal-overlay { align-items: flex-end; }
  
  .modal__footer {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4);
  }
}

/* ============================================================
   13. DROPDOWN
   ============================================================ */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96);
  transform-origin: top left;
  transition: all var(--transition-fast);
}

.dropdown__menu.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dropdown__item:hover {
  background: var(--surface-hover);
}

.dropdown__item.active {
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--accent);
}

.dropdown__item--danger {
  color: var(--danger);
}

.dropdown__item--danger:hover {
  background: var(--danger-bg);
}

.dropdown__divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ============================================================
   14. TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: var(--space-7);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--space-3) 4px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-normal);
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   15. PRICING CARD
   ============================================================ */
.pricing-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
  box-shadow: var(--shadow-md);
  position: relative;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pricing-card--featured {
  border: 2px solid var(--accent);
}

[data-theme="dark"] .pricing-card--featured {
  box-shadow: var(--shadow-lg), var(--shadow-glow-violet);
}

.pricing-card__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.pricing-card__name {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.pricing-card__price {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

.pricing-card__price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-card__divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-5) 0;
}

.pricing-card__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.pricing-card__feature {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 14px;
  color: var(--text-primary);
}

.pricing-card__feature-icon {
  color: var(--success);
  font-size: 16px;
  flex-shrink: 0;
}

/* ============================================================
   16. MEMORY CARD
   ============================================================ */
.memory-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--accent);
  transition: box-shadow var(--transition-fast);
  position: relative;
}

.memory-card:hover {
  box-shadow: var(--shadow-md);
}

.memory-card--preferences { border-left-color: var(--success); }
.memory-card--events { border-left-color: var(--warning); }
.memory-card--emotions { border-left-color: var(--accent-secondary); }

.memory-card__category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.memory-card__fact {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
}

.memory-card__date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.memory-card__menu {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.memory-card:hover .memory-card__menu {
  opacity: 1;
}

/* ============================================================
   17. NOTIFICATION (Toast)
   ============================================================ */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

@media (max-width: 639px) {
  .toast-container {
    top: var(--space-4);
    right: var(--space-4);
    left: var(--space-4);
  }
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 14px 18px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-width: 380px;
  border-left: 3px solid var(--accent);
  animation: toastIn 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

.toast--success { border-left-color: var(--success); }
.toast--warning { border-left-color: var(--warning); }
.toast--error   { border-left-color: var(--danger); }
.toast--info    { border-left-color: var(--accent); }

.toast__icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
}

.toast--success .toast__icon { color: var(--success); }
.toast--warning .toast__icon { color: var(--warning); }
.toast--error .toast__icon   { color: var(--danger); }
.toast--info .toast__icon    { color: var(--accent); }

.toast__text {
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
}

.toast__close {
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  animation: toastProgress 5s linear forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0; }
}

/* ============================================================
   18. EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-9);
  text-align: center;
}

.empty-state__icon {
  font-size: 56px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state__title {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state__desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 340px;
  margin-bottom: var(--space-6);
}

/* ============================================================
   19. LOADING STATE
   ============================================================ */

/* Three-dot loader */
.loader-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.loader-dots__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--accent);
  animation: loaderBounce 1.4s ease-in-out infinite;
}

.loader-dots__dot:nth-child(2) {
  animation-delay: 0.1s;
  background: var(--accent-secondary);
}

.loader-dots__dot:nth-child(3) {
  animation-delay: 0.2s;
  background: var(--text-muted);
}

@keyframes loaderBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-10px); opacity: 1; }
}

/* Skeleton */
.skeleton {
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  animation: shimmer 1.5s linear infinite;
}

[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
}

.skeleton--text { height: 14px; width: 80%; margin-bottom: 8px; border-radius: 4px; }
.skeleton--text-short { width: 50%; }
.skeleton--avatar { border-radius: var(--radius-full); }
.skeleton--card { border-radius: var(--radius-xl); }

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* Inline spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

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

/* ============================================================
   20. ERROR STATE
   ============================================================ */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: var(--space-8);
}

.error-page__code {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 72px;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.3;
  line-height: 1;
}

.error-page__icon {
  font-size: 64px;
  color: var(--danger);
  opacity: 0.7;
  margin-bottom: var(--space-4);
}

.error-page__msg {
  font-size: 17px;
  color: var(--text-secondary);
  margin: var(--space-2) 0 var(--space-6);
}

.chat-error {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--danger-bg);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--danger);
}

.connection-banner {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--danger-bg);
  color: var(--danger);
  padding: 10px var(--space-4);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  z-index: 99;
}

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ============================================================
   UTILITY: AUTH PAGE
   ============================================================ */
.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.auth-card__logo {
  text-align: center;
  margin-bottom: var(--space-7);
}

.auth-card__title {
  text-align: center;
  margin-bottom: var(--space-2);
}

.auth-card__subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: var(--space-7);
}

.auth-card__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.auth-card__divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--text-muted);
  font-size: 13px;
}

.auth-card__divider::before,
.auth-card__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-card__social {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.auth-card__social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  height: 44px;
  padding: 0 var(--space-4);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-card__social-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.auth-card__social-btn img,
.auth-card__social-btn svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   UTILITY: PAGE BODY WITH HEADER OFFSET
   ============================================================ */
.page-body {
  padding-top: 64px;
}

@media (max-width: 639px) {
  .page-body { padding-top: 56px; }
}

/* Chat page layout */
.chat-layout {
  display: flex;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}

.chat-header__info {
  flex: 1;
  min-width: 0;
}

.chat-header__name {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.chat-header__status {
  font-size: 12px;
  color: var(--success);
}

@media (max-width: 639px) {
  .chat-layout { padding-top: 0; top: 56px; height: auto; }
}

/* ============================================================
   21. SITE LAYOUT (4-part grid)
   ============================================================ */
.site-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 1fr auto;
  min-height: calc(100dvh - 64px);
  margin-top: 64px;
}

@media (max-width: 1023px) {
  .site-layout {
    grid-template-columns: 220px 1fr;
  }
}

@media (max-width: 767px) {
  .site-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 639px) {
  .site-layout {
    margin-top: 56px;
    min-height: calc(100dvh - 56px);
  }
}

/* ============================================================
   22. LEFT SIDEBAR — Category Navigation
   ============================================================ */
.left-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--space-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: sticky;
  top: 64px;
  height: calc(100dvh - 64px);
  overflow-y: auto;
  z-index: 10;
}

@media (max-width: 639px) {
  .left-sidebar {
    top: 56px;
    height: calc(100dvh - 56px);
  }
}

.left-sidebar__title {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 var(--space-5) var(--space-3);
}

.left-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--space-3);
}

.left-sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
}

.left-sidebar__item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.left-sidebar__item.active {
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  font-weight: 600;
}

.left-sidebar__item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.left-sidebar__icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* Бейджи счетчиков в сайдбаре каталога: Концепция «Тихая роскошь» */
.left-sidebar__count {
  margin-left: auto;
  position: static;
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.left-sidebar__count--single {
  width: 20px;
  min-width: 20px;
  padding: 0;
  border-radius: 50%;
}

.left-sidebar__item:hover .left-sidebar__count,
.left-sidebar__item.active .left-sidebar__count,
.btn:hover .left-sidebar__count {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}

[data-theme="light"] .left-sidebar__count {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.07);
  color: var(--text-secondary);
}

[data-theme="light"] .left-sidebar__item:hover .left-sidebar__count,
[data-theme="light"] .left-sidebar__item.active .left-sidebar__count,
[data-theme="light"] .btn:hover .left-sidebar__count {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
}

.left-sidebar__divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-3) var(--space-5);
}

.left-sidebar__back {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  margin: 0 var(--space-3);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.left-sidebar__back:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.left-sidebar-overlay {
  display: none;
}

/* Mobile: off-canvas left sidebar */
@media (max-width: 767px) {
  .left-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100dvh;
    z-index: 200;
    transition: left var(--transition-smooth);
    padding-top: calc(64px + var(--space-5));
  }
  .left-sidebar.open { left: 0; }

  .left-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
  }
  .left-sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 639px) {
  .left-sidebar {
    padding-top: calc(56px + var(--space-5));
  }
}

/* ============================================================
   23. RIGHT CONTENT AREA
   ============================================================ */
.right-content {
  padding: var(--space-6);
  overflow-y: auto;
  min-height: 0;
}

@media (max-width: 639px) {
  .right-content {
    padding: var(--space-4);
  }
}

/* ============================================================
   24. FOOTER
   ============================================================ */
.site-footer {
  grid-column: 1 / -1;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-8) var(--space-6);
}

.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.site-footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.site-footer__desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 280px;
}

.site-footer__col-title {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.site-footer__link {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.site-footer__link:hover {
  color: var(--accent);
}

.site-footer__bottom {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-6);
  margin-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 767px) {
  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
  .site-footer__brand { grid-column: 1 / -1; }
  .site-footer__bottom { flex-direction: column; gap: var(--space-2); text-align: center; }
}

@media (max-width: 639px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
  .site-footer { padding: var(--space-6) var(--space-4); }
}

/* ============================================================
   25. CHARACTER GRID (Catalog)
   ============================================================ */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
}

.char-card__link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-width: 0;
}

/* 2-Column Mobile Grid for Characters (High-Tech Luxury UI) */
@media (max-width: 639px) {
  .right-content {
    padding: 12px;
  }

  .char-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .char-card {
    min-width: 0;
    border-radius: var(--radius-lg, 16px);
  }

  .char-card__aura {
    height: 172px;
    aspect-ratio: 1 / 1.05;
    min-height: 145px;
    max-height: 220px;
  }

  .char-card__aura img {
    object-position: center 15%;
  }

  .char-card .fav-btn {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
  }

  .char-card .fav-btn svg {
    width: 14px;
    height: 14px;
  }

  .char-card .char-card__zoom-btn {
    bottom: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    opacity: 0.95;
  }

  .char-card .char-card__zoom-btn svg {
    width: 12px;
    height: 12px;
  }

  .char-card__info {
    padding: 10px 10px 12px;
  }

  .char-card__header {
    margin-bottom: 4px;
    min-height: 20px;
  }

  /* Glass Category Chip floating gracefully in top-left over character portrait */
  .char-card__header .chip {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    line-height: 1.2;
    border-radius: 100px;
    background: rgba(12, 14, 24, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.02em;
    max-width: calc(100% - 46px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .char-card__name {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.25;
    width: 100%;
  }

  .char-card__desc {
    font-size: 11.5px;
    line-height: 1.35;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 31px;
  }

  .char-card__tags {
    margin-bottom: 6px !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    overflow: hidden;
  }

  .char-card__tags .char-card__tag-link {
    height: 18px;
    font-size: 10px;
    padding: 0 6px;
    white-space: nowrap;
  }

  .char-card__tags .char-card__tag-link:not(:first-child) {
    display: none;
  }

  .char-card__tags .char-card__tag-more {
    height: 18px;
    min-width: 18px;
    font-size: 9.5px;
    padding: 0 4px;
  }

  .char-card__footer {
    padding-top: 4px;
    gap: 4px;
  }

  .char-card__status {
    font-size: 10.5px;
    gap: 4px;
  }

  .char-card__status-dot {
    width: 5px;
    height: 5px;
  }

  .char-card__activity {
    height: 20px;
    padding: 0 6px;
    gap: 3px;
    font-size: 10px;
    border-radius: 100px;
  }

  .char-card__activity-count {
    font-size: 10px;
  }

  .char-card__activity i.ph {
    font-size: 11px;
  }

  .char-card__activity-new {
    font-size: 9.5px;
  }

  .char-card__activity-arrow {
    display: none !important;
  }
}

@media (max-width: 350px) {
  .right-content {
    padding: 8px;
  }

  .char-grid {
    gap: 8px;
  }

  .char-card__info {
    padding: 8px;
  }

  .char-card__name {
    font-size: 13.5px;
  }

  .char-card__desc {
    font-size: 11px;
  }
}

/* ============================================================
   26. CHARACTER PROFILE (Detail page)
   ============================================================ */
.char-profile {
  max-width: 760px;
}

.char-profile__hero {
  position: relative;
  display: flex;
  gap: var(--space-7);
  align-items: flex-start;
  margin-bottom: var(--space-7);
}

.char-profile__photo-wrap {
  position: relative;
  flex-shrink: 0;
}

.char-profile__photo {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-2xl);
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.char-profile__photo-aura {
  position: absolute;
  inset: -8px;
  border-radius: calc(var(--radius-2xl) + 8px);
  opacity: 0.35;
  filter: blur(20px);
  z-index: 0;
  transition: opacity var(--transition-smooth);
}

.char-profile__photo-wrap:hover .char-profile__photo-aura {
  opacity: 0.55;
}

[data-theme="dark"] .char-profile__photo-aura {
  opacity: 0.5;
}

[data-theme="dark"] .char-profile__photo-wrap:hover .char-profile__photo-aura {
  opacity: 0.7;
}

.char-profile__photo-placeholder {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 64px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.char-profile__header {
  flex: 1;
  padding-top: var(--space-3);
}

.char-profile__name {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0;
  margin-bottom: var(--space-2);
}

.char-profile__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.char-profile__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--success);
}

.char-profile__desc {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}

.char-profile__long-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.char-profile__section {
  margin-bottom: var(--space-6);
}

.char-profile__section-title {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.char-profile__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}

.char-profile__stat {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border: 1px solid var(--border);
  transition: border-color var(--transition-fast);
}

.char-profile__stat:hover {
  border-color: var(--border-hover);
}

.char-profile__stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.char-profile__stat-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.char-profile__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.char-profile__tag {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(var(--accent-rgb), 0.1);
}

/* Greeting block */
.char-profile__greeting {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  position: relative;
  border: 1px solid var(--border);
}

.char-profile__greeting::before {
  content: '';
  position: absolute;
  left: var(--space-5);
  top: -8px;
  width: 16px;
  height: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-right: none;
  transform: rotate(45deg);
}

.char-profile__greeting-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.char-profile__greeting-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  font-style: italic;
}

/* Personality block */
.char-profile__personality {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* CTA */
.char-profile__cta {
  margin-top: var(--space-7);
}

/* SEO text */
.char-profile__seo {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}

@media (max-width: 639px) {
  .char-profile {
    padding: var(--space-4) !important;
  }
  .char-profile__hero {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-5) !important;
  }
  .char-profile__photo-container {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
  }
  .char-profile__photo,
  .char-profile__photo-placeholder {
    width: 100% !important;
    height: 100% !important;
  }
  .char-profile__meta { justify-content: center; }
  .char-profile__name { font-size: 26px; }
}

/* ============================================================
   27. CHAT PAGE LAYOUT
   ============================================================ */
.chat-page {
  display: grid;
  grid-template-columns: 260px 1fr;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
}

@media (max-width: 1023px) {
  .chat-page { grid-template-columns: 220px 1fr; }
}

@media (max-width: 767px) {
  .chat-page { grid-template-columns: 1fr; }
}

@media (max-width: 639px) {
  .chat-page { margin-top: 0; top: 56px; height: auto; }
}

/* Chat left sidebar */
.chat-left-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-left-sidebar__current {
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.chat-left-sidebar__current-info {
  flex: 1;
  min-width: 0;
}

.chat-left-sidebar__current-name {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-left-sidebar__current-status {
  font-size: 12px;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-left-sidebar__section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-4) var(--space-4) var(--space-2);
}

.chat-left-sidebar__favorites {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-2);
}

.chat-left-sidebar__nav {
  padding: var(--space-3) var(--space-3);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}

/* Chat right (main) */
.chat-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.chat-right__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}

.chat-right__header-info {
  flex: 1;
  min-width: 0;
}

.chat-right__header-name {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.chat-right__header-status {
  font-size: 12px;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-right__messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.chat-right__composer {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5) calc(var(--space-3) + env(safe-area-inset-bottom)) var(--space-5);
  background: var(--surface);
  border-top: 1px solid var(--border);
  min-width: 0;
}

/* Mobile chat sidebar */
@media (max-width: 767px) {
  .chat-left-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100dvh;
    z-index: 200;
    transition: left var(--transition-smooth);
    padding-top: 64px;
  }
  .chat-left-sidebar.open { left: 0; }
}

@media (max-width: 639px) {
  .chat-left-sidebar { padding-top: 56px; }
  .chat-right__header { padding: var(--space-3) var(--space-4); }
  .chat-right__messages { padding: var(--space-4); }
  .chat-right__composer { padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom)) var(--space-4); }
}

/* ============================================================
   28. FAVORITE ITEM
   ============================================================ */
.favorite-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
  color: inherit;
}

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

.favorite-item.active {
  background: rgba(var(--accent-rgb), 0.06);
}

.favorite-item__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.favorite-item__status {
  flex-shrink: 0;
}

/* ============================================================
   29. PULSING STATUS DOT
   ============================================================ */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--success);
  flex-shrink: 0;
}

.status-dot--pulse {
  position: relative;
}

.status-dot--pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: var(--radius-full);
  border: 2px solid var(--success);
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

/* ============================================================
   30. AUTH MODAL (Login/Register overlay)
   ============================================================ */
.auth-modal .modal {
  max-width: 440px;
}

.auth-modal .modal__body {
  padding: var(--space-5) var(--space-6) var(--space-6);
}

.auth-modal__logo {
  text-align: center;
  margin-bottom: var(--space-5);
}

.auth-modal__logo-mark {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0 auto var(--space-3);
}

.auth-modal__title {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-2);
}

.auth-modal__subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: var(--space-5);
}

.auth-card__social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.auth-card__social-btn:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
}


/* ============================================================
   31. HERO SECTION (Landing page)
   ============================================================ */
.landing-hero {
  position: relative;
  padding: var(--space-10) 0;
  text-align: center;
  overflow: hidden;
}

.landing-hero__aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.5;
}

.landing-hero__aurora--1 {
  width: 500px;
  height: 500px;
  background: rgba(var(--accent-rgb), 0.08);
  top: -150px;
  right: -50px;
  animation: auroraFloat 8s ease-in-out infinite;
}

.landing-hero__aurora--2 {
  width: 400px;
  height: 400px;
  background: rgba(236, 72, 153, 0.06);
  bottom: -100px;
  left: -50px;
  animation: auroraFloat 10s ease-in-out infinite reverse;
}

[data-theme="dark"] .landing-hero__aurora--1 { opacity: 0.8; }
[data-theme="dark"] .landing-hero__aurora--2 { opacity: 0.8; }

@keyframes auroraFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -15px) scale(1.05); }
  66% { transform: translate(-10px, 10px) scale(0.95); }
}

.landing-hero__content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

.landing-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(var(--accent-rgb), 0.06);
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: var(--space-6);
}

.landing-hero__title {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.landing-hero__subtitle {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: var(--space-7);
}

@media (max-width: 639px) {
  .landing-hero { padding: var(--space-8) 0; }
  .landing-hero__title { font-size: 30px; }
  .landing-hero__subtitle { font-size: 15px; }
}

/* ============================================================
   32. FEATURE CARDS (Landing)
   ============================================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-8);
}

.feature-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  text-align: left;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

[data-theme="dark"] .feature-card:hover {
  box-shadow: var(--shadow-md), var(--shadow-glow-violet);
}

.feature-card__icon {
  font-size: 28px;
  margin-bottom: var(--space-3);
}

.feature-card__title {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.feature-card__desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 767px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   33. CATALOG PAGE HEADER
   ============================================================ */
.catalog-header {
  margin-bottom: var(--space-6);
}

.catalog-header__title {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.catalog-header__subtitle {
  font-size: 15px;
  color: var(--text-secondary);
}

/* ============================================================
   34. MOBILE SIDEBAR TOGGLE
   ============================================================ */
.mobile-sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 20px;
  background: transparent;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.mobile-sidebar-toggle:hover {
  background: var(--surface-hover);
}

@media (max-width: 767px) {
  .mobile-sidebar-toggle { display: flex; }
}

/* ============================================================
   35. POPULAR CHARACTERS SIDEBAR (Home right)
   ============================================================ */
.popular-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.popular-sidebar__title {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.popular-sidebar__card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
}

.popular-sidebar__card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

.popular-sidebar__card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.popular-sidebar__card-desc {
  font-size: 12px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.composer-wrapper { display: flex; align-items: flex-end; gap: var(--space-3); width: 100%; min-width: 0; }
/* =========================================================================
   TOAST NOTIFICATIONS (Premium Commercial Design)
   ========================================================================= */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

@media (max-width: 600px) {
    #toast-container {
        top: 16px;
        right: 16px;
        left: 16px;
        width: auto;
    }
}

.toast {
    animation: none;
    border-left: 1px solid var(--border, #eaeaea);
    background: var(--surface-elevated, #fff);
    border: 1px solid var(--border, #eaeaea);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.12), 0 3px 8px rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-lg, 14px);
    padding: 16px 18px;
    width: 360px;
    max-width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

@media (max-width: 600px) {
    .toast {
        width: 100%;
    }
}

[data-theme="dark"] .toast {
    background: rgba(26, 26, 34, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 48px -8px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.toast.toast--show {
    transform: translateX(0);
    opacity: 1;
}

/* Специальные акценты для типов тостов */
[data-theme="dark"] .toast--error {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 22px 50px -6px rgba(0, 0, 0, 0.78), 0 0 30px rgba(239, 68, 68, 0.22), inset 0 1px 0 rgba(239, 68, 68, 0.25);
    background: linear-gradient(135deg, rgba(44, 22, 26, 0.94) 0%, rgba(26, 22, 30, 0.96) 100%);
}

[data-theme="dark"] .toast--warning {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 22px 50px -6px rgba(0, 0, 0, 0.78), 0 0 30px rgba(245, 158, 11, 0.18), inset 0 1px 0 rgba(245, 158, 11, 0.25);
    background: linear-gradient(135deg, rgba(44, 32, 20, 0.94) 0%, rgba(26, 22, 30, 0.96) 100%);
}

[data-theme="dark"] .toast--success {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 22px 50px -6px rgba(0, 0, 0, 0.78), 0 0 30px rgba(16, 185, 129, 0.18), inset 0 1px 0 rgba(16, 185, 129, 0.25);
    background: linear-gradient(135deg, rgba(20, 44, 30, 0.94) 0%, rgba(26, 22, 30, 0.96) 100%);
}

[data-theme="dark"] .toast--info {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 22px 50px -6px rgba(0, 0, 0, 0.78), 0 0 30px rgba(99, 102, 241, 0.18), inset 0 1px 0 rgba(99, 102, 241, 0.25);
    background: linear-gradient(135deg, rgba(26, 28, 48, 0.94) 0%, rgba(26, 22, 30, 0.96) 100%);
}

.toast__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast--success .toast__icon { color: var(--success, #10b981); background: rgba(16, 185, 129, 0.15); }
.toast--error .toast__icon { color: #f87171; background: rgba(239, 68, 68, 0.18); box-shadow: 0 0 12px rgba(239, 68, 68, 0.25); }
.toast--warning .toast__icon { color: var(--warning, #f59e0b); background: rgba(245, 158, 11, 0.15); }
.toast--info .toast__icon { color: var(--accent, #6366f1); background: rgba(99, 102, 241, 0.15); }

.toast__content {
    flex: 1;
    min-width: 0;
    margin-top: 1px;
}

.toast__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.toast__message {
    font-size: 13px;
    color: var(--text-secondary, #94a3b8);
    margin: 0;
    line-height: 1.5;
    word-break: break-word;
}

.toast__actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast__action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.toast--error .toast__action-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.toast--error .toast__action-btn:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.toast__close {
    background: none;
    border: none;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    padding: 0;
    margin-top: 2px;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.toast__close:hover {
    color: var(--text-primary, #fff);
}

/* Прогресс-бар */
.toast__progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    transform: scaleX(1);
    pointer-events: none;
}

.toast--error .toast__progress-bar { background: #ef4444; opacity: 0.6; }
.toast--warning .toast__progress-bar { background: #f59e0b; opacity: 0.6; }
.toast--success .toast__progress-bar { background: #10b981; opacity: 0.6; }
.toast--info .toast__progress-bar { background: #6366f1; opacity: 0.6; }

/* Shake animation при повторе */
@keyframes toastShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.toast--shake {
    animation: toastShake 0.4s ease-in-out;
}


/* Character Card Tag Links (Neon Glow) */
.char-card__tag-link {
  display: inline-flex;
  align-items: center;
  height: 20px;
  font-size: 0.68rem;
  line-height: 1;
  padding: 0 7px;
  border-radius: 100px;
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: all 0.2s ease;
  border: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, currentColor 25%, transparent);
  box-sizing: border-box;
}
.char-card__tag-link:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 10px color-mix(in srgb, currentColor 50%, transparent);
  transform: translateY(-1px);
}

.char-card__tag-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.char-card:hover .char-card__tag-more {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="light"] .char-card__tag-more {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.07);
  color: var(--text-muted);
}

[data-theme="light"] .char-card:hover .char-card__tag-more {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-secondary);
}

/* Character Profile Tags (Neon Glow) */
.char-profile__tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  padding: 4px 12px;
  border-radius: 100px;
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, currentColor 30%, transparent);
}
.char-profile__tag:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 16px color-mix(in srgb, currentColor 60%, transparent);
  transform: translateY(-1px);
}

/* Markdown Tables in Chat */
.chat-bubble table {
  width: auto !important;
  max-width: 100%;
  border-collapse: collapse;
  margin: var(--space-3) 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chat-bubble th,
.chat-bubble td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
  word-break: normal !important;
  overflow-wrap: normal !important;
  white-space: normal !important;
  hyphens: none !important;
}

.chat-bubble th {
  background-color: rgba(var(--accent-rgb), 0.1);
  font-weight: 600;
}

.chat-bubble tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .chat-bubble tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.05);
}

/* ============================================================
   28. CATALOG FILTERS & TAGS STREAM (PREMIUM HORIZONTAL SCROLL)
   ============================================================ */
.catalog-filters-row {
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  position: relative;
}

@media (max-width: 768px) {
  .catalog-filters-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
  }
}

.catalog-filters-row .gender-filter {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  padding: 4px;
  align-items: center;
  gap: 4px;
  height: fit-content;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.catalog-filters-row .filter-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .catalog-filters-row .filter-divider {
    display: none;
  }
}

.catalog-tags-nav {
  position: relative;
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
}

.catalog-tags-track {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px;
  width: 100%;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.catalog-tags-track:active,
.catalog-tags-track.is-dragging {
  cursor: grabbing !important;
}

.catalog-tags-track,
.catalog-tags-track * {
  -webkit-user-drag: none;
  user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.catalog-tags-track::-webkit-scrollbar {
  display: none;
}

.catalog-tags-track .chip {
  flex-shrink: 0;
  white-space: nowrap;
  cursor: grab;
}

.catalog-tags-track.is-dragging .chip {
  cursor: grabbing !important;
}

.tags-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 44px;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.25s ease;
}

.tags-fade--left {
  left: 0;
  background: linear-gradient(to right, var(--bg) 15%, transparent 100%);
}

.tags-fade--right {
  right: 0;
  background: linear-gradient(to left, var(--bg) 15%, transparent 100%);
}

.tags-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.tags-nav-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.35);
  transform: translateY(-50%) scale(1.08);
}

.tags-nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.tags-nav-btn--prev {
  left: 2px;
}

.tags-nav-btn--next {
  right: 2px;
}

@media (max-width: 640px) {
  .tags-nav-btn {
    display: none !important;
  }
  .tags-fade {
    width: 24px;
  }
}

/* ==========================================================================
   SEO Showcase & Features Block (Variant 2)
   ========================================================================== */
.seo-section,
.category-seo-section,
.tag-seo-section {
  margin-top: clamp(48px, 6vw, 72px) !important;
  margin-bottom: 24px !important;
  padding: clamp(28px, 4vw, 44px) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 24px !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.seo-section::before,
.category-seo-section::before,
.tag-seo-section::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.seo-block {
  position: relative;
  z-index: 1;
}

/* Main Heading */
.seo-block h2 {
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.35;
  margin: 0 0 14px 0;
}

/* Intro Paragraph */
.seo-block > p {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.68);
  margin: 0 0 28px 0;
  max-width: 860px;
}

/* Sub-heading for Features ("Особенности раздела:") */
.seo-block h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent, #a855f7);
  margin: 0 0 18px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.seo-block h3::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, #a855f7);
  box-shadow: 0 0 10px var(--accent, #a855f7);
}

/* Grid of Feature Cards (Transforms <ul><li> into cards!) */
.seo-block ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.seo-block ul li {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 22px 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.seo-block ul li:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(var(--accent-rgb), 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.seo-block ul li strong {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  display: block;
}

/* Concluding Paragraphs if any */
.seo-block p:last-child {
  margin-bottom: 0;
}

.seo-disclaimer {
  font-size: 12.5px !important;
  color: rgba(255, 255, 255, 0.45) !important;
  margin-top: 20px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
}

@media (max-width: 640px) {
  .seo-section,
  .category-seo-section,
  .tag-seo-section {
    padding: 20px !important;
    border-radius: 18px !important;
    margin-top: 36px !important;
  }
  .seo-block ul {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ============================================================
   37. UNIFIED CATALOG SEO TILE (Subtle & Collapsible)
   ============================================================ */
.catalog-seo-tile {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, rgba(255, 255, 255, 0.005) 100%);
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 18px;
  padding: 20px 24px 16px;
  margin-top: 32px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: all 0.3s ease;
}

[data-theme="light"] .catalog-seo-tile {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.012) 0%, rgba(0, 0, 0, 0.004) 100%);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.catalog-seo-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

[data-theme="light"] .catalog-seo-tile::before {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.08), transparent);
}

.catalog-seo-tile__content {
  position: relative;
}

/* Discreet Typography for Title and Lead */
.catalog-seo-tile__title {
  font-family: 'Satoshi', 'Inter', sans-serif !important;
  font-size: 15.5px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  color: rgba(255, 255, 255, 0.70) !important;
  margin: 0 0 6px 0 !important;
  line-height: 1.35 !important;
}

[data-theme="light"] .catalog-seo-tile__title {
  color: rgba(26, 23, 48, 0.85) !important;
}

.catalog-seo-tile__lead {
  font-size: 12.5px !important;
  line-height: 1.55 !important;
  color: rgba(255, 255, 255, 0.45) !important;
  margin: 0 !important;
}

[data-theme="light"] .catalog-seo-tile__lead {
  color: rgba(26, 23, 48, 0.6) !important;
}

/* Collapsible Secondary Body */
.catalog-seo-tile__body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, margin-top 0.3s ease, padding-top 0.3s ease;
  font-size: 12.5px !important;
  line-height: 1.6 !important;
  color: rgba(255, 255, 255, 0.45) !important;
}

.catalog-seo-tile.is-expanded .catalog-seo-tile__body {
  max-height: 3500px;
  opacity: 1;
  margin-top: 12px;
  padding-top: 12px;
  border-top-color: rgba(255, 255, 255, 0.045);
}

[data-theme="light"] .catalog-seo-tile.is-expanded .catalog-seo-tile__body {
  border-top-color: rgba(0, 0, 0, 0.05);
}

/* All body paragraphs, headings, lists (both direct and inside .seo-block) */
.catalog-seo-tile__body p,
.catalog-seo-tile .seo-block p {
  font-size: 12.5px !important;
  line-height: 1.6 !important;
  color: rgba(255, 255, 255, 0.45) !important;
  margin: 0 0 12px 0 !important;
}

[data-theme="light"] .catalog-seo-tile__body p,
[data-theme="light"] .catalog-seo-tile .seo-block p {
  color: rgba(26, 23, 48, 0.55) !important;
}

.catalog-seo-tile__body p:last-child,
.catalog-seo-tile .seo-block p:last-child {
  margin-bottom: 0 !important;
}

.catalog-seo-tile__body h2,
.catalog-seo-tile .seo-block h2 {
  font-family: 'Satoshi', 'Inter', sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: rgba(255, 255, 255, 0.68) !important;
  letter-spacing: -0.01em !important;
  margin: 14px 0 6px 0 !important;
  line-height: 1.4 !important;
}

[data-theme="light"] .catalog-seo-tile__body h2,
[data-theme="light"] .catalog-seo-tile .seo-block h2 {
  color: rgba(26, 23, 48, 0.8) !important;
}

.catalog-seo-tile__body h3,
.catalog-seo-tile .seo-block h3 {
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: rgba(255, 255, 255, 0.5) !important;
  margin: 12px 0 8px 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

[data-theme="light"] .catalog-seo-tile__body h3,
[data-theme="light"] .catalog-seo-tile .seo-block h3 {
  color: rgba(26, 23, 48, 0.6) !important;
}

.catalog-seo-tile__body h3::before,
.catalog-seo-tile .seo-block h3::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: none !important;
}

[data-theme="light"] .catalog-seo-tile__body h3::before,
[data-theme="light"] .catalog-seo-tile .seo-block h3::before {
  background: rgba(26, 23, 48, 0.35);
}

.catalog-seo-tile__body ul,
.catalog-seo-tile .seo-block ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 12px 0 !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
  gap: 10px !important;
}

.catalog-seo-tile__body ul li,
.catalog-seo-tile .seo-block ul li {
  background: rgba(255, 255, 255, 0.015) !important;
  border: 1px solid rgba(255, 255, 255, 0.04) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
  color: rgba(255, 255, 255, 0.45) !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

[data-theme="light"] .catalog-seo-tile__body ul li,
[data-theme="light"] .catalog-seo-tile .seo-block ul li {
  background: rgba(0, 0, 0, 0.015) !important;
  border-color: rgba(0, 0, 0, 0.05) !important;
  color: rgba(26, 23, 48, 0.55) !important;
}

.catalog-seo-tile__body ul li:hover,
.catalog-seo-tile .seo-block ul li:hover {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  transform: translateY(-1px) !important;
}

.catalog-seo-tile__body ul li strong,
.catalog-seo-tile .seo-block ul li strong {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: rgba(255, 255, 255, 0.72) !important;
}

[data-theme="light"] .catalog-seo-tile__body ul li strong,
[data-theme="light"] .catalog-seo-tile .seo-block ul li strong {
  color: rgba(26, 23, 48, 0.82) !important;
}

/* Subtle Toggle Footer */
.catalog-seo-tile__footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 10px;
  position: relative;
  z-index: 3;
}

.catalog-seo-tile.is-short .catalog-seo-tile__footer {
  display: none !important;
}

.catalog-seo-tile__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 100px;
  color: rgba(255, 255, 255, 0.52);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

[data-theme="light"] .catalog-seo-tile__toggle {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.07);
  color: rgba(26, 23, 48, 0.6);
}

.catalog-seo-tile__toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
}

[data-theme="light"] .catalog-seo-tile__toggle:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.14);
  color: #1A1730;
}

.catalog-seo-tile__toggle-icon {
  width: 13px;
  height: 13px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.7;
}

.catalog-seo-tile.is-expanded .catalog-seo-tile__toggle-icon {
  transform: rotate(180deg);
}

/* Reset any legacy wrapper styling inside */
.catalog-seo-tile .category-seo-section,
.catalog-seo-tile .tag-seo-section {
  position: static !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}

.catalog-seo-tile .seo-block {
  margin: 0;
  padding: 0;
}

@media (max-width: 768px) {
  .catalog-header {
    margin-bottom: 12px !important;
  }
  .catalog-header__title {
    font-size: 20px !important;
    line-height: 1.25 !important;
    margin-bottom: 0 !important;
  }
  .catalog-filters-row {
    margin-bottom: 14px !important;
  }
  .catalog-seo-tile {
    padding: 16px 18px 14px !important;
    border-radius: 16px !important;
    margin-top: 26px !important;
  }
  .catalog-seo-tile::before {
    left: 18px;
    right: 18px;
  }
  .catalog-seo-tile__title {
    font-size: 14.5px !important;
    margin-bottom: 5px !important;
  }
  .catalog-seo-tile__lead {
    font-size: 12px !important;
    line-height: 1.5 !important;
  }
  .catalog-seo-tile__body p,
  .catalog-seo-tile .seo-block p {
    font-size: 12px !important;
  }
  .catalog-seo-tile__body ul,
  .catalog-seo-tile .seo-block ul {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .catalog-seo-tile__body ul li,
  .catalog-seo-tile .seo-block ul li {
    padding: 10px 12px !important;
    border-radius: 10px !important;
  }
}

/* ============================================================
   38. CHARACTER PHOTO VIEWER MODAL & ZOOM BUTTON
   ============================================================ */
body.photo-modal-open {
  overflow: hidden !important;
  touch-action: none;
}

.photo-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-viewer-modal.is-active {
  opacity: 1;
  visibility: visible;
}

.photo-viewer-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 16, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  z-index: 1;
}

.photo-viewer-modal__close {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 100002;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.photo-viewer-modal__close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.45);
}

.photo-viewer-modal__close:active {
  transform: scale(0.92);
}

.photo-viewer-modal__container {
  position: relative;
  z-index: 100001;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  cursor: pointer;
}

.photo-viewer-modal__dialog {
  position: relative;
  max-width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
  transform: scale(0.93);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-viewer-modal.is-active .photo-viewer-modal__dialog {
  transform: scale(1);
}

.photo-viewer-modal__img {
  max-width: 92vw;
  max-height: calc(85dvh - 56px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-xl, 18px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.12);
  user-select: none;
  -webkit-user-drag: none;
}

.photo-viewer-modal__caption {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 20, 32, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 6px 18px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.photo-viewer-modal__name {
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Character Card Zoom Button */
.char-card__zoom-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 9;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(12, 14, 24, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  opacity: 0.88;
}

.char-card__zoom-btn:hover {
  opacity: 1;
  transform: scale(1.12);
  background: rgba(18, 22, 38, 0.92);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.char-card__zoom-btn:active {
  transform: scale(0.92);
}

@media (max-width: 768px) {
  .photo-viewer-modal__img {
    max-width: 94vw;
    max-height: calc(82dvh - 50px);
    border-radius: 14px;
  }
  .photo-viewer-modal__close {
    width: 40px;
    height: 40px;
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
  }
  .photo-viewer-modal__caption {
    margin-top: 10px;
    padding: 5px 14px;
  }
  .photo-viewer-modal__name {
    font-size: 14px;
  }
  .char-card__zoom-btn {
    width: 26px;
    height: 26px;
    bottom: 8px;
    right: 8px;
    opacity: 0.95;
  }
}

/* Favorite Button */
.fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  color: #ffffff;
}

.fav-btn:hover {
  transform: scale(1.12);
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.fav-btn:active {
  transform: scale(0.92);
}

.fav-btn svg {
  transition: all 0.2s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.fav-btn--title {
  position: static;
  width: 48px;
  height: 48px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  flex-shrink: 0;
}

.fav-btn--title:hover {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.3);
}

.char-profile__photo-fav {
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
}

/* Favorites Modal List Items */
.fav-modal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md, 12px);
  background: var(--surface-elevated, #1a1e2d);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  color: var(--text-primary, #fff);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.fav-modal-item:hover {
  border-color: rgba(202, 138, 4, 0.5);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.fav-modal-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg, #0f111a);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: bold;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fav-modal-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.fav-modal-name {
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: var(--text-primary, #fff);
}

.fav-modal-category {
  font-size: 12px;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  margin-top: 2px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.fav-modal-remove-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  margin-left: 6px;
}

.fav-modal-remove-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #ef4444;
  transform: scale(1.1);
}

.fav-modal-remove-btn:active {
  transform: scale(0.92);
}

/* ============================================================
   40. NOTIFICATIONS DROPDOWN (Extracted from partial)
   ============================================================ */
.notification-dropdown {
  display: none;
  position: absolute;
  top: 130%;
  right: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--surface-elevated, #1a1b1e);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.notif-item-hover:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.05)) !important;
}

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #9b51e0);
  align-self: center;
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--accent, rgba(155, 81, 224, 0.6));
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (max-width: 768px) {
  .notification-dropdown {
    position: fixed;
    top: 70px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
}

/* ============================================================
   41. CHARACTER PROFILE SEO ENHANCEMENTS & INNER SIMILAR CARDS
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.char-profile__h1-sub {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0;
  line-height: 1.4;
}

.char-profile__greeting {
  font-style: normal;
  color: var(--text-primary);
  line-height: 1.65;
}

.greeting-action {
  font-style: italic;
  color: var(--text-secondary);
}

.char-profile__seo p {
  margin: 0 0 var(--space-3) 0;
}

.char-profile__seo p:last-child {
  margin-bottom: 0;
}

.char-profile__seo-subtitle {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: var(--space-4) 0 var(--space-2) 0;
  line-height: 1.4;
}

.char-profile__seo-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-3) 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.char-profile__seo-list:last-child {
  margin-bottom: 0;
}

.char-profile__seo-list li {
  position: relative;
  padding-left: 18px;
  line-height: 1.6;
}

.char-profile__seo-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}

.char-profile__similar {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.char-profile__similar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.char-profile__similar-all {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.char-profile__similar-all:hover {
  color: var(--accent);
}

.char-profile__similar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.char-sim-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.char-sim-card:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.char-sim-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface);
}

.char-sim-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  transition: transform 0.35s ease;
}

.char-sim-card:hover .char-sim-card__img {
  transform: scale(1.05);
}

.char-sim-card__media .char-card__zoom-btn {
  position: absolute;
  z-index: 2;
  opacity: 0.9;
  width: 32px;
  height: 32px;
  bottom: 10px;
  right: 10px;
}

.char-sim-card__link {
  text-decoration: none;
  color: inherit;
}

.char-sim-card__link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.char-sim-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 700;
  color: var(--text-muted);
}

.char-sim-card__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.char-sim-card__title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.char-sim-card__name {
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-sim-card__age {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.char-sim-card__desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 1023px) {
  .char-profile__similar-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(195px, 220px);
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .char-sim-card {
    scroll-snap-align: start;
  }
}

/* =========================================================================
   Стартовые реплики («С чего начать диалог») и FAQ на карточке персонажа
   ========================================================================= */

.char-starter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.char-starter-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.char-starter-card__text {
  flex: 1;
  min-width: 0;
}

.char-starter-card .starter-action {
  font-style: italic;
  color: var(--text-secondary);
}

.char-starter-card__arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.3;
  transition: transform 0.18s ease, color 0.18s ease;
}

.char-starter-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--surface-hover, var(--surface-elevated));
  box-shadow: 0 8px 22px rgba(var(--accent-rgb, 139, 92, 246), 0.14);
}

.char-starter-card:hover:not(:disabled) .char-starter-card__arrow {
  color: var(--accent);
  transform: translateX(3px);
}

.char-starter-card:active:not(:disabled) {
  transform: translateY(0);
}

.char-starter-card:disabled {
  opacity: 0.6;
  cursor: wait;
}

.char-starter-card.is-loading {
  opacity: 0.92;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb, 139, 92, 246), 0.25);
}

.char-profile__faq {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.char-faq {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.char-faq__item {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.char-faq__item:hover {
  border-color: rgba(var(--accent-rgb, 139, 92, 246), 0.35);
}

.char-faq__item[open] {
  border-color: rgba(var(--accent-rgb, 139, 92, 246), 0.5);
}

.char-faq__q {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-primary);
  user-select: none;
}

.char-faq__q::-webkit-details-marker,
.char-faq__q::marker {
  display: none;
  content: '';
}

.char-faq__q-text {
  flex: 1;
  min-width: 0;
}

.char-faq__icon {
  position: relative;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb, 139, 92, 246), 0.12);
  transition: background-color 0.2s ease;
}

.char-faq__icon::before,
.char-faq__icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--accent);
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.char-faq__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.char-faq__item[open] .char-faq__icon {
  background: rgba(var(--accent-rgb, 139, 92, 246), 0.2);
}

.char-faq__item[open] .char-faq__icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 0;
}

.char-faq__a {
  padding: 0 var(--space-5) var(--space-4);
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.char-faq__a em {
  color: var(--text-primary);
  font-style: italic;
}

.faq-syntax-example {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(var(--accent-rgb, 139, 92, 246), 0.12);
  border: 1px solid rgba(var(--accent-rgb, 139, 92, 246), 0.25);
  color: var(--text-primary);
  font-family: inherit;
  font-style: italic;
  font-size: 0.95em;
}

@media (max-width: 720px) {
  .char-starter-grid {
    grid-template-columns: 1fr;
  }

  .char-faq__q {
    padding: var(--space-3) var(--space-4);
    font-size: 0.9rem;
  }

  .char-faq__a {
    padding: 0 var(--space-4) var(--space-3);
    font-size: 0.875rem;
  }
}




