/* ==========================================================================
   Kids Trip - Global & Dashboard Stylesheet
   Version: 1.4.1 (KTDS Design System Integration)

   ⚠️ tokens.css / components.css는 더 이상 @import하지 않는다.
   CSS @import 대상 URL은 build_templates.py의 캐시 버스팅(?v=...)이 닿지 않아
   Cloudflare 엣지/브라우저에 최대 7일(+30일 stale-while-revalidate) 그대로
   캐시되며, 매 배포마다 새로 붙는 <link>의 tokens.css를 소스 순서상 뒤에서
   재정의해 무효화시키는 사고까지 발생했다(2026-09-04). 두 파일 모두
   head_common.html에 tokens.css → components.css → style.css 순서의 <link>로
   직접 연결해 동일한 캐시 버스팅 쿼리스트링을 받도록 한다. 절대 되돌리지 말 것.
   ========================================================================== */

/* --------------------------------------------------------------------------
   2. Reset & Base Setup
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: 1rem;
}

/* Layout Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 0.5rem;
    box-sizing: border-box;
    min-width: 0;
}

main {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
}

/* --------------------------------------------------------------------------
   3. Global Ambient Lighting & Header
   -------------------------------------------------------------------------- */
.ambient-glow {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 450px;
    background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.08) 0%, rgba(16, 185, 129, 0.04) 40%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    gap: 0.75rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 20px;
    box-sizing: border-box;
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-blue));
    color: var(--color-white);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0 6px;
    border-radius: var(--radius-xs);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Header Controls */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.departure-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 44px;
}

.departure-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 44px;
    box-sizing: border-box;
    display: inline-block;
    background: var(--bg-secondary);
    color: var(--accent-emerald);
    border: 1px solid var(--border-color);
    padding: 0 2.25rem 0 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 42px;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    max-width: 135px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

@media (min-width: 640px) {
    .departure-select {
        min-width: 156px;
        max-width: 190px;
    }
}

.departure-select:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.departure-select:focus {
    border-color: var(--accent-emerald);
    background: var(--bg-card-hover);
    box-shadow: 0 0 0 3px var(--accent-emerald-glow);
    outline: none;
}

/* 정밀 수직 중앙 정렬 CSS Chevron 화살표 */
.departure-select-wrapper::after {
    content: '';
    position: absolute;
    right: 0.875rem;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
    transition: transform var(--duration-fast) var(--ease-spring), border-color var(--duration-fast) ease;
}

.departure-select-wrapper:hover::after,
.departure-select:focus-within + ::after,
.departure-select-wrapper:focus-within::after {
    border-color: var(--accent-emerald);
}

/* [CSS_JS_COMMONIZATION_REFACTOR_PLAN.md §2.2/§2.3] .btn-icon 정의는
   components.css로 단일화됨(48px 터치 규격 토큰 적용) — 여기서 재정의하지 말 것. */

