:root {
    --sage: #8fb896;
    --sage-deep: #6f9a78;
    --rose: #dfa8b0;
    --rose-deep: #c98a96;
    --bg-a: #dce8d6;
    --bg-b: #f0dce0;
    --bg-c: #e6f0ea;
    --card: rgba(255, 255, 255, 0.9);
    --text: #3a4540;
    --muted: #66726c;
    /*
     * Simli Trinity frames have empty sky above the head.
     * Crop ONLY on media (video/still/freeze) inside .talk-persona-stage.
     * Never transform session-wrap / stage / UI — that collapses the layout box.
     * 1.22 ≈ 10% less zoom than 1.35; milder -Y so crown of head stays in frame.
     */
    --talk-simli-crop-scale: 1.22;
    --talk-simli-crop-shift-y: -10%;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Nunito, system-ui, sans-serif;
    color: var(--text);
}

body {
    background: linear-gradient(135deg, var(--bg-a), var(--bg-b), var(--bg-c), var(--bg-b));
    background-size: 320% 320%;
    animation: talkGradientShift 14s ease infinite;
    padding:
        max(8px, env(safe-area-inset-top))
        max(12px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(12px, env(safe-area-inset-left));
}

@keyframes talkGradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.talk-app {
    max-width: 480px;
    margin: 0 auto;
    min-height: calc(100vh - 16px);
    display: flex;
    flex-direction: column;
}

.talk-screen[hidden],
.talk-top-bar[hidden],
#talkToast[hidden] {
    display: none !important;
}

.talk-top-bar {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 0 10px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(180deg, rgba(220, 232, 214, 0.92) 75%, transparent);
}

.talk-back-btn {
    border: none;
    background: #fff;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #2a1f4e;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(42, 31, 78, 0.08);
}

.talk-back-btn svg {
    display: block;
}

.talk-archive-top-btn {
    border: 0;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    width: 34px;
    height: 34px;
    margin-right: 4px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.talk-level-bar {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.talk-session-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.talk-session-tools[hidden] {
    display: none !important;
}

.talk-top-mic {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sage-deep);
    box-shadow: 0 4px 12px rgba(42, 31, 78, 0.08);
    flex-shrink: 0;
}

.talk-top-mic[hidden] {
    display: none !important;
}

.talk-top-mic-pulse {
    position: absolute;
    inset: 4px;
    border-radius: 8px;
    border: 2px solid rgba(111, 154, 120, 0.35);
    opacity: 0;
    pointer-events: none;
}

.talk-top-mic.is-active .talk-top-mic-pulse {
    opacity: 1;
    animation: talkMicPulse 1.1s ease-in-out infinite;
}

.talk-top-mic.is-idle .talk-top-mic-pulse {
    opacity: 0.55;
    animation: talkMicPulse 2.4s ease-in-out infinite;
}

.talk-stop-top-btn {
    position: relative;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(145deg, #e86b7a, #c94b5a);
    box-shadow: 0 4px 12px rgba(201, 75, 90, 0.32);
    cursor: pointer;
    flex-shrink: 0;
}

.talk-stop-top-btn[hidden] {
    display: none !important;
}

.talk-stop-top-btn::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 2px;
    background: #fff;
}

.talk-stop-top-btn:active {
    transform: scale(0.96);
}

.talk-session-stop-hint {
    margin: 0 0 10px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.35;
}

.talk-level-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 10px 2px 4px;
    cursor: pointer;
}

.talk-level-chevron {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.talk-level-toggle[aria-expanded="true"] .talk-level-chevron {
    transform: rotate(180deg);
}

.talk-level-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
    flex: 1;
    min-width: 0;
}

.talk-speed-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 22px;
}

.talk-speed-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--muted);
    margin-right: 2px;
}

.talk-speed-opt {
    border: 1px solid rgba(111, 154, 120, 0.35);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    border-radius: 999px;
    padding: 4px 10px;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
}

.talk-speed-opt.is-active {
    background: linear-gradient(135deg, var(--sage-deep), var(--rose-deep));
    color: #fff;
    border-color: transparent;
}

.talk-orb[hidden],
.talk-mic[hidden] {
    display: none !important;
}

