/* =====================================================
   서울특별시교육청 학교정보 대시보드 — Design System v3
   Clean · Readable · Modern Minimal
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

/* ── 1. Design Tokens ─────────────────────────────── */
:root {
  /* Base Colors */
  --bg-primary: #F8F9FB;
  --bg-secondary: #FFFFFF;
  --bg-surface: #F1F3F6;
  --bg-card: #FFFFFF;

  /* Accent */
  --accent: #1A56DB;
  --accent-h: #1447C0;
  --accent-soft: rgba(26, 86, 219, 0.08);
  --accent-border: rgba(26, 86, 219, 0.25);

  /* School type */
  --color-elementary: #059669;
  --color-middle: #2563EB;
  --color-high: #7C3AED;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  --text-inverse: #FFFFFF;

  /* Border */
  --border: #E5E7EB;
  --border-strong: #D1D5DB;

  /* Shadow */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.13);

  /* Typography */
  --font-base: 'Noto Sans KR', -apple-system, sans-serif;

  /* Layout */
  --header-h: 56px;
  --filter-h: 44px;
  --sidebar-w: 420px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --t-fast: 0.12s ease;
  --t-base: 0.2s ease;
  --t-slow: 0.35s ease;
}

/* ── 2. Reset ─────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

input,
select {
  font-family: inherit;
}

img {
  max-width: 100%;
}

/* ── 3. Header ────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 1000;
  box-shadow: var(--shadow-xs);
}

.header-left {
  flex: 0 0 auto;
}

.header-center {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.header-right {
  flex: 0 0 auto;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── 4. Search ────────────────────────────────────── */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 0 14px;
  gap: 8px;
  transition: border-color var(--t-base), box-shadow var(--t-base);
  max-width: 420px;
  width: 100%;
}

.search-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
  background: var(--bg-secondary);
}

.search-icon {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

#school-search {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.92rem;
  padding: 9px 0;
  min-width: 0;
  ime-mode: active;
}

#school-search::placeholder {
  color: var(--text-muted);
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
}

.search-suggestions.hidden {
  display: none;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--t-fast);
  font-size: 0.83rem;
}

.suggestion-item:hover {
  background: var(--bg-surface);
}

.suggestion-badge {
  font-size: 0.73rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  flex-shrink: 0;
}

.suggestion-badge.초등학교 {
  background: rgba(5, 150, 105, 0.1);
  color: var(--color-elementary);
}

.suggestion-badge.중학교 {
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-middle);
}

.suggestion-badge.고등학교 {
  background: rgba(124, 58, 237, 0.1);
  color: var(--color-high);
}

.suggestion-name {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.suggestion-district {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── 5. Mode Toggle ──────────────────────────────── */
.mode-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 3px;
  border: 1px solid var(--border);
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--t-base);
  white-space: nowrap;
  line-height: 1;
}

.mode-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26, 86, 219, 0.3);
}

.mode-btn:hover:not(.active) {
  color: var(--text-primary);
  background: var(--border);
}

.mode-label {
  font-size: 0.86rem;
  line-height: 1;
}

/* ── 6. Main Layout ──────────────────────────────── */
.app-main {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
}

/* ── 7. Filter Bar ───────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--filter-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
  z-index: 100;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 15px;
  border-radius: var(--radius-xl);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  background: transparent;
  transition: all var(--t-base);
  white-space: nowrap;
  line-height: 1.2;
}

.filter-chip.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.filter-chip:hover:not(.active) {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

.district-select {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.86rem;
  padding: 5px 11px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--t-base);
  flex-shrink: 0;
}

.district-select:focus {
  border-color: var(--accent);
}

.district-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.filter-stats {
  margin-left: auto;
  flex-shrink: 0;
}

.stats-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stats-text strong {
  color: var(--accent);
  font-weight: 600;
}

/* ── 8. Map + Sidebar Container ─────────────────── */
.map-container {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

#map {
  flex: 1;
  width: 100%;
  height: 100%;
}

/* ── 9. Sidebar (PC) ─────────────────────────────── */
.sidebar {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.sidebar-section {
  padding-bottom: 24px;
}

/* ── 10. Sidebar Default State ───────────────────── */
.sidebar-hero {
  padding: 28px 20px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(26, 86, 219, 0.04) 0%, transparent 60%);
}

