/* ============================================
   DailyData - Soft UI Card Style
   AdminLTE 베이스 + 커스텀 오버라이드
   ============================================ */

/* 다크모드 무시 - 항상 라이트 테마 강제 */
:root {
    color-scheme: light only;
}

/* 전역 */
html, body {
    background-color: #f4f6f9 !important;
    color: #344767;
}
body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f4f6f9;
}

/* 사용자 OS가 다크모드여도 라이트 색상 유지
   주의: 카드 내부는 인라인 스타일(예: 환영카드의 color:#fff)을 존중해야 하므로
   body / .card-soft 기본 배경만 강제하고, 카드 전체 color는 건드리지 않는다. */
@media (prefers-color-scheme: dark) {
    html, body {
        background-color: #f4f6f9 !important;
        color: #344767;
    }
    .content-wrapper.bg-light {
        background-color: #f4f6f9 !important;
    }
    .card-soft:not([style*="background"]) {
        background-color: #ffffff !important;
    }
    input:not([style*="color"]),
    select:not([style*="color"]),
    textarea:not([style*="color"]) {
        background-color: #ffffff;
        color: #344767;
    }
}

/* 아이콘-텍스트 간격 전역 */
i.fas,
i.far,
i.fab {
    margin-right: 8px !important;
}

/* PIN 입력 필드: type="tel" 이지만 글자는 점으로 마스킹 (비밀번호 저장 회피) */
.pin-field {
    -webkit-text-security: disc;
    text-security: disc;
    font-family: 'Arial', sans-serif;
}

/* 복지/공연·전시 카테고리 필터 버튼 컨테이너 — flex-wrap 기본 적용 */
.welfare-category-btns,
#welfareCategoryBtns,
#cultureCategoryBtns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* 버튼 자체 — 음절 단위 쪼개짐 방지 + compact 크기 */
.welfare-category-btns button,
#welfareCategoryBtns button,
#cultureCategoryBtns button {
    white-space: nowrap;
    flex: 0 0 auto;
    font-size: 0.75rem;
    padding: 0.15rem 0.55rem;
    line-height: 1.45;
}

@media (max-width: 480px) {
    .welfare-category-btns button,
    #welfareCategoryBtns button,
    #cultureCategoryBtns button {
        font-size: 0.72rem;
        padding: 0.15rem 0.45rem;
    }
    .welfare-category-btns button i,
    #welfareCategoryBtns button i,
    #cultureCategoryBtns button i {
        margin-right: 0.3rem !important;
    }
}

/* 환영 카드 — 다른 카드와 동일한 정렬/여백 유지 */
.welcome-card .card-body {
    padding: 1.25rem 1.25rem;
}
.welcome-card h5 {
    font-size: 1.1rem;
}
.welcome-card .fa-hand-sparkles {
    font-size: 1.6rem !important;
}

/* AdminLTE card-title float:left 강제 해제 */
.card-title {
    float: none !important;
}

/* Bootstrap 5 me-* / ms-* 클래스 (AdminLTE 3.2 = Bootstrap 4 기반이라 없음) */
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }

/* AdminLTE 사이드바 마진 리셋 (사이드바 미사용) */
body:not(.sidebar-mini) .content-wrapper,
body.sidebar-collapse .content-wrapper {
    margin-left: 0 !important;
}

.content-wrapper {
    min-height: calc(100vh - 57px);
    padding-bottom: 2rem;
}

/* 데스크톱 콘텐츠 max-width 제한 */
.container-fluid.px-4 {
    max-width: 1400px;
    margin: 0 auto;
}

/* ---- 상단 헤더 고정 (sticky) ----
   PC / 모바일 모두 스크롤 시 상단에 붙어있음.
   향후 헤더 바로 아래에 AdSense 광고 슬롯 배치 예정. */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #eff4fb;
    /* iPhone notch / Android cutout 영역 침범 방지 */
    padding-top: env(safe-area-inset-top, 0);
}

/* ---- 데스크톱 상단 Navbar ---- */
.desktop-nav {
    border-bottom: none;
    background: #eff4fb;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #1e6cb8, #0a4d8c) 1;
}

.mobile-nav {
    display: none;
    border-bottom: none;
    background: #eff4fb;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, #1e6cb8, #0a4d8c) 1;
}

.mobile-nav .container-fluid {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
}

.mobile-nav .navbar-brand {
    margin-right: 0 !important;
    flex-grow: 0 !important;
}

.mobile-nav .settings-btn {
    margin-left: auto !important;
}

.main-header .navbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: #344767;
}

.navbar-brand .brand-icon {
    width: 1.6em;
    height: 1.6em;
    vertical-align: -0.35em;
    display: inline-block;
}

.main-header .nav-link.tab-link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #67748e;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    margin: 0 0.15rem;
}

.main-header .nav-link.tab-link:hover {
    color: #344767;
    background: #f0f2f5;
}

.main-header .nav-link.tab-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #1e6cb8, #0a4d8c);
    box-shadow: 0 3px 10px rgba(30, 108, 184, 0.3);
}

/* ---- 하단 탭바 (모바일) ---- */
.bottom-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #eff4fb;
    border-top: 2px solid transparent;
    border-image: linear-gradient(90deg, #1e6cb8, #0a4d8c) 1;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    z-index: 1050;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.5rem;
    /* iPhone 홈바 / Android 제스처 영역 침범 방지 */
    padding-bottom: env(safe-area-inset-bottom, 0);
    height: calc(60px + env(safe-area-inset-bottom, 0));
}

.bottom-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 6px 0;
    color: #8392ab;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    transition: color 0.2s;
    gap: 2px;
}

.bottom-tab i {
    font-size: 1.15rem;
}

.bottom-tab.active {
    color: #1e6cb8;
    font-weight: 600;
}

.bottom-tab:hover {
    color: #1e6cb8;
    text-decoration: none;
}

