:root {
    color-scheme: dark;
    --bg: #191d21;
    --panel: #252b31;
    --panel-light: #2d353c;
    --text: #f1f1f1;
    --muted: #aab4be;
    --line: rgba(255, 255, 255, 0.14);
    --cyan: #49c6d8;
    --danger: #e16b5f;
    --success: #62cf91;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

button,
audio {
    font: inherit;
}

.voice-page {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 48px 24px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(73, 198, 216, 0.12), transparent 36%),
        linear-gradient(315deg, rgba(242, 184, 75, 0.08), transparent 30%),
        var(--bg);
}

.ambient-grid {
    position: absolute;
    inset: 0;
    opacity: 0.2;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 42px 42px;
    pointer-events: none;
}

.assistant-panel {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 22px;
    width: min(920px, 100%);
}

.panel-header,
.recorder,
.results article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(37, 43, 49, 0.94);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--cyan);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(32px, 6vw, 52px);
}

h2 {
    margin-bottom: 10px;
    font-size: 19px;
}

.intro,
.status,
.muted {
    color: var(--muted);
}

.intro,
.status,
.result-copy {
    margin-bottom: 0;
    line-height: 1.5;
}

.back-link {
    flex: 0 0 auto;
    color: var(--text);
    text-decoration: none;
}

.back-link:hover {
    color: var(--cyan);
}

.recorder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 28px;
}

.status[data-state="recording"] {
    color: var(--danger);
}

.status[data-state="success"] {
    color: var(--success);
}

.status[data-state="error"] {
    color: #ff9c92;
}

.record-actions {
    display: flex;
    gap: 10px;
}

button {
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 700;
}

button:disabled {
    cursor: default;
    opacity: 0.5;
}

.primary-button {
    background: #f4f4f4;
    color: #20262c;
}

.secondary-button {
    border-color: rgba(255, 255, 255, 0.24);
    background: var(--panel-light);
    color: var(--text);
}

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

.results article {
    min-height: 190px;
    padding: 22px;
}

.result-copy {
    min-height: 72px;
    overflow-wrap: anywhere;
}

audio {
    width: 100%;
    margin-top: 18px;
}

.action-result {
    margin: 0;
    color: var(--muted);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .voice-page {
        padding: 24px 16px;
    }

    .panel-header,
    .recorder {
        align-items: stretch;
        flex-direction: column;
    }

    .record-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

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

    .results article {
        min-height: 0;
    }
}
