/* ==========================================================================
   PromptUp — Design System & Stylesheet
   "Editorial Neo-Craft" Aesthetic: Warm Paper, Deep Ink, Luminous Highlighter
   ========================================================================== */

/* Self-hosted fonts (SIL Open Font License, see assets/fonts/OFL-*.txt).
   Served from this site so visitors' browsers never contact Google. */
/* Bricolage Grotesque — latin-ext */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('assets/fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Bricolage Grotesque — latin */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('assets/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Instrument Sans Italic — latin-ext */
@font-face {
  font-family: 'Instrument Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/instrument-sans-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Instrument Sans Italic — latin */
@font-face {
  font-family: 'Instrument Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/instrument-sans-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Instrument Sans — latin-ext */
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/instrument-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Instrument Sans — latin */
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/instrument-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* JetBrains Mono — latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* JetBrains Mono — latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Color Palette — Light Mode (Warm Paper Atelier & Design Spec) */
  --bg-paper: #FBFBFD;
  --bg-band: #F5F5F7;
  --bg-card: #FFFFFF;
  --bg-card-subtle: #F5F5F7;
  
  --ink-primary: #1D1D1F;
  --ink-secondary: #424245;
  --ink-muted: #6E6E73; /* was #86868B (3.6:1 on white); this passes WCAG AA for small text */
  
  --border-line: #E8E8ED;
  --border-dark: #1D1D1F;
  --shadow-ink: #000000;
  
  --accent: #0071E3;
  --accent-hover: #0077ED;
  --accent-light: #E8F2FF;
  --on-accent: #FFFFFF;
  --accent-ink: #0066CC;
  --outline: #D2D2D7;
  --outline-strong: #86868B;
  
  --highlighter: #FFE066;
  --highlighter-bg: rgba(255, 224, 102, 0.45);
  --highlighter-border: #E8C838;
  
  --success: #1E7F4F;
  --success-bg: #E8F7EE;
  
  /* Category Tints (Page 15 Design Tokens) */
  --cat-photo: #F7DCC8;
  --cat-photo-accent: #9A4213; /* was #C75B20: 3.24:1 on the tint */
  --cat-image: #D8E2FA;
  --cat-image-accent: #2A52BE; /* was #335ECC: 4.47:1 on the tint */
  --cat-video: #CFEBDD;
  --cat-video-accent: #1C7B4B;
  --cat-text: #F8E1E8;
  --cat-text-accent: #B4275A;

  /* Terminal Surface */
  --term-bg: #1D1D1F;
  --term-surface: #2A2A2D;
  --term-border: #3A3A3C;
  --term-text: #F5F5F7;
  --term-text-dim: #A1A1A6;
  --term-accent: #2997FF;
  --term-code-green: #4ADE80;
  --term-code-cyan: #38BDF8;
  --term-code-yellow: #FDE047;

  /* Typography */
  --font-display: 'Bricolage Grotesque', -apple-system, sans-serif;
  --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Radius & Shadows */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  --shadow-hard: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-hard-lg: 0 6px 30px rgba(0, 0, 0, 0.09);
  --shadow-hard-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.08);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Palette (neutral black and graphite, same layout as light) */
[data-theme="dark"] {
  --bg-paper: #000000;
  --bg-band: #0B0B0C;
  --bg-card: #1C1C1E;
  --bg-card-subtle: #2C2C2E;

  --ink-primary: #F5F5F7;
  --ink-secondary: #C7C7CC;
  --ink-muted: #A1A1A6; /* was #8E8E93 (4.3:1 on #2C2C2E); this passes WCAG AA for small text */

  --border-line: #2C2C2E;
  --border-dark: #F5F5F7;
  --shadow-ink: #000000;
  --outline: #3A3A3C;
  --outline-strong: #8E8E93;

  --accent: #0071E3;
  --accent-hover: #2997FF;
  --accent-light: #0F2A47;
  --accent-ink: #4DA3FF;
  --on-accent: #FFFFFF;

  --highlighter: #FFDE59;
  --highlighter-bg: rgba(255, 222, 89, 0.22);
  --highlighter-border: #FFDE59;

  --success: #5FD394;
  --success-bg: #14261C;

  --cat-photo: #2E2118;
  --cat-photo-accent: #F2A06B;
  --cat-image: #1A2436;
  --cat-image-accent: #86A8F5;
  --cat-video: #15281F;
  --cat-video-accent: #65D9A0;
  --cat-text: #2E1D25;
  --cat-text-accent: #F08BB0;

  --term-bg: #000000;
  --term-surface: #111113;
  --term-border: #2C2C2E;
  --term-text: #F5F5F7;
  --term-text-dim: #98989D;

  --shadow-hard: 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-hard-lg: 0 6px 30px rgba(0, 0, 0, 0.55);
  --shadow-hard-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Dark theme: elements filled with the light ink colour need dark text on them */
[data-theme="dark"] .step-num-badge,
[data-theme="dark"] .filter-tab.active,
[data-theme="dark"] .toast-notification {
  color: var(--bg-paper);
}

[data-theme="dark"] .filter-tab.active .filter-count {
  background-color: rgba(0, 0, 0, 0.14);
  color: var(--bg-paper);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-paper);
  color: var(--ink-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* Subtle tactile grain background */
body::before {
  display: none;
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography Headings */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--ink-primary);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea {
  font-family: inherit;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--outline);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  white-space: nowrap;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--shadow-ink) !important;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-hard);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-hard-lg);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--ink-primary);
  border-color: var(--outline);
  box-shadow: var(--shadow-hard);
}

