/* ============================================
   창업몰 AI - 프론트 CSS
   파일명: AI_css/front.css
   설명: 범사이언스 구글 스타일 기반, 창업몰 맞춤 디자인
   ============================================ */

/* --- CSS 변수 --- */
:root {
    --primary: #1F839C;           /* 창업몰 메인 컬러 (청록) */
    --primary-dark: #176a7f;
    --primary-light: #E8F4F8;
    --accent: #EF5050;            /* 강조색 (수익 등) */
    --secondary: #5F6368;
    --text-primary: #202124;
    --text-secondary: #5F6368;
    --text-light: #80868B;
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-hover: #F1F3F4;
    --border-color: #DFE1E5;
    --border-focus: #1F839C;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-hover: 0 2px 12px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 24px;
    --transition: all 0.2s ease;
    --max-width: 1000px;
}

/* --- 리셋 --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--bg-white);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

/* ============================================
   쿠키 동의 배너
   ============================================ */
.cookie-banner {
    position: relative;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    background: #202124;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.cookie-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cookie-text { font-size: 13px; line-height: 1.4; color: #E8EAED; flex: 1; }
.cookie-btns { display: flex; gap: 8px; flex-shrink: 0; }

.cookie-btn {
    padding: 6px 18px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Noto Sans KR', sans-serif;
}
.cookie-btn.accept { background: var(--primary); color: #fff; }
.cookie-btn.accept:hover { background: var(--primary-dark); }
.cookie-btn.decline { background: transparent; color: #9AA0A6; border: 1px solid #5F6368; }
.cookie-btn.decline:hover { background: #303134; color: #E8EAED; }

@media (max-width: 600px) {
    .cookie-inner { padding: 8px 16px; gap: 10px; }
    .cookie-text { font-size: 12px; }
    .cookie-btn { padding: 5px 12px; font-size: 12px; }
}

/* ============================================
   헤더
   ============================================ */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header-logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}
.header-logo img { height: 36px; width: auto; }
.header-logo .logo-svg { height: 30px; width: auto; }

/* 로고 이미지 없을때 텍스트 폴백 */
.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

/* 네비게이션 */
.header-nav { display: flex; align-items: center; gap: 4px; }

.header-nav a {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
}
.header-nav a:hover { background: var(--bg-hover); color: var(--text-primary); }
.header-nav a.active { color: var(--primary); background: rgba(31, 131, 156, 0.08); }

/* 로그인 버튼 */
.btn-login {
    background: var(--bg-light) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px !important;
    padding: 8px 20px !important;
}
.btn-login:hover { background: var(--bg-hover) !important; border-color: #ccc !important; }

/* 회원가입 버튼 */
.btn-signup {
    background: var(--primary) !important;
    color: white !important;
    border: 1px solid var(--primary) !important;
    border-radius: 20px !important;
    padding: 8px 20px !important;
}
.btn-signup:hover { background: var(--primary-dark) !important; border-color: var(--primary-dark) !important; }

/* 모바일 메뉴 토글 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary);
}

/* ============================================
   메인 페이지 (구글 스타일 AI 채팅)
   ============================================ */
.main-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    min-height: calc(100vh - 64px - 60px);
    position: relative;
    overflow: hidden;
}

/* ★ 배경 이미지 슬라이드쇼 */
.hero-bg-slideshow {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
}
.hero-bg-slide {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}
.hero-bg-slide.active { opacity: 1; }
/* 빛바랜 화이트 필터 (이미지 위에 반투명 흰색 오버레이) */
.hero-bg-filter {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.82);
    z-index: 1;
}
/* 히어로 내 콘텐츠를 필터 위로 올림 */
.main-hero > *:not(.hero-bg-slideshow) {
    position: relative;
    z-index: 2;
}
/* 세로 뷰(모바일 세로)에서 이미지 높이 우선 */
@media (orientation: portrait) {
    .hero-bg-slide {
        background-size: auto 100%;
        background-position: center center;
    }
}

.hero-logo { text-align: center; margin-bottom: 36px; }
.hero-logo img { height: 72px; width: auto; margin-bottom: 8px; }
.hero-logo .hero-subtitle {
    font-size: 18px;
    color: var(--text-light);
    letter-spacing: 1px;
    font-weight: 700;
}

/* 채팅 입력 영역 */
.chat-search-box { width: 100%; max-width: 810px; margin-bottom: 28px; }

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 6px 8px 6px 20px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}
.chat-input-wrapper:hover { box-shadow: var(--shadow-hover); }
.chat-input-wrapper:focus-within { box-shadow: var(--shadow-hover); border-color: var(--border-focus); }
.chat-input-wrapper .chat-icon { color: var(--primary); font-size: 20px; margin-right: 12px; flex-shrink: 0; }

#chatInput, #chatInputBottom {
    flex: 1;
    border: none;
    outline: none;
    font-size: 17px;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
    padding: 10px 0;
    min-width: 0;
}
#chatInput::placeholder, #chatInputBottom::placeholder { color: var(--text-light); }

