/* 日本七日導覽手冊 — 行動優先樣式 */
:root {
  --bg: #f2f5fa;
  --card: #ffffff;
  --ink: #17233a;
  --ink2: #4d5b73;
  --ink3: #5f6b80;
  --line: #e3e9f2;
  --brand: #1d3557;
  --brand2: #2f6fde;
  --accent: #d9482b;
  --warn-bg: #fff4e5;
  --warn-ink: #8a4b00;
  --tip-bg: #eaf4ff;
  --tip-ink: #174a86;
  --chip: #e8eef7;
  --shadow: 0 1px 2px rgba(23, 35, 58, .06), 0 4px 14px rgba(23, 35, 58, .06);
  --top: 52px;
  --tab: 58px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --r: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1420; --card: #172132; --ink: #e9eef7; --ink2: #b3bfd2; --ink3: #7f8ca3; --line: #26334a;
    --brand: #0f1826; --brand2: #6ea3ff; --accent: #ff7a5c; --warn-bg: #3a2a12; --warn-ink: #ffd08a;
    --tip-bg: #14294a; --tip-ink: #a9cdff; --chip: #223048; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1420; --card: #172132; --ink: #e9eef7; --ink2: #b3bfd2; --ink3: #7f8ca3; --line: #26334a;
  --brand: #0f1826; --brand2: #6ea3ff; --accent: #ff7a5c; --warn-bg: #3a2a12; --warn-ink: #ffd08a;
  --tip-bg: #14294a; --tip-ink: #a9cdff; --chip: #223048; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
:root[data-fs="l"] { font-size: 112.5%; }
:root[data-fs="xl"] { font-size: 125%; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + var(--sat) + 8px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Hiragino Sans", "Segoe UI", sans-serif;
  font-size: 1rem; line-height: 1.6; overscroll-behavior-y: none;
}
[lang="ja"], .ja { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "PingFang TC", sans-serif; }
a { color: var(--brand2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand2); outline-offset: 2px; border-radius: 6px; }

/* ---------- 版面骨架 ---------- */
#topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 1000; height: calc(var(--top) + var(--sat)); padding: var(--sat) 6px 0;
  display: flex; align-items: center; gap: 4px; background: var(--brand); color: #fff;
}
#topbar h1 { flex: 1; font-size: 1.05rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
#topbar button { width: 44px; height: 44px; border: 0; background: none; color: #fff; font-size: 1.35rem; border-radius: 12px; }
#topbar button:active { background: rgba(255, 255, 255, .15); }
.offbadge { display: none; font-size: .72rem; background: rgba(255, 255, 255, .18); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
body.offline .offbadge { display: inline-block; }

#view { max-width: 760px; margin: 0 auto; padding: calc(var(--top) + var(--sat)) 0 calc(var(--tab) + var(--sab) + 24px); min-height: 100vh; }
body:not(.ready) #view { opacity: 0; }
.boot { position: fixed; inset: 0; display: grid; place-items: center; color: var(--ink3); font-size: .95rem; pointer-events: none; }
body.ready .boot { display: none; }

#tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 1000; height: calc(var(--tab) + var(--sab)); padding-bottom: var(--sab);
  display: flex; background: var(--card); border-top: 1px solid var(--line);
}
#tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--ink3); font-size: .7rem; font-weight: 600; }
#tabbar a span { font-size: 1.3rem; line-height: 1.2; filter: grayscale(1) opacity(.65); transition: transform .15s; }
#tabbar a.on { color: var(--brand2); }
#tabbar a.on span { filter: none; transform: translateY(-1px) scale(1.08); }