.btn-secondary:hover {
  background-color: var(--bg-card-subtle);
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-hard-lg);
}

.btn-sm {
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  font-size: 1.05rem;
  padding: 14px 26px;
  border-radius: var(--radius-md);
}

/* Very small phones (320px class): let long buttons wrap, and drop the header CTA
   since the hero's "Build my prompt" button sits right below it */
@media (max-width: 359px) {
  .btn {
    white-space: normal;
    text-align: center;
  }

  .header-actions {
    display: none;
  }
}

.btn-outline-dark {
  background-color: transparent;
  color: var(--ink-primary);
  border: 1px solid var(--outline);
  box-shadow: var(--shadow-hard-sm);
}

.btn-outline-dark:hover {
  background-color: var(--bg-card);
}

/* ==========================================================================
   Top Banner & Header Navigation
   ========================================================================== */
.top-banner {
  background-color: var(--bg-band);
  border-bottom: 1px solid var(--border-line);
  font-size: 0.825rem;
  padding: 8px 0;
  color: var(--ink-secondary);
}

.banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-line);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--accent-ink);
  box-shadow: var(--shadow-hard-sm);
}

.banner-text {
  font-weight: 500;
  display: none;
}

@media (min-width: 768px) {
  .banner-text {
    display: inline;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--outline);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--ink-primary);
  cursor: pointer;
  box-shadow: var(--shadow-hard-sm);
  transition: transform var(--transition-fast);
}

.theme-toggle:hover {
  transform: scale(1.03);
}

[data-theme="light"] .dark-icon { display: none; }
[data-theme="dark"] .light-icon { display: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-paper);
  border-bottom: 1px solid var(--border-line);
  padding: 14px 0;
  backdrop-filter: blur(12px);
  background-color: rgba(251, 251, 253, 0.8);
}

[data-theme="dark"] .site-header {
  background-color: rgba(0, 0, 0, 0.72);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background-color: var(--accent);
  color: #FFFFFF;
  border: 1px solid var(--outline);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-hard-sm);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.nav-menu {
  display: none;
  align-items: center;
  gap: 28px;
}

@media (min-width: 820px) {
  .nav-menu {
    display: flex;
  }
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-secondary);
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--accent-ink);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 48px 0 54px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.1fr 1fr;
    gap: 48px;
  }
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  border: 1px solid var(--outline);
  box-shadow: var(--shadow-hard-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 20px;
}

.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 0 3px rgba(23, 131, 76, 0.2);
}

.hero-title {
  font-size: clamp(2.4rem, 4.2vw, 3.8rem);
  letter-spacing: -0.035em;
  margin-bottom: 18px;
  line-height: 1.08;
}

