/* 
 * Phishing Chat Voice - Bright Theme (Vanilla CSS based on Tailwind)
 */

:root {
    --background: #efe4cd;
    --foreground: #1f2937;
    --border: #1f2937;
    --primary: #1f4f7a;
    --primary-hover: #173c5d;
    --primary-light: #d9e8df;
    --success: #1f7a3f;
    --success-hover: #176130;
    --danger: #b91c1c;
    --danger-hover: #7f1d1d;
    --card-bg: #fff7e6;
    --text-muted: #5f5a50;
    --surface-100: #eadcbc;
    --retro-yellow: #e2c36f;
    --retro-green: #9fbd8f;
    --app-max-width: 800px;
    --app-gutter: 24px;
    --topbar-offset: calc(18px + env(safe-area-inset-top, 0px));
    --topbar-height: 48px;
    --bottom-safe-area: env(safe-area-inset-bottom, 0px);
    --keyboard-inset: 0px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

body {
    background: var(--background);
    color: var(--foreground);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.service-topbar {
    position: fixed;
    top: var(--topbar-offset);
    left: 50%;
    width: min(calc(100% - 32px), var(--app-max-width));
    height: var(--topbar-height);
    transform: translateX(-50%);
    z-index: 2000;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border: 3px solid #1f2937;
    border-radius: 12px;
    background: rgba(255, 247, 230, 0.95);
    box-shadow: 5px 5px 0 rgba(31, 41, 55, 0.85);
}

.service-nav-button {
    height: 34px;
    padding: 0 12px;
    border: 2px solid #1f2937;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
}

.service-nav-button.danger {
    background: #b91c1c;
    color: #fff7ed;
}

.service-page-title {
    min-width: 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 화면 공통 */
.screen {
    display: none;
    width: 100%;
    max-width: var(--app-max-width);
    height: 100dvh;
    padding: calc(var(--topbar-offset) + var(--topbar-height) + 20px) 24px calc(24px + var(--bottom-safe-area));
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: fadeIn 0.4s ease-out;
    background: white;
    box-shadow: 8px 8px 0 rgba(31, 41, 55, 0.9);
    border-left: 4px solid #1f2937;
    border-right: 4px solid #1f2937;
    scrollbar-width: thin;
    scrollbar-color: rgba(31, 41, 55, 0.38) transparent;
}

.screen::-webkit-scrollbar {
    width: 8px;
}

.screen::-webkit-scrollbar-track {
    background: transparent;
}

.screen::-webkit-scrollbar-thumb {
    background: rgba(31, 41, 55, 0.38);
    border-radius: 999px;
}

@media (hover: none) and (pointer: coarse) {
    .screen {
        scrollbar-width: none;
    }

    .screen::-webkit-scrollbar {
        display: none;
    }
}

.btn-primary.record-button {
    background: var(--danger);
    min-height: 68px;
    font-size: 1.18rem;
}

.btn-primary.record-button.is-recording {
    background: #facc15;
    color: #1f2937;
    border-width: 4px;
    box-shadow: 7px 7px 0 #1f2937;
    font-size: 1.35rem;
    font-weight: 900;
    animation: recordButtonPulse 0.9s ease-in-out infinite alternate;
}

.btn-primary.record-button.is-recording:hover {
    background: #eab308;
}

.btn-primary.record-button:disabled {
    opacity: 0.72;
    cursor: wait;
    transform: none;
}

@keyframes recordButtonPulse {
    from { transform: scale(1); }
    to { transform: scale(1.025); }
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 유틸리티 클래스 */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-4 { gap: 1rem; }
.font-bold { font-weight: 700; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 버튼 공통 */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 3px solid #1f2937;
    box-shadow: 5px 5px 0 #1f2937;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    transform: translate(3px, 3px);
    box-shadow: 2px 2px 0 #1f2937;
}

.btn-outline {
    background: white;
    color: var(--foreground);
    border: 3px solid var(--border);
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-shadow: 4px 4px 0 #1f2937;
}

.btn-outline:hover {
    background: var(--surface-100);
}

.btn-exit {
    align-self: flex-end;
    width: auto;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 4px;
    margin-bottom: 8px;
}

.btn-exit:hover {
    color: var(--danger);
}

/* 인트로 화면 */
#screen-intro {
    position: relative;
    overflow-x: hidden;
    contain: paint;
    background:
        radial-gradient(circle at 18% 18%, rgba(226, 195, 111, 0.5), transparent 26%),
        radial-gradient(circle at 88% 18%, rgba(159, 189, 143, 0.38), transparent 24%),
        linear-gradient(rgba(31, 41, 55, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 41, 55, 0.055) 1px, transparent 1px),
        #f3ead7;
    background-size: auto, auto, 22px 22px, 22px 22px;
    color: #1f2937;
    justify-content: center;
    align-items: stretch;
    border-left: 8px solid #1f2937;
    border-right: 8px solid #1f2937;
    padding: 86px 28px 28px;
}

#screen-intro::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(rgba(255,255,255,0.12) 50%, rgba(0,0,0,0.03) 50%);
    background-size: 100% 6px;
    mix-blend-mode: multiply;
    opacity: 0.6;
}

#screen-intro::after {
    content: "";
    position: absolute;
    right: -64px;
    bottom: -72px;
    width: 220px;
    height: 220px;
    border: 4px solid rgba(31, 41, 55, 0.18);
    border-radius: 50%;
    pointer-events: none;
}

.intro-stage {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(250px, 0.95fr) minmax(280px, 1fr);
    align-items: center;
    gap: 30px;
    width: 100%;
    min-width: 0;
}

.intro-visual {
    position: relative;
    min-width: 0;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-status-strip {
    position: absolute;
    top: -22px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-family: "Courier New", monospace;
    font-size: 0.72rem;
    font-weight: 800;
    color: #1f2937;
}

.intro-status-strip span {
    background: #fff7e6;
    border: 2px solid #1f2937;
    border-radius: 999px;
    padding: 6px 9px;
    box-shadow: 3px 3px 0 rgba(31, 41, 55, 0.28);
}

.retro-phone-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

.retro-phone {
    position: relative;
    width: min(230px, 68vw);
    padding: 22px 18px 20px;
    border: 4px solid #1f2937;
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.28), transparent 34%),
        #d9c7a3;
    box-shadow: 10px 10px 0 #1f2937;
    transform: rotate(-3deg);
}

