/* ==================== 기본 설정 ==================== */
:root {
    /* 색상 팔레트 */
    --primary-color: #0066FF;
    --primary-dark: #0052CC;
    --primary-light: #E6F0FF;
    --secondary-color: #6C757D;
    --success-color: #28A745;
    --danger-color: #DC3545;
    --warning-color: #FFC107;

    /* 그레이스케일 */
    --gray-50: #F8F9FA;
    --gray-100: #F1F3F5;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-400: #CED4DA;
    --gray-500: #ADB5BD;
    --gray-600: #6C757D;
    --gray-700: #495057;
    --gray-800: #343A40;
    --gray-900: #212529;

    /* 그림자 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);

    /* 간격 */
    --header-height: 80px;
    --footer-height: 50px;

    /* 애니메이션 */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.35s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #F1F2F8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--gray-800);
    overflow-x: hidden;
}

/* ==================== 헤더 ==================== */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    height: var(--header-height);
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--gray-200);
}

.header-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

.header-left {
    display: flex;
    justify-content: flex-start;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.logo {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.logo i {
    font-size: 28px;
    color: white;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.header-subtitle {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 400;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-base);
}

.status-indicator i {
    font-size: 8px;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.status-indicator.offline {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.user-name {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
}

.user-name i {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.logout-btn {
    white-space: nowrap;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: var(--transition-base);
}

.logout-btn:hover {
    background-color: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

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

/* ==================== 메인 컨테이너 ==================== */
.main-container {
    flex: 1;
    padding: 2rem 0;
    display: flex;
    align-items: center;
}

.chat-container {
    background: white;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    height: 75vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

/* ==================== 채팅 메시지 영역 ==================== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    scroll-behavior: smooth;
}

/* 스크롤바 스타일링 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* 웰컴 메시지 */
.welcome-message {
    text-align: center;
    padding: 3rem 1rem;
    animation: fadeInUp 0.6s ease;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-lg);
}

.welcome-icon i {
    font-size: 40px;
    color: white;
}

.welcome-message h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.welcome-message > p {
    font-size: 1.125rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* 샘플 질문 */
.sample-questions {
    margin-top: 3rem;
}

.sample-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 1rem;
    text-align: center;
}

.sample-question-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.sample-question {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    min-height: 100px;
}

.sample-question:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sample-question i {
    font-size: 24px;
    color: var(--primary-color);
}

/* 메시지 스타일 */
.message {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.3s ease;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    margin-top: 8px;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.message.assistant .message-avatar {
    background: var(--gray-200);
    color: var(--gray-700);
}

.message-content {
    max-width: 70%;
}

.message-bubble {
    padding: 1rem 1.25rem;
    border-radius: 18px;
    line-height: 1.6;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background: var(--gray-100);
    color: var(--gray-800);
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
    padding: 0 0.5rem;
}

/* 출처 문서 */
.sources-container {
    margin-top: 1rem;
}

.sources-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sources-title i {
    color: var(--primary-color);
}

.source-item {
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: var(--transition-base);
}

.source-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.source-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.source-url {
    font-size: 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.source-url:hover {
    text-decoration: underline;
}

.source-preview {
    font-size: 0.8125rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* 로딩 인디케이터 */
.typing-indicator {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.3s ease;
}

.typing-indicator .message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.typing-bubble {
    background: var(--gray-100);
    padding: 1rem 1.25rem;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 6px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--gray-500);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ==================== 입력 영역 ==================== */
.chat-input-container {
    padding: 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.chat-form {
    max-width: 100%;
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    resize: none;
    transition: var(--transition-base);
    max-height: 150px;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.btn-send {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-send:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-send:active:not(:disabled) {
    transform: translateY(0);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    color: var(--gray-700);
    font-weight: 500;
}

/* ==================== 푸터 ==================== */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    height: var(--footer-height);
    display: flex;
    align-items: center;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    border-top: 1px solid var(--gray-200);
}

.footer p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.footer i {
    color: var(--primary-color);
    margin: 0 0.25rem;
}

/* ==================== 애니메이션 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 반응형 ==================== */
@media (max-width: 992px) {
    .header-subtitle {
        display: none;
    }

    .logout-text {
        display: none;
    }

    .header-layout {
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .header-title {
        font-size: 1rem;
    }

    .header-center {
        gap: 0.5rem;
    }

    .logo {
        width: 40px;
        height: 40px;
    }

    .logo i {
        font-size: 20px;
    }

    .status-indicator span {
        display: none;
    }

    .status-indicator {
        padding: 8px;
        font-size: 0.8125rem;
    }

    .user-name {
        padding: 6px 10px;
        font-size: 0.8125rem;
    }

    .user-name span {
        display: none;
    }

    .logout-btn {
        padding: 6px 10px;
    }

    .chat-container {
        height: calc(100vh - var(--header-height) - var(--footer-height) - 2rem);
        border-radius: 16px;
    }

    .chat-messages {
        padding: 1rem;
    }

    .welcome-message {
        padding: 2rem 0.5rem;
    }

    .welcome-icon {
        width: 60px;
        height: 60px;
    }

    .welcome-icon i {
        font-size: 30px;
    }

    .welcome-message h2 {
        font-size: 1.5rem;
    }

    .welcome-message > p {
        font-size: 1rem;
    }

    .sample-question-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .message-content {
        max-width: 85%;
    }

    .main-container {
        padding: 1rem 0;
    }
}

@media (max-width: 576px) {
    .header {
        height: auto;
        padding: 1rem 0;
    }

    .header-layout {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .header-center {
        order: 1;
        width: 100%;
        margin-bottom: 0.75rem;
    }

    .header-left {
        order: 2;
    }

    .header-right {
        order: 3;
    }

    .header-title {
        font-size: 0.95rem;
    }

    .sample-question-grid {
        grid-template-columns: 1fr;
    }

    .input-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ==================== 새 채팅 버튼 스타일 ==================== */
.new-chat-button {
    background: linear-gradient(135deg, #00D9FF 0%, #00B4D8 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 217, 255, 0.3);
    transition: all 0.3s ease;
}

.new-chat-button:hover {
    background: linear-gradient(135deg, #00F0FF 0%, #00C8EC 100%) !important;
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.5);
    transform: translateY(-1px);
}

.new-chat-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 217, 255, 0.4);
}

.new-chat-button i {
    font-size: 1rem;
}

/* ============================================================
   데모 모드 (/demo) 전용
   demo-mode.js 가 경로를 보고 html.demo 클래스를 붙인다.
   html.demo 스코프 규칙은 데모 화면에서만 적용 — 운영 화면 불변.
   .fb-* / .quick-chip / .btn-new-chat-corner 등은 데모 전용
   마크업(.demo-only)에서만 쓰이는 컴포넌트다.
   ============================================================ */

/* 웰컴 영역 컴팩트화 — 샘플 질문이 첫 화면에 모두 보이게 */
html.demo .welcome-message { padding: 1.5rem 1rem; }
html.demo .welcome-icon { width: 56px; height: 56px; margin: 0 auto 0.75rem; }
html.demo .welcome-icon i { font-size: 26px; }
html.demo .welcome-message h2 { font-size: 1.4rem; margin-bottom: 0.5rem; }
html.demo .welcome-message > p { font-size: 0.95rem; line-height: 1.5; margin-bottom: 1rem; }

/* 샘플 질문 — 작은 정사각 칩 */
html.demo .sample-questions { margin-top: 1rem; }
html.demo .sample-title { font-size: 0.82rem; margin-bottom: 0.6rem; }

html.demo .sample-question-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    max-width: 640px;
}

html.demo .sample-question {
    border: 1.5px solid var(--gray-200);
    border-radius: 16px;
    width: 88px;
    height: 88px;
    padding: 0.4rem 0.25rem;
    display: inline-flex;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    min-height: 0;
    animation: chipNudge 2.4s ease-in-out infinite;
}

/* 클릭 유도: 버튼이 차례로 살짝 떠오르며 계속 시선을 끈다 */
html.demo .sample-question:nth-child(2) { animation-delay: 0.25s; }
html.demo .sample-question:nth-child(3) { animation-delay: 0.5s; }
html.demo .sample-question:nth-child(4) { animation-delay: 0.75s; }
html.demo .sample-question:nth-child(5) { animation-delay: 1s; }

@keyframes chipNudge {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
        border-color: var(--gray-200);
    }
    50% {
        transform: translateY(-4px);
        box-shadow: 0 8px 16px rgba(79, 70, 229, 0.18);
        border-color: #B9B4F0;
    }
}

html.demo .sample-question:hover { animation: none; }
html.demo .sample-question i { font-size: 1.5rem; }

/* 새 채팅 — 좌상단 모서리 아이콘 버튼 (데모 마크업 전용) */
.btn-new-chat-corner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1.5px solid var(--gray-200);
    background: var(--gray-50);
    color: var(--gray-700);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    margin-right: 0.5rem;
}

.btn-new-chat-corner:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

/* 평가 남기기 — 가게명 바로 아래, 계속 강조 */
.btn-feedback {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    margin-top: 3px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    animation: fbPulse 1.6s ease-in-out infinite;
}

.btn-feedback .fb-sub {
    font-weight: 400;
    font-size: 0.72rem;
    opacity: 0.9;
}

@keyframes fbPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.45); }
    50%      { box-shadow: 0 0 0 8px rgba(79, 70, 229, 0); }
}

/* 데스크톱 상시 노출 평가 폼 — 시선을 끄는 글로우 */
.fb-panel {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    border: 2px solid #E2E0F8;
    position: sticky;
    top: calc(var(--header-height) + 20px);
    animation: fbPanelGlow 2s ease-in-out infinite;
}

@keyframes fbPanelGlow {
    0%, 100% {
        border-color: #E2E0F8;
        box-shadow: 0 4px 14px rgba(30, 30, 80, 0.08);
    }
    50% {
        border-color: #7c3aed;
        box-shadow: 0 0 24px rgba(124, 58, 237, 0.35);
    }
}

/* 데스크톱은 상시 폼이 있으므로 헤더 평가 버튼은 모바일에서만 */
@media (min-width: 992px) {
    .btn-feedback { display: none; }
}

/* 모바일: 우측 중앙에 붙어 스크롤을 따라다니는 피드백 탭 */
.fb-float {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 12px 0 0 12px;
    padding: 12px 6px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: -2px 4px 12px rgba(79, 70, 229, 0.35);
    animation: fbPulse 1.6s ease-in-out infinite;
}

/* 답변 아래 다시 나오는 빠른 질문 알약 */
.quick-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: -0.5rem 0 1.25rem;
    animation: fadeInUp 0.3s ease;
}

.quick-chip {
    border: 1.5px solid var(--gray-200);
    background: var(--gray-50);
    color: var(--gray-700);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.quick-chip i {
    color: var(--primary-color);
    margin-right: 4px;
}

.quick-chip:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

/* 평가 모달 별점 */
.fb-stars {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.fb-stars button {
    border: none;
    background: none;
    font-size: 2.2rem;
    line-height: 1;
    color: var(--gray-200);
    cursor: pointer;
    transition: transform 0.1s, color 0.1s;
    padding: 0 2px;
}

.fb-stars button.on { color: #f5b301; }
.fb-stars button:hover { transform: scale(1.15); }

/* 데모: 모바일 웰컴/헤더 컴팩트화 */
@media (max-width: 768px) {
    html.demo .welcome-message { padding: 1rem 0.25rem; }
    html.demo .welcome-icon { width: 44px; height: 44px; margin-bottom: 0.5rem; }
    html.demo .welcome-icon i { font-size: 20px; }
    html.demo .welcome-message h2 { font-size: 1.15rem; }
    html.demo .welcome-message > p { font-size: 0.85rem; margin-bottom: 0.75rem; }
}

@media (max-width: 576px) {
    html.demo .header { height: auto; padding: 0.6rem 0; position: sticky; }
    html.demo .header-layout { flex-wrap: nowrap; justify-content: center; }
    html.demo .header-center { order: 0; width: 100%; margin-bottom: 0; gap: 0.6rem; }
    /* 카테고리 배지·상태 줄 제거 — 모바일에선 세로 공간만 차지 */
    html.demo .header-right { display: none; }
    html.demo .status-indicator { display: none; }
    html.demo .header-title { font-size: 1rem; }
    html.demo .logo { width: 36px; height: 36px; border-radius: 10px; }
    html.demo .logo i { font-size: 18px; }
    html.demo .header-left { order: 2; }

    /* 새 채팅을 최좌측 상단 모서리에 고정 */
    html.demo .btn-new-chat-corner {
        position: absolute;
        top: 10px;
        left: 10px;
        margin-right: 0;
        padding: 5px 10px;
        z-index: 10;
    }
}

/* ============================================================
   미디어 첨부 (메뉴 카드 · 사진 그리드 · 리뷰 인용 · 라이트박스)
   챗봇 답변에 백엔드가 검증한 미디어가 붙는다 — tenant-chat.js
   ============================================================ */

/* ── 메뉴 카드 캐러셀 (가로 스와이프) ── */
.menu-cards {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 10px 2px 6px;
    margin: 2px -2px 0;
    scrollbar-width: thin;
}

.menu-cards::-webkit-scrollbar { height: 6px; }
.menu-cards::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }

.menu-card {
    flex: 0 0 190px;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(30, 30, 80, 0.06);
    opacity: 0;
    transform: translateY(10px);
    animation: attachPop 0.4s ease forwards;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.menu-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(30, 30, 80, 0.12);
}

@keyframes attachPop {
    to { opacity: 1; transform: translateY(0); }
}

.menu-card-photo {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--gray-100);
    cursor: pointer;
    overflow: hidden;
}

.menu-card-photo.no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: default;
}

.menu-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.menu-card-photo:hover .menu-card-img { transform: scale(1.05); }

.menu-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 99px;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.menu-card-body { padding: 10px 12px 12px; }

.menu-card-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.35;
}

.menu-card-price {
    font-size: 0.88rem;
    font-weight: 800;
    color: #4f46e5;
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
}

.menu-card-desc {
    font-size: 0.74rem;
    color: var(--gray-600);
    margin-top: 5px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── 사진 그리드 ── */
.media-grid {
    display: grid;
    gap: 6px;
    margin-top: 10px;
    max-width: 440px;
}

.media-grid.count-1 { grid-template-columns: 1fr; }
.media-grid.count-2 { grid-template-columns: 1fr 1fr; }
.media-grid.count-3 { grid-template-columns: 1fr 1fr 1fr; }
.media-grid.count-4 { grid-template-columns: 1fr 1fr; }

.media-cell {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    background: var(--gray-100);
    opacity: 0;
    transform: translateY(10px);
    animation: attachPop 0.4s ease forwards;
}

.media-grid.count-1 .media-cell { aspect-ratio: 16 / 10; }

.media-cell-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.media-cell:hover .media-cell-img { transform: scale(1.04); }

/* ── 리뷰 한 줄 인용 ── */
.review-quotes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.review-quote {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    background: #F6F5FE;
    border: 1px solid #E3E0F5;
    border-radius: 12px;
    padding: 8px 13px;
    font-size: 0.8rem;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(10px);
    animation: attachPop 0.4s ease 0.15s forwards;
}

.review-star { color: #f5b301; font-size: 0.85rem; flex-shrink: 0; }
.review-text { color: var(--gray-800); font-weight: 600; word-break: keep-all; }
.review-source { color: var(--gray-500); font-size: 0.72rem; white-space: nowrap; }

/* ── 라이트박스 ── */
#lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(10, 10, 25, 0.94);
    display: none;
    align-items: center;
    justify-content: center;
}

#lightbox.open { display: flex; animation: lbFade 0.2s ease; }

@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }

.lb-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 48px 56px 64px;
}

.lb-media {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
    animation: lbZoom 0.22s ease;
}

@keyframes lbZoom { from { transform: scale(0.96); opacity: 0.5; } to { transform: scale(1); opacity: 1; } }

.lb-close, .lb-prev, .lb-next {
    position: absolute;
    z-index: 2;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, 0.22); }

.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

.lb-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    display: flex;
    justify-content: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    padding: 0 20px;
    text-align: center;
}

.lb-counter { color: rgba(255, 255, 255, 0.55); font-variant-numeric: tabular-nums; }

@media (max-width: 576px) {
    .menu-card { flex: 0 0 165px; }
    .lb-stage { padding: 40px 8px 56px; }
    .lb-prev, .lb-next { display: none !important; }  /* 모바일은 스와이프 */
}

/* ── 말풍선 리치 텍스트 (경량 마크다운) ── */
.message-bubble .rich-p { margin: 0 0 0.55em; }
.message-bubble .rich-p:last-child { margin-bottom: 0; }

.message-bubble .rich-list {
    margin: 0.2em 0 0.55em;
    padding-left: 0.2em;
    list-style: none;
}

.message-bubble .rich-list:last-child { margin-bottom: 0; }

.message-bubble .rich-list li {
    position: relative;
    padding-left: 1.05em;
    margin: 0.35em 0;
    line-height: 1.55;
}

.message-bubble .rich-list li::before {
    content: "";
    position: absolute;
    left: 0.1em;
    top: 0.62em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary-color);
}

.message-bubble strong {
    font-weight: 700;
    color: var(--gray-900);
}

/* ============================================================
   스토어 히어로 헤더 — 가게 대표 사진 위 미니홈 프로필
   ============================================================ */

.store-hero {
    position: relative;
    height: auto;
    display: block;
    background: #1E1E38;
    color: #fff;
    overflow: hidden;
    padding: 0;
    box-shadow: var(--shadow-md);
    border-bottom: none;
}

html.demo .store-hero { position: relative; }  /* 데모 모바일 sticky 규칙 무효화 */

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.03);
}

.hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(14, 14, 32, 0.30) 0%, rgba(14, 14, 32, 0.82) 100%);
}

.hero-inner {
    position: relative;
    z-index: 1;
    padding-top: 12px;
    padding-bottom: 18px;
}

.hero-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* 사진 배경 위의 반투명 버튼·상태 */
.btn-new-chat-corner.hero-btn {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    backdrop-filter: blur(6px);
    margin-right: 0;
}

.btn-new-chat-corner.hero-btn:hover {
    background: rgba(255, 255, 255, 0.24);
    color: #fff;
}

.store-hero .status-indicator {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 99px;
    padding: 4px 12px;
    font-size: 0.75rem;
    backdrop-filter: blur(6px);
}

.hero-name {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.hero-tagline {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.88rem;
    font-weight: 500;
    margin: 3px 0 10px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 10px;
}

.hero-meta-item .oi { font-size: 0.5rem; vertical-align: 2px; margin-right: 3px; }
.hero-meta-item.is-open .oi { color: #4ADE80; }
.hero-meta-item.is-closed .oi { color: #F87171; }

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hero-chip {
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 99px;
    white-space: nowrap;
}

@media (max-width: 576px) {
    .hero-name { font-size: 1.2rem; }
    .hero-tagline { font-size: 0.8rem; }
    .hero-topbar { margin-bottom: 10px; }
    .hero-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        margin-right: -16px;
        padding-right: 16px;
    }
    .hero-chips::-webkit-scrollbar { display: none; }
}

/* ── AI 꼬리 질문 칩 (기본 알약 위에 강조 표시) ── */
.followups { display: flex; flex-direction: column; gap: 4px; }

.quick-chip.ai-chip {
    background: linear-gradient(135deg, #F3F2FD, #FBF7FF);
    border-color: #C9C4F4;
    color: #4338CA;
    font-weight: 700;
}

.quick-chip.ai-chip i { color: #7c3aed; }

.quick-chip.ai-chip:hover {
    background: linear-gradient(135deg, #E9E7FB, #F5EEFE);
    border-color: #4f46e5;
}

.followups .base-chips .quick-chip {
    font-size: 0.74rem;
    opacity: 0.85;
}

/* ============================================================
   웰컴 스토어프론트 개편 + 상태 표시 정리
   ============================================================ */

/* 연결 상태는 문제가 있을 때(오프라인)만 노출 — 평상시 부수물 제거 */
.store-hero .status-indicator { display: none; }
.store-hero .status-indicator.offline {
    display: inline-flex;
    background: rgba(220, 53, 69, 0.85);
    color: #fff;
}

/* 웰컴: 로봇 아이콘·타이틀 없이 인사 → 시그니처 메뉴 → 리뷰 → 질문 칩 */
.welcome-message { padding: 1.4rem 1rem 2rem; }

.welcome-message .welcome-greeting {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.6;
    max-width: 34em;
    margin: 0 auto 1.1rem;
    word-break: keep-all;
}

#welcomeHighlights {
    max-width: 620px;
    margin: 0 auto 1.2rem;
    text-align: left;
}

.welcome-section-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-600);
    margin: 0;
}

#welcomeHighlights .review-quotes { margin-top: 8px; }

/* 질문 칩: 큰 카드 → 컴팩트 알약 (운영 기본형) */
.welcome-message .sample-question-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 540px;
    margin: 0 auto;
}

.welcome-message .sample-question {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: auto;
    height: auto;
    min-height: 0;
    padding: 9px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: 99px;
    background: #fff;
    font-size: 0.84rem;
    font-weight: 600;
    animation: none;
}

.welcome-message .sample-question i { font-size: 1rem; }

@media (max-width: 576px) {
    .welcome-message { padding: 1rem 0.5rem 1.5rem; }
    .welcome-message .sample-question { padding: 8px 13px; font-size: 0.8rem; }
}

/* ============================================================
   입력 바 개편 — 필(pill) 형태, 스크롤바 숨김, 원형 전송 버튼
   ============================================================ */

.chat-input-container {
    padding: 0.9rem 1rem 1.1rem;
    background: #fff;
    border-top: 1px solid var(--gray-100);
}

.input-wrapper {
    gap: 0.5rem;
    align-items: flex-end;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: 26px;
    padding: 5px 5px 5px 18px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input-wrapper:focus-within {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.chat-input {
    border: none;
    background: transparent;
    padding: 0.6rem 0;
    font-size: 0.95rem;
    max-height: 120px;
    scrollbar-width: none;           /* 파이어폭스 */
}

.chat-input::-webkit-scrollbar { display: none; }  /* 크롬·사파리 스크롤 화살표 제거 */

.chat-input:focus {
    border: none;
    box-shadow: none;
    outline: none;
}

.btn-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 17px;
}

.btn-send:hover:not(:disabled) {
    transform: none;
    filter: brightness(1.1);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

@media (max-width: 576px) {
    .chat-input-container { padding: 0.6rem 0.7rem 0.8rem; }
    .chat-input { font-size: 16px; }  /* iOS 자동 확대 방지 */
}

/* ============================================================
   메시지 개편 — 가게 아바타(사진), 고객 아바타 제거, 모던 버블
   ============================================================ */

.message {
    gap: 0.6rem;
    margin-bottom: 1.1rem;
}

.message-content { min-width: 0; max-width: 86%; }
.message.user .message-content { max-width: 80%; display: flex; flex-direction: column; align-items: flex-end; }

/* 가게 아바타 = 대표 사진 원형 (없으면 상호 첫 글자 모노그램) */
.message-avatar,
.typing-indicator .message-avatar {
    width: 34px;
    height: 34px;
    margin-top: 2px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--gray-200);
    font-size: 16px;
    color: var(--gray-600);
}

.message-avatar img,
.typing-indicator .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-mono {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
}

/* 버블: 고객 = 브랜드 그라데이션, 가게 = 옅은 뉴트럴 카드 */
.message-bubble {
    padding: 0.8rem 1.05rem;
    font-size: 0.93rem;
    line-height: 1.6;
}

.message.user .message-bubble {
    border-radius: 20px 20px 6px 20px;
    box-shadow: 0 3px 12px rgba(79, 70, 229, 0.22);
}

.message.assistant .message-bubble {
    background: #F4F5F9;
    border-radius: 6px 20px 20px 20px;
}

.message-time {
    font-size: 0.68rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.typing-bubble {
    background: #F4F5F9;
    border-radius: 6px 20px 20px 20px;
}

/* ── 전체 메뉴판 리스트 ('메뉴 보기' 즉시 렌더) ── */
.menu-list {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    margin-top: 10px;
    max-width: 480px;
    overflow: hidden;
}

.menu-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    opacity: 0;
    transform: translateY(8px);
    animation: attachPop 0.35s ease forwards;
}

.menu-row + .menu-row { border-top: 1px solid var(--gray-100); }

.menu-row-thumb {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gray-100);
    cursor: pointer;
}

.menu-row-thumb.no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: default;
}

