/* HypeCut Semantic Token System - Full Light/Dark Parity */

:root {
  /* Light Mode - Default */
  --color-bg-page: #fafafa;
  --color-bg-surface: #ffffff;
  --color-bg-elevated: #ffffff;
  --color-bg-overlay: rgba(77, 73, 73, 0.6);
  
  --color-text-primary: #0a0a0a;
  --color-text-secondary: #525252;
  --color-text-muted: #737373;
  --color-text-disabled: #a3a3a3;
  
  --color-border-default: #e5e5e5;
  --color-border-subtle: #545454;
  --color-border-strong: #d4d4d4;
  
  --color-action-primary-bg: linear-gradient(135deg, #9146ff 0%, #772ce8 100%);
  --color-action-primary-hover: linear-gradient(135deg, #772ce8 0%, #5c16c5 100%);
  --color-action-secondary-bg: transparent;
  --color-action-secondary-border: #e5e5e5;
  --color-action-secondary-hover: #f5f5f5;
  
  --color-status-success: #00f593;
  --color-status-warning: #ffb800;
  --color-status-error: #eb0400;
  --color-status-info: #00a8fc;
  
  --color-hover: rgba(0, 0, 0, 0.04);
  
  /* Legacy */
  --bg-primary: var(--color-bg-page);
  --bg-secondary: var(--color-bg-surface);
  --bg-tertiary: var(--color-bg-elevated);
  --border-subtle: var(--color-border-subtle);
  --border-medium: var(--color-border-default);
  --text-primary: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-tertiary: var(--color-text-muted);
  --accent: #9146ff;
  --accent-hover: #772ce8;
  --success: #00f593;
  --warning: #ffb800;
  --danger: #eb0400;
  --info: #00a8fc;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --font-display: 32px;
  --font-h1: 24px;
  --font-h2: 18px;
  --font-body: 14px;
  --font-small: 13px;
  --font-tiny: 12px;
  --font-micro: 11px;
  --weight-normal: 400;
  --weight-medium: 500;
  --radius-md: 6px;
  --radius-lg: 8px;
  --transition-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  /* Dark Mode - First Class */
  --color-bg-page: #18181b;
  --color-bg-surface: #27272a;
  --color-bg-elevated: #3f3f46;
  --color-bg-overlay: rgba(93, 86, 86, 0.8);
  
  --color-text-primary: #fafafa;
  --color-text-secondary: #d4d4d8;
  --color-text-muted: #a1a1aa;
  --color-text-disabled: #71717a;
  
  --color-border-default: #3f3f46;
  --color-border-subtle: #27272a;
  --color-border-strong: #52525b;
  
  --color-action-primary-bg: linear-gradient(135deg, #9146ff 0%, #772ce8 100%);
  --color-action-primary-hover: linear-gradient(135deg, #772ce8 0%, #5c16c5 100%);
  --color-action-secondary-bg: transparent;
  --color-action-secondary-border: #262626;
  --color-action-secondary-hover: #1a1a1a;
  
  --color-status-success: #00f593;
  --color-status-warning: #ffb800;
  --color-status-error: #eb0400;
  --color-status-info: #00a8fc;
  
  --color-hover: rgba(255, 255, 255, 0.06);
  
  /* Legacy */
  --bg-primary: var(--color-bg-page);
  --bg-secondary: var(--color-bg-surface);
  --bg-tertiary: var(--color-bg-elevated);
  --border-subtle: var(--color-border-subtle);
  --border-medium: var(--color-border-default);
  --text-primary: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-tertiary: var(--color-text-muted);
}

html,
body,
#root {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  background: #fafafa;
  background: var(--color-bg-page);
  color: #0a0a0a;
  color: var(--color-text-primary);
  overflow-x: hidden;
}

body {
  font-size: 14px;
  font-size: var(--font-body);
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Roboto",
    sans-serif;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #9146ff 0%, #772ce8 100%);
  background: var(--color-action-primary-bg);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-size: var(--font-body);
  font-weight: 500;
  font-weight: var(--weight-medium);
  border: none;
  cursor: pointer;
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all var(--transition-fast);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #772ce8 0%, #5c16c5 100%);
  background: var(--color-action-primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  background: var(--color-action-secondary-bg);
  border: 1px solid #e5e5e5;
  border: 1px solid var(--color-action-secondary-border);
  color: #0a0a0a;
  color: var(--color-text-primary);
  padding: 10px 20px;
  border-radius: 6px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-size: var(--font-body);
  font-weight: 500;
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all var(--transition-fast);
}

.btn-secondary:hover:not(:disabled) {
  background: #f5f5f5;
  background: var(--color-action-secondary-hover);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-dot.processing { background: #00a8fc; background: var(--color-status-info); }
.status-dot.approved { background: #00f593; background: var(--color-status-success); }
.status-dot.pending { background: #ffb800; background: var(--color-status-warning); }
.status-dot.failed { background: #eb0400; background: var(--color-status-error); }

/* Remove global element styling - now scoped to .app-shell */

/* Base Typography - WCAG AA Compliant - Scoped */
.app-shell h1,
.app-shell h2,
.app-shell h3,
.app-shell h4,
.app-shell h5,
.app-shell h6 {
  color: var(--text-primary);
  font-weight: 600;
}

.app-shell p,
.app-shell span,
.app-shell div {
  color: var(--text-primary);
}

.text-muted,
.text-gray,
.text-secondary {
  color: var(--text-muted) !important;
}

.text-disabled {
  color: var(--color-text-disabled) !important;
}

/* Card Components */
.card,
[class*="-card"] {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

/* Remove duplicate button and input styles - now in architecture.css */

/* Sidebar */
.sidebar {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-right: 1px solid var(--border-medium);
}

.sidebar a,
.sidebar button {
  color: var(--text-muted);
}

.sidebar a:hover,
.sidebar button:hover {
  color: var(--text-primary);
}

.sidebar a.active {
  color: var(--accent);
}

/* Logout Button - High Contrast */
.logout-button {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.logout-button:hover {
  background: #fee2e2;
  border-color: #f87171;
}

body.dark .logout-button,
[data-theme="dark"] .logout-button {
  background: #7f1d1d;
  border-color: #991b1b;
  color: #fca5a5;
}

body.dark .logout-button:hover,
[data-theme="dark"] .logout-button:hover {
  background: #991b1b;
  border-color: #dc2626;
}

/* Primary Action Buttons */
.action-button.primary,
.btn-primary,
[class*="upgrade"] {
  background: var(--accent);
  color: #ffffff;
  border: none;
}

.action-button.primary:hover,
.btn-primary:hover {
  background: var(--accent-hover);
}

/* Community Funding - Force Readable Text */
.community-funding-redesign,
.community-funding-redesign * {
  color: var(--text-primary);
}

.community-funding-redesign .card-title,
.community-funding-redesign .section-title,
.community-funding-redesign .tier-name {
  color: var(--text-primary) !important;
}

.community-funding-redesign .card-description,
.community-funding-redesign .feature {
  color: var(--text-secondary) !important;
}

.community-funding-redesign .tier-threshold,
.community-funding-redesign .progress-subtitle {
  color: var(--text-muted) !important;
}

/* Pricing Cards - Force Readable Text */
.pricing-card .plan-name,
.pricing-card .price-amount,
.pricing-card .price-free {
  color: var(--text-primary) !important;
}

.pricing-card .feature-item {
  color: var(--text-secondary) !important;
}

.pricing-card .price-period {
  color: var(--text-muted) !important;
}

/* Current Plan Card - Special Handling */
.pricing-card.current-plan {
  background: #d1fae5;
  border-color: #10b981;
}

.pricing-card.current-plan .plan-name,
.pricing-card.current-plan .price-amount,
.pricing-card.current-plan .price-free,
.pricing-card.current-plan .feature-item {
  color: #065f46 !important;
}

body.dark .pricing-card.current-plan,
[data-theme="dark"] .pricing-card.current-plan {
  background: #064e3b;
  border-color: #10b981;
}

body.dark .pricing-card.current-plan .plan-name,
body.dark .pricing-card.current-plan .price-amount,
body.dark .pricing-card.current-plan .price-free,
body.dark .pricing-card.current-plan .feature-item,
[data-theme="dark"] .pricing-card.current-plan .plan-name,
[data-theme="dark"] .pricing-card.current-plan .price-amount,
[data-theme="dark"] .pricing-card.current-plan .price-free,
[data-theme="dark"] .pricing-card.current-plan .feature-item {
  color: #f9fafb !important;
}

/* Analytics & Settings - Force Readable Text */
.analytics-dashboard *,
.settings-redesign * {
  color: var(--text-primary);
}

.analytics-dashboard .metric-label,
.analytics-dashboard .platform-meta,
.settings-redesign .setting-description {
  color: var(--text-muted) !important;
}

/* Settings Platform Connections - Fix Text Visibility */
.settings-redesign .platform-name,
.settings-redesign .platform-card .platform-name {
  color: var(--text-primary) !important;
}

.settings-redesign .status-badge,
.settings-redesign .connected-badge {
  color: inherit !important;
}

.settings-redesign .toggle-label {
  color: var(--text-primary) !important;
}

/* Table Elements */
table,
.table-row,
.table-header {
  color: var(--text-primary);
}

.table-header {
  color: var(--text-muted);
}

/* Status Badges - Maintain Contrast */
.status-badge,
[class*="badge"] {
  font-weight: 600;
}

/* Remove duplicate input styles - now in architecture.css */

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

/* Ensure All Icons Are Visible */
svg,
.icon {
  color: currentColor;
}

/* Override Any Opacity Issues */
.community-funding-redesign .bits-counter,
.analytics-dashboard .metric-value,
.pricing-card .price-amount {
  opacity: 1 !important;
  color: var(--text-primary) !important;
}

.dashboard {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: transparent;
  flex-direction: column;
}

.reconnect-banner {
  width: 100%;
  background: linear-gradient(90deg, #ff7a18, #ff9f43);
  padding: 12px 0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.reconnect-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reconnect-message {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
}

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

.reconnect-button {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reconnect-button:hover {
  background: rgba(255, 255, 255, 0.25);
}

.reconnect-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.7;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.reconnect-close:hover {
  opacity: 1;
}

.dashboard-content {
  display: flex;
  flex: 1 1;
}

.main-content {
  flex: 1 1;
  padding: var(--space-8) var(--space-6);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  background: transparent;
}

@media (min-width: 768px) {
  .main-content {
    margin-left: 250px;
  }
}

.overview {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.overview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}

.overview-header h1 {
  font-size: var(--font-h1);
  font-weight: var(--weight-medium);
  margin: 0 0 var(--space-2) 0;
  letter-spacing: -0.01em;
}

.overview-subtitle {
  font-size: var(--font-small);
  color: var(--text-secondary);
  margin: 0;
}

.performance-snapshot {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.snapshot-header {
  font-size: var(--font-micro);
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

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

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

.snapshot-metric.highlight .metric-value {
  color: var(--warning);
}

.metric-value {
  font-size: 32px;
  font-weight: var(--weight-medium);
  letter-spacing: -0.02em;
  line-height: 1;
}

.metric-label {
  font-size: var(--font-small);
  color: var(--text-secondary);
}

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

.recent-activity h3 {
  font-size: var(--font-micro);
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  font-size: var(--font-small);
  color: var(--text-secondary);
}

.activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.activity-dot.pending { background: var(--warning); }
.activity-dot.success { background: var(--success); }
.activity-dot.info { background: var(--info); }

.primary-action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 24px;
  background: linear-gradient(135deg, #9146ff 0%, #772ce8 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-body);
  font-weight: var(--weight-medium);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.primary-action:hover {
  background: linear-gradient(135deg, #772ce8 0%, #5c16c5 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(145, 70, 255, 0.3);
}

.quick-links {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: var(--space-3);
  gap: var(--space-3);
}

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

.quick-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.quick-link:hover {
  border-color: var(--border-medium);
  background: var(--bg-tertiary);
}

.quick-link-content h3 {
  font-size: var(--font-body);
  font-weight: var(--weight-medium);
  margin: 0 0 var(--space-1) 0;
}

.quick-link-content p {
  font-size: var(--font-small);
  color: var(--text-secondary);
  margin: 0;
}

.quick-link-arrow {
  font-size: 20px;
  color: var(--text-tertiary);
}

.payment-failed-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  font-size: 14px;
  color: #fca5a5;
  line-height: 1.5;
}

.payment-failed-banner .banner-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.payment-failed-banner .banner-content {
  flex: 1 1;
}

.payment-failed-banner .banner-link {
  display: inline-block;
  margin-left: 8px;
  color: #f87171;
  font-weight: 600;
  text-decoration: none;
}

.payment-failed-banner .banner-link:hover {
  text-decoration: underline;
}

.clip-quota-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.clip-quota-banner.near-cap {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.clip-quota-banner.at-cap {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.clip-quota-banner .quota-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.clip-quota-banner .quota-content {
  flex: 1 1;
}

.clip-quota-banner .quota-link {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.clip-quota-banner .quota-link:hover {
  text-decoration: underline;
}

.clip-quota-banner .quota-dismiss {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.clip-quota-banner .quota-dismiss:hover {
  opacity: 1;
}

/* Sidebar - Single Canonical Definition */
.sidebar {
  width: 100%;
  background: var(--bg-secondary);
  border-right: none;
  border-bottom: 1px solid var(--border-medium);
  padding: 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  color: var(--text-primary);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  height: 70px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-sidebar);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: var(--transition-layout);
}

@media (min-width: 768px) {
  .sidebar {
    width: 250px;
    border-right: 1px solid var(--border-medium);
    border-bottom: none;
    padding: 32px 24px 24px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    height: 100vh;
    box-shadow: none;
  }
}

.sidebar-header {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (min-width: 768px) {
  .sidebar-header {
    margin-bottom: 24px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 16px;
}

@media (min-width: 768px) {
  .header-controls {
    justify-content: flex-end;
    margin-top: 8px;
    padding-right: 0;
  }
}

.logo {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 0;
  gap: 8px;
}

@media (min-width: 768px) {
  .logo {
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 0;
  }
}

.logo-image {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo h2 {
  font-size: 18px;
  margin: 0;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .logo h2 {
    font-size: 24px;
  }
}

.username {
  color: var(--muted-text);
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}

@media (min-width: 768px) {
  .username {
    display: block;
    font-size: 14px;
  }
}

.nav-sections {
  flex: 1 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

@media (min-width: 768px) {
  .nav-sections {
    display: flex;
  }
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  color: var(--muted-text);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  border-left: 4px solid transparent;
  margin-left: -4px;
  position: relative;
  min-height: var(--touch-target-mobile);
  font-size: 16px;
  transition: var(--transition-fast), var(--transition-transform);
}

.nav-menu a:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-menu a.active {
  color: var(--accent);
  font-weight: 700;
  border-left-color: var(--accent);
}

@media (min-width: 768px) {
  .nav-menu a {
    padding: 10px 12px;
    min-height: var(--touch-target-min);
    font-size: 14px;
  }
}

.nav-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.nav-label {
  white-space: nowrap;
}

.sidebar-footer {
  flex-shrink: 0;
  padding-top: 0;
  border-top: none;
  display: none;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

@media (min-width: 768px) {
  .sidebar-footer {
    display: flex;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-direction: column;
  }
}

.plan-badge {
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .plan-badge {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
  }
}

.plan-badge.hobby,
.plan-badge.free {
  background: #f3f4f6;
  color: #374151;
}
.plan-badge.creator,
.plan-badge.starter {
  background: #d1fae5;
  color: #065f46;
}
.plan-badge.brand,
.plan-badge.pro {
  background: #dbeafe;
  color: #1e3a8a;
}

[data-theme="dark"] .plan-badge.hobby,
[data-theme="dark"] .plan-badge.free {
  background: #374151;
  color: #d1d5db;
}
[data-theme="dark"] .plan-badge.creator,
[data-theme="dark"] .plan-badge.starter {
  background: #064e3b;
  color: #6ee7b7;
}
[data-theme="dark"] .plan-badge.brand,
[data-theme="dark"] .plan-badge.pro {
  background: #1e3a8a;
  color: #93c5fd;
}

.logout-button {
  width: auto;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  color: #991b1b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  min-height: 36px;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.logout-button:hover {
  background: #fee2e2;
  border-color: #f87171;
}

@media (min-width: 768px) {
  .logout-button {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    min-height: var(--touch-target-min);
  }
}

[data-theme="dark"] .logout-button {
  background: #7f1d1d;
  border-color: #991b1b;
  color: #fca5a5;
}

[data-theme="dark"] .logout-button:hover {
  background: #991b1b;
  border-color: #dc2626;
}

/* Mobile Navigation - Centralized Z-Index Management */
.mobile-nav-toggle {
  display: block;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
  transition: var(--transition-fast);
}

.mobile-nav-toggle:hover {
  background: var(--bg);
}

.mobile-nav-overlay {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-mobile-overlay);
  transition: var(--transition-opacity);
}

.mobile-nav-menu {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-medium);
  z-index: var(--z-mobile-nav);
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (min-width: 768px) {
  .mobile-nav-toggle,
  .mobile-nav-overlay,
  .mobile-nav-menu {
    display: none;
  }
}

/* Floating help button (FAB) */
.help-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  z-index: var(--z-help-fab);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-transform), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.help-fab:active {
  transform: scale(0.95);
}

/* Help widget */
.help-widget {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 48px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  z-index: var(--z-help-widget);
  overflow: hidden;
  animation: slideUpFade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.help-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.help-widget-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.help-widget-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  cursor: pointer;
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast), transform 0.2s;
}

.help-widget-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.help-widget-body {
  padding: 20px;
}

.tutorial-video-container {
  margin-bottom: 20px;
}

.video-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: var(--transition-transform);
}

.video-placeholder::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: var(--transition-opacity);
}

.video-placeholder:hover::before {
  opacity: 1;
}

.video-placeholder:hover {
  transform: scale(1.02);
}

.play-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.help-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
}

.step-number {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

[data-theme="dark"] .help-widget {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.mobile-nav-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  color: var(--muted-text);
  background: none;
  border: none;
  border-radius: 8px;
  transition: all 0.15s ease-in-out;
  font-weight: 500;
  border-left: 4px solid transparent;
  margin-left: -4px;
  min-height: 52px;
  font-size: 16px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.mobile-nav-separator {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

.mobile-logout-button {
  width: 100%;
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  color: #991b1b;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
}
/* Clips Page — Design Tokens */

:root {
  --clips-surface-primary:       #f5f5f7;
  --clips-surface-secondary:     #ebebed;
  --clips-surface-card:          #ffffff;
  --clips-surface-card-hover:    #fafafa;

  --clips-text-primary:          #0f0f10;
  --clips-text-secondary:        #4b4b57;
  --clips-text-tertiary:         #8a8a99;

  --clips-border-subtle:         #f0f0f2;
  --clips-border-default:        #e2e2e6;
  --clips-border-strong:         #b8b8c4;

  --clips-danger-text:           #c0392b;
  --clips-danger-hover-text:     #96281b;

  --clips-status-pending-bg:     #fef9ec;
  --clips-status-pending-text:   #7a4f00;
  --clips-status-pending-border: #f0c040;

  --clips-status-processing-bg:     #eef3ff;
  --clips-status-processing-text:   #1a3a8f;
  --clips-status-processing-border: #6b8cff;

  --clips-status-ready-bg:     #edfaf4;
  --clips-status-ready-text:   #0a5c38;
  --clips-status-ready-border: #34c77b;

  --clips-status-failed-bg:     #fff0f0;
  --clips-status-failed-text:   #8b1a1a;
  --clips-status-failed-border: #f87171;

  --clips-status-scheduled-bg:     #fffbeb;
  --clips-status-scheduled-text:   #7a5500;
  --clips-status-scheduled-border: #f0b429;

  --clips-status-published-bg:     #f0f4ff;
  --clips-status-published-text:   #1e3a8a;
  --clips-status-published-border: #6366f1;

  --clips-btn-primary-bg:        #1a1a1f;
  --clips-btn-primary-text:      #ffffff;
  --clips-btn-primary-hover-bg:  #2d2d34;

  --clips-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --clips-shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --clips-shadow-lg: 0 16px 40px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
}

[data-theme="dark"] {
  --clips-surface-primary:       #111113;
  --clips-surface-secondary:     #1c1c1f;
  --clips-surface-card:          #1c1c1f;
  --clips-surface-card-hover:    #242428;

  --clips-text-primary:          #f2f2f4;
  --clips-text-secondary:        #a0a0b0;
  --clips-text-tertiary:         #606070;

  --clips-border-subtle:         #2a2a2f;
  --clips-border-default:        #38383f;
  --clips-border-strong:         #4e4e5a;

  --clips-btn-primary-bg:        #363640;
  --clips-btn-primary-text:      #f2f2f4;
  --clips-btn-primary-hover-bg:  #44444f;

  --clips-danger-text:           #f87171;
  --clips-danger-hover-text:     #fca5a5;

  --clips-status-pending-bg:     rgba(240,176,0,0.1);
  --clips-status-pending-text:   #f0c040;
  --clips-status-pending-border: rgba(240,176,0,0.25);

  --clips-status-processing-bg:     rgba(107,140,255,0.1);
  --clips-status-processing-text:   #8ba4ff;
  --clips-status-processing-border: rgba(107,140,255,0.25);

  --clips-status-ready-bg:     rgba(52,199,123,0.1);
  --clips-status-ready-text:   #4ade80;
  --clips-status-ready-border: rgba(52,199,123,0.25);

  --clips-status-failed-bg:     rgba(248,113,113,0.1);
  --clips-status-failed-text:   #f87171;
  --clips-status-failed-border: rgba(248,113,113,0.25);

  --clips-status-scheduled-bg:     rgba(240,180,41,0.1);
  --clips-status-scheduled-text:   #f0b429;
  --clips-status-scheduled-border: rgba(240,180,41,0.25);

  --clips-status-published-bg:     rgba(99,102,241,0.1);
  --clips-status-published-text:   #818cf8;
  --clips-status-published-border: rgba(99,102,241,0.25);

  --clips-shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --clips-shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --clips-shadow-lg: 0 16px 40px rgba(0,0,0,0.55);
}

/* ClipManager — Professional SaaS Design */

/* ─── Layout ─────────────────────────────────────────────── */
.clip-manager {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  color: var(--clips-text-primary);
}
@media (min-width: 768px) { .clip-manager { padding: 0 40px; } }

.clip-manager-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--clips-border-default);
}
@media (min-width: 768px) {
  .clip-manager-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
.clip-manager-header h1 {
  font-size: 26px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--clips-text-primary);
}
.subtitle {
  font-size: 13px;
  color: var(--clips-text-tertiary);
  margin-top: 3px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ─── Header Controls ────────────────────────────────────── */
.refresh-button {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--clips-border-default);
  background: var(--clips-surface-card);
  color: var(--clips-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.refresh-button:hover:not(:disabled) {
  border-color: var(--clips-border-strong);
  background: var(--clips-surface-secondary);
}
.refresh-button:disabled { opacity: 0.4; cursor: not-allowed; }

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 12px;
  background: var(--clips-surface-card);
  border: 1px solid var(--clips-border-default);
  border-radius: 6px;
  height: 34px;
}
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--clips-text-secondary);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  white-space: nowrap;
}
.filter-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--clips-text-primary);
}
.filter-select {
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--clips-border-default);
  background: var(--clips-surface-card);
  color: var(--clips-text-primary);
  font-size: 13px;
  cursor: pointer;
}
.filter-select:focus {
  outline: 2px solid var(--clips-border-strong);
  outline-offset: 2px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.spinner { animation: spin 0.7s linear infinite; }

/* ─── Date Groups ────────────────────────────────────────── */
.date-group { margin-bottom: 44px; }
.date-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--clips-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

/* ─── Grid ───────────────────────────────────────────────── */
.clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  grid-gap: 16px;
  gap: 16px;
}
@media (min-width: 1400px) {
  .clips-grid { grid-template-columns: repeat(auto-fill, minmax(296px, 1fr)); gap: 20px; }
}

/* ─── Card ───────────────────────────────────────────────── */
.clip-card {
  background: var(--clips-surface-card);
  border: 1px solid var(--clips-border-default);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  box-shadow: var(--clips-shadow-sm);
}
.clip-card:hover {
  border-color: var(--clips-border-strong);
  box-shadow: var(--clips-shadow-md);
  transform: translateY(-1px);
}
.clip-card.expiring { opacity: 0.55; }

/* ─── Thumbnail ──────────────────────────────────────────── */
.clip-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--clips-surface-secondary);
  overflow: hidden;
}
.thumbnail-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumbnail-placeholder {
  position: absolute;
  inset: 0;
  background: var(--clips-surface-secondary);
}
.thumbnail-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s;
}
.clip-thumbnail:hover .thumbnail-play-overlay { opacity: 1; }
.play-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.96);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  transition: transform 0.15s;
}
.clip-thumbnail:hover .play-icon { transform: scale(1.08); }
.clip-thumbnail-clickable { cursor: pointer; }
.clip-thumbnail-default   { cursor: default; }
.clip-thumbnail-expired   { cursor: default; }

.thumbnail-expired {
  position: absolute;
  inset: 0;
  background: var(--clips-surface-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0.6;
}
.expired-icon { font-size: 28px; }
.expired-label {
  font-size: 12px;
  color: var(--clips-text-secondary);
  font-weight: 500;
}

.captions-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255,255,255,0.15);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* ─── Card Body ──────────────────────────────────────────── */
.clip-info {
  padding: 14px 16px 12px;
  flex: 1 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.clip-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--clips-text-primary);
  margin: 0 0 6px;
  line-height: 1.4;
  word-break: break-word;
}
.clip-title .untitled {
  color: var(--clips-text-tertiary);
  font-weight: 400;
  font-style: italic;
}
.clip-game {
  font-size: 12px;
  color: var(--clips-text-tertiary);
  margin-bottom: 6px;
}
.clip-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--clips-text-tertiary);
  margin-bottom: 10px;
}

/* ─── Status Badge ───────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid;
  width: -webkit-fit-content;
  width: fit-content;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge.pending, .status-badge.awaiting {
  background: var(--clips-status-pending-bg);
  color: var(--clips-status-pending-text);
  border-color: var(--clips-status-pending-border);
}
.status-dot.pending, .status-dot.awaiting { background: var(--clips-status-pending-text); }

.status-badge.processing {
  background: var(--clips-status-processing-bg);
  color: var(--clips-status-processing-text);
  border-color: var(--clips-status-processing-border);
}
.status-dot.processing { background: var(--clips-status-processing-text); }

.status-badge.approved {
  background: var(--clips-status-ready-bg);
  color: var(--clips-status-ready-text);
  border-color: var(--clips-status-ready-border);
}
.status-dot.approved { background: var(--clips-status-ready-text); }

.status-badge.rejected, .status-badge.failed {
  background: var(--clips-status-failed-bg);
  color: var(--clips-status-failed-text);
  border-color: var(--clips-status-failed-border);
}
.status-dot.rejected, .status-dot.failed { background: var(--clips-status-failed-text); }

.status-badge.scheduled {
  background: var(--clips-status-scheduled-bg);
  color: var(--clips-status-scheduled-text);
  border-color: var(--clips-status-scheduled-border);
}
.status-dot.scheduled { background: var(--clips-status-scheduled-text); }

.status-badge.published {
  background: var(--clips-status-published-bg);
  color: var(--clips-status-published-text);
  border-color: var(--clips-status-published-border);
}
.status-dot.published { background: var(--clips-status-published-text); }

.scheduled-time {
  font-size: 11px;
  color: var(--clips-status-scheduled-text);
  margin-top: 5px;
  font-weight: 500;
}

/* ─── Platform Tags ──────────────────────────────────────── */
.platform-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.platform-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.platform-tag.youtube  { background: #ff0000; color: #fff; }
.platform-tag.tiktok   { background: #111; color: #fff; }
[data-theme="dark"] .platform-tag.tiktok { background: #f0f0f0; color: #111; }
.platform-tag.instagram {
  background: linear-gradient(45deg,#f09433,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888);
  color: #fff;
}
.platform-tag.platform-error { opacity: 0.65; outline: 1px solid #f0b429; }

/* ─── Card Actions ───────────────────────────────────────── */
/*
  Hierarchy:
  1. .action-btn.primary  — filled, one per card state (the main CTA)
  2. .action-btn.ghost    — outlined/transparent, secondary actions
  3. .action-btn.danger   — text-only red, destructive (Delete)
*/
.clip-actions {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--clips-border-subtle);
  background: var(--clips-surface-card);
  flex-wrap: wrap;
}

.actions-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.actions-platforms {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1;
}

.actions-platforms .platform-btn {
  flex: 1 1;
  text-align: center;
  justify-content: center;
}

.actions-utility {
  margin-left: auto;
  gap: 2px;
  flex: 1 1;
}

.action-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s, color 0.13s, opacity 0.13s;
  white-space: nowrap;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.action-btn:focus-visible {
  outline: 2px solid var(--clips-border-strong);
  outline-offset: 2px;
}

/* Primary — one per card, filled */
.action-btn.primary {
  background: var(--clips-btn-primary-bg);
  color: var(--clips-btn-primary-text);
  border-color: var(--clips-btn-primary-bg);
  flex: 1 1;
  min-width: 100px;
}
.action-btn.primary:hover:not(:disabled) {
  background: var(--clips-btn-primary-hover-bg);
  border-color: var(--clips-btn-primary-hover-bg);
}

/* Ghost — secondary actions */
.action-btn.ghost {
  background: transparent;
  color: var(--clips-text-secondary);
  border-color: var(--clips-border-default);
}
.action-btn.ghost:hover:not(:disabled) {
  background: var(--clips-surface-secondary);
  border-color: var(--clips-border-strong);
  color: var(--clips-text-primary);
}

/* Danger — text only, no fill */
.action-btn.danger {
  background: transparent;
  color: var(--clips-danger-text);
  border-color: transparent;
  padding: 0 8px;
}
.action-btn.danger:hover:not(:disabled) {
  color: var(--clips-danger-hover-text);
  background: transparent;
}

/* Disabled state for connected-platform buttons */
.action-btn.action-disabled {
  background: transparent;
  color: var(--clips-text-tertiary);
  border-color: var(--clips-border-subtle);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Processing state */
.action-processing {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--clips-text-tertiary);
  font-size: 12px;
  font-weight: 500;
  padding: 0 4px;
}
.processing-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--clips-border-default);
  border-top-color: var(--clips-text-secondary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ─── Modals ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal-content {
  background: var(--clips-surface-card);
  border: 1px solid var(--clips-border-default);
  border-radius: 12px;
  padding: 28px;
  max-width: 480px;
  width: 92%;
  box-shadow: var(--clips-shadow-lg);
}
.modal-content h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--clips-text-primary);
  letter-spacing: -0.01em;
}
.modal-content p {
  margin: 0 0 22px;
  color: var(--clips-text-secondary);
  font-size: 14px;
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Modal buttons share the same base */
.btn-cancel,
.btn-delete-confirm,
.btn-upgrade,
.btn-approve,
.btn-reject {
  height: 38px;
  padding: 0 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.13s, background 0.13s;
  border: 1px solid transparent;
  min-width: 80px;
}
.btn-cancel {
  background: transparent;
  color: var(--clips-text-secondary);
  border-color: var(--clips-border-default);
}
.btn-cancel:hover:not(:disabled) {
  background: var(--clips-surface-secondary);
  border-color: var(--clips-border-strong);
}
.btn-approve, .btn-upgrade {
  background: var(--clips-btn-primary-bg);
  color: var(--clips-btn-primary-text);
  border-color: var(--clips-btn-primary-bg);
}
.btn-approve:hover:not(:disabled), .btn-upgrade:hover {
  background: var(--clips-btn-primary-hover-bg);
  border-color: var(--clips-btn-primary-hover-bg);
}
.btn-delete-confirm, .btn-reject {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}
.btn-delete-confirm:hover:not(:disabled), .btn-reject:hover:not(:disabled) {
  background: #a93226;
  border-color: #a93226;
}
.btn-cancel:disabled,
.btn-delete-confirm:disabled,
.btn-approve:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Video Modal ────────────────────────────────────────── */
.video-modal-content {
  background: var(--clips-surface-card);
  border: 1px solid var(--clips-border-default);
  border-radius: 12px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--clips-shadow-lg);
}
.video-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--clips-border-default);
}
.video-modal-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--clips-text-primary);
}
.video-modal-controls { display: flex; align-items: center; gap: 8px; }
.captions-toggle {
  height: 28px;
  padding: 0 10px;
  background: var(--clips-surface-secondary);
  color: var(--clips-text-secondary);
  border: 1px solid var(--clips-border-default);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.13s;
}
.captions-toggle:hover { background: var(--clips-surface-card-hover); }
.close-button {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: var(--clips-text-tertiary);
  cursor: pointer;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.13s, color 0.13s;
}
.close-button:hover { background: var(--clips-surface-secondary); color: var(--clips-text-primary); }
.video-player {
  width: 100%;
  max-height: calc(90vh - 56px);
  display: block;
  background: #000;
}

/* ─── Empty State ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--clips-text-tertiary);
  font-size: 14px;
}

/* ─── Platform Selection (Approve Modal) ─────────────────── */
.platform-selection { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.platform-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--clips-surface-secondary);
  border: 1px solid var(--clips-border-default);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.13s;
}
.platform-checkbox:hover { border-color: var(--clips-border-strong); }
.platform-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--clips-text-primary);
}
.platform-checkbox span { flex: 1 1; font-size: 13px; font-weight: 500; color: var(--clips-text-primary); }
.platform-hint { font-size: 11px; color: var(--clips-text-tertiary); }
.warning-text { font-size: 12px; color: var(--clips-danger-text); margin: 10px 0 0; font-weight: 500; }
.warning-text a { color: var(--clips-text-primary); text-decoration: underline; }
.tier-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  background: var(--clips-status-pending-bg);
  border: 1px solid var(--clips-status-pending-border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--clips-status-pending-text);
  margin-bottom: 14px;
  line-height: 1.5;
}
.tier-notice svg { flex-shrink: 0; margin-top: 1px; }

/* ─── Download Options ───────────────────────────────────── */
.download-options { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.btn-download-option {
  display: flex;
  align-items: center;
  padding: 14px;
  background: var(--clips-surface-secondary);
  border: 1px solid var(--clips-border-default);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.13s, background 0.13s;
  text-align: left;
  width: 100%;
}
.btn-download-option:hover:not(:disabled) {
  border-color: var(--clips-border-strong);
  background: var(--clips-surface-card-hover);
}
.btn-download-option:disabled { opacity: 0.4; cursor: not-allowed; }
.download-option-content { display: flex; flex-direction: column; gap: 3px; }
.download-option-content strong { font-size: 13px; font-weight: 600; color: var(--clips-text-primary); }
.download-option-content span  { font-size: 12px; color: var(--clips-text-tertiary); }

/* ─── AI Suggestions ─────────────────────────────────────── */
.ai-suggestions-container { margin-top: 10px; }
.ai-toggle-button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  background: var(--clips-surface-secondary);
  border: 1px solid var(--clips-border-default);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--clips-text-secondary);
  cursor: pointer;
  transition: border-color 0.13s, background 0.13s;
  width: 100%;
}
.ai-toggle-button:hover { border-color: var(--clips-border-strong); background: var(--clips-surface-card-hover); }
.ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  background: var(--clips-btn-primary-bg);
  color: var(--clips-btn-primary-text);
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.ai-suggestions-expanded {
  margin-top: 8px;
  padding: 12px;
  background: var(--clips-surface-secondary);
  border: 1px solid var(--clips-border-default);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-suggestion-item { display: flex; flex-direction: column; gap: 4px; }
.ai-suggestion-header { display: flex; justify-content: space-between; align-items: center; }
.ai-suggestion-item strong {
  font-size: 10px;
  font-weight: 700;
  color: var(--clips-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ai-suggestion-item p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--clips-text-primary);
  word-break: break-word;
  white-space: pre-wrap;
}
.copy-button {
  background: transparent;
  border: 1px solid var(--clips-border-default);
  border-radius: 4px;
  padding: 3px 5px;
  cursor: pointer;
  color: var(--clips-text-tertiary);
  display: flex;
  align-items: center;
  transition: border-color 0.13s, color 0.13s;
}
.copy-button:hover { border-color: var(--clips-border-strong); color: var(--clips-text-primary); }

/* ─── Schedule Picker ────────────────────────────────────── */
.schedule-picker { display: flex; gap: 12px; margin: 16px 0; }
.schedule-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1; }
.schedule-field span { font-size: 12px; font-weight: 600; color: var(--clips-text-secondary); }
.schedule-field input {
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--clips-border-default);
  background: var(--clips-surface-secondary);
  color: var(--clips-text-primary);
  font-size: 13px;
  transition: border-color 0.13s;
}
.schedule-field input:focus {
  outline: 2px solid var(--clips-border-strong);
  outline-offset: 2px;
  border-color: var(--clips-border-strong);
}

