/*
 * AI Photo FX — Plugin Theme Stylesheet
 * Dark tokens on :root; light overrides on body.aipfx-theme-light immediately below (avoids FOUC on stock/archive).
 * Scoped to .aipfx-site-inner so the active theme header/footer stay intact.
 * Fonts: enqueued via aipfx_theme_assets() — do not @import here (blocks the rest of the sheet).
 */

/* ─────────────────────────────────────────────
   TOKENS
───────────────────────────────────────────── */
:root {
  --bg:        #07080f;
  --bg2:       #0d0f1c;
  --bg3:       #111423;
  --surface:   #161929;
  --border:    rgba(255,255,255,.08);
  --border2:   rgba(255,255,255,.13);
  --text:      #e8eaf0;
  --text-dim:  #7c8098;
  --text-muted:#4a4f68;
  --gold:      #d4a843;
  --gold-dim:  rgba(212,168,67,.2);
  --gold-glow: rgba(212,168,67,.12);
  --teal:      #38d9c0;
  --teal-dim:  rgba(56,217,192,.15);
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --shadow:    0 8px 40px rgba(0,0,0,.45);
  --shadow-sm: 0 2px 12px rgba(0,0,0,.35);
  --font-head: 'Syne', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --max-w:     1120px;
  --px:        clamp(16px, 4vw, 32px);
}

/* Light pages: tokens before any .aipfx-site-inner rules so first paint is correct */
body.aipfx-theme-light {
  --bg:        #f6f7fb;
  --bg2:       #ffffff;
  --bg3:       #eef0f6;
  --surface:   #ffffff;
  --border:    rgba(15, 23, 42, 0.08);
  --border2:   rgba(15, 23, 42, 0.14);
  --text:      #0f172a;
  --text-dim:  #475569;
  --text-muted:#64748b;
  --gold:      #b8860b;
  --gold-dim:  rgba(184, 134, 11, 0.12);
  --gold-glow: rgba(184, 134, 11, 0.08);
  --teal:      #0d9488;
  --teal-dim:  rgba(13, 148, 136, 0.12);
  --shadow:    0 8px 32px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.06);
}

/* ─────────────────────────────────────────────
   RESET / BASE (scoped — does not affect theme chrome)
───────────────────────────────────────────── */
.aipfx-site-inner,
.aipfx-site-inner *,
.aipfx-site-inner *::before,
.aipfx-site-inner *::after {
  box-sizing: border-box;
}

.aipfx-site-inner {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.aipfx-site-inner a { color: inherit; text-decoration: none; }
.aipfx-site-inner img { display: block; max-width: 100%; }

/* ─────────────────────────────────────────────
   NAV
───────────────────────────────────────────── */
.at-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--px);
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.at-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  transition: opacity .18s;
}
.at-nav-logo:hover { opacity: .75; }

.at-nav-icon {
  width: 32px; height: 32px;
  color: var(--gold);
  flex-shrink: 0;
}

.at-nav-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 999px;
}

.at-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  transition: color .18s, border-color .18s;
}
.at-nav-back:hover { color: var(--text); border-color: var(--border2); }

/* ─────────────────────────────────────────────
   EYEBROW
───────────────────────────────────────────── */
.at-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}
.at-eyebrow-dot {
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: at-blink 2s ease-in-out infinite;
}
@keyframes at-blink {
  0%,100% { opacity: 1; }
  50%      { opacity: .35; }
}

/* ─────────────────────────────────────────────
   SHARED GLOWS + NOISE
───────────────────────────────────────────── */
.at-hero-noise {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 180px;
  pointer-events: none;
  opacity: .6;
  z-index: 0;
}
.at-hero-glow {
  position: absolute;
  width: 560px; height: 560px;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}
.at-hero-glow--l {
  background: radial-gradient(circle, rgba(212,168,67,.16) 0%, transparent 70%);
  top: -120px; left: -80px;
}
.at-hero-glow--r {
  background: radial-gradient(circle, rgba(56,217,192,.08) 0%, transparent 70%);
  top: -80px; right: -100px;
}

