/* ============================================================
   EDT Case Room — edt.css
   Styles for the Ethical Decision Training engine.
   Warehouse palette: magenta (#ff00ff) on near-black (#0d0810).
   Fonts: Inter (body), JetBrains Mono (evidence + labels).

   Design metaphor: a cluttered investigation workspace.
   Evidence cards = physical documents. Phase tape = amber
   industrial marker. Decisions = locked file drawers.
   Framework challenge = incoming analyst transmission.
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Warehouse palette */
    --edt-bg:           #0d0810;
    --edt-bg-deep:      #090609;
    --edt-bg-card:      #120b14;
    --edt-bg-doc:       #f2eed8;  /* off-white document surface */
    --edt-bg-doc-dark:  #e8e3cc;
    --edt-primary:      #ff00ff;
    --edt-primary-dim:  rgba(255, 0, 255, 0.6);
    --edt-primary-glow: rgba(255, 0, 255, 0.20);
    --edt-primary-bg:   rgba(255, 0, 255, 0.05);
    --edt-primary-border: rgba(255, 0, 255, 0.22);
    --edt-amber:        #f59e0b;
    --edt-amber-dim:    rgba(245, 158, 11, 0.7);
    --edt-amber-bg:     rgba(245, 158, 11, 0.08);
    --edt-amber-border: rgba(245, 158, 11, 0.30);
    --edt-cyan:         #00ffff;
    --edt-cyan-dim:     rgba(0, 255, 255, 0.5);
    --edt-success:      #00ff9d;
    --edt-success-bg:   rgba(0, 255, 157, 0.08);
    --edt-danger:       #ff4444;
    --edt-danger-bg:    rgba(255, 68, 68, 0.08);
    --edt-text:         #ede0f0;
    --edt-text-sec:     #9a82a0;
    --edt-text-muted:   #5a4460;
    --edt-border:       rgba(255, 0, 255, 0.12);
    --edt-border-strong: rgba(255, 0, 255, 0.28);
    --edt-mono:         'JetBrains Mono', 'Courier New', Courier, monospace;
    --edt-sans:         'Inter', 'Segoe UI', system-ui, sans-serif;
    --edt-radius:       8px;
    --edt-transition:   0.22s ease;
}

body {
    font-family: var(--edt-sans);
    background: var(--edt-bg);
    color: var(--edt-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Visually hidden: accessibility anchor */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Case Room Root ───────────────────────────────────────── */
#caseroom {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}

/* ── Header Bar ───────────────────────────────────────────── */
.edt-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--edt-border);
}

.edt-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.edt-course-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--edt-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--edt-primary);
    background: var(--edt-primary-bg);
    border: 1px solid var(--edt-primary-border);
    padding: 3px 10px;
    border-radius: 4px;
    width: fit-content;
    margin-bottom: 6px;
}

.edt-title {
    font-family: var(--edt-sans);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--edt-text);
    line-height: 1.2;
}

.edt-subtitle {
    font-family: var(--edt-mono);
    font-size: 0.78rem;
    color: var(--edt-text-sec);
    margin-top: 2px;
    letter-spacing: 0.04em;
}

.edt-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.edt-meta-chip {
    font-family: var(--edt-mono);
    font-size: 0.65rem;
    color: var(--edt-text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.edt-meta-chip span {
    color: var(--edt-amber);
}

.edt-header-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.edt-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--edt-mono);
    font-size: 0.68rem;
    color: var(--edt-text-muted);
    text-decoration: none;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color var(--edt-transition);
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.edt-back-link:hover {
    color: var(--edt-primary);
    border-color: var(--edt-primary-border);
}

.edt-back-link img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    opacity: 0.5;
    filter: invert(1);
}

.edt-back-link:hover img {
    opacity: 0.9;
}

/* ── Phase Indicator — Industrial Tape Aesthetic ──────────── */
.edt-phase-indicator {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 36px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(245, 158, 11, 0.20);
    position: relative;
}

/* Cross-hatch tape pattern behind the whole bar */
.edt-phase-indicator::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 6px,
        rgba(245, 158, 11, 0.025) 6px,
        rgba(245, 158, 11, 0.025) 8px
    );
    pointer-events: none;
    z-index: 0;
}

