/* ═══════════════════════════════════════════════════════════════════════════
   PLAN STUDIO — EDITOR-SPECIFIC STYLES
   Extracted from plan-studio.css for maintainability.
   Contains: teach cycle cards, coverage map, tag inputs, micro-checks,
   module/chapter/major editor styles, bloom grid, lesson context bar.
   ═══════════════════════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════════════════════
   TEACH CYCLE CARDS (Lesson Editor)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Teach cycle cards */
.ps-cycle-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.ps-cycle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: rgba(99, 102, 241, 0.06);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color, #6366f1);
}

.ps-cycle-header:hover {
    background: rgba(99, 102, 241, 0.1);
}

.ps-cycle-body {
    padding: 1rem;
}

.ps-cycle-card.collapsed .ps-cycle-body {
    display: none;
}

/* Compact metadata bar inside cycle body */
.ps-cycle-meta-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.75rem;
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    flex-wrap: wrap;
}
.ps-cycle-meta-item {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}
.ps-cycle-meta-label {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}
.ps-cycle-meta-pages {
    gap: 2px;
}
.ps-select--compact {
    padding: 4px 6px;
    font-size: 0.75rem;
    min-width: 0;
    max-width: 120px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--text-primary, #e2e8f0);
    cursor: pointer;
    font-family: inherit;
}
.ps-select--compact:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
}
.ps-select--compact option {
    background: var(--bg-primary, #0f0f1e);
    color: var(--text-primary, #e2e8f0);
}
.ps-input--mini {
    width: 52px !important;
    padding: 4px 4px !important;
    font-size: 0.75rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--text-primary, #e2e8f0);
}
.ps-input--mini:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
}

/* Sub-section within a cycle (branching, hints, etc.) */
.ps-cycle-subsection {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ps-cycle-subsection--struggle {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.15);
}

.ps-cycle-subsection--advanced {
    background: rgba(16, 185, 129, 0.04);
    border-color: rgba(16, 185, 129, 0.15);
}

.ps-cycle-subsection--roleplay {
    background: rgba(168, 85, 247, 0.04);
    border-color: rgba(168, 85, 247, 0.15);
}

.ps-cycle-subsection--trap {
    background: rgba(244, 63, 94, 0.04);
    border-color: rgba(244, 63, 94, 0.15);
}

.ps-subsection-title {
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Hint ladder items */
.ps-hint-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: hint;
}

.ps-hint-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    counter-increment: hint;
}

.ps-hint-item::before {
    content: counter(hint);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color, #6366f1);
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ps-hint-item .ps-input {
    flex: 1;
}

/* Micro-check cards */
.ps-microcheck-card {
    background: rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.ps-microcheck-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}


/* ═══════════════════════════════════════════════════════════════════════════
   COVERAGE MAP (Read-only visualization)
   ═══════════════════════════════════════════════════════════════════════════ */

.ps-coverage-grid {
    display: grid;
    grid-template-columns: 140px repeat(auto-fill, minmax(100px, 1fr));
    gap: 2px;
    font-size: 0.72rem;
    margin-top: 0.5rem;
}

.ps-coverage-header {
    background: rgba(99, 102, 241, 0.1);
    padding: 6px 8px;
    font-weight: 700;
    color: var(--primary-color, #818cf8);
    border-radius: 4px;
}

.ps-coverage-cell {
    padding: 6px 8px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.06);
    color: var(--text-muted, #94a3b8);
    text-align: center;
}

.ps-coverage-cell--gap {
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
    border: 1px dashed rgba(239, 68, 68, 0.2);
}

.ps-coverage-cell--covered {
    background: rgba(16, 185, 129, 0.08);
    color: #6ee7b7;
}

.ps-coverage-label {
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 8px;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ═══════════════════════════════════════════════════════════════════════════
   v3: MUST COVER TAG LIST
   ═══════════════════════════════════════════════════════════════════════════ */

.ps-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    min-height: 36px;
}

.ps-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 4px;
    font-size: 0.78rem;
    color: #a5b4fc;
    white-space: nowrap;
}

.ps-tag-remove {
    background: none;
    border: none;
    color: #818cf8;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.ps-tag-remove:hover {
    opacity: 1;
    color: #f87171;
}

.ps-tag-input {
    border: none;
    background: transparent;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.8rem;
    outline: none;
    flex: 1;
    min-width: 120px;
    padding: 0.2rem 0.3rem;
}

.ps-tag-input::placeholder {
    color: var(--text-muted, #64748b);
    font-style: italic;
}

/* ── Concept tags with page ranges ── */
.ps-concept-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    min-height: 36px;
}

.ps-concept-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.4rem;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 4px;
    font-size: 0.78rem;
    color: #a5b4fc;
}

