/* Studio Express — CTO-Studio-001
 * Tokens: packages/ui-styles + david/design_system/tokens-studio.css (D-001)
 * Desktop 1280px+ only. No mobile breakpoints.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Mono:wght@400;500&family=Inter:wght@300;400;500&family=Pinyon+Script&display=swap');

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

html {
  min-width: 1280px;
}

body {
  font-family: var(--font-body);
  background: var(--color-charcoal);
  color: var(--text-primary);
  min-width: 1280px;
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible,
.favorite-marker:focus-visible {
  outline: 2px solid var(--color-brick);
  outline-offset: 2px;
}

/* ── Topbar ── */
.topbar {
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-light);
  padding: 0 var(--space-7);
  height: var(--studio-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Stay put so the sticky Rory pane pins cleanly beneath it as the canvas scrolls. */
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.topbar-brand .wordmark {
  font-family: var(--font-display);
  font-size: var(--text-brand);
  color: var(--text-on-dark);
  letter-spacing: -0.01em;
}

.topbar-brand .divider {
  width: 1px;
  height: 14px;
  background: var(--color-charcoal-lt);
  align-self: center;
}

.topbar-brand .sub {
  font-family: var(--font-body);
  font-size: var(--text-label);
  color: var(--text-on-dark-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-on-dark-muted);
  padding: 6px var(--space-4);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-btn);
  letter-spacing: 0.01em;
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--color-iron-lt);
  color: var(--text-on-dark);
}

.btn-primary {
  background: var(--color-accent);
  border: none;
  color: var(--text-on-dark);
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-btn);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

.btn-primary:disabled,
.btn-ghost:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Layout ── */
.studio {
  display: grid;
  grid-template-columns: 1fr var(--studio-chat-pane-width);
  min-height: calc(100vh - var(--studio-topbar-height));
  max-width: 100%;
}

/* ── Canvas pane ── */
.canvas-pane {
  background: var(--bg-canvas);
  display: flex;
  flex-direction: column;
  padding: var(--space-6) var(--space-7);
  gap: var(--space-4);
  min-height: 640px;
}

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

.canvas-label {
  font-family: var(--font-body);
  font-size: var(--text-label);
  color: var(--text-on-dark-muted);
  flex: 0 0 auto;
}

/* Theme slider (V3, CTO-Studio-002 / interaction_spec.md §3b) — replaces the
   dropdown in the same header slot. ~3 landscape tiles visible with a partial
   peek, scroll-snap; Freestyle is always the pinned-first (leftmost) tile. */
.theme-slider {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 2px;
  scrollbar-width: thin;
}

.theme-tile {
  flex: 0 0 calc((100% - (2 * var(--space-2))) / 3.3);
  scroll-snap-align: center;
  aspect-ratio: 4 / 3;
  border: 2px solid var(--color-charcoal-lt);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--color-charcoal-mid);
  padding: 0;
}

.theme-tile img,
.theme-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.theme-tile-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-family: var(--font-body);
  font-size: var(--text-label);
  color: var(--text-on-dark);
  background: linear-gradient(to top, rgba(20, 19, 17, 0.85), rgba(20, 19, 17, 0));
  padding: var(--space-3) var(--space-2) 4px;
  text-align: left;
}

/* Selected: 2px ochre border (D-001 §15 — base weight; deep-link cue is shimmer, not border). */
.theme-tile.selected {
  border-color: var(--color-ochre);
  border-width: 2px;
}

/* One-time shimmer on deep-linked theme tile (D-001 §15 / CTO-Studio-004). */
.theme-tile-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(201, 162, 39, 0.42) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear 1;
  pointer-events: none;
  z-index: 1;
}

.theme-tile:focus-visible {
  outline: 2px solid var(--color-ochre);
  outline-offset: 2px;
}

.canvas-intro {
  display: none;
}

.canvas-intro.visible {
  display: block;
  margin-bottom: var(--space-2);
}

.encore-headline-suffix {
  font-family: var(--font-body);
  font-size: inherit;
  color: var(--text-on-dark);
}

.encore-breadcrumb {
  margin: 0 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-on-dark-muted);
}

