/* Trust Wallet Checkout — premium Stripe-level UI */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-deep: #060608;
  --bg-panel: #0c0c0f;
  --bg-surface: #121216;
  --bg-raised: #18181d;
  --bg-input: rgba(255, 255, 255, 0.035);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(51, 117, 255, 0.55);
  --text: #f4f4f5;
  --text-secondary: rgba(255, 255, 255, 0.62);
  --text-muted: rgba(255, 255, 255, 0.42);
  --text-faint: rgba(255, 255, 255, 0.24);
  --tw-blue: #0500ff;
  --tw-blue-mid: #3375ff;
  --tw-blue-light: #5b9aff;
  --accent: #3375ff;
  --accent-hover: #4d8bff;
  --accent-glow: rgba(51, 117, 255, 0.22);
  --accent-soft: rgba(51, 117, 255, 0.1);
  --accent-border: rgba(51, 117, 255, 0.45);
  --success: #34d399;
  --error: #fca5a5;
  --error-bg: rgba(220, 38, 38, 0.08);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', 'Consolas', 'Monaco', monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 1px rgba(51, 117, 255, 0.15), 0 8px 40px rgba(51, 117, 255, 0.12);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ===== VIEWS ===== */
.view { display: none; min-height: 100vh; }
body[data-view="checkout"] #view-checkout,
body[data-view="admin"] #view-admin,
body[data-view="notfound"] #view-notfound { display: block; }

#view-notfound {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

body[data-view="notfound"] #view-notfound {
  display: flex;
}

/* ===== CHECKOUT SHELL ===== */
.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}

/* ===== LEFT — ORDER SUMMARY ===== */
.checkout-summary {
  position: relative;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.summary-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--bg-panel);
}

.summary-inner {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 40px 48px 56px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.brand span {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.secure-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.secure-pill svg {
  width: 11px;
  height: 11px;
  opacity: 0.6;
}

/* Product hero */
.summary-product {
  margin-bottom: 36px;
}

.summary-product h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.25;
  margin-bottom: 10px;
  max-width: 380px;
}

.summary-price-large {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.82) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity 0.2s var(--ease-out), transform 0.35s var(--ease-spring);
}

.summary-price-large.is-updating {
  opacity: 0.4;
  transform: scale(0.96);
}

.summary-price-large .currency-suffix {
  font-size: 0.55em;
  font-weight: 500;
  letter-spacing: -0.02em;
  -webkit-text-fill-color: var(--text-muted);
}

/* Tier cards — separate premium cards */
.tier-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.tier-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

.tier-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease-out),
    background 0.2s var(--ease-out),
    box-shadow 0.25s var(--ease-out),
    transform 0.2s var(--ease-out);
  user-select: none;
}

.tier-item:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.tier-item.selected {
  border-color: rgba(5, 0, 255, 0.35);
  background: rgba(51, 117, 255, 0.08);
  box-shadow: none;
}

.tier-item.selected:hover {
  transform: none;
}

.tier-badge {
  position: absolute;
  top: -9px;
  right: 14px;
  padding: 2px 8px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--tw-blue-mid), var(--tw-blue));
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  box-shadow: 0 4px 12px rgba(51, 117, 255, 0.4);
}

.tier-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  transition:
    border-color 0.18s var(--ease-out),
    background 0.18s var(--ease-out),
    box-shadow 0.18s var(--ease-out);
}

.tier-item.selected .tier-radio {
  border-color: var(--tw-blue);
  background: var(--tw-blue);
  box-shadow: none;
}

.tier-radio::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  border-radius: 0;
  background: transparent;
  opacity: 0;
  margin-top: -2px;
  transform: rotate(45deg) scale(0.5);
  transition: transform 0.22s var(--ease-spring), opacity 0.15s ease;
}

.tier-item.selected .tier-radio::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.tier-body h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}