.badge-count {
    background: var(--accent-rose);
    color: var(--color-white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   4. Search & Quick Filters Bar
   -------------------------------------------------------------------------- */
.search-section {
    padding: 1rem 0 0.5rem 0;
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.search-bar-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.search-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0 2.8rem 0 2.8rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px var(--accent-blue-glow);
    background: var(--bg-card-hover);
    outline: none;
}

.search-icon-left {
    position: absolute;
    left: 1rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    width: 44px;
    height: 44px;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    flex-shrink: 0;
    z-index: 2;
}

.search-clear-btn.visible {
    display: flex;
}

/* Hero Quick Filter Chips */
.quick-filters-scroll {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.quick-filters-scroll::-webkit-scrollbar {
    display: none;
}

.quick-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.quick-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.quick-chip.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(56, 189, 248, 0.2));
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
    box-shadow: 0 0 12px var(--accent-emerald-glow);
}

/* --------------------------------------------------------------------------
   5. Guide & Intro Banner (Collapsible)
   -------------------------------------------------------------------------- */
.guide-banner {
    background: linear-gradient(135deg, #FFFFFF 0%, #F0FDF4 100%);
    border: 1.5px solid rgba(16, 185, 129, 0.22);
    border-radius: var(--radius-lg);
    margin: 0.5rem 0 1rem 0;
    overflow: hidden;
    box-shadow: 0 4px 16px -2px rgba(5, 150, 105, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

[data-theme="dark"] .guide-banner {
    background: linear-gradient(135deg, rgba(19, 27, 46, 0.95), rgba(15, 23, 42, 0.98));
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.guide-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(16, 185, 129, 0.12);
    transition: background-color var(--duration-fast) ease;
}

.guide-banner-header:hover {
    background: rgba(16, 185, 129, 0.06);
}

[data-theme="dark"] .guide-banner-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .guide-banner-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.guide-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.guide-toggle-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.guide-banner.collapsed .guide-toggle-icon {
    transform: rotate(-90deg);
}

.guide-banner.collapsed .guide-banner-body {
    display: none;
}

.guide-banner-body {
    padding: 1rem 1.25rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
}

.category-summary-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.category-summary-card:hover {
    border-color: var(--accent-emerald);
    background: var(--accent-emerald-tint);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-emerald-glow);
}

[data-theme="dark"] .category-summary-card {
    background: rgba(11, 15, 25, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .category-summary-card:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--accent-emerald);
}

.category-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.category-badge-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-emerald);
    background: var(--accent-emerald-tint);
    border: 1px solid rgba(5, 150, 105, 0.2);
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.category-card-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.guide-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
}

.guide-step-item {
    flex: 1 1 220px;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.step-num {
    background: rgba(5, 150, 105, 0.12);
    color: var(--accent-emerald);
    border: 1px solid rgba(5, 150, 105, 0.25);
    font-weight: 800;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: var(--radius-xs);
    white-space: nowrap;
    margin-top: 2px;
}

/* --------------------------------------------------------------------------
   6. Dashboard Controls (Category Tabs, View Switcher & Filter Bar)
   -------------------------------------------------------------------------- */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   6. Category 2-Depth System (KTDS v1.0.0 Standard)
   ========================================================================== */

/* 6.1 Tier 1 Segmented Navigation */
.category-tier1-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 4px;
    gap: 4px;
    min-height: 52px;
    contain-intrinsic-size: 0 52px;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .category-tier1-nav {
    background: rgba(15, 23, 42, 0.7);
    border-color: var(--border-color);
}

.tier1-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: var(--touch-min-size, 48px);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.tier1-tab:hover {
    color: var(--accent-emerald);
    background: var(--accent-emerald-tint);
}

.tier1-tab.active {
    background: var(--bg-primary);
    color: var(--accent-emerald);
    font-weight: 700;
    border-color: rgba(5, 150, 105, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(5, 150, 105, 0.1);
}

[data-theme="dark"] .tier1-tab:hover {
    color: var(--color-emerald-400);
    background: rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .tier1-tab.active {
    background: var(--bg-secondary);
    color: var(--color-emerald-400);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.tier1-tab-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.tier1-tab-label {
    white-space: nowrap;
}

.tier1-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    background: rgba(5, 150, 105, 0.12);
    color: var(--accent-emerald);
    line-height: 1;
    transition: all 0.2s ease;
}

.tier1-tab.active .tier1-tab-count {
    background: var(--accent-emerald);
    color: #ffffff;
}

/* 6.1.5 [1.5차 Depth] 대그룹(4개) 상시 칩 바 — 전체/놀거리·체험/숙소 모든 탭에서 노출(숙소 탭은 하위 그룹이 없어 예외).
   시각 스타일은 6.2절 .tier2-chip을 그대로 재사용(class="tier2-chip subgroup-chip")하여 그룹 칩 ↔ 카테고리 칩 간
   크기가 상태 전환 시 달라지지 않도록 통일한다(CATEGORY_REORGANIZATION_PLAN.md v1.1 §4.1, 2026-08-30 개정). */
.category-subgroup-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    min-height: 48px;
    contain-intrinsic-size: 0 48px;
    padding: 2px 0 4px 0;
}

.category-subgroup-bar[hidden] {
    display: none;
}

.subgroup-chip[hidden] {
    display: none !important;
}

.category-subgroup-bar::-webkit-scrollbar {
    display: none;
}

/* 6.2 Tier 2 Horizontal Scrollable Chips Bar */
.category-tier2-bar {
    width: 100%;
    min-height: 48px;
    contain-intrinsic-size: 0 48px;
}

.tier2-chips-scroll {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    padding: 2px 0 6px 0;
}

.tier2-chips-scroll::-webkit-scrollbar {
    display: none;
}

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

.tier2-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.45rem 1.05rem;
    min-height: var(--touch-min-size, 48px);
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.18s ease;
    flex-shrink: 0;
    scroll-snap-align: start;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    animation: chipFadeSlideIn 0.2s ease-out;
}

.tier2-chip:hover {
    color: var(--color-emerald-700);
    background: var(--accent-emerald-tint);
    border-color: rgba(5, 150, 105, 0.35);
}

.tier2-chip.active {
    background: linear-gradient(135deg, var(--color-emerald-600) 0%, var(--color-emerald-700) 100%);
    color: #ffffff !important;
    border-color: var(--color-emerald-700);
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(4, 120, 87, 0.25);
}

.tier2-chip .chip-num {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.85;
}

.tier2-chip.active .chip-num {
    opacity: 1;
    color: #d1fae5;
}

[data-theme="dark"] .tier2-chip:hover {
    color: var(--color-emerald-400);
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .tier2-chip.active {
    background: var(--color-emerald-600);
    color: #ffffff !important;
    border-color: var(--color-emerald-500);
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

/* 모바일 576px 이하 최적화 */
@media (max-width: 576px) {
    .category-tier1-nav {
        padding: 3px;
        gap: 3px;
        min-height: 48px;
    }
    .tier1-tab {
        padding: 6px 6px;
        font-size: 0.83rem;
        gap: 4px;
    }
    .tier1-tab-icon {
        font-size: 1rem;
    }
    .tier1-tab-count {
        padding: 1px 5px;
        font-size: 0.65rem;
    }
    .tier2-chip {
        padding: 0.4rem 0.85rem;
        font-size: 0.8rem;
    }
}

/* Filter Summary & View Switcher Row */
.filter-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-left-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.btn-filter-trigger:hover {
    border-color: var(--accent-blue);
    background: var(--bg-card-hover);
}

.filter-count-badge {
    background: var(--accent-blue);
    color: var(--text-inverse);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

.results-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.results-count b {
    color: var(--accent-emerald);
}

.btn-share-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--accent-emerald-tint);
    border: 1.5px solid var(--accent-emerald);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-emerald);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: var(--touch-min-size);
}

.btn-share-trigger:hover {
    background: var(--accent-emerald);
    color: var(--text-inverse);
}

.btn-share-trigger:active {
    transform: scale(0.97);
}

.btn-share-trigger .share-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.btn-share-trigger .share-text {
    line-height: 1;
}

.filter-right-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sort Dropdown */
.sort-select {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.sort-select:focus {
    border-color: var(--accent-blue);
    outline: none;
}

/* View Switcher */
.view-switcher {
    display: inline-flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2px;
}

.view-btn {
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.view-btn.active {
    background: var(--bg-card-hover);
    color: var(--accent-blue);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   7. Card Grid View
   -------------------------------------------------------------------------- */
.places-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .places-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .places-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

.place-card {
    background: var(--bg-secondary);
    background-clip: padding-box;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 385px;
    content-visibility: auto;
    contain-intrinsic-size: 0 385px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: 0 6px 20px -3px rgba(15, 23, 42, 0.08), 0 2px 6px 0 rgba(15, 23, 42, 0.04);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    cursor: pointer;
}

/* [M1.11] Tier별 상단 테두리는 헤더 내부 카테고리 악센트 라인과 일체화되어
   .place-card 자체의 border-top/data-tier 분기는 더 이상 필요하지 않다
   (라이트/다크 공통 정책, 아래 다크 모드 규칙도 동일하게 적용). */

@media (max-width: 639px) {
    .place-card {
        padding: 0;
    }
}

.place-card:hover {
    border-color: var(--color-emerald-700);
    background: var(--bg-secondary);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px -4px rgba(5, 150, 105, 0.26), 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* Dark Mode Place Card (기존 다크 텍스트/보더 유지 + 앵커 조화)
   [M1.11 다크 회귀 수정] 기존 tier 기반 border-top 4px 앵커를 유지한 채 신규
   .card-header-hero.no-photo의 카테고리 3px accent border-top이 그대로 겹쳐
   렌더링되어 다크 테마 카드 상단에 이중선이 발생했다. 라이트 모드와 동일하게
   outer border-top을 제거하고 헤더 내부 악센트 라인 단일 소스로 통일한다. */
[data-theme="dark"] .place-card {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color); /* var(--color-slate-700) */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .place-card:hover {
    border-color: var(--accent-emerald);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.25);
}

/* Card Header */
.card-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    gap: 0.5rem;
    min-width: 0;
}

.card-badges {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1;
}

.badge-tier {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
}

.badge-tier.tier-1,
.badge-tier.badge-tier-1 {
    background: linear-gradient(135deg, var(--accent-emerald), #047857);
    color: var(--color-white) !important;
    box-shadow: 0 2px 6px var(--accent-emerald-glow);
}

.badge-tier.tier-2,
.badge-tier.badge-tier-2 {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-tier.tier-3,
.badge-tier.badge-tier-3,
.badge-tier.tier-4,
.badge-tier.badge-tier-4,
.badge-tier.tier-5,
.badge-tier.badge-tier-5 {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

/* [CSS_JS_COMMONIZATION_REFACTOR_PLAN.md §2.2/§2.3] .badge-rating 정의는
   components.css로 단일화됨(토큰 기반 색상/크기 적용) — 여기서 재정의하지 말 것. */

/* .badge-travel은 §2.4 CSS_JS_COMMONIZATION_REFACTOR_PLAN.md 정리로
   components.css로 이관되었다 — 이 파일에서 값을 바꾸지 말고 components.css를
   수정할 것. */

.btn-heart {
    min-width: var(--touch-min-size);
    min-height: var(--touch-min-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 1.15rem;
    transition: transform var(--duration-fast) var(--ease-spring), color var(--duration-fast) ease;
    border: 1px solid transparent;
}

.btn-heart:hover {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    transform: scale(1.15);
}

.btn-heart.favorited {
    color: var(--accent-rose);
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.3);
    animation: heartPop 0.35s var(--ease-bounce);
}

/* Card Body */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.place-name {
    font-size: 1.125rem;
    font-weight: 800; /* [쇼케이스 기준] 800 Extra Bold 고농도 차콜 잉크 */
    color: var(--text-primary);
    letter-spacing: -0.3px;
    line-height: 1.35;
}

.place-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: var(--text-secondary); /* [쇼케이스 기준] Slate 700 고대비 */
    font-weight: 600;
}

.place-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.2rem 0;
}

/* .tag-badge는 §2.4 CSS_JS_COMMONIZATION_REFACTOR_PLAN.md 정리로 components.css로
   이관되었다 — 이 파일에서 값을 바꾸지 말고 components.css를 수정할 것. */

.booking-info-box {
    background: linear-gradient(135deg, var(--color-white) 0%, var(--color-emerald-50) 100%);
    border: 1.5px solid rgba(16, 185, 129, 0.30);
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-emerald-900);
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.05);
}

.booking-info-box strong {
    color: var(--color-emerald-700);
}

/* Dark Mode Typography & Box Overrides (현재안 유지) */
[data-theme="dark"] .place-name {
    color: var(--text-primary); /* #F1F5F9 */
}

[data-theme="dark"] .place-meta {
    color: var(--text-secondary); /* #94A3B8 */
    font-weight: 500;
}

[data-theme="dark"] .tag-badge {
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-emerald-400);
    border-color: rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .booking-info-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--color-emerald-400);
    box-shadow: none;
}

[data-theme="dark"] .booking-info-box strong {
    color: var(--accent-emerald);
}

/* Card Footer Actions */
.place-card .card-actions,
.card-actions {
    display: flex;
    gap: 0.45rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.place-card .card-actions .btn-action,
.btn-action {
    flex: 1 1 0;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    padding: 0 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    box-sizing: border-box;
    transition: all var(--duration-fast) ease;
}

.place-card .btn-action-primary,
.btn-action-primary {
    background: var(--accent-emerald-tint);
    border: 1.5px solid var(--accent-emerald);
    color: var(--accent-emerald);
}

.place-card .btn-action-primary:hover,
.btn-action-primary:hover {
    background: var(--accent-emerald);
    color: var(--color-white) !important;
}

.place-card .btn-action-secondary,
.btn-action-secondary {
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
}

.place-card .btn-action-secondary:hover,
.btn-action-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.place-card .btn-action-ghost,
.btn-action-ghost {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.place-card .btn-action-ghost:hover,
.btn-action-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

[data-theme="dark"] .place-card .btn-action-secondary {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .place-card .btn-action-ghost {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   8. Table View
   -------------------------------------------------------------------------- */
.places-table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.places-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.places-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.places-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.places-table tbody tr {
    content-visibility: auto;
    contain-intrinsic-size: 0 52px;
}

.places-table tr:hover td {
    background: var(--bg-card-hover);
}

/* --------------------------------------------------------------------------
   9. Map View (Leaflet.js)
   -------------------------------------------------------------------------- */
.map-view-wrapper {
    position: relative;
    width: 100%;
    height: 65vh;
    min-height: 480px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

#map-container {
    width: 100%;
    height: 100%;
    background: var(--color-slate-900);
}

.map-preview-sheet {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: 420px;
    margin: 0 auto;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    padding: 1rem;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: none;
    animation: slideUp 0.25s ease-out;
}

.map-preview-sheet.active {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

/* --------------------------------------------------------------------------
   10. Multi-Dimensional Filter Modal / Bottom Sheet
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1500;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

@media (min-width: 768px) {
    .modal-overlay {
        align-items: center;
    }
}

.filter-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@media (min-width: 768px) {
    .filter-modal-content {
        border-radius: var(--radius-xl);
        max-height: 80vh;
    }
}

@keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close-modal {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.btn-close-modal:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.filter-group-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 480px) {
    .filter-checkbox-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-checkbox-label:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.filter-checkbox-label input[type="checkbox"]:checked + span {
    color: var(--accent-blue);
    font-weight: 700;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    padding-bottom: calc(0.85rem + var(--safe-bottom));
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    gap: 0.75rem;
}

.btn-reset-filters {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: underline;
    padding: 0.5rem;
}

.btn-apply-filters {
    flex: 1;
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-blue));
    color: var(--text-inverse);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: 0 4px 12px var(--accent-emerald-glow);
}

/* --------------------------------------------------------------------------
   11. Mobile Bottom Navigation Bar
   -------------------------------------------------------------------------- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 50px;
    flex: 1;
    height: 100%;
    position: relative;
    box-sizing: border-box;
}

.nav-item.active {
    color: var(--accent-emerald);
}

/* Data-Page Driven Automatic Active States & Display Control */
body[data-page="home"] .nav-item-home,
body[data-page="calendar"] .nav-item-calendar {
    color: var(--accent-emerald) !important;
    font-weight: 800;
}

body[data-page="home"] .header-nav-home,
body[data-page="calendar"] .header-nav-calendar {
    color: var(--accent-emerald) !important;
    font-weight: 800;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 1rem);
    }
    .pc-only {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
   12. Footer
   [§2.4 CSS_JS_COMMONIZATION_REFACTOR_PLAN.md] .site-footer의 실제 렌더링 정의는
   legal_modal.css(로딩 순서상 항상 승리)에 있고, 그 파일이 나머지 3-Tier 푸터
   서브 컴포넌트(.footer-top-grid/.footer-brand-col/.footer-bottom-bar 등)까지
   전부 소유하는 구조라 이 파일의 .site-footer 정의는 도달 불가 데드코드였다.
   푸터 컴포넌트 전체를 쪼개서 옮기는 대신 legal_modal.css를 그대로 단일 소유자로
   유지하고 이 파일의 중복 정의만 삭제했다(시각적 변경 없음, legal_modal.css:9 참고).
   -------------------------------------------------------------------------- */

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.footer-inner p {
    max-width: 100%;
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.45;
}

.footer-links {
    display: flex;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.footer-links a {
    padding: 0.2rem 0.4rem;
    white-space: nowrap;
    font-size: 0.8rem;
}

.footer-links a:hover {
    color: var(--text-primary);
}
