:root {
  --bg: #fcfbf8;
  --bg-warm: #f6f3ec;
  --surface: #ffffff;
  --surface-soft: #f8f7f3;
  --ink: #1e293b;
  --ink-strong: #0f172a;
  --muted: #475569;

  --hairline: rgba(15, 23, 42, 0.08);
  --hairline-strong: rgba(15, 23, 42, 0.14);
  --border: var(--hairline);
  --border-warm: rgba(217, 119, 6, 0.28);

  /* Refined deep teal primary accent + warm amber/terracotta secondary highlight */
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-soft: #f0fdfa;

  --primary: #d97706;
  --primary-dark: #b45309;
  --primary-soft: #fffbeb;

  --green: #15803d;
  --green-soft: #ecfdf5;
  --green-border: rgba(21, 128, 61, 0.24);

  --paypal: #0f766e;
  --paypal-dark: #115e59;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.06);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-enter: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  overflow-x: clip;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
.brand-text {
  font-family: "Fredoka", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-strong);
  letter-spacing: -0.02em;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: clamp(16px, 3vw, 32px);
}

.sr-only-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Tabular numerals across prices, counts, and order telemetry */
.price-value,
#tabStoryPrice,
#tabBilingualPrice,
#tabBilingualBundlePrice,
.price-pill,
.showcase-spec-pill,
.topic-count-pill,
.selected-count-badge,
.story-progress-pct,
.checkout-price-tag,
#checkoutBtnPrice,
.order-item-meta,
.order-detail-product,
.order-item-id {
  font-variant-numeric: tabular-nums;
}

/* Editorial Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(252, 251, 248, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-strong);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 34px;
  height: 34px;
  display: block;
}

.brand-text {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  padding: 6px 0;
  transition: color 0.15s var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1.5px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s var(--ease);
}

.nav-links a:hover {
  color: var(--ink-strong);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-cta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.customer-auth-bar {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.auth-logged-out,
.auth-logged-in {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-auth-google,
.btn-auth-orders,
.btn-auth-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 700;
  padding: 6px 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.09s var(--ease);
}

.btn-auth-google {
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-strong);
  box-shadow: var(--shadow-sm);
}

.btn-auth-google:hover {
  border-color: rgba(15, 23, 42, 0.28);
  background: var(--surface-soft);
}

.btn-auth-google:active,
.btn-auth-orders:active,
.btn-auth-signout:active {
  transform: translateY(1px);
}

.google-g-icon {
  display: block;
  flex-shrink: 0;
}

.customer-email-pill {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--hairline-strong);
  color: var(--ink-strong);
  font-size: 0.77rem;
  font-weight: 700;
}

.btn-auth-orders {
  border: 1px solid rgba(15, 118, 110, 0.28);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.btn-auth-orders:hover {
  background: #ccfbf1;
  border-color: var(--teal);
}

.btn-auth-signout {
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--muted);
}

.btn-auth-signout:hover {
  border-color: rgba(15, 23, 42, 0.26);
  color: var(--ink-strong);
  background: var(--surface-soft);
}

.ui-lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.ui-lang-icon {
  position: absolute;
  left: 11px;
  font-size: 0.92rem;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}

.ui-lang-switcher::after {
  content: "▾";
  position: absolute;
  right: 11px;
  font-size: 0.7rem;
  color: var(--ink-strong);
  pointer-events: none;
}

#uiLangSelect {
  width: auto;
  min-width: 120px;
  min-height: 38px;
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 26px 6px 31px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-strong);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

#uiLangSelect:hover {
  border-color: var(--teal);
  background: var(--surface-soft);
}

#uiLangSelect:focus-visible {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

/* Badges */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.77rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.pill-warm {
  background: var(--primary-soft);
  color: #92400e;
  border: 1px solid var(--border-warm);
}

.pill-teal {
  background: var(--teal-soft);
  color: var(--teal-dark);
  border: 1px solid rgba(15, 118, 110, 0.22);
}

.pill-green {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green-border);
}