.tiktok-publish-modal {
  max-width: 420px;
  padding: 20px;
}

.tiktok-publish-modal h2 {
  font-size: 15px;
  margin: 0 0 4px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 12px 0 16px;
}

.modal-form label {
  font-size: 10px;
  font-weight: 600;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

.modal-form label:first-child {
  margin-top: 0;
}

.modal-input,
.modal-textarea,
.modal-select {
  width: 100%;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #f4f4f5;
  font-size: 12px;
  font-family: inherit;
  transition: border-color 0.15s;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-input:focus,
.modal-textarea:focus,
.modal-select:focus {
  outline: none;
  border-color: #9146ff;
}

.modal-textarea {
  resize: none;
  min-height: 28px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
}

.modal-select {
  cursor: pointer;
  -webkit-appearance: none;
          appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 viewBox=%270 0 12 12%27%3E%3Cpath fill=%27%23a1a1aa%27 d=%27M6 8L1 3h10z%27/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.modal-select option {
  background: #1f1f23;
  color: #f4f4f5;
}

.tiktok-publish-status {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 2px;
  line-height: 1.3;
}

.tiktok-publish-status.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

.tiktok-publish-status.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.tiktok-publish-status.info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

/* Platform buttons — pill-shaped with subtle platform colors */
.platform-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  border-radius: 14px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

.platform-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f4f4f5;
}

.platform-btn.youtube-btn:hover:not(:disabled) {
  border-color: rgba(255, 0, 0, 0.3);
  color: #ff4444;
}

.platform-btn.tiktok-btn:hover:not(:disabled) {
  border-color: rgba(0, 242, 234, 0.3);
  color: #00f2ea;
}

.platform-btn.reels-btn:hover:not(:disabled) {
  border-color: rgba(225, 48, 108, 0.3);
  color: #e1306c;
}

.platform-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Icon buttons — compact square for utility actions */
.icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  border: none;
  background: transparent;
  color: #71717a;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.icon-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: #f4f4f5;
}

.icon-btn.disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.icon-btn.danger-icon {
  color: #52525b;
}

.icon-btn.danger-icon:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

.ai-toggle-arrow {
  transition: transform 0.2s;
}

.ai-toggle-arrow.expanded {
  transform: rotate(180deg);
}

.schedule-helper-text {
  font-size: 13px;
  color: var(--clips-text-tertiary);
  margin-top: 8px;
}

.youtube-publish-modal {
  max-width: 420px;
  padding: 20px;
}

.youtube-publish-modal h2 {
  font-size: 15px;
  margin: 0 0 4px;
}

.utility-spacer {
  flex: 1 1;
}

.banner {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  max-width: 360px;
  min-width: 240px;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: bannerSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1;
  min-width: 0;
}

.banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1;
  min-width: 0;
}