.edt-phase-segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 8px;
    cursor: default;
    position: relative;
    z-index: 1;
    background: #0f0a11;
    border-right: 1px solid rgba(245, 158, 11, 0.12);
    transition: background var(--edt-transition);
}

.edt-phase-segment:last-child {
    border-right: none;
}

.edt-phase-num {
    font-family: var(--edt-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--edt-text-muted);
    white-space: nowrap;
}

.edt-phase-label {
    font-family: var(--edt-mono);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--edt-text-muted);
    white-space: nowrap;
}

/* Past phase */
.edt-phase-segment.edt-phase-done {
    background: rgba(0, 255, 157, 0.04);
}

.edt-phase-segment.edt-phase-done .edt-phase-num,
.edt-phase-segment.edt-phase-done .edt-phase-label {
    color: var(--edt-success);
    opacity: 0.7;
}

/* Active phase */
.edt-phase-segment.edt-phase-active {
    background: var(--edt-amber-bg);
    border-right-color: rgba(245, 158, 11, 0.25);
}

.edt-phase-segment.edt-phase-active .edt-phase-num {
    color: var(--edt-amber);
    font-weight: 700;
}

.edt-phase-segment.edt-phase-active .edt-phase-label {
    color: var(--edt-text);
    font-weight: 600;
}

/* Active indicator dot */
.edt-phase-segment.edt-phase-active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--edt-amber);
    box-shadow: 0 0 6px var(--edt-amber);
}

/* ── Phase Panels (one rendered at a time) ────────────────── */
.edt-phase-panel {
    display: none;
    animation: edtFadeIn 0.3s ease;
}

.edt-phase-panel.edt-active {
    display: block;
}

@keyframes edtFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Phase Section Headers ────────────────────────────────── */
.edt-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.edt-section-header img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.7;
    filter: invert(1) sepia(1) saturate(5) hue-rotate(255deg);
    /* Tints the icon magenta */
}

.edt-section-title {
    font-family: var(--edt-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--edt-primary);
}

.edt-section-desc {
    font-family: var(--edt-sans);
    font-size: 0.82rem;
    color: var(--edt-text-sec);
    margin-top: 4px;
}

/* ── PHASE 1: Brief / Document Viewer ─────────────────────── */
.edt-brief-wrapper {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.edt-brief-doc {
    flex: 1;
    min-width: 300px;
    background: var(--edt-bg-doc);
    border-radius: 4px;
    padding: 36px 40px;
    position: relative;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.3),
        0 8px 24px rgba(0,0,0,0.5),
        inset 0 0 0 1px rgba(0,0,0,0.08);

    /* Subtle paper grain via CSS gradient */
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 27px,
            rgba(0, 0, 0, 0.04) 27px,
            rgba(0, 0, 0, 0.04) 28px
        ),
        linear-gradient(135deg, #f4efda 0%, #ede9d5 50%, #f0ecda 100%);
}

/* Folded corner effect */
.edt-brief-doc::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 32px 32px 0;
    border-color: transparent var(--edt-bg-card) transparent transparent;
}

.edt-doc-classification {
    display: inline-block;
    font-family: var(--edt-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: #cc1111;
    border: 2px solid #cc1111;
    padding: 2px 10px;
    border-radius: 2px;
    margin-bottom: 20px;
    opacity: 0.85;
}

.edt-doc-meta {
    font-family: var(--edt-mono);
    font-size: 0.7rem;
    color: #4a3a2a;
    margin-bottom: 20px;
    line-height: 1.8;
}

.edt-doc-meta strong {
    color: #2a1a0a;
    display: inline-block;
    width: 60px;
}

.edt-doc-divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    margin: 16px 0;
}

.edt-doc-body {
    font-family: var(--edt-mono);
    font-size: 0.78rem;
    line-height: 1.75;
    color: #2a1a0a;
}

.edt-brief-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.edt-brief-context {
    background: var(--edt-primary-bg);
    border: 1px solid var(--edt-primary-border);
    border-radius: var(--edt-radius);
    padding: 16px;
}

.edt-brief-context-title {
    font-family: var(--edt-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--edt-primary);
    margin-bottom: 10px;
}

.edt-brief-context p {
    font-size: 0.78rem;
    color: var(--edt-text-sec);
    line-height: 1.6;
    margin-bottom: 8px;
}

.edt-brief-context p:last-child {
    margin-bottom: 0;
}

