/**
 * PromptShot — design system.
 *
 * Everything derives from the brand mark: a 6-blade coral aperture (#F75741).
 * ALL colors live in the custom-property blocks below — light on :root, dark
 * on html[data-theme="dark"]. Component styles never hard-code a hex value.
 *
 * Contrast receipts (WCAG AA):
 *  - #211E1C text on #FFF7F5 bg ............ 15.6:1  (body, AA ✓)
 *  - #695F58 secondary on #FFF7F5 .......... 5.9:1   (AA ✓)
 *  - #FFFFFF on #F75741 (buttons) .......... 3.3:1   (AA for LARGE text only →
 *      every coral button renders its label ≥18.7px bold; see .ps-generate)
 *  - #C2321F links on #FFF7F5/#FFFFFF ...... 5.2:1   (AA ✓ — small coral text
 *      uses this darkened action color, never raw #F75741)
 *  - #F75741 focus ring vs #FFF7F5/#FFF .... 3.1/3.3:1 (≥3:1 UI ✓)
 *  - #F5EFE8 text on #17140F bg ............ 15.2:1  (AA ✓)
 *  - #B8AFA3 secondary on #17140F .......... 8.5:1   (AA ✓)
 *  - #FF7B63 on #17140F (text/ring) ........ 7.2:1   (AA ✓ at any size)
 *  - #17140F label on #FF7B63 buttons ...... 7.2:1   (AA ✓)
 *  - #1F7A5C success on light bg ........... 5.0:1 · #3FBF8F on dark 7.9:1 ✓
 */

/* =======================================================================
   1 · TOKENS — light palette
   ==================================================================== */
:root {
	--ps-coral: #F75741;            /* the logo coral — actions only */
	--ps-coral-strong: #E0452F;     /* hover/active shift */
	--ps-on-coral: #FFFFFF;         /* large bold text on coral only */
	--ps-link: #C2321F;             /* small coral text (AA on light) */

	--ps-bg: #FFF7F5;               /* warm near-white page */
	--ps-surface: #FFFFFF;          /* cards */
	--ps-code-bg: #F8F0EC;          /* prompt/JSON output surface */
	--ps-code-text: #211E1C;

	--ps-text: #211E1C;             /* charcoal */
	--ps-text-2: #695F58;           /* secondary */
	--ps-wordmark: #211E1C;

	--ps-border: #EBDED8;
	--ps-border-strong: #D3BFB6;    /* dropzone dashes, control outlines */

	--ps-tint: rgba(247, 87, 65, 0.10);         /* coral card highlight */
	--ps-tint-strong: rgba(247, 87, 65, 0.22);

	--ps-success: #1F7A5C;
	--ps-success-tint: rgba(31, 122, 92, 0.10);
	--ps-error: #B3261E;
	--ps-error-tint: rgba(179, 38, 30, 0.08);

	--ps-focus: #F75741;            /* ≥3:1 vs both light surfaces */

	--ps-seg-bg: #F1E5DF;           /* segmented-control well */
	--ps-skel-a: #EFE2DC;           /* shimmer base */
	--ps-skel-b: #FBF5F2;           /* shimmer highlight */

	--ps-toggle-track: #EADCD6;
	--ps-toggle-knob: #FFFFFF;
	--ps-toggle-icon: #695F58;

	--ps-shadow: 0 12px 32px rgba(33, 30, 28, 0.08);
	--ps-shadow-soft: 0 2px 8px rgba(33, 30, 28, 0.07);

	--ps-select-arrow: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23695F58' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");

	--ps-font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
	--ps-font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--ps-font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, Menlo, monospace;
}

/* =======================================================================
   1b · TOKENS — dark palette (warm near-black, brand coral raised to
   #FF7B63 for contrast; never pure white text)
   ==================================================================== */
