:root { color-scheme: dark; --bg: #161514; --fg: #ebe8e3; --muted: #9a958c; --line: #2e2c29; --accent: #fb923c; --card: #1f1e1c; --hi: #2a211b; --ok: #4ade80; }
* { box-sizing: border-box; }
/* Option photos: an image in an option's row shows once, at the top of its opened details; not in its columns. */
.ophoto { display: block; width: 100%; max-width: 480px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin: 4px 0 8px; background: var(--line); }
.ocell img, .cval img { display: none; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; font-size: 18px; }
.who { color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; }
button { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--card); color: var(--fg); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border: 0; }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
a { color: var(--accent); }
h1 { font-size: 24px; line-height: 1.25; margin: 4px 0 12px; }
h2 { font-size: 19px; margin: 24px 0 8px; }
.docs { list-style: none; padding: 0; } .docs li { margin: 0 0 10px; }
.docs a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-decoration: none; font-size: 17px; font-weight: 600; }
.files a { font-weight: 400; font-size: 15px; }
.badge { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 13px; }
.progress { position: sticky; top: 49px; z-index: 1; background: var(--bg); padding: 6px 0; font-weight: 600; color: var(--ok); border-bottom: 1px solid var(--line); margin-bottom: 8px; }

/* A block: tick boxes, the text, the comment button; its thread opens full width underneath. */
.blk { display: grid; grid-template-columns: auto 1fr auto; column-gap: 8px; align-items: start; margin: 0 0 10px; border-radius: 8px; }
.blk.k-li { margin: 0 0 2px; padding: 2px 0; }
.blk .body { grid-column: 2; min-width: 0; overflow-wrap: anywhere; }
.blk:not(.chk) .body { grid-column: 1 / 3; }
.blk .body > :first-child { margin-top: 0; } .blk .body > :last-child { margin-bottom: 0; }
.blk.k-li ul, .blk.k-li ol { margin: 0; padding-left: 20px; }
.blk.chk .body > ul { list-style: none; padding-left: 0; }
.blk.chk .body ul ul { list-style: disc; color: var(--muted); font-size: 14px; }
.blk.open { background: var(--hi); }
.blk.packed .body > ul > li > p:first-child, .blk.packed .body > ul > li { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--muted); }
.boxes { grid-column: 1; display: flex; gap: 4px; padding-top: 1px; }
.box { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; background: var(--card); }
.box input { width: 20px; height: 20px; margin: 0; accent-color: var(--ok); }
.box span:empty { display: none; }
.cbtn { grid-column: 3; min-width: 40px; padding: 2px 6px; color: var(--muted); opacity: .45; font-size: 13px; }
.cbtn.has, .blk.open .cbtn { opacity: 1; }
.cbtn.has { color: var(--accent); border-color: var(--accent); }
@media (hover: hover) { .blk:hover .cbtn { opacity: 1; } }
.thread { grid-column: 1 / -1; margin: 6px 0 4px; padding: 8px; border-left: 3px solid var(--accent); }
.c { margin-bottom: 10px; } .c.done { opacity: .55; }
.meta { font-size: 12px; color: var(--muted); }
.txt { white-space: pre-wrap; }
.acts { display: flex; gap: 6px; margin-top: 4px; } .acts button { font-size: 12px; padding: 3px 8px; }
.add { display: flex; flex-direction: column; gap: 6px; }
.c .add { margin-top: 4px; }
textarea { font: inherit; font-size: 16px; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--card); color: var(--fg); }
.orphan blockquote { margin: 0; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.login { max-width: 360px; margin: 12vh auto; display: flex; flex-direction: column; gap: 12px; }
.login label { display: flex; flex-direction: column; gap: 6px; }
.login input { font: inherit; font-size: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); }
.login button { padding: 12px; font-size: 16px; background: var(--accent); color: #fff; border: 0; }
.err { color: #dc2626; }

/* Each leg of the trip has a colour; pages, tabs, cards and embeds take it from data-theme. */
[data-theme] { --leg: var(--accent); }
[data-theme="departure"], [data-theme="seoul"] { --leg: #60a5fa; }
[data-theme="shenzhen"], [data-theme="hong"] { --leg: #2dd4bf; }
[data-theme="zhangjiajie"] { --leg: #4ade80; }
[data-theme="fenghuang"] { --leg: #fbbf24; }
[data-theme="chongqing"] { --leg: #f87171; }
[data-theme="chengdu"] { --leg: #c084fc; }
[data-theme="guide"] { --leg: #94a3b8; }

/* Light mode: chosen on the home page and kept on the device (each page's first script sets data-mode before anything
   is drawn). The same variables, lighter; the accent, the green and the leg colours darker, to read on a pale ground. */
:root[data-mode="light"] { color-scheme: light; --bg: #faf8f5; --fg: #1f1d1a; --muted: #6b665e; --line: #ddd8cf; --accent: #c2410c; --card: #ffffff; --hi: #fdebd8; --ok: #15803d; }
:root[data-mode="light"] [data-theme="departure"], :root[data-mode="light"] [data-theme="seoul"] { --leg: #2563eb; }
:root[data-mode="light"] [data-theme="shenzhen"], :root[data-mode="light"] [data-theme="hong"] { --leg: #0f766e; }
:root[data-mode="light"] [data-theme="zhangjiajie"] { --leg: #15803d; }
:root[data-mode="light"] [data-theme="fenghuang"] { --leg: #b45309; }
:root[data-mode="light"] [data-theme="chongqing"] { --leg: #dc2626; }
:root[data-mode="light"] [data-theme="chengdu"] { --leg: #9333ea; }
:root[data-mode="light"] [data-theme="guide"] { --leg: #475569; }
/* Text set on the accent, the green or a leg colour is dark in dark mode, where those are bright; here it is white. */
:root[data-mode="light"] .ochip.on, :root[data-mode="light"] .wxunit span.on, :root[data-mode="light"] .oconf.on,
:root[data-mode="light"] .card.today h3::after, :root[data-mode="light"] .card.today h3[data-split] .hdate::after { color: #fff; }
:root[data-mode="light"] .wxcr.wet { color: #2563eb; }
:root[data-mode="light"] .wxchip.cold { border-color: #0891b2; }
:root[data-mode="light"] .rwarn { color: #b45309; }
/* The map's own controls stay dark over the map, so their text stays light. */
:root[data-mode="light"] .tmap .mctl button, :root[data-mode="light"] .tmap .mfilter button { color: #ebe8e3; border-color: #2e2c29; }

.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
article[data-theme] h1 { border-left: 4px solid var(--leg); padding-left: 10px; }

/* Home: hero, timeline, tiles, reference chips. */
.hero { border-radius: 16px; padding: 14px; margin: 4px 0 8px; background: linear-gradient(160deg, color-mix(in srgb, var(--leg, var(--accent)) 22%, var(--card)), var(--card)); border: 1px solid var(--line); }
.hero .when { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--leg, var(--accent)); }
.hero .todaycard .card { background: transparent; border: 0; padding: 0; margin: 6px 0 0; }
/* Only the "Open the itinerary" link: a line with an open comment thread is also "open" (.blk.open). */
.hero > a.open { display: inline-block; margin-top: 10px; font-weight: 600; }
.timeline { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.timeline::-webkit-scrollbar { display: none; }
.leg { flex: 1 0 auto; min-width: 78px; text-decoration: none; border-top: 4px solid var(--leg); background: var(--card); border-radius: 8px; padding: 8px 8px 6px; }
.leg .t, .tile .t { display: block; color: var(--fg); font-weight: 600; font-size: 14px; }
.leg .s, .tile .s { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.tile { display: block; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.tile .ic { font-size: 22px; display: block; margin-bottom: 4px; }
.tile.pack { grid-column: 1 / -1; }
.tile .bar { display: block; height: 6px; border-radius: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.tile .bar span { display: block; height: 100%; background: var(--ok); }
.refs { display: flex; flex-wrap: wrap; gap: 6px; }
/* Home on the trip: two small tiles for what is opened every day, small labels over the rows of chips, and the
   packing list as one slim bar. */
.tile.qtile { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 6px; }
.tile.qtile .ic { margin-bottom: 0; }
.hlab { font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.packbar { display: flex; align-items: center; gap: 10px; margin-top: 10px; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14px; color: var(--fg); }
.packbar .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.packbar .bar span { display: block; height: 100%; background: var(--ok); }
.packbar small { color: var(--muted); white-space: nowrap; }
.ref { text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--leg, var(--line)); color: var(--fg); }

/* Tabs: one per leg or section, with its dates under the name. */
.tabbar { position: sticky; top: 49px; z-index: 1; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; margin: 4px 0 10px;
  background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar button { flex: none; border-radius: 10px; padding: 5px 12px; white-space: nowrap; color: var(--muted); border-top: 3px solid var(--leg, var(--line)); text-align: left; }
.tabbar button .l { display: block; font-weight: 600; color: var(--fg); }
.tabbar button .d { display: block; font-size: 11px; }
.tabbar button:not([data-theme]) .d:empty, .tabbar button .d:empty { display: none; }
.tabbar button.on { background: color-mix(in srgb, var(--leg, var(--accent)) 25%, var(--card)); border-color: var(--leg, var(--accent)); }
.progress ~ article .tabbar { top: 84px; }
section.tab > .blk.k-heading:first-child h2 { color: var(--leg); }
.tabfoot { display: flex; justify-content: space-between; gap: 8px; margin: 18px 0 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.tabfoot button { font-size: 13px; color: var(--muted); max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--leg, var(--line)); }

/* Day cards. */
.card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--leg, var(--accent)); border-radius: 12px; padding: 10px 10px 6px; margin: 0 0 12px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card.today { box-shadow: 0 0 0 2px var(--leg, var(--accent)); }
/* Days before today, on today's tab: folded to their heading until tapped. */
.card.past.shut > :not(.dayhead) { display: none; }
.card.past.shut { padding-bottom: 8px; opacity: .75; }
.card.past h3.dayfold { cursor: pointer; }
.card.past h3.dayfold::after { content: " ▾"; font-size: .8em; color: var(--muted); }
.card.past.shut h3.dayfold::after { content: " ▸"; }
/* Split day headings: a small date line over the title. Badges and fold arrows move onto the parts. */
.card h3[data-split] .hdate { display: block; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--leg, var(--muted)); margin-bottom: 1px; }
.card h3[data-split] .htitle { display: block; font-size: 17px; line-height: 1.3; }
.card.today h3[data-split]::after, .card.past h3.dayfold[data-split]::after, .card.past.shut h3.dayfold[data-split]::after { content: none; }
.card.past h3.dayfold[data-split] .htitle::after { content: " ▾"; font-size: .8em; color: var(--muted); }
.card.past.shut h3.dayfold[data-split] .htitle::after { content: " ▸"; }
.card.today h3[data-split] .hdate::after { content: "TODAY"; margin-left: 8px; font-size: 10px; letter-spacing: .06em; color: #111; background: var(--leg, var(--accent)); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
.card.today h3::after { content: "TODAY"; margin-left: 8px; font-size: 11px; letter-spacing: .06em; color: #111; background: var(--leg, var(--accent)); border-radius: 6px; padding: 1px 6px; vertical-align: 2px; }

/* A place opened in place: links that peek get a chevron; the embed takes the place's colour. */
a.peek { text-decoration: none; border-bottom: 1px dashed currentColor; }
a.peek::after { content: " ▾"; font-size: .8em; }
a.peek.peeked::after { content: " ▴"; }
.embed { margin: 4px 0 10px 8px; border: 1px solid var(--line); border-left: 3px solid var(--leg, var(--accent)); border-radius: 10px; background: var(--bg); overflow: hidden; }
.ehead { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; font-size: 12px; color: var(--muted); background: color-mix(in srgb, var(--leg, var(--accent)) 14%, var(--bg)); }
.ehead { align-items: center; }
/* "Open page" leaves this page, so it is a button, not one more underlined link among the ones that open in place. */
.ehead a { flex: none; font-weight: 600; color: var(--leg, var(--accent)); text-decoration: none; white-space: nowrap; padding: 2px 10px; border: 1px solid var(--leg, var(--accent)); border-radius: 12px; background: var(--card); }
.ebody { padding: 8px 10px 2px; }
.ebody h2 { font-size: 16px; margin: 0 0 6px; color: var(--leg, var(--accent)); }
.ebody .blk { margin-bottom: 6px; }

/* Folded details, the driver card, links back up. */
li.folds > ul, li.folds > ol { display: none; }
li.folds.open > ul, li.folds.open > ol { display: block; }
.more { font-size: 12px; padding: 1px 8px; margin: 2px 0 2px 6px; border-radius: 10px; color: var(--accent); border-color: var(--line); vertical-align: 1px; }
li.folds.open > .more { color: var(--muted); }
.place { white-space: normal; font-size: 13px; }
.place a { color: var(--muted); }
button.zh { font-size: 15px; padding: 1px 8px; border-color: var(--leg, var(--accent)); color: var(--fg); }
.zhcard { position: fixed; inset: 0; z-index: 10; background: #000; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.zhcard .big { font-size: min(18vw, 120px); line-height: 1.2; text-align: center; word-break: break-all; }
.zhcard .hint { margin-top: 24px; color: #888; font-size: 14px; }
/* A place on the page is one button, a pin and its Chinese name. A tap opens our map with the place's pin selected
   (travel times, the map apps, the name large for a driver); a place with no pin shows the name large here, with the
   map apps under it. The links stay out of the line (the export keeps them). */
.plinks { display: none; }
.printdoc .plinks { display: inline; }
button.zh::before { content: "📍 "; font-size: .8em; }
.zhcard .zlinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.zhcard .zlinks a { color: #fff; text-decoration: none; font-size: 16px; padding: 10px 16px; border: 1px solid #777; border-radius: 12px; }
/* In the options view an option's place is only the pin, after its name. */
.place.mini .zh { font-size: 0; padding: 2px 6px; margin-left: 6px; border-color: var(--line); vertical-align: 1px; }
.place.mini .zh::before { content: "📍"; font-size: 14px; }
.backlinks { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
h3 { font-size: 17px; margin: 18px 0 6px; }
blockquote { margin: 0; padding-left: 10px; border-left: 3px solid var(--accent); color: var(--muted); }
table { border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
td, th { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.net { font-size: 12px; color: var(--muted); }
.net.off { color: #fff; background: #b45309; border-radius: 10px; padding: 1px 8px; }
.c.pending .meta { color: var(--accent); }
.c .add { margin-top: 4px; }
.thread .cclose { align-self: flex-start; font-size: 13px; color: var(--muted); margin-top: 4px; }
.addacts { display: flex; gap: 8px; align-items: stretch; }
.addacts .cclose { margin-top: 0; align-self: auto; }
.addacts > .primary, .addacts > .ask-acts { flex: 1; }
/* Every line: its parts pinned to the first row, so the 💬 always sits top right beside the text (it had been
   dropping below it when a thread opened), and the thread opens on the row below. */
.blk > .boxes { grid-row: 1; grid-column: 1; }
.blk > .body { grid-row: 1; }
.blk > .cbtn { grid-row: 1; grid-column: 3; align-self: start; }
.blk > .thread { grid-row: 2; grid-column: 1 / -1; }
/* The text runs the full width, under the 💬 too: the button sits over the top-right corner, and a small float keeps
   just the first line clear of it. (The 💬 used to own a whole column down the right side.) */
.blk:not(.chk) > .body { grid-column: 1 / -1; }
.blk.chk > .body { grid-column: 2 / -1; }
.blk > .cbtn { justify-self: end; position: relative; z-index: 1; }
.blk > .body::before { content: ""; float: right; width: 46px; height: 24px; }
/* A place opened inside a list sits back at the list's left edge instead of under every level of indent. */
.blk .body > ul > li > .embed, .blk .body > ol > li > .embed { margin-left: -14px; }
.blk .body li li > .embed { margin-left: -34px; }
.blk .body li li li > .embed { margin-left: -54px; }
.embed { margin-right: 0; }
/* A heading's 💬 sits top right beside the heading, which wraps to leave it room; the thread opens below both. */
.blk.k-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.blk.k-heading > .body { grid-column: 1; grid-row: 1; }
.blk.k-heading > .cbtn { grid-column: 2; grid-row: 1; align-self: start; }
.blk.k-heading > .thread { grid-column: 1 / -1; grid-row: 2; }
.blk.k-heading > .body::before { content: none; }
/* Comment buttons show on lines with comments, or everywhere in comment mode. */
.cbtn { display: none; }
.cbtn.has, body.commenting .cbtn, .blk.open .cbtn { display: inline-block; }
#cmode { padding: 3px 8px; opacity: .6; }
#cmode.on { opacity: 1; border-color: var(--accent); background: var(--hi); }
/* A tab's own heading repeats its tab name, so it is hidden. */
section.tab > .blk.k-heading:first-child { display: none; }
.signout { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 28px; font-size: 13px; color: var(--muted); }
/* Light or dark, at the foot of home: a two-part button like the temperature unit's, with the one in use lit. */
.modesw { display: inline-flex; padding: 0; overflow: hidden; }
.modesw span { padding: 5px 9px; }
.modesw span.on { background: var(--accent); }
/* Beside Log out: a link to the app's own design notes, shown to developers only. */
.signbtns { display: flex; gap: 8px; align-items: center; }
.appdev { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--fg); text-decoration: none; font-size: 14px; }
/* A day's options: a quieter line whose items sit in a tinted panel when shown. */
li.options { color: var(--muted); font-style: italic; }
li.options > ul { font-style: normal; color: var(--fg); background: color-mix(in srgb, var(--leg, var(--accent)) 10%, transparent); border-radius: 8px; padding: 6px 8px 6px 24px; margin: 4px 0; }
li.options > ul > li { margin: 4px 0; }
/* Options: the card's button and picked slots, and the fullscreen table. */
.optbtn { border-color: var(--leg, var(--accent)); color: var(--leg, var(--accent)); font-weight: 600; margin: 2px 0 4px; }
.picked { margin: 4px 0 2px; }
.slot { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 3px 0; font-size: 13px; }
.slotname { color: var(--muted); min-width: 70px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.chip { background: color-mix(in srgb, var(--leg, var(--accent)) 22%, var(--card)); border-radius: 12px; padding: 2px 9px; }
.chip small { color: var(--muted); }
.chip.pending { outline: 1px dashed var(--accent); }
body.modal-open { overflow: hidden; }
.optmodal { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.ohead { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.otitle { font-weight: 700; }
.oclose { font-size: 16px; padding: 4px 12px; }
.otools { padding: 8px 14px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line); }
.otools input { font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); }
.ochips { display: flex; gap: 6px; overflow-x: auto; align-items: center; scrollbar-width: none; }
.olabel { font-size: 12px; color: var(--muted); min-width: 36px; }
.ochip { flex: none; border-radius: 14px; padding: 3px 10px; font-size: 13px; text-transform: capitalize; }
.ochip.on { background: var(--accent); color: #1a0f08; border-color: var(--accent); }
.otable { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
.otable table { display: table; width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.otable th { position: sticky; top: 0; background: var(--card); z-index: 1; cursor: pointer; white-space: nowrap; }
.otable th, .otable td { border: 0; border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; max-width: 260px; }
.otable td:nth-child(2) { font-weight: 600; position: sticky; left: 0; background: var(--bg); min-width: 120px; }
.otable tr.on td { background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
.ostar { width: 36px; text-align: center; }
.ostarbtn { border: 0; background: none; font-size: 20px; color: var(--accent); padding: 0 4px; }
.ocount { padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.otable td a[href^="/d/"] { text-decoration: none; border-bottom: 1px dashed currentColor; }
.otable td a[href^="/d/"]::after { content: " ▾"; font-size: .8em; }
.otable tr.odetail td { position: static; max-width: none; white-space: normal; padding: 0 8px 8px; background: var(--bg); }
.otable tr.odetail .embed { margin: 0; max-width: calc(100vw - 32px); position: sticky; left: 8px; }
/* Toasts sit above everything at the foot of the screen. */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30; background: #7f1d1d; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 14px; }

/* Options as stacked blocks: the name on its own line, details in a sideways-scrolling row, alternating shades. */
.osort { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); align-self: flex-start; }
.olist { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.oitem { border: 1px solid var(--line); border-left: 4px solid var(--leg, var(--accent)); border-radius: 10px; padding: 8px 10px; background: var(--card); }
.oitem:nth-child(even) { background: color-mix(in srgb, var(--leg, var(--accent)) 7%, var(--bg)); }
.oitem.on { box-shadow: 0 0 0 2px var(--leg, var(--accent)); }
.oname { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; }
.otext { flex: 1; min-width: 0; }
.oby { font-size: 12px; font-weight: 400; color: var(--muted); }
.ometa { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; padding-bottom: 2px; scrollbar-width: none; }
.ometa::-webkit-scrollbar { display: none; }
.ocell { flex: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; background: var(--bg); }
.ocell.wide { flex: 0 0 auto; max-width: 240px; }
.olab { display: block; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.oval { display: block; font-size: 13px; white-space: nowrap; }
.ocell.wide .oval { white-space: normal; }
.oname a[href^="/d/"] { text-decoration: none; border-bottom: 1px dashed currentColor; }
.oname a[href^="/d/"]::after { content: " ▾"; font-size: .8em; }
.oitem > .embed { margin: 8px 0 0; }

/* Home: the offline copy and export. */
.offline { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 24px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; color: var(--muted); }
.offline .acts { display: flex; gap: 8px; align-items: center; }
.export { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--accent); text-decoration: none; font-size: 14px; }

/* The export: readable on screen, clean on paper. */
.p-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.p-cover { margin-bottom: 18px; }
.p-toc { color: var(--muted); font-size: 13px; }
.p-doc { border-top: 3px solid var(--leg, var(--line)); padding-top: 10px; margin-top: 24px; }
.p-doc button.zh { border: 0; padding: 0; font-size: inherit; }
.p-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 8px; }
.p-opts table { display: table; width: 100%; font-size: 12px; }
.p-picked { font-weight: 600; }
.p-chk { display: flex; gap: 8px; align-items: baseline; }
.p-chk ul { margin: 0; padding-left: 16px; }
.p-marks { flex: none; font-size: 13px; }
.p-box { margin-right: 6px; }
@media print {
  :root { color-scheme: light; --bg: #fff; --fg: #111; --muted: #555; --line: #ccc; --card: #fff; --hi: #fff; }
  header, .p-bar, .backlinks { display: none !important; }
  body { background: #fff; color: #111; font-size: 11pt; }
  main { max-width: none; padding: 0; }
  a { color: #111; }
  .p-doc { break-before: page; }
  .p-doc h3, .p-opts tr, .p-chk, li { break-inside: avoid; }
  .p-doc h2, .p-doc h3 { break-after: avoid; }
}
/* A view-only reader sees no comment, tick or pick controls. */
body.viewonly .cbtn, body.viewonly #cmode, body.viewonly .ostarbtn, body.viewonly .thread .add, body.viewonly .acts { display: none !important; }
body.viewonly .box { pointer-events: none; opacity: .7; }

/* Options grid: labels once and pinned on top, names pinned left at full width, details aligned in shared columns. */
.olist { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 0 0 10px; display: block; }
.ogrid { display: grid; width: max-content; min-width: 100%; }
.ohcell { position: sticky; top: 0; z-index: 2; background: var(--card); border-bottom: 2px solid var(--leg, var(--accent)); padding: 6px 8px;
  font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ofull { grid-column: 1 / -1; }
.opin { position: sticky; left: 0; width: min(100vw, 100%); max-width: 100vw; box-sizing: border-box; padding: 8px 10px 2px; display: flex; align-items: center; gap: 8px; }
.oname { border-top: 1px solid var(--line); background: var(--bg); }
.oname .opin { font-weight: 600; font-size: 16px; }
.oname.alt, .ocell.alt { background: color-mix(in srgb, var(--leg, var(--accent)) 8%, var(--bg)); }
.oname.on .opin { border-left: 4px solid var(--leg, var(--accent)); }
.ocell { padding: 4px 8px 10px; font-size: 13px; background: var(--bg); overflow-wrap: anywhere; }
.ocell.on { box-shadow: inset 0 -2px 0 var(--leg, var(--accent)); }
.oname a[href^="/d/"] { text-decoration: none; border-bottom: 1px dashed currentColor; }
.oname a[href^="/d/"]::after { content: " ▾"; font-size: .8em; }
.odetail .opin { display: block; padding-top: 0; }
.odetail .embed { margin: 0 0 8px; }
.ofull.oname { display: block; }
.ogrid .ocell { border: 0; border-radius: 0; border-right: 1px solid var(--line); }
.zhcard { z-index: 50; }
/* Confirmed options: part of the plan, shown first and solid; the rest are tucked away. */
.slot.confirmed .slotname { color: var(--ok); }
.chip.done { background: color-mix(in srgb, var(--ok) 25%, var(--card)); font-weight: 600; }
.oconf { margin-left: auto; font-size: 12px; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.oconf.on { background: var(--ok); border-color: var(--ok); color: #0b1f12; font-weight: 600; }
.ohide { border-style: dashed; }
body.viewonly .oconf { display: none !important; }
/* Confirmed options on the day card: a line each, expanding in place to the details and the place section. */
.confirmed { margin: 6px 0 4px; }
.confirmed > .slotname { color: var(--ok); margin-bottom: 4px; }
.citem { border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--line)); border-radius: 10px; margin: 0 0 6px; overflow: hidden; }
.citem.pending { border-style: dashed; }
.chead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; width: 100%; border: 0; border-radius: 0; text-align: left;
  background: color-mix(in srgb, var(--ok) 16%, var(--card)); padding: 8px 10px; }
.cname { font-weight: 600; font-size: 15px; }
.cname::after { content: " ▾"; font-size: .8em; color: var(--muted); }
.chead.open .cname::after { content: " ▴"; }
.cbrief { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cbody { padding: 8px 10px 4px; }
.cmeta { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin-bottom: 8px; font-size: 13px; }
.crow { display: contents; }
.crow .olab { padding-top: 2px; }
.cbody .embed { margin: 4px 0 6px; }
/* Comments: always offered on headings (ask about a day or a place); per option in the options view. */
.blk.k-heading .cbtn { display: inline-block; }
.ocmt { font-size: 12px; padding: 2px 8px; border-radius: 12px; color: var(--muted); }
.ocmt.has { color: var(--accent); border-color: var(--accent); }
.othread .opin { display: block; padding: 4px 10px 10px; border-left: 3px solid var(--accent); background: var(--hi); }
.othread .c { margin: 4px 0 8px; }
body.viewonly .ocmt, body.viewonly .othread form { display: none !important; }
/* Omitted options: ruled out by the group. Hidden until "Show omitted"; then dimmed, with a way back. */
.oomit { font-size: 12px; padding: 2px 8px; border-radius: 12px; color: var(--muted); white-space: nowrap; }
.oname.omitted .otext, .ocell.omitted { opacity: .45; }
.oname.omitted .otext { text-decoration: line-through; }
.oname.omitted .ostarbtn, .oname.omitted .oconf { display: none; }
body.viewonly .oomit { display: none !important; }
/* Options planned on another day of the stay: hidden until "Show planned elsewhere"; then their details are dimmed, and
   a line under the name says which day, in green once confirmed there. */
.oaway { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.oaway.conf { color: var(--ok); }
.ocell.away { opacity: .55; }
/* Reach, at the start of the filters row: two small drop-downs (where to measure from, and which options to show),
   then a chip for the phone's last look. The drop-down is edged in the accent while it is narrowing the list; the
   chip's place name is cut short, and it blinks green when the phone has just looked. */
.oreach { flex: none; font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--fg); max-width: 170px; }
.oreach.on { border-color: var(--accent); color: var(--accent); }
.ofrom { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; }
/* The phone's last look sits at the foot of the view, beside the counts. */
.ocount { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ocount .ofrom { font-size: 12px; padding: 2px 8px; max-width: 58%; }
.ofrom.flash { animation: ofix 1.4s ease-out; }
@keyframes ofix { from { background: var(--ok); border-color: var(--ok); color: #0b1f12; } }
/* Priority: a person's flag on an option, tied to no day. The ❗ is faint until it is yours; a line under the name
   says who has flagged it. */
.oprio { flex: none; border: 0; background: none; padding: 0 2px; font-size: 15px; line-height: 1; opacity: .3; filter: grayscale(1); }
.oprio.on { opacity: 1; filter: none; }
.oaway.prio { color: var(--accent); font-weight: 600; }
.oname.omitted .oprio, body.viewonly .oprio { display: none !important; }

/* Locations: every place, one city at a time. On top, the city drop-down with the city's guide and its Getting around
   section beside it; then find and sort. A place is two lines, its name and its Chinese name; a tap opens its notes
   underneath, and the pin beside it goes to our map. The ones that need a pin come first, with a button that opens
   a box for what Amap says. */
.locs h1 { margin-bottom: 8px; }
.ltop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.lsel { flex: none; max-width: 100%; font: inherit; font-size: 15px; font-weight: 700; padding: 6px 8px; border-radius: 16px; border: 1px solid var(--leg, var(--accent)); background: color-mix(in srgb, var(--leg, var(--accent)) 18%, var(--card)); color: var(--fg); margin-right: auto; }
.lbtns { display: flex; gap: 6px; flex: none; }
/* A day's hotel button, beside the date on the day's heading. */
.hotelbtns { display: inline-flex; gap: 6px; margin-left: 8px; vertical-align: middle; }
.hotelbtn { font-size: 12px; font-weight: 600; line-height: 1.3; padding: 1px 8px; border: 1px solid var(--leg, var(--accent)); border-radius: 12px; text-decoration: none; color: var(--leg, var(--accent)); white-space: nowrap; }
/* A confirmed item on the day card: its name on a line of its own, its details under it, so a long name isn't
   squeezed into a narrow column beside them. */
.picked .confirmed .citem .chead { display: flex; flex-direction: column; align-items: stretch; gap: 2px; text-align: left; }
.picked .confirmed .citem .chead .cname { flex: none; width: auto; max-width: none; white-space: normal; }
.picked .confirmed .citem .chead .cbrief { flex: none; width: auto; max-width: none; white-space: normal; text-align: left; margin: 0; }
/* Home: Map and Locations now lead the page, so they sit tight under the header (their top margin was for their old
   place lower down) with a little room before today's card. */
main > .tiles.quick:first-child { margin-top: 0; margin-bottom: 12px; }
/* Comments on the day card. The options box no longer has a comment button of its own (the day's heading has one,
   and it said the same thing); one already holding comments keeps it. Each confirmed item gets its own 💬 instead,
   in comment mode and whenever it has comments. */
.card .blk.k-options > .cbtn:not(.has), .todaycard .blk.k-options > .cbtn:not(.has) { display: none !important; }
.picked .citem { position: relative; }
.picked .citem .ccmt { display: none; position: absolute; right: 6px; top: 6px; font-size: 13px; padding: 2px 8px; border-radius: 10px; background: rgba(0,0,0,.35); border: 1px solid var(--line); color: var(--fg); cursor: pointer; }
body.commenting .picked .citem .ccmt, .picked .citem .ccmt.has { display: block; }
body.commenting .picked .confirmed .citem .chead, .picked .citem:has(> .ccmt.has) .chead { padding-right: 52px; }
/* A confirmed item's third line: the start of its notes, two lines at most. */
.picked .confirmed .citem .chead .cnote { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; line-height: 1.35; color: var(--muted); white-space: normal; text-align: left; }
.picked .confirmed .citem .chead.open .cnote { display: none; }
/* The day card's three parts of the day: a small heading each, what is confirmed, an "Open" line when nothing is,
   and the favorites that suit that time. */
.picked .daysec { margin-top: 8px; }
.picked .dayname { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--leg, var(--accent)); margin-bottom: 4px; }
.picked .citem.cont { opacity: .6; }
.picked .dayopen { display: block; width: 100%; text-align: left; font: inherit; font-size: 13.5px; color: var(--muted); background: none; border: 1px dashed var(--line); border-radius: 10px; padding: 6px 10px; cursor: pointer; }
.picked .slot.favs { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 4px; }
.picked .chip.fav { font: inherit; font-size: 13px; cursor: pointer; border: 0; }
/* Options view: the ✓ on the left of each option; lit once it is confirmed. */
.ostarbtn.ocheck { opacity: .4; font-weight: 700; }
.ostarbtn.ocheck.on { opacity: 1; color: var(--ok); }
/* Options view: the "When?" choice shown when something is confirmed from Any time. */
.owhen { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-left: 6px; }
.owhen .olab { font-size: 12px; color: var(--muted); }
/* The About button beside the city drop-down; the city's own notes stay out of sight until it opens them. */
button.lguide { background: none; font-family: inherit; line-height: inherit; cursor: pointer; }
button.lguide.on { background: var(--leg, var(--accent)); color: #fff; }
.locs .lcity .lplace.about:not(.open) { display: none; }
.lguide { font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; color: var(--leg, var(--accent)); padding: 4px 10px; border: 1px solid var(--leg, var(--accent)); border-radius: 12px; }
.lfind { display: flex; gap: 6px; margin-bottom: 4px; }
.lsearch { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); }
.lsort { flex: none; font: inherit; font-size: 14px; padding: 6px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); }
.lwait { font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 6px; }
.lcity[hidden], .lsub[hidden], .lwait[hidden] { display: none; }
.lcname { display: none; font-size: 15px; margin: 14px 0 0; color: var(--leg, var(--fg)); }
.locs.finding .lcname { display: block; }
.lsub { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 12px 0 0; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.lsub.need { color: var(--accent); }
.card.lplace { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; margin: 0; }
.card.lplace[hidden] { display: none; }
.lh { display: none; }
.lrow { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; padding: 8px 0; }
.ltx { flex: 1; min-width: 0; text-align: left; border: 0; border-radius: 0; background: none; padding: 0; color: var(--fg); }
.ln { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln::after { content: " ▸"; font-size: .8em; color: var(--muted); }
.lplace.open .ln { white-space: normal; }
.lplace.open .ln::after { content: " ▾"; }
.lplace.about .ln { color: var(--leg, var(--accent)); }
.lz { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ldist { flex: none; font-size: 13px; color: var(--muted); }
.lmap { flex: none; text-decoration: none; font-size: 15px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.ldet { border-left: 3px solid var(--leg, var(--accent)); background: var(--card); border-radius: 0 10px 10px 0; padding: 8px 10px 2px; margin: 0 0 8px; font-size: 14px; }
.ldet[hidden] { display: none; }
.ldet .blk { display: block; margin: 0 0 6px; }
.ldet .blk .body::before { content: none; }
.ldet ul, .ldet ol { margin: 0; padding-left: 18px; }
.ldet h2, .ldet h3 { font-size: 14px; margin: 8px 0 4px; color: var(--leg, var(--fg)); }
.luses { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
/* A place's notes opened from a link on another page (nav.js lifts the place's card out of this one): only the notes show. */
.ebody .lrow, .ebody .lh { display: none; }
.ebody .ldet, .ebody .ldet[hidden] { display: block; border: 0; background: none; padding: 0; margin: 0; }
.lpinbtn { flex: none; font-size: 13px; padding: 4px 10px; border-radius: 12px; border-color: var(--accent); color: var(--accent); background: none; }
.lpinbtn.quiet { border-color: var(--line); color: var(--muted); }
.ledit { flex: 0 0 100%; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.lacts { display: flex; gap: 8px; align-items: center; }
.lamap { font-size: 13px; text-decoration: none; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); }
.lacts .primary:disabled { opacity: .45; }
.lmeta { font-size: 12px; color: var(--muted); }
.lreply { font-size: 13px; border-left: 3px solid var(--accent); padding-left: 8px; }
.lnone { color: var(--muted); font-size: 14px; }

.helpbody { padding: 10px 14px; }
.helpbody section.tab { margin-bottom: 18px; }
.helpbody section.tab > .blk.k-heading:first-child { display: block; }
/* Home's offline row: the buttons sit right, with Connect AI at the far right. */
.offline .acts { margin-left: auto; }
#connectai { order: 3; border-color: var(--accent); color: var(--accent); }
/* Forecast chips on each day: rain-heavy days in blue, near-freezing ones in ice. */
.wx { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 2px 0 6px; }
.wxchip { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.wxchip.wet { border-color: #60a5fa; background: color-mix(in srgb, #60a5fa 14%, var(--bg)); }
.wxchip.cold { border-color: #a5f3fc; }
.wxage { font-size: 11px; color: var(--muted); }
button.wxage { border: 0; background: none; padding: 2px 4px; cursor: pointer; }
/* The weather guide's live forecast: Today card, then days grouped by leg with temperature and rain bars. */
.wxlive { margin: 4px 0 18px; }
.wxlivehead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.wxlivehead strong { font-size: 17px; }
.wxsp { flex: 1; }
.wxtoday { border-radius: 16px; padding: 12px; margin-bottom: 14px; border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--leg, var(--accent)) 24%, var(--card)), var(--card)); }
.wxtodayhead { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--leg, var(--accent)); margin-bottom: 6px; }
.wxbig { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.wxbigicon { font-size: 38px; line-height: 1; }
.wxbigname { font-weight: 600; }
.wxbigtemp { font-size: 22px; font-weight: 700; }
.wxtips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wxtip { font-size: 13px; padding: 3px 10px; border-radius: 12px; background: color-mix(in srgb, var(--bg) 60%, transparent); border: 1px solid var(--line); }
.wxleg { margin: 0 0 12px; }
.wxleghead { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--leg, var(--accent)); margin: 0 0 6px 2px; }
.wxdaycard { border: 1px solid var(--line); border-left: 4px solid var(--leg, var(--accent)); border-radius: 10px; background: var(--card); padding: 8px 10px; margin-bottom: 6px; }
.wxdaycard.today { box-shadow: 0 0 0 2px var(--leg, var(--accent)); }
.wxdayhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.wxdaylabel { font-weight: 600; font-size: 14px; }
.wxdaytips { font-size: 15px; letter-spacing: 2px; }
.wxline { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; }
.wxwho { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.wxicon { font-size: 16px; }
.wxname { font-weight: 600; white-space: nowrap; }
.wxwords { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wxtemp, .wxrain { display: flex; align-items: center; gap: 5px; }
.wxlo, .wxhi { font-variant-numeric: tabular-nums; min-width: 26px; }
.wxlo { color: var(--muted); text-align: right; }
.wxtrack, .wxrtrack { position: relative; flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.wxfill { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.wxrfill { display: block; height: 100%; background: #60a5fa; border-radius: 3px; }
.wxdrop { font-size: 11px; }
.wxpct { min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.wxpast { margin-bottom: 12px; }
.wxpast > summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.wxpast[open] .wxdaycard { opacity: .7; }
.wxnote { font-size: 12px; color: var(--muted); margin-top: 6px; }
/* Day cards: the chips are one button that opens the by-time table. */
button.wxsum { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border: 0; background: none; padding: 0; margin: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.wxcaret { font-size: 12px; color: var(--muted); padding: 0 4px; }
.wxmore { flex-basis: 100%; margin-top: 4px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.wxfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
a.wxfull { font-size: 13px; font-weight: 600; text-decoration: none; padding: 3px 10px; border-radius: 12px; border: 1px solid var(--leg, var(--accent)); color: var(--leg, var(--accent)); }
table.wxtable { display: table; width: 100%; border-collapse: collapse; font-size: 13px; margin: 2px 0; }
.wxtable th, .wxtable td { border: 0; border-bottom: 1px solid var(--line); padding: 4px 4px; text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wxtable thead th { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.wxtable tbody th { font-size: 12px; color: var(--muted); font-weight: 500; width: 1%; padding-right: 8px; }
.wxtable tbody tr:last-child th, .wxtable tbody tr:last-child td { border-bottom: 0; }
.wxci { margin-right: 4px; }
.wxct { font-weight: 600; margin-right: 6px; }
.wxcr { color: var(--muted); font-size: 12px; }
.wxcr.wet { color: #60a5fa; font-weight: 600; }
.wxtable tr.now th, .wxtable tr.now td { background: color-mix(in srgb, var(--leg, var(--accent)) 16%, transparent); }
.wxtable tr.now th { color: var(--leg, var(--accent)); font-weight: 700; }
.wxtable tr.gone { opacity: .45; }
.wxnohour { font-size: 13px; color: var(--muted); padding: 4px 0; }
.wxtoday .wxtable { margin-top: 10px; }
button.wxbytime { font-size: 12px; padding: 2px 8px; border-radius: 10px; margin-left: 8px; color: var(--muted); }
.wxdayhead .wxdaytips { margin-left: auto; }
.wxdaycard .wxtable { margin-top: 6px; }
.wxdaycard.flash { animation: wxflash 1.6s ease-out; scroll-margin-top: 70px; }
.wxtoday { scroll-margin-top: 70px; }
/* Second opinion: invisible unless another model disagrees, then an amber dot and a quiet grey line. */
.wxdis { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; margin-left: 5px; vertical-align: middle; }
.wxalt { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.2; }
.wxtable td.dis .wxct { text-decoration: underline dotted #f59e0b; text-underline-offset: 3px; }
.wxaltnote { font-size: 11px; color: var(--muted); margin-top: 2px; }
.wxaltnote::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; margin-right: 5px; vertical-align: middle; }
.wxaltline { font-size: 11.5px; color: var(--muted); margin: -2px 0 4px; }
.wxaltline::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; margin-right: 5px; vertical-align: middle; }
@keyframes wxflash { from { box-shadow: 0 0 0 3px var(--leg, var(--accent)); } to { box-shadow: 0 0 0 0 transparent; } }
@media (max-width: 420px) {
  .wxline { grid-template-columns: 1fr 1fr; }
  .wxwho { grid-column: 1 / -1; }
}
/* Table cells wrap between words, never mid-word; a wide table scrolls sideways instead. */
.blk .body td, .blk .body th { overflow-wrap: normal; }
/* The weather overview on a phone: one small card per stop. Name on top; days, temperatures and rain on one line; the gist below.
   Only the page's own written table (inside a line of the page): the live forecast's by-time table on the same page
   stays a table, the same one the day cards show. */
@media (max-width: 640px) {
  article[data-slug="guides/weather"] .blk table { display: block; overflow: visible; }
  article[data-slug="guides/weather"] .blk thead { display: none; }
  article[data-slug="guides/weather"] .blk tbody { display: grid; gap: 8px; }
  article[data-slug="guides/weather"] .blk tr { display: grid; grid-template-columns: auto auto 1fr; gap: 2px 12px; padding: 8px 10px;
    border: 1px solid var(--line); border-left: 3px solid var(--leg, var(--accent)); border-radius: 10px; background: var(--card); }
  article[data-slug="guides/weather"] .blk td { border: 0; padding: 0; }
  article[data-slug="guides/weather"] .blk td:nth-child(1) { grid-column: 1 / -1; font-weight: 600; font-size: 15px; }
  article[data-slug="guides/weather"] .blk td:nth-child(2), article[data-slug="guides/weather"] .blk td:nth-child(3) { white-space: nowrap; color: var(--muted); }
  article[data-slug="guides/weather"] .blk td:nth-child(4) { color: var(--muted); }
  article[data-slug="guides/weather"] .blk td:nth-child(5) { grid-column: 1 / -1; margin-top: 2px; }
}
/* The by-time table on the forecast page sits in the same panel as on a day card (.wxmore). */
.wxdaycard .wxmore, .wxtoday .wxmore { margin-top: 8px; }
.wxdaycard .wxmore .wxtable, .wxtoday .wxmore .wxtable { margin-top: 2px; }
/* A place's note takes comments like a line of any page: its 💬 sits at its top right corner (in comment mode, or
   once it has comments) and its thread opens under it. The first line keeps clear of the button only while it shows. */
.ldet .blk.k-note { display: grid; }
body.commenting .ldet .blk.k-note > .body::before, .ldet .blk.k-note.open > .body::before, .ldet .blk.k-note:has(> .cbtn.has) > .body::before { content: ""; }
.ldet .blk.k-note > .thread { font-size: 14px; }
.lrow > .badge.lsaid { flex: none; }
/* Options sections: Morning, Afternoon, Evening, each folding open or shut. */
.osec { background: color-mix(in srgb, var(--leg, var(--accent)) 16%, var(--card)); border-top: 1px solid var(--line); }
.osec .opin { padding: 0; }
.osecbtn { width: 100%; text-align: left; border: 0; border-radius: 0; background: none; padding: 9px 10px; font-weight: 700; font-size: 13px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--leg, var(--accent)); }
.osecbtn::before { content: "▾ "; }
.osec.shut .osecbtn::before { content: "▸ "; }
/* The heading in parts, so it reads at a glance: the time of day in capitals; where it is spent and a count in quiet
   type beside it; and under them a line for each thing already confirmed for that time, with its start and length. */
.osecbtn { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; letter-spacing: 0; text-transform: none; }
.osname { letter-spacing: .05em; text-transform: uppercase; }
.oswhere, .oscount { font-size: 12px; font-weight: 500; color: var(--muted); }
.oscount { margin-left: auto; }
.osheld { flex-basis: 100%; padding-left: 15px; font-size: 14px; font-weight: 600; color: var(--ok); }
.osheld small { font-size: 12px; font-weight: 400; color: var(--muted); }
/* Food inside a time of day: its own fold, a step in from the section. Train meals carry a Train tag and a rail-blue tint. */
.osub { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--leg, var(--accent)) 7%, var(--card)); }
.osub .opin { padding: 0 0 0 14px; }
.osubbtn { width: 100%; text-align: left; border: 0; border-radius: 0; background: none; padding: 7px 10px; font-weight: 600; font-size: 13px; color: var(--fg); }
.osubbtn::before { content: "▾ "; color: var(--muted); }
.osub.shut .osubbtn::before { content: "▸ "; }
.oname.food .opin { padding-left: 24px; }
.otag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; border-radius: 8px; padding: 1px 7px; margin-right: 6px; vertical-align: 2px; }
.otag.train { color: #0b1a24; background: #38bdf8; }
.oname.train { background: color-mix(in srgb, #38bdf8 13%, var(--bg)); }
.oname.train .opin { border-left: 4px solid #38bdf8; }
.ocell.train { background: color-mix(in srgb, #38bdf8 8%, var(--bg)); }
.wxunit { display: inline-flex; padding: 0; overflow: hidden; }
.wxunit span { padding: 6px 9px; color: var(--muted); }
.wxunit span.on { background: var(--accent); color: #1a0f08; font-weight: 600; }
/* Routes (@route): the stops on one line, then a Google Maps link for the whole route and an Amap link per leg. */
.route { display: block; margin: 4px 0 6px; padding: 8px 10px; border: 1px solid var(--line); border-left: 3px solid var(--leg, var(--accent)); border-radius: 10px; background: var(--bg); }
.rstops { display: block; font-weight: 600; font-size: 14px; }
.rdist { display: block; font-size: 12px; color: var(--muted); }
.rwarn { display: block; font-size: 12px; color: #f59e0b; }
.rbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
a.rbtn { font-size: 13px; text-decoration: none; padding: 3px 10px; border-radius: 12px; border: 1px solid var(--line); color: var(--fg); background: var(--card); }
a.rbtn.google { border-color: var(--leg, var(--accent)); color: var(--leg, var(--accent)); font-weight: 600; }
/* Folding sub-sections (#### headings, e.g. the legs of a walk): a tappable line with an arrow. */
.blk.subfold h4 { cursor: pointer; margin: 6px 0; font-size: 16px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--leg, var(--accent)) 12%, var(--card)); }
.blk.subfold h4::before { content: "▾ "; color: var(--leg, var(--accent)); }
.blk.subfold.shut h4::before { content: "▸ "; }
.subhid { display: none !important; }
/* A table takes the whole width; its 💬 sits just under it, on the right, instead of beside it. */
.blk.k-table > .body::before { content: none; }
.blk.k-table > .cbtn { grid-row: 2; margin-top: 2px; }
.blk.k-table > .thread { grid-row: 3; }
/* Step tables (a first column headed "#"): full width, the step number narrow. */
.blk .body table.steps { display: table; width: 100%; table-layout: auto; }
.blk .body table.steps th:first-child, .blk .body table.steps td:first-child { width: 1.6em; text-align: center; color: var(--muted); }
.blk .body table.steps td:nth-child(3), .blk .body table.steps th:nth-child(3) { width: 38%; }
/* Adding a file under Reference. */
.addfile { cursor: pointer; border-style: dashed; color: var(--accent); font: inherit; font-size: 14px; }
.addfilemsg { margin-top: 6px; font-size: 13px; color: var(--muted); }
body.viewonly .addfile { display: none !important; }
/* The way home: a 🏠 at the left of the site's header, before the title, on every page (the map included, which has
   nothing else above it). It takes the place of the old row of links above each page's headline. It is no taller
   than the 💬 button, so the header keeps its height (the tabs stick right under it). Home itself doesn't show it. */
.homebtn { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 29px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); text-decoration: none; font-size: 16px; line-height: 1; }
header .brand { margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header .who { flex: none; }
body:has(main > .hero) header .homebtn { display: none; }
/* The header says the page's name beside the 🏠, so a page's own headline isn't shown again under it. It is still in
   the page, and shows when it holds open comments, so none are lost from view. */
article > .intro > .blk.k-heading:has(h1):not(:has(> .cbtn.has)):not(.open) { display: none; }
.homebtn.txt { font-size: 13px; font-weight: 600; padding: 0 10px; }
.htop, .blk.k-heading > .body:has(> .homebtn) { display: flex; align-items: center; gap: 10px; }
.htop { margin: 4px 0 8px; }
.htop h1, .blk.k-heading > .body:has(> .homebtn) h1 { margin: 0; flex: 1; min-width: 0; }
/* A help page shown in a pop-up on home is already home. */
.helpbody .homebtn, .helpbody .htop { display: none; }
/* Home's row of what is opened every day is three across now: Map, Locations, Options. */
.tiles.quick { grid-template-columns: 1fr 1fr 1fr; }
.tiles.quick .qtile { gap: 5px; padding: 10px 4px; flex-wrap: wrap; }
.tiles.quick .qtile .ic { font-size: 18px; }
.tiles.quick .qtile .t { font-size: 13.5px; }
/* The Options page. On top, the city and the day, as drop-downs. "All days" is the stay's plan, a card per day with
   what is confirmed for each time of day, then the search and every option not planned yet; an option's ✓ opens the
   line that asks which day and when. */
.optpage .ltop { margin-bottom: 10px; }
.optpage .lsel { margin-right: 0; }
.opday { flex: 0 1 auto; min-width: 0; max-width: 100%; font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--fg); }
.opdayc { border: 1px solid var(--line); border-left: 4px solid var(--leg, var(--accent)); border-radius: 12px; background: var(--card); padding: 8px 10px; margin: 0 0 8px; cursor: pointer; }
.opdayc.today { box-shadow: 0 0 0 2px var(--leg, var(--accent)); }
.opdh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--leg, var(--accent)); }
.opdn { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.opt { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 3px 8px; margin-top: 5px; font-size: 14px; }
.opt i { font-style: normal; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding-top: 3px; }
.opok { color: var(--ok); font-weight: 600; }
.opok .opcont { opacity: .6; }
.opno { color: var(--muted); font-size: 13.5px; }
.opdayc > .opno { margin-top: 4px; }
.opfind { display: block; width: 100%; margin: 12px 0 0; font: inherit; font-size: 16px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); }
.oprow { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.oprow.asking { background: var(--hi); margin: 0 -16px; padding: 8px 16px; border-bottom: 0; }
.opname { flex: 1; min-width: 0; text-align: left; border: 0; border-radius: 0; background: none; padding: 0; color: var(--fg); }
.opname b { display: block; font-size: 15px; font-weight: 600; }
.opname b::after { content: " ▸"; font-size: .8em; color: var(--muted); font-weight: 400; }
.opname.open b::after { content: " ▾"; }
.opname span { display: block; font-size: 12.5px; color: var(--muted); }
.opask { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--hi); margin: 0 -16px; padding: 2px 16px 10px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.opask .oreach { max-width: none; }
.opask .primary { background: var(--ok); color: #0b1f12; font-weight: 700; }
.opdet { border-left: 3px solid var(--leg, var(--accent)); background: var(--card); border-radius: 0 10px 10px 0; padding: 8px 10px 2px; margin: 6px 0 8px; }
.opdet .embed { margin: 4px 0 8px; }
/* One day on the Options page: the day's options by time of day, drawn into the page (it used to be a pop-up over
   the itinerary). The list runs the width of the screen and scrolls sideways by itself. */
.optview .otools { padding: 0 0 8px; border-bottom: 0; }
.optview .olist { margin: 0 -16px; padding-bottom: 0; }
.optview .ohcell { position: static; }
.optview .opin { width: min(var(--ow, 100vw), 100%); max-width: var(--ow, 100vw); }
.optview .ocount { padding: 8px 0; }
/* On a place: its options, each a way to the Options page; one that is planned says where. */
.lplans { margin: 0 0 6px; }
a.lplan { display: inline-block; margin: 2px 6px 2px 0; font-size: 13px; font-weight: 600; text-decoration: none; padding: 3px 10px; border: 1px solid var(--leg, var(--accent)); border-radius: 12px; color: var(--leg, var(--accent)); }
a.lplan.done { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); color: var(--ok); }
body.viewonly a.lplan:not(.done) { display: none; }
/* Under a tapped "Plan this": which day, what time, Confirm. */
.lask { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.lask .oreach { max-width: none; }
.lask .primary { background: var(--ok); color: #0b1f12; font-weight: 700; }
/* A day's hour-by-hour plan (nav.js timeline): a line that starts with a time is a row, the time in its own column,
   then its title with small tags, a quiet note under it, and its detail out of sight until the row is tapped. */
.blk.k-li.tl { margin: 0; padding: 0; border-top: 1px solid var(--line); border-radius: 0; }
.blk.k-li.tl > .body > ul, .blk.k-li.tl > .body > ol { list-style: none; padding-left: 0; }
.blk.k-li.tl > .body::before { content: none; }
.tlrow { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; column-gap: 10px; padding: 9px 0; }
.tlrow:focus-visible { outline: 2px solid var(--leg, var(--accent)); outline-offset: -2px; border-radius: 6px; }
.tltime { font-size: 14px; font-weight: 700; line-height: 22px; font-variant-numeric: tabular-nums; color: var(--leg, var(--accent)); }
.tlhead { font-size: 16px; line-height: 22px; }
.tlhead strong { font-weight: 600; }
.tlhead.plain { font-size: 15px; }
/* The title takes the room on the left; its tags sit at the row's right edge, level with the title's first line. */
.tlhead:not(.plain) { display: flex; align-items: baseline; gap: 6px; }
.tlhead:not(.plain) > strong { flex: 1; min-width: 0; }
.tlhead:not(.plain) > code.tlk { flex: none; vertical-align: baseline; }
.tlfold > .tlrow { cursor: pointer; }
/* A row with more to it has a small arrow at its right edge. */
.tlrow::after { content: ""; grid-column: 3; grid-row: 1; width: 10px; font-size: 12px; line-height: 22px; color: var(--muted); text-align: center; }
.tlfold > .tlrow::after { content: "▾"; }
.tlfold.open > .tlrow::after { content: "▴"; }
code.tlk { display: inline-block; font: 600 11px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; padding: 0 7px; border-radius: 9px; vertical-align: 2px; white-space: nowrap;
  background: color-mix(in srgb, var(--k, #94a3b8) 20%, var(--card)); color: color-mix(in srgb, var(--k, #94a3b8) 72%, var(--fg)); }
.tlk[data-k="air"] { --k: #a78bfa; } .tlk[data-k="ride"] { --k: #60a5fa; } .tlk[data-k="see"] { --k: #4ade80; } .tlk[data-k="eat"] { --k: #fbbf24; }
.tlk[data-k="stay"] { --k: #2dd4bf; } .tlk[data-k="shop"] { --k: #f472b6; }
.tlk[data-k="opt"] { background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.tlnote { font-size: 13.5px; line-height: 1.4; color: var(--muted); margin-top: 1px; }
.tlfold:not(.open) .tlnote { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tlmore { display: none; margin-top: 6px; font-size: 14px; line-height: 1.45; cursor: auto; }
.tlfold.open .tlmore { display: block; }
.tlmore > ul, .tlmore > ol { padding-left: 18px; list-style: disc; }
.tlmore li { margin: 3px 0; }
/* The 💬 sits over the row's top right corner when it shows; the row keeps clear of it. */
body.commenting .blk.tl .tlrow, .blk.tl.open .tlrow, .blk.tl:has(> .cbtn.has) .tlrow { padding-right: 48px; }
/* Today: what is past is dimmed, what is under way is marked. */
.blk.tl.gone .tlrow { opacity: .5; }
.blk.tl.now { box-shadow: inset 3px 0 0 var(--leg, var(--accent)); background: color-mix(in srgb, var(--leg, var(--accent)) 10%, transparent); }
.blk.tl.now .tlrow { padding-left: 8px; }
li[data-tl] > .embed { margin: 0 0 10px 60px; }
/* Under a row's time: one tap into Naver Map for that step, when its detail holds a route (Korea). */
.tlside { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
a.tlgo, a.rbtn.naver { border-color: #03c75a; color: #03c75a; font-weight: 600; }
a.tlgo { font-size: 11px; line-height: 1.5; padding: 1px 6px; border: 1px solid #03c75a; border-radius: 9px; text-decoration: none; }
:root[data-mode="light"] a.tlgo, :root[data-mode="light"] a.rbtn.naver { border-color: #02893e; color: #02893e; }
/* Home: the hours are folded under one line; only the step under way and the next one show until it is opened. */
.tlall { display: block; width: 100%; text-align: left; font-size: 13px; font-weight: 600; color: var(--leg, var(--accent)); background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 8px 0; }
.card.tlshut .blk.tl:not(.now):not(.next) { display: none; }
/* A page shown from the saved copy that has since changed: a quiet bar at the foot to refresh. */
.newer { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 25; padding: 10px 14px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--accent); color: var(--accent); font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
