@layer components {
/* ═══════════════════════════════════════════════
   BAJKOLAB Component Library
   ═══════════════════════════════════════════════ */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BUTTONS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent, oklch(1 0 0 / 0.08), transparent);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.btn:hover::after { opacity: 1; }

.btn--primary {
  background: var(--gold);
  color: var(--text-on-gold);
  border-color: var(--gold-dim);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--gold-vivid);
}

.btn--primary:hover {
  background: var(--gold-vivid);
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--gold-glow);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn--secondary {
  background: var(--ink);
  color: var(--text-on-dark);
  border-color: var(--ink-80);
}

.btn--secondary:hover {
  background: var(--ink-90);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}

.btn--ghost:hover {
  background: var(--parchment-warm);
  border-color: var(--ink-20);
}

.btn--danger {
  background: var(--error);
  color: white;
  border-color: oklch(0.45 0.20 25);
}

.btn--danger:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn--berry {
  background: var(--berry);
  color: white;
  border-color: oklch(0.42 0.19 350);
}

.btn--berry:hover {
  background: var(--berry-vivid);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-md);
  border-radius: var(--radius-lg);
}

.btn--xl {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
  letter-spacing: var(--tracking-wide);
}

.btn--icon { padding: var(--space-2); }

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CARDS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  border: 1px solid var(--border-subtle);
  transition: box-shadow var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card--interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.card--gold {
  background: linear-gradient(135deg, var(--gold-pale), var(--surface));
  border-color: var(--gold-glow);
}

.card--ink {
  background: var(--ink);
  color: var(--text-on-dark);
  border-color: var(--ink-80);
}

.card--ink p { color: oklch(0.75 0.01 270); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FORMS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.form-wrap {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}

.form-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-10) var(--space-8);
  border: 1px solid var(--border-subtle);
}

.field {
  margin-bottom: var(--space-5);
}

.field--checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.field--checkbox label { margin-bottom: 0; }