.ps-concept-name {
    font-weight: 500;
    white-space: nowrap;
}

.ps-concept-pages {
    font-size: 0.7rem;
    color: #6ee7b7;
    opacity: 0.8;
}

.ps-concept-page-input {
    width: 42px !important;
    padding: 0.1rem 0.2rem !important;
    font-size: 0.72rem !important;
    text-align: center;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 3px !important;
    color: #94a3b8 !important;
    min-height: unset !important;
    height: 22px !important;
}

.ps-concept-page-input:focus {
    border-color: rgba(99, 102, 241, 0.5) !important;
    color: #e2e8f0 !important;
}

.ps-concept-tag button {
    background: none;
    border: none;
    color: #818cf8;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0 0.1rem;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.ps-concept-tag button:hover {
    opacity: 1;
    color: #f87171;
}
/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 5C — MODULE / CHAPTER / MAJOR EDITOR STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Major type badge */
.ps-plan-type-badge--major {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.3);
}

/* Major Profile editor */
.ps-major-profile { padding: 0; }
.ps-major-profile-header {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.25rem 1.5rem; margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.08), rgba(99, 102, 241, 0.05));
    border: 1px solid rgba(167, 139, 250, 0.15); border-radius: 12px;
}
.ps-major-profile-icon { font-size: 2.5rem; }
.ps-major-profile-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.ps-major-profile-subtitle { font-size: 0.8rem; color: var(--text-muted); margin: 0.25rem 0 0; }
.ps-major-profile-footer { margin-top: 1rem; }
.ps-major-profile-preview {
    background: rgba(0, 0, 0, 0.2); border-radius: 8px; padding: 0.75rem 1rem;
    font-size: 0.82rem; color: var(--text-muted); line-height: 1.5;
}
.ps-major-profile-preview strong { color: var(--text-primary); margin-right: 0.5rem; }
.ps-major-profile-preview em { color: #a78bfa; font-style: italic; }

/* Field hints */
.ps-field-hint {
    font-size: 0.72rem; color: var(--text-muted, #64748b);
    margin-top: 0.3rem; line-height: 1.4; display: block;
}

/* Chapter sequence cards (reused for topic sequence) */
.ps-chapter-card {
    background: rgba(0, 0, 0, 0.12); border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px; margin-bottom: 0.5rem; overflow: hidden;
}
.ps-chapter-card-header {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 1rem; background: rgba(255, 255, 255, 0.02);
}
.ps-chapter-order {
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(99, 102, 241, 0.15); color: #818cf8;
    font-size: 0.72rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ps-chapter-title { flex: 1; font-size: 0.85rem; font-weight: 500; color: var(--text-primary); }
.ps-chapter-card-body { padding: 0.5rem 1rem 0.75rem; }
.ps-chapter-meta-inline {
    display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0;
}
.ps-ch-textbook {
    font-size: 0.72rem; color: var(--text-muted);
    background: rgba(99, 102, 241, 0.08); padding: 2px 6px; border-radius: 3px;
    white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.ps-ch-pages {
    font-size: 0.72rem; color: #818cf8; white-space: nowrap;
}
.ps-chapter-reorder { display: flex; gap: 2px; }
.ps-btn-move {
    background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.2);
    color: #818cf8; padding: 2px 6px; border-radius: 4px; cursor: pointer;
    font-size: 0.65rem; transition: all 0.15s;
}
.ps-btn-move:hover { background: rgba(99, 102, 241, 0.2); }
.ps-ch-obj-coverage {
    display: flex; flex-wrap: wrap; gap: 4px;
    padding: 4px 0 6px; border-bottom: 1px solid rgba(255,255,255,0.04);
    margin-bottom: 4px;
}
.ps-ch-obj-badge {
    font-size: 0.65rem; font-weight: 600; letter-spacing: 0.3px;
    padding: 2px 7px; border-radius: 8px;
    background: rgba(34, 197, 94, 0.12); color: #4ade80;
    cursor: default; transition: background 0.15s;
}
.ps-ch-obj-badge:hover {
    background: rgba(34, 197, 94, 0.25);
}
.ps-ch-obj-badge--derived {
    background: rgba(245, 158, 11, 0.12); color: #fbbf24;
}
.ps-ch-obj-badge--derived:hover {
    background: rgba(245, 158, 11, 0.25);
}

/* Dependency table */
.ps-dep-table {
    width: 100%; border-collapse: collapse; font-size: 0.82rem; margin-bottom: 0.75rem;
}
.ps-dep-table th {
    text-align: left; padding: 0.4rem 0.5rem; font-size: 0.72rem;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ps-dep-table td { padding: 0.3rem 0.5rem; }
.ps-dep-table .ps-input { font-size: 0.8rem; padding: 0.35rem 0.5rem; }

/* Add/remove buttons (module/chapter editors) */
.ps-btn-add {
    background: rgba(16, 185, 129, 0.1); border: 1px dashed rgba(16, 185, 129, 0.3);
    color: #10b981; padding: 0.5rem 1rem; border-radius: 8px; cursor: pointer;
    font-size: 0.8rem; font-weight: 500; transition: all 0.15s; width: 100%; margin-top: 0.5rem;
}
.ps-btn-add:hover { background: rgba(16, 185, 129, 0.18); }
.ps-btn-add-small {
    background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981; padding: 4px 10px; border-radius: 4px; cursor: pointer;
    font-size: 0.75rem; transition: all 0.15s;
}
.ps-btn-add-small:hover { background: rgba(16, 185, 129, 0.2); }
.ps-btn-remove-small {
    background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444; padding: 2px 8px; border-radius: 4px; cursor: pointer;
    font-size: 0.8rem; transition: all 0.15s; flex-shrink: 0;
}
.ps-btn-remove-small:hover { background: rgba(239, 68, 68, 0.2); }

/* Cycle card header/body (reused by objective mapping cards) */
.ps-cycle-card-header {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 0.85rem; background: rgba(99, 102, 241, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.ps-cycle-card-body { padding: 0.75rem 0.85rem; }
.ps-cycle-badge {
    background: rgba(99, 102, 241, 0.15); color: #818cf8;
    padding: 2px 8px; border-radius: 4px; font-size: 0.68rem;
    font-weight: 700; flex-shrink: 0;
}

/* Bloom's ceiling grid */
.ps-bloom-grid {
    display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem 0;
}
.ps-bloom-check {
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.75rem; background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 6px;
    font-size: 0.82rem; color: var(--text-primary); cursor: pointer; transition: all 0.15s;
}
.ps-bloom-check:hover { border-color: rgba(99, 102, 241, 0.3); }
.ps-bloom-check input[type="checkbox"] { accent-color: #6366f1; }

/* Objective mapping reference */
.ps-mapping-ref {
    padding: 0.4rem 0.6rem; font-size: 0.8rem; color: var(--text-muted);
    border-left: 3px solid rgba(100, 116, 139, 0.3); margin-bottom: 0.25rem;
}
.ps-mapping-ref--mapped { border-left-color: #10b981; color: var(--text-primary); }

/* Linked resources display */
.ps-linked-resource {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.45rem 0.65rem; background: rgba(0, 0, 0, 0.12);
    border-radius: 6px; margin-bottom: 0.35rem; font-size: 0.82rem;
}
.ps-linked-resource-icon { font-size: 1rem; flex-shrink: 0; }
.ps-linked-resource-title { flex: 1; color: var(--text-primary); }
.ps-linked-resource-scope {
    font-size: 0.7rem; color: var(--text-muted); text-transform: capitalize;
    background: rgba(99, 102, 241, 0.1); padding: 1px 6px; border-radius: 3px;
}

/* Coverage row (inside objective cards) */
.ps-obj-coverage-row {
    display: flex; align-items: center; gap: 0.4rem;
    margin-bottom: 0.3rem; font-size: 0.82rem;
}

/* ─── Module Objective Card Layout ────────────────────────────────────── */
.ps-obj-top-row {
    display: flex; align-items: flex-start; gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: rgba(99, 102, 241, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.ps-obj-desc {
    flex: 1; resize: none; overflow: hidden;
    min-height: 1.6em; line-height: 1.4;
    font-family: inherit; font-size: 0.85rem;
    height: auto; /* let auto-resize handle it */
    field-sizing: content; /* native auto-size in supported browsers */
}
.ps-obj-meta-row {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.85rem; flex-wrap: wrap;
}
.ps-obj-meta-fields {
    display: flex; align-items: center; gap: 0.4rem;
    margin-left: auto; flex-shrink: 0;
}
.ps-hrs-wrapper {
    display: flex; align-items: center; gap: 2px; flex-shrink: 0;
}
.ps-obj-hours {
    width: 42px !important; text-align: center;
    padding: 4px 2px !important; font-size: 0.75rem;
}
.ps-hrs-suffix {
    font-size: 0.68rem; color: var(--text-muted); white-space: nowrap;
}

/* Add reference button */
.ps-btn-add-ref {
    background: rgba(99, 102, 241, 0.1); border: 1px dashed rgba(99, 102, 241, 0.3);
    color: #818cf8; padding: 2px 8px; border-radius: 4px; cursor: pointer;
    font-size: 0.72rem; white-space: nowrap; transition: all 0.15s; flex-shrink: 0;
}
.ps-btn-add-ref:hover { background: rgba(99, 102, 241, 0.2); border-style: solid; }

/* Inline add-coverage row */
.ps-obj-add-cov-row {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 0.85rem; border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(99, 102, 241, 0.03); flex-wrap: wrap;
}
.ps-cov-resource-select {
    flex: 1; min-width: 140px; max-width: 250px;
    font-size: 0.78rem; padding: 4px 6px;
}
.ps-cov-custom-title {
    flex: 1; min-width: 120px; max-width: 200px;
    font-size: 0.78rem; padding: 4px 6px;
}
.ps-cov-page-input {
    width: 55px !important; text-align: center;
    font-size: 0.78rem; padding: 4px 4px !important;
}
.ps-btn-confirm-ref {
    background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981; padding: 3px 10px; border-radius: 4px; cursor: pointer;
    font-size: 0.85rem; font-weight: 700; transition: all 0.15s;
}
.ps-btn-confirm-ref:hover { background: rgba(16, 185, 129, 0.3); }

/* Outcome row for chapter editor */
.ps-outcome-row {
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 0.4rem;
}

/* Tag list for concepts */
.ps-tag-input-row { display: flex; gap: 0.4rem; align-items: center; }


/* ═══════════════════════════════════════════════════════════════════════════
   LESSON CONTEXT BAR — [DEPRECATED] Now uses ps-module-context-bar classes.
   Kept temporarily for backward compatibility. Remove in future cleanup.
   ═══════════════════════════════════════════════════════════════════════════ */

.ps-lesson-context-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.65rem 1rem;
    margin-bottom: 0.75rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    flex-wrap: wrap;
}

.ps-lesson-context-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
}

.ps-lesson-context-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
}

.ps-lesson-context-label {
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
}

.ps-lesson-context-value {
    color: var(--text-primary, #e2e8f0);
    font-size: 0.82rem;
}

.ps-input--compact {
    width: auto !important;
    padding: 0.3rem 0.5rem;
    font-size: 0.82rem;
    text-align: center;
}


/* ═══════════════════════════════════════════════════════════════════════════
   PROGRESSIVE DISCLOSURE — Module & Chapter Editors
   ═══════════════════════════════════════════════════════════════════════════ */

/* ✨ Section Generate Button (in section headers) */
.ps-section-gen-btn {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #c084fc;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.ps-section-gen-btn:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.18));
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.2);
}

/* Section instruction textarea (for optional instructions before generation) */
.ps-section-instruction {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
}
.ps-instruction-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    color: var(--text-primary, #e2e8f0);
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}
.ps-instruction-input:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.4);
}
.ps-instruction-input::placeholder {
    color: var(--text-muted, #64748b);
    font-style: italic;
    font-size: 0.72rem;
}

/* Structure Locked badge (in review card area) */
.ps-lock-confirmed-badge .ps-lock-badge-detail {
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    display: block;
    margin-top: 0.25rem;
}

/* Structured outcome row (chapter plan editor) */
.ps-outcome-structured {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.65rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.ps-outcome-id {
    font-size: 0.7rem;
    font-weight: 700;
    color: #818cf8;
    background: rgba(99, 102, 241, 0.12);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.ps-bloom-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    color: var(--text-primary, #e2e8f0);
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    width: 110px;
}
.ps-bloom-select:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
}
.ps-bloom-select option {
    background: var(--bg-primary, #0f0f1e);
    color: var(--text-primary, #e2e8f0);
}

/* ─── Hours Row Layout ─────────────────────────────────────────────────── */
.ps-hours-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* ─── Hours Mismatch Warning ───────────────────────────────────────────── */
.ps-hours-mismatch {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    font-size: 0.82rem;
    color: #f59e0b;
}
.ps-hours-mismatch-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

/* ─── Hours Match Success ──────────────────────────────────────────────── */
.ps-hours-match {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-top: 8px;
    font-size: 0.82rem;
    color: rgba(52, 211, 153, 0.8);
}

/* ─── Coverage Read-Only Display ───────────────────────────────────────── */
.ps-obj-coverage-row--readonly {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}
.ps-coverage-ref {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.ps-coverage-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
}
.ps-coverage-title {
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ps-coverage-pages {
    font-size: 0.72rem;
    padding: 1px 6px;
    background: rgba(99, 102, 241, 0.12);
    color: rgba(129, 140, 248, 0.9);
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.ps-coverage-pages--no-range {
    background: rgba(148, 163, 184, 0.10);
    color: rgba(148, 163, 184, 0.7);
    font-style: italic;
}

/* ─── Module Context Bar ───────────────────────────────────────────────── */
.ps-module-context-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 14px;
    margin-bottom: 10px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 8px;
    flex-wrap: wrap;
}
.ps-ctx-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.ps-ctx-icon {
    font-size: 0.85rem;
}
.ps-ctx-value {
    font-size: 0.78rem;
    color: var(--text-secondary, #94a3b8);
    font-weight: 500;
}
.ps-ctx-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.ps-ctx-badge--draft {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}
.ps-ctx-badge--locked {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}
.ps-ctx-badge--complete {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}
.ps-ctx-badge--ok {
    background: rgba(34, 197, 94, 0.08);
    color: #22c55e;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
}
.ps-ctx-badge--warn {
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
}
.ps-ctx-badge--action {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}
.ps-ctx-badge--action:hover {
    background: rgba(99, 102, 241, 0.25);
}
.ps-ctx-badge--lock {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(234, 88, 12, 0.1));
    color: #fbbf24;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(245, 158, 11, 0.25);
    font-weight: 700;
}
.ps-ctx-badge--lock:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(234, 88, 12, 0.2));
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

/* ─── Resource Change Warning Banner ───────────────────────────────────── */
.ps-resource-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 8px;
    animation: ps-warn-fadein 0.4s ease-out;
}
@keyframes ps-warn-fadein {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.ps-resource-warning-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.ps-resource-warning-text {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-primary, #e2e8f0);
    line-height: 1.5;
}
.ps-resource-warning-text strong {
    color: #f59e0b;
}
.ps-resource-warning-detail {
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
}

/* ═══════════════════════════════════════════════════════════════════════════
   GENERATE ALL REMAINING BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */

.ps-generate-remaining-bar {
    padding: 0.5rem 1rem; text-align: center;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.06), transparent);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}
.ps-btn-generate-remaining {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white; border: none; padding: 0.55rem 1.4rem;
    border-radius: 8px; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s; letter-spacing: 0.3px;
}
.ps-btn-generate-remaining:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
}
.ps-btn-generate-remaining:disabled {
    opacity: 0.6; cursor: wait;
}

/* ═══════════════════════════════════════════════════════════════════════════
   VALIDATION BANNER
   ═══════════════════════════════════════════════════════════════════════════ */

.ps-validation-banner {
    margin: 0.5rem 0; border-radius: 8px; overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.12);
}
.ps-validation-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0.75rem; font-size: 0.8rem; font-weight: 600;
}
.ps-validation-header--pass {
    background: rgba(34, 197, 94, 0.1); color: #4ade80;
    border-bottom: 1px solid rgba(34, 197, 94, 0.15);
}
.ps-validation-header--warn {
    background: rgba(251, 191, 36, 0.1); color: #fbbf24;
    border-bottom: 1px solid rgba(251, 191, 36, 0.15);
}
.ps-validation-header--fail {
    background: rgba(239, 68, 68, 0.1); color: #f87171;
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}
.ps-validation-dismiss {
    background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted); padding: 2px 10px; border-radius: 4px;
    font-size: 0.72rem; cursor: pointer; transition: all 0.15s;
}
.ps-validation-dismiss:hover {
    background: rgba(255, 255, 255, 0.15);
}
.ps-validation-items {
    padding: 0.4rem 0.75rem;
}
.ps-validation-item {
    display: flex; align-items: flex-start; gap: 6px;
    padding: 0.3rem 0; font-size: 0.78rem; line-height: 1.4;
}
.ps-validation-icon { flex-shrink: 0; }
.ps-validation-label {
    font-weight: 600; flex-shrink: 0; min-width: 110px;
    color: var(--text-secondary, #cbd5e1);
}
.ps-validation-msg { color: var(--text-muted, #94a3b8); }
.ps-validation-item--pass .ps-validation-msg { color: #4ade80; }
.ps-validation-item--warn .ps-validation-msg { color: #fbbf24; }
.ps-validation-item--fail .ps-validation-msg { color: #f87171; }
