/* ==========================================================
   App flow styles — login/register/interpret/account/buy-tokens.
   Loaded alongside css/styles.css (design tokens defined there).
   Kept separate from styles.css on purpose: that file is inlined
   as critical CSS on every marketing page, so it stays lean.
   ========================================================== */

/* styles.css hard-codes `html { direction: rtl }` (and rtl form fields) for
   the Arabic-only marketing site, which overrides the dir attribute. The app
   shell is bilingual — app-header.php / app-router.js set <html dir>, so
   follow it here. */
html[dir="ltr"] { direction: ltr; }
html[dir="ltr"] .form-input,
html[dir="ltr"] .form-textarea,
html[dir="ltr"] .form-select { direction: ltr; }

.app-body {
  background: var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ── */
.app-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--green-dark);
  border-bottom: 1px solid rgba(201,164,74,0.2);
}
.app-navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.app-nav-logo { font-size: 19px; white-space: nowrap; }
.app-nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.app-nav-link {
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.app-nav-link:hover, .app-nav-link.active { color: var(--gold); }
.app-btn-sm { padding: 9px 18px; font-size: 13px; }
.app-token-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(201,164,74,0.15);
  border: 1px solid rgba(201,164,74,0.35);
  border-radius: 100px;
  padding: 5px 14px;
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.app-lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
}
.app-lang-switch a { color: rgba(255,255,255,0.55); }
.app-lang-switch a.active { color: var(--gold); }

@media (max-width: 640px) {
  .app-navbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding-block: 10px;
    row-gap: 10px;
    justify-content: center;
  }
  .app-nav-logo { flex: 1 1 100%; justify-content: center; display: flex; order: -1; }
  .app-nav-right {
    flex: 1 1 100%;
    width: 100%;
    row-gap: 8px;
    column-gap: 10px;
    justify-content: center;
    align-items: center;
  }
}

.app-main { flex: 1; padding: 48px 0 80px; }
.app-notice-bar { margin-top: auto; }

/* ── Footer ── */
.app-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.6);
  padding: 24px 0;
  font-size: 13px;
}
.app-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
}
.app-footer-inner a { color: rgba(255,255,255,0.6); }
.app-footer-inner a:hover { color: var(--gold); }

/* ── Auth cards (login/register) ── */
.auth-card-wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 24px;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  border: 1px solid rgba(27,67,50,0.08);
  box-shadow: var(--shadow-sm);
}
.auth-card h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--green-dark);
  text-align: center;
  margin-bottom: 6px;
}
.auth-card .auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(27,67,50,0.12);
}
.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-mid);
}
.auth-switch a { color: var(--green-prime); font-weight: 700; }
.auth-google-btn-slot { display: flex; justify-content: center; min-height: 44px; }
.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 18px;
  cursor: pointer;
}
.alert-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
}
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }

/* ── Interpret page ── */
.interpret-wrap {
  position: relative;
  isolation: isolate; /* keeps the hero glow (z-index:-1) above the page background */
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}
.interpret-hero {
  position: relative;
  text-align: center;
  margin-bottom: 32px;
  padding-top: 8px;
}
/* Soft moonlight glow behind the heading */
.interpret-hero::before {
  content: '';
  position: absolute;
  inset: -40px 10% auto;
  height: 220px;
  background: radial-gradient(ellipse at center, rgba(201,164,74,0.18), transparent 70%);
  z-index: -1;
  pointer-events: none;
}
.interpret-eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(201,164,74,0.12);
  border: 1px solid rgba(201,164,74,0.35);
  color: var(--green-prime);
  font-size: 12.5px;
  font-weight: 700;
}
.interpret-hero h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 10px;
}
.interpret-hero p { color: var(--text-mid); font-size: 15px; max-width: 560px; margin: 0 auto; }
.interpret-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid rgba(27,67,50,0.08);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
/* Gold accent along the top edge of the card */
.interpret-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--green-light), var(--gold), var(--gold-light));
}
.interpret-form-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 10px;
}
.interpret-form-label { font-size: 16px; font-weight: 800; color: var(--green-dark); }
.interpret-form-tip { font-size: 12.5px; color: var(--text-muted); }
.interpret-textarea-wrap { position: relative; }
.interpret-textarea {
  display: block;
  width: 100%;
  min-height: 180px;
  border: 1.5px solid rgba(27,67,50,0.15);
  border-radius: var(--radius-md);
  padding: 16px 16px 34px;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-dark);
  background: var(--cream);
  resize: vertical;
  transition: var(--transition);
}
.interpret-textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(201,164,74,0.15);
}
.interpret-char-count {
  position: absolute;
  inset-block-end: 10px;
  inset-inline-end: 14px;
  font-size: 11.5px;
  color: var(--text-muted);
  pointer-events: none;
  direction: ltr;
}
.interpret-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.interpret-examples-label { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.interpret-example-chip {
  font-family: inherit;
  font-size: 12.5px;
  color: var(--green-prime);
  background: var(--white);
  border: 1px solid rgba(27,67,50,0.15);
  border-radius: 100px;
  padding: 5px 12px;
  cursor: pointer;
  transition: var(--transition);
}
.interpret-example-chip:hover { border-color: var(--gold); background: rgba(201,164,74,0.1); }
.interpret-submit {
  width: 100%;
  justify-content: center;
  margin-top: 18px;
  padding-block: 16px;
  font-size: 16px;
  box-shadow: 0 8px 20px rgba(201,164,74,0.35);
}
.interpret-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(201,164,74,0.45); }
.interpret-reassure { margin-top: 12px; text-align: center; font-size: 12.5px; color: var(--text-muted); }
.interpret-cost-note a { color: var(--green-prime); font-weight: 700; text-decoration: underline; }