.field__hint {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.form-errors {
  background: var(--error-pale);
  border: 1px solid var(--error);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  color: var(--error);
  font-size: var(--text-sm);
}

.form-errors ul {
  list-style: disc;
  padding-left: var(--space-5);
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.form-footer {
  margin-top: var(--space-6);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FLASH MESSAGES
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.flash-container {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-4));
  right: var(--space-4);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 28rem;
}

.flash {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.4s var(--ease-out) both;
  border: 1px solid;
}

.flash p { margin: 0; color: inherit; flex: 1; }

.flash--notice {
  background: var(--forest-pale);
  color: var(--forest);
  border-color: var(--forest-light);
}

.flash--alert {
  background: var(--error-pale);
  color: var(--error);
  border-color: oklch(0.75 0.10 25);
}

.flash__close {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  opacity: 0.6;
  font-size: var(--text-lg);
  transition: opacity var(--duration-fast);
}

.flash__close:hover { opacity: 1; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BADGES
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.badge--pending    { background: var(--warning-pale); color: oklch(0.45 0.14 80); }
.badge--paid       { background: var(--success-pale); color: var(--success); }
.badge--sent_to_print { background: var(--sky-pale); color: var(--sky); }
.badge--shipped    { background: var(--forest-pale); color: var(--forest); }
.badge--draft      { background: var(--parchment-deep); color: var(--text-muted); }
.badge--generating { background: var(--gold-pale); color: var(--gold-dim); }
.badge--completed  { background: var(--success-pale); color: var(--success); }
.badge--failed     { background: var(--error-pale); color: var(--error); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   NAVIGATION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: oklch(1 0 0 / 0.85);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-normal);
}

.site-nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav__logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: var(--tracking-tight);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.site-nav__logo span {
  color: var(--gold);
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.site-nav__link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}

.site-nav__link:hover {
  color: var(--ink);
  background: var(--parchment-warm);
}

.site-nav__link--accent {
  color: var(--berry);
}

.site-nav__link--cta {
  background: var(--gold);
  color: var(--text-on-gold);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
}

.site-nav__link--cta:hover {
  background: var(--gold-vivid);
  color: var(--text-on-gold);
}

.site-nav__link--admin {
  color: var(--berry);
  font-weight: 600;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FOOTER
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.site-footer {
  margin-top: var(--space-24);
  padding: var(--space-12) 0 var(--space-8);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-footer__brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--ink-60);
  font-weight: 600;
}

.site-footer__links {
  display: flex;
  gap: var(--space-6);
}

.site-footer__links a {
  color: var(--text-muted);
  transition: color var(--duration-fast);
}

.site-footer__links a:hover { color: var(--ink); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   COOKIE CONSENT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.cookie-bar {
  position: fixed;
  bottom: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
  z-index: 200;
  max-width: 32rem;
  margin: 0 auto;
  background: var(--ink);
  color: var(--text-on-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  animation: fadeInUp 0.5s var(--ease-out) 1s both;
}

.cookie-bar p {
  margin: 0;
  font-size: var(--text-sm);
  color: oklch(0.78 0.01 270);
  flex: 1;
}

.cookie-bar__actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PAGE CONTAINER
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-5) var(--space-16);
}

.page--narrow {
  max-width: var(--max-width-narrow);
}

.page--mid {
  max-width: var(--max-width-mid);
}

.page__header {
  margin-bottom: var(--space-8);
}

.page__header h1 {
  margin-bottom: var(--space-2);
}

.page__header p {
  font-size: var(--text-lg);
  color: var(--text-muted);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   HERO (Landing Page)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.hero {
  position: relative;
  min-height: calc(100dvh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-5);
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, oklch(0.18 0.04 270 / 0.03), transparent),
    radial-gradient(ellipse 60% 40% at 80% 80%, oklch(0.76 0.145 70 / 0.06), transparent),
    radial-gradient(ellipse 50% 30% at 10% 90%, oklch(0.52 0.19 350 / 0.04), transparent);
}

/* Star decoration layer */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 15% 25%, var(--gold) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 75% 15%, var(--gold-glow) 50%, transparent 50%),
    radial-gradient(1px 1px at 45% 60%, var(--gold) 50%, transparent 50%),
    radial-gradient(2px 2px at 85% 70%, var(--gold-glow) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 25% 80%, var(--gold) 50%, transparent 50%),
    radial-gradient(1px 1px at 55% 35%, var(--gold-glow) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 92% 45%, var(--gold) 50%, transparent 50%),
    radial-gradient(1px 1px at 8% 50%, var(--gold-glow) 50%, transparent 50%);
  animation: twinkle 4s ease-in-out infinite;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 48rem;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--gold-pale);
  border: 1px solid var(--gold-glow);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gold-dim);
  margin-bottom: var(--space-6);
}

.hero__title {
  font-size: var(--text-hero);
  font-weight: 700;
  margin-bottom: var(--space-6);
  line-height: 1.1;
}

.hero__title em {
  font-style: italic;
  color: var(--gold);
  display: inline-block;
}

.hero__subtitle {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  max-width: 36rem;
  margin: 0 auto var(--space-10);
  line-height: var(--leading-relaxed);
}

.hero__actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

