/* Capykraft app — pieces beyond the DS mirror (auth, menus, skeletons,
   empty/error states, the states previewer). All built on DS tokens. */

/* ---------- nav extras ---------- */
.nav__user { background: none; border: none; padding: 2px; border-radius: 50%; cursor: pointer; display: inline-flex; }
.nav__user:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ---------- language picker (i18n) — a ghost control that wears the brand ---------- */
.lang-picker {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 30px 6px 11px;
  line-height: 1.2;
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8178' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 13px;
}
.lang-picker:hover {
  color: var(--text-strong);
  background-color: var(--paper-200);
  border-color: var(--paper-400);
}
.lang-picker:focus-visible {
  outline: none;
  color: var(--text-strong);
  border-color: var(--clay-400);
  box-shadow: var(--shadow-focus);
}
.lang-picker option { color: var(--ink-800); background: var(--surface-card, #fff); }
/* On the dark hero prompt / wherever a lighter chrome is needed, the variant
   hooks stay available; base style is intentionally neutral so it reads on cream. */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 10px); width: 248px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); padding: 8px; z-index: 60; animation: menuIn var(--dur) var(--ease-out); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.menu__head { padding: 12px 12px 13px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 6px; display: flex; gap: 11px; align-items: center; }
.menu__name { font-weight: 600; color: var(--text-strong); font-size: var(--text-base); }
.menu__email { font-size: var(--text-sm); color: var(--text-faint); }
.menu__item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 10px 12px; border: none; background: none; border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: var(--text-base); color: var(--text-body); cursor: pointer; transition: var(--transition-colors); }
.menu__item:hover { background: var(--paper-200); color: var(--text-strong); }
.menu__item svg { color: var(--text-faint); }

/* ---------- Auth ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 40px 24px; }
.auth__card { width: 100%; max-width: 408px; text-align: center; }
.auth__mark { width: 56px; height: 56px; margin: 0 auto 22px; }
.auth__mark img { width: 100%; height: 100%; object-fit: contain; }
.auth h1 { font-family: var(--font-display); font-weight: 500; font-size: 2.1rem; letter-spacing: -0.025em; color: var(--ink-900); margin: 0 0 8px; }
.auth__sub { color: var(--text-muted); font-size: var(--text-md); margin: 0 0 28px; line-height: 1.55; }
.auth__form { display: grid; gap: 14px; text-align: left; }
.auth__social { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.auth__or { display: flex; align-items: center; gap: 14px; color: var(--text-faint); font-size: var(--text-sm); margin: 22px 0 4px; }
.auth__or::before, .auth__or::after { content: ""; height: 1px; background: var(--border-default); flex: 1; }
.auth__toggle { margin-top: 22px; font-size: var(--text-base); color: var(--text-muted); }
.auth__toggle button { background: none; border: none; color: var(--clay-600); font-weight: 600; font-family: inherit; font-size: inherit; cursor: pointer; padding: 0; }
.auth__toggle button:hover { color: var(--clay-700); text-decoration: underline; }
.auth__err { background: var(--rust-50); color: var(--rust-600); font-size: var(--text-sm); font-weight: 500; padding: 9px 13px; border-radius: var(--radius-md); text-align: left; }

.field__hint { display: block; font-size: var(--text-sm); color: var(--text-faint); margin-top: 6px; }

/* spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; border: 2px solid; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }

/* dashboard card extras */
.pcard__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard__cover-wrap { position: relative; }
/* Visible at rest so delete is discoverable (was opacity:0 / hover-only); lifts on hover/focus. */
.pcard__kebab { position: absolute; top: 8px; right: 8px; opacity: 0.72; transition: opacity var(--dur) var(--ease-out); background: color-mix(in srgb, var(--paper-card) 86%, transparent); backdrop-filter: blur(4px); }
.pcard:hover .pcard__kebab, .pcard:focus-within .pcard__kebab { opacity: 1; }
.pcard__cover--img { padding: 0; overflow: hidden; }
/* Destructive action + inline delete confirmation inside the card menu. */
.menu__item--danger { color: var(--text-danger, #b3261e); }
.menu__item--danger svg { color: currentColor; }
.menu__item--danger:hover { background: color-mix(in srgb, var(--text-danger, #b3261e) 10%, transparent); color: var(--text-danger, #b3261e); }
.menu__confirm { padding: 6px 8px 8px; }
.menu__confirm-q { font-family: var(--font-sans); font-size: var(--text-sm); color: var(--text-body); margin: 2px 4px 10px; line-height: 1.35; }
.menu__confirm-actions { display: flex; gap: 6px; }
.menu__confirm-actions .menu__item { width: auto; flex: 1; justify-content: center; padding: 8px 10px; }
.dash__count { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-faint); }

/* ---------- Skeletons ---------- */
@keyframes shimmerSk { 0% { background-position: -460px 0; } 100% { background-position: 460px 0; } }
.skel { background: var(--paper-200); background-image: linear-gradient(90deg, transparent, rgba(255,253,248,.7), transparent); background-size: 460px 100%; background-repeat: no-repeat; animation: shimmerSk 1.3s infinite linear; border-radius: var(--radius-sm); }
.skel-cover { aspect-ratio: 3/4; border-radius: var(--radius-md); }

/* ---------- Empty / error states ---------- */
.state { text-align: center; max-width: 460px; margin: 7vh auto; }
.state__art { width: 116px; height: 116px; margin: 0 auto 26px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-200); }
.state__art--ink { background: none; padding: 0; border-radius: 0; }
.state__art--ink img { width: 100%; height: 100%; object-fit: contain; }
.state__art svg { color: var(--clay-500); }
.state h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.9rem; color: var(--ink-900); margin: 0 0 10px; letter-spacing: -0.015em; }
.state p { color: var(--text-muted); font-size: var(--text-md); line-height: 1.6; margin: 0 0 26px; }

/* ---------- States previewer (review affordance, not product chrome) ---------- */
.statesbar { position: fixed; left: 20px; bottom: 20px; z-index: 90; display: flex; align-items: center; gap: 8px; background: var(--ink-900); color: var(--paper-200); border-radius: var(--radius-pill); padding: 7px 8px 7px 15px; box-shadow: var(--shadow-xl); font-family: var(--font-mono); font-size: var(--text-xs); }
.statesbar__lbl { letter-spacing: .04em; color: var(--ink-400); padding-right: 4px; }
.statesbar__btn { font-family: var(--font-mono); font-size: var(--text-xs); border: none; background: rgba(250,247,237,.08); color: var(--paper-300); padding: 5px 11px; border-radius: var(--radius-pill); cursor: pointer; transition: var(--transition-colors); }
.statesbar__btn:hover { background: rgba(250,247,237,.16); color: var(--paper-100); }
.statesbar__btn--on { background: var(--clay-500); color: var(--paper-50); }

/* ---------- Kickoff niche chips (Direction A) ---------- */
.kchips { display: flex; flex-wrap: wrap; gap: 8px; }
.kchip { cursor: pointer; white-space: nowrap; border: 1px solid var(--border-default); border-radius: var(--radius-pill); padding: 7px 14px; font-family: var(--font-sans); font-weight: 600; font-size: var(--text-sm); background: transparent; color: var(--text-muted); transition: var(--transition-colors); }
.kchip:hover { border-color: var(--clay-300); color: var(--clay-700); }
.kchip--on { background: var(--clay-50); border-color: var(--clay-300); color: var(--clay-700); }

/* ---------- Brief edit affordances ---------- */
.brief__edit { font-family: var(--font-sans); font-size: var(--text-base); color: var(--text-muted); display: inline-flex; gap: 6px; align-items: center; background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm); }
.brief__edit:hover { color: var(--clay-700); background: var(--clay-50); }
.brief__v-edit { width: 100%; font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.4; color: var(--text-strong); border: 1px solid var(--clay-300); border-radius: var(--radius-md); padding: 8px 12px; background: var(--surface-card); box-shadow: var(--shadow-focus); }
.brief__v-edit:focus { outline: none; }

/* ---------- Request-change popover ---------- */
.rc { background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); padding: 16px; width: 340px; }
.rc h4 { font-family: var(--font-sans); font-size: var(--text-base); font-weight: 700; margin: 0 0 4px; color: var(--text-strong); }
.rc p { font-size: var(--text-sm); color: var(--text-muted); margin: 0 0 12px; }
.rc__row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* regen overlay on a section */
.section-busy { position: absolute; inset: 0; background: color-mix(in srgb, var(--paper-card) 78%, transparent); display: flex; align-items: center; justify-content: center; gap: 12px; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--clay-600); border-radius: var(--radius-md); z-index: 3; }