.highlight-ink {
  position: relative;
  display: inline-block;
  z-index: 1;
}

.highlight-ink::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 4px;
  height: 16px;
  background-color: var(--highlighter);
  z-index: -1;
  transform: rotate(-0.5deg);
  border-radius: 2px;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--ink-secondary);
  line-height: 1.55;
  margin-bottom: 28px;
  max-width: 540px;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-line);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-primary);
  cursor: pointer;
  box-shadow: var(--shadow-hard-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.quick-pill:hover {
  transform: translateY(-2px);
  border-color: var(--outline-strong);
  background-color: var(--accent-light);
}

/* ==========================================================================
   Hero Interactive Before/After Split Slider
   ========================================================================== */
.hero-showcase {
  width: 100%;
}

.comparison-card {
  background-color: var(--bg-card);
  border: 1px solid var(--outline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-hard-lg);
  padding: 16px;
  position: relative;
}

.comparison-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.8rem;
  gap: 8px;
}

.comp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid var(--border-line);
}

.comp-badge span {
  text-transform: uppercase;
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
}

.original-badge {
  background-color: var(--bg-card-subtle);
  color: var(--ink-muted);
}
.original-badge span {
  background-color: #E2DBD0;
  color: #1D1D1F;
}

.promptup-badge {
  background-color: var(--accent-light);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.promptup-badge span {
  background-color: var(--accent);
  color: var(--on-accent);
}

/* Slider Canvas */
.slider-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--outline);
  user-select: none;
  touch-action: none;
  background-color: #111113;
}

.slider-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.img-before-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  z-index: 2;
  border-right: 2px solid #FFFFFF;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
}

.img-before-wrapper .img-before {
  width: calc(100% * (100 / 50)); /* dynamically scaled in JS */
  max-width: none;
}

/* Draggable Handle */
.slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 44px;
  transform: translateX(-50%);
  z-index: 10;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #FFFFFF;
  box-shadow: 0 0 6px rgba(0,0,0,0.6);
}

.handle-circle {
  width: 38px;
  height: 38px;
  background-color: var(--bg-card);
  border: 1px solid var(--outline);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.35), var(--shadow-hard-sm);
  transition: transform var(--transition-fast);
}

.slider-handle:hover .handle-circle,
.slider-handle:active .handle-circle {
  transform: scale(1.1);
  background-color: var(--accent);
  color: var(--on-accent);
}

/* Prompt Pill in Slider */
.slider-prompt-pill {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 5;
  background-color: rgba(20, 20, 22, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  pointer-events: none;
}

.pill-tag {
  display: inline-block;
  background-color: var(--accent);
  color: var(--on-accent);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
}

.pill-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.35;
  color: #F5F5F7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rotating Seal Stamp */
.seal-badge {
  position: absolute;
  bottom: 60px;
  right: 16px;
  width: 72px;
  height: 72px;
  z-index: 4;
  border-radius: 50%;
  background-color: var(--highlighter);
  color: #1D1D1F;
  border: 1px solid var(--outline);
  box-shadow: var(--shadow-hard-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spinSlow 20s linear infinite;
  pointer-events: none;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.seal-svg {
  width: 100%;
  height: 100%;
}

.seal-center {
  position: absolute;
  font-size: 1.2rem;
  font-weight: 800;
}

.slider-caption {
  text-align: center;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 600;
}

/* Tools Bar */
.tools-bar {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.tools-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.tools-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tool-tag {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-line);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Prompt Critique Section (Before/After Reasoning)
   ========================================================================== */
.critique-section {
  padding: 24px 0 48px;
}

.critique-card {
  background-color: var(--bg-card);
  border: 1px solid var(--outline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-hard);
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 860px) {
  .critique-card {
    grid-template-columns: 1fr auto 1.4fr;
    align-items: stretch;
  }
}

.critique-header {
  margin-bottom: 14px;
}

.badge-subtle {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.badge-accent {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-ink);
  margin-bottom: 6px;
}

.weak-bubble {
  background-color: var(--bg-card-subtle);
  border: 1.5px dashed #D5CDC0;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--ink-primary);
}

.bad-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--ink-secondary);
}

.critique-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-ink);
  padding: 12px 0;
}