.edt-brief-instructions {
    background: var(--edt-amber-bg);
    border: 1px solid var(--edt-amber-border);
    border-radius: var(--edt-radius);
    padding: 16px;
}

.edt-brief-instructions-title {
    font-family: var(--edt-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--edt-amber);
    margin-bottom: 10px;
}

.edt-brief-step {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.76rem;
    color: var(--edt-text-sec);
    line-height: 1.5;
}

.edt-brief-step-num {
    font-family: var(--edt-mono);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--edt-amber);
    background: var(--edt-amber-bg);
    border: 1px solid var(--edt-amber-border);
    border-radius: 3px;
    padding: 1px 6px;
    flex-shrink: 0;
    line-height: 1.6;
}

/* ── PHASE 2: Evidence Board ──────────────────────────────── */
.edt-evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.edt-evidence-card {
    background: var(--edt-bg-doc);
    border-radius: 4px;
    padding: 20px 22px;
    position: relative;
    cursor: default;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.25),
        0 6px 16px rgba(0,0,0,0.4);

    background-image:
        linear-gradient(135deg, #f4efda 0%, #ede9d5 60%, #f0ecda 100%);

    /* Slight rotation per card for physical feel */
    transform: rotate(0deg);
    transition: transform var(--edt-transition), box-shadow var(--edt-transition);
}

/* Alternating slight tilts */
.edt-evidence-card:nth-child(odd)  { transform: rotate(-0.4deg); }
.edt-evidence-card:nth-child(even) { transform: rotate(0.3deg); }

.edt-evidence-card:hover {
    transform: rotate(0deg) translateY(-3px);
    box-shadow:
        0 4px 8px rgba(0,0,0,0.35),
        0 12px 28px rgba(0,0,0,0.55);
    z-index: 10;
}

/* Pin marker (visible when selected as relevant) */
.edt-evidence-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--edt-bg-card);
    border: 2px solid var(--edt-text-muted);
    opacity: 0;
    transition: opacity var(--edt-transition), border-color var(--edt-transition);
    z-index: 2;
}

.edt-evidence-card.edt-tagged-relevant::before {
    opacity: 1;
    border-color: var(--edt-success);
    background: var(--edt-success);
    box-shadow: 0 0 8px rgba(0, 255, 157, 0.6);
}