/* Hero Section (First-screen editorial framing) */
@keyframes abw-hero-rise {
  from {
    opacity: 0.94;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes abw-hero-media-settle {
  from {
    transform: scale(1.025);
  }
  to {
    transform: scale(1);
  }
}

.hero-section {
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
  padding: clamp(32px, 5vh, 64px) 0 clamp(40px, 6vh, 72px);
  min-height: min(720px, calc(100dvh - 68px));
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.hero-copy > * {
  animation: abw-hero-rise 0.55s var(--ease-enter) both;
}

.hero-copy > *:nth-child(2) {
  animation-delay: 0.04s;
}

.hero-copy > *:nth-child(3) {
  animation-delay: 0.08s;
}

.hero-copy > *:nth-child(4) {
  animation-delay: 0.12s;
}

.hero-copy > *:nth-child(5) {
  animation-delay: 0.16s;
}

.eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.hero-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(2.1rem, 3.6vw, 3.1rem);
  line-height: 1.09;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.hero-lead {
  margin: 0 0 24px;
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 56ch;
  line-height: 1.62;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.hero-cta-row .btn.btn-hero-primary,
.hero-cta-row .btn.btn-hero-secondary {
  width: auto !important;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.96rem;
}

@media (min-width: 1024px) {
  .hero-section {
    min-height: calc(100svh - 69px);
    display: flex;
    align-items: center;
  }
}

.btn-hero-primary {
  background: var(--teal);
  color: #ffffff;
  border: 1px solid var(--teal);
  box-shadow: var(--shadow-sm);
}

.btn-hero-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.btn-hero-secondary {
  background: var(--surface);
  color: var(--ink-strong);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-sm);
}

.btn-hero-secondary:hover {
  background: var(--surface-soft);
  border-color: rgba(15, 23, 42, 0.28);
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.highlight-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-strong);
}

/* Hero Visual Showcase */
.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-showcase-frame {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: 12px 0 22px;
}

.hero-photo-card {
  position: relative;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  padding: 10px;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.08);
}

.hero-photo-media {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-warm);
}

.hero-photo-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
  animation: abw-hero-media-settle 0.8s var(--ease-enter) both;
  transition: transform 0.55s var(--ease-enter);
}

.hero-photo-card:hover .hero-photo-media img {
  transform: scale(1.02);
}

.hero-floating-badge {
  position: absolute;
  top: -13px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-warm);
  color: #92400e;
  font-size: 0.77rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.hero-mini-chip {
  position: absolute;
  bottom: -18px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 7px 14px 7px 7px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(15, 118, 110, 0.24);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.1);
}

.hero-mini-thumb {
  width: 58px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--hairline);
  background: var(--bg-warm);
}

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

.hero-mini-copy {
  min-width: 0;
}

.hero-mini-kicker {
  display: block;
  font-size: 0.69rem;
  font-weight: 800;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.hero-mini-copy strong {
  display: block;
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--ink-strong);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Real Print & Coloring Showcase Gallery */
.showcase-section {
  background: var(--bg-warm);
  border-bottom: 1px solid var(--hairline);
  padding: clamp(52px, 6.5vh, 80px) 0;
}

.showcase-heading {
  margin-bottom: 32px;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.showcase-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.showcase-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-soft);
}

.showcase-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.55s var(--ease-enter);
}

.showcase-media--portrait img {
  object-position: center 28%;
}

.showcase-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px 22px 22px;
  flex: 1;
}

.showcase-spec-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #92400e;
  border: 1px solid var(--border-warm);
}

.showcase-spec-pill.is-teal {
  background: var(--teal-soft);
  color: var(--teal-dark);
  border-color: rgba(15, 118, 110, 0.24);
}

.showcase-spec-pill.is-green {
  background: var(--green-soft);
  color: var(--green);
  border-color: var(--green-border);
}

.showcase-body h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.32;
  letter-spacing: -0.015em;
}

.showcase-body p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Storefront Studio */
.studio-section {
  background: var(--bg);
  padding: clamp(52px, 7vh, 84px) 0;
  border-bottom: 1px solid var(--hairline);
}

.storefront-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.storefront-tab {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
  box-shadow: var(--shadow-sm);
}

.storefront-tab:active {
  transform: translateY(1px);
}

.storefront-tab.active {
  border: 1.5px solid var(--teal);
  background: linear-gradient(135deg, var(--teal-soft) 0%, var(--surface) 75%);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.08);
}

.tab-icon {
  font-size: 1.85rem;
  line-height: 1;
  flex-shrink: 0;
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tab-title {
  font-family: "Fredoka", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink-strong);
}