/* dialog buttons row */
.dialog__art { width: 92px; height: 92px; margin: 0 auto 18px; display: grid; place-items: center; background: var(--clay-50); border-radius: 50%; }
.dialog h3 { font-family: var(--font-display); font-size: 1.6rem; color: var(--ink-900); margin: 0 0 10px; }
.dialog p { color: var(--text-muted); font-size: var(--text-base); line-height: 1.6; margin: 0 0 22px; }
.dialog__row { display: flex; gap: 10px; justify-content: center; }

/* generation: error panel */
.gen-error { background: var(--rust-50); border: 1px solid var(--rust-100); border-radius: var(--radius-lg); padding: 22px 24px; display: flex; gap: 16px; align-items: flex-start; margin-top: 22px; }
.gen-error svg { color: var(--rust-500); flex: none; margin-top: 2px; }
.gen-error h3 { font-family: var(--font-sans); font-size: var(--text-md); font-weight: 700; color: var(--rust-600); margin: 0 0 4px; }
.gen-error p { font-size: var(--text-base); color: var(--ink-700); margin: 0 0 14px; line-height: 1.5; }

@media (max-width: 720px) {
  .auth__social { grid-template-columns: 1fr; }
  .statesbar { left: 12px; right: 12px; bottom: 12px; justify-content: center; flex-wrap: wrap; }
}

/* ---------- interview scroll spacing ---------- */
.interview { min-height: calc(100vh - var(--nav-height)); display: flex; flex-direction: column; }
.chat-scroll { flex: 1; }

/* ---------- generation ---------- */
.gen__head { display: flex; gap: 26px; align-items: center; margin-bottom: 30px; }
.gen__cover { border-radius: var(--radius-md); position: relative; transition: box-shadow var(--dur) var(--ease-out); }
@keyframes coverGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(192,106,65,0); } 50% { box-shadow: 0 10px 30px -8px rgba(192,106,65,.45); } }
.gen__cover--building { animation: coverGlow 2.2s var(--ease-in-out) infinite; }
.gen__cover--building::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-md); background: linear-gradient(110deg, transparent 30%, rgba(255,253,248,.28) 50%, transparent 70%); background-size: 220% 100%; animation: coverSweep 2.4s linear infinite; pointer-events: none; }
@keyframes coverSweep { from { background-position: 140% 0; } to { background-position: -40% 0; } }
.log__line--error .log__m { color: var(--ochre-400); }

