/* Variables are now imported from variables.css */

html[data-i18n-ready='false'] body>* {
  visibility: hidden;
}

html[data-i18n-ready='false'] body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg-main);
  z-index: 9999;
}

html[data-i18n-ready='false'] body::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  margin-left: -16px;
  border: 3px solid var(--border-default);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spectrue-spin 0.8s linear infinite;
  z-index: 10000;
}

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

@media (prefers-reduced-motion: reduce) {
  html[data-i18n-ready='false'] body::after {
    animation: none;
  }
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
  background: var(--bg-main);
  color: var(--fg-main);
  font-size: 16px;
}

.container {
  display: flex;
  align-items: flex-start;
}

/* Сайдбар */
/* Сайдбар */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background-color: var(--bg-sidebar);
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--card-border);
  transition:
    width 0.3s ease,
    background-color 0.3s ease;
  position: relative;
  z-index: 10;
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar-header {
  padding: var(--sidebar-padding);
  /* Use variable */
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

/* Collapsed-only buttons */
.icon-button.collapsed-only {
  display: none;
}

.sidebar.collapsed .icon-button.collapsed-only {
  display: flex;
  margin: 10px auto;
}

#sidebar-deep-toggle.active {
  color: var(--color-success);
  background: rgba(45, 164, 78, 0.1);
}



.sidebar h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  flex-grow: 1;
  /* Changed from width: 100% */
  min-width: 0;
  /* Allow shrinking */
}

.sidebar.collapsed h2 {
  opacity: 0;
  width: 0;
  margin: 0;
}

.sidebar-content {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 var(--sidebar-padding);
  /* Use variable (horizontal) */
  /* Hide scrollbar for cleaner look */
  scrollbar-width: none;
}

.sidebar-content::-webkit-scrollbar {
  display: none;
}

.sidebar.collapsed .sidebar-content {
  padding: 0 4px;
}

.sidebar-section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  /* border-bottom: 1px solid var(--card-border); Removed for airier look */
}

.sidebar-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}



.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

.sidebar.collapsed .section-header label,
.sidebar.collapsed .section-header h3,
.sidebar.collapsed .section-header h4 {
  display: none;
}

.sidebar.collapsed .section-header {
  justify-content: center;
  margin-bottom: 8px;
  cursor: pointer;
}

.sidebar h3,
.sidebar h4 {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.sidebar.collapsed h3,
.sidebar.collapsed h4,
.sidebar.collapsed label,
.sidebar.collapsed .cost-info,
.sidebar.collapsed .plan-status-card,
.sidebar.collapsed .credits-balance-value,
.sidebar.collapsed .balance-card,
.sidebar.collapsed .select-wrapper,
.sidebar.collapsed .form-group,
.sidebar.collapsed #history-list-container,
.sidebar.collapsed .user-id-section {
  display: none !important;
}

/* Theme Toggle */
.theme-toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--fg-main);
  font-weight: 500;
}

.sidebar.collapsed .theme-toggle-container span {
  display: none;
}

.sidebar.collapsed .theme-toggle-container {
  justify-content: center;
}

/* Icon Button */
.icon-button {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  flex-shrink: 0;
  transition:
    background 0.2s,
    color 0.2s;
}

.icon-button:hover {
  background: var(--hover-bg);
  color: var(--fg-main);
}

.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: currentColor;
  color: inherit;
}

/* Sidebar Toggle Rotation */
#sidebar-toggle .icon {
  transition: transform 0.3s;
}

.sidebar.collapsed #sidebar-toggle .icon {
  transform: rotate(180deg);
}

/* Theme Icons */
[data-theme='dark'] .theme-sun {
  display: block;
}

[data-theme='dark'] .theme-moon {
  display: none;
}

:root:not([data-theme='dark']) .theme-sun {
  display: none;
}

:root:not([data-theme='dark']) .theme-moon {
  display: block;
}

/* Sidebar Button (Logout etc) */
.sidebar-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent !important;
  /* Ghost by default */
  border: none !important;
  /* No border */
  color: var(--fg-main) !important;
  padding: 10px;
  border-radius: 6px;
  margin-top: 10px;
  text-align: left;
  cursor: pointer;
  position: relative;
  z-index: 10;
}

.sidebar-button:hover {
  background: var(--bg-surface-subtle) !important;
  /* Hover state */
}

.sidebar.collapsed .sidebar-button span {
  display: none;
}

.sidebar.collapsed .sidebar-button {
  justify-content: center;
  padding: 10px;
  width: 100%;
  background: transparent !important;
  border: none !important;
}

.sidebar-button .icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.sidebar.collapsed .sidebar-button .icon {
  width: 24px;
  height: 24px;
}

/* Cost Info */
.cost-info {
  background: var(--bg-surface-subtle);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
}

[data-theme='dark'] .cost-info {
  background: var(--bg-surface-subtle);
}

.cost-info ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.cost-info li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

/* User Menu */
.user-menu-container {
  position: relative;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.user-menu-trigger {
  /* Styles inherited from .icon-button */
  position: relative;
}

/* Removed .user-badge, .user-balance, .user-avatar styles as they are replaced by Hamburger Menu */

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--bg-main);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  overflow: hidden;
  transition: opacity 0.2s, transform 0.2s;
  opacity: 1;
  transform: translateY(0);
  display: block;
}

.user-menu-dropdown.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  /* Use pointer-events instead of display:none for transition */
}

.menu-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-surface-subtle);
}

.user-info-link {
  text-decoration: none;
  color: inherit;
  display: block;
  border-radius: 6px;
  transition: background 0.2s;
  margin: -8px;
  /* Expand hit area to cover padding if desired, or just normal */
  padding: 8px;
}

.user-info-link:hover {
  background: rgba(0, 0, 0, 0.05);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-email {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
  font-weight: 700;
}

.badge-free {
  background: var(--color-gray-200);
  color: var(--color-gray-800);
}

/* High specificity for Dark Mode */
body.dark-theme .badge-free,
[data-theme='dark'] .badge-free {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #e6edf3 !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-pro {
  background: var(--color-primary);
  color: white;
}

.menu-actions,
.menu-settings,
.menu-footer {
  padding: 8px;
  border-bottom: 1px solid var(--border-default);
}

.menu-footer {
  border-bottom: none;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--fg-main);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  text-decoration: none;
}