.edt-evidence-card.edt-tagged-contested::before {
    opacity: 1;
    border-color: var(--edt-amber);
    background: var(--edt-amber);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.edt-evidence-card.edt-tagged-irrelevant::before {
    opacity: 1;
    border-color: var(--edt-danger);
    background: var(--edt-danger);
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
}

.edt-evidence-id {
    font-family: var(--edt-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7a6a5a;
    margin-bottom: 6px;
}

.edt-evidence-type-badge {
    display: inline-block;
    font-family: var(--edt-mono);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #5a4a3a;
    background: rgba(0,0,0,0.07);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 3px;
    padding: 1px 7px;
    margin-bottom: 10px;
}

.edt-evidence-title {
    font-family: var(--edt-mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a0e0a;
    margin-bottom: 4px;
    line-height: 1.3;
}

.edt-evidence-date {
    font-family: var(--edt-mono);
    font-size: 0.62rem;
    color: #7a6a5a;
    margin-bottom: 10px;
}

.edt-evidence-content {
    font-family: var(--edt-mono);
    font-size: 0.72rem;
    line-height: 1.65;
    color: #2a1a0a;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 10px;
    margin-bottom: 16px;
}

/* Tagging controls on evidence card */
.edt-evidence-tag-controls {
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 12px;
    margin-top: auto;
}

.edt-tag-label {
    font-family: var(--edt-mono);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7a6a5a;
    margin-bottom: 8px;
    display: block;
}

.edt-tag-radios {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.edt-tag-radio {
    display: none;
}

.edt-tag-btn {
    font-family: var(--edt-mono);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.18);
    background: rgba(0,0,0,0.05);
    color: #5a4a3a;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.edt-tag-btn:hover {
    background: rgba(0,0,0,0.10);
}

/* Active state per tag type */
.edt-tag-radio[value="relevant"]:checked ~ * .edt-tag-btn[data-for="relevant"],
input[data-tag="relevant"].edt-tag-active ~ * {
    background: rgba(0, 255, 157, 0.18);
    border-color: rgba(0, 200, 120, 0.5);
    color: #006644;
}

.edt-tag-btn.edt-btn-relevant.edt-tag-active {
    background: rgba(0, 180, 100, 0.15);
    border-color: rgba(0, 200, 120, 0.5);
    color: #005533;
    font-weight: 700;
}

.edt-tag-btn.edt-btn-irrelevant.edt-tag-active {
    background: rgba(200, 60, 60, 0.15);
    border-color: rgba(200, 60, 60, 0.4);
    color: #882222;
    font-weight: 700;
}

.edt-tag-btn.edt-btn-contested.edt-tag-active {
    background: rgba(200, 140, 0, 0.15);
    border-color: rgba(200, 140, 0, 0.4);
    color: #7a5500;
    font-weight: 700;
}

.edt-tag-explanation {
    width: 100%;
    font-family: var(--edt-mono);
    font-size: 0.68rem;
    background: rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 3px;
    padding: 6px 8px;
    color: #1a0e0a;
    resize: vertical;
    min-height: 54px;
    line-height: 1.5;
    display: none; /* shown after tag selection */
}

.edt-tag-explanation::placeholder {
    color: #9a8a7a;
}

.edt-tag-explanation.edt-visible {
    display: block;
    animation: edtFadeIn 0.2s ease;
}

/* Evidence progress counter */
.edt-evidence-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--edt-bg-card);
    border: 1px solid var(--edt-border);
    border-radius: var(--edt-radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-family: var(--edt-mono);
    font-size: 0.7rem;
}

.edt-evidence-count {
    color: var(--edt-text-sec);
}

.edt-evidence-count strong {
    color: var(--edt-primary);
    font-size: 0.85rem;
}

/* ── PHASE 3: Stakeholders + Decision ────────────────────── */
.edt-stakeholder-section {
    margin-bottom: 36px;
}

.edt-stakeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.edt-stakeholder-item {
    position: relative;
}

.edt-stakeholder-checkbox {
    display: none;
}

.edt-stakeholder-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--edt-radius);
    border: 1px solid var(--edt-border);
    background: var(--edt-bg-card);
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--edt-text-sec);
    transition: all var(--edt-transition);
    user-select: none;
    line-height: 1.4;
}

.edt-stakeholder-label:hover {
    border-color: var(--edt-primary-border);
    color: var(--edt-text);
}

/* Pin marker that appears when checked */
.edt-pin-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--edt-border-strong);
    background: transparent;
    flex-shrink: 0;
    transition: all var(--edt-transition);
}

.edt-stakeholder-checkbox:checked + .edt-stakeholder-label {
    border-color: var(--edt-primary);
    background: var(--edt-primary-bg);
    color: var(--edt-text);
}

.edt-stakeholder-checkbox:checked + .edt-stakeholder-label .edt-pin-marker {
    background: var(--edt-primary);
    border-color: var(--edt-primary);
    box-shadow: 0 0 8px var(--edt-primary-glow);
}

/* Non-obvious stakeholder: slightly dimmed until discovered */
/* All stakeholders appear identical -- no visual tells for obvious/non-obvious/irrelevant */

.edt-stakeholder-count-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    margin-bottom: 12px;
}

.edt-stakeholder-count-bar span {
    font-family: var(--edt-mono);
    font-size: 0.68rem;
    color: var(--edt-text-muted);
}

.edt-stakeholder-count-bar strong {
    color: var(--edt-primary);
}

/* ── Decision Block ───────────────────────────────────────── */
.edt-decision-section {
    margin-bottom: 0;
}

.edt-decision-intro {
    background: var(--edt-amber-bg);
    border: 1px solid var(--edt-amber-border);
    border-radius: var(--edt-radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 0.82rem;
    color: var(--edt-text-sec);
    line-height: 1.6;
    border-left: 3px solid var(--edt-amber);
}

.edt-decision-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.edt-decision-item {
    position: relative;
}

.edt-decision-radio {
    display: none;
}

.edt-decision-label {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--edt-radius);
    border: 1px solid var(--edt-border);
    background: var(--edt-bg-card);
    cursor: pointer;
    transition: all var(--edt-transition);
    user-select: none;
    line-height: 1.5;
}

.edt-decision-label:hover {
    border-color: var(--edt-primary-border);
    background: rgba(255, 0, 255, 0.03);
}

