/* HiChord Test Procedure v2.0 - Dual Mode Styling */
/* Teenage Engineering meets NASA aesthetic */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #FAFAFA;
    color: #0A0A0A;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #0A0A0A;
}

h1 {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    color: #6B6B6B;
    letter-spacing: 1px;
}

/* Mode Selector */
.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.mode-btn {
    padding: 32px 24px;
    background: white;
    border: 3px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: center;
}

.mode-btn:hover {
    border-color: #0A0A0A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mode-btn.active {
    border-color: #FF6B35;
    background: #FFF9F5;
}

.mode-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    display: block;
}

.mode-name {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.mode-desc {
    font-size: 13px;
    color: #6B6B6B;
}

/* Test Mode Containers */
.test-mode {
    display: none;
}

.test-mode.active {
    display: block;
}

/* Info Box */
.info-box {
    background: #F3F4F6;
    border-left: 4px solid #FFB800;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 14px;
}

/* Test Overview Navigation */
.test-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
    padding: 24px;
    background: #F9FAFB;
    border-radius: 8px;
    border: 2px solid #E5E7EB;
}

.test-overview-item {
    padding: 12px;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 12px;
}

.test-overview-item:hover {
    border-color: #0A0A0A;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.test-overview-item.active {
    border-color: #FF6B35;
    background: #FFF9F5;
    font-weight: 700;
}

.test-overview-item.completed {
    border-color: #10B981;
    background: #F0FDF4;
}

.test-overview-number {
    font-size: 20px;
    font-weight: 700;
    color: #0A0A0A;
    margin-bottom: 4px;
}

.test-overview-name {
    font-size: 11px;
    color: #6B6B6B;
    line-height: 1.3;
}

/* Navigation */
.test-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 16px 0;
    border-top: 1px solid #E5E7EB;
    border-bottom: 1px solid #E5E7EB;
}

.test-nav.bottom {
    margin-top: 32px;
    margin-bottom: 0;
}

.nav-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #0A0A0A;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.nav-btn:hover:not(:disabled) {
    background: #FF6B35;
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.test-progress {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6B6B6B;
}

/* Manual Test Styling */
.manual-test {
    padding: 32px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
}

.test-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #0A0A0A;
}

.test-number {
    font-size: 48px;
    font-weight: 700;
    color: #0A0A0A;
    min-width: 80px;
    font-variant-numeric: tabular-nums;
}

.test-header h2 {
    font-size: 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1;
}

.batch-tag {
    background: #FFB800;
    color: #0A0A0A;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.test-body h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6B6B6B;
    margin-bottom: 16px;
    margin-top: 32px;
}

.test-body h3:first-child {
    margin-top: 0;
}

.procedure-section ol,
.expected-section ul {
    margin-left: 24px;
}

.procedure-section li,
.expected-section li {
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.6;
}

