:root {
  --outer: #f3ebe4;
  --bg: #fff8f3;
  --paper: #ffffff;
  --ink: #3b3431;
  --ink-soft: #857a74;
  --line: #f0e3da;
  --coral: #e5877a;
  --coral-deep: #cf6d60;
  --coral-soft: #fdebe6;
  --sea: #4c9aa0;
  --sea-soft: #e3f2f1;
  --gold: #c9a46a;
  --gray: #b9b0aa;
  --serif: "Gowun Batang", "Nanum Myeongjo", serif;
  --sans: "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", sans-serif;
  --script: "Great Vibes", cursive;
  --w: 480px;
  --r: 18px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--outer);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: break-word;
}
#app { max-width: var(--w); margin: 0 auto; background: var(--bg); min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- 표지 ---------- */
.hero { position: relative; height: 330px; overflow: hidden; color: #fff; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(40,25,20,.05) 30%, rgba(40,25,20,.55)); }
.hero-text { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; padding: 0 16px; }
.script { font-family: var(--script); font-size: 44px; line-height: 1; margin: 0; }
.hero h1 { font-family: var(--serif); font-weight: 700; font-size: 22px; margin: 6px 0 0; letter-spacing: .04em; }
.hero-sub { margin: 2px 0 0; font-family: var(--serif); opacity: .92; }
.hero-date { margin: 2px 0 0; font-size: 13px; opacity: .85; letter-spacing: .06em; }
.dday { display: inline-block; margin: 10px 0 0; padding: 3px 14px; border-radius: 99px; background: rgba(255,255,255,.22); backdrop-filter: blur(6px); font-size: 13px; font-weight: 500; }

/* ---------- 탭 ---------- */
.tabs {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 12px; background: rgba(255,248,243,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--paper);
  border-radius: 14px; padding: 6px 12px; text-align: center; line-height: 1.25; min-width: 54px;
}
.tab b { display: block; font-size: 13px; font-weight: 700; }
.tab small { font-size: 11px; color: var(--ink-soft); }
.tab.maui { border-top: 3px solid var(--coral); }
.tab.oahu { border-top: 3px solid var(--sea); }
.tab.on { background: var(--coral); border-color: var(--coral); color: #fff; }
.tab.on small { color: #fff; opacity: .9; }
.tab .flag { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--coral-deep); margin-left: 3px; vertical-align: middle; }
.tab.on .flag { background: #fff; }

main { padding: 16px 16px 8px; }

/* ---------- 카드 공통 ---------- */
.card { background: var(--paper); border-radius: var(--r); padding: 18px 16px; margin-bottom: 14px; box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(150,110,90,.06); }
.card h2 { font-family: var(--serif); font-size: 17px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.card h2 .en { font-family: var(--script); font-weight: 400; font-size: 24px; color: var(--coral); }
.card h2 .right { margin-left: auto; }
.muted { color: var(--ink-soft); font-size: 13px; }

.btn { border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 8px 14px; font-size: 14px; }
.btn.primary { background: var(--coral); border-color: var(--coral); color: #fff; font-weight: 500; }
.btn.small { padding: 4px 10px; font-size: 12.5px; border-radius: 10px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.btn.danger { color: var(--coral-deep); }
.link-btn { border: 0; background: none; color: var(--ink-soft); text-decoration: underline; font-size: 12px; padding: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

input[type=text], input[type=password], input[type=url], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fffdfb; font-size: 14px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--coral-soft); border-color: var(--coral); }
textarea { resize: vertical; min-height: 70px; }

/* ---------- 공지 ---------- */
.notice { background: var(--coral-soft); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; font-size: 14px; position: relative; }
.notice .when { display: block; font-size: 11.5px; color: var(--coral-deep); font-weight: 700; margin-bottom: 2px; }
.notice .x { position: absolute; top: 6px; right: 8px; }

/* ---------- 개요 ---------- */
.flight { display: grid; grid-template-columns: 62px 1fr; gap: 2px 10px; padding: 10px 0; border-top: 1px dashed var(--line); }
.flight:first-of-type { border-top: 0; padding-top: 0; }
.flight .tag { font-size: 12px; color: var(--sea); font-weight: 700; padding-top: 2px; }
.flight .route { font-weight: 500; }
.flight .times { grid-column: 2; font-size: 13.5px; }
.flight .note { grid-column: 2; font-size: 12px; color: var(--ink-soft); }
.flight.changed .times { color: var(--coral-deep); font-weight: 700; }

.hotel-group + .hotel-group { margin-top: 16px; }
.hotel-group > p { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.hotel-opts { display: grid; gap: 8px; }
.hotel-opt { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: center; text-align: left; border: 1.5px solid var(--line); background: var(--paper); border-radius: 14px; padding: 6px; }
.hotel-opt img { width: 84px; height: 64px; object-fit: cover; border-radius: 10px; }
.hotel-opt b { display: block; font-size: 14px; }
.hotel-opt span { font-size: 12px; color: var(--ink-soft); display: block; line-height: 1.45; }
.hotel-opt.on { border-color: var(--coral); background: var(--coral-soft); }
.hotel-opt.on b::after { content: " ✓"; color: var(--coral-deep); }
.hotel-opts.collapsed .hotel-opt:not(.on) { display: none; }

.car-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.car-opt { border: 1.5px solid var(--line); background: var(--paper); border-radius: 14px; padding: 10px; text-align: left; }
.car-opt b { display: block; }
.car-opt span { display: block; font-size: 12px; color: var(--ink-soft); }
.car-opt em { font-style: normal; font-weight: 700; color: var(--sea); }
.car-opt.on { border-color: var(--sea); background: var(--sea-soft); }
.kv { font-size: 13px; margin: 4px 0; }
.kv b { display: inline-block; min-width: 56px; color: var(--ink-soft); font-weight: 500; }

.check { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--coral); margin: 2px 0 0; flex: 0 0 auto; }
.check.done span { color: var(--gray); text-decoration: line-through; }
.progress { height: 6px; background: var(--line); border-radius: 9px; overflow: hidden; margin: -4px 0 10px; }
.progress i { display: block; height: 100%; background: var(--coral); border-radius: 9px; transition: width .3s; }

.daylist button { display: grid; grid-template-columns: 50px 1fr auto; gap: 10px; align-items: center; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; padding: 10px 0; text-align: left; }
.daylist button:first-child { border-top: 0; }
.daylist .d { font-family: var(--serif); font-weight: 700; color: var(--coral); }
.daylist .d small { display: block; font-family: var(--sans); font-weight: 400; color: var(--ink-soft); font-size: 11px; }
.daylist .t { font-size: 14px; }
.daylist .m { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }

/* ---------- 일차 ---------- */
.day-photo { position: relative; border-radius: var(--r); overflow: hidden; margin-bottom: 14px; aspect-ratio: 16 / 10; background: var(--line); }
.day-photo img { width: 100%; height: 100%; object-fit: cover; }
.day-photo .cap { position: absolute; inset: auto 0 0 0; padding: 40px 16px 14px; color: #fff; background: linear-gradient(transparent, rgba(30,20,15,.6)); }
.day-photo .cap small { font-size: 12px; letter-spacing: .08em; opacity: .9; }
.day-photo .cap h2 { margin: 2px 0 0; font-family: var(--serif); font-size: 21px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; vertical-align: middle; }
.badge.maui { background: var(--coral); color: #fff; }
.badge.oahu { background: var(--sea); color: #fff; }
.badge.home { background: var(--gold); color: #fff; }
.badge.changed { background: var(--coral-soft); color: var(--coral-deep); }
.badge.cancelled { background: #f1eeec; color: var(--ink-soft); }

.stay { display: flex; gap: 8px; align-items: center; font-size: 13.5px; padding: 10px 14px; background: var(--sea-soft); border-radius: 14px; margin-bottom: 14px; }
.stay b { color: var(--sea); font-weight: 700; flex: 0 0 auto; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 51px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 44px 16px 1fr; gap: 0 6px; padding: 6px 0; position: relative; }
.timeline .tm { font-size: 13px; font-weight: 700; color: var(--sea); text-align: right; padding-top: 1px; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--coral); margin: 6px 0 0 2px; z-index: 1; }
.timeline .tt { font-size: 14.5px; }
.timeline .nt { display: block; font-size: 12.5px; color: var(--ink-soft); }
.timeline li.changed .dot { background: var(--coral); }
.timeline li.changed .tt > span:first-child { font-weight: 700; }
.timeline li.cancelled .dot { border-color: var(--gray); }
.timeline li.cancelled .tt > span:first-child, .timeline li.cancelled .tm { text-decoration: line-through; color: var(--gray); }
.memo { white-space: pre-wrap; font-size: 13.5px; background: #fffaf2; border-left: 3px solid var(--gold); padding: 10px 12px; border-radius: 0 10px 10px 0; margin-top: 12px; }

/* ---------- 식당 ---------- */
.meal { padding: 10px 0; border-top: 1px solid var(--line); }
.meal:first-of-type { border-top: 0; padding-top: 0; }
.meal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.meal-head b { font-size: 14px; }
.meal-head .ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--coral-soft); }
.meal-head .add { margin-left: auto; }
.place { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0 6px 34px; }
.place .heart { border: 0; background: none; font-size: 18px; line-height: 1; padding: 0; color: var(--gray); }
.place.picked .heart { color: var(--coral); }
.place .body { flex: 1; min-width: 0; }
.place .nm { font-size: 14px; font-weight: 500; }
.place.picked .nm { color: var(--coral-deep); }
.place .nt { display: block; font-size: 12px; color: var(--ink-soft); }
.place a { font-size: 12px; color: var(--sea); }
.empty { padding-left: 34px; font-size: 12.5px; color: var(--gray); }
.meal-form { display: grid; gap: 6px; margin: 6px 0 4px 34px; padding: 10px; background: #fffaf7; border-radius: 12px; border: 1px dashed var(--line); }

/* ---------- 수정 모드 ---------- */
.edit-item { display: grid; grid-template-columns: 70px 1fr; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: #fffdfb; }
.edit-item .full { grid-column: 1 / -1; }
.edit-item .tools { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.edit-item .tools select { width: auto; flex: 1; }
.label { font-size: 12px; color: var(--ink-soft); margin: 10px 0 4px; display: block; }
.photo-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.photo-pick button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: none; }
.photo-pick button img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick button.on { border-color: var(--coral); }

/* ---------- 로그인·토스트 ---------- */
.login { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: linear-gradient(rgba(255,248,243,.7), rgba(255,248,243,.92)), url(img/hero.jpg) center / cover; }
.login-card { width: 100%; max-width: 340px; background: var(--paper); border-radius: 22px; padding: 28px 22px; text-align: center; display: grid; gap: 12px; box-shadow: 0 10px 40px rgba(150,100,80,.18); }
.login-card .script { color: var(--coral); }
.login-title { margin: 0 0 4px; font-family: var(--serif); }
.login-err { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--coral-deep); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: rgba(59,52,49,.92); color: #fff; padding: 8px 16px; border-radius: 99px; font-size: 13.5px; transition: .25s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot { display: flex; justify-content: space-between; align-items: center; padding: 18px 16px 34px; font-family: var(--script); font-size: 20px; color: var(--coral); }