.hero__note {
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-family: var(--font-handwritten);
  font-size: var(--text-lg);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LANDING SECTIONS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.section {
  padding: var(--space-20) var(--space-5);
  max-width: var(--max-width);
  margin: 0 auto;
}

.section--wide {
  max-width: var(--max-width-wide);
}

.section__header {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto var(--space-12);
}

.section__header h2 {
  margin-bottom: var(--space-3);
}

.section__header p {
  font-size: var(--text-lg);
  color: var(--text-muted);
}

.section__eyebrow {
  font-family: var(--font-handwritten);
  font-size: var(--text-xl);
  color: var(--gold);
  display: block;
  margin-bottom: var(--space-2);
}

/* How it Works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  counter-reset: step;
}

.step {
  text-align: center;
  position: relative;
  counter-increment: step;
}

.step::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto var(--space-5);
  background: var(--ink);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
}

.step h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.step p {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.feature {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  transition: all var(--duration-normal) var(--ease-out);
}

.feature:hover {
  border-color: var(--gold-glow);
  box-shadow: var(--shadow-md);
}

.feature__icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--gold-pale);
  font-size: var(--text-xl);
}

.feature h3 {
  font-size: var(--text-md);
  margin-bottom: var(--space-1);
}

.feature p {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Testimonials */
.testimonials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.testimonial {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.testimonial::before {
  content: '\201C';
  position: absolute;
  top: var(--space-3);
  left: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  color: var(--gold-glow);
  line-height: 1;
}

.testimonial__text {
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  padding-top: var(--space-4);
}

.testimonial__author {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--ink);
}

.testimonial__role {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Pricing */
.pricing-card {
  max-width: 28rem;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  text-align: center;
  box-shadow: var(--shadow-xl);
  border: 2px solid var(--gold-glow);
  position: relative;
  overflow: hidden;
}

.pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--berry), var(--gold));
}

.pricing__amount {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 700;
  color: var(--ink);
}

.pricing__currency {
  font-size: var(--text-xl);
  vertical-align: super;
}

.pricing__period {
  font-size: var(--text-md);
  color: var(--text-muted);
}

.pricing__features {
  text-align: left;
  margin: var(--space-8) 0;
}

.pricing__features li {
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.pricing__features li::before {
  content: '\2713';
  color: var(--success);
  font-weight: 700;
}

/* CTA Band */
.cta-band {
  background: var(--ink);
  color: var(--text-on-dark);
  padding: var(--space-16) var(--space-5);
  text-align: center;
  margin: var(--space-20) calc(-1 * var(--space-5));
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, var(--gold) 50%, transparent 50%),
    radial-gradient(1px 1px at 70% 20%, var(--gold-glow) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 40% 70%, var(--gold) 50%, transparent 50%),
    radial-gradient(1px 1px at 90% 60%, var(--gold-glow) 50%, transparent 50%),
    radial-gradient(1px 1px at 10% 80%, var(--gold) 50%, transparent 50%);
  animation: twinkle 5s ease-in-out infinite;
  opacity: 0.7;
}

.cta-band__content {
  position: relative;
  z-index: 1;
  max-width: 36rem;
  margin: 0 auto;
}

.cta-band h2 {
  color: var(--text-on-dark);
  margin-bottom: var(--space-4);
}

.cta-band p {
  color: oklch(0.75 0.01 270);
  margin-bottom: var(--space-8);
  font-size: var(--text-lg);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PROFILE CARDS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: var(--space-5);
}

.profile-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-out);
}

.profile-card:hover {
  border-color: var(--gold-glow);
  box-shadow: var(--shadow-md);
}

.profile-card__avatar {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold-pale), var(--berry-pale));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--gold-dim);
  margin-bottom: var(--space-3);
}

.profile-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-1);
}

.profile-card__age {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.profile-card__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PROFILE EDIT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.profile-edit {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.profile-edit section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}

.profile-edit section h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-1);
}

.profile-edit section h2 + p {
  margin-bottom: var(--space-6);
}

/* ─── Character / Avatar ─── */
.profile-edit__avatar-display {
  text-align: center;
}

.profile-edit__avatar-image {
  display: inline-block;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 3px solid var(--gold-pale);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  margin-bottom: var(--space-4);
}

.profile-edit__avatar-image img {
  display: block;
  width: 200px;
  height: 200px;
  object-fit: cover;
}

.profile-edit__avatar-actions {
  margin-top: var(--space-2);
}

