/* ========================================================================
   Live STT — 미려 디자인 오버레이 (live_stt.css 위에 적용)
   회의 중 켜놓는 화면이라 "프리미엄·집중" 느낌으로 정돈.
   라이트/다크 모두 자연스럽도록 var(--surface-color) 등 기존 토큰 활용.
   ======================================================================== */

:root {
    --stt-glow-1: rgba(99, 102, 241, 0.32);
    --stt-glow-2: rgba(168, 85, 247, 0.28);
    --stt-glow-3: rgba(236, 72, 153, 0.22);
    --stt-card-shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.45);
    --stt-card-border: rgba(15, 23, 42, 0.06);
    --stt-accent: #6366f1;
    --stt-accent-2: #a855f7;
    --stt-rec: #ef4444;
}

[data-theme='dark'] :root,
[data-theme='dark'] {
    --stt-card-shadow: 0 22px 50px -28px rgba(0, 0, 0, 0.7);
    --stt-card-border: rgba(255, 255, 255, 0.08);
}

/* ── 전체 작업영역 카드화 ── */
.live-stt-page .stt-workspace-frame {
    border-radius: 22px;
    overflow: hidden;
    background: var(--surface-color);
    border: 1px solid var(--stt-card-border);
    box-shadow: var(--stt-card-shadow);
}

/* ── 헤더(라벨 + LIVE pill): 더 차분하게 ── */
.live-stt-page .stt-session-header--minimal {
    padding: 18px 22px 12px;
    border-bottom: 1px solid var(--stt-card-border);
    background:
        radial-gradient(60% 120% at 0% 0%, var(--stt-glow-1), transparent 70%),
        radial-gradient(80% 140% at 100% 0%, var(--stt-glow-2), transparent 65%),
        var(--surface-color);
}

.live-stt-page .stt-session-header__meta-block .stt-transcript-section__label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.live-stt-page .stt-session-header__meta-block .stt-transcript-section__meta {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── LIVE Pill: 호흡하는 듯한 펄스 ── */
.live-stt-page .stt-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
    background: linear-gradient(135deg, var(--stt-accent), var(--stt-accent-2));
    box-shadow: 0 6px 18px -8px var(--stt-glow-1);
}

.live-stt-page .stt-live-pill__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.85);
    animation: sttPulse 1.6s ease-out infinite;
}

@keyframes sttPulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.85); }
    70%  { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* 녹음 중일 때 LIVE pill 색을 빨강 계열로 (data-recording=1 root) */
.live-stt-page[data-recording='1'] .stt-live-pill,
.live-stt-page .stt-root[data-recording='1'] .stt-live-pill,
.stt-root[data-recording='1'] .stt-live-pill {
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 6px 18px -8px rgba(239, 68, 68, 0.45);
}

/* ── Transcript 영역: 깊이감 있는 스크롤 컨테이너 ── */
.live-stt-page .stt-transcript-section {
    padding: 10px 22px 6px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--surface-color) 96%, transparent), var(--surface-color));
}

.live-stt-page .stt-scroll-wrap {
    background: color-mix(in srgb, var(--bg-color) 70%, var(--surface-color));
    border: 1px solid var(--stt-card-border);
    border-radius: 16px;
    padding: 14px 14px 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.live-stt-page #stt-segments .stt-segment,
.live-stt-page #stt-segments > div {
    transition: background 200ms ease, transform 200ms ease;
}

/* 새로 들어온 마지막 라인 살짝 강조 */
.live-stt-page #stt-segments > div:last-child {
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--stt-accent) 8%, transparent),
        transparent 60%);
    border-radius: 10px;
}

/* partial(아직 확정 전) 텍스트 — 깜빡이는 캐럿 */
.live-stt-page .stt-partial-text::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 1em;
    margin-left: 3px;
    vertical-align: -2px;
    background: var(--stt-accent);
    border-radius: 2px;
    animation: sttCaret 900ms steps(2) infinite;
}

@keyframes sttCaret {
    50% { opacity: 0; }
}