.canvas-headline {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--text-on-dark);
  line-height: 1.25;
  margin-bottom: var(--space-2);
}

.canvas-subhead {
  font-family: var(--font-body);
  font-size: var(--text-body-lg);
  color: var(--text-on-dark);
  line-height: 1.55;
  max-width: 520px;
  margin: 0;
}

.upload-email-fallback {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--text-on-dark);
  text-align: left;
  line-height: 1.5;
  max-width: 520px;
  margin: var(--space-2) 0 0;
  padding: 0;
}

.upload-email-fallback a {
  color: var(--color-ochre);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.upload-email-fallback a:hover,
.upload-email-fallback a:focus-visible {
  color: var(--color-linen);
}

.canvas-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
}

.canvas-body.has-upload .canvas-intro,
.canvas-body.has-upload .upload-zone,
.canvas-body.has-upload .upload-email-row {
  display: none;
}

.upload-zone {
  flex: 1;
  border: var(--border-dashed-upload);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  background: var(--bg-upload-zone);
  position: relative;
  min-height: 400px;
  transition: border-color var(--transition-fast);
}

.upload-email-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  max-width: min(840px, 90vw);
  margin: 0 auto;
}

.upload-email-row label,
.upload-email-label {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--color-linen);
}

.upload-email-row input[type='email'] {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
}

.upload-email-row input[type='email']:focus {
  outline: 2px solid var(--color-brick);
  outline-offset: 2px;
}

.upload-drop-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 320px;
  cursor: pointer;
}

.upload-zone:hover .upload-drop-target,
.upload-zone.drag-over .upload-drop-target {
  /* border highlight handled on parent */
}

.upload-zone:hover,
.upload-zone.drag-over {
  border: var(--border-dashed-upload-hover);
}

.upload-zone::before,
.upload-zone::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(168, 60, 40, 0.4);
  border-style: solid;
  pointer-events: none;
}

.upload-zone::before {
  top: 12px;
  left: 12px;
  border-width: 2px 0 0 2px;
}

.upload-zone::after {
  bottom: 12px;
  right: 12px;
  border-width: 0 2px 2px 0;
}

.upload-drop-target input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-zone.has-pending-file .upload-drop-target {
  display: none;
}

.upload-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  position: relative;
  z-index: 3;
  pointer-events: none;
}

.upload-preview img {
  max-width: min(280px, 100%);
  max-height: 220px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}

.upload-preview-pending {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--color-linen);
  text-align: center;
  max-width: min(320px, 90vw);
  line-height: 1.5;
}

.upload-preview-name {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--color-linen);
  text-align: center;
  word-break: break-all;
}

.upload-email-row.needs-email {
  padding: var(--space-3);
  border: 1px solid var(--color-brick);
  border-radius: var(--radius-sm);
  background: rgba(168, 60, 40, 0.08);
}

.upload-email-row.needs-email label,
.upload-email-row.needs-email .upload-email-label {
  color: var(--color-brick-lt);
}

.upload-email-row.email-mismatch {
  padding: var(--space-3);
  border: 1px solid var(--color-brick);
  border-radius: var(--radius-sm);
  background: rgba(168, 60, 40, 0.08);
}

.upload-email-row.email-mismatch input[type='email'] {
  border-color: var(--color-brick);
}

.upload-email-row.email-mismatch label,
.upload-email-row.email-mismatch .upload-email-label {
  color: var(--color-brick-lt);
}

.upload-email-mismatch-hint {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--color-brick-lt);
  text-align: left;
}

.upload-change-btn {
  pointer-events: auto;
  position: relative;
  z-index: 4;
}

.upload-drop-target.awaiting-email {
  opacity: 0.55;
  cursor: not-allowed;
}

.upload-drop-target.awaiting-email input[type='file'] {
  cursor: not-allowed;
}

.upload-drop-target.awaiting-email-mismatch {
  opacity: 0.85;
  cursor: default;
}

.upload-drop-target.awaiting-email-mismatch input[type='file'] {
  cursor: default;
}

.upload-finish-btn {
  pointer-events: auto;
  margin-top: var(--space-2);
}

.upload-zone.uploading {
  pointer-events: none;
  opacity: 0.85;
}

