/* ==========================================
   MOBILE-FIRST RESET & BASE
   ========================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  height: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================
   DESIGN TOKENS
   ========================================== */
:root {
  --rgb-white: 255, 255, 255;
  --rgb-text: 232, 234, 240;
  --rgb-bg: 13, 15, 28;

  --gold:    #f5c842;
  --teal:    #1de9b6;
  --teal-dk: #00bfa5;
  --coral:   #ff6b6b;
  --purple:  #9c6fff;
  --blue:    #5294ff;
  --green:   #1de9b6;
  
  --bg:      #0d0f1c;
  --bg2:     #13162a;
  --bg3:     #1a1e35;
  --border:  rgba(var(--rgb-white),0.09);
  --glass:   rgba(var(--rgb-white),0.05);
  --text-main: #e8eaf0;
  --text-muted: rgba(var(--rgb-white),0.7);
  --card-bg: rgba(var(--rgb-white),0.02);

  --r:       14px;
  --r-sm:    9px;
  --header-h: 60px;
  --nav-h: 65px;
}

body.light-theme {
  --rgb-white: 0, 0, 0;
  --rgb-text: 40, 40, 40;
  --rgb-bg: 250, 245, 235;

  --bg:      #faf5eb;
  --bg2:     #fffdf7;
  --bg3:     #f2ebd9;
  --border:  rgba(0,0,0,0.1);
  --glass:   rgba(0,0,0,0.03);
  --text-main: #1a202c;
  --text-muted: rgba(0,0,0,0.6);
  --card-bg: #fffdf7;
}

/* ==========================================
   APP HEADER
   ========================================== */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(var(--rgb-bg),0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: env(safe-area-inset-top, 0) 0 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
}

.header-title { display: flex; align-items: center; gap: 10px; }
.header-emoji { font-size: 1.8rem; line-height: 1; }

.header-main {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-sub { font-size: 0.7rem; color: rgba(var(--rgb-text),0.5); margin-top: 1px; }
.header-actions { display: flex; gap: 6px; }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.icon-btn:active { background: rgba(var(--rgb-white),0.12); }
.install-icon-btn { background: linear-gradient(135deg, rgba(29,233,182,0.2), rgba(82,148,255,0.2)); border-color: var(--teal); }

/* ==========================================
   PLAN TABS (in header)
   ========================================== */
.plan-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 10px 10px;
  gap: 8px;
}

.plan-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 4px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--glass);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Noto Sans KR', sans-serif;
}

.plan-tab-icon  { font-size: 1rem; }
.plan-tab-name  { font-size: 0.72rem; font-weight: 700; color: rgba(var(--rgb-text),0.75); }
.plan-tab-sub   { font-size: 0.6rem; color: rgba(var(--rgb-text),0.4); }

.plan-tab.active { background: rgba(245,200,66,0.12); border-color: var(--gold); }
.plan-tab.active .plan-tab-name { color: var(--gold); }
.plan-tab.active .plan-tab-sub  { color: rgba(245,200,66,0.6); }
.plan-tab.lock-tab { border-color: rgba(29,233,182,0.3); }
.plan-tab.lock-tab .plan-tab-name { color: var(--teal); }
.plan-tab.locked { background: rgba(29,233,182,0.15); border-color: var(--teal); }
.plan-tab.locked .plan-tab-sub { color: var(--teal); }

/* ==========================================
   MAIN SCROLLABLE AREA
   ========================================== */
.app-main {
  position: fixed;
  top: var(--header-h);
  bottom: var(--nav-h);
  left: 0; right: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* ==========================================
   TABS (content panels)
   ========================================== */
.tab-section {
  display: none;
  padding: 12px 12px 20px;
  min-height: 100%;
  animation: fadeIn 0.2s ease;
}
.tab-section.active { display: block; }

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

/* ==========================================
   SECTION BLOCKS
   ========================================== */
.section-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 12px;
  overflow: hidden;
}

.block-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 12px 14px 8px;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
}

.block-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
}

.block-sub { font-size: 0.72rem; color: rgba(var(--rgb-text),0.45); padding: 6px 14px 0; }