.menu-item:hover {
  background: var(--bg-surface-subtle);
}

.menu-item.danger {
  color: var(--color-danger);
}

.menu-item.danger:hover {
  background: rgba(217, 48, 37, 0.05);
}

.menu-item .icon {
  width: 18px;
  height: 18px;
}

.menu-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
}

.lang-selector select {
  border: none;
  background: transparent;
  width: 100%;
  padding: 10px 28px 10px 0;
  min-height: 44px;
  font-size: 14px;
  cursor: pointer;
}

.menu-item.lang-selector {
  padding: 0;
}

.menu-item.lang-selector .icon {
  margin-left: 10px;
}


/* Toggle Switch */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.toggle-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 22px;
  background: var(--border-default);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  outline: none;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch:checked {
  background: var(--color-success);
}

.toggle-switch:checked::after {
  transform: translateX(18px);
}

.toggle-switch:focus-visible {
  box-shadow: 0 0 0 2px var(--bg-main), 0 0 0 4px var(--color-info);
}

.toggle-label {
  font-size: 14px;
  color: var(--fg-main);
  cursor: pointer;
  user-select: none;
}

/* Simplified Cost Info */
.cost-simplified {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-main);
  cursor: default;
  display: flex;
  gap: 4px;
}

.cost-details.hidden {
  display: none;
}

/* Cost Info Tooltip Behavior (CSS-only hover for now) */
.cost-info:hover .cost-details.hidden {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--muted);
}

/* User ID Section */
.user-id-section {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
}

.user-id-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.user-id-label {
  flex-shrink: 0;
}

.user-id-code {
  font-family: monospace;
  font-size: 10px;
  background: var(--bg-main);
  padding: 2px 6px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
  border: 1px solid var(--card-border);
}

.user-id-section .copy-btn {
  padding: 4px;
  min-width: 24px;
  min-height: 24px;
}

.user-id-section .copy-btn .icon {
  width: 14px;
  height: 14px;
}

/* Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--card-border);
}

.sidebar.collapsed .sidebar-footer {
  padding: 16px 8px;
}

.support-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.sidebar.collapsed .support-button span {
  display: none;
}

.sidebar.collapsed .support-button {
  padding: 10px 0;
}

/* Sidebar Footer Actions (Removed) */

/* Sidebar Card (Deep Analysis) */
.sidebar-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-card .card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--fg-main);
  cursor: pointer;
  /* Make clickable */
}

.sidebar-card .toggle-group {
  margin-bottom: 0;
  width: auto;
}

.sidebar-card .card-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  /* Default Grey */
  transition: color 0.2s;
}

.sidebar-card .card-icon.active {
  color: var(--color-success);
  /* Green when active */
}

/* Hide card contents when collapsed */
.sidebar.collapsed .sidebar-card {
  display: none;
}

/* Deep Toggle Button (Collapsed) */
#sidebar-deep-toggle {
  margin: 16px auto 16px auto;
  position: relative;
  z-index: 20;
}

/* Inputs in sidebar */
select {
  padding: 8px;
  border-radius: 6px;
  background: var(--bg-main);
  color: var(--fg-main);
  border: 1px solid var(--card-border);
}

.sidebar select {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  background: var(--bg-main);
  color: var(--fg-main);
  border: 1px solid var(--card-border);
}

.sidebar.collapsed select {
  padding: 8px 4px;
  text-overflow: ellipsis;
}

/* --- НОВЫЕ СТИЛИ: История --- */
#history-list-container {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--bg-main);
}

.history-item {
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--card-border);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.history-item:last-child {
  border-bottom: none;
}

.history-item:hover {
  background-color: var(--hover-bg);
}

.history-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.history-item.loading {
  color: var(--muted);
  cursor: default;
}

/* --- КОНЕЦ НОВЫХ СТИЛЕЙ --- */

/* Стили для карточки тарифа */
.plan-status-card {
  background: var(--bg-surface-subtle);
  border: none;
  border-radius: 8px;
  padding: 15px;
  margin-top: 15px;
  text-align: center;
}

.plan-status-card h4 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--muted);
}

.plan-status-card p {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 500;
}

.plan-status-card button.primary {
  background-color: #2da44e !important;
  border-color: #2da44e !important;
  color: white !important;
  width: 100%;
  padding: 8px;
  font-size: 14px;
}

.plan-status-card button.primary:hover {
  background-color: #2c974b !important;
}

.plan-status-card button.secondary {
  background-color: transparent !important;
  border: 1px solid var(--muted) !important;
  color: var(--muted) !important;
  width: 100%;
  padding: 8px;
  font-size: 14px;
}

.plan-status-card button.secondary:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

.sidebar-section>button {
  width: 100%;
  margin-bottom: 10px;
  background-color: #f6f8fa;
  border: 1px solid rgba(27, 31, 36, 0.15);
  color: var(--fg-main);
  transition: background-color 0.2s ease-in-out;
}

.sidebar-section>button:hover {
  background-color: var(--hover-bg);
}

/* Основной контент */
.main-content {
  flex-grow: 1;
  padding: var(--page-padding);
  /* Use variable */
  height: 100vh;
  overflow-y: auto;
  contain: layout style;
  min-width: 0;
}

.main-content>header,
.main-content>.hero-section,
.main-content>.card,
.main-content>footer {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* Standalone page content (no sidebar) - fixes scrollbar in middle */
.standalone-content {
  flex-grow: 1;
  padding: var(--page-padding);
  /* Use variable */
  width: 100%;
  height: auto;
  overflow: visible;
}

.main-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.logo-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
}

.logo {
  width: 200px;
  height: 100px;
  display: block;
}

/* Theme-aware logo switching */
.logo-dark {
  display: none;
}

[data-theme='dark'] .logo-light {
  display: none;
}

[data-theme='dark'] .logo-dark {
  display: block;
}

.main-header h1 {
  margin: 0;
  font-size: 28px;
}

.main-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.card {
  padding: 20px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  margin: 20px 0;
  box-shadow: var(--shadow);
}

.card.input-card {
  border: none;
  box-shadow: none;
  padding: 0;
}

/* Profile + Data Deletion Pages */
.profile-loading {
  text-align: center;
  color: var(--muted);
  font-weight: 500;
}

.profile-guest {
  text-align: center;
}

.profile-guest h2 {
  margin-top: 0;
}

