/**
 * Right-column live preview — style switcher pills + 3 card variants
 * (Aurora / Postcard / Wax seal) + final CTA (Send now / Schedule delivery).
 *
 * Variants share .genv2-live-card; differentiate by data-variant. The wrap
 * (.genv2-live-card-wrap[data-style]) controls which one is visible — the
 * sibling `[hidden]` attribute does the actual hiding (set by JS).
 */

/* ===================================================================
   Style switcher (above the card)
   =================================================================== */
.genv2-live-styles {
	display: flex;
	gap: 0.45rem;
	padding: 0.3rem;
	background: rgba(96, 80, 176, 0.08);
	border: 1px solid rgba(96, 80, 176, 0.15);
	border-radius: 999px;
	margin: 0 0 1rem;
	width: max-content;
	max-width: 100%;
}
.genv2-live-style {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem 0.85rem;
	border: none;
	background: transparent;
	color: var(--v2-text-muted, #5e5f5c);
	font: inherit;
	font-weight: 500;
	font-size: 0.84rem;
	border-radius: 999px;
	cursor: pointer;
	transition: background .2s, color .2s, box-shadow .2s;
}
.genv2-live-style:hover { color: var(--v2-text, #313330); }
.genv2-live-style.active {
	background: var(--v2-primary, #6050b0);
	color: #fff;
	box-shadow: 0 4px 14px -4px rgba(96, 80, 176, 0.45);
}
.genv2-live-style.active:hover { color: #fff; }
.genv2-live-style-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(96, 80, 176, 0.12);
}
.genv2-live-style.active .genv2-live-style-dot {
	box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}
.genv2-live-style-dot--aurora   { background: #8B7AC8; }
.genv2-live-style-dot--postcard { background: #FFC369; }
.genv2-live-style-dot--seal     { background: #7a3a2a; }

/* ===================================================================
   Card wrap + variants
   =================================================================== */
.genv2-live-card-wrap {
	position: relative;
	margin-bottom: 1rem;
}
/* Phase 6.10.2 H2 — the preview column is a height-constrained flex-column
   (it stretches to the form's height via the grid). A long wish + the in-card
   photo dropzone can exceed that height; a shrinking card-wrap plus the card's
   own overflow:hidden (needed to clip the glow blurs) would then cut the wish
   off mid-word. Pin the wrap so it never shrinks below its content — the column
   overflows visibly instead of clipping the text. */
.genv2-result .genv2-live-card-wrap,
.genv2-result--cards .genv2-live-card-wrap { flex-shrink: 0; }
.genv2-live-card {
	position: relative;
	border-radius: 24px;
	padding: 1.6rem 1.4rem 1.3rem;
	overflow: hidden;
	
	box-shadow: 0 18px 48px -16px rgba(96, 80, 176, 0.25), 0 4px 12px rgba(49, 51, 48, 0.06);
}
.genv2-live-card[hidden] { display: none; }

/* ---------- Aurora ---------- */
.genv2-live-card--aurora {
	background: radial-gradient(120% 80% at 50% 0%, #8B7AC8 0%, #6050B0 55%, #3d3380 100%);
	color: #fff;
}
.genv2-live-card--aurora .lc-aurora-glow {
	position: absolute;
	width: 220px;
	height: 220px;
	border-radius: 50%;
	filter: blur(60px);
	opacity: 0.35;
	pointer-events: none;
}
.genv2-live-card--aurora .lc-aurora-glow-1 {
	background: #C4B8FF;
	top: -80px; left: -60px;
}
.genv2-live-card--aurora .lc-aurora-glow-2 {
	background: #FFC369;
	bottom: -80px; right: -60px;
	opacity: 0.25;
}

/* ---------- Premium overrides (Aurora layout, swatch only) ----------
   All premium styles reuse the Aurora <article data-variant="aurora"> —
   only the base background changes. Source of truth for the gradients
   is dg_premium_card_styles() in the plugin — keep in sync. */
.genv2-live-card-wrap[data-style="watercolor"] > .genv2-live-card--aurora { background: linear-gradient(135deg, #a8d8ea 0%, #aa96da 50%, #fcbad3 100%); }
.genv2-live-card-wrap[data-style="neon"]       > .genv2-live-card--aurora { background: linear-gradient(135deg, #ff006e 0%, #8338ec 50%, #3a86ff 100%); }
.genv2-live-card-wrap[data-style="marble"]     > .genv2-live-card--aurora { background: linear-gradient(135deg, #fefdfb 0%, #d8d2c4 100%); }
.genv2-live-card-wrap[data-style="rose"]       > .genv2-live-card--aurora { background: linear-gradient(135deg, #fec5bb 0%, #e63946 100%); }
.genv2-live-card-wrap[data-style="cosmos"]     > .genv2-live-card--aurora { background: radial-gradient(circle, #2a1a4d 0%, #050314 100%); }
.genv2-live-card-wrap[data-style="foil"]       > .genv2-live-card--aurora { background: linear-gradient(135deg, #f0c878 0%, #c89548 100%); }
.genv2-live-card-wrap[data-style="velvet"]     > .genv2-live-card--aurora { background: linear-gradient(160deg, #2a1f4d 0%, #0a0420 100%); }
.genv2-live-card-wrap[data-style="noir"]       > .genv2-live-card--aurora { background: linear-gradient(160deg, #1a1a1a 0%, #0a0a0a 100%); }
.genv2-live-card-wrap[data-style="linen"]      > .genv2-live-card--aurora { background: linear-gradient(135deg, #f4ead5 0%, #d4a373 100%); }
.genv2-live-card-wrap[data-style="ember"]      > .genv2-live-card--aurora { background: linear-gradient(135deg, #ff6b35 0%, #c1121f 100%); }
.genv2-live-card-wrap[data-style="sage"]       > .genv2-live-card--aurora { background: linear-gradient(135deg, #a3b18a 0%, #588157 100%); }
.genv2-live-card-wrap[data-style="lavender"]   > .genv2-live-card--aurora { background: linear-gradient(135deg, #c8b6ff 0%, #8e7dbe 100%); }
.genv2-live-card-wrap[data-style="ocean"]      > .genv2-live-card--aurora { background: linear-gradient(135deg, #0077b6 0%, #03045e 100%); }
.genv2-live-card-wrap[data-style="sunset"]     > .genv2-live-card--aurora { background: linear-gradient(135deg, #ffafcc 0%, #ff8500 50%, #cb1b45 100%); }
.genv2-live-card-wrap[data-style="midnight"]   > .genv2-live-card--aurora { background: linear-gradient(135deg, #1d2d50 0%, #133b5c 100%); }
/* Aurora's purple/orange glows can muddy lighter palettes (Watercolor,
   Marble, Linen). We leave them untouched for now — same "Aurora layout,
   only background changes" contract used everywhere else; if a specific
   palette needs the glow toned down, override per data-style here. */

/* Light premium overrides — Marble / Linen are near-white, so the default
   white text on Aurora becomes invisible. Flip text + tag chips to dark.
   Mirrors the is_light flag in dg_premium_card_styles(). */
.genv2-live-card-wrap[data-style="marble"] > .genv2-live-card--aurora,
.genv2-live-card-wrap[data-style="linen"]  > .genv2-live-card--aurora {
	color: #1a1a1a;
}
.genv2-live-card-wrap[data-style="marble"] > .genv2-live-card--aurora .lc-aurora-text,
.genv2-live-card-wrap[data-style="linen"]  > .genv2-live-card--aurora .lc-aurora-text {
	color: rgba(0, 0, 0, 0.82);
}
.genv2-live-card-wrap[data-style="marble"] > .genv2-live-card--aurora .lc-aurora-foot,
.genv2-live-card-wrap[data-style="linen"]  > .genv2-live-card--aurora .lc-aurora-foot {
	color: rgba(0, 0, 0, 0.55);
	border-top-color: rgba(0, 0, 0, 0.1);
}
.genv2-live-card-wrap[data-style="marble"] > .genv2-live-card--aurora .lc-tag,
.genv2-live-card-wrap[data-style="linen"]  > .genv2-live-card--aurora .lc-tag {
	background: rgba(0, 0, 0, 0.06);
	color: rgba(0, 0, 0, 0.75);
}

.lc-aurora-tags {
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
	position: relative;
	z-index: 1;
}
.lc-tag {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	background: rgba(255,255,255,0.18);
	color: rgba(255,255,255,0.92);
}
.lc-tag:empty { display: none; }

.lc-aurora-medallion {
	margin: 1.2rem auto 0.7rem;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: linear-gradient(135deg, #FFC369 0%, #ff9eb1 100%);
	display: grid;
	place-items: center;
	box-shadow: 0 6px 20px -6px rgba(0,0,0,0.4);
	position: relative;
	z-index: 1;
}
.lc-aurora-medallion-icon {
	font-size: 1.7rem;
	line-height: 1;
}
.lc-aurora-greeting {
	text-align: center;
	font-family: 'Fraunces', Georgia, serif;
	font-weight: 500;
	font-size: 1.3rem;
	margin: 0.2rem 0 0.7rem;
	position: relative;
	z-index: 1;
}
.lc-aurora-greeting strong { font-weight: 700; }
.lc-aurora-text {
	text-align: center;
	font-size: 0.94rem;
	line-height: 1.6;
	color: rgba(255,255,255,0.92);
	margin-bottom: 0.6rem;
	position: relative;
	z-index: 1;
	/* Phase 6.10.2 — wrap long unbroken strings (e.g. "ыыыы…") like a textarea
	   instead of letting them widen / blow out the preview panel. */
	overflow-wrap: anywhere;
	word-break: break-word;
	white-space: pre-wrap;
}
/* Phase 6.10.2 H3 — the card text is editable in place; signal it. */
.lc-aurora-text.lc-editable { cursor: text; border-radius: 8px; transition: background 0.15s, box-shadow 0.15s; }
.lc-aurora-text.lc-editable:hover { background: rgba(255,255,255,0.10); }
.lc-aurora-text.lc-editable:focus { outline: none; background: rgba(255,255,255,0.14); box-shadow: 0 0 0 1px rgba(255,255,255,0.35); }
/* Light card styles (marble/linen) — dark text, so use a dark hover tint. */
.genv2-live-card-wrap[data-style="marble"] .lc-aurora-text.lc-editable:hover,
.genv2-live-card-wrap[data-style="linen"]  .lc-aurora-text.lc-editable:hover { background: rgba(40,30,50,0.06); }

/* Phase 6.10.3 — the greeting line is editable in place (mirrors the wish-text
   affordance above) + a non-functional pencil icon signalling editability. The
   pencil flows inline after the greeting span so the centred line stays centred
   and long greetings still wrap naturally. */
.lc-aurora-greeting [data-recipient].lc-editable {
	cursor: text;
	border-radius: 8px;
	padding: 0 0.2rem;
	transition: background 0.15s, box-shadow 0.15s;
	overflow-wrap: anywhere;
	word-break: break-word;
}
.lc-aurora-greeting [data-recipient].lc-editable:hover { background: rgba(255,255,255,0.10); }
.lc-aurora-greeting [data-recipient].lc-editable:focus { outline: none; background: rgba(255,255,255,0.14); box-shadow: 0 0 0 1px rgba(255,255,255,0.35); }
.genv2-live-card-wrap[data-style="marble"] .lc-aurora-greeting [data-recipient].lc-editable:hover,
.genv2-live-card-wrap[data-style="linen"]  .lc-aurora-greeting [data-recipient].lc-editable:hover { background: rgba(40,30,50,0.06); }

.lc-greeting-pencil {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
	width: 20px;
	height: 20px;
	margin-left: 0.2rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: currentColor;
	opacity: 0.4;
	cursor: pointer;
	border-radius: 6px;
	transition: opacity 0.15s, background 0.15s;
}
.lc-aurora-greeting:hover .lc-greeting-pencil,
.lc-greeting-pencil:hover,
.lc-greeting-pencil:focus-visible { opacity: 0.85; background: rgba(255,255,255,0.12); }
.genv2-live-card-wrap[data-style="marble"] .lc-greeting-pencil:hover,
.genv2-live-card-wrap[data-style="linen"]  .lc-greeting-pencil:hover { background: rgba(40,30,50,0.08); }
.lc-greeting-pencil svg { display: block; width: 13px; height: 13px; }

.lc-aurora-foot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-top: 1px solid rgba(255,255,255,0.18);
	padding-top: 0.7rem;
	margin-top: 0.4rem;
	font-size: 0.75rem;
	color: rgba(255,255,255,0.7);
	position: relative;
	z-index: 1;
}

/* ---------- Postcard ---------- */
.genv2-live-card--postcard {
	background: linear-gradient(135deg, #FFC369 0%, #ff9eb1 50%, #A898FF 100%);
	color: #2f2f31;
	padding: 1rem;
}
.lc-pc-stamp {
	position: absolute;
	top: 14px; right: 18px;
	font-size: 1.4rem;
	z-index: 2;
}
.lc-pc-postmark {
	position: absolute;
	top: 14px; left: 16px;
	z-index: 2;
}
.lc-pc-postmark span {
	display: inline-block;
	padding: 0.25rem 0.6rem;
	border-radius: 6px;
	background: rgba(255,255,255,0.85);
	color: #7a5744;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 1.5px;
	text-transform: uppercase;
}
.lc-pc-postmark span:empty { display: none; }
.lc-pc-grain { display: none; }

.lc-pc-panel {
	position: relative;
	background: #fbf6e8;
	border-radius: 16px;
	padding: 2.2rem 1.3rem 1.3rem;
	margin-top: 0.4rem;
}
.lc-pc-eyebrow {
	font-family: 'Fraunces', Georgia, serif;
	font-style: italic;
	color: #7a5744;
	font-size: 0.84rem;
	margin-bottom: 0.4rem;
}
.lc-pc-recipient {
	font-family: 'Fraunces', Georgia, serif;
	font-weight: 500;
	font-size: 1.2rem;
	color: #2f2f31;
	margin-bottom: 0.5rem;
}
.lc-pc-text {
	font-size: 0.94rem;
	line-height: 1.7;
	color: #3a3a3c;
	margin-bottom: 0.8rem;
}
.lc-pc-sign {
	font-family: 'Fraunces', Georgia, serif;
	font-style: italic;
	color: #7a5744;
	text-align: right;
	font-size: 0.92rem;
}

/* ---------- Wax seal ---------- */
.genv2-live-card--seal {
	background: #f4ead8;
	border: 1px solid #e6d8b9;
	color: #2f2f31;
	text-align: center;
}
.lc-seal-paper {
	position: absolute; inset: 0;
	background:
		radial-gradient(circle at 20% 80%, rgba(122, 87, 68, 0.04) 0 60px, transparent 60px),
		radial-gradient(circle at 80% 20%, rgba(122, 87, 68, 0.03) 0 80px, transparent 80px);
	pointer-events: none;
}
.lc-seal-monogram {
	margin: 0.5rem auto 0.7rem;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #9a4a36 0 60%, #6b2c1f 100%);
	display: grid;
	place-items: center;
	box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2), 0 4px 12px -4px rgba(0,0,0,0.3);
	position: relative;
	z-index: 1;
}
.lc-seal-wax {
	font-family: 'Fraunces', Georgia, serif;
	font-style: italic;
	font-weight: 600;
	color: #f4ead8;
	font-size: 1.4rem;
}
.lc-seal-eyebrow {
	font-family: 'Fraunces', Georgia, serif;
	font-style: italic;
	color: #7a5744;
	font-size: 0.84rem;
	margin-bottom: 0.4rem;
	position: relative;
	z-index: 1;
}
.lc-seal-eyebrow:empty { display: none; }
.lc-seal-recipient {
	font-family: 'Fraunces', Georgia, serif;
	font-weight: 500;
	font-size: 1.15rem;
	margin-bottom: 0.6rem;
	position: relative;
	z-index: 1;
}
.lc-seal-text {
	font-family: 'Fraunces', Georgia, serif;
	font-size: 0.96rem;
	line-height: 1.7;
	margin-bottom: 0.8rem;
	position: relative;
	z-index: 1;
}
.lc-seal-sign {
	font-family: 'Fraunces', Georgia, serif;
	font-style: italic;
	color: #7a5744;
	font-size: 0.92rem;
	position: relative;
	z-index: 1;
}

/* ---------- Photo banner (shared) ---------- */
.lc-photo-banner {
	margin: 0.9rem 0 0.5rem;
	border-radius: 14px;
	overflow: hidden;
	position: relative;
	z-index: 1;
}
.lc-photo-banner[hidden] { display: none; }
.lc-photo-banner img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
}

/* ===================================================================
   State gating — live-card always visible, tools only on ready,
   skeleton only on loading.
   =================================================================== */
.genv2-result--cards .genv2-result-tools { display: none; }
.genv2-result--cards[data-state="ready"] .genv2-result-tools { display: block; }
.genv2-result--cards .genv2-state-loading { display: none; }
.genv2-result--cards[data-state="loading"] .genv2-state-loading { display: block; }
.genv2-result--cards[data-state="loading"] .genv2-live-card-wrap { display: none; }

/* ===================================================================
   Result actions (Regenerate + Copy under quick edits)
   =================================================================== */
.genv2-result-actions {
	display: flex;
	gap: 0.6rem;
	margin: 0.75rem 0 1rem;
}
.genv2-result-actions .btn {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	padding: 0.65rem 1rem;
	border-radius: 999px;
	font: inherit;
	font-weight: 600;
	font-size: 0.92rem;
	cursor: pointer;
	transition: border-color .2s, background .2s, color .2s, transform .15s;
}
.genv2-result-actions .btn-outline {
	background: #fff;
	color: var(--color-text-dark, #313330);
	border: 1.5px solid rgba(178, 178, 174, 0.4);
}
.genv2-result-actions .btn-outline:hover {
	border-color: var(--color-primary, #6050b0);
	color: var(--color-primary, #6050b0);
	transform: translateY(-1px);
}
.genv2-result-actions .btn-secondary {
	background: rgba(196, 184, 255, 0.18);
	color: var(--color-primary, #6050b0);
	border: 1.5px solid rgba(96, 80, 176, 0.18);
}
.genv2-result-actions .btn-secondary:hover {
	background: rgba(196, 184, 255, 0.32);
	transform: translateY(-1px);
}

/* ===================================================================
   Result share row (right column) — shares CSS with .dg-success-share
   in success modal (delivery-success.css). Just a tiny container tweak.
   =================================================================== */
.genv2-result-share {
	margin-bottom: 1rem;
}
.genv2-result-share .dg-success-social {
	gap: 0.6rem;
}
.genv2-result-share .share-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	text-decoration: none;
	border: none;
	transition: transform .15s, box-shadow .2s;
	box-shadow: 0 4px 12px -4px rgba(0,0,0,0.18);
}
.genv2-result-share .share-btn[hidden] { display: none; }
.genv2-result-share .share-btn:hover { transform: translateY(-2px); }
.genv2-result-share .share-btn svg { width: 20px; height: 20px; }
.genv2-result-share .share-btn--whatsapp { background: #25D366; }
.genv2-result-share .share-btn--telegram { background: #2AABEE; }
.genv2-result-share .share-btn--viber    { background: #7360F2; }
.genv2-result-share .share-btn--twitter,
.genv2-result-share .share-btn--x        { background: #000; }
.genv2-result-share .share-btn--native   { background: var(--color-text-dark, #313330); }

/* ===================================================================
   Final CTA (Send now / Schedule delivery) + spinner
   =================================================================== */
.genv2-result-footer {
	margin-top: 0.5rem;
}
.genv2-cta-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid rgba(255,255,255,0.45);
	border-top-color: #fff;
	animation: genv2CtaSpin 0.7s linear infinite;
}
.genv2-result-cta.is-busy .genv2-cta-spinner { display: inline-block; }
.genv2-result-cta.is-busy .genv2-cta-arrow { display: none; }
@keyframes genv2CtaSpin {
	to { transform: rotate(360deg); }
}
.genv2-result-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.95rem 1.4rem;
	border: none;
	border-radius: 999px;
	background: var(--color-primary, #6050b0);
	color: #fff;
	font: inherit;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	box-shadow: 0 8px 22px -8px rgba(96, 80, 176, 0.5);
	transition: background .2s, transform .15s, box-shadow .2s;
}
.genv2-result-cta:hover:not(:disabled) {
	background: var(--color-primary-hover, #5040a0);
	transform: translateY(-1px);
	box-shadow: 0 14px 30px -8px rgba(96, 80, 176, 0.6);
}
.genv2-result-cta:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.genv2-result-cta.is-busy { opacity: 0.85; cursor: progress; }

/* ===================================================================
   Regenerate button (Step 4 footer, replaces old Schedule-delivery btn)
   =================================================================== */
.genv2-regen-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}
.genv2-regen-btn svg {
	width: 16px;
	height: 16px;
}