.quick-plan-switch {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.q-plan-btn {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.q-plan-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 800;
  background: rgba(245, 200, 66, 0.1);
}

/* ==========================================
   CURRENCY CONVERTER
   ========================================== */
.converter-card {
  border: 1px solid rgba(29,233,182,0.2) !important;
  background: linear-gradient(135deg, rgba(29,233,182,0.05) 0%, var(--bg2) 100%) !important;
}

.rate-ts {
  font-size: 0.6rem;
  color: rgba(var(--rgb-text),0.4);
  text-align: right;
  max-width: 120px;
  line-height: 1.3;
}

.conv-grid {
  padding: 10px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.conv-arrow {
  text-align: center;
  color: var(--teal);
  font-size: 0.7rem;
  opacity: 0.4;
  line-height: 1;
  padding: 1px 0;
}

.conv-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(var(--rgb-white),0.04);
}
.conv-row:last-child { border-bottom: none; }

.conv-left {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 58px;
  flex-shrink: 0;
}

.conv-flag { font-size: 1.1rem; }
.conv-code { font-family: 'Outfit', sans-serif; font-size: 0.72rem; font-weight: 700; color: rgba(var(--rgb-text),0.55); }

.conv-input {
  flex: 1;
  background: rgba(var(--rgb-white),0.04);
  border: 1px solid rgba(var(--rgb-white),0.1);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-align: right;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  min-width: 0;
}
.conv-input:focus {
  border-color: var(--teal);
  background: rgba(29,233,182,0.06);
}
.conv-input::placeholder { color: rgba(var(--rgb-text),0.2); }

.conv-unit {
  font-size: 0.8rem;
  color: rgba(var(--rgb-text),0.45);
  width: 18px;
  text-align: right;
  flex-shrink: 0;
}

.rate-chips {
  display: flex;
  gap: 8px;
  padding: 8px 14px 12px;
  flex-wrap: wrap;
}

.rate-chip {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(29,233,182,0.07);
  border: 1px solid rgba(29,233,182,0.15);
  color: rgba(var(--rgb-text),0.65);
}

.rate-chip strong { color: var(--teal); font-family: 'Outfit', sans-serif; font-size: 0.85rem; }

/* ==========================================
   OVERVIEW TABLE
   ========================================== */
.overview-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.overview-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  font-size: 0.75rem;
}

.overview-table th {
  padding: 8px 10px;
  background: rgba(245,200,66,0.08);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: left;
}

.overview-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(var(--rgb-white),0.04);
  vertical-align: middle;
  white-space: nowrap;
}

.overview-table tr:last-child td { border-bottom: none; }

.day-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.68rem;
  background: rgba(29,233,182,0.15);
  color: var(--teal);
}

.transport-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 100px;
  font-size: 0.65rem;
  background: rgba(82,148,255,0.12);
  color: var(--blue);
  border: 1px solid rgba(82,148,255,0.25);
}

/* ==========================================
   DAY CARDS
   ========================================== */
.day-card { border-bottom: 1px solid var(--border); }
.day-card:last-child { border-bottom: none; }

.day-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.day-header:active { background: rgba(var(--rgb-white),0.04); }

.day-num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 38px;
}

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

.day-date { font-size: 0.65rem; color: var(--gold); font-weight: 600; letter-spacing: 0.04em; }
.day-title { font-size: 0.85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.day-facts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.day-fact {
  font-size: 0.62rem; font-weight: 600; padding: 2px 8px; border-radius: 100px;
  white-space: nowrap;
}
.fact-sleep { background: rgba(156,111,255,0.12); color: var(--purple); }
.fact-move  { background: rgba(82,148,255,0.12);  color: var(--blue); }

.day-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 0.6rem; padding: 2px 7px; border-radius: 100px; border: 1px solid var(--border); color: rgba(var(--rgb-text),0.55); }

.day-arrow { font-size: 0.65rem; color: rgba(var(--rgb-text),0.3); transition: transform 0.25s; flex-shrink: 0; }
.day-card.open .day-arrow { transform: rotate(180deg); }

.day-body { max-height: 0; overflow: hidden; transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1); }
.day-card.open .day-body { max-height: 9999px; }

.day-body-inner { padding: 0 14px 14px 52px; }

