/* ═══ Prompt Manager ═══════════════════════════════════════ */

.pm-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* ─── Nav ──────────────────────────────────────────────── */
.pm-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #1a1a1a;
    margin-bottom: 20px;
}

.pm-eyebrow {
    margin-left: auto;
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ─── Filter tabs ─────────────────────────────────────── */
.pm-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.pm-filter-btn {
    background: transparent;
    border: 1px solid #222;
    color: #666;
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    padding: 4px 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.pm-filter-btn:hover {
    border-color: #444;
    color: #aaa;
}

.pm-filter-btn.active {
    border-color: var(--accent, #03dac6);
    color: var(--accent, #03dac6);
    background: rgba(3, 218, 198, 0.05);
}

/* ─── Prompt cards ────────────────────────────────────── */
.pm-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pm-loading {
    color: #555;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    padding: 40px 0;
    text-align: center;
}

.pm-loading code {
    color: var(--accent, #03dac6);
    background: rgba(3, 218, 198, 0.08);
    padding: 2px 6px;
    border-radius: 3px;
}

.pm-card {
    background: #0d0d0d;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    padding: 16px;
    transition: border-color 0.2s;
}

.pm-card:hover {
    border-color: #333;
}

.pm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.pm-card-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #ddd;
}

.pm-card-cat {
    font-family: 'Space Mono', monospace;
    font-size: 0.55rem;
    color: var(--accent, #03dac6);
    background: rgba(3, 218, 198, 0.08);
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
}

.pm-card-key {
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    color: #444;
    margin-bottom: 10px;
}

.pm-card-preview {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #777;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 80px;
    overflow: hidden;
    margin-bottom: 10px;
}

.pm-placeholder {
    color: #e6a23c;
    font-weight: 600;
}

.pm-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pm-card-modified {
    font-family: 'Space Mono', monospace;
    font-size: 0.55rem;
    color: #333;
}

.pm-card-edit {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    padding: 4px 14px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.pm-card-edit:hover {
    border-color: var(--accent, #03dac6);
    color: var(--accent, #03dac6);
}

/* ─── Editor overlay ──────────────────────────────────── */
.pm-editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pm-editor-overlay.hidden {
    display: none;
}

.pm-editor {
    background: #0d0d0d;
    border: 1px solid #222;
    border-radius: 8px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.pm-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #1a1a1a;
}

.pm-editor-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ddd;
}

.pm-editor-key {
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    color: #444;
    margin-left: 12px;
}

.pm-editor-close {
    background: transparent;
    border: none;
    color: #555;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.pm-editor-close:hover {
    color: #f44336;
}

.pm-editor-hint {
    padding: 8px 20px;
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    color: #444;
}

.pm-editor-hint code {
    color: #e6a23c;
}

.pm-editor-textarea {
    flex: 1;
    min-height: 400px;
    margin: 0 20px;
    padding: 14px;
    background: #080808;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    color: #ccc;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    tab-size: 2;
}

.pm-editor-textarea:focus {
    border-color: #333;
}

.pm-editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #1a1a1a;
}

.pm-editor-status {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #555;
}

.pm-editor-save {
    background: transparent;
    border: 1px solid var(--accent, #03dac6);
    color: var(--accent, #03dac6);
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    padding: 6px 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.pm-editor-save:hover {
    background: rgba(3, 218, 198, 0.1);
}

.pm-editor-save:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
    .pm-editor {
        max-height: 95vh;
    }
    .pm-editor-textarea {
        min-height: 250px;
    }
}