/* ── Below-the-card: deliverables, sources, trust ── */
.interpret-extras { margin-top: 44px; }
.interpret-extras-heading { text-align: center; font-size: 20px; font-weight: 800; color: var(--green-dark); margin-bottom: 18px; }
.interpret-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.interpret-feature {
  background: var(--white);
  border: 1px solid rgba(27,67,50,0.08);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.interpret-feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.interpret-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(201,164,74,0.15);
  font-size: 18px;
  margin-bottom: 10px;
}
.interpret-feature h3 { font-size: 15px; font-weight: 800; color: var(--green-prime); margin-bottom: 4px; }
.interpret-feature p { font-size: 13px; color: var(--text-mid); line-height: 1.7; }
.interpret-sources {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.interpret-sources strong { font-family: 'Amiri', serif; font-size: 17px; color: var(--green-dark); }
.interpret-trust {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(27,67,50,0.15);
}
.interpret-trust a { font-size: 12.5px; font-weight: 600; color: var(--text-mid); }
.interpret-trust a:hover { color: var(--green-prime); }
.interpret-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.interpret-cost-note { font-size: 13px; color: var(--text-muted); }
.interpret-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cream-dark);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--green-prime);
}
.interpret-result {
  margin-top: 0px;
  padding-top: 4px;
  animation: interpretFadeIn 0.5s ease both;
}
@keyframes interpretFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.interpret-result-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--green-dark), var(--green-prime));
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 24px;
}
.interpret-result-banner-icon {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}
.interpret-result-banner h2 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.interpret-result-text {
  white-space: pre-wrap;
  line-height: 1.95;
  color: var(--text-dark);
  font-size: 15.5px;
}