/* ─────────────────────────────────────────────
   ARCHIVE — HERO
───────────────────────────────────────────── */
body.aipfx-archive .aipfx-site-inner .at-eyebrow {
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
body.aipfx-archive .aipfx-site-inner .at-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 56px var(--px) 48px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
}
body.aipfx-archive .aipfx-site-inner .at-hero-content {
  position: relative;
  z-index: 1;
  max-width: 42rem;
  margin: 0 auto;
}
body.aipfx-archive .aipfx-site-inner .at-hero-title {
  font-family: var(--font-head);
  font-size: clamp(1.625rem, 3.2vw, 2.375rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 14px;
}
body.aipfx-archive .aipfx-site-inner .at-hero-title-em {
  display: block;
  margin-top: 0.15em;
  background: linear-gradient(95deg, var(--gold) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.aipfx-archive .aipfx-site-inner .at-hero-sub {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 38rem;
  margin: 0 auto 28px;
}
body.aipfx-archive .aipfx-site-inner .at-hero-stats {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  gap: 16px 22px;
}
body.aipfx-archive .aipfx-site-inner .at-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 4.5rem;
}
body.aipfx-archive .aipfx-site-inner .at-stat-num {
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}
body.aipfx-archive .aipfx-site-inner .at-stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.35;
  text-align: center;
  max-width: 6.5rem;
}
body.aipfx-archive .aipfx-site-inner .at-stat-div {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}
.at-hero-scroll-hint {
  position: absolute;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  z-index: 1;
  animation: at-bounce 2.4s ease-in-out infinite;
}
@keyframes at-bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(5px); }
}

/* ─────────────────────────────────────────────
   ARCHIVE — GRID
───────────────────────────────────────────── */
.aipfx-site-inner .at-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px var(--px) 96px;
  width: 100%;
  flex: 1;
}

body.aipfx-archive .aipfx-site-inner .at-archive-main {
  max-width: min(1280px, 100%);
  padding-top: 40px;
  padding-bottom: 72px;
}

body.aipfx-archive .aipfx-site-inner .at-grid-header,
.aipfx-stock-shop-page .as-stock-related .at-grid-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
body.aipfx-archive .aipfx-site-inner .at-grid-heading,
.aipfx-stock-shop-page .as-stock-related .at-grid-heading {
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}
body.aipfx-archive .aipfx-site-inner .at-grid-count {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-muted);
}

/* 4 per row (desktop), 3:4 image, single “Use template” CTA */
body.aipfx-archive .aipfx-site-inner .at-archive-grid,
.aipfx-stock-shop-page .as-stock-related .at-archive-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 20px;
  list-style: none;
}

body.aipfx-archive .aipfx-site-inner .at-card,
.aipfx-stock-shop-page .as-stock-related .at-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
body.aipfx-archive .aipfx-site-inner .at-card:hover,
.aipfx-stock-shop-page .as-stock-related .at-card:hover {
  border-color: rgba(212,168,67,.35);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

body.aipfx-archive .aipfx-site-inner .at-card-media,
.aipfx-stock-shop-page .as-stock-related .at-card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg3);
}
body.aipfx-archive .aipfx-site-inner .at-card-media.has-transparent-preview,
.aipfx-stock-shop-page .as-stock-related .at-card-media.has-transparent-preview,
.at-stock-justified-link.has-transparent-preview,
.aipfx-stock-shop-page .as-stock-preview-frame.has-transparent-preview,
.aipfx-stock-shop-page .as-stock-preview-img.has-transparent-preview {
  background-color: #f6f7f9;
  background-image:
    linear-gradient(45deg, #dee2e8 25%, transparent 25%),
    linear-gradient(-45deg, #dee2e8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dee2e8 75%),
    linear-gradient(-45deg, transparent 75%, #dee2e8 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}
body.aipfx-archive .aipfx-site-inner .at-card-img,
.aipfx-stock-shop-page .as-stock-related .at-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.aipfx-archive .aipfx-site-inner .at-card-img-placeholder,
.aipfx-stock-shop-page .as-stock-related .at-card-img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg3);
}

body.aipfx-archive .aipfx-site-inner .at-card-body,
.aipfx-stock-shop-page .as-stock-related .at-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  flex: 1;
}
body.aipfx-archive .aipfx-site-inner .at-card-title,
.aipfx-stock-shop-page .as-stock-related .at-card-title {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  text-align: center;
  margin: 0;
  overflow-wrap: anywhere;
  hyphens: auto;
}
body.aipfx-archive .aipfx-site-inner a.at-card-use-btn,
.aipfx-stock-shop-page .as-stock-related a.at-card-use-btn {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: #0a0b12 !important;
  text-decoration: none !important;
  background: var(--gold);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
body.aipfx-archive .aipfx-site-inner a.at-card-use-btn:hover,
.aipfx-stock-shop-page .as-stock-related a.at-card-use-btn:hover {
  background: #e4bc5a;
  color: #0a0b12 !important;
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────
   PAGINATION
───────────────────────────────────────────── */
.at-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 56px;
  flex-wrap: wrap;
}
.at-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px; height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  transition: background .15s, color .15s, border-color .15s;
}
.at-pagination .page-numbers:hover,
.at-pagination .page-numbers.current {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  font-weight: 700;
}

/* ─────────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────────── */
.at-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
}
.at-empty-icon { font-size: 48px; margin-bottom: 20px; }
.at-empty h2 {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.at-empty p { font-size: 15px; }

/* ─────────────────────────────────────────────
   SINGLE — BREADCRUMB
───────────────────────────────────────────── */
.as-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  max-width: var(--max-w);
  margin: 4px auto 0;
  padding: 0 var(--px) 16px;
}
.as-breadcrumb a {
  color: var(--text-dim);
  transition: color .15s;
}
.as-breadcrumb a:hover { color: var(--text); }
.as-bc-sep { opacity: .4; }