.upload-progress {
  width: 100%;
  max-width: 280px;
  margin: var(--space-3) auto var(--space-2);
}

.upload-progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-brick), var(--color-gold, #c9a227));
  transition: width 0.35s ease;
}

.upload-progress-label {
  margin-top: var(--space-2);
  font-size: var(--text-body-sm);
  color: var(--text-on-dark-muted);
  text-align: center;
}

.upload-icon {
  width: 52px;
  height: 52px;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-dark-muted);
  font-size: 24px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.upload-text {
  text-align: center;
  pointer-events: none;
}

.upload-text .primary {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-on-dark);
  margin-bottom: var(--space-2);
}

.upload-text .secondary {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--text-on-dark-muted);
  line-height: 1.6;
}

.upload-error {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--color-brick-lt);
  margin-top: var(--space-2);
  text-align: center;
  max-width: 360px;
}

.boot-error {
  position: fixed;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-charcoal);
  color: var(--color-brick-lt);
  border: 1px solid var(--color-brick);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  z-index: 200;
  max-width: 90%;
}

.results-empty-hint {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--text-on-dark-muted);
  text-align: center;
  padding: var(--space-4);
}

.render-row {
  flex: 1;
  display: none;
  gap: 14px;
  overflow: hidden;
  min-height: 0;
  align-items: stretch;
}

.render-row.visible {
  display: flex;
  flex: 1;
  min-height: 280px;
}

.upload-zone.hidden {
  display: none;
}

