/* 연차요정 trip — 2026 모던 프로덕트 톤 (쿨 그레이 + 화이트 + 선셋코랄 포인트) */
:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --line: #E5E8EB;
  --line-2: #F2F4F6;
  --ink: #191F28;
  --ink-2: #4E5968;
  --ink-3: #8B95A1;
  --coral: #FF5A36;
  --coral-ink: #E14A28;
  --coral-soft: #FFF4F0;
  --coral-line: #FFDDD3;
  --teal: #0F8A6A;
  --warn: #A15C00;
  --warn-soft: #FFF6E8;
  --danger: #D64545;
  --danger-soft: #FDF0F0;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(25, 31, 40, 0.04);
  --shadow: 0 4px 16px rgba(25, 31, 40, 0.06);
  --shadow-lg: 0 16px 48px rgba(25, 31, 40, 0.16);
  --header-h: 56px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  line-height: 1.45;
}

body.sheet-open { overflow: hidden; }

button { font-family: inherit; color: inherit; }
input, select, textarea { font-family: inherit; color: var(--ink); }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }

.ico { width: 18px; height: 18px; flex: 0 0 auto; }

.num,
.split-total strong,
.settle-amt,
.person-balance,
.exp-top strong,
.place-time,
.place-idx,
.day-count {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ---------------- 상단 헤더 (1줄, 56px) ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 900;
  display: flex; align-items: center; gap: 10px;
  height: var(--header-h); padding: 0 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: baseline; gap: 5px; flex: 0 0 auto; }
.brand-mark { display: none; }
.brand-name { font-size: 15.5px; font-weight: 800; letter-spacing: -0.03em; }
.brand-sub { font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }

.trip-switch {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 320px; padding: 5px 8px 5px 10px;
  border: 0; border-radius: 8px; background: transparent;
  cursor: pointer; transition: background .14s ease;
}
.trip-switch:hover { background: var(--surface-2); }
.trip-switch-text { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.trip-switch-text strong { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.trip-switch-text span { display: none; }
.trip-switch .ico { width: 15px; height: 15px; color: var(--ink-3); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.save-hint { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.save-hint::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: #22C55E; vertical-align: middle; }
.save-hint[data-state='saving']::before { background: #EAB308; }

.privacy-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  font-size: 12px; font-weight: 600;
  transition: background .14s ease, border-color .14s ease;
}
.privacy-badge:hover { background: var(--surface-2); }
.badge-ico { display: grid; place-items: center; color: var(--ink-3); }
.badge-ico .ico { width: 14px; height: 14px; }
.badge-text { display: inline-flex; align-items: center; gap: 5px; }
.badge-text strong { font-size: 12px; font-weight: 650; }
.badge-text em { display: none; font-style: normal; color: var(--ink-3); font-weight: 500; }
.privacy-badge[data-mode='shared'] { background: var(--coral-soft); border-color: var(--coral-line); color: var(--coral-ink); }
.privacy-badge[data-mode='shared'] .badge-ico { color: var(--coral); }
.privacy-badge[data-mode='shared-view'] { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.privacy-badge[data-mode='shared-view'] .badge-ico { color: var(--coral); }

/* ---------------- 메인 메뉴 (언더라인 탭) ---------------- */
.tabbar { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.view-nav { display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.view-nav button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 13px 1px 12px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: none;
  color: var(--ink-3); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: color .14s ease, border-color .14s ease;
}
.view-nav button .ico { width: 16px; height: 16px; }
.view-nav button:hover { color: var(--ink-2); }
.view-nav button.is-active { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------------- 메인 ---------------- */
main { position: relative; max-width: 1200px; margin: 0 auto; padding: 16px 20px 96px; }

.screen { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.shared-banner {
  display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap;
  margin: 0 0 12px; padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink-2);
}
.banner-text { display: flex; align-items: center; gap: 9px; }
.banner-text > .ico { width: 17px; height: 17px; color: var(--coral); }
.banner-text strong { display: block; font-size: 13px; color: var(--ink); font-weight: 650; }
.banner-text span { font-size: 11.5px; color: var(--ink-3); }
.shared-banner .btn { white-space: nowrap; }

/* Day 탭 — 얇은 칩 */
.day-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; }
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.day-tab:hover { border-color: #D5DAE0; }
.day-tab .day-pip { width: 6px; height: 6px; border-radius: 50%; background: #C3CAD2; }
.day-tab .day-label { font-weight: 650; }
.day-tab .day-date { display: none; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.day-tab .day-count { padding: 0 5px; border-radius: 5px; background: var(--line-2); font-size: 10.5px; color: var(--ink-3); }
.day-tab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.day-tab.is-active .day-pip { background: var(--coral); }
.day-tab.is-active .day-date,
.day-tab.is-active .day-count { color: rgba(255, 255, 255, 0.7); }
.day-tab.is-active .day-count { background: rgba(255, 255, 255, 0.14); }
.day-tab--add { padding: 7px 9px; color: var(--ink-3); }
.day-tab--add .ico { width: 15px; height: 15px; }

/* 지도 + 리스트 */
.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr) 404px; gap: 18px; align-items: start; }

.map-card {
  position: sticky; top: calc(var(--header-h) + 16px);
  height: calc(100vh - 220px); min-height: 440px;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line);
  background: #EAEDF0;
}
#map { position: absolute; inset: 0; z-index: 1; background: #EAEDF0; }
#map.is-picking { cursor: crosshair; }

.map-overlay { position: absolute; z-index: 500; left: 10px; top: 10px; right: 10px; display: flex; flex-wrap: nowrap; gap: 4px; pointer-events: none; overflow-x: auto; scrollbar-width: none; padding: 0 92px 2px 0; }
.map-overlay::-webkit-scrollbar { display: none; }
.legend-chip {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: 7px;
  background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line);
  font-size: 11px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.legend-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pin, #C3CAD2); }
.legend-chip em { font-style: normal; color: var(--ink-3); font-size: 10px; }
.legend-chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.legend-chip.is-active em { color: rgba(255, 255, 255, 0.65); }

.map-style-btn {
  position: absolute; z-index: 500; right: 10px; top: 10px;
  padding: 6px 9px; border-radius: 7px;
  background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line);
  font-size: 11px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.map-style-btn:hover { color: var(--ink); }

.pick-bar {
  position: absolute; z-index: 600; left: 50%; transform: translateX(-50%); bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 9px 8px 14px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 600;
  box-shadow: var(--shadow);
}
.pick-bar button { border: 0; border-radius: 6px; padding: 4px 9px; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 11.5px; cursor: pointer; }

/* 패널 */
.panel { min-width: 0; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 0 2px 10px; }
.panel-head h2 { font-size: 16.5px; font-weight: 750; letter-spacing: -0.02em; }
.panel-head p { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.panel-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 9px; padding: 9px 13px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .14s ease, border-color .14s ease, opacity .14s ease;
}
.btn:hover { background: var(--surface-2); border-color: #D5DAE0; }
.btn:active { opacity: 0.85; }
.btn .ico { width: 15px; height: 15px; }
.btn--sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn--primary { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn--primary:hover { background: #F04E2C; border-color: #F04E2C; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--line-2); border-color: transparent; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--notion { color: var(--ink-2); }
.btn--notion .ico { width: 14px; height: 14px; color: var(--coral); }
.btn--notion .lbl-short { display: none; }
.card-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

/* Day 그룹 헤더 */
.day-group { display: flex; align-items: center; gap: 7px; padding: 18px 8px 6px; cursor: pointer; }
.day-group:first-child { padding-top: 6px; }
.day-group:not(:first-child) { margin-top: 6px; border-top: 1px solid var(--line); }
.day-group .dg-pip { width: 5px; height: 5px; border-radius: 50%; background: #B9C0C8; }
.day-group strong { font-size: 12.5px; font-weight: 700; letter-spacing: -0.01em; }
.day-group .dg-date { font-size: 11.5px; color: var(--ink-3); }
.day-group .dg-count { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.day-group:hover strong { color: var(--coral-ink); }

/* 장소 = 세로 타임라인 행 */
.place-list { display: flex; flex-direction: column; }

.place { 
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; column-gap: 12px;
  padding: 7px 8px;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.place:hover { background: rgba(255, 255, 255, 0.72); }
.place.is-selected { background: var(--surface); border-color: var(--coral-line); }
.place.is-day-last { padding-bottom: 16px; }

.place-rail { position: relative; display: flex; flex-direction: column; align-items: center; }
.place-idx {
  display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto;
  border-radius: 50%; background: #DCE1E6; color: var(--ink-2);
  font-size: 11px; font-weight: 700; line-height: 1; z-index: 1;
}
.place[data-day='1'] .place-idx { background: var(--coral); color: #fff; }
.place.is-selected .place-idx { box-shadow: 0 0 0 3px var(--coral-soft); }
.place-line { flex: 1 1 auto; width: 1.5px; margin-top: 5px; margin-bottom: -12px; border-radius: 1px; background: var(--line); }
.place.is-day-last .place-line { display: none; }

.place-main { min-width: 0; padding-top: 1px; }
.place-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.place-time { font-size: 11.5px; font-weight: 600; color: var(--ink-3); min-width: 34px; }
.place-time--none { color: #C3CAD2; }
.place-name { font-size: 14px; font-weight: 700; letter-spacing: -0.015em; }
.place-note { margin-top: 1px; font-size: 12.5px; color: var(--ink-3); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.place-tags { display: flex; gap: 8px; margin-top: 3px; flex-wrap: wrap; align-items: center; }
.tag { font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 5px; background: var(--line-2); color: var(--ink-3); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--route {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 0; background: none; color: var(--ink-3); text-decoration: none;
  transition: color .12s ease;
}
.tag--route .ico { width: 11px; height: 11px; }
.tag--route:hover { color: var(--coral-ink); }

.place-tools { display: flex; flex-direction: row; gap: 0; align-items: center; opacity: 0.28; transition: opacity .12s ease; }
.place:hover .place-tools,
.place.is-selected .place-tools { opacity: 1; }
.icon-btn { display: grid; place-items: center; width: 26px; height: 26px; border: 0; background: transparent; border-radius: 6px; color: var(--ink-3); cursor: pointer; }
.icon-btn:hover { background: var(--line-2); color: var(--ink-2); }
.icon-btn .ico { width: 15px; height: 15px; }
.icon-btn--ghost:hover { background: var(--danger-soft); color: var(--danger); }

.add-place {
  width: 100%; margin-top: 12px; padding: 12px;
  border: 1px dashed #D5DAE0; border-radius: 10px;
  background: transparent; color: var(--ink-2);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color .14s ease, color .14s ease, background .14s ease;
}
.add-place:hover { border-color: var(--coral); color: var(--coral-ink); background: var(--coral-soft); }

/* 비어 있음 */
.empty { text-align: center; padding: 36px 20px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.empty .ico { width: 26px; height: 26px; color: var(--ink-3); margin-bottom: 10px; }
.empty h3 { font-size: 14.5px; font-weight: 700; }
.empty p { margin-top: 5px; font-size: 12.5px; color: var(--ink-3); max-width: 300px; margin-left: auto; margin-right: auto; }
.empty-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.empty--sm { padding: 26px 16px; }
.empty--sm .ico { width: 22px; height: 22px; }

/* Leaflet 커스텀 */
.pin-wrap { background: none; border: 0; }
.pin {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--pin, var(--coral));
  border: 2px solid #fff;
  display: grid; place-items: center;
  box-shadow: 0 1px 4px rgba(25, 31, 40, 0.28);
  transition: transform .14s ease, box-shadow .14s ease;
}
.pin-num { color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.pin--selected { transform: scale(1.18); box-shadow: 0 0 0 4px rgba(255, 90, 54, 0.18), 0 2px 8px rgba(25, 31, 40, 0.3); }
/* 지도는 뿌연 회색조 대신 밝고 깨끗한 라이트 톤. */
.tile--light { filter: saturate(0.85) brightness(1.03); }
.tile--plain { filter: none; }
.leaflet-tile { transition: filter .2s ease; }
.leaflet-container { font-family: var(--font); background: #EAEDF0; }
.leaflet-control-zoom a { border-radius: 7px !important; color: var(--ink-2) !important; border-color: var(--line) !important; }
.leaflet-bar { border: 1px solid var(--line) !important; border-radius: 9px !important; overflow: hidden; box-shadow: var(--shadow-sm) !important; }
.leaflet-control-attribution { background: rgba(255, 255, 255, 0.82) !important; font-size: 9.5px !important; color: var(--ink-3) !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }

.trip-popup .leaflet-popup-content-wrapper { border-radius: 12px; padding: 0; box-shadow: var(--shadow); border: 1px solid var(--line); }
.trip-popup .leaflet-popup-content { margin: 0; width: auto !important; }
.trip-popup .leaflet-popup-tip { box-shadow: none; }
.popup { padding: 11px 13px 12px; min-width: 150px; max-width: 230px; }
.pp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.pp-day { font-size: 10.5px; font-weight: 700; color: var(--ink-2); background: var(--line-2); padding: 2px 6px; border-radius: 5px; }
.pp-time { font-size: 10.5px; font-weight: 600; color: var(--ink-3); }
.pp-name { font-size: 13px; font-weight: 700; letter-spacing: -0.015em; }
.pp-note { margin-top: 3px; font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.pp-route {
  display: inline-flex; align-items: center; gap: 3px; margin-top: 8px;
  color: var(--coral-ink); font-size: 11px; font-weight: 650; text-decoration: none;
}
.pp-route:hover { text-decoration: underline; }

/* ---------------- 정산 ---------------- */
.split-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 18px; align-items: start; }
.split-hero-wrap { grid-column: 1; grid-row: 1; }
.split-main { grid-column: 1; grid-row: 2; }
.split-side { grid-column: 2; grid-row: 1 / span 2; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.card + .card { margin-top: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h3 { font-size: 14.5px; font-weight: 700; letter-spacing: -0.015em; }
.card-eyebrow { font-size: 11.5px; font-weight: 650; color: var(--ink-3); }
.tips-card h3 { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.tips-card .muted { line-height: 1.75; }

.split-hero { padding: 20px 20px 18px; }
.split-total { display: flex; flex-direction: column; gap: 2px; }
.split-total strong { font-size: 34px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.15; }
.split-total .sub { font-size: 12px; color: var(--ink-3); }
.split-label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.split-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.meta-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.meta-pill b { color: var(--ink); font-weight: 700; }

.person-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.person-chip { display: flex; flex-direction: column; gap: 1px; padding: 9px 11px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); min-width: 104px; }
.person-name { font-size: 12px; font-weight: 700; }
.person-paid { font-size: 10.5px; color: var(--ink-3); }
.person-balance { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.person-balance.is-plus { color: var(--ink); }
.person-balance.is-minus { color: var(--coral-ink); }

.expense { display: flex; align-items: center; gap: 8px; padding: 11px 6px; border-radius: 8px; cursor: pointer; transition: background .12s ease; }
.expense + .expense { border-top: 1px solid var(--line-2); }
.expense:hover { background: var(--surface-2); }
.exp-main { flex: 1; min-width: 0; }
.exp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.exp-top h3 { font-size: 13.5px; font-weight: 650; }
.exp-top strong { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.exp-sub { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }
.exp-krw { color: var(--ink-2); font-weight: 600; }

.settlement-card { background: var(--coral-soft); border-color: var(--coral-line); }
.settlement-card .card-head h3 { color: var(--ink); }
.settlement-card .btn { background: var(--surface); border-color: var(--coral-line); color: var(--coral-ink); }
.settlement-card .btn:hover { background: #FFEFE9; }
.settle-row { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 8px; padding: 11px 2px; }
.settle-row + .settle-row { border-top: 1px solid var(--coral-line); }
.settle-who { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.settle-arrow { color: #E3A695; font-size: 12px; }
.settle-amt { font-size: 16px; font-weight: 750; color: var(--coral-ink); letter-spacing: -0.015em; justify-self: end; }
.settle-empty { display: flex; align-items: center; gap: 8px; padding: 14px 2px 6px; color: var(--ink-2); font-size: 12.5px; }
.settle-empty .ico { color: #16A34A; }

.rates-card { padding: 0; overflow: hidden; }
.rates-card summary { display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 15px 20px; cursor: pointer; font-size: 13.5px; font-weight: 650; list-style: none; }
.rates-card summary::-webkit-details-marker { display: none; }
.rates-card summary::after { content: '⌄'; color: var(--ink-3); font-size: 14px; }
.rates-card[open] summary::after { transform: rotate(180deg); }
.rates-card summary span { margin-left: auto; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.rates-body { padding: 0 20px 18px; }
.rate-row { display: grid; grid-template-columns: 1fr 110px 18px; align-items: center; gap: 10px; padding: 6px 0; }
.rate-code { font-size: 12.5px; font-weight: 650; }
.rate-code em { font-style: normal; font-weight: 500; color: var(--ink-3); font-size: 11px; margin-left: 5px; }
.rate-row input { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; text-align: right; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.rate-unit { font-size: 11.5px; color: var(--ink-3); }
.rates-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* ---------------- 여행 ---------------- */
.trips-wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.trips-wrap .card { margin: 0; }
.trip-card { position: relative; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .14s ease, background .14s ease; background: var(--surface); }
.trip-card + .trip-card { margin-top: 6px; }
.trip-card:hover { border-color: #D5DAE0; background: var(--surface-2); }
.trip-card.is-active { border-color: var(--coral-line); background: var(--coral-soft); }
.trip-card-top { display: flex; align-items: center; gap: 7px; padding-right: 30px; }
.trip-card h3 { font-size: 14px; font-weight: 700; letter-spacing: -0.015em; }
.trip-card-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.trip-del { position: absolute; right: 8px; top: 9px; }
.mini-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 5px; border-radius: 4px; background: var(--line-2); color: var(--ink-3); font-size: 10px; font-weight: 650; }
.mini-badge .ico { width: 10px; height: 10px; }
.mini-badge--shared { background: var(--coral-soft); color: var(--coral-ink); }

.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 12.5px; }
.settings-row:first-of-type { border-top: 0; }
.settings-row span:first-child { color: var(--ink-3); }
.settings-row strong { font-weight: 650; }
.with-ico { display: inline-flex; align-items: center; gap: 4px; }
.exp-dot { color: var(--line); }
.traveler-form { display: flex; gap: 6px; margin-top: 10px; }
.traveler-form input { flex: 1; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.chip-row { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px 5px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; font-size: 12px; font-weight: 600; }
.chip--soft { padding: 5px 10px; cursor: pointer; }
.chip--toggle { padding: 6px 11px; cursor: pointer; background: var(--surface); color: var(--ink-2); font-weight: 600; }
.chip--toggle.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-x { display: grid; place-items: center; width: 16px; height: 16px; border: 0; border-radius: 50%; background: rgba(25, 31, 40, 0.06); color: var(--ink-2); cursor: pointer; padding: 0; }
.chip-x .ico { width: 10px; height: 10px; }
.chip-x:hover { background: var(--danger-soft); color: var(--danger); }

.backup-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.backup-actions .btn { justify-content: flex-start; }
.privacy-note { margin-top: 10px; padding: 12px 13px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; font-size: 11.5px; color: var(--ink-2); line-height: 1.6; }
.privacy-note b { color: var(--ink); }

.muted { color: var(--ink-3); font-size: 12.5px; }
.fineprint { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; margin-top: 8px; }
.divider { height: 1px; background: var(--line-2); margin: 14px 0; }
.mini-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- 시트(모달) ---------------- */
.sheet-root { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(25, 31, 40, 0.4); animation: fade-in .16s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: relative; width: 100%; max-width: 520px;
  max-height: 90vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheet-up .22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sheet-up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px 6px; }
.sheet-head h2 { font-size: 17px; font-weight: 750; letter-spacing: -0.02em; }
.sheet-head p { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.sheet-close { margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
.sheet-close:hover { background: var(--line-2); }
.sheet-body { padding: 10px 20px 18px; overflow-y: auto; flex: 1; }
.sheet-footer { display: flex; gap: 8px; padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); position: sticky; bottom: 0; }
.sheet-footer .btn { flex: 1; }
.sheet-footer .btn--ghost { flex: 0 0 auto; }
.sheet-note { font-size: 12.5px; color: var(--ink-2); line-height: 1.65; }
.copy-area { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font-size: 12px; line-height: 1.6; resize: vertical; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 11.5px; font-weight: 650; color: var(--ink-3); }
.field input,
.field select,
.field textarea {
  width: 100%; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-2); font-size: 13.5px;
  transition: border-color .14s ease, background .14s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--ink-2); background: var(--surface); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-row .field { margin-bottom: 12px; }
.field--tight { margin-bottom: 8px; }
.loc-field { gap: 7px; }
.loc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.loc-head > span { font-size: 11.5px; font-weight: 650; color: var(--ink-3); }
.coord { font-size: 11px; color: var(--ink-2); background: var(--surface-2); padding: 3px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.search-row { display: flex; gap: 6px; }
.search-row input { flex: 1; }
.search-results { display: flex; flex-direction: column; gap: 4px; }
.result { display: flex; flex-direction: column; gap: 1px; text-align: left; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.result:hover { background: var(--surface-2); }
.result.is-selected { border-color: var(--coral); background: var(--coral-soft); }
.result strong { font-size: 12.5px; font-weight: 650; }
.result span { font-size: 11px; color: var(--ink-3); }
.result-note { font-size: 11.5px; color: var(--ink-3); padding: 4px 1px; }
.loc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); margin: 2px 0 12px; }
.check em { font-style: normal; color: var(--ink-3); }
.quick-samples { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }

.paste-progress { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.p-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 7px; background: var(--surface-2); font-size: 12px; }
.p-name { font-weight: 600; }
.p-state { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-3); font-size: 11px; }
.p-row.is-busy .p-state { color: var(--ink-2); }
.p-row.is-found { background: #F1F8F3; }
.p-row.is-found .p-state { color: var(--teal); }
.p-row.is-found .ico { width: 12px; height: 12px; }
.p-row.is-miss { background: var(--warn-soft); }
.p-row.is-miss .p-state { color: var(--warn); }

.chip-select { display: flex; gap: 5px; flex-wrap: wrap; }
.chip-hint { display: flex; gap: 6px; align-items: center; margin-top: 7px; font-size: 11px; color: var(--ink-3); }
.link-btn { border: 0; background: none; padding: 0; color: var(--ink-2); font-size: 11.5px; font-weight: 650; text-decoration: underline; cursor: pointer; }
.krw-preview { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.krw-preview strong { color: var(--ink); font-weight: 750; }

.picker-list { display: flex; flex-direction: column; gap: 4px; }
.picker-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; text-align: left; }
.picker-item:hover { background: var(--surface-2); }
.picker-item.is-active { border-color: var(--coral-line); background: var(--coral-soft); }
.picker-main { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.picker-main strong { font-size: 13px; font-weight: 650; }
.picker-main span { font-size: 11.5px; color: var(--ink-3); }
.picker-item .ico { color: var(--ink-3); }

.share-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 14px; }
.share-toggle-text strong { display: block; font-size: 13.5px; font-weight: 700; }
.share-toggle-text span { font-size: 11.5px; color: var(--ink-3); }
.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; border: 0; background: #D5DAE0; cursor: pointer; transition: background .16s ease; flex: 0 0 auto; }
.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(25, 31, 40, 0.2); transition: transform .16s ease; }
.switch.is-on { background: var(--coral); }
.switch.is-on span { transform: translateX(18px); }
.share-link-box { min-height: 12px; }
.share-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.share-hero { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); }
.share-hero > .ico { color: var(--coral); }
.share-hero strong { display: block; font-size: 13px; font-weight: 700; }
.share-hero span { font-size: 11.5px; color: var(--ink-3); }

/* ---------------- 토스트 ---------------- */
.toast-root { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 2000; pointer-events: none; opacity: 0; transition: opacity .18s ease, transform .18s ease; }
.toast-root.is-on { opacity: 1; transform: translateX(-50%) translateY(-3px); }
.toast { padding: 10px 16px; border-radius: 8px; background: rgba(25, 31, 40, 0.94); color: #fff; font-size: 12.5px; font-weight: 550; box-shadow: var(--shadow); max-width: 86vw; text-align: center; }
.toast--warn { background: #8A5200; }

/* ---------------- 앱 하단 · 노션 여행 OS 배너 (미니멀 1줄) ---------------- */
.os-banner { margin: 22px 0 0; }
.os-banner-card {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: inherit;
  transition: border-color .14s ease, background .14s ease;
}
.os-banner-card:hover { border-color: #D5DAE0; background: var(--surface-2); }
.os-banner-tag { display: none; }
.os-banner-body { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.os-banner-body strong { font-size: 12.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; white-space: nowrap; }
.os-banner-body em { font-style: normal; font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-banner-arrow { margin-left: auto; flex: 0 0 auto; display: grid; place-items: center; color: var(--ink-3); }
.os-banner-arrow .ico { width: 15px; height: 15px; }

/* 하단 내비 (모바일) */
.bottom-nav { display: none; }

/* ---------------- 반응형 ---------------- */
@media (max-width: 1080px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .map-card { position: relative; top: 0; height: 42vh; min-height: 300px; }
  .split-wrap, .trips-wrap { grid-template-columns: minmax(0, 1fr); }
  .split-hero-wrap, .split-main, .split-side { grid-column: auto; grid-row: auto; }
}

@media (max-width: 760px) {
  .topbar { padding: 0 12px; gap: 6px; }
  .brand-name { font-size: 14.5px; }
  .brand-sub { display: none; }
  .trip-switch { padding: 4px 6px; max-width: 168px; }
  .trip-switch-text strong { font-size: 13px; max-width: 122px; }
  .save-hint { display: none; }
  .privacy-badge { padding: 5px 8px; gap: 4px; }
  .badge-text strong { font-size: 11.5px; }
  .badge-text em { display: none; }
  .badge-ico .ico { width: 13px; height: 13px; }

  .tabbar { display: none; }
  main { padding: 10px 12px 92px; }

  .day-tabs { padding: 2px 0 10px; gap: 5px; }
  .day-tab { padding: 6px 9px; font-size: 12px; }
  .map-card { height: 34vh; min-height: 220px; border-radius: 12px; }
  .map-overlay { display: none; }
  .pin { width: 22px; height: 22px; }
  .pin-num { font-size: 10.5px; }

  .panel-head { padding: 10px 2px 8px; }
  .panel-head h2 { font-size: 16px; }
  .panel-head .btn--paste span { display: none; }
  .panel-head .btn--notion { padding: 6px 8px; }
  .panel-head .btn--notion .lbl-full { display: none; }
  .panel-head .btn--notion .lbl-short { display: inline; }

  .place { padding: 8px 4px; column-gap: 10px; }
  .place-name { font-size: 13.5px; }
  .place-tools { opacity: 0.5; }

  .card { padding: 16px; border-radius: 13px; }
  .split-total strong { font-size: 29px; }
  .settle-row { grid-template-columns: 1fr auto 1fr; }
  .settle-amt { grid-column: 1 / -1; justify-self: start; font-size: 14.5px; margin-top: -2px; }

  .sheet { max-width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .toast-root { bottom: 82px; }

  .os-banner { margin: 16px 0 0; }
  .os-banner-card { padding: 11px 12px; }
  .os-banner-body em { display: none; }
  .os-banner-body strong { font-size: 12px; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(150%) blur(12px);
    -webkit-backdrop-filter: saturate(150%) blur(12px);
    border-top: 1px solid var(--line);
    gap: 2px;
  }
  .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 4px; border: 0; background: transparent; border-radius: 8px;
    font-size: 10.5px; font-weight: 600; color: var(--ink-3); cursor: pointer;
  }
  .bottom-nav button .ico { width: 20px; height: 20px; }
  .bottom-nav button.is-active { color: var(--ink); }
  .bottom-nav button.is-active .ico { color: var(--coral); }
}

@media (min-width: 761px) {
  .sheet-root { align-items: center; }
  .sheet { border-radius: 18px; max-height: 84vh; }
  .sheet-footer .btn { flex: 0 1 auto; min-width: 100px; }
  .sheet-footer { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