.edt-decision-radio:checked + .edt-decision-label {
    border-color: var(--edt-primary);
    background: var(--edt-primary-bg);
}

/* Decision index pill */
.edt-decision-index {
    font-family: var(--edt-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--edt-text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--edt-border);
    border-radius: 4px;
    padding: 2px 8px;
    flex-shrink: 0;
    transition: all var(--edt-transition);
    margin-top: 2px;
}

.edt-decision-radio:checked + .edt-decision-label .edt-decision-index {
    color: var(--edt-primary);
    border-color: var(--edt-primary-border);
    background: var(--edt-primary-bg);
}

.edt-decision-text {
    font-size: 0.85rem;
    color: var(--edt-text);
    flex: 1;
}

/* Locked state — after commit */
.edt-decision-locked .edt-decision-label {
    cursor: default;
    pointer-events: none;
    opacity: 0.55;
}

.edt-decision-locked .edt-decision-radio:checked + .edt-decision-label {
    opacity: 1;
    border-color: var(--edt-primary);
    background: var(--edt-primary-bg);
}

/* LOCK IN button */
.edt-commit-btn {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: 14px 24px;
    font-family: var(--edt-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--edt-bg);
    background: var(--edt-primary);
    border: 2px solid var(--edt-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--edt-transition);
    box-shadow: 0 0 24px rgba(255, 0, 255, 0.25);
    position: relative;
    overflow: hidden;
}

.edt-commit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(255,255,255,0.1) 0%,
        transparent 50%
    );
}

.edt-commit-btn:hover:not(:disabled) {
    box-shadow: 0 0 40px rgba(255, 0, 255, 0.45);
    transform: translateY(-1px);
}

.edt-commit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.edt-commit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    background: var(--edt-text-muted);
    border-color: var(--edt-text-muted);
    color: var(--edt-text);
}

.edt-commit-btn.edt-locked {
    background: var(--edt-bg-card);
    border-color: var(--edt-primary-border);
    color: var(--edt-primary-dim);
    box-shadow: none;
    cursor: default;
    pointer-events: none;
    font-size: 0.68rem;
    letter-spacing: 0.20em;
}

/* ── PHASE 4: Framework Challenge ────────────────────────── */

/* Transmission animation wrapper */
.edt-transmission-wrapper {
    position: relative;
    margin-bottom: 28px;
}

.edt-transmission-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(0, 255, 255, 0.04);
    border: 1px solid rgba(0, 255, 255, 0.18);
    border-bottom: none;
    border-radius: var(--edt-radius) var(--edt-radius) 0 0;
    font-family: var(--edt-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--edt-cyan);
}

/* Pulsing dot — "incoming" indicator */
.edt-tx-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--edt-cyan);
    box-shadow: 0 0 8px var(--edt-cyan);
    flex-shrink: 0;
    animation: edtTxPulse 1.4s ease-in-out infinite;
}

@keyframes edtTxPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--edt-cyan); }
    50%       { opacity: 0.4; box-shadow: 0 0 3px var(--edt-cyan); }
}

.edt-transmission-body {
    border: 1px solid rgba(0, 255, 255, 0.18);
    border-radius: 0 0 var(--edt-radius) var(--edt-radius);
    overflow: hidden;
    animation: edtTransmitIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes edtTransmitIn {
    from { opacity: 0; transform: translateY(-12px); clip-path: inset(0 0 100% 0); }
    to   { opacity: 1; transform: translateY(0);     clip-path: inset(0 0 0% 0); }
}

.edt-framework-block {
    padding: 20px 22px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.10);
}

.edt-framework-block:last-child {
    border-bottom: none;
}

