/* ═══ Buy Page ═══ */
.buy-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  animation: fadeInUp .5s ease both;
}
.buy-header-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-accent);
}
.buy-header-icon i { font-size: 1.3rem; color: #fff; }
.package-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
}
.package-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity .3s;
}
.package-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
}
.package-card:hover::before { opacity: 1; }
.package-name { font-weight: 700; font-size: 1rem; margin-bottom: .6rem; color: var(--text-primary); }
.package-price { text-align: center; margin: .75rem 0; }
.package-price .amount {
  font-size: 2.1rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.package-price .currency { font-size: .9rem; font-weight: 600; color: var(--text-secondary); }
.package-tokens { text-align: center; margin-bottom: .4rem; color: var(--text-secondary); font-size: .84rem; }
.package-tokens i { color: var(--accent); }
.package-bonus { text-align: center; margin-bottom: .85rem; }
.package-bonus .badge {
  background: var(--success-bg);
  color: var(--success);
  font-weight: 600;
  padding: .35rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .78rem;
}
.package-actions { margin-top: auto; display: flex; flex-direction: column; gap: .45rem; }
.package-actions .btn { border-radius: var(--radius-md); font-size: .84rem; padding: .55rem; font-weight: 600; }
.info-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--gradient-subtle);
  padding: 1.1rem 1.15rem;
  margin-top: 1.2rem;
  animation: fadeInUp .5s ease .3s both;
}
.info-card h6 {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--text-primary);
}
.info-card h6 i { color: var(--accent); }
.info-card ul { margin: 0; padding-left: 1.25rem; }
.info-card li { color: var(--text-secondary); font-size: .82rem; margin-bottom: .3rem; line-height: 1.45; }
.empty-packages {
  text-align: center;
  padding: 4rem 2rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}
.empty-packages i { font-size: 3rem; color: var(--text-muted); opacity: .3; }
.account-command-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 0 0 1rem;
}
.account-command-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.3rem;
  padding: 0 .85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
  transition: all .2s ease;
}
.account-command-link:hover,
.account-command-link.active {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.account-command-link i { color: var(--accent); }
.billing-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.billing-toolbar-copy h2 {
  margin: 0 0 .2rem;
  font-size: 1.18rem;
}
.billing-toolbar-copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: .84rem;
}
.billing-trust {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .8rem;
}
.billing-trust span {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  min-height: 1.95rem;
  padding: 0 .72rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-alt) 94%, transparent);
  color: var(--text-secondary);
  font-size: .72rem;
  font-weight: 700;
}
.billing-trust i { color: var(--accent); }
.billing-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  width: min(100%, 31rem);
}
.billing-method-card {
  display: flex;
  align-items: center;
  gap: .8rem;
  width: 100%;
  min-height: 88px;
  padding: .95rem 1rem;
  border-radius: 1.15rem;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent),
    color-mix(in srgb, var(--surface) 97%, transparent);
  color: var(--text-primary);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.billing-method-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
  box-shadow: var(--shadow-md);
}
.billing-method-card.active {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), .12), transparent 40%),
    color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 12px 28px rgba(var(--accent-rgb), .12);
}
.billing-method-card:focus-visible {
  outline: 0;
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  box-shadow: 0 0 0 3px var(--accent-light);
}
.billing-method-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 1rem;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--surface-alt) 94%, transparent);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 1.1rem;
}
.billing-method-card-copy {
  display: grid;
  gap: .16rem;
}
.billing-method-card-copy strong {
  font-size: .9rem;
}
.billing-method-card-copy span {
  color: var(--text-secondary);
  font-size: .76rem;
  line-height: 1.45;
}
.package-card {
  padding-top: 1.45rem;
}
.package-eyebrow {
  margin-bottom: .35rem;
  color: var(--text-muted);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-weight: 800;
}
.package-card--featured {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.12), transparent 34%),
    color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-md);
}
.package-badge {
  position: absolute;
  top: .95rem;
  right: .95rem;
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0 .65rem;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.package-unit-price {
  margin-bottom: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .78rem;
}
.package-value-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .45rem;
  margin: 0 0 1rem;
}
.package-value-points span {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 1.8rem;
  padding: 0 .6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-alt) 94%, transparent);
  color: var(--text-secondary);
  font-size: .7rem;
  font-weight: 700;
}
.package-value-points i { color: var(--accent); }
.package-pay-btn {
  min-height: 46px;
}