.banner-debug {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  opacity: 0.6;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.debug-code {
  font-weight: 600;
  text-transform: uppercase;
}

.debug-separator {
  font-size: 8px;
}

.debug-timestamp {
  font-weight: 400;
}

.banner-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  margin-top: 1px;
}

.banner-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: inherit;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-description {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  color: inherit;
  opacity: 0.85;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-message {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: inherit;
}

.banner-dismiss {
  padding: 4px;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.banner-dismiss:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.banner-dismiss:focus {
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: 2px;
}

.banner-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}

.banner-success .banner-icon {
  background: rgba(255, 255, 255, 0.2);
}

.banner-error {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  color: #ffffff;
}

.banner-error .banner-icon {
  background: rgba(255, 255, 255, 0.2);
}

.banner-warning {
  background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
  color: #2d3436;
}

.banner-warning .banner-icon {
  background: rgba(45, 52, 54, 0.1);
}

.banner-info {
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  color: #ffffff;
}

.banner-info .banner-icon {
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .banner {
  background: rgba(28, 28, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .banner-dismiss:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .banner-dismiss:focus {
  outline-color: rgba(255, 255, 255, 0.3);
}

.settings-redesign {
  color: var(--text);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.settings-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
  max-width: 400px;
}

.settings-toast-success {
  background: #10b981;
  color: white;
  border: 1px solid #059669;
}

.settings-toast-error {
  background: #ef4444;
  color: white;
  border: 1px solid #dc2626;
}

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

.settings-header {
  width: 100%;
  margin-bottom: 32px;
  padding: 24px 16px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
}

@media (min-width: 768px) {
  .settings-header {
    padding: 32px 24px;
    margin: 0 80px 32px 80px;
  }
}

.settings-header h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

@media (min-width: 768px) {
  .settings-header h1 {
    font-size: 28px;
  }
}

.subtitle {
  font-size: 15px;
  color: var(--muted-text);
  margin-top: 4px;
}



.settings-shell {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 64px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.settings-main {
  width: 100%;
  padding: 0;
}

.settings-main > .settings-card {
  margin-bottom: 24px;
}

.settings-main > .settings-card:last-child {
  margin-bottom: 0;
}

.settings-section {
  position: relative;
}

.settings-section-divider {
  height: 1px;
  background: var(--color-border-default);
  margin: 56px 0;
}

/* Content Settings two-column layout */
.content-settings-layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 380px);
  grid-gap: 48px;
  gap: 48px;
  align-items: start;
}

.content-settings-controls {
  min-width: 0;
}

.content-settings-preview {
  position: -webkit-sticky;
  position: sticky;
  top: 100px;
}

.content-settings-preview .preview-card {
  position: static;
  padding: 24px 16px;
}

.preview-card {
  position: -webkit-sticky;
  position: sticky;
  top: 120px;
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  background: transparent;
  border-radius: 12px;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Title: match app font-family (Inter) and text rendering */
.preview-card-title {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
  font-size: clamp(34px, 3.2vw, 52px);
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.05;
  margin: 0 0 12px 0;
  padding: 0;
  color: var(--text);
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  display: block;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.preview-card-title::before,
.preview-card-title::after {
  display: none !important;
  content: none !important;
}

/* Subtitle: match app font-family (Inter) and text rendering */
.preview-card-subtitle {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
  opacity: 0.7;
  margin: 0 auto 32px auto;
  padding: 0;
  max-width: 360px;
  color: var(--muted-text);
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  display: block;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.preview-card-subtitle::before,
.preview-card-subtitle::after {
  display: none !important;
  content: none !important;
}

.preview-card-frame-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Preview stage: removed glow effect, added subtle shadow matching settings cards */
.preview-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 9/16;
  border-radius: 12px;
  overflow: hidden;
  border: none;
  box-shadow: none;
  background: transparent;
  --caption-safe-x: clamp(12px, 4%, 28px);
  --caption-safe-bottom: 80px;
  --caption-shadow-strength: 0.6;
}

/* Background image - non-interactive layer at z-index 0 */
.preview-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Interactive overlay layers - above background */
.preview-layer {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
}

.preview-separator {
  top: 30%;
  height: 25px;
  width: 100%;
  z-index: 3;
  background-color: #000000;
  background-color: var(--separator-color, #000000);
}

.preview-static-text {
  top: 30%;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 4;
  text-align: center;
  margin: 0 auto;
  width: -webkit-fit-content;
  width: fit-content;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  line-height: 25px;
  color: #ffffff;
  color: var(--static-text-color, #ffffff);
  background-color: transparent;
  text-shadow: none;
  box-shadow: none;
}



.captionOverlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  justify-content: center;
  z-index: 5;
}

.captionSafeArea {
  width: 100%;
  padding-left: var(--caption-safe-x);
  padding-right: var(--caption-safe-x);
  display: flex;
  justify-content: center;
}

.captionPill {
  display: inline-block;
  max-width: 100%;
  background: transparent;
  border-radius: 999px;
  padding: clamp(8px, 1.5vw, 14px) clamp(14px, 2vw, 20px);
  box-sizing: border-box;
}

.captionText {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 800;
  color: #fff;
  font-size: calc(14 * 0.35px);
  font-size: calc(var(--caption-size, 14) * 0.35px);
  line-height: 1.15;
  text-align: center;
  letter-spacing: 0.2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.preview-card-image {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1200px) {
  .settings-shell {
    padding: 40px 24px;
  }
  
  .content-settings-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .content-settings-preview {
    position: static;
    display: flex;
    justify-content: center;
  }
  
  .content-settings-preview .preview-card {
    max-width: 400px;
  }
}

.settings-card {
  background: var(--color-bg-surface);
  border-radius: 12px;
  padding: 40px 32px;
  border: 1px solid var(--color-border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.15s ease-in-out;
}

@media (min-width: 768px) {
  .settings-card {
    padding: 48px 40px;
  }
}

[data-theme="dark"] .settings-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.beta-badge {
  font-size: 11px;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  vertical-align: middle;
  margin-left: 8px;
  letter-spacing: 0.5px;
}

.card-subtitle {
  font-size: 15px;
  color: var(--muted-text);
  margin: 0 0 32px 0;
  line-height: 1.6;
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.setting-row-spaced {
  margin-top: 12px;
}

@media (min-width: 768px) {
  .setting-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
  }
}

.setting-info {
  flex: 1 1;
}

.setting-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.setting-description {
  font-size: 14px;
  color: var(--muted-text);
}



.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

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

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  background: #d1d5db;
  border-radius: 14px;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

[data-theme="dark"] .toggle-slider {
  background: #4b5563;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.15s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: #10b981;
}

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

.toggle-switch input:focus + .toggle-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-label {
  font-size: 14px;
  color: var(--muted-text);
}

.platforms-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 16px;
  gap: 16px;
}

@media (min-width: 768px) {
  .platforms-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

.platform-card {
  background: var(--color-bg-elevated);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--color-border-default);
  transition: all 0.15s ease-in-out;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
  .platform-card {
    padding: 20px;
  }
}

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

[data-theme="dark"] .platform-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .platform-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.platform-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.platform-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #f5f5f5;
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 8px;
}

.platform-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.platform-profile-avatar.youtube {
  background: #ff0000;
}

.platform-profile-avatar.tiktok {
  background: #000000;
}

.platform-profile-pic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.platform-profile-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.platform-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.connected {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.status-badge.disconnected {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

[data-theme="dark"] .status-badge.connected {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #10b981;
}

[data-theme="dark"] .status-badge.disconnected {
  background: #374151;
  color: #9ca3af;
  border-color: #4b5563;
}

.platform-status {
  margin: 12px 0;
  font-size: 14px;
}

.posting-enabled {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #10b981;
  font-weight: 500;
}

.posting-enabled svg {
  flex-shrink: 0;
}

.posting-locked {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-text);
  font-weight: 500;
}

.posting-locked svg {
  flex-shrink: 0;
}

.posting-unavailable {
  color: var(--muted-text);
  font-size: 13px;
}

.platform-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.platform-button {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  min-height: var(--touch-target-min);
  width: 100%;
  transition: var(--transition-fast), var(--transition-transform);
}

@media (min-width: 768px) {
  .platform-button {
    padding: 8px 16px;
    width: auto;
  }
}

.platform-button.connect {
  background: #10b981;
  color: white;
  border: none;
}

.platform-button.connect:hover {
  background: #059669;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.platform-button.connect:focus {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

.platform-button.disconnect {
  background: #ef4444;
  color: white;
  border: none;
}

.platform-button.disconnect:hover {
  background: #dc2626;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.platform-button.disconnect:focus {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

.form-field {
  margin-bottom: 24px;
}

.form-field:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.field-input,
.field-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  transition: all 0.15s ease-in-out;
  min-height: 44px;
}

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

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

.field-select option {
  background: var(--card-bg);
  color: var(--text);
}

.field-help {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted-text);
}

.field-help-spaced {
  margin-top: 4px;
  margin-bottom: 12px;
}

.full-width {
  width: 100%;
}

.disabled-text {
  opacity: 0.5;
}

.discord-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

@media (min-width: 768px) {
  .discord-section {
    padding: 20px;
  }
}

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

.discord-info p {
  font-size: 14px;
  color: var(--muted-text);
  margin: 0 0 16px 0;
}

.discord-benefits {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.benefit-item {
  font-size: 14px;
  color: var(--text);
  padding: 8px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.discord-connected {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.discord-connected p {
  font-size: 14px;
  color: var(--muted-text);
  margin: 0;
  font-family: monospace;
}

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

.discord-form .field-help a {
  color: var(--accent);
  text-decoration: none;
}

.discord-form .field-help a:hover {
  text-decoration: underline;
}

.discord-setup {
  margin-bottom: 24px;
}

.discord-invite {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.discord-invite:hover {
  text-decoration: none;
}

.card-subtitle {
  font-size: 14px;
  color: var(--muted-text);
  margin: -12px 0 24px 0;
  line-height: 1.5;
}

.tier-note {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 8px;
}

.tier-requirement {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 16px 0;
  padding: 8px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.posting-mode-notice {
  font-size: 14px;
  color: var(--text);
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.discord-config {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

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

.platform-toggles {
  margin-top: 24px;
}

.platform-toggles h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.15s ease-in-out;
}

.checkbox-label:hover {
  background: var(--bg);
  border-color: var(--accent);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  border-radius: 8px;
}

[data-theme="dark"] .connection-status {
  background: #064e3b;
  border-color: #10b981;
}

.status-text {
  font-size: 14px;
  color: #065f46;
  font-weight: 500;
}

[data-theme="dark"] .status-text {
  color: #6ee7b7;
}

.platform-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.platform-button:disabled:hover {
  background: #10b981;
  box-shadow: none;
  transform: none;
}

.platform-button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.platform-button.disabled:hover {
  background: #10b981;
  box-shadow: none;
  transform: none;
}

@media (max-width: 768px) {
  .card-subtitle {
    margin: -12px 0 20px 0;
  }

  .discord-config {
    margin-top: 24px;
    padding-top: 20px;
  }

  .discord-benefits {
    gap: 6px;
  }

  .benefit-item {
    font-size: 13px;
  }

  .settings-toast {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .subscription-card {
    padding: 20px 16px !important;
  }
  
  /* Mobile-friendly form elements */
  .field-input,
  .field-textarea,
  select {
    font-size: 16px !important; /* Prevent zoom on iOS */
    min-height: var(--touch-target-mobile);
    padding: 12px 16px;
  }
  
  .platform-button {
    min-height: var(--touch-target-mobile);
    padding: 12px 20px;
    font-size: 16px;
  }
  
  .checkbox-label {
    min-height: var(--touch-target-mobile);
    padding: 12px 16px;
  }
  
  .checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }
  
  /* Stack form elements vertically on mobile */
  .api-key-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .api-key-actions .platform-button {
    width: 100%;
  }
  
  .token-display {
    flex-direction: column;
    gap: 12px;
  }
  
  .token-display .field-input {
    min-width: 0;
    min-width: initial;
    width: 100%;
  }
  
  .token-display .platform-button {
    width: 100%;
  }
}

@media (max-width: 414px) {
  .card-title {
    font-size: 18px;
  }
  
  .setting-label {
    font-size: 15px;
  }
  
  .setting-description {
    font-size: 13px;
  }
  
  /* Extra small screens */
  .field-input,
  .field-textarea,
  select {
    font-size: 16px !important;
    padding: 14px 16px;
  }
  
  .platform-button {
    padding: 14px 18px;
    font-size: 15px;
  }
  
  .checkbox-label {
    padding: 14px 16px;
    font-size: 15px;
  }
}

.api-key-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 720px;
  margin-bottom: 12px;
}

.api-key-section .field-input {
  width: 100%;
}

.api-key-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.api-key-actions .platform-button {
  flex-shrink: 0;
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
  min-height: 40px;
}

@media (max-width: 768px) {
  .api-key-actions .platform-button {
    flex: 1 1;
    min-width: 100px;
  }
}

.locked-feature {
  opacity: 0.6;
}

.premium-feature-gate {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.feature-gate-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feature-gate-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.feature-gate-icon {
  flex-shrink: 0;
  color: var(--muted-text);
  margin-top: 2px;
}

.feature-gate-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.feature-gate-description {
  font-size: 14px;
  color: var(--muted-text);
  line-height: 1.5;
}

.feature-gate-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
  .feature-gate-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.feature-gate-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-text);
  padding: 6px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.feature-gate-cta {
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  width: 100%;
  transition: var(--transition-fast), var(--transition-transform);
}

@media (min-width: 768px) {
  .feature-gate-cta {
    width: auto;
  }
}

.feature-gate-cta:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.feature-gate-cta:active {
  transform: translateY(0);
}

.locked-platform {
  opacity: 0.8;
}

.status-badge.locked {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

[data-theme="dark"] .status-badge.locked {
  background: #374151;
  color: #9ca3af;
  border-color: #4b5563;
}

.streamdeck-access {
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 24px rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  padding: 24px;
  margin-top: 8px;
}

[data-theme="light"] .streamdeck-access {
  background: rgba(0, 0, 0, 0.02);
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 8px 24px rgba(0, 0, 0, 0.08);
}

.access-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 4px 0;
}

.access-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 12px 0;
}

[data-theme="light"] .access-description {
  color: rgba(0, 0, 0, 0.65);
}

.access-requirement {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 18px 0;
}

[data-theme="light"] .access-requirement {
  color: rgba(0, 0, 0, 0.55);
}

.upgrade-button {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 
    0 6px 16px rgba(34, 197, 94, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
  align-self: flex-start;
  transition: var(--transition-transform), box-shadow 0.2s ease;
}

.upgrade-button:hover {
  transform: translateY(-1px);
  box-shadow: 
    0 8px 20px rgba(34, 197, 94, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.upgrade-button:active {
  transform: translateY(0);
}

.token-display {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.token-display .field-input {
  flex: 1 1;
  min-width: 200px;
}

.token-display .platform-button {
  flex-shrink: 0;
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
}

@media (max-width: 768px) {
  .token-display {
    flex-direction: column;
    gap: 12px;
  }
  
  .token-display .field-input {
    min-width: 0;
    min-width: initial;
  }
}

.subscription-card {
  padding: 20px 16px !important;
}

@media (min-width: 768px) {
  .subscription-card {
    padding: 24px !important;
  }
}

.subscription-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.subscription-status {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  padding: 16px;
}

.status-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.current-plan {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.plan-label,
.status-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-text);
}

.plan-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-badge.plan-hobby {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.plan-badge.plan-creator {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.plan-badge.plan-brand {
  background: #f3e8ff;
  color: #7c3aed;
  border: 1px solid #c4b5fd;
}

[data-theme="dark"] .plan-badge.plan-hobby {
  background: #374151;
  color: #9ca3af;
  border-color: #4b5563;
}

[data-theme="dark"] .plan-badge.plan-creator {
  background: #1e3a8a;
  color: #93c5fd;
  border-color: #3b82f6;
}

[data-theme="dark"] .plan-badge.plan-brand {
  background: #581c87;
  color: #c4b5fd;
  border-color: #8b5cf6;
}

.subscription-details {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-value {
  font-size: 14px;
  font-weight: 500;
}

.status-value.status-active {
  color: #10b981;
}

.status-value.status-canceled,
.status-value.status-past_due {
  color: #ef4444;
}

.status-value.status-trialing {
  color: #f59e0b;
}

.early-access-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.early-access-badge {
  padding: 4px 8px;
  background: #10b981;
  color: white;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.platform-button.btn-secondary {
  background: #6b7280;
  color: white;
  border: none;
}

.platform-button.btn-secondary:hover {
  background: #4b5563;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.platform-button.btn-secondary:focus {
  outline: 2px solid #6b7280;
  outline-offset: 2px;
}

[data-theme="dark"] .platform-button.btn-secondary {
  background: #4b5563;
  color: #e5e7eb;
}

[data-theme="dark"] .platform-button.btn-secondary:hover {
  background: #374151;
}

/* Discord Integration - Compressed Accordion */
.discord-optional {
  border-bottom: 1px solid var(--color-border-default);
  margin-bottom: 16px;
  padding-bottom: 16px;
}

.discord-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 8px 0;
  -webkit-user-select: none;
  user-select: none;
}

.discord-accordion-header:hover {
  opacity: 0.8;
}

.discord-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-text);
  margin: 0;
}

.discord-subtitle {
  font-size: 12px;
  color: var(--muted-text);
  margin-left: 8px;
  opacity: 0.7;
}

.discord-caret {
  color: var(--muted-text);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.discord-caret.expanded {
  transform: rotate(180deg);
}

.discord-content {
  padding: 16px 0 0 0;
  animation: slideDown 0.2s ease;
}

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

.discord-bot-setup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.discord-invite-compact {
  padding: 6px 12px;
  font-size: 13px;
  width: auto;
}

.micro-label {
  font-size: 11px;
  color: var(--muted-text);
  opacity: 0.7;
}

.platform-toggles-inline {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 0;
  flex-wrap: wrap;
}

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

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

.inline-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.discord-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.platform-button.compact {
  padding: 6px 16px;
  font-size: 13px;
  width: auto;
}

.status-indicator {
  font-size: 12px;
  color: #10b981;
  font-weight: 500;
}

/* Discord Upsell Row */
.discord-upsell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-default);
  margin-bottom: 16px;
}

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

.platform-button.upgrade.compact {
  padding: 6px 12px;
  font-size: 12px;
  background: #6b7280;
  color: white;
  border: none;
}

.platform-button.upgrade.compact:hover {
  background: #4b5563;
}

/* Subsection Styles */
.subsection {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border-default);
}

.subsection:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.subsection-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.subsection-subtitle {
  font-size: 14px;
  color: var(--muted-text);
  margin: 0 0 24px 0;
  line-height: 1.6;
}

/* Clip Preview Title Styles */
/* BETA Tag */
.beta-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 8px;
  vertical-align: middle;
}

[data-theme="dark"] .beta-tag {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
}

/* Discord section heading adjustments */
.discord-info h4,
.discord-config h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
}

.discord-config h5 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
}

/* Captions BETA Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .modal-content {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

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

.modal-warning {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 24px 0;
  padding: 16px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-actions .platform-button {
  width: auto;
  padding: 10px 20px;
  font-size: 14px;
}

@media (max-width: 480px) {
  .modal-content {
    margin: 20px;
    padding: 20px;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .modal-actions .platform-button {
    width: 100%;
  }
}

/* Discord platform filters */
.discord-platform-filters {
  margin-left: 1rem;
  margin-top: 0.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border-color);
}

.discord-platform-filters .field-help {
  margin-bottom: 0.5rem;
}

.discord-platform-filters .setting-row {
  margin-top: 0.5rem;
}

/* Discord unlink button */
.discord-unlink-button {
  margin-top: 1rem;
}
.discord-linked-status {
  padding: 16px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
}

.discord-linked-status .status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #10b981;
  margin-bottom: 12px;
}

.discord-linked-status .field-help {
  margin: 0;
}

.discord-linked-status code {
  background: var(--card-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--border);
}

/* Discord platform filters */
.discord-platform-filters {
  margin-left: 1rem;
  margin-top: 0.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border-color);
}

.discord-platform-filters .field-help {
  margin-bottom: 0.5rem;
}

.discord-platform-filters .setting-row {
  margin-top: 0.5rem;
}

/* Discord unlink button */
.discord-unlink-button {
  margin-top: 1rem;
}

/* Discord Linked Status */
.discord-linked-status {
  padding: 16px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
}

.discord-linked-status .status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #10b981;
  margin-bottom: 12px;
}

.discord-linked-status .field-help {
  margin: 0;
}

.discord-linked-status code {
  background: var(--card-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--border);
}

/* Discord autopost row */
.discord-autopost-row {
  margin-top: 1rem;
}

/* Caption Color Picker */
.color-picker-row {
  display: flex;
  align-items: center;
}

.color-input {
  width: 60px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
}

.hex-input {
  width: 120px;
  margin-left: 10px;
}

/* Caption Preview */
.caption-preview {
  margin-top: 20px;
  padding: 15px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.preview-label {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.preview-box {
  background: #000;
  border-radius: 8px;
  padding: 20px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.preview-webcam {
  background: #333;
  padding: 20px 40px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
}

.preview-static-text {

  color: #fff;

  color: var(--static-text-color, #fff);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  margin: 10px 0;
}

.preview-gameplay {
  flex: 1 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 14px;
}

.preview-caption {
  background: rgba(0, 0, 0, 0.8);
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 10px;
  color: #fff;
  color: var(--caption-color, #fff);
}

/* Locked platform cards */
.platform-card.locked {
  opacity: 0.6;
}

.platform-card.locked:hover {
  transform: none;
  box-shadow: none;
}

.platform-card.locked .platform-actions {
  pointer-events: auto;
}

.platform-features-muted {
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
}

/* Lock icon for locked platform cards */
.lock-icon {
  opacity: 0.3;
}

/* Separator Bar Preview */
.separator-bar-preview {
  margin-top: 16px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.separator-bar-preview .preview-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.separator-bar {
  width: 100%;
  height: 70px;
  background: #000000;
  background: var(--bar-color, #000000);
  transition: height 0.2s ease;
  border-radius: 4px;
}

.separator-bar.hidden {
  height: 0;
  overflow: hidden;
}

/* Clip Preview Component */
.clip-preview-frame {
  aspect-ratio: 9/16;
  width: 100%;
  max-width: 520px;
  background-color: #1a1a1a;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.clip-preview-webcam {
  height: 30%;
  background-color: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 12px;
}

.clip-preview-separator {
  height: 25px;
  width: 100%;
}

.clip-preview-static-text {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

.clip-preview-static-text.with-separator {
  top: calc(30% + 12px);
}

.clip-preview-gameplay {
  height: 70%;
  background-color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 12px;
}

.clip-preview-gameplay.with-separator {
  height: calc(70% - 25px);
}

.clip-preview-captions {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);

  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  text-align: center;
  max-width: 85%;

  z-index: 3;
}

.caption-single {
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.caption-multi {
  font-weight: 700;
  white-space: nowrap;
}

.caption-block {
  font-weight: 600;
  max-width: 95%;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  display: inline;
}

/* Slider Styles */
.slider-container {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.field-slider {
  flex: 1 1;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-border-default);
  outline: none;
  cursor: pointer;
}

.field-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #10b981;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  -webkit-transition: all 0.15s ease;
  transition: all 0.15s ease;
}

.field-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(16, 185, 129, 0.4);
}

.field-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #10b981;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  -moz-transition: all 0.15s ease;
  transition: all 0.15s ease;
}

.field-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(16, 185, 129, 0.4);
}

.slider-value {
  min-width: 48px;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

[data-theme="dark"] .field-slider {
  background: #4b5563;
}


/* Upload Schedule */
.schedule-days-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-day-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-mode-options {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}

/* Affiliate Hero */
.affiliate-hero-card {
  position: relative;
  overflow: hidden;
}

.affiliate-hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Earnings Highlight */
.affiliate-earnings-highlight {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
  padding: 20px;
  background: #f8f9fa;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 12px;
}

[data-theme="dark"] .affiliate-earnings-highlight {
  background: rgba(255, 255, 255, 0.05);
}

.earnings-scenario {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
  border-bottom: 1px solid var(--color-border-default, #e5e7eb);
}

.earnings-scenario:last-child {
  border-bottom: none;
}

.earnings-scenario.featured {
  border-bottom: none;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
  border-radius: 8px;
  border-left: 3px solid #10b981;
}

.scenario-label {
  font-size: 14px;
  color: var(--text);
}

.scenario-amount {
  font-size: 20px;
  font-weight: 700;
  color: #10b981;
}

.earnings-scenario.featured .scenario-amount {
  font-size: 24px;
}

/* CTA */
.affiliate-cta {
  width: auto;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
}

.affiliate-cta-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted-text);
}

/* Personas */
.affiliate-personas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 16px;
  gap: 16px;
}

@media (max-width: 600px) {
  .affiliate-personas {
    grid-template-columns: 1fr;
  }
}

.persona {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  background: #f8f9fa;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 10px;
}

[data-theme="dark"] .persona {
  background: rgba(255, 255, 255, 0.04);
}

.persona-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.persona-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin: 0 0 4px 0;
}

.persona-desc {
  font-size: 13px;
  color: var(--muted-text);
  margin: 0;
  line-height: 1.4;
}

/* Steps */
.affiliate-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.affiliate-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-number {
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #8b5cf6;
  background: var(--accent, #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.step-content {
  flex: 1 1;
}

.step-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin: 0 0 4px 0;
}

.step-text {
  margin: 0;
  font-size: 14px;
  color: var(--muted-text);
  line-height: 1.5;
}

/* Benefits List */
.affiliate-benefits {
  margin-bottom: 16px;
}

.affiliate-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.affiliate-item {
  font-size: 15px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.affiliate-check {
  color: #10b981;
  font-size: 18px;
  font-weight: 700;
}

.affiliate-product-note {
  font-size: 14px;
  color: var(--muted-text);
  font-style: italic;
  margin: 16px 0 0 0;
}

/* Details Grid */
.affiliate-details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 16px;
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .affiliate-details-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.detail-item {
  text-align: center;
  padding: 20px 12px;
  background: #f8f9fa;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 10px;
}

[data-theme="dark"] .detail-item {
  background: rgba(255, 255, 255, 0.04);
}

.detail-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #8b5cf6;
  color: var(--accent, #8b5cf6);
  margin-bottom: 4px;
}

.detail-label {
  display: block;
  font-size: 12px;
  color: var(--muted-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Final CTA */
.affiliate-final-cta {
  text-align: center;
}

.affiliate-already {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted-text);
}

.affiliate-dashboard-link {
  color: #8b5cf6;
  color: var(--accent, #8b5cf6);
  text-decoration: none;
  font-weight: 500;
}

.affiliate-dashboard-link:hover {
  text-decoration: underline;
}

.community-funding-redesign {
  color: var(--text);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
}

@media (min-width: 768px) {
  .community-funding-redesign {
    padding: 0;
  }
}

.funding-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
  padding: 24px 16px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
}

@media (min-width: 768px) {
  .funding-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    margin: 0 16px 32px 16px;
    padding: 32px 24px;
  }
}

.funding-header h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

@media (min-width: 768px) {
  .funding-header h1 {
    font-size: 28px;
  }
}

.subtitle {
  font-size: 15px;
  color: var(--muted-text);
  margin-top: 4px;
}

.tier-badge {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg-surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tier-badge-active {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

.tier-badge-icon {
  font-size: 10px;
}

.tier-badge-name {
  font-size: 11px;
}

.current-tier-badge {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.hero-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  padding: 24px 16px;
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .hero-card {
    padding: 32px 24px;
    margin: 0 16px 32px 16px;
  }
}

.progress-card {
  background: var(--color-bg-surface);
  border-radius: 12px;
  padding: 24px 16px;
  margin-bottom: 32px;
  border: 1px solid var(--color-border-strong);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
  .progress-card {
    padding: 40px 32px;
    margin: 0 16px 32px 16px;
  }
}

[data-theme="dark"] .progress-card {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-card-spaced {
  margin-bottom: 32px;
}

.card-description-muted {
  margin-top: 12px;
  font-size: 14px;
  opacity: 0.8;
}

.progress-card-bordered {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
}

.empty-state-message {
  padding: 16px;
  text-align: center;
  opacity: 0.7;
  font-size: 14px;
  margin-bottom: 16px;
}

.progress-message {
  padding: 12px;
  text-align: center;
  font-size: 14px;
  margin-bottom: 16px;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 8px;
}

.next-unlock-text {
  margin-top: 12px;
  font-size: 13px;
  opacity: 0.7;
  font-style: italic;
}

[data-theme="dark"] .hero-card,
[data-theme="dark"] .progress-card {
  box-shadow: none;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--text);
}

.card-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.progress-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .progress-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
  }
}

.progress-subtitle {
  font-size: 14px;
  color: var(--muted-text);
  margin-top: 4px;
}

.bits-counter {
  font-size: 36px;
  font-weight: 300;
  color: var(--text);
}

@media (min-width: 768px) {
  .bits-counter {
    font-size: 48px;
  }
}

.progress-bar-section {
  margin-bottom: 24px;
}

.progress-track {
  position: relative;
  height: 16px;
  background: var(--color-bg-elevated);
  border: 2px solid var(--color-border-default);
  border-radius: 8px;
  margin-bottom: 56px;
  overflow: visible;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .progress-track {
    margin-bottom: 48px;
  }
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
  width: var(--progress-width, 0%);
}

.tier-checkpoint {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.checkpoint-dot {
  width: 20px;
  height: 20px;
  background: var(--bg);
  border: 3px solid var(--border);
  border-radius: 50%;
  transition: all 0.3s;
}

.tier-checkpoint.unlocked .checkpoint-dot {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.checkpoint-label {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 600;
  color: var(--muted-text);
  white-space: nowrap;
  text-align: center;
}

@media (min-width: 768px) {
  .checkpoint-label {
    font-size: 9px;
  }
}

.tier-checkpoint:last-child .checkpoint-label {
  left: auto;
  right: 0;
  transform: translateX(0);
}

.tier-checkpoint.unlocked .checkpoint-label {
  color: #10b981;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted-text);
  white-space: nowrap;
  padding: 0 2px;
}

.degradation-alert {
  padding: 12px 16px;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  font-size: 14px;
  color: #78350f;
}

[data-theme="dark"] .degradation-alert {
  background: #78350f;
  color: #fcd34d;
}

.tiers-section {
  margin-bottom: 32px;
  padding: 32px 16px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
}

@media (min-width: 768px) {
  .tiers-section {
    margin: 0 16px 32px 16px;
    padding: 40px 24px;
  }
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}

.tiers-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 16px;
  gap: 16px;
}

@media (min-width: 768px) {
  .tiers-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
  }
}

.tier-card {
  background: var(--color-bg-elevated);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--color-border-default);
  transition: all 0.15s ease-in-out;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
  .tier-card {
    padding: 24px;
  }
}

.tier-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-strong);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .tier-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .tier-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.tier-card.unlocked {
  border: 2px solid #10b981;
  background: var(--color-bg-elevated);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .tier-card.unlocked {
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tier-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.unlocked-badge {
  padding: 4px 8px;
  background: #10b981;
  color: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.tier-threshold {
  font-size: 14px;
  color: var(--muted-text);
  margin-bottom: 16px;
}

.tier-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.feature {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.feature::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--muted-text);
}

.tier-progress {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.tier-progress-bar {
  height: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.tier-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
  width: var(--tier-progress, 0%);
}

.tier-progress-text {
  font-size: 12px;
  color: var(--muted-text);
  text-align: center;
}

.info-section {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 16px;
  border: 1px solid var(--border);
}

@media (min-width: 768px) {
  .info-section {
    padding: 16px 20px;
  }
}

.info-section summary {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.info-section summary::-webkit-details-marker {
  display: none;
}

.info-section p {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted-text);
}

.smart-banner {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (min-width: 768px) {
  .smart-banner {
    padding: 16px 24px;
    margin-bottom: 32px;
  }
}

.tier-footer {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted-text);
  text-align: center;
  margin-top: 24px;
}

@media (min-width: 768px) {
  .tier-footer {
    padding: 16px 20px;
    margin-top: 32px;
  }
}

@media (max-width: 414px) {
  .checkpoint-label {
    font-size: 7px;
  }

  .progress-labels {
    font-size: 8px;
  }

  .progress-track {
    margin-bottom: 60px;
  }
  
  .card-title {
    font-size: 18px;
  }
  
  .tier-name {
    font-size: 16px;
  }
  
  .bits-counter {
    font-size: 32px;
  }
}

.tier-disclaimer {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(139, 92, 246, 0.1);
  border-left: 3px solid #8b5cf6;
  border-radius: 4px;
  font-size: 11px;
  font-style: italic;
  color: var(--muted-text);
  line-height: 1.4;
}

[data-theme="dark"] .tier-disclaimer {
  background: rgba(139, 92, 246, 0.15);
}

.explanation-section {
  margin-bottom: 32px;
  padding: 0 16px;
  max-width: 600px;
}

@media (min-width: 768px) {
  .explanation-section {
    padding: 0 16px;
  }
}

.explanation-section h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
}

.explanation-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.explanation-list li {
  font-size: 14px;
  color: var(--text-tertiary);
  padding-left: 16px;
  position: relative;
  line-height: 1.4;
}

.explanation-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text-tertiary);
  font-weight: normal;
}

.progress-helper {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-style: italic;
}

.billing-redesign {
  color: var(--text);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
}

.billing-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
  padding: 24px 16px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
}

@media (min-width: 768px) {
  .billing-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    padding: 32px 24px;
    margin: 0 16px 32px 16px;
  }
}

.billing-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.billing-toggle {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.billing-toggle button {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--muted-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
}

.billing-toggle button.active {
  background: var(--accent);
  color: white;
}

.billing-toggle button:hover:not(.active) {
  background: var(--bg-hover);
}

.save-badge {
  margin-left: 6px;
  padding: 2px 6px;
  background: #10b981;
  color: white;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.billing-header-simple {
  padding: 24px 16px 16px 16px;
  text-align: center;
}

@media (min-width: 768px) {
  .billing-header-simple {
    padding: 32px 24px 16px 24px;
  }
}

.billing-header-simple h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text);
}

@media (min-width: 768px) {
  .billing-header-simple h1 {
    font-size: 28px;
  }
}

.billing-header-simple .subtitle {
  font-size: 15px;
  color: var(--muted-text);
  margin: 0 auto;
  max-width: 600px;
}

.billing-portal-card {
  margin: 20px auto 30px;
  max-width: 980px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15);
}

.billing-portal-text {
  font-size: 0.98rem;
}

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

.pricing-section {
  margin: 0 16px 32px 16px;
}

.pricing-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 12px 0;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 768px) {
  .pricing-section-header {
    flex-direction: column;
    align-items: stretch;
  }
}

.pricing-card.annual-highlight {
  animation: annualPulse 150ms ease-out;
}

@keyframes annualPulse {
  0% {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }
  50% {
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2);
  }
  100% {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }
}

.pricing-card.annual-highlight {
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2);
}

[data-theme="dark"] .pricing-card.annual-highlight {
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.price-monthly-equiv {
  font-size: 0.7rem;
  color: var(--muted-text);
  font-weight: 400;
  margin-top: 2px;
}

.billing-header h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

@media (min-width: 768px) {
  .billing-header h1 {
    font-size: 28px;
  }
}

.subtitle {
  font-size: 15px;
  color: var(--muted-text);
  margin-top: 4px;
  max-width: 600px;
}

.current-plan-badge {
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 16px;
  gap: 16px;
  padding: 16px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
}

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

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

.pricing-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.15s ease-in-out;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
  .pricing-card {
    padding: 16px;
  }
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-color: var(--color-border-strong);
}

[data-theme="dark"] .pricing-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .pricing-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.pricing-card.free-tier {
  opacity: 0.92;
  border-color: var(--color-border-default);
}

.pricing-card.free-tier .plan-tagline {
  color: var(--text-muted);
}

.pricing-card.free-tier:hover {
  transform: translateY(-2px);
}

.pricing-card.current-plan {
  border-color: #10b981;
  background: #d1fae5;
}

[data-theme="dark"] .pricing-card.current-plan {
  background: #064e3b;
  border-color: #10b981;
}

[data-theme="dark"] .pricing-card.current-plan .plan-name,
[data-theme="dark"] .pricing-card.current-plan .price-amount,
[data-theme="dark"] .pricing-card.current-plan .price-free,
[data-theme="dark"] .pricing-card.current-plan .feature-item {
  color: #f9fafb;
}

.current-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 12px;
  background: #10b981;
  color: white;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-badge-top {
  position: absolute;
  top: 8px;
  right: 12px;
  padding: 6px 12px;
  background: var(--bg);
  color: var(--muted-text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.roi-banner {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 16px 24px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (min-width: 768px) {
  .roi-banner {
    padding: 12px 24px;
    margin: 0 24px 32px 24px;
  }
}

.pricing-header {
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: none;
}

.plan-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
}

.plan-summary {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin: 0 0 12px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.plan-tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0 0 8px 0;
  min-height: 36px;
}

.value-statement {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  line-height: 1.4;
  margin: 0 0 16px 0;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 4px;
  border-left: 2px solid var(--color-border-strong);
}

[data-theme="dark"] .value-statement {
  background: rgba(255, 255, 255, 0.03);
}

.price-display {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 12px;
}

.price-amount {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.price-period {
  font-size: 0.9rem;
  color: var(--muted-text);
  font-weight: 400;
}

.price-sublabel {
  font-size: 0.8rem;
  color: #10b981;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.price-free {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
}

.features-list {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

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

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
  font-weight: 500;
}

.see-more-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-bottom: 8px;
  opacity: 0.85;
}

.see-more-toggle::after {
  content: "→";
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.see-more-toggle:hover {
  opacity: 1;
  color: var(--accent);
}

.see-more-toggle:hover::after {
  transform: translateX(3px);
}

.see-more-toggle:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[data-theme="dark"] .see-more-toggle {
  color: var(--color-text-primary);
}

.pricing-card.popular-tier {
  border: 2px solid var(--accent);
  box-shadow: 0 6px 20px rgba(145, 70, 255, 0.25);
  transform: scale(1.02);
}

[data-theme="dark"] .pricing-card.popular-tier {
  box-shadow: 0 6px 20px rgba(145, 70, 255, 0.35);
}

.pricing-card.popular-tier:hover {
  transform: scale(1.02) translateY(-2px);
}

.pricing-card.popular-tier .plan-badge-top {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.feature-item:first-child {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.feature-item:first-child .check-icon {
  opacity: 0;
}

.feature-details {
  margin: 12px 0 16px 0;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.feature-details summary {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  list-style: none;
}

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

.detailed-features-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detailed-feature-item {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  padding-left: 8px;
}

.reassurance-text {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
  font-style: italic;
}

.check-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #10b981;
  margin-top: 1px;
}

.x-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--disabled-text);
  margin-top: 1px;
  opacity: 0.5;
}

.lock-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--disabled-text);
  margin-top: 1px;
  opacity: 0.4;
}

.feature-item.locked {
  opacity: 0.5;
  cursor: help;
}

.feature-item.locked span {
  color: var(--disabled-text);
}

.card-action {
  margin-top: auto;
  padding-top: 16px;
}

.roi-note {
  margin-bottom: 10px;
  font-size: 0.75rem;
  color: var(--muted-text);
  font-style: italic;
  line-height: 1.4;
}

.action-button {
  width: 100%;
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 48px;
}

@media (min-width: 768px) {
  .action-button {
    padding: 14px 24px;
  }
}

.action-button.primary {
  background: var(--accent);
  color: white;
}

.action-button.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.action-button.current {
  background: var(--bg);
  color: var(--disabled-text);
  cursor: not-allowed;
  border: 1px solid var(--border);
}

.action-button.disabled {
  background: var(--bg);
  color: var(--disabled-text);
  cursor: not-allowed;
  border: 1px solid var(--border);
  opacity: 0.7;
}

.cta-explainer {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

.action-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.action-button[href] {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.payment-history-section {
  margin-top: 24px;
  padding: 32px 16px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
}

@media (min-width: 768px) {
  .payment-history-section {
    margin: 32px 16px 0 16px;
    padding: 40px 24px;
  }
}

.section-heading {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}

.history-table {
  background: var(--color-bg-elevated);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border-default);
}

.table-header {
  display: grid;
  grid-template-columns: 100px 1fr 80px;
  grid-gap: 8px;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (min-width: 768px) {
  .table-header {
    grid-template-columns: 140px 1fr 120px;
    gap: 16px;
    padding: 16px 24px;
    font-size: 13px;
  }
}

.table-row {
  display: grid;
  grid-template-columns: 100px 1fr 80px;
  grid-gap: 8px;
  gap: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  border-top: 1px solid var(--border);
  transition: all 0.15s ease-in-out;
}

@media (min-width: 768px) {
  .table-row {
    grid-template-columns: 140px 1fr 120px;
    gap: 16px;
    padding: 16px 24px;
    font-size: 14px;
  }
}

.table-row:hover {
  background: var(--bg);
}

.table-row .amount {
  font-weight: 600;
  text-align: right;
}

@media (max-width: 414px) {
  .plan-badge-top {
    position: static;
    display: inline-block;
    margin-bottom: 12px;
  }

  .pricing-card:hover {
    transform: none;
  }
  
  .feature-item {
    font-size: 0.75rem;
  }
  
  .plan-name {
    font-size: 1.1rem;
  }
}

.easter-egg-banner {
  background: #ef4444;
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin: 0 24px 24px 24px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  animation: slideDown 0.3s ease-out;
  border: 2px solid #dc2626;
}

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

.billing-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  padding: 16px 24px;
  border-radius: 8px;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  animation: slideIn 0.3s ease-out;
}

.billing-toast-error {
  background-color: #ef4444;
}

.billing-toast-success {
  background-color: #10b981;
}

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

.addon-section {
  margin: 24px 16px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
  .addon-section {
    margin: 32px 24px;
  }
}

.addon-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 2px var(--shadow);
}

.addon-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .addon-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
  }
}

