:root{
  --teal:#1F8A82; --teal-dark:#146860;
  --coral:#F0684A; --coral-dark:#D14E32;
  --sand:#F6EFE3; --paper:#FFFDF8;
  --ink:#2A2D2F; --ink-soft:#5B5F62;
  --line:#2A2D2F;
  --ok:#2F9E5B;
}
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0; background:var(--sand); color:var(--ink);
  font-family:"Noto Sans TC",-apple-system,sans-serif;
  -webkit-font-smoothing:antialiased;
  padding-bottom:60px;
}
h1,h2,h3{margin:0;}
a{color:inherit;}

/* ---------- HEADER ---------- */
header.top{
  background:linear-gradient(120deg,var(--teal-dark),var(--teal));
  color:#fff; padding:26px 18px 20px; text-align:center;
}
header.top h1{font-size:clamp(24px,5vw,34px); font-weight:900; letter-spacing:.5px;}
header.top .subtitle{margin-top:6px; font-size:14px; font-weight:700; opacity:.92;}

.countdown{
  margin:18px auto 0; max-width:320px;
  background:rgba(255,255,255,.14); border:2px solid rgba(255,255,255,.55);
  border-radius:18px; padding:14px 18px;
}
.countdown .num{font-size:44px; font-weight:900; line-height:1;}
.countdown .label{font-size:13px; font-weight:700; margin-top:4px; opacity:.9;}

.summary-row{
  display:flex; justify-content:center; gap:10px; flex-wrap:wrap; margin-top:16px;
}
.summary-chip{
  background:#fff; color:var(--teal-dark); font-weight:800; font-size:13px;
  padding:6px 14px; border-radius:999px; border:2px solid var(--teal-dark);
}

.city-bar{
  display:flex; max-width:600px; margin:18px auto 0; height:34px;
  border-radius:10px; overflow:hidden; border:2px solid #fff;
}
.city-bar .seg{
  display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:800; color:#fff; white-space:nowrap; overflow:hidden;
}
.city-legend{
  display:flex; justify-content:center; gap:14px; flex-wrap:wrap; margin-top:8px; font-size:12px;
}
.city-legend span{display:inline-flex; align-items:center; gap:5px; font-weight:700;}
.city-legend i{width:10px; height:10px; border-radius:3px; display:inline-block;}

/* ---------- TABS ---------- */
nav.tabs{
  position:sticky; top:0; z-index:10;
  display:flex; overflow-x:auto; background:var(--paper);
  border-bottom:3px solid var(--line);
}
nav.tabs button{
  flex:1 0 auto; border:none; background:none; cursor:pointer;
  font-family:inherit; font-weight:800; font-size:13.5px; color:var(--ink-soft);
  padding:13px 16px; border-bottom:4px solid transparent; white-space:nowrap;
}
nav.tabs button.active{color:var(--coral-dark); border-bottom-color:var(--coral);}

main{max-width:760px; margin:0 auto; padding:22px 16px 10px;}
.panel{display:none;}
.panel.active{display:block;}

/* ---------- CARD ---------- */
.card{
  background:var(--paper); border:3px solid var(--line); border-radius:20px;
  box-shadow:6px 6px 0 rgba(42,45,47,.10); padding:18px 20px; margin-bottom:18px;
}
.card h2{font-size:18px; font-weight:900; margin-bottom:12px; display:flex; align-items:center; gap:8px;}
.card h2 .tag{
  font-size:11px; font-weight:800; background:var(--teal); color:#fff;
  padding:2px 9px; border-radius:999px; letter-spacing:1px;
}