html[data-theme="dark"] {
	--ps-coral: #FF7B63;
	--ps-coral-strong: #FF8F7A;
	--ps-on-coral: #17140F;         /* 7.2:1 on the light coral */
	--ps-link: #FF7B63;             /* 7.2:1 on dark bg — AA any size */

	--ps-bg: #17140F;
	--ps-surface: #211D17;
	--ps-code-bg: #120F0B;
	--ps-code-text: #F5EFE8;

	--ps-text: #F5EFE8;
	--ps-text-2: #B8AFA3;
	--ps-wordmark: #F5EFE8;

	--ps-border: #3A342B;
	--ps-border-strong: #57493D;    /* dashed dropzone stays clearly visible */

	--ps-tint: rgba(255, 123, 99, 0.12);
	--ps-tint-strong: rgba(255, 123, 99, 0.26);

	--ps-success: #3FBF8F;
	--ps-success-tint: rgba(63, 191, 143, 0.14);
	--ps-error: #FF9184;
	--ps-error-tint: rgba(255, 145, 132, 0.12);

	--ps-focus: #FF7B63;

	--ps-seg-bg: #2B251D;
	--ps-skel-a: #2B251D;
	--ps-skel-b: #3A342B;

	--ps-toggle-track: #3A342B;
	--ps-toggle-knob: #F5EFE8;
	--ps-toggle-icon: #B8AFA3;

	--ps-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
	--ps-shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.4);

	--ps-select-arrow: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23B8AFA3' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* =======================================================================
   2 · SITE-WIDE THEME LAYER
   Dark mode restyles the whole site, not just the tool. Low-specificity
   :where() lets any theme rule with explicit colors win if it must.
   ==================================================================== */
html[data-theme="dark"] {
	color-scheme: dark;
	background-color: var(--ps-bg);
}
html[data-theme="dark"] body {
	background-color: var(--ps-bg);
	color: var(--ps-text);
}
html[data-theme="dark"] body :where(h1, h2, h3, h4, h5, h6, p, li, dt, dd, th, td, figcaption, blockquote, label, legend) {
	color: inherit;
}
html[data-theme="dark"] body :where(a:not([class*="ps-"])) {
	color: var(--ps-link);
}
html[data-theme="dark"] body :where(input, textarea, select) {
	background-color: var(--ps-surface);
	color: var(--ps-text);
	border-color: var(--ps-border-strong);
}
html[data-theme="dark"] body :where(hr) {
	border-color: var(--ps-border);
}

/* GeneratePress (and similar themes) set explicit white backgrounds on
   their container elements, which outrank the low-specificity :where()
   layer above and leave light text on white boxes in dark mode. These
   targeted overrides carry enough specificity to win. */
html[data-theme="dark"] .separate-containers .inside-article,
html[data-theme="dark"] .separate-containers .comments-area,
html[data-theme="dark"] .separate-containers .page-header,
html[data-theme="dark"] .separate-containers .paging-navigation,
html[data-theme="dark"] .separate-containers .widget,
html[data-theme="dark"] .one-container .site-content {
	background-color: var(--ps-surface);
}
html[data-theme="dark"] body .site-content,
html[data-theme="dark"] body .content-area,
html[data-theme="dark"] body #page {
	background-color: transparent;
}
html[data-theme="dark"] body .site-header,
html[data-theme="dark"] body .inside-header,
html[data-theme="dark"] body .main-navigation,
html[data-theme="dark"] body .site-footer,
html[data-theme="dark"] body .site-info {
	background-color: var(--ps-surface);
	color: var(--ps-text);
}
html[data-theme="dark"] body .main-navigation .main-nav ul li a,
html[data-theme="dark"] body .site-info a,
html[data-theme="dark"] body .main-title a {
	color: var(--ps-text);
}

/* ~200ms cross-fade when the toggle flips; the class is only added by JS
   when prefers-reduced-motion is NOT set (and removed right after). */
