/* AI Prompts Library — listing + detail
   Enqueued by page-ai-prompts.php and single-ai_prompt.php
   Styling deliberately mirrors the existing blog listing/detail templates. */

:root {
    --aip-navy-deep: #0d4a5c;
    --aip-navy-mid: #1a7288;
    --aip-teal: #4fb4c4;
    --aip-teal-dark: #3a9aab;
    --aip-teal-pale: #dcf0f2;
    --aip-bg-light: #f4f6f7;
    --aip-card-white: #ffffff;
    --aip-text-dark: #16242b;
    --aip-text-muted: #5b6b71;
    --aip-border-soft: #e6eaec;
    --aip-link-blue: #1c6ea4;
    --aip-shadow-soft: 0 2px 10px rgba(15, 50, 60, 0.06);
    --aip-shadow-hover: 0 10px 24px rgba(15, 50, 60, 0.12);
}

body.aip-page {
    background: var(--aip-bg-light);
    overflow-x: hidden;
}

/* OceanWP prints its own page title above custom templates — hide it
   so the hero / article header is the first thing visitors see. */
body.aip-page .page-header,
body.aip-page #page-header {
    display: none;
}

/* Force a full-width layout even if the page still has a sidebar set. */
body.aip-page #sidebar,
body.aip-page #secondary {
    display: none;
}

body.aip-page #primary,
body.aip-page .content-area,
body.aip-page .site-main {
    width: 100%;
    max-width: 100%;
    float: none;
    margin: 0;
    padding: 0;
}

/* ===== FULL-WIDTH BREAKOUT (escapes OceanWP's content container) ===== */
.aip-breakout {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow-x: hidden;
    background: var(--aip-bg-light);
    color: var(--aip-text-dark);
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
}

.aip-breakout *,
.aip-breakout *::before,
.aip-breakout *::after {
    box-sizing: border-box;
}

:where(.aip-breakout) a {
    text-decoration: none;
    color: inherit;
}

.aip-breakout img {
    max-width: 100%;
    display: block;
}

.aip-breakout h1,
.aip-breakout h2,
.aip-breakout h3,
.aip-breakout h4,
.aip-breakout p,
.aip-breakout ul {
    margin: 0;
    padding: 0;
}

.aip-breakout a:focus-visible,
.aip-breakout button:focus-visible {
    outline: 2px solid var(--aip-teal-dark);
    outline-offset: 3px;
}

/* ===== HERO ===== */
.aip-hero {
    position: relative;
    width: 100%;
    padding: 90px 24px 104px;
    text-align: center;
    color: #fff;
    background-image:
        linear-gradient(180deg, rgba(7, 38, 48, 0.55) 0%, rgba(7, 38, 48, 0.72) 100%),
        url('../images/hero-hexagon.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.aip-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
}

.aip-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 20px;
    margin-bottom: 22px;
    backdrop-filter: blur(4px);
}

.aip-kicker i {
    color: var(--aip-teal);
}

.aip-hero h1 {
    font-size: clamp(2.1rem, 4.4vw, 3.3rem);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -0.5px;
    margin-bottom: 18px;
}

.aip-hero h2 {
    font-size: clamp(1.15rem, 2.4vw, 1.6rem);
    font-weight: 700;
    color: var(--aip-teal);
    margin-bottom: 20px;
}

.aip-hero p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.86);
    max-width: 660px;
    margin: 0 auto;
}

.aip-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.aip-hero-stats span {
    font-size: 0.94rem;
    color: rgba(255, 255, 255, 0.8);
}

.aip-hero-stats strong {
    color: #fff;
    font-size: 1.12rem;
}

.aip-stat-sep {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.32);
}

/* ===== MAIN LAYOUT ===== */
.aip-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 60px 24px 20px;
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 30px;
    align-items: start;
}

/* ===== SIDEBAR ===== */
.aip-sidebar {
    background: var(--aip-card-white);
    border-radius: 14px;
    padding: 22px;
    box-shadow: var(--aip-shadow-soft);
    position: sticky;
    top: 108px;
}

.aip-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.aip-sidebar-head h3 {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.aip-sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    background: #f1f3f4;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: var(--aip-text-dark);
    flex-shrink: 0;
}