/* ---------- review / reader ---------- */
.reader { position: relative; }
.reader-wrap { animation: fadeUp var(--dur-slow) var(--ease-out); }
.reader__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.reader__top .reader__chnum { margin-bottom: 0; }
.reader__actions { display: flex; gap: 8px; position: relative; }
.reader__actions .menu { right: 0; top: calc(100% + 8px); }
.reader-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 0 4px; }
.reader-dots { display: flex; gap: 8px; }
.reader-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: var(--paper-400); cursor: pointer; padding: 0; transition: var(--transition-colors), transform var(--dur-fast) var(--ease-out); }
.reader-dot:hover { background: var(--clay-300); }
.reader-dot--on { background: var(--clay-500); transform: scale(1.25); }

.covertab { display: flex; gap: 44px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 16px 0; }

/* ---------- product view header ---------- */
.pv__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.pv__title { font-size: clamp(1.8rem, 4vw, 2.5rem); max-width: 22ch; line-height: 1.06; }
.pv__actions { display: flex; gap: 10px; align-items: center; }

/* ============================================================
   Blueprint identity — internal app chrome
   Mirrors the landing design system: ink-on-cream dot-grid paper,
   grotesk display headlines, mono small-caps labels, and blueprint
   frames with crop-mark ticks. Everything is scoped to .app, so the
   landing (.landing) and the warm product surfaces (.reader, .cover,
   .sales) are left untouched and stay intentionally warm.
   Brand tokens (--brand-*) come from brand.css.
   ============================================================ */

/* --- Blueprint paper: cream + faint dot-grid (matches .landing) --- */
.app {
  background-color: var(--paper-50);
  background-image: radial-gradient(circle, rgba(31, 27, 21, 0.06) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}

/* --- Eyebrows -> mono small-caps blueprint labels --- */
.app .eyebrow {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.6875rem;   /* 11px */
  letter-spacing: 0.14em;
  color: var(--ink-900);
  opacity: 0.5;
}
.app .eyebrow--clay { color: var(--clay-600); opacity: 1; }
.app .brief__k { font-family: var(--font-mono); }

/* --- Primary chrome headlines -> grotesk display (the landing face) --- */
.app .h-display,
.app .gen__stage-label,
.app .auth h1,
.app .state h2,
.app .dialog h3 {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.03;
  color: var(--ink-900);
}

/* --- Blueprint framed cards: dashed rule + diagonal crop-mark ticks --- */
.app .dirA__card,
.app .brief,
.app .dialog {
  position: relative;
  background: var(--paper-card);
  border: 1.5px dashed var(--brand-rule, rgba(31, 27, 21, 0.25));
  border-radius: 3px;
  box-shadow: var(--shadow-sm);
}
.app .dirA__card::before, .app .dirA__card::after,
.app .brief::before, .app .brief::after,
.app .dialog::before, .app .dialog::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  pointer-events: none;
  z-index: 2;
}
.app .dirA__card::before,
.app .brief::before,
.app .dialog::before {
  top: -1px; left: -1px;
  border-top: 2px solid var(--ink-900);
  border-left: 2px solid var(--ink-900);
}
.app .dirA__card::after,
.app .brief::after,
.app .dialog::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--ink-900);
  border-right: 2px solid var(--ink-900);
}

/* --- Auth: the entry moment gets the signature ink panel (mirrors .lcta__card) --- */
.app .auth { padding: 56px 24px; }
.app .auth__card {
  position: relative;
  background-color: var(--ink-900);
  background-image:
    radial-gradient(circle, rgba(250, 247, 237, 0.06) 1.5px, transparent 1.5px),
    linear-gradient(var(--ink-900), var(--ink-900));
  background-size: 22px 22px, 100% 100%;
  border-radius: 4px;
  box-shadow: var(--shadow-xl);
  padding: 44px 40px 36px;
}
/* registration crop-marks in paper, printed on the dark sheet */
.app .auth__card::before,
.app .auth__card::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  pointer-events: none;
  opacity: 0.45;
}
.app .auth__card::before {
  top: 12px; left: 12px;
  border-top: 2px solid var(--paper-300);
  border-left: 2px solid var(--paper-300);
}
.app .auth__card::after {
  bottom: 12px; right: 12px;
  border-bottom: 2px solid var(--paper-300);
  border-right: 2px solid var(--paper-300);
}
.app .auth h1 { color: var(--paper-50); }
.app .auth__sub { color: var(--paper-300); }
.app .auth .field__label { color: var(--paper-200); }
.app .auth__or { color: var(--paper-400); }
.app .auth__or::before,
.app .auth__or::after { background: rgba(250, 247, 237, 0.16); }
.app .auth__toggle { color: var(--paper-300); }
.app .auth__mark {
  width: 56px; height: 56px;
  background: url('/assets/capykraft-mark-light.png') center / contain no-repeat;
}
.app .auth__mark img { opacity: 0; }   /* hide the dark-bg default mark; show the light one */

/* --- Product covers pinned like blueprints: crop-mark ticks --- */
.app .pcard__cover-wrap::before,
.app .pcard__cover-wrap::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.26;
  transition: opacity var(--dur) var(--ease-out);
}
.app .pcard:hover .pcard__cover-wrap::before,
.app .pcard:hover .pcard__cover-wrap::after { opacity: 0.7; }
.app .pcard__cover-wrap::before {
  top: -5px; left: -5px;
  border-top: 2px solid var(--ink-900);
  border-left: 2px solid var(--ink-900);
}
.app .pcard__cover-wrap::after {
  bottom: -5px; right: -5px;
  border-bottom: 2px solid var(--ink-900);
  border-right: 2px solid var(--ink-900);
}