body.aipfx-single .aipfx-site-inner.aipfx-single-page {
  width: 100%;
  max-width: none;
  padding-top: 8px;
  padding-bottom: 48px;
}
body.aipfx-single .as-single-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(12px, 2vw, 24px) 12px;
}
body.aipfx-single .as-back-templates {
  flex-shrink: 0;
  text-decoration: none;
  font-weight: 500;
}
body.aipfx-single .as-back-icon {
  font-size: 15px;
  line-height: 1;
  opacity: 0.85;
}
body.aipfx-single .aipfx-site-inner .as-breadcrumb {
  max-width: none;
  width: auto;
  margin: 0;
  padding: 0;
}
@media (max-width: 640px) {
  body.aipfx-single .as-single-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
body.aipfx-single .aipfx-site-inner .as-studio-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 clamp(12px, 2vw, 24px) 32px;
}

/* Compact “How it works” below studio */
body.aipfx-single .as-steps-section--compact {
  border-top: 1px solid var(--border);
  background: transparent;
}
body.aipfx-single .as-steps-section--compact .as-steps-wrap {
  max-width: none;
  padding: 18px clamp(12px, 2vw, 24px) 24px;
}
body.aipfx-single .as-steps-section--compact .as-steps-heading {
  font-size: 11px;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  color: var(--text-muted);
}
body.aipfx-single .as-steps-section--compact .as-steps {
  gap: 10px 12px;
}
body.aipfx-single .as-steps-section--compact .as-step {
  gap: 10px;
  align-items: center;
}
body.aipfx-single .as-steps-section--compact .as-step-num {
  font-size: 22px;
  min-width: 28px;
  opacity: 0.75;
}
body.aipfx-single .as-steps-section--compact .as-step-title {
  font-size: 13px;
  margin-bottom: 2px;
  line-height: 1.3;
}
body.aipfx-single .as-steps-section--compact .as-step-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}
body.aipfx-single .as-steps-section--compact .as-step-arrow {
  font-size: 16px;
  opacity: 0.35;
}

/* ─────────────────────────────────────────────
   SINGLE — HERO (legacy; unused on studio single)
───────────────────────────────────────────── */
.as-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 52px var(--px) 64px;
}
.as-hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.as-hero-text {}
.as-title {
  font-family: var(--font-head);
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
  margin-bottom: 18px;
  color: var(--text);
}
.as-desc {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 26px;
}

/* Pills */
.as-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.as-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
}
.as-pill--gold {
  color: var(--gold);
  background: var(--gold-dim);
  border-color: rgba(212,168,67,.25);
}

/* CTA button */
.as-scroll-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #000;
  background: var(--gold);
  padding: 12px 24px;
  border-radius: 999px;
  transition: opacity .18s, transform .18s;
}
.as-scroll-btn:hover { opacity: .88; transform: translateY(-1px); }

/* Image */
.as-hero-img-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg3);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.as-hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.as-hero-img-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.as-hero-img-badge {
  position: absolute;
  bottom: 14px; left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(7,8,15,.75);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border2);
  padding: 7px 14px;
  border-radius: 10px;
}
.as-live-dot {
  width: 7px; height: 7px;
  background: #4ade80;
  border-radius: 50%;
  animation: as-live 1.8s ease-in-out infinite;
}
@keyframes as-live {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(1.4); }
}

/* ─────────────────────────────────────────────
   SINGLE — STEPS
───────────────────────────────────────────── */
.as-steps-section {
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.as-steps-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 52px var(--px);
}
.as-steps-heading {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.as-steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 20px;
  align-items: center;
}
.as-step-arrow {
  font-size: 22px;
  color: var(--text-muted);
  opacity: .4;
}
.as-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.as-step-num {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 800;
  color: var(--gold);
  opacity: .6;
  line-height: 1;
  flex-shrink: 0;
  min-width: 44px;
}
.as-step-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.as-step-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ─────────────────────────────────────────────
   SINGLE — TOOL SECTION
───────────────────────────────────────────── */
.as-tool-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px var(--px) 96px;
  flex: 1;
  width: 100%;
}
.as-tool-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.as-tool-heading {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
}
.as-tool-heading-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─────────────────────────────────────────────
   SHORTCODE OVERRIDES
   Override aipfx.css colours so they feel
   native inside our dark theme.