.profile-edit__avatar-generating {
  padding: var(--space-8) 0;
  color: var(--text-muted);
}

.profile-edit__avatar-spinner {
  width: 3rem;
  height: 3rem;
  margin: 0 auto var(--space-4);
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: var(--radius-full);
  animation: spin-slow 1s linear infinite;
}

.profile-edit__avatar-generating p {
  margin-bottom: var(--space-1);
}

.profile-edit__avatar-failed {
  padding: var(--space-6) 0;
  color: var(--error);
}

.profile-edit__avatar-failed p {
  color: inherit;
  margin-bottom: var(--space-3);
}

.profile-edit__avatar-empty {
  padding: var(--space-8) 0;
  color: var(--text-muted);
}

.profile-edit__avatar-placeholder {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-3);
  opacity: 0.5;
}

.profile-edit__avatar-empty p {
  margin-bottom: var(--space-4);
  color: var(--text-muted);
}

/* ─── Form ─── */
.profile-edit__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.profile-edit__current-photo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.profile-edit__current-photo img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* ─── Books list ─── */
.profile-edit__book-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.profile-edit__book-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--parchment-paper);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.profile-edit__book-item:hover {
  border-color: var(--gold-pale);
  background: var(--gold-pale);
  transform: translateX(4px);
}

.profile-edit__book-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
}

.profile-edit__empty-books {
  text-align: center;
  padding: var(--space-4) 0;
}

.profile-edit__empty-books p {
  margin-bottom: var(--space-4);
}

/* ─── Danger zone ─── */
.profile-edit__danger {
  border-color: var(--error-pale) !important;
}

.profile-edit__danger h3 {
  font-size: var(--text-md);
  color: var(--error);
  margin-bottom: var(--space-2);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BOOK CARDS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: var(--space-6);
}

.book-card {
  background: var(--surface);
  border-radius: var(--radius-book);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md), var(--shadow-page);
  transition: all var(--duration-normal) var(--ease-out);
}

.book-card:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: var(--shadow-xl);
}

.book-card__cover {
  height: 10rem;
  background: linear-gradient(135deg, var(--ink), var(--ink-80));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.book-card__cover h3 {
  color: var(--gold);
  font-size: var(--text-lg);
  text-align: center;
  font-style: italic;
}

.book-card__body {
  padding: var(--space-4);
}

.book-card__meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BOOK VIEWER (Preview)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.book-viewer {
  max-width: var(--max-width-mid);
  margin: 0 auto;
}

.book-viewer__header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.book-viewer__header h1 {
  font-style: italic;
  color: var(--ink);
}

.book-viewer__header p {
  color: var(--text-muted);
  font-family: var(--font-handwritten);
  font-size: var(--text-lg);
}

.book-page {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-subtle);
  animation: scaleIn 0.4s var(--ease-out) both;
}

.book-page__illustration {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, var(--parchment-warm), var(--gold-pale));
}

.book-page__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-page__text {
  padding: var(--space-8);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.book-page__number {
  text-align: center;
  padding: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
  border-top: 1px solid var(--border-subtle);
}

.book-viewer__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  margin: var(--space-6) 0;
}

.book-viewer__counter {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--ink);
  min-width: 5rem;
  text-align: center;
}

.book-viewer__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin-top: var(--space-8);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   STORYBOOK (Review Mode)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.storybook {
  max-width: var(--max-width-mid);
  margin: 0 auto;
}