.tab-sub {
  font-size: 0.88rem;
  color: var(--muted);
}

/* Status Alert */
.status-alert {
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.94rem;
}

.status-alert.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.status-alert.info {
  background: var(--teal-soft);
  border: 1px solid rgba(15, 118, 110, 0.24);
  color: var(--teal-dark);
}

/* Studio Layout */
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.36fr) minmax(0, 0.64fr);
  gap: 24px;
  align-items: start;
}

.builder-card {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 30px);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 20px;
}

.card-header h2 {
  margin: 6px 0 0;
  font-size: clamp(1.35rem, 2.2vw, 1.62rem);
}

.step-pill {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #92400e;
  background: var(--primary-soft);
  border: 1px solid var(--border-warm);
  padding: 3px 10px;
  border-radius: 999px;
}

.step-pill-teal {
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-color: rgba(15, 118, 110, 0.22);
}

.price-display {
  text-align: right;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.price-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.price-value {
  font-family: "Fredoka", sans-serif;
  font-size: 1.45rem;
  color: var(--ink-strong);
}

.price-teal {
  color: var(--teal-dark);
}

/* COPPA Privacy Banner */
.coppa-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  margin-bottom: 20px;
}

.coppa-icon {
  font-size: 1.25rem;
  line-height: 1.2;
}

.coppa-banner strong {
  display: block;
  font-size: 0.9rem;
  color: #14532d;
}

.coppa-banner p {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: #166534;
}

/* Form Elements */
.field-group {
  margin-bottom: 18px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-strong);
  margin-bottom: 7px;
}

.label-title-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.required-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.label-hint {
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--muted);
}

input[type="text"],
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink-strong);
  transition: border-color 0.14s var(--ease), box-shadow 0.14s var(--ease);
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* Dropzones */
.dropzone {
  position: relative;
  border: 1.5px dashed rgba(15, 23, 42, 0.22);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.drag-over {
  outline: none;
  border-color: var(--teal);
  background: var(--teal-soft);
}

.dropzone.is-error {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.dropzone-compact {
  padding: 12px;
}

.dropzone-icon {
  font-size: 1.7rem;
  margin-bottom: 4px;
}

.dropzone-title {
  margin: 0;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--ink);
}

.dropzone-title .dropzone-browse {
  color: var(--teal-dark);
  text-decoration: underline;
  font-weight: 700;
}

.dropzone-sub {
  margin: 4px 0 0;
  font-size: 0.81rem;
  color: var(--muted);
}

.dropzone-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.dropzone-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  flex-shrink: 0;
}

.dropzone-compact .dropzone-preview img {
  width: 44px;
  height: 44px;
}

.dropzone-file-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dropzone-file-meta strong {
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone-file-meta span {
  font-size: 0.78rem;
  color: var(--green);
  font-weight: 600;
}

.btn-link-danger {
  background: none;
  border: none;
  padding: 0;
  margin-top: 2px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  color: #b91c1c;
  cursor: pointer;
}

.btn-link-danger:hover {
  text-decoration: underline;
}

/* Co-Star Toggle Block (flat inset, <= 2 nesting levels) */
.costar-box {
  margin-bottom: 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 14px 16px;
}

.toggle-card {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.toggle-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.toggle-ui {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  flex-shrink: 0;
  transition: background 0.18s var(--ease);
}

.toggle-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.16);
  transition: transform 0.18s var(--ease);
}

.toggle-card input:checked + .toggle-ui {
  background: var(--teal);
}

.toggle-card input:checked + .toggle-ui::after {
  transform: translateX(20px);
}

.toggle-card input:focus-visible + .toggle-ui {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.24);
}

.toggle-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.toggle-copy strong {
  font-size: 0.92rem;
  color: var(--ink-strong);
}

.toggle-copy span {
  font-size: 0.81rem;
  color: var(--muted);
}

.addon-badge {
  background: var(--primary-soft);
  color: #92400e;
  border: 1px solid var(--border-warm);
  font-size: 0.77rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}

.costar-fields {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

/* Segmented Control (Paper Size) */
.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.seg-option {
  position: relative;
  cursor: pointer;
}

.seg-option input {
  position: absolute;
  opacity: 0;
}

.seg-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-strong);
  background: var(--surface);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
  text-align: center;
}