.aip-sidebar-close svg {
    width: 16px;
    height: 16px;
}

.aip-filter-toggle {
    display: none;
    align-items: center;
    gap: 10px;
    width: max-content;
    background: var(--aip-teal);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px 18px;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background 0.15s ease;
}

.aip-filter-toggle:hover {
    background: var(--aip-teal-dark);
}

.aip-filter-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.aip-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 30, 38, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1000;
}

.aip-sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Search */
.aip-search {
    position: relative;
    display: flex;
    margin-bottom: 24px;
}

.aip-search-input {
    width: 100%;
    border: 1px solid var(--aip-border-soft);
    background: #f7f9fa;
    border-radius: 10px;
    padding: 12px 46px 12px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--aip-text-dark);
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.aip-search-input::placeholder {
    color: #8b9aa0;
}

.aip-search-input:focus {
    border-color: var(--aip-teal);
    background: #fff;
}

.aip-search-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    bottom: 5px;
    width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: var(--aip-teal);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.aip-search-btn:hover {
    background: var(--aip-teal-dark);
}

.aip-filter-label {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--aip-text-muted);
    margin: 0 0 12px;
}

.aip-cat-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
    padding: 0;
}

.aip-cat-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    background: #f1f3f4;
    color: var(--aip-text-dark);
    font-size: 0.94rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.aip-cat-list a:hover {
    background: #e4eaec;
}

.aip-cat-list a.active {
    background: var(--aip-teal);
    color: #fff;
    font-weight: 600;
}

.aip-cat-count {
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.5;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(13, 74, 92, 0.08);
    color: var(--aip-text-muted);
}

.aip-cat-list a.active .aip-cat-count {
    background: rgba(255, 255, 255, 0.24);
    color: #fff;
}

/* ===== PROMPT GRID ===== */
.aip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.aip-results-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.aip-result-count {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--aip-text-muted);
}

.aip-search-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--aip-border-soft);
    color: var(--aip-text-dark);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow: var(--aip-shadow-soft);
    transition: border-color 0.15s ease;
}

.aip-search-chip:hover {
    border-color: var(--aip-teal);
}

.aip-search-chip i {
    color: var(--aip-teal-dark);
    font-size: 0.74rem;
}

/* ===== PROMPT CARD ===== */
.prompt-card {
    background: var(--aip-card-white);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--aip-shadow-soft);
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.prompt-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--aip-shadow-hover);
}

.prompt-card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: linear-gradient(160deg, #0f5064 0%, #1a7288 100%);
    overflow: hidden;
}

.prompt-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

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

.prompt-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 2.2rem;
    background:
        radial-gradient(circle at 72% 18%, rgba(79, 180, 196, 0.42), transparent 58%),
        linear-gradient(160deg, #0f5064 0%, #1a7288 100%);
}

.prompt-cat {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    max-width: calc(100% - 74px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.94);
    color: var(--aip-navy-deep);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: 20px;
}

.prompt-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding-left: 3px;
    background: rgba(79, 180, 196, 0.95);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    transition: transform 0.18s ease, background 0.18s ease;
}

.prompt-card:hover .prompt-play {
    transform: translate(-50%, -50%) scale(1.08);
    background: var(--aip-teal-dark);
}

.prompt-card-body {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.prompt-card-title {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 10px;
}

.prompt-card-title a {
    color: var(--aip-text-dark);
    transition: color 0.15s ease;
}

.prompt-card-title a:hover {
    color: var(--aip-teal-dark);
}

.prompt-card-excerpt {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--aip-text-muted);
    margin: 0 0 16px;
}

.prompt-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 16px;
}

.prompt-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.4;
    padding: 5px 10px;
    border-radius: 20px;
    background: var(--aip-teal-pale);
    color: var(--aip-navy-deep);
}

.prompt-chip i {
    font-size: 0.72rem;
    color: var(--aip-teal-dark);
}

.prompt-chip-diff {
    background: #f1f3f4;
    color: var(--aip-text-muted);
}

.prompt-card-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--aip-border-soft);
}