/* ─── Cover ─── */
.storybook__cover {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  margin-bottom: var(--space-8);
  background:
    radial-gradient(ellipse at 30% 20%, oklch(0.76 0.145 70 / 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, oklch(0.52 0.19 350 / 0.05) 0%, transparent 50%),
    linear-gradient(180deg, var(--parchment-paper), var(--parchment-warm));
  border: 2px solid var(--gold-pale);
  border-radius: var(--radius-xl);
  box-shadow:
    var(--shadow-xl),
    inset 0 1px 0 oklch(1 0 0 / 0.5),
    inset 0 -1px 0 oklch(0.76 0.145 70 / 0.1);
  position: relative;
  overflow: hidden;
}

.storybook__cover::before {
  content: "";
  position: absolute;
  inset: var(--space-3);
  border: 1px solid var(--gold-pale);
  border-radius: calc(var(--radius-xl) - var(--space-2));
  pointer-events: none;
}

.storybook__cover-ornament {
  width: 6rem;
  height: 2px;
  margin: var(--space-4) auto;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold) 20%,
    var(--gold-vivid) 50%,
    var(--gold) 80%,
    transparent
  );
  position: relative;
}

.storybook__cover-ornament::before {
  content: "✦";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--text-sm);
  color: var(--gold);
  background: var(--parchment-paper);
  padding: 0 var(--space-2);
}

.storybook__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin-bottom: 0;
}

.storybook__subtitle {
  font-family: var(--font-handwritten);
  font-size: var(--text-xl);
  color: var(--text-muted);
  margin-bottom: 0;
}

.storybook__subtitle span {
  color: var(--gold-dim);
  font-weight: 600;
}

/* ─── Intro text ─── */
.storybook__intro {
  text-align: center;
  font-size: var(--text-md);
  color: var(--text-muted);
  margin-bottom: var(--space-8);
  font-style: italic;
}

/* ─── Page ─── */
.storybook__page {
  animation: scaleIn 0.4s var(--ease-out) both;
}

.storybook__page-inner {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow:
    var(--shadow-xl),
    4px 4px 0 oklch(0.18 0.04 270 / 0.04),
    8px 8px 0 oklch(0.18 0.04 270 / 0.02);
  position: relative;
}

.storybook__page-inner::before {
  content: "";
  position: absolute;
  top: var(--space-4);
  bottom: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
  border: 1px solid oklch(0.76 0.145 70 / 0.12);
  border-radius: var(--radius-md);
  pointer-events: none;
  z-index: 1;
}

/* ─── Illustration placeholder ─── */
.storybook__illustration-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  background:
    radial-gradient(ellipse at center, oklch(0.76 0.145 70 / 0.06) 0%, transparent 70%),
    repeating-linear-gradient(
      45deg,
      oklch(0.76 0.145 70 / 0.03),
      oklch(0.76 0.145 70 / 0.03) 1px,
      transparent 1px,
      transparent 12px
    ),
    linear-gradient(180deg, var(--parchment-warm), var(--gold-pale));
  border-bottom: 1px solid var(--border-subtle);
}

.storybook__illustration-icon {
  font-size: var(--text-4xl);
  animation: float 3s ease-in-out infinite;
  opacity: 0.6;
}

.storybook__illustration-placeholder span {
  font-family: var(--font-handwritten);
  font-size: var(--text-md);
  color: var(--text-muted);
  opacity: 0.7;
}

/* ─── Story text ─── */
.storybook__text {
  padding: var(--space-10) var(--space-10) var(--space-6);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  text-align: justify;
  hyphens: auto;
}

.storybook__text p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 3.2em;
  float: left;
  line-height: 0.8;
  margin-right: 0.08em;
  margin-top: 0.05em;
  color: var(--gold-dim);
  font-weight: 700;
}

/* ─── Page number ─── */
.storybook__page-number {
  text-align: center;
  padding: var(--space-4) var(--space-3) var(--space-5);
}

.storybook__page-number span {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: var(--tracking-wider);
  position: relative;
  padding: 0 var(--space-6);
}

.storybook__page-number span::before,
.storybook__page-number span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: var(--space-8);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.storybook__page-number span::before { right: 100%; }
.storybook__page-number span::after  { left: 100%; }