.profile-page {
  position: relative;
  padding: 0 6px 24px;
}

.profile-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 240px;
  background:
    radial-gradient(1200px 320px at 10% -20%, rgba(88, 166, 255, 0.18), transparent 60%),
    radial-gradient(900px 300px at 90% -30%, rgba(255, 120, 120, 0.14), transparent 55%);
  pointer-events: none;
  z-index: -1;
}

[data-theme='dark'] .profile-page::before {
  background:
    radial-gradient(1200px 320px at 8% -20%, rgba(56, 139, 253, 0.18), transparent 60%),
    radial-gradient(900px 300px at 92% -30%, rgba(248, 81, 73, 0.18), transparent 55%);
}

.profile-page .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 65%), var(--bg-card);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
}

[data-theme='dark'] .profile-page .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.2)), var(--bg-card);
}

.profile-page .main-header {
  gap: 14px;
  margin-bottom: 24px;
}

.profile-page .main-header h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.profile-page .main-header p {
  font-size: 14px;
}

.profile-page h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

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

.profile-content .card {
  animation: profileFade 0.35s ease both;
}

.profile-content .card:nth-child(2) {
  animation-delay: 0.05s;
}

.profile-content .card:nth-child(3) {
  animation-delay: 0.1s;
}

.profile-content .card:nth-child(4) {
  animation-delay: 0.15s;
}

.profile-content .card:nth-child(5) {
  animation-delay: 0.2s;
}

.profile-content {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  grid-template-areas:
    'identity identity'
    'details data'
    'links delete';
  gap: 20px;
}

.profile-card {
  grid-area: identity;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-default);
  background: var(--bg-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-identity h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.profile-identity p {
  margin: 6px 0 0;
  color: var(--muted);
}

.profile-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.profile-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--fg-muted);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
}

.profile-actions {
  margin-left: auto;
}

.profile-actions .btn-secondary {
  background: var(--highlight);
  color: var(--fg-on-primary);
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.profile-actions .btn-secondary:hover {
  background: var(--btn-bg);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.profile-stat {
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-stat span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-details {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 24px;
}

.profile-detail dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-detail dd {
  margin: 4px 0 0;
  font-weight: 600;
  word-break: break-all;
}

.profile-details-card {
  grid-area: details;
  padding: 20px;
}

.profile-links-card {
  grid-area: links;
  padding: 20px;
}

.profile-data-card {
  grid-area: data;
  padding: 20px;
}

.profile-data-card p {
  margin: 0 0 14px;
}

.profile-links-card p {
  margin: 0 0 16px;
  color: var(--muted);
}

.profile-links-grid {
  display: grid;
  gap: 12px;
}

.profile-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.profile-link-row .btn-secondary {
  padding: 8px 14px;
  font-size: 13px;
  border-color: var(--border-default);
  color: var(--fg-main);
}

.profile-link-row .btn-secondary:disabled {
  background: var(--bg-surface-subtle);
  color: var(--muted);
  border-color: var(--border-subtle);
}

.profile-link-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-link-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-link-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--fg-main);
}

.profile-link-name {
  font-weight: 600;
}

.profile-link-status {
  font-size: 12px;
  color: var(--muted);
}

.profile-link-message {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.profile-link-message.error {
  color: var(--color-primary);
}

.profile-delete-card {
  grid-area: delete;
  border: 1px solid rgba(255, 75, 75, 0.25);
  background: rgba(255, 75, 75, 0.08);
}

[data-theme='dark'] .profile-delete-card {
  background: rgba(255, 75, 75, 0.16);
}

.profile-delete-confirm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.profile-delete-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--fg-main);
}

.profile-delete-checkbox input {
  margin-top: 3px;
}

.profile-delete-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.profile-delete-status {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* Merge Page */
.merge-page {
  position: relative;
  padding: 0 6px 24px;
}

.merge-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 240px;
  background:
    radial-gradient(1200px 320px at 10% -20%, rgba(88, 166, 255, 0.18), transparent 60%),
    radial-gradient(900px 300px at 90% -30%, rgba(255, 120, 120, 0.14), transparent 55%);
  pointer-events: none;
  z-index: -1;
}

[data-theme='dark'] .merge-page::before {
  background:
    radial-gradient(1200px 320px at 8% -20%, rgba(56, 139, 253, 0.18), transparent 60%),
    radial-gradient(900px 300px at 92% -30%, rgba(248, 81, 73, 0.18), transparent 55%);
}

.merge-page .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 65%), var(--bg-card);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
}

[data-theme='dark'] .merge-page .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.2)), var(--bg-card);
}

.merge-page .main-header h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.merge-page .main-header p {
  font-size: 14px;
}

.merge-loading {
  text-align: center;
  color: var(--muted);
  font-weight: 500;
}

.merge-empty p {
  color: var(--muted);
}

.merge-content {
  display: grid;
  gap: 20px;
}

.merge-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.merge-summary-item {
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.merge-summary-item span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.merge-summary-note {
  margin: 12px 0 0;
  color: var(--muted);
}

.merge-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.merge-account {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--border-default);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.merge-account.is-selected {
  border-color: var(--color-info);
  box-shadow: 0 0 0 1px rgba(9, 105, 218, 0.3), 0 10px 24px rgba(9, 105, 218, 0.12);
  transform: translateY(-2px);
}

[data-theme='dark'] .merge-account.is-selected {
  box-shadow: 0 0 0 1px rgba(56, 139, 253, 0.35), 0 12px 26px rgba(0, 0, 0, 0.3);
}

.merge-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--fg-main);
}

.merge-choice input {
  accent-color: var(--color-info);
}

.merge-account-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.merge-account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border-default);
}

.merge-account-header h3 {
  margin: 0;
  font-size: 16px;
}

.merge-account-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.merge-account-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.merge-account-meta span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.merge-account-meta strong {
  display: block;
  margin-top: 4px;
  word-break: break-all;
}

.merge-fields-note {
  margin: 0 0 12px;
  color: var(--muted);
}

.merge-fields-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 12px;
}