/* ── 마이크 도크: 물결치는 글로우 ── */
.live-stt-page .stt-mic-dock {
    padding: 22px 22px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.live-stt-page .stt-mic-btn {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--stt-accent), var(--stt-accent-2));
    box-shadow:
        0 18px 40px -10px var(--stt-glow-1),
        0 8px 24px -8px var(--stt-glow-2),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 180ms ease, box-shadow 220ms ease;
    overflow: visible;
}

.live-stt-page .stt-mic-btn:hover {
    transform: translateY(-1px) scale(1.02);
}

.live-stt-page .stt-mic-btn:active {
    transform: translateY(0) scale(0.98);
}

/* 녹음 중: 빨강 + 다중 링 펄스 */
.live-stt-page .stt-mic-btn--rec {
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow:
        0 18px 40px -10px rgba(239, 68, 68, 0.45),
        0 8px 24px -8px rgba(249, 115, 22, 0.35);
}

.live-stt-page .stt-mic-btn--rec::before,
.live-stt-page .stt-mic-btn--rec::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(239, 68, 68, 0.55);
    animation: sttRing 1.6s ease-out infinite;
}

.live-stt-page .stt-mic-btn--rec::after {
    animation-delay: 0.6s;
    inset: -14px;
    border-color: rgba(249, 115, 22, 0.4);
}

@keyframes sttRing {
    0%   { transform: scale(0.85); opacity: 0.9; }
    80%  { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

.live-stt-page .stt-mic-hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* ── Bottom action bar (선택 문장 액션) — 글래스 카드 ── */
.live-stt-page .stt-bottom-bar {
    margin: 4px 22px 8px;
    border-radius: 14px;
    padding: 10px 14px;
    background: color-mix(in srgb, var(--surface-color) 85%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--stt-card-border);
    box-shadow: 0 6px 18px -14px rgba(15, 23, 42, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-stt-page .stt-bottom-bar[data-on='1'] {
    border-color: color-mix(in srgb, var(--stt-accent) 35%, transparent);
}

.live-stt-page .stt-bottom-bar > span {
    color: var(--text-muted);
    font-size: 13px;
    margin-right: 6px;
}

.live-stt-page .stt-bottom-bar .stt-tonal {
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--stt-card-border);
    background: var(--surface-color);
    color: var(--text-color);
    transition: background 160ms ease, transform 120ms ease;
}

.live-stt-page .stt-bottom-bar .stt-tonal:hover {
    background: color-mix(in srgb, var(--stt-accent) 10%, var(--surface-color));
    transform: translateY(-1px);
}

/* ── Per-speaker 요약 섹션 ── */
.live-stt-page .stt-stance-section {
    margin: 6px 22px 18px;
    padding: 16px 18px;
    border-radius: 16px;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--stt-accent) 6%, transparent),
            color-mix(in srgb, var(--stt-accent-2) 4%, transparent)),
        var(--surface-color);
    border: 1px solid var(--stt-card-border);
}

.live-stt-page .stt-stance-label {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 11px;
    color: var(--text-muted);
}

.live-stt-page .stt-stance-model {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--stt-accent) 12%, transparent);
    color: var(--stt-accent);
    font-size: 11px;
    font-weight: 600;
}

.live-stt-page .stt-stance-refresh {
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--stt-card-border);
    background: var(--surface-color);
    color: var(--text-color);
}

/* ── 화자 칩(speaker tag) — 발화자별 컬러는 동적이지만 공통 디자인 보강 ── */
.live-stt-page .stt-speaker-chip,
.live-stt-page [class*='stt-speaker-'] {
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* ── 스크롤바 미니멀 ── */
.live-stt-page .stt-scroll-wrap::-webkit-scrollbar {
    width: 8px;
}
.live-stt-page .stt-scroll-wrap::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-muted) 25%, transparent);
    border-radius: 999px;
}
.live-stt-page .stt-scroll-wrap::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--text-muted) 45%, transparent);
}

/* ── 반응형 ── */
@media (max-width: 720px) {
    .live-stt-page .stt-mic-btn {
        width: 72px;
        height: 72px;
    }
    .live-stt-page .stt-session-header--minimal {
        padding: 14px 16px 10px;
    }
    .live-stt-page .stt-transcript-section,
    .live-stt-page .stt-stance-section {
        padding-left: 14px;
        padding-right: 14px;
        margin-left: 12px;
        margin-right: 12px;
    }
}