/* ── Structured interpretation sections (## headings parsed from the AI response), rendered as a stack of cards ── */
.interpret-section {
  background: var(--cream);
  border: 1px solid rgba(27,67,50,0.07);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 14px;
  transition: var(--transition);
}
.interpret-section:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.interpret-section:last-of-type { margin-bottom: 0; }
.interpret-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.interpret-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  font-size: 15px;
}
.interpret-section h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--green-dark);
  margin: 0;
}
.interpret-section-body {
  white-space: pre-wrap;
  line-height: 1.9;
  color: var(--text-dark);
  font-size: 15px;
  padding-inline-start: 0;
}
.interpret-insight-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 18px;
}
.interpret-insight-divider::before,
.interpret-insight-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,164,74,0.4));
}
.interpret-insight-divider::after { background: linear-gradient(90deg, rgba(201,164,74,0.4), transparent); }
.interpret-insight-divider-pill {
  flex-shrink: 0;
  background: rgba(201,164,74,0.12);
  border: 1px solid rgba(201,164,74,0.35);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: #8a6d1f;
  white-space: nowrap;
}
.interpret-section--insight {
  background: linear-gradient(135deg, rgba(201,164,74,0.08), rgba(201,164,74,0.03));
  border: 1px solid rgba(201,164,74,0.3);
  border-inline-start: 3px solid var(--gold);
}
.interpret-section--insight h3 { color: #8a6d1f; }
.interpret-section--insight .interpret-section-icon { background: var(--gold); }
.interpret-section--warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.interpret-section--warning h3 { color: #9a3412; }
.interpret-section--warning .interpret-section-icon { background: #fed7aa; }

.interpret-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 24px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-muted);
  background: var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.interpret-result-actions {
  margin-top: 24px;
  text-align: center;
}
.interpret-insufficient {
  margin-top: 20px;
  text-align: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 20px;
}
.interpret-insufficient p { color: #9a3412; margin-bottom: 14px; font-weight: 600; }
#interpret-insufficient {
  margin-bottom: 20px;
}

/* ── Interpretation loading animation (shown for a minimum of 5s — see interpret.php) ── */
.interpret-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 20px 48px;
  text-align: center;
}
.interpret-loading-orb {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
}
.interpret-loading-orb::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,164,74,0.35), transparent 70%);
  animation: interpretLoadingPulse 2.2s ease-in-out infinite;
}
.interpret-loading-moon {
  position: relative;
  z-index: 2;
  font-size: 44px;
  line-height: 1;
  animation: interpretLoadingFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(201,164,74,0.55));
}
.interpret-loading-ring {
  position: absolute;
  inset: 0;
  width: 75px;
  animation: interpretLoadingSpin 7s linear infinite;
}
.interpret-loading-star {
  position: absolute;
  color: var(--gold);
  font-size: 13px;
  text-shadow: 0 0 8px rgba(201,164,74,0.7);
}
.interpret-loading-star.s1 { top: 0; left: 50%; transform: translateX(-50%); }
.interpret-loading-star.s2 { bottom: 10px; right: 2px; }
.interpret-loading-star.s3 { bottom: 10px; left: 2px; }
@keyframes interpretLoadingPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.6; }
  50%      { transform: scale(1.15); opacity: 1; }
}
@keyframes interpretLoadingFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-8px) rotate(4deg); }
}
@keyframes interpretLoadingSpin {
  to { transform: rotate(360deg); }
}
.interpret-loading-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--green-prime);
  min-height: 22px;
  transition: opacity 0.35s ease;
}
.interpret-loading-bar {
  width: 220px;
  max-width: 100%;
  height: 5px;
  border-radius: 100px;
  background: var(--cream-dark);
  overflow: hidden;
  margin-top: 22px;
  position: relative;
}
.interpret-loading-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: 100px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: interpretLoadingBar 1.4s ease-in-out infinite;
}
@keyframes interpretLoadingBar {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(380%); }
}