───────────────────────────────────────────── */
.as-tool-section .aipfx-wrap {
  max-width: 100%;
  margin: 0;
  padding: 0;
}
.as-tool-section .aipfx-title { display: none; } /* we already show a heading */
.as-tool-section .aipfx-sub   { display: none; }

.as-tool-section .aipfx-card {
  background: var(--surface);
  border-color: var(--border);
}

.as-tool-section .aipfx-btn {
  background: var(--gold);
  color: #000;
  font-weight: 700;
}
.as-tool-section .aipfx-btn:hover:not([disabled]) {
  background: #e8c058;
}
.as-tool-section .aipfx-btn--ghost {
  background: transparent;
  border-color: var(--border2);
  color: var(--text-dim);
}

.as-tool-section .aipfx-progress {
  background: var(--bg3);
  border-color: var(--border);
  color: var(--text-dim);
}

.as-tool-section .aipfx-tpl {
  background: var(--bg3);
  border-color: var(--border);
}
.as-tool-section .aipfx-tpl:hover {
  border-color: rgba(212,168,67,.45);
}
.as-tool-section .aipfx-tpl.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.as-tool-section .aipfx-name { color: var(--text); }
.as-tool-section .aipfx-ex   { color: var(--text-dim); }

.as-tool-section .aipfx-field label { color: var(--text-dim); }
.as-tool-section .aipfx-field input[type=file] {
  background: var(--bg3);
  border-color: var(--border2);
  color: var(--text-dim);
}

.as-tool-section .aipfx-selected { color: var(--text-muted); }

.as-tool-section .aipfx-banner {
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.2);
}

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
.at-footer {
  border-top: 1px solid var(--border);
  padding: 28px var(--px);
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.at-footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}
.at-footer-copy a {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s;
}
.at-footer-copy a:hover { color: var(--text); }

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 860px) {
  .as-hero-inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .as-hero-img-wrap { order: -1; max-height: 300px; }
  .as-steps {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .as-step-arrow { display: none; }
  .as-title { font-size: 36px; }
  body.aipfx-single .as-steps-section--compact .as-steps {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  body.aipfx-single .as-steps-section--compact .as-step-arrow {
    display: none;
  }
}

@media (max-width: 767px) {
  body.aipfx-archive .aipfx-site-inner .at-archive-grid,
  .aipfx-stock-shop-page .as-stock-related .at-archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
  }
  body.aipfx-archive .aipfx-site-inner .at-card-body,
  .aipfx-stock-shop-page .as-stock-related .at-card-body { padding: 10px 10px 12px; gap: 8px; }
  body.aipfx-archive .aipfx-site-inner .at-card-title,
  .aipfx-stock-shop-page .as-stock-related .at-card-title { font-size: 0.75rem; }
  body.aipfx-archive .aipfx-site-inner a.at-card-use-btn,
  .aipfx-stock-shop-page .as-stock-related a.at-card-use-btn { font-size: 0.6875rem; padding: 7px 8px; }
  body.aipfx-archive .aipfx-site-inner .at-hero { padding: 40px var(--px) 36px; }
  body.aipfx-archive .aipfx-site-inner .at-hero-sub { font-size: 0.8125rem; }
}

@media (max-width: 640px) {
  body.aipfx-archive .aipfx-site-inner .at-hero-title { font-size: 1.5rem; }
  body.aipfx-archive .aipfx-site-inner .at-hero-stats { gap: 12px 16px; padding: 10px 16px; }
  body.aipfx-archive .aipfx-site-inner .at-stat-num { font-size: 1rem; }
  body.aipfx-archive .aipfx-site-inner .at-stat-div { display: none; }
  body.aipfx-archive .aipfx-site-inner .at-stat { min-width: 4rem; }
  .as-hero        { padding: 40px var(--px) 48px; }
  .as-tool-section { padding: 40px var(--px) 64px; }
  .at-footer      { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ─────────────────────────────────────────────
   STOCK LIBRARY
───────────────────────────────────────────── */
.aipfx-stock-archive .at-hero--stock .at-hero-title-em { color: var(--teal); }

.at-stock-search {
  width: 100%;
  margin: 0 0 28px;
}
.at-stock-search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 8px 8px 8px 22px;
  border: 1px solid rgba(13, 148, 136, 0.18);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow:
    0 10px 40px rgba(13, 148, 136, 0.12),
    0 2px 8px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.at-stock-search-field:focus-within {
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow:
    0 0 0 4px rgba(13, 148, 136, 0.12),
    0 14px 48px rgba(13, 148, 136, 0.16),
    0 2px 8px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}
.at-stock-search-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: var(--teal);
}
.at-stock-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.4;
  padding: 12px 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.at-stock-search-input::placeholder {
  color: var(--text-muted);
}
.at-stock-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.at-stock-search-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 0;
  border-radius: calc(var(--radius-lg) - 8px);
  background: linear-gradient(180deg, #2dd4bf 0%, var(--teal) 100%);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0 24px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.at-stock-search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.34);
}
.at-stock-search-btn:active {
  transform: translateY(0);
}
.at-stock-search-btn-icon {
  display: none;
}
.at-stock-search-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 0 2px;
}
.at-stock-search-active {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-dim);
}
.at-stock-search-clear {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--teal);
  padding: 6px 14px;
  border: 1px solid rgba(13, 148, 136, 0.22);
  border-radius: 999px;
  background: #fff;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.at-stock-search-clear:hover {
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.35);
  background: #f0fdfa;
}
.at-stock-search-clear--empty {
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--gold);
  border: 0;
  padding: 0;
  background: transparent;
}
.at-stock-search-clear--empty:hover {
  opacity: 0.88;
  background: transparent;
}

