/* ==========================================================================
   F-Site Base Stylesheet (Mobile App Exclusive)
   Hyundai App Style Layout & Design System
   ========================================================================== */

:root {
    --fsite-color-bg: #F6F6F6;
    /* 연한 회색 배경 */
    --fsite-color-surface: #ffffff;
    /* 흰색 카드 요소 */
    --fsite-color-text: #1a1a1a;
    --fsite-color-text-secondary: #767676;
    --fsite-color-border: #eeeeee;
    --fsite-color-primary: #002C5F;
    /* 현대차 딥 네이비 */
    --fsite-font-primary: 'Pretendard', system-ui, -apple-system, sans-serif;

    /* App UI Metrics */
    --fsite-header-height: 56px;
    --fsite-bottom-nav-height: 64px;
    --fsite-max-width: 500px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    touch-action: manipulation;
}

/* 가로 스크롤 및 불필요한 바운스 원천 봉쇄 */
html,
body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background-color: #e5e5e5;
    /* 모바일 컨테이너 바깥쪽 바탕색 */
    font-family: var(--fsite-font-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: none;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* 데스크톱 고려 안함 - 오직 max-width 500px의 모바일 앱 컨테이너 */
#fsite-app-root {
    width: 100%;
    max-width: var(--fsite-max-width);
    height: 100%;
    height: 100dvh;
    margin: 0 auto;
    background-color: var(--fsite-color-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* 공통 리셋 */
button,
a {
    cursor: pointer;
    text-decoration: none;
    border: none;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
}


/* =========================================
   1. 상단 앱 바 (Top App Bar)
   ========================================= */
#fsite-app-header {
    height: var(--fsite-header-height);
    background-color: transparent;
    /* 초기 투명 헤더 (Transparent State) */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: absolute;
    /* 메인 영역 위로 덮음 (Full-Bleed) */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    pointer-events: auto;
    /* 투명 쉴드 방어 (강제 이벤트 수신) */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    /* 전환 효과 */
}

#fsite-app-header.is-scrolled {
    background-color: var(--fsite-color-surface);
    /* 스크롤 시 흰색 솔리드 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    /* 스크롤 시 하단 그림자 부활 */
}

.header-logo {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: -0.5px;
    color: #ffffff;
    /* 딥 사진 위 흰색 로고 (오버레이) */
    transition: color 0.3s ease;
}

#fsite-app-header.is-scrolled .header-logo {
    color: var(--fsite-color-primary);
    /* 딥 네이비 반전 */
}

.header-logo strong {
    font-weight: 700;
}

/* 비밀 통로 껍데기 (이벤트 바인딩 방어막) */
.secret-logo-btn {
    display: block;
    position: relative;
    z-index: 9999;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 10px;
    margin-left: -10px;
    /* 정렬 보정 */
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
    /* 터치 이벤트 가로채기 보장 */
}

.header-actions {
    display: flex;
    gap: 4px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
    /* 사진 위 흰색 아이콘 (오버레이) */
    transition: color 0.3s ease;
}

#fsite-app-header.is-scrolled .icon-btn {
    color: #333;
    /* 스크롤 시 다크 반전 */
}


/* =========================================
   가운데 스크롤 영역 (App Main)
   ========================================= */
#fsite-app-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 40px;
    /* top 여백 없음(0)으로 메인 슬라이더가 최상단에 꽉 참 (Full-Bleed) */
    -webkit-overflow-scrolling: touch;
    padding-bottom: 40px;
    /* 여유 공간 */
}


/* =========================================
   2. 메인 비주얼 및 로그인 유도 카드 (Hero Swipe)
   ========================================= */
.hero-section {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    background-color: var(--fsite-color-bg);
    /* 모서리 둥글게 처리 즉각 삭제 (Flat Edge) */
    overflow: hidden;
    /* 슬라이더가 삐져나가지 않도록 */
    z-index: 1;
}

/* 히어로 하단 블렌딩 (Dissolve Effect) */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none !important;
    z-index: 6;
    /* hero-overlay(5)보다 위에 덮음 */
}