.merge-field-header {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.merge-fields-list {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 12px;
  grid-column: 1 / -1;
}

.merge-field-row {
  display: contents;
}

.merge-field-key {
  font-size: 13px;
  color: var(--fg-main);
  font-weight: 600;
}

.merge-field-value {
  font-size: 13px;
  color: var(--muted);
  word-break: break-word;
}

.merge-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.merge-status {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.merge-status.error {
  color: var(--color-primary);
}

@media (max-width: 980px) {
  .profile-content {
    grid-template-columns: 1fr;
    grid-template-areas:
      'identity'
      'details'
      'links'
      'data'
      'delete';
  }

  .profile-actions {
    width: 100%;
  }

  .profile-actions .btn-secondary {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .merge-choice-grid {
    grid-template-columns: 1fr;
  }

  .merge-fields-grid,
  .merge-fields-list {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .merge-field-header:nth-child(3),
  .merge-field-secondary {
    display: none;
  }

  .merge-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

.profile-delete-status.error {
  color: var(--color-primary);
}

.deletion-card h2 {
  margin-top: 24px;
}

.deletion-steps {
  padding-left: 20px;
  margin: 10px 0 0;
}

.deletion-steps li {
  margin: 10px 0;
}

.deletion-note {
  margin-top: 20px;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-subtle);
}

@media (max-width: 720px) {
  .profile-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-actions {
    width: 100%;
  }

  .profile-actions .btn-secondary {
    width: 100%;
  }
}

textarea,
input[type='text'],
input[type='email'],
input[type='password'] {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  margin-top: 4px;
  font-size: 16px;
  background: var(--bg-main);
  color: var(--fg-main);
  font-family: inherit;
}

textarea {
  line-height: 1.4;
  scrollbar-gutter: stable;
}

textarea::placeholder,
input::placeholder {
  color: var(--fg-muted);
  opacity: 0.8;
}

:where(textarea, input[type='text'], input[type='email'], input[type='password'], select, button, .icon-button):focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

button {
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 500;
  background: var(--bg-main);
  color: var(--fg-main);
  border-color: var(--card-border);
}

button:hover:not(:disabled) {
  background: var(--hover-bg);
}

#start-check {
  margin-top: 15px;
  padding: 12px 20px;
  font-size: 16px;
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  border: none;
}

/* Стили для результатов */
.results-card {
  background-color: var(--bg-sidebar);
}

.sentence-container {
  margin-bottom: 8px;
  overflow: visible;
}

.sentence-wrapper {
  background-color: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  background-clip: padding-box;
}

[data-theme='dark'] .sentence-wrapper {
  background-color: #f7f7f8;
}

.sentence {
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 0;
  display: block;
  white-space: normal;
  word-break: break-word;
  overflow: visible;
}

.popup {
  background: var(--bg-main);
  border: 1px solid var(--card-border);
  margin-top: 8px;
  padding: 15px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.popup .rationale {
  white-space: pre-line;
}

/* Credits spent info - shown at bottom of results */
.credits-spent-info {
  margin-top: 16px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

.share-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
  text-align: right;
  display: flex;
  /* Используем flexbox */
  justify-content: flex-end;
  /* Выравниваем по правому краю */
  gap: 10px;
  /* Добавляем отступ между кнопками */
}

.share-actions .button.secondary {
  background-color: transparent !important;
  border: 1px solid var(--muted) !important;
  color: var(--muted) !important;
}

.share-actions .button.secondary:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

/* M41: Powered by Spectrue badge */
.spectrue-badge {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.7;
}

.spectrue-badge a {
  color: var(--muted);
  text-decoration: none;
  transition: opacity 0.2s;
}

.spectrue-badge a:hover {
  opacity: 1;
  text-decoration: underline;
}

#status-bar {
  position: fixed;
  bottom: calc(8px + env(safe-area-inset-bottom));
  right: calc(8px + env(safe-area-inset-right));
  font-size: 12px;
  background: var(--bg-sidebar);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  z-index: 100;
  max-width: min(360px, calc(100vw - 16px));
  word-break: break-word;
}

.score-bar-container {
  margin-bottom: 8px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 15px;
}

.score-bar-container span {
  flex-shrink: 0;
  width: 200px;
}

.score-bar {
  flex-grow: 1;
  background-color: #e0e0e0;
  border-radius: 5px;
  height: 12px;
  overflow: hidden;
}

.score-bar div {
  height: 100%;
  border-radius: 5px;
}

.score-bar.score-bar-na {
  background-color: #f5f5f5;
}

.score-bar.score-bar-na div {
  width: 0;
}

.popup .highlighted-score {
  background-color: rgba(0, 128, 0, 0.08);
  border: 1px solid rgba(0, 128, 0, 0.2);
  border-radius: 8px;
  padding: 10px;
  margin: 5px -10px;
}

.popup .highlighted-score span {
  font-weight: 500;
}

/* M29: Trusted Source Badge Styles */
.popup ul {
  padding-left: 20px;
  margin: 8px 0;
}

.popup ul li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.popup ul li.trusted-source {
  font-weight: 500;
}

.popup ul li.trusted-source a {
  color: var(--color-success, #2da44e);
}

/* Source Badge - Category-specific styling */
.source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  font-size: 14px;
  cursor: help;
  border-radius: 4px;
  padding: 2px 4px;
  transition: transform 0.2s, filter 0.2s;
}

.source-badge:hover {
  transform: scale(1.15);
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.2));
}

/* Category-specific badge backgrounds */
.source-badge.category-science_and_health {
  background: rgba(138, 43, 226, 0.1);
}

.source-badge.category-ukraine_imi_whitelist {
  background: rgba(0, 91, 187, 0.1);
}

.source-badge.category-fact_checking_ifcn {
  background: rgba(45, 164, 78, 0.15);
}

.source-badge.category-technology {
  background: rgba(59, 130, 246, 0.1);
}

.source-badge.category-russia_independent_exiled {
  background: rgba(156, 163, 175, 0.15);
}

.source-badge.category-global_news_agencies {
  background: rgba(245, 158, 11, 0.1);
}

.source-badge.category-general_news_western {
  background: rgba(16, 185, 129, 0.1);
}

.source-badge.category-europe_tier1 {
  background: rgba(0, 51, 153, 0.1);
}

.source-badge.category-asia_pacific {
  background: rgba(236, 72, 153, 0.1);
}

.source-origin {
  color: var(--muted);
  font-size: 12px;
}

.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  flex-direction: column;
  gap: 15px;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: var(--highlight);
  animation: spin 1s ease infinite;
}

