/*
 * Elkinematics Live Screening Interface Stylesheet
 * Strict Zero-Emoji Policy Enforced
 */

html, body { 
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    background-color: #f4f7f6;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

input, select, textarea {
    -webkit-user-select: text;
    user-select: text;
}

.app-scroll-container { 
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 8px 40px 60px 8px;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
}

/* Screening Header Bar */
.screening-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 12px auto;
    padding: 6px 10px 12px 10px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 10px;
    box-sizing: border-box;
}

.screening-branding {
    text-align: left;
}

.screening-branding h1 {
    margin: 0;
    font-size: 26px;
    color: #1e293b;
    font-weight: 700;
}

.sub-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0369a1;
    background: #e0f2fe;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 3px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link-btn {
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: #0369a1;
    background: #e0f2fe;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #bae6fd;
    transition: background 0.15s ease;
}

.nav-link-btn:hover {
    background: #bae6fd;
}

/* Bilingual Language Switcher */
.lang-switch {
    display: inline-flex;
    background: #e2e8f0;
    padding: 3px;
    border-radius: 6px;
    gap: 2px;
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Explicit Tablet Touch Scrollbar */
.tablet-scrollbar-track {
    position: fixed;
    top: 0;
    right: 0;
    width: 36px;
    height: 100%;
    background: rgba(0, 0, 0, 0.05);
    border-left: 1px solid #dcdde1;
    z-index: 1000;
    touch-action: none;
    display: flex;
    justify-content: center;
    user-select: none;
}

.tablet-scrollbar-thumb {
    position: absolute;
    top: 10px;
    width: 24px;
    height: 90px;
    background: #7f8c8d;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    touch-action: none;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tablet-scrollbar-thumb:active, 
.tablet-scrollbar-thumb.dragging {
    background: #2c3e50;
    width: 28px;
}

.tablet-scrollbar-thumb::after {
    content: "";
    width: 10px;
    height: 16px;
    border-top: 2px solid rgba(255, 255, 255, 0.8);
    border-bottom: 2px solid rgba(255, 255, 255, 0.8);
}

.quick-nav-btn {
    position: fixed;
    bottom: 20px;
    right: 48px;
    z-index: 999;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    opacity: 0.9;
    transition: 0.2s;
}

.quick-nav-btn:hover {
    opacity: 1;
    background: #1a252f;
}

.container { 
    width: 100%; 
    max-width: 100%; 
    margin: 0 auto; 
    background: white; 
    padding: 16px 20px; 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); 
    box-sizing: border-box;
}

h1 { 
    color: #2c3e50; 
    font-size: 26px; 
    margin-bottom: 5px; 
    margin-top: 5px;
}

p { 
    color: #555; 
    margin-top: 5px; 
    font-size: 16px; 
}

canvas { 
    box-sizing: border-box;
    border: 1px solid #cbd5e1; 
    border-radius: 10px; 
    background-color: #ffffff; 
    cursor: crosshair; 
    touch-action: none; 
    margin: 10px auto; 
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.03);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
}

.controls { 
    margin-top: 25px; 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    flex-wrap: wrap;
}

button { 
    padding: 14px 28px; 
    font-size: 17px; 
    font-weight: bold; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.3s; 
    color: white; 
}

.btn-transcribe { 
    background-color: #2980b9; 
    min-width: 200px; 
}

.btn-transcribe:hover { 
    background-color: #1f618d; 
}

.btn-clear { 
    background-color: #e74c3c; 
    min-width: 140px; 
}

.btn-clear:hover { 
    background-color: #c0392b; 
}

.btn-secondary { 
    background-color: #7f8c8d; 
    min-width: 180px; 
}

.btn-secondary:hover { 
    background-color: #636e72; 
}

/* Mode Selection */
.mode-selection-container {
    margin: 15px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: #eef2f5;
    padding: 10px;
    border-radius: 8px;
    max-width: 650px;
}

.engine-selection-container {
    margin: 8px auto 14px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 650px;
    font-size: 13px;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.mode-label {
    cursor: pointer;
}

/* Evaluator Reference Selector */
.prompt-selector-container {
    display: none;
    flex-direction: column;
    margin: 10px auto;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    border-radius: 8px;
    max-width: 650px;
}

.prompt-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.prompt-text-input {
    padding: 8px 14px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    min-width: 240px;
    color: #1e293b;
    background: #ffffff;
    transition: border-color 0.15s ease, filter 0.2s ease;
}

.prompt-text-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
    filter: none !important;
}

.prompt-text-input-masked {
    filter: blur(5px);
}

.prompt-visibility-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #334155;
    padding-top: 4px;
    border-top: 1px solid #e2e8f0;
    width: 100%;
}

.instruction { 
    font-size: 24px; 
    font-weight: bold; 
    margin-bottom: 5px; 
    color: #34495e; 
}

.prompt-display-free {
    color: #7f8c8d;
    font-size: 20px;
    font-style: italic;
}

.prompt-display-target {
    color: #34495e;
    font-size: 24px;
    font-weight: bold;
}

/* Movement Dynamics Telemetry Grid */
.telemetry-grid {
    display: flex;
    /* grid-template-columns: repeat(4, 1fr); */
    gap: 10px;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    margin: 15px auto 5px auto;
    font-size: 14px;
    box-sizing: border-box;
}

.telemetry-card {
    min-width: fit-content;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding:  8px 16px;
}

.telemetry-label {
    color: #7f8c8d;
    font-size: 12px;
}

.telemetry-value {
    font-weight: bold;
    font-size: 18px;
    color: #2c3e50;
}

.telemetry-value-smooth {
    color: #27ae60;
}