.addon-info h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px 0;
}

.addon-description {
  font-size: 14px;
  color: var(--muted-text);
  line-height: 1.5;
  margin: 0 0 12px 0;
}

.early-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.badge-text {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spots-remaining {
  font-weight: 400;
  opacity: 0.9;
}

.addon-pricing {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

@media (min-width: 768px) {
  .addon-pricing {
    align-items: flex-end;
  }
}

.price-toggle {
  display: flex;
  gap: 8px;
}

.price-btn {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
}

.price-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.price-btn .price {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.price-btn.active .price {
  color: white;
}

.price-btn .period {
  font-size: 12px;
  color: var(--muted-text);
  margin-top: 2px;
}

.price-btn.active .period {
  color: rgba(255, 255, 255, 0.8);
}

.annual-savings {
  font-size: 10px;
  font-weight: 600;
  color: #10b981;
  text-transform: uppercase;
  margin-top: 2px;
}

.price-btn.active .annual-savings {
  color: #86efac;
}

.addon-subscribe-btn {
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.addon-subscribe-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.addon-features {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.feature-list {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 12px;
  gap: 12px;
}

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

.addon-divider {
  border-top: 1px solid var(--border);
  margin: 12px 0 8px 0;
}

.streamdeck-addon {
  padding-left: 8px;
  cursor: help;
}

.addon-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.streamdeck-addon .addon-description {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.addon-price {
  font-size: 12px;
  color: var(--muted-text);
  font-style: italic;
}

@media (max-width: 768px) {
  .price-toggle {
    justify-content: center;
  }

  .billing-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .billing-toast {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

.founders-notice {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 0.75rem;
  color: #92400e;
  line-height: 1.4;
  font-weight: 500;
}

[data-theme="dark"] .founders-notice {
  background: #451a03;
  border-color: #f59e0b;
  color: #fef3c7;
}

.feature-group-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  margin-top: 8px;
}

.feature-group:first-child .feature-group-title {
  margin-top: 0;
}

.feature-item:last-child span {
  font-style: italic;
  opacity: 0.85;
}

.bits-explanation {
  text-align: center;
  padding: 16px 24px;
  margin: 0 16px 24px 16px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (min-width: 768px) {
  .bits-explanation {
    margin: 0 16px 32px 16px;
  }
}

.clip-usage-banner {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  padding: 16px 24px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  flex-wrap: wrap;
}

.usage-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.usage-label {
  font-size: 12px;
  color: var(--muted-text);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.usage-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

@media (max-width: 768px) {
  .clip-usage-banner {
    gap: 16px;
    padding: 12px 16px;
  }
  
  .usage-value {
    font-size: 18px;
  }
  
  .usage-label {
    font-size: 11px;
  }
}

.clip-packs-section {
  margin: 32px 16px;
  padding: 32px 24px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
}

.clip-packs-section .section-heading {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px 0;
}

.clip-packs-section .section-subtitle {
  font-size: 14px;
  color: var(--muted-text);
  margin: 0 0 24px 0;
}

.clip-packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 16px;
  gap: 16px;
}

.clip-pack-card {
  background: var(--color-bg-elevated);
  border: 2px solid var(--color-border-default);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.clip-pack-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pack-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.pack-clips {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.clips-amount {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.clips-label {
  font-size: 14px;
  color: var(--muted-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pack-bonus {
  font-size: 12px;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pack-base-value {
  font-size: 11px;
  color: var(--muted-text);
  font-weight: 400;
  opacity: 0.7;
}

.pack-expiry {
  font-size: 11px;
  color: var(--muted-text);
  font-weight: 500;
  margin-top: 4px;
}

.pack-buy-button {
  width: 100%;
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pack-buy-button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.pack-buy-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 768px) {
  .clip-packs-grid {
    grid-template-columns: 1fr;
  }
  
  .clip-packs-section {
    margin: 24px 16px;
    padding: 24px 16px;
  }
}

.price-display-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.clips-amount-base {
  font-size: 32px;
  font-weight: 600;
  color: var(--muted-text);
  line-height: 1;
  text-decoration: line-through;
  opacity: 0.6;
}

.clips-arrow {
  font-size: 24px;
  color: var(--accent);
  font-weight: 700;
  margin: 0 4px;
}

.clips-comparison {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  text-align: center;
}

.section-helper {
  font-size: 13px;
  color: var(--muted-text);
  margin: -16px 0 24px 0;
  font-style: italic;
}

/* Remove unwanted focus outlines */
.billing-redesign *:focus:not(button):not(a):not(input):not(select):not(textarea):not(details) {
  outline: none !important;
}

.popular-choice-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
  margin-top: 6px;
  text-align: center;
  letter-spacing: 0.3px;
}

[data-theme="dark"] .popular-choice-badge {
  background: rgba(99, 102, 241, 0.15);
}

.brand-value-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 8px;
  text-align: center;
  letter-spacing: 0.3px;
}

/* Brand tier visual dominance */
.pricing-card.popular-tier {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
  border: 2px solid var(--accent);
}

.pricing-card.popular-tier .price-amount {
  font-size: 2.75rem;
}

.pricing-card.popular-tier .plan-name {
  font-size: 1.75rem;
}

@media (max-width: 768px) {
  .pricing-card.popular-tier {
    transform: none;
  }
}

/* ─── Clip Packs ─────────────────────────────────── */
.clip-packs-section {
  margin-top: 48px;
  margin-bottom: 48px;
}

.clip-packs-header {
  text-align: center;
  margin-bottom: 28px;
}

.clip-packs-subtitle {
  font-size: 14px;
  color: #a1a1aa;
  color: var(--text-secondary, #a1a1aa);
  margin-top: 6px;
}

.clip-packs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 16px;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .clip-packs-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
  }
}

.clip-pack-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 0.2s, transform 0.2s;
}

.clip-pack-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.clip-pack-card.featured {
  border-color: rgba(145, 70, 255, 0.3);
  background: rgba(145, 70, 255, 0.04);
}

.clip-pack-card.featured:hover {
  border-color: rgba(145, 70, 255, 0.5);
}

.pack-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #9146ff, #772ce8);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 10px;
  white-space: nowrap;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.pack-clips {
  font-size: 36px;
  font-weight: 800;
  color: #f4f4f5;
  line-height: 1;
  letter-spacing: -0.02em;
}

.pack-clips-label {
  font-size: 13px;
  font-weight: 600;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  text-align: center;
}

.pack-base-clips {
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #52525b;
}

.pack-bonus {
  font-size: 11px;
  font-weight: 600;
  color: #a78bfa;
  background: rgba(145, 70, 255, 0.1);
  padding: 2px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
}

.pack-price {
  font-size: 22px;
  font-weight: 700;
  color: #f4f4f5;
  margin-top: 8px;
}

.pack-per-clip {
  font-size: 11px;
  color: #71717a;
  margin-bottom: 12px;
}

.pack-buy-btn {
  width: 100%;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f4f5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pack-buy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.clip-pack-card.featured .pack-buy-btn {
  background: linear-gradient(135deg, #9146ff, #772ce8);
  color: #fff;
}

.clip-pack-card.featured .pack-buy-btn:hover {
  background: linear-gradient(135deg, #a970ff, #8b4aff);
  box-shadow: 0 4px 12px rgba(145, 70, 255, 0.3);
}

/* StreamerDashboard — uses app design-system tokens */

/* ─── Layout ─────────────────────────────────────────── */
.streamer-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 0 64px;
}

.streamer-page-header {
  margin-bottom: 40px;
}

.streamer-page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.streamer-page-header p {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0;
}

/* ─── Tabs ───────────────────────────────────────────── */
.streamer-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border-default);
  margin-bottom: 32px;
}

.streamer-tab {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

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

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

/* ─── Onboarding stepper ─────────────────────────────── */
.onboarding-progress {
  height: 2px;
  background: var(--color-border-default);
  border-radius: 2px;
  margin-bottom: 32px;
  overflow: hidden;
}

.onboarding-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--color-bg-elevated);
  border: none;
  border-radius: 10px;
}

.step-card.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.step-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.step-indicator.done {
  background: var(--color-status-success);
  color: #000;
}

.step-indicator.current {
  background: var(--accent);
  color: #fff;
}

.step-indicator.pending {
  background: var(--color-border-default);
  color: var(--color-text-muted);
}

.step-body {
  flex: 1 1;
  min-width: 0;
}

.step-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 2px;
}

.step-body p {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
}

.step-action {
  flex-shrink: 0;
  align-self: center;
}

/* ─── Price grid (inside step) ───────────────────────── */
.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 8px;
  gap: 8px;
  margin-top: 14px;
}

.price-option {
  position: relative;
  padding: 10px 0;
  border-radius: 8px;
  border: none;
  background: var(--color-bg-surface);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}

.price-option:hover {
  background: var(--color-bg-page);
}

.price-option.selected {
  background: rgba(145, 70, 255, 0.15);
  color: var(--color-text-primary);
  font-weight: 600;
}

.price-badge {
  position: absolute;
  top: -7px;
  right: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

.price-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 10px;
}

/* ─── Permission selector ────────────────────────────── */
.permission-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 8px;
  gap: 8px;
}

.permission-option {
  padding: 10px 0;
  border-radius: 8px;
  border: none;
  background: var(--color-bg-surface);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}

.permission-option:hover {
  background: var(--color-bg-page);
}

.permission-option.selected {
  background: rgba(145, 70, 255, 0.15);
  color: var(--color-text-primary);
  font-weight: 600;
}

.permission-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Connection cards ───────────────────────────────── */
.connections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 16px;
  gap: 16px;
  margin-bottom: 24px;
}

.connection-card {
  padding: 24px;
  background: var(--color-bg-elevated);
  border: none;
  border-radius: 10px;
}

.connection-card-icon {
  font-size: 32px;
  margin-bottom: 14px;
  line-height: 1;
}

.connection-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 10px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.connection-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.connection-status .dot.green { background: var(--color-status-success); }
.connection-status .dot.yellow { background: var(--color-status-warning); }

.connection-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ─── Link box ───────────────────────────────────────── */
.link-box {
  padding: 20px;
  background: var(--color-bg-elevated);
  border: none;
  border-radius: 10px;
}

.link-box-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.link-box-row {
  display: flex;
  gap: 10px;
}

.link-box-input {
  flex: 1 1;
  background: var(--color-bg-surface);
  border: none;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--color-text-primary);
  font-size: 14px;
  font-family: inherit;
}

.link-box-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 8px;
}

/* ─── Metric cards ───────────────────────────────────── */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 16px;
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  padding: 24px;
  background: var(--color-bg-elevated);
  border: none;
  border-radius: 10px;
}

.metric-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.metric-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ─── Payout info card ───────────────────────────────── */
.payout-card {
  padding: 20px;
  background: var(--color-bg-elevated);
  border: none;
  border-radius: 10px;
}

.payout-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.payout-detail {
  font-size: 13px;
  color: var(--color-text-muted);
}

.payout-cta {
  text-align: center;
  padding: 32px 20px;
}

.payout-cta p {
  color: var(--color-text-muted);
  font-size: 14px;
  margin: 0 0 16px;
}

/* ─── Earnings explainer ─────────────────────────────── */
.earnings-explainer {
  margin-top: 24px;
  padding: 24px;
  background: var(--color-bg-elevated);
  border-radius: 10px;
}

.earnings-explainer h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 16px;
}

.earnings-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.earnings-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.earnings-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(145, 70, 255, 0.15);
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.earnings-step-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.earnings-step-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ─── Streaming panel ────────────────────────────────── */
.streaming-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.streaming-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.status-pill.active {
  background: rgba(0, 245, 147, 0.12);
  color: var(--color-status-success);
}

.status-pill.inactive {
  background: rgba(248, 113, 113, 0.12);
  color: var(--color-status-error);
}

.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.streaming-grid {
  display: grid;
  grid-template-columns: 5fr 3fr;
  grid-gap: 20px;
  gap: 20px;
}

.streaming-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.streaming-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aside-card {
  padding: 20px;
  background: var(--color-bg-elevated);
  border: none;
  border-radius: 10px;
}

.aside-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.aside-empty {
  font-size: 13px;
  color: var(--color-text-disabled);
}

.aside-stat-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.aside-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

/* Inactive state */
.inactive-state {
  text-align: center;
  padding: 64px 24px;
  background: var(--color-bg-elevated);
  border: none;
  border-radius: 10px;
}

.inactive-state-icon {
  font-size: 40px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.inactive-state h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 6px;
}

.inactive-state p {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 24px;
}

/* ─── Shared button overrides ────────────────────────── */
.streamer-page .btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.streamer-page .btn-accent {
  background: var(--accent);
  color: #fff;
}

.streamer-page .btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
}