/* ---- 홈 히어로 배너 ---- */
.hero-banner {
    background: linear-gradient(135deg, #1e6cb8, #0a4d8c, #1e6cb8);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
    padding: 2rem 0 1.5rem;
    color: #fff;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-greeting {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: #fff;
}

.hero-sub {
    font-size: 0.88rem;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.85);
}

.hero-icon {
    width: 56px;
    height: 56px;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.75);
    animation: heroFloat 3s ease-in-out infinite;
    flex-shrink: 0;
    pointer-events: none;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---- 탭 섹션 제목 ---- */
.tab-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #344767;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.tab-section-title i {
    margin-right: 0.4rem;
}

/* ---- Soft UI 카드 ---- */
.card-soft {
    border: none;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.card-soft:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.card-soft .card-header {
    background: transparent;
    padding: 1rem 1.25rem 0.5rem;
}

.card-soft .card-body {
    padding: 1.25rem 1.5rem;
}

/* ---- 서비스 카드 (그룹 내 목록) ---- */
.service-card {
    cursor: pointer;
    margin-bottom: 0.6rem;
    border-left: 4px solid transparent;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.service-card.accent-warning  { --card-accent: #f5365c; }
.service-card.accent-info     { --card-accent: #11cdef; }
.service-card.accent-success  { --card-accent: #2dce89; }
.service-card.accent-primary  { --card-accent: #1e6cb8; }
.service-card.accent-danger   { --card-accent: #f5365c; }
.service-card.accent-secondary { --card-accent: #8392ab; }

.service-card:hover {
    border-left-color: var(--card-accent, #1e6cb8);
}

.service-card .card-body {
    padding: 1.1rem 1.25rem;
}

.service-card .card-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
    margin-right: 1rem;
    transition: transform 0.3s ease;
}

.service-card:hover .card-icon {
    animation: iconBounce 0.4s ease;
}

@keyframes iconBounce {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.15); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* 카드 chevron 이동 애니메이션 */
.service-card .fa-chevron-right {
    transition: transform 0.25s ease;
}

.service-card:hover .fa-chevron-right {
    transform: translateX(4px);
}

/* 공통 gradient + accent 변수 (카드 아이콘, 설정 아이콘, 최근 목록 아이콘) */
.bg-gradient-warning { background: linear-gradient(135deg, #f5365c, #f56036) !important; --card-accent: #f5365c; }
.bg-gradient-info { background: linear-gradient(135deg, #11cdef, #1171ef) !important; --card-accent: #11cdef; }
.bg-gradient-success { background: linear-gradient(135deg, #2dce89, #2dcecc) !important; --card-accent: #2dce89; }
.bg-gradient-primary { background: linear-gradient(135deg, #1e6cb8, #0a4d8c) !important; --card-accent: #1e6cb8; }
.bg-gradient-danger { background: linear-gradient(135deg, #f5365c, #f56036) !important; --card-accent: #f5365c; }
.bg-gradient-secondary { background: linear-gradient(135deg, #8392ab, #8392d4) !important; --card-accent: #8392ab; }

.service-card .card-info {
    flex: 1;
    min-width: 0;
}

.service-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #344767;
    margin-bottom: 0.3rem;
}

.service-card .card-text {
    font-size: 0.8rem;
    color: #67748e;
    margin-bottom: 0;
    line-height: 1.4;
}

.service-card .fa-chevron-right {
    margin-left: 0.75rem;
}

/* ---- 탭 카드 (풀와이드) ---- */
.tab-card {
    margin-bottom: 1rem;
}

.tab-card .card-body {
    padding: 1.4rem 1.5rem;
}

.tab-card .card-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    font-size: 1.5rem;
}

/* 상태 텍스트 */
.card-status {
    display: inline-block;
    font-size: 0.7rem;
    color: #8392ab;
    margin-top: 0.35rem;
}

.card-status i {
    margin-right: 0.2rem;
    font-size: 0.6rem;
}

/* 하단 안내 배너 */
.tab-info-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0 1rem;
    background: rgba(30, 108, 184, 0.06);
    border-radius: 0.75rem;
    color: #8392ab;
    font-size: 0.78rem;
}

.tab-info-banner i {
    color: #1e6cb8;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ---- 최근 본 서비스 리스트 ---- */
.recent-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    background: #ffffff;
    border-radius: 0.75rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: background 0.15s, transform 0.2s ease;
    opacity: 0;
    animation: cardSlideUp 0.3s ease-out forwards;
}

.recent-item:hover {
    background: #f0f2f5;
}

.recent-item .recent-icon {
    width: 38px;
    height: 38px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
    margin-right: 0.85rem;
    flex-shrink: 0;
}
.recent-item .recent-icon i {
    transform: translateX(4px);
}
.service-card .card-icon i {
    transform: translateX(6px);
}

.recent-item .recent-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #344767;
}

.recent-item .recent-time {
    font-size: 0.7rem;
    color: #8392ab;
    margin-left: auto;
}

/* ---- 방문 통계 차트 영역 ---- */
#visitChart {
    max-height: 200px;
}

/* ---- 상세 페이지 ---- */
#page-detail .card-body {
    min-height: auto;
}

/* ---- 뒤로 버튼 ---- */
.btn-outline-secondary {
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

/* ---- 콘텐츠 헤더 ---- */
.content-header h4 {
    font-weight: 700;
    color: #344767;
}

/* ---- 데이터 소스 배너 ---- */
.data-source-banner {
    font-size: 0.68rem;
    color: #888;
    padding: 4px 0 8px 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.data-source-banner .banner-icon {
    font-size: 0.65rem;
    margin-right: 0 !important;
}
.data-source-banner .banner-sep {
    color: #bbb;
}
.data-source-banner .banner-update {
    white-space: nowrap;
}

/* ---- 설정 버튼 (톱니바퀴) ---- */
.test-btn {
    padding: 0.5rem 0.65rem;
    font-size: 1.1rem;
    color: #8392ab;
    border-radius: 0.5rem;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.test-btn:hover,
.test-btn.active {
    color: #f5365c;
    background: #f0f2f5;
}

.settings-btn {
    padding: 0.5rem 0.65rem;
    font-size: 1.1rem;
    color: #67748e;
    border-radius: 0.5rem;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.settings-btn:hover,
.settings-btn.active {
    color: #1e6cb8;
    background: #f0f2f5;
}

/* ---- 모바일 뒤로 버튼 (mobile-nav 내부) ---- */
.btn-mobile-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    color: #344767;
    font-size: 1.1rem;
    margin-left: -0.25rem;
    margin-right: 0.5rem;
    transition: all 0.15s;
    flex-shrink: 0;
    text-decoration: none;
}

.btn-mobile-back:hover {
    color: #1e6cb8;
    background: #f0f2f5;
}

.btn-mobile-back:active {
    transform: scale(0.9);
    transition: transform 0.1s;
}

/* ---- 설정 페이지 ---- */
.settings-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #344767;
    margin-bottom: 0.5rem;
}

.settings-section-title i {
    margin-right: 0.4rem;
}

/* 전체 선택/해제 바 */
.select-all-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0 0.75rem;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 0.5rem;
}

.select-all-count {
    font-size: 0.8rem;
    font-weight: 500;
    color: #1e6cb8;
}

.select-all-bar .btn {
    border-radius: 0.4rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
}

/* 그룹 라벨 (선택됨/미선택) */
.settings-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #8392ab;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0;
    margin-bottom: 0.5rem;
}

/* 토글 아이템 */
.settings-toggle-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f2f5;
}

.settings-toggle-item:last-child {
    border-bottom: none;
}

.settings-toggle-item.compact {
    padding: 0.5rem 0;
}

.settings-toggle-item.compact .toggle-desc {
    display: none;
}

/* 작은 아이콘 (설정용) */
.card-icon-sm {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.settings-toggle-item.compact .card-icon-sm {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
    border-radius: 0.4rem;
}

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

.toggle-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: #344767;
}

.settings-toggle-item.compact .toggle-name {
    font-size: 0.82rem;
    color: #67748e;
}

.toggle-desc {
    display: block;
    font-size: 0.75rem;
    color: #8392ab;
    margin-top: 0.1rem;
}

/* Bootstrap 스위치 커스텀 */
.form-check-input {
    width: 2.75rem;
    height: 1.4rem;
    cursor: pointer;
}

/* 설정 토글 우측 여유 — 카드 가장자리에 붙지 않게 */
.settings-toggle-item .form-switch {
    margin-right: 6px;
}

.form-check-input:checked {
    background-color: #1e6cb8;
    border-color: #1e6cb8;
}

/* 저장된 설정값 — 읽기 전용 */
.saved-setting-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.15s;
}

.saved-setting-item:last-child {
    border-bottom: none;
}

.saved-setting-item:active {
    background: #f8f9ff;
}

.saved-setting-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.saved-setting-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-right: 10px;
    flex-shrink: 0;
}

.saved-setting-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #344767;
}

.saved-setting-values {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-left: 40px;
}

.saved-setting-tag {
    display: inline-block;
    background: #f0f2f5;
    color: #344767;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
}

.saved-setting-empty {
    font-size: 0.75rem;
    color: #adb5bd;
    font-style: italic;
}

/* 기타 설정 */
.other-setting-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid #f0f2f5;
}

.other-setting-item:last-child {
    border-bottom: none;
}

.other-setting-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: #344767;
}

.other-setting-desc {
    display: block;
    font-size: 0.75rem;
    color: #8392ab;
    margin-top: 0.1rem;
}

/* ============================================
   설정 메뉴 리스트 (V1.1.x)
   ============================================ */
.settings-group-header {
    font-size: 0.72rem;
    font-weight: 600;
    color: #8392ab;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 12px;
    margin: 14px 0 6px;
}

.settings-menu-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: 4px;
}

.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.12s ease;
}

.settings-menu-item:last-child {
    border-bottom: none;
}

.settings-menu-item:active {
    background: #f8f9fa;
}

.settings-menu-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.settings-menu-text {
    flex: 1;
    min-width: 0;
}

.settings-menu-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #344767;
}

.settings-menu-desc {
    display: block;
    font-size: 0.74rem;
    color: #8392ab;
    margin-top: 1px;
}

.settings-menu-chevron {
    color: #c5cdd9;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-left: 4px;
}

.settings-menu-action {
    flex-shrink: 0;
    margin-left: 4px;
}

/* ============================================
   상세 페이지 스켈레톤
   ============================================ */

/* 공통 스켈레톤 라인 */
.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #f0f2f5 25%, #e8eaed 50%, #f0f2f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-line.w-15 { width: 15%; }
.skeleton-line.w-20 { width: 20%; }
.skeleton-line.w-25 { width: 25%; }
.skeleton-line.w-35 { width: 35%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-45 { width: 45%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-55 { width: 55%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-65 { width: 65%; }
.skeleton-line.w-70 { width: 70%; }

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 리스트형 스켈레톤 */
.skeleton-list-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f2f5;
}

.skeleton-list-item:last-child {
    border-bottom: none;
}

/* 차트형 스켈레톤 */
.skeleton-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 180px;
    padding: 0 0.5rem;
}

.skeleton-chart-bar {
    width: 10%;
    background: linear-gradient(90deg, #e8eaed 25%, #dde0e4 50%, #e8eaed 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px 6px 0 0;
}

/* 테이블형 스켈레톤 */
.skeleton-table-row {
    display: flex;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f0f2f5;
}

.skeleton-table-row.header {
    background: #f8f9fa;
}

.skeleton-table-row:last-child {
    border-bottom: none;
}

/* 지도형 스켈레톤 */
.skeleton-map {
    height: 250px;
    background: linear-gradient(135deg, #e8eaed, #f0f2f5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8392ab;
    font-size: 0.85rem;
    border-radius: 0 0 1rem 1rem;
}

.skeleton-map i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* ---- 빈 상태 메시지 ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #8392ab;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* ============================================
   터치 UX / 애니메이션
   ============================================ */

/* 카드 터치 press 피드백 */
.service-card:active {
    transform: scale(0.97);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    transition: transform 0.1s, box-shadow 0.1s;
}

.recent-item:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

.bottom-tab:active {
    transform: scale(0.9);
    transition: transform 0.1s;
}

/* 페이지 전환 */
.page-section {
    animation: pageSlideIn 0.3s ease-out;
}

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

/* 카드 순차 등장 (stagger) */
.service-card {
    opacity: 0;
    animation: cardSlideUp 0.35s ease-out forwards;
}

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

/* ---- 관리자 페이지 ---- */
.admin-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f5365c, #f56036);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
    letter-spacing: 0.05em;
    vertical-align: middle;
    margin-right: 0.4rem;
}

/* 스케줄러 수집 현황 */
.scheduler-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (min-width: 768px) {
    .scheduler-grid { grid-template-columns: repeat(3, 1fr); }
}

.scheduler-card {
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    padding: 12px;
    background: #fff;
    transition: box-shadow 0.15s;
}
.scheduler-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.scheduler-card.scheduler-ok { border-left: 3px solid #27ae60; }
.scheduler-card.scheduler-warn { border-left: 3px solid #f39c12; }
.scheduler-card.scheduler-error { border-left: 3px solid #e74c3c; }
.scheduler-card.scheduler-idle { border-left: 3px solid #bdc3c7; }

.scheduler-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.scheduler-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #344767;
}
.scheduler-status-badge {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}
.scheduler-status-badge.scheduler-ok { background: #d4edda; color: #155724; }
.scheduler-status-badge.scheduler-warn { background: #fff3cd; color: #856404; }
.scheduler-status-badge.scheduler-error { background: #f8d7da; color: #721c24; }
.scheduler-status-badge.scheduler-idle { background: #e9ecef; color: #6c757d; }

.scheduler-card-body {
    margin-bottom: 8px;
}
.scheduler-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    padding: 2px 0;
}
.scheduler-card-footer .btn {
    border-radius: 6px;
}

.admin-api-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f0f2f5;
}

.admin-api-item:last-child {
    border-bottom: none;
}

.admin-api-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 0.85rem;
}

.admin-api-dot.status-ok { background: #2dce89; }
.admin-api-dot.status-fail { background: #f5365c; }
.admin-api-dot.status-error { background: #f5365c; }
.admin-api-dot.status-wait { background: #8392ab; }

.admin-api-info {
    flex: 1;
    min-width: 0;
}

.admin-api-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #344767;
}

.admin-api-time {
    font-size: 0.7rem;
    color: #8392ab;
}

.admin-api-btn {
    margin-left: auto;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.admin-stat-card {
    text-align: center;
    padding: 1rem 0.5rem;
    background: #f8f9fa;
    border-radius: 0.75rem;
}

.admin-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #344767;
}

.admin-stat-label {
    font-size: 0.7rem;
    color: #8392ab;
    margin-top: 0.2rem;
}

/* 설정 토글 아이템 터치 */
.settings-toggle-item:active {
    background: #f8f9fa;
}

/* ---- 마이크로 인터랙션 ---- */
/* 톱니바퀴 회전 */
.settings-btn:active i {
    animation: gearSpin 0.4s ease-out;
}

@keyframes gearSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(90deg); }
}

/* 뒤로 버튼 nudge */
.btn-mobile-back:active i {
    animation: backNudge 0.25s ease-out;
}

@keyframes backNudge {
    0%   { transform: translateX(0); }
    40%  { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

/* 하단 탭 dot indicator */
.bottom-tab.active::after {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #1e6cb8;
    margin-top: 2px;
    animation: dotAppear 0.3s ease-out;
}

@keyframes dotAppear {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ============================================
   반응형: 모바일 (768px 이하)
   ============================================ */
@media (max-width: 767.98px) {
    /* 상단 데스크톱 네비 숨김, 모바일 네비 표시 */
    .desktop-nav {
        display: none !important;
    }

    .mobile-nav {
        display: flex !important;
    }

    /* 하단 탭바 표시 */
    .bottom-tab-bar {
        display: flex;
    }

    /* 하단 탭 공간 확보 */
    .content-wrapper {
        padding-bottom: 70px;
    }

    .content-header h4 {
        font-size: 1.15rem;
    }

    .service-card .card-icon {
        width: 52px;
        height: 52px;
        font-size: 1.2rem;
        margin-right: 0.85rem;
    }

    .hero-greeting {
        font-size: 1.2rem;
    }

    .hero-icon {
        width: 48px;
        height: 48px;
        font-size: 1.8rem;
    }

    .tab-card .card-body {
        padding: 1.2rem 1.1rem;
    }

    .navbar-brand .brand-icon {
        width: 1.4em;
        height: 1.4em;
        vertical-align: -0.25em;
    }
}

/* ============================================
   API 테스트 페이지
   ============================================ */
.text-purple { color: #1e6cb8; }

.test-result {
    border-radius: 0.5rem;
    padding: 0.75rem;
    border: 1px solid;
}

.test-result-ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.test-result-fail {
    background: #fef2f2;
    border-color: #fecaca;
}

.test-result-pre {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-size: 0.75rem;
    max-height: 300px;
    overflow: auto;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ============================================
   Step 6: 비주얼 폴리싱 + 모바일 최적화
   ============================================ */

/* 데이터 테이블 통일 스타일 */
.table-sm th {
    font-size: 0.78rem;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    padding: 0.5rem 0.4rem;
}
.table-sm td {
    font-size: 0.78rem;
    padding: 0.45rem 0.4rem;
    vertical-align: middle;
}
.table-light th {
    background-color: #f8f9fe !important;
    border-bottom: 2px solid #e9ecef;
}

/* 검색 영역 카드 통일 */
.card-soft .form-control-sm,
.card-soft .form-select-sm {
    border-radius: 0.5rem;
    border-color: #e0e3eb;
    font-size: 0.82rem;
}
.card-soft .form-control-sm:focus,
.card-soft .form-select-sm:focus {
    border-color: #1e6cb8;
    box-shadow: 0 0 0 0.15rem rgba(30,108,184,0.15);
}

/* 테이블 가로 스크롤 힌트 */
.table-responsive {
    position: relative;
}
.table-responsive::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.table-responsive.is-scrollable::after {
    opacity: 1;
}

/* 버튼/터치 영역 최소 44px */
.btn-sm {
    min-height: 36px;
    min-width: 36px;
}
@media (max-width: 767.98px) {
    .btn-sm {
        min-height: 44px;
        min-width: 44px;
        padding: 0.4rem 0.75rem;
    }
    .form-select-sm, .form-control-sm {
        min-height: 40px;
        font-size: 16px !important; /* iOS zoom 방지 */
    }
    .table-sm th, .table-sm td {
        font-size: 0.72rem;
        padding: 0.35rem 0.3rem;
    }
}

/* 빈 상태/에러 상태 통일 */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #8898aa;
}
.empty-state i {
    font-size: 2rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 0.5rem;
}

/* 주유소 활성 뷰 버튼 */
.gas-view-btn.active {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

/* 복지 카테고리 활성 버튼 */
#welfareCategoryBtns .btn.active {
    font-weight: 600;
}

/* 차트 모바일 최적화 */
@media (max-width: 576px) {
    canvas {
        max-height: 200px;
    }
}

/* 공기질 등급별 행동 안내 */
.alert.py-2.small {
    font-size: 0.78rem;
    border-radius: 0.5rem;
}

/* 데스크톱 검색 영역 최대 너비 제한 */
@media (min-width: 768px) {
    #airStationInput,
    #welfareSearchInput {
        max-width: 360px;
    }
}

/* ============================================
   Step 7: 좁은 모바일 화면 (≤480px) 레이아웃 최적화
   ============================================ */

/* 가로 오버플로우 차단
   주의: html/body에 overflow-x: hidden 을 걸면 .main-header 의 position: sticky 가
   동작하지 않는다 (스크롤 컨테이너가 html 이 되어 sticky 기준점이 깨짐).
   따라서 가로 오버플로우 차단은 .content-wrapper 에만 적용한다. */
html, body {
    max-width: 100%;
}
.content-wrapper {
    overflow-x: hidden;
    max-width: 100%;
}

/* 한글 제목 음절 단위 끊김 방지 */
.card-title,
.content-header h4,
h1, h2, h3, h4, h5, h6 {
    word-break: keep-all;
}

@media (max-width: 480px) {
    /* 컨테이너 좌우 여백 최소화 → 카드 폭 최대화 */
    .container-fluid.px-4,
    .container-fluid.px-3 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    .px-4.pt-3 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    /* content-header 자체 padding 제거 (내부 container-fluid.px-4가 이미 0.5rem 적용) */
    .content-header {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    /* ─────────────────────────────────────────────
       카드는 화면에 붙어있어도 OK,
       그러나 카드 바깥의 모든 텍스트/아이콘은
       왼쪽 가장자리에 붙지 않도록 12px 패딩 강제.
       ───────────────────────────────────────────── */
    .content-header h1,
    .content-header h2,
    .content-header h3,
    .content-header h4,
    .content-header h5,
    .content-header h6 {
        padding-left: 12px !important;
    }

    /* 홈 페이지 섹션 레이블 (자주 찾는 서비스, 최근 본 서비스) */
    #frequentLabel,
    #page-home .col-lg-8 > h6,
    #page-home .col-lg-4 > h6 {
        padding-left: 12px !important;
    }

    /* 생활정보/부동산/복지·공연 탭 섹션 타이틀 */
    .tab-section-title {
        padding-left: 12px !important;
    }

    /* 히어로 배너 내부 텍스트 (좋은 오후예요! / 필요한 정보를...) */
    .hero-banner .hero-text {
        padding-left: 12px;
    }

    /* 데이터 소스 배너: 한 줄 flex-wrap 유지, 좌측 12px 여유만 적용 */
    .data-source-banner {
        padding: 4px 0 8px 12px !important;
    }

    /* 카드 내부 여백 축소 */
    .card-soft .card-body {
        padding: 1rem 1rem;
    }
    .card-soft .card-header {
        padding: 0.85rem 1rem 0.4rem;
    }

    /* 카드 헤더: 제목 + 드롭다운 flex 정리 */
    .card-soft .card-header.d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }

    /* 카드 헤더 제목: 남은 공간 차지 + 축소 허용 */
    .card-soft .card-header h6.card-title {
        font-size: 0.88rem;
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
    }

    /* 헤더 안 드롭다운: 축소 방지 + 컴팩트 */
    .card-soft .card-header .form-select-sm {
        flex: 0 0 auto;
        width: auto !important;
        max-width: 45%;
        min-height: 34px !important;
        font-size: 0.78rem !important;
        padding: 0.2rem 1.4rem 0.2rem 0.5rem !important;
    }

    /* 주유소 뷰 버튼 3개: 한 줄에 균등 배치 */
    .gas-view-btn {
        flex: 1 1 0;
        min-width: 0 !important;
        padding: 0.55rem 0.3rem !important;
        font-size: 0.78rem !important;
        white-space: nowrap;
    }
    .gas-view-btn i {
        margin-right: 4px !important;
    }

    /* 주유소 뷰 버튼 3개 컨테이너만: 전체 폭 사용 + gap 축소 (한 줄 유지) */
    .card-soft .card-body > .d-flex.flex-wrap:has(.gas-view-btn) {
        flex-wrap: nowrap !important;
        gap: 0.4rem !important;
        width: 100%;
    }

    /* 테이블 컬럼 패딩 더 축소 */
    .table-sm th, .table-sm td {
        padding: 0.3rem 0.25rem;
    }

    /* 데이터 소스 배너 여백 */
    .content-header {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* 아주 좁은 화면 (≤360px, 갤럭시S 기본 등) */
@media (max-width: 360px) {
    .container-fluid.px-4,
    .container-fluid.px-3 {
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
    }
    .card-soft .card-body {
        padding: 0.85rem 0.8rem;
    }
    .card-soft .card-header {
        padding: 0.75rem 0.8rem 0.35rem;
    }
    .card-soft .card-header h6.card-title {
        font-size: 0.82rem;
    }
    .gas-view-btn {
        font-size: 0.72rem !important;
        padding: 0.5rem 0.2rem !important;
    }
    .gas-view-btn i {
        display: none;
    }
    .table-sm th, .table-sm td {
        font-size: 0.68rem;
    }
}

/* ============================================
   Step 8: 모바일 모드 전체 일관화 (< 768px)
   - 768px 미만: 모바일 UI (하단 탭, 뒤로가기, 좁은 레이아웃)
   - 768px 이상: PC/탭 UI (상단 탭, 넓은 레이아웃)
   ============================================ */
@media (max-width: 767.98px) {
    /* 하단 탭 바는 모바일 모드에서만 표시. 기본은 .bottom-tab-bar가 CSS로 표시됨.
       상세/설정/관리자/테스트 페이지 진입 시에는 body에 .hide-bottom-tabs 클래스를
       JS가 부여하므로, 이 클래스가 있으면 숨김. */
    body.hide-bottom-tabs .bottom-tab-bar {
        display: none !important;
    }
    /* 본문 하단 여백도 하단 탭이 숨겨졌으면 제거 */
    body.hide-bottom-tabs .content-wrapper {
        padding-bottom: 0 !important;
    }
    /* 하위 페이지 진입 시 상단 헤더의 설정 버튼도 숨김 (모바일 앱 표준 패턴) */
    body.hide-bottom-tabs .mobile-nav .settings-btn {
        display: none !important;
    }

    /* 카드 내부 긴 텍스트 줄바꿈 안전망 (모바일에서 가로 오버플로우 방지) */
    .card-soft .card-body,
    .card-soft .card-header {
        overflow-wrap: break-word;
        word-break: keep-all;
    }

    /* 아이콘-텍스트 간격 일관화 (me-2가 0.5rem인데 모바일에서 너무 좁으면 8px 보장) */
    .card-title i.fas,
    .card-title i.far,
    .card-title i.fab,
    .tab-section-title i.fas,
    .tab-section-title i.far,
    h4 i.fas, h4 i.far, h4 i.fab,
    h5 i.fas, h5 i.far, h5 i.fab,
    h6 i.fas, h6 i.far, h6 i.fab {
        margin-right: 8px !important;
    }
}

/* ≥ 768px: PC/탭 모드. 하단 탭 바 자체를 숨김 (원래 디자인 유지) */
@media (min-width: 768px) {
    .bottom-tab-bar {
        display: none !important;
    }
}

/* ============================================
   급식 — 알레르기 배지
   ============================================ */
.meal-menu-list { padding-left: 0; }
.meal-menu-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    line-height: 1.6;
}
.meal-menu-name { flex-shrink: 0; }
.meal-menu-allergens { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.allergy-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.65rem;
    color: #495057;
    border: 1px solid rgba(0,0,0,0.06);
    line-height: 1.3;
    white-space: nowrap;
}
.allergy-emoji { font-size: 0.85em; }
.allergy-name { font-size: 0.7rem; }
/* 본인/자녀 알레르기 매칭 메뉴 */
.meal-menu-item.allergy-match {
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 4px 8px;
}
.meal-menu-item.allergy-match::before {
    content: "⚠️";
    margin-right: 4px;
}

/* 알레르기 등록 페이지 — 체크박스 그리드 */
.allergy-checks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 6px;
}
.allergy-check-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.78rem;
    user-select: none;
}
.allergy-check-item:hover { border-color: #1e6cb8; }
.allergy-check-item.checked {
    background: #cfe4f7;
    border-color: #1e6cb8;
    color: #0a4d8c;
    font-weight: 600;
}
.allergy-check-item input[type="checkbox"] {
    margin: 0;
    accent-color: #1e6cb8;
}
.allergy-check-item .allergy-emoji { font-size: 1rem; }

/* 공기질 — 주의보 배너 */
.advisory-card { border-left: 4px solid #f59e0b; }
.advisory-row { padding: 6px 0; }
.advisory-row.advisory-ylw { color: #92400e; }
.advisory-row.advisory-oz { color: #b45309; border-top: 1px dashed #e5e7eb; padding-top: 8px; margin-top: 6px; }
.advisory-card .small { font-size: 0.72rem; color: #6b7280; }

/* 공기질 민감도 옵션 */
.sensitivity-option {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
}
.sensitivity-option:hover { border-color: #1e6cb8; background: #fafbfc; }
.sensitivity-option.active {
    border-color: #1e6cb8;
    background: #cfe4f7;
    box-shadow: 0 0 0 1px #1e6cb8;
}
.sensitivity-radio { font-size: 1.2rem; }

/* 공기질 — 즐겨찾기 + 비교 뷰 */
.air-fav-area, .air-recent-area { margin-bottom: 8px; }
.air-fav-list, .air-recent-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.air-station-btn { flex-shrink: 0; white-space: nowrap; display: inline-flex; align-items: center; }
.air-compare-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.air-compare-card:hover { background: #eff4fb; }
.air-compare-worst {
    background: #fff5f5 !important;
    box-shadow: 0 0 0 1px #fca5a5;
}

/* 공기질 항목 — 바 형태 (6개) */
.air-items-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
    text-align: left;
}
.air-item-bar {
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: background 0.15s;
}
.air-item-bar:hover { background: #fafbfc; }
.air-item-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    font-size: 0.85rem;
}
.air-item-bar-label {
    color: #475569;
    font-weight: 600;
}
.air-item-bar-value strong { font-size: 1.05rem; }
.air-item-bar-grade {
    margin-left: 8px;
    font-size: 0.78rem;
    font-weight: 600;
}
.air-item-bar-track {
    position: relative;
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: visible; /* 마커가 bar 위로 솟음 */
    margin-top: 16px; /* lollipop 위쪽 공간 */
}
.air-item-bar-segment { flex: 1; }
.air-seg-1 { background: #c5d9ed; }
.air-seg-2 { background: #b9e3c5; }
.air-seg-3 { background: #fde0a3; }
.air-seg-4 { background: #fcc1bc; }
.air-item-bar-segment:first-child { border-radius: 5px 0 0 5px; }
.air-item-bar-segment:last-child { border-radius: 0 5px 5px 0; }

/* Lollipop 마커 — 세로선 + 위쪽 큰 원 */
.air-item-bar-marker {
    position: absolute;
    top: -12px;             /* bar 위로 12px 솟음 (이전 -16px에서 4px 내림) */
    bottom: 0;              /* bar 끝까지 세로선 연장 */
    width: 2px;
    background: rgba(0,0,0,0.18);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 2;
}
.air-item-bar-marker::before {
    /* 위쪽 큰 원 */
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--marker-color, #475569);
    border: 3px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.06);
}

/* 주유소 — 유종 가이드 행 (3유종 색상별 라벨) */
.gas-prod-guide {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    text-align: center;
    padding: 8px 12px;
}
.gas-prod-cell {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
}
.gas-prod-cell i { font-size: 0.5rem; margin-right: 4px; }

/* 카드 내 3유종 가격 그리드 (가이드 색상과 매칭) */
/* 주유소 — "내 주변 검색" 첫 진입 안내 pulse (subtle) */
@keyframes gasNearSearchPulse {
    0%   { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.55); transform: scale(1); }
    70%  { box-shadow: 0 0 0 12px rgba(40, 167, 69, 0); transform: scale(1.015); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); transform: scale(1); }
}
.gas-near-search-btn.pulsing {
    animation: gasNearSearchPulse 1.6s ease-out infinite;
}

.gas-prices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    text-align: center;
    margin: 4px 0 2px 0;
}
.gas-price-cell {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}
.gas-near-dist-row {
    margin-top: 2px;
    font-size: 0.74rem;
}

/* ---- 즐겨찾기 빈 상태 안내 (공기질·급식·아파트 공통) ---- */
.fav-empty-hint {
    color: #6c757d;
    font-size: 0.65rem;
    text-align: center;
    padding: 5px 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fav-empty-hint .fa-star {
    color: #f6c344;
    margin-right: 4px;
    font-size: 0.65rem;
}

/* ---- 즐겨찾기 토스트 (해제 시 + 되돌리기) ---- */
.fav-toast {
    position: fixed;
    left: 50%;
    bottom: 70px;
    transform: translate(-50%, 10px);
    background: rgba(50, 50, 50, 0.92);
    color: #fff;
    padding: 7px 10px;
    border-radius: 18px;
    font-size: 0.85rem;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    width: max-content;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
}
.fav-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
.fav-toast-msg {
    white-space: nowrap;
}
.fav-toast-undo {
    background: transparent;
    border: none;
    color: #4da3e0;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

/* 글로벌 로딩 스피너 — 검색·내 주변 찾기 시 250ms delay 후 표시 */
#globalLoading {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: none;
}
#globalLoading.visible {
    display: flex;
}
#globalLoading .loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #cfe4f7;
    border-top-color: #1e6cb8;
    border-radius: 50%;
    animation: minosSpin 0.8s linear infinite;
}
@keyframes minosSpin {
    to { transform: rotate(360deg); }
}

/* 정렬 버튼 — 모바일 가독성 */
.gas-sort-toggle .gas-sort-btn {
    padding: 0.32rem 0.85rem;
    font-size: 0.92rem;
    line-height: 1.3;
}

/* 홈 — 발효 주의보 알람 (독립 스타일, 작고 진한 빨강) */
.home-alert {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff1f1;
    border-left: 3px solid #c0392b;
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 4px;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.15s ease;
}
.home-alert:hover {
    background: #ffe4e4;
}
.home-alert i {
    color: #c0392b;
    flex-shrink: 0;
}
.home-alert strong {
    color: #991b1b;
    font-weight: 700;
}
.home-alert .home-alert-area {
    color: #7f1d1d;
    font-weight: 500;
    margin-left: 4px;
}

/* 홈 스켈레톤 — 자주 찾는·최근 본 placeholder */
.skeleton-card .skeleton-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    background: linear-gradient(90deg, #f0f2f5 25%, #e8eaed 50%, #f0f2f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
}
.skeleton-row .skeleton-icon-sm {
    width: 38px;
    height: 38px;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, #f0f2f5 25%, #e8eaed 50%, #f0f2f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-right: 0.85rem;
    flex-shrink: 0;
}

/* 카드 row3 (거리 + 액션) */
.gas-near-row3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}
.gas-near-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.gas-fav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
}

/* 주유소 — 내 주변 검색 */
.gas-brand-summary { padding: 6px 0; }
.gas-brand-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.72rem;
    border: 1px solid;
    border-radius: 12px;
    background: #fff;
    white-space: nowrap;
}
.gas-near-list { display: flex; flex-direction: column; gap: 8px; }
.gas-near-item {
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    position: relative;
}
.gas-near-row2-wrap {
    display: grid;
    grid-template-columns: 1fr 90px;
    column-gap: 8px;
    align-items: center;
}
.gas-near-dist-cell {
    text-align: right;
    font-size: 0.74rem;
    color: #6c757d;
    line-height: 1;
    white-space: nowrap;
}
.gas-near-row1 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.gas-near-row2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}
.gas-near-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.gas-brand-tag {
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    flex-shrink: 0;
}
.gas-near-name { flex: 1; font-size: 0.88rem; }
.gas-near-price { font-size: 1rem; font-weight: 700; color: #1e6cb8; line-height: 1; }
.gas-near-dist {
    white-space: nowrap;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    height: 28px;
}
.gas-near-addr { font-size: 0.7rem; }
.gas-pin-btn {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    flex-shrink: 0;
}
.gas-near-item { cursor: pointer; transition: background 0.15s; }
.gas-near-item:hover { background: #f8fafc; }
.gas-near-item.gas-near-active { background: #cfe4f7; box-shadow: 0 0 0 2px #1e6cb8; }
.gas-fav-item { background: #fffbe9; border-color: #fbd24c; }
.gas-fav-item:hover { background: #fff5cc; }

/* 주유소 — 시군구 평균 (시도 row expand) */
.gas-sigungu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 4px;
    padding: 8px;
}
.gas-sigungu-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: #fff;
    border-radius: 4px;
    font-size: 0.72rem;
}
.gas-sigungu-name { color: #475569; }
.gas-sigungu-price { font-weight: 600; color: #1e6cb8; }

/* 공연·전시 — 종료 임박 카드 */
.culture-card { position: relative; }
.culture-closing-soon {
    border-left: 4px solid #dc2626 !important;
    background: linear-gradient(90deg, rgba(220,38,38,0.04) 0%, transparent 30%);
}
/* 우측 상단 위치 핀 버튼 (gps 있을 때만 표시) */
.culture-card-arrow {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #1e6cb8;
    cursor: pointer;
    transition: all 0.15s;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.culture-card-arrow i {
    font-size: 0.85rem;
    line-height: 1;
    display: block;
    transform: translateX(3px);
}
.culture-card-arrow:hover {
    background: #1e6cb8;
    color: #fff;
    border-color: #1e6cb8;
}

/* 공연·전시 — 필터 행 높이·간격 통일 */
#cultureFilters {
    gap: 4px !important;
    align-items: center;
}
#cultureSido {
    font-size: 0.68rem !important;
    width: 78px !important;
    padding: 0.18rem 1.1rem 0.18rem 0.35rem !important;
    height: 26px !important;
    line-height: 1.1;
}
#culturePeriodBtns .culture-period-btn,
#cultureFreeBtn {
    height: 26px;
    padding: 2px 7px !important;
    font-size: 0.68rem !important;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* 시간별 측정 데이터 표 — 2줄 셀 + 배지 제거 */
.air-hourly-table {
    font-size: 0.82rem;
}
.air-hourly-table th,
.air-hourly-table td {
    vertical-align: middle !important;
}
.air-hourly-table th {
    text-align: center;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 6px 4px !important;
}
.air-hourly-table th .th-unit {
    font-size: 0.62rem;
    color: #94a3b8;
    font-weight: 400;
    margin-top: 1px;
}
.air-hour-cell {
    text-align: center;
    padding: 6px 4px !important;
}
.air-hour-num {
    font-weight: 400;          /* 600 → 400 — 숫자 굵기 제거 */
    font-size: 0.88rem;
    line-height: 1.2;
}
.air-hour-grade {
    font-size: 0.68rem;
    margin-top: 1px;
    line-height: 1;
}
@media (max-width: 480px) {
    .air-hourly-table th { font-size: 0.7rem; padding: 4px 2px !important; }
    .air-hourly-table th .th-unit { font-size: 0.58rem; }
    .air-hour-cell { padding: 4px 2px !important; }
    .air-hour-num { font-size: 0.82rem; }
    .air-hour-grade { font-size: 0.62rem; }
}

/* 항목 expand */
.air-item-expand {
    border-top: 1px dashed #e2e8f0;
    margin-top: 10px;
    padding-top: 10px;
}
.air-item-action {
    background: #f8fafc;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.82rem;
    color: #334155;
    margin-bottom: 8px;
}
.air-item-limits {
    background: #fff;
    border-left: 3px solid #cfe4f7;
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 0.72rem;
}

/* 급식 — 즐겨찾기 + 최근 검색 영역 */
.meal-fav-area, .meal-recent-area {
    margin-bottom: 8px;
}
.meal-fav-list, .meal-recent-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.meal-fav-list::-webkit-scrollbar,
.meal-recent-list::-webkit-scrollbar {
    height: 4px;
}
.meal-fav-list::-webkit-scrollbar-thumb,
.meal-recent-list::-webkit-scrollbar-thumb {
    background: #cfe4f7;
    border-radius: 2px;
}
.meal-school-btn {
    flex-shrink: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}
.fav-toggle-inline {
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.fav-toggle-inline:hover { opacity: 0.8; }

@media (max-width: 480px) {
    .meal-fav-list, .meal-recent-list {
        gap: 5px;
    }
    .meal-school-btn {
        font-size: 0.72rem !important;
        padding: 0.15rem 0.5rem !important;
    }
}

/* 급식 페이지 알레르기 등록 안내 배너 */
.allergy-banner {
    background: #fff3cd;
    border: 1px solid #ffe69c;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.allergy-banner:hover { background: #ffeeba; }
.allergy-banner-icon {
    font-size: 1.2rem;
    color: #856404;
    flex-shrink: 0;
}
.allergy-banner-text {
    flex: 1;
    font-size: 0.82rem;
    color: #664d03;
    line-height: 1.4;
}
.allergy-banner-close {
    background: transparent;
    border: none;
    color: #856404;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 6px;
}
.allergy-banner-close:hover { color: #533f03; }


/* 공연·전시 카드 — 선택 효과 (배경색 + 그림자, 종료 임박 좌측 테두리와 충돌 X) */
.culture-card { cursor: pointer; transition: background-color 0.15s, box-shadow 0.15s; }
.culture-card.culture-active {
    background-color: #cfe4f7 !important;
    box-shadow: 0 2px 10px rgba(30, 108, 184, 0.25);
    border-right: 3px solid #1e6cb8;
}