@media (prefers-reduced-motion: no-preference) {
	html.ps-theme-anim,
	html.ps-theme-anim body,
	html.ps-theme-anim body * {
		transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, fill 0.2s ease, stroke 0.2s ease !important;
	}
}

/* =======================================================================
   3 · THEME TOGGLE — compact 52×26 pill, sun | moon, sliding knob
   ==================================================================== */
.ps-theme-toggle-wrap.ps-in-header {
	display: inline-flex;
	align-items: center;
	margin-inline-start: 12px;
	vertical-align: middle;
}
.ps-theme-toggle-wrap.ps-toggle-fixed {
	position: fixed;
	top: 14px;
	right: 14px;
	z-index: 9990;
}
.ps-theme-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	width: 52px;
	height: 26px;
	padding: 0 6px;
	border: 1px solid var(--ps-border-strong);
	border-radius: 999px;
	background: var(--ps-toggle-track);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.ps-tt-icon {
	width: 13px;
	height: 13px;
	color: var(--ps-toggle-icon);
	flex: none;
}
.ps-tt-knob {
	position: absolute;
	top: 2px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--ps-toggle-knob);
	box-shadow: var(--ps-shadow-soft);
}
.ps-theme-toggle[aria-checked="true"] .ps-tt-knob {
	transform: translateX(25px);
}
@media (prefers-reduced-motion: no-preference) {
	.ps-tt-knob {
		transition: transform 0.2s ease;
	}
}
.ps-theme-toggle:focus-visible {
	outline: 2px solid var(--ps-focus);
	outline-offset: 2px;
}

/* =======================================================================
   4 · THE APERTURE — sized per context; animations in section 12
   ==================================================================== */
.ps-aperture {
	display: block;
	color: var(--ps-coral);
}
.ps-lockup-mark { width: 30px; height: 30px; }
.ps-generate-iris { width: 22px; height: 22px; color: var(--ps-on-coral); display: none; flex: none; }
.ps-copy-iris { width: 15px; height: 15px; color: currentColor; flex: none; }

/* =======================================================================
   5 · APP SHELL
   ==================================================================== */
.ps-app {
	box-sizing: border-box;
	max-width: 100%;
	margin: 0 auto;
	padding: clamp(20px, 4.5vw, 42px);
	background: var(--ps-surface);
	color: var(--ps-text);
	border: 1px solid var(--ps-border);
	border-radius: 22px;
	box-shadow: var(--ps-shadow);
	font-family: var(--ps-font-body);
	font-size: 16px;
	line-height: 1.55;
}
.ps-app *,
.ps-app *::before,
.ps-app *::after {
	box-sizing: border-box;
}
/* The hidden attribute must always beat component display values
   (several components set display:flex/grid explicitly). */
.ps-app [hidden],
.ps-app[hidden],
.ps-lib-single [hidden] {
	display: none !important;
}
.ps-app :focus-visible {
	outline: 2px solid var(--ps-focus);
	outline-offset: 2px;
	border-radius: 4px;
}
.ps-app button {
	font-family: inherit;
}

.ps-masthead { margin-bottom: 28px; }
.ps-lockup {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 18px;
}
.ps-wordmark {
	font-family: var(--ps-font-display);
	font-weight: 800;
	font-size: 1.18rem;
	letter-spacing: -0.02em;
	color: var(--ps-wordmark);
}
.ps-title {
	margin: 0 0 10px;
	font-family: var(--ps-font-display);
	font-weight: 800;
	font-size: clamp(1.65rem, 5.5vw, 2.55rem);
	line-height: 1.06;
	letter-spacing: -0.025em;
	color: var(--ps-text);
}
.ps-subtitle {
	margin: 0;
	color: var(--ps-text-2);
	font-size: 0.98rem;
	max-width: 56ch;
}

.ps-zone { margin-top: 26px; }
.ps-eyebrow {
	margin: 0 0 10px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ps-text-2);
}

/* =======================================================================
   6 · INPUT ZONE — tabs, dropzone, preview, fields
   ==================================================================== */
