﻿/* Dashboard Styles */
.dashboard-container {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-gray);
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dashboard-header {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  padding: max(16px, env(safe-area-inset-top, 0px)) 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px var(--shadow);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-right, 0px)) 0 max(24px, env(safe-area-inset-left, 0px));
  align-items: center;
  gap: 16px;
  min-width: 0;
}

@media (min-width: 1025px) {
  .header-content {
    display: flex;
    justify-content: space-between;
  }

  .dashboard-header-welcome {
    display: none;
  }
}

@media (max-width: 1024px) {
  .header-content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: 'menu welcome actions';
    align-items: center;
    gap: 10px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .dashboard-nav-toggle {
    grid-area: menu;
    justify-self: start;
  }

  .dashboard-header-welcome {
    grid-area: welcome;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 6px;
    text-align: center;
  }

  .dashboard-header-welcome__text {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--primary, #6366f1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .dashboard-brand-link.logo {
    display: none !important;
  }

  .header-actions {
    grid-area: actions;
    justify-self: end;
    flex-shrink: 0;
    margin-left: 0;
  }

  .user-profile-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .user-identity-copy {
    display: none;
  }

  .logout-btn-header {
    display: none;
  }

  .user-profile-link {
    order: 2;
    max-width: none;
    padding: 0;
  }

  .cutup-notif-bell-wrap {
    order: 1;
  }

  .user-avatar-header {
    width: 36px;
    height: 36px;
  }
}

.dashboard-header .header-content > .header-actions:only-child {
  margin-left: auto;
}

/* Match .main-header .logo (style.css) â€” same shell as marketing header */
.dashboard-header .dashboard-brand-link.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--primary);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: opacity 0.2s;
  flex-shrink: 1;
  min-width: 0;
}

.dashboard-header .dashboard-brand-link.logo:hover {
  opacity: 0.82;
}

.dashboard-header .dashboard-brand-logo.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: block;
}

