.cs-widget {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e5e7eb;



  margin: 0 auto;
}

.cs-widget.cs-is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.cs-root {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cs-title {
  font-size: 1.5rem;
  margin: 0;
  color: #f3f4f6;
}

.cs-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
}

.cs-tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid #374151;
}

.cs-tab {
  position: relative;
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.2s ease;
}

.cs-tab:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.35);
  outline-offset: 2px;
}

.cs-tab::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.2s ease;
}

.cs-tab:hover {
  color: #a5b4fc;
}

.cs-tab-active {
  color: #f3f4f6;
}

.cs-tab-active::after {
  background: #4f46e5;
}

.cs-tab-panels {
  margin-top: 16px;
}

.cs-tab-panel[hidden] {
  display: none !important;
}

.cs-alert-info {
  background: #334155;
  color: #e5e7eb;
}

.cs-alert-error {
  background: #fee2e2;
  color: #991b1b;
}

.cs-alert-success {
  background: #e6f4ea;
  color: #166534;
}

.cs-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  align-items: start;
}

.cs-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-section-title {
  margin: 0;
  font-size: 1.1rem;
  color: #f3f4f6;
}

.cs-products-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.cs-subscriptions-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.cs-subscription-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #2d3748;
  border: 1px solid #4a5568;
  border-radius: 10px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cs-subscription-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-subscription-card:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.35);
  outline-offset: 2px;
}

.cs-subscription-card:hover {
  border-color: #4f46e5;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.15);
}

.cs-subscription-card.cs-selected {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.cs-subscription-body h4 {
  margin: 0;
  font-size: 1rem;
  color: #f3f4f6;
}

.cs-subscription-description {
  margin: 0;
  color: #9ca3af;
  font-size: 0.9rem;
}

.cs-subscription-pricing {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 1rem;
}

.cs-subscription-price {
  font-weight: 600;
  color: #a5b4fc;
}

.cs-subscription-interval {
  background: #3730a3;
  color: #c7d2fe;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.cs-subscription-credits {
  margin: 0;
  font-weight: 600;
  color: #34d399;
}

.cs-subscriptions-helper {
  margin: 0;
  margin-top: 4px;
  font-size: 0.85rem;
  color: #9ca3af;
}

.cs-subscription-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.cs-subscription-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid #4a5568;
  border-radius: 8px;
  padding: 10px 12px;
  background: #374151;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cs-subscription-option:hover {
  border-color: #4f46e5;
}

.cs-subscription-option.cs-selected {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
  background: #3730a3;
}

.cs-subscription-option-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #f3f4f6;
}

.cs-subscription-option-price {
  font-size: 0.85rem;
  color: #9ca3af;
}

.cs-product-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  background: #2d3748;
  border: 1px solid #4a5568;
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cs-product-card:hover {
  border-color: #4f46e5;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.15);
}

.cs-product-card.cs-selected {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.cs-product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: #4a5568;
}

.cs-product-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-product-body h4 {
  margin: 0;
  font-size: 1rem;
  color: #f3f4f6;
}

.cs-product-description {
  margin: 0;
  color: #9ca3af;
  font-size: 0.9rem;
}

.cs-product-pricing {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 0.95rem;
}

.cs-product-cutoff {
  text-decoration: line-through;
  color: #9ca3af;
}

.cs-product-price {
  font-weight: 600;
  color: #a5b4fc;
}

.cs-product-credits {
  margin: 0;
  font-weight: 600;
  color: #34d399;
}

.cs-or {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-weight: 500;
}

.cs-custom-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.cs-field span {
  font-weight: 500;
}

.cs-input {
  border: 1px solid #4a5568;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
  background: #374151;
  color: #f3f4f6;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cs-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
  outline: none;
}

.cs-input::placeholder {
  color: #9ca3af;
}

.cs-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs-slider {
  width: 100%;
}

.cs-slider-values {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #9ca3af;
}

.cs-custom-preview {
  margin: 0;
  font-size: 0.95rem;
  color: #a5b4fc;
}

.cs-billing-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.cs-root.cs-has-prefilled-billing .cs-billing-controls {
  grid-template-columns: 1fr;
}

.cs-root.cs-has-prefilled-billing .cs-billing-controls .cs-field,
.cs-root.cs-has-prefilled-billing .cs-billing-controls .cs-create-profile {
  display: none !important;
}

.cs-root.cs-has-prefilled-billing .cs-billing-controls .cs-billing-prefilled {
  display: block !important;
  font-size: 0.95rem;
  color: #e5e7eb;
  background: #374151;
  border: 1px solid #4a5568;
  border-radius: 8px;
  padding: 10px 12px;
}