.streamer-page .btn-accent:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.streamer-page .btn-outline {
  background: var(--color-bg-surface);
  border: none;
  color: var(--color-text-secondary);
}

.streamer-page .btn-outline:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

/* ─── Toast ──────────────────────────────────────────── */
.streamer-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1002;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  animation: toastIn 0.25s ease-out;
}

.streamer-toast.success { background: #059669; }
.streamer-toast.error { background: #dc2626; }

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

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .streamer-page { padding: 0 0 48px; }
  .connections-grid { grid-template-columns: 1fr; }
  .metrics-row { grid-template-columns: 1fr; }
  .streaming-grid { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: repeat(3, 1fr); }
  .permission-grid { grid-template-columns: repeat(2, 1fr); }
  .streamer-page-header h1,
  .streaming-header h1 { font-size: 22px; }
}

@media (max-width: 480px) {
  .streaming-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

.btn-sm.btn-muted {
  padding: 6px 14px;
  background: var(--color-bg-surface);
  color: var(--color-text-muted);
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sm.btn-muted:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-elevated);
}

.btn-sm.btn-danger {
  padding: 6px 14px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-sm.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

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

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

.faq-container {
  min-height: 100vh;
  background: var(--color-bg-page);
  padding: 32px 16px;
}

.faq-content {
  max-width: 900px;
  margin: 0 auto;
}

.faq-back-button {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.faq-back-button:hover {
  background: var(--bg);
  border-color: var(--accent);
}

.faq-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  padding: 32px 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
  .faq-card {
    padding: 48px 40px;
  }
}

[data-theme="dark"] .faq-card {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.faq-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  text-align: center;
}

.faq-subtitle {
  color: var(--muted-text);
  text-align: center;
  margin-bottom: 30px;
  font-size: 16px;
}

.faq-categories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 30px;
}

.faq-category-button {
  background: var(--bg);
  color: var(--muted-text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.faq-category-button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
}

.faq-category-button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.faq-category-button.active:hover {
  background: var(--accent);
  color: white;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
}

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

.faq-question-button {
  width: 100%;
  padding: 20px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question-button:hover {
  background: var(--card-bg);
}

.faq-arrow {
  font-size: 14px;
  transition: transform 0.2s;
  transform: rotate(0deg);
  color: var(--muted-text);
}

.faq-arrow.open {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq-answer {
  padding: 0 20px 20px 20px;
  color: var(--muted-text);
  font-size: 14px;
  line-height: 1.7;
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 20px;
}

.faq-list-ol {
  margin-left: 20px;
  margin-top: 10px;
}

.faq-list-ul {
  margin-left: 20px;
  margin-top: 10px;
}

.faq-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.faq-link:hover {
  text-decoration: underline;
}

.faq-note {
  margin-top: 10px;
}

.faq-contact {
  margin-top: 40px;
  padding: 24px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  text-align: center;
}

.faq-contact h3 {
  color: var(--text);
  margin-bottom: 10px;
  font-weight: 600;
}

.faq-contact p {
  color: var(--muted-text);
  margin-bottom: 15px;
}

.faq-settings-button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.faq-settings-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.faq-search {
  margin: 24px 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.faq-search-input {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  background: var(--color-bg-elevated);
  color: var(--text);
  transition: all 0.2s;
}

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

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

.faq-no-results {
  text-align: center;
  color: var(--muted-text);
  padding: 40px 20px;
  font-size: 16px;
}

.subscription-required-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem;
  text-align: center;
}

.subscription-required-title {
  margin-bottom: 1rem;
}

.subscription-required-description {
  max-width: 500px;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.7);
}

.subscription-required-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.subscription-required-primary-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}

.subscription-required-secondary-btn {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

.subscription-required-tertiary-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

.subscription-required-primary-btn:hover,
.subscription-required-secondary-btn:hover,
.subscription-required-tertiary-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  transition: all 0.2s ease;
}
.login-container {
  min-height: 100vh;
  background-color: var(--bg-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.login-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 3rem 0;
}

.login-content {
  display: grid;
  grid-template-columns: 1fr 420px;
  grid-gap: 5rem;
  gap: 5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

.login-left-section {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 2rem;
  background-color: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-medium);
}

.login-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-medium);
  margin-bottom: 0;
}

.login-logo {
  display: flex;
  align-items: center;
}

.login-logo-image {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.login-nav-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 8px;
  transition: all 0.2s;
  background-color: var(--bg-primary);
  border: 2px solid #dc2626;
  font-size: 14px;
}

.login-nav-link:hover {
  background-color: #dc2626;
  color: #ffffff;
}

.login-title {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.login-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.7;
  font-weight: 400;
}

.login-features {
  margin: 0;
}

.login-features-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1.5rem 0;
  letter-spacing: -0.025em;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 1.25rem;
  gap: 1.25rem;
}