.ps-input-tabs {
	display: flex;
	gap: 6px;
	padding: 4px;
	background: var(--ps-seg-bg);
	border-radius: 12px;
	margin-bottom: 14px;
}
.ps-input-tab {
	flex: 1;
	padding: 9px 10px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--ps-text-2);
	font-size: 0.92rem;
	font-weight: 600;
	cursor: pointer;
}
.ps-input-tab:hover { color: var(--ps-text); }
.ps-input-tab.is-active {
	background: var(--ps-surface);
	color: var(--ps-text);
	box-shadow: var(--ps-shadow-soft);
}

.ps-dropzone {
	display: block;
	width: 100%;
	padding: 28px 16px;
	border: 2px dashed var(--ps-border-strong);
	border-radius: 14px;
	background: transparent;
	text-align: center;
	cursor: pointer;
}
.ps-dropzone:hover,
.ps-dropzone.is-dragover {
	border-color: var(--ps-coral);
	background: var(--ps-tint);
}
.ps-dz-icon {
	width: 28px;
	height: 28px;
	margin: 0 auto 8px;
	color: var(--ps-text-2);
	display: block;
}
.ps-dropzone:hover .ps-dz-icon,
.ps-dropzone.is-dragover .ps-dz-icon { color: var(--ps-coral); }
.ps-dz-title {
	margin: 0 0 4px;
	font-weight: 600;
	font-size: 0.98rem;
	color: var(--ps-text);
}
.ps-dz-hint {
	margin: 0;
	font-size: 0.82rem;
	color: var(--ps-text-2);
}
.ps-file { display: none; }

.ps-preview {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px;
	border: 1px solid var(--ps-border);
	border-radius: 14px;
	background: var(--ps-tint);
}
.ps-preview-img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 10px;
	border: 1px solid var(--ps-border);
	background: var(--ps-surface);
	flex: none;
}
.ps-preview-meta { min-width: 0; }
.ps-preview-name {
	display: block;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--ps-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin-bottom: 6px;
}
.ps-preview-remove {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border: 1px solid var(--ps-border-strong);
	border-radius: 999px;
	background: var(--ps-surface);
	color: var(--ps-text-2);
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
}
.ps-preview-remove:hover {
	color: var(--ps-error);
	border-color: var(--ps-error);
}
/* "Analyzed:" — Gemini's read of the photo, shown after a real generation. */
.ps-analyzed {
	margin: 8px 0 0;
	font-size: 0.8rem;
	color: var(--ps-text-2);
}
.ps-analyzed strong {
	color: var(--ps-text);
	font-weight: 600;
}

.ps-field { margin-top: 14px; }
.ps-label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--ps-text);
}
.ps-label-soft {
	font-weight: 400;
	color: var(--ps-text-2);
}
.ps-input,
.ps-textarea,
.ps-select {
	width: 100%;
	padding: 11px 13px;
	border: 1.5px solid var(--ps-border-strong);
	border-radius: 10px;
	background: var(--ps-surface);
	color: var(--ps-text);
	font-family: inherit;
	font-size: 0.95rem;
	line-height: 1.5;
}
.ps-textarea { resize: vertical; min-height: 84px; }
.ps-input::placeholder,
.ps-textarea::placeholder { color: var(--ps-text-2); opacity: 0.85; }
.ps-input:focus-visible,
.ps-textarea:focus-visible,
.ps-select:focus-visible {
	outline: 2px solid var(--ps-focus);
	outline-offset: 1px;
	border-color: var(--ps-focus);
}
.ps-select {
	-webkit-appearance: none;
	appearance: none;
	background-image: var(--ps-select-arrow);
	background-repeat: no-repeat;
	background-position: right 13px center;
	padding-right: 36px;
	cursor: pointer;
}

/* =======================================================================
   7 · FORMAT PILLS — default / hover / selected / disabled
   ==================================================================== */