.timeline { position: relative; padding-left: 16px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 1.5px;
  background: linear-gradient(to bottom, var(--teal), transparent);
}

.tl-item { position: relative; margin-bottom: 14px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-item::before {
  content: '';
  position: absolute;
  left: -19px; top: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px var(--teal);
}

.tl-time { font-family: 'Outfit', sans-serif; font-size: 0.65rem; font-weight: 700; color: var(--gold); letter-spacing: 0.04em; }
.tl-cat { display: inline-block; padding: 1px 7px; border-radius: 100px; font-size: 0.6rem; font-weight: 700; margin: 2px 0; }
.cat-move  { background: rgba(82,148,255,0.15);  color: var(--blue); }
.cat-sight { background: rgba(29,233,182,0.15);  color: var(--teal); }
.cat-food  { background: rgba(255,107,107,0.15); color: var(--coral); }
.cat-hotel { background: rgba(156,111,255,0.15); color: var(--purple); }
.cat-shop  { background: rgba(245,200,66,0.15);  color: var(--gold); }

.tl-title { font-size: 0.85rem; font-weight: 700; margin-bottom: 2px; }
.tl-desc  { font-size: 0.78rem; color: rgba(var(--rgb-text),0.6); line-height: 1.5; }

.tl-meta { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.meta-chip {
  font-size: 0.64rem; font-weight: 600; padding: 2px 8px; border-radius: 100px;
  background: rgba(var(--rgb-text),0.05); border: 1px solid var(--border);
  color: rgba(var(--rgb-text),0.65); white-space: nowrap;
}

.kw-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.kw-btn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 0.66rem; font-weight: 700;
  background: rgba(245,200,66,0.1); border: 1px solid rgba(245,200,66,0.35);
  color: var(--gold); cursor: pointer; transition: all 0.2s;
  font-family: inherit;
}
.kw-btn:active, .kw-btn:hover { background: rgba(245,200,66,0.22); }

.link-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }

.pl {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 100px;
  font-size: 0.62rem; font-weight: 700; text-decoration: none;
  border: 1px solid; transition: opacity 0.2s;
}
.pl:active { opacity: 0.7; }
.pl.n { color: #03c75a; border-color: rgba(3,199,90,0.4);   background: rgba(3,199,90,0.08); }
.pl.g { color: #4285f4; border-color: rgba(66,133,244,0.4); background: rgba(66,133,244,0.08); }
.pl.m { color: #ea4335; border-color: rgba(234,67,53,0.4);  background: rgba(234,67,53,0.08); }

.tip-bubble {
  margin-top: 6px; padding: 8px 10px;
  background: rgba(245,200,66,0.06);
  border: 1px solid rgba(245,200,66,0.18);
  border-radius: var(--r-sm);
  font-size: 0.72rem; color: rgba(245,200,66,0.85); line-height: 1.5;
}
.tip-bubble::before { content: '💡 '; }

/* ==========================================
   PLACES GRID
   ========================================== */
#places-grid { padding: 8px 12px 12px; }

.place-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.place-card:active { border-color: rgba(29,233,182,0.3); }

.place-name { font-family: 'Outfit', sans-serif; font-size: 0.95rem; font-weight: 700; margin-bottom: 2px; }
.place-name-en { font-size: 0.65rem; color: rgba(var(--rgb-text),0.35); margin-bottom: 6px; }

.place-metas { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.place-meta {
  font-size: 0.62rem; padding: 2px 8px; border-radius: 100px;
  background: rgba(29,233,182,0.08); border: 1px solid rgba(29,233,182,0.2); color: var(--teal);
}
.place-meta.booking { background: rgba(255,107,107,0.08); border-color: rgba(255,107,107,0.3); color: var(--coral); }

.place-desc { font-size: 0.8rem; color: rgba(var(--rgb-text),0.7); line-height: 1.55; margin-bottom: 8px; }
.place-insider {
  padding: 7px 10px; background: rgba(245,200,66,0.05);
  border: 1px solid rgba(245,200,66,0.15); border-radius: var(--r-sm);
  font-size: 0.72rem; color: rgba(245,200,66,0.85); line-height: 1.5; margin-bottom: 6px;
}
.place-insider::before { content: '💡 '; }

.place-warning { font-size: 0.7rem; color: var(--coral); margin-bottom: 8px; }

.kid-toggle {
  display: inline-block; padding: 4px 10px; border-radius: 100px;
  background: rgba(156,111,255,0.12); border: 1px solid rgba(156,111,255,0.3);
  color: #b388ff; font-size: 0.7rem; font-weight: 700; cursor: pointer; margin-bottom: 4px;
}
.kid-toggle:active { background: rgba(156,111,255,0.25); }

.kid-content {
  display: none; padding: 8px 10px;
  background: rgba(156,111,255,0.06);
  border-left: 2px solid var(--purple); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 0.78rem; color: rgba(var(--rgb-white),0.88); line-height: 1.55; margin-bottom: 8px;
}
.kid-content.active { display: block; }

.place-links { display: flex; gap: 5px; padding-top: 8px; border-top: 1px solid var(--border); }

/* ==========================================
   PRICE GUIDE
   ========================================== */
.zone-key {
  display: flex;
  gap: 16px;
  padding: 6px 14px 10px;
  font-size: 0.7rem;
  font-weight: 700;
}
.zk { display: flex; align-items: center; gap: 4px; }
.zk-cheap { color: var(--teal); }
.zk-mid   { color: var(--gold); }
.zk-exp   { color: var(--coral); }

#price-guide-content { padding-bottom: 8px; }

.price-cat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin: 0 0 12px;
  overflow: hidden;
}

.price-cat-header {
  padding: 11px 14px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-cat-name { font-family: 'Outfit', sans-serif; font-size: 0.9rem; font-weight: 800; color: var(--gold); }
.price-cat-note { font-size: 0.65rem; color: rgba(var(--rgb-text),0.4); }

.price-items { padding: 4px 14px 10px; display: flex; flex-direction: column; gap: 10px; }

.price-item {}

.price-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
  gap: 6px;
}

.pi-name { font-size: 0.8rem; font-weight: 600; flex: 1; min-width: 0; }

.pi-price-wrap { display: flex; align-items: baseline; gap: 5px; flex-shrink: 0; }

.pi-aud {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
}
.pi-aud.zone-cheap { color: var(--teal); }
.pi-aud.zone-mid   { color: var(--gold); }
.pi-aud.zone-exp   { color: var(--coral); }
.pi-aud.zone-free  { color: #64ffda; }

.pi-krw { font-size: 0.65rem; color: rgba(var(--rgb-text),0.4); white-space: nowrap; }

/* Zone track (gradient bar) */
.zone-track {
  position: relative;
  height: 7px;
  border-radius: 4px;
  overflow: visible;
}

.price-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2.5px solid var(--bg2);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  z-index: 1;
}

.range-bar {
  position: absolute;
  top: -1px; height: 9px;
  border-radius: 4px;
  background: rgba(var(--rgb-white),0.15);
}

.free-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  background: rgba(29,233,182,0.12);
  border: 1px solid rgba(29,233,182,0.3);
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ==========================================
   TIPS GRID
   ========================================== */
#tips-grid { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 8px; }

.tip-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
  display: flex; gap: 10px; align-items: flex-start;
}

.tip-icon { font-size: 1.4rem; flex-shrink: 0; }
.tip-title { font-size: 0.82rem; font-weight: 700; color: var(--teal); margin-bottom: 3px; }
.tip-body  { font-size: 0.75rem; color: rgba(var(--rgb-text),0.65); line-height: 1.55; }

/* ==========================================
   CHECKLIST & BUDGET
   ========================================== */
.progress-wrap {
  background: rgba(var(--rgb-white),0.08);
  height: 5px;
  margin: 0 12px 8px;
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  width: 0%;
  transition: width 0.4s ease;
}

#checklist-items { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 6px; }

.chk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.chk-item:active { background: rgba(var(--rgb-white),0.05); }
.chk-item.critical { border-left: 2.5px solid var(--coral); }
.chk-item.checked { opacity: 0.5; }
.chk-item.checked .chk-label { text-decoration: line-through; }
.chk-item input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--teal); cursor: pointer; flex-shrink: 0; }
.chk-label { flex: 1; font-size: 0.8rem; font-weight: 600; }
.chk-deadline { font-size: 0.6rem; color: var(--gold); background: rgba(245,200,66,0.08); padding: 2px 7px; border-radius: 100px; white-space: nowrap; }