.login-feature-card {
  padding: 1.25rem;
  background-color: var(--bg-primary);
  border-radius: 12px;
  border: 1px solid var(--border-medium);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.login-feature-card:hover {
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.login-feature-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.login-feature-description {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
  font-weight: 400;
}

.login-right-section {
  display: flex;
  align-items: flex-start;
}

.login-card {
  background-color: var(--bg-secondary);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 2px solid var(--border-medium);
  width: 100%;
  position: relative;
}

.login-logo-section {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 0;
  border-bottom: none;
}

.login-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.login-logo-svg {
  width: 32px;
  height: 32px;
  color: white;
}

.login-card-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  letter-spacing: -0.025em;
  border: none !important;
  background: transparent !important;
  padding: 0;
}

.login-card-subtitle {
  color: var(--text-muted);
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  border: none !important;
  background: transparent !important;
  padding: 0;
}



.login-twitch-button {
  background: linear-gradient(135deg, #9146ff 0%, #7c3aed 100%);
  color: #ffffff !important;
  border: none;
  border-radius: 12px;
  padding: 18px 24px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  transition: all 0.2s;
  margin-bottom: 2.5rem;
  box-shadow: 0 6px 16px rgba(145, 70, 255, 0.3);
  min-height: 52px;
  letter-spacing: 0.025em;
}

.login-twitch-button span {
  color: #ffffff !important;
}

.login-twitch-button:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(145, 70, 255, 0.35);
}

.login-twitch-button:focus {
  outline: 2px solid #9146ff;
  outline-offset: 2px;
}

.login-twitch-icon {
  width: 20px;
  height: 20px;
}

.login-footer {
  border-top: 2px solid var(--border-medium);
  padding-top: 2rem;
  margin-top: 0.5rem;
}

.login-privacy-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.6;
  text-align: center;
  font-weight: 500;
}