.seg-option input:checked + span {
  border-color: var(--ink-strong);
  background: var(--ink-strong);
  color: #ffffff;
}

.seg-option input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.2);
}

/* Radio Cards (Age Tier & Bundle) */
.tier-cards,
.bundle-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.radio-card {
  position: relative;
  cursor: pointer;
}

.radio-card input {
  position: absolute;
  opacity: 0;
}

.radio-card-body {
  height: 100%;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--surface);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.radio-card input:checked + .radio-card-body {
  border: 1.5px solid var(--teal);
  background: var(--teal-soft);
}

.radio-card input:focus-visible + .radio-card-body {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.22);
}

.radio-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.radio-card-top strong {
  font-size: 0.92rem;
  color: var(--ink-strong);
}

.radio-card-body p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.48;
}

.tag-pill,
.price-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  color: var(--ink-strong);
}

.tag-teal {
  background: #ccfbf1;
  border-color: rgba(15, 118, 110, 0.2);
  color: var(--teal-dark);
}

.price-pill-save {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #ffffff;
}

/* Learning Topic & Focus Item Chips */
.topic-section {
  margin-bottom: 18px;
}

.topic-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.topic-header .field-label {
  margin-bottom: 0;
}

.topic-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border: 1px solid rgba(15, 118, 110, 0.22);
  padding: 3px 10px;
  border-radius: 999px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease);
}

.topic-card:active {
  transform: translateY(1px);
}

.topic-card.active {
  border: 1.5px solid var(--teal);
  background: var(--teal-soft);
}

.topic-card:focus-visible,
.item-chip:focus-visible,
.btn-chip-reset:focus-visible,
.qp-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.22);
}

.topic-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topic-card-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-strong);
}

.topic-count-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-strong);
  flex-shrink: 0;
}

.topic-card.active .topic-count-pill {
  background: #ccfbf1;
  color: var(--teal-dark);
}

.topic-card-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.44;
}

.items-focus-box {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline);
  background: var(--surface-soft);
}

.items-focus-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.items-focus-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.items-focus-title {
  font-size: 0.88rem;
  color: var(--ink-strong);
}

.items-focus-hint {
  font-size: 0.79rem;
  color: var(--muted);
}

.items-focus-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.selected-count-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--teal-dark);
  background: #ccfbf1;
  padding: 3px 10px;
  border-radius: 999px;
}

.btn-chip-reset {
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-strong);
  font-family: inherit;
  font-size: 0.77rem;
  font-weight: 700;
  min-height: 30px;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.14s var(--ease), color 0.14s var(--ease), transform 0.09s var(--ease);
}

.btn-chip-reset:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.btn-chip-reset:active {
  transform: translateY(1px);
}

.item-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.item-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-strong);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s var(--ease), background 0.14s var(--ease), color 0.14s var(--ease), transform 0.09s var(--ease);
}

.item-chip:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.item-chip:active {
  transform: translateY(1px);
}

.item-chip.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
  font-weight: 700;
}

/* Quick-Pick Bilingual Tiers */
.quickpick-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.quickpick-header .field-label {
  margin-bottom: 0;
}

.free-pair-badge {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border: 1px solid rgba(15, 118, 110, 0.22);
  padding: 3px 10px;
  border-radius: 999px;
}

.quickpick-tiers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.qp-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qp-tier-label {
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.qp-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.qp-btn {
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  color: var(--ink-strong);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.14s var(--ease), background 0.14s var(--ease), color 0.14s var(--ease), transform 0.09s var(--ease);
}

.qp-btn:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.qp-btn:active {
  transform: translateY(1px);
}

.qp-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
  font-weight: 700;
}

/* Free Language Pair Box */
.lang-pair-box {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 118, 110, 0.22);
  background: var(--teal-soft);
}

.lang-pair-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.88rem;
}

.pair-chip {
  font-size: 0.79rem;
  font-weight: 800;
  color: var(--teal-dark);
  background: #ccfbf1;
  padding: 3px 10px;
  border-radius: 999px;
}

.lang-selectors {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: end;
}