.edt-framework-block-label {
    font-family: var(--edt-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.edt-framework-block-label.edt-label-supporting {
    color: var(--edt-success);
}

.edt-framework-block-label.edt-label-challenging {
    color: var(--edt-danger);
}

.edt-framework-block-label.edt-label-incomplete {
    color: var(--edt-amber);
}

.edt-framework-block p {
    font-size: 0.82rem;
    line-height: 1.68;
    color: var(--edt-text-sec);
}

/* Student response to framework challenge */
.edt-framework-response-section {
    margin-top: 8px;
}

.edt-framework-prompt {
    background: var(--edt-primary-bg);
    border: 1px solid var(--edt-primary-border);
    border-radius: var(--edt-radius);
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: var(--edt-text-sec);
    line-height: 1.6;
}

.edt-framework-prompt strong {
    color: var(--edt-primary);
    font-family: var(--edt-mono);
    font-size: 0.75rem;
    display: block;
    margin-bottom: 6px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── PHASE 5: Code Conflict ───────────────────────────────── */
.edt-code-provisions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.edt-provision-card {
    background: var(--edt-bg-card);
    border: 1px solid var(--edt-border);
    border-radius: var(--edt-radius);
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: border-color var(--edt-transition);
}

.edt-provision-card:hover {
    border-color: var(--edt-primary-border);
}

.edt-provision-rank {
    font-family: var(--edt-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--edt-text-muted);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--edt-border);
    border-radius: 4px;
    flex-shrink: 0;
    transition: all var(--edt-transition);
}

.edt-provision-card.edt-rank-1 .edt-provision-rank {
    color: var(--edt-primary);
    border-color: var(--edt-primary-border);
    background: var(--edt-primary-bg);
}

.edt-provision-card.edt-rank-2 .edt-provision-rank {
    color: var(--edt-amber);
    border-color: var(--edt-amber-border);
    background: var(--edt-amber-bg);
}

.edt-provision-card.edt-rank-3 .edt-provision-rank {
    color: var(--edt-text-muted);
}

.edt-provision-info {
    flex: 1;
}

.edt-provision-ref {
    font-family: var(--edt-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--edt-primary);
    letter-spacing: 0.10em;
    margin-bottom: 4px;
}

.edt-provision-text {
    font-size: 0.82rem;
    color: var(--edt-text-sec);
    line-height: 1.6;
}

.edt-provision-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.edt-rank-btn {
    font-family: var(--edt-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--edt-border);
    background: transparent;
    color: var(--edt-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.edt-rank-btn:hover {
    border-color: var(--edt-primary-border);
    color: var(--edt-primary);
}

/* Conflict highlight box */
.edt-conflict-box {
    background: rgba(255, 68, 68, 0.04);
    border: 1px solid rgba(255, 68, 68, 0.22);
    border-radius: var(--edt-radius);
    padding: 18px 20px;
    margin-bottom: 20px;
}

.edt-conflict-box-title {
    font-family: var(--edt-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--edt-danger);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.edt-conflict-box-title img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    filter: invert(1) sepia(1) saturate(5) hue-rotate(300deg);
    /* Tints to red-ish */
}

.edt-conflict-box p {
    font-size: 0.82rem;
    line-height: 1.65;
    color: var(--edt-text-sec);
}

/* ── Shared: Text Areas ───────────────────────────────────── */
.edt-textarea {
    width: 100%;
    font-family: var(--edt-mono);
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--edt-border);
    border-radius: var(--edt-radius);
    padding: 12px 14px;
    color: var(--edt-text);
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
    transition: border-color var(--edt-transition);
}

.edt-textarea:focus {
    outline: none;
    border-color: var(--edt-primary-border);
    background: rgba(255, 0, 255, 0.02);
}

.edt-textarea::placeholder {
    color: var(--edt-text-muted);
    font-style: italic;
}

.edt-textarea-label {
    display: block;
    font-family: var(--edt-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--edt-text-muted);
    margin-bottom: 8px;
}

.edt-char-count {
    display: block;
    text-align: right;
    font-family: var(--edt-mono);
    font-size: 0.58rem;
    color: var(--edt-text-muted);
    margin-top: 4px;
}

/* ── Navigation Buttons ───────────────────────────────────── */
.edt-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--edt-border);
    flex-wrap: wrap;
}

.edt-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    font-family: var(--edt-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--edt-bg);
    background: var(--edt-primary);
    border: 2px solid var(--edt-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--edt-transition);
    box-shadow: 0 0 18px rgba(255, 0, 255, 0.2);
}

.edt-btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 32px rgba(255, 0, 255, 0.4);
    transform: translateY(-1px);
}

.edt-btn-primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.edt-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    font-family: var(--edt-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--edt-text-sec);
    background: transparent;
    border: 1px solid var(--edt-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--edt-transition);
}

.edt-btn-secondary:hover {
    border-color: var(--edt-border-strong);
    color: var(--edt-text);
}

.edt-btn-secondary img,
.edt-btn-primary img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    filter: invert(1);
    opacity: 0.8;
}