.login-security-text {
  font-size: 0.875rem;
  color: #047857;
  margin: 0;
  text-align: center;
  padding: 1rem;
  background-color: #ecfdf5;
  border-radius: 10px;
  border: 1px solid #a7f3d0;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.login-link {
  color: #dc2626;
  text-decoration: underline;
  font-weight: 700;
  transition: color 0.2s;
}

.login-link:hover {
  color: #b91c1c;
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-content {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 0 1.5rem;
  }
  
  .login-left-section {
    padding: 1.5rem;
  }
  
  .login-title {
    font-size: 2.25rem;
  }
  
  .login-feature-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .login-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
  }
  
  .login-card {
    padding: 2.5rem 2rem;
    border-radius: 16px;
  }
}

@media (max-width: 480px) {
  .login-main {
    padding: 1.5rem 0;
  }
  
  .login-content {
    padding: 0 1rem;
    gap: 2rem;
  }
  
  .login-left-section {
    padding: 1.25rem;
  }
  
  .login-title {
    font-size: 1.875rem;
  }
  
  .login-card {
    padding: 2rem 1.5rem;
    border-radius: 16px;
  }
}

/* Accessibility improvements */
@media (prefers-contrast: high) {
  .login-card {
    border: 2px solid #000000;
  }
  
  .login-twitch-button {
    border: 2px solid #9146ff;
  }
  
  .login-feature-card {
    border: 2px solid #374151;
  }
  
  .login-left-section {
    border: 2px solid #374151;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-twitch-button,
  .login-nav-link,
  .login-feature-card {
    transition: none;
  }
  
  .login-twitch-button:hover {
    transform: none;
  }
}

/* Focus states for accessibility */
.login-logo:focus,
.login-nav-link:focus,
.login-link:focus {
  outline: 3px solid #dc2626;
  outline-offset: 2px;
  border-radius: 4px;
}

.login-twitch-button:focus {
  outline: 3px solid #9146ff;
  outline-offset: 3px;
}


.oauth-info-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 20px;
}

.oauth-container {
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  color: #e0e0e0;
}

.oauth-container h1 {
  color: #9147ff;
  font-size: 2.5em;
  margin-bottom: 10px;
}

.oauth-container .subtitle {
  font-size: 1.2em;
  color: #b0b0b0;
  margin-bottom: 30px;
}

.oauth-container section {
  margin-bottom: 30px;
}

.oauth-container h2 {
  color: #a970ff;
  font-size: 1.8em;
  margin-top: 30px;
  margin-bottom: 15px;
  border-bottom: 2px solid rgba(145, 71, 255, 0.3);
  padding-bottom: 10px;
}

.oauth-container h3 {
  color: #b89fff;
  font-size: 1.3em;
  margin-top: 20px;
  margin-bottom: 10px;
}

.oauth-container p {
  margin-bottom: 15px;
  font-size: 1.1em;
  line-height: 1.6;
}

.oauth-container ul,
.oauth-container ol {
  margin-left: 30px;
  margin-bottom: 15px;
}

.oauth-container li {
  margin-bottom: 10px;
  font-size: 1.05em;
}

.highlight {
  background: rgba(145, 71, 255, 0.2);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #9147ff;
  margin: 20px 0;
}

.oauth-container a {
  color: #8ab4ff;
  text-decoration: none;
  font-weight: 600;
}

.oauth-container a:hover {
  text-decoration: underline;
}

.links {
  display: flex;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.link-button {
  display: inline-block;
  padding: 12px 24px;
  background: #9147ff;
  color: white !important;
  border-radius: 8px;
  text-decoration: none !important;
  font-weight: 600;
  transition: all 0.2s;
}

.link-button:hover {
  background: #a970ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(145, 71, 255, 0.4);
}

.scope-list {
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
}

.scope-list code {
  color: #ffa500;
  font-family: "Courier New", monospace;
  font-size: 0.95em;
}

.footer-note {
  margin-top: 40px;
}

.footer-note p {
  margin-bottom: 0;
}

.legal-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 60px 80px;
  background: #ffffff;
  color: #1f2937;
  line-height: 1.8;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.legal-container h1 {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 30px;
  letter-spacing: 1px;
  color: #111827;
  border-bottom: 3px solid #e5e7eb;
  padding-bottom: 20px;
}

.legal-container h2 {
  font-size: 20px;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 20px;
  color: #111827;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-left: 4px solid #6366f1;
  padding-left: 16px;
}

.legal-container h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 30px;
  margin-bottom: 15px;
  color: #374151;
}

.legal-container p {
  margin-bottom: 16px;
  text-align: justify;
  color: #4b5563;
}

.legal-container strong {
  color: #111827;
  font-weight: 600;
}

.legal-intro {
  margin-top: 30px;
  margin-bottom: 30px;
  padding: 20px;
  background: #f3f4f6;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  color: #111827;
  line-height: 1.6;
}

.legal-indent {
  margin-left: 40px;
  padding-left: 20px;
  border-left: 2px solid #e5e7eb;
  margin-bottom: 12px;
}

.legal-footer {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 2px solid #e5e7eb;
  font-style: italic;
  text-align: center;
  font-size: 14px;
  color: #6b7280;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .legal-container {
    margin: 20px;
    padding: 40px 30px;
    font-size: 15px;
  }

  .legal-container h1 {
    font-size: 26px;
  }

  .legal-container h2 {
    font-size: 18px;
    margin-top: 30px;
  }

  .legal-container h3 {
    font-size: 16px;
  }

  .legal-indent {
    margin-left: 20px;
    padding-left: 15px;
  }

  .legal-intro {
    padding: 15px;
    font-size: 14px;
  }
}

.not-found-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  text-align: center;
}

.not-found-title {
  font-size: 72px;
  margin: 0;
  color: var(--text);
}

.not-found-subtitle {
  font-size: 24px;
  margin-top: 20px;
  color: var(--text);
}

.not-found-description {
  margin-top: 10px;
  color: var(--muted-text);
}

.not-found-link {
  margin-top: 30px;
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s;
}

.not-found-link:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.viewer-login-container {
  min-height: 100vh;
  background-color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.viewer-login-main {
  width: 100%;
  max-width: 400px;
}

.viewer-login-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.viewer-login-logo-image {
  height: 36px;
  width: auto;
}

.viewer-login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.viewer-login-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.viewer-login-error {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.85rem;
  text-align: center;
}

.viewer-login-twitch-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  background: #9146ff;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.viewer-login-twitch-btn:hover {
  background: #7c3aed;
}

.viewer-login-twitch-btn svg {
  width: 20px;
  height: 20px;
}

.viewer-login-footer {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.viewer-login-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.viewer-login-link:hover {
  text-decoration: underline;
}

/* ─── Live page — full viewport layout ───────────────── */
.live-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #0e0e10;
  color: #efeff1;
  overflow: hidden;
}

/* ─── Top bar ────────────────────────────────────────── */
.live-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  height: 50px;
  background: #18181b;
  border-bottom: 1px solid #2f2f35;
  flex-shrink: 0;
  z-index: 10;
}

.live-logo-img {
  height: 24px;
  width: auto;
  display: block;
}

