/* static/style.css */

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

:root {
  --bg:      #f1f5f9;
  --card:    #ffffff;
  --inner:   #f8fafc;
  --text:    #0f172a;
  --sub:     #334155;
  --muted:   #64748b;
  --border:  #e2e8f0;
  --brand:   #dc2626;
  --ok:      #22c55e;
  --err:     #ef4444;
  --warn:    #f59e0b;
  --blue:    #0ea5e9;
  --purple:  #a855f7;
  --orange:  #f97316;
  --cyan:    #06b6d4;
  --emerald: #10b981;
  --amber:   #d97706;
  --header-bg: #ffffff;
  --panel-bg:  #f8fafc;
  --zebra-bg:  rgba(0,0,0,0.04);
  --section-title-bg: rgba(220, 38, 38, 0.06);
}

[data-theme="dark"] {
  --bg:      #0f172a;
  --card:    #1e293b;
  --inner:   #0f172a;
  --text:    #f1f5f9;
  --sub:     #94a3b8;
  --muted:   #475569;
  --border:  #334155;
  --header-bg: #0a0e1a;
  --panel-bg:  #111827;
  --zebra-bg:  rgba(255,255,255,0.04);
  --section-title-bg: rgba(220, 38, 38, 0.14);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

.theme-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 36px; height: 36px;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,.28), 0 1px 2px rgba(0,0,0,.18);
}

.hidden { display: none !important; }

/* ── SPLASH ── */
#splash {
  position: fixed; inset: 0;
  background: #0a0a0a;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 1000;
  transition: opacity 0.6s ease;
}
#splash.fade-out { opacity: 0; pointer-events: none; }

.splash-glow {
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, #c0392b18 0%, transparent 70%);
  border-radius: 50%;
  animation: glowPulse 2s ease-in-out 1s infinite;
}
#splash-logo {
  width: 180px; height: 180px;
  border-radius: 50%;
  position: relative; z-index: 1;
  filter: drop-shadow(0 0 20px #c0392b66);
  animation: scaleIn 1s cubic-bezier(.34,1.56,.64,1) 0.2s both;
}
.splash-text {
  margin-top: 18px;
  text-align: center;
  animation: slideUp 0.6s ease-out 1s both;
}
.splash-brand { color: #c0392b; font-size: 13px; font-weight: 700; letter-spacing: 4px; }
.splash-sub   { color: #333; font-size: 10px; margin-top: 3px; letter-spacing: 1px; }

.splash-bar {
  position: absolute; bottom: 48px;
  width: 80px; height: 2px;
  background: #1a1a1a; border-radius: 2px; overflow: hidden;
}
.splash-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #c0392b, #e74c3c);
  animation: progress 2.8s ease-out 0.2s both;
}

/* ── HEADER ── */
#header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px 6px;
  display: flex; flex-direction: column; gap: 6px;
}
.header-row1 {
  display: flex; align-items: center;
  background: #000000;
  margin: -8px -16px 0;
  padding: 8px 16px;
}
[data-theme="dark"] .header-row1 {
  background: transparent;
  margin: 0;
  padding: 0;
}
.header-row2 {
  display: flex; align-items: stretch; justify-content: space-between; gap: 6px;
}
.header-btn-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: 1;
  min-width: 0;
}
.header-row2 .header-btn-wrap:last-child {
  flex: 1.6;
}
.header-row2 .theme-btn,
.header-row2 .menu-btn {
  width: 100%;
  height: 36px;
  font-size: 16px;
  padding: 0 8px;
  box-sizing: border-box;
}
.header-row2 .menu-btn {
  font-size: 12px;
  justify-content: center;
}
.header-btn-label {
  font-size: 8px; color: var(--muted); line-height: 1; text-align: center;
}