.render-original-slot {
  flex-shrink: 0;
  width: 340px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.render-original-slot .render-card {
  flex: 1;
  min-height: 280px;
  height: 100%;
}

.results-scroll {
  flex: 1;
  display: grid;
  gap: 14px;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

.render-row.landscape-mode {
  flex-direction: column;
}

.render-row.landscape-mode .render-original-slot {
  width: 100%;
  max-height: 42vh;
  flex-shrink: 0;
}

.render-row.landscape-mode .render-original-slot .render-card {
  min-height: 0;
  max-height: 42vh;
}

.render-row.landscape-mode .img-original-wrap img {
  object-fit: contain;
}

.render-row.landscape-mode .results-scroll {
  width: 100%;
  flex: 1;
  min-height: 200px;
}

.results-scroll .render-card {
  min-height: 0;
  height: 100%;
}

.render-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.render-card-compareable {
  cursor: pointer;
}

.render-card-compareable:hover {
  border-color: var(--color-brick);
}

.render-card.favorite {
  border: 1.5px solid var(--color-brick);
}

.render-card .card-label {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-family: var(--font-body);
  font-size: var(--text-micro);
  color: rgba(240, 235, 225, 0.65);
  background: rgba(35, 35, 32, 0.72);
  padding: 3px var(--space-2);
  border-radius: 3px;
}

.favorite-marker {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(35, 35, 32, 0.72);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-on-dark-muted);
  cursor: pointer;
}

.render-card.favorite .favorite-marker {
  background: var(--color-brick);
  border-color: var(--color-brick);
  color: var(--text-on-dark);
}

.render-card.purchase-selected {
  outline: 2px solid var(--color-gold, #c9a227);
  outline-offset: 2px;
}

.select-purchase-btn {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 28px;
  z-index: 2;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: rgba(35, 35, 32, 0.92);
  color: var(--text-on-dark);
  cursor: pointer;
}

.select-purchase-btn .product-wordmark {
  font-size: 1.35em;
}

.render-card.purchase-selected .select-purchase-btn {
  background: var(--color-gold, #c9a227);
  border-color: var(--color-gold, #c9a227);
  color: #1a1a18;
}

.select-purchase-btn:hover {
  filter: brightness(1.08);
}

.scroll-hint,
.scroll-hint.visible {
  display: none !important;
}

.img-placeholder {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-original-wrap {
  flex: 1;
  width: 100%;
  min-height: 0;
  background: linear-gradient(160deg, var(--color-charcoal-mid) 0%, var(--color-charcoal) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-original-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-generated {
  background: linear-gradient(160deg, #2a2826 0%, #1e1d1a 60%, #2a2320 100%);
  position: relative;
}

.render-ref-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--color-linen);
  background: rgba(35, 35, 32, 0.82);
  border: 1px solid rgba(240, 235, 225, 0.2);
  padding: 4px 8px;
  border-radius: 3px;
  pointer-events: none;
  line-height: 1;
}

.img-generated img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.watermark-text {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: rgba(240, 235, 225, 0.14);
  letter-spacing: 0.06em;
  transform: rotate(-35deg);
  white-space: nowrap;
}

.shimmer {
  background: linear-gradient(100deg, #232320 30%, #4a3a30 50%, #232320 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.canvas-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.render-counter {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--text-on-dark-muted);
  letter-spacing: 0.04em;
}

.render-pips {
  display: flex;
  gap: 4px;
}

.pip {
  width: 14px;
  height: 4px;
  background: rgba(110, 107, 98, 0.3);
  border-radius: 2px;
}

.pip.used {
  background: var(--color-brick);
}

/* Free theme-starter render pip (CTO-Studio-002) — ochre, leftmost, fills on the
   auto-fired free render. Structurally "1 free + 6 standard", not a renumbered 7. */
.pip.free {
  background: rgba(201, 162, 39, 0.28);
}

.pip.free.used {
  background: var(--color-ochre);
}

.btn-compare {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-on-dark-muted);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-micro);
  letter-spacing: 0.01em;
}

.btn-compare:hover:not(:disabled) {
  color: var(--text-on-dark);
  border-color: var(--color-iron-lt);
}

/* ── Chat pane ── */
.chat-pane {
  background: var(--bg-chat);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-strong);
  /* Float independently of the canvas: Rory + the typing area stay pinned in the
     viewport no matter how far the render list on the left pushes the page down.
     align-self:start keeps the grid cell from stretching so sticky can engage. */
  position: sticky;
  top: var(--studio-topbar-height);
  align-self: start;
  height: calc(100vh - var(--studio-topbar-height));
}

.chat-header {
  padding: var(--space-4) var(--space-5) 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-chat-header);
  flex: 0 0 auto;
}

.rory-avatar {
  width: 36px;
  height: 36px;
  background: var(--color-charcoal-mid);
  border: 1px solid var(--color-charcoal-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--text-on-dark);
  border-radius: var(--radius-sm);
}

.rory-info .name {
  font-family: var(--font-display);
  font-size: var(--text-body-lg);
  color: var(--text-primary);
}

.rory-info .status {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--color-brick);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-indicator {
  width: 6px;
  height: 6px;
  background: var(--color-brick);
  border-radius: 1px;
  animation: blink 2s ease-in-out infinite;
}

.status-indicator.generating {
  animation: flicker 1.2s ease-in-out infinite;
}

.chat-messages {
  flex: 1;
  padding: 18px var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  overflow-y: auto;
  /* min-height:0 lets this scroll region shrink inside the fixed-height pane so the
     input area below stays pinned and visible (flexbox scroll-child pattern). */
  min-height: 0;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.message.rory {
  align-items: flex-start;
}

.message.user {
  align-items: flex-end;
}

.bubble {
  padding: 11px 15px;
  font-size: var(--text-body);
  line-height: 1.65;
  max-width: 92%;
}

.message.rory .bubble {
  background: var(--bg-rory-bubble);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
}

.image-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  max-width: 92%;
}

.image-choice-btn {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: 0.02em;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-rory-bubble);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.image-choice-btn:hover:not(:disabled) {
  border-color: var(--text-primary);
  background: var(--bg-surface, #fff);
}

.image-choice-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.message.user .bubble {
  background: var(--bg-user-bubble);
  color: var(--text-on-dark);
  border-radius: var(--radius-lg) 4px var(--radius-lg) var(--radius-lg);
}

.msg-time {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--text-muted);
  padding: 0 4px;
}

.chat-input-area {
  padding: var(--space-3) var(--space-5) 18px;
  border-top: 1px solid var(--border-strong);
  background: var(--bg-chat-header);
  flex: 0 0 auto;
}

.turn-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stepper-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stepper-opt {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: var(--text-label);
  color: var(--color-iron);
  cursor: pointer;
  background: var(--bg-chat);
}

.stepper-opt.selected {
  background: var(--color-charcoal);
  color: var(--text-on-dark);
  border-color: var(--color-charcoal);
}

.stepper-opt.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-chat);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px var(--space-3);
}

.input-wrap.disabled {
  opacity: 0.4;
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--text-primary);
  resize: none;
  outline: none;
  min-height: 22px;
  max-height: 120px;
}

