:root {
  --bg: #f4ecdd; --card: #fffaf1; --olive: #5b6b3c; --olive-d: #44512b; --olive-l: #e4e8d6;
  --clay: #c2703d; --clay-l: #f6e1d1; --ink: #3e2f23; --muted: #8a7a68; --line: #e6d9c3; --sand: #eadcc2;
  --tabbar-h: 64px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  overflow-wrap: anywhere;
}
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }

/* hero */
.hero {
  position: relative; color: #fbf5e8;
  background: linear-gradient(160deg, #6d7d48 0%, var(--olive) 45%, var(--olive-d) 100%);
  padding: calc(env(safe-area-inset-top) + 30px) 20px 46px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 20%, #fff8 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 85% 45%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 15%, #fff9 50%, transparent 51%);
}
.hero-text { position: relative; }
.eyebrow { font-size: 13px; opacity: .85; letter-spacing: .05em; }
.hero h1 { font-size: 26px; margin: 4px 0 6px; letter-spacing: .04em; }
.dates { font-size: 14px; }
.people { font-size: 13px; opacity: .85; margin-top: 2px; }
.mountains { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 34px; display: block; }
.m-back { fill: #7f8d5a; opacity: .55; }
.m-front { fill: var(--bg); }
.bell {
  position: absolute; top: calc(env(safe-area-inset-top) + 24px); right: 16px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; background: #fff3; font-size: 20px;
  display: grid; place-items: center;
}
.bell::after {
  content: ""; position: absolute; top: 8px; right: 8px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--clay); border: 2px solid var(--olive);
}

main { padding: 14px 14px 0; max-width: 560px; margin: 0 auto; }

/* cards */
.card { background: var(--card); border-radius: 18px; padding: 16px; margin-bottom: 12px; box-shadow: 0 2px 0 var(--line); }
.card h2 { font-size: 16px; margin-bottom: 8px; }
.countdown { text-align: center; background: var(--olive); color: #fbf5e8; }
.countdown .label { font-size: 13px; opacity: .85; }
.cd { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
.cd div { background: #fff2; border-radius: 12px; padding: 6px 0; width: 56px; }
.cd b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.cd span { font-size: 11px; opacity: .85; }

.stop .tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--olive-l); color: var(--olive-d); margin-bottom: 8px; }
.stop.now { border: 2px solid var(--clay); }
.stop.now .tag { background: var(--clay); color: #fff; }
.stop .time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stop h3 { font-size: 20px; margin: 2px 0; }
.stop .place { font-size: 15px; }
.stop .note { font-size: 13px; background: var(--clay-l); color: #8a4a22; border-radius: 10px; padding: 6px 10px; margin-top: 8px; }
.stop .btn { margin-top: 12px; }

.farewell { text-align: center; background: var(--card); border: 2px solid var(--olive-l); }
.farewell h3 { font-size: 22px; margin-bottom: 10px; color: var(--olive-d); }
.farewell p { font-size: 15px; line-height: 1.8; margin-top: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  border-radius: 12px; padding: 10px 16px; font-weight: 700; font-size: 15px;
  background: var(--olive); color: #fff; text-decoration: none;
}
.btn.full { width: 100%; }
.btn.clay { background: var(--clay); }
.btn.ghost { background: transparent; color: var(--muted); font-weight: 400; }
.btn.sm { min-height: 40px; padding: 6px 14px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.announce .a-title { font-weight: 700; }

/* tabbar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex;
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button { flex: 1; min-height: var(--tabbar-h); font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tabbar .ti { font-size: 22px; filter: grayscale(1); opacity: .6; }
.tabbar button[aria-current="page"] { color: var(--olive); font-weight: 700; }
.tabbar button[aria-current="page"] .ti { filter: none; opacity: 1; }

/* schedule */
.day-switch { display: flex; background: var(--sand); border-radius: 14px; padding: 4px; margin-bottom: 12px; }
.day-switch button { flex: 1; padding: 10px 8px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); }
.day-switch button[aria-selected="true"] { background: var(--card); color: var(--olive-d); box-shadow: 0 1px 3px #0001; }

.timeline { list-style: none; position: relative; margin-top: 6px; }
.timeline::before { content: ""; position: absolute; left: 66px; top: 12px; bottom: 12px; width: 2px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 54px 22px 1fr auto; gap: 0 6px; align-items: start; padding: 10px 0; border-radius: 12px; }
.timeline .t { text-align: right; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.timeline .t small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.timeline .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 3px solid var(--olive); margin: 2px auto 0; position: relative; z-index: 1; }
.timeline h4 { font-size: 15px; }
.timeline .pl { font-size: 13px; color: var(--muted); }
.timeline .nt { font-size: 12px; color: #8a4a22; margin-top: 2px; }
.map-link { font-size: 12px; background: var(--olive-l); color: var(--olive-d); border-radius: 999px; padding: 8px 12px; font-weight: 700; white-space: nowrap; text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
.timeline li.is-done { opacity: .45; }
.timeline li.is-done .dot { background: var(--olive); }
.timeline li.is-now { background: var(--clay-l); }
.timeline li.is-now .dot { border-color: var(--clay); background: var(--clay); box-shadow: 0 0 0 5px #c2703d33; }
.badge { font-size: 11px; background: var(--clay); color: #fff; border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: 2px; }
.timeline li.flash { animation: flash 1.5s ease; }
@keyframes flash { 0%, 60% { background: var(--clay-l); box-shadow: 0 0 0 3px var(--clay); } 100% { box-shadow: 0 0 0 0 transparent; } }

body[data-mode="after"] #weather-card { display: none !important; }

/* weather */
.wx h2 { display: flex; justify-content: space-between; align-items: baseline; }
.wx h2 small { font-size: 11px; font-weight: 400; color: var(--muted); }
.wx-row { display: grid; grid-template-columns: 70px 30px 1fr auto; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.wx-row .d { font-weight: 700; }
.wx-row .ic { font-size: 22px; text-align: center; }
.wx-row .tp { font-variant-numeric: tabular-nums; }
.wx-row .tp b { color: var(--clay); }
.rain { font-size: 12px; background: #e3ecf0; color: #3d6475; border-radius: 999px; padding: 2px 8px; }
.wx-tip { font-size: 13px; background: var(--olive-l); color: var(--olive-d); border-radius: 10px; padding: 7px 10px; margin-top: 8px; }
.wx-strip { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; box-shadow: 0 2px 0 var(--line); }
.wx-strip .ic { font-size: 26px; }
.wx-strip .rain { margin-left: auto; }

/* prep */
.prep { list-style: none; }
.prep li { display: flex; align-items: center; gap: 12px; padding: 14px 2px; border-bottom: 1px dashed var(--line); font-size: 15px; cursor: pointer; min-height: 48px; }
.prep li:last-child { border-bottom: none; }
.box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--olive); display: grid; place-items: center; color: #fff; font-size: 15px; flex: none; }
.prep li.ok .box { background: var(--olive); }
.prep li.ok span { text-decoration: line-through; color: var(--muted); }
.progress { height: 8px; background: var(--sand); border-radius: 99px; overflow: hidden; margin: 12px 0 6px; }
.progress-bar { height: 100%; width: 0; background: var(--olive); border-radius: 99px; transition: width .25s; }

/* sheets (dialog) */
dialog.sheet {
  border: none; background: var(--bg); color: var(--ink); width: 100%; max-width: 560px;
  margin: auto auto 0; border-radius: 24px 24px 0 0; padding: 0; max-height: 92vh; overflow: auto;
}
dialog.sheet::backdrop { background: #2b241d88; }
dialog.sheet-full { height: 100%; max-height: 100%; border-radius: 0; margin: 0 auto; }
.sheet-inner { padding: 22px 18px calc(env(safe-area-inset-bottom) + 24px); position: relative; }
.sheet h2 { font-size: 20px; text-align: center; }
.sheet .lead { text-align: center; color: var(--muted); font-size: 14px; margin: 4px 0 16px; }
.step { background: var(--card); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.step-h { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 15px; }
.ok-chip { font-size: 12px; background: var(--olive-l); color: var(--olive-d); border-radius: 999px; padding: 3px 10px; }
.step ol { margin: 10px 0 0 20px; font-size: 13px; line-height: 1.9; color: #5c4c3c; }
.step .btn { margin-top: 10px; }
.step p.muted { margin-top: 6px; }
.share { display: inline-block; border: 1.5px solid #5c4c3c; border-radius: 4px; font-size: 10px; padding: 0 3px; line-height: 14px; }

/* admin */
.x { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; font-size: 20px; color: var(--muted); }
.stat { display: flex; align-items: baseline; gap: 6px; background: var(--olive); color: #fff; border-radius: 16px; padding: 14px 16px; margin: 16px 0 14px; }
.stat b { font-size: 30px; }
.sec { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.chips button { font-size: 12px; background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 12px; min-height: 36px; }
.chips button.sel { border-color: var(--olive); background: var(--olive-l); color: var(--olive-d); font-weight: 700; }
.field { display: block; margin-bottom: 10px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.field textarea { min-height: 84px; resize: vertical; }
.err { color: #a3361f; font-size: 13px; margin: 6px 0; min-height: 18px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px); z-index: 30;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; font-size: 14px; border-radius: 999px; padding: 10px 18px;
  max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