.prompt-copy-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.77rem;
    font-weight: 600;
    color: var(--aip-text-muted);
}

.prompt-copy-note i {
    color: var(--aip-teal-dark);
}

.prompt-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    background: var(--aip-teal);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 9px 16px;
    border-radius: 22px;
    transition: background 0.15s ease, gap 0.15s ease;
}

.prompt-card-btn:hover {
    background: var(--aip-teal-dark);
    gap: 10px;
}

/* ===== PAGINATION ===== */
.aip-pagination {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.aip-pagination a,
.aip-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--aip-card-white);
    color: var(--aip-text-dark);
    font-size: 0.92rem;
    box-shadow: var(--aip-shadow-soft);
}

.aip-pagination a:hover {
    background: var(--aip-teal-pale);
    color: var(--aip-navy-deep);
}

.aip-pagination .current {
    background: var(--aip-teal);
    color: #fff;
    font-weight: 700;
}

/* ===== EMPTY STATE ===== */
.aip-empty {
    grid-column: 1 / -1;
    background: var(--aip-card-white);
    border-radius: 16px;
    padding: 56px 24px;
    text-align: center;
    box-shadow: var(--aip-shadow-soft);
}

.aip-empty-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--aip-teal-pale);
    color: var(--aip-teal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 18px;
}

.aip-empty h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.aip-empty p {
    font-size: 0.98rem;
    color: var(--aip-text-muted);
    max-width: 470px;
    margin: 0 auto 22px;
}

.aip-empty-btn {
    display: inline-block;
    background: var(--aip-teal);
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 12px 24px;
    border-radius: 24px;
    transition: background 0.15s ease;
}

.aip-empty-btn:hover {
    background: var(--aip-teal-dark);
}

/* ===== CTA BANNER ===== */
.aip-cta-wrap {
    max-width: 1600px;
    margin: 60px auto 80px;
    padding: 0 24px;
}

.aip-cta-banner {
    background: linear-gradient(100deg, #0d4a5c 0%, #1a7288 100%);
    border-radius: 16px;
    padding: 44px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    color: #fff;
}

.aip-cta-text h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.aip-cta-text p {
    font-size: 0.98rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 500px;
}

.aip-cta-btn {
    display: inline-block;
    white-space: nowrap;
    background: var(--aip-teal);
    color: #fff;
    font-weight: 700;
    font-size: 0.98rem;
    padding: 14px 28px;
    border-radius: 24px;
    transition: background 0.15s ease;
}

.aip-cta-btn:hover {
    background: var(--aip-teal-dark);
}

/* ============================================================
   DETAIL PAGE
   ============================================================ */
.aip-detail {
    padding-bottom: 20px;
}

.aip-detail-wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 52px 24px 10px;
}

.aip-back {
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    font-size: 0.87rem;
    font-weight: 700;
    color: var(--aip-text-muted);
    margin-bottom: 22px;
    transition: color 0.15s ease;
}

.aip-back:hover {
    color: var(--aip-teal-dark);
}

.aip-back i {
    font-size: 0.8rem;
}

.aip-detail-tag {
    display: inline-block;
    background: var(--aip-teal-pale);
    color: var(--aip-link-blue);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    padding: 7px 14px;
    border-radius: 20px;
    margin-bottom: 18px;
    transition: background 0.15s ease;
}

.aip-detail-tag:hover {
    background: #cfe9ec;
}

.aip-detail-title {
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: -0.4px;
    color: var(--aip-text-dark);
    margin-bottom: 18px;
    max-width: 900px;
}

.aip-detail-excerpt {
    font-size: 1.12rem;
    color: var(--aip-text-muted);
    max-width: 820px;
    margin-bottom: 24px;
}

.aip-detail-meta {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.aip-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--aip-text-muted);
}

.aip-meta-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.aip-diff {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    background: #f1f3f4;
    color: var(--aip-text-muted);
}

.aip-diff i {
    font-size: 0.72rem;
}

.aip-diff-beginner {
    background: #e5f5ec;
    color: #1f7a4d;
}

.aip-diff-intermediate {
    background: #fdf1d9;
    color: #946a09;
}

