:root {
    color-scheme: light dark;
    --bg: #f4f6fb;
    --bg-dark: #0f172a;
    --text: #1f2937;
    --text-muted: #526281;
    --text-dark: #e5e7eb;
    --primary: #3864ff;
    --card: #ffffff;
    --card-dark: #1e293b;
    --border: #d5d9e6;
    --border-dark: #293548;
    --bubble-user: #3864ff;
    --bubble-user-dark: #4c6fff;
    --bubble-bot: #e8ecf8;
    --bubble-bot-dark: #273349;
}

* {
    box-sizing: border-box;
}

html,body {
    width:100%; height:100dvh;
    margin: 0; padding:0;
}

body, h1, h2, h3, p {
    margin: 0; padding:0;
    font-family: "Noto Sans KR";
}

body.theme-light {
    background: #fff;
    color:#000;
}

/* body.theme-dark {
    background: var(--bg-dark);
    color: var(--text-dark);
} */

.app-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    width:400px;
    margin:0 auto; 
    position:relative;
}

.app-header {
    width:100%; position:relative; padding:11px 12px;
}

.app-title {
    width:100%; position:relative;
}

.app-title .headInner {
    display:flex; flex-flow: row nowrap; align-items: center; justify-content: center; gap:6px;
}

.app-title .headInner > p{
    font-size:20px; font-weight:500; color:#000;
}

.app-title > a {
    position:absolute; top:50%; right:12px; width:32px; height:32px; transform:translateY(-50%); background:#fff;
}

/* .badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(56, 100, 255, 0.12);
    color: var(--primary);
}

.app-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.55);
}

body.theme-dark .status-indicator {
    border-color: var(--border-dark);
    background: rgba(15, 23, 42, 0.65);
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #9ca3af;
}

.status-indicator[data-status="authenticated"] .status-dot {
    background: #22c55e;
}

.icon-button {
    border: none;
    background: transparent;
    padding: 0.45rem 0.65rem;
    border-radius: 0.65rem;
    cursor: pointer;
    font-size: 1rem;
    color: inherit;
    transition: background 0.2s ease;
}

.icon-button:hover {
    background: rgba(56, 100, 255, 0.12);
} */

main {
    width:100%; background:#F5F5F5; overflow-y:auto; height:calc(100dvh - 140px);
}
 main::-webkit-scrollbar {
    display:none;
}
/*main::-webkit-scrollbar-track {
    background-color: #f5f5f5; padding:5px;
}
main::-webkit-scrollbar-thumb { 
    background-color: #0098FF; border-radius:10px;
}
main::-webkit-scrollbar-button {
    display: none;
} */

.chatIntro {
    padding-top:60px;
}

.chatIntro .inner {
    display:flex; flex-flow: column; align-items: center; justify-content: flex-start;
}

.chatIntro .inner > .introTit{
    font-size:22px; font-weight:500; line-height:150%; color:#000; margin:16px 0 20px; text-align:center;
}

.chatIntro .inner > .introTit span{
    color:#0098FF;
}

.chatIntro .inner > .introDesc{
    font-size:16px; font-weight:400; line-height:150%; color:#000; text-align:center; margin-bottom:60px;
}

.chatIntro .inner > .introDesc span{
    color: #0098FF;
}

.chat-main {
    padding:3px 20px 32px 20px;
    display:flex;
    flex-direction: column;
    gap:16px;
}

.tag-strip{
    display:flex;
    flex-flow: row wrap;
    gap:8px;
    background:#fff;
    padding:10px 12px;
    border-radius:16px;
    border:1px solid #e5e5e5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 10;
}

.tag-chip{
    padding:8px 14px;
    border-radius:18px;
    border: none;
    background:#e7f0ff;
    color:#004cbd;
    font-weight:700;
    font-size:14px;
    cursor:pointer;
    transition: all 0.2s ease;
}

.tag-chip:hover,
.tag-chip:focus-visible{
    background:#d7e7ff;
    outline:none;
    transform: translateY(-1px);
}

.tag-chip.selected{
    background:#004cbd;
    color:#fff;
    box-shadow:0 6px 14px rgba(0, 76, 189, 0.18);
}

.chat-history {
    width:100%; display:flex; flex-flow:column; gap:20px;
}

.chat-message {
    display: flex;
}

.chat-message.bot {
    flex-flow:column; gap:8px;
}

.chat-message.bot .profile{
    display:flex; flex-flow: row nowrap; align-items: center ;justify-content: flex-start; gap:8px;
}

.chat-message.bot .profile p{
    font-size: 14px; font-weight:500; line-height:160%;
}

.chat-message.user {
    justify-content: flex-end;
}

.bubble {
    padding: 14px 16px;
    border-radius: 1.2rem;
    line-height: 1.5;
    max-width: 70%;
    white-space: pre-line;
}

.chat-message.user .bubble {
    background: #5C5C5C;
    color: #fff;
    border-radius:20px 0 20px 20px;
}

.chat-message.bot .bubble {
    background: #fff;
    color: #000;
    border-radius:0 20px 20px 20px;
}

.input-bar {
    width:100%; position:relative; background:#fff; padding:14px 16px;
}

.input-field {
    width:100%; position:relative;
}

#chatInput {
    width:100%; padding: 12px 52px 12px 20px; background:#F5F5F5; resize:none; border:none; border-radius:30px; min-height:56px;
    font-size:16px; font-weight:500; color:#000; line-height:30px; font-family: "Noto Sans KR";
}

#chatInput:focus{
    outline:none;
}

#chatInput::-webkit-scrollbar {
    display:none;
}

/* body.theme-dark #chatInput {
    border-color: rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.92);
} */

.send-button {
    position:absolute; top:50%; right:20px; width:32px; height:32px; background:url(/images/helpbot_send_off.svg)50% 50% no-repeat; transform:translateY(-50%);
}

#chatInput.typing + a{
    background: url(/images/helpbot_send_on.svg) 50% 50% no-repeat;
}


@media (max-width: 480px) {
    .app-shell {width:100%;}
}

.loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.65);
    color: #fff;
    z-index: 9999;
    transition: opacity 0.2s ease;
    font-size: 1.05rem;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.loading-overlay .spinner {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