.hero-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.hero-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Stats Overview */
.stats-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.stat-card {
  padding: 16px 12px;
  text-align: center;
  transition: background var(--t-fast);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-card:nth-child(even) {
  border-right: none;
}

.stat-card:nth-last-child(-n+2) {
  border-bottom: none;
}

.stat-card:hover {
  background: var(--bg-surface);
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

/* ── 11. School Detail Header ────────────────────── */
.school-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.back-btn {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.back-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.school-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0 10px;
  height: 24px;
  border-radius: 12px;
  line-height: 1;
  margin-bottom: 8px;
}

.school-badge.초등학교 {
  background: rgba(5, 150, 105, 0.1);
  color: var(--color-elementary);
}

.school-badge.중학교 {
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-middle);
}

.school-badge.고등학교 {
  background: rgba(124, 58, 237, 0.1);
  color: var(--color-high);
}

.school-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 6px;
}

.school-address {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.school-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-item {
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.meta-link {
  color: var(--accent);
  transition: color var(--t-fast);
}

.meta-link:hover {
  color: var(--accent-h);
  text-decoration: underline;
}

/* ── 12. Quick Stats ─────────────────────────────── */
.quick-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.quick-stat {
  padding: 14px 8px;
  text-align: center;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.quick-stat:last-child {
  border-right: none;
}

.qs-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.qs-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.2;
  text-align: center;
}

/* ── 13. Mode Content Panels ─────────────────────── */
.mode-content {
  padding: 0;
}

.mode-panel {}

.mode-panel.hidden {
  display: none;
}

.panel-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.panel-section:last-child {
  border-bottom: none;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Legend in sidebar default */
.panel-section [style*="flex-direction:column"] div {
  color: var(--text-secondary) !important;
}

/* ── 14. Meal Card ───────────────────────────────── */
.meal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
  min-height: 60px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  user-select: none;
}

/* 주간 급식 네비게이터 */
.meal-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.meal-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  line-height: 1;
}

.meal-nav-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
}

.meal-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--border);
  background: transparent;
  color: var(--text-muted);
}

.meal-nav-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.meal-nav-center:hover .meal-week-label {
  color: var(--accent);
}

.meal-week-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  line-height: 1.2;
  transition: color var(--t-fast);
}

.meal-week-range {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 1px;
}

.meal-swipe-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  user-select: none;
}

.meal-tab.no-meal {
  opacity: 0.6;
}

.meal-tabs {
  display: flex;
  gap: 3px;
  width: 100%;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 6px;
  overflow-x: auto;
}

.meal-tab {
  flex: 1;
  background: transparent;
  border: 1.5px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 44px;
}

.meal-tab:hover {
  background: var(--border);
  color: var(--text-primary);
}

.meal-tab.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
  font-weight: 600;
}

.meal-tab.today {
  border-color: #F59E0B;
}

.meal-tab-date {
  font-size: 0.62rem;
  opacity: 0.7;
}

.meal-content {
  width: 100%;
}

.meal-type-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(5, 150, 105, 0.1);
  color: var(--color-elementary);
  margin-bottom: 6px;
}

.meal-menu {
  color: var(--text-primary);
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.7;
}

.meal-kcal {
  font-size: 0.8rem;
  color: #D97706;
  margin-top: 4px;
  font-weight: 600;
}

.meal-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

.meal-empty {
  color: var(--text-muted);
  font-style: italic;
  align-self: center;
}