.aip-diff-advanced {
    background: #fbe6e6;
    color: #a63b3b;
}

/* ===== VIDEO ===== */
.aip-video-section {
    margin-bottom: 34px;
}

.aip-video-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.aip-video-head h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--aip-text-dark);
}

.aip-video-head h2 i {
    color: var(--aip-teal-dark);
}

.aip-video-head span {
    font-size: 0.87rem;
    color: var(--aip-text-muted);
}

.aip-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #07262e;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(15, 50, 60, 0.16);
}

.aip-video-frame iframe,
.aip-video-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.aip-video-frame video {
    object-fit: contain;
    background: #000;
}

.aip-video-oembed {
    aspect-ratio: auto;
    min-height: 240px;
    background: #fff;
}

.aip-video-oembed iframe {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: 420px;
}

.aip-video-placeholder {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #dff3f6;
    font-weight: 700;
    background:
        radial-gradient(circle at 72% 18%, rgba(79, 180, 196, 0.4), transparent 58%),
        linear-gradient(160deg, #0f5064 0%, #1a7288 100%);
    background-size: cover;
    background-position: center;
    box-shadow: 0 10px 28px rgba(15, 50, 60, 0.16);
}

.aip-video-placeholder > i {
    font-size: 2.4rem;
    opacity: 0.9;
}

.aip-video-placeholder > span {
    font-size: 0.92rem;
}

.aip-video-placeholder.has-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(6, 35, 44, 0.45);
}

.aip-video-placeholder.has-image .aip-video-note {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(6, 35, 44, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
}

/* ===== PROMPT PANEL ===== */
.aip-prompt-section {
    background: var(--aip-card-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--aip-shadow-soft);
    margin-bottom: 34px;
}

.aip-prompt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 22px 26px;
    border-bottom: 1px solid var(--aip-border-soft);
}

.aip-panel-kicker {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1.3px;
    color: var(--aip-teal-dark);
    margin-bottom: 5px;
}

.aip-prompt-head h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--aip-text-dark);
}

.aip-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
    background: var(--aip-teal);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 12px 22px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.aip-copy-btn:hover {
    background: var(--aip-teal-dark);
    transform: translateY(-1px);
}

.aip-copy-btn.copied {
    background: #1f9d6b;
}

.aip-copy-btn.copied:hover {
    background: #178057;
}

.aip-prompt-code {
    margin: 0;
    padding: 26px 28px;
    min-height: 120px;
    max-height: 540px;
    overflow: auto;
    background: #0c3541;
    color: #e6f5f7;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.92rem;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

.aip-prompt-code::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.aip-prompt-code::-webkit-scrollbar-thumb {
    background: #2b5b68;
    border-radius: 8px;
}

.aip-prompt-hint {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 16px 26px;
    background: #f7f9fa;
    border-top: 1px solid var(--aip-border-soft);
    font-size: 0.86rem;
    color: var(--aip-text-muted);
}

.aip-prompt-hint > i {
    color: #d9a409;
    margin-top: 2px;
}

.aip-prompt-hint code {
    background: #eef2f3;
    color: var(--aip-navy-deep);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82em;
}

.aip-prompt-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 30px;
    background: #f7f9fa;
    color: var(--aip-text-muted);
}

.aip-prompt-empty i {
    color: var(--aip-teal-dark);
    font-size: 1.2rem;
}

/* Locked state for guests */
.aip-prompt-locked {
    position: relative;
    min-height: 320px;
    overflow: hidden;
    background: #0c3541;
}

.aip-prompt-code.is-preview {
    max-height: 220px;
    overflow: hidden;
    opacity: 0.75;
    filter: blur(3.5px);
    user-select: none;
    pointer-events: none;
}

.aip-locked-lines {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 320px;
    padding: 30px 28px;
    opacity: 0.55;
    filter: blur(4px);
}

.aip-locked-lines span {
    display: block;
    height: 14px;
    border-radius: 8px;
    background: #2a5a66;
}

.aip-locked-lines span:nth-child(1) { width: 82%; }
.aip-locked-lines span:nth-child(2) { width: 95%; }
.aip-locked-lines span:nth-child(3) { width: 68%; }
.aip-locked-lines span:nth-child(4) { width: 88%; }
.aip-locked-lines span:nth-child(5) { width: 74%; }

