/* ========================================
   CSS Custom Properties & Theme
   ======================================== */
:root {
    /* Modern Color Palette - Light Theme */
    --primary-blue: #3b82f6;
    --primary-blue-dark: #1d4ed8;
    --accent-indigo: #6366f1;

    /* Background Colors */
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-gray: #f1f5f9;
    --bg-card: #ffffff;

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #6b7c93;

    /* Border & Effects */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;

    /* Layout */
    --max-width: 1200px;
    --header-height: 64px;
}

/* ========================================
   Global Styles & Reset
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

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

/* ========================================
   Site Header
   ======================================== */
.site-header {
    position: sticky;
    top: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    height: var(--header-height);
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.site-logo svg {
    color: var(--primary-blue);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.nav-link {
    padding: 8px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-gray);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-fast);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-sm);
    z-index: 99;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav-link {
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.mobile-nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-gray);
}

/* ========================================
   Main Wrapper
   ======================================== */
.main-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
    text-align: center;
    padding: var(--spacing-2xl) 0;
    background: linear-gradient(180deg, var(--bg-white) 0%, var(--bg-light) 100%);
    border-radius: 16px;
    margin: var(--spacing-lg) 0;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary {
    padding: 14px 28px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    padding: 14px 28px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-gray);
    border-color: var(--text-muted);
}

/* System Info Box */
.system-info-box {
    max-width: 600px;
    margin: var(--spacing-xl) auto 0;
    padding: var(--spacing-md);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.system-info-box h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.system-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

.system-info-item {
    text-align: center;
}

.info-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.info-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================================
   Tests Section
   ======================================== */
.tests-section {
    padding: var(--spacing-xl) 0;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

/* Test Cards */
.test-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-lg);
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.test-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue);
}

.test-card-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--spacing-md);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
}

.test-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.test-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--spacing-md);
    min-height: 40px;
}

.test-card-btn {
    width: 100%;
    padding: 10px 20px;
    background: var(--bg-gray);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.test-card:hover .test-card-btn {
    background: var(--primary-blue);
    color: white;
}

/* ========================================
   Features Section
   ======================================== */
.features-section {
    padding: var(--spacing-xl) 0;
    background: var(--bg-white);
    border-radius: 16px;
    margin: var(--spacing-lg) 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.feature-card {
    text-align: center;
    padding: var(--spacing-md);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========================================
   CTA Section
   ======================================== */
.cta-section {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-md);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    margin: var(--spacing-xl) 0;
}

.cta-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.cta-section p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   Test Content Wrapper
   ======================================== */
.test-content-wrapper {
    padding: var(--spacing-lg) 0;
}

.back-to-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-gray);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: var(--spacing-lg);
}

.back-to-home:hover {
    background: var(--bg-white);
    border-color: var(--text-muted);
}

.tab-content {
    display: none;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-lg);
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.content-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.content-header p {
    color: var(--text-secondary);
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-xl) var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-blue);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ========================================
   Ad Container
   ======================================== */
.ad-container {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md);
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Specs Grid (for test results)
   ======================================== */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.spec-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: var(--spacing-md);
}

.spec-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--border-light);
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.spec-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

/* ========================================
   Test Container Base Styles
   ======================================== */
.test-container {
    max-width: 100%;
}

/* Button Base */
.btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.85rem;
}

/* Select Input */
.select-input {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    cursor: pointer;
}

.select-input:focus {
    border-color: var(--primary-blue);
}

/* Input Group */
.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.input-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.input-group input {
    padding: var(--spacing-sm);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
}

.input-group input:focus {
    border-color: var(--primary-blue);
    outline: none;
}

/* Info Panel */
.info-panel {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
}

