@charset "UTF-8";

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
    --nhp-primary: #1a237e;
    --nhp-primary-deep: #0f172a;
    --nhp-bg: #f8f9fa;
    --nhp-white: #ffffff;
    --nhp-user-bubble: #1a237e;
    --nhp-ai-bubble: #ffffff;
    --nhp-border: #e5e7eb;
    --nhp-muted: #6b7280;
    --nhp-danger: #d92d20;
    --nhp-success: #107569;
    --nhp-accent: #ff5252;
    --nhp-shadow: 0 16px 36px rgba(15, 23, 42, 0.10);
    --nhp-safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

.nhp-hidden {
    display: none !important;
}

.nhp-chat-page,
.nhp-chat-page * {
    box-sizing: border-box;
    font-family: "Pretendard", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.nhp-chat-page {
    width: 100%;
    max-width: 480px;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0 auto;
    background: var(--nhp-bg);
    overflow: hidden;
}

.nhp-chat-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    background: var(--nhp-bg);
    overflow: hidden;
    box-shadow: var(--nhp-shadow);
}

.nhp-chat-header {
    flex: 0 0 auto;
    padding: 18px 18px 16px;
    background: var(--nhp-primary);
    color: var(--nhp-white);
}

.nhp-chat-header-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nhp-chat-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.nhp-chat-header-title {
    font-size: 17px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nhp-chat-header-subtitle {
    margin: 10px 0 0;
    color: rgba(255,255,255,0.82);
    font-size: 13px;
    line-height: 1.55;
}

.nhp-chat-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nhp-chat-top-status {
    flex: 0 0 auto;
    padding: 10px 16px;
    border-bottom: 1px solid var(--nhp-border);
    background: #fff;
    color: var(--nhp-muted);
    font-size: 12px;
    line-height: 1.55;
    font-weight: 600;
}

.nhp-chat-top-status.is-error {
    color: var(--nhp-danger);
    background: #fff4f4;
}

.nhp-chat-top-status.is-success {
    color: var(--nhp-success);
    background: #f2fcf8;
}

#nhp-chat-messages.nhp-chat-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(180deg, #fafafa 0%, #f4f6fb 100%);
}

.nhp-msg-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nhp-msg-user {
    align-items: flex-end;
}

.nhp-msg-admin,
.nhp-msg-intro,
.nhp-msg-ai,
.nhp-msg-system {
    align-items: flex-start;
}

.nhp-msg-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.65;
    letter-spacing: -0.01em;
    word-break: keep-all;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.nhp-msg-user .nhp-msg-bubble {
    background: var(--nhp-user-bubble);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.nhp-msg-admin .nhp-msg-bubble,
.nhp-msg-intro .nhp-msg-bubble,
.nhp-msg-ai .nhp-msg-bubble,
.nhp-msg-system .nhp-msg-bubble {
    background: var(--nhp-ai-bubble);
    color: #111827;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.03);
    border-bottom-left-radius: 6px;
}

.nhp-richtext-bubble p {
    margin: 0 0 10px;
}

.nhp-richtext-bubble p:last-child {
    margin-bottom: 0;
}

.nhp-richtext-bubble strong,
.nhp-richtext-bubble b {
    font-weight: 800;
    color: inherit;
}

.nhp-richtext-bubble em,
.nhp-richtext-bubble i {
    font-style: italic;
}

.nhp-richtext-bubble ul,
.nhp-richtext-bubble ol {
    margin: 8px 0 8px 18px;
    padding: 0;
}

.nhp-richtext-bubble li {
    margin: 0 0 6px;
}

.nhp-richtext-bubble li:last-child {
    margin-bottom: 0;
}

.nhp-msg-user .nhp-richtext-bubble ul,
.nhp-msg-user .nhp-richtext-bubble ol {
    margin-left: 16px;
}

.nhp-voice-feedback {
    flex: 0 0 auto;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(26, 35, 126, 0.08);
    border-top: 1px solid rgba(26, 35, 126, 0.04);
}

.nhp-wave-container {
    display: flex;
    gap: 4px;
}

.nhp-wave-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--nhp-accent);
    animation: nhpWave 1.2s infinite ease-in-out;
}

.nhp-wave-dot:nth-child(2) { animation-delay: 0.2s; }
.nhp-wave-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes nhpWave {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.nhp-voice-status-text {
    color: var(--nhp-primary);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 600;
}

.nhp-chat-compose {
    flex: 0 0 auto;
    padding: 12px 12px calc(12px + var(--nhp-safe-bottom));
    background: #fff;
    border-top: 1px solid var(--nhp-border);
}

.nhp-input-shell {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nhp-compose-status {
    display: none;
    padding: 8px 10px;
    border-radius: 12px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    line-height: 1.5;
}

.nhp-compose-status.is-visible {
    display: block;
}

.nhp-compose-status.is-error {
    background: #fff4f4;
    color: var(--nhp-danger);
}

.nhp-compose-status.is-success {
    background: #f2fcf8;
    color: var(--nhp-success);
}

.nhp-input-wrapper {
    background: #f1f3f5;
    border-radius: 18px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#nhp-chat-message {
    width: 100%;
    min-height: 40px;
    max-height: 120px;
    padding: 0;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    resize: none;
    color: #111827;
    font-size: 15px !important;
    line-height: 1.55 !important;
    overflow-y: auto;
}

#nhp-chat-message::placeholder {
    color: #9ca3af;
}

.nhp-input-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.nhp-left-tools,
.nhp-right-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nhp-tool-label {
    font-size: 12px;
    line-height: 1;
    color: var(--nhp-muted);
}

.nhp-icon-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: #5f6368;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.nhp-icon-btn:hover {
    transform: scale(1.06);
    background: rgba(255,255,255,0.8);
    color: var(--nhp-primary);
}