.edt-nav-hint {
    font-family: var(--edt-mono);
    font-size: 0.62rem;
    color: var(--edt-text-muted);
    letter-spacing: 0.06em;
}

/* ── Submission / Completion Screen ──────────────────────── */
.edt-submit-screen {
    text-align: center;
    padding: 40px 20px 60px;
}

.edt-submit-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: invert(1) sepia(1) saturate(5) hue-rotate(255deg);
    margin: 0 auto 24px;
    display: block;
    opacity: 0.85;
}

.edt-submit-title {
    font-family: var(--edt-sans);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--edt-text);
    margin-bottom: 10px;
}

.edt-submit-desc {
    font-size: 0.88rem;
    color: var(--edt-text-sec);
    line-height: 1.65;
    max-width: 560px;
    margin: 0 auto 28px;
}

.edt-score-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    max-width: 680px;
    margin: 0 auto 32px;
}

.edt-score-cell {
    background: var(--edt-bg-card);
    border: 1px solid var(--edt-border);
    border-radius: var(--edt-radius);
    padding: 16px 14px;
    text-align: center;
}

.edt-score-cell-label {
    font-family: var(--edt-mono);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--edt-text-muted);
    margin-bottom: 8px;
}

.edt-score-cell-value {
    font-family: var(--edt-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--edt-primary);
}

.edt-score-cell-max {
    font-family: var(--edt-mono);
    font-size: 0.62rem;
    color: var(--edt-text-muted);
}

.edt-score-cell.edt-pending .edt-score-cell-value {
    color: var(--edt-amber);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

/* Status messages */
.edt-status-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--edt-radius);
    font-family: var(--edt-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
    line-height: 1.5;
}

.edt-status-msg.edt-status-info {
    background: var(--edt-primary-bg);
    border: 1px solid var(--edt-primary-border);
    color: var(--edt-primary-dim);
}

.edt-status-msg.edt-status-warning {
    background: var(--edt-amber-bg);
    border: 1px solid var(--edt-amber-border);
    color: var(--edt-amber-dim);
}

.edt-status-msg.edt-status-error {
    background: var(--edt-danger-bg);
    border: 1px solid rgba(255, 68, 68, 0.25);
    color: #ff8888;
}

.edt-status-msg.edt-status-success {
    background: var(--edt-success-bg);
    border: 1px solid rgba(0, 255, 157, 0.22);
    color: var(--edt-success);
}

.edt-status-msg img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: invert(1);
    opacity: 0.7;
    flex-shrink: 0;
}

/* Validation error below a required field */
.edt-field-error {
    font-family: var(--edt-mono);
    font-size: 0.62rem;
    color: var(--edt-danger);
    margin-top: 4px;
    letter-spacing: 0.04em;
    display: none;
}

.edt-field-error.edt-visible {
    display: block;
}

/* ── Reflection Mode Overlay ──────────────────────────────── */
.edt-reflection-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: var(--edt-success-bg);
    border: 1px solid rgba(0, 255, 157, 0.22);
    border-radius: var(--edt-radius);
    margin-bottom: 24px;
    font-family: var(--edt-mono);
    font-size: 0.7rem;
    color: var(--edt-success);
    letter-spacing: 0.06em;
}

.edt-reflection-banner img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    filter: invert(1) sepia(1) saturate(5) hue-rotate(100deg);
    flex-shrink: 0;
}

/* ── Spinner ──────────────────────────────────────────────── */
.edt-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--edt-border);
    border-top-color: var(--edt-primary);
    border-radius: 50%;
    animation: edtSpin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes edtSpin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 700px) {
    .edt-brief-wrapper {
        flex-direction: column;
    }

    .edt-brief-sidebar {
        width: 100%;
    }

    .edt-phase-segment {
        padding: 8px 4px;
    }

    .edt-phase-label {
        display: none;
    }

    .edt-evidence-grid {
        grid-template-columns: 1fr;
    }

    .edt-stakeholder-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .edt-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .edt-header-status {
        align-items: flex-start;
    }
}

/* ── Feature 2: Export Report Button ─────────────────────── */

.edt-reflection-banner-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.edt-reflection-banner {
    flex: 1;
    min-width: 0;
}

.edt-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--edt-border-strong);
    border-radius: var(--edt-radius);
    color: var(--edt-text-sec);
    font-family: var(--edt-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color var(--edt-transition), color var(--edt-transition);
    flex-shrink: 0;
}