/* ── Account dashboard ── */
.account-wrap { max-width: 920px; margin: 0 auto; padding: 0 24px; }
.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}
.account-header h1 { font-size: 26px; font-weight: 800; color: var(--green-dark); }
.account-balance-card {
  background: linear-gradient(135deg, var(--green-dark), var(--green-prime));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
}
.account-balance-value { font-size: 36px; font-weight: 800; color: var(--gold-light); }
.account-balance-label { font-size: 13px; color: rgba(255,255,255,0.65); margin-top: 4px; }
.account-section { margin-bottom: 32px; }
.account-section h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 14px;
}
.account-table-wrap {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid rgba(27,67,50,0.08);
  overflow: hidden;
  overflow-x: auto;
}
.account-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.account-table th {
  background: var(--cream);
  padding: 10px 16px;
  text-align: start;
  font-weight: 700;
  color: var(--green-prime);
  white-space: nowrap;
}
.account-table td { padding: 10px 16px; border-top: 1px solid var(--cream-dark); vertical-align: middle; }
.account-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(27,67,50,0.15);
}
.status-pill {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}
.status-completed, .status-success { background: #dcfce7; color: #15803d; }
.status-pending { background: #fef3c7; color: #b45309; }
.status-failed { background: #fee2e2; color: #b91c1c; }
.status-refunded { background: #f1f5f9; color: #475569; }

/* ── Buy tokens ── */
.buy-tokens-wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; text-align: center; }
.buy-tokens-wrap h1 { font-size: 28px; font-weight: 800; color: var(--green-dark); margin-bottom: 8px; }
.buy-tokens-wrap > p { color: var(--text-mid); margin-bottom: 36px; }
.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.package-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(27,67,50,0.1);
  padding: 28px 24px;
  text-align: center;
  transition: var(--transition);
}
.package-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.package-tokens { font-size: 30px; font-weight: 800; color: var(--green-prime); }
.package-tokens-unit { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.package-price { font-size: 22px; font-weight: 800; color: var(--gold); margin-bottom: 18px; }
.package-buy-btn { width: 100%; justify-content: center; }

/* ── Inline Paddle checkout (embedded, not the default overlay popup) ── */
.paddle-checkout-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px 0;
  text-align: start;
}
.paddle-checkout-back {
  background: none;
  border: none;
  color: var(--green-prime);
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 8px;
}
.paddle-checkout-back:hover { color: var(--green-dark); }
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.paddle-checkout-frame-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(27,67,50,0.08);
  box-shadow: var(--shadow-md);
  padding: 24px 20px 12px;
  min-height: 450px;
  overflow: hidden;
}
/* Same green→gold strip as the interpret card */
.paddle-checkout-frame-card::before,
.checkout-summary::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--green-light), var(--gold), var(--gold-light));
}
.paddle-checkout-frame { width: 100%; }
.checkout-summary {
  position: sticky;
  top: 84px;
  overflow: hidden;
  background: var(--green-dark);
  color: rgba(255,255,255,0.85);
  border-radius: var(--radius-lg);
  padding: 26px 22px 20px;
  box-shadow: var(--shadow-md);
}
.checkout-summary h2 { font-size: 17px; font-weight: 800; color: var(--white); margin-bottom: 16px; }
.checkout-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.checkout-summary-name { font-weight: 800; color: var(--gold-light); font-size: 16px; }
.checkout-summary-meta { font-size: 12.5px; color: rgba(255,255,255,0.6); margin-top: 2px; }
.checkout-summary-amount { font-weight: 700; color: var(--white); white-space: nowrap; }
.checkout-summary-amount, .checkout-totals dd { direction: ltr; unicode-bidi: isolate; }
.checkout-totals { margin: 12px 0 0; }
.checkout-totals > div[hidden] { display: none; }
.checkout-totals > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13.5px; }
.checkout-totals dt { color: rgba(255,255,255,0.7); }
.checkout-totals dd { margin: 0; color: var(--white); font-weight: 600; white-space: nowrap; }
.checkout-totals .is-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 15.5px;
}
.checkout-totals .is-total dt { color: var(--white); font-weight: 800; }
.checkout-totals .is-total dd { color: var(--gold-light); font-weight: 800; }
.checkout-summary-note {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(201,164,74,0.12);
  color: var(--gold-light);
  font-size: 12.5px;
  font-weight: 600;
}
.checkout-trust { list-style: none; margin: 14px 0 0; padding: 0; font-size: 12.5px; }
.checkout-trust li { padding: 3px 0; color: rgba(255,255,255,0.7); }
.checkout-trust a { color: rgba(255,255,255,0.85); text-decoration: underline; }
.checkout-trust a:hover { color: var(--gold-light); }
@media (max-width: 860px) {
  .checkout-layout { grid-template-columns: 1fr; }
  /* On phones show what they're paying for before the form */
  .checkout-summary { position: static; order: -1; }
}
@media (max-width: 640px) {
  .paddle-checkout-wrap { padding: 16px 16px 0; }
  .paddle-checkout-frame-card { padding: 20px 8px 8px; border-radius: var(--radius-md); }
}