.talk-btn-continue {
    background: linear-gradient(135deg, var(--sage-deep), var(--sage));
    box-shadow: 0 8px 24px rgba(111, 154, 120, 0.28);
}

.talk-level-opt {
    border: 1px solid rgba(111, 154, 120, 0.35);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    border-radius: 999px;
    padding: 4px 10px;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
}

.talk-level-opt.is-active {
    background: linear-gradient(135deg, var(--sage-deep), var(--rose-deep));
    color: #fff;
    border-color: transparent;
}

.talk-screen {
    flex: 1;
    display: flex;
    align-items: stretch;
}

.talk-card {
    width: 100%;
    background: var(--card);
    border-radius: 24px;
    padding: 22px 18px;
    box-shadow: 0 12px 36px rgba(111, 154, 120, 0.14);
    backdrop-filter: blur(10px);
}

.talk-card-compact {
    align-self: center;
    padding: 18px 16px;
}

.talk-card-center {
    text-align: center;
    align-self: center;
}

.talk-card-emoji {
    font-size: 2.4rem;
    margin-bottom: 8px;
}

h1 {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 800;
}

.talk-muted, p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.5;
    font-size: 0.95rem;
}

.talk-label {
    display: block;
    margin: 0 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
}

.talk-input {
    width: 100%;
    border: 1px solid rgba(111, 154, 120, 0.28);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    font-weight: 600;
    color: var(--text);
    background: rgba(255, 255, 255, 0.95);
}

.talk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 14px;
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.talk-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--sage-deep), var(--rose-deep));
    box-shadow: 0 8px 24px rgba(111, 154, 120, 0.28);
}

.talk-btn-start {
    max-width: 280px;
}

.talk-btn-ghost {
    margin-top: 10px;
    color: var(--muted);
    background: transparent;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: none;
}

.talk-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.talk-screen-session {
    flex: 1;
    min-height: 0;
    padding: 0;
    align-items: stretch;
    position: relative;
}

.talk-session-wrap {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    min-height: 58vh;
    padding: 12px 0 24px;
    position: relative;
    overflow: hidden;
}

/*
 * Dialog: fill the whole session screen. Do NOT use height:100% alone —
 * parent often has only min-height, so % height collapses to the caption strip.
 */
.talk-session-wrap.is-dialog-active {
    position: absolute;
    inset: 0;
    flex: none;
    width: 100%;
    min-height: 0;
    height: auto;
    padding: 0;
    margin: 0;
    justify-content: flex-start;
    overflow: hidden;
}

.talk-persona-stage {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: #e8efe9;
}

.talk-persona-stage[hidden] {
    display: none !important;
}

/* Shared Simli crop: live video, freeze canvas, stage still — media only */
.talk-persona-stage-img,
.talk-simli-video,
.talk-simli-freeze {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: scale(var(--talk-simli-crop-scale)) translateY(var(--talk-simli-crop-shift-y));
    transform-origin: center center;
    display: block;
    background: #e8efe9;
}

.talk-persona-stage-img {
    z-index: 1;
    transition: filter 0.35s ease;
}

.talk-simli-video {
    z-index: 2;
}

.talk-simli-freeze {
    z-index: 3;
    pointer-events: none;
}

/* Paused last-frame fallback after Stop (when canvas freeze fails) */
.talk-persona-stage.is-simli-frozen .talk-simli-video:not(.talk-simli-freeze):not([hidden]) {
    z-index: 3;
}

.talk-simli-freeze[hidden] {
    display: none !important;
}

/* Live track must sit above freeze/still even if freeze.hidden races */
.talk-persona-stage.is-simli-live:not(.is-simli-frozen) .talk-simli-video:not(.talk-simli-freeze) {
    z-index: 4;
}

.talk-persona-stage.is-simli-live:not(.is-simli-frozen) .talk-simli-freeze {
    display: none !important;
    visibility: hidden;
}

.talk-avatar3d-holder {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #dfece2 0%, #f4f8f5 55%, #e8efe9 100%);
}

.talk-avatar3d-holder[hidden] {
    display: none !important;
}

.talk-avatar3d-holder .talk-avatar3d-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.talk-simli-video[hidden] {
    display: none !important;
}