.live-channel-name {
  font-size: 15px;
  font-weight: 600;
  color: #efeff1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-balance-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #2f2f35;
  border: 1px solid #3f3f46;
  border-radius: 20px;
  padding: 5px 14px;
  color: #efeff1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
}
.live-balance-pill:hover { border-color: #9146ff; }

.live-sign-in {
  font-size: 13px;
  font-weight: 600;
  color: #bf94ff;
  text-decoration: none;
  padding: 5px 14px;
  border: 1px solid #9146ff;
  border-radius: 20px;
  transition: background 0.15s;
}
.live-sign-in:hover { background: rgba(145, 70, 255, 0.15); }

.live-chat-toggle {
  background: none;
  border: 1px solid #3f3f46;
  color: #adadb8;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.live-chat-toggle:hover { color: #efeff1; border-color: #53535f; }

/* ─── Content area — video + chat ────────────────────── */
.live-content {
  flex: 1 1;
  display: flex;
  min-height: 0;
}

.live-video-wrap {
  flex: 1 1;
  position: relative;
  background: #000;
  min-width: 0;
}

.live-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.live-chat-wrap {
  width: 340px;
  flex-shrink: 0;
  border-left: 1px solid #2f2f35;
  background: #18181b;
}

.live-chat {
  width: 100%;
  height: 100%;
  border: none;
}

.live-content.chat-hidden .live-video-wrap {
  flex: 1 1;
}

/* ─── Clip bar ───────────────────────────────────────── */
.live-clip-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: #18181b;
  border-top: 1px solid #2f2f35;
  flex-shrink: 0;
  position: relative;
}

.live-clip-error {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 6px;
  white-space: nowrap;
  animation: fadeSlideUp 0.2s ease-out;
}

.live-clip-btn {
  background: #9146ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  min-width: 180px;
}
.live-clip-btn:hover:not(:disabled) { background: #772ce8; }
.live-clip-btn:active:not(:disabled) { transform: scale(0.97); }
.live-clip-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.live-clip-btn.success { background: #00c853; }

.live-buy-btn {
  background: transparent;
  border: 1px solid #3f3f46;
  color: #adadb8;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.live-buy-btn:hover { border-color: #9146ff; color: #efeff1; }

/* ─── Purchase drawer ────────────────────────────────── */
.live-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.15s ease-out;
}

.live-drawer {
  background: #1f1f23;
  border-radius: 14px 14px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease-out;
}

.live-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.live-drawer-header h2 { margin: 0; font-size: 18px; font-weight: 700; }

.live-drawer-close {
  background: none;
  border: none;
  color: #adadb8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.live-drawer-sub {
  color: #adadb8;
  font-size: 13px;
  margin: 0 0 20px;
}

/* Pack cards */
.live-pack-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.live-pack {
  position: relative;
  background: #2f2f35;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  color: #efeff1;
  transition: border-color 0.15s;
}
.live-pack:hover { border-color: #53535f; }
.live-pack.selected { border-color: #9146ff; }

.live-pack-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  background: #9146ff;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

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

.live-pack-name { font-weight: 600; font-size: 14px; }
.live-pack-price { font-size: 14px; color: #adadb8; }
.live-pack-credits { font-size: 13px; color: #bf94ff; font-weight: 500; }

.live-purchase-btn {
  width: 100%;
  background: #9146ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.live-purchase-btn:hover:not(:disabled) { background: #772ce8; }
.live-purchase-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Transaction history in drawer */
.live-tx-section {
  margin-top: 20px;
  border-top: 1px solid #2f2f35;
  padding-top: 16px;
}

.live-tx-label {
  font-size: 11px;
  font-weight: 600;
  color: #adadb8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.live-tx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid #2f2f35;
}
.live-tx-row:last-child { border-bottom: none; }

.live-tx-amount { font-weight: 700; min-width: 48px; }
.live-tx-amount.purchase { color: #00c853; }
.live-tx-amount.spend { color: #f85149; }
.live-tx-desc { flex: 1 1; color: #adadb8; }
.live-tx-date { color: #71717a; font-size: 12px; }

/* ─── Animations ─────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .live-chat-wrap {
    display: none;
  }

  .live-content.chat-hidden .live-chat-wrap {
    display: none;
  }

  .live-chat-toggle {
    display: none;
  }

  .live-clip-btn {
    min-width: 140px;
    padding: 10px 20px;
    font-size: 13px;
  }

  .live-buy-btn {
    padding: 10px 14px;
    font-size: 12px;
  }

  .live-drawer {
    max-width: 100%;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .live-chat-wrap {
    width: 280px;
  }
}

/* ─── Stripe checkout form ───────────────────────────── */
.live-checkout-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.live-clip-notice {
  font-size: 13px;
  color: #adadb8;
  padding: 4px 0;
}

/* Color System - Light & Dark Mode Support */

:root {
  /* Dark Mode Colors (Default) */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-muted: #94a3b8;
  
  --border-light: #334155;
  --border-medium: #475569;
  --border-strong: #64748b;
  
  --accent: #818cf8;
  --accent-hover: #6366f1;
  
  --success: #34d399;
  --success-bg: #064e3b;
  --warning: #fbbf24;
  --warning-bg: #78350f;
  --error: #f87171;
  --error-bg: #7f1d1d;
  
  --color-hover: #1e293b;
  --color-border-strong: #64748b;
  
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-md: rgba(0, 0, 0, 0.4);
  --shadow-lg: rgba(0, 0, 0, 0.5);
}

/* Dark Mode Colors */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  
  --border-light: #334155;
  --border-medium: #475569;
  --border-strong: #64748b;
  
  --accent: #818cf8;
  --accent-hover: #6366f1;
  
  --success: #34d399;
  --success-bg: #064e3b;
  --warning: #fbbf24;
  --warning-bg: #78350f;
  --error: #f87171;
  --error-bg: #7f1d1d;
  
  --color-hover: #1e293b;
  --color-border-strong: #64748b;
  
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-md: rgba(0, 0, 0, 0.4);
  --shadow-lg: rgba(0, 0, 0, 0.5);
}

/* Base Styles */
html {
  background-color: #0f172a;
  background-color: var(--bg-primary);
  color: #f8fafc;
  color: var(--text-primary);
}

body {
  background-color: #0f172a;
  background-color: var(--bg-primary);
  color: #f8fafc;
  color: var(--text-primary);
  font-weight: 500; /* Increase base font weight for better contrast */
}
/* CSS Architecture - Z-Index Management & Performance Variables */

:root {
  /* Z-Index Hierarchy - Centralized Management */
  /* Layering: banner > modal > toast > help-fab > help-widget > mobile-nav > mobile-overlay > sidebar > content */
  --z-sidebar: 100;
  --z-mobile-overlay: 99;
  --z-mobile-nav: 100;
  --z-help-fab: 1000;
  --z-help-widget: 999;
  --z-toast: 9999;
  --z-banner: 10000;
  --z-modal: 10001;
  
  /* Performance-Optimized Transitions */
  --transition-fast: background-color 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
  --transition-transform: transform 0.15s ease-out;
  --transition-opacity: opacity 0.15s ease-out;
  --transition-layout: padding 0.15s ease-out, margin 0.15s ease-out;
  
  /* Touch Target Standards */
  --touch-target-min: 44px;
  --touch-target-mobile: 48px;
  
  /* Responsive Breakpoints */
  --bp-xs: 375px;
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
}

/* Scoped Base Styles - Avoid Global Pollution */

.app-shell button,
.app-shell [class*="-button"],
.app-shell [class*="-btn"] {
  color: var(--text-primary);
  transition: background-color 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
  transition: var(--transition-fast);
  min-height: 44px;
  min-height: var(--touch-target-min);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  touch-action: manipulation;
}

.app-shell button:hover:not(:disabled),
.app-shell [class*="-button"]:hover:not(:disabled) {
  filter: brightness(0.95);
}

.app-shell button:active:not(:disabled),
.app-shell [class*="-button"]:active:not(:disabled) {
  filter: brightness(0.9);
}

/* Scoped card styles */
.app-shell [class*="-card"],
.app-shell .card {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  transition: background-color 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out, transform 0.15s ease-out;
  transition: var(--transition-fast), var(--transition-transform);
}

/* Scoped form elements */
.app-shell input,
.app-shell textarea,
.app-shell select {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  font-size: 16px; /* iOS zoom prevention */
  min-height: 44px;
  min-height: var(--touch-target-min);
  padding: 12px 16px;
  border-radius: 6px;
  transition: background-color 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
  transition: var(--transition-fast);
}

.app-shell input:focus,
.app-shell textarea:focus,
.app-shell select:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Responsive Overrides - Desktop */
@media (min-width: 768px) {
  .app-shell button,
  .app-shell [class*="-button"],
  .app-shell [class*="-btn"] {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 14px;
  }
  
  .app-shell input,
  .app-shell textarea,
  .app-shell select {
    font-size: 14px;
    min-height: 40px;
    padding: 8px 12px;
  }
}

/* Performance - Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
  .app-shell * {
    transition: none !important;
    animation: none !important;
  }
}
/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -100px;
  left: 6px;
  background: #6366f1;
  background: var(--accent, #6366f1);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  z-index: 10000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible styles for better keyboard navigation */
*:focus-visible {
  outline: 2px solid #6366f1;
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 2px;
}

.App {
  min-height: 100vh;
  width: 100%;
  background: transparent;
}

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

/* Mobile-first responsive design */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* Ensure minimum touch target size (44px) */
button, 
a, 
input[type="button"], 
input[type="submit"], 
.clickable {
  min-height: 44px;
  min-width: 44px;
}

/* Improve tap targets on mobile */
@media (max-width: 768px) {
  button, 
  a, 
  input[type="button"], 
  input[type="submit"], 
  .clickable {
    min-height: 48px;
    padding: 12px 16px;
  }
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  color: var(--text-primary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-medium);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

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

.logo h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.logo p {
  color: var(--text-tertiary);
  margin-bottom: 32px;
}

.nav-menu {
  list-style: none;
  margin-bottom: 32px;
}

.nav-menu li {
  margin-bottom: 8px;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-tertiary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s ease-in-out;
  font-weight: 500;
  border-left: 4px solid transparent;
  margin-left: -4px;
}

.nav-menu a:hover {
  background: var(--color-hover);
  color: var(--text-primary);
}

.nav-menu a.active {
  background: var(--color-hover);
  color: var(--accent);
  font-weight: 700;
  border-left-color: var(--accent);
}

.subscription-badge {
  margin-top: auto;
}

.plan-badge {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.plan-badge.free {
  background: #f3f4f6;
  color: #374151;
}
.plan-badge.starter {
  background: #d1fae5;
  color: #065f46;
}
.plan-badge.pro {
  background: #dbeafe;
  color: #1e3a8a;
}
.plan-badge.unlimited {
  background: #fef3c7;
  color: #78350f;
}

[data-theme="dark"] .plan-badge.free {
  background: #374151;
  color: #d1d5db;
}
[data-theme="dark"] .plan-badge.starter {
  background: #064e3b;
  color: #6ee7b7;
}
[data-theme="dark"] .plan-badge.pro {
  background: #1e3a8a;
  color: #93c5fd;
}
[data-theme="dark"] .plan-badge.unlimited {
  background: #78350f;
  color: #fcd34d;
}

.logout-button {
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  color: #991b1b;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.logout-button:hover {
  background: #fee2e2;
  border-color: #f87171;
}

[data-theme="dark"] .logout-button {
  background: #7f1d1d;
  border-color: #991b1b;
  color: #fca5a5;
}

[data-theme="dark"] .logout-button:hover {
  background: #991b1b;
  border-color: #dc2626;
}

.main-content {
  flex: 1 1;
  padding: 12px;
  overflow-y: auto;
  width: 100%;
  min-width: 0;
  margin-left: 0;
  background: transparent;
  padding-top: 80px; /* Account for mobile header */
}

@media (min-width: 480px) {
  .main-content {
    padding: 16px;
    padding-top: 80px;
  }
}

@media (min-width: 768px) {
  .main-content {
    padding: 24px;
    margin-left: 250px;
    padding-top: 24px;
  }
}

@media (min-width: 1024px) {
  .main-content {
    padding: 32px;
  }
}

.content-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 8px;
  width: 100%;
}

@media (min-width: 480px) {
  .content-container {
    padding: 0 16px;
  }
}

@media (min-width: 768px) {
  .content-container {
    padding: 0 24px;
  }
}

.overview h1 {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

@media (min-width: 480px) {
  .overview h1 {
    font-size: 24px;
  }
}

@media (min-width: 768px) {
  .overview h1 {
    font-size: 28px;
  }
}

.section-heading {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  grid-gap: 24px;
  gap: 24px;
}

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

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.overview-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .overview-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
  }
}

.overview-subtitle {
  color: var(--text-tertiary);
  font-size: 15px;
  margin-top: 4px;
}

.tier-badge-header {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid var(--color-border-strong);
  color: var(--text-secondary);
}

.section-title {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.section-title-spaced {
  margin-top: 32px;
}

.performance-section {
  margin-bottom: 40px;
}

.metrics-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 12px;
  gap: 12px;
  box-shadow: 0 1px 2px var(--shadow);
  transition: all 0.15s ease-in-out;
}

@media (min-width: 480px) {
  .metrics-bar {
    padding: 16px;
    gap: 16px;
    border-radius: 12px;
  }
}

@media (min-width: 768px) {
  .metrics-bar {
    padding: 24px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 32px;
  }
}

[data-theme="dark"] .metrics-bar {
  box-shadow: none;
}

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

.metric-label {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.metric-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
}

@media (min-width: 480px) {
  .metric-value {
    font-size: 24px;
  }
}

@media (min-width: 768px) {
  .metric-value {
    font-size: 32px;
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 24px;
  gap: 24px;
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1.5fr 1fr;
    gap: 32px;
  }
}

.actions-section,
.tier-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 2px var(--shadow);
  transition: all 0.15s ease-in-out;
}

[data-theme="dark"] .actions-section,
[data-theme="dark"] .tier-section {
  box-shadow: none;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--color-hover);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.15s ease-in-out;
  border: 1px solid var(--border-medium);
}

.action-item:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 2px 8px var(--shadow-md);
}

.action-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.action-content p {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

.action-arrow {
  font-size: 18px;
  color: var(--text-tertiary);
  transition: transform 0.2s;
}

.action-item:hover .action-arrow {
  transform: translateX(4px);
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-item {
  padding: 12px 16px;
  background: var(--color-hover);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-primary);
  border-left: 3px solid var(--border-medium);
}

.upgrade-notice {
  margin-top: 8px;
  padding: 12px 16px;
  background: #eef2ff;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  font-size: 13px;
  color: #4338ca;
  font-weight: 500;
}

.upgrade-notice.success {
  background: var(--success-bg);
  border-left-color: var(--success);
  color: #065f46;
}

[data-theme="dark"] .upgrade-notice {
  background: #312e81;
  color: #c7d2fe;
}

[data-theme="dark"] .upgrade-notice.success {
  background: var(--success-bg);
  color: #6ee7b7;
}

.feature-disclaimer {
  margin-top: 8px;
  padding: 12px 16px;
  background: var(--color-hover);
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
}

@media (max-width: 374px) {
  .metric-value {
    font-size: 18px;
  }
  
  .metric-label {
    font-size: 11px;
  }
  
  .overview h1 {
    font-size: 18px;
  }
  
  .content-container {
    padding: 0 4px;
  }
  
  .main-content {
    padding: 8px;
    padding-top: 80px;
  }
}

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  padding: 24px;
  border-radius: 16px;
  color: var(--text-primary);
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 4px 12px var(--shadow-lg);
}

@media (min-width: 768px) {
  .login-card {
    padding: 48px;
  }
}

.login-card h1 {
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .login-card h1 {
    font-size: 32px;
  }
}

.login-card p {
  color: var(--text-tertiary);
  margin-bottom: 32px;
}

.twitch-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  background: #9146ff;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  width: 100%;
  min-height: 52px;
  font-size: 16px;
  touch-action: manipulation;
}

@media (min-width: 768px) {
  .twitch-login-btn {
    width: auto;
    padding: 16px 32px;
    font-size: 14px;
  }
}

.twitch-login-btn:hover {
  background: #772ce8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(145, 70, 255, 0.3);
}

.clips-container {
  color: var(--text-primary);
}

.clips-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .clips-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.clips-header h1 {
  font-size: 24px;
}

@media (min-width: 768px) {
  .clips-header h1 {
    font-size: 32px;
  }
}

.clips-header select {
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 16px; /* Prevent zoom on iOS */
  cursor: pointer;
  width: 100%;
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"%23666\" d=\"M2 0L0 2h4zm0 5L0 3h4z\"/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 40px;
}

@media (min-width: 768px) {
  .clips-header select {
    width: auto;
    padding: 8px 12px;
    padding-right: 32px;
    min-height: 44px;
    font-size: 14px;
  }
}

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

.clips-header select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.clips-grid {
  display: grid;
  grid-gap: 16px;
  gap: 16px;
}

.clip-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 1px 2px var(--shadow);
  transition: all 0.15s ease-in-out;
}

.clip-card:hover {
  box-shadow: 0 4px 12px var(--shadow-md);
  transform: translateY(-2px);
}

[data-theme="dark"] .clip-card {
  box-shadow: none;
}

[data-theme="dark"] .clip-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.clip-info h3 {
  margin-bottom: 8px;
}

.clip-meta {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.clip-status {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  border: 1px solid transparent;
}

.status-pending {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fcd34d;
}
.status-processing {
  background: #dbeafe;
  color: #1e3a8a;
  border: 1px solid #93c5fd;
}
.status-uploaded {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.status-failed {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

[data-theme="dark"] .status-pending {
  background: #78350f;
  color: #fcd34d;
  border-color: #d97706;
}
[data-theme="dark"] .status-processing {
  background: #1e3a8a;
  color: #93c5fd;
  border-color: #3b82f6;
}
[data-theme="dark"] .status-uploaded {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #10b981;
}
[data-theme="dark"] .status-failed {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: #ef4444;
}

.clip-video {
  width: 100%;
  max-height: 300px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.youtube-link {
  color: #10b981;
  font-size: 14px;
}

.clip-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.approve-button,
.reject-button {
  flex: 1 1;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
}

.approve-button {
  background: #10b981;
}

.approve-button:hover {
  background: #059669;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.approve-button:focus {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

.approve-button:disabled {
  background: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
  box-shadow: none;
}

.reject-button {
  background: #ef4444;
}

.reject-button:hover {
  background: #dc2626;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.reject-button:focus {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

.reject-button:disabled {
  background: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
  box-shadow: none;
}

[data-theme="dark"] .approve-button:disabled,
[data-theme="dark"] .reject-button:disabled {
  background: #374151;
  color: #6b7280;
}

.empty-clips {
  text-align: center;
  padding: 48px;
  color: var(--text-tertiary);
}

.clip-video {
  width: 100%;
  max-height: 300px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.youtube-link {
  color: var(--success);
  font-size: 14px;
  font-weight: 500;
}

.youtube-link:hover {
  color: #047857;
  text-decoration: underline;
}

.clip-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.empty-clips {
  text-align: center;
  padding: 48px;
  opacity: 0.6;
}

.watermark-select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
}

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

.billing-alert-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ff4444;
  color: white;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10000;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.billing-alert-banner a {
  background: white;
  color: #ff4444;
  padding: 6px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s;
}

.billing-alert-banner a:hover {
  transform: scale(1.05);
}

.error-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ff9800;
  color: white;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 9999;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.error-banner button {
  background: white;
  color: #ff9800;
  padding: 6px 16px;
  border-radius: 4px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.error-banner button:hover {
  transform: scale(1.05);
}

/* Mobile-specific optimizations */

/* Better touch targets */
@media (max-width: 768px) {
  /* Ensure all interactive elements meet minimum touch target size */
  .app-shell button,
  .app-shell input,
  .app-shell select,
  .app-shell textarea,
  .app-shell [role="button"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Improve tap highlighting */
  a, button, [role="button"] {
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
  }
  
  /* Better spacing for mobile */
  .card, [class*="-card"] {
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 8px;
  }
  
  /* Mobile-friendly tables */
  table {
    font-size: 14px;
  }
  
  /* Better modal sizing on mobile */
  .modal, [class*="modal"] {
    margin: 16px;
    max-height: calc(100vh - 32px);
    border-radius: 12px;
  }
  
  /* Improve form layouts */
  .form-group, .field-group {
    margin-bottom: 20px;
  }
  
  .form-row {
    flex-direction: column;
    gap: 16px;
  }
  
  /* Better spacing for lists */
  ul, ol {
    padding-left: 20px;
  }
  
  /* Improve readability */
  p, li {
    line-height: 1.6;
  }
  
  /* Better focus indicators on mobile */
  input:focus, textarea:focus, select:focus, button:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
}

/* Extra small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
  .main-content {
    padding: 8px;
    padding-top: 78px;
  }
  
  .content-container {
    padding: 0 4px;
  }
  
  h1 {
    font-size: 18px !important;
  }
  
  h2 {
    font-size: 16px !important;
  }
  
  h3 {
    font-size: 15px !important;
  }
  
  .card, [class*="-card"] {
    padding: 12px;
    margin-bottom: 12px;
  }
  
  .metrics-bar {
    padding: 12px;
    gap: 8px;
  }
  
  .metric-value {
    font-size: 18px !important;
  }
  
  .metric-label {
    font-size: 11px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .main-content {
    padding-top: 60px;
  }
  
  .sidebar {
    height: 60px;
    padding: 12px 16px;
  }
  
  .logo h2 {
    font-size: 16px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Let browser handle retina scaling naturally */
  .logo-image {
    image-rendering: auto;
  }
}

/* Dark mode mobile adjustments */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
  /* Improve contrast in dark mode on mobile */
  .sidebar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  .mobile-nav-menu {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .sidebar,
  .mobile-nav-toggle,
  .mobile-nav-overlay,
  .mobile-nav-menu,
  .help-fab {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
    padding-top: 0 !important;
  }
}