.spinner-small {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  box-sizing: border-box;
  opacity: 0.8;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

button:disabled {
  background-color: var(--bg-hover);
  color: var(--fg-muted);
  border-color: var(--card-border);
  cursor: not-allowed;
  opacity: 0.7;
}

textarea:disabled {
  background-color: var(--bg-hover);
  cursor: not-allowed;
}

.form-group {
  width: 100%;
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--muted);
}

.form-group input {
  padding: 10px;
  font-size: 16px;
}

.auth-toggle {
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
}

.auth-toggle a {
  color: var(--highlight);
  text-decoration: none;
  font-weight: 500;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

.error-text {
  color: #d93025;
  font-size: 14px;
  margin-top: 15px;
  text-align: center;
  min-height: 1.2em;
}

.fallback-notice {
  background-color: #fffbdd;
  border: 1px solid #ffdc73;
  border-radius: 8px;
  padding: 12px 15px;
  margin: 10px 0 15px 0;
  font-size: 14px;
  color: #5c3c00;
}

.search-quality-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: rgba(255, 220, 115, 0.25);
  border: 1px solid rgba(255, 220, 115, 0.8);
  border-radius: 8px;
  padding: 12px 15px;
  margin: 10px 0 15px 0;
  font-size: 14px;
  color: var(--fg-main);
}

.search-quality-text {
  line-height: 1.4;
}

[data-theme='dark'] .search-quality-notice {
  background-color: rgba(255, 220, 115, 0.12);
  border-color: rgba(255, 220, 115, 0.35);
}

/* M8.2: Parsed text metadata display */
.parsed-text-info {
  background-color: rgba(0, 115, 255, 0.05);
  border: 1px solid rgba(0, 115, 255, 0.2);
  border-radius: 8px;
  padding: 10px 15px;
  margin: 10px 0 15px 0;
  font-size: 13px;
  color: var(--fg-main);
  line-height: 1.6;
}

[data-theme='dark'] .parsed-text-info {
  background-color: rgba(56, 139, 253, 0.1);
  border-color: rgba(56, 139, 253, 0.3);
}

/* T1.2: Anchor Claim Notice */
.anchor-claim-notice {
  background-color: rgba(45, 164, 78, 0.08);
  border: 1px solid rgba(45, 164, 78, 0.3);
  border-left: 4px solid #2da44e;
  border-radius: 8px;
  padding: 12px 15px;
  margin: 10px 0 15px 0;
  font-size: 14px;
  color: var(--fg-main);
}

.anchor-claim-notice .anchor-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #2da44e;
  margin-bottom: 4px;
}

.anchor-claim-notice .anchor-text {
  display: block;
  line-height: 1.5;
  font-weight: 500;
}

[data-theme='dark'] .anchor-claim-notice {
  background-color: rgba(45, 164, 78, 0.12);
  border-color: rgba(45, 164, 78, 0.4);
}

.claims-list {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 12px;
  margin: 8px 0 16px 0;
}

.claims-list-header {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.claims-accordion .claims-list-header {
  margin-bottom: 0;
}

.claims-list-title {
  flex: 1;
}

.claims-accordion {
  padding: 0;
}

.claims-accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 12px;
  margin: 0;
}

.claims-accordion summary::-webkit-details-marker {
  display: none;
}

.claims-accordion summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.claims-accordion[open] summary::after {
  transform: rotate(45deg);
}

.claims-list-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  padding: 2px 8px;
}

.claims-accordion .claims-list-body {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0 12px 12px;
}