.talk-persona-stage.is-simli-live .talk-persona-stage-img,
.talk-persona-stage.is-simli-live .talk-avatar3d-holder {
    display: none !important;
}

.talk-livekit-audio {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.talk-persona-stage.is-rpm-3d .talk-persona-stage-img {
    display: none;
}

.talk-persona-stage.is-assistant-speaking::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        to top,
        rgba(111, 154, 120, 0.28) 0%,
        rgba(111, 154, 120, 0.08) 38%,
        transparent 68%
    );
    animation: talkPersonaSpeakPulse 1.6s ease-in-out infinite;
}

.talk-persona-stage.is-assistant-speaking .talk-persona-stage-img {
    filter: saturate(1.04) brightness(1.02);
}

.talk-persona-stage.is-user-turn::after {
    display: none;
}

.talk-session-wrap.is-dialog-active .talk-session-ui {
    /* Overlay at bottom of full-screen stage — must not shrink the wrap */
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    margin: 0;
    z-index: 4;
    background: linear-gradient(
        to top,
        rgba(240, 247, 241, 0.94) 0%,
        rgba(240, 247, 241, 0.55) 45%,
        transparent 100%
    );
    justify-content: flex-end;
    min-height: 0;
    max-height: min(18vh, 120px);
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

@keyframes talkPersonaSpeakPulse {
    0%,
    100% {
        opacity: 0.72;
    }
    50% {
        opacity: 1;
    }
}


#talkSessionBtn {
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.talk-session-ui {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: auto;
    padding: 12px 12px calc(16px + env(safe-area-inset-bottom, 0px));
}

.talk-session-wrap.is-dialog-active .talk-persona-bar {
    display: none !important;
}

.talk-orb {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 8px auto 20px;
}

.talk-orb-idle {
    margin-bottom: 28px;
}

.talk-orb-core {
    position: absolute;
    inset: 24px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--sage), var(--rose));
    opacity: 0.9;
    z-index: 2;
}

.talk-orb-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(143, 184, 150, 0.5);
    animation: none;
}

.talk-orb-idle .talk-orb-ring {
    animation: talkPulse 2.4s ease-in-out infinite;
}

.talk-orb.is-speaking .talk-orb-core {
    background: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff, #5f27cd);
    background-size: 320% 320%;
    animation: talkRainbow 2.2s ease infinite;
    opacity: 1;
}

.talk-orb.is-speaking .talk-orb-ring {
    border-color: rgba(255, 255, 255, 0.55);
    animation: talkPulse 0.95s ease-in-out infinite;
}

@keyframes talkRainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.talk-orb.is-user .talk-orb-ring {
    border-color: rgba(111, 154, 120, 0.85);
}

.talk-mic {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 8px auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sage-deep);
}

.talk-mic-pulse {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 2px solid rgba(111, 154, 120, 0.35);
    opacity: 0.45;
    animation: none;
}

.talk-mic.is-active .talk-mic-pulse {
    animation: talkMicPulse 1.1s ease-in-out infinite;
    border-color: rgba(111, 154, 120, 0.85);
    opacity: 1;
}

.talk-mic.is-idle {
    opacity: 0.72;
}

.talk-mic-icon {
    position: relative;
    z-index: 2;
}

@keyframes talkMicPulse {
    0%, 100% { transform: scale(0.92); opacity: 0.55; }
    50% { transform: scale(1.08); opacity: 1; }
}

@keyframes talkPulse {
    0%, 100% { transform: scale(0.96); opacity: 0.55; }
    50% { transform: scale(1.04); opacity: 1; }
}

.talk-session-hint {
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    margin: 0 12px 8px;
}

.talk-mode-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0 auto 10px;
    max-width: 360px;
    padding: 0 8px;
}

.talk-mode-bar[hidden] {
    display: none !important;
}

.talk-mode-chip {
    border: 1px solid rgba(111, 154, 120, 0.35);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text, #2d3b30);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
}

.talk-mode-chip.is-active {
    border-color: rgba(111, 154, 120, 0.95);
    background: rgba(111, 154, 120, 0.16);
    box-shadow: 0 2px 10px rgba(111, 154, 120, 0.18);
}

.talk-mode-chip.is-soon {
    opacity: 0.72;
}

.talk-coach-progress {
    margin: 0 12px 12px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted, #6b7c6f);
}