/* 타이핑 애니메이션 오버레이 */
.input-typing-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}
.input-typing-wrap #chatInput,
.input-typing-wrap #chatInputBottom {
    width: 100%;
    position: relative;
    z-index: 2;
    background: transparent;
}
.typing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    font-size: 17px;
    font-family: inherit;
    color: var(--text-light);
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    padding: 10px 0;
}
.typing-inner {
    display: inline-block;
    white-space: nowrap;
    transition: transform 0.15s ease-out;
}
.typing-overlay b {
    font-weight: 700;
    color: #333;
}
.typing-cursor {
    color: var(--primary);
    font-weight: 300;
    margin-left: 1px;
    animation: cursorPulse 0.7s step-end infinite;
}
.typing-cursor.hide { animation: none; opacity: 0; }
@keyframes cursorPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.chat-send-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    font-size: 18px;
    margin-left: 8px;
}
.chat-send-btn:hover { background: var(--primary-dark); transform: scale(1.05); }
.chat-send-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; }

/* 음성 입력 마이크 버튼 */
.voice-btn {
    background: #F39C12;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    margin-left: 6px;
}
.voice-btn:hover { background: #E67E22; transform: scale(1.05); }
.voice-btn.recording {
    background: #E74C3C;
    animation: voicePulse 1.2s ease-in-out infinite;
}
@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.4); }
    50% { box-shadow: 0 0 0 10px rgba(231,76,60,0); }
}