/* ─── Page tools (edit/regenerate) ─── */
.storybook__page-tools {
  margin-top: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.storybook__edit {
  flex: 1;
  min-width: 0;
}

.storybook__edit summary {
  cursor: pointer;
}

.storybook__edit-panel {
  margin-top: var(--space-3);
  padding: var(--space-4);
  background: var(--parchment-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.storybook__edit-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.storybook__regenerate {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.storybook__error {
  width: 100%;
  text-align: center;
  padding: var(--space-4) var(--space-6);
  background: var(--error-pale);
  border: 1px solid var(--error);
  border-radius: var(--radius-md);
  color: var(--error);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.storybook__error p {
  color: inherit;
  margin-bottom: 0;
}

/* Story Review (legacy) */
.book-review__intro {
  margin-bottom: var(--space-6);
  font-size: var(--text-lg);
}

.book-page__illustration--locked {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-page__locked-overlay {
  color: var(--text-muted);
  font-style: italic;
}

.book-page__regenerate {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.book-audiobook {
  margin-top: var(--space-4);
  text-align: center;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  justify-content: center;
}

.audio-player__bar {
  width: 150px;
  height: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.audio-player__progress {
  width: 0%;
  height: 100%;
  background: var(--gold);
  transition: width 0.3s linear;
}

.book-series {
  margin-top: var(--space-6);
  text-align: center;
}

.book-series__list {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
}

.book-series__item {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  border: 1px solid var(--border);
}

.book-series__item--current {
  background: var(--gold-pale);
  font-weight: 600;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   GENERATION PROGRESS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.gen-progress {
  max-width: var(--max-width-narrow);
  margin: var(--space-16) auto;
  text-align: center;
}

.gen-progress__visual {
  margin: var(--space-10) 0;
}

.gen-progress__icon {
  width: 6rem;
  height: 6rem;
  margin: 0 auto var(--space-6);
  border-radius: var(--radius-full);
  background: var(--gold-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-4xl);
  animation: pulse-glow 2.5s ease-in-out infinite;
}

.gen-progress__status {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-4);
}

.progress-bar {
  height: 0.5rem;
  background: var(--parchment-deep);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-vivid));
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease-out);
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

.gen-progress__percent {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.gen-progress__error {
  background: var(--error-pale);
  border: 1px solid var(--error);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin: var(--space-6) 0;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ORDER CARDS & TIMELINE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.orders-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.order-row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  transition: all var(--duration-fast) var(--ease-out);
}

.order-row:hover {
  border-color: var(--gold-glow);
  box-shadow: var(--shadow-sm);
}

.order-row__title { flex: 1; font-weight: 500; }
.order-row__price { font-weight: 600; color: var(--ink); }
.order-row__date  { font-size: var(--text-sm); color: var(--text-muted); }

/* Timeline */
.timeline {
  display: flex;
  gap: var(--space-1);
  margin: var(--space-6) 0;
}

.timeline__step {
  flex: 1;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--parchment-deep);
  text-align: center;
  opacity: 0.45;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
}

.timeline__step--done {
  opacity: 1;
  background: var(--forest-pale);
}

.timeline__step--done::after {
  content: '\2713';
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  font-size: var(--text-xs);
  color: var(--forest);
  font-weight: 700;
}

.timeline__label {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text);
  margin-bottom: var(--space-1);
}

.timeline__date {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.timeline__tracking {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Checkout */
.checkout {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}

.checkout__summary {
  background: linear-gradient(135deg, var(--ink), var(--ink-80));
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  color: var(--text-on-dark);
  margin-bottom: var(--space-6);
}

.checkout__summary h2 {
  color: var(--gold);
  font-style: italic;
  font-size: var(--text-xl);
}

.checkout__summary .price {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-on-dark);
  margin-top: var(--space-2);
}

/* Payment success */
.payment-success {
  text-align: center;
  padding: var(--space-16) 0;
}

.payment-success__icon {
  width: 5rem;
  height: 5rem;
  margin: 0 auto var(--space-6);
  background: var(--success-pale);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-3xl);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   DASHBOARD
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.dash-greeting {
  margin-bottom: var(--space-8);
}

.dash-greeting h1 span {
  color: var(--gold);
}

.dash-section {
  margin-bottom: var(--space-10);
}

.dash-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.dash-section__header h2 {
  font-size: var(--text-xl);
}

.empty-state {
  text-align: center;
  padding: var(--space-10);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
}

.empty-state__icon {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-3);
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ACCOUNT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.account-section {
  padding-bottom: var(--space-8);
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--border);
}

.account-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.account-section h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

.account-danger {
  background: var(--error-pale);
  border: 1px solid oklch(0.80 0.08 25);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ADMIN
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.admin-layout {
  background: var(--parchment-paper);
}

.admin-nav {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-5);
  background: var(--ink);
  border-bottom: 2px solid var(--gold-dim);
}

.admin-nav a {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-20);
  transition: all var(--duration-fast);
}

.admin-nav a:hover {
  color: var(--text-on-dark);
  background: oklch(0.25 0.03 270);
}

.admin-nav a.active {
  color: var(--gold);
  background: oklch(0.25 0.03 270);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.metric-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

.metric-card__value {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--ink);
}

.metric-card__label {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.admin-table {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

.admin-table th {
  background: var(--parchment-warm);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: var(--tracking-wide);
}

.admin-table td {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}

.admin-table tr:hover td {
  background: var(--parchment-paper);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PHOTO UPLOAD
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.photo-upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  transition: border-color var(--duration-fast);
  cursor: pointer;
}

.photo-upload:hover {
  border-color: var(--gold);
}

.photo-upload__preview {
  margin-top: var(--space-4);
}

.photo-preview__img {
  max-width: 12rem;
  border-radius: var(--radius-md);
  margin: 0 auto;
  box-shadow: var(--shadow-md);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   WIZARD (Book Creation)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.wizard {
  max-width: var(--max-width-mid);
  margin: 0 auto;
}

.wizard__steps {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.wizard__step {
  flex: 1;
  padding: var(--space-2);
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 500;
  border-bottom: 3px solid var(--border);
  color: var(--text-muted);
  transition: all var(--duration-fast);
}

.wizard__step--active {
  color: var(--gold-dim);
  border-color: var(--gold);
}

.wizard__step--done {
  color: var(--forest);
  border-color: var(--forest);
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: var(--space-3);
}

.option-card {
  position: relative;
}

.option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-card label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
  transition: all var(--duration-fast) var(--ease-out);
  min-height: 3rem;
}

.option-card input:checked + label {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--gold-dim);
  box-shadow: 0 0 0 3px var(--gold-pale);
}

.option-card label:hover {
  border-color: var(--gold-glow);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   STATIC PAGES
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.prose {
  max-width: var(--max-width-mid);
  margin: 0 auto;
}

.prose h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

.prose h3 {
  font-size: var(--text-xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.prose p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

.prose ul, .prose ol {
  list-style: disc;
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.prose li {
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BLOG
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.blog-categories {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}

.blog-category {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  transition: all var(--duration-fast) var(--ease-out);
}

.blog-category:hover {
  border-color: var(--gold-glow);
  color: var(--ink);
}

.blog-category--active {
  background: var(--ink);
  color: var(--text-on-dark);
  border-color: var(--ink);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.blog-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: var(--space-4);
}

.blog-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-out);
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.blog-card__image {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: linear-gradient(135deg, var(--parchment-warm), var(--gold-pale));
}

.blog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--ink), var(--ink-80));
}

.blog-card__content {
  padding: var(--space-4);
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.blog-card__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.blog-card__title a {
  color: var(--ink);
  transition: color var(--duration-fast);
}

.blog-card__title a:hover {
  color: var(--gold-dim);
}

.blog-card__excerpt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
}

.blog-card__tags {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  background: var(--parchment-warm);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.blog-post__header {
  margin-bottom: var(--space-8);
}

.blog-post__header h1 {
  margin-top: var(--space-3);
}

.blog-post__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.blog-post__cover {
  margin-bottom: var(--space-8);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.blog-post__cover img {
  width: 100%;
  height: auto;
  display: block;
}

.blog-post__body {
  margin-bottom: var(--space-8);
}

.blog-post__tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-10);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
}

.blog-post__related {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.blog-post__related h2 {
  margin-bottom: var(--space-6);
}

.badge--tips        { background: var(--forest-pale); color: var(--forest); }
.badge--inspiration { background: var(--gold-pale); color: var(--gold-dim); }
.badge--news        { background: var(--sky-pale); color: var(--sky); }
.badge--stories     { background: oklch(0.93 0.06 350); color: var(--berry); }

.pagination,
.pagy {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-1);
  margin: var(--space-8) 0;
}

.pagination a,
.pagination em,
.pagination span,
.pagy a,
.pagy label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 var(--space-2);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  font-style: normal;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.pagination a,
.pagy a {
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.pagination a:hover,
.pagy a:hover {
  background: var(--parchment-warm);
  border-color: var(--gold-glow);
  color: var(--ink);
}

.pagination a.current,
.pagination em,
.pagy a[aria-current="page"] {
  background: var(--ink);
  color: var(--text-on-dark);
  border: 1px solid var(--ink);
  pointer-events: none;
}

.pagination .disabled,
.pagy a[aria-disabled="true"]:not([aria-current]) {
  opacity: 0.4;
  pointer-events: none;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CONSENT CHECKBOXES
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.consent-checkboxes { margin-top: var(--space-4); }

.consent-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.consent-checkbox input[type="checkbox"] {
  margin-top: 0.25em;
  flex-shrink: 0;
}

.consent-checkbox label {
  font-size: var(--text-sm);
  line-height: 1.5;
}

.consent-checkbox a {
  color: var(--gold);
  text-decoration: underline;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LEGAL PAGES
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.legal-page h2 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.legal-page h3 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

.legal-page ul, .legal-page ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.legal-page table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
}

.legal-page th, .legal-page td {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  text-align: left;
}

.legal-page th {
  background: var(--surface-dim, var(--parchment-warm));
  font-weight: 600;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CONSENT MANAGEMENT (account page)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.consent-list {
  list-style: none;
  padding: 0;
}

.consent-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

@media (max-width: 64rem) {
  .features-grid { grid-template-columns: 1fr; }
  .testimonials  { grid-template-columns: 1fr; }
  .steps         { grid-template-columns: 1fr; gap: var(--space-6); }
}

@media (max-width: 48rem) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-grid--compact { grid-template-columns: 1fr; }

  .site-nav__inner {
    flex-wrap: wrap;
    height: auto;
    padding: var(--space-3) var(--space-4);
    gap: var(--space-2);
  }

  .site-nav__links {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-1);
  }

  .hero {
    min-height: auto;
    padding: var(--space-12) var(--space-4);
  }

  .hero__title { font-size: var(--text-3xl); }

  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  .timeline { flex-direction: column; }

  .site-footer__inner {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .cookie-bar {
    flex-direction: column;
    text-align: center;
  }

  .order-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .cta-band { margin: var(--space-12) calc(-1 * var(--space-4)); }

  .profile-edit section {
    padding: var(--space-5);
  }

  .profile-edit__avatar-image img {
    width: 150px;
    height: 150px;
  }

  .storybook__cover {
    padding: var(--space-10) var(--space-5);
  }

  .storybook__title {
    font-size: var(--text-2xl);
  }

  .storybook__text {
    padding: var(--space-6) var(--space-5) var(--space-4);
    font-size: var(--text-md);
    text-align: left;
    hyphens: none;
  }

  .storybook__page-tools {
    flex-direction: column;
  }
}

}
