/* =====================================================
   서울 안심등교·학교정보 통합 대시보드 — 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;
  --color-special: #EA580C;
  --color-kindergarten: #D97706;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #334155;
  --text-muted: #475569;
  --text-subtle: #64748B;
  --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;
}

.brand-on {
  color: #2563EB;
  font-weight: 800;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .brand-on {
  color: #60A5FA;
}

.logo-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── 4. Search ────────────────────────────────────── */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  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.88rem;
  color: var(--text-subtle);
  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-subtle);
  opacity: 0.85;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 280px;
  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;
  white-space: nowrap;
}

.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;
  white-space: nowrap;
}

.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-badge.특수학교 {
  background: rgba(234, 88, 12, 0.1);
  color: var(--color-special);
}

.suggestion-badge.유치원 {
  background: rgba(217, 119, 6, 0.1);
  color: var(--color-kindergarten);
}

.suggestion-name {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-district {
  color: var(--text-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── 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[data-filter="초등학교"].active {
  color: var(--color-elementary);
  border-color: var(--color-elementary);
  background: rgba(5, 150, 105, 0.12);
}

.filter-chip[data-filter="중학교"].active {
  color: var(--color-middle);
  border-color: var(--color-middle);
  background: rgba(37, 99, 235, 0.12);
}

.filter-chip[data-filter="고등학교"].active {
  color: var(--color-high);
  border-color: var(--color-high);
  background: rgba(124, 58, 237, 0.12);
}

.filter-chip[data-filter="특수학교"].active {
  color: var(--color-special);
  border-color: var(--color-special);
  background: rgba(234, 88, 12, 0.12);
}

.filter-chip[data-filter="유치원"].active {
  color: var(--color-kindergarten);
  border-color: var(--color-kindergarten);
  background: rgba(217, 119, 6, 0.12);
}

.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.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

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

/* ── 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.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-weight: 400;
}

/* 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.82rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 600;
}

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

.school-header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.school-header-nav .back-btn {
  margin-bottom: 0;
}

.school-header-nav .school-badge {
  margin-bottom: 0;
}

.btn-to-map {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #2563EB;
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-to-map:active {
  background: #DBEAFE;
  transform: scale(0.97);
}

@media (max-width: 1023px) {
  .btn-to-map {
    display: inline-flex;
  }
}

.back-btn {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface);
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

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

.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-badge.특수학교 {
  background: rgba(234, 88, 12, 0.1);
  color: var(--color-special);
}

.school-badge.유치원 {
  background: rgba(217, 119, 6, 0.1);
  color: var(--color-kindergarten);
}

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

.school-address {
  font-size: 0.84rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.4;
}

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

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

.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.8rem;
  color: var(--text-muted);
  font-weight: 600;
  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.72rem;
  color: var(--text-secondary);
  line-height: 1.2;
  margin-top: 1px;
  font-weight: 500;
}

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

.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-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  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: 700;
}

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

.meal-tab-date {
  font-size: 0.68rem;
  opacity: 0.85;
  font-weight: 500;
}

.meal-content {
  width: 100%;
}

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

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

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

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

.meal-empty {
  color: var(--text-secondary);
  font-weight: 500;
  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-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  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-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  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;
  top: 0;
  background: var(--bg-secondary);
  border-top: none;
  border-radius: 0;
  z-index: 1200;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

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

.bottom-sheet.peek {
  transform: translateY(calc(100% - 50px));
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.16);
  border-radius: 16px 16px 0 0;
}

.sheet-handle {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 14px;
  cursor: pointer;
  user-select: none;
  touch-action: pan-y;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  transition: all var(--t-fast);
  box-sizing: border-box;
  width: 100%;
  padding-top: env(safe-area-inset-top, 0);
}

.bottom-sheet.peek .sheet-handle {
  height: 50px;
  background: #EEF2FF;
  border-top: 2px solid #6366F1;
}

.handle-bar {
  width: 38px;
  height: 4px;
  background: #CBD5E1;
  border-radius: 2px;
}

.bottom-sheet.peek .handle-bar {
  display: none;
}

.sheet-peek-tab {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  font-size: 0.85rem;
  font-weight: 700;
  color: #3730A3;
}

.bottom-sheet.peek .sheet-peek-tab {
  display: flex;
}

.peek-tab-icon {
  font-size: 1rem;
}

.peek-tab-arrow {
  font-size: 1.05rem;
  font-weight: 800;
  color: #4F46E5;
}

.sheet-content {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 14px);
  max-height: calc(100dvh - 14px);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  width: 100%;
  box-sizing: border-box;
  padding-bottom: env(safe-area-inset-bottom, 24px);
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 1100;
  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;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* 모바일 및 터치 환경을 위한 터치 타겟 확장 (최소 48x48px 터치 영역 보장) */
.custom-marker::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  pointer-events: auto;
}

.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 cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.custom-marker:hover {
  z-index: 50 !important;
}

.custom-marker.selected {
  z-index: 100 !important;
}

.custom-marker:active .marker-pin {
  transform: rotate(-45deg) scale(0.92);
}

.custom-marker:hover .marker-pin,
.custom-marker.selected .marker-pin {
  transform: rotate(-45deg) scale(1.22);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.38);
}

.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-special .marker-pin {
  background: linear-gradient(135deg, #C2410C, #EA580C);
}

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

.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;
    --filter-h: 44px;
  }

  .app-header {
    padding: 0 10px;
    gap: 8px;
    height: var(--header-h);
  }

  .logo {
    gap: 6px;
  }

  .logo-icon {
    font-size: 1.25rem;
  }

  .logo-title {
    font-size: 0.95rem;
    white-space: nowrap;
    letter-spacing: -0.03em;
  }

  .logo-sub {
    display: none;
  }

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

  .header-center {
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
  }

  .search-wrapper {
    max-width: none;
    height: 36px;
    padding: 0 10px;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .search-suggestions {
    position: fixed;
    top: calc(var(--header-h) + 4px);
    left: 8px;
    right: 8px;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: 55vh;
    border-radius: 12px;
    border: 1.5px solid var(--border-strong);
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.28);
    z-index: 1000;
  }

  .search-icon {
    font-size: 0.8rem;
  }

  #school-search {
    font-size: 0.82rem;
    padding: 0;
  }

  .header-manual-btn,
  .header-fullscreen-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .header-manual-btn .manual-label,
  .header-fullscreen-btn .fullscreen-label {
    display: none;
  }

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

  .mode-toggle {
    padding: 2px;
    gap: 2px;
    border-radius: 20px;
  }

  .mode-btn {
    width: 32px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1;
  }

  .mode-label {
    display: none;
  }

  .filter-bar {
    height: var(--filter-h);
    padding: 0 10px;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filter-chips {
    gap: 4px;
    flex-shrink: 0;
  }

  .filter-chip {
    padding: 4px 10px;
    font-size: 0.78rem;
    border-radius: 12px;
  }

  .filter-district {
    flex-shrink: 0;
  }

  .district-select {
    padding: 4px 8px;
    font-size: 0.78rem;
    height: 28px;
    border-radius: 12px;
  }

  .my-schools-inline {
    order: -1;
    gap: 4px;
    flex-shrink: 0;
  }

  .my-schools-title {
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .my-school-chip {
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .filter-stats {
    display: none;
  }

  .sidebar {
    display: none;
  }

  .bottom-sheet {
    display: flex;
    flex-direction: column;
    top: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
  }

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

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

  .toast-container {
    bottom: 80px;
  }

  .school-header {
    padding: 14px 12px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .panel-section {
    padding: 14px 12px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

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

@media (max-width: 420px) {
  .app-header {
    padding: 0 6px;
    gap: 5px;
  }

  .logo-title {
    font-size: 0.88rem;
  }

  .search-wrapper {
    padding: 0 6px;
    gap: 4px;
  }

  .header-manual-btn,
  .header-fullscreen-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .mode-btn {
    width: 28px;
    height: 26px;
    font-size: 0.88rem;
  }
}

/* ── 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;
  width: auto !important;
  max-width: calc(100% - 28px);
  border: 1px solid var(--border);
  padding: 10px 14px !important;
  transition: background var(--t-fast), border-color var(--t-fast);
  box-sizing: border-box;
}

.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.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.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.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 8px;
  padding: 8px 12px;
  background: #F1F5F9;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  font-weight: 500;
}

/* ── 32. Air Quality Widget ──────────────────────── */
.air-quality-widget {
  padding: 6px 16px 8px 16px;
  background: transparent;
  border-bottom: none;
  box-sizing: border-box;
}

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

/* ── 32-1. Glassmorphism Morning Briefing Card (2-Row Collision-Free UI) ── */
.morning-briefing-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 16px;
  box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.morning-briefing-card:hover {
  box-shadow: 0 6px 22px -2px rgba(37, 99, 235, 0.08);
  border-color: rgba(191, 219, 254, 0.9);
}

/* 1층 (Hero Row): 기온 & 핵심 행동지침 뱃지 (양끝 정렬) */
.mb-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mb-weather-hero {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.mb-icon {
  font-size: 1.3rem;
  line-height: 1;
  margin-right: 1px;
}

.mb-temp {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
}

.mb-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.mb-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.mb-action-badge.badge-rain {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.mb-action-badge.badge-dust {
  background: rgba(225, 29, 72, 0.09);
  color: #be123c;
  border: 1px solid rgba(225, 29, 72, 0.22);
}

.mb-action-badge.badge-good {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* 2층 (Sub Row): 강수/습도 & 미세·초미세먼지 실측치 */
.mb-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(226, 232, 240, 0.7);
  padding-top: 5px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  box-sizing: border-box;
  width: 100%;
}

.mb-sub-weather {
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.mb-rain-tag {
  color: #2563EB;
  font-weight: 600;
}

.mb-sub-air {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.mb-sub-air strong {
  font-weight: 700;
  color: var(--text-primary);
}

/* 다크모드 대응 */
[data-theme="dark"] .morning-briefing-card {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .morning-briefing-card:hover {
  border-color: rgba(96, 165, 250, 0.35);
}

[data-theme="dark"] .mb-sub-row {
  border-top-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 480px) {
  .morning-briefing-card {
    padding: 8px 12px;
    gap: 5px;
  }
  .mb-temp {
    font-size: 1.35rem;
  }
  .mb-action-badge {
    font-size: 0.7rem;
    padding: 2px 7px;
  }
  .mb-sub-row {
    font-size: 0.69rem;
    flex-wrap: wrap;
    gap: 4px 6px;
  }
  .mb-sub-weather,
  .mb-sub-air {
    min-width: 0;
  }
}


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

.air-label {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.air-value-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  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-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 0;
  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-dot.air-grade-1 { background: #10B981; }
.air-dot.air-grade-2 { background: #2563EB; }
.air-dot.air-grade-3 { background: #F59E0B; }
.air-dot.air-grade-4 { background: #EF4444; }
.air-dot.air-grade-unknown { background: #94A3B8; }

.air-grade-badge.air-grade-1 { background: #059669; color: #fff; }
.air-grade-badge.air-grade-2 { background: #2563EB; color: #fff; }
.air-grade-badge.air-grade-3 { background: #D97706; color: #fff; }
.air-grade-badge.air-grade-4 { background: #DC2626; color: #fff; }
.air-grade-badge.air-grade-unknown { background: var(--border-strong); color: var(--text-secondary); }

.air-loading {
  color: var(--text-secondary);
  font-weight: 500;
  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);
}
.fact-card-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 5px;
  font-weight: 500;
}

.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.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.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);
  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.82rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.infra-sub-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  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: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 7px 10px;
  transition: background 0.15s;
}
.infra-item:hover {
  background: #F1F5F9;
}

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

.infra-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  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: #059669;
  background: rgba(5, 150, 105, 0.12);
  border-radius: 6px;
  padding: 0 6px;
  height: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.infra-item-type {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 1px;
  font-weight: 500;
}

.infra-item-tel {
  font-size: 0.72rem;
  color: var(--accent);
  margin-top: 1px;
  text-decoration: none;
  font-weight: 600;
}
.infra-item-tel:hover { text-decoration: underline; }

.infra-empty {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

/* 더보기 버튼 */
.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;
}

/* 브라우저 전체화면 헤더 버튼 */
.header-fullscreen-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-fullscreen-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.header-fullscreen-btn.active {
  background: #EEF2FF;
  border-color: #6366F1;
  color: #4F46E5;
}

.fullscreen-icon {
  font-size: 1.05rem;
  line-height: 1;
}

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

/* 지도 위 플로팅 내 위치 찾기(GPS) 버튼 */
.map-floating-location-btn,
.map-floating-fullscreen-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 100;
  width: 42px;
  height: 42px;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  color: #1E293B;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.map-floating-location-btn:hover,
.map-floating-fullscreen-btn:hover {
  background: #F8FAFC;
  border-color: #3B82F6;
  color: #2563EB;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
}

.map-floating-location-btn:active,
.map-floating-fullscreen-btn:active {
  transform: translateY(1px) scale(0.96);
}

.map-floating-location-btn.active {
  background: #EFF6FF;
  border-color: #3B82F6;
  color: #2563EB;
}

/* 위치 탐색 중 회전 애니메이션 */
.map-floating-location-btn.loading svg {
  animation: spinLoc 1s linear infinite;
  color: #3B82F6;
}

@keyframes spinLoc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.floating-loc-icon {
  display: block;
  transition: transform 0.2s ease;
}

/* 지도 내 위치 펄스 마커 */
.my-location-marker {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.my-location-dot {
  width: 14px;
  height: 14px;
  background: #2563EB;
  border: 2.5px solid #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.5);
  z-index: 2;
}

.my-location-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  margin-left: -16px;
  background: rgba(37, 99, 235, 0.35);
  border-radius: 50%;
  animation: myLocPulse 2s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  z-index: 1;
}

@keyframes myLocPulse {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  70% {
    transform: scale(2.2);
    opacity: 0;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* 모달 백드롭 */
.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: #cbd5e1;
  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: #cbd5e1;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}

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

.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 {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}

.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.94rem;
  color: #e2e8f0;
  line-height: 1.6;
  margin: 0;
  font-weight: 400;
}

.guide-desc strong {
  color: #ffffff;
  font-weight: 700;
}

/* 모달 푸터 */
.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.8rem;
  color: #cbd5e1;
  line-height: 1.4;
  font-weight: 500;
}

.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);
}

/* ── 40. Map Zone Disclaimer Banner ───────────────────── */
.map-zone-disclaimer {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: rgba(15, 23, 42, 0.94);
  border: 1.5px solid #f59e0b;
  border-radius: 30px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(245, 158, 11, 0.3);
  backdrop-filter: blur(8px);
  animation: bannerSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 95%;
  width: max-content;
  white-space: nowrap;
  pointer-events: none;
}

.map-zone-disclaimer.hidden {
  display: none !important;
}

@keyframes bannerSlideUp {
  from { transform: translate(-50%, 15px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.disclaimer-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 7px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.disclaimer-text {
  font-size: 0.78rem;
  color: #f1f5f9;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .map-zone-disclaimer {
    bottom: 90px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    border-radius: 14px;
    padding: 8px 12px;
    width: auto;
    white-space: normal;
  }
  .disclaimer-text {
    white-space: normal;
  }
}

/* ══════════════════════════════════════════════════
   ⭐ 내 학교 퀵칩 (필터바 내 inline)
══════════════════════════════════════════════════ */
.my-schools-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  order: -1;
  overflow-x: auto;
  scrollbar-width: none;
}

.my-schools-inline::-webkit-scrollbar {
  display: none;
}

.my-schools-inline.hidden {
  display: none !important;
}

.my-schools-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.my-schools-chips {
  display: flex;
  align-items: center;
  gap: 5px;
}

.my-school-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  background: #EEF2FF;
  border: 1.5px solid #C7D2FE;
  color: #3730A3;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.my-school-chip:hover {
  background: #E0E7FF;
  border-color: #818CF8;
  color: #312E81;
}

.my-school-chip.active {
  background: var(--accent);
  border-color: var(--accent-h);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(26, 86, 219, 0.3);
}

.chip-label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chip-delete-btn {
  background: transparent;
  border: none;
  color: #6366F1;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.chip-delete-btn:hover {
  color: #DC2626;
  transform: scale(1.2);
}

/* ══════════════════════════════════════════════════
   ⭐ 학교 상세 패널 액션 바 (내 학교 / 공유 / 전화)
══════════════════════════════════════════════════ */
.school-action-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.btn-school-action {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-surface, #F8FAFC);
  border: 1px solid var(--border, #CBD5E1);
  color: var(--text-primary, #1E293B);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.btn-school-action:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  color: #0F172A;
  transform: translateY(-1px);
}

.btn-school-action.active {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #B45309;
}

.action-icon {
  font-size: 0.85rem;
}

/* ══════════════════════════════════════════════════
   💬 학부모 소통 앱 3대장 퀵 칩 (하이클래스 / e알리미 / 클래스팅)
══════════════════════════════════════════════════ */
.parent-comm-bar {
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg-surface, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.comm-bar-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary, #64748B);
  white-space: nowrap;
  flex-shrink: 0;
}

.comm-chips-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
}

.comm-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.comm-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-hiclass {
  background: #10B981;
}

.dot-ealimi {
  background: #2563EB;
}

.dot-classting {
  background: #F59E0B;
}

.comm-chip.hiclass {
  background: rgba(16, 185, 129, 0.07);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.22);
}
.comm-chip.hiclass:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.comm-chip.ealimi {
  background: rgba(37, 99, 235, 0.07);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.22);
}
.comm-chip.ealimi:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.comm-chip.classting {
  background: rgba(245, 158, 11, 0.07);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.24);
}
.comm-chip.classting:hover {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.42);
  transform: translateY(-1px);
}

.comm-chip-arrow {
  font-size: 0.68rem;
  opacity: 0.6;
}

/* 다크모드 대응 */
[data-theme="dark"] .btn-school-action {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}
[data-theme="dark"] .btn-school-action:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}
[data-theme="dark"] .parent-comm-bar {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .comm-chip.hiclass {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}
[data-theme="dark"] .comm-chip.ealimi {
  background: rgba(37, 99, 235, 0.18);
  color: #93c5fd;
  border-color: rgba(37, 99, 235, 0.35);
}
[data-theme="dark"] .comm-chip.classting {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}

@media (max-width: 480px) {
  .parent-comm-bar {
    padding: 6px 8px;
    gap: 6px;
  }
  .comm-bar-label {
    font-size: 0.7rem;
  }
  .comm-chips-wrap {
    gap: 4px;
  }
  .comm-chip {
    padding: 3px 6px;
    font-size: 0.69rem;
    gap: 3px;
  }
}

@media (max-width: 365px) {
  .parent-comm-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .comm-chips-wrap {
    justify-content: space-between;
  }
  .comm-chip {
    flex: 1;
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════════
   🍱 상단 오늘의 급식 섹션 (학생수 위 배치)
══════════════════════════════════════════════════ */
.meal-section-top {
  padding: 12px 18px 14px 18px;
  background: var(--bg-surface, #ffffff);
  border-bottom: 1px solid var(--border);
}


/* ══════════════════════════════════════════════════
   ⚠️ 급식 섹션 타이틀 & 알레르기 설정 버튼
══════════════════════════════════════════════════ */
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title-row .section-title {
  margin-bottom: 0;
}

.btn-allergy-setting {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #F1F5F9;
  border: 1.5px solid #CBD5E1;
  color: #1E293B;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-allergy-setting:hover {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #B45309;
}

.btn-allergy-setting.active {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #B45309;
}

/* ══════════════════════════════════════════════════
   🍱 반찬별 알레르기 하이라이트 & 면책 캡션
══════════════════════════════════════════════════ */
.meal-dishes-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.meal-dish-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  transition: all 0.15s ease;
  text-align: center;
}

.meal-dish-item.has-allergy {
  background: #FEF3C7;
  border-color: #F59E0B;
}

.dish-name {
  font-size: 0.88rem;
  color: #0F172A;
  font-weight: 600;
  text-align: center;
}

.meal-dish-item.has-allergy .dish-name {
  color: #92400E;
  font-weight: 700;
}

.allergy-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.allergy-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.22);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.45);
  white-space: nowrap;
}

.meal-disclaimer {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #334155;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════
   ⚠️ 법정 알레르기 설정 모달 (19종)
══════════════════════════════════════════════════ */
.allergy-modal-card {
  max-width: 680px;
  width: 92%;
}

.modal-badge.allergy {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.allergy-modal-intro {
  padding: 12px 20px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.allergy-tag-preview {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.allergy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  padding: 18px 20px;
  max-height: 380px;
  overflow-y: auto;
}

.allergy-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.allergy-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.allergy-item:has(.allergy-chk:checked) {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.45);
}

.allergy-chk {
  width: 16px;
  height: 16px;
  accent-color: #f59e0b;
  cursor: pointer;
}

.allergy-item-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #ffffff;
  font-weight: 600;
}

.allergy-item-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

.allergy-item:has(.allergy-chk:checked) .allergy-item-num {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.25);
}

.allergy-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.allergy-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-text-action {
  background: transparent;
  border: none;
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color 0.15s ease;
}

.btn-text-action:hover {
  color: #f87171;
}

.allergy-footer-note {
  font-size: 0.78rem;
  color: #cbd5e1;
  font-weight: 500;
}

@media (max-width: 768px) {
  .allergy-modal-card {
    width: 95%;
  }
  .allergy-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .allergy-footer {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .allergy-footer-left {
    justify-content: space-between;
  }
  .allergy-footer-right .modal-confirm-btn {
    width: 100%;
  }
}

/* ══════════════════════════════════════════════════
   🎒 학교명 행 & [지도 보기] 아래 정사각형 등교완료 버튼
══════════════════════════════════════════════════ */
.school-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.school-title-main {
  flex: 1;
  min-width: 0;
}

.ready-mission-square-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-mission-ready-square {
  min-width: 90px;
  min-height: 64px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #F0FDF4;
  color: #166534;
  border: 2px solid #86EFAC;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(22, 101, 52, 0.10);
  transition: transform 0.15s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn-mission-ready-square:active {
  transform: scale(0.93);
  background: #DCFCE7;
}

.mission-square-icon {
  font-size: 2.15rem;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: block;
}

.btn-mission-ready-square:hover .mission-square-icon {
  transform: scale(1.18);
}

.mission-square-text {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1;
  white-space: nowrap;
}

/* 완료 모핑 상태 (산뜻한 에메랄드 축하 배지) */
.btn-mission-ready-square.completed {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
  border-color: #059669 !important;
  color: #FFFFFF !important;
  box-shadow: 0 3px 12px rgba(5, 150, 105, 0.32) !important;
}

.btn-mission-ready-square.completed .mission-square-icon {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
  transform: scale(1.05);
}

.btn-mission-ready-square.completed .mission-square-text {
  font-weight: 800;
  color: #FFFFFF !important;
}

/* 모바일 화면 (768px 이하): 아이콘과 버튼을 공간에 맞게 시원시원하게 확대 */
@media (max-width: 768px) {
  .school-title-row {
    gap: 10px;
    align-items: center;
  }
  .btn-mission-ready-square {
    min-width: 84px;
    min-height: 64px;
    padding: 7px 8px;
    border-radius: 12px;
    gap: 3px;
  }
  .mission-square-icon {
    font-size: 2.1rem;
    line-height: 1;
  }
  .mission-square-text {
    font-size: 0.74rem;
  }
}

/* 초소형 모바일 화면 (380px 이하) */
@media (max-width: 380px) {
  .school-title-row {
    gap: 8px;
  }
  .btn-mission-ready-square {
    min-width: 76px;
    min-height: 58px;
    padding: 6px 6px;
    border-radius: 10px;
  }
  .mission-square-icon {
    font-size: 1.85rem;
    line-height: 1;
  }
  .mission-square-text {
    font-size: 0.68rem;
  }
}

/* ⚠️ 정보 오류 수정 메타 링크 (학교 메타 행에 자연스럽게 배치) */
.meta-voc-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  color: #94A3B8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: color var(--t-fast);
  touch-action: manipulation;
}

.meta-voc-btn:hover {
  color: #EF4444;
  text-decoration: underline;
}

/* ⚠️ 데이터 자정 제보 마이크로 칩 패널 */
.voc-chip-panel {
  margin: 10px 0 6px 0;
  padding: 10px 12px;
  background: #FFFFFF;
  border: 1px dashed #CBD5E1;
  border-radius: 10px;
  animation: slideDownVoc 0.25s ease-out;
}

[data-theme="dark"] .voc-chip-panel {
  background: #0F172A;
  border-color: #475569;
}

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

.voc-panel-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

[data-theme="dark"] .voc-panel-title {
  color: #CBD5E1;
}

.voc-chip-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.voc-chip {
  height: 32px;
  padding: 0 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.voc-chip:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
}

.voc-chip:active {
  transform: scale(0.95);
}

.voc-chip.selected {
  background: #EFF6FF;
  border-color: #2563EB;
  color: #1D4ED8;
}

.voc-feedback-msg {
  margin-top: 8px;
  font-size: 0.74rem;
  color: #059669;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── 30. Mobile Welcome Onboarding Card ─────────── */
.mobile-welcome-card {
  display: none;
}

@media (max-width: 768px) {
  .mobile-welcome-card {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 12px;
    left: 10px;
    right: 10px;
    background: #FFFFFF;
    border: 1.5px solid #CBD5E1;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    padding: 12px 14px;
    z-index: 1050;
    gap: 8px;
    animation: slideUpFade 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .mobile-welcome-card.hidden {
    display: none !important;
  }

  .mwc-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mwc-brand-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .mwc-main-badge {
    background: #EFF6FF;
    color: #1D4ED8;
    font-weight: 700;
    font-size: 0.84rem;
    padding: 2.5px 9px;
    border-radius: 20px;
    border: 1px solid #BFDBFE;
    line-height: 1.2;
  }

  .mwc-sub-text {
    font-size: 0.76rem;
    color: #64748B;
    font-weight: 500;
  }

  .mwc-close-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #94A3B8;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    margin: -4px -4px 0 0;
    transition: color 0.15s ease;
  }

  .mwc-close-btn:hover {
    color: #475569;
  }

  .mwc-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .mwc-chip {
    background: #F8FAFC;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 6px 6px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    text-align: center;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mwc-cta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 0.74rem;
    color: #92400E;
    line-height: 1.35;
  }

  .mwc-cta-icon {
    font-size: 0.92rem;
    flex-shrink: 0;
  }

  .mwc-cta-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mwc-cta-text strong {
    color: #B45309;
    font-weight: 700;
  }

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

/* ═══════════════════════════════════════════════════════════════
   39. 2026 공공 AI 챌린지: 팩트 그라운딩 AI 모닝 안심 브리핑 & 공문 비서
   ═══════════════════════════════════════════════════════════════ */

/* 컨테이너 */
.ai-briefing-container {
  margin: 12px 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 교직원 모드 안전공문 배너 */
.staff-safety-notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(4, 120, 87, 0.2);
  gap: 10px;
  animation: fadeIn 0.25s ease-out;
}
.staff-banner-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.staff-banner-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #a7f3d0;
  letter-spacing: -0.3px;
}
.staff-banner-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #ffffff;
  word-break: keep-all;
}
.btn-gen-safety-notice {
  flex-shrink: 0;
  padding: 7px 12px;
  background: #ffffff;
  color: #065f46;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn-gen-safety-notice:hover {
  background: #ecfdf5;
  transform: translateY(-1px);
}
.btn-gen-safety-notice:active {
  transform: translateY(0);
}

/* 학부모 AI 모닝 안심 브리핑 카드 (글라스모피즘) */
.ai-briefing-card {
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08), 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  overflow: hidden;
}

[data-theme="dark"] .ai-briefing-card {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(52, 211, 153, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

/* 카드 헤더 */
.ai-briefing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(16, 185, 129, 0.2);
}
.ai-briefing-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
  flex-shrink: 0;
}
.ai-pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 1.8s infinite;
}
@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.ai-briefing-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
[data-theme="dark"] .ai-briefing-title {
  color: #f1f5f9;
}
.ai-source-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1px 6px;
  border-radius: 6px;
  letter-spacing: -0.2px;
  white-space: nowrap;
}
[data-theme="dark"] .ai-source-badge {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.3);
}

/* 브리핑 헤더 액션 버튼 그룹 */
.ai-briefing-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* TTS 음성 브리핑 읽어주기 원형 아이콘 버튼 */
.btn-tts-briefing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: #f0fdf4;
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.btn-tts-briefing:hover {
  background: #dcfce7;
  border-color: #059669;
  transform: scale(1.08);
}
.btn-tts-briefing.playing {
  background: #fee2e2;
  border-color: #ef4444;
  color: #dc2626;
  animation: pulseTts 1.5s infinite;
}
@keyframes pulseTts {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
[data-theme="dark"] .btn-tts-briefing {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}
[data-theme="dark"] .btn-tts-briefing.playing {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
}

/* 단톡방 공유 버튼 */
.btn-copy-briefing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-copy-briefing:hover {
  background: #e2e8f0;
  color: #0f172a;
}
[data-theme="dark"] .btn-copy-briefing {
  background: #334155;
  color: #e2e8f0;
  border-color: #475569;
}
[data-theme="dark"] .btn-copy-briefing:hover {
  background: #475569;
}

/* 카드 본문 리스트 */
.ai-briefing-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-briefing-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 7px 10px;
  background: rgba(248, 250, 252, 0.85);
  border-radius: 8px;
  border-left: 3px solid #10b981;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #1e293b;
  word-break: keep-all;
}
[data-theme="dark"] .ai-briefing-item {
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
}
.ai-briefing-item strong {
  color: #047857;
  font-weight: 700;
}
[data-theme="dark"] .ai-briefing-item strong {
  color: #34d399;
}

.ai-briefing-item.ai-line-meal { border-left-color: #f59e0b; }
.ai-briefing-item.ai-line-weather { border-left-color: #3b82f6; }
.ai-briefing-item.ai-line-school { border-left-color: #10b981; }

/* 카드 푸터 */
.ai-briefing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #64748b;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 6px;
  flex-wrap: wrap;
  gap: 4px;
}
[data-theme="dark"] .ai-briefing-footer {
  color: #94a3b8;
  border-top-color: rgba(255, 255, 255, 0.08);
}
.ai-model-tag {
  font-weight: 600;
  color: #0284c7;
}
[data-theme="dark"] .ai-model-tag {
  color: #38bdf8;
}
.ai-grounding-tag {
  letter-spacing: -0.2px;
}

/* 스켈레톤 로더 */
.ai-skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}
.ai-skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.5s infinite;
}
.ai-skeleton-line.short {
  width: 50%;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 안전공문서 모달 전용 스타일 */
.safety-notice-modal-card {
  max-width: 620px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.safety-notice-intro {
  font-size: 0.76rem;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 10px 0 12px 0;
  line-height: 1.5;
  word-break: keep-all;
}
.safety-notice-body {
  flex: 1;
  display: flex;
  min-height: 280px;
}
.safety-notice-textarea {
  width: 100%;
  min-height: 280px;
  font-family: 'Malgun Gothic', -apple-system, sans-serif;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.safety-notice-textarea:focus {
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}
.safety-status-tag {
  font-size: 0.74rem;
  font-weight: 700;
  color: #059669;
}

/* 375px 모바일 뷰포트 최적화 */
@media (max-width: 480px) {
  .ai-briefing-card {
    padding: 10px 12px;
    border-radius: 12px;
  }
  .ai-briefing-title {
    font-size: 0.88rem;
    white-space: nowrap;
  }
  .ai-source-badge {
    font-size: 0.62rem;
    padding: 1px 4px;
    white-space: nowrap;
  }
  .btn-copy-briefing {
    padding: 3px 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .btn-open-care-memo {
    font-size: 0.76rem;
    padding: 7px 10px;
  }
  .btn-open-care-memo .care-tag {
    font-size: 0.64rem;
    padding: 1px 5px;
  }
  .ai-lang-selector {
    gap: 3px;
    padding: 4px;
  }
  .btn-lang-chip {
    font-size: 0.68rem;
    padding: 5px 1px;
    gap: 2px;
  }
  .btn-lang-chip .chip-flag {
    font-size: 0.78rem;
  }
  .btn-lang-chip .chip-label {
    font-size: 0.66rem;
  }
  .ai-briefing-item {
    font-size: 0.78rem;
    padding: 6px 8px;
  }
  .staff-safety-notice-banner {
    padding: 8px 10px;
  }
  .staff-banner-title {
    font-size: 0.78rem;
  }
  .btn-gen-safety-notice {
    padding: 5px 8px;
    font-size: 0.74rem;
  }
}

/* ── 매뉴얼 조항 근거 배지 (Evidence Badge) ─────────────────── */
.evidence-badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.2s ease;
}

.evidence-badge .evidence-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.evidence-badge .evidence-sep {
  color: #94a3b8;
  user-select: none;
}

.evidence-badge .evidence-link {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease;
}

.evidence-badge .evidence-link:hover {
  color: #1d4ed8;
}

.evidence-badge .evidence-subtext {
  font-size: 0.7rem;
  color: #64748b;
  line-height: 1.3;
}

/* 학부모 화면: 콤팩트 배지 (작고 깔끔한 형태) */
.evidence-badge-compact {
  margin-top: 8px;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.75rem;
  color: #334155;
}

.evidence-badge-compact .evidence-subtext {
  font-size: 0.68rem;
  color: #64748b;
}

/* 교직원 공문 화면: 눈에 띄는 배지 (강조 형태) */
.evidence-badge-prominent {
  margin-top: 10px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1.5px solid #10b981;
  border-radius: 10px;
  font-size: 0.88rem;
  color: #065f46;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

.evidence-badge-prominent .evidence-main {
  font-size: 0.88rem;
  font-weight: 700;
}

.evidence-badge-prominent .evidence-link {
  color: #047857;
  font-weight: 700;
  background: #d1fae5;
  padding: 2px 8px;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid #a7f3d0;
}

.evidence-badge-prominent .evidence-link:hover {
  background: #a7f3d0;
  color: #065f46;
}

.evidence-badge-prominent .evidence-subtext {
  font-size: 0.74rem;
  color: #047857;
  margin-top: 4px;
  opacity: 0.9;
}

/* ══════════════════════════════════════════════════════════════
   🌐 다문화 AI 브리핑 언어 선택 칩 & 💌 안심 돌봄 쪽지 스타일
   ══════════════════════════════════════════════════════════════ */

/* 담임선생님 안심 돌봄 쪽지 전용 배너 액션 */
.care-memo-banner-wrap {
  margin: 8px 0 6px 0;
}

.btn-open-care-memo {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff1f2 0%, #fee2e2 100%);
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.08);
  box-sizing: border-box;
}

.btn-open-care-memo:hover {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #fca5a5;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.15);
}

.btn-open-care-memo .care-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.btn-open-care-memo .care-text {
  flex: 1;
  text-align: left;
  margin-left: 6px;
  letter-spacing: -0.2px;
}

.btn-open-care-memo .care-tag {
  font-size: 0.68rem;
  padding: 2px 7px;
  background: #ffffff;
  color: #dc2626;
  border-radius: 10px;
  border: 1px solid #fca5a5;
  font-weight: 700;
  white-space: nowrap;
}

/* 🌐 다문화 언어 선택기 (4분할 그리드) */
.ai-lang-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 5px;
  background: #f1f5f9;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 6px;
}

.btn-lang-chip {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 2px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  line-height: 1.1;
  white-space: nowrap;
  user-select: none;
  box-sizing: border-box;
}

.btn-lang-chip .chip-flag {
  font-size: 0.85rem;
  line-height: 1;
}

.btn-lang-chip .chip-label {
  font-size: 0.72rem;
}

.btn-lang-chip:hover {
  background: rgba(255, 255, 255, 0.7);
  color: #1e293b;
}

.btn-lang-chip.active {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.28);
}

[data-theme="dark"] .ai-lang-selector {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .btn-lang-chip {
  color: #94a3b8;
}

[data-theme="dark"] .btn-lang-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

[data-theme="dark"] .btn-lang-chip.active {
  background: #2563eb;
  color: #ffffff;
}

[data-theme="dark"] .btn-open-care-memo {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.25) 100%);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

[data-theme="dark"] .btn-open-care-memo .care-tag {
  background: #1e293b;
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

/* ══════════════════════════════════════════════════════════════
   💌 담임선생님 안심 소통 비서 모달 (White Minimalist Premium Theme)
   ══════════════════════════════════════════════════════════════ */

.care-memo-modal-card {
  max-width: 580px;
  width: 94%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.28), 0 4px 16px rgba(15, 23, 42, 0.08);
}

.care-memo-modal-card .modal-header {
  background: #ffffff !important;
  border-bottom: 1px solid #f1f5f9;
  padding: 18px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.care-memo-modal-card .modal-title {
  color: #0f172a !important;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.care-header-badge {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.care-memo-modal-card .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  gap: 12px;
}

.care-memo-modal-card .modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.care-memo-modal-card .modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.care-memo-modal-card .modal-close-btn {
  color: #94a3b8 !important;
  font-size: 1.5rem;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.care-memo-modal-card .modal-close-btn:hover {
  color: #0f172a !important;
}

/* 🌐 모국어 선택 전용 바 (4분할 균등 그리드 시스템) */
.care-lang-bar {
  padding: 8px 18px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.care-lang-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.btn-care-lang-chip {
  height: 36px;
  padding: 0 4px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  box-sizing: border-box;
  width: 100%;
}

.btn-care-lang-chip .chip-flag {
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
}

.btn-care-lang-chip .chip-label {
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-care-lang-chip:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-care-lang-chip.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* 탭 내비게이션 (2분할 균등 그리드) */
.care-memo-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 8px 18px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.care-tab-btn {
  height: 40px;
  padding: 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.care-tab-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 100%;
}

.care-tab-btn:hover {
  color: #1e293b;
  border-color: #cbd5e1;
}

.care-tab-btn.active {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.12);
}

/* 탭 본문 */
.care-tab-content {
  display: none;
  padding: 16px 20px;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: calc(88vh - 210px);
  background: #ffffff;
}

.care-tab-content.active {
  display: flex;
}

/* 안내 문구 카드 */
.care-memo-intro {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.55;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #2563eb;
}

/* 감지된 민감 식품 분석 바 */
.care-memo-detected-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  flex-wrap: wrap;
}

.detected-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

.detected-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.detected-tag {
  padding: 3px 9px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.76rem;
}

.detected-tag.empty {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-weight: 600;
}

/* ⚡ 원터치 빠른 프리셋 문구 칩 */
.care-preset-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0 4px;
}

.care-preset-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.care-preset-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #0284c7;
  letter-spacing: -0.2px;
}

.care-preset-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.care-preset-chip {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #1e293b;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}

.care-preset-chip span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.care-preset-chip:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
  transform: translateY(-1px);
}

.care-preset-chip.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.28);
}

/* 🎙️ 음성 인식 (STT) 버튼 및 입력 필드 */
.care-memo-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.care-input-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.care-input-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

.btn-stt-mic {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 9px;
  font-size: 0.73rem;
  font-weight: 700;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-stt-mic:hover {
  background: #fee2e2;
  border-color: #ef4444;
  transform: scale(1.02);
}

.btn-stt-mic.recording {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #b91c1c !important;
  animation: pulseMic 1.4s infinite;
}

@keyframes pulseMic {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.care-input-box-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}

.stt-status-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 10px;
  background: #fef2f2;
  border: 1px dashed #f87171;
  border-radius: 6px;
  font-size: 0.74rem;
  color: #b91c1c;
  font-weight: 600;
  animation: fadeIn 0.2s ease;
}

.stt-pulse-dot {
  width: 8px;
  height: 8px;
  background: #dc2626;
  border-radius: 50%;
  animation: pulseDot 1.2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.care-text-input,
.care-multiline-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.86rem;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  font-family: inherit;
  transition: all 0.18s ease;
}

.care-text-input:focus,
.care-multiline-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.care-multiline-input {
  resize: vertical;
  line-height: 1.5;
  min-height: 75px;
}

/* 카테고리 칩 (4분할 균등 그리드 시스템) */
.care-memo-category-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.category-chip {
  height: 38px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
}

.category-chip span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 100%;
}

.category-chip input {
  display: none;
}

.category-chip:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.category-chip:has(input:checked) {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
}

/* 생성 버튼 */
.care-memo-btn-row {
  display: flex;
  margin-top: 2px;
}

.btn-care-primary {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 18px;
  border-radius: 10px;
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  box-sizing: border-box;
}

.btn-care-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* 결과 상자 (알림장 초안) */
.care-result-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  padding: 14px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  animation: fadeIn 0.2s ease-in;
}

.result-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1e40af;
  background: #dbeafe;
  padding: 3px 8px;
  border-radius: 4px;
}

.result-badge.alt {
  color: #166534;
  background: #dcfce7;
}

.result-char-count {
  font-size: 0.72rem;
  color: #64748b;
}

.care-memo-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 90px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #0f172a;
  background: #ffffff;
  resize: none;
  font-family: inherit;
  font-weight: 500;
}

.translated-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
}

.care-memo-trans-text {
  padding: 10px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #166534;
  font-weight: 500;
}

/* 하단 액션 바 (균등 2분할 50:50 그리드 시스템) */
.care-memo-action-bar {
  padding: 14px 20px 18px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.care-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.btn-care-share,
.btn-care-copy {
  height: 44px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-care-share {
  background: #059669;
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.22);
}

.btn-care-share:hover {
  background: #047857;
  transform: translateY(-1px);
}

.btn-care-copy {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
}

.btn-care-copy:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.quick-app-launch-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.74rem;
}

.quick-launch-label {
  font-weight: 600;
  color: #64748b;
}

.app-chip {
  height: 28px;
  line-height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  transition: all 0.15s;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
}

.app-chip:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #94a3b8;
}