.tier-body p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.tier-price {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

/* Order lines */
.order-lines {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.price-row .label { letter-spacing: -0.01em; }

.price-row .val {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text-secondary);
  transition: opacity 0.2s;
}

.price-row.total {
  padding-top: 0;
  margin-top: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.price-row.total .val {
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
}

.how-block {
  padding: 18px 20px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.how-block p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}

.summary-footer {
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-faint);
}

.summary-footer .powered {
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-footer .powered img {
  width: 18px;
  height: 18px;
  opacity: 0.65;
  object-fit: contain;
}

/* ===== RIGHT — PAYMENT FORM ===== */
.checkout-main {
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.checkout-main-inner {
  position: relative;
  width: 100%;
  max-width: 440px;
  animation: fadeUp 0.5s var(--ease-out) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Step indicator — Trust Wallet style */
.checkout-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.step {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: -0.02em;
  min-width: 0;
}

.step.active {
  color: var(--text);
}

.step.done {
  color: var(--text-secondary);
}

.step-label {
  white-space: nowrap;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition:
    border-color 0.18s var(--ease-out),
    background 0.18s var(--ease-out),
    color 0.18s var(--ease-out);
}

.step.active .step-num {
  background: var(--tw-blue);
  border-color: var(--tw-blue);
  color: #fff;
  box-shadow: none;
}

.step.done .step-num {
  background: var(--tw-blue);
  border-color: var(--tw-blue);
  color: transparent;
  position: relative;
}

.step.done .step-num::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.step-divider {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 12px;
  border-radius: 99px;
  min-width: 24px;
  max-width: 56px;
}

.step-divider--done {
  background: var(--tw-blue);
}

/* Fieldsets */
.fieldset {
  border: none;
  margin: 0 0 28px;
  padding: 0;
}

.fieldset-legend {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 14px;
  display: block;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group.full { grid-column: 1 / -1; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: -0.01em;
}

.input-wrap {
  position: relative;
}

.form-group input {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  letter-spacing: -0.01em;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.form-group input:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.045);
}

.form-group input:focus {
  border-color: var(--border-focus);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.1),
    0 0 0 3px var(--accent-glow);
  background: rgba(255, 255, 255, 0.05);
}

.form-group input::placeholder {
  color: var(--text-faint);
}

/* Payment method card */
.pay-method {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: visible;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pay-method:focus-within {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-glow);
}

/* Payment method dropdown */
.pay-method-select {
  position: relative;
  border-bottom: 1px solid var(--border);
}

.pay-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transition: background 0.15s ease;
}

.pay-select-trigger:hover {
  background: rgba(255, 255, 255, 0.045);
}

.pay-method-select.is-open .pay-select-trigger {
  background: rgba(255, 255, 255, 0.05);
}

.pay-select-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 50%;
}

.pay-select-info {
  flex: 1;
  min-width: 0;
}

.pay-select-info b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1px;
}

.pay-select-info span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pay-select-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-out), background 0.15s;
}

.pay-select-chevron svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.pay-method-select.is-open .pay-select-chevron {
  transform: rotate(180deg);
  background: rgba(51, 117, 255, 0.1);
  border-color: rgba(51, 117, 255, 0.25);
}

.pay-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(0, 0, 0, 0.2);
  padding: 6px;
  animation: dropdownIn 0.18s var(--ease-out) both;
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pay-select-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}

.pay-select-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.pay-select-option.selected {
  background: var(--accent-soft);
  border-color: rgba(51, 117, 255, 0.25);
}

.pay-option-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 50%;
}

.pay-option-info {
  flex: 1;
  min-width: 0;
}

.pay-option-info b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1px;
}

.pay-option-info span {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
}

.pay-option-check {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.2s var(--ease-spring);
  color: var(--accent);
}

.pay-option-check svg {
  width: 14px;
  height: 14px;
}

.pay-select-option.selected .pay-option-check {
  opacity: 1;
  transform: scale(1);
}

.pay-method-body {
  padding: 16px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

.pay-order-summary {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
}

.pay-order-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 3px 0;
}

.pay-order-row + .pay-order-row {
  margin-top: 6px;
}