.divider-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--accent-light);
  border: 1.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.strong-meta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.annotation-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.anno-pill {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.anno-pill strong {
  color: var(--ink-primary);
}

.anno-check {
  color: var(--success);
  font-weight: 800;
  margin-right: 4px;
}

/* ==========================================================================
   Interactive Studio Builder Section
   ========================================================================== */
.builder-section {
  background-color: var(--bg-band);
  border-top: 1px solid var(--border-line);
  border-bottom: 1px solid var(--border-line);
  padding: 56px 0 72px;
}

.section-title-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 36px;
}

@media (min-width: 768px) {
  .section-title-area {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.section-badge {
  font-size: 0.725rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-ink);
  display: inline-block;
  margin-bottom: 4px;
}

.section-heading {
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  letter-spacing: -0.03em;
}

.section-subtext {
  font-size: 1rem;
  color: var(--ink-secondary);
  max-width: 440px;
}

.section-subtext.centered {
  margin: 0 auto;
  text-align: center;
}

.text-center {
  text-align: center;
  align-items: center;
}

/* Centred section headers stay stacked on wide screens (the row layout above is for left-aligned headers) */
.section-title-area.text-center {
  flex-direction: column;
  justify-content: flex-start;
}

/* 2-Column Split Studio Grid */
.builder-studio-grid {
  display: grid;
  /* minmax(0, …) stops a wide child (e.g. a nowrap button row) from stretching the column past the screen */
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

@media (min-width: 980px) {
  .builder-studio-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
}

/* Step Cards */
.studio-card {
  background-color: var(--bg-card);
  border: 1px solid var(--outline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-hard);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
}

.step-num-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--border-dark);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.step-header {
  padding-left: 42px;
  margin-bottom: 20px;
}

.step-title {
  font-size: 1.35rem;
}

/* Category Selection Grid */
.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 540px) {
  .category-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.cat-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background-color: var(--bg-card-subtle);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.cat-card:hover {
  transform: translateY(-2px);
  border-color: var(--outline-strong);
  box-shadow: var(--shadow-hard-sm);
}

.cat-card.active {
  background-color: var(--bg-card);
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: var(--shadow-hard);
}

.cat-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}

.cat-photo { background-color: var(--cat-photo); color: var(--cat-photo-accent); }
.cat-image { background-color: var(--cat-image); color: var(--cat-image-accent); }
.cat-video { background-color: var(--cat-video); color: var(--cat-video-accent); }
.cat-text { background-color: var(--cat-text); color: var(--cat-text-accent); }

.cat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.cat-desc {
  font-size: 0.775rem;
  color: var(--ink-muted);
  line-height: 1.35;
}

.cat-radio-indicator {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-card.active .cat-radio-indicator {
  border-color: var(--accent);
  background-color: var(--accent);
}

.cat-card.active .cat-radio-indicator::after {
  content: "✓";
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 800;
}

/* Step 2 Inputs & Options */
.input-group-main {
  margin-bottom: 24px;
}

.input-main-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 8px;
}

.intent-input-wrapper {
  position: relative;
}

.intent-textarea {
  width: 100%;
  padding: 12px 36px 12px 14px;
  border: 1px solid var(--outline);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background-color: var(--bg-card);
  color: var(--ink-primary);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
  resize: vertical;
  min-height: 64px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.intent-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.intent-clear-btn {
  font-family: inherit;
  line-height: 1;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--bg-card-subtle);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  border: 1px solid var(--border-line);
}

/* Live Auto-Detection Alert */
.autodetect-banner {
  margin-top: 10px;
  padding: 8px 12px;
  background-color: var(--highlighter-bg);
  border: 1px solid var(--highlighter-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ink-primary);
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.autodetect-icon {
  font-size: 1rem;
}

/* Form Group & Chip Matrix */
.form-group-block {
  margin-bottom: 22px;
}

.group-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.group-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.group-hint {
  font-size: 0.775rem;
  color: var(--ink-muted);
}

.ft-text-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--outline);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background-color: var(--bg-card);
  color: var(--ink-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.ft-text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-line);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-hard-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.chip-btn:hover {
  border-color: var(--outline-strong);
  transform: translateY(-1px);
}