.nhp-plus-btn {
    color: #4285f4;
}

.nhp-mic-btn {
    color: #5f6368;
}

.nhp-mic-btn.is-recording {
    color: var(--nhp-accent);
}

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

.nhp-send-btn:hover {
    color: #fff;
    background: #283593;
}

.nhp-send-btn.is-disabled,
.nhp-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.nhp-clear-btn {
    color: #64748b;
}

.nhp-voice-wave {
    display: none;
    align-items: center;
    gap: 3px;
    height: 16px;
}

.nhp-voice-wave i {
    display: block;
    width: 3px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    animation: nhpVoiceBeat 0.84s infinite ease-in-out;
}

.nhp-voice-wave i:nth-child(2) { animation-delay: 0.16s; }
.nhp-voice-wave i:nth-child(3) { animation-delay: 0.32s; }

@keyframes nhpVoiceBeat {
    0%,100% { transform: scaleY(0.85); opacity: 0.55; }
    50% { transform: scaleY(2.2); opacity: 1; }
}

.nhp-mic-btn.is-recording .nhp-voice-idle,
.nhp-mic-btn.is-processing .nhp-voice-idle {
    display: none;
}

.nhp-mic-btn.is-recording .nhp-voice-wave,
.nhp-mic-btn.is-processing .nhp-voice-wave {
    display: inline-flex;
}

.nhp-chat-privacy-notice {
    margin: 0;
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
}

@media (max-width: 480px) {
    .nhp-chat-page,
    .nhp-chat-container {
        max-width: 100%;
        box-shadow: none;
    }

    .nhp-chat-header {
        padding: 16px 14px 14px;
    }

    #nhp-chat-messages.nhp-chat-thread {
        padding: 16px 14px 10px;
    }

    .nhp-msg-bubble {
        max-width: 90%;
        font-size: 14px;
        padding: 12px 14px;
    }

    .nhp-chat-compose {
        padding: 10px 10px calc(10px + var(--nhp-safe-bottom));
    }

    .nhp-input-wrapper {
        padding: 10px;
        border-radius: 16px;
    }

    .nhp-icon-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
    }
}


/* Quick intake modal */
.nhp-inline-intake-wrap {
    position: absolute;
    inset: 0;
    z-index: 25;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(2px);
}
.nhp-inline-intake-wrap.nhp-hidden {
    display: none !important;
}
.nhp-inline-intake-card {
    width: min(100%, 460px);
    max-height: 88%;
    overflow: auto;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    padding: 18px 18px 16px;
}
.nhp-inline-intake-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.nhp-inline-intake-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}
.nhp-inline-intake-close {
    border: 0;
    background: #f1f5f9;
    color: #334155;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 18px;
}
.nhp-inline-intake-desc {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.6;
    color: #475569;
}
.nhp-inline-intake-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}
.nhp-inline-intake-field label {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}
.nhp-inline-intake-field input {
    width: 100%;
    height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 14px;
    color: #0f172a;
    outline: none;
}
.nhp-inline-intake-field input:focus {
    border-color: #b45309;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}
.nhp-privacy-accordion {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #fff;
}
.nhp-privacy-toggle {
    width: 100%;
    border: 0;
    background: #f8fafc;
    color: #0f172a;
    text-align: left;
    padding: 13px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.nhp-privacy-body {
    display: none;
    padding: 12px 14px 14px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    line-height: 1.7;
    color: #475569;
    background: #fff;
}
.nhp-privacy-accordion.is-open .nhp-privacy-body {
    display: block;
}
.nhp-inline-intake-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
}
.nhp-inline-intake-check input {
    margin-top: 2px;
}
.nhp-inline-intake-submit {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.nhp-inline-intake-submit[disabled] {
    opacity: .65;
    cursor: not-allowed;
}
.nhp-inline-intake-status {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.5;
    color: #64748b;
}
.nhp-inline-intake-status.is-error {
    color: #b91c1c;
}
.nhp-inline-intake-status.is-success {
    color: #166534;
}
.nhp-msg-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-start;
}
.nhp-msg-row.nhp-msg-user .nhp-msg-actions {
    justify-content: flex-end;
}
.nhp-intake-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(180, 83, 9, 0.18);
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.08);
    color: #92400e;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.nhp-intake-open-btn:hover {
    background: rgba(245, 158, 11, 0.14);
}