/* Stats Panel */
.stats-panel {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
    flex-wrap: wrap;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.stat-item {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.stat-item span:first-child {
    color: var(--text-secondary);
}

.stat-item span:last-child {
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 1.1rem;
}

/* ========================================
   Camera Test
   ======================================== */
.camera-preview {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16/9;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: var(--spacing-md);
}

#camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

#camera-video.active {
    display: block;
}

.camera-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.camera-placeholder.hidden {
    display: none;
}

.camera-controls {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
}

/* ========================================
   Speaker Test
   ======================================== */
.speaker-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.btn-channel {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-channel:hover {
    border-color: var(--primary-blue);
    background: var(--bg-light);
}

.btn-channel.playing {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border-color: var(--primary-blue);
}

.frequency-sweep {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-lg);
}

.frequency-sweep h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.sweep-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

/* ========================================
   Microphone Test
   ======================================== */
.mic-visualizer {
    width: 100%;
    max-width: 800px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

#mic-canvas {
    display: block;
    width: 100%;
    height: auto;
}

.mic-controls {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
}

.level-bar {
    flex: 1;
    height: 24px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.level-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    width: 0%;
    transition: width 0.1s ease;
}

/* ========================================
   Keyboard Test
   ======================================== */
.keyboard-layout-toggle {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.layout-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.layout-btn:hover {
    border-color: var(--primary-blue);
    color: var(--text-primary);
}

.layout-btn.active {
    background: #dbeafe;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.keyboard-stats-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-md);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: var(--spacing-lg);
}

.progress-stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.progress-label {
    color: var(--text-secondary);
}

.progress-value {
    color: #16a34a;
    font-weight: 700;
}

.keys-stat {
    color: var(--text-secondary);
}

.keys-stat span {
    color: var(--text-primary);
    font-weight: 600;
}

.keyboard-container {
    overflow-x: auto;
    overflow-y: visible;
    padding: var(--spacing-md);
    width: 100%;
    display: flex;
    justify-content: center;
}

.keyboard-layout {
    display: flex;
    gap: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    transform-origin: top center;
    --keyboard-base-width: 950px;
    max-width: 100%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.keyboard-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.keyboard-right {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.keyboard-editing,
.keyboard-arrows,
.keyboard-numpad {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Numpad grid layout - 4 columns */
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(4, 34px);
    gap: 5px;
}

/* Numpad + key spans 2 rows */
.key-numpad-plus {
    grid-row: span 2;
    height: calc(34px * 2 + 5px);
}

/* Numpad Enter key spans 2 rows */
.key-numpad-enter {
    grid-row: span 2;
    height: calc(34px * 2 + 5px);
}

/* Numpad 0 key spans 2 columns */
.key-numpad-zero {
    grid-column: span 2;
    min-width: calc(34px * 2 + 5px);
}

.keyboard-row {
    display: flex;
    gap: 5px;
}

.function-row {
    margin-bottom: 12px;
    padding-bottom: 0;
    border-bottom: none;
}

/* Spacer between F-key groups */
.key-spacer {
    width: 20px;
    flex-shrink: 0;
}

.key {
    min-width: 34px;
    height: 34px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #d1d5db;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-size: 0.7rem;
    font-weight: 500;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    box-shadow: 0 2px 0 #e5e7eb, 0 3px 6px rgba(0, 0, 0, 0.08);
}

.key:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
}

.key.pressed {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    border-color: #15803d;
    color: white;
    transform: scale(0.95);
}

.key.tested {
    background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #22c55e;
    color: #166534;
}

.tested-indicator {
    color: #16a34a;
    font-weight: 600;
}

/* Key size variants */
.key-wide {
    min-width: 80px;
}

.key-tab {
    min-width: 65px;
}

.key-backslash {
    min-width: 55px;
}

.key-caps {
    min-width: 75px;
}

.key-enter {
    min-width: 95px;
}

.key-shift-left {
    min-width: 100px;
}

.key-shift-right {
    min-width: 115px;
}

.key-ctrl,
.key-alt,
.key-menu {
    min-width: 52px;
    font-size: 0.7rem;
}

.key-meta {
    min-width: 52px;
}

.key-meta-mac {
    min-width: 80px;
    font-size: 0.65rem;
}

.key-space {
    min-width: 280px;
}

.keyboard-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: var(--spacing-md);
}

/* ========================================
   Keyboard Guide Sections
   ======================================== */
.keyboard-guide-section,
.keyboard-features-section,
.keyboard-issues-section,
.keyboard-faq-section {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.keyboard-guide-section h3,
.keyboard-features-section h3,
.keyboard-issues-section h3,
.keyboard-faq-section h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

/* How to Use Steps */
.guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.guide-step {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-blue), #1d4ed8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    margin: 0 0 var(--spacing-xs);
    font-size: 1rem;
    color: var(--text-primary);
}

.step-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Features Grid Compact */
.features-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-sm);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.feature-item .feature-icon {
    font-size: 1.25rem;
}

/* Issues Grid */
.issues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-md);
}