/* 가로 스와이프 전용 슬라이더 껍데기 컨테이너 */
.hero-slider {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    /* 가로 배열 강제 */
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    /* 가로 자석 스냅 효과 적용 */
    -webkit-overflow-scrolling: touch;
    /* 앱처럼 부드러운 스크롤 */
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox 스크롤바 제거 */
}

.hero-slider::-webkit-scrollbar {
    display: none;
    /* Safari/Chrome 스크롤바 제거 */
}

/* 영원히 무너지지 않는 슬라이드 아이템 구조 */
.slide-item {
    flex: 0 0 100%;
    /* 한 화면에 사진 한 장씩만 딱딱 끊어지게 */
    height: 100%;
    scroll-snap-align: start;
    /* 화면 끝에 정확히 붙도록 설정 */
    position: relative;
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 이미지가 찌그러지지 않고 꽉 차게 */
    object-position: center bottom;
}

/* 하단 페이드-투-화이트 블러 효과 구현 (Blending Overlay) */
.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    /* 사진 아랫단 50% 가량 */
    /* 가독성 방어막: 이미지 위에 어두운 그라데이션 깔기 */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none !important;
    z-index: 5;
    /* 모서리 둥글게 삭제 */
}

/* 플로팅 로그인 카드 (마이너스 마진으로 겹침 효과 완벽 복원) */
.login-card-floating {
    position: relative;
    margin-top: -40px;
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: 0;
    /* margin-top: -40px; 로 히어로 아래단을 살짝 덮음 */
    background-color: var(--fsite-color-surface);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    /* 입체감 */
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-msg {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-msg .face-icon {
    font-size: 40px;
    color: #e0e0e0;
}

.login-msg p {
    font-size: 15px;
    line-height: 1.4;
    color: var(--fsite-color-text);
}

.login-msg p strong {
    font-size: 18px;
    font-weight: 700;
}

/* 강렬한 현대 네이비 버튼 */
.btn-primary {
    width: 100%;
    height: 52px;
    background-color: var(--fsite-color-primary);
    color: #ffffff;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
}


/* =========================================
   둥근 검색바 (Search)
   ========================================= */
.search-section {
    padding: 24px 20px 0;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--fsite-color-surface);
    border-radius: 100px;
    padding: 0 20px;
    height: 54px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.search-bar .material-symbols-rounded {
    color: var(--fsite-color-primary);
    margin-right: 12px;
    font-size: 24px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: var(--fsite-color-text);
    outline: none;
}

.search-bar input::placeholder {
    color: var(--fsite-color-text-secondary);
}


/* =========================================
   3. 업무 바로가기 (4열 Grid Service Menu)
   ========================================= */
.service-grid-section {
    padding: 24px 20px;
}

.service-grid-section .section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding: 0 4px;
    letter-spacing: -0.5px;
}

/* 흰색 라운드 카드 기반의 그리드 컨테이너 */
.service-grid {
    background-color: var(--fsite-color-surface);
    border-radius: 20px;
    padding: 32px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-row-gap: 32px;
    grid-column-gap: 8px;
    list-style: none;
}

/* 4열 중 5번째 메뉴는 2개의 열을 스팬하여 자연스럽게 하단 중앙으로 배치 */
.service-grid .grid-item:last-child:nth-child(5) {
    grid-column: 2 / span 2;
}

.grid-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    /* 현대차 앱 느낌 쫀득한 여백 확보 */
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.grid-item a .icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #F4F6F9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fsite-color-primary);
    transition: transform 0.2s, background-color 0.2s;
}

.grid-item a:active .icon-circle {
    transform: scale(0.95);
    background-color: #E6EAF1;
}

.grid-item a .icon-circle .material-symbols-rounded {
    font-size: 28px;
}

.grid-item a .grid-label {
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    color: #222;
    word-break: keep-all;
    letter-spacing: -0.3px;
}


/* =========================================
   4.5 Maker Guide (이벤트형 카드 섹션)
   ========================================= */
.mg-section {
    padding: 16px 0 32px;
}

.mg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 20px;
}

