/* ── Detail Overlay ──────────────────────────────────────────────────────── */
.portal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 200;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}
.portal-overlay.hidden { display: none; }
.portal-overlay-inner {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    max-width: 680px;
    width: 100%;
    padding: 24px;
    position: relative;
}
.portal-overlay-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    line-height: 1;
    transition: color var(--transition), background var(--transition);
}
.portal-overlay-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.detail-thumb {
    border-radius: var(--radius);
    overflow: hidden;
    width: 100%;
    max-height: 320px;
    background: var(--bg-tertiary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.detail-thumb img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    display: block;
}
.detail-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}
.detail-title {
    font-size: 1.1rem;
    font-weight: 700;
    padding-right: 32px;
}
.detail-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
}
.detail-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
}
.detail-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}
.detail-prompt {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--card-bg);
}
.detail-prompt.negative { color: var(--text-secondary); }
.detail-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}