/* map + flights */
.leaflet-map{
  width:100%; height:320px; border-radius:14px; border:3px solid var(--line); margin-bottom:10px;
  background:#eee;
}
.map-legend{display:flex; flex-wrap:wrap; gap:10px; margin-bottom:12px; font-size:12px; font-weight:700;}
.map-legend span{display:inline-flex; align-items:center; gap:5px;}
.map-legend i{width:12px; height:12px; border-radius:50%; display:inline-block; border:2px solid #fff; box-shadow:0 0 0 1.5px var(--line);}
.map-pin{
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:800; font-size:11px; border:2px solid #fff; box-shadow:0 1px 4px rgba(0,0,0,.4);
}
.map-link{
  display:inline-flex; align-items:center; gap:8px; background:var(--teal); color:#fff;
  font-weight:800; font-size:13.5px; padding:9px 16px; border-radius:12px; text-decoration:none;
  border:2px solid var(--teal-dark); margin-bottom:14px;
}
.flight-card{
  border:2px solid var(--line); border-radius:14px; padding:12px 14px; margin-bottom:10px; background:#fff;
}
.flight-card .dir{
  display:inline-block; font-size:11px; font-weight:800; background:var(--coral); color:#fff;
  padding:2px 9px; border-radius:999px; margin-bottom:6px;
}
.flight-card .route{display:flex; justify-content:space-between; align-items:center; font-weight:800; font-size:14px; flex-wrap:wrap; gap:6px;}
.flight-card .meta{font-size:12.5px; color:var(--ink-soft); margin-top:4px;}

.hotel-row{
  display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap;
  border:2px solid var(--line); border-radius:14px; padding:10px 14px; margin-bottom:8px; background:#fff;
}
.hotel-row .h-name{font-weight:800; font-size:14px;}
.hotel-row .h-meta{font-size:12.5px; color:var(--ink-soft);}
.hotel-row a{
  font-size:12.5px; font-weight:800; color:var(--teal-dark); text-decoration:none;
  border:2px solid var(--teal-dark); padding:4px 10px; border-radius:10px; white-space:nowrap;
}

/* daily timeline */
.day-block{border:2px solid var(--line); border-radius:16px; margin-bottom:16px; overflow:hidden; background:#fff;}
.day-block .d-head{
  background:var(--coral); color:#fff; padding:10px 16px; font-weight:900; font-size:14px;
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:6px;
}
.day-block .d-sub{font-size:12px; font-weight:700; opacity:.95; margin-top:2px; width:100%;}
.event-row{display:flex; gap:10px; padding:10px 16px; border-bottom:1px dashed #ddd;}
.event-row:last-child{border-bottom:none;}
.event-row .ic{font-size:19px; flex:0 0 auto; width:30px; text-align:center;}
.event-body{flex:1 1 auto; min-width:0;}
.event-top{display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:3px;}
.event-row .time{display:inline-block; font-weight:800; font-size:12px; background:var(--ink); color:#fff; padding:1px 8px; border-radius:7px;}
.event-row h4{font-size:14.5px; font-weight:800; margin:2px 0 1px;}
.event-row p{font-size:12.5px; color:var(--ink-soft); margin:0;}
.event-map-link{
  display:inline-flex; align-items:center; gap:4px; font-size:11.5px; font-weight:800;
  color:var(--teal-dark); text-decoration:none; border:2px solid var(--teal-dark); padding:3px 9px; border-radius:999px;
}
.luggage-note{
  margin:0 16px 12px; font-size:12.5px; background:var(--sand); border:2px dashed var(--teal);
  border-radius:10px; padding:8px 12px;
}

/* packing */
.pack-cat{margin-bottom:16px;}
.pack-cat h3{font-size:14.5px; font-weight:900; margin-bottom:8px; color:var(--teal-dark);}
.pack-item{
  display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:10px;
  border:2px solid #e7ddc7; margin-bottom:6px; background:#fff; cursor:pointer;
}
.pack-item input{width:18px; height:18px; accent-color:var(--teal);}
.pack-item span{font-size:13.5px; font-weight:600; flex:1 1 auto;}
.pack-item.checked{background:#EAF6EF; border-color:var(--ok);}
.pack-item.checked span{text-decoration:line-through; color:var(--ink-soft);}
.pack-progress{font-size:12.5px; color:var(--ink-soft); margin-bottom:14px; font-weight:700;}
.item-remove{
  border:none; background:none; color:var(--coral-dark); font-size:15px; cursor:pointer;
  font-family:inherit; padding:2px 4px; flex:0 0 auto; line-height:1;
}

.add-row{display:flex; gap:8px; margin-bottom:14px;}
.add-row input{
  flex:1 1 auto; font-size:13.5px; padding:9px 12px; border-radius:10px;
  border:2px solid var(--line); font-family:inherit; min-width:0;
}
.add-row button{
  font-size:13px; font-weight:800; color:#fff; background:var(--teal); border:2px solid var(--teal-dark);
  padding:0 16px; border-radius:10px; cursor:pointer; font-family:inherit; white-space:nowrap;
}
.add-row button:hover{background:var(--teal-dark);}

/* currency */
.rate-display{
  text-align:center; background:var(--sand); border:2px solid var(--teal); border-radius:14px;
  padding:14px; margin-bottom:16px; font-weight:800;
}
.rate-display .big{font-size:22px; color:var(--teal-dark);}
.rate-display .updated{font-size:11px; color:var(--ink-soft); font-weight:600; margin-top:4px;}
.conv-row{display:flex; gap:10px; align-items:center; margin-bottom:14px;}
.conv-row input{
  flex:1; font-size:20px; font-weight:800; padding:10px 12px; border-radius:12px;
  border:2px solid var(--line); font-family:inherit;
}
.conv-row .eq{font-size:18px; font-weight:800;}
.conv-result{font-size:24px; font-weight:900; color:var(--coral-dark); text-align:center; margin-bottom:14px;}
.quick-amounts{display:flex; flex-wrap:wrap; gap:8px; justify-content:center;}
.quick-amounts button{
  border:2px solid var(--teal-dark); background:#fff; color:var(--teal-dark); font-weight:800;
  font-size:13px; padding:7px 14px; border-radius:999px; cursor:pointer; font-family:inherit;
}
.quick-amounts button:hover{background:var(--teal); color:#fff;}

/* documents */
.panel-title{font-size:18px; font-weight:900; margin:4px 2px 14px;}
.card .sub{font-size:12px; color:var(--ink-soft); font-weight:600; margin-bottom:12px; line-height:1.6;}

.shared-card{border-color:var(--teal-dark);}
.shared-card h2{color:var(--teal-dark);}

.cat-row{
  border:2px solid var(--line); border-radius:12px; padding:10px 12px; margin-bottom:8px; background:#fff;
}
.cat-row:last-child{margin-bottom:0;}
.cat-head{display:flex; justify-content:space-between; align-items:center; margin-bottom:6px;}
.cat-head .cname{font-weight:800; font-size:13.5px;}
.upload-btn{
  font-size:12px; font-weight:800; color:var(--teal-dark); background:none; border:2px solid var(--teal-dark);
  padding:4px 10px; border-radius:999px; cursor:pointer; font-family:inherit;
}
.upload-btn:disabled{opacity:.5; cursor:not-allowed;}
.file-row{
  display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:12.5px;
  padding:6px 0; border-top:1px dashed #ddd;
}
.file-row:first-of-type{border-top:none;}
.file-row a{color:var(--teal-dark); font-weight:700; text-decoration:none; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.ai-badge{font-size:12px; flex-shrink:0;}
.file-row button{
  border:none; background:none; color:var(--coral-dark); cursor:pointer; font-size:14px; font-family:inherit;
}

/* per-traveler accordion */
.travelers{margin-top:6px;}
.travelers h2{font-size:14px; font-weight:900; color:var(--ink-soft); letter-spacing:.5px; margin-bottom:10px;}
.trav{border:2px solid var(--line); border-radius:15px; margin-bottom:9px; background:#fff; overflow:hidden;}
.trav-head{
  display:flex; align-items:center; gap:10px; padding:11px 14px; cursor:pointer; -webkit-tap-highlight-color:transparent;
}
.trav-head:focus-visible{outline:3px solid var(--teal); outline-offset:-3px;}
.trav-emoji{font-size:20px; flex:0 0 auto;}
.trav-name{font-weight:800; font-size:14px; flex:1 1 auto;}
.badges{display:flex; gap:5px; flex:0 0 auto; flex-wrap:wrap; justify-content:flex-end;}
.badge{font-size:11px; font-weight:800; padding:2px 8px; border-radius:999px; white-space:nowrap;}
.badge.done{background:#EAF6EF; color:var(--ok);}
.badge.pending{background:#FBEED2; color:#C98A1B;}
.chev{font-size:12px; color:var(--ink-soft); transition:transform .18s ease; flex:0 0 auto;}
.trav.open .chev{transform:rotate(180deg);}
.trav-body{max-height:0; overflow:hidden; transition:max-height .22s ease;}
.trav.open .trav-body{border-top:2px solid var(--line);}
.trav-body-inner{padding:12px 14px 14px;}

.setup-hint{
  background:var(--sand); border:2px dashed var(--coral); border-radius:12px; padding:12px 14px;
  font-size:12.5px; line-height:1.8;
}
.setup-hint ol{margin:8px 0 0; padding-left:20px;}

/* notes */
.tip-list{margin:0; padding-left:20px; font-size:13.5px; line-height:1.8;}
.dress-box{
  background:var(--sand); border:2px dashed var(--coral); border-radius:12px; padding:12px 14px;
  font-size:13.5px; line-height:1.7; margin-top:10px;
}
.emg-row{
  display:flex; justify-content:space-between; align-items:center; padding:10px 14px;
  border:2px solid var(--line); border-radius:12px; margin-bottom:8px; background:#fff;
}
.emg-row .num{font-weight:900; font-size:16px; color:var(--coral-dark);}

.empty-hint{font-size:12.5px; color:var(--ink-soft); font-style:italic;}

@media (max-width:480px){
  nav.tabs button{padding:12px 10px; font-size:12.5px;}
  .conv-row input{font-size:17px;}
}