.exchange-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  font-size: 0.8rem; color: rgba(var(--rgb-text),0.7);
  border-bottom: 1px solid var(--border);
}

.exchange-input {
  width: 75px; padding: 5px 8px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(29,233,182,0.3);
  background: rgba(29,233,182,0.07);
  color: var(--teal);
  font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 0.88rem;
  text-align: center;
  outline: none;
}

#budget-content { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }

.budget-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 9px 12px; font-size: 0.78rem;
}

.budget-day { font-weight: 700; color: var(--teal); min-width: 38px; }
.budget-details { color: rgba(var(--rgb-text),0.5); font-size: 0.68rem; }
.budget-amt  { font-weight: 700; color: white; }
.budget-krw  { font-size: 0.65rem; color: var(--gold); }

.budget-total {
  margin: 4px 12px 12px; padding: 12px;
  background: rgba(29,233,182,0.07);
  border: 1px solid rgba(29,233,182,0.2);
  border-radius: var(--r-sm);
  text-align: right; font-size: 0.9rem; font-weight: 700; color: var(--teal);
}

/* ==========================================
   BOTTOM NAVIGATION (5 tabs)
   ========================================== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(var(--rgb-bg),0.97);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 200;
}

.bottom-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; border: none; background: transparent; cursor: pointer;
  transition: background 0.15s; padding: 6px 0;
}
.bottom-tab:active { background: rgba(var(--rgb-white),0.05); }

.bt-icon { font-size: 1.15rem; transition: transform 0.2s; }
.bt-label { font-family: 'Noto Sans KR', sans-serif; font-size: 0.58rem; color: rgba(var(--rgb-text),0.45); font-weight: 500; }
.bottom-tab.active .bt-icon { transform: scale(1.15); }
.bottom-tab.active .bt-label { color: var(--teal); font-weight: 700; }

/* ==========================================
   EMERGENCY MODAL
   ========================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  animation: overlayIn 0.2s ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 480px;
  padding-bottom: env(safe-area-inset-bottom, 16px);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(30px); } to { transform: translateY(0); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; font-weight: 700; font-size: 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--glass);
  color: rgba(var(--rgb-text),0.6); font-size: 0.8rem; cursor: pointer;
}

.emergency-list { list-style: none; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.emergency-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: rgba(234,67,53,0.08); border: 1px solid rgba(234,67,53,0.2); border-radius: var(--r-sm);
}
.em-label { font-size: 0.82rem; font-weight: 600; }
.em-link { color: var(--coral); font-weight: 700; font-size: 0.9rem; text-decoration: none; padding: 6px 12px; background: rgba(234,67,53,0.12); border-radius: 8px; }
.em-tip { font-size: 0.72rem; color: rgba(var(--rgb-text),0.45); text-align: center; padding: 6px 16px 14px; line-height: 1.5; }

/* ==========================================
   OFFLINE BANNER
   ========================================== */
.offline-banner {
  position: fixed; top: var(--header-h); left: 0; right: 0;
  background: rgba(234,67,53,0.9); color: white;
  text-align: center; padding: 6px; font-size: 0.75rem; z-index: 150;
}

/* ==========================================
   SCROLLBAR (minimal)
   ========================================== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(29,233,182,0.25); border-radius: 2px; }


/* ==========================================
   ENCYCLOPEDIA STYLES
   ========================================== */
.kw-link {
  color: var(--gold);
  font-weight: 800;
  cursor: pointer;
  border-bottom: 2px dashed rgba(245, 200, 66, 0.5);
  transition: all 0.2s ease;
  padding: 0 2px;
}
.kw-link:active, .kw-link:hover {
  background: rgba(245, 200, 66, 0.2);
  border-radius: 4px;
}