/* --- Pixel-square divider under the dashboard head (echoes .pixel-divider) --- */
.app .dash__head { position: relative; }
.app .dash__head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -18px;
  height: 5px;
  background-image: linear-gradient(90deg, var(--ink-900) 0 5px, transparent 5px 8px);
  background-size: 8px 5px;
  background-repeat: repeat-x;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 20%, transparent 58%);
          mask-image: linear-gradient(90deg, #000 0%, #000 20%, transparent 58%);
  opacity: 0.5;
}

/* --- Blueprint error/empty art: framed ink square, not a clay circle --- */
.app .state__art:not(.state__art--ink) {
  background: var(--paper-card);
  border: 1.5px dashed var(--brand-rule-dk, rgba(31, 27, 21, 0.42));
  border-radius: 4px;
  position: relative;
}
.app .state__art:not(.state__art--ink)::before,
.app .state__art:not(.state__art--ink)::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  pointer-events: none;
}
.app .state__art:not(.state__art--ink)::before {
  top: -1px; left: -1px;
  border-top: 2px solid var(--ink-900);
  border-left: 2px solid var(--ink-900);
}
.app .state__art:not(.state__art--ink)::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--ink-900);
  border-right: 2px solid var(--ink-900);
}

/* --- Product-view tabs: subtle blueprint container --- */
.app .tabs {
  background: var(--brand-ghost, rgba(31, 27, 21, 0.06));
  border: 1px dashed var(--brand-rule, rgba(31, 27, 21, 0.18));
  border-radius: 3px;
}
.app .tab--active { border-radius: 2px; }

/* ============================================================
   Poster pass — push the chrome toward the printed-blueprint
   posters: risograph grain, mono label-tags, bracketed boxes,
   ink chips. CSS-only, scoped to .app.
   ============================================================ */

/* Risograph grain over the whole app — the "printed" texture.
   Sits above page content (z:1) but below floating chrome (nav z40+),
   so it grains the paper/cards but leaves menus and toasts crisp. */
.app::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px 150px;
}

/* Eyebrows read as printed label-tags: a leading pixel square */
.app .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.app .eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 1px;
  background: currentColor;
}

/* Stronger corner brackets on framed cards — the posters' [ ] boxes */
.app .dirA__card::before, .app .dirA__card::after,
.app .brief::before, .app .brief::after,
.app .dialog::before, .app .dialog::after {
  width: 14px;
  height: 14px;
}

/* Dashboard count becomes a small inverse-ink tag (poster chip) */
.app .dash__count {
  display: inline-flex;
  align-items: center;
  background: var(--ink-900);
  color: var(--paper-200);
  padding: 5px 11px;
  border-radius: 2px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================================
   §10 Store tab — author's storefront management home.
   Built from the existing `.app` design tokens (no new palette).
   ============================================================ */
.app .store-view { display: flex; flex-direction: column; }
.app .store-card {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md, 0 1px 2px rgba(0,0,0,.04));
  padding: 26px 28px;
  margin-top: 22px;
}

/* Identity card */
.app .store-id { display: flex; gap: 24px; align-items: flex-start; }
.app .store-id__avatar {
  flex: none;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--clay-50);
  border: 1px solid var(--border-subtle);
  display: grid; place-items: center;
  overflow: hidden;
}
.app .store-id__avatar img { width: 70%; height: 70%; object-fit: contain; }
.app .store-id__avatar img[alt]:not([alt=""]) { width: 100%; height: 100%; object-fit: cover; }
.app .store-id__body { flex: 1; min-width: 0; }
.app .store-id__name { font-family: var(--font-display); font-size: 1.7rem; margin: 2px 0 16px; color: var(--text-strong); }
.app .store-id__handle {
  display: flex; align-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease-out);
}
.app .store-id__handle:focus-within { border-color: var(--clay-400, var(--clay-300)); box-shadow: var(--shadow-focus); }
.app .store-id__handle--err { border-color: var(--rust-300, var(--rust-100)); }
.app .store-id__at { padding: 0 4px 0 12px; color: var(--text-faint); font-weight: 600; }
.app .store-id__handle-input { border: none; box-shadow: none; flex: 1; background: transparent; padding-left: 2px; }
.app .store-id__handle-input:focus { outline: none; box-shadow: none; }
.app .store-id__err { display: flex; align-items: center; gap: 6px; color: var(--rust-600); font-size: var(--text-sm); font-weight: 500; margin: 8px 0 0; }
.app .store-id__row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 18px; }
.app .store-id__visit { display: flex; flex-direction: column; gap: 4px; }
.app .store-id__url { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-faint); }
.app .store-id__nohandle { font-size: var(--text-sm); color: var(--text-faint); }

/* Products card */
.app .store-prods__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.app .store-prods__title { font-family: var(--font-display); font-size: 1.7rem; color: var(--text-strong); }
.app .store-prods__notice {
  display: flex; align-items: center; gap: 9px;
  background: var(--clay-50); color: var(--clay-700);
  border-radius: var(--radius-md);
  padding: 11px 14px; font-size: var(--text-sm);
  margin-bottom: 18px;
}
.app .store-prods__empty { color: var(--text-muted); font-size: var(--text-base); padding: 8px 0; }
.app .store-prods__list { display: flex; flex-direction: column; }
.app .store-prod {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--border-subtle);
}
.app .store-prod:first-child { border-top: none; }
.app .store-prod__cover { flex: none; width: 80px; }
.app .store-prod__cover .cover { aspect-ratio: 3/4; border-radius: 4px; }
/* The Cover composition is tuned for large dashboard/landing covers (vw-based
   type, big rule/pixels). At thumbnail size that overflows + gets clipped and
   reads as "gigantic". Scale its internals down for this 80px thumbnail. */
