/* 실시간 영어 회화 — Azure Blue 팔레트 (docs/색상컨셉03.html) */

.liveconv-root {
    --lc-bg: #F5EEDF;
    --lc-surface: #FCF7EC;
    --lc-surface-alt: #ECE2CE;
    --lc-primary: #3A6EA4;
    --lc-primary-deep: #2A5179;
    --lc-secondary: #8FA06B;
    --lc-accent: #F2C03E;
    --lc-ink: #243240;
    --lc-text-muted: #6E7178;
    --lc-border: #E4D9C3;

    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 16px 16px 56px;
    box-sizing: border-box;
    overflow-x: hidden;
    color: var(--lc-ink);
    font-family: "Noto Sans KR", -apple-system, sans-serif;
}

/* 모든 박스를 border-box로, 자식이 가로폭을 넘지 않게 고정 */
.liveconv-root,
.liveconv-root *,
.liveconv-root *::before,
.liveconv-root *::after {
    box-sizing: border-box;
}

.liveconv-root button,
.liveconv-root input,
.liveconv-root select,
.liveconv-root textarea {
    max-width: 100%;
}

/* 전역 button{height:34px} 무효화 (이게 역할 버튼 글자를 잘랐던 원인) */
.liveconv-root button {
    height: auto;
}

/* ---------- 스마트폰 전용 안내 게이트 ----------
   스마트폰이 아니라고 판단되면(넓은 화면 또는 마우스 포인터 환경)
   본문을 숨기고 안내 화면만 표시. "그래도 PC에서 계속하기"를 누르면
   루트에 .lc-force-pc 클래스가 붙어 원래대로 동작한다. */

.lc-mobile-gate {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--lc-surface);
    border: 1px solid var(--lc-border);
    border-radius: 16px;
    padding: 56px 28px;
    margin: 40px auto;
    max-width: 440px;
}

.lc-gate-icon {
    font-size: 56px;
    color: #FE5C2B;
    margin-bottom: 16px;
}

.lc-gate-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--lc-ink);
    margin: 0 0 12px;
}

.lc-gate-desc {
    font-size: 0.95rem;
    color: var(--lc-text-muted);
    line-height: 1.75;
    margin: 0 0 28px;
}

.lc-gate-continue {
    background: transparent;
    border: none;
    color: var(--lc-text-muted);
    font-size: 0.83rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 6px 10px;
}

.lc-gate-continue:hover {
    color: var(--lc-ink);
}

@media (min-width: 768px), (hover: hover) and (pointer: fine) {
    .liveconv-root:not(.lc-force-pc) > :not(.lc-mobile-gate):not(.lc-gate-notice) {
        display: none !important;
    }

    .liveconv-root:not(.lc-force-pc) > .lc-mobile-gate {
        display: flex;
    }
}

/* ---------- 공통 ---------- */
.lc-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--lc-primary-deep);
    margin: 0;
}

.lc-card {
    background: var(--lc-surface);
    border: 1px solid var(--lc-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .05);
}

.lc-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--lc-ink);
    margin: 0 0 4px;
}

.lc-card-title .material-symbols-outlined {
    font-size: 19px;
    color: var(--lc-primary);
}

.lc-card-desc {
    font-size: 12.5px;
    color: var(--lc-text-muted);
    margin: 0 0 10px;
}

.lc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 11px 14px;
    border: none;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}

.lc-btn .material-symbols-outlined { font-size: 19px; }

.lc-btn-primary {
    background: var(--lc-primary);
    color: #fff;
}

.lc-btn-primary:active { background: var(--lc-primary-deep); }

.lc-btn-primary:disabled {
    background: var(--lc-surface-alt);
    color: var(--lc-text-muted);
    cursor: default;
}

.lc-btn-ghost {
    background: var(--lc-surface-alt);
    color: var(--lc-ink);
    margin-top: 8px;
}

.lc-btn-end {
    background: #b3563e;
    color: #fff;
    margin-top: 32px;
}

.lc-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--lc-primary-deep);
    cursor: pointer;
}

.lc-icon-btn:active { background: var(--lc-surface-alt); }

.lc-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--lc-border);
    border-radius: 10px;
    background: #fff;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--lc-ink);
    resize: none;
    margin-bottom: 8px;
}

.lc-textarea:focus {
    outline: none;
    border-color: var(--lc-primary);
}

/* ---------- STEP 1 ---------- */
.lc-step1-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.lc-topic-chips {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
    border: 1px solid var(--lc-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.lc-topic-chips:empty {
    margin-top: 0;
    border: none;
}

.lc-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: #fff;
    border: none;
    border-bottom: 1px solid var(--lc-border);
    color: var(--lc-primary-deep);
    padding: 18px 16px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    transition: background .15s;
}

.lc-chip:last-child { border-bottom: none; }

.lc-chip::before {
    content: '';
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--lc-primary);
}