.retro-phone-antenna {
    position: absolute;
    top: -44px;
    right: 34px;
    width: 9px;
    height: 48px;
    border: 3px solid #1f2937;
    border-bottom: 0;
    background: #f8fafc;
    transform: rotate(12deg);
}

.retro-phone-speaker {
    width: 76px;
    height: 9px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: #1f2937;
}

.retro-phone-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 15px 10px;
    border: 3px solid #1f2937;
    border-radius: 12px;
    background: #9fbd8f;
    color: #123018;
    font-family: "Courier New", monospace;
    text-align: center;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25);
}

.retro-phone-screen span,
.retro-phone-screen small {
    font-size: 0.76rem;
    letter-spacing: 0.08em;
}

.retro-phone-screen strong {
    font-size: 1.14rem;
    letter-spacing: 0.03em;
}

.retro-phone-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 40px;
    margin-top: 12px;
    border: 2px solid #1f2937;
    border-radius: 999px;
    background: #fff7e6;
}

.retro-phone-wave span {
    width: 5px;
    border-radius: 999px;
    background: #b91c1c;
}

.retro-phone-wave span:nth-child(1) { height: 10px; }
.retro-phone-wave span:nth-child(2) { height: 20px; }
.retro-phone-wave span:nth-child(3) { height: 28px; }
.retro-phone-wave span:nth-child(4) { height: 18px; }
.retro-phone-wave span:nth-child(5) { height: 12px; }

.retro-phone-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin-top: 14px;
}

.retro-phone-keypad span {
    aspect-ratio: 1;
    border: 2px solid #1f2937;
    border-radius: 50%;
    background: #f8fafc;
}

.intro-call-card {
    position: absolute;
    right: 2px;
    bottom: 26px;
    min-width: 154px;
    padding: 14px 16px;
    border: 3px solid #1f2937;
    border-radius: 12px;
    background: #fff7e6;
    box-shadow: 7px 7px 0 #1f2937;
    transform: rotate(2deg);
}