/* Procedure with images - procedure left, images stacked right */
.procedure-with-images {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.procedure-with-images .procedure-section {
    flex: 1;
}

.images-stack {
    flex-shrink: 0;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.images-stack .device-image img,
.images-stack .procedure-secondary-image img {
    width: 100%;
    height: auto;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
}

.expected-section ul {
    list-style: none;
    margin-left: 0;
}

.expected-section li {
    padding-left: 24px;
    position: relative;
}

.expected-section li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #0A0A0A;
    font-weight: 700;
}

.batch-note {
    background: #FEF3C7;
    border-left: 4px solid #F59E0B;
    padding: 12px 16px;
    margin-top: 24px;
    font-size: 13px;
}

/* Device Images */
.device-image {
    margin: 24px 0;
    text-align: center;
    background: #F9FAFB;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.device-image img {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
}

/* OLED Mockup */
.oled-mockup {
    margin: 32px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.oled-screen {
    background: #000;
    color: #FFF;
    width: 320px;
    height: 160px;
    border: 4px solid #0A0A0A;
    border-radius: 4px;
    display: flex;
    position: relative;
    font-family: 'Courier New', 'Monaco', monospace;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.oled-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px;
}

.oled-content.centered {
    align-items: center;
    justify-content: center;
}

.oled-header-bar {
    background: #FFF;
    color: #000;
    padding: 4px 8px;
    margin: -8px -8px 8px -8px;
    text-align: center;
    font-weight: 700;
}

.oled-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.oled-body.centered {
    align-items: center;
    justify-content: center;
}

.oled-text {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.oled-text-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.oled-text-version {
    font-size: 14px;
    text-align: center;
}

.oled-text-large {
    font-size: 36px;
    font-weight: 700;
}

.oled-text-medium {
    font-size: 20px;
    font-weight: 700;
}

.oled-progress-bar {
    width: 200px;
    height: 16px;
    border: 2px solid #FFF;
    margin-top: 16px;
    font-size: 14px;
    line-height: 12px;
    padding: 2px;
}

.oled-progress-fill {
    letter-spacing: -1px;
}

.oled-battery-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 32px;
}

.battery-icon-large {
    width: 60px;
    height: 28px;
    border: 3px solid #FFF;
    border-radius: 4px;
    position: relative;
    padding: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.battery-icon-large:after {
    content: '';
    position: absolute;
    right: -5px;
    top: 8px;
    width: 3px;
    height: 8px;
    background: #FFF;
}

.mockup-label {
    font-size: 11px;
    color: #6B6B6B;
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Connection Panel (Automated Mode) */
.connection-panel {
    background: #F9FAFB;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 32px;
    text-align: center;
}

.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.status-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid;
}

.status-indicator.disconnected {
    background: #EF4444;
    border-color: #DC2626;
    animation: pulse-red 2s infinite;
}

.status-indicator.connected {
    background: #10B981;
    border-color: #059669;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

.status-text {
    text-align: left;
}

.status-text div:first-child {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-text div:last-child {
    font-size: 13px;
    color: #6B6B6B;
}

.btn-connect {
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #0A0A0A;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-connect:hover:not(:disabled) {
    background: #FF6B35;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

/* Hardware Info */
.hardware-info {
    background: #F3F4F6;
    border: 2px solid #0A0A0A;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 32px;
}

.hardware-info h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.info-item {
    text-align: center;
    padding: 12px;
    background: white;
    border-radius: 4px;
}

.info-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6B6B6B;
    margin-bottom: 6px;
}

.info-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #0A0A0A;
}

/* Automated Test Styling */
.automated-test {
    padding: 32px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
}

.auto-badge,
.manual-badge {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auto-badge {
    background: #DBEAFE;
    color: #1E40AF;
}

.manual-badge {
    background: #FEF3C7;
    color: #92400E;
}

.instruction-section {
    margin-bottom: 24px;
}

.instruction-section h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6B6B6B;
    margin-bottom: 12px;
}

.instruction-section p {
    font-size: 15px;
    line-height: 1.6;
}

.auto-test-controls,
.manual-verify-controls {
    background: #F9FAFB;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    padding: 20px;
    margin: 24px 0;
}

.btn-run-test {
    padding: 14px 32px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #10B981;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-bottom: 16px;
    width: 100%;
}

.btn-run-test:hover {
    background: #059669;
}

.test-status {
    text-align: center;
    padding: 12px;
    border-radius: 4px;
    background: white;
    border: 2px solid #E5E7EB;
}

.status-text.testing {
    color: #F59E0B;
}

.status-text.passed {
    color: #10B981;
    font-weight: 700;
}

.status-text.failed {
    color: #EF4444;
    font-weight: 700;
}

.test-progress-log {
    margin-top: 24px;
    padding: 16px;
    background: #F3F4F6;
    border-radius: 6px;
}

.test-progress-log h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6B6B6B;
    margin-bottom: 12px;
}

.log-content {
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.log-item {
    padding: 6px 0;
    border-bottom: 1px solid #E5E7EB;
}

.log-item.success {
    color: #059669;
}

.log-item.error {
    color: #DC2626;
}

.verify-instruction {
    font-size: 14px;
    color: #6B6B6B;
    font-style: italic;
}

/* Summary */
.summary-section {
    margin-top: 60px;
    padding: 40px;
    background: #F9FAFB;
    border-radius: 8px;
    border: 2px solid #0A0A0A;
}

.summary-section h2 {
    text-align: center;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 32px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.summary-item {
    text-align: center;
    padding: 24px;
    background: white;
    border-radius: 4px;
    border: 2px solid #E5E7EB;
}

.summary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6B6B6B;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 48px;
    font-weight: 700;
    color: #0A0A0A;
    font-variant-numeric: tabular-nums;
}

.summary-value.fail {
    color: #EF4444;
}

.summary-value.skip {
    color: #6B6B6B;
}

.summary-actions {
    display: flex;
    gap: 16px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 16px 32px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: #0A0A0A;
    color: white;
    border: 2px solid #0A0A0A;
}

.btn-primary:hover {
    background: #FF6B35;
    border-color: #FF6B35;
}

.btn-secondary {
    background: white;
    color: #0A0A0A;
    border: 2px solid #0A0A0A;
}

.btn-secondary:hover {
    background: #F3F4F6;
}

/* Footer */
footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #E5E7EB;
    text-align: center;
    font-size: 12px;
    color: #6B6B6B;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .container {
        box-shadow: none;
        padding: 20px;
    }

    .mode-selector,
    .test-nav,
    .connection-panel,
    .summary-actions,
    .auto-test-controls,
    .manual-verify-controls {
        display: none !important;
    }

    .test-mode {
        display: block !important;
    }

    .manual-test,
    .automated-test {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 32px;
    }

    .mode-selector {
        grid-template-columns: 1fr;
    }

    .summary-grid,
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .test-number {
        font-size: 32px;
        min-width: 50px;
    }

    .test-header h2 {
        font-size: 18px;
    }

    .oled-screen {
        width: 280px;
        height: 140px;
    }
}

/* ========================================
   CUSTOM OLED DISPLAYS FOR TEST PROCEDURE
   ======================================== */

/* Mini OLED screens for grid displays */
.oled-screen-mini {
    background: #000;
    color: #FFF;
    width: 128px;
    height: 64px;
    border: 2px solid #0A0A0A;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', 'Monaco', monospace;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Chord text display (centered, large) */
.oled-chord-text {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
}

/* Menu header (inverted bar) + value */
.oled-menu-header {
    background: #FFF;
    color: #000;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 4px;
    text-align: center;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.oled-menu-value {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.oled-menu-single {
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

/* Joystick 8-direction grid */
.joystick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.joy-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.joy-cell.empty {
    visibility: hidden;
}

.joy-cell.center .oled-screen-mini {
    border-color: #FF6B35;
    border-width: 3px;
    box-shadow: 0 0 12px rgba(255, 107, 53, 0.3);
}

.joy-arrow {
    font-size: 28px;
    font-weight: 700;
    color: #0A0A0A;
    line-height: 1;
    text-align: center;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-arrow {
    color: #FF6B35;
    font-size: 32px;
}

.joy-label {
    font-size: 11px;
    font-weight: 600;
    color: #6B6B6B;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Chord button grid (7 buttons) */
.chord-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    padding: 20px;
}

.chord-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.chord-label {
    font-size: 12px;
    font-weight: 600;
    color: #0A0A0A;
    text-align: center;
}

/* Function button menu grid (F1, F2, F3) */
.function-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 20px;
}

.function-cell {
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    padding: 16px;
    background: #F9FAFB;
}

.function-header {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: #0A0A0A;
    border-bottom: 2px solid #0A0A0A;
    padding-bottom: 8px;
}

.menu-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.menu-item {
    padding: 8px;
}

.menu-item .oled-menu-header {
    width: 100%;
}

/* UNIFIED: Single test row layout (button/direction → ONE OLED) */
.single-test-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.single-test-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #FFFFFF;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.single-test-row:hover {
    border-color: #0A0A0A;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.single-test-row.center-highlight {
    background: #FFF4E6;
    border-color: #FF6B35;
    border-width: 2px;
}

/* Button/Direction icon display */
.button-icon-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 100px;
}

.button-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6B6B6B;
    text-align: center;
}

/* Function button icons (F1, F2, F3) */
.button-icon-square {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.2),
                0 1px 2px rgba(0, 0, 0, 0.1),
                inset 0 -1px 1px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* SVG icons inside function buttons */
.function-button-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* Joystick direction arrows */
.joy-arrow-icon {
    font-size: 42px;
    font-weight: 700;
    color: #0A0A0A;
    line-height: 1;
    text-align: center;
}

.center-highlight .joy-arrow-icon {
    color: #FF6B35;
}

/* Chord button numbers */
.chord-button-number {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: #0A0A0A;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Arrow connector */
.arrow-single {
    font-size: 28px;
    color: #0A0A0A;
    font-weight: 700;
    flex-shrink: 0;
}

/* Full OLED screen simulation (64x32 pixel accurate) */
.oled-screen-full {
    background: #000000;
    color: #FFFFFF;
    width: 192px;
    height: 96px;
    border: 2px solid #1A1A1A;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', 'Monaco', monospace;
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    flex-shrink: 0;
}

/* OLED header (inverted bar) for menu items */
.oled-header-inverted {
    background: #FFFFFF;
    color: #000000;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
}

/* OLED body (centered value) */
.oled-body-centered {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    padding: 8px;
}

/* OLED chord display (centered, large) */
.oled-chord-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
}

/* Chord name label (after OLED) */
.chord-name-label {
    font-size: 12px;
    font-weight: 600;
    color: #6B6B6B;
    min-width: 100px;
    text-align: left;
}

/* Looper OLED display */
/* OLED Menu List (Looper, Selection Menus) */
.oled-menu-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px;
    gap: 2px;
}

.oled-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.3px;
    border-radius: 2px;
    background: transparent;
    color: #E8E8E8;
    transition: all 0.15s ease;
}

.oled-menu-item.selected {
    background: #E8E8E8;
    color: #0A0A0A;
}

.menu-icon {
    font-size: 14px;
    line-height: 1;
    width: 16px;
    text-align: center;
}

.menu-text {
    flex: 1;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* F1 Dual-Line Display (KEY + OCTAVE) */
.oled-dual-line {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px;
    width: 100%;
}

.oled-dual-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
}

.oled-label {
    font-size: 10px;
    letter-spacing: 0.5px;
}

.oled-arrows {
    font-size: 10px;
    opacity: 0.7;
}

.oled-value {
    font-size: 16px;
    font-weight: 700;
}

.oled-divider {
    height: 1px;
    background: #FFFFFF;
    margin: 2px 8px;
    opacity: 0.3;
}

/* F2 Effect Display */
.oled-effect-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
    gap: 8px;
}

