/* Tripsee — 복숭아·청록, 흰 바탕 둥근 카드 */
:root {
  --peach: #F4895F;
  --peach-deep: #E8703F;
  --peach-soft: #FFEDE2;
  --teal: #13A39E;
  --teal-deep: #0C7F7C;
  --teal-soft: #E2F5F3;
  --ink: #1D2A33;
  --sub: #6B7884;
  --faint: #9AA5AE;
  --line: #ECEEF1;
  --bg: #FAFAF8;
  --card: #FFFFFF;
  --danger: #E0534A;
  --radius: 20px;
  --shadow: 0 2px 10px rgba(29, 42, 51, .06), 0 1px 2px rgba(29, 42, 51, .04);
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: "Pretendard", "Pretendard Variable", -apple-system, "SamsungOne", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal-deep); }
[hidden] { display: none !important; }

/* 머리 */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: rgba(250, 250, 248, .92);
  backdrop-filter: blur(10px);
}
.top .back { border: 0; background: none; padding: 6px; margin-left: -6px; border-radius: 12px; cursor: pointer; display: flex; }
.top .back svg { width: 24px; height: 24px; }
.top h1 { font-size: 18px; margin: 0; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); flex: 1; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.brand b { font-size: 20px; letter-spacing: -.3px; }
.brand b span { color: var(--teal); }
.top .icon-btn { border: 0; background: var(--card); box-shadow: var(--shadow); width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; cursor: pointer; }
.top .icon-btn svg { width: 20px; height: 20px; }

main { max-width: 960px; margin: 0 auto; padding: 4px 16px calc(var(--nav-h) + var(--safe-b) + 28px); }
main.no-nav { padding-bottom: 40px; }

/* 카드·글자 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card h2, .section-title { font-size: 17px; margin: 0 0 10px; font-weight: 700; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.section-title a, .section-title button { font-size: 14px; font-weight: 600; }
.muted { color: var(--sub); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }

/* 단추 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 700; cursor: pointer;
  background: var(--teal); color: #fff; text-decoration: none; min-height: 48px;
}
.btn:active { transform: scale(.98); }
.btn.peach { background: var(--peach); }
.btn.soft { background: var(--teal-soft); color: var(--teal-deep); }
.btn.ghost { background: transparent; color: var(--sub); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: #FDECEB; color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; min-height: 36px; font-size: 14px; border-radius: 11px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link-btn { border: 0; background: none; color: var(--teal-deep); cursor: pointer; padding: 4px; font-weight: 600; }

/* 입력 */
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--sub); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; min-height: 48px;
  outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--teal); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 13px; color: var(--faint); margin-top: 6px; }

/* 고르기 카드(라디오) */
.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--line); cursor: pointer; background: #fff; }
.choice input { accent-color: var(--teal); width: 20px; height: 20px; margin: 0; }
.choice:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.choice b { display: block; font-size: 15px; }
.choice small { color: var(--sub); }

