* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
}

.recorder {
    width: min(95vw, 760px);
    padding: 2rem;
    text-align: center;
    background: white;
    border: 1px solid #d8dde3;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 10%);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

button {
    min-width: 150px;
    padding: 0.8rem 1rem;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

#startButton {
    color: white;
    background: #177245;
}

#stopButton {
    color: white;
    background: #b42318;
}

#transcribeButton {
    color: white;
    background: #2457a7;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#format,
#uploadStatus {
    padding: 0.75rem;
    background: #eef2f7;
    border-radius: 8px;
}

#status {
    min-height: 1.5rem;
    margin-top: 1.25rem;
    font-weight: 600;
}

#timer {
    margin: 0.5rem 0 1rem;
    font-size: 2rem;
    font-variant-numeric: tabular-nums;
}

#transcriptSection {
    margin-top: 2rem;
    text-align: left;
}

#transcript {
    width: 100%;
    resize: vertical;
    padding: 0.8rem;
    border: 1px solid #b8c0cc;
    border-radius: 8px;
    font: 1rem/1.45 Arial, sans-serif;
}


.download-links {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    align-items: center;
}

.download-links a {
    font-weight: 600;
}


#debugSection {
    margin-top: 1.5rem;
    padding: 1rem;
    text-align: left;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff8e6;
}

#debugSection summary {
    cursor: pointer;
    font-weight: 700;
}

#debugOutput {
    max-height: 520px;
    overflow: auto;
    padding: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
    background: #111827;
    color: #f9fafb;
    border-radius: 8px;
    font: 0.85rem/1.4 Consolas, "Courier New", monospace;
}


.build-info {
    margin-top: 1.25rem;
    font-size: 0.78rem;
    color: #6b7280;
}


.existing-recordings {
    margin: 1.25rem 0;
    padding: 1rem;
    text-align: left;
    border: 1px solid #d8dde3;
    border-radius: 10px;
    background: #f9fafb;
}

.existing-recordings h2 {
    margin-top: 0;
    font-size: 1.15rem;
}

.record-picker {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 0.65rem;
    align-items: center;
}

#existingRecordingSelect {
    width: 100%;
    min-height: 42px;
    padding: 0.55rem;
    border: 1px solid #b8c0cc;
    border-radius: 8px;
    background: white;
    font: inherit;
}

#refreshRecordingsButton,
#useRecordingButton {
    min-width: 130px;
    background: #4b5563;
    color: white;
}

#useRecordingButton {
    background: #6d3fa0;
}

#selectedRecordingInfo {
    margin-bottom: 0;
    color: #4b5563;
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .record-picker {
        grid-template-columns: 1fr;
    }

    #refreshRecordingsButton,
    #useRecordingButton {
        width: 100%;
    }
}