.ps-formats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.ps-pill {
	padding: 9px 16px;
	border: 1.5px solid var(--ps-border-strong);
	border-radius: 999px;
	background: var(--ps-surface);
	color: var(--ps-text);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
}
.ps-pill:hover { border-color: var(--ps-coral); }
.ps-pill.is-selected {
	border-color: var(--ps-coral);
	background: var(--ps-tint);
	box-shadow: inset 0 0 0 1px var(--ps-coral);
}
.ps-pill:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

/* =======================================================================
   8 · SMART SUGGESTIONS — switch + manual dropdowns
   ==================================================================== */
.ps-zone-suggest {
	padding: 16px;
	border: 1px solid var(--ps-border);
	border-radius: 14px;
	background: var(--ps-tint);
}
.ps-suggest-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}
.ps-switch {
	flex: none;
	margin-top: 2px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
.ps-switch-track {
	display: block;
	position: relative;
	width: 46px;
	height: 26px;
	border-radius: 999px;
	background: var(--ps-border-strong);
	border: 1px solid var(--ps-border-strong);
}
.ps-switch[aria-checked="true"] .ps-switch-track {
	background: var(--ps-coral);
	border-color: var(--ps-coral);
}
.ps-switch-knob {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--ps-surface);
	box-shadow: var(--ps-shadow-soft);
}
.ps-switch[aria-checked="true"] .ps-switch-knob {
	transform: translateX(20px);
}
@media (prefers-reduced-motion: no-preference) {
	.ps-switch-knob { transition: transform 0.18s ease; }
	.ps-switch-track { transition: background-color 0.18s ease, border-color 0.18s ease; }
}
.ps-switch-label {
	display: block;
	font-weight: 700;
	font-size: 1rem;
	color: var(--ps-text);
	cursor: pointer;
}
.ps-switch-help {
	margin: 3px 0 0;
	font-size: 0.85rem;
	color: var(--ps-text-2);
}
.ps-manual {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-top: 16px;
}
.ps-manual .ps-field { margin-top: 0; }

/* =======================================================================
   9 · GENERATE — full-width coral button, remaining count, errors,
   email-capture card
   ==================================================================== */
.ps-generate {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 16px 20px;
	border: 0;
	border-radius: 14px;
	background: var(--ps-coral);
	color: var(--ps-on-coral);
	font-family: var(--ps-font-display);
	/* 1.2rem bold ≈ 19px — "large text", so white-on-coral (3.3:1) passes AA. */
	font-size: 1.2rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	cursor: pointer;
}
.ps-generate:hover { background: var(--ps-coral-strong); }
.ps-generate:active { transform: translateY(1px); }
.ps-generate.is-loading {
	pointer-events: none;
	opacity: 0.92;
}
.ps-generate.is-loading .ps-generate-iris { display: block; }
.ps-remaining {
	margin: 10px 0 0;
	text-align: center;
	font-size: 0.85rem;
	color: var(--ps-text-2);
}
.ps-error {
	margin: 12px 0 0;
	padding: 10px 14px;
	border-radius: 10px;
	background: var(--ps-error-tint);
	color: var(--ps-error);
	font-size: 0.9rem;
	font-weight: 500;
}

.ps-email-card {
	margin-top: 16px;
	padding: 20px;
	border: 1px solid var(--ps-tint-strong);
	border-radius: 14px;
	background: var(--ps-tint);
}
.ps-email-title {
	margin: 0 0 4px;
	font-family: var(--ps-font-display);
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--ps-text);
}
.ps-email-sub {
	margin: 0 0 12px;
	font-size: 0.9rem;
	color: var(--ps-text-2);
}
.ps-email-form {
	display: flex;
	gap: 8px;
}
.ps-email-form .ps-email-input { flex: 1; min-width: 0; }
.ps-email-submit {
	flex: none;
	padding: 11px 18px;
	border: 0;
	border-radius: 10px;
	background: var(--ps-coral);
	color: var(--ps-on-coral);
	/* 18.7px bold → large-text AA on coral in light theme. */
	font-size: 1.17rem;
	font-weight: 700;
	font-family: var(--ps-font-display);
	cursor: pointer;
}
.ps-email-submit:hover { background: var(--ps-coral-strong); }
.ps-consent {
	margin: 10px 0 0;
	font-size: 0.78rem;
	color: var(--ps-text-2);
}
/* Honeypot: off-screen for humans, present for bots. */
.ps-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

