:root {
  --bg: #f2f6f7;
  --surface: #ffffff;
  --ink: #102a33;
  --muted: #5f737a;
  --primary: #0b4f6c;
  --primary-2: #087e8b;
  --accent: #ffb703;
  --danger: #a73636;
  --line: #d9e5e8;
  --shadow: 0 10px 30px rgba(16, 42, 51, .10);
  --radius: 20px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: linear-gradient(180deg, #dff3f5 0, var(--bg) 260px);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(18px + env(safe-area-inset-top)) 18px 14px;
  background: rgba(223, 243, 245, .88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(11,79,108,.08);
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.55rem, 6vw, 2.25rem); line-height: 1.05; }
h2 { margin-bottom: 0; font-size: 1.45rem; }
h3 { margin-bottom: 10px; }
.eyebrow { margin-bottom: 5px; color: var(--primary-2); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
main { width: min(860px, 100%); margin: 0 auto; padding: 14px 14px 48px; }
.hero-card {
  overflow: hidden;
  position: relative;
  min-height: 170px;
  padding: 22px;
  border-radius: 28px;
  color: white;
  background: radial-gradient(circle at 90% 10%, rgba(255,183,3,.55), transparent 34%), linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: var(--shadow);
}
.hero-card::after { content: "🛵"; position: absolute; right: 18px; bottom: 5px; font-size: 4rem; opacity: .24; transform: rotate(-5deg); }
.hero-card .big { display: block; font-size: 2rem; font-weight: 850; line-height: 1.05; margin-bottom: 8px; max-width: 75%; }
.hero-card p { max-width: 80%; margin-bottom: 8px; }
.hero-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.tabs {
  position: sticky;
  top: 90px;
  z-index: 15;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0 12px;
  scrollbar-width: none;
  background: linear-gradient(180deg, rgba(242,246,247,.98), rgba(242,246,247,.82));
  backdrop-filter: blur(12px);
}
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 10px 15px; color: var(--muted); font-weight: 750; }
.tab.active { background: var(--primary); border-color: var(--primary); color: white; }
.panel { display: none; }
.panel.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: .35; transform: translateY(4px); } }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 10px 2px 16px; }
.primary-btn, .secondary-btn, .icon-btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 800;
}
.primary-btn { background: var(--primary); color: white; }
.secondary-btn { background: #e4f1f3; color: var(--primary); }
.secondary-btn.danger { color: var(--danger); background: #f8eaea; }
.icon-btn { width: 44px; height: 44px; padding: 0; font-size: 1.7rem; background: var(--primary); color: white; }
.hidden { display: none !important; }
.timeline { display: grid; gap: 12px; }
.stop-card {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 15px;
  text-align: left;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 20px rgba(16,42,51,.05);
}
.stop-card .badge { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: #dff3f5; font-size: 1.65rem; }
.stop-card strong { display: block; font-size: 1.02rem; }
.stop-card small { color: var(--muted); line-height: 1.35; }
.stop-card .arrow { color: var(--primary-2); font-size: 1.4rem; }
.notice { margin-top: 14px; padding: 14px 15px; border-radius: 16px; background: #fff4cf; color: #614d00; font-size: .9rem; line-height: 1.45; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: white; padding: 8px 12px; border-radius: 999px; color: var(--muted); white-space: nowrap; }
.chip.active { border-color: var(--primary-2); background: #dff3f5; color: var(--primary); font-weight: 800; }
.day-list { display: grid; gap: 12px; }
.day-card { padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.day-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.day-date { color: var(--primary-2); font-weight: 850; }
.day-place { color: var(--muted); font-size: .85rem; }
.day-card ul { margin: 10px 0 0 18px; padding: 0; line-height: 1.48; }
.event-pill { display: inline-block; margin-top: 12px; padding: 7px 10px; border-radius: 10px; background: #f3e9ff; color: #5b2a86; font-size: .85rem; }
.budget-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.budget-summary div { padding: 14px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.budget-summary span { display: block; color: var(--muted); font-size: .75rem; margin-bottom: 5px; }
.budget-summary strong { font-size: 1.05rem; }
.cost-rows { display: grid; gap: 8px; }
.cost-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.cost-row small { color: var(--muted); }
.expense-form { margin-top: 16px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
label { display: grid; gap: 6px; margin-bottom: 12px; color: var(--muted); font-size: .88rem; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #c9d9dd; border-radius: 12px; background: white; color: var(--ink); padding: 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(8,126,139,.12); }
.expense-history { margin-top: 14px; display: grid; gap: 8px; }
.expense-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 11px 13px; border-radius: 13px; background: #edf4f5; }
.expense-item small { color: var(--muted); }
.delete-expense { border: 0; background: transparent; color: var(--danger); font-size: 1.15rem; }
.check-group { margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.check-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 2px; border-top: 1px solid #eef3f4; }
.check-item:first-of-type { border-top: 0; }
.check-item input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--primary-2); }
.check-item.done span { color: var(--muted); text-decoration: line-through; }
.notes-label { max-width: 360px; }
textarea { resize: vertical; min-height: 260px; line-height: 1.45; }
.save-state { color: var(--muted); font-size: .82rem; }
footer { padding: 20px 16px calc(25px + env(safe-area-inset-bottom)); color: var(--muted); text-align: center; font-size: .8rem; }
dialog { width: min(600px, calc(100% - 24px)); max-height: 88vh; padding: 0; border: 0; border-radius: 24px; box-shadow: 0 20px 70px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(5,25,32,.56); backdrop-filter: blur(5px); }
dialog article { position: relative; padding: 24px; overflow: auto; max-height: 88vh; }
.dialog-close { position: sticky; float: right; top: 0; border: 0; width: 38px; height: 38px; border-radius: 50%; background: #edf4f5; font-size: 1.35rem; }
.stop-gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(82%, 1fr);
  gap: 10px;
  overflow-x: auto;
  margin: 14px -4px 18px;
  padding: 0 4px 6px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.stop-gallery figure { margin: 0; scroll-snap-align: start; }
.stop-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 16px;
  background: #dfeaec;
}
.stop-gallery figcaption {
  padding: 6px 3px 0;
  color: var(--muted);
  font-size: .72rem;
}
.detail-grid { display: grid; gap: 10px; margin: 14px 0; }
.detail-box { padding: 12px; border-radius: 14px; background: #edf4f5; }
.detail-box strong { display: block; margin-bottom: 3px; }
.link-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
@media (min-width: 720px) {
  main { padding-left: 24px; padding-right: 24px; }
  .timeline { grid-template-columns: 1fr 1fr; }
  .day-list { grid-template-columns: 1fr 1fr; }
  .stop-gallery { grid-auto-columns: minmax(48%, 1fr); }
  .tabs { top: 94px; }
}
