:root {
  --paper: #faf7f2; --ink: #171412; --red: #a3231f; --jade: #2f6b5e; --dark: #14110f;
  --gold: #d9b36c; --cream: #f5efe6; --cream-2: #e8dfd2; --muted: #5f564e; --muted-2: #4a423c;
  --line: #e4ddd4; --line-2: #efe9e0; --input: #cfc6bb; --amber: #7f5c1f; --amber-bg: #f8f0e1;
  --jade-bg: #e7f0ed; --red-bg: #f7eae7; --nav-dark: #3a332d;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }
html[lang="zh"] body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif; }
a { color: var(--red); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; letter-spacing: -0.01em; line-height: 1.15; }
.serif { font-family: 'Iowan Old Style', 'Palatino Linotype', Georgia, serif; }
html[lang="zh"] .serif { font-family: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--input); background: #fff; color: var(--ink); font-size: 15px; font-weight: 650; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-outline { border: 1px solid var(--ink); }
.btn-small { min-height: 36px; padding: 0 10px; font-size: 13px; font-weight: 500; border-radius: 8px; }
.btn-danger { color: var(--red); border-color: var(--red); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.pill { font-size: 12px; font-weight: 650; border-radius: 99px; padding: 4px 10px; white-space: nowrap; }
.pill-jade { color: var(--jade); background: var(--jade-bg); }
.pill-red { color: var(--red); background: var(--red-bg); }
.pill-amber { color: var(--amber); background: var(--amber-bg); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
html[lang="zh"] .eyebrow { letter-spacing: 0; text-transform: none; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted-2); }
.field input, .field select, .field textarea { min-height: 44px; border: 1px solid var(--input); border-radius: 8px; padding: 8px 12px; font-size: 16px; font-weight: 400; color: var(--ink); background: #fff; width: 100%; }
.field textarea { min-height: 80px; resize: vertical; }
.field.needed input, .field.needed select { border: 2px solid var(--amber); }
.need-tag { margin-left: 4px; padding: 1px 8px; border-radius: 99px; background: var(--amber-bg); color: var(--amber); font-size: 11px; font-weight: 700; }
/* The room partner only matters for "With someone specific". Browsers without :has() just show it. */
form:has(select[name="room_preference"]) .share-field { display: none; }
form:has(select[name="room_preference"] option[value="specific"]:checked) .share-field { display: flex; }
.hint { font-size: 13px; font-weight: 400; color: var(--muted); }
.notice { background: var(--amber-bg); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.notice-ok { background: var(--jade-bg); color: var(--jade); font-weight: 650; }
.notice-err { background: var(--red-bg); color: var(--red); font-weight: 650; }

/* Guest shell: phone first */
.guest { min-height: 100vh; display: flex; flex-direction: column; }
.guest-main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 24px 20px 32px; display: flex; flex-direction: column; gap: 20px; }
.guest-main.flush { padding-top: 0; }
.hero { background: var(--dark); color: var(--cream); padding: 24px 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.hero-wrap { background: var(--dark); }
.hero-inner { max-width: 560px; margin: 0 auto; }
.hero a { color: var(--cream); }
.hero h1 { font-size: 28px; }
.hero p { color: var(--cream-2); }
.brand { font-size: 13px; color: var(--gold); font-weight: 600; }
.lang-switch { min-height: 44px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; text-decoration: none; }
.lang-switch b { text-decoration: underline; }
.step { display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; }
.step .label { font-size: 12px; font-weight: 700; color: var(--amber); }
.step .label.urgent { color: var(--red); }
.step .title { font-size: 16px; font-weight: 650; }
.step .sub { font-size: 14px; color: var(--muted); }
.step.first { border: 2px solid var(--red); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.facts span { display: block; }
.facts .k { font-size: 12px; color: var(--muted); }
.facts .v { font-size: 15px; font-weight: 650; }
.tabbar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: 72px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabbar a.active { color: var(--red); }
.tabbar svg { width: 22px; height: 22px; }
.person { display: flex; flex-direction: column; gap: 6px; }
.person .name { font-size: 16px; font-weight: 650; }
.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.counts .card { padding: 10px; }
.counts .n { font-size: 22px; font-weight: 700; display: block; }

/* Public page */
.public { min-height: 100vh; background: var(--dark); color: var(--cream); display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 40px 32px; max-width: 560px; margin: 0 auto; }
.public .when { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.public h1 { font-size: 44px; line-height: 1.05; letter-spacing: -0.02em; }
.public .cn { font-size: 24px; color: var(--gold); }
.public hr { border: 0; height: 1px; background: var(--nav-dark); margin: 0; width: 100%; }
.public p { font-size: 18px; line-height: 1.5; color: var(--cream-2); }
.public a { color: #b3a698; }
.public .field { color: var(--cream-2); }
.public .btn { background: var(--cream); color: var(--dark); border-color: var(--cream); }

/* Admin shell */
.admin { min-height: 100vh; display: flex; flex-wrap: wrap; }
.admin-nav { flex: 1 1 220px; background: var(--dark); color: var(--cream); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.admin-nav .brand-line { font-size: 15px; font-weight: 700; padding: 0 12px 16px; color: var(--cream); }
.admin-nav a { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 8px; color: var(--cream-2); font-size: 14px; text-decoration: none; }
.admin-nav a.active { background: var(--nav-dark); color: #fff; font-weight: 650; }
.admin-nav .soon { opacity: 0.45; }
.admin-nav form { margin-top: auto; }
.admin-nav button { background: none; border: 0; color: var(--cream-2); font-size: 14px; min-height: 44px; padding: 0 12px; cursor: pointer; }
.admin-main { flex: 999 1 560px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.admin-main h1 { font-size: 28px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; }
.stats .n { font-size: 26px; font-weight: 700; display: block; }
.stats .n.bad { color: var(--red); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
th { padding: 12px 14px; font-weight: 700; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.bad { color: var(--red); font-weight: 700; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 20px; align-items: start; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form { display: inline; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; word-break: break-all; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
pre.message { white-space: pre-wrap; font: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 0; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login .card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; padding: 24px; }
dl.kv { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.briefing h2 { font-size: 20px; margin-top: 8px; }
.briefing p, .briefing li { font-size: 16px; line-height: 1.55; }
.briefing ul { padding-left: 20px; margin: 0; }

/* Release 2: route, days, stops */
.leg { font-size: 13px; font-weight: 600; color: var(--amber); padding: 2px 0; }
.stop-card { min-height: 56px; text-decoration: none; color: var(--ink); }
.stop-card.mine { border: 2px solid var(--red); }
.day { display: flex; flex-direction: column; gap: 6px; }
.day.today { border: 2px solid var(--red); }
.day.dim { opacity: 0.55; }
.addr { font-size: 22px; line-height: 1.4; font-weight: 600; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; word-break: break-all; }

/* Release 3: booking */
.booking-row { text-decoration: none; color: var(--ink); min-height: 56px; }
.booking-row .title { font-size: 15px; font-weight: 650; }
.booking-row.next { border: 2px solid var(--red); }
.next-card { background: var(--dark); color: var(--cream); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.btn-outline-red { border: 2px solid var(--red); color: var(--red); font-weight: 700; }
.big-number { font-size: 28px; font-weight: 700; letter-spacing: 0.02em; }
.check-row { display: flex; align-items: center; gap: 12px; font-size: 15px; min-height: 44px; cursor: pointer; }
.check-row input { width: 22px; height: 22px; flex: none; margin: 0; }
label.card.check-row { align-items: flex-start; }
label.card.check-row input { margin-top: 2px; }
.warn { border: 2px solid var(--red); display: flex; flex-direction: column; gap: 10px; }
.notices { background: var(--jade-bg); border-color: var(--jade); }
.for-box summary { cursor: pointer; font-weight: 650; min-height: 44px; display: flex; align-items: center; }
.booked { border: 2px solid var(--jade); }
.hotel-option h2 { font-size: 18px; }
/* Guests who live in China skip insurance and passport. Browsers without :has() just show them. */
form:has(select[name="lives_in_china"] option[value="yes"]:checked) .abroad-only { display: none; }