/* =======================================================================
   10 · OUTPUT — camera-mode model tabs, view toggle, prompt surface,
   copy button, regenerate
   ==================================================================== */
.ps-output { margin-top: 30px; }
.ps-note {
	display: flex;
	gap: 8px;
	align-items: baseline;
	margin: 0 0 16px;
	padding: 11px 14px;
	border-radius: 10px;
	background: var(--ps-tint);
	font-size: 0.9rem;
	color: var(--ps-text);
}
.ps-note-spark { flex: none; }

/* Model tabs as a camera-mode selector: PHOTO | VIDEO | PORTRAIT energy. */
.ps-modes {
	display: flex;
	justify-content: center;
	gap: 4px;
	margin-bottom: 14px;
	padding-bottom: 2px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.ps-mode {
	position: relative;
	flex: none;
	padding: 8px 14px 14px;
	border: 0;
	background: transparent;
	color: var(--ps-text-2);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	cursor: pointer;
	white-space: nowrap;
}
.ps-mode:hover { color: var(--ps-text); }
.ps-mode.is-active { color: var(--ps-coral); }
.ps-mode.is-active::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 4px;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--ps-coral);
	transform: translateX(-50%);
}

.ps-outpanel {
	border: 1px solid var(--ps-border);
	border-radius: 16px;
	padding: 14px;
	background: var(--ps-surface);
}
.ps-outbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}
.ps-viewtoggle {
	display: inline-flex;
	gap: 4px;
	padding: 3px;
	border-radius: 999px;
	background: var(--ps-seg-bg);
}
.ps-view {
	padding: 5px 13px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ps-text-2);
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
}
.ps-view.is-active {
	background: var(--ps-surface);
	color: var(--ps-text);
	box-shadow: var(--ps-shadow-soft);
}

.ps-copy-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 14px;
	border: 1.5px solid var(--ps-border-strong);
	border-radius: 999px;
	background: var(--ps-surface);
	color: var(--ps-text);
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
}
.ps-copy-btn:hover { border-color: var(--ps-coral); }
.ps-copy-btn.is-copied {
	border-color: var(--ps-success);
	background: var(--ps-success-tint);
	color: var(--ps-success);
}