.menu-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 11px;
  cursor: pointer;
  position: relative;
  color: var(--sub);
  font-size: 12px;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,.28), 0 1px 2px rgba(0,0,0,.18);
}
.menu-btn-accent {
  background: #16a34a;
  border-color: #16a34a;
  box-shadow: 0 2px 8px rgba(0,0,0,.28), 0 1px 2px rgba(0,0,0,.18), 0 2px 10px rgba(22,163,74,.4);
}
.hamburger {
  display: block;
  width: 14px; height: 1.5px;
  background: var(--sub);
  border-radius: 2px;
  box-shadow: 0 4px 0 var(--sub), 0 -4px 0 var(--sub);
}
.hamburger-accent {
  background: #fff;
  box-shadow: 0 4px 0 #fff, 0 -4px 0 #fff;
}
.menu-label { color: var(--sub); font-size: 11px; }
.menu-label-accent { color: #fff; }

.badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--err);
  color: white; font-size: 9px; font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── MAIN ── */
main { padding: 12px; padding-top: 132px; display: flex; flex-direction: column; gap: 12px; padding-bottom: 32px; }

.card {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.45), 0 1px 4px rgba(0,0,0,.3);
}
.section-title {
  padding: 12px 14px 10px;
  font-size: 13px; font-weight: 600; color: var(--text);
  background: var(--section-title-bg);
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--brand);
}