.claim-card {
  background: var(--bg-surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.claim-card-top {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.claim-card-id {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.claim-card-verdict {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(56, 139, 253, 0.12);
  color: #1f6feb;
}

.claim-card-score {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-main);
}

.claim-card-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-main);
}

[data-theme='dark'] .claims-list {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .claims-list-count {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .claims-accordion .claims-list-body {
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .claim-card {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .claim-card-verdict {
  background: rgba(56, 139, 253, 0.18);
  color: #58a6ff;
}

.progress-card {
  padding: 20px;
}

#progress-label {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--muted);
  position: relative;
  min-height: 1.5em;
  overflow: visible;
}

#progress-label.trigger-flash .status-content {
  animation: status-glow-bloom 0.6s ease-out;
}

/* Pure text halo glow - no horizontal line */
@keyframes status-glow-bloom {
  0% {
    text-shadow:
      0 0 2px rgba(255, 255, 255, 0.3),
      0 0 4px rgba(255, 255, 255, 0.2);
    filter: brightness(1);
  }

  30% {
    text-shadow:
      0 0 4px rgba(255, 255, 255, 0.9),
      0 0 8px rgba(255, 255, 255, 0.6),
      0 0 12px rgba(255, 255, 255, 0.3);
    filter: brightness(1.3);
  }

  100% {
    text-shadow:
      0 0 2px rgba(255, 255, 255, 0.3),
      0 0 4px rgba(255, 255, 255, 0.2);
    filter: brightness(1);
  }
}

@keyframes telescopic-flash-ethereal {
  0% {
    transform: translateY(-50%) scaleX(0);
    opacity: 0;
  }

  20% {
    transform: translateY(-50%) scaleX(1.5);
    opacity: 1;
  }

  100% {
    transform: translateY(-50%) scaleX(1.3);
    opacity: 0;
  }
}

.status-content {
  display: inline-block;
  white-space: nowrap;
  position: relative;
}

.status-text-clone {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  display: inline-block;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}

.status-fall-away {
  /* Explosive start, but longer overall duration to let user read */
  animation: fall-down-fade 4s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes fall-down-fade {
  0% {
    transform: translateY(0);
    opacity: 1;
  }

  /* Rapid descent to "resting" zone */
  10% {
    transform: translateY(51px);
    opacity: 1;
  }

  /* Drift slowly while being readable */
  75% {
    transform: translateY(77px);
    opacity: 1;
  }

  /* Final drop and fade out */
  100% {
    transform: translateY(192px);
    opacity: 0;
  }
}

.status-fall-away.overlap-push-down {
  /* Triggered when a new status arrives on top. Force rapid exit from the dwell zone. */
  animation: fall-down-fast-exit 0.6s ease-in forwards;
}

@keyframes fall-down-fast-exit {
  0% {
    transform: translateY(51px);
    /* Resume from start of dwell zone */
    opacity: 1;
  }

  100% {
    transform: translateY(192px);
    opacity: 0;
  }
}

.status-new-text {
  display: inline-block;
  animation: tv-telescopic 0.4s ease-out forwards;
  transform-origin: center;
}

@keyframes tv-telescopic {
  0% {
    transform: scaleX(0) scaleY(0.05);
    filter: brightness(2) blur(1px);
    opacity: 0;
  }

  35% {
    transform: scaleX(1.1) scaleY(0.1);
    filter: brightness(1.8) blur(0.5px);
    opacity: 1;
  }

  65% {
    transform: scaleX(0.98) scaleY(1.1);
    filter: brightness(1.3);
  }

  100% {
    transform: scaleX(1) scaleY(1);
    filter: brightness(1);
    opacity: 1;
  }
}

@keyframes simple-fade-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

#progress-bar-inner {
  width: 0%;
  height: 100%;
  background-color: var(--highlight);
  border-radius: 4px;
  transition: width 0.3s ease-in-out;
  background-size: 40px 40px;
  background-image: linear-gradient(45deg,
      rgba(255, 255, 255, 0.15) 25%,
      transparent 25%,
      transparent 50%,
      rgba(255, 255, 255, 0.15) 50%,
      rgba(255, 255, 255, 0.15) 75%,
      transparent 75%,
      transparent);
  animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
  from {
    background-position: 40px 0;
  }

  to {
    background-position: 0 0;
  }
}

.toast-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -150%);
  background-color: #24292f;
  color: #ffffff;
  padding: 14px 22px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  font-size: 15px;
  transition:
    transform 0.4s ease-in-out,
    opacity 0.4s ease-in-out;
  opacity: 0;
}

.toast-notification.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast-notification a {
  color: #58a6ff;
  text-decoration: underline;
  font-weight: 500;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-top: 40px;
}

@media (min-width: 768px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pricing-card {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.pricing-card.recommended {
  border-color: var(--highlight);
  border-width: 2px;
  position: relative;
  background: linear-gradient(to bottom, rgba(46, 164, 78, 0.05), transparent);
}

.pricing-card.recommended::before {
  content: 'Рекомендовано';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--highlight);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

.pricing-card h2 {
  font-size: 24px;
  margin-bottom: 8px;
  font-weight: 700;
}

.pricing-price {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--fg-main);
  letter-spacing: -1px;
}

.pricing-price span {
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: normal;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  text-align: left;
  flex-grow: 1;
}

.pricing-features li {
  margin-bottom: 14px;
  padding-left: 28px;
  position: relative;
  line-height: 1.4;
  color: var(--fg-muted);
}

.pricing-features li::before {
  content: '✓';
  color: #2da44e;
  position: absolute;
  left: 0;
  font-weight: 800;
}

/* Mission / Community Pool Feature Style */
.pricing-features li.community-feature {
  color: var(--color-primary);
  font-weight: 600;
  padding-left: 28px;
}

.pricing-features li.community-feature::before {
  content: '❤️';
  font-size: 14px;
  top: 1px;
}

.pricing-features li.community-feature span.note {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 2px;
}

.pricing-card button {
  width: 100%;
  padding: 12px;
  font-size: 16px;
}

.pricing-card button.secondary {
  background-color: transparent;
  color: var(--btn-bg);
  border-color: var(--btn-bg);
}

.pricing-card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background-color: var(--highlight);
  color: white;
  border-color: var(--highlight);
}

.pricing-card button.secondary:hover {
  background-color: rgba(45, 164, 78, 0.1);
  color: var(--color-success);
  border-color: var(--color-success);
}

/* Light mode overrides for secondary button hover to ensure visibility */
:root:not([data-theme='dark']) .pricing-card button.secondary:hover {
  background-color: rgba(45, 164, 78, 0.1);
  color: #1a7f37;
  border-color: #1a7f37;
}

[data-theme='dark'] .pricing-card button.secondary:hover {
  background-color: rgba(45, 164, 78, 0.2);
  color: #3fb950;
  border-color: #3fb950;
}

.main-footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
  font-size: 14px;
}

.main-footer a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 10px;
}

.main-footer a:hover {
  text-decoration: underline;
  color: var(--highlight);
}

.main-footer span {
  color: var(--muted);
}

.main-footer a.current-page-link {
  color: var(--fg-main);
  font-weight: 500;
  cursor: default;
  text-decoration: none;
}

/* Blink Animation for Sidebar Sections */
@keyframes double-blink {
  0% {
    box-shadow: 0 0 0 0 transparent;
  }

  16% {
    box-shadow: 0 0 0 2px var(--highlight);
  }

  33% {
    box-shadow: 0 0 0 0 transparent;
  }

  50% {
    box-shadow: 0 0 0 2px var(--highlight);
  }

  66% {
    box-shadow: 0 0 0 0 transparent;
  }

  83% {
    box-shadow: 0 0 0 2px var(--highlight);
  }

  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.blink-highlight {
  animation: double-blink 1.5s ease-in-out;
  border-radius: 12px;
}

.main-footer a.current-page-link:hover {
  color: var(--fg-main);
}

.donation-section {
  margin-top: 40px;
  text-align: center;
}

.donation-section h2 {
  font-size: 24px;
}

.donation-section p {
  max-width: 500px;
  margin: 10px auto 20px;
  color: var(--muted);
}

.donation-type-hint {
  font-size: 13px;
  color: #22c55e;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.donation-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.donation-buttons button {
  min-width: 100px;
  font-size: 16px;
  background-color: transparent;
  border: 1px solid var(--card-border);
  color: var(--fg-main);
}

.donation-buttons button:hover:not(:disabled) {
  background-color: var(--hover-bg);
  border-color: var(--muted);
}

.support-section {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
}

.support-button {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  background-color: transparent;
  border: 1px solid #2da44e;
  color: #2da44e;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
}

.support-button:hover {
  background-color: #2da44e;
  color: white;
  text-decoration: none;
}

/* Header Standalone Language Selector */
.header-lang-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  height: 32px;
}

.header-lang-selector:hover {
  border-color: var(--highlight);
  box-shadow: 0 0 10px rgba(var(--highlight-rgb), 0.2);
}

.header-lang-selector .icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.header-lang-select {
  background: transparent;
  border: none;
  color: var(--text-default);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
}

.header-lang-select option {
  background: var(--bg-main);
  color: var(--text-default);
}