.issue-card {
    padding: var(--spacing-md);
    background: var(--bg-white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    border-left: 4px solid #f97316;
}

.issue-card h4 {
    margin: 0 0 var(--spacing-xs);
    font-size: 1rem;
    color: var(--text-primary);
}

.issue-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* FAQ List */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.faq-item {
    padding: var(--spacing-md);
    background: var(--bg-white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.faq-item h4 {
    margin: 0 0 var(--spacing-xs);
    font-size: 1rem;
    color: var(--text-primary);
}

.faq-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive Keyboard Layout */
@media (max-width: 1200px) {
    .keyboard-container {
        overflow: hidden;
    }

    .keyboard-layout {
        flex-direction: column;
        align-items: center;
        transform: scale(0.85);
        transform-origin: top center;
    }

    .keyboard-main,
    .keyboard-right,
    .keyboard-numpad {
        width: 100%;
        max-width: fit-content;
    }

    .keyboard-right {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-lg);
    }
}


@media (max-width: 768px) {
    .keyboard-container {
        display: flex;
        justify-content: center;
        overflow: hidden;
        min-height: 380px;
    }

    .keyboard-layout {
        transform: scale(0.55);
        transform-origin: top center;
        width: 900px;
        flex-shrink: 0;
        margin-bottom: -180px;
    }

    .key {
        min-width: 36px;
        height: 36px;
        font-size: 0.7rem;
    }

    .key-wide {
        min-width: 65px;
    }

    .key-tab {
        min-width: 52px;
    }

    .key-backslash {
        min-width: 45px;
    }

    .key-caps {
        min-width: 60px;
    }

    .key-enter {
        min-width: 75px;
    }

    .key-shift-left {
        min-width: 80px;
    }

    .key-shift-right {
        min-width: 90px;
    }

    .key-ctrl,
    .key-alt,
    .key-menu,
    .key-meta {
        min-width: 42px;
    }

    .key-space {
        min-width: 180px;
    }

    .numpad-grid {
        grid-template-columns: repeat(4, 36px);
    }

    .key-numpad-plus,
    .key-numpad-enter {
        height: calc(36px * 2 + 6px);
    }

    .key-numpad-zero {
        min-width: calc(36px * 2 + 6px);
    }

    .guide-steps {
        grid-template-columns: 1fr;
    }

    .features-grid-compact {
        grid-template-columns: 1fr;
    }

    .issues-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .keyboard-container {
        min-height: 300px;
    }

    .keyboard-layout {
        transform: scale(0.42);
        width: 900px;
        margin-bottom: -280px;
    }

    .key {
        min-width: 28px;
        height: 28px;
        font-size: 0.6rem;
    }

    .key-wide {
        min-width: 50px;
    }

    .key-tab {
        min-width: 42px;
    }

    .key-backslash {
        min-width: 35px;
    }

    .key-caps {
        min-width: 48px;
    }

    .key-enter {
        min-width: 60px;
    }

    .key-shift-left {
        min-width: 65px;
    }

    .key-shift-right {
        min-width: 72px;
    }

    .key-ctrl,
    .key-alt,
    .key-menu,
    .key-meta {
        min-width: 34px;
        font-size: 0.55rem;
    }

    .key-space {
        min-width: 140px;
    }

    .numpad-grid {
        grid-template-columns: repeat(4, 28px);
    }

    .key-numpad-plus,
    .key-numpad-enter {
        height: calc(28px * 2 + 6px);
    }

    .key-numpad-zero {
        min-width: calc(28px * 2 + 6px);
    }

    .keyboard-stats-panel {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .keyboard-layout-toggle {
        flex-direction: column;
    }
}

/* ========================================
   Mouse Test
   ======================================== */
.mouse-test-area {
    width: 100%;
    height: 400px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
}

.mouse-test-area p {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    pointer-events: none;
}

#mouse-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ========================================
   CPU Stress Test
   ======================================== */
.stress-controls {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
}

.stress-chart {
    width: 100%;
    max-width: 800px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

#stress-chart {
    display: block;
    width: 100%;
    height: auto;
}

/* ========================================
   Battery
   ======================================== */
.battery-container {
    max-width: 100%;
}

.battery-dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Two-column BatteryInfoView layout */
.bv-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: start;
}
.bv-left, .bv-right {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* BatteryInfoView Hardware Table */
.bv-section {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}
.bv-section-header {
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.bv-os-badge {
    display: inline-block;
    font-size: 0.75rem;
    color: #a5b4fc;
    background: rgba(99,102,241,0.2);
    border: 1px solid rgba(99,102,241,0.3);
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 6px;
}
.bv-title {
    font-size: 1rem;
    font-weight: 700;
    color: #e0e7ff;
    margin: 4px 0;
}
.bv-subtitle {
    font-size: 0.8rem;
    color: #818cf8;
    margin: 0;
    line-height: 1.4;
}
.bv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.bv-table thead th {
    padding: 8px 12px;
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(0,0,0,0.03);
    border-bottom: 1px solid var(--border-color);
}
.bv-row {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}
.bv-row:last-child { border-bottom: none; }
.bv-row:hover { background: rgba(99,102,241,0.05); }
.bv-field {
    padding: 8px 12px;
    font-weight: 600;
    color: var(--text-primary);
    width: 38%;
    white-space: nowrap;
}
.bv-value {
    padding: 8px 6px;
    color: var(--text-secondary);
    font-size: 0.82rem;
}
.bv-native {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bv-lock {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}
.bv-subcmd {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.72rem;
    color: #22d3ee;
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
    display: block;
}
.bv-note {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    display: block;
}
.bv-copy-cell {
    padding: 8px 10px 8px 4px;
    text-align: right;
    width: 56px;
}
.bv-copy-btn {
    background: rgba(99,102,241,0.12);
    color: #818cf8;
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.bv-copy-btn:hover { background: rgba(99,102,241,0.22); color: #6366f1; }
.bv-copy-btn.copied { background: rgba(34,197,94,0.15); color: #22c55e; border-color: rgba(34,197,94,0.3); }

/* All-in-one command block */
.bv-allinone {
    padding: var(--spacing-md) var(--spacing-lg);
    background: #0f172a;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.bv-allinone-label {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 6px;
}
.bv-allinone-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.bv-allinone-cmd {
    flex: 1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: #22d3ee;
    background: transparent;
    word-break: break-all;
    min-width: 0;
}
.bv-copy-big {
    padding: 5px 12px;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Live table (left panel) */
.bv-live-table-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}
.bv-live-badge {
    padding: 6px 14px;
    background: rgba(34,197,94,0.08);
    border-bottom: 1px solid rgba(34,197,94,0.15);
    font-size: 0.78rem;
    font-weight: 600;
    color: #16a34a;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bv-live-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.bv-live-row {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}
.bv-live-row:last-child { border-bottom: none; }
.bv-live-row:hover { background: rgba(0,0,0,0.03); }
.bv-row-locked { opacity: 0.55; }
.bv-live-field {
    padding: 7px 14px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.82rem;
    width: 55%;
}
.bv-live-val {
    padding: 7px 14px 7px 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    position: relative;
}
.bv-live-pip {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    animation: live-pulse 1.5s ease-in-out infinite;
}

/* Health estimate tag */
.bv-estimate-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 400;
    color: #f59e0b;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.25);
    padding: 1px 7px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
}

@media (max-width: 900px) {
    .bv-layout {
        grid-template-columns: 1fr;
    }
}

/* Live bar */
.battery-live-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.live-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    flex-shrink: 0;
    animation: live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
    50%       { opacity: 0.8; transform: scale(1.1); box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}
.live-label {
    font-weight: 600;
    color: #16a34a;
}
.live-updated {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Real-time row */
.battery-realtime-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}
.battery-rt-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}
.rt-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}
.rt-content {
    flex: 1;
    min-width: 0;
}
.rt-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}
.rt-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rt-countdown {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.3rem;
    letter-spacing: 0.05em;
    color: #6366f1;
}

/* Chart card */
.battery-chart-card {
    padding: var(--spacing-lg);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}
.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}
.chart-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.chart-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(99,102,241,0.08);
    padding: 2px 8px;
    border-radius: 10px;
}
#bat-chart {
    display: block;
    width: 100%;
    border-radius: 8px;
}

/* Session stats card */
.battery-session-card {
    padding: var(--spacing-lg);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}
.battery-session-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}
.session-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}
.session-stat {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
.session-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.session-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .battery-realtime-row {
        grid-template-columns: 1fr;
    }
    .session-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.battery-main-display {
    padding: var(--spacing-xl);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    justify-content: center;
}

.battery-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.battery-outer {
    display: flex;
    align-items: center;
    gap: 4px;
}

.battery-inner {
    width: 200px;
    height: 80px;
    border: 3px solid var(--border-color);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    background: var(--bg-white);
}

.battery-level-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    transition: width 0.5s ease;
}