.lc-chip:active {
    background: #E8EFF6;
}

.lc-step1-status {
    font-size: 13px;
    color: var(--lc-text-muted);
    text-align: center;
    min-height: 18px;
}

.lc-step1-status.error { color: #b3563e; }

/* ---------- STEP 2 ---------- */
.lc-situation-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--lc-primary-deep);
    color: #fff;
    border-radius: 12px;
    padding: 10px 8px 10px 14px;
    margin-bottom: 10px;
}

.lc-situation-text {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
}

.lc-situation-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: none;
}

.lc-situation-right .lc-icon-btn { color: #fff; }

.lc-timer {
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    opacity: .85;
}

.lc-timer.warning { color: var(--lc-accent); font-weight: 700; }

/* 역할 바 */
.lc-role-bar {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
}

.lc-role {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--lc-surface);
    border: 1px solid var(--lc-border);
    border-radius: 10px;
    padding: 8px 12px;
}

.lc-role-me { border-left: 4px solid var(--lc-secondary); }
.lc-role-ai { border-left: 4px solid var(--lc-primary); }

.lc-role-label {
    font-size: 11px;
    color: var(--lc-text-muted);
    font-weight: 600;
}

.lc-role-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--lc-ink);
    line-height: 1.3;
}

.lc-role-vs {
    align-self: center;
    font-size: 11px;
    color: var(--lc-text-muted);
    font-weight: 700;
}

/* 시작 전 안내 */
.lc-prestart {
    text-align: center;
    padding: 30px 16px 10px;
}

.lc-prestart-hint {
    font-size: 13px;
    color: var(--lc-text-muted);
    line-height: 1.5;
    margin: 0 0 18px;
}

.lc-prestart-hint.error { color: #b3563e; font-weight: 600; }

.lc-role-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lc-role-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-height: 76px;
    padding: 18px 16px;
    border: 1.5px solid var(--lc-primary);
    border-radius: 14px;
    background: #fff;
    color: var(--lc-primary-deep);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.lc-role-choice:active { background: var(--lc-primary); color: #fff; }
.lc-role-choice:disabled { opacity: .5; cursor: default; }

.lc-role-choice-name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.lc-role-choice-sub { font-size: 11.5px; color: var(--lc-text-muted); }
.lc-role-choice:active .lc-role-choice-sub { color: rgba(255, 255, 255, .85); }

.lc-chat {
    height: min(48vh, 420px);
    overflow-y: auto;
    background: var(--lc-surface);
    border: 1px solid var(--lc-border);
    border-radius: 14px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}

.lc-msg {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    max-width: 86%;
}

.lc-msg.gemini { align-self: flex-start; }
.lc-msg.me { align-self: flex-end; flex-direction: row; }

.lc-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.lc-msg.gemini .lc-bubble {
    background: var(--lc-primary);
    color: #fff;
    border-bottom-left-radius: 5px;
}

.lc-msg.me .lc-bubble {
    background: var(--lc-surface-alt);
    color: var(--lc-ink);
    border-bottom-right-radius: 5px;
}

.lc-polish-trigger {
    flex: none;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--lc-accent);
    color: #3a2a10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lc-polish-trigger .material-symbols-outlined { font-size: 17px; }

/* 로딩 점 애니메이션 (말풍선 크기 고정: 점 3개 항상 표시, 투명도만 변화) */
.lc-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 1em;
    vertical-align: middle;
}

.lc-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: .3;
    animation: lc-dot-bounce 1.3s infinite ease-in-out;
}

.lc-dots span:nth-child(2) { animation-delay: .2s; }
.lc-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes lc-dot-bounce {
    0%, 75%, 100% { opacity: .3; transform: translateY(0); }
    35% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- 하단 컨트롤 ---------- */
.lc-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.lc-ctrl-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--lc-primary-deep);
}

.lc-ctrl-btn .material-symbols-outlined {
    width: 82px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 28px;
    background: var(--lc-surface-alt);
    transition: background .15s, color .15s, transform .1s;
}

.lc-ctrl-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--lc-text-muted);
}

/* Speak 버튼: 고정 크기 원형. 평상시 mic 아이콘, 녹음 중 동적 점 4개 */
.lc-ctrl-speak .lc-speak-circle {
    position: relative;
    width: 100px;
    height: 64px;
    min-height: 64px;
    box-sizing: border-box;
    border-radius: 18px;
    background: var(--lc-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .1s;
}

/* 아이콘과 점을 원 중앙에 겹쳐 배치 → 토글해도 원 높이에 영향 없음 */
.lc-ctrl-speak .lc-speak-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: auto;
    background: transparent;
    border-radius: 0;
    font-size: 34px;
    color: #fff;
}