.swap-btn {
  height: 44px;
  width: 44px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--teal-dark);
  cursor: pointer;
  transition: border-color 0.14s var(--ease), background 0.14s var(--ease), transform 0.09s var(--ease);
}

.swap-btn:hover {
  border-color: var(--teal);
  background: var(--surface-soft);
}

.swap-btn:active {
  transform: translateY(1px);
}

.inline-warn {
  margin: 8px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #92400e;
}

/* Unified Button Pair (Solid Primary + Clean Hairline Secondary) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  padding: 11px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.09s var(--ease);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.24);
}

.btn-lg {
  min-height: 48px;
  padding: 13px 20px;
  font-size: 1rem;
}

.btn-primary,
.btn-teal,
.btn-paypal {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled),
.btn-teal:hover:not(:disabled),
.btn-paypal:hover:not(:disabled) {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.btn-emerald {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-emerald:hover:not(:disabled) {
  background: #166534;
  border-color: #166534;
}

.btn-demo,
.btn-demo-alt,
.btn-ghost,
.btn-outline {
  background: var(--surface);
  color: var(--ink-strong);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-sm);
}

.btn-demo:hover:not(:disabled),
.btn-demo-alt:hover:not(:disabled),
.btn-ghost:hover:not(:disabled),
.btn-outline:hover:not(:disabled) {
  background: var(--surface-soft);
  border-color: rgba(15, 23, 42, 0.28);
}

.btn-ghost {
  width: auto;
  min-height: 40px;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.88rem;
}

.btn-outline {
  width: auto;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 0.92rem;
  white-space: nowrap;
}

.submit-footnote {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Info Sidebar */
.info-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.sidebar-card h3 {
  margin: 0 0 12px;
  font-size: 1.12rem;
}

.sidebar-soft {
  background: var(--primary-soft);
  border-color: var(--border-warm);
}

.sidebar-soft-teal {
  background: var(--teal-soft);
  border-color: rgba(15, 118, 110, 0.22);
}

.sidebar-card p {
  margin: 8px 0 0;
  font-size: 0.89rem;
  color: var(--ink);
  line-height: 1.55;
}

.mini-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mini-badge-teal {
  color: var(--teal-dark);
}

.check-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.89rem;
  color: var(--muted);
}

.check-list li {
  position: relative;
  padding-left: 22px;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 900;
  color: var(--teal);
}

.check-list strong {
  color: var(--ink-strong);
}

/* Preview & Paywall Section */
.preview-section {
  background: var(--bg);
  padding: 16px 0 56px;
}

.preview-shell {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 30px);
  box-shadow: var(--shadow-md);
}

.preview-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.preview-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.qa-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-soft);
  color: #14532d;
  border: 1px solid var(--green-border);
  font-size: 0.77rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
}

.preview-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.4vw, 1.7rem);
}

.preview-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.preview-loading-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  border: 1.5px dashed var(--hairline-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  text-align: center;
}

.preview-loading-card strong {
  font-size: 1rem;
  color: var(--ink-strong);
}

.preview-loading-card span {
  font-size: 0.89rem;
  color: var(--muted);
  max-width: 52ch;
}

.preview-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--hairline-strong);
  border-top-color: var(--teal);
  animation: abw-spin 0.8s linear infinite;
}

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

.story-progress-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.story-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.story-progress-title {
  margin: 0;
  font-family: "Fredoka", "Plus Jakarta Sans", sans-serif;
  font-size: 1.16rem;
  font-weight: 600;
  color: var(--ink-strong);
}

.story-progress-pct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--teal-soft);
  border: 1px solid rgba(15, 118, 110, 0.24);
  color: var(--teal-dark);
  font-size: 0.85rem;
  font-weight: 800;
}

.story-progress-track {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.story-progress-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal) 0%, #14b8a6 55%, var(--teal) 100%);
  background-size: 200% 100%;
  transition: width 0.45s var(--ease-enter);
  animation: abw-progress-flow 1.8s linear infinite;
}

@keyframes abw-progress-flow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.story-progress-status {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-strong);
}

.story-progress-hint {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.page-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  padding: 10px;
  overflow: hidden;
  transition: transform 0.16s var(--ease), border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.page-card.free-card {
  cursor: zoom-in;
}

.page-thumb-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--surface);
}

.page-thumb-wrap img {
  width: 100%;
  height: auto;
}