.care-disclaimer {
  font-size: 0.7rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.4;
}

/* 모바일 뷰포트 최적화 */
@media (max-width: 480px) {
  .care-memo-modal-card {
    width: 96%;
    max-height: 94vh;
  }
  .care-memo-modal-card .modal-header {
    padding: 12px 14px 10px;
    gap: 8px;
  }
  .care-memo-modal-card .modal-title {
    font-size: 0.95rem;
  }
  .care-lang-bar {
    padding: 6px 12px 8px;
  }
  .care-lang-grid {
    gap: 4px;
  }
  .btn-care-lang-chip {
    height: 34px;
    padding: 0 2px;
    font-size: 0.7rem;
    gap: 3px;
  }
  .btn-care-lang-chip .chip-flag {
    font-size: 0.85rem;
  }
  .btn-care-lang-chip .chip-label {
    font-size: 0.68rem;
  }
  .care-memo-tabs {
    padding: 6px 12px;
    gap: 4px;
  }
  .care-tab-btn {
    height: 38px;
    padding: 0 4px;
    font-size: 0.74rem;
  }
  .care-memo-category-row {
    gap: 4px;
  }
  .category-chip {
    height: 34px;
    padding: 0 2px;
    font-size: 0.68rem;
  }
  .care-preset-label {
    font-size: 0.72rem;
  }
  .care-preset-chips {
    gap: 4px;
  }
  .care-preset-chip {
    height: 30px;
    padding: 0 4px;
    font-size: 0.69rem;
    gap: 2px;
  }
  .btn-stt-mic {
    height: 26px;
    padding: 0 7px;
    font-size: 0.68rem;
  }
  .care-tab-content {
    padding: 12px 14px;
    gap: 10px;
  }
  .care-memo-action-bar {
    padding: 10px 14px 12px;
  }
  .care-action-buttons {
    gap: 6px;
  }
  .btn-care-share,
  .btn-care-copy {
    height: 42px;
    font-size: 0.8rem;
    padding: 0 6px;
  }
}


