*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f0f4f8;
    color: #1a2332;
    min-height: 100vh;
    padding: 24px 16px;
}

.container {
    max-width: 680px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 28px;
}

header h1 {
    font-size: 2rem;
    color: #1565c0;
    letter-spacing: 1px;
}

.subtitle {
    color: #546e7a;
    margin-top: 4px;
    font-size: 0.95rem;
}

/* Karty */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 12px;
}

.hint {
    font-size: 0.88rem;
    color: #607d8b;
    margin-bottom: 12px;
}

.hint code {
    background: #e8f0fe;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: monospace;
    color: #1565c0;
}

/* Upload šablony */
.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    pointer-events: none;
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px dashed #90caf9;
    border-radius: 8px;
    padding: 14px 18px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-size: 0.95rem;
    color: #1565c0;
    background: #fff;
    width: 100%;
    text-align: left;
}

.upload-btn:hover {
    border-color: #1565c0;
    background: #e8f0fe;
}

.upload-btn.uploaded {
    border-color: #43a047;
    background: #f1f8e9;
    color: #2e7d32;
}

.template-confirm {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 14px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    color: #2e7d32;
    font-size: 0.92rem;
    font-weight: 500;
}

.confirm-check {
    font-size: 1.1rem;
    font-weight: 700;
    color: #388e3c;
    flex-shrink: 0;
}

/* Mikrofon */
.mic-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.btn-mic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: #1565c0;
    cursor: pointer;
    font-size: 2rem;
    box-shadow: 0 4px 14px rgba(21,101,192,0.35);
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-mic:hover { background: #1976d2; transform: scale(1.05); }
.btn-mic:active { transform: scale(0.97); }

.btn-mic.recording {
    background: #c62828;
    box-shadow: 0 0 0 6px rgba(198,40,40,0.2);
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0   rgba(198,40,40,0.35); }
    70%  { box-shadow: 0 0 0 14px rgba(198,40,40,0); }
    100% { box-shadow: 0 0 0 0   rgba(198,40,40,0); }
}

.rec-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #c62828;
    font-weight: 600;
    font-size: 0.95rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c62828;
    animation: blink 1s infinite;
}

@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.2; } }

/* Spinner */
.processing {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    color: #1565c0;
    font-weight: 500;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #bbdefb;
    border-top-color: #1565c0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Textarea */
textarea {
    width: 100%;
    border: 1px solid #cfd8dc;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    color: #1a2332;
    transition: border-color 0.2s;
}

textarea:focus { outline: none; border-color: #1565c0; }

/* Akční tlačítka */
.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 11px 0;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
    background: #1565c0;
    color: #fff;
}

.btn-primary:hover:not(:disabled) { background: #1976d2; }
.btn-primary:disabled { opacity: 0.45; cursor: default; }

.btn-secondary {
    background: #eceff1;
    color: #546e7a;
}

.btn-secondary:hover { background: #cfd8dc; }

/* Status zprávy */
.status-msg {
    font-size: 0.85rem;
    margin-top: 8px;
    min-height: 18px;
    color: #43a047;
}

/* Chybová hláška */
.error-box {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    border-radius: 8px;
    padding: 14px 18px;
    color: #c62828;
    font-size: 0.93rem;
    margin-bottom: 20px;
}

.hidden { display: none !important; }