.watermark-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-family: "Fredoka", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(15, 23, 42, 0.22);
  transform: rotate(-24deg);
  text-transform: uppercase;
  text-align: center;
  user-select: none;
}

.watermark-large {
  font-size: 1.35rem;
}

.page-card-footer {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.page-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
}

.page-status-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.status-free {
  background: var(--green-soft);
  color: var(--green);
}

.status-locked {
  background: var(--primary-soft);
  color: #92400e;
}

/* Locked Blur Paywall Card */
.page-card.locked-card {
  cursor: pointer;
}

.locked-card .page-thumb-wrap img {
  filter: blur(8px) grayscale(15%);
  opacity: 0.5;
  transform: scale(1.03);
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px;
  text-align: center;
  background: rgba(252, 251, 248, 0.65);
  backdrop-filter: blur(2px);
}

.lock-badge {
  background: var(--ink-strong);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.lock-hint {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-strong);
}

/* Checkout Box */
.checkout-box {
  margin-top: 26px;
  background: var(--surface-soft);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: center;
}

.checkout-price-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--primary-dark);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.checkout-info h3 {
  margin: 0 0 8px;
  font-size: 1.38rem;
}

.checkout-info p {
  margin: 0 0 12px;
  font-size: 0.94rem;
  color: var(--muted);
}

.checkout-trust-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.demo-downloads {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 14px;
}

.demo-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
  margin-bottom: 4px;
  text-align: center;
}

.demo-lock-notice {
  margin: 0 0 10px;
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.demo-btn-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.demo-btn-row .btn {
  font-size: 0.83rem;
  padding: 10px;
}

/* Why Section */
.why-section {
  padding: clamp(56px, 7vh, 88px) 0;
  background: var(--bg-warm);
}

.section-heading {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 32px;
}

.section-heading h2 {
  margin: 10px 0 10px;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.15;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.benefit-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.benefit-icon {
  font-size: 1.85rem;
  margin-bottom: 10px;
}

.benefit-card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.benefit-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

.coppa-strip {
  margin-top: 28px;
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.coppa-strip-content {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.coppa-shield {
  font-size: 1.9rem;
  line-height: 1;
}

.coppa-strip h3 {
  margin: 0 0 4px;
  font-size: 1.12rem;
  color: #14532d;
}

.coppa-strip p {
  margin: 0;
  font-size: 0.9rem;
  color: #166534;
}

/* Footer */
.site-footer {
  background: var(--ink-strong);
  color: #cbd5e1;
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}

.footer-brand strong {
  font-family: "Fredoka", sans-serif;
  font-size: 1.25rem;
  color: #ffffff;
}

.footer-brand p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: #cbd5e1;
  max-width: 44ch;
}

.footer-meta p {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: #94a3b8;
}

.footer-links a {
  color: #5eead4;
  text-decoration: none;
  font-weight: 600;
  padding: 4px 0;
  transition: color 0.14s var(--ease);
}

.footer-links a:hover {
  color: #99f6e4;
  text-decoration: underline;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.auth-modal-card {
  max-width: 460px;
}

.orders-modal-card {
  max-width: 840px;
}

.lightbox-card {
  max-width: 680px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  background: var(--surface-soft);
  color: var(--ink-strong);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  transition: background 0.14s var(--ease), border-color 0.14s var(--ease);
}

.modal-close:hover {
  background: #e2e8f0;
}

.modal-card h3 {
  margin: 10px 0 8px;
  font-size: 1.35rem;
}

.modal-summary {
  margin: 0 0 14px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.94rem;
}

.checkout-member-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--teal-soft);
  border: 1px solid rgba(15, 118, 110, 0.22);
  font-size: 0.85rem;
  color: var(--teal-dark);
}

.checkout-provider-group {
  margin-bottom: 14px;
}

.checkout-provider-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-strong);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.checkout-provider-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.btn-polar-cta {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-polar-cta:hover:not(:disabled) {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.inline-modal-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 600;
}

.checkout-order-success {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  color: #14532d;
}

.checkout-order-success strong {
  display: block;
  font-size: 0.96rem;
  margin-bottom: 4px;
}

.checkout-order-success p {
  margin: 0 0 10px;
  font-size: 0.86rem;
  color: #166534;
}

.checkout-success-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-note {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--primary-soft);
  border: 1px solid var(--border-warm);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.modal-note-spaced {
  margin-top: 16px;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Google Auth Modal */
.auth-gate-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  border: 1px solid var(--border-warm);
  color: #92400e;
  font-size: 0.87rem;
  font-weight: 700;
}

.google-gsi-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.dev-google-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dev-google-form input[type="email"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink-strong);
}

.dev-google-form input[type="email"]:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.btn-google-submit {
  background: var(--surface);
  color: var(--ink-strong);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-sm);
}