/* 켜고 끄기 */
.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; }
.toggle .grow b { display: block; font-size: 15px; }
.toggle .grow small { color: var(--sub); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: #D7DCE0; border-radius: 30px; transition: .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + i { background: var(--teal); }
.switch input:checked + i::after { transform: translateX(20px); }

/* 첫 화면 */
.hero { padding: 26px 4px 8px; }
.hero .logo { width: 84px; height: 84px; border-radius: 24px; box-shadow: 0 10px 30px rgba(244, 137, 95, .25); }
.hero h2 { font-size: 28px; line-height: 1.3; margin: 18px 0 8px; letter-spacing: -.5px; }
.hero h2 em { font-style: normal; color: var(--peach-deep); }
.hero p { color: var(--sub); margin: 0 0 20px; }

/* 여행 목록 카드 */
.trips { display: grid; gap: 14px; }
.trip-card { position: relative; display: block; text-decoration: none; color: inherit; border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.trip-card .cover { height: 104px; background: linear-gradient(135deg, var(--peach) 0%, #F7B489 45%, var(--teal) 100%); position: relative; }
.trip-card .cover .flag { position: absolute; left: 16px; bottom: -20px; width: 44px; height: 44px; border-radius: 14px; background: #fff; display: grid; place-items: center; font-size: 26px; box-shadow: var(--shadow); }
.trip-card .body { padding: 28px 16px 16px; }
.trip-card h3 { margin: 0 0 2px; font-size: 18px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--peach-soft); color: var(--peach-deep); }
.badge.teal { background: var(--teal-soft); color: var(--teal-deep); }
.badge.gray { background: #F0F2F4; color: var(--sub); }
.trip-card .badge { position: absolute; right: 14px; top: 14px; background: rgba(255,255,255,.92); }

/* 여행 홈 머리 카드 */
.trip-hero { border-radius: 24px; padding: 20px; color: #fff; background: linear-gradient(140deg, #F28A5E 0%, #F6A77A 38%, #2BB0A8 100%); box-shadow: 0 10px 30px rgba(19, 163, 158, .2); margin-bottom: 14px; position: relative; overflow: hidden; }
.trip-hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 160px; background: url(icon.svg) no-repeat center/contain; opacity: .14; }
.trip-hero h2 { margin: 6px 0 4px; font-size: 24px; letter-spacing: -.4px; }
.trip-hero .dday { display: inline-block; background: rgba(255,255,255,.25); padding: 4px 12px; border-radius: 99px; font-weight: 800; font-size: 14px; }
.trip-hero .meta { opacity: .95; font-size: 14px; }
.clocks { display: flex; gap: 10px; margin-top: 14px; position: relative; z-index: 1; }
.clock { background: rgba(255,255,255,.2); border-radius: 14px; padding: 8px 12px; min-width: 0; }
.clock small { display: block; font-size: 12px; opacity: .9; }
.clock b { font-size: 20px; font-variant-numeric: tabular-nums; }

.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick a { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.quick a .ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; }
.quick a .ic svg { width: 22px; height: 22px; }
.quick a b { font-size: 15px; }
.quick a small { color: var(--sub); font-size: 13px; }
.ic.peach { background: var(--peach-soft); color: var(--peach-deep); }
.ic.teal { background: var(--teal-soft); color: var(--teal-deep); }

/* 멤버 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 99px; background: #F3F5F6; font-size: 14px; font-weight: 600; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; flex: none; }
.avatar.lg { width: 40px; height: 40px; font-size: 16px; }
.member-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.member-row:first-child { border-top: 0; }
.member-row .grow b { display: block; }
.invite-box { display: flex; gap: 8px; align-items: center; background: var(--teal-soft); border-radius: 14px; padding: 10px 12px; }
.invite-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--teal-deep); }

/* 아래 메뉴 */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255,255,255,.97); box-shadow: 0 -2px 16px rgba(29,42,51,.07);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
}
.nav a, .nav button.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--faint); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 6px 0; }
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--teal-deep); }
.nav .plus { justify-self: center; width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; border: 4px solid #fff; background: var(--teal); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(19,163,158,.35); cursor: pointer; }
.nav .plus svg { width: 26px; height: 26px; }

/* 아래에서 올라오는 창 */
.sheet-bg { position: fixed; inset: 0; background: rgba(20, 28, 34, .38); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: #fff; width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; padding: 10px 18px calc(22px + var(--safe-b)); max-height: 88vh; overflow: auto; animation: up .2s ease-out; }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: #DDE1E4; margin: 4px auto 14px; }
.sheet h3 { margin: 0 0 14px; font-size: 18px; }
.sheet-list button { display: flex; width: 100%; gap: 14px; align-items: center; padding: 12px 4px; border: 0; background: none; cursor: pointer; text-align: left; border-radius: 12px; }
.sheet-list button:active { background: #F5F6F7; }
.sheet-list .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.sheet-list .ic svg { width: 22px; height: 22px; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); transform: translateX(-50%); background: rgba(29,42,51,.92); color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 14px; z-index: 60; max-width: calc(100% - 32px); animation: up .2s; }
.empty { text-align: center; padding: 36px 16px; color: var(--sub); }
.empty .big { font-size: 40px; }
.err { color: var(--danger); font-size: 14px; margin: 8px 0; }
.soon { display: inline-block; font-size: 11px; font-weight: 700; color: var(--faint); background: #F0F2F4; border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }
.loading { padding: 60px 0; text-align: center; color: var(--faint); }


/* 코스: 지도 + 날짜별 시간표 */
.map-wrap { position: relative; isolation: isolate; margin: 0 -16px 12px; }
.map { height: 42vh; min-height: 240px; max-height: 420px; background: #E8EEF0; }
.map-msg { height: 100%; display: grid; place-items: center; text-align: center; color: var(--sub); padding: 20px; font-size: 14px; }
.map-btn { position: absolute; z-index: 500; left: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: 14px; border: 0; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; color: var(--teal-deep); }
.map-btn svg { width: 20px; height: 20px; }
.pick-banner { position: absolute; z-index: 600; left: 12px; right: 12px; top: 12px; background: var(--ink); color: #fff; border-radius: 16px; padding: 10px 10px 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 14px; }
.pick-banner .btn { color: #fff; border-color: rgba(255,255,255,.4); }
.map-wrap.picking .map { cursor: crosshair; outline: 3px solid var(--peach); outline-offset: -3px; }
.leaflet-container { font: inherit; }
.mk-wrap { background: none; border: 0; }
.mk { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 800; font-size: 14px; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.mk.emoji { background: #fff; font-size: 15px; border-color: var(--teal); }
.mk.pick { background: var(--peach); font-size: 18px; }
.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day-chip { flex: none; border: 0; background: var(--card); box-shadow: var(--shadow); border-radius: 16px; padding: 8px 14px; text-align: left; cursor: pointer; line-height: 1.25; }
.day-chip b { display: block; font-size: 14px; }
.day-chip small { color: var(--sub); font-size: 12px; }
.day-chip.on { background: var(--teal); color: #fff; }
.day-chip.on small { color: rgba(255,255,255,.85); }
.day-head { display: flex; align-items: center; gap: 8px; margin: 10px 2px; }
.day-head b { font-size: 17px; }
.day-head .link-btn { margin-left: auto; }
.timeline { list-style: none; margin: 0 0 14px; padding: 0; position: relative; }
.timeline:not(.plain)::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; border-left: 2px dashed #BFE6E3; }
.pl-item { position: relative; display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 14px 12px 8px; margin-bottom: 10px; cursor: pointer; transition: box-shadow .2s; }
.pl-item:active, .pl-item.flash { box-shadow: 0 0 0 2.5px var(--peach); }
.pl-item .num { flex: none; position: relative; z-index: 1; width: 28px; height: 28px; margin-left: 0; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.timeline.plain .num { background: var(--teal-soft); }
.pl-body { min-width: 0; display: flex; flex-direction: column; }
.pl-body b { font-size: 16px; }
.pl-body small { color: var(--sub); font-size: 13px; white-space: pre-line; }
.pl-time { font-size: 13px; font-weight: 700; color: var(--peach-deep); }
.nopos { color: var(--faint) !important; }
.pl-sheet-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.pl-sheet-head .kind { font-size: 28px; }
.pl-sheet-head h3 { margin: 0; }
.pl-memo { white-space: pre-line; background: var(--bg); border-radius: 14px; padding: 10px 14px; margin: 8px 0; }
.go-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 8px; }
.go-btns .btn { display: flex; align-items: center; justify-content: center; gap: 6px; }
.sheet-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.paste-box { background: var(--teal-soft); border-radius: 16px; padding: 12px; }
.paste-box .field { margin-bottom: 8px; }
.row-btns { display: flex; gap: 8px; }
.kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.kind-chip input { position: absolute; opacity: 0; pointer-events: none; }
.kind-chip span { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--bg); border: 1.5px solid var(--line); font-size: 14px; cursor: pointer; }
.kind-chip input:checked + span { border-color: var(--teal); background: var(--teal-soft); font-weight: 700; }
.kind-chip input:focus-visible + span { outline: 2px solid var(--teal); }
.pos-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pos-row [data-pos] { flex: 1 1 100%; }

/* 가계부 */
.money-hero { border-radius: 24px; padding: 18px 20px; color: #fff; background: linear-gradient(140deg, #F28A5E 0%, #F6A77A 50%, #F7C39C 100%); box-shadow: 0 10px 30px rgba(244, 137, 95, .25); margin-bottom: 14px; }
.money-hero small { opacity: .92; font-size: 13px; }
.money-hero .total { font-size: 30px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.money-hero .sub { font-size: 14px; opacity: .95; }
.money-hero .mine { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.35); font-size: 14px; }
.card.warn { background: #FFF6E5; box-shadow: none; padding: 12px 14px; }
.warn-text { color: #C0791B !important; }
.seg { display: flex; gap: 4px; background: #EEF0F2; border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 11px; padding: 9px 4px; font-weight: 700; color: var(--sub); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.mpanel:not(.on) { display: none; }
.ex-day { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 4px 8px; font-size: 15px; }
.ex-day span { color: var(--sub); font-size: 14px; font-weight: 600; }
.ex-list { padding: 4px 6px; }
.ex-item { display: flex; width: 100%; gap: 12px; align-items: center; padding: 11px 8px; border: 0; background: none; text-align: left; cursor: pointer; border-top: 1px solid var(--line); }
.ex-item:first-child { border-top: 0; }
.ex-item:active { background: var(--bg); border-radius: 12px; }
.ex-ic { width: 38px; height: 38px; border-radius: 13px; background: var(--peach-soft); display: grid; place-items: center; font-size: 19px; flex: none; }
.ex-item .grow b, .pool-card .grow b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-item .grow small { color: var(--sub); font-size: 13px; }
.ex-amt { text-align: right; flex: none; }
.ex-amt b { display: block; font-variant-numeric: tabular-nums; }
.ex-amt small, .split-row .r small, .ex-big small { display: block; color: var(--sub); font-size: 12.5px; font-weight: 500; }
.pool-card .grow small { display: block; }
.ex-big { font-size: 26px; font-weight: 800; margin: 6px 0 2px; }
.split-list { margin: 12px 0; border-top: 1px solid var(--line); }
.split-row { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.split-row .r { text-align: right; font-variant-numeric: tabular-nums; }
.amt-row { display: flex; gap: 8px; align-items: center; }
.amt-row .input { flex: 1; min-width: 0; }
.amt-row .input.amt { font-size: 26px; font-weight: 800; padding: 10px 14px; font-variant-numeric: tabular-nums; }
.amt-row .cur { flex: 0 0 96px; }
.amt-row .unit { flex: 0 0 56px; font-weight: 700; color: var(--sub); }
.amt-help { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 2px 14px; font-size: 14px; min-height: 36px; }
.ex-form .kinds { margin-bottom: 4px; }
.field-label { font-size: 14px; font-weight: 600; color: var(--sub); margin: 14px 0 6px; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-seg { display: inline-flex; background: #EEF0F2; border-radius: 10px; padding: 3px; }
.mini-seg input { position: absolute; opacity: 0; pointer-events: none; }
.mini-seg span { display: inline-block; padding: 4px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.mini-seg input:checked + span { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.share-box { margin-top: 4px; }
.share-amt { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.share-amt .input { flex: 0 0 46%; min-height: 42px; padding: 8px 12px; text-align: right; }
.input.bad { border-color: var(--danger); }
.settle-table { display: grid; font-size: 14px; }
.st-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 6px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.st-row.head { border-top: 0; color: var(--sub); font-size: 12.5px; font-weight: 600; padding-top: 0; }
.st-row .who { display: flex; gap: 6px; align-items: center; text-align: left; min-width: 0; }
.st-row .who b, .tr-row .who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-row small { display: block; color: var(--sub); font-size: 11.5px; }
.st-row .plus { color: var(--teal-deep); font-weight: 800; }
.st-row .minus { color: var(--peach-deep); font-weight: 800; }
.tr-row { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card h2 + .tr-row { border-top: 0; }
.tr-row .who { display: flex; gap: 6px; align-items: center; min-width: 0; }
.tr-row .arrow { color: var(--faint); }
.tr-row .amt { margin-left: auto; font-variant-numeric: tabular-nums; }
.tr-row.done { color: var(--sub); }
.rate-row, .fx-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.card h2 + .rate-row, .card h2 + .fx-row { border-top: 0; }
.rate-row > b { flex: 0 0 44px; }
.rate-row small, .fx-row small { display: block; color: var(--sub); font-size: 12.5px; }

/* 폴드 펼친 화면 등 넓은 화면: 두 열 */
@media (min-width: 700px) {
  .trips { grid-template-columns: 1fr 1fr; }
  .cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
  .nav { left: 50%; right: auto; transform: translateX(-50%); width: min(560px, 100%); bottom: 12px; border-radius: 24px; height: var(--nav-h); padding-bottom: 0; }
  main { padding-bottom: calc(var(--nav-h) + 48px); }
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 24px; }
  .course { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
  .course .map-wrap { margin: 0; position: sticky; top: 72px; }
  .course .map { height: calc(100vh - 180px); max-height: none; border-radius: var(--radius); overflow: hidden; }
  /* 가계부: 왼쪽 지출, 오른쪽 정산·환율(탭 없이 모두 보임) */
  .money-top { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
  .seg { display: none; }
  .money { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0 16px; align-items: start; }
  .mpanel:not(.on) { display: block; }
  .mpanel[data-panel=list] { grid-row: span 2; }
}

/* 사진 */
.trip-hero.has-cover { background: linear-gradient(180deg, rgba(20,28,34,.15) 0%, rgba(20,28,34,.55) 100%), var(--cover) center/cover no-repeat; }
.trip-hero.has-cover::after { display: none; }
.trip-card .cover[style] { background-size: cover; background-position: center; }
.ph-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 2px 12px; }
.ph-top b { font-size: 18px; }
.ph-add { cursor: pointer; }
.ph-up { margin-bottom: 12px; padding: 14px 16px; }
.ph-up .row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.ph-up .row.fail { color: var(--danger); }
.ph-up .row.fail small { color: var(--sub); flex-basis: 100%; }
.ph-up .tools { display: flex; gap: 8px; margin-top: 8px; }
.ph-up .bar { height: 6px; border-radius: 3px; background: var(--peach-soft); margin-top: 10px; overflow: hidden; }
.ph-up .bar i { display: block; height: 100%; background: var(--peach); transition: width .3s; }
.ph-up .row + .row { margin-top: 12px; }
.ph-who { margin-bottom: 4px; }
button.chip { border: 0; cursor: pointer; }
.chip.on { background: var(--teal); color: #fff; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 3px; border-radius: 14px; overflow: hidden; margin-bottom: 18px; }
.ph-cell { position: relative; aspect-ratio: 1; padding: 0; border: 0; background: #ECEFF1; cursor: pointer; overflow: hidden; }
.ph-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-cell .has-cap { position: absolute; right: 6px; bottom: 6px; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
.ph-cell .ph-cc { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }
.pc-list { max-height: 50vh; overflow-y: auto; margin-bottom: 8px; }
.ph-grid.trash { border-radius: 12px; margin-top: 12px; }
.ph-grid.trash .ph-cell { cursor: default; }
.ph-grid.trash img { opacity: .6; }
.ph-grid.trash .left { position: absolute; left: 6px; top: 6px; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.ph-grid.trash .btn { position: absolute; left: 6px; right: 6px; bottom: 6px; min-height: 30px; padding: 4px; font-size: 13px; }
.ph-foot { text-align: center; margin: 6px 0 10px; }
body.no-scroll { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 45; background: #0E1418; color: #fff; display: flex; flex-direction: column; animation: fade .15s; touch-action: pan-y; }
.v-top { display: flex; align-items: center; justify-content: space-between; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px; font-weight: 700; font-size: 15px; }
.v-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 20px; display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.v-stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; user-select: none; }
.v-stage img { max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-drag: none; }
.v-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 12px; background: rgba(0,0,0,.3); color: #fff; font-size: 34px; cursor: pointer; display: none; }
.v-nav.prev { left: 10px; } .v-nav.next { right: 10px; }
.v-info { padding: 12px 16px calc(16px + var(--safe-b)); max-width: 760px; width: 100%; margin: 0 auto; }
.v-info .who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.v-info .who span { color: rgba(255,255,255,.7); }
.v-info .who a { margin-left: auto; color: #8FE0DC; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 600; }
.v-info .cap { margin: 8px 0 0; font-size: 15px; white-space: pre-wrap; }
.v-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.v-chip { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 99px; padding: 8px 14px; min-height: 38px; background: rgba(255,255,255,.12); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.v-chip.danger { color: #FF9C94; }
@media (hover: hover) { .v-nav { display: block; } }
@media (min-width: 700px) { .ph-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; } }

/* 인터넷이 느리거나 끊겼을 때 */
.net-chip { position: fixed; z-index: 70; top: calc(env(safe-area-inset-top, 0px) + 68px); /* 머리 줄 바로 아래(제목을 가리지 않게) */ left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.net-chip.sending { background: var(--teal-deep); }
.card.pending { border: 1.5px dashed var(--peach); }
.card.pending ul { margin: 8px 0 0; padding-left: 18px; }
.card.pending li { margin: 2px 0; }
.map-btn.dl { left: auto; right: 12px; bottom: auto; top: 12px; width: auto; padding: 0 12px; font-size: 13px; font-weight: 600; gap: 6px; display: flex; align-items: center; }

/* 기록 */
.nt { padding: 14px 16px; }
.nt-head { display: flex; align-items: center; gap: 8px; }
.nt-head .avatar { width: 28px; height: 28px; font-size: 13px; }
.nt-tools { margin-left: auto; display: flex; gap: 10px; }
.nt-tools .link-btn { font-size: 13px; }
.nt-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.nt-body { margin: 10px 2px 2px; line-height: 1.6; }
.nt-cs { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.nt-c { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; font-size: 14px; }
.nt-c .avatar { width: 22px; height: 22px; font-size: 11px; flex: none; margin-top: 1px; }
.nt-x { font-size: 18px; line-height: 1; padding: 0 4px; color: var(--sub); }
.nt-cf { display: flex; gap: 8px; margin-top: 6px; }
.nt-cf .input { flex: 1; min-width: 0; min-height: 38px; padding: 6px 12px; }
.nt-days { margin-bottom: 10px; }
.nt-wait { color: var(--peach-deep); font-weight: 700; }
.search-row { display: flex; gap: 8px; }
.search-row .input { flex: 1; min-width: 0; }

/* 여행 첫 화면: 오늘 일정 */
.card.today { margin: 12px 0; }
.card.offer { margin: 12px 0; border: 2px solid var(--peach); background: var(--peach-soft); }
.today-list { list-style: none; margin: 10px 0 0; padding: 0; }
.today-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.today-list .num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--teal-soft); color: var(--teal-deep); }
.today-list li.next .num { background: var(--teal); color: #fff; }
.today-list li.past { opacity: .55; }