.menu-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.menu-row-thumb:hover img { transform: scale(1.08); }

.menu-row-info { flex: 1; min-width: 0; }

.menu-row-name {
    font-size: 0.87rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 6px;
}

.menu-row-badge {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    flex-shrink: 0;
}

.menu-row-desc {
    font-size: 0.73rem;
    color: var(--gray-500);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-row-price {
    font-size: 0.85rem;
    font-weight: 800;
    color: #4f46e5;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ── 말풍선 내 전화번호 링크 (탭하면 바로 통화) ── */
.message-bubble .tel-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #4f46e5;
    font-weight: 700;
    text-decoration: none;
    background: #EEF0FE;
    border-radius: 99px;
    padding: 2px 10px;
    white-space: nowrap;
}

.message-bubble .tel-link i { font-size: 0.78em; }
.message-bubble .tel-link:hover { background: #E2E5FD; }

/* ============================================================
   모바일 앱형 레이아웃 — 이중 스크롤 제거 · 키보드 대응 · 히어로 축소
   페이지 스크롤을 잠그고 [히어로|대화(유일한 스크롤)|입력바] 3단 고정.
   100dvh 는 키보드가 올라오면 자동으로 줄어 입력바가 키보드 위에 붙는다.
   ============================================================ */

@media (max-width: 768px) {
    html, body {
        height: 100vh;               /* 최후 폴백 */
        overflow: hidden;
    }
    @supports (height: 100svh) {
        /* svh = 브라우저 바가 펼쳐진 상태의 가시 영역 — 입력바가 URL바에 안 가림 */
        html, body { height: 100svh; }
    }
    html.vh-fallback, html.vh-fallback body {
        /* 1순위: visualViewport 실측값 (iOS URL바·키보드 실시간 대응) */
        height: var(--app-vh, 100vh);
    }

    body { display: flex; flex-direction: column; }

    .store-hero { flex-shrink: 0; }

    .main-container {
        flex: 1;
        min-height: 0;
        padding: 0;
        align-items: stretch;
    }
    .main-container .container { max-width: 100%; padding: 0; height: 100%; }
    .main-container .row { height: 100%; margin: 0; }
    #chatCol { padding: 0; height: 100%; }

    .chat-container {
        height: 100% !important;
        border-radius: 0;
        box-shadow: none;
    }

    .footer { display: none; }

    /* ── 대화 시작 후: 히어로 → 슬림 바 (사진 배경 유지) ── */
    body.chat-active .hero-inner {
        display: flex;
        align-items: center;
        gap: 10px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    body.chat-active .hero-topbar { order: 3; margin: 0 0 0 auto; }
    body.chat-active .hero-name {
        order: 1;
        font-size: 1.02rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
    body.chat-active .hero-meta { order: 2; margin: 0; flex-wrap: nowrap; }
    body.chat-active .hero-meta-item { display: none; }
    body.chat-active .hero-meta-item.is-open,
    body.chat-active .hero-meta-item.is-closed {
        display: inline;
        white-space: nowrap;
        font-size: 0.72rem;
    }
    body.chat-active .hero-tagline,
    body.chat-active .hero-chips,
    body.chat-active .store-hero .btn-feedback { display: none; }
    body.chat-active .btn-new-chat-corner.hero-btn { padding: 5px 10px; font-size: 0.76rem; }
}

/* 플레이스홀더는 옅은 회색으로 — 입력창임이 직관적으로 보이게 */
.chat-input::placeholder {
    color: var(--gray-400);
    opacity: 1;   /* 파이어폭스 기본 반투명 제거 */
}

/* ── 정보 카드 (조회형 원문 직송) ── */
.info-cards { margin-top: 10px; max-width: 480px; display: flex; flex-direction: column; gap: 10px; }

.info-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(30, 30, 80, 0.06);
    opacity: 0;
    transform: translateY(8px);
    animation: attachPop 0.4s ease forwards;
}

.info-card-head {
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--gray-900);
    background: #F6F5FE;
    border-bottom: 1px solid var(--gray-100);
}

.info-card-body {
    padding: 12px 14px;
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--gray-800);
}

/* ============================================================
   피드백 반영 — 스크롤바 가시화 · 영업 배지 · 새채팅 위치 · 휴무 강조
   ============================================================ */

/* 대화창 스크롤바: 두껍고 색 들어가게 (iOS는 시스템 오버레이라 제한적) */
.chat-messages { scrollbar-width: thin; scrollbar-color: #A5A1E8 transparent; }
.chat-messages::-webkit-scrollbar { width: 9px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #B9B4F0; border-radius: 99px; border: 2px solid #fff; }
.chat-messages::-webkit-scrollbar-thumb:hover { background: #8B86E0; }

/* 메뉴 캐러셀 넘김 바: 확실히 보이게 */
.menu-cards { scrollbar-width: thin; scrollbar-color: #A5A1E8 #EFEFF7; }
.menu-cards::-webkit-scrollbar { height: 8px; }
.menu-cards::-webkit-scrollbar-track { background: #EFEFF7; border-radius: 99px; }
.menu-cards::-webkit-scrollbar-thumb { background: #A5A1E8; border-radius: 99px; }
.menu-cards::-webkit-scrollbar-thumb:hover { background: #8B86E0; }

/* 휴무일 강조 (버건디) — 헛걸음 방지 */
.info-card-body .closed-day { color: #9F1239; font-weight: 800; }

/* ── 영업 상태 배지 (펄스 도트) ── */
.hero-name-row { display: flex; align-items: center; gap: 10px; min-width: 0; }

.hero-open-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
}

.pulse-dot { width: 8px; height: 8px; border-radius: 50%; position: relative; flex-shrink: 0; }
.hero-open-badge.is-open .pulse-dot { background: #4ADE80; }
.hero-open-badge.is-closed .pulse-dot { background: #F87171; }

.hero-open-badge.is-open .pulse-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #4ADE80;
    animation: dotPing 1.8s ease-out infinite;
}

@keyframes dotPing {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(2.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-open-badge .pulse-dot::after { animation: none; }
}

/* ── PC: 새 채팅을 입력바 우측으로, 히어로 버튼은 모바일 전용 ── */
.btn-new-chat-input {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid var(--gray-200);
    background: #fff;
    color: var(--gray-600);
    font-size: 16px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-base);
}

.btn-new-chat-input:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

@media (min-width: 769px) {
    .btn-new-chat-input { display: inline-flex; }
    .btn-new-chat-corner.hero-btn { display: none; }
    .hero-topbar { margin-bottom: 6px; min-height: 0; }
}

/* ── 모바일: 배지를 히어로 우상단에 크게 ── */
@media (max-width: 768px) {
    .hero-open-badge {
        position: absolute;
        top: 12px;
        right: 16px;
        z-index: 2;
        font-size: 0.8rem;
        padding: 6px 14px;
    }
    /* 슬림 바 모드: 배지는 가게명 옆으로 복귀 */
    body.chat-active .hero-name-row { order: 1; flex: 1; min-width: 0; }
    body.chat-active .hero-open-badge {
        position: static;
        font-size: 0.7rem;
        padding: 3px 10px;
    }
}

/* ── 태그라인 인용 스타일 — "손님들의 평"이라는 뉘앙스, 제목보다 한 톤 아래 ── */
.hero-tagline.is-quote {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.015em;
}

.hero-tagline.is-quote::before {
    content: "\275D";           /* ❝ */
    color: #FFD66B;             /* 별점과 같은 골드 — 포인트는 이 글리프 하나만 */
    font-size: 1.05rem;
    line-height: 1;
    transform: translateY(2px);
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .hero-tagline.is-quote { font-size: 0.78rem; gap: 6px; }
    .hero-tagline.is-quote::before { font-size: 0.95rem; }
}
