/* ===== PROMPTS ===== */
.prm-wrap {
    max-width: 100%;
    margin: 0 auto;
    padding: 28px 0 36px;
}
.prm-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.prm-col {
    min-width: 0;
}
.prm-card {
    background: var(--surface);
    border: 2px solid var(--border);
    padding: 28px;
    margin-bottom: 0;
}
.prm-title {
    font-family:var(--font-ui);
    font-size:var(--text-title);
    font-weight: 700;
    color: var(--role-brand-text, var(--accent-red));
    margin-bottom: 18px;
    text-transform: uppercase;
}
.prm-title-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.prm-title-with-icon > span:last-child {
    min-width: 0;
}
.prm-context-section-title.prm-title-with-icon {
    margin-bottom: 14px;
}
.prm-context-section-title.prm-title-with-icon .sec-icon {
    color: var(--role-brand-text, var(--accent-red));
}
.system-prompt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.system-prompt-head .prm-title,
.system-prompt-head .prm-title-with-icon {
    margin-bottom: 0;
}
.prompts-locale-hint {
    flex: 1 1 100%;
    margin: 0;
    font-size: var(--text-small, 0.8125rem);
    color: var(--text-muted, var(--muted, #888));
    text-align: left;
    line-height: var(--leading-normal);
}
.prm-system-ta {
    min-height: 280px;
    line-height:var(--leading-relaxed);
    font-size:var(--text-body);
}
.context-inject-diagram .inject-muted {
    color: var(--text-muted);
    font-style: italic;
}
#prompts-system::placeholder {
    color: var(--text-muted);
    opacity: 1;
    font-size:var(--text-small);
    line-height:var(--leading-relaxed);
}

.prm-context-section-title {
    margin: 0 0 14px;
    padding: 0 0 8px;
    border-bottom: 2px solid color-mix(in srgb, var(--accent-red) 40%, var(--border));
    font-family:var(--font-ui);
    font-size:var(--text-small);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--role-brand-text, var(--accent-red));
}

.prm-context-options {
    padding: 16px 14px 18px;
    border: 2px solid var(--border);
    background: color-mix(in srgb, var(--bg-black) 32%, var(--surface));
}

.prm-context-options > .prm-context-section-title {
    margin-bottom: 16px;
}

.prm-context-options .context-inject-box {
    margin: 0 0 14px;
    border-color: color-mix(in srgb, var(--border) 85%, var(--accent-red));
}

.prm-context-add-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prm-context-add-stack .context-quick-add,
.prm-context-add-stack .context-generate-box,
.prm-context-add-stack .context-gen-config-box {
    margin: 0;
    background: var(--bg-black);
}

.context-gen-config-desc {
    margin: 0 0 12px;
    font-size:var(--text-small);
    color: var(--text-muted, var(--text-gray));
    line-height:var(--leading-normal);
}

.context-gen-config-desc code {
    font-size:var(--text-small);
}

.profile-origin-box {
    margin-top: 10px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.profile-origin-summary {
    padding: 8px 10px;
    cursor: pointer;
    font-size:var(--text-small);
    color: var(--text-muted, var(--text-gray));
    list-style: none;
}

.profile-origin-summary::-webkit-details-marker { display: none; }

.profile-origin-body {
    padding: 0 10px 10px;
}

.profile-origin-field + .profile-origin-field {
    margin-top: 8px;
}

.profile-origin-label {
    font-size:var(--text-caption);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--role-brand-text, var(--accent-red));
    margin-bottom: 4px;
}

.profile-origin-value {
    margin: 0;
    padding: 8px;
    font-size:var(--text-caption);
    line-height:var(--leading-normal);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 160px;
    overflow: auto;
    background: var(--bg-black);
    border: 1px solid var(--border);
}

.prm-context-list {
    margin-top: 22px;
    padding-top: 4px;
    border-top: 2px solid color-mix(in srgb, var(--accent-red) 45%, var(--border));
}

.prm-context-list > .prm-context-section-title {
    margin-top: 14px;
}

.prm-context-list .profile-counter {
    margin-top: 0;
    margin-bottom: 12px;
}

.prm-context-list .profile-order-hint {
    margin-bottom: 12px;
}

/* Gen intention — strip modèle + actions (miroir llm-strip Workspace) */
.context-generate-intent-ta {
    min-height: 90px;
    width: 100%;
    box-sizing: border-box;
}
.context-gen-strip {
    margin-top: 10px;
    padding: 0;
    border: none;
    background: transparent;
}
.context-gen-strip-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 12px;
    min-width: 0;
}
.context-gen-strip .llm-strip-config {
    flex: 1 1 160px;
    min-width: 0;
}
.context-gen-strip .llm-strip-model-select {
    width: 100%;
    max-width: 100%;
}
.context-gen-strip-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
}
.context-intent-options {
    margin-top: 10px;
}
.context-intent-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.context-intent-param {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.context-intent-param .llm-opt-label {
    margin: 0;
}
.context-intent-param-input {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    box-sizing: border-box;
    display: block;
    opacity: 1;
    visibility: visible;
}
.context-generate-status {
    margin-top: 8px;
    min-height: 1.25em;
}

@media (max-width: 480px) {
    .context-gen-strip-row {
        flex-direction: column;
        align-items: stretch;
    }
    .context-gen-strip-actions {
        width: 100%;
    }
    .context-gen-strip-actions .btn {
        flex: 1 1 auto;
    }
    .context-gen-strip .llm-strip-options-btn {
        width: 100%;
    }
}

@media (min-width: 1024px) {
    .prm-grid {
        flex-direction: row;
        align-items: stretch;
        gap: 32px;
    }
    .prm-col-system {
        flex: 1 1 46%;
        display: flex;
        flex-direction: column;
    }
    .prm-col-context {
        flex: 1 1 54%;
        display: flex;
        flex-direction: column;
    }
    .prm-card-system {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 32px 34px 36px;
    }
    .prm-card-system .prm-system-ta {
        flex: 1;
        min-height: min(72vh, 920px);
        resize: vertical;
    }
    .prm-card-context {
        max-height: calc(100vh - 96px);
        overflow-y: auto;
        padding: 28px 30px 32px;
    }
    .prm-card-context .profile-prompt {
        min-height: 88px;
    }
}