.aip-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 34px 24px;
    color: #fff;
    background: linear-gradient(180deg, rgba(7, 38, 48, 0.55) 0%, rgba(7, 38, 48, 0.94) 78%);
}

.aip-lock-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: rgba(79, 180, 196, 0.18);
    border: 1px solid rgba(79, 180, 196, 0.55);
    color: var(--aip-teal);
    font-size: 1.25rem;
}

.aip-lock-overlay h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 9px;
}

.aip-lock-overlay p {
    font-size: 0.94rem;
    color: rgba(255, 255, 255, 0.78);
    max-width: 440px;
    margin-bottom: 20px;
}

/* ===== USAGE NOTES ===== */
.aip-notes {
    background: var(--aip-card-white);
    border-radius: 16px;
    padding: 30px 32px;
    box-shadow: var(--aip-shadow-soft);
    margin-bottom: 34px;
}

.aip-notes h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--aip-text-dark);
    margin-bottom: 18px;
}

.aip-notes-body {
    max-width: 820px;
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--aip-text-dark);
}

.aip-notes-body p { margin: 0 0 18px; }
.aip-notes-body p:last-child { margin-bottom: 0; }

.aip-notes-body h2,
.aip-notes-body h3 {
    margin: 26px 0 12px;
    font-weight: 800;
}

.aip-notes-body ul,
.aip-notes-body ol {
    margin: 0 0 18px 22px;
    padding: 0;
}

.aip-notes-body li {
    margin-bottom: 6px;
}

.aip-notes-body a {
    color: var(--aip-link-blue);
    text-decoration: underline;
}

.aip-notes-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 10px 0 20px;
}

.aip-notes-body blockquote {
    border-left: 4px solid var(--aip-teal);
    padding: 4px 0 4px 18px;
    margin: 0 0 18px;
    color: var(--aip-text-muted);
    font-style: italic;
}

/* ===== RELATED PROMPTS ===== */
.aip-related {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px 20px;
}

.aip-related-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.aip-related-head h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--aip-text-dark);
}

.aip-related-head a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--aip-teal-dark);
}

.aip-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.aip-detail .aip-cta-wrap {
    max-width: 1040px;
    padding-left: 24px;
    padding-right: 24px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1280px) {
    .aip-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .aip-main {
        grid-template-columns: 1fr;
        padding-top: 44px;
    }

    .aip-filter-toggle {
        display: inline-flex;
    }

    .aip-sidebar-backdrop {
        display: block;
    }

    .aip-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 82%;
        max-width: 330px;
        height: 100vh;
        border-radius: 0;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
        box-shadow: 2px 0 24px rgba(0, 0, 0, 0.2);
    }

    .aip-sidebar.is-open {
        transform: translateX(0);
    }

    .aip-sidebar-close {
        display: flex;
    }

    .aip-results-head {
        margin-bottom: 2px;
    }

    .aip-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .aip-hero {
        padding: 64px 20px 80px;
    }

    .aip-grid {
        grid-template-columns: 1fr;
    }

    .aip-cta-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 32px 28px;
    }

    .aip-detail-wrap {
        padding-top: 38px;
    }

    .aip-detail-meta {
        gap: 14px 18px;
    }

    .aip-prompt-head {
        padding: 20px 20px;
    }

    .aip-copy-btn {
        width: 100%;
        justify-content: center;
    }

    .aip-prompt-code {
        padding: 22px 20px;
        font-size: 0.86rem;
    }

    .aip-prompt-hint {
        padding: 14px 20px;
    }

    .aip-notes {
        padding: 24px 22px;
    }

    .aip-related-grid {
        grid-template-columns: 1fr;
    }

    .aip-video-oembed iframe {
        min-height: 260px;
    }
}

@media (max-width: 480px) {
    .aip-hero-stats {
        gap: 12px;
    }

    .aip-stat-sep {
        display: none;
    }

    .aip-hero-stats span {
        font-size: 0.86rem;
    }

    .aip-result-count {
        font-size: 0.88rem;
    }
}