.chip-btn.active {
  background-color: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.chip-btn.active::before {
  content: "✓";
  font-size: 0.75rem;
}

.chip-btn.auto-picked {
  background-color: var(--highlighter-bg);
  border-color: var(--highlighter-border);
  color: var(--ink-primary);
}

/* Fine-tune Collapsible Accordion */
.finetune-accordion {
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 12px;
}

.finetune-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--bg-card-subtle);
  border: none;
  cursor: pointer;
  text-align: left;
}

.ft-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ft-icon {
  font-size: 1.1rem;
}

.ft-labels {
  display: flex;
  flex-direction: column;
}

.ft-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.ft-summary {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.ft-arrow {
  font-size: 0.75rem;
  color: var(--ink-muted);
  transition: transform var(--transition-fast);
}

.finetune-accordion.open .ft-arrow {
  transform: rotate(180deg);
}

.finetune-body {
  padding: 16px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-line);
}

/* ==========================================================================
   Step 3: Sticky Pro Prompt Terminal (Output Console)
   ========================================================================== */
.sticky-output-container {
  position: sticky;
  top: 90px;
}

.pro-terminal-card {
  background-color: var(--term-bg);
  border: 1px solid var(--outline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-hard-lg);
  overflow: hidden;
  color: var(--term-text);
}

.terminal-header {
  background-color: var(--term-surface);
  border-bottom: 1px solid var(--term-border);
  padding: 16px 20px;
}

.terminal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.terminal-left-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.term-step-indicator {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--highlighter);
  color: #1D1D1F;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.term-heading {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
}

.term-right-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-tool {
  background-color: rgba(41, 151, 255, 0.18);
  border: 1px solid var(--term-accent);
  color: #9CCBFF;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-count {
  background-color: rgba(255, 255, 255, 0.1);
  color: #C7C7CC; /* was var(--term-text-dim): 4.07:1 in the light theme */
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Modules Bar */
.modules-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.modules-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--term-text-dim);
}

.modules-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mod-chip {
  font-size: 0.725rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.07);
  color: var(--term-text-dim);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.mod-chip.active {
  background-color: rgba(74, 222, 128, 0.15);
  color: #4ADE80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

/* Terminal Live Visual Target Reference Banner */
.terminal-visual-banner {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  border-bottom: 1px solid var(--term-border);
  background-color: #0A0A0B;
}

.term-vis-split {
  width: 100%;
  height: 100%;
  position: relative;
}

.term-vis-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.term-vis-badge {
  position: absolute;
  bottom: 8px;
  left: 10px;
  background-color: rgba(20, 20, 22, 0.88);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Code View Area */
.terminal-content {
  padding: 20px;
  max-height: 380px;
  overflow-y: auto;
  background-color: var(--term-bg);
}

.prompt-code-view {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--term-text);
}

/* Highlighted bracketed variables inside the prompt */
.prompt-var {
  background-color: var(--highlighter);
  color: #1D1D1F;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  display: inline-block;
}

.prompt-var:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px var(--highlighter);
}