.pay-order-label {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.pay-order-value {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: right;
}

.pay-order-amount {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.pay-tier-desc {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Pay button — Trust Wallet style */
.btn-pay {
  width: 100%;
  padding: 0 20px;
  height: 48px;
  background: var(--tw-blue);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.15s ease, transform 0.15s var(--ease-out);
  box-shadow: none;
  letter-spacing: -0.01em;
}

.btn-pay:hover {
  background: #1a15ff;
  transform: none;
  box-shadow: none;
}

.btn-pay:active {
  background: #0400cc;
  transform: scale(0.985);
  box-shadow: none;
}

.btn-pay:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-pay-logo-wrap {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.btn-pay-logo {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  object-fit: contain;
}

.btn-pay-text {
  font-size: 14px;
  font-weight: 600;
}

.btn-pay-text::after {
  content: '·';
  margin: 0 5px;
  font-weight: 500;
  opacity: 0.72;
}

.btn-pay-amount {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.2s;
}

.form-disclaimer {
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
  margin-top: 16px;
  line-height: 1.6;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* Mobile sticky pay bar */
.mobile-pay-bar {
  display: none;
}

/* ===== ADMIN ===== */
#view-admin {
  padding: 32px 20px 64px;
  overflow-x: hidden;
  background: var(--bg-deep);
}

.admin-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  min-width: 0;
}

.admin-header {
  text-align: center;
  margin-bottom: 28px;
}

.admin-header .brand {
  justify-content: center;
  margin-bottom: 12px;
}

.admin-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.admin-header .sub {
  font-size: 13px;
  color: var(--text-muted);
}

.cloud-badge {
  display: inline-block;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-top: 10px;
}

.cloud-badge--wait { color: var(--text-muted); }
.cloud-badge--on { color: var(--success); border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.06); }
.cloud-badge--off { color: var(--error); border-color: rgba(252, 165, 165, 0.3); background: var(--error-bg); }

.admin-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: none;
  min-width: 0;
  overflow-x: hidden;
}

.admin-card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.admin-card .card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.admin-section {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.admin-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.admin-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-grid .full { grid-column: 1 / -1; }

.admin-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.admin-hint {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  margin: -2px 0 8px;
  line-height: 1.4;
}

.admin-hint.block {
  margin: 0 0 12px;
}

.tier-section-top {
  margin-bottom: 14px;
}

.tier-section .admin-section-title {
  margin-bottom: 0;
}

.tier-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.tier-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
  min-width: 0;
  transition: border-color 0.15s ease;
}

.tier-card:focus-within {
  border-color: rgba(51, 117, 255, 0.35);
  box-shadow: none;
}

.tier-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.tier-card-index {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(51, 117, 255, 0.15);
  border: 1px solid rgba(51, 117, 255, 0.25);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.tier-card-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tier-card-label.is-placeholder {
  color: var(--text-faint);
  font-weight: 500;
}

.tier-remove {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  padding: 0;
}

.tier-remove svg {
  width: 14px;
  height: 14px;
}

.tier-remove:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(252, 165, 165, 0.3);
  color: var(--error);
}

.tier-remove:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.tier-card--solo .tier-remove {
  visibility: hidden;
}

.tier-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 12px 14px;
  padding: 14px;
  min-width: 0;
}

.tier-field {
  min-width: 0;
}

.tier-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.tier-field input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 11px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.tier-field input:focus {
  border-color: rgba(51, 117, 255, 0.45);
  box-shadow: none;
}

.tier-field input::placeholder {
  color: var(--text-faint);
}

.tier-field--desc {
  grid-column: 1 / -1;
}

.tier-price-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.tier-price-wrap:focus-within {
  border-color: rgba(51, 117, 255, 0.45);
  box-shadow: none;
}

.tier-price-symbol {
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  align-self: stretch;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
}

.tier-price-wrap input {
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 11px 12px;
  font-variant-numeric: tabular-nums;
}

.tier-price-wrap input:focus {
  box-shadow: none;
}