body.aipfx-theme-light .at-stock-search-field {
  background: #fff;
  border-color: rgba(13, 148, 136, 0.2);
  box-shadow:
    0 12px 44px rgba(13, 148, 136, 0.14),
    0 2px 10px rgba(15, 23, 42, 0.05);
}
body.aipfx-theme-light .at-stock-search-field:focus-within {
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow:
    0 0 0 4px rgba(13, 148, 136, 0.1),
    0 16px 52px rgba(13, 148, 136, 0.18);
}
body.aipfx-theme-light .at-stock-search-btn {
  background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.3);
}
body.aipfx-theme-light .at-stock-search-btn:hover {
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.36);
}

@media (max-width: 640px) {
  .at-stock-search-field {
    padding: 10px 10px 10px 14px;
    gap: 10px;
  }
  .at-stock-search-input {
    font-size: 0.9375rem;
    padding: 10px 0;
  }
  .at-stock-search-btn {
    min-width: 44px;
    padding: 0 14px;
  }
  .at-stock-search-btn-text {
    display: none;
  }
  .at-stock-search-btn-icon {
    display: flex;
  }
}

body.aipfx-stock-archive-page .at-grid-header .at-grid-count {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.at-stock-grid .at-card--stock { position: relative; }

.at-stock-type-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(7,8,15,.82);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 0.625rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.at-stock-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(7,8,15,.82);
  border: 1px solid var(--border2);
  color: var(--gold);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.at-stock-id,
.at-stock-cats {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.at-stock-id code {
  font-size: 0.6875rem;
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
}

.as-stock-hero {
  display: grid;
  grid-template-columns: 1fr min(420px, 42vw);
  gap: 32px;
  align-items: start;
  padding: 24px var(--px) 8px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.as-stock-title {
  font-family: var(--font-body);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  margin: 0 0 12px;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
}

.as-stock-excerpt {
  color: var(--text-dim);
  margin: 0 0 16px;
  max-width: 52ch;
}

.as-stock-meta {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 0.875rem;
}

.as-stock-preview-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.as-stock-preview-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border2);
  box-shadow: var(--shadow);
  background: var(--bg2);
  min-height: 200px;
}

.aipfx-stock-single--fallback {
  padding: 24px var(--px) 48px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.aipfx-stock-single--fallback .as-stock-layout {
  display: block;
  padding: 0;
}

.as-stock-preview-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: var(--bg3);
}

.as-stock-content {
  padding: 32px var(--px) 64px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.as-stock-content-inner {
  color: var(--text-dim);
  font-size: 0.9375rem;
}

body.aipfx-stock .aipfx-wrap--stock .aipfx-preview-img--template {
  pointer-events: none;
  user-select: none;
}

.as-stock-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(440px, 42vw));
  gap: 40px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px var(--px) 64px;
}

.aipfx-stock-shop-page .as-single-top--stock-shop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px var(--px) 0;
}

.aipfx-stock-shop-page .as-single-top--stock-shop .as-breadcrumb {
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-dim);
}

.aipfx-stock-shop-page .as-bc-current {
  color: var(--text);
  font-weight: 500;
}

.aipfx-stock-shop-page .as-stock-shop-main {
  padding-bottom: 32px;
}

.aipfx-stock-shop-page .as-stock-tax {
  font-size: 0.875rem;
  color: var(--text-dim);
  margin: 0 0 10px;
  line-height: 1.5;
}

.aipfx-stock-shop-page .as-stock-tax a {
  color: var(--teal);
  text-decoration: none;
}