.battery-tip {
    width: 8px;
    height: 30px;
    background: var(--border-color);
    border-radius: 0 4px 4px 0;
}

.battery-percentage {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.battery-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Battery Cap */
.battery-cap {
    width: 8px;
    height: 30px;
    background: var(--border-color);
    border-radius: 0 4px 4px 0;
}

/* Battery Percentage Large */
.battery-percentage-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.battery-status-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Charging Indicator */
.charging-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Battery Health Card */
.battery-health-card {
    padding: var(--spacing-lg);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.battery-health-card h4 {
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Health Display - Key Fix for Gauge Sizing */
.health-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.health-gauge {
    width: 150px !important;
    height: 150px !important;
    max-width: 150px !important;
    position: relative;
    flex-shrink: 0;
}

.health-circle {
    width: 100% !important;
    height: 100% !important;
    max-width: 150px !important;
}

.health-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.health-percent {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
}

.health-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.health-details {
    flex: 1;
    min-width: 200px;
}

.health-status {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.health-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.drain-info {
    font-size: 0.85rem;
    color: var(--accent-primary);
}

.estimation-disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: rgba(245, 158, 11, 0.1);
    border-radius: 6px;
}

/* Battery Stats Grid */
.battery-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-md);
}

.battery-stat-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.stat-icon {
    font-size: 1.8rem;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-value-detailed {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.time-hours,
.time-minutes {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.time-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Battery Tips */
.battery-tips {
    padding: var(--spacing-lg);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.battery-tips h4 {
    margin-bottom: var(--spacing-md);
}

.tips-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.tip {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    font-size: 0.9rem;
}

.tip.default {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
}

.tip.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.tip.info {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}

.tip.success {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

/* Detailed Health Section */
.detailed-health-section {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.detailed-health-section h4 {
    margin-bottom: var(--spacing-md);
}

.os-instructions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.os-card {
    padding: var(--spacing-md);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.os-card h5 {
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
}

.instruction-steps {
    font-size: 0.9rem;
}

.instruction-steps code {
    display: block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: #1e293b;
    color: #22d3ee;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    margin: var(--spacing-xs) 0;
    overflow-x: auto;
}

.instruction-steps .small {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.tool-link {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--accent-primary);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.tool-link:hover {
    background: var(--accent-dark);
}

/* Battery Updated */
.battery-updated {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.update-note {
    opacity: 0.7;
}

/* Battery Not Supported */
.battery-not-supported {
    text-align: center;
    padding: var(--spacing-xl);
}

.battery-not-supported h3 {
    margin: var(--spacing-md) 0;
}

.battery-icon-large {
    color: var(--text-muted);
}

.browser-support-info {
    margin: var(--spacing-lg) auto;
    max-width: 300px;
    text-align: left;
}

.browser-support-info h4 {
    margin-bottom: var(--spacing-sm);
}

.browser-support-info ul {
    list-style: none;
    padding: 0;
}

.browser-support-info li {
    padding: var(--spacing-xs) 0;
}

/* Battery Error */
.battery-error {
    text-align: center;
    padding: var(--spacing-xl);
}

.error-icon {
    font-size: 3rem;
}

/* ========================================
   Dead Pixel Test
   ======================================== */
.dead-pixel-controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.btn-pixel {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-pixel:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   Fullscreen Overlay
   ======================================== */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 10000;
    cursor: none;
}

.fullscreen-overlay.active {
    display: block;
}

.exit-hint {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 6px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.fullscreen-overlay:hover .exit-hint {
    opacity: 1;
}

/* ========================================
   Utilities Grid
   ======================================== */
.utilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.utility-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.utility-card:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.utility-card h3 {
    font-size: 1.15rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.utility-card p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
}

.shortcut-info {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    text-align: center;
}

kbd {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================================
   Standalone Tool Pages
   ======================================== */
.page-hero {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    background: linear-gradient(180deg, var(--bg-white) 0%, var(--bg-light) 100%);
    border-radius: 16px;
    margin: var(--spacing-lg) 0;
}

.page-hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.page-hero .hero-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

.breadcrumb {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--primary-blue);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Test Section */
.test-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

/* Content Sections */
.content-section {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.content-section h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.content-section h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.content-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Related Tools Grid */
.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.related-tool-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-md);
    text-decoration: none;
    text-align: center;
    transition: var(--transition-fast);
}

.related-tool-card:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.related-tool-card .tool-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: var(--spacing-sm);
}

.related-tool-card h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.related-tool-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Nav Link Active State */
.nav-link.active,
.mobile-nav-link.active {
    color: var(--primary-blue);
    font-weight: 600;
}

@media (max-width: 768px) {
    .related-tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-hero h1 {
        font-size: 1.75rem;
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .tests-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .site-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-description {
        font-size: 1rem;
    }

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

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

    .features-grid {
        grid-template-columns: 1fr;
    }

    .speaker-controls {
        grid-template-columns: 1fr;
    }

    .sweep-controls {
        grid-template-columns: 1fr;
    }

    .keyboard-stats-panel {
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }

    .stats-panel {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .tests-grid {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn-primary,
    .hero-buttons .btn-secondary {
        width: 100%;
    }

    .camera-controls,
    .mic-controls {
        flex-direction: column;
    }

    .camera-controls .btn,
    .mic-controls .btn,
    .select-input {
        width: 100%;
    }

    .stress-controls {
        flex-direction: column;
    }

    .stress-controls .input-group,
    .stress-controls .btn {
        width: 100%;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* ========================================
   Scrollbar Styling
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   Selection Styling
   ======================================== */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
}
/* ========================================
   Camera Real-time Module CSS
   ======================================== */
.cam-live-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.cam-rt-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.cam-rt-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
}
.cam-rt-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.cam-rt-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}
.cam-table-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
}
.cam-table-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cam-table { width: 100%; border-collapse: collapse; }
.cam-table tr { border-bottom: 1px solid var(--border-color); }
.cam-table tr:last-child { border-bottom: none; }
.cam-td-label {
    padding: 7px 10px 7px 0;
    font-size: 0.80rem;
    color: var(--text-muted);
    white-space: nowrap;
    width: 45%;
}
.cam-td-val {
    padding: 7px 0;
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
}
.cam-bright-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.cam-bright-bar-wrap {
    background: var(--bg-light);
    border-radius: 6px;
    overflow: hidden;
    height: 10px;
    margin: 8px 0;
}
.cam-bright-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s, background 0.3s;
    background: #22c55e;
}
.cam-bright-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.70rem;
    color: var(--text-muted);
}
.cam-error {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========================================
   Microphone Real-time Module CSS
   ======================================== */
.mic-live-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.mic-rt-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.mic-rt-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
}
.mic-rt-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.mic-rt-label {
    font-size: 0.70rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}
.mic-db-meter-wrap {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.mic-db-zones {
    display: flex;
    font-size: 0.65rem;
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 6px;
    gap: 2px;
}
.mic-db-zone-good { background: rgba(34,197,94,0.12); border-radius: 3px; padding: 2px 4px; flex: 60; }
.mic-db-zone-mid  { background: rgba(245,158,11,0.15); border-radius: 3px; padding: 2px 4px; flex: 20; }
.mic-db-zone-hot  { background: rgba(239,68,68,0.15); border-radius: 3px; padding: 2px 4px; flex: 14; }
.mic-db-zone-clip { background: rgba(239,68,68,0.4); border-radius: 3px; padding: 2px 4px; flex: 6; color: #ef4444; font-weight: 700; }
.mic-db-bar-outer {
    background: var(--bg-light);
    border-radius: 6px;
    height: 12px;
    overflow: hidden;
}
.mic-db-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.1s, background 0.2s;
    background: #22c55e;
}

/* ========================================
   Display Real-time Module CSS
   ======================================== */
.dsp-live-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.dsp-rt-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.dsp-rt-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
}
.dsp-rt-val {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.dsp-rt-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}
.dsp-measuring { color: var(--text-muted); font-size: 0.85rem; }
.dsp-gamut-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
}
.dsp-gamut-strips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}
.dsp-strip {
    height: 56px;
    border-radius: 6px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}
.dsp-strip span {
    font-size: 0.6rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    background: rgba(0,0,0,0.4);
    padding: 1px 5px;
    border-radius: 3px;
    margin-bottom: 4px;
    white-space: nowrap;
}

/* ========================================
   Network Real-time Module CSS
   ======================================== */
.net-live-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.net-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.net-dot-online  { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.6); animation: pulse 2s infinite; }
.net-dot-offline { background: #ef4444; }
.net-speed-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.net-speed-btn {
    background: var(--accent-primary, #6366f1);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.net-speed-btn:hover   { opacity: 0.85; }
.net-speed-btn:disabled{ opacity: 0.5; cursor: default; }
.net-speed-result {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ========================================
   System Specs Real-time Module CSS
   ======================================== */
/* (reuses .dsp-live-bar, .dsp-rt-row, .dsp-rt-card, .dsp-rt-val, .dsp-rt-label from display module) */