.tier-price-wrap input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.tier-price-wrap input[type="number"]::-webkit-outer-spin-button,
.tier-price-wrap input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-add-tier {
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-add-tier-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(51, 117, 255, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
}

.btn-add-tier:hover {
  border-color: rgba(51, 117, 255, 0.4);
  color: var(--text);
  background: rgba(51, 117, 255, 0.05);
}

.admin-field input,
.admin-field textarea,
.admin-field select {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
  resize: vertical;
}

.admin-field textarea {
  min-height: 72px;
  line-height: 1.5;
}

.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus {
  border-color: rgba(51, 117, 255, 0.45);
}

.admin-field input::placeholder,
.admin-field textarea::placeholder {
  color: var(--text-faint);
}

.theme-picker {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.theme-option {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option-text {
  display: block;
  padding: 11px 14px;
  border-radius: calc(var(--radius-sm) + 2px);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  letter-spacing: -0.02em;
  transition: background 0.15s ease, color 0.15s ease;
}

.theme-option:hover .theme-option-text {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.theme-option input:checked + .theme-option-text {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-icon:hover {
  background: var(--error-bg);
  border-color: rgba(252, 165, 165, 0.3);
  color: var(--error);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  margin-top: 8px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.btn-primary {
  width: 100%;
  padding: 13px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 8px;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 16px;
  width: 100%;
  text-align: center;
  transition: color 0.15s ease;
}

.btn-ghost:hover { color: var(--text-muted); }

.err {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--error-bg);
  border: 1px solid rgba(220, 38, 38, 0.15);
  color: var(--error);
  font-size: 12px;
  margin-bottom: 14px;
}

.result-box {
  margin-top: 20px;
  text-align: center;
}

.result-box .ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.result-box .ok::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}

.result-link {
  display: block;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  word-break: break-all;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.result-link:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(51, 117, 255, 0.3);
}

.copied-msg {
  font-size: 11px;
  color: var(--success);
  margin-top: 8px;
  display: none;
  font-weight: 600;
}

/* ===== 404 ===== */
.notfound-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  max-width: 420px;
  width: 100%;
}

.notfound-card h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.notfound-card p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== CHECKOUT LIGHT THEME ===== */
body.checkout-light {
  background: #f0f1f4;
  color: #0a0a0c;
  color-scheme: light;
}

#view-checkout.checkout-theme-light {
  --bg-deep: #f0f1f4;
  --bg-panel: #ffffff;
  --bg-surface: #ffffff;
  --bg-raised: #e8eaef;
  --bg-input: #ffffff;
  --border: rgba(0, 0, 0, 0.16);
  --border-strong: rgba(0, 0, 0, 0.26);
  --border-focus: rgba(5, 0, 255, 0.55);
  --text: #0a0a0c;
  --text-secondary: rgba(0, 0, 0, 0.82);
  --text-muted: rgba(0, 0, 0, 0.62);
  --text-faint: rgba(0, 0, 0, 0.5);
  --accent-glow: rgba(51, 117, 255, 0.18);
  --accent-soft: rgba(51, 117, 255, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 56px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 0 1px rgba(51, 117, 255, 0.18);
  background: var(--bg-deep);
  color: var(--text);
}

#view-checkout.checkout-theme-light .brand span,
#view-checkout.checkout-theme-light .summary-product h1,
#view-checkout.checkout-theme-light .tier-body h3,
#view-checkout.checkout-theme-light .price-row.total,
#view-checkout.checkout-theme-light .price-row.total .val,
#view-checkout.checkout-theme-light .pay-order-value,
#view-checkout.checkout-theme-light .pay-order-amount,
#view-checkout.checkout-theme-light .pay-select-info b,
#view-checkout.checkout-theme-light .step.active {
  color: #0a0a0c;
}

#view-checkout.checkout-theme-light .form-group label,
#view-checkout.checkout-theme-light .pay-select-info span {
  color: rgba(0, 0, 0, 0.72);
}

#view-checkout.checkout-theme-light .checkout-steps {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.12);
}

#view-checkout.checkout-theme-light .step.active,
#view-checkout.checkout-theme-light .step.active .step-label {
  color: #0a0a0c;
}

#view-checkout.checkout-theme-light .step.done .step-label {
  color: rgba(0, 0, 0, 0.58);
}

#view-checkout.checkout-theme-light .step-num {
  border-color: rgba(0, 0, 0, 0.18);
  background: #fff;
}

#view-checkout.checkout-theme-light .step.active .step-num,
#view-checkout.checkout-theme-light .step.done .step-num {
  border-color: var(--tw-blue);
  background: var(--tw-blue);
}

#view-checkout.checkout-theme-light .step-divider {
  background: rgba(0, 0, 0, 0.1);
}

#view-checkout.checkout-theme-light .step-divider--done {
  background: var(--tw-blue);
}

#view-checkout.checkout-theme-light .fieldset-legend,
#view-checkout.checkout-theme-light .tier-section-label {
  color: rgba(0, 0, 0, 0.55);
  font-weight: 700;
}

#view-checkout.checkout-theme-light .secure-pill {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.14);
  color: rgba(0, 0, 0, 0.65);
}

#view-checkout.checkout-theme-light .tier-item {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.14);
}

#view-checkout.checkout-theme-light .tier-body p,
#view-checkout.checkout-theme-light .pay-order-label,
#view-checkout.checkout-theme-light .pay-tier-desc,
#view-checkout.checkout-theme-light .form-disclaimer {
  color: rgba(0, 0, 0, 0.58);
}

#view-checkout.checkout-theme-light .tier-price {
  color: #0a0a0c;
}

#view-checkout.checkout-theme-light .form-group input {
  background: #fff;
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  color: #0a0a0c;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#view-checkout.checkout-theme-light .form-group input::placeholder {
  color: rgba(0, 0, 0, 0.38);
}

#view-checkout.checkout-theme-light .form-group input:hover {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.28);
}

#view-checkout.checkout-theme-light .form-group input:focus {
  background: #fff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#view-checkout.checkout-theme-light .pay-method {
  background: var(--bg-surface);
  border-color: rgba(0, 0, 0, 0.14);
}

#view-checkout.checkout-theme-light .pay-select-trigger {
  background: #fff;
}

#view-checkout.checkout-theme-light .pay-select-trigger:hover,
#view-checkout.checkout-theme-light .pay-method-select.is-open .pay-select-trigger {
  background: #fafbfc;
}

#view-checkout.checkout-theme-light .pay-order-summary {
  background: #f6f7f9;
  border-color: rgba(0, 0, 0, 0.12);
}