.intro-call-card::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 20px;
    width: 22px;
    height: 22px;
    border-left: 3px solid #1f2937;
    border-bottom: 3px solid #1f2937;
    background: #fff7e6;
    transform: rotate(45deg);
}

.intro-call-card strong,
.intro-call-card small,
.intro-call-label {
    position: relative;
    z-index: 1;
    display: block;
}

.intro-call-label {
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.intro-call-card strong {
    font-size: 1.35rem;
    line-height: 1.2;
}

.intro-call-card small {
    color: #5f5a50;
    font-weight: 800;
    margin-top: 4px;
}

.intro-badge {
    display: inline-block;
    padding: 8px 12px;
    background: #1f2937;
    color: #f3ead7;
    border: 2px solid #1f2937;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.intro-content {
    position: relative;
    z-index: 1;
    text-align: left;
    min-width: 0;
}

.intro-title {
    font-size: clamp(2.6rem, 7vw, 4.35rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 16px;
    color: #1f2937;
    text-shadow: 4px 4px 0 #e2c36f;
    word-break: keep-all;
    overflow-wrap: normal;
}

.intro-title-line {
    display: block;
    white-space: nowrap;
}

.intro-subtitle {
    font-size: 1.1rem;
    color: #4b5563;
    margin-bottom: 22px;
    line-height: 1.55;
    font-weight: 700;
    max-width: 360px;
}

.intro-note {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.intro-note span {
    padding: 8px 11px;
    border: 2px solid #1f2937;
    border-radius: 999px;
    background: #eadcbc;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 800;
}

#btn-start-experience {
    background: #b91c1c;
    color: #fff7ed;
    border: 3px solid #1f2937;
    box-shadow: 6px 6px 0 #1f2937;
}

.intro-start-button {
    width: min(100%, 360px);
    padding: 22px 24px;
    border-radius: 12px;
    font-size: 1.35rem;
}

#btn-start-experience:active {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 #1f2937;
}

@media (max-width: 720px) {
    #screen-intro {
        justify-content: flex-start;
        padding: 76px 22px 22px;
    }

    .intro-stage {
        grid-template-columns: 1fr;
        gap: 18px;
        min-height: 100%;
    }

    .intro-visual {
        min-height: 345px;
        align-items: flex-end;
        padding-top: 34px;
    }

    .intro-status-strip {
        top: 2px;
    }

    .retro-phone {
        width: min(205px, 64vw);
    }

    .intro-call-card {
        right: max(0px, calc(50% - 180px));
        bottom: 14px;
        min-width: 136px;
        padding: 12px 14px;
    }

    .intro-content {
        text-align: center;
    }

    .intro-title {
        font-size: clamp(2.2rem, 11vw, 3.45rem);
    }

    .intro-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .intro-note {
        justify-content: center;
    }
}

@media (max-height: 700px) {
    .intro-visual {
        min-height: 300px;
    }

    .retro-phone {
        width: min(190px, 62vw);
        padding: 18px 16px;
    }

    .intro-title {
        margin-bottom: 12px;
    }

    .intro-subtitle {
        margin-bottom: 16px;
    }

    .intro-note {
        margin-bottom: 18px;
    }
}

/* 카드 스타일 */
.glass-card {
    background: var(--card-bg);
    border: 3px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 6px 6px 0 #1f2937;
}

/* 녹음 스크립트 */
.script-box {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--foreground);
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f0d8;
    border: 3px solid var(--primary);
    border-left: 8px solid var(--primary);
    padding: 16px;
    border-radius: 4px;
    font-family: "Courier New", monospace;
    font-weight: 700;
}

.waveform-container {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 24px 0;
}

.wave-bar {
    width: 3px;
    height: 10px;
    background: var(--retro-green);
    border: 1px solid #1f2937;
    border-radius: 2px;
    transition: height 0.1s ease;
}