/* ═══ Profile Page ═══ */
.profile-card {
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), .05), transparent 28%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: all .25s;
  animation: fadeInUp .5s ease .1s both;
}
.profile-card:hover { box-shadow: var(--shadow-sm); }
.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.profile-avatar {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 1.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-accent);
}
.profile-avatar-info h5 {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin: 0 0 .2rem 0;
  letter-spacing: -.01em;
}
.profile-avatar-info .username { color: var(--text-secondary); font-size: .88rem; }
.profile-info-table { width: 100%; border-collapse: collapse; color: var(--text-primary); }
.profile-info-table tr { border-bottom: 1px solid var(--border); transition: background .15s; }
.profile-info-table tr:hover { background: var(--surface-hover); }
.profile-info-table tr:last-child { border-bottom: none; }
.profile-info-table td { padding: .62rem 0; vertical-align: middle; font-size: .84rem; }
.profile-info-table td:first-child { color: var(--text-secondary); width: 42%; font-size: .8rem; }
.profile-info-table td:last-child { font-weight: 600; color: var(--text-primary); }
.profile-stat-card {
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), .05), transparent 28%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: all .25s;
  animation: fadeInUp .5s ease .15s both;
}
.profile-stat-card:hover { box-shadow: var(--shadow-md); }
.profile-stat-card h5 {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin: 0 0 1.25rem 0;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.profile-stat-card h5 i { color: var(--accent); }
.profile-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.profile-stat-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  text-align: center;
  transition: all .2s;
}
.profile-stat-item:hover { background: var(--surface); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(var(--accent-rgb), .08); }
.profile-stat-item .stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .5rem;
  font-size: 1rem;
}
.profile-stat-item .stat-icon.balance { background: var(--accent-light); color: var(--accent); }
.profile-stat-item .stat-icon.requests { background: var(--blue-bg); color: var(--blue); }
.profile-stat-item .stat-icon.spent { background: var(--amber-bg); color: var(--amber); }
.profile-stat-item .stat-icon.paid { background: var(--emerald-bg); color: var(--emerald); }
.profile-stat-item .stat-value { font-size: 1.35rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.profile-stat-item .stat-label { font-size: .75rem; color: var(--text-secondary); margin-top: .15rem; }
.profile-actions { margin-top: 1.75rem; display: flex; gap: .65rem; flex-wrap: wrap; animation: fadeInUp .5s ease .2s both; }

/* ═══ Settings Page ═══ */
.settings-section-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.settings-section-title i { color: var(--accent); font-size: 1.15rem; }
.settings-card .form-control, .settings-card .form-select {
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: .6rem .9rem;
  font-size: .88rem;
}
.settings-card .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  background: var(--surface);
}
.settings-card .form-control::placeholder { color: var(--text-muted); }
.settings-card .form-label { color: var(--text-primary); font-weight: 600; font-size: .82rem; }
.account-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.account-table tr { border-bottom: 1px solid var(--border); }
.account-table tr:last-child { border-bottom: none; }
.account-table td { padding: .7rem 0; color: var(--text-primary); vertical-align: middle; font-size: .88rem; }
.account-table td:first-child { color: var(--text-secondary); font-size: .85rem; }
.account-table .badge { font-size: .72rem; font-weight: 600; padding: .3rem .6rem; border-radius: var(--radius-sm); }
.account-table .badge.bg-success { background: var(--accent-light) !important; color: var(--accent) !important; }
.account-table .badge.bg-secondary { background: var(--surface-hover) !important; color: var(--text-secondary) !important; }
.account-table .badge.bg-warning { background: var(--amber-bg) !important; color: var(--amber) !important; }
.referral-input-group { display: flex; gap: .5rem; margin-bottom: .75rem; }
.referral-input-group input {
  flex: 1;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: .5rem .9rem;
  font-size: .82rem;
  color: var(--text-primary);
}
.referral-input-group input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }
.referral-copy-btn {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-md);
  padding: .5rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-size: .85rem;
}
.referral-copy-btn:hover { background: var(--accent); color: #fff; }
.settings-alert { border-radius: var(--radius-md); border: none; padding: .55rem .85rem; font-size: .82rem; }
.settings-alert.alert-success { background: var(--accent-light); color: var(--accent); }
.settings-alert.alert-danger { background: var(--danger-bg); color: var(--danger); }
.settings-alert.alert-warning { background: var(--amber-bg); color: var(--amber); }
.yandex-btn {
  background: #fc3f1d !important;
  color: #fff !important;
  border: none;
  border-radius: var(--radius-md);
  padding: .5rem 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  transition: all .2s;
}
.yandex-btn:hover { color: #fff; opacity: .95; transform: translateY(-1px); }
.settings-divider { border-color: var(--border) !important; margin: .75rem 0; }

/* ═══ History Page ═══ */
.history-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: background .35s, border-color .35s;
  animation: fadeInUp .5s ease .1s both;
}
.history-table { width: 100%; border-collapse: collapse; color: var(--text-primary); }
.history-table thead th {
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .75rem .95rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.history-table tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
.history-table tbody tr:hover { background: var(--surface-hover); }
.history-table tbody tr:last-child { border-bottom: none; }
.history-table tbody td { padding: .78rem .95rem; vertical-align: middle; font-size: .84rem; }
.history-table .col-date { color: var(--text-secondary); font-size: .78rem; white-space: nowrap; }
.history-table .col-amount-positive { color: var(--success); font-weight: 600; white-space: nowrap; }
.history-table .col-amount-negative { color: var(--danger); font-weight: 600; white-space: nowrap; }
.history-table .col-balance { font-weight: 600; color: var(--text-primary); }
.history-table .col-desc { color: var(--text-secondary); font-size: .82rem; }
.history-badge {
  display: inline-block;
  padding: .25rem .65rem;
  border-radius: var(--radius-sm);
  font-size: .75rem;
  font-weight: 600;
}
.history-badge.purchase { background: var(--success-bg); color: var(--success); }
.history-badge.usage { background: var(--accent-light); color: var(--accent); }
.history-badge.bonus { background: var(--warning-bg); color: var(--warning); }
.history-badge.admin { background: var(--info-bg); color: var(--info); }
.history-badge.refund { background: rgba(139,92,246,.15); color: #8b5cf6; }
.history-badge.other { background: var(--surface-hover); color: var(--text-secondary); }
.history-page-pagination {
  margin-top: 1.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.history-page-pagination .pagination { margin: 0; gap: .25rem; }
.history-page-pagination .page-link {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: .38rem .78rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: .8rem;
  transition: all .2s;
}
.history-page-pagination .page-link:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--accent); }
.history-page-pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; }
.history-page-pagination .page-item.disabled .page-link { background: var(--surface); color: var(--text-muted); border-color: var(--border); }
.history-page-pagination .total-count { color: var(--text-secondary); font-size: .82rem; }
.history-empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.8rem 1.3rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.history-empty-state .empty-icon-wrap {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--gradient-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.history-empty-state .empty-icon-wrap i { font-size: 2rem; color: var(--accent); opacity: .4; }
.history-empty-state p { color: var(--text-secondary); font-size: .95rem; margin: 0 0 1.25rem 0; }

/* ═══ Presets Page ═══ */
.presets-hero-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}
.presets-hero-icon i { font-size: 1.6rem; color: #fff; }
.presets-hero h1 { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); margin: 0 0 .5rem; letter-spacing: -.03em; }
.presets-hero p { font-size: .95rem; color: var(--text-secondary); max-width: 500px; margin: 0 auto 1.5rem; line-height: 1.5; }
.section-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.section-icon-image { background: var(--pink-bg); color: var(--pink); }
.section-icon-video { background: var(--sky-bg); color: var(--sky); }
.section-icon-text { background: var(--accent-light); color: var(--accent); }
/* ═══ Video Page Specifics ═══ */
.mode-tabs {
  display: flex;
  gap: .35rem;
  margin-bottom: 1.25rem;
  background: var(--surface-alt);
  border-radius: 1.2rem;
  padding: .35rem;
  border: 1px solid var(--border);
}
.mode-tab {
  flex: 1;
  text-align: center;
  min-height: 2.9rem;
  padding: .5rem .4rem;
  font-size: .8rem;
  font-weight: 600;
  border-radius: 1rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all .2s;
  border: none;
  background: none;
  white-space: nowrap;
}
.mode-tab:hover { color: var(--text-primary); background: var(--surface); }
.mode-tab.active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.mode-panel { display: none; }
.mode-panel.active { display: block; }
.duration-slider-wrap { padding: .25rem 0; }
#durationSlider {
  width: 100%; height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}
#durationSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--surface);
  transition: transform .15s, box-shadow .15s;
}
#durationSlider::-webkit-slider-thumb:hover { transform: scale(1.15); box-shadow: 0 0 0 4px var(--accent-light); }
#durationSlider::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-sm);
}
#durationSlider::-moz-range-track { background: var(--border); border-radius: 3px; height: 6px; }
.duration-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-muted); margin-top: .4rem; }
.duration-labels .duration-value { font-weight: 700; color: var(--accent); font-size: .85rem; }
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 1.1rem;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--surface-alt);
  position: relative;
}
.upload-zone--compact { padding: 1rem .75rem; }
.upload-zone--compact .upload-icon { font-size: 1.4rem; margin-bottom: .25rem; }
.upload-zone--compact .upload-text { font-size: .78rem; }
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: rgba(14,165,233,.04); }
.upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone .upload-icon { font-size: 1.8rem; color: var(--accent); opacity: .5; margin-bottom: .4rem; }
.upload-zone .upload-text { font-size: .82rem; color: var(--text-secondary); }
.upload-zone .upload-hint { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; }
.upload-preview { position: relative; display: none; margin-bottom: .75rem; }
.upload-preview img, .upload-preview video {
  max-width: 100%;
  max-height: 180px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  object-fit: contain;
}
.upload-preview .remove-btn {
  position: absolute;
  top: .35rem;
  right: .35rem;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(239,68,68,.85);
  color: #fff;
  border: none;
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.video-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: .5rem;
  margin-top: .5rem;
}
.video-preset-card {
  padding: .6rem .4rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-alt);
  min-height: 72px;
}
.video-preset-card:hover { border-color: var(--accent); color: var(--text-primary); }
.video-preset-card.selected { border-color: var(--accent); background: rgba(14,165,233,.08); color: var(--accent); }
.video-preset-card .preset-icon { font-size: 1.3rem; display: block; margin-bottom: .25rem; }
.source-toggle {
  display: flex;
  gap: .25rem;
  margin-bottom: .75rem;
  background: var(--surface-alt);
  border-radius: .95rem;
  padding: .24rem;
  border: 1px solid var(--border);
}
.source-toggle-btn {
  flex: 1;
  text-align: center;
  min-height: 2.4rem;
  padding: .4rem .3rem;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: .8rem;
  border: none;
  background: none;
  color: var(--text-secondary);
  transition: all .2s;
}
.source-toggle-btn.active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.progress-ring { width: 72px; height: 72px; position: relative; margin-bottom: 1rem; }
.progress-ring .spinner-border { width: 72px; height: 72px; color: var(--accent) !important; border-width: .2em; }
.spinner-overlay .loading-text { color: var(--text-secondary); font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
.spinner-overlay .status-text { color: var(--text-muted); font-size: .82rem; }

/* ═══ Image/Video Page Header Icons ═══ */
.page-header-icon--image { background: var(--pink-bg); color: var(--pink); }
.page-header-icon--video { background: var(--sky-bg); color: var(--sky); }
.page-header-icon--accent { background: var(--accent-light); color: var(--accent); }

/* ═══ Preset Card Image Styles ═══ */
.preset-card-img {
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.preset-card-placeholder {
  height: 180px;
  background: var(--gradient-subtle);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preset-card-placeholder i { font-size: 2.5rem; opacity: .4; }
.preset-card-name { color: var(--text-primary); font-size: .9rem; }
.preset-card-badge--locked {
  right: auto;
  left: 14px;
  top: 14px;
  background: rgba(255, 193, 7, .94);
  color: #2f2100;
}
.preset-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .8rem;
}

/* ═══ Shared utility classes ═══ */
.icon-sm { font-size: .8rem; }
.icon-xs { font-size: .65rem; }
.letter-tight { letter-spacing: -.02em; }
.max-w-lg { max-width: 580px; }
.max-w-md { max-width: 520px; }
.max-w-sm { max-width: 480px; }

.preset-detail-page {
  max-width: 960px;
}

.preset-detail-breadcrumb {
  margin-bottom: 0;
}

.preset-detail-breadcrumb-link {
  color: var(--accent);
  text-decoration: none;
}

.preset-detail-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.preset-detail-media {
  background: var(--surface-alt);
}

.preset-detail-cover {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
}

.preset-detail-topline {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.preset-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.preset-detail-note {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.preset-detail-note--warning {
  background: var(--warning-bg, rgba(255, 193, 7, .14));
  color: var(--text-primary);
}

/* ═══ Responsive: Pages ═══ */
@media (max-width: 576px) {
  .profile-stat-grid { grid-template-columns: 1fr; }
  .history-table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .history-table { min-width: 540px; }
  .account-table td:first-child { width: auto; }
  .profile-actions { flex-direction: column; }
  .referral-input-group { flex-direction: column; }
  .buy-header { flex-direction: column; text-align: center; }
  .package-price .amount { font-size: 2rem; }
  .mode-tab { font-size: .72rem; padding: .4rem .25rem; }
  .video-preset-grid { grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)); }
  .billing-toolbar { flex-direction: column; align-items: stretch; }
  .billing-method-grid { grid-template-columns: 1fr; width: 100%; }
  .account-command-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .15rem; }
}

@media (max-width: 767.98px) {
  .settings-card { padding: 1.25rem; }
  .profile-card { padding: 1.25rem; }
  .profile-stat-card { padding: 1.25rem; }
  .profile-avatar { width: 60px; height: 60px; font-size: 1.5rem; }
}

/* ═══ Skeleton Loaders ═══ */
.skeleton {
  background: linear-gradient(105deg, var(--surface-alt) 30%, var(--surface-hover) 50%, var(--surface-alt) 70%);
  background-size: 300% 100%;
  animation: skeletonShimmer 2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeletonShimmer {
  0% { background-position: 300% 0; }
  100% { background-position: -100% 0; }
}
.skeleton-text { height: .88rem; margin-bottom: .5rem; }
.skeleton-text--sm { height: .72rem; }
.skeleton-text--lg { height: 1.2rem; }
.skeleton-circle { border-radius: 50%; }
.skeleton-card { height: 120px; border-radius: var(--radius-xl); }

/* ═══ Redesign Pages Overrides ═══ */
.presets-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr);
  gap: .85rem;
  align-items: stretch;
  margin-bottom: 1.3rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.1), transparent 26%),
    color-mix(in srgb, var(--surface) 97%, transparent);
  box-shadow: var(--shadow-sm);
}

