:root {
    color-scheme: light;
    --bg: #f6f7f4;
    --surface: #ffffff;
    --text: #18201b;
    --muted: #667069;
    --line: #d9ded8;
    --primary: #1f7a4d;
    --primary-dark: #155d3a;
    --danger: #b93b3b;
    --danger-dark: #8f2a2a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

button {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
}

button:hover {
    background: var(--primary-dark);
}

button:disabled {
    cursor: default;
    opacity: .55;
}

.secondary {
    background: #e4eee8;
    color: var(--primary-dark);
}

.secondary:hover {
    background: #d4e6da;
}

.danger {
    background: var(--danger);
}

.danger:hover {
    background: var(--danger-dark);
}

.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}

.ghost:hover {
    background: #edf0ec;
}

.app {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.workspace,
.drill {
    display: grid;
    gap: 20px;
}

.topbar,
.drill-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.05;
}

p {
    margin: 6px 0 0;
    color: var(--muted);
}

.field {
    display: grid;
    gap: 8px;
}

.field span,
.label {
    color: var(--muted);
    font-size: 14px;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 12px 14px;
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 220px;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 122, 77, .12);
}

.actions,
.drill-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.dev-drill,
.stages {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin: 8px 0;
}

/* Экранное управление сессией — крупные кнопки под палец (особенно для iOS). */
.session-controls {
    display: flex;
    gap: 12px;
    margin: 10px 0;
}
.session-controls button {
    flex: 1;
    min-width: 90px;
    padding: 16px 10px;
    font-size: 16px;
}
.dev-drill span,
.stages span { color: var(--muted); font-size: 14px; }

.status {
    min-height: 22px;
    color: var(--muted);
}

.word-list {
    display: grid;
    gap: 10px;
}

.word-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.word-row small {
    grid-column: 1 / -1;
    color: var(--muted);
}

.card {
    min-height: 420px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 22px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 32px;
    text-align: center;
}

.word {
    font-size: clamp(44px, 9vw, 92px);
    line-height: 1;
    font-weight: 750;
}

.sound {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 0;
    font-size: 20px;
}

.answer {
    min-height: 28px;
    color: var(--muted);
    font-size: 20px;
}

.enrichment {
    max-width: 560px;
    color: var(--muted);
}

@media (max-width: 640px) {
    .app {
        width: min(100% - 20px, 920px);
        padding: 20px 0;
    }

    .topbar,
    .drill-header {
        align-items: stretch;
        flex-direction: column;
    }

    .actions,
    .drill-actions {
        display: grid;
    }

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

    .card {
        min-height: 360px;
        padding: 24px 16px;
    }
}

.voice-cheats {
    margin: 4px 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
}
.voice-cheats summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-dark);
    user-select: none;
}
.voice-cheats ul {
    margin: 10px 0 4px;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.7;
}
.voice-cheats b { color: var(--text); }