.edt-export-btn:hover {
    border-color: var(--edt-primary);
    color: var(--edt-text);
}

.edt-export-btn img {
    width: 13px;
    height: 13px;
    opacity: 0.7;
}

/* ── Reset Lab Button ───────────────────────────────────── */
.edt-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--edt-border-strong);
    border-radius: var(--edt-radius);
    color: var(--edt-text-sec);
    font-family: var(--edt-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color var(--edt-transition), color var(--edt-transition), background var(--edt-transition);
    flex-shrink: 0;
}

.edt-reset-btn:hover {
    border-color: var(--edt-danger);
    color: var(--edt-danger);
}

.edt-reset-btn.edt-reset-confirming {
    border-color: var(--edt-danger);
    color: var(--edt-danger);
    background: rgba(255, 68, 68, 0.08);
}

.edt-reset-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.edt-reset-btn img {
    width: 13px;
    height: 13px;
    opacity: 0.7;
}

.edt-banner-error {
    border-color: var(--edt-danger) !important;
    color: var(--edt-danger) !important;
}

/* ── Feature 3: Instructor Feedback Card ────────────────── */

.edt-feedback-loading {
    font-family: var(--edt-mono);
    font-size: 0.72rem;
    color: var(--edt-text-muted);
    padding: 12px 0;
}

.edt-feedback-pending {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--edt-mono);
    font-size: 0.72rem;
    color: var(--edt-text-muted);
    padding: 12px 16px;
    background: var(--edt-bg-card);
    border: 1px solid var(--edt-border);
    border-radius: var(--edt-radius);
}

.edt-feedback-card {
    background: var(--edt-bg-card);
    border: 1px solid var(--edt-border-strong);
    border-radius: var(--edt-radius);
    padding: 20px 22px;
    margin-top: 8px;
}

.edt-feedback-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--edt-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--edt-success);
    margin-bottom: 14px;
}

.edt-feedback-scores {
    display: flex;
    gap: 24px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.edt-feedback-score-item {
    font-family: var(--edt-mono);
    font-size: 0.8rem;
    color: var(--edt-text-sec);
}

.edt-feedback-score-item strong {
    color: var(--edt-text);
    font-size: 1rem;
    margin-left: 4px;
}

.edt-score-total strong {
    color: var(--edt-primary);
}

.edt-feedback-label {
    font-family: var(--edt-mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--edt-text-muted);
    margin-bottom: 10px;
}

.edt-feedback-text {
    font-size: 0.86rem;
    line-height: 1.7;
    color: var(--edt-text-sec);
    white-space: pre-wrap;
    background: rgba(255,0,255,0.03);
    border: 1px solid var(--edt-border);
    border-left: 3px solid var(--edt-primary-dim);
    padding: 14px 16px;
    border-radius: 0 4px 4px 0;
}

/* ── Feature 5: Peer Perspectives Cards ─────────────────── */

.edt-peer-card {
    background: var(--edt-bg-card);
    border: 1px solid var(--edt-border);
    border-radius: var(--edt-radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.edt-peer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--edt-border);
}

.edt-peer-label {
    font-family: var(--edt-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--edt-primary-dim);
    border: 1px solid var(--edt-primary-border);
    padding: 2px 8px;
    border-radius: 3px;
    flex-shrink: 0;
}

.edt-peer-decision {
    font-size: 0.78rem;
    color: var(--edt-text-sec);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edt-peer-decision em {
    font-style: normal;
    color: var(--edt-text);
}

.edt-peer-response {
    padding: 14px 16px;
    font-size: 0.82rem;
    color: var(--edt-text-sec);
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Feature 6: Student Self-Review Boxes ───────────────── */

.edt-self-response-box {
    background: rgba(0, 255, 157, 0.04);
    border: 1px solid rgba(0, 255, 157, 0.20);
    border-left: 3px solid var(--edt-success);
    border-radius: 0 var(--edt-radius) var(--edt-radius) 0;
    padding: 14px 16px;
    margin-top: 14px;
}

.edt-self-response-label {
    font-family: var(--edt-mono);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--edt-success);
    margin-bottom: 8px;
    font-weight: 600;
}

.edt-self-response-text {
    font-size: 0.84rem;
    color: var(--edt-text-sec);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}