/* Fixed Language Selector */
.lang-select-fixed {
  position: fixed;
  top: 20px;
  right: 70px;
  /* Left of theme toggle */
  z-index: 1000;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: var(--bg-main);
  color: var(--fg-main);
  cursor: pointer;
}

.lang-select-fixed:focus {
  outline: 2px solid var(--highlight);
  border-color: transparent;
}

/* Analysis Metadata Section */
.analysis-metadata {
  margin: 20px 0;
  padding: 16px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

.analysis-metadata h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metadata-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-border);
}

.metadata-row:last-child {
  border-bottom: none;
}

.metadata-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.metadata-value {
  font-size: 14px;
  color: var(--fg-main);
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: var(--bg-main);
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
}

/* Header Badges & Controls */
.header-controls {
  margin-left: auto;
  /* Push to right */
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 100;
  min-height: 44px;
  align-self: center;
  margin-top: 0;
}

.header-controls.force-vertical {
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-top: 0;
}

.header-controls.force-vertical .header-lang-container {
  order: 0;
}

.header-controls.force-vertical #user-menu-container {
  order: 1;
}

.header-controls.force-vertical #header-credits-badge {
  order: 2;
}

.header-controls.force-vertical #header-plan-badge {
  order: 3;
}

/* Header Toggle (Compact) */
.header-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-right: 10px;
}

.header-toggle input {
  display: none;
}

.header-toggle .slider {
  width: 34px;
  height: 18px;
  background-color: var(--border-default);
  border-radius: 12px;
  position: relative;
  transition: 0.3s;
}

.header-toggle .slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.header-toggle input:checked+.slider {
  background-color: var(--color-success);
}

.header-toggle input:checked+.slider::after {
  transform: translateX(16px);
}

.header-toggle .label-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
}

.header-toggle input:checked~.label-text {
  color: var(--color-success);
}

.header-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}

.header-badge:hover {
  opacity: 0.8;
}

.header-badge.hidden {
  display: none;
}

#header-plan-badge {
  background-color: var(--color-gray-200);
  color: var(--color-gray-800);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#header-plan-badge.badge-pro {
  background-color: var(--color-primary);
  color: white;
}

#header-credits-badge {
  background-color: rgba(45, 164, 78, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(45, 164, 78, 0.2);
}

/* Sidebar Balance Hint */
.balance-hint {
  font-size: 13px;
  color: var(--color-success);
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Insufficient Credits Modal */
#insufficient-credits-modal {
  display: flex;
}

.credits-modal {
  padding: 30px;
  text-align: center;
}

.credits-modal h2 {
  margin: 0 0 16px 0;
  font-size: 24px;
  color: var(--fg-main);
}

.modal-message {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 12px;
}

.modal-plan-info {
  font-size: 15px;
  color: var(--fg-main);
  background-color: rgba(0, 115, 255, 0.05);
  border: 1px solid rgba(0, 115, 255, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 20px 0;
}

[data-theme='dark'] .modal-plan-info {
  background-color: rgba(56, 139, 253, 0.1);
  border-color: rgba(56, 139, 253, 0.3);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.btn-primary {
  background-color: var(--highlight);
  color: white;
  border: none;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--btn-bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background-color: transparent;
  color: var(--highlight);
  border: 1px solid var(--highlight);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: rgba(0, 115, 255, 0.05);
}

.btn-primary,
.btn-secondary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-danger {
  background-color: var(--color-primary);
  color: var(--fg-on-primary);
  border: none;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--color-primary-hover);
}

.btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  background-color: transparent;
  color: var(--muted);
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ghost:hover {
  color: var(--fg-main);
}

/* === Info Button & Tooltip Styles === */
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--muted);
  color: var(--bg-main);
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  cursor: help;
  border: none;
  padding: 0;
  margin-left: 6px;
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
  position: relative;
  flex-shrink: 0;
}

.info-btn:hover {
  opacity: 1;
  background: var(--highlight);
}

.info-btn::before {
  content: 'i';
}

/* Global JS Tooltip */
.spectrue-tooltip {
  position: fixed;
  background: var(--bg-main);
  color: var(--fg-main);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: normal;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 250px;
  box-shadow: var(--shadow-md);
  z-index: 9999;
  /* Always on top */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.spectrue-tooltip.visible {
  opacity: 1;
}

/* Label with info button */
.label-with-info {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Score bar with info button */
.score-bar-container {
  position: relative;
}

.score-bar-container .info-btn {
  width: 14px;
  height: 14px;
  font-size: 10px;
}

.score-bar-container .tooltip {
  bottom: auto;
  top: calc(100% + 8px);
}

.score-bar-container .tooltip::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--bg-main);
}



/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Small screens: sidebar as overlay drawer (prevents content squeeze) */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100dvh;
    box-shadow: var(--shadow-md);
    z-index: 1001;
  }

  .main-content {
    position: relative;
  }

  .sidebar.collapsed~.main-content {
    padding-left: calc(var(--page-padding) + 70px);
  }

  html:not([data-sidebar-collapsed='true']) .main-content::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1000;
  }
}

/* Narrow screens: vertical header controls */
@media (max-width: 480px) {
  .main-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-controls {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    margin-top: 0;
  }

  /* Keep the menu button on top when controls stack vertically (mobile + extension sidepanel). */
  #user-menu-container {
    order: 0;
  }

  #header-credits-badge {
    order: 1;
  }

  #header-plan-badge {
    order: 2;
  }

  .header-badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* Shrink logo on very narrow screens */
  .logo {
    width: 150px;
    height: 75px;
  }
}

/* Extra narrow (extension panel in collapsed state, small phones) */
@media (max-width: 360px) {
  .logo {
    width: 120px;
    height: 60px;
  }

  .header-controls {
    gap: 6px;
  }

  .header-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .user-menu-trigger {
    padding: 6px;
  }
}

/* Very narrow (minimal width) */
@media (max-width: 280px) {
  .logo {
    width: 100px;
    height: 50px;
  }

  .main-header {
    gap: 8px;
  }
}

/* ===========================================
   Philosophy-Aligned Hero & Notices
   =========================================== */

/* Hero Section Enhancements */
.hero-section {
  text-align: center;
  padding: 2rem 0;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--fg-muted);
  margin: 0.5rem 0 0 0;
  font-weight: 400;
  line-height: 1.4;
}

