/* ========================================================
   다올 (Daol.me) - 모바일 반응형 및 앱 웹뷰 패키징 스타일
   ======================================================== */

@media (max-width: 992px) {
    /* 데스크톱/모바일 요소 분기 */
    .desktop-only,
    .mobile-hide {
        display: none !important;
    }
    .mobile-only {
        display: inline-flex !important;
    }

    /* 모바일 헤더: 텍스트 요소가 넘치거나 깨지지 않도록 컴팩트 & 아이콘 중심 레이아웃 */
    .main-header {
        padding: 0 12px;
        height: 52px;
        gap: 6px;
    }

    .header-left {
        gap: 6px;
        min-width: 0;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
    }

    .sidebar-toggle-btn {
        width: 34px;
        height: 34px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .brand-logo {
        font-size: 16px;
        gap: 5px;
        white-space: nowrap;
    }

    .brand-logo-img {
        width: 24px;
        height: 24px;
    }

    .brand-subtext {
        display: none !important; /* 모바일에서 서비스 영문명(Daol.me) 숨김 */
    }

    .header-right {
        gap: 5px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }

    /* 햄버거 메뉴(사이드바) 내로 이동된 요소들 헤더에서 숨김 */
    .header-saju-btn,
    .pwa-chip-btn,
    .header-divider,
    .header-icon-circle-btn,
    .header-logout-link,
    .header-admin-link {
        display: none !important;
    }

    /* 질문 잔여 크레딧 뱃지 컴팩트화 및 터치 영역 확보 */
    .credit-badge-wrapper {
        height: 32px !important;
        padding: 0 9px !important;
        gap: 4px !important;
        border-radius: 16px !important;
        background: #FFFFFF !important;
        border: 1px solid rgba(38, 68, 120, 0.25) !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
        display: inline-flex !important;
        align-items: center !important;
    }

    .credit-icon {
        font-size: 12px;
        display: inline-block;
    }

    .credit-label {
        display: none !important; /* '질문 잔여' 텍스트 생략 */
    }

    .credit-count {
        font-size: 12px;
        font-weight: 700;
        color: #264478 !important;
    }

    .charge-btn {
        font-size: 10px !important;
        padding: 2px 6px !important;
        border-radius: 999px !important;
        height: 20px !important;
        line-height: 1 !important;
    }

    /* 헤더 로그인 버튼 터치 최적화 (최소 32px 보장 및 터치 피드백) */
    .header-login-btn {
        height: 32px !important;
        padding: 0 10px !important;
        font-size: 12px !important;
        border-radius: 16px !important;
        gap: 4px !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .header-login-btn:active {
        transform: scale(0.96);
    }

    .header-login-btn svg {
        width: 13px !important;
        height: 13px !important;
    }

    /* 마이페이지 링크 컴팩트화 */
    .header-mypage-link {
        height: 32px !important;
        padding: 0 10px !important;
        font-size: 12px !important;
        border-radius: 16px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    /* 사이드바는 모바일에서 화면 전체 높이 오버레이 드로어로 동작 */
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 300px;
        max-width: 84vw;
        height: 100vh;
        background: #FFFFFF;
        z-index: 10000;
        transform: translateX(-100%);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.25);
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* 모바일 오버레이 배경 */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 9999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.24s ease;
    }

    .sidebar-overlay.active {
        display: block !important;
        opacity: 1;
        pointer-events: auto;
    }

    /* 사이드바 모바일 상단 바 */
    .sidebar-mobile-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 16px 16px 12px;
        border-bottom: 1px solid #EDF2F7;
        flex-shrink: 0;
    }

    .sidebar-mobile-brand {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .sidebar-brand-img {
        width: 24px;
        height: 24px;
        object-fit: contain;
    }

    .sidebar-brand-title {
        font-size: 15.5px;
        font-weight: 800;
        color: #264478;
    }

    .sidebar-close-btn {
        width: 32px;
        height: 32px;
        border: none;
        background: #F1F5F9;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #475569;
        transition: all 0.15s;
    }

    .sidebar-close-btn:hover {
        background: #E2E8F0;
        color: #0F172A;
    }

    /* 모바일 사용자/운세 컨트롤 카드 */
    .sidebar-mobile-user-card {
        display: block !important;
        margin: 12px 14px 10px;
        padding: 13px;
        background: #F8FAFC;
        border: 1px solid #E2E8F0;
        border-radius: 16px;
        flex-shrink: 0;
    }

    .sm-user-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 11px;
    }

    .sm-user-meta {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .sm-avatar-icon {
        font-size: 18px;
        flex-shrink: 0;
    }

    .sm-avatar-circle {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #264478;
        color: #FFFFFF;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12.5px;
        font-weight: 700;
        flex-shrink: 0;
    }

    .sm-user-text-wrap {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .sm-user-badge-tag {
        font-size: 12px;
        font-weight: 700;
        color: #264478;
    }

    .sm-user-name {
        font-size: 13px;
        font-weight: 700;
        color: #1E293B;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sm-user-sub {
        font-size: 10.5px;
        color: #64748B;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sm-login-action-btn {
        background: #17181C !important;
        color: #FFFFFF !important;
        border: none;
        padding: 5px 12px;
        font-size: 11.5px;
        font-weight: 700;
        border-radius: 14px;
        cursor: pointer;
        flex-shrink: 0;
        box-shadow: 0 2px 6px rgba(23, 24, 28, 0.25);
    }

    .sm-member-btn-group {
        display: flex;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
    }

    .sm-pill-btn {
        padding: 4px 9px;
        font-size: 11px;
        font-weight: 600;
        border-radius: 12px;
        text-decoration: none;
        background: #FFFFFF;
        border: 1px solid #CBD5E1;
        color: #334155;
    }

    .sm-pill-btn.logout {
        color: #EF4444;
        border-color: #FCA5A5;
    }

    /* 사주 명식 카드 행 */
    .sm-saju-card-btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 9px 12px;
        background: #FFFFFF;
        border: 1.5px solid #264478;
        border-radius: 12px;
        cursor: pointer;
        text-align: left;
        margin-bottom: 7px;
        box-shadow: 0 2px 5px rgba(38, 68, 120, 0.06);
        transition: all 0.15s;
    }

    .sm-saju-left {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .sm-saju-icon {
        font-size: 15px;
        flex-shrink: 0;
    }

    .sm-saju-text {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .sm-saju-title {
        font-size: 12px;
        font-weight: 700;
        color: #264478;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sm-saju-title.need-reg {
        color: #DC2626;
    }

    .sm-saju-desc {
        font-size: 10.5px;
        color: #64748B;
        margin-top: 1px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sm-chevron {
        font-size: 12px;
        font-weight: 700;
        color: #264478;
        flex-shrink: 0;
    }

    /* 크레딧 잔여 바 */
    .sm-credit-card-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 12px;
        background: #FFFFFF;
        border: 1px solid #E2E8F0;
        border-radius: 12px;
        margin-bottom: 7px;
    }

    .sm-credit-left {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 11.5px;
        color: #475569;
        cursor: pointer;
    }

    .sm-credit-icon {
        font-size: 12px;
    }

    .sm-credit-val {
        font-weight: 800;
        color: #264478;
        font-size: 12.5px;
    }

    .sm-charge-action-btn {
        background: linear-gradient(135deg, #375E9E, #264478);
        color: #FFFFFF !important;
        border: none;
        padding: 4px 10px;
        font-size: 10.5px;
        font-weight: 700;
        border-radius: 12px;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(38, 68, 120, 0.2);
    }

    /* 유틸리티 바 (앱 설치 & 공유) */
    .sm-utils-bar {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .sm-util-btn {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 6px 10px;
        background: #FFFFFF;
        border: 1px solid #CBD5E1;
        border-radius: 10px;
        font-size: 11px;
        font-weight: 600;
        color: #334155;
        cursor: pointer;
        text-decoration: none;
        transition: all 0.15s;
    }

    .sm-util-btn:hover {
        border-color: #264478;
        color: #264478;
        background: #EDF3FA;
    }

    .sm-util-btn.admin {
        flex: none;
        color: #6366F1;
        border-color: #C7D2FE;
    }

    /* 상단 카테고리 칩 내비게이션 바 (모바일 가로 스크롤 및 컴팩트화) */
    .category-nav-bar {
        padding: 8px 12px !important;
        gap: 6px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
    .category-nav-bar::-webkit-scrollbar {
        display: none !important;
    }
    .category-chip {
        padding: 6px 12px !important;
        font-size: 12.5px !important;
        border-radius: 999px !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
    }

    /* 웰컴 인트로 카드 (모바일 뷰) */
    .welcome-intro-card {
        padding: 16px 14px !important;
        margin-bottom: 12px !important;
        border-radius: 16px !important;
    }
    .welcome-title {
        font-size: 15.5px !important;
        line-height: 1.4 !important;
        word-break: keep-all !important;
    }
    .welcome-desc {
        font-size: 12px !important;
        line-height: 1.55 !important;
        word-break: keep-all !important;
    }
    .saju-status-pill {
        font-size: 11.5px !important;
        padding: 7px 12px !important;
        word-break: keep-all !important;
        line-height: 1.4 !important;
    }
    .engine-interactive-bar {
        gap: 6px !important;
    }
    .tool-action-pill {
        font-size: 11.5px !important;
        padding: 6px 11px !important;
        width: 100% !important;
        justify-content: center !important;
        border-radius: 10px !important;
    }

    /* 타로 카드 플로우 카드 (모바일) */
    .tarot-flow-card {
        padding: 14px 12px !important;
        border-radius: 16px !important;
    }
    .tarot-spread-tabs {
        grid-template-columns: 1fr !important;
        gap: 7px !important;
    }
    .tarot-spread-tab {
        padding: 10px 12px !important;
    }
    .tarot-suggestions-bar {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding-bottom: 4px !important;
    }
    .tarot-suggestions-bar::-webkit-scrollbar {
        display: none !important;
    }
    .tarot-suggestion-chip {
        font-size: 11.5px !important;
        padding: 5px 10px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* 대화 영역 (모바일) */
    .app-container {
        flex: 1 !important;
        min-height: 0 !important;
        height: auto !important;
    }

    body.chat-active .app-container {
        height: calc(100vh - 52px) !important;
        height: calc(100dvh - 52px) !important;
    }

    .chat-scroll-area {
        padding: 10px 10px 16px 10px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .message-content-wrapper {
        max-width: 86% !important;
    }

    .message-content-wrapper.ai-wrapper {
        max-width: 92% !important;
    }

    .message-bubble {
        max-width: 100% !important;
        font-size: 14.5px !important;
        padding: 11px 14px !important;
        line-height: 1.68 !important;
        word-break: break-word !important;
    }

    .stream-flow-line {
        font-size: 14.5px !important;
        line-height: 1.75 !important;
    }

    .message-row.ai .message-bubble.ai-analyzing-card {
        min-width: 0 !important;
        width: 100% !important;
        padding: 13px 15px !important;
    }

    .analyzing-status-text {
        font-size: 12.5px !important;
    }

    .stream-status-badge {
        font-size: 11.5px !important;
        padding: 4px 10px !important;
        margin-bottom: 8px !important;
    }

    .message-avatar {
        width: 32px !important;
        height: 32px !important;
        font-size: 11px !important;
    }

    .message-sender-name {
        font-size: 11px !important;
    }

    .message-time {
        font-size: 10px !important;
    }

    .related-question-chip {
        font-size: 12.5px !important;
        padding: 8px 12px !important;
    }

    /* 모바일 퀵 추천 질문 칩 바 (가로 슬라이드 스와이프 최적화) */
    .quick-suggestions-bar {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        padding: 4px 4px 6px 4px !important;
        margin-bottom: 4px !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
    .quick-suggestions-bar::-webkit-scrollbar {
        display: none !important;
    }
    .suggestion-pill {
        min-height: 30px !important;
        padding: 4px 12px !important;
        font-size: 11.5px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        border-radius: 16px !important;
    }

    /* 하단 입력바 도크 (모바일 Safe Area 및 입력 최적화) */
    .floating-composer-container {
        position: relative !important;
        bottom: auto !important;
        padding: 6px 10px max(10px, env(safe-area-inset-bottom, 0px)) 10px !important;
        width: 100% !important;
    }

    .composer-box {
        padding: 8px 10px 8px 12px !important;
        border-radius: 16px !important;
        gap: 5px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .composer-inline-controls {
        gap: 4px !important;
        padding-bottom: 5px !important;
        border-bottom: 1px dashed rgba(237, 125, 49, 0.2) !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    .composer-tone-bar {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 4px !important;
        flex-wrap: nowrap !important;
    }

    /* 모바일에서 '답변 말투' 라벨 숨김 (공간 확보) */
    .tone-bar-label {
        display: none !important;
    }

    .tone-options-group {
        display: inline-flex !important;
        align-items: center !important;
        padding: 2px !important;
        gap: 2px !important;
        background: #F8FAFC !important;
        border: 1px solid #E2E8F0 !important;
        border-radius: 999px !important;
        flex: 1 !important;
        max-width: 240px !important;
        justify-content: space-between !important;
    }

    .tone-btn {
        padding: 3px 6px !important;
        font-size: 11px !important;
        gap: 2px !important;
        flex: 1 !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    /* 핵심: 모바일에서 버튼 괄호 설명 텍스트 숨김 -> 320px 폰에서도 한 줄 정렬! */
    .tone-btn .tone-desc {
        display: none !important;
    }

    .divination-settings-trigger-btn {
        min-height: 28px !important;
        height: 28px !important;
        font-size: 11.5px !important;
        padding: 0 10px !important;
        border-radius: 999px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    .divination-settings-trigger-btn span {
        font-size: 11.5px !important;
    }

    .other-saju-trigger-btn {
        min-height: 28px !important;
        height: 28px !important;
        font-size: 11.5px !important;
        padding: 0 9px !important;
        border-radius: 999px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    .other-saju-trigger-btn span {
        font-size: 11.5px !important;
    }

    .composer-input-row {
        gap: 8px !important;
    }

    /* iOS 사파리 자동 확대 방지 (최소 16px 보장) */
    .composer-input {
        font-size: 16px !important;
        min-height: 40px !important;
        padding: 4px 0 !important;
        line-height: 1.45 !important;
    }

    .tarot-prompt-box {
        padding: 8px 10px 10px 12px !important;
        border-radius: 16px !important;
        gap: 6px !important;
    }

    /* 모바일 프롬프트 전송 액션 버튼: 40px 터치 타깃 확보 및 터치 피드백 */
    .send-action-btn {
        width: 40px !important;
        height: 40px !important;
        flex-shrink: 0 !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    /* 모달 모바일 반응형 전면 고도화 (하단 버튼 잘림 및 스크롤 불가 해결) */
    .modal-overlay {
        padding: 10px !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .modal-content {
        padding: 18px 16px !important;
        border-radius: 18px !important;
        width: calc(100% - 16px) !important;
        max-width: 480px !important;
        max-height: calc(100dvh - 24px) !important;
        max-height: calc(100vh - 24px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-sizing: border-box !important;
    }

    .modal-header {
        flex-shrink: 0 !important;
        padding-bottom: 12px !important;
        margin-bottom: 12px !important;
        border-bottom: 1px solid #EDF2F7 !important;
    }

    .modal-footer {
        flex-shrink: 0 !important;
        padding-top: 12px !important;
        margin-top: 12px !important;
        border-top: 1px solid #EDF2F7 !important;
    }

    /* 모달 내부 2열 폼 그리드 모바일 1열 전환 */
    .modal-form-grid,
    .saju-form-grid,
    .form-grid-2col {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .divination-option-card {
        padding: 10px 12px !important;
    }

    /* 관리자 모바일 반응형 */
    body {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }

    .admin-nav-list {
        display: flex;
        padding: 8px;
    }

    .admin-content {
        padding: 16px;
    }

    .stats-cards-grid {
        grid-template-columns: 1fr;
    }

    /* ========================================================
       모바일 상태 반응형 스마트 푸터 & 대화 전체화면 확장 모드
       ======================================================== */

    /* 1. 데스크톱 정통 푸터 숨기고 모바일 컴팩트 푸터 활성화 */
    .pc-footer-content {
        display: none !important;
    }

    .mobile-compact-footer {
        display: block !important;
    }

    /* 2. 대화 활성화(채팅 진행 중) 상태: 푸터 0px 완전 숨김 */
    body.chat-active .site-footer {
        display: none !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    /* 3. 첫 진입 웰컴 상태의 초슬림 28px 아코디언 푸터 */
    .site-footer {
        padding: 0 !important;
        background: #F5EFE9 !important;
        border-top: 1px solid rgba(211, 201, 190, 0.6) !important;
    }

    .m-footer-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 5px 12px;
        min-height: 28px;
        gap: 8px;
    }

    .m-footer-links {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 11px;
        font-weight: 500;
    }

    .m-footer-links a {
        color: #7A6F64;
        text-decoration: none;
        transition: color 0.15s ease;
    }

    .m-footer-links a:hover,
    .m-footer-links a:active {
        color: #9E480E;
    }

    .m-divider {
        color: #C8BEB4;
        font-size: 10px;
    }

    .m-biz-toggle-btn {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: transparent;
        border: none;
        padding: 2px 4px;
        font-size: 10.5px;
        color: #8C8074;
        cursor: pointer;
        border-radius: 4px;
        transition: all 0.15s ease;
    }

    .m-biz-toggle-btn:active {
        background: rgba(0, 0, 0, 0.05);
    }

    .m-biz-toggle-btn .m-chevron-icon {
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .m-biz-toggle-btn.active .m-chevron-icon {
        transform: rotate(180deg);
    }

    /* 모바일 사업자 정보 아코디언 드로어 */
    .m-biz-accordion-drawer {
        display: none;
        background: #EFE8E1;
        border-top: 1px dashed rgba(211, 201, 190, 0.8);
        padding: 10px 14px 12px;
        animation: drawerSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .m-biz-accordion-drawer.active {
        display: block;
    }

    @keyframes drawerSlideDown {
        from {
            opacity: 0;
            transform: translateY(-6px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .m-biz-drawer-inner {
        font-size: 10.5px;
        color: #6C6258;
        line-height: 1.6;
    }

    .m-biz-line {
        margin-bottom: 2px;
        word-break: keep-all;
    }

    .m-biz-line strong {
        color: #4A423B;
        font-weight: 600;
    }

    .m-biz-copyright {
        margin-top: 6px;
        font-size: 10px;
        color: #9E9388;
    }

    /* 4. 모바일 사이드바 내 법적 고지 및 사업자 정보 상시 열람 섹션 */
    .sidebar-mobile-legal {
        display: block !important;
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
    }

    .sidebar-legal-links {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 11.5px;
        font-weight: 500;
        margin-bottom: 8px;
    }

    .sidebar-legal-links a {
        color: var(--text-secondary, #6C6258);
        text-decoration: none;
        transition: color 0.15s ease;
    }

    .sidebar-legal-links a:hover,
    .sidebar-legal-links a:active {
        color: var(--brand-gold, #9E480E);
    }

    .sidebar-legal-dot {
        color: #C8BEB4;
        font-size: 10px;
    }

    .sidebar-biz-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        gap: 4px;
        background: rgba(0, 0, 0, 0.03);
        border: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: 6px;
        padding: 6px 10px;
        font-size: 11px;
        color: var(--text-secondary, #6C6258);
        cursor: pointer;
        transition: all 0.15s ease;
    }

    .sidebar-biz-toggle-btn .sidebar-chevron-icon {
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar-biz-toggle-btn.active .sidebar-chevron-icon {
        transform: rotate(180deg);
    }

    .sidebar-biz-drawer {
        display: none;
        margin-top: 8px;
        background: rgba(0, 0, 0, 0.02);
        border: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: 6px;
        padding: 8px 10px;
        animation: drawerSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .sidebar-biz-drawer.active {
        display: block;
    }

    .sidebar-biz-inner {
        font-size: 10.5px;
        color: var(--text-muted, #7A6F64);
        line-height: 1.55;
    }

    .sidebar-biz-inner p {
        margin-bottom: 2px;
        word-break: keep-all;
    }

    .sidebar-biz-inner strong {
        color: var(--text-primary, #332B25);
    }

    .sidebar-biz-copy {
        margin-top: 4px;
        font-size: 9.5px;
        color: #A3978B;
    }
}

/* ========================================================
   모바일 PWA 및 WebView (Android / iOS) 하이브리드 앱 최적화
   ======================================================== */
html, body {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    overscroll-behavior-y: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 텍스트 입력창 및 메시지 본문은 선택 가능 */
input, textarea, .message-bubble {
    -webkit-user-select: text !important;
    user-select: text !important;
}

/* PWA 독립 모드 (Standalone) 및 네이티브 웹뷰 진입 시 Safe Area 노치/홈바 보정 */
body.in-pwa-standalone,
body.in-app-webview {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

body.in-pwa-standalone .main-header,
body.in-app-webview .main-header {
    height: calc(56px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
}

body.in-pwa-standalone .app-container,
body.in-app-webview .app-container {
    height: calc(100vh - 56px - env(safe-area-inset-top, 0px));
}

body.in-pwa-standalone .floating-composer-container,
body.in-app-webview .floating-composer-container {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}

/* iOS 웹뷰 고무줄 바운스 방지 및 부드러운 관성 스크롤 */
.chat-scroll-area {
    -webkit-overflow-scrolling: touch;
}



/* ========================================================
   다올 시그니처 - 동·서양 교차 융합 배너 반응형
   ======================================================== */
@media (max-width: 860px) {
    .fusion-grid-trio {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .fusion-core-node {
        order: -1;
        min-width: unset;
        width: 100%;
    }
    .home-sig-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .home-sig-cta-btn {
        width: 100%;
        justify-content: center;
    }
    .fusion-showcase-container {
        padding: 20px 16px;
        margin: 20px auto 28px auto;
    }
    .fusion-showcase-title {
        font-size: 18px;
    }
}