.oled-effect-top {
    width: 100%;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    padding: 4px 0;
    background: #FFFFFF;
    color: #000000;
}

.oled-effect-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 8px;
}

.oled-hint {
    font-size: 10px;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

/* F3 BPM Display */
.oled-bpm-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 8px;
    width: 100%;
}

.oled-bpm-top {
    font-size: 10px;
    text-align: center;
    letter-spacing: 0.5px;
}

.oled-bpm-number {
    font-size: 32px;
    font-weight: 700;
    text-align: right;
    line-height: 1;
    padding-right: 4px;
}

.oled-bpm-bottom {
    font-size: 9px;
    text-align: left;
    letter-spacing: 0.5px;
    padding-left: 4px;
}

/* Pixel-Perfect Chord Display (matches firmware exactly) */
/* Real OLED: 64x32px, CSS: 192x96px (3x scale) */
/* Chord Number & Key at y=10 (top), Chord Name at y=30 (bottom) */
.oled-chord-accurate {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Chord Number: Circle at (10, 10), radius 9px, font 5x7 */
/* 3x scale: center (30, 30), radius 27px (diameter 54px), font 21px */
.oled-chord-number-circle {
    position: absolute;
    left: 30px;
    top: 30px;
    width: 54px;
    height: 54px;
    border: 3px solid #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    transform: translate(-50%, -50%);
}

/* Key Letter: Right-aligned at x=(64-width-2), y=10, font 5x7 */
/* 3x scale: right 6px, baseline at y=30, font 21px */
.oled-chord-key-letter {
    position: absolute;
    right: 6px;
    top: 20px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1;
}

/* Chord Name: Centered, baseline at y=30 (bottom), font 8x13B (13px tall) */
/* 3x scale: font 39px, baseline at y=90 (bottom edge of 96px container) */
.oled-chord-name-center {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.5px;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    line-height: 1;
}

/* Bar Select Display (Looper Waiting) - Pixel Perfect */
/* Real OLED: 64x32px, CSS: 192x96px (3x scale) */
.oled-bar-select-accurate {
    position: relative;
    width: 100%;
    height: 100%;
}

/* "WAITING": x=8, baseline y=10, font 7x14B (14px tall, top at y≈0, bottom at y≈12) */
/* 3x scale: x=24, top at y≈0, font reduced to 32px for better visual balance */
.bar-select-waiting {
    position: absolute;
    left: 24px;
    top: 4px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1;
}

/* Line: y=12 (just below WAITING bottom) */
/* 3x scale: y=36, full width */
.bar-select-separator {
    position: absolute;
    left: 0;
    top: 36px;
    width: 100%;
    height: 3px;
    background: #FFFFFF;
}

/* Bar number "4": x=8, baseline y=24, font 7x14B (14px tall, top at y≈12) */
/* 3x scale: x=24, top at y≈36 (just below line), font 32px for better balance */
.bar-select-number {
    position: absolute;
    left: 24px;
    top: 40px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
}

/* "BARS": x=35, baseline y=22, font 5x7 (7px tall, top at y≈17) */
/* 3x scale: x=105, top at y≈51, font 21px */
.bar-select-label {
    position: absolute;
    left: 105px;
    top: 48px;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* "<>": x=50, baseline y=22, font 5x7 (7px tall, top at y≈17) */
/* 3x scale: x=150, top at y≈51, font 21px */
.bar-select-arrows {
    position: absolute;
    left: 150px;
    top: 48px;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1;
}

/* PIXEL-PERFECT F1/F2/F3 Displays */

/* Border frame for all function button displays */
.oled-border-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #FFFFFF;
    pointer-events: none;
    z-index: 10;
}

/* F1: KEY (inverted) / OCTAVE (normal) dual display */
.oled-f1-dual {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.f1-top-inverted {
    background: #FFFFFF;
    color: #000000;
    width: 100%;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
}

.f1-bottom-normal {
    background: #000000;
    color: #FFFFFF;
    width: 100%;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* F2: SOUND ^ (inverted) / < VERB > / ON/OFF v (inverted) triple display */
/* Exact proportions: 12px (37.5%) / 12px (37.5%) / 8px (25%) */
.oled-f2-triple {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.f2-top-inverted {
    background: #FFFFFF;
    color: #000000;
    width: 100%;
    height: 37.5%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.f2-middle-normal {
    background: #000000;
    color: #FFFFFF;
    width: 100%;
    height: 37.5%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

.f2-bottom-inverted {
    background: #FFFFFF;
    color: #000000;
    width: 100%;
    height: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* F3: MODE ^ / BPM <> 120 (inverted box) display */
/* Exact proportions: 12px top (37.5%) / 1px line / 19px inverted box (59.4%) */
.oled-f3-bpm {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.f3-mode-text {
    background: #000000;
    color: #FFFFFF;
    width: 100%;
    height: 37.5%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.f3-divider-line {
    width: 100%;
    height: 3%;
    background: #FFFFFF;
    min-height: 1px;
}

.f3-bpm-inverted-box {
    background: #FFFFFF;
    color: #000000;
    width: 100%;
    height: 59.5%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.f3-bpm-label {
    position: absolute;
    left: 6px;
    top: 6px;
    font-size: 11px;
    font-weight: 700;
}

.f3-bpm-arrows {
    position: absolute;
    left: 6px;
    bottom: 4px;
    font-size: 8px;
}

.f3-bpm-number {
    font-size: 24px;
    font-weight: 700;
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
}

/* MIC SAMPLE Recording Display */
.oled-mic-recording {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 4px;
}

.mic-title {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.mic-time-text {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 6px;
}

.mic-progress-bar {
    border: 1px solid #FFFFFF;
    position: relative;
    background: #000000;
}

.mic-progress-fill {
    background: #FFFFFF;
    height: 100%;
}

.mic-rms-meter {
    border: 1px solid #FFFFFF;
    position: relative;
    background: #000000;
}

.mic-rms-fill {
    background: #FFFFFF;
    height: 100%;
}

/* Battery Display (F1+F2) */
.oled-battery-accurate {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 8px;
}

.battery-text-centered {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.battery-bar-container {
    position: relative;
}

.battery-bar-frame {
    border: 2px solid #FFFFFF;
    position: relative;
    background: #000000;
}

.battery-fill {
    background: #FFFFFF;
    position: absolute;
    top: 1px;
    left: 1px;
}

.battery-divider {
    position: absolute;
    top: 1px;
    width: 1px;
    height: calc(100% - 2px);
    background: #000000;
}

.battery-tip {
    background: #FFFFFF;
    position: absolute;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .single-test-row {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .arrow-single {
        transform: rotate(90deg);
        font-size: 20px;
    }

    .oled-screen-full {
        width: 160px;
        height: 80px;
    }

    .oled-chord-display {
        font-size: 26px;
    }

    .oled-body-centered {
        font-size: 20px;
    }

    .button-icon-display {
        min-width: 80px;
    }

    .chord-name-label {
        text-align: center;
        min-width: auto;
    }
}

/* Test Mode Selector */
.test-mode-selector {
    display: flex;
    gap: 0;
    margin-bottom: 40px;
    border-bottom: 2px solid #E8E8E8;
}

.test-mode-btn {
    flex: 1;
    padding: 20px 30px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    position: relative;
    margin-bottom: -2px;
}

.test-mode-btn:hover:not(.active) {
    background: #FAFAFA;
    border-bottom-color: #D0D0D0;
}

.test-mode-btn.active {
    background: transparent;
    border-bottom-color: #FF6B35;
}

.mode-label {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0A0A0A;
}

.test-mode-btn:not(.active) .mode-label {
    color: #6B6B6B;
}

.mode-description {
    font-size: 13px;
    font-weight: 400;
    color: #6B6B6B;
    letter-spacing: 0.3px;
}

.test-mode-btn.active .mode-description {
    color: #0A0A0A;
}

/* ========================================
   PRODUCTION TEST MODE - ENHANCED GUI
   ======================================== */

/* Start Test Button */
.btn-start-test {
    width: 100%;
    padding: 24px 48px;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: #0A0A0A;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-start-test:hover {
    background: #FF6B35;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

/* Quick Stats */
.test-quick-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.quick-stat-item {
    text-align: center;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 6px;
    border: 2px solid #E5E7EB;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #0A0A0A;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6B6B6B;
}

/* Test Coverage Note */
.test-coverage-note {
    margin-top: 24px;
    padding: 20px;
    background: #F9FAFB;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
}

.test-coverage-note h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #0A0A0A;
    margin-bottom: 12px;
}

.test-coverage-note ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.test-coverage-note li {
    padding: 6px 0;
    font-size: 13px;
    color: #0A0A0A;
    line-height: 1.5;
}

/* Current Test Card */
.current-test-card {
    background: #FFFFFF;
    border: 3px solid #0A0A0A;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
}

/* Test Action Buttons (Retry/Skip/Abort) */
.test-action-btn {
    padding: 16px 32px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.retry-btn {
    background: #FF6B35;
    color: white;
    border-color: #FF6B35;
}

.retry-btn:hover {
    background: #FF8555;
    border-color: #FF8555;
    transform: translateY(-1px);
}

.skip-btn {
    background: #6B6B6B;
    color: white;
    border-color: #6B6B6B;
}

.skip-btn:hover {
    background: #858585;
    border-color: #858585;
}

.abort-btn {
    background: #EF4444;
    color: white;
    border-color: #EF4444;
}

.abort-btn:hover {
    background: #F87171;
    border-color: #F87171;
}

/* Slim Progress Bar */
.test-progress-bar-slim {
    width: 100%;
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill-slim {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #059669);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-count {
    font-size: 14px;
    font-weight: 700;
    text-align: right;
    color: #6B6B6B;
    margin-bottom: 24px;
    font-variant-numeric: tabular-nums;
}

/* Large Instruction Text */
.test-instruction-large {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    text-transform: none;
    letter-spacing: 0.3px;
    color: #0A0A0A;
    margin-bottom: 32px;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 8px;
    line-height: 1.5;
}

/* Visual Test Display */
.test-visual-display {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

/* Test Status Indicator */
.test-status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    background: #F3F4F6;
    border-radius: 8px;
}

.status-icon {
    font-size: 48px;
    line-height: 1;
}

.status-icon:empty {
    display: none;
}

.status-text {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
    color: #374151;
}

.test-status-indicator.waiting {
    background: #FEF3C7;
    border: 2px solid #F59E0B;
}

.test-status-indicator.waiting .status-text {
    color: #92400E;
}

.test-status-indicator.waiting .status-icon {
    animation: none;
}

.test-status-indicator.passed {
    background: #D1FAE5;
    border: 2px solid #10B981;
}

.test-status-indicator.passed .status-icon {
    color: #10B981;
}

.test-status-indicator.passed .status-text {
    color: #059669;
}

.test-status-indicator.failed {
    background: #FEE2E2;
    border: 2px solid #EF4444;
}

.test-status-indicator.failed .status-icon {
    color: #EF4444;
}

.test-status-indicator.failed .status-text {
    color: #DC2626;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Results Card */
.test-results-card {
    background: #FFFFFF;
    border: 3px solid #0A0A0A;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 32px;
}

/* Results Verdict */
.results-verdict {
    text-align: center;
    margin-bottom: 40px;
    padding: 32px;
    border-radius: 12px;
    background: #D1FAE5;
    border: 3px solid #10B981;
}

.results-verdict.fail {
    background: #FEE2E2;
    border-color: #EF4444;
}

.verdict-icon {
    font-size: 80px;
    line-height: 1;
    margin-bottom: 16px;
}

.results-verdict.fail .verdict-icon {
    color: #EF4444;
}

.verdict-text {
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #059669;
}

.results-verdict.fail .verdict-text {
    color: #DC2626;
}

/* Results Stats Grid */
.results-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-box {
    text-align: center;
    padding: 24px;
    border-radius: 8px;
    border: 3px solid;
}

.stat-box.stat-pass {
    background: #F0FDF4;
    border-color: #10B981;
}

.stat-box.stat-fail {
    background: #FEF2F2;
    border-color: #EF4444;
}

.stat-box.stat-total {
    background: #F9FAFB;
    border-color: #0A0A0A;
}

.stat-big-number {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.stat-box.stat-pass .stat-big-number {
    color: #059669;
}

.stat-box.stat-fail .stat-big-number {
    color: #DC2626;
}

.stat-box.stat-total .stat-big-number {
    color: #0A0A0A;
}

.stat-small-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6B6B6B;
}

/* Action Buttons Row */
.results-actions-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    margin-bottom: 24px;
}

.btn-action-primary,
.btn-action-secondary {
    padding: 16px 32px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    border: 2px solid;
}

.btn-action-primary {
    background: #0A0A0A;
    color: #FFFFFF;
    border-color: #0A0A0A;
}

.btn-action-primary:hover {
    background: #FF6B35;
    border-color: #FF6B35;
}

.btn-action-secondary {
    background: #FFFFFF;
    color: #0A0A0A;
    border-color: #0A0A0A;
}

.btn-action-secondary:hover {
    background: #F3F4F6;
}

/* Detailed Results Section */
.results-detail-section {
    border-top: 2px solid #E5E7EB;
    padding-top: 24px;
}

.results-detail-section summary {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6B6B6B;
    cursor: pointer;
    padding: 12px;
    text-align: center;
    background: #F9FAFB;
    border-radius: 6px;
    transition: all 0.2s;
}

.results-detail-section summary:hover {
    background: #F3F4F6;
    color: #0A0A0A;
}

.results-detail-list {
    margin-top: 16px;
    display: grid;
    gap: 8px;
}

.result-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #F9FAFB;
    border-radius: 6px;
    border-left: 4px solid;
}

.result-detail-item.passed {
    border-left-color: #10B981;
    background: #F0FDF4;
}

.result-detail-item.failed {
    border-left-color: #EF4444;
    background: #FEF2F2;
}

.result-detail-name {
    font-size: 13px;
    font-weight: 600;
    color: #0A0A0A;
}

.result-detail-status {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-detail-item.passed .result-detail-status {
    color: #059669;
}

.result-detail-item.failed .result-detail-status {
    color: #DC2626;
}

/* Console Log Improvements */
.console-log {
    margin-top: 32px;
    background: #0A0A0A;
    border-radius: 8px;
    padding: 20px;
    color: #E5E7EB;
}

.console-log h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6B6B6B;
    margin-bottom: 12px;
}

.log-output {
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.6;
    background: #000000;
    border-radius: 4px;
    padding: 12px;
}

.log-item {
    padding: 4px 0;
    opacity: 0.8;
}

.log-item.info {
    color: #93C5FD;
}

.log-item.success {
    color: #6EE7B7;
}

.log-item.error {
    color: #FCA5A5;
}

.log-item.warning {
    color: #FCD34D;
}

.log-item.send {
    color: #C4B5FD;
}

.log-item.receive {
    color: #86EFAC;
}

.btn-small {
    margin-top: 12px;
    padding: 8px 16px;
    font-size: 11px;
}

/* Responsive Adjustments for Production Test Mode */
@media (max-width: 768px) {
    .btn-start-test {
        font-size: 18px;
        padding: 20px 32px;
    }

    .test-quick-stats {
        grid-template-columns: 1fr;
    }

    .test-instruction-large {
        font-size: 16px;
        padding: 12px;
    }

    .status-icon {
        font-size: 36px;
    }

    .status-text {
        font-size: 14px;
    }

    .results-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .results-actions-row {
        grid-template-columns: 1fr;
    }

    .verdict-icon {
        font-size: 60px;
    }

    .verdict-text {
        font-size: 20px;
    }

    .stat-big-number {
        font-size: 36px;
    }
}

/* ========================================
   MIDI Test Component Styles
   ======================================== */

.midi-test-app {
    margin: 30px 0;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
}

.midi-test-header {
    text-align: center;
    margin-bottom: 20px;
}

.midi-test-header h3 {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.midi-test-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.midi-test-instructions {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.midi-test-instructions h4 {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.midi-test-instructions ol {
    margin: 0;
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    line-height: 1.8;
}

.midi-test-instructions li {
    margin-bottom: 8px;
}

.midi-test-instructions li strong {
    color: white;
    font-weight: 600;
}

.midi-test-instructions p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.midi-connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.disconnected {
    background: #dc3545;
}

.status-dot.connecting {
    background: #ffc107;
}

.status-dot.connected {
    background: #28a745;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-text {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.btn-midi-test {
    width: 100%;
    padding: 16px 32px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-midi-test:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-midi-test:active:not(:disabled) {
    transform: translateY(0);
}

.btn-midi-test:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.midi-log-container {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    overflow: hidden;
}

.midi-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #0A0A0A;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.btn-clear-log {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-log:hover {
    background: rgba(255, 255, 255, 0.2);
}

.midi-log {
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
    background: white;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

.midi-log-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-style: italic;
}

.midi-message {
    display: grid;
    grid-template-columns: 90px 120px 1fr;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.midi-message:hover {
    background: #f8f9fa;
}

.midi-time {
    color: #6B6B6B;
    font-size: 11px;
}

.midi-type {
    font-weight: 700;
    font-size: 12px;
}

.midi-data {
    color: #0A0A0A;
    font-size: 12px;
}

/* Message type colors */
.midi-message.note-on .midi-type {
    color: #28a745;
}

.midi-message.note-off .midi-type {
    color: #6c757d;
}

.midi-message.cc .midi-type {
    color: #007bff;
}

.midi-message.pc .midi-type {
    color: #6f42c1;
}

.midi-message.info .midi-type {
    color: #17a2b8;
}

.midi-message.error .midi-type {
    color: #dc3545;
}

/* Simplified MIDI Test UI */
.midi-instruction {
    margin-top: 24px;
    padding: 32px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.instruction-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

.instruction-text {
    color: white;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.midi-result {
    margin-top: 24px;
}

.midi-success {
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

.success-icon {
    font-size: 80px;
    color: #28a745;
    margin-bottom: 16px;
    animation: scaleIn 0.5s ease-out;
}

.success-text {
    font-size: 36px;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 8px;
}

.success-subtext {
    font-size: 16px;
    color: #6B6B6B;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Scrollbar styling for MIDI log */
.midi-log::-webkit-scrollbar {
    width: 8px;
}

.midi-log::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.midi-log::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.midi-log::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================================================
   PIXEL-PERFECT OLED DISPLAYS - Matching Firmware Rendering
   ======================================================================== */

/* Boot Screen (Ghost + HiChord + REV) */
.oled-boot-accurate {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.boot-ghost {
    width: 320px;
    height: 160px;
    background: #000;
}

.boot-ghost text {
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* Volume Display (Inverted Bar + Percentage) */
.oled-volume-accurate {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #000;
    position: relative;
    align-items: center;
    justify-content: center;
}

/* Volume header - inverted white box at top (12px on device, scales with container) */
.volume-header-inverted {
    background: #fff;
    color: #000;
    font-family: 'Helvetica', 'Arial', sans-serif;
    font-weight: bold;
    font-size: 24px;
    height: 36px;
    line-height: 36px;
    width: 100%;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Volume percentage - large centered text */
.volume-percentage-large {
    color: #fff;
    font-family: 'Helvetica', 'Arial', sans-serif;
    font-weight: bold;
    font-size: 42px;
    text-align: center;
    position: absolute;
    top: 36px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================================================
   BUTTON ICONS - From HiChord Manual
   ======================================================================== */

/* Function Button Icons (F1, F2, F3) */
.inline-code.f1,
.inline-code.f2,
.inline-code.f3 {
    display: inline-block;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 4px;
    position: relative;
    vertical-align: middle;
    margin: 0 4px;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
    text-indent: -9999px;
    border: none;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15),
                0 1px 2px rgba(0, 0, 0, 0.1),
                inset 0 -1px 1px rgba(0, 0, 0, 0.2);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.inline-code.f1 {
    background: linear-gradient(135deg, #909090 0%, #808080 50%, #707070 100%);
}

.inline-code.f2 {
    background: linear-gradient(135deg, #FFC820 0%, #FFB800 50%, #E0A000 100%);
}

.inline-code.f3 {
    background: linear-gradient(135deg, #ff5555 0%, #ef4444 50%, #dc2626 100%);
}

/* SVG icons inside function keys */
.inline-code.f1::before,
.inline-code.f2::before,
.inline-code.f3::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* F1 - Key Icon */
.inline-code.f1::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="7" cy="14" r="3.5"/><line x1="9.5" y1="11.5" x2="18" y2="3"/><line x1="16" y1="5" x2="16" y2="3"/></svg>');
}

/* F2 - Waveform Icon */
.inline-code.f2::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3,17 3,9 7,9 7,17 11,17 11,9 15,9 15,17 19,17 19,9 21,9"/></svg>');
}

/* F3 - Clock Icon */
.inline-code.f3::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><line x1="12" y1="12" x2="12" y2="6"/><line x1="12" y1="12" x2="17" y2="12"/></svg>');
}

/* Chord Button Icon */
.chord-btn-icon {
    display: inline-block;
    width: 18px;
    height: 22px;
    margin: 0 3px;
    vertical-align: middle;
    position: relative;
    border: 1.5px solid #333333;
    border-radius: 3px;
    background: linear-gradient(135deg, #F8F8F8 0%, #E8E8E8 100%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15), inset 0 -1px 1px rgba(0, 0, 0, 0.1);
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 11px;
    color: #333333;
    text-align: center;
    line-height: 22px;
}

.chord-btn-icon::before {
    content: attr(data-num);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Joystick Direction Icons */
.joy-up,
.joy-down,
.joy-left,
.joy-right,
.joy-click {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin: 0 2px;
    vertical-align: middle;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.joy-up {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23333333" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5 L12 19 M12 5 L7 10 M12 5 L17 10"/></svg>');
}

.joy-down {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23333333" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19 L12 5 M12 19 L7 14 M12 19 L17 14"/></svg>');
}

.joy-left {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23333333" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12 L19 12 M5 12 L10 7 M5 12 L10 17"/></svg>');
}

.joy-right {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23333333" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 12 L5 12 M19 12 L14 7 M19 12 L14 17"/></svg>');
}

.joy-click {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23333333" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="3" fill="%23333333"/></svg>');
}

/* Battery Display SVG */
.battery-display {
    width: 320px;
    height: 160px;
    background: #000;
}

.battery-display text {
    font-family: 'Courier New', monospace;
    font-weight: normal;
}