.sec { padding: 14px 14px 0; }
.sec > h2 { font-size: 1.08rem; margin: 6px 2px 10px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.lead { color: var(--ink2); font-size: .93rem; margin: 2px 2px 10px; }
.hint { color: var(--ink3); font-size: .8rem; margin: 8px 2px 0; }
.foot { color: var(--ink3); font-size: .76rem; padding: 18px 16px 0; text-align: center; }
.desc { color: var(--ink); font-size: .97rem; line-height: 1.75; }
.empty { text-align: center; color: var(--ink3); padding: 26px 12px; font-size: .92rem; }
.grp { font-size: .9rem; color: var(--ink2); margin: 16px 2px 8px; font-weight: 700; }
.grp small { font-weight: 500; color: var(--ink3); }
.chev { color: var(--ink3); font-size: 1.3rem; margin-left: auto; padding-left: 4px; flex: none; }

.pill { display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .92); color: #17233a; border-radius: 99px; padding: 4px 12px; font-size: .84rem; font-weight: 600; }
.pill b { color: var(--accent); font-size: 1.05em; }
.pill.light { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- 按鈕 / chips ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.btn-col { display: grid; gap: 8px; }
.btn { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 42px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: .9rem; text-align: center; }
.btn.primary { background: var(--brand2); border-color: var(--brand2); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0d1420; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0d1420; } }
.btn.danger { color: #c62828; }
.btn:disabled { opacity: .45; }
.btn:active { transform: scale(.98); }
.mini { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--brand2); border-radius: 99px; padding: 6px 14px; font-size: .82rem; font-weight: 600; min-height: 40px; display: inline-flex; align-items: center; }
.mini-x { flex: none; border: 0; background: none; color: var(--ink3); width: 44px; height: 44px; border-radius: 50%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 14px; margin: 8px -14px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; background: var(--chip); color: var(--ink2); border-radius: 99px; padding: 8px 14px; font-size: .86rem; font-weight: 600; min-height: 40px; }
.chip.on { background: var(--brand2); color: #fff; }
.chip.cat.on { background: var(--c); }
.search, .ta { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 14px; font-size: 1rem; }
.ta { resize: vertical; min-height: 84px; line-height: 1.6; }
.ta.tall { min-height: 50vh; }
.seg { display: flex; background: var(--chip); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 9px 6px; font-weight: 600; color: var(--ink2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- 首頁 ---------- */
.hero { position: relative; height: 230px; overflow: hidden; background: #8ec5ff; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-txt { position: absolute; inset: 0; padding: 18px 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: #12264a; }
.hero-kicker { font-size: .84rem; font-weight: 700; letter-spacing: .04em; background: rgba(255, 255, 255, .7); padding: 2px 10px; border-radius: 99px; }
.hero h1 { font-size: 1.55rem; line-height: 1.25; font-weight: 800; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.today { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; margin: 14px 14px 0; padding: 12px 14px; border-left: 6px solid var(--dc); color: var(--ink); }
.today-k { width: 100%; font-size: .78rem; color: var(--dc); font-weight: 700; }
.flights { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.flight { padding: 10px 12px; }
.fl-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .74rem; color: var(--ink3); }
.fl-top b { font-size: .95rem; color: var(--brand2); }
.fl-main { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin: 4px 0; }
.fl-main strong { display: block; font-size: 1.15rem; line-height: 1.2; }
.fl-main span { font-size: .72rem; color: var(--ink2); }
.fl-main > div:last-child { text-align: right; }
.fl-line { flex: 1; display: flex; align-items: center; gap: 2px; color: var(--ink3); min-width: 14px; }
.fl-line i { flex: 1; border-top: 1.5px dashed var(--line); }
.flight small { font-size: .68rem; color: var(--ink3); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 2px 10px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); color: var(--ink); font-size: .76rem; font-weight: 600; text-align: center; }
.quick a span { font-size: 1.6rem; line-height: 1; }
.days { display: grid; gap: 10px; }
.day-card { display: flex; align-items: stretch; gap: 12px; padding: 0 10px 0 0; color: var(--ink); overflow: hidden; }
.day-card.is-today { outline: 2px solid var(--dc); }
.day-badge { flex: none; width: 74px; background: var(--dc); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 4px; gap: 0; }
.day-badge small { font-size: .7rem; opacity: .95; white-space: nowrap; }
.day-badge b { font-size: 1.5rem; line-height: 1.15; }
.day-badge span { font-size: 1.15rem; }
.day-info { flex: 1; min-width: 0; padding: 10px 0; display: flex; flex-direction: column; gap: 3px; }
.day-info > b { font-size: .98rem; line-height: 1.35; }
.day-stops { font-size: .8rem; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.day-hotel { font-size: .76rem; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-card .chev { align-self: center; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 2px; }
.meta i { font-style: normal; font-size: .72rem; background: var(--chip); color: var(--ink2); border-radius: 6px; padding: 1px 7px; }
.install { padding: 14px; }
.install p { font-size: .88rem; color: var(--ink2); margin-top: 4px; }

/* ---------- 提示框 ---------- */
.note { display: flex; gap: 10px; padding: 11px 13px; border-radius: 13px; margin: 10px 0 0; font-size: .9rem; line-height: 1.6; }
.note > span { flex: none; }
.note p { font-size: .88rem; margin-top: 2px; }
.note.tip { background: var(--tip-bg); color: var(--tip-ink); }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note.sm { font-size: .82rem; padding: 8px 10px; }
.note.linkable em { font-style: normal; font-weight: 700; font-size: .82rem; }
.note a { color: inherit; text-decoration: underline; }

/* ---------- 每日行程頁 ---------- */
.day-hero, .guide-hero { background-color: var(--dc, #1d3557); background-image: linear-gradient(160deg, rgba(11, 23, 48, 0), rgba(11, 23, 48, .32)); color: #fff; padding: 18px 16px 16px; }
.route-hero { --dc: #b8402a; }
.guide-hero { --dc: #1d3557; }
.guide-hero.shop { --dc: #b82f61; }
.dh-top { display: flex; align-items: center; gap: 10px; font-size: .84rem; font-weight: 600; opacity: .96; }
.dh-badge { background: #fff; color: #17233a; border-radius: 8px; padding: 1px 10px; font-weight: 800; }
.day-hero h1, .guide-hero h1 { font-size: 1.32rem; line-height: 1.35; margin: 8px 0 6px; }
.day-hero p, .guide-hero p { font-size: .9rem; opacity: .95; line-height: 1.65; }
.dh-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.anchors { position: sticky; top: calc(var(--top) + var(--sat)); z-index: 500; display: flex; gap: 8px; overflow-x: auto; padding: 8px 14px; background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.anchors::-webkit-scrollbar { display: none; }
.meals { padding: 2px 12px; }
.meals > div { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .9rem; line-height: 1.55; }
.meals > div:first-child { border-top: 0; }
.meals small { flex: none; width: 4.4em; color: var(--ink3); font-size: .8rem; padding-top: 1px; white-space: nowrap; }
.meals span { flex: 1; min-width: 0; }
details.wx-note { display: block; }
details.wx-note summary { font-weight: 700; cursor: pointer; }
details.wx-note > div { margin-top: 6px; }
.cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 14px 0; }
.sec .cta-row { padding: 0; }
.cta { display: flex; flex-direction: column; gap: 1px; padding: 12px; border-radius: var(--r); background: linear-gradient(135deg, #2f6fde, #5b8dee); color: #fff; box-shadow: var(--shadow); }
.cta.alt { background: linear-gradient(135deg, #d9482b, #ee7b30); }
.cta span { font-size: 1.5rem; line-height: 1.2; }
.cta small { font-size: .74rem; opacity: .92; }

.tl, .steps { list-style: none; margin: 0; padding: 0; }
.tl li > a, .tl li > div { display: flex; align-items: flex-start; gap: 8px; padding: 9px 4px; color: var(--ink); position: relative; }
.tl li + li > a, .tl li + li > div { border-top: 1px dashed var(--line); }
.tl-time { flex: none; width: 46px; font-variant-numeric: tabular-nums; font-weight: 700; font-size: .86rem; color: var(--ink2); padding-top: 1px; }
.tl-dot { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; font-size: .95rem; }
.tl-body { flex: 1; min-width: 0; }
.tl-body b { display: block; font-size: .95rem; line-height: 1.4; }
.tl-body i { font-style: normal; font-size: .74rem; color: var(--ink3); }
.tl-body small { display: block; font-size: .8rem; color: var(--ink2); line-height: 1.5; margin-top: 1px; }
.tl-move .tl-body b, .tl-flight .tl-body b { font-weight: 600; color: var(--ink2); }

.spot { padding: 12px; margin-bottom: 10px; }
.spot-head { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.spot-head b { display: block; font-size: 1.02rem; line-height: 1.35; }
.spot-sum { font-size: .9rem; color: var(--ink2); margin: 8px 0 0; }
.spot-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; font-size: .82rem; color: var(--ink3); }
.spot-foot a { font-weight: 700; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 8px 0 0; }
.tags li { background: var(--chip); color: var(--ink2); border-radius: 8px; padding: 2px 9px; font-size: .78rem; }
.tags.big li { font-size: .9rem; padding: 5px 12px; background: #fff0e6; color: #a2400f; font-weight: 600; }
:root[data-theme="dark"] .tags.big li { background: #3a2415; color: #ffb98a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tags.big li { background: #3a2415; color: #ffb98a; } }
.pager { display: flex; justify-content: space-between; padding: 20px 14px 0; }
.pager a { background: var(--card); box-shadow: var(--shadow); border-radius: 99px; padding: 9px 16px; font-weight: 700; font-size: .9rem; }

.ul, .ol { margin: 0; padding-left: 1.25em; font-size: .93rem; }
.ul li, .ol li { margin: 5px 0; line-height: 1.65; }
.tipsul, .famul, .stars { list-style: none; padding: 0; }
.tipsul li, .famul li, .stars li { background: var(--card); border-radius: 12px; padding: 9px 12px 9px 36px; margin: 6px 0; box-shadow: var(--shadow); position: relative; }
.tipsul li::before { content: "💡"; position: absolute; left: 10px; }
.famul li::before { content: "🧸"; position: absolute; left: 10px; }
.stars li::before { content: "✨"; position: absolute; left: 10px; }

/* ---------- POI 卡片 ---------- */
.poi-card { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 8px 10px 12px; margin: 8px 0; color: var(--ink); }
.poi-ico { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--chip); background: color-mix(in srgb, var(--c) 16%, var(--card)); color: var(--c); display: grid; place-items: center; font-size: 1.15rem; font-weight: 800; }
.poi-ico.sm { width: 30px; height: 30px; font-size: .95rem; border-radius: 9px; }
.poi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.poi-body > b { font-size: .97rem; line-height: 1.35; }
.poi-body small.ja, small.ja { color: var(--ink3); font-size: .74rem; line-height: 1.3; display: block; }
.poi-sum { color: var(--ink2); font-size: .84rem; line-height: 1.45; }
.poi-must { color: #a2400f; font-size: .78rem; }
:root[data-theme="dark"] .poi-must { color: #ffb98a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .poi-must { color: #ffb98a; } }
.poi-jan { color: var(--warn-ink); font-size: .76rem; }

/* ---------- POI 詳細頁 ---------- */
.poi-hero { background-color: var(--c); background-image: linear-gradient(160deg, rgba(11, 23, 48, 0), rgba(11, 23, 48, .4)); color: #fff; padding: 16px 16px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ph-cat { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .8rem; font-weight: 700; }
.ph-cat span { background: rgba(255, 255, 255, .22); border-radius: 99px; padding: 2px 10px; }
.ph-cat a { background: #fff; color: #17233a; border-radius: 99px; padding: 2px 10px; }
.poi-hero h1 { font-size: 1.45rem; line-height: 1.3; margin-top: 6px; }
.ph-ja { font-size: .9rem; opacity: .95; }
.ph-ja span { opacity: .8; font-size: .82rem; }
.poi-hero p { font-size: .95rem; margin-top: 4px; }
.poi-hero .pill { margin-top: 8px; }
.actbar { display: flex; background: var(--card); border-bottom: 1px solid var(--line); }
.act { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 9px 2px 8px; border: 0; background: none; color: var(--ink2); font-size: .72rem; font-weight: 600; min-height: 54px; }
.act span { font-size: 1.25rem; line-height: 1.3; }
.act.on { color: #e09a00; }
.rows { padding: 2px 12px; }
.hotel .rows { padding: 0; margin-top: 8px; }
.row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .93rem; }
.row:first-child { border-top: 0; }
.row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row small { display: block; color: var(--ink3); font-size: .72rem; }
.row-i { flex: none; width: 24px; text-align: center; }
.kv { margin: 0; display: grid; gap: 0; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 2px 12px; }
.kv > div { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.kv > div:first-child { border-top: 0; }
.kv dt { flex: none; width: 5.2em; color: var(--ink3); font-size: .82rem; padding-top: 1px; }
.kv dd { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
details.src { margin: 16px 16px 0; font-size: .78rem; color: var(--ink3); }
details.src ul { padding-left: 1.2em; overflow-wrap: anywhere; }

/* ---------- 地圖 ---------- */
.mapbox { border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); background: var(--chip); }
.mapbox .map { height: 270px; }
.mapbox.sm .map { height: 170px; }
.mapbox.sm { margin: 10px 0 0; }
.map { width: 100%; z-index: 0; }
.map-off { padding: 30px; text-align: center; color: var(--ink3); }
body.full #view { max-width: none; padding-bottom: 0; }
.mapfull { position: fixed; inset: calc(var(--top) + var(--sat)) 0 calc(var(--tab) + var(--sab)) 0; }
.mapfull .map { height: 100%; }
.map-top { position: absolute; top: 6px; left: 0; right: 0; z-index: 600; pointer-events: none; }
.map-top .chips { pointer-events: auto; margin: 0 0 4px; padding: 2px 10px; }
.map-top .chip { box-shadow: 0 1px 4px rgba(0, 0, 0, .25); background: var(--card); color: var(--ink2); }
.map-top .chip.on { background: var(--brand2); color: #fff; }
.map-top .chip.cat { opacity: .6; }
.map-top .chip.cat.on { background: var(--c); opacity: 1; }
.fab { position: absolute; right: 12px; bottom: 22px; z-index: 600; width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--card); color: var(--brand2); font-size: 1.55rem; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.fab.on { background: var(--brand2); color: #fff; }
.fab.busy { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.mapcard { position: absolute; left: 10px; right: 10px; bottom: 12px; z-index: 900; background: var(--card); border-radius: 18px; box-shadow: 0 6px 24px rgba(0, 0, 0, .28); padding: 12px; }
.mapcard:not([hidden]) ~ .fab { bottom: 200px; }
.mc-main { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); padding-right: 34px; }
.mc-main b { display: block; line-height: 1.35; }
.pin-wrap { background: none; border: 0; }
.pin { width: 32px; height: 32px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); display: grid; place-items: center; }
.pin span { transform: rotate(45deg); font-size: 14px; line-height: 1; color: #fff; font-weight: 800; font-family: system-ui, sans-serif; }
.pin.num { width: 34px; height: 34px; }
.pin.num span { font-size: 15px; }
.pin.active { transform: rotate(-45deg) scale(1.3); border-color: #ffd54a; z-index: 5; }
.leaflet-popup-content { margin: 10px 12px; }
.pop { display: flex; flex-direction: column; color: #17233a !important; min-width: 150px; }
.pop b { font-size: 14px; }
.pop small { color: #5b6880; font-size: 12px; }
.pop em { font-style: normal; color: #2f6fde; font-weight: 700; font-size: 12px; margin-top: 4px; }
.leaflet-container { font: inherit; background: var(--chip); }

/* ---------- 路線 / 自訂行程 ---------- */
.route-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 8px 12px 12px; margin: 10px 0; color: var(--ink); }
.rc-emoji { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--chip); display: grid; place-items: center; font-size: 1.5rem; }
.rc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rc-body small { color: var(--accent); font-size: .78rem; font-weight: 700; }
.route-card .chev { align-self: center; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.steps > li { margin: 0; }
.st { display: flex; align-items: flex-start; gap: 8px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 8px 10px 10px; color: var(--ink); }
.st-time { flex: none; width: 44px; font-weight: 700; font-size: .84rem; color: var(--ink2); font-variant-numeric: tabular-nums; padding-top: 3px; }
.st-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .82rem; }
.st-body { flex: 1; min-width: 0; }
.st-body b { display: block; font-size: .96rem; line-height: 1.4; }
.st-body i { font-style: normal; font-size: .74rem; color: var(--ink3); }
.st-body small { display: block; font-size: .82rem; color: var(--ink2); line-height: 1.55; margin-top: 2px; }
.leg { display: flex; align-items: center; gap: 10px; margin: 0 0 0 30px; padding: 8px 6px 8px 14px; border-left: 3px dotted var(--ink3); font-size: .82rem; color: var(--ink2); }
.leg > div { flex: 1; min-width: 0; }
.leg b { display: block; color: var(--ink); font-size: .84rem; }
.leg small { display: block; color: var(--ink3); font-size: .76rem; }
.leg.slim { margin-left: 28px; padding: 5px 6px 5px 12px; }
.plan-start { font-size: .86rem; font-weight: 700; color: var(--ink2); margin: 10px 2px 2px; }
.plan-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 10px; }
.plan-item a { flex: 1; min-width: 0; color: var(--ink); }
.plan-item a b { display: block; font-size: .94rem; line-height: 1.35; }
.plan-item a small { display: block; color: var(--ink3); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-btns { display: flex; flex: none; }
.plan-btns button { width: 42px; height: 44px; border: 0; background: none; color: var(--ink2); font-size: 1rem; border-radius: 8px; }
.plan-btns button:disabled { opacity: .25; }
.found { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.found > span:nth-child(2) { flex: 1; min-width: 0; }
.found b { display: block; font-size: .92rem; }
.found small { display: block; color: var(--ink3); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.found i { font-style: normal; font-size: .76rem; color: var(--ink3); }
.pick { display: grid; gap: 8px; margin-top: 12px; }

/* ---------- 攻略 ---------- */
.chips.scroll.gindex { margin: 0; padding: 10px 14px 2px; }
.gsec { margin: 10px 0; overflow: hidden; }
.gsec > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 13px 14px; font-size: 1rem; cursor: pointer; }
.gsec > summary::-webkit-details-marker { display: none; }
.gsec > summary::after { content: "＋"; margin-left: auto; color: var(--ink3); font-weight: 700; }
.gsec[open] > summary::after { content: "－"; }
.gsec > summary span { font-size: 1.25rem; }
.gbody { padding: 0 14px 14px; }
.gbody > * + * { margin-top: 10px; }
.gbody p { font-size: .94rem; line-height: 1.75; }
.gbody h4 { font-size: .92rem; color: var(--ink2); margin-top: 16px; }
.gbody .kv, .gbody .poi-card, .gbody .chk { box-shadow: none; border: 1px solid var(--line); }
.tblwrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { padding: 8px 10px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); line-height: 1.5; }
thead th { background: var(--chip); border-top: 0; font-size: .8rem; white-space: nowrap; }
.mealtbl th:first-child { width: 44px; white-space: nowrap; }

.chk { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 6px 12px 10px; }
.chk-head { display: flex; align-items: center; gap: 10px; font-size: .76rem; color: var(--ink3); padding: 6px 0; }
.bar { flex: 1; height: 6px; background: var(--chip); border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #34a853; border-radius: 9px; transition: width .2s; }
.chk-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .94rem; min-height: 44px; }
.chk-row input { flex: none; width: 22px; height: 22px; accent-color: #34a853; }
.chk-row span { flex: 1; }
.chk-row.done span { color: var(--ink3); text-decoration: line-through; }
.chk-add { display: flex; gap: 8px; margin-top: 8px; }
.chk-add input { flex: 1; min-width: 0; border: 1px dashed var(--line); background: none; border-radius: 10px; padding: 8px 10px; font-size: 1rem; }
.chk-add button { border: 0; background: var(--chip); border-radius: 10px; padding: 0 14px; font-weight: 600; color: var(--ink2); }

.phrase { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 8px 10px 12px; margin: 8px 0; }
.gbody .phrase { box-shadow: none; border: 1px solid var(--line); }
.ph-text { flex: 1; min-width: 0; }
.ph-text small { display: block; color: var(--ink2); font-size: .82rem; }
.ph-text b { display: block; font-size: 1.05rem; line-height: 1.5; }
.ph-text i { display: block; font-style: normal; color: var(--ink3); font-size: .76rem; }
.ph-btns { display: flex; flex: none; }
.ph-btns button { width: 42px; height: 42px; border: 0; background: var(--chip); border-radius: 50%; margin-left: 6px; font-size: 1.05rem; }

/* ---------- 更多 / 工具 ---------- */
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu a { display: flex; flex-direction: column; padding: 12px; color: var(--ink); }
.menu a span { font-size: 1.5rem; line-height: 1.3; }
.menu a small { color: var(--ink3); font-size: .74rem; }
.hotel { padding: 14px; margin: 0 0 12px; }
.hotel h3 { font-size: 1.1rem; margin-top: 6px; }
.hotel h3 a { color: var(--ink); }
.hotel p { font-size: .9rem; color: var(--ink2); margin-top: 4px; }
.hotel details { margin-top: 8px; font-size: .9rem; }
.hotel summary { color: var(--brand2); font-weight: 700; cursor: pointer; padding: 6px 0; }
.hotel-n { display: inline-block; background: var(--chip); background: color-mix(in srgb, #7a4fc9 16%, var(--card)); color: #7a4fc9; font-weight: 700; font-size: .78rem; padding: 2px 10px; border-radius: 99px; }
:root[data-theme="dark"] .hotel-n { color: #c3a6ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hotel-n { color: #c3a6ff; } }
.conv { padding: 14px; display: grid; gap: 8px; }
.conv label { display: grid; gap: 4px; font-size: .8rem; color: var(--ink3); font-weight: 600; }
.conv label input { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 1.5rem; font-weight: 700; width: 100%; }
.conv-eq { text-align: center; color: var(--ink3); line-height: 1; }
.conv-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .86rem; color: var(--ink2); }
.conv-rate input { width: 96px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 4px 8px; font-size: 1rem; }
.conv small { color: var(--ink3); font-size: .74rem; }
.exform { padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.exform input, .exform select { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px; min-width: 0; font-size: 1rem; }
.exform #exNote, .exform button { grid-column: 1 / -1; }
.total { padding: 14px; margin: 12px 0; display: flex; flex-direction: column; }
.total small { color: var(--ink3); font-size: .78rem; }
.total b { font-size: 1.8rem; line-height: 1.2; }
.total span { color: var(--ink2); font-size: .86rem; }
.ex { display: flex; align-items: center; padding: 8px 6px 8px 14px; margin: 8px 0; }
.ex > div { flex: 1; }
.ex small { display: block; color: var(--ink3); font-size: .78rem; }
.wx-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 14px 6px; margin: 0 -14px; scrollbar-width: none; }
.wx { flex: none; width: 104px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.wx small { color: var(--ink3); font-size: .76rem; }
.wx b { font-size: .84rem; }
.wx i { font-style: normal; font-size: .74rem; color: var(--ink3); }
.sos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sos a { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; color: var(--ink); }
.sos span { font-size: 1.8rem; line-height: 1.2; }
.sos b { font-size: 1.7rem; color: #c62828; line-height: 1.2; }
.sos small { color: var(--ink3); font-size: .78rem; }

/* ---------- 彈出面板 / toast ---------- */
#sheet { position: fixed; inset: 0; z-index: 2000; display: none; }
#sheet.open { display: block; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 14, 26, .5); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + var(--sab)); max-width: 760px; margin: 0 auto; animation: up .2s ease-out; overscroll-behavior: contain; }
.sheet-panel:focus { outline: none; }
.sheet-panel.big { min-height: 62vh; }
.sheet-panel h3 { font-size: 1.05rem; padding-right: 40px; margin-bottom: 10px; }
.sheet-panel h4 { font-size: .84rem; color: var(--ink3); margin: 14px 2px 4px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--chip); color: var(--ink2); z-index: 2; }
body.sheet-open { overflow: hidden; }
.askcard { text-align: center; padding: 16px 4px 4px; }
.askcard small { display: block; color: var(--ink3); font-size: .84rem; }
.ask-line { font-size: 1.1rem; margin-top: 14px; color: var(--ink2); }
.askcard h2 { font-size: 2rem; line-height: 1.35; margin: 14px 0; overflow-wrap: anywhere; }
.ask-addr { font-size: 1.25rem; line-height: 1.6; overflow-wrap: anywhere; }
.ask-tel { font-size: 1.05rem; color: var(--ink2); margin-top: 8px; }
.askcard .btn-row { margin-top: 22px; }
#toast { position: fixed; left: 50%; bottom: calc(var(--tab) + var(--sab) + 16px); transform: translate(-50%, 20px); z-index: 3000; background: rgba(20, 28, 44, .94); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: .9rem; opacity: 0; pointer-events: none; transition: all .2s; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.sticky.show { pointer-events: auto; }
#toast button { border: 0; background: #fff; color: #17233a; border-radius: 99px; padding: 4px 14px; font-weight: 700; margin-left: 6px; }

@media (min-width: 620px) {
  .hero { height: 280px; }
  .hero h1 { font-size: 2rem; }
  .mapbox .map { height: 360px; }
  .menu { grid-template-columns: repeat(3, 1fr); }
  .mapcard { left: auto; width: 380px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --card: #fff; --ink: #000; --ink2: #333; --ink3: #555; --line: #ccc; --chip: #eee; }
  #topbar, #tabbar, .actbar, .anchors, .btn-row, .mapbox, .mapfull, #sheet, #toast, .boot { display: none !important; }
  #view { padding: 0; }
  .day-hero, .guide-hero, .poi-hero { color: #000; background: none !important; }
  .pill.light { color: #000; border: 1px solid #ccc; }
  .card, .poi-card, .kv, .chk { box-shadow: none; border: 1px solid #ddd; }
}
/* 深色模式下，亮藍底按鈕改用深色字 */
:root[data-theme="dark"] :is(.chip.on, .map-top .chip.on, .fab.on) { color: #0d1420; }
:root[data-theme="dark"] :is(.btn.danger, .sos b) { color: #ff8a80; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.chip.on, .map-top .chip.on, .fab.on) { color: #0d1420; }
  :root:not([data-theme="light"]) :is(.btn.danger, .sos b) { color: #ff8a80; }
}
.leaflet-touch .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; font-size: 20px; }