.send-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--color-charcoal);
  border: none;
  color: var(--text-on-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: var(--text-body);
  flex-shrink: 0;
}

.input-hint {
  font-family: var(--font-body);
  font-size: var(--text-micro);
  color: var(--text-muted);
  margin-top: var(--space-2);
  text-align: center;
}

.paywall-actions {
  display: none;
  flex-direction: column;
  gap: var(--space-2);
}

.paywall-actions.visible {
  display: flex;
}

.paywall-actions .btn-primary,
.paywall-actions .btn-ghost {
  width: 100%;
  padding: 10px;
  font-size: var(--text-body-sm);
  text-align: center;
}

.paywall-actions .btn-primary .product-wordmark {
  font-size: 1.25em;
}

.paywall-encore-caption {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-micro);
  color: var(--text-on-dark-muted);
  text-align: center;
}

/* ── Compare modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 15, 13, 0.75);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.open {
  display: flex;
}

.compare-modal {
  background: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  width: min(95vw, 1400px);
  height: min(90vh, 1000px);
  max-width: calc(100vw - 32px);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.compare-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.compare-modal-title {
  font-family: var(--font-display);
  font-size: var(--text-heading-md);
  color: var(--text-on-dark);
}

.compare-modal-close {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-on-dark-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  background: transparent;
}

.compare-modal-close:hover {
  color: var(--text-on-dark);
}

.compare-modal-grid {
  display: grid;
  flex: 1;
  gap: var(--space-4);
  align-items: stretch;
  min-height: 0;
}

.compare-modal-grid .render-card {
  height: 100%;
  min-height: 0;
  width: auto;
}

.checkout-page .checkout-main {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-8);
}

.checkout-card {
  background: rgba(35, 35, 32, 0.72);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.checkout-page .encore-breadcrumb {
  color: var(--text-on-dark-muted);
}

.checkout-title {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.product-wordmark {
  font-family: var(--font-wordmark, 'Pinyon Script', cursive);
  font-size: 1.35em;
  color: var(--color-wordmark-gold, #D9B055);
  font-weight: 400;
  line-height: 1;
  display: inline;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.checkout-lead {
  margin: 0 0 var(--space-5);
  color: var(--text-on-dark-muted);
}

.checkout-cta .product-wordmark {
  font-size: 1.2em;
}

.checkout-loading {
  padding: var(--space-6) 0;
  text-align: center;
}

.checkout-loading .upload-progress {
  margin-left: auto;
  margin-right: auto;
}

.checkout-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.checkout-pick {
  position: relative;
  display: block;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
}

.checkout-pick.selected {
  border-color: var(--color-gold, #c9a227);
}

.checkout-pick input {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}

.checkout-pick img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.checkout-pick-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 3px;
}

.checkout-receipt {
  margin: 0 0 var(--space-3);
  padding-left: 1.2rem;
  color: var(--text-on-dark-muted);
}

.checkout-subtotal {
  font-size: 1.1rem;
  margin: 0 0 var(--space-2);
}

.checkout-hint,
.checkout-trust {
  color: var(--text-on-dark-muted);
  font-size: var(--text-body-sm);
}

.checkout-cta {
  width: 100%;
  margin-top: var(--space-4);
}

.checkout-error {
  color: var(--color-brick-lt);
  margin-top: var(--space-3);
}

.compare-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  font-size: var(--text-body-sm);
  color: var(--text-on-dark-muted);
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border-light);
}

.render-progress-track {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 12px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  z-index: 2;
}

.render-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-brick), var(--color-gold, #c9a227));
  transition: width 0.4s ease;
}

.render-progress-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  z-index: 2;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Cookie consent (CTO-Studio-004) — non-blocking bottom banner. */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-5);
  background: rgba(20, 19, 17, 0.94);
  border-top: 1px solid var(--border-light);
  color: var(--text-on-dark-muted);
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  line-height: 1.5;
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner-text {
  max-width: min(720px, 90vw);
  text-align: center;
}