/* Terminal Actions */
.terminal-actions-bar {
  padding: 14px 20px;
  background-color: var(--term-surface);
  border-top: 1px solid var(--term-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.btn-copy {
  flex: 1;
  background-color: var(--accent);
  color: #FFFFFF;
  border: 1.5px solid #000000;
  box-shadow: none;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-md);
}

.btn-copy:hover {
  background-color: #FFEA85;
}

.btn-copy.copied {
  background-color: #22C55E !important;
  color: #FFFFFF !important;
}

.btn-fill-blanks {
  background-color: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.btn-fill-blanks:hover {
  background-color: rgba(255, 255, 255, 0.18);
}

.btn-icon-reset {
  background-color: transparent;
  color: var(--term-text-dim);
  border: 1px solid var(--term-border);
  width: 42px;
  height: 42px;
  /* override .btn padding, which otherwise uses up the whole 42px and hides the icon */
  padding: 0;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.btn-icon-reset:hover {
  color: #FFFFFF;
  border-color: #FFFFFF;
}

/* Quick launch AI links */
.terminal-launch-row {
  padding: 8px 20px 12px;
  background-color: var(--term-surface);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.launch-label {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--term-text-dim);
}

.launch-chip {
  background-color: transparent;
  color: #9CCBFF;
  border: 1px solid rgba(41, 151, 255, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.launch-chip:hover {
  background-color: var(--term-accent);
  color: #FFFFFF;
}

/* Pro-Tip Box */
.pro-tip-box {
  padding: 14px 20px;
  background-color: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8rem;
  color: #E8E8ED;
  line-height: 1.45;
}

.tip-icon {
  font-size: 1rem;
}

/* ==========================================================================
   How It Works Section
   ========================================================================== */
.how-it-works-section {
  padding: 64px 0 72px;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 40px;
}

@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.workflow-card {
  background-color: var(--bg-card);
  border: 1px solid var(--outline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.workflow-visual {
  height: 140px;
  background-color: var(--bg-card-subtle);
  border-bottom: 1.5px solid var(--border-line);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.mini-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.mini-cat {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  border: 1px solid var(--border-line);
  color: var(--ink-secondary);
}

.mini-cat.active {
  background-color: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.mini-input-box {
  background-color: var(--bg-card);
  border: 1px solid var(--outline);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.775rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.mini-chip-row {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.mini-chip {
  font-size: 0.675rem;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-line);
}

.mini-chip.active {
  background-color: var(--accent-light);
  color: var(--accent-ink);
  font-weight: 700;
}

.mini-badge {
  font-size: 0.675rem;
  font-weight: 700;
  color: #1D1D1F; /* always sits on the yellow highlighter, so it must stay dark in both themes */
  background-color: var(--highlighter);
  padding: 1px 6px;
  border-radius: 3px;
}

.mini-prompt-box {
  background-color: var(--term-bg);
  color: var(--term-text);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.675rem;
  line-height: 1.35;
  width: 90%;
  margin-bottom: 6px;
}

.mini-line {
  display: block;
}

.mini-btn-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.mini-copy-btn {
  background-color: var(--accent);
  color: #FFFFFF;
  font-size: 0.675rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #000;
}

.mini-paste-tag {
  font-size: 0.675rem;
  color: var(--ink-muted);
}

.workflow-content {
  padding: 20px;
}

.step-index {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-ink);
  display: block;
  margin-bottom: 4px;
}

.workflow-title {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.workflow-desc {
  font-size: 0.875rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

/* ==========================================================================
   Prompt Library Section
   ========================================================================== */
.library-section {
  padding: 64px 0 80px;
  border-top: 1px solid var(--border-line);
}

.library-header-area {
  margin-bottom: 28px;
}

.library-toolbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .library-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.library-search-input {
  width: 100%;
  padding: 12px 38px 12px 42px;
  border: 1px solid var(--outline);
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  background-color: var(--bg-card);
  color: var(--ink-primary);
  box-shadow: var(--shadow-hard-sm);
  outline: none;
  transition: box-shadow var(--transition-fast);
}

.library-search-input:focus {
  box-shadow: var(--shadow-hard);
  border-color: var(--accent);
}

.search-clear-btn {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 0.85rem;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-line);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-hard-sm);
  transition: all var(--transition-fast);
}

.filter-tab:hover {
  border-color: var(--outline-strong);
  transform: translateY(-1px);
}

.filter-tab.active {
  background-color: var(--border-dark);
  color: #FFFFFF;
  border-color: var(--border-dark);
}

.filter-count {
  font-size: 0.725rem;
  background-color: rgba(0, 0, 0, 0.08);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.filter-tab.active .filter-count {
  background-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.results-feedback-bar {
  margin-bottom: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
}

/* Cards Grid */
.library-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

@media (min-width: 680px) {
  .library-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1040px) {
  .library-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.lib-card {
  background-color: var(--bg-card);
  border: 1px solid var(--outline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-hard);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.lib-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hard-lg);
}

/* Photo & Comparison Example Visual Header */
.lib-card-visual {
  position: relative;
  width: 100%;
  height: 190px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--outline);
  background-color: var(--term-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.lib-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.lib-card:hover .lib-card-img {
  transform: scale(1.04);
}

/* Visual Badge (Before/After or Result Tag) */
.lib-visual-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  max-width: calc(100% - 96px);
  min-width: 0;
  background-color: rgba(29, 29, 31, 0.85);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.lib-visual-badge > span:not(.comp-tag) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.lib-visual-badge .comp-tag {
  display: none; /* the text already says BEFORE vs AFTER, and the room is needed for it */
}

.lib-visual-badge.badge-comp {
  background-color: var(--accent);
  color: var(--on-accent);
  border-color: rgba(255, 255, 255, 0.4);
}

.lib-visual-badge span.comp-tag {
  background-color: var(--highlighter);
  color: #1D1D1F;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 800;
}

/* Disclosure: example images are AI-generated */
.lib-ai-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background-color: rgba(29, 29, 31, 0.85);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.ai-example-note {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
  text-align: center;
}

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

/* Quick Zoom Overlay Tag */
.lib-zoom-tag {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: rgba(29, 29, 31, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-size: 0.725rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  transition: background-color var(--transition-fast);
}

.lib-card-visual:hover .lib-zoom-tag {
  background-color: var(--accent);
}

/* Stylized Visual Mockup Placeholder for Text/Code */
.lib-visual-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  position: relative;
}

.lib-visual-placeholder.theme-text {
  background: linear-gradient(135deg, #2A2A2D 0%, #111113 100%);
  color: #F5F5F7;
}

.lib-visual-placeholder.theme-video {
  background: linear-gradient(135deg, #132E22 0%, #0D1B15 100%);
  color: #F5F5F7;
}

.lib-visual-placeholder.theme-image {
  background: linear-gradient(135deg, #1B294D 0%, #0F172E 100%);
  color: #F5F5F7;
}

.lib-visual-placeholder.theme-photo {
  background: linear-gradient(135deg, #382115 0%, #1E120B 100%);
  color: #F5F5F7;
}

.lib-placeholder-icon {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.lib-placeholder-text {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  line-height: 1.4;
  opacity: 0.9;
  max-width: 240px;
}

.lib-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.lib-category-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.1);
}

.lib-card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lib-trend-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background-color: #FFE8DD;
  color: #B4400F;
  border: 1px solid rgba(180, 64, 15, 0.25);
}

.library-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.lib-blanks-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.lib-blanks-tag.has-blanks {
  background-color: var(--highlighter-bg);
  color: #825800; /* was #9A6B00: 4.14:1 on the yellow tint */
  border: 1px solid var(--highlighter-border);
}

.lib-blanks-tag.ready {
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(23, 131, 76, 0.2);
}

.lib-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.25;
}

.lib-tools-compat {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.lib-prompt-snippet {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-secondary);
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  flex: 1;
  position: relative;
  white-space: pre-wrap;
}

.lib-var-highlight {
  background-color: var(--highlighter);
  color: #1D1D1F;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}

.lib-tip-note {
  font-size: 0.75rem;
  color: var(--ink-muted);
  line-height: 1.4;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.lib-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.lib-copy-btn {
  flex: 1;
  background-color: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--outline);
  box-shadow: var(--shadow-hard-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.lib-copy-btn:hover {
  background-color: var(--accent-hover);
}

.lib-customize-btn {
  background-color: var(--bg-card);
  color: var(--ink-primary);
  border: 1px solid var(--outline);
  box-shadow: var(--shadow-hard-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
}

.lib-customize-btn:hover {
  background-color: var(--bg-card-subtle);
}

/* Empty State */
.empty-state-card {
  text-align: center;
  padding: 48px 24px;
  background-color: var(--bg-card);
  border: 2px dashed var(--border-line);
  border-radius: var(--radius-xl);
  margin-top: 24px;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.empty-title {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.empty-desc {
  color: var(--ink-muted);
  margin-bottom: 20px;
}

/* ==========================================================================
   Variable Substitution Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(20, 20, 22, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background-color: var(--bg-card);
  border: 1px solid var(--outline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-hard-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog.modal-dialog-lg {
  max-width: 780px;
}

.modal-image-showcase {
  width: 100%;
  max-height: 360px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--outline);
  margin-bottom: 18px;
  background-color: #0A0A0B;
  box-shadow: var(--shadow-hard-sm);
}

.modal-hero-photo {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
}

.modal-prompt-copy-block {
  background-color: var(--term-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--outline);
  padding: 16px;
  color: var(--term-text);
  box-shadow: var(--shadow-hard-sm);
}

.modal-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.725rem;
}

.prompt-header-label {
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--highlighter);
}

.prompt-header-tip {
  color: var(--term-text-dim);
}

.modal-prompt-view {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 6px;
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1.5px solid var(--border-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-ink);
}

.modal-title {
  font-size: 1.25rem;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-desc {
  font-size: 0.875rem;
  color: var(--ink-secondary);
  margin-bottom: 18px;
}

.modal-field {
  margin-bottom: 14px;
}

.modal-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink-primary);
}

.modal-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--outline);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background-color: var(--bg-card-subtle);
  color: var(--ink-primary);
  outline: none;
}

.modal-field input:focus {
  border-color: var(--accent);
  background-color: var(--bg-card);
}

.modal-preview-box {
  margin-top: 18px;
  background-color: var(--term-bg);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--term-text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  max-height: 180px;
  overflow-y: auto;
}

.preview-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--term-text-dim);
  margin-bottom: 6px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1.5px solid var(--border-line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background-color: var(--bg-card-subtle);
}

/* ==========================================================================
   Photo Comparison Lightbox Modal Styling
   ========================================================================== */
.modal-dialog-lg {
  max-width: 820px;
  width: 94%;
}

.modal-image-showcase {
  width: 100%;
  max-height: 420px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--outline);
  background-color: #0A0A0B;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.modal-hero-photo {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.modal-prompt-copy-block {
  background-color: var(--term-bg);
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  padding: 18px;
  color: var(--term-text);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.modal-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--term-border);
}

.prompt-header-label {
  font-size: 0.725rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--highlighter);
}

.prompt-header-tip {
  font-size: 0.75rem;
  color: var(--term-text-dim);
}

.modal-prompt-view {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.65;
  white-space: pre-wrap;
  color: #F5F5F7;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 6px;
  user-select: all;
}


/* ==========================================================================
   Privacy Guarantee Card & Footer
   ========================================================================== */
.privacy-callout-section {
  padding: 32px 0 64px;
}

.privacy-card {
  background-color: var(--bg-card);
  border: 1px solid var(--outline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-hard);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .privacy-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.privacy-icon-badge {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
  background-color: var(--accent-light);
  color: var(--accent-ink);
  border: 1px solid var(--outline);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-hard-sm);
}

.privacy-content {
  flex: 1;
}

.privacy-heading {
  font-size: 1.35rem;
  margin-bottom: 6px;
}

.privacy-text {
  font-size: 0.95rem;
  color: var(--ink-secondary);
  line-height: 1.5;
  max-width: 680px;
}

.site-footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-line);
  padding: 36px 0;
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink-primary);
}

.footer-links {
  display: flex;
  gap: 20px;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--accent-ink);
}

.footer-subtext {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* ==========================================================================
   Toast Notification & Mobile Bottom Bar
   ========================================================================== */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--border-dark);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  background-color: var(--success);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* Mobile Floating Dock */
.mobile-floating-bar {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background-color: var(--term-bg);
  border: 1px solid var(--outline);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  z-index: 99;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 979px) {
  .mobile-floating-bar.active {
    display: flex;
  }
}

.mobile-float-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.float-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
}

.float-text {
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Keyboard focus ring for buttons, links and pictures that act as buttons */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[role="slider"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Dark mode: the amber 'blanks' badge was too dim */
[data-theme="dark"] .lib-blanks-tag.has-blanks {
  color: #FFD866;
}

/* Hero buttons stack at the same width on phones */
@media (max-width: 539px) {
  .hero-cta-group .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.lib-load-error {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
  color: var(--ink-secondary, inherit);
}
