:root {
  --bg: #F5F0E6;
  --card: #FFFFFF;
  --card-line: #EFE6D6;
  --inner: #FCFAF6;
  --inner-line: #F0E8DA;
  --chip-line: #E3D8C6;
  --ink: #2C2520;
  --body: #3A3330;
  --label: #5A5350;
  --muted: #7A7571;
  --faint: #B9AE9F;
  --accent: #C8956B;
  --tab: #ECE4D5;
  --tab-on: #DCCFB9;
  /* 標題：英文用工作整合器同款（Noto Sans TC 內建英文＝Source Sans），中文維持明體 */
  --serif: 'Source Sans 3', 'Noto Serif TC', 'Songti TC', serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* 關掉點兩下放大（保留兩指縮放）：iOS 要每個元素都設才確實生效 */
*, *::before, *::after { touch-action: manipulation; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  /* 內文以 Noto Sans TC 為主（數字和中文同一套，大小一致）；它缺的 Ō 這類字母才改用 Source Sans 3 */
  font-family: 'Noto Sans TC', 'Source Sans 3', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
/* 輸入框與可複製的資料（訂位代號、地址、電話）允許選取 */
input, textarea, .sel { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
button { font-family: inherit; color: inherit; }
a { color: var(--ink); }

/* iOS 27 主畫面 App 頂部霧面：放一條有底色的 fixed 細條 */
.remove-blur {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; height: 11px;
  pointer-events: none; z-index: 2147483647;
  background-color: #F5F0E6; background-clip: text; -webkit-background-clip: text;
}
@media (display-mode: standalone) { .remove-blur { display: block; } }
:root[data-standalone] .remove-blur { display: block; }

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 16px calc(56px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 20px;
  min-width: 0;
}
.wrap > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ── 標題區 ── */
.hero-head { display: flex; flex-direction: column; gap: 6px; }
.eyebrow { font-size: 12px; letter-spacing: .18em; color: var(--muted); font-weight: 500; }
/* 大標題：英文用 Fredoka（圓潤可愛），中文標題退回 Noto Sans TC */
.hero-head h1 { margin: 0; font-family: 'Fredoka', 'Noto Sans TC', sans-serif; font-size: 32px; line-height: 1.25; font-weight: 600; overflow-wrap: anywhere; }
.meta { font-size: 14px; color: var(--muted); line-height: 1.6; }
.head-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.head-top .eyebrow { min-width: 0; }
.head-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex-shrink: 0; max-width: 70%; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; }
.pill {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--card); border: 1px solid var(--card-line); color: var(--label);
}
.pill.count { background: var(--ink); border-color: var(--ink); color: #FFF; font-weight: 700; }

/* ── 天數切換：「全部」固定在左；天數那段可左右滑、色塊只在天數間滑動；往下捲時貼頂 ── */
.tabs-bar {
  position: sticky; top: 0; z-index: 20; margin: -6px -16px; padding: 8px 16px;
  background: var(--bg); display: flex; align-items: stretch; gap: 4px;
}
.tabs-scroll {
  flex: 1; min-width: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs-scroll.more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.tabs-scroll.less { -webkit-mask-image: linear-gradient(to right, transparent, #000 24px); mask-image: linear-gradient(to right, transparent, #000 24px); }
.tabs-scroll.less.more { -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 36px), transparent); }
.tabs { position: relative; display: flex; gap: 2px; width: max-content; min-width: 100%; }
.tab-pill {
  position: absolute; left: 0; top: 0; height: 100%; width: 0; border-radius: 14px; z-index: 0;
  transition: transform .35s cubic-bezier(.3, .8, .3, 1), width .35s cubic-bezier(.3, .8, .3, 1), background-color .35s, opacity .2s;
}
.tab-pill.still { transition: opacity .2s; }
.tab-pill.hide { opacity: 0; }
.tab {
  position: relative; z-index: 1;
  flex: 1 0 40px; height: 50px; padding: 0 4px;
  border: none; border-radius: 14px; cursor: pointer; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  line-height: 1.1; white-space: nowrap; color: var(--muted);
  transition: color .25s;
}
.tab.all { flex: 0 0 52px; background: transparent; }
.tab.all.on { background: var(--tab-on); }
.tab .num { font-size: 16px; font-weight: 700; }
.tab.all .num { font-size: 14px; }
.tab .date { font-size: 10px; font-weight: 500; }
.tab.on { color: var(--ink); }

/* ── 卡片 ── */
.card {
  background: var(--card); border: 1px solid var(--card-line); border-radius: 22px;
  padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.card-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.card-title svg { flex-shrink: 0; }
/* 可收合卡片 */
.card-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.folded .card-body { display: none; }
.fold-head { cursor: default; }
.fold-btn {
  margin-left: auto; width: 32px; height: 32px; margin-top: -6px; margin-bottom: -6px; margin-right: -6px;
  border: none; background: var(--inner); border-radius: 10px; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.fold-btn svg { transition: transform .25s; }
.card.folded .fold-btn svg { transform: rotate(-90deg); }
.group-sub { font-size: 12px; font-weight: 500; color: var(--faint); }

/* 每日行程列表 */
.day-list { display: flex; flex-direction: column; }
.day-row {
  display: flex; align-items: stretch; gap: 12px; width: 100%; text-align: left;
  background: none; border: none; border-top: 1px solid var(--inner-line); padding: 12px 0; cursor: pointer; color: var(--ink);
}
.day-row:first-child { border-top: none; padding-top: 2px; }
.day-row .bar { flex-shrink: 0; width: 4px; border-radius: 4px; }
.dr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dr-top { display: flex; align-items: center; gap: 8px; }
.dr-code { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 7px; }
.dr-date { font-size: 12px; color: var(--muted); }
.dr-title { font-family: var(--serif); font-size: 16px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.dr-meta { font-size: 12px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.dr-go { flex-shrink: 0; align-self: center; color: var(--faint); display: flex; transform: rotate(-90deg); }
.sub-title { font-size: 12px; font-weight: 700; color: var(--label); }
.divider { border-top: 1px solid var(--inner-line); }
.inner {
  background: var(--inner); border: 1px solid var(--inner-line); border-radius: 16px;
  padding: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.k { font-size: 11px; color: var(--muted); }
.v { font-size: 14px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.note { font-size: 13px; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.text { font-size: 13px; color: var(--body); line-height: 1.6; overflow-wrap: anywhere; }

/* 格狀資訊（住宿／重點等）：用 minmax(0,1fr) 讓長字自動換行，不會撐破畫面 */
.grid { display: grid; border: 1px solid var(--inner-line); border-radius: 16px; background: var(--inner); min-width: 0; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > div { padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.grid > div + div { border-left: 1px solid var(--inner-line); }

/* ── 航班 ── */
.flight-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flight-top .left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.flight-label {
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px;
  background: var(--tab); color: var(--label); flex-shrink: 0;
}
.flight-no { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.flight-date { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.flight-route { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.flight-route .end { display: flex; flex-direction: column; gap: 2px; }
.flight-route .end.r { text-align: right; align-items: flex-end; }
.flight-route .t { font-size: 20px; font-weight: 700; letter-spacing: .01em; }
.flight-route .p { font-size: 12px; color: var(--muted); }
.flight-route .line { display: flex; align-items: center; gap: 6px; color: var(--faint); min-width: 0; }
.flight-route .line::before, .flight-route .line::after { content: ''; flex: 1; border-top: 1px dashed var(--chip-line); }
.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.fact {
  display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%;
  padding: 5px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--inner-line);
  font-size: 12px;
}
.fact .fk { color: var(--muted); flex-shrink: 0; }
.fact .fv { font-weight: 600; color: var(--body); overflow-wrap: anywhere; }

/* ── 列表列 ── */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .name { font-size: 14px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.kv { display: flex; gap: 8px; font-size: 13px; color: var(--body); line-height: 1.6; }
.kv .kk { color: var(--accent); font-weight: 700; flex-shrink: 0; min-width: 56px; }
.kv .vv { min-width: 0; overflow-wrap: anywhere; }

.btns { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.map-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px;
  min-height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--chip-line); background: var(--inner);
  font-size: 11px; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.btn {
  align-self: flex-start; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--chip-line); background: var(--card); color: var(--ink);
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.btn.primary { background: var(--ink); border-color: var(--ink); color: #FFF; align-self: stretch; font-weight: 700; }

/* ── 每日卡片與當日頁 ── */
.day-head { display: flex; align-items: center; gap: 10px; }
.day-pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 28px;
  padding: 0 10px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--ink);
}
.day-date { font-size: 13px; color: var(--muted); }
.day-title { font-family: var(--serif); font-size: 19px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.day-hero { border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.day-hero .code { font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.day-hero h2 { margin: 0; font-family: var(--serif); font-size: 24px; line-height: 1.35; font-weight: 700; overflow-wrap: anywhere; }
.day-hero .grid { background: #FFF; border: none; }
.day-hero .v { font-size: 13px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; }
.sec-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.sec-head span { font-size: 12px; color: var(--muted); }
.item {
  display: flex; gap: 14px; background: var(--card); border: 1px solid var(--card-line);
  border-radius: 20px; padding: 16px; min-width: 0;
}
.item .time { width: 50px; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.item .time b { font-size: 15px; }
.item .dot { width: 8px; height: 8px; border-radius: 50%; }
.item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.item .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.item .name { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.rain { border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.rain .head { display: flex; align-items: center; gap: 8px; }
.rain .head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.rain .box { background: #FFF; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }

/* 毛利語長音字母 */
.mac { font-family: 'Source Sans 3', sans-serif; }

/* ── 預訂進度 ── */
.check.book .label { display: flex; flex-direction: column; gap: 2px; }
.check.book .bname { font-size: 14px; font-weight: 600; line-height: 1.45; }
.check.book.done .bname { color: var(--faint); text-decoration: line-through; }
.check.book .status { margin-left: 4px; }
.status { flex-shrink: 0; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; }
.status.done { background: #E3EDDC; color: #4F6E3F; }
.status.pending { background: #FBEBD2; color: #9A6420; }
.status.todo { background: var(--tab); color: var(--muted); }

/* ── 個人清單 ── */
.who { display: flex; flex-wrap: wrap; gap: 6px; }
.who button {
  height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--chip-line); background: var(--card); font-size: 14px; font-weight: 500;
}
.who button.on { background: var(--ink); border-color: var(--ink); color: #FFF; font-weight: 700; }
.check-list { display: flex; flex-direction: column; }
.check {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  border-bottom: 1px solid var(--inner-line);
}
.check:last-child { border-bottom: none; }
.check .tick {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--chip-line); background: var(--card);
  display: flex; align-items: center; justify-content: center; color: #FFF; padding: 0; cursor: pointer;
}
.check.done .tick { background: var(--accent); border-color: var(--accent); }
.check .label { flex: 1; min-width: 0; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; cursor: pointer; padding: 10px 0; }
.check.done .label { color: var(--faint); text-decoration: line-through; }
.check .del {
  flex-shrink: 0; width: 32px; height: 32px; border: none; background: none; color: var(--faint);
  font-size: 18px; cursor: pointer; border-radius: 8px;
}
.add { display: flex; gap: 8px; margin-top: 4px; }
.add input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 14px;
  border: 1px solid var(--chip-line); background: var(--inner); font-size: 16px; font-family: inherit; color: var(--ink);
}
.add button {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 14px; border: none;
  background: var(--ink); color: #FFF; font-size: 22px; cursor: pointer;
}
.progress { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ── 用語 ── */
.phrase { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--inner-line); }
.phrase:last-child { border-bottom: none; }
.phrase .zh { font-size: 13px; color: var(--muted); }
.phrase .lo { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.phrase .rd { grid-column: 2; font-size: 12px; color: var(--muted); }

/* ── 登入 ── */
.login { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.login .card { width: 100%; max-width: 360px; gap: 14px; padding: 24px; }
.login h1 { margin: 0; font-family: var(--serif); font-size: 24px; }
.login input {
  height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--chip-line);
  background: var(--inner); font-size: 16px; font-family: inherit; color: var(--ink); width: 100%;
}
.err { font-size: 13px; color: #B5523F; min-height: 18px; }
.foot { display: flex; justify-content: center; }
.link-btn { border: none; background: none; font-size: 12px; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 8px; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: #FFF; font-size: 13px; padding: 10px 16px; border-radius: 999px; z-index: 50;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* 很窄的手機：航班時間縮一點 */
@media (max-width: 360px) {
  .flight-route .t { font-size: 18px; }
  .hero-head h1 { font-size: 26px; }
}
