.microphone-test-component {
    padding: 1%;
    background: var(--container-bg, #f8f9fa);
    border-radius: 8px;
    border: 1px solid var(--container-border, #dee2e6);
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: clamp(0.6rem, 1.5vw, 0.9rem);
}
.mic-header {
    text-align: center;
    flex-shrink: 0;
}
.mic-header h3 {
    margin: 0 0 0.35rem 0;
    font-size: 1.2em;
    font-weight: 600;
    line-height: 1.2;
    color: #2c3e50;
}
.mic-controls {
    margin-bottom: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.mic-controls select {
    padding: 5px 8px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 0.9em;
    background: #fff;
}
#mic-device-select {
    width: min(100%, 320px);
    max-width: 320px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}
#mic-device-select option {
    white-space: normal;
    overflow-wrap: anywhere;
}
.mic-theme-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.mic-theme-control label {
    font-size: 0.85em;
    color: #555;
}
.recording-controls {
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    max-width: 420px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    gap: 10px;
    flex-shrink: 0;
}
.recording-controls button {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    color: white;
    transition: opacity 0.2s;
}
.recording-controls button:hover:not(:disabled) {
    opacity: 0.8;
}
.recording-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.mic-component-record-btn {
    background: #e74c3c;
}
.mic-component-play-btn {
    background: #3498db;
}
.mic-component-reset-btn {
    background: #95a5a6;
}
.microphone-test-component .record-btn { background: #e74c3c; }
.microphone-test-component .play-btn { background: #3498db; }
.microphone-test-component .reset-btn { background: #f59e0b; }
.microphone-test-component .reset-btn:disabled { background: #95a5a6; }

.canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow: hidden;
}
.canvas-wrapper {
    flex: 1;
    min-height: 0;
    position: relative;
}
.mic-canvas {
    width: 100%;
    height: 100%;
    background: #222;
    border-radius: 4px;
    display: block;
}
.mic-overlay-canvas {
    position: absolute;
    inset: 0;
    background: transparent;
    cursor: crosshair;
    touch-action: none;
    -ms-touch-action: none;
    z-index: 2;
}
.scrub-hint {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.78em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease;
    z-index: 3;
}
.scrub-hint:not(.scrub-hint-hidden) {
    opacity: 1;
}
.frequency-markers {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 4;
}
.frequency-marker {
    position: absolute;
    right: 5px;
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 4px;
    border-radius: 2px;
    white-space: nowrap;
    transform: translateY(-50%);
}

.mic-fullscreen-btn {
    position: absolute;
    left: 6px;
    bottom: 6px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    cursor: pointer;
    z-index: 5;
    opacity: 0.85;
    transition: opacity 0.2s, background-color 0.2s;
}

.mic-fullscreen-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.9);
}

.mic-fullscreen-btn svg {
    width: 16px;
    height: 16px;
}