/* ── App-shell client-side routing (js/app-router.js) ── */
.app-progress-bar {
  position: fixed;
  top: 0; inset-inline: 0;
  height: 3px;
  z-index: 300;
  background: transparent;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.app-progress-bar--active { opacity: 1; }
.app-progress-bar--active::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-light), transparent);
  animation: appProgressSlide 1.1s ease-in-out infinite;
}
@keyframes appProgressSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.app-main {
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.app-main.app-main-fade {
  opacity: 0;
  transform: translateY(8px);
}

/* ── Mobile polish ── */
@media (max-width: 600px) {
  .app-main { padding: 28px 0 56px; }
  .interpret-wrap, .account-wrap, .buy-tokens-wrap, .auth-card-wrap { padding: 0 16px; }
  .interpret-card, .auth-card { padding: 22px 18px; border-radius: var(--radius-md); }
  .interpret-hero h1 { font-size: 24px; }
  .interpret-hero p { font-size: 13.5px; }
  .interpret-textarea { min-height: 140px; font-size: 14px; }
  .interpret-features { grid-template-columns: 1fr; }
  .interpret-form-head { flex-direction: column; align-items: flex-start; }
  .interpret-footer-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .interpret-balance-pill { justify-content: center; }
  .interpret-result-banner { padding: 14px 16px; }
  .interpret-section { padding: 14px 16px; }
  .interpret-section-body { margin-top: 8px; }
  .interpret-section-head { align-items: flex-start; }
  .account-balance-card { padding: 22px 20px; flex-direction: column; align-items: flex-start; }
  .account-balance-card .btn { width: 100%; justify-content: center; }
  .account-header h1 { font-size: 22px; }
  .account-table th, .account-table td { padding: 8px 10px; font-size: 12.5px; }
  .package-grid { grid-template-columns: 1fr; }
  .auth-card h1 { font-size: 20px; }
  .app-nav-link { font-size: 13px; }
  .app-btn-sm { padding: 8px 14px; font-size: 12.5px; }
  .app-footer-inner { flex-direction: column; text-align: center; gap: 8px; }
  .interpret-loading { padding: 40px 12px 36px; }
  .interpret-loading-orb { width: 90px; height: 90px; }
  .interpret-loading-moon { font-size: 36px; }
}

/* Larger tap targets on touch devices */
@media (hover: none) and (pointer: coarse) {
  .app-nav-link, .app-lang-switch a { min-height: 36px; display: inline-flex; align-items: center; }
  .btn, .package-buy-btn, .paddle-checkout-back { min-height: 44px; }
}

/* ── Pricing page, purchase disclosures, legal pages ── */
.package-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.legal-purchase-note { max-width: 640px; margin: 28px auto 0; font-size: 13px; line-height: 1.8; color: var(--text-muted); }
.legal-purchase-note p { margin: 0 0 6px; }
.legal-purchase-note a { color: var(--green-prime); font-weight: 600; text-decoration: underline; }
.pricing-info { display: grid; gap: 20px; margin: 40px 0 28px; text-align: start; }
.pricing-info-block { background: var(--white); border: 1px solid rgba(27,67,50,0.08); border-radius: var(--radius-md); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.pricing-info-block h2 { font-size: 19px; font-weight: 800; color: var(--green-dark); margin-bottom: 10px; }
.pricing-info-block ol, .pricing-info-block ul { margin: 0; padding-inline-start: 22px; color: var(--text-mid); line-height: 2; }
.pricing-info-block p { margin: 0; color: var(--text-mid); line-height: 1.9; }
.legal-wrap { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.legal-wrap h1 { font-size: 28px; font-weight: 800; color: var(--green-dark); margin-bottom: 20px; text-align: center; }
.legal-card { background: var(--white); border-radius: var(--radius-lg); padding: 40px; border: 1px solid rgba(27,67,50,0.08); box-shadow: var(--shadow-sm); }
.app-footer-inner { flex-wrap: wrap; }
@media (max-width: 640px) {
  .legal-wrap { padding: 0 16px; }
  .legal-card { padding: 24px 18px; }
}

/* ── Guest → account → payment → result flow (includes/flow-banner.php) ── */
.flow-banner { max-width: 440px; margin: 0 auto 18px; }
.buy-tokens-wrap .flow-banner { max-width: 640px; margin-bottom: 28px; text-align: start; }
.flow-steps {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin: 0 0 14px;
  padding: 0;
  counter-reset: none;
}
.flow-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
}
/* connector line between steps */
.flow-step:not(:first-child)::before {
  content: '';
  position: absolute;
  top: 13px;
  inset-inline-end: 50%;
  width: 100%;
  height: 2px;
  background: var(--cream-dark);
  z-index: 0;
}
.flow-step.is-done:not(:first-child)::before,
.flow-step.is-current:not(:first-child)::before { background: var(--gold); }
.flow-step-dot {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  background: var(--white);
  border: 2px solid var(--cream-dark);
  color: var(--text-muted);
}
.flow-step.is-done .flow-step-dot { background: var(--gold); border-color: var(--gold); color: var(--green-dark); }
.flow-step.is-current .flow-step-dot { border-color: var(--gold); color: var(--green-dark); box-shadow: 0 0 0 4px rgba(201,164,74,0.18); }
.flow-step.is-current .flow-step-label { color: var(--green-dark); font-weight: 700; }
.flow-saved {
  background: var(--white);
  border: 1px solid rgba(201,164,74,0.4);
  border-inline-start: 4px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.flow-saved-title { font-weight: 800; color: var(--green-dark); font-size: 14.5px; margin-bottom: 6px; }
.flow-saved-dream { font-size: 13px; color: var(--text-mid); font-style: italic; line-height: 1.7; margin-bottom: 6px; }
.flow-saved-msg { font-size: 13px; color: var(--green-prime); font-weight: 600; }

.flow-paid {
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 24px;
  margin-bottom: 24px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(27,67,50,0.08);
  box-shadow: var(--shadow-md);
}
.flow-paid p { font-weight: 700; color: var(--green-dark); }
.flow-paid-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--cream-dark);
  border-top-color: var(--gold);
  animation: flowSpin 0.9s linear infinite;
}
@keyframes flowSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .flow-paid-spinner { animation-duration: 3s; } }
@media (max-width: 640px) {
  .flow-step-label { font-size: 10.5px; }
}
