:root {
  --bg: #f6f3ee;
  --card: #fffdf9;
  --ink: #1d2124;
  --sub: #6d7277;
  --line: #e7e1d7;
  --sea: #1f7a8c;
  --sea-soft: #e3f1f3;
  --sun: #e07a3f;
  --danger: #c0392b;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background: var(--bg);
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
}
a { color: var(--sea); }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--sub); }
.error { color: var(--danger); font-size: 14px; }

/* 상단 */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: calc(16px + env(safe-area-inset-top));
}
.eyebrow { margin: 0; font-size: 13px; color: var(--sub); letter-spacing: 0.01em; }
h1 { margin: 2px 0 12px; font-size: 24px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.dday { font-size: 13px; font-weight: 700; color: #fff; background: var(--sun); border-radius: 999px; padding: 2px 10px; }
.dday:empty { display: none; }

.tabs { display: flex; gap: 4px; }
.tabs button {
  flex: 1; border: 0; background: none; cursor: pointer;
  padding: 10px 0 12px; font-weight: 600; color: var(--sub);
  border-bottom: 2px solid transparent;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.pill { font-size: 12px; font-weight: 600; color: var(--sea); background: var(--sea-soft); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.pill:empty { display: none; }

main { padding-top: 16px; }

/* 카드 */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 12px;
}
.card h2 { margin: 0 0 12px; font-size: 15px; color: var(--sub); font-weight: 600; }
.big { margin: 0 0 12px; font-size: 18px; font-weight: 700; }

.flight + .flight { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.flight-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.flight-head .muted { margin-left: auto; font-size: 14px; }
.tag { font-size: 12px; font-weight: 600; background: var(--sea-soft); color: var(--sea); border-radius: 6px; padding: 1px 7px; }
.route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.route strong { display: block; font-size: 26px; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.route span { font-size: 13px; color: var(--sub); }
.route .right { text-align: right; }
.route .line { position: relative; text-align: center; }
.route .line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.route .line span { position: relative; background: var(--card); padding: 0 6px; font-size: 12px; }

.kv { display: grid; grid-template-columns: 72px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--sub); font-size: 14px; }
.kv dd { margin: 0; }

.notes { margin: 12px 0 0; padding-left: 18px; font-size: 14px; color: #3d4246; }
.notes li + li { margin-top: 6px; }
.card > .notes:first-of-type:nth-child(2) { margin-top: 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--sea); }
.timeline b { display: block; }
.timeline span { font-size: 14px; color: #3d4246; }

.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.danger { background: var(--danger); }
.link { border: 0; background: none; color: var(--sea); cursor: pointer; font-size: 14px; padding: 0; }

/* 체크리스트 */
.progress-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-weight: 600; }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--sea); transition: width .3s; }

.group { margin: 20px 0 8px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 6px; }
.group-head h3 { margin: 0; font-size: 15px; }
.group-head span { font-size: 13px; color: var(--sub); }
.items { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.item + .item { border-top: 1px solid var(--line); }
.item input[type="checkbox"] { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--sea); cursor: pointer; }
.item .text { flex: 1; min-width: 0; word-break: keep-all; overflow-wrap: anywhere; cursor: text; }
.item.done .text { color: var(--sub); text-decoration: line-through; text-decoration-color: #b9b3a8; }
.item .more { flex: none; border: 0; background: none; color: var(--sub); cursor: pointer; padding: 0 2px; font-size: 18px; line-height: 1; }
.hide-done .item.done { display: none; }

.editor { flex: 1; display: grid; gap: 8px; }
.editor input, .editor select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.editor .actions { margin-top: 0; }
.editor .btn { padding: 7px 12px; font-size: 14px; }

dialog { border: 0; border-radius: var(--radius); padding: 20px; width: min(340px, 90vw); background: var(--card); }
dialog::backdrop { background: rgb(0 0 0 / .35); }
dialog h3 { margin: 0 0 4px; }
dialog p { margin: 0 0 12px; font-size: 14px; }
dialog input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 18px; letter-spacing: .2em; }
dialog .actions { justify-content: flex-end; }


.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.wide { width: 100%; }
.group-head { align-items: center; gap: 8px; }
.group-head h3 { flex: 1; }
.group-head .more { border: 0; background: none; color: var(--sub); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }
.category-editor { margin: 0 0 8px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.add-row { display: flex; gap: 8px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); }
.items .add-row:first-child { border-top: 0; }
.add-row input { flex: 1; min-width: 0; border: 0; background: none; padding: 6px 0; outline: none; }
.add-row input::placeholder { color: #a8a39a; }
.new-category { margin-top: 20px; }
.new-category .editor { padding: 12px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