.mg-header .section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.mg-header .btn-more {
    font-size: 13px;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.mg-header .btn-more .material-symbols-rounded {
    font-size: 18px;
    margin-left: -2px;
}

.mg-card-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 0 20px;
    -webkit-overflow-scrolling: touch;
}

.mg-card-wrapper::-webkit-scrollbar {
    display: none;
}

.mg-card {
    flex: 0 0 calc(75% - 10px);
    /* 메인과 서브가 보이도록 넓이 설정 */
    aspect-ratio: 16 / 9;
    /* 가로로 긴 직사각형 카드 */
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    scroll-snap-align: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    background-color: #eee;
}

.mg-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 이미지 하단에 linear-gradient를 깔아서 흰색 글씨 시인성 확보 */
.mg-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 80%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    color: #fff;
    pointer-events: none;
}

.mg-card-title {
    font-size: 19px;
    font-weight: 800;
    /* 현대차 앱 특유의 좌측 하단 타이틀 강조 */
    margin-bottom: 0;
    /* 서브타이틀이 지워졌으므로 마진 제로화 */
    word-break: keep-all;
    line-height: 1.3;
    letter-spacing: -0.5px;
}


/* =========================================
   6. 수익원 계산 (.rev- 네임스페이스 격리)
   ========================================= */
.revenue-banner-section {
    padding: 0 20px 48px;
    background-color: var(--fsite-color-background);
}

.rev-card-container {
    position: relative;
}

.rev-card {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.rev-content {
    display: flex;
    flex-direction: column;
}

.rev-title {
    font-weight: 700;
    color: #111;
    font-size: 18px;
    letter-spacing: -0.5px;
    margin: 0;
}

.rev-subtitle {
    color: #666;
    font-size: 13px;
    margin-top: 6px;
    margin-bottom: 0;
    letter-spacing: -0.3px;
    word-break: keep-all;
}

.rev-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #002C5F;
    color: #FFFFFF;
    font-size: 24px;
    font-weight: 800;
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.rev-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
}

.rev-dot {
    width: 6px;
    height: 6px;
    background-color: #ddd;
    border-radius: 50%;
}

.rev-dot.active {
    background-color: #111;
}

/* =========================================
   8. 발전소 상담 신청하기 (CTA Section)
   ========================================= */
.consulting-cta-section {
    padding: 0 20px 48px;
    background-color: var(--fsite-color-background);
}

.consult-card {
    background-color: #002C5F;
    /* 조합의 메인 컬러: 네이비 */
    border-radius: 16px;
    padding: 32px 24px;
    color: #FFFFFF;
}

.consult-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.consult-subtitle {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 8px;
    margin-bottom: 0;
    line-height: 1.4;
    word-break: keep-all;
    letter-spacing: -0.3px;
}

.consult-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #FFFFFF;
    color: #002C5F;
    border-radius: 50px;
    /* 알약 형태 */
    padding: 12px 24px;
    font-weight: 600;
    font-size: 15px;
    margin-top: 20px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}


/* =========================================
   9. 읽을 거리 (Reading Material)
   ========================================= */
.reading-material-section {
    padding: 24px 0 40px;
    background-color: #fff;
}

/* 탭 네비게이션 UI */
.read-tabs {
    display: flex;
    gap: 20px;
    padding: 0 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 24px;
    /* 스와이프 스크롤 속성 추가 */
    overflow-x: auto;
    white-space: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* 탭 스크롤바 숨기기 (모바일 환경 깔끔한 UI 유지) */
.read-tabs::-webkit-scrollbar {
    display: none;
}

.read-tab {
    font-size: 15px;
    font-weight: 500;
    color: #888;
    padding-bottom: 12px;
    text-decoration: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    /* 탭이 찌그러지지 않도록 방지 */
}

.read-tab.active {
    color: #111;
    font-weight: 600;
}

.read-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #111;
}

/* 리스트 뷰 & 썸네일 */
.read-list {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 999;
}

.read-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* a 태그로 치환되었을 때를 대비한 스타일 초기화 */
a.read-item {
    color: inherit;
    display: flex;
    text-decoration: none;
    width: 100%;
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
}

.read-item:last-child {
    margin-bottom: 0;
}