.voice-wave-bar {
    width: 8px;
    height: 6px;
    min-height: 5px;
    border: 2px solid #1f2937;
    border-radius: 999px;
    background: linear-gradient(180deg, #e2c36f 0%, #9fbd8f 58%, #1f7a3f 100%);
    box-shadow: 2px 2px 0 #1f2937;
    opacity: 0.35;
    transition: height 80ms linear, opacity 80ms linear, transform 80ms linear;
}

/* 클로닝 상태 바 */
.progress-container {
    width: 100%;
    height: 8px;
    background: #f8f0d8;
    border: 2px solid #1f2937;
    border-radius: 0;
    overflow: hidden;
    margin: 16px 0;
}

#cloning-progress-bar {
    height: 100%;
    background: var(--retro-green);
    border-radius: 0;
    transition: width 0.3s ease;
}

/* 전화 수신/채팅 화면용 */
.chat-screen {
    padding: 72px 0 0;
    background:
        linear-gradient(rgba(31, 41, 55, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 41, 55, 0.04) 1px, transparent 1px),
        var(--surface-100);
    background-size: 22px 22px;
    overflow: hidden;
}

.chat-header {
    flex-shrink: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #1f2937;
    color: white;
    border-bottom: 4px solid #0f172a;
    box-shadow: none;
}

.chat-partner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--retro-green);
    color: #123018;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chat-partner-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.chat-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 24px 120px;
    scroll-padding-bottom: 140px;
    -webkit-overflow-scrolling: touch;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border: 2px solid #1f2937;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-word;
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 0;
    box-shadow: 4px 4px 0 #1f2937;
}

.message.assistant {
    align-self: flex-start;
    background: #fff7e6;
    color: var(--foreground);
    border-bottom-left-radius: 0;
    box-shadow: 4px 4px 0 #1f2937;
}

.latency-meta {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid rgba(100, 116, 139, 0.18);
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.45;
    font-weight: 600;
}

/* 하단 입력 영역 */
.input-area {
    position: fixed;
    bottom: calc(24px + var(--bottom-safe-area) + var(--keyboard-inset));
    left: var(--app-gutter);
    right: var(--app-gutter);
    max-width: calc(var(--app-max-width) - (var(--app-gutter) * 2));
    margin: 0 auto;
    display: flex;
    gap: 8px;
    background: white;
    padding: 12px;
    border-radius: 10px;
    border: 3px solid var(--border);
    box-shadow: 6px 6px 0 #1f2937;
    z-index: 220;
}

.input-area textarea {
    flex: 1;
    background: none;
    border: none;
    color: var(--foreground);
    padding: 8px 12px;
    resize: none;
    outline: none;
    font-size: 1rem;
}

.chat-send-button {
    flex-shrink: 0;
    width: 54px;
    height: 44px;
    border: 0;
    border: 2px solid #1f2937;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-voice-button {
    flex-shrink: 0;
    width: 48px;
    height: 44px;
    border: 2px solid #111827;
    border-radius: 999px;
    background: #111827;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 0 rgba(31, 41, 55, 0.35);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.chat-voice-button:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 rgba(31, 41, 55, 0.4);
}

.chat-voice-button:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 rgba(31, 41, 55, 0.35);
}

.chat-voice-button.active {
    background: var(--danger);
    color: white;
    border-color: #111827;
}

.voice-mode-icon {
    height: 22px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.voice-mode-icon span {
    width: 3px;
    border-radius: 999px;
    background: currentColor;
}

.voice-mode-icon span:nth-child(1) { height: 10px; }
.voice-mode-icon span:nth-child(2) { height: 18px; }
.voice-mode-icon span:nth-child(3) { height: 14px; }
.voice-mode-icon span:nth-child(4) { height: 22px; }

.voice-close-icon {
    position: relative;
    width: 20px;
    height: 20px;
}

.voice-close-icon::before,
.voice-close-icon::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 0;
    width: 3px;
    height: 20px;
    border-radius: 999px;
    background: currentColor;
}

.voice-close-icon::before { transform: rotate(45deg); }
.voice-close-icon::after { transform: rotate(-45deg); }

