#responseContent {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Message bubble styling */
.message {
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.examiner {
    background-color: #c7ced3b7;
    border-left: 4px solid #2526276e;
}

.user {
    background-color: #E8F5E9;
    border-left: 4px solid #43A047;
}

.candidate-b {
    background-color: #FFF3E0;
    border-left: 4px solid #FF9800;
}

.candidate-c {
    background-color: #F3E5F5;
    border-left: 4px solid #9C27B0;
}

.candidate-d {
    background-color: #E1F5FE;
    border-left: 4px solid #03A9F4;
}

/* Candidate container styling */
.candidate-container[data-candidate="B"] {
    border-color: #FF9800;
    border-width: 2px;
}

.candidate-container[data-candidate="C"] {
    border-color: #9C27B0;
    border-width: 2px;
}

.candidate-container[data-candidate="D"] {
    border-color: #03A9F4;
    border-width: 2px;
}

.candidate-container.speaking[data-candidate="B"] {
    background-color: #FFF3E0;
    border-width: 4px;
}

.candidate-container.speaking[data-candidate="C"] {
    background-color: #F3E5F5;
    border-width: 4px;
}

.candidate-container.speaking[data-candidate="D"] {
    background-color: #E1F5FE;
    border-width: 4px;
}

/* Status indicators */
.status-speaking {
    color: #F44336;
    font-weight: 500;
}

.status-completed {
    color: #4CAF50;
    font-weight: 500;
}

.status-waiting {
    color: #9E9E9E;
}

.badge-score {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    min-width: 50px;
}

.feedback-container {
    max-height: 400px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.feedback-text {
    line-height: 1.6;
    font-size: 0.95rem;
}

.score-item {
    background: linear-gradient(45deg, #f8f9fa, #ffffff);
    border-left: 4px solid #007bff;
    transition: all 0.3s ease;
}

.score-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Evaluation Panel Styles */
.evaluation-panel {
    margin-top: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.evaluation-panel details {
    border: none;
}

.evaluation-summary {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: all 0.2s ease;
    list-style: none;
}

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

.evaluation-summary::marker {
    display: none;
}

.evaluation-summary:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.evaluation-summary::after {
    content: '▼';
    font-size: 0.75rem;
    color: #64748b;
    transition: transform 0.2s ease;
}

.evaluation-panel[open] .evaluation-summary::after {
    transform: rotate(180deg);
}

.evaluation-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.evaluation-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.eval-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.eval-badge.grade-1 {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.eval-badge.grade-2 {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fed7aa;
}

.eval-badge.grade-3 {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.eval-badge.grade-4 {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.eval-badge.grade-5 {
    background: #f3e8ff;
    color: #7c3aed;
    border: 1px solid #c4b5fd;
}

.evaluation-timestamp {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 400;
}

.evaluation-body {
    padding: 1.5rem 1.25rem;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
}

.eval-section {
    margin-bottom: 1.5rem;
}

.eval-section:last-child {
    margin-bottom: 0;
}

.eval-section-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.eval-marks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.eval-mark-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.eval-mark-label {
    color: #475569;
    font-weight: 500;
}

.eval-mark-value {
    font-weight: 600;
    color: #1e293b;
}

.feedback-markdown {
    line-height: 1.6;
    color: #374151;
}

.feedback-markdown h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 1rem 0 0.5rem 0;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.25rem;
}

.feedback-markdown h2:first-child {
    margin-top: 0;
}

.feedback-markdown p {
    margin: 0.5rem 0;
}

.feedback-markdown strong {
    font-weight: 600;
    color: #1e293b;
}

.feedback-markdown em {
    font-style: italic;
    color: #4b5563;
}

.evaluation-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
}

.eval-json-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.eval-json-link:hover {
    background: #f8fafc;
    border-color: #2563eb;
    text-decoration: none;
}

/* Evaluation Panel Styles */
.evaluation-panel {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
    margin-top: 1.5rem;
    overflow: hidden;
}

.evaluation-panel details {
    border: none;
}

.evaluation-panel summary {
    padding: 1rem;
    cursor: pointer;
    background: #dcfce7;
    border-bottom: 1px solid #bbf7d0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: #166534;
    transition: background-color 0.2s ease;
}

.evaluation-panel summary:hover {
    background: #d1fae5;
}

/* Keep native disclosure arrow; remove custom arrow to avoid duplicates */

.evaluation-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
}

.eval-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.eval-badge.grade-1 {
    background: #fecaca;
    color: #991b1b;
}

.eval-badge.grade-2 {
    background: #fed7aa;
    color: #c2410c;
}

.eval-badge.grade-3 {
    background: #fef3c7;
    color: #92400e;
}

.eval-badge.grade-4 {
    background: #d1fae5;
    color: #166534;
}

.eval-badge.grade-5 {
    background: #bbf7d0;
    color: #14532d;
}

.eval-timestamp {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: normal;
}

.evaluation-content {
    padding: 1.5rem;
}

.eval-marks-section {
    margin-bottom: 1.5rem;
}

.eval-marks-grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.eval-mark-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
}

.eval-mark-label {
    font-weight: 500;
    color: #374151;
}

.eval-mark-value {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: #f3f4f6;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #1f2937;
}

.eval-feedback-section {
    margin-bottom: 1rem;
}

.section-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.feedback-markdown {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 1rem;
    color: #374151;
    line-height: 1.6;
}

.feedback-markdown h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 1rem 0 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.25rem;
}

.feedback-markdown h2:first-child {
    margin-top: 0;
}

.feedback-markdown p {
    margin: 0.5rem 0;
}

.feedback-markdown strong {
    font-weight: 600;
    color: #1f2937;
}

.feedback-markdown em {
    font-style: italic;
    color: #4b5563;
}

/* Enhanced Marks Display Styles */
.overall-grade-display {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    gap: 1rem;
}

.overall-grade-label {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
}

.overall-grade-value {
    font-size: 2rem;
    font-weight: 800;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    min-width: 3rem;
    text-align: center;
}

.marks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.mark-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.mark-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.mark-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.mark-value {
    font-weight: 700;
    font-size: 1.125rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    min-width: 2rem;
    text-align: center;
}

/* Grade Color Classes for Enhanced Display */
.mark-value.grade-1, .overall-grade-value.grade-1 {
    background: #fecaca;
    color: #991b1b;
    border: 1px solid #f87171;
}

.mark-value.grade-2, .overall-grade-value.grade-2 {
    background: #fed7aa;
    color: #c2410c;
    border: 1px solid #fb923c;
}

.mark-value.grade-3, .overall-grade-value.grade-3 {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.mark-value.grade-4, .overall-grade-value.grade-4 {
    background: #d1fae5;
    color: #166534;
    border: 1px solid #34d399;
}

.mark-value.grade-5, .overall-grade-value.grade-5 {
    background: #bbf7d0;
    color: #14532d;
    border: 1px solid #22c55e;
}

/* ================================
     Training UI styles (chat, popups)
     ================================ */

/* Generic panel */
.panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Chat area */
.chat-thread {
    height: 58vh;
    overflow-y: auto;
    background: #f8fafc;
    border-radius: 0.5rem;
    position: relative;
}

.chat-message {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.chat-row-user {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
}

.chat-row-coach {
    background: #eef2ff;
    border-left: 4px solid #6366f1;
}

/* Status bar */
.status-bar {
    font-size: 0.9rem;
    color: #334155;
}

.status-bar.active {
    color: #0ea5e9;
}

/* Typing indicator */
.typing-indicator {
    display: none;
    position: sticky;
    bottom: 0;
    background: transparent;
    padding-top: 0.25rem;
}

.typing-indicator.active { display: inline-block; }
.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 4px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.6; }
    40% { transform: scale(1); opacity: 1; }
}

/* Skills/choices grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.skill-choice-btn,
.choice-btn,
.quiz-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.skill-choice-btn:hover,
.choice-btn:hover,
.quiz-option:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.skill-choice-btn.selected,
.choice-btn.selected,
.quiz-option.selected {
    background: #eff6ff;
    border-color: #60a5fa;
}

.skill-number,
.quiz-option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    color: #1e293b;
    background: #e2e8f0;
}

.skill-text,
.quiz-option-text { flex: 1; }

/* Popups panel */
.popup-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.popup-card .popup-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #1f2937;
    padding: 0.25rem 0.25rem 0.5rem 0.25rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}

.popup-card .popup-icon { font-size: 1rem; }
.popup-card .popup-body { padding-top: 0.5rem; }
.popup-card.collapsed .popup-body { display: none; }

/* Variants */
.popup-quiz .popup-heading { color: #1d4ed8; }
.popup-notes .popup-heading { color: #0f766e; }
.popup-examples .popup-heading { color: #7c3aed; }
.popup-tasks .popup-heading { color: #b45309; }
.popup-feedback .popup-heading { color: #f59e0b; }

/* Quiz */
.quiz-question {
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.quiz-options { display: grid; gap: 0.5rem; }