.cs-summary-text {
  margin: 0;
  font-size: 1rem;
  color: #e5e7eb;
}

.cs-payment-element {
  padding: 16px;
  border: 1px solid #4a5568;
  border-radius: 12px;
  background: #374151;
}

.cs-saved-methods {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid #4a5568;
  border-radius: 12px;
  background: #2d3748;
}

.cs-saved-methods-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #f3f4f6;
}

.cs-saved-methods-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-saved-method {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.95rem;
  color: #e5e7eb;
}

.cs-saved-method input[type='radio'] {
  margin: 0;
  margin-top: 2px;
}

.cs-saved-method-description {
  line-height: 1.4;
}

.cs-payment-preferences {
  margin: 12px 0;
  display: flex;
  align-items: flex-start;
  font-size: 0.95rem;
  color: #e5e7eb;
}

.cs-save-payment-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}

.cs-save-payment-option input {
  margin-top: 3px;
}

.cs-payment-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cs-account-overview {
  border-top: 1px solid #374151;
  padding-top: 20px;
  gap: 18px;
}

.cs-account-balance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: #312e81;
  border-radius: 12px;
  padding: 16px 20px;
}

.cs-account-balance-label {
  font-weight: 500;
  color: #c7d2fe;
}

.cs-account-balance-value {
  font-size: 1.75rem;
  font-weight: 600;
  color: #a5b4fc;
}

.cs-account-collections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.cs-account-collection {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-account-purchases,
.cs-account-subscriptions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-account-collection-header h4 {
  margin: 0;
  font-size: 1rem;
  color: #f3f4f6;
}

.cs-account-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #4a5568;
  background: #2d3748;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.cs-account-card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.cs-account-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cs-account-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #f3f4f6;
}

.cs-account-card-meta {
  margin: 0;
  font-size: 0.9rem;
  color: #9ca3af;
  word-break: break-word;
}

.cs-account-card-sub {
  margin: 0;
  font-size: 0.8rem;
  color: #9ca3af;
  word-break: break-all;
}

.cs-account-card-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #9ca3af;
}

.cs-account-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.cs-button-small {
  padding: 8px 12px;
  font-size: 0.875rem;
}

.cs-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cs-status-success {
  background: #dcfce7;
  color: #166534;
}

.cs-status-warning {
  background: #fef3c7;
  color: #92400e;
}

.cs-status-danger {
  background: #fee2e2;
  color: #991b1b;
}

.cs-status-muted {
  background: #e5e7eb;
  color: #374151;
}

.cs-section-loading {
  opacity: 0.6;
  pointer-events: none;
}

.cs-button {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.cs-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cs-primary {
  background: #4f46e5;
  color: #ffffff;
}

.cs-primary:hover:not(:disabled) {
  background: #4338ca;
}

.cs-secondary {
  background: #4a5568;
  color: #f3f4f6;
}

.cs-secondary:hover:not(:disabled) {
  background: #5a6778;
}

.cs-link {
  background: transparent;
  color: #a5b4fc;
  padding-left: 0;
  padding-right: 0;
}

.cs-link:hover {
  text-decoration: underline;
}

.cs-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.9);
  border-radius: 12px;
  font-weight: 500;
  color: #a5b4fc;
}

.cs-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 4px solid rgba(79, 70, 229, 0.2);
  border-top-color: #4f46e5;
  animation: cs-spin 0.8s linear infinite;
}

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

.cs-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 9999;
}

.cs-modal {
  background: #1e293b;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.cs-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #334155;
  border-bottom: 1px solid #4a5568;
}

.cs-modal-header h3 {
  margin: 0;
  color: #f3f4f6;
}

.cs-modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: #9ca3af;
}

.cs-modal-body {
  padding: 20px;
}

.cs-modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.cs-modal-alert {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.9rem;
}

.cs-empty {
  margin: 0;
  color: #9ca3af;
}

@media (max-width: 768px) {
  .cs-widget {
    padding: 16px;
  }

  .cs-products-list {
    grid-template-columns: 1fr;
  }

  .cs-product-card {
    grid-template-columns: 1fr;
  }

  .cs-billing-controls {
    grid-template-columns: 1fr;
  }

  .cs-account-balance {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .cs-account-collections {
    grid-template-columns: 1fr;
  }

  .cs-account-card-actions {
    justify-content: flex-start;
  }
}