.aipfx-stock-shop-page .as-stock-tax a:hover {
  text-decoration: underline;
}

.aipfx-stock-shop-page .as-stock-description-full {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 8px clamp(12px, 2vw, 24px) 48px;
  box-sizing: border-box;
}

.aipfx-stock-shop-page .as-stock-section-title {
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.aipfx-stock-shop-page .as-stock-content--full {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.aipfx-stock-shop-page .as-stock-content--full p {
  margin: 0 0 1em;
}

.aipfx-stock-shop-page .as-stock-description-full.is-collapsed .as-stock-content--full {
  max-height: 7.5rem;
  overflow: hidden;
  position: relative;
}

.aipfx-stock-shop-page .as-stock-description-full.is-collapsed .as-stock-content--full::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5rem;
  background: linear-gradient(to bottom, transparent, var(--bg, #0d1117));
  pointer-events: none;
}

.aipfx-stock-shop-page .as-stock-desc-toggle {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.aipfx-stock-shop-page .as-stock-desc-toggle:hover {
  color: var(--text);
}

.aipfx-stock-shop-page .as-stock-related {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 clamp(12px, 2vw, 24px) 64px;
  box-sizing: border-box;
}

.aipfx-stock-shop-page .as-stock-related .at-grid-header {
  margin-bottom: 16px;
}

.aipfx-stock-shop-page .as-stock-related .at-grid-heading {
  margin: 0;
}

@media (max-width: 900px) {
  .aipfx-stock-shop-page .as-stock-layout {
    grid-template-columns: 1fr;
  }
}

.as-stock-preview-col {
  min-width: 0;
}

.as-stock-purchase-box {
  margin-top: 24px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.as-stock-owned-badge {
  color: var(--teal);
  font-weight: 600;
  margin: 0 0 14px;
  font-size: 0.875rem;
}

.as-stock-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 18px;
}

.as-stock-price-block,
.as-stock-credits-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.as-stock-price-label,
.as-stock-credits-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.as-stock-price-num {
  font-family: var(--font-head);
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--gold);
}

.as-stock-credits-num {
  font-family: var(--font-head);
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--teal);
}

.as-stock-credits-login {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.as-stock-credits-login:hover {
  color: var(--text);
}

.as-stock-download-btn--primary,
.as-stock-buy-btn--primary,
.as-stock-personalise-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 22px;
  border: none;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: #052e1f !important;
  text-decoration: none !important;
  cursor: pointer;
  background: linear-gradient(135deg, #6ee7b7 0%, #34d399 42%, #10b981 100%);
  box-shadow:
    0 4px 14px rgba(16, 185, 129, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.35) inset;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.as-stock-download-btn--primary:hover,
.as-stock-buy-btn--primary:hover:not(:disabled),
.as-stock-personalise-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #6ee7b7 0%, #34d399 42%, #10b981 100%);
  box-shadow:
    0 7px 20px rgba(16, 185, 129, 0.42),
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
  color: #052e1f !important;
}

.as-stock-buy-btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.as-stock-download-btn--secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding: 14px 20px;
  border: 1px solid var(--border2);
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text) !important;
  text-decoration: none !important;
  cursor: pointer;
  background: var(--surface2, rgba(255, 255, 255, 0.04));
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.as-stock-download-btn--secondary:hover {
  transform: translateY(-1px);
  border-color: var(--teal);
  background: rgba(16, 185, 129, 0.08);
  color: var(--text) !important;
}

.as-stock-action-or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.as-stock-action-or::before,
.as-stock-action-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border2);
}

.as-stock-download-btn__icon {
  display: flex;
  flex-shrink: 0;
  opacity: 0.9;
}

.as-stock-download-btn__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(5, 46, 31, 0.22);
  border-top-color: #052e1f;
  border-radius: 50%;
  animation: as-stock-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.as-stock-download-btn.is-loading {
  cursor: wait;
  pointer-events: none;
}

.as-stock-download-btn.is-loading .as-stock-download-btn__icon {
  display: none;
}

@keyframes as-stock-spin {
  to { transform: rotate(360deg); }
}

.as-stock-buy-msg.is-error { color: #f87171; }
.as-stock-buy-msg.is-ok { color: var(--teal); }

.as-stock-file-meta {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-dim);
}

.as-stock-file-meta li { margin-bottom: 6px; }

.as-stock-buy-msg {
  margin-top: 12px;
  font-size: 0.875rem;
}

.as-stock-sample-ready-msg {
  margin-top: 0;
  margin-bottom: 10px;
}

.as-stock-download-btn.is-sample-highlight {
  box-shadow: 0 0 0 2px var(--teal);
  animation: aipfx-sample-highlight 1.4s ease-in-out 2;
}