@media (max-width: 639px) {
  .dashboard-header .dashboard-brand-link.logo {
    font-size: 19px;
    font-weight: 700;
  }

  .dashboard-header .dashboard-brand-logo.logo-icon {
    width: 28px;
    height: 28px;
  }
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-avatar-header {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.user-name-header {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn-header {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 14px;
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.logout-btn-header:hover {
  background: var(--bg-gray);
  color: var(--text-primary);
}

.dashboard-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
}

.dashboard-sidebar {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: 100px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s;
  font-size: 14px;
}

.nav-item:hover {
  background: var(--bg-gray);
}

.nav-item.active {
  background: var(--primary);
  color: white;
}

.nav-icon {
  font-size: 20px;
}

.dashboard-content {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 32px;
}

.dashboard-section {
  display: none;
}

.dashboard-section.active {
  display: block;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.welcome-message {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 32px;
  font-size: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px var(--shadow);
  border-color: var(--primary);
}

.stat-icon {
  font-size: 48px;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.chart-container {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 32px;
}

.chart-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
}

#usageChart {
  width: 100%;
  height: 300px;
}

.plans-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: 32px;
  width: 100%;
}

.plan-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  transition: all 0.3s;
  position: relative;
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px var(--shadow);
}

.plan-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.plan-header {
  text-align: center;
  margin-bottom: 24px;
}

.plan-name {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.plan-period {
  font-size: 14px;
  color: var(--text-secondary);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.plan-features li {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-features li::before {
  content: 'âœ“';
  color: var(--success);
  font-weight: 700;
}

/* Override legacy mojibake checkmark from mis-encoded UTF-8 */
.plan-features li::before {
  content: '\2713' !important;
}

.plan-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.plan-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.price-original {
  text-decoration: line-through;
  color: var(--text-secondary);
  font-size: 18px;
  margin-left: 8px;
}

.price-discount {
  color: var(--success);
  font-size: 14px;
  margin-top: 4px;
}

/* Plan Billing Selector */
.plan-billing-selector {
  margin: 16px 0;
}

.plan-billing-selector label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.billing-period-select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.plan-price-section {
  text-align: center;
  margin: 16px 0;
}

.price-main {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.current-badge {
  background: var(--success);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  margin-top: 8px;
  display: inline-block;
}

.plan-card.current-plan {
  border-color: var(--success);
}

.plan-btn.current {
  background: var(--success);
  cursor: not-allowed;
}

/* Cart Badge */
.cart-badge {
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-right: 8px;
}

/* Cart Section */
.cart-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-info h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.cart-item-info p {
  margin: 4px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.cart-item-price {
  text-align: left;
}

.cart-item-price-main {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.cart-item-price-original {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: line-through;
}

.cart-item-discount {
  font-size: 12px;
  color: var(--success);
}

.cart-item-remove {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.cart-item-remove:hover {
  background: var(--bg-gray);
}

.cart-summary {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: 100px;
}

.cart-summary-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.summary-row.total {
  border-bottom: none;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.summary-row.discount {
  color: var(--success);
}

.checkout-btn {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin-top: 16px;
}

.checkout-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.empty-cart {
  text-align: center;
  padding: 48px;
  color: var(--text-secondary);
}

/* Cart Notification */
.cart-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--success);
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s;
}

.cart-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Usage Section */
.usage-summary {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.usage-summary h3 {
  margin: 0 0 16px 0;
  font-size: 20px;
}

.usage-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.usage-stat-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-gray);
  border-radius: 8px;
}

.usage-stat-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.usage-stat-value {
  font-weight: 600;
  color: var(--primary);
}

.usage-history {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}

.usage-history h3 {
  margin: 0 0 16px 0;
  font-size: 20px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-gray);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.history-item:hover {
  box-shadow: 0 2px 8px var(--shadow);
  border-color: var(--primary);
}

.history-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 8px;
  flex-shrink: 0;
}

.history-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.history-type {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.history-duration {
  color: var(--primary);
  font-weight: 500;
}

.history-date {
  color: var(--text-secondary);
}

.info-text {
  color: var(--text-secondary);
  margin: 8px 0;
  text-align: center;
  padding: 24px;
}

/* Financial Section */
.invoices-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.invoice-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.invoice-card:hover {
  box-shadow: 0 4px 12px var(--shadow);
}

.invoice-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.invoice-card-id {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.invoice-card-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.invoice-card-status.pending {
  background: #fef3c7;
  color: #92400e;
}

.invoice-card-status.paid {
  background: #d1fae5;
  color: #065f46;
}

.invoice-card-status.cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.invoice-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.invoice-card-info {
  flex: 1;
}

.invoice-card-info p {
  margin: 4px 0;
  font-size: 14px;
}

.invoice-card-actions {
  display: flex;
  gap: 8px;
}

.btn-view-invoice,
.btn-download-pdf,
.btn-delete-invoice {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn-view-invoice:hover,
.btn-download-pdf:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-delete-invoice:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* Invoice Modal */
.invoice-modal {
  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: 24px;
}

.invoice-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.invoice-header h2 {
  margin: 0;
  font-size: 24px;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.close-btn:hover {
  background: var(--bg-gray);
}

.invoice-body {
  padding: 24px;
}

.invoice-info {
  margin-bottom: 24px;
}

.invoice-info p {
  margin: 8px 0;
  font-size: 14px;
}

.invoice-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

.invoice-status.pending {
  background: #fef3c7;
  color: #92400e;
}

.invoice-status.paid {
  background: #d1fae5;
  color: #065f46;
}

.invoice-status.cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.invoice-items {
  margin: 24px 0;
}

.invoice-items h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.invoice-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-gray);
  border-radius: 8px;
  margin-bottom: 8px;
}

.invoice-total {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

.total-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 16px;
}

.total-row.final {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 8px;
}

.total-row.discount {
  color: var(--success);
}

.invoice-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-download-pdf,
.btn-delete-invoice {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn-download-pdf {
  background: var(--primary);
  color: white;
}

.btn-download-pdf:hover {
  background: var(--primary-hover);
}

.btn-delete-invoice {
  background: #ef4444;
  color: white;
}

.btn-delete-invoice:hover {
  background: #dc2626;
}

/* Support Section */
.support-header {
  margin-bottom: 24px;
}

.btn-new-ticket {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn-new-ticket:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.tickets-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ticket-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.ticket-card:hover {
  box-shadow: 0 4px 12px var(--shadow);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ticket-id {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.ticket-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.ticket-status.open {
  background: #dbeafe;
  color: #1e40af;
}

.ticket-status.closed {
  background: #e5e7eb;
  color: #374151;
}

.ticket-status.pending {
  background: #fef3c7;
  color: #92400e;
}

.ticket-body h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.ticket-body p {
  margin: 4px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.ticket-date {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Ticket Modal */
.ticket-modal {
  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: 24px;
}

.ticket-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
}

.ticket-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.ticket-modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.ticket-modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-submit,
.btn-cancel {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn-submit {
  background: var(--primary);
  color: white;
}

.btn-submit:hover {
  background: var(--primary-hover);
}

.btn-cancel {
  background: var(--bg-gray);
  color: var(--text-primary);
}

.btn-cancel:hover {
  background: var(--border);
}

.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-secondary);
}

/* Free Plan Text (no card) */
.free-plan-text {
  margin: 0 auto 48px auto;
  padding: 0;
  max-width: 800px;
  text-align: center;
}

.free-plan-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.free-plan-description {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.8;
}

.free-plan-limits {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: right;
  display: inline-block;
}

.free-plan-limits li {
  padding: 12px 0;
  font-size: 15px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.free-plan-limits li:last-child {
  border-bottom: none;
}

/* Paid Plans Container */
.paid-plans-container {
  margin-top: 32px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.paid-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.paid-plan-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  transition: all 0.3s ease;
  position: relative;
  transform: scale(0.95);
}

.paid-plan-card:hover {
  transform: scale(0.98) translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--primary);
}

.paid-plan-card.featured {
  transform: scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 24px 48px rgba(0, 0, 0, 0.15);
  z-index: 10;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.paid-plan-card.featured:hover {
  transform: scale(1.05) translateY(-4px);
}

.paid-plan-card--highlight {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.45), 0 12px 28px rgba(99, 102, 241, 0.12);
}

.paid-plan-card.disabled-plan,
.paid-plan-card.plan-card-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.paid-plan-card.disabled-plan .plan-btn:disabled,
.paid-plan-card.plan-card-disabled .plan-btn:disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.paid-plan-card.disabled-plan:hover,
.paid-plan-card.plan-card-disabled:hover {
  transform: scale(0.95);
  border-color: var(--border);
  box-shadow: none;
}

.paid-plan-card.featured.disabled-plan:hover,
.paid-plan-card.featured.plan-card-disabled:hover {
  transform: scale(1.05);
}

.paid-plan-header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

.paid-plan-name {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.paid-plan-card.featured .paid-plan-name {
  font-size: 32px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* User Profile Link */
.user-profile-link {
  transition: all 0.2s;
  border-radius: 8px;
  padding: 4px 8px;
}

.user-profile-link:hover {
  background: var(--bg-gray);
}

/* Responsive */
@media (max-width: 1024px) {
  .paid-plans-grid {
    grid-template-columns: 1fr !important;
    gap: 24px;
    max-width: 100% !important;
  }
  
  .paid-plan-card {
    transform: scale(1) !important;
    width: 100%;
  }
  
  .paid-plan-card.featured {
    transform: scale(1) !important;
  }
  
  .paid-plan-card:hover {
    transform: translateY(-4px) scale(1) !important;
  }
  
  .paid-plan-card.featured:hover {
    transform: translateY(-4px) scale(1) !important;
  }
}

@media (max-width: 768px) {
  .dashboard-main {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .cart-content {
    grid-template-columns: 1fr;
  }
  
  .cart-summary {
    position: static;
  }
  
  .plans-grid {
    grid-template-columns: 1fr;
  }
  
  .paid-plans-grid {
    grid-template-columns: 1fr;
  }
  
  .free-plan-title {
    font-size: 24px;
  }
  
  .free-plan-description {
    font-size: 14px;
  }
  
  .paid-plan-card {
    padding: 24px;
  }
  
  .paid-plan-name {
    font-size: 24px;
  }
  
  .paid-plan-card.featured .paid-plan-name {
    font-size: 26px;
  }
}

/* Non-blocking payment / status feedback (replaces alert) */
.dashboard-muted-loading,
.dashboard-empty-note {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

.dashboard-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: max(14px, env(safe-area-inset-top, 0px)) 20px 14px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: opacity 0.2s ease;
}

.dashboard-banner[hidden] {
  display: none !important;
}

.dashboard-banner--success {
  background: #ecfdf5;
  color: #065f46;
  border-bottom: 1px solid #6ee7b7;
}

.dashboard-banner--neutral {
  background: #f8fafc;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
}

.dashboard-banner--info {
  background: #eff6ff;
  color: #1e40af;
  border-bottom: 1px solid #93c5fd;
}

.dashboard-banner--error {
  background: #fef2f2;
  color: #991b1b;
  border-bottom: 1px solid #fecaca;
}

.dashboard-offer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #c4b5fd;
  background: #f5f3ff;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0 14px;
}

.dashboard-offer-banner p {
  margin: 0;
  color: #4c1d95;
  font-weight: 600;
}

.dashboard-offer-banner-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dashboard-offer-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #faf8ff 100%);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.dashboard-offer-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.dashboard-offer-badge {
  border-radius: 999px;
  background: #ede9fe;
  color: #4c1d95;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-offer-meta {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-banner--with-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dashboard-payment-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: dashboard-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes dashboard-spin {
  to {
    transform: rotate(360deg);
  }
}

.dashboard-banner--with-retry .dashboard-banner-retry-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
  max-width: 720px;
  margin: 0 auto;
}

.dashboard-banner--with-retry .dashboard-banner-msg {
  text-align: left;
}

.dashboard-payment-retry-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #1e40af;
  color: #fff;
}

.dashboard-banner--neutral .dashboard-payment-retry-btn {
  background: #334155;
  color: #fff;
}

.dashboard-banner--error .dashboard-payment-retry-btn {
  background: #991b1b;
  color: #fff;
}

.user-identity-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-email-header {
  font-size: 12px;
  color: var(--text-secondary);
}

.identity-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.identity-strip > div {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.current-plan-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.current-plan-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.current-plan-card p {
  margin: 8px 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.plan-status-card h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.plan-status-card__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.plan-status-card__row:last-of-type {
  border-bottom: none;
}

.plan-status-card__label {
  color: var(--text-secondary);
  font-size: 14px;
}

.plan-status-card__value {
  font-size: 15px;
  color: var(--text-primary, #0f172a);
}

.plan-status-card__hint {
  margin: 14px 0 0;
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.06);
  border-radius: 8px;
  color: #4338ca;
  font-size: 13px;
  line-height: 1.5;
}

.plan-status-card .plan-btn {
  margin-top: 16px;
}

/* —— Dashboard Plans page —— */
.dash-plans {
  display: grid;
  gap: 20px;
  max-width: 1200px;
}

.dash-plans-kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .dash-plans-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .dash-plans-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.dash-plans-kpi {
  background: #fff;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 76px;
}

.dash-plans-kpi--accent {
  border-color: rgba(99, 102, 241, 0.28);
  background: linear-gradient(135deg, #fff 0%, rgba(99, 102, 241, 0.05) 100%);
}

.dash-plans-kpi__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.dash-plans-kpi__value {
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.dash-plans-kpi--accent .dash-plans-kpi__value {
  color: var(--primary, #6366f1);
}

.dash-plans-kpi__value--sm {
  font-size: 0.95rem;
  font-weight: 700;
}

.dash-plans-kpi__renewal-urgent {
  color: #dc2626;
  animation: dash-renewal-blink 1.15s ease-in-out infinite;
}

@keyframes dash-renewal-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.dash-plans-section-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #64748b;
}

.dash-plans-usage {
  background: #fff;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.dash-plans-usage__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-plans-usage__plan {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  background: rgba(99, 102, 241, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
}

.dash-plans-usage__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: #64748b;
  margin-bottom: 12px;
}

.dash-plans-usage__stats strong {
  color: #0f172a;
  font-weight: 800;
}

.dash-plans-usage__bar {
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.dash-plans-usage__fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  border-radius: 999px;
  transition: width 0.45s ease;
}

.dash-plans-matrix {
  min-width: 0;
}

.dash-plans-matrix .pricing-compare-wrap {
  margin: 0;
}

.dash-subscription-layout {
  display: grid;
  gap: 24px;
  max-width: 640px;
}

.dash-subscription-plan-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.dash-subscription-plan-card__title {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.dash-subscription-plan-card__status {
  margin: 0 0 16px;
  font-size: 13px;
  color: #64748b;
}

.dash-subscription-plan-card__credits {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.dash-subscription-plan-card__meta {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.dash-subscription-upgrade {
  background: #f8fafc;
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 12px;
  padding: 20px;
}

.dash-subscription-upgrade h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: #0f172a;
}

.dash-subscription-upgrade ul {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.dash-subscription-upgrade li {
  padding: 4px 0;
  font-size: 14px;
  color: #334155;
}

.dash-subscription-upgrade .plan-btn {
  margin-right: 8px;
  margin-top: 4px;
}

.dash-subscription-upgrade .plan-btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.dash-subscription-complete {
  padding: 16px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 10px;
  color: #047857;
  font-size: 14px;
}

.stats-grid--single {
  grid-template-columns: 1fr;
  max-width: 280px;
}

.dashboard-error-surface {
  background: #fef2f2 !important;
  color: #991b1b !important;
}

.plans-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.paid-plan-card.current-plan {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.paid-plan-card {
  transform: none;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.paid-plan-card .plan-features {
  flex: 1;
}

.paid-plan-card.featured {
  transform: none;
}

.plan-price {
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 700;
  font-size: 18px;
}

.plan-offer-badge {
  display: inline-flex;
  margin: 0 0 8px;
  border-radius: 999px;
  border: 1px solid #c4b5fd;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
}

.plan-price-offer {
  margin: 0 0 12px;
  color: #4c1d95;
  font-size: 14px;
}

.plan-price-old {
  color: #6b7280;
  text-decoration: line-through;
  margin-right: 6px;
}

.plan-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
}

@media (max-width: 1024px) {
  .identity-strip {
    grid-template-columns: 1fr;
  }

  .plans-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .dashboard-content {
    padding: 16px;
  }

  .header-content {
    padding: 0 16px;
  }

  .header-actions {
    min-width: 0;
  }

  .user-profile-link {
    gap: 8px !important;
    min-width: 0;
  }

  .user-avatar-header {
    width: 34px;
    height: 34px;
  }

  .user-name-header {
    font-size: 13px;
  }

  .user-email-header {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .logout-btn-header {
    padding: 8px 10px;
  }

  .paid-plan-card {
    width: 100%;
    max-width: 100%;
    padding: 20px;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .usage-history,
  .usage-summary,
  .current-plan-card {
    padding: 16px;
  }

  .history-item {
    padding: 12px;
  }

  .saved-output-actions {
    flex-direction: column;
  }

  .saved-output-actions .plan-btn {
    width: 100%;
  }
}

.history-item {
  cursor: pointer;
}

.history-item details {
  width: 100%;
}

.history-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-item summary::-webkit-details-marker {
  display: none;
}

.history-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  display: grid;
  gap: 6px;
}

.history-expand-hint {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.history-item details[open] .history-expand-hint {
  color: var(--primary);
}

.history-details a {
  color: var(--primary);
  text-decoration: underline;
}

.history-link-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
  border-radius: 8px;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.insight-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.insight-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.insight-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.upgrade-warning {
  margin: 12px 0 16px;
  border: 1px solid #f5d08a;
  background: #fffbeb;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upgrade-warning--neutral {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.upgrade-warning--strong {
  background: #fff7ed;
  border-color: #fdba74;
}

.cutup-quota-upgrade-hint {
  margin: 12px 0 16px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid #c7d2fe;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.cutup-quota-upgrade-hint__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #1e1b4b;
  line-height: 1.35;
}

.cutup-quota-upgrade-hint__reset,
.cutup-quota-upgrade-hint__benefits {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #475569;
}

.cutup-quota-upgrade-hint__benefits {
  margin-bottom: 14px;
}

.cutup-quota-upgrade-hint .plan-btn {
  width: 100%;
  max-width: 280px;
  box-sizing: border-box;
}

.saved-output-card {
  margin-bottom: 14px;
}

.saved-output-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.saved-output-header h3 {
  margin: 0;
  font-size: 18px;
}

.saved-output-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.saved-output-badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #334155;
}

.saved-output-date {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.saved-output-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-btn--sm {
  padding: 8px 12px;
}

.plan-btn--ghost {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.saved-output-preview {
  margin-top: 10px;
}

.saved-output-preview pre {
  white-space: pre-wrap;
  margin-top: 8px;
  max-height: 240px;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.saved-output-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.saved-filter-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-primary);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.saved-filter-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: #eef2ff;
}

.plan-feature-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plan-feature-row span {
  color: var(--text-secondary);
  font-size: 14px;
}

.plan-feature-row strong {
  color: var(--text-primary);
  font-size: 14px;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .plan-feature-row strong {
    white-space: normal;
    text-align: right;
  }
}

@media (max-width: 1200px) {
  .plans-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .upgrade-warning {
    flex-direction: column;
    align-items: stretch;
  }

  .cutup-quota-upgrade-hint .plan-btn {
    max-width: none;
  }
}

/* â€”â€” Initial dashboard gate (profile check) â€”â€” */
.dashboard-initial-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.2s ease;
}

.dashboard-initial-loader.is-done {
  opacity: 0;
  pointer-events: none;
}

.dashboard-initial-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #475569;
}

.dashboard-initial-loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #6c5ce7;
  border-radius: 50%;
  animation: dashboard-loader-spin 0.7s linear infinite;
}

@keyframes dashboard-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

/* â€”â€” Onboarding overlay (class hooks; base layout still inline in JS) â€”â€” */
#cutupDashboardShell.cutup-onboarding-locked {
  pointer-events: none;
  user-select: none;
}

.onboardingOverlay--anim {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.onboardingOverlay--anim.is-visible {
  opacity: 1;
}

.onboardingModal {
  width: 520px;
  max-width: 92%;
  max-height: min(92dvh, 720px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f9f9ff 100%);
  border-radius: 18px;
  padding: 28px;
  padding-bottom: max(28px, env(safe-area-inset-bottom, 0px));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.onboardingOverlay--anim.is-visible .onboardingModal {
  opacity: 1;
  transform: translateY(0);
}

.onboardingModalHeader {
  text-align: center;
  margin-bottom: 22px;
}

.onboardingModalIcon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 4px rgba(108, 92, 231, 0.2));
}

.onboardingModalTitle {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1e1b4b;
}

.onboardingModalLead {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #64748b;
  font-weight: 500;
}

.onboardingModalError {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.onboardingModalError[hidden],
.onboardingModalSuccess[hidden] {
  display: none !important;
}

.onboardingModalSuccess {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #166534;
  background: linear-gradient(180deg, #ecfdf5, #d1fae5);
  border: 1px solid #6ee7b7;
  animation: onboarding-success-in 0.35s ease;
}

.onboardingModalSuccessIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.onboardingForm {
  margin: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
}

.onboardingForm.is-hidden {
  display: none;
}

.onboardingFormScroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  margin-right: -4px;
}

.onboardingFormGrid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

.onboardingField {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.onboardingFieldLabel {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.onboardingFieldReq {
  color: #dc2626;
  font-weight: 700;
  text-decoration: none;
  border: none;
  margin-left: 2px;
}

.onboardingFieldError {
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
  margin: 0;
  line-height: 1.3;
}

.onboardingField--invalid input,
.onboardingField--invalid select,
.onboardingField--invalid textarea {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
}

.onboardingField--wide {
  grid-column: 1 / -1;
}

.onboardingField--postal {
  grid-column: span 1;
  max-width: 220px;
}

.onboardingField input,
.onboardingField select,
.onboardingField textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: #0f172a;
  background: #fff;
  box-sizing: border-box;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.onboardingField input:focus,
.onboardingField select:focus,
.onboardingField textarea:focus {
  outline: none;
  border-color: #6c5ce7;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.onboardingField textarea {
  resize: vertical;
  min-height: 88px;
}

.onboardingSubmit {
  width: 100%;
  flex-shrink: 0;
  margin-top: 16px;
  padding: 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
  border: none;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  background: linear-gradient(135deg, #6c5ce7, #8e7cff);
  color: #fff;
  box-shadow: 0 6px 24px rgba(108, 92, 231, 0.35);
  transition:
    filter 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.onboardingSubmit:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 8px 28px rgba(108, 92, 231, 0.42);
}

.onboardingSubmit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  filter: none;
}

@keyframes onboarding-success-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 560px) {
  .onboardingFormGrid {
    grid-template-columns: 1fr;
  }

  .onboardingField--wide,
  .onboardingField--postal {
    grid-column: 1;
    max-width: none;
  }
}

/* â€”â€” Mobile nav toggle (hidden on desktop) â€”â€” */
.dashboard-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
}

.dashboard-nav-toggle-bars {
  display: block;
  width: 18px;
  height: 2px;
  background: #111827;
  border-radius: 999px;
  box-shadow:
    0 -6px 0 #111827,
    0 6px 0 #111827;
}

.dashboard-sidebar-backdrop {
  display: none;
}

.dashboard-sidebar-footer {
  display: none;
}

.nav-item--logout {
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

/* —— Tablet / mobile: sidebar drawer (max-width: 1024px) —— */
@media (max-width: 1024px) {
  .dashboard-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 4px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  }

  .dashboard-nav-toggle:hover {
    border-color: #c7d2fe;
    background: #fafaff;
  }

  .dashboard-nav-toggle:active {
    opacity: 0.85;
  }

  .dashboard-header {
    overflow-x: hidden;
  }

  .dashboard-main {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }

  .dashboard-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(288px, 88vw);
    max-width: 100%;
    z-index: 220;
    margin: 0;
    border-radius: 0;
    padding: 20px 16px;
    padding-top: max(20px, env(safe-area-inset-top, 0px));
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.18);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  .dashboard-sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .nav-item {
    flex: none;
    min-height: 44px;
    width: 100%;
    box-sizing: border-box;
  }

  .dashboard-sidebar-footer {
    display: block;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .nav-item--logout {
    color: #b91c1c;
  }

  .nav-item--logout:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #991b1b;
  }

  .dashboard-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 210;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.2s ease,
      visibility 0.2s ease;
  }

  .dashboard-sidebar-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.dashboard-nav-open {
    overflow: hidden;
  }
}

/* â€”â€” Onboarding: scrollable on small viewports â€”â€” */
#onboardingOverlay.onboardingOverlay--anim {
  align-items: flex-start !important;
  justify-content: center !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: max(12px, env(safe-area-inset-top, 0px)) 16px max(12px, env(safe-area-inset-bottom, 0px)) !important;
}

.onboardingModal {
  width: min(520px, 100%);
  max-height: min(92dvh, 720px);
  margin: auto 0;
}

@media (max-width: 480px) {
  .user-profile-header {
    gap: 6px;
  }

  .user-profile-link {
    max-width: none;
  }

  .user-identity-copy {
    display: none;
  }

  .logout-btn-header {
    display: none;
  }

  .header-content {
    gap: 8px;
  }

  .section-title {
    font-size: clamp(1.25rem, 5.5vw, 1.5rem);
    line-height: 1.25;
    word-break: break-word;
  }

  .welcome-message {
    font-size: 16px;
    padding: 18px;
  }

  .plan-btn:not(:disabled) {
    min-height: 44px;
    width: 100%;
    box-sizing: border-box;
  }

  .onboardingModal {
    padding: 20px 16px;
    max-height: min(calc(100dvh - 24px), 720px);
  }

  .onboardingModalTitle {
    font-size: 1.2rem;
  }

  .onboardingField input,
  .onboardingField select,
  .onboardingField textarea {
    min-height: 44px;
  }

  .onboardingField textarea {
    min-height: 96px;
  }

  .onboardingSubmit {
    min-height: 48px;
  }
}

/* â€”â€” Profile settings + dashboard polish â€”â€” */
.dashboard-section-lead {
  margin: -12px 0 24px;
  color: var(--text-secondary, #64748b);
  font-size: 15px;
  line-height: 1.5;
}

.dashboard-sidebar-profile {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

.dashboard-sidebar-profile-inner {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dashboard-sidebar-profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.15);
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
  display: block;
  background: #f1f5f9;
}

.dashboard-sidebar-profile-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dashboard-sidebar-profile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-sidebar-profile-email {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-sidebar-profile-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.dashboard-sidebar-profile-badge--ok {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.dashboard-sidebar {
  border: 1px solid rgba(99, 102, 241, 0.08);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dashboard-content {
  border: 1px solid rgba(99, 102, 241, 0.08);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.stat-card,
.current-plan-card,
.usage-summary {
  border: 1px solid rgba(99, 102, 241, 0.1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover,
.current-plan-card:hover {
  border-color: rgba(99, 102, 241, 0.18);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.08);
}

.nav-item {
  border: 1px solid transparent;
}

.nav-item:hover {
  border-color: rgba(99, 102, 241, 0.12);
}

.profile-settings-root {
  min-height: 200px;
}

.profile-settings-loading,
.profile-settings-error {
  margin: 0;
  padding: 24px;
  font-size: 15px;
  color: var(--text-secondary, #64748b);
  background: #fff;
  border: 1px dashed rgba(99, 102, 241, 0.2);
  border-radius: 14px;
}

.profile-settings-error {
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(254, 242, 242, 0.5);
}

.profile-settings-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 900px) {
  .profile-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .profile-settings-card--span-full {
    grid-column: 1 / -1;
  }
}

.profile-settings-card {
  background: #fff;
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.profile-settings-card--danger {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(254, 242, 242, 0.35);
}

.profile-settings-card-head {
  margin-bottom: 18px;
}

.profile-settings-card-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-settings-card-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary, #64748b);
}

.profile-settings-avatar-row {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.profile-settings-avatar-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 280px;
}

.profile-settings-avatar-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.profile-settings-avatar {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 50%;
  border: none;
  background: #f1e8ec;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  display: block;
  flex-shrink: 0;
}

.profile-settings-avatar-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  margin-top: 0;
  padding: 6px 16px 6px 13px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #008069;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  white-space: nowrap;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.profile-settings-avatar-edit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
}

.profile-settings-avatar-edit-icon {
  display: block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #008069;
}

.profile-settings-avatar-edit-label {
  color: #008069;
  font-weight: 500;
}

.profile-settings-avatar-copy {
  flex: 1;
  min-width: 0;
}

.prof-avatar-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.prof-avatar-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.prof-avatar-modal__panel {
  position: relative;
  width: min(420px, 100%);
  background: var(--card, #fff);
  border-radius: 18px;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  padding: 18px 18px 16px;
  animation: prof-avatar-in 0.22s ease-out;
}

@keyframes prof-avatar-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.prof-avatar-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.prof-avatar-modal__head h3 {
  margin: 0;
  font-size: 17px;
}

.prof-avatar-modal__close {
  min-width: 36px;
  padding: 4px 10px;
}

.prof-avatar-modal__hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-secondary, #64748b);
}

.prof-avatar-modal__stage {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  background: #f1f5f9;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.prof-avatar-modal__canvas {
  display: block;
  width: 280px;
  height: 280px;
  cursor: grab;
  touch-action: none;
}

.prof-avatar-modal__canvas:active {
  cursor: grabbing;
}

.prof-avatar-modal__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(99, 102, 241, 0.55);
  pointer-events: none;
}

.prof-avatar-modal__zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
}

.prof-avatar-modal__zoom-input {
  flex: 1;
  accent-color: #6366f1;
}

.prof-avatar-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.profile-settings-avatar-copy {
  flex: 1;
  min-width: 0;
}

.profile-settings-pill {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.profile-settings-pill--warn {
  background: rgba(251, 191, 36, 0.2);
  color: #92400e;
}

.profile-settings-pill--ok {
  background: rgba(34, 197, 94, 0.15);
  color: #166534;
}

.profile-settings-avatar-name {
  margin: 0;
  font-weight: 600;
  font-size: 17px;
  color: var(--text-primary, #0f172a);
  max-width: 100%;
  word-break: break-word;
}

.profile-settings-avatar-hint {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary, #64748b);
}

.profile-settings-avatar-stack .profile-settings-pill {
  margin-top: 10px;
}

.profile-settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.profile-settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
  min-width: 0;
}

.profile-settings-field--wide {
  grid-column: 1 / -1;
}

.profile-settings-field input,
.profile-settings-field select,
.profile-settings-field textarea {
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fafafe;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.profile-settings-field input:focus,
.profile-settings-field select:focus,
.profile-settings-field textarea:focus {
  outline: none;
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: #fff;
}

.profile-settings-field input[readonly] {
  background: #f1f5f9;
  color: #64748b;
}

.profile-settings-muted {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-secondary, #64748b);
}

.profile-settings-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-settings-fields--stack {
  grid-template-columns: 1fr;
}

.profile-settings-toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-settings-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-settings-toggle:hover {
  border-color: rgba(99, 102, 241, 0.28);
  background: rgba(99, 102, 241, 0.04);
}

.profile-settings-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.profile-settings-toggle-ui {
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  margin-top: 2px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.2s ease;
}

.profile-settings-toggle-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.profile-settings-toggle input:checked + .profile-settings-toggle-ui {
  background: var(--primary, #6366f1);
}

.profile-settings-toggle input:checked + .profile-settings-toggle-ui::after {
  transform: translateX(18px);
}

.profile-settings-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.profile-settings-toggle-copy strong {
  font-weight: 600;
  color: var(--text-primary);
}

.profile-settings-toggle-copy small {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}

.profile-settings-danger-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.profile-settings-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.profile-settings-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-settings-btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.profile-settings-btn--primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.profile-settings-btn--ghost {
  color: var(--text-primary);
  background: #fff;
  border-color: rgba(99, 102, 241, 0.2);
}

.profile-settings-btn--danger {
  color: #b91c1c;
  background: #fff;
  border-color: rgba(239, 68, 68, 0.35);
}

.profile-settings-save-bar {
  position: sticky;
  bottom: 12px;
  z-index: 2;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(99, 102, 241, 0.14);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-settings-save-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.profile-settings-footer {
  margin-top: 8px;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.profile-settings-alert {
  margin: 0;
  font-size: 14px;
  color: #b45309;
}

.profile-settings-status {
  margin: 0;
  font-size: 14px;
}

.profile-settings-status--error {
  color: #b91c1c;
}

.profile-settings-status--ok {
  color: #166534;
}

/* Profile & dashboard — mobile overflow fixes */
@media (max-width: 768px) {
  .dashboard-container {
    overflow-x: hidden;
    max-width: 100%;
  }

  .dashboard-main {
    padding: 12px;
    min-width: 0;
    max-width: 100%;
  }

  .dashboard-content {
    padding: 16px 12px;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  #profile-section .section-title {
    font-size: clamp(1.25rem, 5.5vw, 1.5rem);
    margin-bottom: 16px;
    word-break: break-word;
  }

  .profile-settings-root,
  .profile-settings-layout,
  .profile-settings-grid,
  .profile-settings-card,
  .profile-settings-save-bar {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .profile-settings-card {
    padding: 16px 14px;
  }

  .profile-settings-avatar-stack {
    max-width: 100%;
  }

  .profile-settings-fields {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .profile-settings-field input,
  .profile-settings-field select,
  .profile-settings-field textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .profile-settings-danger-row {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-settings-danger-row .profile-settings-btn {
    width: 100%;
  }

  .profile-settings-actions-row {
    flex-direction: column;
  }

  .profile-settings-actions-row .profile-settings-btn {
    width: 100%;
    justify-content: center;
  }

  .profile-settings-save-bar {
    padding: 12px 14px;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }

  .profile-settings-save-row {
    justify-content: stretch;
  }

  .profile-settings-save-row .profile-settings-btn--primary {
    width: 100%;
  }

  .profile-settings-footer {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .dashboard-header-welcome__text {
    font-size: 13px;
  }
}

.profile-settings-card--error {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(254, 242, 242, 0.35);
}

.profile-settings-card--error .profile-settings-error {
  margin: 0;
  font-size: 14px;
  color: #b91c1c;
}

.cutup-account-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  animation: cutupModalFadeIn 0.2s ease;
}

@keyframes cutupModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cutup-account-modal {
  width: min(440px, 100%);
  max-height: min(88vh, 640px);
  overflow: auto;
  padding: 26px 28px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(99, 102, 241, 0.14);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
  animation: cutupModalSlideIn 0.22s ease;
}

@keyframes cutupModalSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cutup-account-modal-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.cutup-account-modal-body p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary, #64748b);
}

.cutup-account-modal-muted {
  font-size: 14px;
  color: #94a3b8;
}

.cutup-account-modal-body a {
  color: #6366f1;
  font-weight: 500;
}

.cutup-account-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(99, 102, 241, 0.1);
}

.profile-settings-card--danger .profile-settings-btn--danger:not(:disabled) {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.28);
}

.profile-settings-card--danger .profile-settings-btn--danger:not(:disabled):hover {
  filter: brightness(1.05);
}

@media (max-width: 720px) {
  .profile-settings-fields {
    grid-template-columns: 1fr;
  }
}

/* —— Usage analytics widget —— */
.dash-usage-analytics {
  display: grid;
  gap: 16px;
  max-width: 1200px;
}

.dash-usage-block {
  background: #fff;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.dash-usage-block__title {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #64748b;
}

.dash-usage-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.dash-usage-metrics--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dash-usage-metrics--4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .dash-usage-metrics--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.dash-usage-metric {
  text-align: center;
  padding: 14px 10px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
}

.dash-usage-metric--accent {
  background: rgba(99, 102, 241, 0.07);
  border-color: rgba(99, 102, 241, 0.14);
}

.dash-usage-metric strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.dash-usage-metric--accent strong {
  color: var(--primary, #6366f1);
}

.dash-usage-metric span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.dash-usage-progress {
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.dash-usage-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  border-radius: 999px;
  transition: width 0.5s ease;
}

.dash-activity-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.dash-activity-item:last-child {
  border-bottom: none;
}

.dash-activity-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--primary, #6366f1);
  flex-shrink: 0;
}

.dash-activity-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dash-activity-body strong {
  font-size: 14px;
  color: #0f172a;
}

.dash-activity-body span {
  font-size: 12px;
  color: #94a3b8;
}

.dash-activity-section {
  margin-top: 28px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.dash-activity-section__title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.af-host {
  min-height: 0;
}

.af-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.af-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}

.af-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.af-card__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  flex-shrink: 0;
}

.af-card__body {
  flex: 1;
  min-width: 0;
}

.af-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.af-card__title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.af-card__time {
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
}

.af-card__detail {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}

.af-empty {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
  background: #f8fafc;
  border-radius: 10px;
}

.bd-block--activity .af-card {
  padding: 12px 0;
}

.dash-usage-empty {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
  background: #f8fafc;
  border-radius: 12px;
}

/* —— Saved outputs grid —— */
.dash-saved-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 640px) {
  .dash-saved-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .dash-saved-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.dash-saved-card {
  background: #fff;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.dash-saved-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.dash-saved-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.dash-saved-card__pin {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  color: #94a3b8;
}

.dash-saved-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
}

.dash-saved-card__type {
  font-weight: 700;
  color: var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
}

.dash-saved-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dash-saved-action {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.dash-saved-action:hover {
  border-color: var(--primary, #6366f1);
  color: var(--primary, #6366f1);
}

.dash-saved-action--danger {
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.25);
}

.dash-saved-action--danger:hover {
  border-color: #ef4444;
  color: #b91c1c;
  background: #fef2f2;
}

.dash-saved-card__preview {
  font-size: 12px;
}

.dash-saved-card__preview pre {
  max-height: 120px;
  overflow: auto;
  font-size: 11px;
  background: #f8fafc;
  padding: 10px;
  border-radius: 8px;
}