.telemetry-value-variable {
    color: #f39c12;
}

.telemetry-value-hesitant {
    color: #e74c3c;
}

/* Transcription Card */
.transcription-card {
    display: none;
    margin: 20px auto 0 auto;
    width: 100%;
    max-width: 100%;
    background: #e8f4fd;
    border-left: 5px solid #2980b9;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: left;
    box-sizing: border-box;
}

.transcription-label {
    font-size: 13px;
    color: #555;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.decoded-text-display {
    font-size: 34px;
    font-weight: bold;
    color: #2c3e50;
    font-family: monospace;
    margin: 6px 0;
}

.alternative-candidates {
    font-size: 14px;
    color: #555;
}

.reversal-notice {
    display: none;
    margin-top: 10px;
    padding: 8px 12px;
    background: #fde8e8;
    border-radius: 6px;
    color: #c0392b;
    font-weight: bold;
    font-size: 14px;
}

/* Assessment Dashboard */
.dashboard { 
    margin: 20px auto 0 auto; 
    width: 100%;
    max-width: 100%;
    padding: 20px; 
    border-radius: 8px; 
    display: none; 
    background-color: #f8f9fa; 
    border-left: 5px solid #27ae60; 
    text-align: left; 
    box-sizing: border-box;
}

.dashboard-heading {
    margin-top: 0;
    color: #2c3e50;
}

.status-badge { 
    display: inline-block; 
    padding: 6px 14px; 
    border-radius: 18px; 
    font-size: 15px; 
    font-weight: bold; 
    color: white;
}

.badge-red { 
    background-color: #e74c3c; 
}

.badge-green { 
    background-color: #27ae60; 
}

.risk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
    text-align: center;
}

.risk-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.risk-title {
    font-weight: bold;
    color: #2c3e50;
}

.risk-percentage {
    font-size: 26px;
    font-weight: bold;
    color: #27ae60;
    margin: 10px 0;
}

.risk-footnote {
    color: #7f8c8d;
}

.risk-flags-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}

.flag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    line-height: 1.4;
    cursor: default;
    user-select: none;
    transition: all 0.2s ease;
}

.flag-chip-label {
    opacity: 0.85;
}

.flag-chip-value {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.flag-chip.flag-active {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

.flag-chip.flag-danger {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.reversal-alert-box {
    display: none;
    margin-top: 15px;
    padding: 12px;
    background-color: #fce4ec;
    border-left: 4px solid #c2185b;
    color: #880e4f;
    border-radius: 4px;
}

.meta-latency {
    margin-top: 15px;
    font-size: 14px;
    color: #555;
}

.dashboard-divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

.dashboard-footer-note {
    margin: 0;
    color: #7f8c8d;
    font-size: 13px;
}

/* Model Transparency & Pipeline Diagnostics */
.model-diagnostics-card {
    margin-top: 15px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
    font-size: 13px;
    color: #334155;
}

.diagnostics-header {
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diagnostics-cluster-row {
    margin-bottom: 10px;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    line-height: 1.5;
}

.diagnostics-cluster-title {
    font-weight: 600;
    color: #0f172a;
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.diag-tag {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
}

.diag-tag-reversed {
    background: #fee2e2;
    color: #991b1b;
}

.diag-tag-normal {
    background: #dcfce7;
    color: #166534;
}


/* ------------------------------------------------------------------
 * 3-Section Layout: Header (setup), Body (focused workspace), Footer (results)
 * ------------------------------------------------------------------ */
.screening-header-section {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.screening-header-section .mode-selection-container,
.screening-header-section .prompt-selector-container,
.screening-header-section .engine-selection-container {
    margin-top: 8px;
    margin-bottom: 8px;
}

.screening-workspace-section {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.screening-results-section {
    width: 100%;
    max-width: 100%;
    margin: 24px auto 0 auto;
    padding-top: 16px;
    border-top: 2px solid #e2e8f0;
    box-sizing: border-box;
}

/* Focal Stimulus Prompt Card */
.stimulus-card {
    margin: 8px auto 14px auto;
    padding: 18px 24px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    text-align: center;
    box-sizing: border-box;
}

.stimulus-card .instruction {
    margin: 0;
    line-height: 1.2;
}

.stimulus-card .prompt-display-target {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #0f172a;
}

.stimulus-card .prompt-display-free {
    font-size: 20px;
    font-weight: 600;
    color: #64748b;
    font-style: italic;
}

/* Canvas fills the workspace */
.screening-workspace-section #drawingCanvas {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 10px auto;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
}

/* Softened screening indication colors */
.badge-amber {
    background-color: #d97706;
}

.screening-disclaimer {
    margin-top: 10px;
    padding: 10px 12px;
    background: #fffbeb;
    border-left: 4px solid #d97706;
    color: #78350f;
    font-size: 13px;
    border-radius: 4px;
}

/* Overlay toggle bar */
.overlay-toggle-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0 5px 0;
    font-size: 13px;
    color: #475569;
}

.overlay-toggle-bar label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.overlay-toggle-bar input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
}

/* Collapsible DHRC Model accordion */
.diagnostics-accordion-header {
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
}

.diagnostics-accordion-header:hover {
    background: #f1f5f9;
}

.accordion-arrow {
    display: inline-block;
    transition: transform 0.15s ease;
}

.model-diagnostics-card.expanded .accordion-arrow {
    transform: rotate(90deg);
}

.model-diagnostics-card .diagnostics-details {
    display: none;
    margin-top: 10px;
    text-align: left;
}

.model-diagnostics-card.expanded .diagnostics-details {
    display: block;
}

.model-diagnostics-card.expanded .diagnostics-accordion-header {
    margin-bottom: 10px;
}