@keyframes aipfx-sample-highlight {
  0%, 100% { box-shadow: 0 0 0 2px var(--teal); }
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 45%, transparent); }
}

.as-stock-buy-credits-link {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  color: var(--gold);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.as-stock-buy-credits-link:hover {
  color: var(--gold2);
}

.at-stock-excerpt-card {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0;
}

.aipfx-tpl-type,
.aipfx-tpl-cost {
  font-size: 0.65rem;
  color: var(--text-dim);
  display: block;
  margin-top: 4px;
}

.aipfx-tpl-type {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Source badges: Template vs Stock library */
.at-source-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.2;
}

.at-source-badge--template {
  background: rgba(212, 168, 67, 0.92);
  color: #1a1408;
}

.at-source-badge--stock {
  background: rgba(56, 217, 192, 0.92);
  color: #062a24;
}

.at-source-badge--inline {
  position: static;
  display: inline-block;
  vertical-align: middle;
  margin: 0 2px;
  font-size: 0.5625rem;
  padding: 3px 8px;
}

body.aipfx-archive .aipfx-site-inner .at-card-media {
  position: relative;
}

body.aipfx-archive .aipfx-site-inner .at-stock-badge {
  display: none;
}

.at-stock-archive-hint {
  max-width: var(--max-w);
  margin: 0 auto 24px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text-dim);
}

.at-maker-section {
  margin-top: 56px;
  padding: 0 var(--px) 64px;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
}

.at-grid-intro {
  max-width: var(--max-w);
  margin: -8px auto 20px;
  padding: 0 var(--px);
  color: var(--text-muted);
  font-size: 0.875rem;
}

@media (max-width: 900px) {
  .as-stock-layout {
    grid-template-columns: 1fr;
  }
  .as-stock-preview-frame {
    max-width: 400px;
  }
}

/* ─────────────────────────────────────────────
   LIGHT THEME — component tweaks (tokens are at top of file)
───────────────────────────────────────────── */
body.aipfx-theme-light .at-hero-noise {
  opacity: 0.35;
}

body.aipfx-theme-light .at-hero-glow--l {
  background: radial-gradient(circle, rgba(184, 134, 11, 0.12) 0%, transparent 70%);
}

body.aipfx-theme-light .at-hero-glow--r {
  background: radial-gradient(circle, rgba(13, 148, 136, 0.1) 0%, transparent 70%);
}

body.aipfx-theme-light .aipfx-site-inner .at-card:hover {
  border-color: rgba(184, 134, 11, 0.45);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
}

body.aipfx-theme-light .at-stock-type-badge,
body.aipfx-theme-light .at-stock-badge {
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--border2);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

body.aipfx-theme-light .at-stock-badge {
  color: var(--gold);
}

body.aipfx-theme-light .at-stock-id code {
  background: var(--bg3);
}

body.aipfx-theme-light .as-stock-preview-frame {
  background: var(--bg2);
  box-shadow: var(--shadow-sm);
}

body.aipfx-theme-light .as-stock-preview-img {
  background: var(--bg3);
}

body.aipfx-theme-light .as-stock-purchase-box {
  background: var(--bg2);
  border-color: var(--border2);
}

body.aipfx-theme-light .aipfx-stock-shop-page .as-stock-description-full.is-collapsed .as-stock-content--full::after {
  background: linear-gradient(to bottom, transparent, var(--bg));
}

body.aipfx-theme-light .at-empty {
  background: var(--surface);
  border-color: var(--border);
}

body.aipfx-theme-light .at-stock-archive-hint {
  background: var(--bg2);
}

body.aipfx-theme-light .as-stock-tax-top {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px var(--px) 0;
  width: 100%;
}

body.aipfx-theme-light .at-hero--stock-tax {
  padding-top: 24px;
}

body.aipfx-theme-light .at-source-badge--stock {
  background: var(--teal-dim);
  color: var(--teal);
  border: 1px solid rgba(13, 148, 136, 0.25);
}

body.aipfx-theme-light .at-source-badge--template {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(184, 134, 11, 0.25);
}