/* The prompt surface — its own themed layer, legible in both modes. */
.ps-outbox {
	margin: 0;
	padding: 16px;
	max-height: 420px;
	overflow: auto;
	border: 1px solid var(--ps-border);
	border-radius: 12px;
	background: var(--ps-code-bg);
	color: var(--ps-code-text);
	font-family: var(--ps-font-mono);
	font-size: 0.83rem;
	line-height: 1.65;
	white-space: pre-wrap;
	word-break: break-word;
}
.ps-regenerate {
	display: inline-block;
	margin-top: 12px;
	padding: 2px 0;
	border: 0;
	background: none;
	color: var(--ps-link);
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.ps-regenerate:hover { color: var(--ps-coral-strong); }
.ps-regenerate:disabled { opacity: 0.5; cursor: wait; }

/* Skeleton shimmer — distinct gradients per theme so it never vanishes. */
.ps-skeleton {
	display: grid;
	gap: 12px;
	padding: 16px;
	border: 1px solid var(--ps-border);
	border-radius: 12px;
	background: var(--ps-code-bg);
}
.ps-skel-bar {
	display: block;
	height: 13px;
	border-radius: 6px;
	background: linear-gradient(90deg, var(--ps-skel-a) 25%, var(--ps-skel-b) 42%, var(--ps-skel-a) 60%);
	background-size: 220% 100%;
}
@media (prefers-reduced-motion: no-preference) {
	.ps-skel-bar { animation: ps-shimmer 1.25s linear infinite; }
}
@keyframes ps-shimmer {
	from { background-position: 120% 0; }
	to   { background-position: -120% 0; }
}

/* =======================================================================
   11 · AFFILIATE STRIP + optional ad slot (below output only)
   ==================================================================== */
.ps-affiliates {
	margin-top: 24px;
	padding-top: 18px;
	border-top: 1px solid var(--ps-border);
}
.ps-disclosure {
	margin: 0 0 10px;
	font-size: 0.75rem;
	color: var(--ps-text-2);
}
.ps-aff-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}
.ps-aff-lead {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--ps-text);
}
.ps-aff-btn {
	display: inline-block;
	padding: 8px 16px;
	border: 1.5px solid var(--ps-coral);
	border-radius: 999px;
	background: transparent;
	color: var(--ps-link);
	font-size: 0.88rem;
	font-weight: 700;
	text-decoration: none;
}
.ps-aff-btn:hover {
	background: var(--ps-tint);
	color: var(--ps-link);
}
/* No ad surface exists inside the tool container (policy hard rule);
   display ads live in the theme's zones only. */

/* =======================================================================
   12 · APERTURE ANIMATIONS
   Loading: blades contract + ring rotates (a real iris breathing).
   Copy: one quick snap — the camera takes the shot.
   Each blade scales from its own outer-arc midpoint (73,10.2 in local
   viewBox units), so scaling pushes it toward the center.
   ==================================================================== */
.ps-aperture .ps-ap-ring {
	transform-box: view-box;
	transform-origin: 50px 50px;
}
.ps-aperture .ps-ap-blade path {
	transform-box: view-box;
	transform-origin: 73px 10.2px;
}
@keyframes ps-iris-spin {
	to { transform: rotate(120deg); }
}
@keyframes ps-iris-close {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.26); }
}
@keyframes ps-iris-snap {
	0%   { transform: scale(1); }
	45%  { transform: scale(1.3); }
	100% { transform: scale(1); }
}
@keyframes ps-pulse {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0.45; }
}
@media (prefers-reduced-motion: no-preference) {
	.ps-generate.is-loading .ps-generate-iris .ps-ap-ring {
		animation: ps-iris-spin 2.4s linear infinite;
	}
	.ps-generate.is-loading .ps-generate-iris .ps-ap-blade path {
		animation: ps-iris-close 1.2s ease-in-out infinite;
	}
	.ps-copy-btn.is-copied .ps-copy-iris .ps-ap-blade path {
		animation: ps-iris-snap 0.38s ease-in-out 1;
	}
}
@media (prefers-reduced-motion: reduce) {
	/* Fallback: simple pulse instead of moving blades. */
	.ps-generate.is-loading .ps-generate-iris {
		animation: ps-pulse 1.2s ease-in-out infinite;
	}
}

/* =======================================================================
   13 · PROMPT LIBRARY PAGES
   ==================================================================== */
.ps-breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 7px;
	margin: 0 0 18px;
	font-size: 0.8rem;
	color: var(--ps-text-2);
}
.ps-breadcrumbs a {
	color: var(--ps-link);
	text-decoration: none;
}
.ps-breadcrumbs a:hover { text-decoration: underline; }
.ps-crumb-sep { color: var(--ps-text-2); }

.ps-lib-single { font-family: var(--ps-font-body); }

.ps-copybox {
	margin: 26px 0;
	border: 1px solid var(--ps-border);
	border-radius: 16px;
	background: var(--ps-surface);
	overflow: hidden;
}
.ps-copybox-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--ps-border);
}
.ps-copybox-title {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ps-text-2);
}
.ps-copybox .ps-outbox {
	border: 0;
	border-radius: 0;
	max-height: none;
}