.app .store-prod__cover .cover__pad { padding: 11% 11% 12%; }
.app .store-prod__cover .cover__kicker { font-size: 0.34rem; letter-spacing: 0.06em; }
.app .store-prod__cover .cover__rule { width: 14px; height: 1.5px; margin-top: 9%; }
.app .store-prod__cover .cover__pixels { gap: 2px; margin-top: 9%; }
.app .store-prod__cover .cover__pixels span { width: 4px; height: 4px; }
.app .store-prod__cover .cover__title { font-size: 0.6rem; line-height: 1.06; margin-top: auto; }
.app .store-prod__cover .cover__author { font-size: 0.4rem; margin-top: 9%; }
.app .store-prod__main { flex: 1; min-width: 0; }
.app .store-prod__title { font-weight: 600; color: var(--text-strong); margin: 0 0 7px; }
.app .store-prod__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.app .store-prod__link { display: inline-flex; align-items: center; gap: 4px; color: var(--clay-600); font-size: var(--text-sm); font-weight: 600; text-decoration: none; }
.app .store-prod__link:hover { color: var(--clay-700); text-decoration: underline; }
.app .store-prod__hint { font-size: var(--text-sm); color: var(--text-faint); }
.app .store-prod__action { flex: none; }
.app .store-prod__gated { font-size: var(--text-sm); color: var(--text-faint); }

/* ===== sales-3 — DS-native edit toolbar (SalesEditBar + StorefrontLayoutCard).
   Container/layout ONLY: every control is a DS <Button>; this just spaces the
   groups and builds the segmented control. Tokens only — no bespoke colours. ===== */