/* MAP */
#map { height: 280px; }
.leaflet-container { background: #1a2744; }

/* EVENTS — Calendar */
#events-list { padding: 10px; }

.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.cal-nav-btn {
  background: var(--inner); border: 1px solid var(--border);
  color: var(--text); font-size: 20px; font-weight: 300;
  width: 36px; height: 36px; border-radius: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.28), 0 1px 2px rgba(0,0,0,.18);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.cal-nav-btn:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.36), 0 1px 3px rgba(0,0,0,.22);
  border-color: var(--border-h, var(--border));
}
.cal-month-title {
  font-size: 14px; font-weight: 700; color: var(--text);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 10px;
}
.cal-header {
  text-align: center;
  font-size: 10px; font-weight: 600; color: var(--muted);
  padding: 4px 0 6px;
}
.cal-header:first-child { color: #f43f5e; }
.cal-header:last-child  { color: var(--blue); }
.cal-cell {
  min-height: 96px;
  background: var(--inner);
  border-radius: 8px;
  padding: 5px 3px 4px;
  display: flex; flex-direction: column; align-items: stretch;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid transparent;
  transition: border-color 0.15s;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.28), 0 1px 2px rgba(0,0,0,.18);
}
.cal-cell.empty { background: transparent; }
.cal-cell.today { border: 2px solid #f59e0b; box-shadow: 0 0 8px #f59e0b55; }
.cal-cell.today .cal-day { color: #f59e0b; font-weight: 700; }
.cal-cell.selected { border: 2px solid var(--brand); }
.cal-cell.selected .cal-day { color: var(--brand); font-weight: 700; }
.cal-day { font-size: 12px; color: var(--sub); line-height: 1.4; text-align: center; flex-shrink: 0; }

/* Event chips inside calendar cells */
.cal-chip {
  display: block;
  width: 100%;
  font-size: 8px; font-weight: 600;
  color: #fff;
  border-radius: 3px;
  padding: 2px 3px;
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.cal-chip.food        { background: #f97316; } /* 주황 — 음식 */
.cal-chip.activity    { background: #22c55e; } /* 초록 — 스포츠·액티비티 */
.cal-chip.performance { background: #8b5cf6; } /* 보라 — 음악·공연 */
.cal-chip.culture     { background: #e11d48; } /* 장미 — 문화·축제 */
.cal-chip.general     { background: #0ea5e9; } /* 하늘 — 일반 */
.cal-more {
  font-size: 7px; color: var(--muted);
  padding: 1px 3px; margin-top: 1px; cursor: pointer;
  flex-shrink: 0;
}

/* View toggle */
.cal-view-toggle {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.cal-view-btn {
  flex: 1; padding: 7px;
  background: var(--inner); border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; font-weight: 600;
  border-radius: 10px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,.28), 0 1px 2px rgba(0,0,0,.18);
}
.cal-view-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Week view */
.cal-grid.week-view .cal-cell { min-height: 160px; }
.cal-grid.week-view .cal-chip { font-size: 9px; padding: 2px 4px; }

/* Day panel (selected day events list) */
#cal-day-panel { margin-top: 10px; }
.day-panel-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: .4px; margin-bottom: 7px;
}
.day-panel-item {
  background: var(--inner); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
  border-left: 3px solid var(--blue);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.day-panel-item:last-child { margin-bottom: 0; }
.day-panel-item.food        { border-left-color: #f97316; }
.day-panel-item.activity    { border-left-color: #22c55e; }
.day-panel-item.performance { border-left-color: #8b5cf6; }
.day-panel-item.culture     { border-left-color: #e11d48; }
.day-panel-item.general     { border-left-color: #0ea5e9; }
.day-panel-name { font-size: 12px; font-weight: 500; color: var(--text); }
.day-panel-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* Calendar legend */
.cal-legend {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 10px 0 4px;
}
.cal-legend-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--muted);
}
.cal-legend-dot {
  width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
}
.cal-legend-dot.food        { background: #f97316; }
.cal-legend-dot.activity    { background: #22c55e; }
.cal-legend-dot.performance { background: #8b5cf6; }
.cal-legend-dot.culture     { background: #e11d48; }
.cal-legend-dot.general     { background: #0ea5e9; }

/* ── EVENT MODAL (bottom sheet) ── */
.event-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1100;
  backdrop-filter: blur(2px);
}
.event-modal {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  z-index: 1101;
  max-height: 80vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,.5);
}
.event-modal.open { transform: translateY(0); }
.event-modal-handle {
  width: 100%;
  padding: 12px 0 8px;
  background: transparent;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
}
.event-modal-handle::before {
  content: '';
  display: block;
  width: 44px; height: 5px;
  background: var(--border); border-radius: 3px;
  margin: 0 auto;
}
.event-modal-handle:active { cursor: grabbing; }
.event-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 0; flex-shrink: 0;
}
.modal-category-bar { height: 4px; border-radius: 2px; width: 40px; }
.modal-category-bar.food        { background: #f97316; }
.modal-category-bar.activity    { background: #22c55e; }
.modal-category-bar.performance { background: #8b5cf6; }
.modal-category-bar.culture     { background: #e11d48; }
.modal-category-bar.general     { background: #0ea5e9; }
.event-modal-close {
  background: var(--inner); border: none;
  width: 28px; height: 28px; border-radius: 8px;
  color: var(--sub); font-size: 13px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.event-modal-body { overflow-y: auto; padding: 14px 16px 32px; flex: 1; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 14px; line-height: 1.3; }
.modal-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.modal-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.modal-label { font-size: 10px; color: var(--muted); margin-bottom: 1px; }
.modal-value { font-size: 13px; color: var(--text); line-height: 1.4; }
.modal-desc {
  font-size: 12px; color: var(--sub); line-height: 1.6;
  background: var(--inner); border-radius: 10px; padding: 10px 12px; margin-top: 4px;
}
.modal-link {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 14px; padding: 13px;
  background: var(--brand); color: white; border-radius: 12px;
  text-decoration: none; font-size: 13px; font-weight: 600;
}

.event-item {
  background: var(--inner);
  border-radius: 10px;
  padding: 9px 11px;
  display: flex; gap: 10px; align-items: flex-start;
  border-left: 3px solid var(--blue);
  margin-bottom: 6px;
}
.event-item:last-child { margin-bottom: 0; }
.event-item.food    { border-left-color: var(--orange); }
.event-item.sports  { border-left-color: var(--ok); }
.event-item.arts    { border-left-color: var(--purple); }
.event-item.culture { border-left-color: #f43f5e; }
.event-date { min-width: 28px; text-align: center; flex-shrink: 0; }
.event-day  { font-size: 14px; font-weight: 700; color: var(--blue); }
.event-month{ font-size: 8px; color: var(--muted); }
.event-item.food    .event-day { color: var(--orange); }
.event-item.sports  .event-day { color: var(--ok); }
.event-item.arts    .event-day { color: var(--purple); }
.event-item.culture .event-day { color: #f43f5e; }
.event-name { font-size: 11px; font-weight: 500; color: var(--text); }
.event-loc  { font-size: 9px; color: var(--muted); margin-top: 2px; }

/* SCHEDULES */
.store-tabs {
  display: flex; gap: 6px;
  padding: 10px 10px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.store-tab {
  flex-shrink: 0;
  background: var(--inner);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 11px; font-weight: 600;
  line-height: 1.4;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,.28), 0 1px 2px rgba(0,0,0,.18);
}
.store-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}
#schedule-images { padding: 10px; min-height: 120px; scroll-margin-top: 68px; }
#schedule-images img {
  width: 100%; border-radius: 10px;
  display: block; margin-bottom: 8px;
  aspect-ratio: 4/3; object-fit: contain; background: var(--inner);
}

/* ── POPULAR TIMES + REVIEWS (혼잡도 + 리뷰, 2026-04-09) ── */
.pop-live-badge {
  display: flex; align-items: center; gap: 6px;
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.3);
  border-radius: 8px; padding: 5px 10px; margin-bottom: 8px;
  font-size: 12px; color: var(--text);
}
.pop-live-dot {
  width: 8px; height: 8px; background: #16a34a; border-radius: 50%; flex-shrink: 0;
  animation: pop-pulse 1.4s ease-in-out infinite;
}
@keyframes pop-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.75); }
}
.pop-chart {
  display: flex; align-items: flex-end; gap: 2px;
  height: 80px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 18px;
}
.pop-bar-col {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; min-width: 16px; position: relative;
}
.pop-bar-wrap {
  width: 100%; height: 64px; display: flex; align-items: flex-end;
  position: relative; border-bottom: 1px solid var(--border);
}
.pop-bar {
  width: 100%; background: var(--brand); opacity: 0.6;
  border-radius: 3px 3px 0 0; min-height: 2px; transition: height 0.3s ease;
}
.pop-bar-col--now .pop-bar { opacity: 1; box-shadow: 0 0 8px var(--brand); }
.pop-bar-live {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--blue); box-shadow: 0 0 4px var(--blue);
}
.pop-bar-label {
  position: absolute; bottom: -16px; font-size: 7px;
  color: var(--muted); white-space: nowrap;
}
.pop-bar-col--now .pop-bar-label { color: var(--brand); font-weight: 700; }
.pop-rating {
  display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px;
}
.pop-rating-stars { color: #f59e0b; font-size: 16px; }
.pop-rating-num { font-size: 20px; font-weight: 700; color: var(--text); }
.pop-rating-total { font-size: 11px; color: var(--muted); }
.pop-reviews { max-height: 220px; overflow-y: auto; }
.pop-review-item {
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.pop-review-item:last-child { border-bottom: none; }
.pop-review-header {
  display: flex; align-items: center; gap: 6px; margin-bottom: 3px;
  font-size: 11px;
}
.pop-review-stars { color: #f59e0b; font-size: 10px; }
.pop-review-author { font-weight: 600; color: var(--text); }
.pop-review-time { color: var(--muted); font-size: 9px; }
.pop-review-text {
  font-size: 11px; color: var(--sub); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── TOAST NOTIFICATIONS (리뷰 알림, 2026-04-09) ── */
#toast-container {
  position: fixed; top: 72px; right: 12px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; max-width: 320px;
}
.toast {
  pointer-events: auto;
  background: var(--card); border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 10px; padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  font-size: 12px; color: var(--text);
  animation: toast-in 0.3s ease, toast-out 0.3s ease 5.7s forwards;
  cursor: pointer;
}
.toast-title { font-weight: 700; margin-bottom: 3px; font-size: 11px; }
.toast-body { color: var(--sub); line-height: 1.4; }
.toast--good { border-left-color: var(--ok); }
.toast--warn { border-left-color: var(--warn); }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* ── OVERLAY ── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  backdrop-filter: blur(2px);
}

/* ── RIGHT PANEL ── */
.panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(320px, 88vw);
  background: var(--panel-bg);
  z-index: 1001;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,.6);
}
.panel.open { transform: translateX(0); }

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-title { font-size: 14px; font-weight: 700; color: var(--text); }
.panel-close {
  background: var(--card); border: none;
  width: 28px; height: 28px; border-radius: 8px;
  color: var(--sub); font-size: 13px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.panel-body { overflow-y: auto; flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 10px; }

.panel-section { background: var(--card); border-radius: 12px; padding: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.35); }
.panel-section-title { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .6px; margin-bottom: 8px; }

/* Pipeline status dots (renderPipelines) */
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot.ok     { background: var(--ok);    box-shadow: 0 0 6px var(--ok); }
.dot.error  { background: var(--err);   box-shadow: 0 0 6px var(--err); }
.dot.stale  { background: var(--warn);  box-shadow: 0 0 6px var(--warn); }
.dot.no_log { background: var(--muted); }

/* Tasks */
.task-row {
  background: var(--inner); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 5px;
  border-left: 2px solid var(--warn);
}
.task-name { font-size: 11px; color: var(--text); font-weight: 500; }
.task-meta { font-size: 9px; color: var(--muted); margin-top: 2px; }
.no-tasks  { color: var(--muted); font-size: 11px; text-align: center; padding: 8px 0; }

/* Sheets */
.sheet-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--blue);
  font-size: 11px;
}
.sheet-link:last-child { border-bottom: none; }

/* Pipeline grid */
.pipeline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.pipe-item {
  background: var(--inner); border-radius: 8px;
  padding: 7px 9px;
  display: flex; align-items: center; gap: 5px;
}
.pipe-item.error { background: #7f1d1d22; border: 1px solid #dc262622; }
.pipe-name { font-size: 10px; color: var(--text); }
.pipe-time { font-size: 8px; color: var(--muted); }

/* Loading */
.loading { color: var(--muted); font-size: 11px; padding: 8px; text-align: center; }

/* ── ANIMATIONS ── */
@keyframes scaleIn {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 12px #c0392b88); }
  50%       { filter: drop-shadow(0 0 28px #c0392b); }
}
@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes progress {
  from { width: 0%; }
  to   { width: 100%; }
}

/* ── PRICE CHANGES ────────────────────────────────────────────────────── */
.price-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.price-row:last-child { border-bottom: none; }
.price-pct {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}
.price-pct.up   { color: #ef4444; background: #ef444422; }
.price-pct.down { color: #22c55e; background: #22c55e22; }

/* ── ITEM SEARCH ─────────────────────────────────────────────────────── */
.item-suggestion {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.item-suggestion:last-child { border-bottom: none; }
.item-suggestion:hover { background: var(--inner); }

/* ── QUICK NAV ───────────────────────────────────────────────────────── */
.quick-nav {
  display: flex;
  gap: 6px;
  padding: 8px 16px 4px;
  background: var(--bg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.quick-nav::-webkit-scrollbar { display: none; }
.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.quick-btn.active {
  background: var(--brand);
  border-color: var(--brand);
}
.quick-btn.active .quick-label { color: #fff; }
.quick-icon { font-size: 18px; line-height: 1; }
.quick-label { font-size: 9px; font-weight: 600; color: var(--sub); }

/* ── TASK CARDS ──────────────────────────────────────────────────────── */
.task-card {
  background: var(--inner);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.task-card:last-child { margin-bottom: 0; }
.task-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.task-card-desc {
  font-size: 11px;
  color: var(--sub);
  line-height: 1.5;
  margin-bottom: 8px;
}
.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.task-card-link {
  font-size: 11px;
  color: var(--blue);
  cursor: pointer;
  font-weight: 500;
}

/* ───────────────────────────────────────────────
 * AI Agents Grid (Phase 1 — 2026-04-07)
 * ─────────────────────────────────────────────── */
#ai-agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  row-gap: 10px;
  column-gap: 16px;
  padding: 4px 6px;
}
.ai-card {
  background: var(--inner);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  min-height: 120px;
  box-shadow: 0 2px 8px rgba(0,0,0,.28), 0 1px 2px rgba(0,0,0,.18);
}
.ai-card:hover   { border-color: var(--blue); box-shadow: 0 4px 14px rgba(0,0,0,.36), 0 1px 3px rgba(0,0,0,.22); }
.ai-card:active  { transform: scale(0.98); }
.ai-card.status-warn { border-left: 3px solid var(--warn); }
.ai-card.status-err  { border-left: 3px solid var(--err); }
.ai-card.status-ok   { border-left: 3px solid var(--ok); }

.ai-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.ai-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-card-emoji { font-size: 16px; }
.ai-card-time {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.ai-card-role {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.ai-card-summary {
  font-size: 12px;
  color: var(--sub);
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ai-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--muted);
}
.ai-card-link-count {
  color: var(--blue);
  font-weight: 600;
}
.ai-card-more {
  color: var(--muted);
}

/* Agent detail modal content (reuses existing .event-modal) */
.ai-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.ai-detail-emoji { font-size: 28px; }
.ai-detail-name  { font-size: 18px; font-weight: 700; color: var(--text); }
.ai-detail-meta  {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.ai-detail-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 14px;
}
.ai-detail-links {
  margin-top: 10px;
}
.ai-detail-links-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.ai-detail-link {
  display: block;
  background: var(--inner);
  border-left: 3px solid var(--blue);
  padding: 9px 12px;
  margin-bottom: 6px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
  word-break: break-all;
}
.ai-detail-link:hover {
  background: var(--border);
}

/* Phase 2 (2026-04-07): 피드백 버튼 */
.ai-card-footer .ai-fb-btns {
  display: flex;
  gap: 4px;
}
.ai-fb-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.2;
  transition: all 0.15s;
}
.ai-fb-btn:hover   { background: var(--border); }
.ai-fb-btn.up.sent   { background: #22c55e33; border-color: #22c55e; color: #22c55e; }
.ai-fb-btn.down.sent { background: #ef444433; border-color: #ef4444; color: #ef4444; }
.ai-fb-count { font-size: 11px; font-weight: 600; margin-left: 1px; }

.ai-detail-feedback {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.ai-detail-feedback-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.ai-detail-feedback-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-detail-fb-btn {
  flex: 1;
  padding: 8px 12px;
  background: var(--inner);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.ai-detail-fb-btn:hover { background: var(--border); }
.ai-detail-fb-btn.up.sent   { background: #22c55e33; border-color: #22c55e; color: #22c55e; }
.ai-detail-fb-btn.down.sent { background: #ef444433; border-color: #ef4444; color: #ef4444; }
.ai-detail-fb-comment-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  margin-top: 6px;
}
.ai-detail-fb-reason {
  flex: 1;
  padding: 8px 10px;
  background: var(--inner);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  font-size: 12px;
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}
.ai-detail-fb-send {
  padding: 8px 14px;
  background: var(--accent, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.ai-detail-fb-send:hover { opacity: 0.85; }
.ai-detail-fb-saved {
  font-size: 12px;
  font-weight: 600;
  color: #22c55e;
  background: #22c55e18;
  border: 1px solid #22c55e55;
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 8px;
  display: none;
}
.ai-detail-fb-saved.show { display: block; }

/* ── Nutrition Table (Phase 4, 2026-04-08) ───────────────────────────────── */
.nutr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.5;
}
.nutr-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
}
.nutr-table td {
  padding: 8px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  white-space: nowrap;
}
.nutr-table tbody tr:nth-child(even) {
  background: var(--zebra-bg);
}
.nutr-table tbody tr:hover {
  background: color-mix(in srgb, var(--surface) 80%, var(--accent));
}

/* ── Zebra striping (가격변동 / 인보이스합계) ── */
#price-changes-list .zebra-row.even,
#invoice-totals-list .zebra-row.even {
  background: var(--zebra-bg);
}

/* ── 쇼타 신메뉴 제안 모달 (Phase 5, 2026-04-08) ────────────────────────── */
.shota-suggestions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.shota-suggestion-card {
  background: var(--inner);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.shota-card-layout {
  display: flex;
  gap: 0;
}
.shota-img-wrap {
  flex-shrink: 0;
  width: 120px;
}
.shota-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  display: block;
}
.shota-img-placeholder {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: var(--surface);
}
.shota-card-info {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.shota-cat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.shota-cat {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.shota-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
}
.shota-badge-existing {
  background: #22c55e1a;
  color: #22c55e;
  border: 1px solid #22c55e44;
}
.shota-badge-creative {
  background: #f59e0b1a;
  color: #f59e0b;
  border: 1px solid #f59e0b44;
}
.shota-name-ko {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-top: 2px;
}
.shota-name-en {
  font-size: 11px;
  color: var(--muted);
}
.shota-ingreds {
  font-size: 10px;
  color: var(--sub);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shota-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  margin-top: 2px;
}
.shota-cost  { color: var(--muted); }
.shota-arrow { color: var(--border); }
.shota-price { color: #34d399; font-weight: 700; }
.shota-chef-note {
  font-size: 11px;
  color: var(--sub);
  font-style: italic;
  line-height: 1.4;
  border-left: 2px solid var(--accent);
  padding-left: 8px;
  margin-top: 2px;
}
.shota-recipe-toggle {
  border-top: 1px solid var(--border);
}
.shota-recipe-toggle summary {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 12px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.shota-recipe-toggle summary::-webkit-details-marker { display: none; }
.shota-recipe-toggle[open] summary { color: var(--text); }
.shota-steps {
  padding: 4px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shota-step {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}
.shota-step-num {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: var(--accent);
  color: var(--surface);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.shota-card-actions {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}
.shota-save-btn {
  background: var(--inner);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.shota-save-btn:hover { border-color: var(--blue); color: var(--blue); }
.shota-save-btn.saved { background: #22c55e1a; border-color: #22c55e; color: #22c55e; }

/* 저장된 메뉴 목록 */
.shota-saved-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.shota-saved-item:last-child { border-bottom: none; }
.shota-saved-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.shota-saved-img-ph {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--surface);
  border-radius: 6px;
  flex-shrink: 0;
}
.shota-saved-info { flex: 1; min-width: 0; }
.shota-saved-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shota-saved-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.shota-unsave-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.5;
  padding: 4px;
  flex-shrink: 0;
}
.shota-unsave-btn:hover { opacity: 1; }
#section-ingredients .card-inner { padding: 12px; }

/* ─── Gluten-Free Badges (2026-04-16) ──────────────────────────────
   메뉴명 옆 표시. 모바일 우선, 테마 인지 변수, 드롭섀도 통일 톤.  */
:root {
  --gf-yes-bg:      rgba(34, 197, 94, 0.14);
  --gf-yes-fg:      #15803d;
  --gf-yes-border:  rgba(34, 197, 94, 0.28);
  --gf-no-bg:       rgba(239, 68, 68, 0.12);
  --gf-no-fg:       #b91c1c;
  --gf-no-border:   rgba(239, 68, 68, 0.26);
  --gf-unknown-bg:  rgba(245, 158, 11, 0.14);
  --gf-unknown-fg:  #b45309;
  --gf-unknown-border: rgba(245, 158, 11, 0.3);
}
[data-theme="dark"] {
  --gf-yes-bg:      rgba(34, 197, 94, 0.18);
  --gf-yes-fg:      #6ee7b7;
  --gf-yes-border:  rgba(34, 197, 94, 0.38);
  --gf-no-bg:       rgba(239, 68, 68, 0.18);
  --gf-no-fg:       #fca5a5;
  --gf-no-border:   rgba(239, 68, 68, 0.38);
  --gf-unknown-bg:  rgba(245, 158, 11, 0.18);
  --gf-unknown-fg:  #fcd34d;
  --gf-unknown-border: rgba(245, 158, 11, 0.4);
}
.gf-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid transparent;
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  cursor: help;
}
.gf-badge.gf-yes {
  background: var(--gf-yes-bg);
  color: var(--gf-yes-fg);
  border-color: var(--gf-yes-border);
}
.gf-badge.gf-no {
  background: var(--gf-no-bg);
  color: var(--gf-no-fg);
  border-color: var(--gf-no-border);
}
.gf-badge.gf-unknown {
  background: var(--gf-unknown-bg);
  color: var(--gf-unknown-fg);
  border-color: var(--gf-unknown-border);
}