.cookie-banner-text a {
  color: var(--color-linen);
  text-decoration: underline;
}

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

.cookie-banner .btn-primary,
.cookie-banner .btn-ghost {
  padding: 6px 14px;
  font-size: var(--text-body-sm);
}

.checkout-ecard-addon {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  margin: var(--space-4) 0 var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: var(--text-body-sm);
  line-height: 1.45;
  color: var(--text-on-dark);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
}

.checkout-ecard-addon input {
  margin-top: 0.25em;
  flex-shrink: 0;
  width: 1.1em;
  height: 1.1em;
}

.checkout-ecard-addon strong {
  color: var(--text-on-dark);
  font-weight: 500;
}

.checkout-ecard-hint {
  margin-top: 0;
  margin-bottom: var(--space-3);
}

.ecard-designer-panel {
  margin: var(--space-3) 0 var(--space-4);
  padding: var(--space-4);
  background: var(--bg-chat-header);
  border: 1px solid var(--border-on-light);
  border-radius: 14px;
}

.ecard-designer-preview-wrap {
  margin-bottom: var(--space-4);
}

.ecard-still-preview {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  background: #111;
}

.ecard-still-preview[hidden],
.ecard-video-stage[hidden],
.ecard-preview-generating[hidden],
.ecard-preview-controls[hidden] {
  display: none !important;
}

.ecard-still-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ecard-preview-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #111;
  aspect-ratio: 4 / 3;
}

.ecard-video-stage {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
}

.ecard-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111;
}

/* DOM watermark overlay — tiled FromU4them (CTO-Studio-012; bypass accepted). */
.ecard-wm-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background-image: repeating-linear-gradient(
    -30deg,
    transparent 0,
    transparent 48px,
    rgba(255, 255, 255, 0.07) 48px,
    rgba(255, 255, 255, 0.07) 49px
  ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='120'%3E%3Ctext x='10' y='70' fill='rgba(255,255,255,0.42)' font-family='Georgia,serif' font-size='18' transform='rotate(-30 10 70)'%3EFromU4them%3C/text%3E%3C/svg%3E");
  background-size: auto, 220px 120px;
}

/* Gift message DOM overlay — D-001 §17 (CTO-Studio-014). Same element/rules
 * on the pre-pay designer preview (checkout.html) and the recipient page
 * (ecard.html): pewter serif italic, bottom-anchored scrim, ~2s fade-in,
 * holds for the loop. Generic template — no per-message customization. */
.ecard-message-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  margin: 0;
  padding: var(--space-5) var(--space-4) var(--space-3);
  pointer-events: none;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-message-overlay-pewter, #A8B4BD);
  font-size: clamp(0.95rem, 2.6vw, var(--text-heading-md));
  line-height: 1.35;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.38) 60%,
    rgba(0, 0, 0, 0) 100%
  );
  opacity: 0;
  transition: opacity 2s ease;
}

.ecard-message-overlay.is-visible {
  opacity: 1;
}

.ecard-message-overlay[hidden] {
  display: none;
}

.ecard-message-overlay.overlay-len-md {
  font-size: clamp(0.85rem, 2.2vw, var(--text-body-lg));
}

.ecard-message-overlay.overlay-len-lg {
  font-size: clamp(0.78rem, 1.9vw, var(--text-body));
}

.ecard-message-overlay.overlay-len-xl {
  font-size: clamp(0.72rem, 1.6vw, var(--text-body-sm));
  line-height: 1.3;
}

.ecard-preview-generating {
  margin: 0;
  padding: var(--space-8) var(--space-4);
  text-align: center;
  font-size: var(--text-body-sm);
  color: var(--text-on-dark);
  background: #111;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CTO-Studio-018 — heart-loop wait overlay inside a tile/stage (not full-screen) */
.wait-overlay-host {
  position: relative;
}

.wait-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: inherit;
  background: #111;
}

.wait-overlay[hidden] {
  display: none !important;
}

.wait-overlay-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
}