.presets-hero-main {
  display: flex;
  align-items: start;
  gap: .85rem;
}

.presets-hero-copy h1 {
  margin: 0 0 .4rem;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.1;
}

.presets-hero-copy p {
  margin: 0;
  max-width: 38rem;
  font-size: .9rem;
  line-height: 1.55;
}

.presets-hero-side {
  display: grid;
  gap: .65rem;
}

.presets-hero-stat {
  display: grid;
  gap: .25rem;
  padding: .8rem .9rem;
  border-radius: 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.presets-hero-stat span {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .68rem;
  color: var(--text-muted);
  font-weight: 700;
}

.presets-hero-stat strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-primary);
}

.hero-nav {
  grid-column: 1 / -1;
  justify-content: flex-start;
  margin-top: .1rem;
}

.hero-nav-btn {
  min-height: 40px;
  padding: .58rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  text-decoration: none;
  font-weight: 700;
}

.section-block {
  margin-bottom: 1.65rem;
}

.section-header {
  margin-bottom: .8rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.18rem;
}

.section-link {
  min-height: 38px;
  padding: 0 .82rem;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: .8rem;
}

.workspace-page {
  display: grid;
  gap: 1rem;
}

.workspace-page > .page-tabs {
  margin-bottom: 0;
}

.workspace-grid {
  align-items: start;
  margin-top: 0;
}

