/**
 * AI Image Generator v4 — Modern design with CSS Custom Properties + 3 Themes.
 * Light (default), Dark, Glass. Two-column layout, gradient bg, card depth,
 * styled FAQ accordion, numbered steps, enhanced prompt chips.
 */

/* ══════════════════════════════════════════════════
   THEME: LIGHT (default)
   ══════════════════════════════════════════════════ */
.saa-ig {
    --ig-page-bg: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 40%, #ecfeff 70%, #f0fdf4 100%);
    --ig-bg: #ffffff;
    --ig-card-bg: #ffffff;
    --ig-card-border: #e2e4ea;
    --ig-card-shadow: 0 1px 3px rgba(0,0,0,.04), 0 6px 24px rgba(37,99,235,.06);
    --ig-sidebar-bg: #ffffff;
    --ig-sidebar-border: #e2e4ea;
    --ig-sidebar-shadow: 0 1px 3px rgba(0,0,0,.03), 0 4px 16px rgba(37,99,235,.04);
    --ig-text: #334155;
    --ig-text-muted: #64748b;
    --ig-heading: #1e293b;
    --ig-label: #475569;
    --ig-input-bg: #f8f9fb;
    --ig-input-border: #d1d5db;
    --ig-input-text: #1e293b;
    --ig-input-placeholder: #94a3b8;
    --ig-pill-bg: #f8f9fb;
    --ig-pill-border: #e2e4ea;
    --ig-pill-text: #475569;
    --ig-pill-hover-border: #2563eb;
    --ig-pill-hover-text: #1d4ed8;
    --ig-pill-hover-bg: rgba(37,99,235,.04);
    --ig-pill-active-bg: rgba(37,99,235,.1);
    --ig-pill-active-border: #2563eb;
    --ig-pill-active-text: #1d4ed8;
    --ig-accent: #2563eb;
    --ig-accent-hover: #1e40af;
    --ig-btn-gradient: linear-gradient(135deg, #2563eb, #0ea5e9);
    --ig-btn-shadow: 0 4px 14px rgba(37,99,235,.35);
    --ig-btn-text: #ffffff;
    --ig-error-bg: rgba(239,68,68,.06);
    --ig-error-border: rgba(239,68,68,.2);
    --ig-error-text: #dc2626;
    --ig-result-bg: #f1f5f9;
    --ig-result-border: #e2e4ea;
    --ig-crumb-text: #64748b;
    --ig-crumb-link: #2563eb;
    --ig-seo-h2: var(--ig-seo-heading-color, #1e293b);
    --ig-seo-h3: var(--ig-seo-faq-color, #334155);
    --ig-seo-text: var(--ig-seo-text-color, #475569);
    --ig-seo-link: var(--ig-seo-link-color, #2563eb);
    --ig-faq-border: #e2e4ea;
    --ig-faq-bg: #f8f9fb;
    --ig-faq-hover-bg: #f1f5f9;
    --ig-details-border: #e2e4ea;
    --ig-tool-btn-bg: #f1f5f9;
    --ig-spinner-track: rgba(37,99,235,.15);
    --ig-spinner-head: #2563eb;
    --ig-example-bg: rgba(37,99,235,.04);
    --ig-example-border: rgba(37,99,235,.15);
    --ig-example-text: #1d4ed8;
    --ig-example-hover-bg: rgba(37,99,235,.1);
    --ig-remaining-bg: #f0fdf4;
    --ig-remaining-border: #bbf7d0;
    --ig-remaining-text: #166534;
    --ig-step-bg: linear-gradient(135deg, #2563eb, #0ea5e9);
    --ig-step-text: #ffffff;
}

/* ══════════════════════════════════════════════════
   THEME: DARK
   ══════════════════════════════════════════════════ */
.saa-ig--dark {
    --ig-page-bg: linear-gradient(135deg, #1a1b2e 0%, #1e1d35 40%, #182030 70%, #1a1b2e 100%);
    --ig-bg: #1a1b2e;
    --ig-card-bg: #222340;
    --ig-card-border: #2e3050;
    --ig-card-shadow: 0 1px 3px rgba(0,0,0,.15), 0 8px 32px rgba(0,0,0,.2);
    --ig-sidebar-bg: #222340;
    --ig-sidebar-border: #2e3050;
    --ig-sidebar-shadow: 0 1px 3px rgba(0,0,0,.1), 0 4px 16px rgba(0,0,0,.18);
    --ig-text: #d4d4e0;
    --ig-text-muted: #a0a0b8;
    --ig-heading: #f0f0f5;
    --ig-label: #a0a0b8;
    --ig-input-bg: #1e1f38;
    --ig-input-border: #2e3050;
    --ig-input-text: #e8e8ec;
    --ig-input-placeholder: #606078;
    --ig-pill-bg: #1e1f38;
    --ig-pill-border: #2e3050;
    --ig-pill-text: #b8b8cc;
    --ig-pill-hover-border: #3b82f6;
    --ig-pill-hover-text: #e4e4f2;
    --ig-pill-hover-bg: rgba(59,130,246,.08);
    --ig-pill-active-bg: rgba(59,130,246,.18);
    --ig-pill-active-border: #3b82f6;
    --ig-pill-active-text: #93c5fd;
    --ig-accent: #60a5fa;
    --ig-accent-hover: #3b82f6;
    --ig-btn-gradient: linear-gradient(135deg, #3b82f6, #0ea5e9);
    --ig-btn-shadow: 0 4px 14px rgba(59,130,246,.3);
    --ig-btn-text: #ffffff;
    --ig-error-bg: rgba(239,68,68,.1);
    --ig-error-border: rgba(239,68,68,.25);
    --ig-error-text: #fca5a5;
    --ig-result-bg: #1c1d35;
    --ig-result-border: #2e3050;
    --ig-crumb-text: #8585a0;
    --ig-crumb-link: #60a5fa;
    --ig-seo-h2: var(--ig-seo-heading-color, #e4e4f2);
    --ig-seo-h3: var(--ig-seo-faq-color, #d4d4e0);
    --ig-seo-text: var(--ig-seo-text-color, #a0a0b8);
    --ig-seo-link: var(--ig-seo-link-color, #60a5fa);
    --ig-faq-border: #2a2c48;
    --ig-faq-bg: #1e1f38;
    --ig-faq-hover-bg: #282948;
    --ig-details-border: #2a2c48;
    --ig-tool-btn-bg: #282948;
    --ig-spinner-track: rgba(59,130,246,.2);
    --ig-spinner-head: #3b82f6;
    --ig-example-bg: rgba(59,130,246,.1);
    --ig-example-border: rgba(59,130,246,.22);
    --ig-example-text: #93c5fd;
    --ig-example-hover-bg: rgba(59,130,246,.18);
    --ig-remaining-bg: rgba(34,197,94,.1);
    --ig-remaining-border: rgba(34,197,94,.25);
    --ig-remaining-text: #86efac;
    --ig-step-bg: linear-gradient(135deg, #3b82f6, #0ea5e9);
    --ig-step-text: #ffffff;
}

/* ══════════════════════════════════════════════════
   THEME: GLASS
   ══════════════════════════════════════════════════ */
.saa-ig--glass {
    --ig-page-bg: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 40%, #cffafe 70%, #ecfdf5 100%);
    --ig-bg: transparent;
    --ig-card-bg: rgba(255,255,255,.55);
    --ig-card-border: rgba(255,255,255,.5);
    --ig-card-shadow: 0 4px 24px rgba(0,0,0,.06), inset 0 1px 0 rgba(255,255,255,.6);
    --ig-sidebar-bg: rgba(255,255,255,.45);
    --ig-sidebar-border: rgba(255,255,255,.4);
    --ig-sidebar-shadow: 0 2px 16px rgba(0,0,0,.04);
    --ig-text: #334155;
    --ig-text-muted: #64748b;
    --ig-heading: #1e293b;
    --ig-label: #475569;
    --ig-input-bg: rgba(255,255,255,.7);
    --ig-input-border: rgba(148,163,184,.4);
    --ig-input-text: #1e293b;
    --ig-input-placeholder: #94a3b8;
    --ig-pill-bg: rgba(255,255,255,.5);
    --ig-pill-border: rgba(148,163,184,.35);
    --ig-pill-text: #475569;
    --ig-pill-hover-border: #2563eb;
    --ig-pill-hover-text: #1d4ed8;
    --ig-pill-hover-bg: rgba(37,99,235,.06);
    --ig-pill-active-bg: rgba(37,99,235,.12);
    --ig-pill-active-border: #2563eb;
    --ig-pill-active-text: #1d4ed8;
    --ig-accent: #2563eb;
    --ig-accent-hover: #1e40af;
    --ig-btn-gradient: linear-gradient(135deg, #2563eb, #0ea5e9);
    --ig-btn-shadow: 0 4px 14px rgba(37,99,235,.3);
    --ig-btn-text: #ffffff;
    --ig-error-bg: rgba(239,68,68,.08);
    --ig-error-border: rgba(239,68,68,.2);
    --ig-error-text: #dc2626;
    --ig-result-bg: rgba(255,255,255,.5);
    --ig-result-border: rgba(148,163,184,.3);
    --ig-crumb-text: #64748b;
    --ig-crumb-link: #2563eb;
    --ig-seo-h2: var(--ig-seo-heading-color, #1e293b);
    --ig-seo-h3: var(--ig-seo-faq-color, #334155);
    --ig-seo-text: var(--ig-seo-text-color, #475569);
    --ig-seo-link: var(--ig-seo-link-color, #2563eb);
    --ig-faq-border: rgba(148,163,184,.25);
    --ig-faq-bg: rgba(255,255,255,.4);
    --ig-faq-hover-bg: rgba(255,255,255,.6);
    --ig-details-border: rgba(148,163,184,.25);
    --ig-tool-btn-bg: rgba(255,255,255,.5);
    --ig-spinner-track: rgba(37,99,235,.15);
    --ig-spinner-head: #2563eb;
    --ig-example-bg: rgba(37,99,235,.06);
    --ig-example-border: rgba(37,99,235,.18);
    --ig-example-text: #1d4ed8;
    --ig-example-hover-bg: rgba(37,99,235,.12);
    --ig-remaining-bg: rgba(240,253,244,.7);
    --ig-remaining-border: #bbf7d0;
    --ig-remaining-text: #166534;
    --ig-step-bg: linear-gradient(135deg, #2563eb, #0ea5e9);
    --ig-step-text: #ffffff;
}
.saa-ig--glass .saa-ig__gen,
.saa-ig--glass .saa-ig__sidebar-card {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.saa-ig--glass .saa-ig__result {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ══════════════════════════════════════════════════
   BASE LAYOUT
   ══════════════════════════════════════════════════ */
.saa-ig {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 32px 40px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ig-text);
    line-height: 1.6;
    background: var(--ig-page-bg);
    min-height: 80vh;
    box-sizing: border-box;
}
.saa-ig__inner {
    max-width: 900px;
    margin: 0 auto;
}
.saa-ig--two-col .saa-ig__inner { max-width: 1200px; }
.saa-ig *, .saa-ig *::before, .saa-ig *::after { box-sizing: border-box; }
.saa-ig p, .saa-ig li, .saa-ig span, .saa-ig div { color: inherit; }
.saa-ig h1, .saa-ig h2, .saa-ig h3 { color: var(--ig-heading); }
.saa-ig a { color: var(--ig-seo-link); }
.saa-ig .saa-ig__seo h2 { color: var(--ig-seo-h2); }
.saa-ig .saa-ig__seo p,
.saa-ig .saa-ig__seo li { color: var(--ig-seo-text); }
.saa-ig .saa-ig__faq-answer,
.saa-ig .saa-ig__faq-answer p { color: var(--ig-seo-text); }
.saa-ig .saa-ig__faq-item summary { color: var(--ig-seo-h3); }
.saa-ig .saa-ig__sidebar-card p { color: var(--ig-text); }

/* Two-column main grid */
.saa-ig__main { display: block; }
.saa-ig--two-col .saa-ig__main {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    align-items: start;
}
.saa-ig__primary { min-width: 0; }

/* Content grid below */
.saa-ig__content-grid { display: block; margin-top: 40px; }
.saa-ig--two-col .saa-ig__content-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    align-items: start;
}
.saa-ig__content-main { min-width: 0; }

/* ══════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════ */
.saa-ig__hero { text-align: center; margin-bottom: 36px; padding: 8px 0; }
.saa-ig__crumbs { font-size: 13px; color: var(--ig-crumb-text); margin-bottom: 14px; }
.saa-ig__crumbs a { color: var(--ig-crumb-link); text-decoration: none; }
.saa-ig__crumbs a:hover { text-decoration: underline; }
.saa-ig__hero h1 {
    font-size: var(--ig-hero-size, 2.2rem);
    font-weight: 800;
    color: var(--ig-heading);
    margin: 0 0 10px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.saa-ig--dark .saa-ig__hero h1 {
    background: linear-gradient(135deg, #f0f0f5 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
}
.saa-ig__hero p { font-size: 16px; color: var(--ig-text-muted); margin: 0; max-width: 560px; margin-inline: auto; }

/* ══════════════════════════════════════════════════
   GENERATOR CARD — depth + accent top border
   ══════════════════════════════════════════════════ */
.saa-ig__gen {
    background: var(--ig-card-bg);
    border: 1px solid var(--ig-card-border);
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 0;
    position: relative;
    box-shadow: var(--ig-card-shadow);
    border-top: 3px solid var(--ig-accent);
}

/* Labels */
.saa-ig__label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--ig-label);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}

/* Sections */
.saa-ig__section { margin-bottom: 22px; }
.saa-ig__row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.saa-ig__field { flex: 1; min-width: 120px; }

/* ══════════════════════════════════════════════════
   STYLE PILLS — colored bg
   ══════════════════════════════════════════════════ */
.saa-ig__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.saa-ig__pill {
    padding: 7px 14px;
    border: 1px solid var(--ig-pill-border);
    border-radius: 20px;
    background: var(--ig-pill-bg);
    color: var(--ig-pill-text);
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.saa-ig__pill:hover { border-color: var(--ig-pill-hover-border); color: var(--ig-pill-hover-text); background: var(--ig-pill-hover-bg); }
.saa-ig__pill--active {
    background: var(--ig-pill-active-bg);
    border-color: var(--ig-pill-active-border);
    color: var(--ig-pill-active-text);
    font-weight: 600;
}

/* ══════════════════════════════════════════════════
   PROMPT AREA
   ══════════════════════════════════════════════════ */
.saa-ig__prompt-wrap { position: relative; }
.saa-ig__prompt-wrap textarea {
    width: 100%;
    background: var(--ig-input-bg);
    border: 1px solid var(--ig-input-border);
    border-radius: 12px;
    padding: 14px 14px 44px;
    color: var(--ig-input-text);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.saa-ig__prompt-wrap textarea:focus { border-color: var(--ig-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.saa-ig__prompt-wrap textarea::placeholder { color: var(--ig-input-placeholder); }
.saa-ig__prompt-tools {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    gap: 6px;
}
.saa-ig__tool-btn {
    padding: 4px 12px;
    border: 1px solid var(--ig-pill-border);
    border-radius: 14px;
    background: var(--ig-tool-btn-bg);
    color: var(--ig-text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
}
.saa-ig__tool-btn:hover { border-color: var(--ig-accent); color: var(--ig-accent); background: var(--ig-pill-active-bg); }
.saa-ig__tool-btn:disabled { opacity: .5; cursor: wait; }
.saa-ig__prompt-status {
    font-size: 12px;
    color: var(--ig-accent);
    margin-top: 6px;
    padding: 0 4px;
}

/* Negative Prompt Collapsible */
.saa-ig__details {
    margin-bottom: 22px;
    border: 1px solid var(--ig-details-border);
    border-radius: 10px;
}
.saa-ig__details summary {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--ig-text-muted);
    cursor: pointer;
    user-select: none;
    list-style: none;
}
.saa-ig__details summary::before { content: '▸ '; font-size: 11px; }
.saa-ig__details[open] summary::before { content: '▾ '; }
.saa-ig__details-body { padding: 0 14px 12px; }
.saa-ig__details-body textarea {
    width: 100%;
    background: var(--ig-input-bg);
    border: 1px solid var(--ig-input-border);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--ig-input-text);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    outline: none;
}
.saa-ig__details-body textarea:focus { border-color: var(--ig-accent); }
.saa-ig__details-body textarea::placeholder { color: var(--ig-input-placeholder); }

/* ══════════════════════════════════════════════════
   QUALITY TIER PILLS
   ══════════════════════════════════════════════════ */
.saa-ig__tier-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.saa-ig__tier {
    padding: 6px 14px;
    border: 1px solid var(--ig-pill-border);
    border-radius: 8px;
    background: var(--ig-pill-bg);
    color: var(--ig-pill-text);
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    position: relative;
}
.saa-ig__tier:hover { border-color: var(--ig-pill-hover-border); background: var(--ig-pill-hover-bg); }
.saa-ig__tier--active { background: var(--ig-pill-active-bg); border-color: var(--ig-pill-active-border); color: var(--ig-pill-active-text); font-weight: 600; }
.saa-ig__tier--locked { opacity: .6; cursor: default; }
.saa-ig__tier--locked::after {
    content: '🔒';
    font-size: 10px;
    margin-left: 4px;
}

/* Aspect Ratio Pills */
.saa-ig__ratio-pills { display: flex; gap: 6px; }
.saa-ig__ratio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 10px;
    border: 1px solid var(--ig-pill-border);
    border-radius: 8px;
    background: var(--ig-pill-bg);
    color: var(--ig-text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all .15s;
}
.saa-ig__ratio:hover { border-color: var(--ig-pill-hover-border); }
.saa-ig__ratio--active { background: var(--ig-pill-active-bg); border-color: var(--ig-pill-active-border); color: var(--ig-pill-active-text); }
.saa-ig__ratio-icon {
    display: block;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}
.saa-ig__ratio-icon--square { width: 16px; height: 16px; }
.saa-ig__ratio-icon--landscape { width: 22px; height: 14px; }
.saa-ig__ratio-icon--portrait { width: 12px; height: 20px; }
.saa-ig__ratio-icon--wide { width: 26px; height: 10px; }

/* Image Count Pills */
.saa-ig__count-pills { display: flex; gap: 6px; }
.saa-ig__count {
    width: 36px; height: 36px;
    border: 1px solid var(--ig-pill-border);
    border-radius: 8px;
    background: var(--ig-pill-bg);
    color: var(--ig-pill-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.saa-ig__count:hover { border-color: var(--ig-pill-hover-border); }
.saa-ig__count--active { background: var(--ig-pill-active-bg); border-color: var(--ig-pill-active-border); color: var(--ig-pill-active-text); }

/* ══════════════════════════════════════════════════
   REMAINING COUNTER
   ══════════════════════════════════════════════════ */
.saa-ig__remaining {
    background: var(--ig-remaining-bg);
    border: 1px solid var(--ig-remaining-border);
    border-radius: 10px;
    padding: 10px 16px;
    color: var(--ig-remaining-text);
    font-size: 13px;
    text-align: center;
    margin-bottom: 16px;
}
.saa-ig__remaining--low { background: #fef2f2; border-color: #fecaca; color: #991b1b; font-weight: 600; }
.saa-ig--dark .saa-ig__remaining--low { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); color: #fca5a5; }
.saa-ig--glass .saa-ig__remaining--low { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.25); color: #991b1b; }

/* ══════════════════════════════════════════════════
   GENERATE BUTTON — glow on hover
   ══════════════════════════════════════════════════ */
.saa-ig__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px;
    background: var(--ig-btn-gradient);
    color: var(--ig-btn-text);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--ig-btn-shadow);
    transition: opacity .15s, transform .1s, box-shadow .2s;
}
.saa-ig__btn:hover { opacity: .95; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,.45); }
.saa-ig__btn:active { transform: translateY(0); box-shadow: var(--ig-btn-shadow); }
.saa-ig__btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Loading */
.saa-ig__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px;
    color: var(--ig-text-muted);
    font-size: 14px;
}
.saa-ig__spinner {
    width: 22px; height: 22px;
    border: 2.5px solid var(--ig-spinner-track);
    border-top-color: var(--ig-spinner-head);
    border-radius: 50%;
    animation: saa-ig-spin .6s linear infinite;
}
@keyframes saa-ig-spin { to { transform: rotate(360deg); } }

/* Error */
.saa-ig__error {
    background: var(--ig-error-bg);
    border: 1px solid var(--ig-error-border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--ig-error-text);
    font-size: 13px;
    margin-top: 16px;
}

/* ══════════════════════════════════════════════════
   RESULTS
   ══════════════════════════════════════════════════ */
.saa-ig__results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.saa-ig__results--single { grid-template-columns: 1fr; }
.saa-ig__result {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: var(--ig-result-bg);
    border: 1px solid var(--ig-result-border);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.saa-ig__result img {
    width: 100%;
    display: block;
    cursor: pointer;
    transition: transform .25s;
}
.saa-ig__result:hover img { transform: scale(1.03); }
.saa-ig__result-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0,0,0,.7));
    opacity: 0;
    transition: opacity .2s;
}
.saa-ig__result:hover .saa-ig__result-overlay { opacity: 1; }
.saa-ig__result-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background .15s;
}
.saa-ig__result-btn:hover { background: rgba(37,99,235,.5); }
.saa-ig__result-btn--saved { background: rgba(34,197,94,.3); border-color: rgba(34,197,94,.4); pointer-events: none; }
.saa-ig__result-seed {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    background: rgba(0,0,0,.5);
    border-radius: 6px;
    font-size: 10px;
    color: #ccc;
    backdrop-filter: blur(4px);
}

/* Lightbox */
.saa-ig__lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: saa-ig-fadein .2s;
}
.saa-ig__lightbox img { max-width: 95vw; max-height: 95vh; border-radius: 8px; cursor: default; }
@keyframes saa-ig-fadein { from { opacity: 0; } to { opacity: 1; } }

/* ══════════════════════════════════════════════════
   SIDEBAR — Cards + Prompts + Steps
   ══════════════════════════════════════════════════ */
.saa-ig__sidebar-card {
    background: var(--ig-sidebar-bg);
    border: 1px solid var(--ig-sidebar-border);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--ig-sidebar-shadow);
}
.saa-ig__sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ig-heading);
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Prompt example chips — colored bg */
.saa-ig__examples { display: flex; flex-wrap: wrap; gap: 8px; }
.saa-ig__example {
    padding: 8px 14px;
    border: 1px solid var(--ig-example-border);
    border-radius: 20px;
    background: var(--ig-example-bg);
    color: var(--ig-prompt-color, var(--ig-example-text));
    font-size: var(--ig-prompt-size, 13px);
    cursor: pointer;
    transition: all .15s;
    line-height: 1.4;
    text-align: left;
}
.saa-ig--dark .saa-ig__example {
    color: var(--ig-prompt-color-dark, var(--ig-example-text));
}
.saa-ig__example:hover { border-color: var(--ig-accent); background: var(--ig-example-hover-bg); }

/* Numbered steps */
.saa-ig__steps {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: none;
}
.saa-ig__steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--ig-text);
    line-height: 1.5;
}
.saa-ig__steps li:last-child { margin-bottom: 0; }
.saa-ig__step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ig-step-bg);
    color: var(--ig-step-text);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

/* ══════════════════════════════════════════════════
   SEO CONTENT
   ══════════════════════════════════════════════════ */
.saa-ig__seo {
    color: var(--ig-seo-text);
    font-size: var(--ig-seo-text-size, 14px);
    line-height: 1.7;
    margin-bottom: 28px;
}
.saa-ig__seo h2 {
    color: var(--ig-seo-h2);
    font-size: var(--ig-seo-heading-size, 1.2rem);
    font-weight: 700;
    margin: 0 0 12px;
}
.saa-ig__seo p { margin: 0 0 12px; }
.saa-ig__seo a { color: var(--ig-seo-link); }

/* ══════════════════════════════════════════════════
   FAQ ACCORDION — styled details/summary
   ══════════════════════════════════════════════════ */
.saa-ig__faq { display: flex; flex-direction: column; gap: 10px; }
.saa-ig__faq-item {
    background: var(--ig-faq-bg);
    border: 1px solid var(--ig-faq-border);
    border-radius: 12px;
    overflow: hidden;
    transition: background .15s;
}
.saa-ig__faq-item:hover { background: var(--ig-faq-hover-bg); }
.saa-ig__faq-item summary {
    padding: 14px 18px;
    font-size: var(--ig-seo-faq-size, 0.95rem);
    font-weight: 600;
    color: var(--ig-seo-h3);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.saa-ig__faq-item summary::-webkit-details-marker { display: none; }
.saa-ig__faq-item summary::after {
    content: '+';
    font-size: 18px;
    font-weight: 400;
    color: var(--ig-text-muted);
    transition: transform .2s;
    flex-shrink: 0;
}
.saa-ig__faq-item[open] summary::after { content: '−'; }
.saa-ig__faq-answer {
    padding: 0 18px 16px;
    color: var(--ig-seo-text);
    font-size: var(--ig-seo-text-size, 14px);
    line-height: 1.7;
}
.saa-ig__faq-answer p { margin: 0; }

/* ══════════════════════════════════════════════════
   LOGIN PROMPT
   ══════════════════════════════════════════════════ */
.saa-ig__login-prompt {
    background: var(--ig-card-bg);
    border: 1px solid var(--ig-card-border);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    margin: 16px 0;
    animation: saa-ig-fadein .2s;
    box-shadow: var(--ig-card-shadow);
}
.saa-ig__login-prompt p {
    color: var(--ig-text);
    font-size: 14px;
    margin: 0 0 16px;
}
.saa-ig__login-prompt a {
    display: inline-block;
    padding: 10px 28px;
    background: var(--ig-btn-gradient);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: opacity .15s;
    box-shadow: var(--ig-btn-shadow);
}
.saa-ig__login-prompt a:hover { opacity: .9; }
.saa-ig__login-box { text-align: center; }
.saa-ig__btn--login { display: inline-block; text-decoration: none; }
.saa-ig__lock { font-size: 10px; vertical-align: middle; }

/* ══════════════════════════════════════════════════
   MOBILE
   ══════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .saa-ig--two-col .saa-ig__main,
    .saa-ig--two-col .saa-ig__content-grid {
        display: block;
    }
    .saa-ig__gen { margin-bottom: 24px; }
    .saa-ig__sidebar { margin-top: 24px; }
    .saa-ig__content-side { margin-top: 24px; }
}
@media (max-width: 600px) {
    .saa-ig { padding: 16px 14px 40px; }
    .saa-ig__hero h1 {
        font-size: var(--ig-hero-size-mobile, 1.6rem);
        -webkit-text-fill-color: var(--ig-heading);
        background: none;
    }
    .saa-ig__gen { padding: 18px; border-radius: 14px; }
    .saa-ig__row { flex-direction: column; gap: 16px; }
    .saa-ig__results { grid-template-columns: 1fr; }
    .saa-ig__result-overlay { opacity: 1; }
    .saa-ig__pills { gap: 6px; }
    .saa-ig__pill { padding: 6px 10px; font-size: 12px; }
    .saa-ig__sidebar-card { padding: 16px; border-radius: 12px; }
    .saa-ig__example { font-size: 11px; padding: 6px 10px; }
    .saa-ig__seo { font-size: var(--ig-seo-text-size-mobile, 13px); }
    .saa-ig__seo h2 { font-size: var(--ig-seo-heading-size-mobile, 1rem); }
    .saa-ig__faq-item summary { font-size: var(--ig-seo-faq-size-mobile, 0.9rem); padding: 12px 14px; }
    .saa-ig__faq-answer { padding: 0 14px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .saa-ig__spinner { animation: none; }
    .saa-ig__btn, .saa-ig__result img { transition: none; }
}

/* ══════════════════════════════════════════════════
   IMAGE HISTORY
   ══════════════════════════════════════════════════ */
.saa-ig__history { margin-top: 28px; }
.saa-ig__history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.saa-ig__history-header h3 { margin: 0; }
.saa-ig__history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
.saa-ig__history-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--ig-result-border);
    background: var(--ig-result-bg);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    aspect-ratio: 1;
}
.saa-ig__history-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.saa-ig__history-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.saa-ig__history-item--broken {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ig-text-muted);
    font-size: 11px;
    text-align: center;
    padding: 8px;
}
.saa-ig__history-prompt {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,.7));
    color: #fff;
    font-size: 10px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity .15s;
}
.saa-ig__history-item:hover .saa-ig__history-prompt { opacity: 1; }

/* ══════════════════════════════════════════════════
   THEME TOGGLE BUTTON
   ══════════════════════════════════════════════════ */
.saa-ig__theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--ig-card-border);
    border-radius: 20px;
    background: var(--ig-card-bg);
    color: var(--ig-text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
    margin-top: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.saa-ig__theme-toggle:hover {
    border-color: var(--ig-accent);
    color: var(--ig-accent);
    box-shadow: 0 2px 8px rgba(37,99,235,.12);
}
.saa-ig__theme-toggle svg { width: 16px; height: 16px; }
