  /* ============================================================
     NCC.training Virtual Classroom v3 — Phase D foundation
     ============================================================ */
  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: #f0f3f8;
    color: #1a1a1a;
    line-height: 1.55;
    min-height: 100vh;
  }

  /* === Top nav === */
  nav.top-nav {
    background: #0f2e5c;
    color: white;
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .brand { font-weight: 700; font-size: 15px; cursor: pointer; }
  .brand .v-tag {
    background: rgba(255,255,255,0.15);
    padding: 1px 8px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
  }
  .nav-links {
    display: flex;
    gap: 16px;
    align-items: center;
  }
  .nav-link {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .nav-link:hover { background: rgba(255,255,255,0.1); color: white; }
  .nav-link.active { background: rgba(255,255,255,0.2); color: white; font-weight: 600; }

  /* === Layer 1 permanent disclaimer === */
  .layer-1-banner {
    background: #fdf4e8;
    border-bottom: 2px solid #d97e2e;
    padding: 6px 24px;
    font-size: 11px;
    color: #553;
    text-align: center;
  }
  .layer-1-banner strong { color: #b22222; }

  /* === Page container === */
  .page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
  }

  h1 { color: #0f2e5c; font-size: 26px; margin-bottom: 6px; }
  h2 { color: #0f2e5c; font-size: 18px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #e0e6ee; }
  h3 { color: #0f2e5c; font-size: 15px; margin-bottom: 8px; }
  h4 { color: #0f2e5c; font-size: 13px; margin-bottom: 4px; }
  p { color: #333; margin-bottom: 8px; }
  .strap { color: #555; max-width: 700px; margin-bottom: 16px; font-size: 14px; }

  .panel {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 14px;
    border: 1px solid #e0e6ee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }

  /* === Buttons === */
  .btn {
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    font-family: inherit;
  }
  .btn-primary { background: #0f2e5c; color: white; }
  .btn-primary:hover { background: #173a70; }
  .btn-secondary { background: white; color: #0f2e5c; border: 1px solid #0f2e5c; }
  .btn-secondary:hover { background: #f0f5ff; }
  .btn-danger { background: #b22222; color: white; }
  .btn-danger:hover { background: #931414; }
  .btn-ghost { background: transparent; color: #555; border: 1px solid #d4dae5; }
  .btn-ghost:hover { background: #f0f3f8; }
  .btn-small { padding: 6px 12px; font-size: 13px; }
  .btn:disabled { opacity: 0.4; cursor: not-allowed; }

  .controls-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 12px;
  }

  /* === Layer 2 disclaimer (mode select) === */
  .layer-2-disclaimer {
    background: #fdf4e8;
    border-left: 4px solid #d97e2e;
    padding: 12px 18px;
    border-radius: 4px;
    margin: 14px 0;
  }
  .layer-2-disclaimer strong { color: #b22222; }
  .layer-2-disclaimer p { color: #553; font-size: 12.5px; margin-bottom: 6px; }
  .layer-2-disclaimer p:last-child { margin-bottom: 0; }

  /* === Layer 3 disclaimer (assessment output) === */
  .layer-3-disclaimer {
    background: #fdf4e8;
    border-left: 4px solid #d97e2e;
    padding: 12px 18px;
    border-radius: 4px;
    margin: 14px 0;
  }
  .layer-3-disclaimer strong { color: #b22222; }
  .layer-3-disclaimer p { color: #553; font-size: 12px; margin-bottom: 6px; }
  .layer-3-disclaimer p:last-child { margin-bottom: 0; }

  /* === Module cards on home === */
  .module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin: 16px 0;
  }
  .module-card {
    background: white;
    border-radius: 10px;
    padding: 18px;
    border: 1px solid #e0e6ee;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
  }
  .module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15,46,92,0.12);
    border-color: #0f2e5c;
  }
  .module-card .module-tag {
    display: inline-block;
    background: #0f2e5c;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
  }
  .module-card .module-tag.coming-soon { background: #888; }
  .module-card .module-tag.day-2 { background: #d97e2e; }
  .module-card .module-tag.day-3 { background: #2a7d6e; }
  .module-card .module-tag.dashboard { background: #b22222; }
  .module-card h3 { margin-bottom: 6px; font-size: 15px; }
  .module-card p { font-size: 12.5px; color: #555; margin-bottom: 0; }
  .module-card .module-stats {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    font-size: 11px;
    color: #888;
  }
  .module-card .module-stats span { display: flex; align-items: center; gap: 4px; }
  .module-card.disabled { opacity: 0.55; cursor: not-allowed; }

  /* === Scoring rubric (used in TAT/WAT self-assessment) === */
  .rubric-dimension {
    background: white;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
    border-left: 4px solid #0f2e5c;
  }
  .rubric-dimension h4 { color: #0f2e5c; font-size: 13px; margin-bottom: 4px; }
  .rubric-dimension .description { font-size: 12px; color: #555; margin-bottom: 8px; }

  .score-buttons {
    display: flex;
    gap: 4px;
  }
  .score-btn {
    flex: 1;
    padding: 7px 0;
    background: #f0f3f8;
    border: 1px solid #d4dae5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    transition: all 0.15s;
  }
  .score-btn:hover { background: #e8f0ff; }
  .score-btn.selected {
    background: #0f2e5c;
    color: white;
    border-color: #0f2e5c;
  }

  /* === Comparison view === */
  .comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
  }
  @media (max-width: 700px) { .comparison-grid { grid-template-columns: 1fr; } }
  .comparison-side {
    background: white;
    border-radius: 8px;
    padding: 14px;
    border: 1px solid #e0e6ee;
  }
  .comparison-side h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
  }
  .comparison-side.self h3 { color: #2a7d6e; }
  .comparison-side.system h3 { color: #d97e2e; }

  .dimension-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #e8edf5;
    align-items: center;
    font-size: 12.5px;
  }
  .dimension-row:last-child { border-bottom: none; }
  .dimension-row .dim-name { color: #333; }
  .dimension-row .dim-score {
    background: #0f2e5c;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    min-width: 36px;
    text-align: center;
  }
  .dimension-row.disagree .dim-score { background: #b22222; }
  .dimension-row.disagree { background: #fff8f8; }

  .total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #0f2e5c;
    font-weight: 700;
  }
  .total-row .total-score { color: #0f2e5c; font-size: 18px; }

  .evidence-list {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f7f9fc;
    border-radius: 4px;
    font-size: 11.5px;
    color: #555;
  }
  .evidence-list ul { margin-left: 16px; margin-top: 3px; }
  .evidence-list li { margin: 2px 0; }

  /* === Story / response display === */
  .response-display {
    background: #f7f9fc;
    border-left: 4px solid #2a7d6e;
    padding: 10px 14px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 13.5px;
    line-height: 1.65;
    white-space: pre-wrap;
  }

  /* === Picture display (TAT) === */
  .picture-display {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f2e5c 100%);
    color: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 14px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: opacity 0.5s;
  }
  .picture-display.fading { opacity: 0.2; }
  .picture-display.faded { opacity: 0.1; pointer-events: none; }
  .picture-display .picture-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #d97e2e;
    margin-bottom: 10px;
    font-weight: 700;
  }
  .picture-display .picture-content {
    font-size: 16px;
    line-height: 1.7;
    max-width: 700px;
  }
  .picture-display.blank-slide .picture-content::before {
    content: "BLANK SLIDE";
    display: block;
    font-size: 28px;
    letter-spacing: 4px;
    color: #d97e2e;
    margin-bottom: 12px;
  }

  /* === WAT word stream === */
  .wat-word-display {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f2e5c 100%);
    color: white;
    border-radius: 10px;
    padding: 50px 30px;
    margin-bottom: 14px;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .wat-word-display .word {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
  }
  .wat-word-display .word-meta {
    margin-top: 10px;
    font-size: 12px;
    color: #d97e2e;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  /* === Writing input === */
  textarea {
    width: 100%;
    padding: 14px;
    font-family: inherit;
    font-size: 14.5px;
    line-height: 1.6;
    border: 2px solid #e0e6ee;
    border-radius: 6px;
    resize: vertical;
    background: white;
  }
  textarea:focus { outline: none; border-color: #0f2e5c; }

  input[type="text"], select {
    padding: 7px 10px;
    border-radius: 4px;
    border: 1px solid #d4dae5;
    font-family: inherit;
    font-size: 13px;
  }
  input[type="text"]:focus, select:focus { outline: none; border-color: #0f2e5c; }

  .input-stats {
    display: flex;
    gap: 14px;
    margin-top: 6px;
    font-size: 11.5px;
    color: #555;
  }
  .stat-good { color: #2a7d6e; }
  .stat-warn { color: #d97e2e; }
  .stat-bad { color: #b22222; }

  /* === Top status bar (during sessions) === */
  .status-bar {
    background: #1a3a6e;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
  }
  .status-bar .progress { display: flex; gap: 12px; align-items: center; }
  .status-bar .timer {
    background: rgba(255,255,255,0.15);
    padding: 3px 10px;
    border-radius: 3px;
    font-family: "SF Mono", "Consolas", monospace;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
  }
  .status-bar .timer.warning { background: #b22222; animation: pulse 1s infinite; }
  @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

  /* === Dashboard === */
  .stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 14px 0;
  }
  .stat-card {
    background: white;
    border-radius: 8px;
    padding: 14px;
    border: 1px solid #e0e6ee;
    text-align: center;
  }
  .stat-card .label {
    color: #888;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-bottom: 4px;
  }
  .stat-card .value {
    color: #0f2e5c;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
  }
  .stat-card .sub { font-size: 10.5px; color: #555; margin-top: 4px; }
  .stat-card.tat { border-top: 3px solid #2196f3; }
  .stat-card.wat { border-top: 3px solid #ff9800; }
  .stat-card.srt { border-top: 3px solid #2a7d6e; }

  /* === OLQ chips === */
  .olq-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
  }
  .olq-chip {
    background: #0f2e5c;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .olq-chip .count {
    background: rgba(255,255,255,0.25);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
  }
  .olq-chip.strong { background: #2a7d6e; }
  .olq-chip.weak { background: #888; }

  /* === Session list === */
  .session-list { display: flex; flex-direction: column; gap: 6px; }
  .session-item {
    background: white;
    border-radius: 6px;
    padding: 10px 14px;
    border-left: 4px solid #0f2e5c;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .session-item.tat { border-left-color: #2196f3; }
  .session-item.wat { border-left-color: #ff9800; }
  .session-item.srt { border-left-color: #2a7d6e; }
  .session-item.sd { border-left-color: #b22222; }
  .session-item.ppdt { border-left-color: #6a1b9a; }
  .session-item.oir { border-left-color: #455a64; }
  .session-item .session-meta { display: flex; gap: 8px; align-items: center; }
  .session-item .session-meta .tag {
    background: #f0f3f8;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    color: #555;
    font-weight: 600;
  }
  .session-item .score { font-weight: 700; color: #0f2e5c; }

  /* === Status messages === */
  .status-msg {
    padding: 10px 14px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 13px;
  }
  .status-msg.info { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }
  .status-msg.success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
  .status-msg.warning { background: #fff3cd; color: #856404; border-left: 4px solid #ffc107; }

  /* === Footer === */
  .footer-note {
    text-align: center;
    color: #888;
    font-size: 11px;
    padding: 24px;
    margin-top: 20px;
    border-top: 1px solid #e0e6ee;
  }
  .footer-note p { margin: 0 0 6px; }
  .footer-note p:last-child { margin-bottom: 0; }
  .footer-note a { color: #0f2e5c; text-decoration: none; }
  .footer-note a:hover { text-decoration: underline; }

  /* Nav identity slot (signed-in learner / sign-in link) */
  .nav-identity {
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    padding-left: 6px;
    margin-left: 2px;
    border-left: 1px solid rgba(255,255,255,0.2);
    white-space: nowrap;
  }
  .nav-identity:empty { display: none; }

  /* === Paper Mode === */
  .mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
  }
  @media (max-width: 600px) { .mode-selector { grid-template-columns: 1fr; } }
  .mode-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    background: #f7f9fc;
    border: 2px solid #e0e6ee;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .mode-option:hover { background: #e8f0ff; }
  .mode-option.selected {
    border-color: #0f2e5c;
    background: #f0f5ff;
  }
  .mode-option input[type="radio"] { margin-top: 3px; accent-color: #0f2e5c; flex-shrink: 0; }
  .mode-option .mode-label { flex: 1; }
  .mode-option .mode-label strong { color: #0f2e5c; }
  .mode-option .mode-desc { font-size: 12px; color: #555; margin-top: 3px; }
  .mode-option .mode-badge {
    display: inline-block;
    background: #d97e2e;
    color: white;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-left: 6px;
    vertical-align: middle;
  }

  .paper-upload-area {
    background: white;
    border: 2px dashed #0f2e5c;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 12px;
  }
  .paper-upload-area:hover { background: #f0f5ff; border-color: #b22222; }
  .paper-upload-area.uploaded { padding: 14px; cursor: default; }
  .paper-upload-area.uploaded:hover { background: white; border-color: #0f2e5c; }
  .paper-upload-icon { font-size: 36px; margin-bottom: 8px; }
  .paper-upload-text { font-size: 15px; color: #1a1a1a; margin-bottom: 4px; }
  .paper-upload-text strong { color: #0f2e5c; }
  .paper-upload-hint { font-size: 12px; color: #888; }

  .paper-progress {
    background: #d1ecf1;
    color: #0c5460;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid #17a2b8;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
  }
  .paper-progress::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid #17a2b8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .ocr-output {
    background: #f7f9fc;
    border-left: 4px solid #d97e2e;
    padding: 12px 14px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
  }

  .paper-prompt-recap {
    background: #f7f9fc;
    border-left: 3px solid #2a7d6e;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
  }

  /* === Mobile === */
  @media (max-width: 700px) {
    .nav-links { display: none; }
    nav.top-nav { padding: 10px 14px; }
    .page-container { padding: 12px; }
    h1 { font-size: 22px; }
  }