.app .editbar { display: flex; flex-direction: column; gap: 18px; margin-top: 18px; }
.app .editbar__group { display: flex; flex-direction: column; gap: 10px; }
.app .editbar__group-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.app .editbar__label {
  font-size: var(--text-xs, 0.75rem); font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-faint);
}
.app .editbar__hint { font-size: var(--text-sm); color: var(--text-muted); }
/* Segmented control: a soft tray that groups the option Buttons as one unit. */
.app .seg {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px;
  background: var(--clay-50, var(--surface-sunken, rgba(0,0,0,.03)));
  border: 1px solid var(--border-subtle); border-radius: var(--radius-pill, 999px);
  width: fit-content;
}
.app .editbar__rows { display: flex; flex-direction: column; gap: 4px; }
.app .editbar__row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 10px; border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle); background: var(--surface-card);
}
.app .editbar__row-name { font-size: var(--text-sm); font-weight: 600; color: var(--text-strong); }
.app .editbar__row-actions { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.app .editbar__uploads { display: flex; gap: 12px; flex-wrap: wrap; }
/* The upload control is a styled <label class="btn"> wrapping a hidden input. */
.app .editbar__upload { position: relative; cursor: pointer; gap: 7px; }
.app .editbar__upload-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.app .editbar__upload-input:disabled { cursor: default; }

/* The "Receber pagamentos" Connect block — a real card with a labeled heading. */
.app .stripe-connect { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.app .stripe-connect__title { margin: 0; }
.app .stripe-connect__ok { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-weight: 600; color: var(--sage-700, var(--text-strong)); }
.app .stripe-connect__pending, .app .stripe-connect__off { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* ===== "Edit storefront" — the live editable real storefront ===== */
.app .store-edit { display: flex; flex-direction: column; }
.app .store-edit__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.app .store-edit__canvas {
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-md, 0 1px 2px rgba(0,0,0,.04));
}
.app .store-edit__canvas .editbar { margin-top: 14px; }

/* ===== §24 Magic Create — live filmstrip build ===== */
.wrap--wide { max-width: 1180px; }

.mbuild { display: flex; flex-direction: column; gap: 18px; }
.mbuild__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.mbuild__rail { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-faint); padding: 8px 0; }
.mbuild__rail-item { display: inline-flex; align-items: center; gap: 5px; }

/* The book column sizes to the page content (measure + page padding), so the
   preview card hugs the book instead of stretching to a wide track that leaves a
   dead whitespace band to the RIGHT of the chapter text. minmax(0, …) keeps it
   shrinkable below the cap on narrow widths. */
.mbuild__stage { display: grid; grid-template-columns: 248px minmax(0, calc(var(--bk-measure, 40rem) + 82px)); gap: 22px; align-items: start; }
@media (max-width: 820px) { .mbuild__stage { grid-template-columns: 1fr; } }

/* Left filmstrip column */
.film { display: flex; flex-direction: column; gap: 10px; }
.film__thumb { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; text-align: left;
  padding: 10px 12px; border-radius: var(--radius-md); border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.film__thumb:hover { border-color: var(--bk-accent, var(--clay-400)); }
.film__thumb--building { border-color: var(--bk-accent, var(--clay-500)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bk-accent, var(--clay-500)) 16%, transparent); background: var(--paper-50, var(--paper)); }
.film__thumb--done { border-color: var(--sage-300, #9bb07e); }
.film__thumb--active { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bk-accent, var(--clay-500)) 22%, transparent); border-color: var(--bk-accent, var(--clay-600)); }
.film__num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }
.film__mini { width: 30px; height: 38px; border-radius: 3px; overflow: hidden; background: var(--paper-200, #eee); display: block; position: relative; }
.film__mini-skel { position: absolute; inset: 0; }
.film__mini-lines { position: absolute; inset: 6px 5px; display: flex; flex-direction: column; gap: 4px; }
.film__mini-lines span { height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--bk-ink, #333) 28%, transparent); }
.film__mini-lines span:nth-child(2) { width: 80%; }
.film__mini-lines span:nth-child(3) { width: 60%; }
.film__title { font-size: var(--text-sm); color: var(--text-strong); line-height: 1.25; }
.film__thumb--pending .film__title { color: var(--text-faint); }
.film__state { display: inline-flex; flex: none; color: var(--sage-500, #566a3f); }
.film__thumb--building .film__state { color: var(--bk-accent, var(--clay-500)); }

/* Right book pane — the real designed page, styled from frame 1 */
.bookpane { min-width: 0; }
/* The live book document, rendered in a same-origin iframe so its embedded
   <style> blocks stay sandboxed in the frame (no global leak into the app).
   Fills the pane; no border (the document carries its own paper + shadow). */
.bookpane__frame { width: 100%; height: 78vh; min-height: 520px; border: 0; display: block;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md, 0 8px 30px rgba(0,0,0,.08));
  background: var(--bk-paper, var(--paper)); }
.bookpane__shell { background: var(--bk-paper, var(--paper)); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-md, 0 8px 30px rgba(0,0,0,.08)); }
.bookpane__cover { padding: 22px 22px 0; }
.bookpane__cover .cover { max-width: 180px; width: 100%; }
.bookpane__cover-img { width: 180px; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius-md); display: block; }
.bookpane__page { padding: 26px 40px 40px; color: var(--bk-ink, var(--text-strong)); font-family: var(--bk-body-font, var(--font-serif)); width: 100%; max-width: var(--bk-measure, 40rem); }
.bookpane__page--building { min-height: 280px; }
.bookpane__h { font-family: var(--bk-heading-font, var(--font-serif)); color: var(--bk-ink, var(--text-strong)); font-size: 1.7rem; line-height: 1.15; margin: 0 0 16px; }
.bookpane__body { font-size: var(--text-md); line-height: 1.7; }
.bookpane__body p { margin: 0 0 1em; }
.bookpane__body strong { color: var(--bk-accent-deep, var(--bk-ink)); }
.bookpane__body blockquote { border-left: 3px solid var(--bk-accent, var(--clay-500)); margin: 1.2em 0; padding: 4px 0 4px 16px; font-style: italic; color: var(--bk-accent-deep, var(--bk-ink)); }
.bookpane__body ul { margin: 0 0 1em; padding-left: 1.2em; }
.bookpane__figure { margin-top: 8px; }
.bookpane__figure img { width: 100%; border-radius: var(--radius-md); display: block; }
.bookpane__figure-ph { width: 100%; aspect-ratio: 16/9; border-radius: var(--radius-md); }

/* Per-style capybara thumbnail in the style picker. Square, rounded, sized to
   sit beside the style label; cover-fit so a 512px source crops cleanly. The
   placeholder variant (shown when no thumb exists yet / image fails to load)
   reuses the same box so the card layout is identical with or without art. */
.style-thumb {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md, 10px);
  object-fit: cover;
  display: block;
  background: var(--paper, #fff);
  border: 1px solid var(--line, rgba(0, 0, 0, .08));
}
.style-thumb--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm, 13px);
  color: var(--clay-500, #c0653c);
  background: var(--clay-50, rgba(192, 101, 60, .08));
  border-color: var(--clay-100, rgba(192, 101, 60, .16));
  user-select: none;
}

/* HERO variant — the capybara as the card's HEADLINE: a full-width image at the
   top of the swatch instead of a 40px corner icon. The source art is square and
   carries baked-in style typography, so the box is square + object-fit:cover —
   a square source in a square box shows the WHOLE image with zero crop (no clipped
   art, no clipped lettering). Gives the thumbnail the prominence it lacked. */
.style-thumb--hero {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md, 10px);
}
.style-thumb--placeholder.style-thumb--hero {
  font-size: 3rem;
}

/* Style picker GRID — the 3 AI-shortlisted swatches. Fixed 3-up on desktop (the
   .gen column is 680px, where auto-fit's 220px floor + gaps overflowed to 688px and
   dropped the 3rd card to a second row). Collapses to a single full-width column on
   phones. Shared by the loading skeleton and the real grid so both stay in lockstep. */