.enc-filter {
  display: flex; gap: 8px; padding: 12px 14px 4px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.enc-filter::-webkit-scrollbar { display: none; }
.enc-f-btn {
  background: var(--glass);
  border: 1px solid var(--border);
  color: rgba(232, 234, 240, 0.6);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.enc-f-btn.active {
  background: rgba(29, 233, 182, 0.15);
  border-color: var(--teal);
  color: var(--teal);
}

.enc-grid {
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.enc-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.enc-card:active { background: rgba(var(--rgb-white),0.05); }
.enc-card-cat {
  font-size: 0.65rem; color: var(--gold);
  margin-bottom: 4px; font-weight: 700;
}
.enc-card-title {
  font-family: 'Outfit', 'Noto Sans KR', sans-serif;
  font-size: 0.95rem; font-weight: 800; color: var(--text-main);
}

/* Sul Min-seok Style Modal Content */
.enc-box { max-height: 85vh; display: flex; flex-direction: column; }
.enc-badge {
  background: linear-gradient(135deg, var(--gold), #ff9800);
  color: #000; font-weight: 800; font-size: 0.75rem;
  padding: 4px 10px; border-radius: 100px;
}
.enc-content-scroll {
  padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.enc-title {
  font-size: 1.3rem; font-weight: 800; line-height: 1.4;
  margin-bottom: 12px; color: var(--text-main);
  word-break: keep-all;
}
.enc-tags {
  display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap;
}
.sul-style {
  font-size: 0.95rem; line-height: 1.7; color: rgba(255, 255, 255, 0.85);
}
.sul-style p { margin-bottom: 16px; word-break: keep-all; }
.sul-style strong { font-weight: 800; color: var(--text-main); }
.sul-style .hl-green {
  background: linear-gradient(180deg, transparent 60%, rgba(29, 233, 182, 0.4) 60%);
  font-weight: 800; color: var(--text-main); padding: 0 2px;
}
.sul-style .hl-red {
  background: linear-gradient(180deg, transparent 60%, rgba(255, 107, 107, 0.4) 60%);
  font-weight: 800; color: var(--text-main); padding: 0 2px;
}
.sul-style blockquote {
  background: rgba(245, 200, 66, 0.1);
  border-left: 4px solid var(--gold);
  padding: 16px; margin: 20px 0;
  font-size: 1.05rem; font-weight: 800; color: var(--gold);
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

/* --- New Checklist Category Styles --- */
.chk-category {
  margin-bottom: 16px;
  background: var(--bg3);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.chk-cat-header {
  background: rgba(var(--rgb-white),0.03);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--teal);
  border-bottom: 1px solid var(--border);
}
.chk-cat-items {
  padding: 8px 12px;
}

/* ==========================================
   AI HELPER & MODAL STYLES
   ========================================== */
.ai-icon-btn {
  width: auto;
  min-width: 44px;
  padding: 0 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(82, 148, 255, 0.22), rgba(156, 111, 255, 0.28));
  border: 1px solid rgba(156, 111, 255, 0.6);
  color: #cbb4ff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(156, 111, 255, 0.25);
  transition: all 0.2s ease;
}
.ai-icon-btn:active {
  transform: scale(0.95);
  background: linear-gradient(135deg, rgba(82, 148, 255, 0.35), rgba(156, 111, 255, 0.45));
}
body.light-theme .ai-icon-btn {
  background: linear-gradient(135deg, rgba(82, 148, 255, 0.15), rgba(156, 111, 255, 0.2));
  border-color: rgba(120, 80, 220, 0.4);
  color: #6c47c7;
}

.ai-modal-box {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.ai-modal-content {
  padding: 16px 18px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, rgba(82, 148, 255, 0.12), rgba(156, 111, 255, 0.15));
  border: 1px solid rgba(156, 111, 255, 0.35);
  border-radius: var(--r);
  padding: 12px 14px;
}
.ai-banner-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.ai-banner-text strong {
  display: block;
  font-size: 0.88rem;
  color: #d8c7ff;
  margin-bottom: 4px;
}
body.light-theme .ai-banner-text strong {
  color: #5c38b8;
}
.ai-banner-text p {
  font-size: 0.76rem;
  line-height: 1.45;
  color: rgba(var(--rgb-text), 0.8);
}

.ai-plan-info {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}
.ai-badge {
  background: rgba(245, 200, 66, 0.15);
  color: var(--gold);
  border: 1px solid rgba(245, 200, 66, 0.3);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
}
.ai-plan-title {
  font-weight: 800;
  color: var(--text-main);
}
.ai-plan-desc {
  font-size: 0.7rem;
  color: rgba(var(--rgb-text), 0.55);
}

.ai-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--r);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg3);
  transition: all 0.2s ease;
  text-align: left;
  font-family: inherit;
  width: 100%;
}
.ai-action-btn:active {
  transform: scale(0.98);
}
.ai-btn-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ai-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.ai-btn-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ai-btn-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}
.ai-btn-sub {
  font-size: 0.72rem;
  color: rgba(var(--rgb-text), 0.6);
}
.ai-btn-arrow {
  font-size: 1.1rem;
  color: rgba(var(--rgb-text), 0.5);
  transition: transform 0.2s ease;
}
.ai-action-btn:hover .ai-btn-arrow {
  transform: translateX(3px);
}

/* ChatGPT Theme Button */
.btn-chatgpt {
  border-color: rgba(16, 163, 127, 0.4);
  background: linear-gradient(135deg, rgba(16, 163, 127, 0.12), rgba(16, 163, 127, 0.04));
}
.btn-chatgpt:hover, .btn-chatgpt:active {
  border-color: #10a37f;
  background: linear-gradient(135deg, rgba(16, 163, 127, 0.2), rgba(16, 163, 127, 0.08));
}
.btn-chatgpt .ai-btn-title {
  color: #2edba6;
}
body.light-theme .btn-chatgpt .ai-btn-title {
  color: #0b8063;
}

/* Gemini Theme Button */
.btn-gemini {
  border-color: rgba(82, 148, 255, 0.4);
  background: linear-gradient(135deg, rgba(82, 148, 255, 0.14), rgba(156, 111, 255, 0.1));
}
.btn-gemini:hover, .btn-gemini:active {
  border-color: #5294ff;
  background: linear-gradient(135deg, rgba(82, 148, 255, 0.24), rgba(156, 111, 255, 0.16));
}
.btn-gemini .ai-btn-title {
  background: linear-gradient(135deg, #74a9ff, #c39eff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.light-theme .btn-gemini .ai-btn-title {
  background: linear-gradient(135deg, #2b6cb0, #7b3fe4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Copy Only Button */
.btn-copy-only {
  border-color: rgba(245, 200, 66, 0.3);
  background: rgba(245, 200, 66, 0.05);
}
.btn-copy-only:hover, .btn-copy-only:active {
  border-color: var(--gold);
  background: rgba(245, 200, 66, 0.1);
}
.ai-btn-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(245, 200, 66, 0.18);
  color: var(--gold);
  border: 1px solid rgba(245, 200, 66, 0.4);
}

/* Preview Accordion */
.ai-preview-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg3);
  overflow: hidden;
}
.ai-preview-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: rgba(var(--rgb-text), 0.7);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ai-preview-toggle:active {
  background: rgba(var(--rgb-white), 0.04);
}
.ai-preview-content {
  padding: 0 12px 12px;
  border-top: 1px dashed var(--border);
}
#ai-preview-text {
  width: 100%;
  height: 140px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.7rem;
  line-height: 1.5;
  color: rgba(var(--rgb-text), 0.75);
  resize: vertical;
  box-sizing: border-box;
}

.ai-guide-tip {
  font-size: 0.74rem;
  line-height: 1.6;
  color: rgba(var(--rgb-text), 0.65);
  background: rgba(var(--rgb-white), 0.02);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  border-left: 3px solid var(--teal);
}
.ai-guide-tip strong {
  color: var(--teal);
}

/* Toast Message */
.toast-msg {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 24, 45, 0.95);
  color: #fff;
  border: 1px solid var(--teal);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(29, 233, 182, 0.3);
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 1000;
  text-align: center;
  max-width: 90vw;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s ease-out;
}
.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
body.light-theme .toast-msg {
  background: rgba(255, 255, 255, 0.96);
  color: #1a202c;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 12px rgba(29, 233, 182, 0.3);
}