/* 음성 인식 오버레이 */
.voice-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.voice-overlay-content {
    background: #fff;
    border-radius: 20px;
    padding: 36px 48px;
    text-align: center;
    min-width: 300px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
/* 음성 파형 애니메이션 */
.voice-wave-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 50px;
    margin-bottom: 16px;
}
.voice-wave-bar {
    width: 6px;
    height: 10px;
    background: #F39C12;
    border-radius: 3px;
    animation: voiceWave 0.8s ease-in-out infinite;
}
.voice-wave-bar:nth-child(1) { animation-delay: 0s; }
.voice-wave-bar:nth-child(2) { animation-delay: 0.15s; }
.voice-wave-bar:nth-child(3) { animation-delay: 0.3s; }
.voice-wave-bar:nth-child(4) { animation-delay: 0.45s; }
.voice-wave-bar:nth-child(5) { animation-delay: 0.6s; }
@keyframes voiceWave {
    0%, 100% { height: 10px; opacity: 0.5; }
    50% { height: 40px; opacity: 1; }
}
.voice-status {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}
.voice-preview {
    font-size: 16px;
    color: var(--primary);
    font-weight: 600;
    min-height: 24px;
    margin-bottom: 20px;
    word-break: keep-all;
}
.voice-stop-btn {
    background: #eee;
    border: none;
    border-radius: 12px;
    padding: 10px 32px;
    font-size: 15px;
    color: #666;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.voice-stop-btn:hover { background: #ddd; color: #333; }
.voice-countdown {
    display: inline-block;
    color: #E74C3C;
    font-size: 22px;
    font-weight: 800;
    min-width: 20px;
    text-align: center;
}
.voice-cancel-hint {
    font-size: 15px;
    color: #999;
    margin-bottom: 16px;
}

/* 추천 질문 카드 */

/* ★ 모바일 세로 전용 카드형 매물 리스트 */
.ai-cards-mobile { display: none; }
.item-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.item-card:active { box-shadow: 0 2px 12px rgba(0,0,0,0.12); }
.item-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}
.item-card-num {
    background: #F39C12;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    min-width: 30px;
    height: 26px;
    padding: 0 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.item-card-kind {
    background: #E74C3C;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    white-space: nowrap;
}
.item-card-detail {
    margin-left: auto;
    background: var(--primary);
    color: #fff !important;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 14px;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
}
.item-card-photo {
    width: 100%;
    max-height: 180px;
    overflow: hidden;
}
.item-card-photo img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.item-card-info {
    padding: 12px;
}
.item-card-region {
    font-size: 13px;
    color: #999;
    margin-bottom: 4px;
}
.item-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.item-card-prices {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: #555;
}
/* ★ 카드 담당자 정보 영역 (구분선 + 한줄 배치) */
.item-card-manager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    color: #555;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}
.item-card-mgr-name {
    font-weight: 600;
    color: #333;
}
/* ★ 담당자행 전화번호 링크 */
.item-card-mgr-phone {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
/* ★ 카드 전화연결 버튼 (인라인, 담당자 우측, 👆 아이콘 포함) */
.item-card-call-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;
    background: #43a047;
    color: #fff !important;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
}
.item-card-call-btn:active {
    background: #388e3c;
}

/* ★ 모바일 세로(portrait)에서만: 테이블→카드 전환 */
@media (max-width: 768px) and (orientation: portrait) {
    .ai-table-desktop { display: none !important; }
    .ai-cards-mobile { display: block !important; }
    .main-hero { padding: 0 12px; }
}
.suggest-cards { display: grid; grid-template-columns: repeat(2, auto); gap: 24px; justify-content: center; max-width: 910px; }

.suggest-card {
    padding: 10px 18px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 15px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-weight: 700;
}
.suggest-card:hover { background: var(--bg-hover); border-color: var(--primary); color: var(--primary); }

/* ============================================
   채팅 대화창 (AI 결과 표시)
   ============================================ */
.chat-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 24px 20px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.chat-messages { display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px; }

.chat-message { display: flex; gap: 12px; animation: fadeIn 0.3s ease; }

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

.chat-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
}
.chat-avatar.user-avatar { background: var(--primary); color: white; }
.chat-avatar.ai-avatar { background: var(--primary-light); color: var(--primary); }

/* TTS 스피커 버튼 (AI 아바타 아래 세로 배치) */
.ai-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    gap: 4px;
}
.tts-float-btn {
    background: #F39C12;
    border: none;
    cursor: pointer;
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0.7;
}
.tts-float-btn:hover { opacity: 1; transform: scale(1.1); }
.tts-float-btn.tts-playing {
    opacity: 1;
    background: #E74C3C;
    animation: ttsPulse 1s ease-in-out infinite;
}
.tts-float-btn.tts-nudge {
    opacity: 1;
    animation: ttsNudge 0.5s ease-in-out 5;
}
@keyframes ttsPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
@keyframes ttsNudge {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
}
/* TTS 미지원 브라우저에서 스피커 버튼 숨김 */
.no-tts .tts-float-btn { display: none !important; }

.chat-bubble { flex: 1; line-height: 1.7; font-size: 15px; }
.chat-bubble.user-bubble { background: var(--bg-light); padding: 12px 16px; border-radius: 12px 12px 12px 4px; font-size: 17px; }
.chat-bubble.ai-bubble { padding: 4px 0; color: var(--text-primary); }
.chat-bubble.ai-bubble .chat-para { margin-bottom: 8px; }
.chat-bubble.ai-bubble .chat-para:last-child { margin-bottom: 0; }
.chat-bubble.ai-bubble .chat-para:empty { display: none; }