.btn-google-submit:hover:not(:disabled) {
  border-color: rgba(15, 23, 42, 0.28);
  background: var(--surface-soft);
}

.dev-login-hint {
  margin: 0;
  font-size: 0.79rem;
  color: var(--muted);
  text-align: center;
}

/* Customer Orders & Support Messaging Modal */
.orders-email-line {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.orders-loading-state,
.orders-empty-state {
  padding: 28px 18px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--hairline-strong);
  background: var(--surface-soft);
  text-align: center;
}

.orders-empty-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.orders-empty-state strong {
  display: block;
  font-size: 1rem;
  color: var(--ink-strong);
  margin-bottom: 4px;
}

.orders-empty-state p {
  margin: 0;
  font-size: 0.89rem;
  color: var(--muted);
}

.orders-workspace {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
  align-items: stretch;
}

.orders-col-heading {
  margin: 0 0 10px;
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}

.order-item-card {
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.14s var(--ease), background 0.14s var(--ease);
}

.order-item-card:hover {
  border-color: var(--teal);
}

.order-item-card.active {
  border: 1.5px solid var(--teal);
  background: var(--teal-soft);
}

.order-item-card.is-paid-highlight {
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.22);
  border-color: var(--green);
}

.order-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.order-item-id {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink-strong);
}

.order-status-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-strong);
  text-transform: uppercase;
}

.order-status-pill.is-paid,
.order-status-pill.is-fulfilled {
  background: var(--green-soft);
  color: var(--green);
}

.order-status-pill.is-pending {
  background: var(--primary-soft);
  color: #92400e;
}

.order-status-pill.is-failed {
  background: #fee2e2;
  color: #b91c1c;
}

.order-item-title {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-strong);
  margin-bottom: 3px;
}

.order-item-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.77rem;
  color: var(--muted);
}

.orders-chat-col {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 14px;
  min-height: 320px;
}

.order-detail-panel {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
}

.order-detail-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-detail-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.order-detail-id-row strong {
  font-size: 0.92rem;
  color: var(--ink-strong);
}

.order-detail-product {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.order-paid-banner {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  color: var(--green);
  font-size: 0.81rem;
  font-weight: 800;
}

.order-confirming-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  border: 1px solid var(--border-warm);
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 700;
}

.btn-refresh-status {
  border: 1px solid rgba(180, 83, 9, 0.35);
  background: var(--surface);
  color: #92400e;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s var(--ease), border-color 0.14s var(--ease);
}

.btn-refresh-status:hover:not(:disabled) {
  background: #fef3c7;
  border-color: var(--primary-dark);
}

.btn-refresh-status:disabled {
  opacity: 0.65;
  cursor: wait;
}

.order-downloads-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
}

.order-downloads-box .btn {
  font-size: 0.81rem;
  padding: 10px;
}

.order-messages-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px 2px 10px;
}

.msg-empty-hint {
  margin: auto 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 18px 8px;
}

.msg-bubble {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  line-height: 1.48;
  word-break: break-word;
}

.msg-bubble.is-customer {
  align-self: flex-end;
  background: var(--teal-soft);
  border: 1px solid rgba(15, 118, 110, 0.2);
  color: var(--ink-strong);
}

.msg-bubble.is-admin {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  color: var(--ink-strong);
}

.msg-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 3px;
}

.msg-body {
  margin: 0;
  white-space: pre-wrap;
}

.order-message-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
}

.order-message-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 60px;
  padding: 9px 11px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--ink-strong);
  background: var(--surface);
}

.order-message-form textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.lightbox-frame {
  position: relative;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 75vh;
  display: flex;
  justify-content: center;
  background: var(--surface);
}