.read-thumb {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover !important;
    object-position: center !important;
    flex-shrink: 0;
    background-color: #f5f5f5;
}

.read-text-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    /* 텍스트 가운데 정렬 지원 */
}

/* =========================================
   9-1. 네이티브 글쓰기 폼 위장 (CTA)
   ========================================= */
.write-prompt-item {
    transition: background-color 0.2s ease;
    border-radius: 12px;
    padding: 12px;
    margin: -12px -12px 12px -12px;
    /* 디자인 리스트 뷰와 통합되 패딩으로 영역 확보 */
}

.write-prompt-item:hover,
.write-prompt-item:active {
    background-color: #f8f9fa;
    /* 미세한 터치 반응 (배경 짙어짐) */
}

.write-prompt-thumb {
    background-color: #E6F0F9;
    /* 아주 연한 파란색 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.write-prompt-text-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.write-prompt-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.write-prompt-title {
    font-size: 15px;
    font-weight: 700;
    color: #002C5F;
    margin: 0 0 4px 0;
    letter-spacing: -0.3px;
    word-break: keep-all;
}

.write-prompt-desc {
    font-size: 13px;
    font-weight: 400;
    color: #666;
    line-height: 1.4;
    margin: 0;
    word-break: keep-all;
    display: -webkit-box;
    line-clamp: 2;
    /* compatibility */
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.write-prompt-arrow {
    font-size: 20px;
    color: #002C5F;
    opacity: 0.4;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin-left: 8px;
}

.write-prompt-item:hover .write-prompt-arrow,
.write-prompt-item:active .write-prompt-arrow {
    transform: translateX(4px);
    opacity: 1;
}

.read-title {
    font-size: 15px;
    color: #111;
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
    word-break: keep-all;

    /* 2줄 초과 시 말줄임표 처리 */
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 하단 더보기 버튼 */
.read-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F5F5F5;
    color: #444;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    padding: 16px;
    margin: 24px 20px 0;
    text-decoration: none;
    letter-spacing: -0.3px;
    -webkit-tap-highlight-color: transparent;
}


/* =========================================
   5. 마켓 인사이트 (Horizontal Scroll Cards)
   ========================================= */
.market-insight-section {
    padding: 24px 0 40px;
    background-color: var(--fsite-color-background);
}

.insight-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    padding: 0 20px;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.insight-cards-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 10px 20px;
    /* 좌우 여백 및 상하 그림자 여유 */
    -webkit-overflow-scrolling: touch;
}

/* 맥/IOS계열의 보기 흉한 네이티브 스크롤바 숨김 처리 */
.insight-cards-wrapper::-webkit-scrollbar {
    display: none;
}

.insight-card {
    flex: 0 0 calc(85% - 10px);
    /* 85% 차지하여 우측 카드 살짝 암시 */
    aspect-ratio: 3 / 4;
    /* 세로형 스태다드 하이엔드 비율 강제 */
    position: relative;
    overflow: hidden;
    /* 그래픽 이탈 차단 */
    scroll-snap-align: center;
    background-color: #ffffff;
    border-radius: 16px;
    padding: 32px;
    /* 여백의 미 강제 (기존 24px -> 32px) */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    /* 넓고 공중에 떠 있는 고급 그림자 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* 요소들을 위 아래로 밀어냄 */
}

/* 내부 데이터가 배경에 파묻히지 않도록 Z-index 승격 */
.insight-card .card-header,
.insight-card .card-question,
.insight-card .card-data {
    position: relative;
    z-index: 10;
}

/* 하단 백그라운드를 채우는 라인 차트 컴포넌트 */
.insight-card .card-graph {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 1;
    opacity: 0.9;
}

/* 카드의 하단부분을 화이트 리니어 그라데이션으로 자연스럽게 녹이는 오버레이 */
.insight-card .card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 2;
    pointer-events: none;
}

.insight-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.insight-card .category {
    font-size: 13px;
    font-weight: 300;
    /* 얇고 세련된 폰트 */
    color: #8e8e93;
}