#view-checkout.checkout-theme-light .summary-footer {
  color: rgba(0, 0, 0, 0.5);
}

#view-checkout.checkout-theme-light .checkout-summary {
  background: var(--bg-panel);
  border-right-color: var(--border);
}

#view-checkout.checkout-theme-light .summary-bg {
  background: var(--bg-panel);
}

#view-checkout.checkout-theme-light .checkout-main {
  background: var(--bg-deep);
}

#view-checkout.checkout-theme-light .summary-price-large {
  background: linear-gradient(180deg, #0a0a0c 0%, rgba(10, 10, 12, 0.78) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

#view-checkout.checkout-theme-light .tier-item:hover {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.22);
}

#view-checkout.checkout-theme-light .tier-item.selected {
  background: rgba(5, 0, 255, 0.06);
  border-color: rgba(5, 0, 255, 0.32);
}

#view-checkout.checkout-theme-light .tier-radio {
  border-color: rgba(0, 0, 0, 0.2);
  background: #fff;
}

#view-checkout.checkout-theme-light .tier-item.selected .tier-radio {
  border-color: var(--tw-blue);
  background: var(--tw-blue);
}

#view-checkout.checkout-theme-light .how-block {
  background: #f6f7f9;
  border-color: rgba(0, 0, 0, 0.12);
}

#view-checkout.checkout-theme-light .pay-select-dropdown {
  background: #fff;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

#view-checkout.checkout-theme-light .pay-select-option:hover {
  background: rgba(0, 0, 0, 0.05);
}

#view-checkout.checkout-theme-light .mobile-pay-bar {
  background: rgba(255, 255, 255, 0.96);
  border-top-color: rgba(0, 0, 0, 0.12);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .checkout {
    grid-template-columns: 1fr;
  }

  .checkout-summary {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .summary-inner {
    min-height: auto;
    padding: 28px 24px 20px;
  }

  .summary-header { margin-bottom: 28px; }
  .summary-product h1 { font-size: 20px; }
  .summary-price-large { font-size: 36px; }
  .summary-footer { display: none; }

  .tier-list {
    gap: 6px;
    margin-bottom: 24px;
  }

  .tier-item {
    grid-template-columns: 16px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 2px 10px;
    padding: 10px 12px;
    align-items: start;
  }

  .tier-item:hover {
    transform: none;
  }

  .tier-radio {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: center;
    width: 18px;
    height: 18px;
    border-width: 2px;
  }

  .tier-item.selected .tier-radio {
    box-shadow: none;
  }

  .tier-radio::after {
    width: 4px;
    height: 7px;
    border-width: 0 1.5px 1.5px 0;
    margin-top: -1px;
  }

  .tier-body {
    grid-column: 2;
    grid-row: 1 / -1;
    min-width: 0;
  }

  .tier-body h3 {
    font-size: 13px;
    margin-bottom: 2px;
    line-height: 1.25;
    padding-right: 4px;
  }

  .tier-body p {
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .tier-price {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    padding-left: 8px;
  }

  .order-lines {
    padding: 12px 0;
    margin-bottom: 0;
  }

  .price-row {
    padding: 0;
  }

  .price-row.total {
    font-size: 15px;
  }

  .price-row.total .val {
    font-size: 15px;
  }

  .checkout-main {
    padding: 28px 24px 100px;
    align-items: flex-start;
  }

  .mobile-pay-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(6, 6, 8, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    z-index: 100;
  }

  .mobile-pay-bar .btn-pay {
    width: 100%;
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 18px;
  }

  #payBtnSlot {
    width: 100%;
  }

  .checkout-main .btn-pay {
    display: none;
  }
}

@media (max-width: 560px) {
  .summary-inner,
  .checkout-main {
    padding-left: 18px;
    padding-right: 18px;
  }

  .form-row { grid-template-columns: 1fr; }
  .secure-pill { display: none; }

  .tier-item {
    padding: 9px 10px;
    gap: 2px 8px;
  }

  .tier-body h3 {
    font-size: 12.5px;
  }

  .tier-body p {
    font-size: 10.5px;
    line-height: 1.3;
  }

  .tier-price {
    font-size: 12.5px;
    padding-left: 6px;
  }

  .admin-grid { grid-template-columns: 1fr; }
  .admin-card { padding: 24px 18px; }

  .tier-card-body {
    grid-template-columns: 1fr;
  }

  .tier-field--price {
    max-width: 160px;
  }
}

@media (min-width: 961px) {
  .checkout-summary {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }

  .checkout-summary::-webkit-scrollbar {
    width: 4px;
  }

  .checkout-summary::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
  }
}