.workspace-grid > [class*="col-"] {
  display: flex;
  flex-direction: column;
}

.workspace-grid .form-card,
.workspace-grid .result-card {
  height: 100%;
}

.task-card {
  border-radius: 1.1rem !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-sm);
}

.upload-zone:focus-visible,
.video-preset-card:focus-visible,
.source-toggle-btn:focus-visible,
.mode-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 991.98px) {
  .presets-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .presets-hero {
    padding: 1.15rem;
  }

  .presets-hero-main {
    gap: .75rem;
  }
}

.form-section {
  display: grid;
  gap: .35rem;
  margin-bottom: 1rem;
}

.form-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .35rem;
}

.form-section-heading h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.generation-summary-card {
  margin: .85rem 0 1rem;
  padding: .9rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  background: color-mix(in srgb, var(--surface-alt) 96%, transparent);
}

.generation-summary-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .7rem;
}

.generation-summary-header h3 {
  margin: 0;
  font-size: 1rem;
}

.generation-summary-cost {
  display: inline-flex;
  align-items: center;
  min-height: 2.15rem;
  padding: 0 .75rem;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), .08);
  color: var(--accent);
  font-weight: 700;
  font-size: .78rem;
}

.generation-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}

.generation-summary-item {
  display: grid;
  gap: .18rem;
  padding: .75rem .8rem;
  border-radius: .9rem;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
}

