.sr-card { padding: 0; overflow: hidden; }

/* Slim, professional toolbar - no loud gradient block, just a clean strip */
.sr-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 14px 22px; border-bottom: 1px solid #eee; background: #fafbfc; }
.sr-toolbar-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: #1f2937; font-size: 1.02em; }
.sr-toolbar-brand i { color: var(--sr-dark-2); }
.sr-toolbar-status { display: flex; align-items: center; gap: 14px; }
.sr-timer { font-size: 1.1em; font-weight: 800; color: var(--sr-dark-2); font-variant-numeric: tabular-nums; }

.sr-rec-badge { background: rgba(220,38,38,.12); color: #dc2626; padding: 4px 12px; border-radius: 20px; font-size: .78em; font-weight: 700; display: none; align-items: center; gap: 6px; }
.sr-rec-badge.show { display: flex; }
.sr-rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #dc2626; animation: srPulse 1s infinite; }
@keyframes srPulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* 80 / 20 layout: preview on the left, a narrow vertical control rail on the right */
.sr-tool-row { display: flex; gap: 22px; padding: 22px; align-items: stretch; }
.sr-preview-col { flex: 0 0 80%; max-width: 80%; min-width: 0; display: flex; flex-direction: column; }
.sr-side-controls { flex: 0 0 20%; max-width: 20%; min-width: 160px; display: flex; flex-direction: column; gap: 10px; }

.sr-preview-wrap { background: #111318; border-radius: 10px; overflow: hidden; flex: 1; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; position: relative; }
.sr-preview-wrap video { width: 100%; height: 100%; object-fit: contain; background: #111318; }
.sr-preview-placeholder { color: #6b7280; text-align: center; padding: 20px; }
.sr-preview-placeholder i { font-size: 2.6em; margin-bottom: 10px; display: block; }

.sr-status { text-align: center; color: #6b7280; font-size: .88em; margin-bottom: 12px; min-height: 1.4em; }

.sr-side-mic { display: flex; align-items: center; gap: 8px; font-size: .88em; font-weight: 600; color: #374151; cursor: pointer; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 8px; white-space: nowrap; width: 95%; align-self: center; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }
.sr-side-mic input { cursor: pointer; }

.sr-side-divider { border-top: 1px solid #eee; margin: 4px 0; }

.sr-btn { border: none; border-radius: 8px; padding: 12px 16px; font-weight: 600; cursor: pointer; font-size: .9em; display: flex; align-items: center; justify-content: center; gap: 8px; transition: filter .15s ease; width: 95%; align-self: center; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-btn:disabled { opacity: .45; cursor: not-allowed; }
.sr-btn:not(:disabled):hover { filter: brightness(1.08); }
.sr-btn-start { background: var(--sr-dark-2); color: #fff; }
.sr-btn-stop { background: #1f2937; color: #fff; }
.sr-btn-download { background: var(--sr-accent); color: #1f2937; }
.sr-btn-gif { background: #fff; color: var(--sr-dark-2); border: 2px solid var(--sr-dark-2); }

/* Result/process page (opened in a new tab from Download/Convert-to-GIF) */
.sr-process { text-align: center; padding: 20px 10px; }
.sr-process-icon { font-size: 2.6em; color: var(--sr-dark-2); margin-bottom: 14px; display: block; }
.sr-process h1 { font-size: 1.3em; margin: 0 0 22px; }

.sr-progress-wrap { max-width: 420px; margin: 0 auto; }
.sr-progress-wrap.hide { display: none; }
.sr-progress-track { background: #eee; border-radius: 20px; height: 10px; overflow: hidden; }
.sr-progress-bar { background: var(--sr-accent); height: 100%; width: 0%; transition: width .2s ease; }
.sr-progress-label { font-size: .88em; color: #6b7280; margin-top: 10px; }

.sr-process-result { display: none; }
.sr-process-result.show { display: block; }
.sr-process-success-icon { font-size: 2.6em; color: #15803d; margin-bottom: 12px; display: block; }
.sr-process-result p { color: #374151; margin-bottom: 20px; }
.sr-process-result .sr-btn { max-width: 320px; margin: 0 auto 16px; }

.sr-process-back { display: inline-block; color: var(--sr-dark-2); font-weight: 600; font-size: .9em; }
.sr-process-back-wrap.hide { display: none; }

.sr-status.sr-error { color: #b91c1c; }
#spError:not(.show) { display: none; }

@media (max-width: 700px) {
    .sr-tool-row { flex-direction: column; }
    .sr-preview-col, .sr-side-controls { flex: 1 1 auto; max-width: 100%; }
}