.insight-card .card-question {
    font-size: 18px;
    font-weight: 500;
    /* 제목 얇게 다이어트 */
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 0;
    /* justify-content로 인해 띄워지므로 마진 제거 */
    word-break: keep-all;
}

.insight-card .card-data {
    display: flex;
    justify-content: flex-start;
    /* 텍스트와 아이콘 나란히 예쁘게 배치 */
    align-items: flex-end;
    gap: 12px;
    /* 가격과 등락폭 간격 확보 */
    margin-top: auto;
}

.insight-card .price {
    font-size: 28px;
    font-weight: 700;
    /* 가격 중요 데이터 굵게 */
    letter-spacing: -0.5px;
    color: var(--fsite-color-primary);
    line-height: 1;
}

.insight-card .unit {
    font-size: 15px;
    font-weight: 400;
    /* 단위 폰트 다이어트 */
    color: #666;
}

.insight-card .diff {
    font-size: 14px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
    /* price와 라인 맞춤 보정 */
}

.insight-card .diff.positive {
    background-color: rgba(255, 59, 48, 0.1);
    color: #FF3B30;
    /* 한국앱 기준 상승: 레드 계열 */
}

.insight-card .diff.negative {
    background-color: rgba(0, 90, 238, 0.1);
    color: var(--fsite-color-primary);
    /* 한국앱 기준 하락: 블루 계열 */
}


/* =========================================
   6. 하단 고정 탭 바 (Bottom Navigation)
   ========================================= */
#fsite-app-bottom-nav {
    height: calc(var(--fsite-bottom-nav-height) + env(safe-area-inset-bottom));
    background-color: var(--fsite-color-surface);
    border-top: 1px solid var(--fsite-color-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
    position: sticky;
    bottom: 0;
    z-index: 100;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    height: 100%;
    color: var(--fsite-color-text-secondary);
    transition: color 0.2s;
}

.nav-item .material-symbols-rounded {
    font-size: 26px;
    /* 기본적으로 얇은 아웃라인 아이콘 */
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* 활성화 상태 (현대 네이비 및 아이콘 채워짐) */
.nav-item.active {
    color: var(--fsite-color-primary);
}

.nav-item.active .material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* =========================================
   9-2. 공유 폼 모달 (Share Modal)
   ========================================= */
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: flex-end;
}

/* JS로 show 먼저 주고(display:flex 활성화) 애니메이션 프레임 후 active 부여 */
.share-modal.show {
    display: flex;
}

.share-modal-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.share-modal.active .share-modal-overlay {
    opacity: 1;
}

.share-modal-content {
    position: relative;
    width: 100%;
    background-color: #fff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 0 20px 40px;
    /* 상단 패딩 제거하고 헤더에 위임 */
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.4s ease;
}

.share-modal.active .share-modal-content {
    transform: translateY(0);
    opacity: 1;
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    padding: 24px 0 10px;
    /* 천장 빈틈 방지를 위해 24px로 확대 */
    margin: 0 0 24px 0;
    /* 여백 대폭 확장 */
    z-index: 100;
    position: sticky;
    top: 0;
    /* 모션 렌더링 최적화: 브라우저 과부하 방지 위해 GPU 가속 속성만 사용 */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
}

.share-modal-header.header-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.share-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.share-modal-close {
    font-size: 24px;
    color: #444;
    cursor: pointer;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.category-options {
    display: flex;
    flex-wrap: wrap;
    /* 다수 버튼 줄바꿈 */
    gap: 8px;
}

.cat-radio-lbl {
    flex: 1 1 calc(33.333% - 8px);
    /* 3열 배치 (바둑판) */
    min-width: 80px;
    /* 너무 좁아지지 않게 최소 너비 보장 */
    position: relative;
    cursor: pointer;
}

.cat-radio-lbl input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cat-radio-text {
    display: block;
    text-align: center;
    padding: 12px 0;
    border-radius: 8px;
    background-color: #f5f5f5;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.cat-radio-lbl input:checked~.cat-radio-text {
    background-color: rgba(0, 44, 95, 0.05);
    /* 연한 네이비 */
    border-color: #002C5F;
    color: #002C5F;
    font-weight: 600;
}

.share-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
}