.talk-coach-progress[hidden] {
    display: none !important;
}

.talk-session-wrap.is-dialog-active .talk-mode-bar,
.talk-session-wrap.is-dialog-active .talk-coach-progress {
    display: none !important;
}

/* Thin top strip above the avatar (not over the face / not in bottom UI). */
.talk-coach-hud {
    display: none;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: center;
    box-sizing: border-box;
    pointer-events: none;
}

.talk-coach-hud[hidden] {
    display: none !important;
}

.talk-session-wrap.is-dialog-active .talk-coach-hud:not([hidden]) {
    display: grid;
    position: absolute;
    top: max(6px, env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: min(200px, 52vw);
    margin: 0;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(111, 154, 120, 0.18);
    box-shadow: none;
    opacity: 0.78;
}

.talk-coach-overall {
    font-size: 0.62rem;
    font-weight: 700;
    color: rgba(31, 61, 42, 0.78);
    white-space: nowrap;
    line-height: 1;
}

.talk-coach-bar {
    min-width: 0;
    height: 4px;
    border-radius: 999px;
    background: rgba(45, 59, 48, 0.12);
    overflow: hidden;
}

.talk-coach-bar-fill {
    height: 100%;
    width: 12%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(111, 154, 120, 0.85), rgba(63, 107, 74, 0.9));
    transition: width 0.35s ease;
}

.talk-pattern-pin {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: calc(100% - 20px);
    max-width: 360px;
    margin: 0 auto 6px;
    padding: 5px 12px;
    border-radius: 10px;
    background: #1f3d2a;
    border: 1.5px solid #6f9a78;
    box-shadow: 0 2px 10px rgba(31, 61, 42, 0.22);
    text-align: center;
}

.talk-pattern-pin[hidden] {
    display: none !important;
}

.talk-pattern-pin-label {
    display: none !important;
}

.talk-pattern-pin-text {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
}

.talk-pattern-pin-ru {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 500;
    font-style: italic;
    line-height: 1.2;
    color: rgba(232, 242, 234, 0.88);
}

.talk-pattern-pin-ru:empty {
    display: none;
}

.talk-session-wrap.is-dialog-active .talk-pattern-pin {
    order: 0;
    margin: 0 10px 4px;
    flex: 0 0 auto;
    padding: 4px 10px;
}

.talk-persona-bar {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 0 auto 16px;
    max-width: 340px;
    padding: 0 8px;
}

.talk-persona-bar[hidden] {
    display: none !important;
}

.talk-session-wrap.is-persona-pick #talkSessionBtn,
#talkSessionBtn[hidden] {
    display: none !important;
}

.talk-session-wrap.is-persona-pick .talk-speed-bar {
    display: none !important;
}