/* 단건 분석 매물 사진 */
.direct-photos {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}
/* 4장일 때 2x2 그리드 레이아웃 */
.direct-photos.grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 260px 260px;
    gap: 8px;
    margin: 12px 0;
}
.direct-photo-item {
    flex: 1;
    height: 260px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}
/* 2x2 그리드 내 아이템은 flex 해제 (grid가 높이 제어) */
.direct-photos.grid-2x2 .direct-photo-item {
    flex: none;
    height: 100%;
}
.direct-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* 사진 1장일 때 가로폭을 테이블의 절반 정도로 제한 */
.direct-photo-item:only-child {
    flex: none;
    max-width: 50%;
}
.direct-photo-empty {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
}

/* 단건 분석 면책 안내 박스 */
.ai-disclaimer-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0 12px;
    padding: 14px 16px;
    background: #FFF8E1;
    border: 1px solid #FFD54F;
    border-left: 4px solid #FF9800;
    border-radius: 8px;
    font-size: 15.5px;
    line-height: 1.65;
    color: #5D4037;
}
.ai-disclaimer-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}
.ai-disclaimer-text {
    flex: 1;
}
.ai-disclaimer-text strong {
    color: #E65100;
}

/* AI 응답 내 테이블 스타일 */
.ai-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    table-layout: fixed;
}
/* 7컬럼 너비 배분: 번호, 사진, 매물명, 지역, 권리금/총창업비용, 월수익, AI분석 */
.ai-table th:nth-child(1),
.ai-table td:nth-child(1) { width: 5%; }
.ai-table th:nth-child(2),
.ai-table td:nth-child(2) { width: 14%; }
.ai-table th:nth-child(3),
.ai-table td:nth-child(3) { width: 28%; }
.ai-table th:nth-child(4),
.ai-table td:nth-child(4) { width: 10%; }
.ai-table th:nth-child(5),
.ai-table td:nth-child(5) { width: 14%; }
.ai-table th:nth-child(6),
.ai-table td:nth-child(6) { width: 11%; }
.ai-table th:nth-child(7),
.ai-table td:nth-child(7) { width: 10%; }
.ai-table th {
    background: var(--primary);
    color: #fff;
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.2);
    word-break: keep-all;
}
.ai-table td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #eee;
    background: #fff;
    word-break: keep-all;
}
/* 금액 컬럼 우측 정렬 (5:권리금/총창업비, 6:월수익) */
.ai-table td:nth-child(5),
.ai-table td:nth-child(6) { text-align: right; }
/* 사진 셀 스타일 */
.ai-table td.pic-cell { padding: 4px; text-align: center; }
.tbl-thumb {
    width: 100%;
    max-height: 86px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}
/* 테이블 셀 안의 매물 링크 스타일 */
.ai-table td a {
    display: inline;
    text-decoration: none;
}
.ai-table td a span {
    margin-left: 0 !important;
}
/* 매물 링크가 있는 셀: 매물명 위, 상세보기 아래 */
.ai-table td.product-cell {
    text-align: left;
    cursor: pointer;
    overflow: hidden;
}
.ai-table td.product-cell a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    color: var(--primary);
    font-weight: 600;
}
.ai-table td.product-cell a br { display: none; }
.ai-table td.product-cell a span {
    font-size: 11px !important;
    white-space: nowrap;
}
/* 매물 링크 배지 (텍스트 내 인라인) */
.product-link-badge {
    font-size: 12px;
    background: var(--primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 4px;
}

/* 매물 행 호버 효과 */
.ai-table tr.clickable-row { cursor: pointer; }
.ai-table tr.clickable-row:hover td { background: #E8F4F8 !important; }
.ai-table tr:nth-child(even) td {
    background: #f8fffe;
}
.ai-table tr:hover td {
    background: var(--primary-light);
}
/* AI분석 버튼 (테이블 마지막 컬럼) */
.ai-analyze-cell { text-align: center; }
.btn-ai-analyze {
    padding: 4px 10px;
    background: #FF6B35;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}
.btn-ai-analyze:hover { background: #E55A2B; }

/* 테이블 페이징 바 */
.pager-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
}
.pager-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.pager-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pager-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}
.pager-num:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}
.pager-num.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 채팅창 하단 고정 */
.chat-input-fixed {
    background: var(--bg-white);
    padding: 8px 16px 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}
.chat-input-fixed .chat-input-wrapper { width: 100%; max-width: 810px; }

/* 로딩 스테퍼 */
.status-stepper { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--text-light);
    opacity: 0.4;
    transition: all 0.4s ease;
}
.step-item.active { color: var(--primary); opacity: 1; font-weight: 500; }
.step-item.done { color: #16A34A; opacity: 0.65; }
.step-item.done .step-icon::after { content: ' \2713'; font-size: 12px; }
.step-item .step-icon { font-size: 17px; flex-shrink: 0; width: 24px; text-align: center; }
.step-item .step-text { line-height: 1.4; }
.step-item .dots { display: inline-block; min-width: 18px; text-align: left; font-weight: 700; letter-spacing: 1px; }

/* ============================================
   페이지 공통 컨테이너
   ============================================ */
.page-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 24px;
    flex: 1;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

/* ============================================
   창업상품 검색 필터
   ============================================ */
.search-filter-box {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}
.filter-row:last-child { margin-bottom: 0; }

.filter-row select,
.filter-row input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-primary);
    transition: var(--transition);
}
.filter-row select:focus,
.filter-row input[type="text"]:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(31, 131, 156, 0.1);
}

