/* === Prompt Lab Editorial Shell === */
.prompts-brief-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    margin-bottom: 14px;
    border: 1px solid var(--line, #ddd6ce);
    border-radius: 8px;
    background: var(--card-solid, #fffdf8);
    box-shadow: 0 10px 30px rgba(28,25,23,.05);
}
.prompts-eyebrow { color: var(--accent, #a16207); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.prompts-brief-hero h2 {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.9rem, 4.2vw, 3rem);
    line-height: 1;
    color: var(--ink, #1c1917);
    letter-spacing: 0;
}
.prompts-brief-hero p { max-width: 680px; color: var(--muted, #78716c); line-height: 1.7; margin: 0; }
.prompts-stats { display: grid; grid-template-columns: repeat(3, 104px); gap: 8px; }
.prompts-stats div { border: 1px solid var(--line, #ddd6ce); border-radius: 8px; padding: 10px 12px; background: var(--paper, #f7f4ee); }
.prompts-stats strong { display: block; color: var(--ink, #1c1917); font-size: 1.25rem; line-height: 1; }
.prompts-stats span { display: block; margin-top: 6px; color: var(--muted, #78716c); font-size: .78rem; }

/* === Search Bar === */
.prompts-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}
.prompts-search-bar { position: relative; min-width: 0; }
.prompts-search-bar input {
    width: 100%;
    padding: 14px 18px 14px 44px;
    border: 1px solid var(--line, #ddd6ce);
    border-radius: 999px;
    font-size: 0.98em;
    background: var(--card-solid, #fffdf8);
    color: var(--ink, #1c1917);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.prompts-search-bar input:focus { outline: none; border-color: var(--accent, #a16207); box-shadow: 0 0 0 3px rgba(161,98,7,.12); }
.prompts-search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted, #78716c); font-size: 1.1em; pointer-events: none; }

/* === Filter Row (Dropdowns) === */
.prompts-filter-row { display: flex; gap: 10px; flex-wrap: nowrap; align-items: center; justify-content: flex-end; min-width: 0; }
.prompts-filter-select { padding: 9px 32px 9px 12px; border: 1px solid var(--line, #ddd6ce); border-radius: 999px; background: var(--card-solid, #fffdf8); color: var(--ink, #1c1917); font-size: 0.88em; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2378716c' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; min-width: 120px; transition: border-color 0.2s; }
.prompts-filter-select:focus { outline: none; border-color: var(--accent, #a16207); }
.prompts-filter-row .prompts-add-btn { flex: 0 0 auto; }
.prompts-add-btn { padding: 8px 16px; background: var(--ink, #1c1917); color: #fffaf3; border: none; border-radius: 999px; cursor: pointer; font-size: 0.85em; white-space: nowrap; }

/* === Results Info === */
.prompts-results-info { color: var(--muted, #78716c); font-size: 0.85em; margin-bottom: 12px; }

/* === Three-Column Grid === */
.prompts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }
@media (max-width: 1024px) { .prompts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .prompts-grid { grid-template-columns: 1fr; } }

/* === Prompt Card === */
.prompt-card { background: var(--card-solid, #fffdf8); border: 1px solid var(--line, #ddd6ce); border-radius: 8px; padding: 0; box-shadow: 0 10px 30px rgba(28,25,23,.05); display: flex; flex-direction: column; transition: transform 0.15s, box-shadow 0.15s; overflow: hidden; }
.prompt-card:hover { box-shadow: 0 16px 40px rgba(28,25,23,.08); transform: translateY(-2px); }
.prompt-card.text-card { padding-top: 8px; }
.prompt-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.prompt-card-header, .prompt-card .prompt-tag-wrap, .prompt-card .prompt-desc-wrap, .prompt-toggle-bar, .prompt-content-block, .prompt-actions, .prompt-comments { margin-left: 16px; margin-right: 16px; }
.prompt-card-header h3 { color: var(--ink, #1c1917); font-size: 1.05em; margin: 0; line-height: 1.35; }
.prompt-card-admin { display: flex; gap: 6px; flex-shrink: 0; }
.prompt-card-admin button { padding: 4px 10px; border: none; border-radius: 6px; cursor: pointer; font-size: 0.8em; }
.prompt-admin-edit { background: #667eea; color: white; }
.prompt-admin-delete { background: #e53e3e; color: white; }
.prompt-teaser { position: relative; }
.prompt-card .prompt-tag-wrap { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 9px; }
.prompt-card .tags { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 6px; min-width: 0; max-height: 25px; overflow: hidden; transition: max-height 0.2s ease; }
.prompt-card .tag { display: inline-block; background: rgba(120,113,108,.1) !important; color: var(--muted, #78716c) !important; border: 1px solid rgba(120,113,108,.18); padding: 2px 8px; border-radius: 999px; font-size: 0.74em; font-weight: 700; line-height: 1.5; }
.prompt-inline-more { display: none; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 24px; border: 1px solid rgba(161,98,7,.24); border-radius: 999px; padding: 2px 8px; background: var(--card-solid, #fffdf8); color: var(--accent, #a16207); cursor: pointer; font-size: 0.74em; font-weight: 800; line-height: 1.4; transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease; }
.prompt-inline-more:hover { border-color: var(--accent, #a16207); background: var(--accent-soft, #fef3c7); }
.prompt-teaser.has-overflow .prompt-inline-more { display: inline-flex; }
.prompt-tag-wrap.has-overflow:hover .tags,
.prompt-tag-wrap.has-overflow:focus-within .tags,
.prompt-tag-wrap.has-overflow.force-open .tags { max-height: 132px; overflow-y: auto; padding-bottom: 2px; }

.prompt-card .prompt-desc-wrap { margin-bottom: 8px; }
.prompt-card p.desc { color: var(--muted, #78716c); font-size: 0.9em; line-height: 1.55; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.18s ease; }
.prompt-desc-wrap.has-overflow p.desc { padding-right: 46px; }
.prompt-desc-more { position: absolute; right: 0; bottom: -1px; min-height: 22px; padding: 1px 7px; box-shadow: -10px 0 14px var(--card-solid, #fffdf8); }
.prompt-desc-wrap.has-overflow:hover p.desc,
.prompt-desc-wrap.has-overflow:focus-within p.desc,
.prompt-desc-wrap.has-overflow.force-open p.desc { display: block; -webkit-line-clamp: initial; -webkit-box-orient: initial; overflow: visible; padding-right: 0; color: var(--ink, #1c1917); }
.prompt-desc-wrap.has-overflow:hover .prompt-desc-more,
.prompt-desc-wrap.has-overflow:focus-within .prompt-desc-more,
.prompt-desc-wrap.has-overflow.force-open .prompt-desc-more { position: static; margin-top: 5px; box-shadow: none; }

/* === Image Carousel === */
.prompt-effect-frame { position: relative; margin: 0 0 14px; min-height: 240px; background: #16120f; overflow: hidden; display: flex; align-items: stretch; justify-content: center; }
.prompt-effect-frame:not(.empty) { aspect-ratio: 4 / 3; min-height: 0; }
.prompt-effect-frame.compact { min-height: 190px; margin-bottom: 0; }
.prompt-effect-frame.compact:not(.empty) { min-height: 0; }
.prompt-effect-frame video { width: 100%; height: 100%; min-height: 240px; object-fit: contain; display: block; background: #16120f; }
.prompt-effect-frame.compact video { min-height: 190px; }
.prompt-effect-frame.empty { background: linear-gradient(135deg, #1c1917, #4a3424); color: #fffaf3; padding: 18px; }
.prompt-effect-placeholder { display: grid; gap: 8px; text-align: center; max-width: 240px; }
.prompt-effect-placeholder strong { font-family: Georgia, 'Times New Roman', serif; font-size: 1.45rem; }
.prompt-effect-placeholder span { color: #e7e5e4; font-size: .85rem; line-height: 1.5; }
.prompt-effect-badge { position: absolute; z-index: 2; left: 10px; top: 10px; background: rgba(255,250,243,.92); color: var(--ink, #1c1917); border-radius: 999px; padding: 4px 9px; font-size: .72rem; font-weight: 800; }
.prompt-carousel { position: relative; width: 100%; height: 100%; overflow: hidden; background: #16120f; }
.prompt-carousel-inner { display: flex; transition: transform 0.3s ease; }
.prompt-media-slide { flex-shrink: 0; height: 100%; }
.prompt-media-stage {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #16120f;
}
.prompt-media-bg {
    position: absolute;
    inset: -22px;
    background-image: var(--prompt-image);
    background-size: cover;
    background-position: center;
    filter: blur(22px) saturate(1.08);
    transform: scale(1.08);
    opacity: .72;
}
.prompt-media-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(22,18,15,.18);
    pointer-events: none;
}
.prompt-media-front {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    cursor: pointer;
    display: block;
}
.prompt-carousel-prev, .prompt-carousel-next { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.36); color: white; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 1.2em; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.prompt-carousel-prev { left: 8px; }
.prompt-carousel-next { right: 8px; }
.prompt-carousel-dots { position: absolute; z-index: 3; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; justify-content: center; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; background: rgba(22,18,15,.42); backdrop-filter: blur(10px); }
.prompt-carousel-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,250,243,.72); border: none; cursor: pointer; padding: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.prompt-carousel-dot.active { background: #667eea; box-shadow: 0 0 0 2px rgba(255,250,243,.75); }
.prompt-single-img { cursor: pointer; }

/* === Toggle Bar (expand/copy) === */
.prompt-toggle-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.prompt-toggle-btn { background: none; border: 1px solid var(--line, #ddd6ce); border-radius: 999px; padding: 6px 14px; color: var(--accent, #a16207); cursor: pointer; font-size: 0.85em; transition: all 0.2s; }
.prompt-toggle-btn:hover { border-color: var(--accent, #a16207); background: var(--accent-soft, #fef3c7); }
.prompt-toggle-bar .prompt-copy-btn { position: static; padding: 6px 14px; background: var(--ink, #1c1917); color: #fffaf3; border: none; border-radius: 999px; cursor: pointer; font-size: 0.85em; }
.prompt-toggle-bar .prompt-copy-btn:hover { opacity: 0.9; }

/* === Prompt Content === */
.prompt-content-block { position: relative; margin-bottom: 12px; }
.prompt-content-block.collapsed { display: none; }
.prompt-content-block pre { background: #1c1917; color: #f8f3eb; padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 0.85em; white-space: pre-wrap; max-height: 300px; overflow-y: auto; margin: 0; }

/* === Actions Bar === */
.prompt-actions { display: flex; align-items: center; gap: 16px; padding: 10px 0 14px; border-top: 1px solid var(--line, #ddd6ce); margin-top: auto; }
.prompt-action-btn { display: flex; align-items: center; gap: 4px; background: none; border: none; cursor: pointer; color: #888; font-size: 0.88em; padding: 4px 0; }
.prompt-action-btn:hover { color: var(--accent, #a16207); }
.prompt-action-btn.liked { color: #e53e3e; }

/* === Comments === */
.prompt-comments { margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0f0f0; display: none; }
.prompt-comments.open { display: block; }
.prompt-comment-item { padding: 8px 0; border-bottom: 1px solid #f5f5f5; font-size: 0.88em; }
.prompt-comment-item:last-child { border-bottom: none; }
.prompt-comment-user { font-weight: 600; color: #333; margin-right: 8px; }
.prompt-comment-time { color: #aaa; font-size: 0.8em; float: right; }
.prompt-comment-delete { background: none; border: none; color: #e53e3e; cursor: pointer; font-size: 0.78em; float: right; margin-left: 8px; }
.prompt-comment-content { color: #555; margin-top: 2px; }
.prompt-comment-form { display: flex; gap: 8px; margin-top: 10px; }
.prompt-comment-form input { flex: 1; padding: 8px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 0.88em; }
.prompt-comment-form button { padding: 8px 16px; background: linear-gradient(135deg, #667eea, #764ba2); color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 0.85em; white-space: nowrap; }

/* === Pagination === */
.prompts-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 20px 0; }
.prompts-page-btn { padding: 8px 14px; border: 1.5px solid #e2e8f0; border-radius: 8px; background: white; color: #555; cursor: pointer; font-size: 0.88em; transition: all 0.2s; }
.prompts-page-btn:hover:not(:disabled) { border-color: var(--accent, #a16207); color: var(--accent, #a16207); }
.prompts-page-btn.active { background: var(--ink, #1c1917); color: #fffaf3; border-color: transparent; }
.prompts-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.prompts-page-ellipsis { color: #999; font-size: 0.88em; padding: 0 4px; }

/* === Toast Notification === */
.prompts-toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px); background: #333; color: white; padding: 12px 24px; border-radius: 10px; font-size: 0.9em; z-index: 1000; opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; pointer-events: none; }
.prompts-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.prompts-toast.success { background: #48bb78; }
.prompts-toast.error { background: #e53e3e; }

/* === Admin Edit Modal === */
.prompt-edit-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 300; justify-content: center; align-items: flex-start; padding: 20px; overflow-y: auto; }
.prompt-edit-modal.show { display: flex; }
.prompt-edit-modal-content { background: white; border-radius: 16px; padding: 24px; width: 100%; max-width: 550px; margin: auto; }
.prompt-edit-modal-content h2 { margin: 0 0 20px; color: #333; font-size: 1.2em; }
.prompt-edit-modal-content label { display: block; font-size: 0.88em; color: #555; margin-bottom: 4px; margin-top: 12px; }
.prompt-edit-modal-content input[type="text"],
.prompt-edit-modal-content textarea,
.prompt-edit-modal-content select { width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 0.92em; margin-bottom: 4px; }
.prompt-edit-modal-content textarea { min-height: 80px; resize: vertical; }
.prompt-edit-modal-content textarea.large { min-height: 140px; }
.prompt-edit-images { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.prompt-edit-img-thumb { position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; }
.prompt-edit-img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prompt-edit-img-thumb .remove-img { position: absolute; top: 2px; right: 2px; background: rgba(229,62,62,0.9); color: white; border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: 0.7em; display: flex; align-items: center; justify-content: center; }
.prompt-edit-img-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prompt-edit-img-actions input[type="text"] { flex: 1; min-width: 150px; }
.prompt-edit-modal-footer { display: flex; gap: 10px; margin-top: 20px; }
.prompt-edit-modal-footer button { flex: 1; padding: 12px; border: none; border-radius: 8px; cursor: pointer; font-size: 0.92em; }
.prompt-edit-save { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.prompt-edit-cancel { background: #e2e8f0; color: #333; }

/* === Lightbox === */
.lightbox-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 500; justify-content: center; align-items: center; }
.lightbox-overlay.active { display: flex; }
.lightbox-img { max-width: 90vw; max-height: 85vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 15px; right: 20px; background: none; border: none; color: white; font-size: 2em; cursor: pointer; z-index: 501; }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.2); border: none; color: white; font-size: 2em; padding: 10px 16px; cursor: pointer; border-radius: 8px; }
.lightbox-prev { left: 15px; }
.lightbox-next { right: 15px; }
.lightbox-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: white; font-size: 0.9em; }

@media (max-width: 960px) {
    .prompts-brief-hero { grid-template-columns: 1fr; }
    .prompts-stats { grid-template-columns: repeat(3, 1fr); }
    .prompts-toolbar { grid-template-columns: 1fr; }
    .prompts-filter-row { justify-content: flex-start; flex-wrap: wrap; }
}

@media (max-width: 640px) {
    .prompts-brief-hero { padding: 14px 16px; }
    .prompts-stats { grid-template-columns: repeat(3, 1fr); }
    .prompts-stats div { padding: 8px; }
    .prompts-stats strong { font-size: 1.05rem; }
    .prompts-stats span { font-size: .7rem; }
    .prompts-toolbar { gap: 10px; }
    .prompts-filter-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
    .prompts-filter-select, .prompts-filter-row .prompts-add-btn { width: 100%; margin-left: 0; min-height: 44px; }
    .prompt-effect-frame { min-height: 210px; }
    .prompt-card-header { display: grid; gap: 10px; }
    .prompt-card-admin { justify-content: flex-start; flex-wrap: wrap; }
    .prompt-toggle-bar { align-items: stretch; gap: 8px; }
    .prompt-toggle-btn, .prompt-toggle-bar .prompt-copy-btn { flex: 1; min-height: 40px; }
    .prompt-actions { flex-wrap: wrap; gap: 10px 14px; }
    .prompt-comment-form { display: grid; grid-template-columns: 1fr; }
    .prompt-comment-form button { min-height: 42px; }
    .prompts-pagination { flex-wrap: wrap; gap: 6px; padding-bottom: 12px; }
    .prompts-page-btn { min-height: 40px; padding: 8px 12px; }
    .prompt-edit-modal { align-items: flex-end; padding: 8px; }
    .prompt-edit-modal-content {
        max-width: none;
        max-height: calc(100dvh - 16px);
        overflow-y: auto;
        border-radius: 16px 16px 10px 10px;
        padding: 18px;
        margin: 0;
    }
    .prompt-edit-img-actions { display: grid; grid-template-columns: 1fr; align-items: stretch; }
    .prompt-edit-img-actions input[type="text"] { min-width: 0; }
    .prompt-edit-modal-footer { display: grid; grid-template-columns: 1fr; }
}