.talk-persona-opt {
    flex: 1;
    max-width: 150px;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.talk-persona-opt.is-active {
    border-color: rgba(111, 154, 120, 0.95);
    box-shadow: 0 4px 14px rgba(111, 154, 120, 0.25);
}

.talk-persona-photo {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center 22%;
    border-radius: 12px;
    display: block;
    background: #e8efe9;
}

.talk-persona-name {
    margin: 8px 0 2px;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text, #2d3b30);
}

.talk-persona-desc {
    margin: 0;
    font-size: 0.72rem;
    color: var(--muted, #6b7c6f);
    line-height: 1.3;
}

.talk-transcript {
    min-height: 36px;
    max-width: 100%;
    margin: 0 12px 20px;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.45;
    text-align: center;
}

.talk-live-transcript {
    width: 100%;
    max-width: 360px;
    max-height: 172px;
    min-height: 140px;
    overflow-y: auto;
    margin: 0 auto 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    font-size: 1.02rem;
    line-height: 1.45;
    text-align: left;
    -webkit-overflow-scrolling: touch;
}

.talk-session-wrap.is-dialog-active .talk-live-transcript {
    order: 1;
    /* ~6–7 lines visible — +1 line so a full coach phrase usually fits */
    max-height: min(28vh, 180px);
    min-height: 88px;
    margin: 0 10px 2px;
    padding: 8px 10px;
    flex: 0 1 auto;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.92rem;
    line-height: 1.35;
    overflow-y: auto;
}

.talk-persona-desc {
    display: none !important;
}

.talk-session-wrap.is-dialog-active #talkSessionBtn {
    order: 2;
}

.talk-stop-icon-btn {
    position: relative;
    width: 46px;
    height: 46px;
    margin: 8px auto 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, #e86b7a, #c94b5a);
    box-shadow: 0 6px 18px rgba(201, 75, 90, 0.35);
    cursor: pointer;
    flex-shrink: 0;
}

.talk-stop-icon-btn::before {
    content: '';
    position: absolute;
    inset: 13px;
    border-radius: 3px;
    background: #fff;
}

.talk-stop-icon-btn:active {
    transform: scale(0.96);
}

.talk-session-wrap.is-persona-pick .talk-stop-icon-btn,
.talk-session-wrap.is-persona-pick .talk-session-stop-hint {
    display: none !important;
}

.talk-live-line {
    margin: 0 0 10px;
    white-space: pre-wrap;
}

.talk-live-line:last-child {
    margin-bottom: 0;
}

.talk-live-para {
    display: block;
}

.talk-live-para + .talk-live-para {
    margin-top: 8px;
}

.talk-live-user .talk-live-label {
    color: #5a7a62;
    font-weight: 800;
}

.talk-live-lapi .talk-live-label {
    color: #6b8f74;
    font-weight: 800;
}

.talk-live-draft {
    opacity: 0.65;
    font-style: italic;
}

.talk-pattern-hl {
    font-weight: 800;
    color: #1f6b4a;
    background: rgba(47, 140, 98, 0.16);
    border-radius: 4px;
    padding: 0 3px;
}

.talk-stats-transcript {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(111, 154, 120, 0.2);
    max-height: 280px;
    overflow-y: auto;
    font-size: 0.88rem;
    line-height: 1.5;
    text-align: left;
    -webkit-overflow-scrolling: touch;
}

.talk-transcript-legend {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: var(--muted);
    text-align: left;
}

.talk-d-line {
    margin: 0 0 10px;
}

.talk-d-line:last-child {
    margin-bottom: 0;
}

.talk-d-label {
    font-weight: 800;
    margin-right: 4px;
}

.talk-t-err {
    color: #c0392b;
    font-weight: 700;
    text-decoration: line-through;
    text-decoration-color: rgba(192, 57, 43, 0.45);
}

.talk-t-fix {
    color: #2563eb;
    font-weight: 700;
}

.talk-controls {
    display: none;
}

.talk-btn-stop {
    margin-top: 12px;
    max-width: 300px;
    width: 100%;
    color: #fff;
    background: linear-gradient(145deg, var(--rose-deep), #b86a76);
    box-shadow: 0 8px 24px rgba(185, 106, 118, 0.28);
}

.talk-start-wrap {
    gap: 4px;
}

.talk-report-card {
    width: 100%;
    position: relative;
    background: var(--card);
    border-radius: 24px;
    padding: 22px 18px 18px;
    box-shadow: 0 12px 36px rgba(111, 154, 120, 0.14);
    backdrop-filter: blur(10px);
}

.talk-report-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: var(--muted);
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
}

.talk-report-title {
    margin: 0 36px 12px 0;
    font-size: 1.2rem;
}

.talk-card-archive {
    align-self: flex-start;
    margin-top: 8px;
}

.talk-archive-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.talk-archive-header h1 {
    margin: 0;
    font-size: 1.15rem;
}

.talk-archive-back {
    border: 0;
    background: transparent;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px 4px 0;
}

.talk-archive-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.talk-archive-item {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(111, 154, 120, 0.22);
    background: rgba(255, 255, 255, 0.72);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    cursor: pointer;
    color: var(--text);
}

.talk-archive-item-date {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.talk-archive-item-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}

.talk-stats-text {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.55;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 14px;
    margin: 0 0 8px;
}

.talk-audio-debug {
    width: 100%;
    max-width: 360px;
    margin: 0 auto 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
    word-break: break-word;
}

.talk-toast {
    position: fixed;
    left: 50%;
    bottom: max(20px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    max-width: min(92vw, 420px);
    background: rgba(58, 69, 64, 0.94);
    color: #fff;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 700;
    z-index: 30;
}