.ps-lib-cta {
	margin: 26px 0;
	padding: 22px;
	border: 1px solid var(--ps-tint-strong);
	border-radius: 16px;
	background: var(--ps-tint);
}
.ps-lib-cta-text {
	margin: 0 0 14px;
	color: var(--ps-text);
	font-size: 0.95rem;
}
.ps-btn-coral {
	display: inline-block;
	padding: 12px 22px;
	border-radius: 12px;
	background: var(--ps-coral);
	color: var(--ps-on-coral) !important; /* beat theme link colors */
	font-family: var(--ps-font-display);
	/* 18.7px bold → large-text AA on coral in light theme. */
	font-size: 1.17rem;
	font-weight: 700;
	text-decoration: none !important;
}
.ps-btn-coral:hover { background: var(--ps-coral-strong); }

.ps-lib-faqs { margin: 30px 0; }
.ps-lib-faqs h2,
.ps-related h2 {
	font-family: var(--ps-font-display);
	font-weight: 700;
	letter-spacing: -0.015em;
}
.ps-faq {
	border-bottom: 1px solid var(--ps-border);
	padding: 4px 0;
}
.ps-faq summary {
	padding: 10px 0;
	font-weight: 600;
	color: var(--ps-text);
	cursor: pointer;
}
.ps-faq summary:hover { color: var(--ps-link); }
.ps-faq p {
	margin: 0 0 14px;
	color: var(--ps-text-2);
	font-size: 0.95rem;
}

.ps-related { margin: 30px 0 10px; }
.ps-related-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}
.ps-related-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px;
	border: 1px solid var(--ps-border);
	border-radius: 14px;
	background: var(--ps-surface);
	text-decoration: none !important;
	box-shadow: var(--ps-shadow-soft);
}
.ps-related-card:hover { border-color: var(--ps-coral); }
.ps-related-cat {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ps-link);
}
.ps-related-title {
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--ps-text);
}
.ps-related-arrow {
	margin-top: auto;
	color: var(--ps-link);
	font-weight: 700;
}

.ps-lib-archive-intro { margin: 0 0 26px; }
.ps-lib-archive-sub {
	margin: 0;
	max-width: 64ch;
	color: var(--ps-text-2);
	font-size: 1rem;
}

/* Filter bar — term links styled as pills; current filter carries the
   same coral selected state as the tool's format pills. */
.ps-lib-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
}
.ps-filter-group {
	margin-left: 6px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ps-text-2);
}
.ps-filter-pill {
	padding: 7px 14px;
	border: 1.5px solid var(--ps-border-strong);
	border-radius: 999px;
	background: var(--ps-surface);
	color: var(--ps-text);
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
}
.ps-filter-pill:hover { border-color: var(--ps-coral); }
.ps-filter-pill.is-selected {
	border-color: var(--ps-coral);
	background: var(--ps-tint);
	box-shadow: inset 0 0 0 1px var(--ps-coral);
}

/* =======================================================================
   14 · UTILITIES + RESPONSIVE (solid down to 360px)
   ==================================================================== */
.ps-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 640px) {
	.ps-manual { grid-template-columns: 1fr; }
	.ps-related-grid { grid-template-columns: 1fr; }
	.ps-email-form { flex-direction: column; }
	.ps-email-submit { width: 100%; }
	.ps-outbar { align-items: stretch; }
}
@media (max-width: 400px) {
	.ps-app { border-radius: 16px; }
	.ps-pill { padding: 8px 13px; font-size: 0.86rem; }
	.ps-mode { padding: 8px 10px 14px; letter-spacing: 0.1em; }
	.ps-outbox { font-size: 0.79rem; }
}


/* Full-width generator section (added 2026-07-24) */
.ps-wrap.ps-tool-wrap {
	max-width: 1080px !important;
}