.wait-overlay-timer {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 10px 14px;
  max-width: 90%;
  text-align: center;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--text-body-sm, 0.9rem);
  letter-spacing: 0.02em;
  color: var(--text-on-dark, #f5f2ea);
  background: rgba(18, 18, 16, 0.55);
  border: 1px solid rgba(245, 242, 234, 0.18);
  border-radius: var(--radius-md, 8px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* Still-gen: fill the results strip tile area */
#resultsScroll.wait-overlay-host {
  min-height: 220px;
}

/* Encore preview stage already has aspect ratio — overlay sits on top of it */
.ecard-preview-stage.wait-overlay-host {
  /* keep existing aspect / layout; form stays usable beside/below */
}

.ecard-preview-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.ecard-back-row {
  margin: var(--space-3) 0 0;
}

.ecard-back-row .btn-ghost {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: #fff;
  color: var(--color-charcoal);
  border-color: var(--border-light, #d8d4cc);
}

.ecard-back-row .btn-ghost:hover {
  border-color: var(--color-brick);
  color: var(--color-brick);
}

.ecard-back-row .btn-ghost.is-busy,
.topbar-actions .btn-ghost.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

.ecard-generate-btn {
  margin-top: var(--space-3);
  width: 100%;
}

.ecard-designer-caption {
  margin: var(--space-2) 0 0;
  font-size: var(--text-micro, 0.75rem);
  color: var(--text-secondary);
  line-height: 1.4;
}

.ecard-designer-refusal {
  margin: var(--space-2) 0 var(--space-3);
  font-size: var(--text-body-sm);
  color: var(--danger, #c45c5c);
  line-height: 1.4;
}

.checkout-rory-panel {
  margin: var(--space-3) 0 var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: rgba(35, 35, 32, 0.55);
  border: 1px solid var(--border-light);
}

.checkout-rory-panel.is-block {
  border-color: rgba(196, 92, 92, 0.55);
  background: rgba(60, 28, 28, 0.55);
}

.checkout-rory-label {
  margin: 0 0 var(--space-1);
  font-family: var(--font-body);
  font-size: var(--text-micro);
  color: var(--text-on-dark-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.checkout-rory-bubble {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--text-on-dark);
  line-height: 1.45;
}

.checkout-rory-bubble.is-block {
  color: #f07171;
  font-weight: 700;
}

.checkout-rory-panel .btn-ghost {
  margin-top: var(--space-2);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: #fff;
  color: #1a1916;
  border: 1px solid #d8d4cc;
  font-weight: 600;
}

.checkout-rory-panel .btn-ghost:hover {
  border-color: var(--color-brick);
  color: var(--color-brick);
}

.checkout-rory-panel .btn-ghost.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

.ecard-rory-retry {
  margin: var(--space-3) 0 var(--space-2);
  display: grid;
  gap: var(--space-2);
}

.ecard-rory-retry[hidden],
.ecard-variant-picker[hidden] {
  display: none !important;
}

.ecard-rory-retry .ecard-field-label {
  color: var(--text-primary);
}

.ecard-rory-retry .btn-ghost,
.ecard-designer-panel .ecard-preview-controls .btn-ghost {
  justify-self: start;
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.ecard-rory-retry .btn-ghost:hover:not(:disabled),
.ecard-designer-panel .ecard-preview-controls .btn-ghost:hover:not(:disabled) {
  border-color: var(--color-charcoal);
  color: var(--color-charcoal);
}

.ecard-rory-retry .btn-ghost:disabled {
  opacity: 0.45;
  color: var(--text-secondary);
}

.ecard-variant-picker {
  margin: var(--space-3) 0 var(--space-2);
}

.ecard-variant-picker > .ecard-field-label {
  color: var(--text-primary);
}

.ecard-variant-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.ecard-variant-option {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  color: var(--text-primary);
  background: #fff;
}

.ecard-variant-option:has(input:checked) {
  border-color: var(--color-brick);
  box-shadow: 0 0 0 1px var(--color-brick);
  background: #fff;
}

.ecard-variant-option-header {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--text-primary);
}

.ecard-variant-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  background: #111;
  display: block;
}

.ecard-still-download {
  margin: 0 0 var(--space-3);
}

.ecard-still-download .btn-ghost {
  display: inline-flex;
}

.ecard-send-recap {
  margin: 0 0 var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border-on-light);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: var(--text-body-sm);
  line-height: 1.45;
  color: var(--text-on-light-muted);
}

.ecard-send-recap strong {
  color: var(--text-on-light);
  font-weight: 500;
}

.ecard-send-panel {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-chat-header);
  border: 1px solid var(--border-on-light);
  border-radius: 14px;
}

.ecard-send-title {
  font-family: var(--font-display);
  font-size: var(--text-heading-sm);
  margin: 0 0 var(--space-2);
}

.ecard-send-lead,
.ecard-privacy-note,
.ecard-status {
  font-size: var(--text-body-sm);
  color: var(--text-on-light-muted);
  margin: 0 0 var(--space-2);
}

.ecard-share-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin: var(--space-2) 0 0;
}