.hero-anti-framing {
  font-size: 0.95rem;
  color: var(--fg-muted);
  font-style: italic;
  margin: 0.75rem 0 0 0;
  opacity: 0.85;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-cta .btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.hero-cta .btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border: none;
}

.hero-cta .btn-primary:hover {
  background: var(--color-primary-hover);
}

.hero-cta .btn-secondary {
  background: transparent;
  color: var(--fg-main);
  border: 1px solid var(--border-default);
}

.hero-cta .btn-secondary:hover {
  background: var(--bg-hover);
}

/* Expectation Notice (before results) */
.expectation-notice {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.expectation-notice .icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

/* Responsive hero adjustments */
@media (max-width: 600px) {
  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-anti-framing {
    font-size: 0.85rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .hero-cta .btn {
    width: 100%;
    max-width: 280px;
  }
}

/* Documentation Link Button in Input Area */
.doc-link-btn {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.doc-link-btn:hover {
  background: var(--bg-hover);
  color: var(--fg-main);
  border-color: var(--border-hover);
}

@media (max-width: 600px) {
  .input-actions {
    flex-direction: column;
    gap: 15px;
    align-items: stretch !important;
  }

  .doc-link-btn {
    text-align: center;
  }
}

/* Credits Info Icon - Interactive State */
.credits-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 10px;
  opacity: 0.6;
  cursor: pointer;
  position: relative;
  top: -1px;
  transition: all 0.2s ease;
}

.credits-info-icon:hover {
  opacity: 1;
  background-color: var(--fg-main);
  color: var(--bg-main);
  border-color: var(--fg-main);
  transform: scale(1.1);
}

/* Pricing Divider */
.pricing-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 60px 0 40px;
  position: relative;
  text-align: center;
}

.pricing-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--card-border) 20%, var(--card-border) 80%, transparent);
  z-index: 0;
}

.pricing-divider span,
.pricing-divider h2 {
  background: var(--bg-main);
  padding: 0 24px;
  position: relative;
  z-index: 1;
  font-size: 20px;
  font-weight: 700;
  color: var(--fg-main);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Subtle Gradients for Cards - Premium Light Mode */
.plan-card-bg {
  background: linear-gradient(180deg, rgba(56, 139, 253, 0.08) 0%, #ffffff 100%);
  border: 1px solid rgba(56, 139, 253, 0.2);
  box-shadow: 0 4px 20px rgba(56, 139, 253, 0.08);
}

[data-theme='dark'] .plan-card-bg {
  background: linear-gradient(180deg, rgba(56, 139, 253, 0.15) 0%, rgba(56, 139, 253, 0.02) 100%);
  border-top: 1px solid rgba(56, 139, 253, 0.4);
  border-bottom: 1px solid transparent;
  box-shadow: none;
}

.pack-card-bg {
  background: linear-gradient(180deg, rgba(163, 113, 247, 0.08) 0%, #ffffff 100%);
  border: 1px solid rgba(163, 113, 247, 0.2);
  box-shadow: 0 4px 20px rgba(163, 113, 247, 0.08);
}

[data-theme='dark'] .pack-card-bg {
  background: linear-gradient(180deg, rgba(163, 113, 247, 0.15) 0%, rgba(163, 113, 247, 0.02) 100%);
  border-top: 1px solid rgba(163, 113, 247, 0.4);
  border-bottom: 1px solid transparent;
  box-shadow: none;
}

/* Donation Section Improvements */
.donation-section {
  background: radial-gradient(circle at top right, rgba(45, 164, 78, 0.08), transparent 40%),
    radial-gradient(circle at bottom left, rgba(45, 164, 78, 0.08), transparent 40%),
    var(--bg-card);
  border: 1px solid rgba(45, 164, 78, 0.2);
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  margin-top: 60px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: visible;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
}

.donation-section:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 15px 30px rgba(45, 164, 78, 0.15);
  border-color: rgba(45, 164, 78, 0.5);
}

@keyframes heartbeat {
  0% {
    transform: scale(1);
  }

  14% {
    transform: scale(1.1);
  }

  28% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.1);
  }

  70% {
    transform: scale(1);
  }
}

@keyframes halo-glow {

  0%,
  28%,
  70%,
  100% {
    filter:
      drop-shadow(0 0 15px rgba(255, 75, 75, 0.4)) drop-shadow(0 0 30px rgba(255, 75, 75, 0.2));
  }

  14%,
  42% {
    filter:
      drop-shadow(0 0 40px rgba(255, 75, 75, 0.8)) drop-shadow(0 0 70px rgba(255, 75, 75, 0.4));
  }
}

.donation-heart-wrapper {
  display: inline-block;
  margin-top: -100px;
  margin-bottom: 10px;
  z-index: 10;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.donation-heart {
  width: 140px;
  height: auto;
  display: block;
  overflow: visible;
  animation: heartbeat 2s infinite;
}

.heart-main-path {
  animation: halo-glow 2s ease-in-out infinite;
}

.donation-section h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #2da44e, #4ac26b);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  /* changed to block to sit under heart */
}

.donation-section p {
  color: var(--fg-muted);
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.donation-buttons {
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.donation-buttons button {
  border-radius: 50px !important;
  /* Pill shape */
  padding: 12px 24px !important;
  font-weight: 600 !important;
  background: var(--bg-main) !important;
  border: 1px solid var(--border-default) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  /* Bouncy transition */
}

.donation-buttons button:hover {
  transform: translateY(-4px) scale(1.05);
  border-color: #2da44e !important;
  color: #2da44e !important;
  box-shadow: 0 6px 12px rgba(45, 164, 78, 0.15);
}

/* Gradient Hero Title */
.hero-gradient-text {
  /* Default to Light Mode (Dark Text) */
  background: linear-gradient(135deg, #1f2937 0%, #4f46e5 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
  display: inline-block;
}

[data-theme='dark'] .hero-gradient-text {
  /* Dark Mode (Light Text) */
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pricing-price {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-block;
}

.pricing-card:hover .pricing-price {
  transform: scale(1.1);
  text-shadow: 0 0 20px rgba(56, 139, 253, 0.4);
}

/* Info Icon Button */
.info-icon-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: help;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  min-height: auto;
}

.info-icon-btn:hover {
  color: var(--fg-main);
  background: transparent;
}