.style-grid {
  display: grid;
  /* minmax(0,1fr) — NOT plain 1fr (= minmax(auto,1fr)). The swatch has nowrap lines
     (the style name set big in its display face); with `auto` the longest name can't
     shrink its track, so that card renders WIDER than the others. minmax(0,…) lets
     every track shrink equally, so all 3 cards are the same width. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}
@media (max-width: 640px) {
  .style-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Style picker SWATCH — one cohesive card the user judges a whole style by:
   capybara thumbnail + name (head), then a two-line TYPE SPECIMEN (the label as
   a title in the style's display face, a fixed body sample in its body face),
   then the AI's one-line reason. The specimen is the centerpiece, so it gets a
   tinted, inset panel that reads like a real type sample mounted on the card. */
.style-swatch {
  min-width: 0; /* allow the grid item to shrink so its nowrap lines ellipsis instead of widening the column */
  text-align: left;
  padding: 14px;
  border-radius: var(--radius-lg, 14px);
  cursor: pointer;
  border: 2px solid var(--line, rgba(0, 0, 0, .1));
  background: var(--paper, #fff);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.style-swatch:hover { border-color: var(--clay-300, rgba(192, 101, 60, .4)); transform: translateY(-1px); }
.style-swatch:focus-visible { outline: 2px solid var(--clay-500, #c0653c); outline-offset: 2px; }
.style-swatch.is-selected {
  border-color: var(--clay-500, #c0653c);
  background: var(--clay-50, #fffaf7);
  box-shadow: 0 0 0 3px var(--clay-100, rgba(192, 101, 60, .16));
}

.style-swatch__head { display: flex; align-items: center; gap: 10px; }
.style-swatch__name {
  font-weight: 700;
  font-size: var(--text-md, 15px);
  line-height: 1.2;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.style-swatch__check { color: var(--clay-500, #c0653c); flex: 0 0 auto; }

/* The two-line specimen panel. */
.style-swatch__specimen {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-md, 10px);
  background: var(--ink-02, rgba(0, 0, 0, .03));
  border: 1px solid var(--line, rgba(0, 0, 0, .07));
  overflow: hidden;
}
.style-swatch.is-selected .style-swatch__specimen {
  background: rgba(255, 255, 255, .65);
  border-color: var(--clay-100, rgba(192, 101, 60, .2));
}
/* Line 1 — the label set as a TITLE in the style's display face. Big enough to
   read the personality of the face; clipped so a tall display font can't break
   the card. */
.style-swatch__display {
  display: block;
  font-size: 1.6rem;
  line-height: 1.05;
  font-weight: 600;
  color: var(--ink, #1f1b15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Line 2 — a fixed body sample in the style's body face, at reading size. */
.style-swatch__body {
  display: block;
  font-size: var(--text-sm, 13px);
  line-height: 1.4;
  color: var(--ink-70, rgba(31, 27, 21, .72));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.style-swatch__reason {
  margin: 0;
  font-size: var(--text-sm, 13px);
  line-height: 1.4;
  color: var(--muted, rgba(31, 27, 21, .6));
}

/* ============================================================
   Spec A — Credits made visible: pill, popover, account page,
   and the redesigned Planos. Tokens only (_ds), mirroring the
   dash/store language (warm card, keyline, low diffuse shadow).
   ============================================================ */

/* Anchor wraps the pill + its absolutely-positioned popover in the nav. */
.credit-anchor { position: relative; display: inline-flex; align-items: center; margin-right: 14px; }

/* ---- Credit pill ---- */
.credit-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--surface-card); border: 1px solid var(--border-default);
  box-shadow: var(--shadow-xs); cursor: pointer;
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 600;
  color: var(--text-strong); transition: var(--transition-colors), box-shadow var(--dur-fast) var(--ease-out);
}
.credit-pill:hover { background: var(--paper-50); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.credit-pill:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.credit-pill__ico { color: var(--clay-500); }
.credit-pill__n { font-weight: 700; }
.credit-pill__label { color: var(--text-muted); font-weight: 500; }
.credit-pill svg:last-child { color: var(--text-faint); }

/* ---- Credit popover ---- */
.credit-pop {
  position: absolute; right: 0; top: calc(100% + 10px); width: 264px; z-index: 60;
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  padding: var(--space-4); animation: menuIn var(--dur) var(--ease-out);
}
.credit-pop__plan {
  font-family: var(--font-sans); font-weight: 700; font-size: var(--text-base);
  color: var(--text-strong); margin-bottom: var(--space-3);
}
.credit-pop__row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 0; font-size: var(--text-base); color: var(--text-body);
}
.credit-pop__ico { color: var(--clay-500); flex: none; }
.credit-pop__amt { font-weight: 600; color: var(--text-strong); }
.credit-pop__sub { margin-left: auto; font-size: var(--text-sm); color: var(--text-faint); }
.credit-pop__actions { display: flex; flex-direction: column; gap: 8px; margin-top: var(--space-3); }
.credit-pop__buy, .credit-pop__manage {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: var(--transition-colors), box-shadow var(--dur-fast) var(--ease-out);
}
.credit-pop__buy { background: var(--accent); color: var(--text-on-accent); box-shadow: var(--shadow-sm); }
.credit-pop__buy:hover { background: var(--accent-hover); box-shadow: var(--shadow-md); }
.credit-pop__manage { background: var(--surface-card); color: var(--text-strong); border-color: var(--border-default); box-shadow: var(--shadow-xs); }
.credit-pop__manage:hover { background: var(--paper-50); border-color: var(--border-strong); }
.credit-pop__buy:focus-visible, .credit-pop__manage:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ---- Account page ---- */
.account { max-width: var(--container-md); margin: 0 auto; padding: var(--space-12) var(--shell-pad) var(--space-20); }
.account__head { margin-bottom: var(--space-8); }
.account__name { font-family: var(--font-display); font-weight: 500; font-size: var(--text-2xl); letter-spacing: var(--tracking-tight); color: var(--text-strong); }
.account__email { margin-top: 4px; font-size: var(--text-base); color: var(--text-muted); }
.account__card {
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: var(--space-8);
}
.account__plan {
  font-family: var(--font-sans); font-weight: 700; font-size: var(--text-lg);
  color: var(--text-strong); margin-bottom: var(--space-4);
}
.account__row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 0; border-top: 1px solid var(--border-subtle);
  font-size: var(--text-md); color: var(--text-body);
}
.account__row:first-of-type { border-top: none; }
.account__ico { color: var(--clay-500); flex: none; }
.account__amt { font-weight: 600; color: var(--text-strong); }
.account__sub { margin-left: auto; font-size: var(--text-sm); color: var(--text-faint); }
.account__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--space-6); }
.account__buy, .account__manage, .account__plans {
  padding: 11px 18px; border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: var(--text-base); font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: var(--transition-colors), box-shadow var(--dur-fast) var(--ease-out);
}
.account__buy { background: var(--accent); color: var(--text-on-accent); box-shadow: var(--shadow-sm); }
.account__buy:hover { background: var(--accent-hover); box-shadow: var(--shadow-md); }
.account__manage { background: var(--surface-card); color: var(--text-strong); border-color: var(--border-default); box-shadow: var(--shadow-xs); }
.account__manage:hover { background: var(--paper-50); border-color: var(--border-strong); }
.account__plans { background: none; color: var(--text-link); }
.account__plans:hover { background: var(--paper-200); }
.account__buy:focus-visible, .account__manage:focus-visible, .account__plans:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.account__error {
  max-width: 420px; margin: var(--space-16) auto; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  color: var(--text-muted);
}
.account__error svg { color: var(--text-faint); }
.account__retry {
  margin-top: var(--space-2); padding: 9px 18px; border-radius: var(--radius-md);
  background: var(--surface-card); border: 1px solid var(--border-default); box-shadow: var(--shadow-xs);
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 600; color: var(--text-strong); cursor: pointer;
}
.account__retry:hover { background: var(--paper-50); border-color: var(--border-strong); }

/* ============================================================
   Planos (redesigned) — tier cards with hierarchy, Pro featured.
   ============================================================ */
.pricing { max-width: var(--container-lg); margin: 0 auto; padding: var(--space-12) var(--shell-pad) var(--space-20); }
.pricing__head { text-align: center; max-width: 620px; margin: 0 auto var(--space-10); }
.pricing__title {
  font-family: var(--font-display); font-weight: 500; font-size: var(--text-3xl);
  letter-spacing: var(--tracking-tighter); line-height: 1.06; color: var(--text-strong); margin: 6px 0 12px;
}
.pricing__lede { font-size: var(--text-md); line-height: 1.6; color: var(--text-muted); margin: 0; }

.pricing__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6);
  align-items: stretch;
}
@media (max-width: 860px) { .pricing__grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }

.pricing__card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: var(--space-8);
  transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.pricing__card--featured {
  box-shadow: var(--shadow-lg), 0 0 0 2px var(--ring);
  transform: translateY(-6px);
}
.pricing__badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--text-on-accent);
  font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 700;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  padding: 5px 12px; border-radius: var(--radius-pill); box-shadow: var(--shadow-sm);
}
.pricing__name {
  font-family: var(--font-sans); font-weight: 700; font-size: var(--text-lg);
  color: var(--text-strong); margin: 0 0 var(--space-3);
}
.pricing__price {
  font-family: var(--font-display); font-weight: 500; font-size: var(--text-3xl);
  letter-spacing: var(--tracking-tight); color: var(--text-strong); margin: 0;
}
.pricing__per { font-family: var(--font-sans); font-size: var(--text-base); font-weight: 500; color: var(--text-muted); }
.pricing__credits { margin: var(--space-2) 0 0; font-size: var(--text-base); font-weight: 600; color: var(--accent-ink); }
.pricing__blurb { margin: var(--space-3) 0 var(--space-6); font-size: var(--text-base); line-height: 1.5; color: var(--text-muted); flex: 1; }
.pricing__cta {
  width: 100%; padding: 12px 18px; border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: var(--text-base); font-weight: 600;
  cursor: pointer; border: 1px solid var(--border-default);
  background: var(--surface-card); color: var(--text-strong); box-shadow: var(--shadow-xs);
  transition: var(--transition-colors), box-shadow var(--dur-fast) var(--ease-out);
}
.pricing__cta:hover:not(:disabled) { background: var(--paper-50); border-color: var(--border-strong); }
.pricing__cta:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.pricing__card--featured .pricing__cta { background: var(--accent); color: var(--text-on-accent); border-color: transparent; box-shadow: var(--shadow-sm); }
.pricing__card--featured .pricing__cta:hover:not(:disabled) { background: var(--accent-hover); box-shadow: var(--shadow-md); }
.pricing__card--current .pricing__cta {
  background: var(--sage-50); color: var(--sage-700); border-color: var(--sage-100);
  box-shadow: none; cursor: default; opacity: 1;
}
.pricing__cta:disabled { cursor: default; }

.pricing__topup {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap;
  margin-top: var(--space-8); padding: var(--space-6) var(--space-8);
  background: var(--surface-sunken); border-radius: var(--radius-lg); border: 1px solid var(--border-subtle);
}
.pricing__topup-copy { display: flex; flex-direction: column; gap: 3px; }
.pricing__topup-title { font-family: var(--font-sans); font-weight: 700; font-size: var(--text-base); color: var(--text-strong); }
.pricing__topup-sub { font-size: var(--text-sm); color: var(--text-muted); }
.pricing__topup-cta {
  padding: 10px 18px; border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: var(--text-base); font-weight: 600; cursor: pointer;
  background: var(--surface-card); color: var(--text-strong); border: 1px solid var(--border-default); box-shadow: var(--shadow-xs);
  transition: var(--transition-colors), box-shadow var(--dur-fast) var(--ease-out);
}
.pricing__topup-cta:hover:not(:disabled) { background: var(--paper-50); border-color: var(--border-strong); }
.pricing__topup-cta:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.pricing__manage {
  display: block; margin: var(--space-8) auto 0;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 600; color: var(--text-link);
  padding: 8px 14px; border-radius: var(--radius-sm); transition: var(--transition-colors);
}
.pricing__manage:hover { background: var(--paper-200); }