/* ── 15. Schedule List ───────────────────────────── */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.schedule-date {
  font-weight: 700;
  color: var(--accent);
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.schedule-name {
  color: var(--text-primary);
  flex: 1;
}

.schedule-empty {
  color: var(--text-muted);
  font-size: 0.83rem;
  font-style: italic;
  text-align: center;
  padding: 10px;
}

/* ── 16. Chart Containers ────────────────────────── */
.charts-row {
  position: relative;
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.stats-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
}

.chart-label {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── 17. Gauge Bar ───────────────────────────────── */
.gauge-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gauge-bar-wrap {}

.gauge-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-weight: 500;
}

.gauge-track {
  position: relative;
  background: var(--bg-surface);
  border-radius: 20px;
  height: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.gauge-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.gauge-fill.school {
  background: linear-gradient(90deg, var(--accent), #60A5FA);
}

.gauge-fill.district {
  background: linear-gradient(90deg, #D97706, #FCD34D);
}

.gauge-fill.city {
  background: linear-gradient(90deg, var(--color-elementary), #34D399);
}

.gauge-val {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  mix-blend-mode: difference;
  white-space: nowrap;
}

/* ── 18. Academy List ────────────────────────────── */
.academy-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.academy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.academy-name {
  color: var(--text-primary);
  font-weight: 500;
}

.academy-meta {
  color: var(--text-muted);
}

.academy-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ── 19. Shortcut Grid ───────────────────────────── */
.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.shortcut-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 10px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  transition: all var(--t-base);
  line-height: 1;
  min-height: 42px;
}

.shortcut-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ── 20. Hidden Utility ──────────────────────────── */
.hidden {
  display: none !important;
}

/* ── 21. Loading Spinner ─────────────────────────── */
.loading-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 14px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── 22. Toast Notifications ─────────────────────── */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  pointer-events: auto;
  animation: toastIn 0.3s ease forwards;
  max-width: 320px;
}

.toast.success {
  border-color: rgba(5, 150, 105, 0.4);
}

.toast.error {
  border-color: rgba(220, 38, 38, 0.4);
}

.toast.info {
  border-color: var(--accent-border);
}

.toast.fade-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* ── 23. Bottom Sheet (Mobile) ───────────────────── */
.bottom-sheet {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 500;
  transform: translateY(calc(100% - 64px));
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
  max-height: 90vh;
}

.bottom-sheet.open {
  transform: translateY(0);
}

.bottom-sheet.peek {
  transform: translateY(calc(100% - 64px));
}

.sheet-handle {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 44px;
  cursor: grab;
  flex-shrink: 0;
}

.sheet-handle:active {
  cursor: grabbing;
}

.handle-bar {
  width: 36px;
  height: 3px;
  background: var(--border-strong);
  border-radius: 2px;
}

.sheet-content {
  overflow-y: auto;
  max-height: calc(90vh - 44px);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 400;
  transition: opacity var(--t-base);
}

.overlay.hidden {
  display: none;
}

/* ── 24. Kakao Map Marker Styles ─────────────────── */
.custom-marker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.marker-pin {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.custom-marker:hover .marker-pin,
.custom-marker.selected .marker-pin {
  transform: rotate(-45deg) scale(1.2);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
}

.marker-pin-inner {
  transform: rotate(45deg);
  font-size: 13px;
  line-height: 1;
}

.marker-label {
  margin-top: 5px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--border);
  font-family: var(--font-base);
  box-shadow: var(--shadow-xs);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s;
}

.custom-marker:hover .marker-label,
.custom-marker.selected .marker-label {
  opacity: 1;
  transform: translateY(0);
}

.marker-elementary .marker-pin {
  background: linear-gradient(135deg, #047857, #059669);
}

.marker-middle .marker-pin {
  background: linear-gradient(135deg, #1D4ED8, #2563EB);
}

.marker-high .marker-pin {
  background: linear-gradient(135deg, #6D28D9, #7C3AED);
}

.marker-academy .marker-pin {
  background: linear-gradient(135deg, #F59E0B, #D97706);
}

.marker-cctv .marker-pin {
  background: linear-gradient(135deg, #0E7490, #06B6D4);
}

.marker-playground .marker-pin {
  background: linear-gradient(135deg, #059669, #34D399);
}

.marker-kium .marker-pin {
  background: linear-gradient(135deg, #e11d48, #fb7185);
}

.marker-haven .marker-pin {
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
}

/* ── 25. Scrollbar Global ────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 2px;
}

/* ── 26. Responsive — Mobile (< 1024px) ─────────── */
@media (max-width: 1023px) {
  :root {
    --header-h: 52px;
  }

  .logo-sub {
    display: none;
  }

  .mode-label {
    display: none;
  }

  .filter-stats {
    display: none;
  }

  .sidebar {
    display: none;
  }

  .bottom-sheet {
    display: flex;
    flex-direction: column;
  }

  .map-container {
    position: fixed;
    inset: 0;
    top: calc(var(--header-h) + var(--filter-h));
  }

  #map {
    width: 100%;
    height: 100%;
  }

  .toast-container {
    bottom: 80px;
  }

  .app-header {
    padding: 0 14px;
    gap: 10px;
  }

  .search-wrapper {
    max-width: 200px;
  }

  .school-header {
    padding: 14px;
  }

  .panel-section {
    padding: 14px;
  }

  .shortcut-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── 27. Responsive — Tablet (768px~1023px) ─────── */
@media (min-width: 768px) and (max-width: 1023px) {
  .mode-label {
    display: inline;
  }

  .search-wrapper {
    max-width: 280px;
  }
}

/* ── 28. Responsive — PC (≥ 1024px) ─────────────── */
@media (min-width: 1024px) {
  .map-container {
    position: relative;
    flex: 1;
    overflow: hidden;
  }

  #map {
    width: calc(100% - var(--sidebar-w));
  }

  .sidebar {
    display: block;
  }

  .bottom-sheet {
    display: none !important;
  }
}

/* ── 29. Animations ──────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.animate-fade-in {
  animation: fadeIn 0.25s ease forwards;
}

.animate-slide-up {
  animation: slideUp 0.28s ease forwards;
}

.animate-pulse {
  animation: pulse 1.5s ease infinite;
}

/* ── 30. Utility ─────────────────────────────────── */
.text-gold {
  color: #D97706;
}

.text-green {
  color: var(--color-elementary);
}

.text-blue {
  color: var(--accent);
}

.text-muted {
  color: var(--text-muted);
}

.font-bold {
  font-weight: 700;
}

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 6px;
}

.mt-4 {
  margin-top: 12px;
}

/* ── 31. Toggle Switch Styles ────────────────────── */
.toggle-section {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  margin: 6px 14px 0;
  border: 1px solid var(--border);
  padding: 10px 14px !important;
  transition: background var(--t-fast), border-color var(--t-fast);
}

.toggle-section:first-of-type {
  margin-top: 10px;
}

#haven-toggle-section {
  margin-bottom: 8px;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.toggle-text-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.toggle-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.toggle-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.switch-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-strong);
  transition: background-color var(--t-base);
  border-radius: 22px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background-color: #fff;
  transition: transform var(--t-base);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-control input:checked+.switch-slider {
  background-color: var(--accent);
}

.switch-control input:checked+.switch-slider:before {
  transform: translateX(16px);
}

.badge-no-zone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  line-height: 1;
}

.zone-notice-caption {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border-left: 2px solid var(--accent);
}

/* ── 32. Air Quality Widget ──────────────────────── */
.air-quality-widget {
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

.air-quality-widget.hidden {
  display: none !important;
}

.air-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}

.air-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.air-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.air-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.air-stat-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.air-label-container {
  display: flex;
  align-items: center;
  gap: 5px;
}

.air-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.air-dot.pm10 { background: #3B82F6; }
.air-dot.pm25 { background: #8B5CF6; }

.air-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.air-value-container {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: nowrap;
}

.air-value {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.1rem;
  line-height: 1;
  white-space: nowrap;
}

.air-unit {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  margin-right: auto;
  white-space: nowrap;
}

.air-grade-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.68rem;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  align-self: center;
}

.air-grade-1 {
  background: #059669;
}

.air-grade-2 {
  background: #2563EB;
}

.air-grade-3 {
  background: #D97706;
}

.air-grade-4 {
  background: #DC2626;
}

.air-grade-unknown {
  background: var(--border-strong);
  color: var(--text-secondary);
}

.air-loading {
  color: var(--text-muted);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
}

/* ── 33. CCTV 마커 (청록 보안 테마) ─────────────── */
.marker-cctv .marker-pin {
  background: linear-gradient(135deg, #0e7490 0%, #06b6d4 100%);
  border: 2px solid rgba(6, 182, 212, 0.45);
  box-shadow:
    0 4px 12px rgba(6, 182, 212, 0.38),
    0 0 0 2px rgba(6, 182, 212, 0.15);
}

.marker-cctv .marker-pin-inner {
  font-size: 1rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}

.marker-cctv .marker-label {
  background: rgba(6, 182, 212, 0.13);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.32);
  font-weight: 600;
}

.marker-cctv:hover .marker-pin {
  transform: rotate(-45deg) scale(1.13);
  box-shadow:
    0 8px 22px rgba(6, 182, 212, 0.52),
    0 0 0 3px rgba(6, 182, 212, 0.28);
}

/* CCTV 마커 — 어린이보호구역 강조 펄스 애니메이션 */
@keyframes cctv-pulse {
  0%   { box-shadow: 0 4px 12px rgba(245,158,11,0.38), 0 0 0 0 rgba(245,158,11,0.5); }
  70%  { box-shadow: 0 4px 12px rgba(245,158,11,0.38), 0 0 0 8px rgba(245,158,11,0); }
  100% { box-shadow: 0 4px 12px rgba(245,158,11,0.38), 0 0 0 0 rgba(245,158,11,0); }
}

.marker-cctv.school-zone .marker-pin {
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
  border-color: rgba(245, 158, 11, 0.45);
  animation: cctv-pulse 2s ease-out infinite;
}

/* ── 34. 학원 마커 (골드/오렌지 테마) ─────────────── */
.marker-academy .marker-pin {
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
  border: 2px solid rgba(245, 158, 11, 0.45);
  box-shadow:
    0 4px 12px rgba(245, 158, 11, 0.38),
    0 0 0 2px rgba(245, 158, 11, 0.15);
}

.marker-academy .marker-pin-inner {
  font-size: 1rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}

.marker-academy .marker-label {
  background: rgba(245, 158, 11, 0.13);
  color: #fbc02d;
  border: 1px solid rgba(245, 158, 11, 0.32);
  font-weight: 600;
}

.marker-academy:hover .marker-pin {
  transform: rotate(-45deg) scale(1.13);
  box-shadow:
    0 8px 22px rgba(245, 158, 11, 0.52),
    0 0 0 3px rgba(245, 158, 11, 0.28);
}

/* ── 35. 놀이시설 마커 (초록 테마) ─────────────── */
.marker-playground .marker-pin {
  background: linear-gradient(135deg, #047857 0%, #10b981 100%);
  border: 2px solid rgba(16, 185, 129, 0.45);
  box-shadow:
    0 4px 12px rgba(16, 185, 129, 0.38),
    0 0 0 2px rgba(16, 185, 129, 0.15);
}

.marker-playground .marker-pin-inner {
  font-size: 1rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}

.marker-playground .marker-label {
  background: rgba(16, 185, 129, 0.13);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.32);
  font-weight: 600;
}

.marker-playground:hover .marker-pin {
  transform: rotate(-45deg) scale(1.13);
  box-shadow:
    0 8px 22px rgba(16, 185, 129, 0.52),
    0 0 0 3px rgba(16, 185, 129, 0.28);
}

/* ═══════════════════════════════════════════════════════════════
   36. 지도 핀 팝업 카드 공통 스타일 (학원 · CCTV · 놀이터)
   JS inline style.cssText → CSS 클래스로 이전
   ═══════════════════════════════════════════════════════════════ */
.map-popup-card {
  position: absolute;
  bottom: 55px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 14px;
  min-width: 230px;
  font-family: 'Noto Sans KR', sans-serif;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  z-index: 100;
}

/* 학원 팝업 — accent: sky blue */
.map-popup-card.academy-popup-card {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* CCTV 팝업 — accent: cyan */
.map-popup-card.cctv-popup-card {
  border-color: rgba(6, 182, 212, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(6, 182, 212, 0.1);
}

/* 놀이터 팝업 — accent: emerald */
.map-popup-card.playground-popup-card {
  border-color: rgba(52, 211, 153, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(52, 211, 153, 0.1);
}

/* 키움센터 팝업 — accent: rose */
.map-popup-card.kium-popup-card {
  border-color: rgba(244, 63, 94, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(244, 63, 94, 0.15);
}

/* 안심지킴이집 팝업 — accent: blue */
.map-popup-card.haven-popup-card {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(59, 130, 246, 0.15);
}

/* 팝업 내부 링크 버튼 (ITIS, TOPIS 등) */
.map-popup-card .popup-link-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 0;
  border-radius: 7px;
  font-size: 0.73rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.15s;
}
.map-popup-card .popup-link-btn:hover { opacity: 0.85; }

.map-popup-card .popup-link-btn.btn-itis {
  background: linear-gradient(135deg, #0e7490, #06b6d4);
}
.map-popup-card .popup-link-btn.btn-topis {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

/* ═══════════════════════════════════════════════════════════════
   37. 추정 학구도 안내 라벨 (실제 데이터 없을 때 폴백 폴리곤 위에 표시)
   ═══════════════════════════════════════════════════════════════ */
.zone-estimate-notice {
  padding: 4px 10px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #f59e0b;
  white-space: nowrap;
  font-family: 'Noto Sans KR', sans-serif;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

/* ═══════════════════════════════════════════════════════════════
   38. 실제 공시 데이터 팩트 카드 (방과후 프로그램 / 전입전출 현황)
   ═══════════════════════════════════════════════════════════════ */
.fact-card-box {
  background: var(--bg-surface-alt, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 16px 14px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fact-card-box:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.fact-card-main {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}
.fact-card-num {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary, #1A56DB);
  letter-spacing: -0.02em;
}
.fact-card-unit {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary, #4b5563);
}
.fact-card-sub {
  font-size: 0.74rem;
  color: var(--text-muted, #9ca3af);
  margin-top: 5px;
}

.transfer-fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.transfer-fact-box {
  padding: 12px 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid;
}
.transfer-fact-box.in {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.25);
}
.transfer-fact-box.in .transfer-fact-val {
  color: #059669;
}
.transfer-fact-box.out {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.25);
}
.transfer-fact-box.out .transfer-fact-val {
  color: #dc2626;
}
.transfer-fact-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #4b5563);
}
.transfer-fact-val {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
/* ══════════════════════════════════════════════════════════════
   안심 인프라 섹션 (우리동네키움센터 + 아동안전지킴이집)
══════════════════════════════════════════════════════════════ */

/* 섹션 제목 옆 반경 뱃지 */
.section-badge-radius {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 6px;
  height: 18px;
  line-height: 1;
  letter-spacing: 0.02em;
}

/* 서브섹션 (키움 / 지킴이) */
.infra-subsection {
  margin-bottom: 12px;
}

.infra-sub-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 5px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.07));
  margin-bottom: 6px;
}

.infra-sub-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.infra-sub-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  flex: 1;
}

.infra-sub-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary, #1a56db);
  border-radius: 10px;
  padding: 0 7px;
  height: 18px;
  min-width: 20px;
  line-height: 1;
  text-align: center;
}

/* 리스트 */
.infra-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.infra-item {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 7px 10px;
  transition: background 0.15s;
}
.infra-item:hover {
  background: rgba(255,255,255,0.07);
}

.infra-item-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.infra-item-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary, #f8fafc);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.infra-item-dist {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(52,211,153,0.12);
  border-radius: 6px;
  padding: 0 6px;
  height: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.infra-item-type {
  font-size: 0.68rem;
  color: var(--text-muted, #64748b);
  margin-top: 1px;
}

.infra-item-tel {
  font-size: 0.68rem;
  color: #60a5fa;
  margin-top: 1px;
  text-decoration: none;
}
.infra-item-tel:hover { text-decoration: underline; }

.infra-empty {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  text-align: center;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 더보기 버튼 */
.infra-more-btn {
  width: 100%;
  margin-top: 4px;
  padding: 6px;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--primary, #1a56db);
  background: none;
  border: 1px dashed var(--primary, #1a56db);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.infra-more-btn:hover {
  background: rgba(26,86,219,0.08);
}

/* ═══════════════════════════════════════════════════════════════
   39. 사용설명서 모달 (Manual Guide Modal & Header Button)
   ═══════════════════════════════════════════════════════════════ */
.header-manual-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 12px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.header-manual-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.manual-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.manual-label {
  line-height: 1;
}

/* 모달 백드롭 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 20, 38, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.2s ease forwards;
}

.modal-backdrop.hidden {
  display: none !important;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 모달 카드 */
/* 모달 카드 (기존 대비 50% 확대: max-width 640px -> 960px) */
.modal-card {
  width: 94%;
  max-width: 960px;
  max-height: 90vh;
  background: rgba(15, 23, 42, 0.97);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* 모달 헤더 */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.01em;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.8rem;
  line-height: 1;
  padding: 2px 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--t-fast);
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* 모달 탭 바 */
.modal-tabs {
  display: flex;
  padding: 10px 28px 0;
  gap: 12px;
  background: rgba(15, 23, 42, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #94a3b8;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}

.modal-tab-btn:hover {
  color: #e2e8f0;
}

.modal-tab-btn.active {
  color: #60a5fa;
  border-bottom-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 10px 10px 0 0;
}

.tab-emoji {
  font-size: 1.25rem;
}

/* 모달 패널 & 카드 그리드 */
.modal-panel {
  padding: 24px 28px;
  overflow-y: auto;
  max-height: 64vh;
}

.modal-panel.hidden {
  display: none !important;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .modal-card {
    width: 96%;
    max-height: 92vh;
  }
  .modal-panel {
    padding: 16px 18px;
    max-height: 70vh;
  }
  .modal-header,
  .modal-tabs,
  .modal-footer {
    padding-left: 18px;
    padding-right: 18px;
  }
  .guide-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .header-manual-btn .manual-label {
    display: none;
  }
  .header-manual-btn {
    padding: 0 8px;
  }
}

.guide-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px 18px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.guide-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.guide-card.highlight-card {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.08);
}

.guide-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.guide-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.guide-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
  line-height: 1.35;
}

.guide-badge-new {
  font-size: 0.68rem;
  font-weight: 800;
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.18);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: auto;
}

.guide-desc {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}

.guide-desc strong {
  color: #f8fafc;
  font-weight: 600;
}

/* 모달 푸터 */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 16px;
}

.modal-footer-note {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.modal-confirm-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.modal-confirm-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}