.generation-summary-item span {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: var(--text-muted);
  font-weight: 700;
}

.generation-summary-item strong {
  color: var(--text-primary);
  font-size: .88rem;
}

/* ═══ Generator Workspace Shared ═══ */
.workspace-hidden-panel {
  display: none;
}

.workspace-file-input {
  display: none;
}

.workspace-meta-note {
  font-size: .72rem;
  margin-top: .15rem;
}

.workspace-choice-btn {
  border-radius: var(--radius-md, 8px);
}

.tiny-spinner {
  width: .8rem;
  height: .8rem;
}

.history-title-icon-muted {
  opacity: .6;
}

.section-count {
  font-size: .82rem;
}

.empty-state-icon-lg {
  font-size: 3rem;
  color: var(--text-muted);
  opacity: .3;
}

.muted-copy {
  color: var(--text-secondary);
}

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

.generator-config-loading {
  display: none;
}

.upload-panel {
  display: none;
}

.upload-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md, 8px);
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}

.upload-dropzone:hover,
.upload-dropzone.drag-over {
  border-color: var(--accent, #ec4899);
  background: rgba(236, 72, 153, .04);
}

.upload-dropzone:focus-visible {
  outline: none;
  border-color: var(--accent, #ec4899);
  background: rgba(236, 72, 153, .06);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #ec4899) 18%, transparent);
}

.upload-dropzone-icon {
  font-size: 1.5rem;
  opacity: .5;
  margin-bottom: .25rem;
}

.upload-dropzone-text {
  font-size: .82rem;
  color: var(--text-secondary);
}

.upload-inline-trigger {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent, #ec4899);
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
}

.upload-previews {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
}

.upload-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  border: none;
  font-size: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.upload-counter {
  font-size: .75rem;
  color: var(--text-secondary);
  margin-top: .25rem;
}

.task-queue {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1rem;
  animation: fadeInUp .35s ease both;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: opacity .4s, max-height .4s, padding .4s, margin .4s;
}

.task-card--processing { border-left: 3px solid var(--accent, #ec4899); }
.task-card--completed { border-left: 3px solid #22c55e; }
.task-card--error { border-left: 3px solid #ef4444; }

.task-card--closing {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  padding: 0;
  margin-bottom: 0;
}

.task-card-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
  font-size: .82rem;
}

.task-card-prompt {
  color: var(--text-secondary);
  font-size: .78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.task-card-spinner {
  display: inline-block;
  width: .9rem;
  height: .9rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  color: var(--accent, #ec4899);
  flex-shrink: 0;
}

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

.task-card-status {
  font-weight: 600;
  flex-shrink: 0;
}

.task-card-status--processing { color: var(--accent, #ec4899); }
.task-card-status--completed { color: #22c55e; }
.task-card-status--error { color: #ef4444; }

.task-card-state-icon--success {
  color: #22c55e;
}

.task-card-state-icon--danger {
  color: #ef4444;
}

.task-card-body {
  margin-top: .5rem;
}

.task-card-image,
.task-card-video {
  max-width: 100%;
  border-radius: var(--radius-md, 8px);
}

.task-card-image {
  cursor: pointer;
}

.task-card-actions {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

.task-card-download {
  border-radius: var(--radius-md);
}

.task-card-meta {
  font-size: .75rem;
  color: var(--text-secondary);
}

.task-card-error {
  font-size: .82rem;
  color: #ef4444;
  margin-top: .25rem;
}

.task-card-elapsed {
  font-size: .72rem;
  color: var(--text-secondary);
  margin-left: auto;
}

.task-card-dismiss {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: .9rem;
  padding: 2px;
  line-height: 1;
  opacity: .5;
  transition: opacity .2s;
}

.task-card-dismiss:hover {
  opacity: 1;
}

.preset-detail-progress,
.preset-detail-result,
.preset-detail-result-image,
.preset-detail-result-video,
.preset-detail-result-text,
.preset-detail-error {
  display: none;
}

.preset-detail-spinner {
  width: 3rem;
  height: 3rem;
}

.preset-detail-progress-bar {
  height: 6px;
  border-radius: 3px;
}

.preset-detail-progress-bar .progress-bar {
  width: 100%;
  background: var(--gradient);
}

.preset-detail-result-media {
  max-height: 500px;
  box-shadow: var(--shadow-lg);
}

.preset-detail-result-video-player {
  max-width: 100%;
  max-height: 500px;
  box-shadow: var(--shadow-lg);
}

.preset-detail-result-copy {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  font-size: .92rem;
  line-height: 1.65;
  max-height: 500px;
  overflow-y: auto;
}

.preset-detail-error-alert {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius-md);
}

@media (max-width: 575.98px) {
  .generation-summary-grid {
    grid-template-columns: 1fr;
  }
}

.settings-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-bottom: 1.1rem;
}

.settings-overview-item {
  display: grid;
  gap: .2rem;
  padding: .8rem .9rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-sm);
}

.settings-overview-item span {
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .68rem;
  color: var(--text-muted);
  font-weight: 700;
}

.settings-overview-item strong {
  font-size: .88rem;
  color: var(--text-primary);
}

.settings-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), .05), transparent 28%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.settings-card--primary {
  background: var(--surface);
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.1), transparent 30%),
    color-mix(in srgb, var(--surface) 96%, transparent);
}

.settings-card--danger {
  border-color: color-mix(in srgb, var(--danger) 24%, var(--border));
}

.settings-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1rem;
  padding: .3rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-alt) 94%, transparent);
}

.settings-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: 0 .82rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
  transition: all .2s ease;
}

.settings-nav-link:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.settings-section-copy {
  margin: -.15rem 0 1rem;
  color: var(--text-secondary);
  font-size: .84rem;
  line-height: 1.55;
}

@media (max-width: 991.98px) {
  .settings-overview {
    grid-template-columns: 1fr;
  }
}