.share-input:focus {
    border-color: #002C5F;
}

.share-helper-text {
    font-size: 13px;
    color: #888;
    margin-top: 8px;
    margin-bottom: 0;
    line-height: 1.4;
    letter-spacing: -0.3px;
    word-break: keep-all;
}

.share-file-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 24px 0;
    background-color: #fafafa;
    cursor: pointer;
}

.share-file-upload .material-symbols-rounded {
    font-size: 28px;
    color: #aaa;
    margin-bottom: 8px;
}

.share-file-upload .upload-txt {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.file-upload-input {
    display: none;
}

/* 하이브리드 자동/수동 썸네일 컨트롤 뷰 */
.hybrid-thumb-group {
    margin-top: -8px;
}

.share-thumb-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    border: 1px solid #e5e5ea;
}

.share-thumb-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.share-thumb-change-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background-color: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background-color 0.2s;
}

.share-thumb-change-btn:hover {
    background-color: rgba(0, 0, 0, 0.85);
}

.share-thumb-change-btn .material-symbols-rounded {
    font-size: 16px;
}

.fallback-upload {
    flex-direction: row !important;
    padding: 16px !important;
}

.fallback-upload .material-symbols-rounded {
    margin-bottom: 0 !important;
    font-size: 20px !important;
}

.share-submit-btn {
    width: 100%;
    padding: 16px;
    background-color: #002C5F;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* -------------------------------------------
   전기 판매 방식 인포그래픽 모달 CSS
------------------------------------------- */
.elec-tabs {
    display: flex;
    background-color: #f0f0f5;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.elec-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    color: #888;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.3;
}

.elec-tab small {
    font-size: 11px;
    font-weight: 500;
}

.elec-tab.active {
    background-color: #fff;
    color: #111;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.elec-tab-pane {
    display: none;
}

.elec-tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.infra-section {
    background-color: #f9fafb;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.infra-title {
    font-size: 15px;
    font-weight: 800;
    color: #222;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #ddd;
}

.infra-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.infra-arrow {
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.infra-grid {
    display: flex;
    gap: 10px;
    width: 100%;
}

.infra-grid .infra-box {
    flex: 1;
}

.infra-box {
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    line-height: 1.4;
    word-break: keep-all;
    z-index: 5;
    position: relative;
}

.infra-box small {
    font-size: 10px;
    font-weight: 500;
    color: #666;
    margin-top: 4px;
}

/* Box Types */
.type-gov {
    border-color: #ff3b30;
    color: #ff3b30;
    background-color: #fff0f0;
}

.type-market {
    border-color: #0A7AFF;
    color: #0A7AFF;
    background-color: #eef5ff;
    font-weight: 800;
}

.type-user {
    border-color: #999;
    color: #555;
    background-color: #f7f7f7;
}

.type-gen {
    border-color: #8e8e93;
    color: #444;
}

.type-eco {
    border-color: #34c759;
    color: #1e8736;
    background-color: #f0fdf4;
}

.type-partner {
    border-color: #af52de;
    color: #af52de;
    background-color: #f9f0ff;
}

.type-vpp {
    background: #333;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
}

/* Market Layout */
.infra-market-wrap {
    display: flex;
    gap: 12px;
}

.market-col {
    display: flex;
    flex-direction: column;
    flex: 1;
    word-break: keep-all;
}

.market-col.divider {
    flex: 1.5;
    border-left: 1px dashed #ccc;
    border-right: 1px dashed #ccc;
    padding: 0 12px;
    background-color: rgba(0, 0, 0, 0.01);
}

.market-label {
    font-size: 11px;
    font-weight: 700;
    color: #999;
    margin-bottom: 12px;
    text-align: center;
}

.flow-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.infra-conn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #666;
}

.conn-lbl {
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 9px;
}

.infra-conn-complex {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-right: 4px;
}

.flow-special-link {
    position: relative;
    width: 100%;
    margin-top: 20px;
    text-align: right;
}

.flow-special-link2 {
    position: relative;
    width: 100%;
}

.side-flow {
    position: relative;
}