.ecard-share-row .ecard-field {
  flex: 1;
  margin: 0;
}

.ecard-field-label {
  display: block;
  font-size: var(--text-body-sm);
  margin: var(--space-2) 0 var(--space-1);
  color: var(--text-primary);
}

.ecard-field {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border-on-light);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--text-primary);
  background: #fff;
}

.ecard-field-area {
  resize: vertical;
  min-height: 72px;
}

.ecard-attestation-panel {
  margin: var(--space-3) 0;
  padding: var(--space-2);
  background: var(--bg-canvas);
  border: 1px solid var(--border-on-light);
  border-radius: 8px;
}

.ecard-attestation-label {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  font-size: var(--text-body);
  line-height: 1.4;
  color: var(--text-on-dark);
}

.ecard-attestation-label input {
  margin-top: 0.2em;
  flex-shrink: 0;
  accent-color: var(--accent, #c4a35a);
}

.ecard-view-page {
  background: var(--color-charcoal-mid);
  color: var(--text-on-dark);
  min-height: 100vh;
}

.ecard-view-main {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
  text-align: center;
}

.ecard-from-line {
  font-family: var(--font-mono);
  font-size: var(--text-body-sm);
  color: var(--text-on-dark-muted);
  margin-bottom: var(--space-3);
}

.ecard-video-wrap {
  position: relative;
  margin: 0 auto var(--space-4);
  max-width: min(90vw, 720px);
}

.ecard-video {
  width: 100%;
  border-radius: 14px;
  background: #000;
}

.ecard-unmute {
  margin-top: var(--space-2);
}

.ecard-reveal-chip {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(20, 16, 14, 0.72);
  color: var(--color-linen, #f3efe6);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 3;
}

.ecard-reveal-chip.is-visible {
  opacity: 1;
}

.ecard-reveal-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  font-weight: 600;
}

.ecard-reveal-lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(12, 10, 8, 0.72);
}

.ecard-reveal-lightbox[hidden] {
  display: none;
}

.ecard-reveal-dialog {
  position: relative;
  max-width: min(92vw, 640px);
  max-height: 90vh;
  padding: 1.25rem;
  border-radius: 16px;
  background: #1c1714;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: center;
}

.ecard-reveal-img {
  max-width: 100%;
  max-height: 65vh;
  border-radius: 10px;
  object-fit: contain;
}

.ecard-reveal-close {
  align-self: flex-end;
  background: transparent;
  border: none;
  color: var(--color-linen, #f3efe6);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  opacity: 0.85;
}

.ecard-reveal-cta {
  text-decoration: none;
}

.ecard-memorial-label {
  margin-top: var(--space-2);
}

.ecard-memorial-hint {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.ecard-download {
  display: inline-block;
  margin-bottom: var(--space-4);
}

.ecard-footer {
  font-size: var(--text-micro);
  color: var(--text-on-dark-muted);
}

.ecard-footer a {
  color: var(--text-on-dark-muted);
}

.ecard-recipient-privacy {
  font-size: var(--text-micro);
  color: var(--text-on-dark-muted);
  margin: var(--space-2) auto 0;
  max-width: 36rem;
  line-height: 1.45;
}

.ecard-error {
  color: #f2b8b8;
  margin-top: var(--space-3);
}