.lc-speak-dots {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    gap: 5px;
}

.lc-speak-dots i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    opacity: .4;
    animation: lc-speak-dot 1s infinite ease-in-out;
}

.lc-speak-dots i:nth-child(2) { animation-delay: .12s; }
.lc-speak-dots i:nth-child(3) { animation-delay: .24s; }
.lc-speak-dots i:nth-child(4) { animation-delay: .36s; }

.lc-ctrl-speak.recording .lc-speak-icon { display: none; }
.lc-ctrl-speak.recording .lc-speak-dots { display: flex; }

.lc-ctrl-speak.recording .lc-speak-circle {
    background: #b3563e;
    animation: lc-pulse 1.2s ease-in-out infinite;
}

@keyframes lc-speak-dot {
    0%, 70%, 100% { opacity: .4; transform: translateY(0); }
    35% { opacity: 1; transform: translateY(-4px); }
}

@keyframes lc-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.lc-ctrl-btn:disabled {
    cursor: default;
    opacity: .4;
}

.lc-ctrl-btn:disabled .material-symbols-outlined { background: var(--lc-surface-alt); color: var(--lc-text-muted); }

/* Speak 아이콘은 원형 배경(.lc-speak-circle)이 담당하므로 비활성 시에도 회색 원이 생기지 않게 */
.lc-ctrl-speak:disabled .lc-speak-icon { background: transparent; color: #fff; }

/* ---------- STEP 3 / 리포트 ---------- */
.lc-finish-card { text-align: center; padding: 26px 18px; }
.lc-finish-card .lc-title { margin-bottom: 6px; }
.lc-finish-card .lc-btn { margin-top: 10px; }

.lc-report-overall {
    background: var(--lc-surface);
    border-left: 4px solid var(--lc-primary);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.55;
    margin: 12px 0;
}

.lc-report-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.lc-report-item {
    background: var(--lc-surface);
    border: 1px solid var(--lc-border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13.5px;
}

.lc-report-item .ri-original {
    color: #b3563e;
    text-decoration: line-through;
    margin-bottom: 4px;
}

.lc-report-item .ri-suggested {
    color: var(--lc-primary-deep);
    font-weight: 700;
    margin-bottom: 4px;
}

.lc-report-item .ri-issue {
    color: var(--lc-text-muted);
    font-size: 12.5px;
    line-height: 1.5;
}

/* ---------- 모달 ---------- */
.lc-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.lc-modal[hidden] { display: none; }

.lc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(36, 50, 64, .45);
}

.lc-modal-panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 78vh;
    overflow-y: auto;
    background: var(--lc-surface);
    border-radius: 18px 18px 0 0;
    padding: 16px 18px 26px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.lc-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.lc-modal-head h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 16px;
    color: var(--lc-primary-deep);
}

.lc-modal-head .material-symbols-outlined { font-size: 20px; }

/* 족집게 모달 */
.lc-polish-original {
    background: var(--lc-surface-alt);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13.5px;
    color: var(--lc-text-muted);
    margin-bottom: 12px;
}

.lc-polish-body { font-size: 14px; line-height: 1.5; }

.lc-polish-suggestion {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fff;
    border: 1.5px solid var(--lc-primary);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.lc-polish-suggestion .text {
    flex: 1;
    font-weight: 600;
    color: var(--lc-primary-deep);
}

.lc-polish-tts-btn {
    flex: none;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--lc-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lc-polish-tts-btn:disabled { opacity: .5; }
.lc-polish-tts-btn .material-symbols-outlined { font-size: 20px; }

.lc-polish-explanation {
    font-size: 12.5px;
    color: var(--lc-text-muted);
    line-height: 1.55;
}

.lc-polish-error { color: #b3563e; font-size: 13px; }

/* 옵션 모달 */
.lc-opt-group { margin-bottom: 16px; }

.lc-opt-group h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--lc-primary-deep);
    border-bottom: 1px solid var(--lc-border);
    padding-bottom: 5px;
}

.lc-opt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: var(--lc-ink);
    padding: 5px 0;
}

.lc-opt-row select {
    max-width: 60%;
    border: 1px solid var(--lc-border);
    border-radius: 8px;
    background: #fff;
    color: var(--lc-ink);
    font-size: 12.5px;
    padding: 6px 8px;
}

/* 게이트 */
.lc-gate-notice {
    text-align: center;
    padding: 40px 20px;
    color: var(--lc-text-muted);
}

.lc-gate-notice .material-symbols-outlined { font-size: 38px; }