.lightbox-frame img {
  max-height: 74vh;
  width: auto;
  object-fit: contain;
}

/* Fine-pointer Hover Micro-Interactions (taste-skill 2.5.1) */
@media (hover: hover) and (pointer: fine) {
  .showcase-card:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, 0.28);
    box-shadow: var(--shadow-md);
  }

  .showcase-card:hover .showcase-media img {
    transform: scale(1.02);
  }

  .benefit-card:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, 0.26);
    box-shadow: var(--shadow-md);
  }

  .page-card.free-card:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, 0.28);
    box-shadow: var(--shadow-md);
  }

  .storefront-tab:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 23, 42, 0.26);
  }

  .topic-card:hover {
    transform: translateY(-1px);
    border-color: var(--teal);
  }

  .btn:hover:not(:disabled) {
    transform: translateY(-1px);
  }
}

/* Responsive Breakpoints (1440, 1024, 768, 390, 320 zero overflow) */
@media (max-width: 1500px) {
  .nav-cta .pill-badge {
    display: none;
  }
}

@media (max-width: 1100px) {
  .nav-links {
    display: none;
  }
}

@media (max-width: 980px) {
  .hero-section {
    min-height: auto;
  }

  .hero-grid,
  .studio-layout,
  .checkout-box {
    grid-template-columns: 1fr;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin: 0 auto;
  }

  .benefits-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .hero-section {
    padding: 24px 0 36px;
  }

  .hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero-copy {
    display: contents;
  }

  .eyebrow-row {
    order: 1;
    margin-bottom: 0;
  }

  .hero-copy h1 {
    order: 2;
    margin-bottom: 0;
  }

  .hero-lead {
    order: 3;
    margin-bottom: 0;
  }

  .hero-cta-row {
    order: 4;
    margin-bottom: 4px;
  }

  .hero-visual {
    order: 5;
  }

  .hero-highlights {
    order: 6;
    margin-top: 6px;
  }
}

@media (max-width: 720px) {
  .orders-workspace {
    grid-template-columns: 1fr;
  }

  .customer-email-pill {
    display: none;
  }
}

@media (max-width: 680px) {
  .storefront-switcher,
  .form-row-2,
  .tier-cards,
  .topic-grid,
  .bundle-cards,
  .benefits-grid,
  .demo-btn-row,
  .modal-actions,
  .order-downloads-box {
    grid-template-columns: 1fr;
  }

  .hero-highlights {
    grid-template-columns: 1fr;
  }

  .lang-selectors {
    grid-template-columns: 1fr;
  }

  .swap-btn {
    width: 100%;
    height: 40px;
  }

  .coppa-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .builder-card,
  .preview-shell {
    padding: 18px;
  }
}

@media (max-width: 520px) {
  .nav-inner {
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 10px;
  }

  .nav-cta {
    margin-left: auto;
    flex-wrap: wrap;
  }

  .hero-cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta-row .btn.btn-hero-primary,
  .hero-cta-row .btn.btn-hero-secondary {
    width: 100% !important;
  }

  .hero-floating-badge {
    right: 12px;
    font-size: 0.73rem;
    padding: 6px 11px;
  }

  .hero-mini-chip {
    left: 10px;
    bottom: -14px;
    max-width: calc(100% - 20px);
    padding: 6px 11px 6px 6px;
  }

  .hero-mini-thumb {
    width: 48px;
    height: 36px;
  }

  .hero-mini-copy strong {
    font-size: 0.75rem;
  }
}

@media (max-width: 420px) {
  .nav-inner {
    gap: 8px;
    min-height: 58px;
  }

  .brand-text {
    font-size: 1.12rem;
  }

  .btn-auth-google,
  .btn-auth-orders,
  .btn-auth-signout {
    font-size: 0.76rem;
    padding: 8px 11px;
    min-height: 44px;
  }

  #uiLangSelect {
    min-width: 112px;
    max-width: 148px;
    min-height: 44px;
    font-size: 0.8rem;
    padding: 8px 24px 8px 34px;
  }

  .checkout-box,
  .modal-card {
    padding: 16px;
  }
}

/* Reduced Motion Respect (taste-skill 2.5.1) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-copy > *,
  .hero-photo-media img {
    animation: none !important;
  }

  .story-progress-fill,
  .preview-spinner {
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