@media (max-width: 430px) {
    :root {
        --topbar-offset: calc(12px + env(safe-area-inset-top, 0px));
        --topbar-height: 44px;
    }

    .service-topbar {
        width: min(calc(100% - 20px), var(--app-max-width));
        gap: 6px;
        padding: 5px 7px;
    }

    .service-nav-button {
        height: 32px;
        padding: 0 9px;
        font-size: 0.82rem;
    }

    .service-page-title {
        font-size: 0.92rem;
    }

    .input-area {
        gap: 6px;
        padding: 10px;
    }

    .chat-send-button {
        width: 50px;
    }

    .chat-voice-button {
        width: 44px;
        height: 42px;
    }
}

/* 모달 (기존 구조를 유지하지만 스타일만 변경) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 12px;
    margin-bottom: 16px;
    border: 2px solid #1f2937;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 3px 3px 0 rgba(31, 41, 55, 0.35);
}

.consent-overlay {
    align-items: flex-start;
    background: var(--background);
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.consent-content {
    width: 100%;
    max-width: var(--app-max-width);
    padding: 0 0 32px;
    background: transparent;
    box-shadow: none;
}

.consent-overlay .glass-card {
    margin-bottom: 16px;
}

.consent-content h1,
#screen-recording h2,
#screen-cloning h2 {
    color: #1f2937 !important;
    text-shadow: 2px 2px 0 var(--retro-yellow);
}

#screen-recording,
#screen-cloning {
    background:
        linear-gradient(rgba(31, 41, 55, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 41, 55, 0.04) 1px, transparent 1px),
        #f3ead7;
    background-size: 22px 22px;
}

#screen-incoming-call {
    background:
        radial-gradient(circle at top, rgba(159, 189, 143, 0.2), transparent 45%),
        #1f2937 !important;
    border-left-color: #d9c7a3;
    border-right-color: #d9c7a3;
    padding-top: 86px !important;
}

#screen-incoming-call h2 {
    color: #fff7e6;
    text-shadow: 4px 4px 0 #0f172a;
}

#screen-incoming-call button {
    border: 3px solid #fff7e6 !important;
    box-shadow: 5px 5px 0 #0f172a !important;
}

.cleanup-status {
    min-height: 20px;
    margin-bottom: 16px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 700;
}

.call-reject-note {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
    padding: 0 24px;
    margin-top: 18px;
}

/* 애니메이션 */
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

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

.voice-panel {
    display: none;
    position: fixed;
    left: var(--app-gutter);
    right: var(--app-gutter);
    bottom: calc(112px + var(--bottom-safe-area) + var(--keyboard-inset));
    max-width: calc(var(--app-max-width) - (var(--app-gutter) * 2));
    margin: 0 auto;
    z-index: 180;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: rgba(255,255,255,0.96);
    color: var(--foreground);
    border: 3px solid var(--border);
    border-radius: 10px;
    box-shadow: 6px 6px 0 #1f2937;
}

.voice-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.voice-panel-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-100);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.voice-panel-title {
    flex: 1;
    margin: 0;
    color: var(--foreground);
    font-size: 1rem;
    font-weight: 700;
}

.voice-call-timer {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.voice-panel-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 4px 0;
}

#voice-last-message {
    max-width: min(640px, 100%);
    min-height: 44px;
    color: var(--foreground);
    font-size: 1rem;
    line-height: 1.55;
    text-align: center;
    font-weight: 500;
}

#voice-interim-text {
    min-height: 24px;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-style: italic;
}

.voice-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 64px;
    margin-top: 10px;
    width: min(260px, 100%);
    padding: 8px 10px;
    border: 3px solid #1f2937;
    border-radius: 999px;
    background: #f8f0d8;
    box-shadow: inset 0 0 0 2px rgba(31, 41, 55, 0.06), 4px 4px 0 #1f2937;
}

.voice-waveform.is-active {
    background: #fff7d6;
}

.voice-status {
    text-align: center;
}

#voice-status-dots {
    color: var(--primary);
    font-size: 1.2rem;
    letter-spacing: 4px;
}

#voice-status-text {
    margin-top: 4px;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
}

.voice-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.voice-barge-button {
    display: none;
    width: 100%;
    padding: 14px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 520px) {
    :root {
        --app-gutter: 16px;
    }

    .chat-container {
        padding-left: 16px;
        padding-right: 16px;
        padding-bottom: 128px;
    }
}