/* Caricature maker single — studio shortcode on light page */
body.aipfx-theme-light.aipfx-single .as-steps-section--compact {
  border-bottom-color: var(--border);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-upload-box {
  background: var(--bg3);
  border-color: var(--border2);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-upload-box:hover {
  border-color: rgba(13, 148, 136, 0.45);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-upload-slot.has-file .aipfx-upload-box {
  border-color: rgba(13, 148, 136, 0.55);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-upload-label {
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--border2);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-upload-placeholder {
  color: var(--text-muted);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-upload-clear {
  background: rgba(255, 255, 255, 0.95);
  color: #334155;
  border: 1px solid var(--border2);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-upload-clear:hover {
  background: #fef2f2;
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.35);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-preview-stage {
  background: var(--bg3);
  border-color: var(--border2);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-field label {
  color: var(--text-dim);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-progress {
  color: var(--text-dim);
  background: var(--bg2);
  border-color: var(--border);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-progress-caption {
  color: var(--text);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-progress-spinner {
  border-color: rgba(13, 148, 136, 0.2);
  border-top-color: var(--teal);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-progress-error {
  color: #b91c1c;
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-btn--ghost {
  border-color: var(--border2);
  color: var(--text-dim);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-btn--ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-btn--generate:not(.aipfx-btn--purchase-cta) {
  background: linear-gradient(135deg, #6ee7b7 0%, #34d399 42%, #10b981 100%);
  color: #052e1f !important;
  box-shadow:
    0 4px 14px rgba(16, 185, 129, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-btn--generate:hover:not([disabled]) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-credits-link--buy,
body.aipfx-theme-light .aipfx-wrap--stock .aipfx-credits-link--buy {
  color: #991b1b !important;
  font-weight: 700;
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-credits-link--buy:hover,
body.aipfx-theme-light .aipfx-wrap--stock .aipfx-credits-link--buy:hover {
  color: #7f1d1d !important;
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-credits-bar,
body.aipfx-theme-light .aipfx-wrap--stock .aipfx-credits-bar {
  background: var(--bg2);
  border-color: var(--border);
  color: var(--text);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-credits-msg,
body.aipfx-theme-light .aipfx-wrap--stock .aipfx-credits-msg {
  color: var(--text);
  font-weight: 500;
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-credits-link,
body.aipfx-theme-light .aipfx-wrap--stock .aipfx-credits-link {
  color: var(--text) !important;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-credits-link:hover,
body.aipfx-theme-light .aipfx-wrap--stock .aipfx-credits-link:hover {
  color: #000 !important;
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-credits-balance strong,
body.aipfx-theme-light .aipfx-wrap--stock .aipfx-credits-balance strong {
  color: var(--text);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-credits-cost,
body.aipfx-theme-light .aipfx-wrap--stock .aipfx-credits-cost {
  color: var(--text-dim);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-banner--busy,
body.aipfx-theme-light .aipfx-wrap--stock .aipfx-banner--busy,
body.aipfx-theme-light .as-tool-section .aipfx-banner--busy {
  background: rgba(185, 28, 28, 0.1);
  border-color: rgba(153, 27, 27, 0.35);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-banner-msg,
body.aipfx-theme-light .aipfx-wrap--stock .aipfx-banner-msg,
body.aipfx-theme-light .as-tool-section .aipfx-banner-msg {
  color: #991b1b !important;
  font-weight: 600;
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-btn--generate.aipfx-btn--purchase-cta,
body.aipfx-theme-light .aipfx-wrap--stock .aipfx-btn--generate.aipfx-btn--purchase-cta {
  background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 42%, #d97706 100%) !important;
  color: #1c1917 !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-btn--nobg {
  border-color: rgba(13, 148, 136, 0.4);
  color: var(--teal);
}

body.aipfx-theme-light .aipfx-wrap--studio .aipfx-btn--nobg:hover {
  background: var(--teal-dim);
}

body.aipfx-theme-light .aipfx-wrap--stock .aipfx-preview-stage {
  background: var(--bg3);
  border-color: var(--border2);
}

.at-stock-grid .at-card-body--title-only {
  gap: 8px;
}

.at-stock-grid .at-card-body--title-only .at-card-title {
  margin: 0;
}

/* ─────────────────────────────────────────────
   STOCK — Justified image grid (archive + related)
───────────────────────────────────────────── */
.at-stock-justified {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  width: 100%;
}

.at-stock-justified.is-laid-out {
  display: flex;
  flex-direction: column;
}

.at-stock-justified-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  overflow: hidden;
}

.at-stock-justified-item {
  flex-shrink: 0;
  margin: 0;
  min-width: 0;
  aspect-ratio: 1;
}

.at-stock-justified.is-laid-out .at-stock-justified-item {
  aspect-ratio: auto;
}

.at-stock-justified-link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg3);
  text-decoration: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.at-stock-justified-link:hover {
  border-color: rgba(212, 168, 67, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.at-stock-justified-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.at-stock-justified-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: var(--bg3);
}

.at-stock-justified .at-stock-type-badge,
.at-stock-justified .at-stock-badge {
  z-index: 1;
}

body.aipfx-theme-light .at-stock-justified-link:hover {
  box-shadow: var(--shadow);
}

.as-stock-related .at-stock-justified {
  margin-top: 4px;
}