/* coherent runtime overrides for inline intake accordion */
.nhp-inline-intake-wrap {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    display: block !important;
    align-items: initial !important;
    justify-content: initial !important;
    padding: 0 !important;
    margin-top: 10px !important;
    background: transparent !important;
    backdrop-filter: none !important;
}
.nhp-inline-intake-wrap.nhp-hidden {
    display: none !important;
}
.nhp-inline-intake-card,
.nhp-inline-intake-head,
.nhp-inline-intake-title,
.nhp-inline-intake-close,
.nhp-inline-intake-desc,
.nhp-inline-intake-field,
.nhp-privacy-accordion,
.nhp-privacy-toggle,
.nhp-privacy-body,
.nhp-msg-actions,
.nhp-intake-open-btn {
    display: none !important;
}
.nhp-inline-intake-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 122px;
    min-height: 42px;
    padding: 11px 18px;
    border: 0;
    border-radius: 12px;
    background: #1e3a8a;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(30, 58, 138, 0.18);
}
.nhp-inline-intake-wrap.is-open .nhp-inline-intake-toggle {
    background: #17306f;
}
.nhp-inline-intake-panel {
    display: none;
    margin-top: 10px;
    padding: 14px 14px 12px;
    border: 1px solid #dbe4ff;
    border-radius: 14px;
    background: #f8fbff;
    overflow: hidden;
}
.nhp-inline-intake-wrap.is-open .nhp-inline-intake-panel {
    display: block;
}
.nhp-inline-minimal-fields {
    display: grid;
    gap: 10px;
}
.nhp-inline-intake-form input[type="text"] {
    width: 100%;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid #d6dce5;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    font-size: 14px;
}
.nhp-inline-intake-form input[type="text"]:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.10);
}
.nhp-inline-minimal-check {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.6;
    color: #334155;
}
.nhp-inline-minimal-check input {
    margin-top: 3px;
}
.nhp-inline-minimal-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.nhp-inline-intake-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 128px;
    min-height: 42px;
    padding: 11px 16px;
    border: 0;
    border-radius: 12px;
    background: #1e3a8a;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}
.nhp-inline-intake-submit[disabled] {
    opacity: .65;
    cursor: not-allowed;
}
.nhp-inline-intake-status {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.6;
    color: #475569;
}
.nhp-inline-intake-status.is-error {
    color: #b91c1c;
}
.nhp-inline-intake-status.is-success {
    color: #166534;
}
@media (max-width: 480px) {
    .nhp-inline-intake-toggle,
    .nhp-inline-intake-submit {
        width: 100%;
    }
}


/* stage 4 voice UX polish */
.nhp-voice-feedback {
    transition: opacity .22s ease, transform .22s ease, background-color .22s ease, border-color .22s ease;
    border-top: 1px solid rgba(26, 35, 126, 0.06);
}

.nhp-voice-feedback.nhp-hidden {
    display: none !important;
}

.nhp-voice-feedback.is-recording {
    background: rgba(26, 35, 126, 0.08);
}

.nhp-voice-feedback.is-processing {
    background: rgba(16, 117, 105, 0.08);
}

.nhp-voice-feedback.is-recoverable {
    background: rgba(180, 83, 9, 0.12);
}

.nhp-voice-feedback.is-passive {
    background: rgba(71, 85, 105, 0.08);
}

.nhp-input-wrapper {
    transition: box-shadow .24s ease, background-color .24s ease, transform .24s ease;
}

.nhp-input-wrapper.is-voice-updating {
    background: #eef4ff;
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.10);
}

.nhp-voice-recovery-wrap {
    display: none;
}

.nhp-voice-recovery-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 0 2px;
}

.nhp-voice-recovery-label {
    font-size: 12px;
    line-height: 1.5;
    color: #b45309;
    font-weight: 700;
}

.nhp-voice-recovery-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nhp-voice-recovery-btn {
    appearance: none;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}

.nhp-voice-recovery-btn:hover {
    transform: translateY(-1px);
}

.nhp-voice-recovery-btn.is-primary {
    border: 0;
    background: #1e3a8a;
    color: #fff;
    box-shadow: 0 8px 18px rgba(30, 58, 138, 0.18);
}

.nhp-voice-recovery-btn.is-muted {
    border: 1px solid #d6dce5;
    background: #fff;
    color: #475569;
}

@media (max-width: 480px) {
    .nhp-voice-recovery-box {
        align-items: stretch;
    }

    .nhp-voice-recovery-actions {
        width: 100%;
    }

    .nhp-voice-recovery-btn {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
    }
}


/* 고객 채팅창 자료 업로드 버튼은 좌측 1개만 사용 */
#nhp-chat-plus-btn,
#nhp-chat-evidence-files {
    display: none !important;
}
#nhp-evidence-trigger.is-uploading {
    opacity: .55;
    cursor: wait;
}
@media (max-width: 768px), (pointer: coarse) {
    #nhp-voice-btn {
        display: none !important;
    }
}