.filter-row .btn-search {
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}
.filter-row .btn-search:hover { background: var(--primary-dark); }

/* 검색/초기화 버튼 그룹 (4번째 칸 반반) */
.filter-btn-group {
    display: flex;
    gap: 6px;
}
.filter-btn-group .btn-search,
.filter-btn-group .btn-reset {
    flex: 1;
    padding: 10px 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}
.filter-btn-group .btn-search {
    background: var(--primary);
    color: white;
    border: none;
}
.filter-btn-group .btn-search:hover { background: var(--primary-dark); }
.filter-btn-group .btn-reset {
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.filter-btn-group .btn-reset:hover { background: var(--bg-hover); color: var(--text-primary); }

/* 검색결과 표시 */
.search-result-bar {
    background: #E5E5E5;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}
.search-result-bar .result-label { font-weight: 700; color: var(--primary); }
.search-result-bar .result-keyword {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 8px;
}

/* ============================================
   창업상품 목록 카드
   ============================================ */
.product-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.product-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
/* 행 여백 순차 호버 시 카드 효과 */
.product-card.row-hover-active {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.product-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); color: inherit; }

/* 카드 이미지 영역 */
.product-card-img {
    width: 100%;
    aspect-ratio: 3 / 2;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
/* 카드 슬라이드 로테이션용 이미지 */
.product-card-img .card-img-current,
.product-card-img .card-img-next {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-card-img .card-img-next { display: none; }
/* 오른쪽→왼쪽 슬라이드 애니메이션 */
@keyframes slideOutLeft {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
.card-slide-out {
    animation: slideOutLeft 0.5s ease-in-out forwards;
}
.card-slide-in {
    display: block !important;
    animation: slideInRight 0.5s ease-in-out forwards;
}
.product-card-img .no-img { font-size: 48px; color: var(--text-light); }

/* 업종 배지 (이미지 위에 표시) */
.product-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 3px 10px;
    background: rgba(31, 131, 156, 0.9);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* 카드 본문 */
.product-card-body { padding: 16px; }

.product-card-location {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.product-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 가격 영역 */
.product-card-prices {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-card-cost {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.product-card-profit {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

/* 문의 버튼 (카드 하단) */
.product-card-inquiry {
    display: block;
    text-align: center;
    padding: 12px;
    background: var(--primary);
    color: white !important;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
}
.product-card-inquiry:hover { background: var(--primary-dark); color: white; }

/* ============================================
   창업상품 상세
   ============================================ */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    align-items: start;
}

/* 이미지 슬라이더 영역 */
.product-detail-img {
    background: var(--bg-light);
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-detail-img img { width: 100%; height: 100%; object-fit: cover; }
/* 썸네일 호버 시 줌아웃 애니메이션 (scale 1.1 → 1.0) */
@keyframes zoomOut {
    from { transform: scale(1.1); }
    to   { transform: scale(1.0); }
}
.product-detail-img img.zoom-in-effect {
    animation: zoomOut 0.4s ease-out forwards;
}
.product-detail-img .no-img { font-size: 100px; color: var(--text-light); }

/* 썸네일 리스트 - 메인 이미지 가로폭에 맞게 4등분 */
.product-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
}
.product-thumbs img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}
.product-thumbs img:hover,
.product-thumbs img.active { border-color: var(--primary); }

/* 상세 정보 */
.product-detail-info { padding: 0; }

.product-detail-badge {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--primary);
    border-radius: 5px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.product-detail-location {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.product-detail-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.3;
}

/* 가격/수익 정보 테이블 */
.detail-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.detail-info-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}
.detail-info-table .info-label {
    color: var(--text-light);
    width: 35%;
}
.detail-info-table .info-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}
.detail-info-table .info-value.price-highlight {
    color: var(--primary);
    font-size: 18px;
}
.detail-info-table .info-value.profit-highlight {
    color: var(--accent);
    font-size: 18px;
}

/* 파란 진한 구분선 (매출 및 지출내역 테이블) */
.detail-info-table tr.info-divider-top td {
    border-top: 2px solid var(--primary);
}
.detail-info-table tr.info-divider-bottom td {
    border-bottom: 2px solid var(--primary);
}

/* 사업체 소개 섹션 */
.detail-section {
    margin-bottom: 32px;
}
.detail-section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
}
.detail-section-content {
    font-size: 15px;
    line-height: 1.0;
    color: var(--text-secondary);
    white-space: pre-line;
}

/* 담당자 카드 */
.consultant-card {
    display: flex;
    gap: 20px;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin: 32px 0;
}
.consultant-card img {
    width: 130px;
    height: auto;
    border-radius: var(--radius);
    object-fit: cover;
    border: 3px solid var(--bg-light);
    box-shadow: var(--shadow-sm);
}
.consultant-info { flex: 1; }
.consultant-info .consultant-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.consultant-info .consultant-job { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.consultant-info .consultant-phone {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

/* 문의 버튼 */
/* 상단 정보영역 내 담당자 미니 카드 */
.detail-consultant-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}
.detail-consultant-mini img {
    width: 74px;
    height: auto;
    border-radius: var(--radius);
    object-fit: cover;
    border: 2px solid var(--bg-light);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}
.detail-consultant-info {
    flex: 1;
    min-width: 0;
}
.detail-consultant-info .consultant-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}
.detail-consultant-info .consultant-phone {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}
.detail-consultant-info .consultant-phone a {
    color: var(--primary);
    text-decoration: none;
}
.detail-consultant-btns {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.btn-inquiry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-inquiry:hover { background: var(--primary-dark); color: white; }
.btn-sms {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: #43a047;
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-sms:hover { background: #2e7d32; color: white; }

/* 유의사항 박스 */
.notice-box {
    background: #FFF8E1;
    border: 1px solid #FFE082;
    border-radius: var(--radius);
    padding: 16px 20px;
    font-size: 13px;
    line-height: 1.6;
    color: #795548;
    margin-top: 24px;
}

/* ============================================
   로그인 / 회원가입 폼
   ============================================ */
.auth-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 48px 40px;
}
.auth-box h2 { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.auth-box .auth-desc { text-align: center; color: var(--text-secondary); font-size: 14px; margin-bottom: 32px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-white);
    color: var(--text-primary);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(31, 131, 156, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-submit:hover { background: var(--primary-dark); }

.auth-link { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-secondary); }
.auth-link a { font-weight: 600; }

/* ============================================
   푸터
   ============================================ */
.site-footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 20px 24px;
    font-size: 13px;
    color: var(--text-light);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.footer-text { color: var(--text-light); }

.footer-admin-link {
    font-size: 12px;
    color: #9AA0A6;
    border: 1px solid #DFE1E5;
    padding: 4px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.footer-admin-link:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

/* ============================================
   페이징
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 32px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}
.pagination a:hover { background: var(--bg-hover); }
.pagination .active { background: var(--primary); color: white; font-weight: 600; }

/* ============================================
   알림 메시지
   ============================================ */
.alert { padding: 12px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #FEE2E2; color: #DC2626; border: 1px solid #FECACA; }
.alert-success { background: #DCFCE7; color: #16A34A; border: 1px solid #BBF7D0; }

/* ============================================
   반응형
   ============================================ */
@media (max-width: 1024px) {
    .product-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    /* PC 전용 줄바꿈 모바일에서 숨김 */
    br.pc-br { display: none; }
    /* 상세보기 버튼 모바일에서 줄바꿈 */
    .product-link-badge { display: block; margin-left: 0; margin-top: 4px; width: fit-content; }
    .header-logo .logo-svg { height: 24px; }
    .mobile-menu-btn { display: block; }

    .header-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0; right: 0;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 12px;
        box-shadow: var(--shadow-md);
    }
    .header-nav.open { display: flex; }
    .header-nav a { padding: 12px 16px; }

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

    .product-detail { grid-template-columns: 1fr; gap: 20px; }
    .product-detail-img { aspect-ratio: 4 / 3; }
    .product-detail-name { font-size: 20px; }

    .hero-logo img { height: 56px; }
    .auth-box { padding: 32px 24px; }

    .filter-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .filter-row select, .filter-row input[type="text"] { width: 100%; }
    .filter-btn-group { width: 100%; }

/* 담당자 소개 카드 */
.manager-card {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    margin: 12px 0;
    overflow: hidden;
}
.manager-card-header {
    background: var(--primary, #1F839C);
    color: #fff;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 15px;
}
.manager-card-body { padding: 14px 16px; }
.manager-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e0f2fe;
}
.manager-row:last-child { border-bottom: none; }
.manager-label {
    font-weight: 700;
    color: var(--primary, #1F839C);
    min-width: 70px;
    font-size: 14px;
}
.manager-value {
    flex: 1;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.manager-phone {
    color: var(--primary, #1F839C);
    text-decoration: none;
    font-weight: 600;
}
/* 담당자 매물 페이징 */
.manager-table-wrap { margin-top: 12px; }
.mgr-paging {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 14px 0 4px;
}
.mgr-page-btn {
    background: var(--primary, #1F839C);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
}
.mgr-page-btn:hover { opacity: 0.85; }
.mgr-page-info {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

    .consultant-card { flex-direction: row; text-align: left; flex-wrap: wrap; }
}

@media (max-width: 700px) {
    .suggest-cards { grid-template-columns: 1fr; align-items: center; }
}

@media (max-width: 480px) {
    .product-row { grid-template-columns: 1fr; }
    .hero-logo img { height: 48px; }
    .chat-input-wrapper { padding: 4px 6px 4px 14px; }
    /* ★ 모바일 가격 가로 1줄 + 폰트 20% 확대 */
    .product-card-prices {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }
    .product-card-cost,
    .product-card-profit {
        font-size: 17px;
    }
    /* ★ 모바일 지역 + 매물번호 좌우 대칭 */
    .product-card-location {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .product-card-jid {
        font-size: 15px;
        color: var(--text-light);
        font-weight: 600;
    }
}

/* ============================================
   ★ 모바일 detail 페이지 가로 오버플로 수정
   - 콘텐츠가 뷰포트를 벗어나지 않도록 제한
   - 폰트/여백 조정으로 가독성 향상
   ============================================ */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

@media (max-width: 768px) {
    /* ★ 페이지 컨테이너: 모바일 여백 축소 */
    .page-container {
        padding: 20px 16px;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* ★ 상세 이미지: 뷰포트 내 제한 */
    .product-detail-img {
        max-width: 100%;
    }
    .product-detail-img img {
        max-width: 100%;
        height: auto;
    }

    /* ★ 썸네일: 모바일에서 간격 축소 */
    .product-thumbs {
        gap: 4px;
        margin-top: 8px;
    }

    /* ★ 매물 제목: 모바일 폰트 조정 */
    .product-detail-name {
        font-size: 18px;
        word-break: keep-all;
        overflow-wrap: break-word;
    }

    /* ★ 매물번호: 모바일 폰트 조정 */
    .product-detail-info h3,
    .product-detail-info [style*="font-size"] {
        font-size: 16px !important;
    }

    /* ★ 정보 테이블: 가로 오버플로 방지 */
    .detail-info-table {
        width: 100%;
        table-layout: fixed;
    }
    .detail-info-table td {
        padding: 10px 12px;
        font-size: 14px;
        word-break: keep-all;
        overflow-wrap: break-word;
    }
    .detail-info-table .info-value.price-highlight,
    .detail-info-table .info-value.profit-highlight {
        font-size: 16px;
    }

    /* ★ 섹션 콘텐츠: 긴 텍스트 줄바꿈 */
    .detail-section-content {
        word-break: keep-all;
        overflow-wrap: break-word;
        font-size: 14px;
        line-height: 1.4;
        white-space: normal;
    }

    /* ★ 담당자 미니 카드 (상단): 가로 배치 유지, 사진 크게 */
    .detail-consultant-mini {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 12px;
        padding: 14px 16px;
    }
    .detail-consultant-mini img {
        width: 80px;
        height: auto;
    }
    .detail-consultant-btns {
        flex-direction: column;
        flex-shrink: 0;
        gap: 6px;
    }
    .detail-consultant-btns a {
        text-align: center;
    }

    /* ★ 담당자 카드 (하단): 가로 배치 유지, 사진 크게 */
    .consultant-card {
        flex-direction: row;
        text-align: left;
        padding: 16px;
        gap: 12px;
        align-items: center;
    }
    .consultant-card img {
        width: 80px;
        height: auto;
        flex-shrink: 0;
    }

    /* ★ 매장 사진 그리드: 모바일 1열 */
    .detail-section div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* ★ 유튜브 영상: 오버플로 방지 */
    .detail-section div[style*="padding-bottom"] {
        max-width: 100%;
    }
    .detail-section iframe {
        max-width: 100%;
    }

    /* ★ 유의사항: 모바일 폰트 */
    .notice-box {
        font-size: 12px;
        padding: 14px;
        word-break: keep-all;
    }
}

/* ★ 모바일 AI분석 사진 갤러리 (detail.asp 스타일) */
.direct-gallery-mobile {
    display: none;
    margin: 12px 0;
}
.direct-gallery-main {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #f5f5f5;
}
.direct-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.direct-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
}
.direct-gallery-thumbs img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
}
.direct-gallery-thumbs img.active {
    border-color: var(--primary);
}

/* ★ 모바일 세로에서: PC사진 숨기고 갤러리 표시 */
@media (max-width: 768px) and (orientation: portrait) {
    .direct-photos-pc { display: none !important; }
    .direct-gallery-mobile { display: block !important; }
}

/* ★ AI분석 채팅 내 담당자 카드 (detail.asp 테이블 스타일) */
.chat-consultant-card {
    margin: 16px 0 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-light);
}
.chat-consultant-table {
    width: 100%;
    border-collapse: collapse;
}
.chat-consultant-table td {
    padding: 10px;
    vertical-align: middle;
}
.chat-con-photo {
    width: 96px;
    padding: 12px !important;
}
.chat-con-photo img {
    width: 80px;
    height: auto;
    border-radius: var(--radius);
    object-fit: cover;
    display: block;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
}
.chat-con-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    padding-bottom: 2px !important;
}
.chat-con-phone {
    padding-top: 0 !important;
}
.chat-con-phone a {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.chat-con-btn {
    width: 80px;
    text-align: center;
    padding: 8px !important;
}
.chat-con-btn a {
    display: block;
    padding: 8px 4px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    margin-bottom: 4px;
}
.chat-con-btn a:last-child {
    margin-bottom: 0;
}
.chat-con-call {
    background: var(--primary);
    color: #fff !important;
}
.chat-con-sms {
    background: #43a047;
    color: #fff !important;
}

#chatSection {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}