/* Colours and type follow yizhouyu.dev; change the tokens in :root to restyle. */
/* Colours: every colour on the page and on the map is one of these variables. Two palettes (macaron by default;
   <html data-palette="morandi"> or ?pal=morandi for the other), each in light and dark. The three colours that say who
   has been to a place are --w-both, --w-me and --w-wife. The --c-* group belongs to the sister map at /demo/visa/. */

/* ===== macaron · light ===== */
:root{
  /* 页面 */ --bg:#FFFFFF;--bg-2:#F4F8FB;--ink:#1B2233;--ink-2:#3C4558;--muted:#5F6B80;--line:#DCE4EC;--accent:#1E45FF;--on-accent:#FFFFFF;
  /* 底图 */ --sea:#D6ECF8;--sea-line:#C2DFF1;--coast:#9CC6E2;--sea-label:#3F7DA8;--blank:#B5D2E5;--blank-line:#86B2D0;--border:#FFFFFF;--halo:#FFFFFF;--label:#1B2233;--label-inv:#FFFFFF;
  /* 交互 */ --sel:#1E45FF;--sel-key:#FFFFFF;--shadow:rgba(27,34,51,.30);--hover:rgba(255,255,255,.34);--press:rgba(27,34,51,.12);
  /* 去过的地方 */ --w-both:#84B68A;--w-me:#6B9BE0;--w-wife:#F6B468;--stripe:rgba(255,255,255,.62);--foil-1:#EFE3BC;--foil-2:#FAF4DF;--foil-3:#E9DAAA;--foil-4:#FCF8EA;
  /* 签证地图 */ --c-free:#0E7F68;--c-voa:#6CC7B6;--c-eta:#F7B267;--c-visa:#F0E7D8;--c-no:#5F5A6E;--c-home:#2A2F4C;--c-loss:#E4572E;--hatch:#1B2233;
  --r-s:3px;--r-m:6px;
}
/* ===== macaron · dark ===== */
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  /* 页面 */ --bg:#0E1420;--bg-2:#141B2A;--ink:#EEF2F8;--ink-2:#C5CCD9;--muted:#8E98AA;--line:#263042;--accent:#8AA2FF;--on-accent:#0E1420;
  /* 底图 */ --sea:#0F2740;--sea-line:#16324F;--coast:#234A72;--sea-label:#6C9CC8;--blank:#254A74;--blank-line:#3F6A9A;--border:#0F2740;--halo:#0F2740;--label:#141A28;--label-inv:#FFFFFF;
  /* 交互 */ --sel:#8AA2FF;--sel-key:#FFFFFF;--shadow:rgba(0,0,0,.55);--hover:rgba(255,255,255,.16);--press:rgba(0,0,0,.22);
  /* 去过的地方 */ --w-both:#84B68A;--w-me:#6B9BE0;--w-wife:#F6B468;--stripe:rgba(15,25,40,.30);--foil-1:#6E5827;--foil-2:#A88B45;--foil-3:#5C4A20;--foil-4:#BFA35C;
  /* 签证地图 */ --c-free:#5ED9BF;--c-voa:#2A8F80;--c-eta:#F2B56B;--c-visa:#677390;--c-no:#54464F;--c-home:#98A6E0;--c-loss:#E8553A;--hatch:#EEF2F8;
}}
:root[data-theme="dark"]{
  /* 页面 */ --bg:#0E1420;--bg-2:#141B2A;--ink:#EEF2F8;--ink-2:#C5CCD9;--muted:#8E98AA;--line:#263042;--accent:#8AA2FF;--on-accent:#0E1420;
  /* 底图 */ --sea:#0F2740;--sea-line:#16324F;--coast:#234A72;--sea-label:#6C9CC8;--blank:#254A74;--blank-line:#3F6A9A;--border:#0F2740;--halo:#0F2740;--label:#141A28;--label-inv:#FFFFFF;
  /* 交互 */ --sel:#8AA2FF;--sel-key:#FFFFFF;--shadow:rgba(0,0,0,.55);--hover:rgba(255,255,255,.16);--press:rgba(0,0,0,.22);
  /* 去过的地方 */ --w-both:#84B68A;--w-me:#6B9BE0;--w-wife:#F6B468;--stripe:rgba(15,25,40,.30);--foil-1:#6E5827;--foil-2:#A88B45;--foil-3:#5C4A20;--foil-4:#BFA35C;
  /* 签证地图 */ --c-free:#5ED9BF;--c-voa:#2A8F80;--c-eta:#F2B56B;--c-visa:#677390;--c-no:#54464F;--c-home:#98A6E0;--c-loss:#E8553A;--hatch:#EEF2F8;
}

/* ===== morandi · light ===== */
:root[data-palette="morandi"]{
  /* 页面 */ --bg:#FBFAF7;--bg-2:#F2F0EB;--ink:#2B2D33;--ink-2:#4A4D55;--muted:#63666E;--line:#DDD9D0;--accent:#3F5F8A;--on-accent:#FFFFFF;
  /* 底图 */ --sea:#C7D8E1;--sea-line:#B8CBD6;--coast:#9DB6C4;--sea-label:#48697E;--blank:#B4C8D3;--blank-line:#8FA9B8;--border:#FBFAF7;--halo:#FBFAF7;--label:#2B2D33;--label-inv:#FFFFFF;
  /* 交互 */ --sel:#3F5F8A;--sel-key:#FFFFFF;--shadow:rgba(43,45,51,.30);--hover:rgba(255,255,255,.34);--press:rgba(43,45,51,.12);
  /* 去过的地方 */ --w-both:#8DAA90;--w-me:#7298C7;--w-wife:#D3AA72;--stripe:rgba(255,255,255,.62);--foil-1:#E2D8BE;--foil-2:#F1EBDB;--foil-3:#D9CDAE;--foil-4:#F5F0E3;
  /* 签证地图 */ --c-free:#4F7F6C;--c-voa:#96BBAA;--c-eta:#D6B06A;--c-visa:#EEE6D6;--c-no:#55504B;--c-home:#232932;--c-loss:#B4563F;--hatch:#2B2D33;
  --r-s:3px;--r-m:6px;
}
/* ===== morandi · dark ===== */
@media (prefers-color-scheme:dark){:root[data-palette="morandi"]:not([data-theme="light"]){
  /* 页面 */ --bg:#16181B;--bg-2:#1D2024;--ink:#ECEAE5;--ink-2:#C8C5BE;--muted:#96938C;--line:#30343A;--accent:#9DB6D6;--on-accent:#16181B;
  /* 底图 */ --sea:#17262F;--sea-line:#1E303B;--coast:#2C4554;--sea-label:#7FA0B4;--blank:#2C4656;--blank-line:#456577;--border:#17262F;--halo:#17262F;--label:#1B1D21;--label-inv:#FFFFFF;
  /* 交互 */ --sel:#9DB6D6;--sel-key:#FFFFFF;--shadow:rgba(0,0,0,.55);--hover:rgba(255,255,255,.16);--press:rgba(0,0,0,.22);
  /* 去过的地方 */ --w-both:#8DAA90;--w-me:#7298C7;--w-wife:#D3AA72;--stripe:rgba(15,25,40,.30);--foil-1:#6A5C3A;--foil-2:#978558;--foil-3:#5A4E31;--foil-4:#A8966A;
  /* 签证地图 */ --c-free:#8FCBB4;--c-voa:#4F9483;--c-eta:#D9B573;--c-visa:#565D68;--c-no:#47413D;--c-home:#A9B4C8;--c-loss:#D0694F;--hatch:#ECEAE5;
}}
:root[data-palette="morandi"][data-theme="dark"]{
  /* 页面 */ --bg:#16181B;--bg-2:#1D2024;--ink:#ECEAE5;--ink-2:#C8C5BE;--muted:#96938C;--line:#30343A;--accent:#9DB6D6;--on-accent:#16181B;
  /* 底图 */ --sea:#17262F;--sea-line:#1E303B;--coast:#2C4554;--sea-label:#7FA0B4;--blank:#2C4656;--blank-line:#456577;--border:#17262F;--halo:#17262F;--label:#1B1D21;--label-inv:#FFFFFF;
  /* 交互 */ --sel:#9DB6D6;--sel-key:#FFFFFF;--shadow:rgba(0,0,0,.55);--hover:rgba(255,255,255,.16);--press:rgba(0,0,0,.22);
  /* 去过的地方 */ --w-both:#8DAA90;--w-me:#7298C7;--w-wife:#D3AA72;--stripe:rgba(15,25,40,.30);--foil-1:#6A5C3A;--foil-2:#978558;--foil-3:#5A4E31;--foil-4:#A8966A;
  /* 签证地图 */ --c-free:#8FCBB4;--c-voa:#4F9483;--c-eta:#D9B573;--c-visa:#565D68;--c-no:#47413D;--c-home:#A9B4C8;--c-loss:#D0694F;--hatch:#ECEAE5;
}

:root{
  --font:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue","PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Source Han Sans SC","Microsoft YaHei UI","Microsoft YaHei",sans-serif;
  --disp:"Archivo",var(--font); /* display only: the big number, the English title, the tabs, small caps */
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){color-scheme:dark}}
:root[data-theme="dark"]{color-scheme:dark}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--ink);font:400 14px/1.5 var(--font);-webkit-font-smoothing:antialiased;overflow:hidden}
button,input{font:inherit;color:inherit}
button{background:none;border:0;padding:0;cursor:pointer}
a{color:inherit}
p,h1,h2,ol,ul{margin:0;padding:0}
ol,ul{list-style:none}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.cap{font:700 12px/1.3 var(--disp);letter-spacing:.07em;text-transform:uppercase;color:var(--muted)}
:lang(zh-Hans) .cap{font-weight:600;letter-spacing:.12em}
.d{font-family:var(--disp);font-weight:900;font-stretch:112%;text-transform:uppercase;letter-spacing:-.015em;line-height:.95}

/* top bar: same geometry as the demo pages (centre y 28, 28px from the edges; phone y 24, 16px) */
#top{position:fixed;inset:0 0 auto 0;height:56px;display:flex;align-items:center;gap:20px;padding:0 28px;z-index:5;font-size:14px;color:var(--muted);pointer-events:none}
#top>*{pointer-events:auto}
#top .sp{flex:1;pointer-events:none}
#top a,#top button{min-height:40px;display:inline-flex;align-items:center;text-decoration:none;color:var(--muted);white-space:nowrap;font-weight:500}
#top a:hover,#top button:hover{color:var(--ink)}
#top .ic{width:44px;margin:0 -8px;justify-content:center}
/* Feedback (site.js feedback): in the bar only from 900 px, a text button like About; below that, the last line of About */
#top #fbb{display:none}
@media (min-width:900px){#top #fbb:not([hidden]){display:inline-flex}}
.fbl{margin-top:14px}
.fbl button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;text-decoration:underline;text-decoration-color:var(--accent);text-decoration-thickness:2px;text-underline-offset:3px} /* a 44px tap range that does not reach over its neighbours (the bar has gaps of 8px and more) */
#home{position:relative}
#home::before{content:"";position:absolute;inset:6px -10px;z-index:-1;background:color-mix(in srgb,var(--bg) 88%,transparent);border-radius:6px}

#app{position:fixed;inset:0;display:grid;grid-template-columns:minmax(0,1fr) 408px;grid-template-rows:auto minmax(0,1fr);grid-template-areas:"stage head" "stage side"}
#stage{grid-area:stage;position:relative;min-width:0;min-height:0;background:var(--sea)}
#map{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;cursor:grab;outline-offset:-3px}
#map.drag{cursor:grabbing}
#load{position:absolute;inset:0;display:grid;place-items:center;color:var(--muted);pointer-events:none}
#tip{position:absolute;pointer-events:none;background:var(--ink);color:var(--bg);font-size:12.5px;font-weight:600;padding:4px 9px;border-radius:4px;white-space:nowrap;z-index:2}
#zoom{position:absolute;right:28px;bottom:24px;display:flex;flex-direction:column;border:1px solid var(--line);background:var(--bg);border-radius:6px;overflow:hidden}
#zoom button{width:36px;height:36px;display:grid;place-items:center;font-size:18px;color:var(--ink-2);border-bottom:1px solid var(--line)}
#zoom button:last-child{border-bottom:0}
#zoom button:hover{background:var(--bg-2);color:var(--ink)}
#legend{position:absolute;left:18px;bottom:16px;max-width:calc(100% - 100px);display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;padding:6px 10px;font-size:13px;color:var(--ink-2);background:color-mix(in srgb,var(--bg) 90%,transparent);border:1px solid var(--line);border-radius:6px}
.l1,.l2{display:contents}
.lg{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;min-height:30px;padding:0 4px;border:1px solid transparent;border-radius:4px;font:inherit;color:inherit}
button.lg:hover{background:var(--bg-2)}
button.lg.on{background:var(--bg-2);border-color:var(--line)}
.lg.off{opacity:.45} /* a person who is switched off: that kind has nothing on the map */
.lg b{font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink)}
.sw{width:14px;height:14px;flex:none;display:inline-block;border-radius:3px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ink) 16%,transparent)}
.sw.w-both{background:var(--w-both)}.sw.w-me{background:var(--w-me)}.sw.w-wife{background:var(--w-wife)}
.sw.foil{background:linear-gradient(115deg,var(--foil-1),var(--foil-4) 45%,var(--foil-3) 70%,var(--foil-2))}
.replay{min-height:30px;padding:0 10px;border:1px solid var(--line);border-radius:4px;background:var(--bg);font-size:12.5px;font-weight:600;color:var(--ink-2)}
.replay:hover{background:var(--bg-2);color:var(--ink)}

#head{grid-area:head;padding:68px 28px 18px;border-left:1px solid var(--line);background:var(--bg)}
#h{font-size:34px;margin-top:8px}
#h2:empty{display:none}
:lang(zh-Hans) #h{letter-spacing:0;font-size:32px;line-height:1.1}
#trow{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;margin-top:16px} /* the maps, and the way in to "make your own" */
#tabs{display:inline-flex;border:1px solid var(--ink)}
#tabs button{min-height:36px;padding:0 14px;font:700 13px/1 var(--disp);letter-spacing:.05em;text-transform:uppercase;color:var(--ink)}
#tabs button+button{border-left:1px solid var(--ink)}
#tabs button.on{background:var(--ink);color:var(--bg)}
#tabs button:not(.on):hover{background:var(--bg-2)}
:lang(zh-Hans) #tabs button{font-weight:600;letter-spacing:0}
#mkcta{flex:none;display:inline-flex;align-items:center;min-height:36px;padding:0 12px;border:1.5px solid var(--accent);border-radius:18px;font:600 13px/1 var(--font);color:var(--accent);text-decoration:none;white-space:nowrap}
#mkcta:hover{background:var(--accent);color:var(--on-accent)}
#mkcta .ls,#mkcta.short .lf{display:none}
#mkcta.short .ls{display:inline}
#stat{display:flex;align-items:baseline;gap:10px;margin-top:18px}
#num{font:900 76px/.9 var(--disp);font-stretch:112%;letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--accent)}
#unit{font:700 14px/1.2 var(--disp);letter-spacing:.04em;text-transform:uppercase;color:var(--ink)}
#sub{margin-top:10px;font-size:13.5px;line-height:1.55;color:var(--ink-2);min-height:3.1em}

#side{grid-area:side;border-left:1px solid var(--line);border-top:1px solid var(--line);background:var(--bg);overflow-y:auto;overscroll-behavior:contain;min-height:0;padding-bottom:20px}
/* a bar that is always there, so nothing below it moves: a hint, or the place just tapped that we have not been to */
#pick{display:flex;align-items:center;gap:10px;height:44px;padding:0 20px 0 28px;background:var(--bg-2);border-bottom:1px solid var(--line);font-size:13.5px;color:var(--ink-2);white-space:nowrap;overflow:hidden}
#pick .hint{color:var(--muted)}
#pick>span{overflow:hidden;text-overflow:ellipsis}
/* the details of the selected place lie over the list: opening or closing them moves nothing on the page */
#card{grid-area:side;z-index:2;background:var(--bg);border-left:1px solid var(--line);border-top:1px solid var(--line);overflow-y:auto;overscroll-behavior:contain;padding:0 22px 24px 28px}
.ch{display:flex;align-items:center;gap:12px;position:sticky;top:0;z-index:1;background:var(--bg);padding:14px 0 4px} /* the name and the close button stay at the top while the card scrolls */
.cn{flex:1;min-width:0;margin:0;font-size:18px;font-weight:700;line-height:1.3}
:lang(zh-Hans) .cn{font-weight:600}
.ch .x,.ch .tall{flex:none;width:32px;height:32px;font-size:20px;color:var(--muted)}
.ch .tall{display:none}
.ch .x:hover,.ch .tall:hover{color:var(--ink)}
#card .rd,#card .rc{margin:6px 0 0 26px;font-size:13px;color:var(--muted)}
#card .rb{padding:10px 0 0 26px;background:none}
#pick b{color:var(--ink);font-weight:700;flex:none;max-width:45%}
#pick>span{flex:1}
#pick>span:not(.hint):not(.pmsg){white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-height:1.25}
/* a place that is not on the map: two lines in the same 44px bar, the place and its state on the first, the capital ("★ Capital · Montgomery") alone on the second.
   Each line stays one line (the end is cut when the bar is too narrow; the whole text is the title), so the bar never changes height. */
#pick .pmsg{display:flex;flex-direction:column;justify-content:center;min-width:0;line-height:1.3}
#pick .pline,#pick .pcap{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#pick .pst{color:var(--muted)}
#pick .pcap{font-size:13px;color:var(--ink-2)}
#pick .x{width:32px;height:32px;font-size:18px;color:var(--muted);flex:none}
#pick .x:hover{color:var(--ink)}
.row{border-bottom:1px solid var(--line)}
.rh{display:grid;grid-template-columns:14px minmax(0,1fr) 12px;column-gap:12px;row-gap:2px;align-items:center;width:100%;min-height:52px;padding:9px 22px 9px 28px;text-align:left}
.rh:hover{background:var(--bg-2)}
.rh .sw{grid-row:1/3;align-self:start;margin-top:4px}
.rn{font-size:15.5px;font-weight:700;line-height:1.3}
:lang(zh-Hans) .rn{font-weight:600}
.rc{grid-column:2;font-size:13px;color:var(--muted)}
.rd{grid-column:2;font-size:13px;line-height:1.45;color:var(--muted);font-variant-numeric:tabular-nums}
.row.on .rh{background:var(--bg-2)}
.tag{display:inline-block;margin-left:8px;padding:1px 6px;border:1px solid var(--line);font:600 12px/1.4 var(--font);letter-spacing:.03em;color:var(--muted);vertical-align:1px;white-space:nowrap}
.rb{padding:2px 22px 16px 54px;background:var(--bg-2)}
.sum{font-size:13.5px;color:var(--ink-2);padding:2px 0 10px}
.go{font-weight:700;color:var(--ink);text-decoration:underline;text-decoration-color:var(--accent);text-decoration-thickness:2px;text-underline-offset:4px;min-height:28px}
.go:hover{color:var(--accent)}
.trips li{padding:8px 0;border-top:1px solid var(--line);font-size:13.5px;line-height:1.5}
.trips li:first-child{border-top:0;padding-top:2px}
.when{display:block;font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink)}
.seg{display:block}
.seg+.seg{margin-top:6px}
.what{color:var(--ink-2);display:block}
.rd:empty{display:none}
.go.all{display:block;margin-top:8px}
.vl{display:inline-block;margin-top:2px;font-weight:600;white-space:nowrap;color:var(--ink);text-decoration:underline;text-decoration-color:var(--accent);text-decoration-thickness:2px;text-underline-offset:3px}
.vl:hover{color:var(--accent)}
.none{padding:20px 28px;color:var(--muted)}
#filters{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;margin-top:12px}
/* the search box: a row of its own on a computer; on a phone a button at the end of the row that opens the box over the row (nothing moves).
   The list of results lies over the page below it and is never part of the layout. */
#srch{position:relative;z-index:6;flex:1 0 100%;height:44px}
#srchgo{display:none}
#srchbox{display:flex;align-items:center;gap:8px;height:44px;padding:0 4px 0 12px;border:1px solid var(--line);border-radius:6px;background:var(--bg)}
#srchbox:focus-within{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)} /* the focus ring stays inside the box, so that nothing peeks out around it when it opens over the row */
.si{flex:none;display:grid;color:var(--muted)}
#sq{flex:1;min-width:0;height:100%;padding:0;border:0;border-radius:0;background:transparent;outline:0;font-size:16px;color:var(--ink)} /* 16px: a smaller one makes iPhone zoom the page when it is tapped */
#sq::placeholder{color:var(--muted);opacity:1}
#sx{display:none;flex:none;width:36px;height:36px;place-items:center;font-size:20px;line-height:1;color:var(--muted)}
#sx:hover{color:var(--ink)}
#srch.has #sx{display:grid}
#sres{position:absolute;left:0;right:0;top:calc(100% + 6px);max-height:min(60vh,360px);overflow-y:auto;overscroll-behavior:contain;padding:4px 0;background:var(--bg);border:1px solid var(--line);border-radius:6px;box-shadow:0 10px 28px var(--shadow)}
#sres li{display:flex;align-items:center;gap:12px;min-height:44px;padding:0 14px;cursor:pointer}
#sres li.on{background:var(--bg-2)}
#sres .sn{flex:1;min-width:0;font-size:15.5px;font-weight:700;line-height:1.3}
:lang(zh-Hans) #sres .sn{font-weight:600}
#sres .sv{flex:none;max-width:48%;font-size:13px;color:var(--muted);text-align:right}
#sres .sv:empty{display:none}
#sres li.none{min-height:48px;cursor:default;color:var(--muted)}
#who{display:flex;gap:10px}
.pc{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px 0 12px;border:1.5px solid var(--line);border-radius:22px;font-size:14px;font-weight:600;color:var(--muted);background:var(--bg)}
.pc.on{color:var(--label);border-color:transparent}
.pc.me.on{background:var(--w-me)}
.pc.wife.on{background:var(--w-wife)}
#year{min-height:36px;padding:0 8px;border:1px solid var(--line);border-radius:0;background:var(--bg);font-size:13px;font-weight:600;color:var(--ink-2)}
.flag{height:20px;width:auto;max-width:34px;margin-right:10px;vertical-align:-4px;border-radius:3px;box-shadow:0 0 0 1px color-mix(in srgb,var(--ink) 14%,transparent)}
#pick .flag{margin:0 8px 0 0;height:16px;vertical-align:-3px}

#src{padding:6px 28px 4px;font-size:13px}
#src a{color:var(--muted);text-decoration:underline;text-decoration-color:var(--line);text-underline-offset:4px}
#src a:hover{color:var(--ink);text-decoration-color:var(--accent)}
#credit{margin-left:12px;color:var(--muted);white-space:nowrap}
#more{color:var(--muted)}
dialog{border:1px solid var(--ink);background:var(--bg);color:var(--ink);padding:30px 34px 26px;max-width:min(600px,calc(100vw - 32px));max-height:min(86vh,720px);overflow:auto;font-size:14.5px;line-height:1.65}
dialog::backdrop{background:rgba(8,10,14,.55)}
dialog h2{font:700 15px/1.3 var(--disp);letter-spacing:.05em;text-transform:uppercase;margin:20px 0 8px}
dialog h2:first-child{margin-top:0}
dialog p{margin:0 0 10px;color:var(--ink-2)}
dialog ul{margin:0 0 6px;padding-left:1.2em;list-style:square;color:var(--ink-2)}
dialog li{margin:0 0 7px}
dialog b{color:var(--ink)}
dialog a{text-decoration:underline;text-decoration-color:var(--accent);text-decoration-thickness:2px;text-underline-offset:3px}
#aboutx{position:sticky;float:right;top:0;margin:-14px -18px 0 0;width:40px;height:40px;font-size:22px;color:var(--muted)}
#aboutx:hover{color:var(--ink)}
/* Post to X on a computer: the box before X opens (the picture, what happened to it, one button) */
#xbox{width:min(468px,calc(100vw - 32px));padding:22px 24px 24px}
#xbox .x{position:absolute;right:8px;top:8px;width:40px;height:40px;font-size:22px;color:var(--muted)}
#xbox .x:hover{color:var(--ink)}
#xbox h2{margin:0 40px 14px 0}
#xbox img{display:block;width:100%;height:auto;aspect-ratio:1200/630;border:1px solid var(--line);background:var(--bg-2)}
#xbox p{margin:14px 0 18px;font-size:15px;line-height:1.5;color:var(--ink)}
#xbox .pri{display:flex;align-items:center;justify-content:center;min-height:44px;background:var(--ink);color:var(--bg);font-size:15px;font-weight:600;text-decoration:none}
#xbox .pri:hover{background:var(--ink-2)}
#xbox .pri:focus-visible,#xbox .x:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* ---------- a visitor's own map: making one (body.mk) and looking at a shared one (body.mv) ---------- */
/* the head of the panel: the first question, then (in the same box, the same height) the switch, "Start over" and the names */
#mk{padding:14px 22px 14px 28px;border-bottom:1px solid var(--line)}
#mkq,#mkset{display:flex;flex-direction:column;gap:10px}
#mkq .q{height:36px;line-height:36px;font-size:15px;font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.qa{display:flex;gap:10px}
.qa button{flex:1 1 0;height:36px;padding:0 12px;border:1px solid var(--ink);font-size:14px;font-weight:600;color:var(--ink);white-space:nowrap}
.qa button:hover{background:var(--bg-2)}
.mkrow{display:flex;align-items:center;justify-content:space-between;gap:12px;height:36px}
#mkclear{flex:none;min-height:36px;font-size:13px;font-weight:600;color:var(--ink-2)}
#mkclear:hover{color:var(--ink)}
.nms{display:flex;gap:12px;width:100%;height:36px}
.segs{display:inline-flex;flex:none;border:1px solid var(--ink)}
.segs button{height:36px;padding:0 14px;font-size:13px;font-weight:600;color:var(--ink);white-space:nowrap}
.segs button+button{border-left:1px solid var(--ink)}
.segs button.on{background:var(--ink);color:var(--bg)}
.segs button:not(.on):hover{background:var(--bg-2)}
.nm{display:flex;align-items:center;gap:7px;flex:1 1 0;min-width:0}
.nm input,#findq{height:36px;padding:0 10px;border:1px solid var(--line);border-radius:0;background:var(--bg);font-size:14px;color:var(--ink)}
.nm input{width:100%;min-width:0}
.nm input::placeholder,#findq::placeholder{color:var(--muted);opacity:1}
body.mine #sub{min-height:4.65em}
body.mk .lg b{display:inline-block;min-width:2ch}
.lw{white-space:nowrap} /* a visitor's name in the key: never cut short (the key wraps instead) */
/* a visitor's map: the title keeps typed names as they were typed (no capitals, the type of the page), and no line is left with one word */
body.mine #h{text-wrap:balance}
body.mine #h:lang(zh-Hans){text-transform:none}
#h.plain{font-family:var(--font);font-weight:800;font-stretch:normal;text-transform:none;letter-spacing:-.01em;line-height:1.12}
body.mine #side{padding-bottom:0}
#find{padding:10px 22px 10px 28px;border-bottom:1px solid var(--line)}
#findq{width:100%}
.mrow{display:flex;align-items:center;gap:10px;height:50px;padding:0 22px 0 28px;border-bottom:1px solid var(--line)}
.mn{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;font-weight:700}
:lang(zh-Hans) .mn{font-weight:600}
/* who has been to one place in the list: one small button, in the words of the key; it opens the card */
.chip{flex:none;display:inline-flex;align-items:center;gap:7px;height:34px;padding:0 10px;border:1px solid var(--line);border-radius:4px;background:var(--bg);font-size:13px;font-weight:600;color:var(--muted);white-space:nowrap}
.chip.on{color:var(--ink)}
.chip:hover{background:var(--bg-2);color:var(--ink)}
.chip:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#pick .go{flex:none;min-height:32px}
#mkfoot{padding:16px 22px 18px 28px;font-size:13px;color:var(--muted)}
#mkfoot a{color:var(--muted);text-decoration:underline;text-decoration-color:var(--line);text-underline-offset:4px}
#mkfoot a:hover{color:var(--ink);text-decoration-color:var(--accent)}
body.mk #pick{display:none} /* making: the card over the map names the place */
/* the card over the map while making: the place, its capital, who has been (fixed over the page: opening it moves nothing) */
/* a computer: as wide as the three choices need on one line each (with names too), 340px at least; the name and the capital line never widen it */
#pop{position:fixed;left:0;top:0;z-index:7;width:max-content;min-width:340px;max-width:min(584px,calc(100vw - 16px));padding:12px 12px 12px 14px;background:var(--bg);color:var(--ink);border:1px solid var(--ink);border-radius:8px;box-shadow:0 8px 24px var(--shadow)}
#pop[hidden]{display:none}
#pop .ph{display:flex;align-items:center;gap:10px;min-height:28px}
#pop .ph,#pop .pcap,#pop .pnote,#pop .pq{width:0;min-width:100%} /* (they take the width the choices give, and add none) */
#pop .pn{flex:1;min-width:0;font-size:15px;font-weight:700;line-height:1.3;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
#pop .pn .flag{margin:0 8px 0 0;height:16px;vertical-align:-2px}
#pop .pclr{flex:none;display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:0 4px;font-size:13px;font-weight:600;color:var(--ink-2);text-decoration:underline;text-decoration-color:var(--line);text-underline-offset:4px;white-space:nowrap}
#pop .pclr:hover{color:var(--ink)}
#pop .pcap{margin-top:2px;font-size:13px;color:var(--ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#pop .pnote,#pop .pq{margin-top:8px;font-size:13.5px;color:var(--muted)}
#pop .pq{color:var(--ink);font-weight:600}
#pop .prow{display:flex;gap:6px;margin-top:10px}
#pop .po{flex:1 0 auto;min-width:0;min-height:40px;display:flex;align-items:center;justify-content:center;gap:7px;padding:4px 8px;border:1px solid var(--ink);border-radius:4px;font-size:13px;font-weight:600;line-height:1.2;color:var(--ink);text-align:center}
#pop .po:hover{background:var(--bg-2)}
#pop .po.on{background:var(--ink);color:var(--bg)}
#pop .po:focus-visible,#pop .pclr:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#pop .po .sw{flex:none}
#pop .pl{white-space:nowrap}
#pop .prow.col{flex-direction:column} /* the choices did not fit side by side: one under the other, each on one line */
#pop .prow.col .po{flex:none;justify-content:flex-start;padding:4px 14px}
#pop .parr{position:absolute;left:var(--ax,50%);width:12px;height:12px;margin-left:-6px;background:var(--bg);border:1px solid var(--ink);transform:rotate(45deg)}
#pop[data-dir="up"] .parr{bottom:-7px;border-top:0;border-left:0}
#pop[data-dir="down"] .parr{top:-7px;border-bottom:0;border-right:0}
#pop[data-dir=""] .parr{display:none}
/* a short note over the map after a tap that marked something; it never takes a tap and never moves anything */
#mktoast{position:absolute;left:50%;top:12px;z-index:2;transform:translateX(-50%);display:flex;align-items:center;gap:8px;max-width:calc(100% - 24px);padding:7px 12px;border-radius:6px;background:var(--ink);color:var(--bg);font-size:13px;font-weight:600;white-space:nowrap;pointer-events:none;box-shadow:0 4px 14px var(--shadow);transition:opacity .4s}
#mktoast span{overflow:hidden;text-overflow:ellipsis}
#mktoast.out{opacity:0}
#acts,#cta{display:flex;flex-wrap:wrap;gap:8px;padding:12px 22px 12px 28px;background:var(--bg)}
#acts{position:sticky;bottom:0;z-index:1;border-top:1px solid var(--line)}
#cta{border-bottom:1px solid var(--line)}
#acts button,#cta button{flex:1 1 0;min-height:40px;padding:0 8px;border:1px solid var(--ink);font-size:14px;font-weight:600;color:var(--ink);white-space:nowrap}
#acts button:hover,#cta button:hover{background:var(--bg-2)}
#acts .pri,#cta .pri{background:var(--ink);color:var(--bg)}
#acts .pri:hover,#cta .pri:hover{background:var(--ink-2)}
/* the note after "Post on X": over the page, at its foot, moving nothing */
#toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:20;display:flex;align-items:center;gap:6px 14px;width:max-content;max-width:calc(100vw - 32px);padding:8px 6px 8px 16px;background:var(--ink);color:var(--bg);font-size:14px;line-height:1.4;border-radius:6px;box-shadow:0 6px 24px rgba(0,0,0,.18)}
#toast[hidden]{display:none}
#toast .go{flex:none;font-weight:700;color:var(--bg);text-decoration:underline;text-underline-offset:3px;white-space:nowrap;padding:4px 2px}
#toast .x{flex:none;width:32px;height:32px;font-size:20px;line-height:1;color:var(--bg);opacity:.75}
#toast .x:hover{opacity:1}
#acts button[aria-busy="true"]{cursor:progress}
#acts button:disabled{opacity:.4;cursor:default;background:none}
#acts .pri:disabled{background:none;color:var(--ink)}
#acts .priv{flex:1 0 100%;margin:-2px 0 0;font-size:12px;line-height:16px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#acts .priv.wrap{white-space:normal} /* with short links the line says what is stored where: it may take two lines, never cut */
/* the short link under the buttons (site.js shortLinks): its address, its state, "Delete": words on one line, not buttons */
#acts #short{display:flex;align-items:baseline;gap:6px}
#acts #short[hidden]{display:none}
#acts #short>*{flex:none}
#acts #short a,#acts #short .st{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis} /* the address and the state give way; "Delete" never does */
#acts #short a{color:var(--ink);text-decoration:underline;text-underline-offset:2px}
#acts #short button{flex:none;min-height:0;padding:0;border:0;font:inherit;color:var(--ink);text-decoration:underline;text-underline-offset:2px;white-space:nowrap}
#acts #short button:hover{background:none;color:var(--accent)}
#sub .go{font-weight:600;color:var(--ink);text-decoration:underline;text-underline-offset:3px}

@media (max-width:760px),(max-height:559px){
  /* the page scrolls as a whole; the map stays in a strip under the top bar */
  html,body{height:auto}
  body{overflow:auto}
  #top{height:calc(48px + env(safe-area-inset-top));padding:env(safe-area-inset-top) max(16px,env(safe-area-inset-right)) 0 max(16px,env(safe-area-inset-left));gap:16px;background:var(--bg);border-bottom:1px solid var(--line)}
  #top a,#top button{min-height:44px}
  /* the buttons keep their size; the address on the left gives way (it is cut short with an ellipsis) when the row is too wide, so that nothing is pushed off the screen */
  #top{gap:12px}
  #top button{flex:none}
  #top #home{display:block;flex:0 1 auto;min-width:1.8em;min-height:0;line-height:44px;overflow:hidden;text-overflow:ellipsis}
  #home::before{display:none}
  #app{position:static;display:block}
  #head{padding:calc(58px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left));border-left:0;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;align-items:end}
  #kicker{grid-column:1/3}
  #h{grid-column:1;font-size:24px;margin-top:4px}
  :lang(zh-Hans) #h{font-size:24px}
  #trow{grid-column:1/3;margin-top:12px}
  #tabs button{min-height:44px;padding:0 14px}
  #mkcta{min-height:44px;border-radius:22px}
  #stat{grid-column:2;grid-row:2;margin:0;gap:6px;align-self:end;justify-content:flex-end}
  #num{font-size:44px}
  #unit{font-size:12px;max-width:9.5em}
  #sub{grid-column:1/3;font-size:12.5px;margin-top:10px;min-height:0}
  #filters{grid-column:1/3;gap:8px}
  #srch{flex:none;width:44px;margin-left:auto}
  #srchgo{display:grid;place-items:center;width:44px;height:44px;border-radius:6px;color:var(--ink-2)}
  #srchgo:active{background:var(--bg-2)}
  #srchbox{display:none}
  #srch.open{position:absolute;left:0;right:0;top:0;width:auto;margin:0}
  #srch.open #srchgo{display:none}
  #srch.open #srchbox{display:flex}
  #srch.open #sx{display:grid}
  #filters.alone #srch{position:relative;flex:1 0 100%;width:auto}
  #filters.alone #srchgo{display:none}
  #filters.alone #srchbox{display:flex}
  #year{min-height:44px;font-size:16px} /* a form control under 16px makes iPhone zoom the page when it is opened */
  #stage{position:sticky;top:calc(48px + env(safe-area-inset-top));z-index:3;height:240px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
  /* one bar under the map, 84px, nothing on top of the map: row 1 (44px) the three kinds, with the whole width (a count of two digits
     never runs under the buttons); row 2 (32px) the two notes, and at the right edge replay, then + and "whole map" (44px square, they
     reach 8px up into the empty foot of row 1) */
  #legend{left:0;right:0;bottom:0;max-width:none;display:block;height:84px;padding:4px 8px;font-size:12px;border:0;border-top:1px solid var(--line);border-radius:0;background:var(--bg)}
  .l1{display:flex;align-items:center;gap:12px;height:44px;padding-right:0}
  .l2{display:flex;align-items:center;gap:10px;height:32px;padding-right:92px}
  #zoom{bottom:0}
  /* a shared map: the second row is as tall as the buttons, which then stay inside it */
  body.mv #legend{height:96px}
  body.mv .l2{height:44px}
  body.mv #zoom{bottom:2px}
  button.lg{min-height:44px;padding:0}
  .lg.note{min-height:28px;padding:0}
  .replay{position:relative;margin-left:auto;width:32px;height:32px;min-height:0;padding:0;border:0;background:none;border-radius:6px;font-size:18px;color:var(--ink-2)} /* the same plain icon button as + and the whole-map button */
  .replay:active,#zoom button:active{background:var(--bg-2)}
  #zoom button{border-radius:6px;color:var(--ink-2)}
  .replay::after{content:"";position:absolute;inset:-6px 0} /* the tap range reaches 44px */
  .replay span{display:none}
  #zoom{right:4px;top:auto;flex-direction:row;border:0;border-radius:0;background:none}
  #zoom button{width:44px;height:44px;border-bottom:0}
  #zo{display:none!important} /* touch: pinch to zoom out; + and "whole map" stay */
  #side{border-left:0;border-top:0;overflow:visible;padding-bottom:calc(28px + env(safe-area-inset-bottom))}
  #pick{padding:0 8px 0 16px}
  #card{position:fixed;left:0;right:0;bottom:0;z-index:4;border-left:0;padding:0 16px calc(22px + env(safe-area-inset-bottom));box-shadow:0 -8px 20px var(--shadow)}
  .ch{padding-top:12px}
  .ch .x,.ch .tall{width:44px;height:44px}
  .ch .tall{display:block}
  .ch{gap:6px}
  .rh{padding:8px 14px 8px 16px;min-height:48px}
  .vl{display:inline-flex;align-items:center;min-height:40px;margin-top:0}
  .trips li{padding:6px 0}
  .go{min-height:40px}
  #src{padding:6px 16px 4px}
  #src a{display:inline-flex;align-items:center;min-height:40px}
  dialog{padding:24px 20px 20px}
  /* a visitor's own map on a phone: bigger targets, 16px inputs (no zoom on focus), the actions in a bar at the bottom */
  #mk{padding:12px 16px}
  #mkq .q,.qa button,.mkrow,.segs button,#mkclear,.nms,.nm input{height:44px}
  #mkq .q{line-height:44px}
  /* a phone: a fixed width, three equal choices on one line each (one under the other when they do not fit), every choice the same height */
  #pop{width:340px;min-width:0;max-width:calc(100vw - 16px);padding:10px 10px 10px 12px}
  #pop .po{flex:1 1 0;min-width:0}
  #pop .pclr{min-height:44px;margin:-8px -4px -8px 0;padding:0 8px}
  #pop .po{min-height:52px}
  body.mine #sub{min-height:3.1em}
  body.mk .lg b{display:inline-block;min-width:3ch} /* room for three digits: a count never changes how the key is laid out */
  body.mine #legend.two{height:auto}
  #legend.two .l1{flex-wrap:wrap;height:auto;row-gap:0}
  body.mv #legend.two button.lg{min-height:40px}
  body.mk #num{display:inline-block;min-width:2ch;text-align:right} /* the count can grow a digit without the title beside it rewrapping */
  .nm input{font-size:16px}
  #find{padding:8px 16px}
  #findq{min-height:44px;font-size:16px}
  .mrow{padding:0 10px 0 16px;height:54px}
  .chip{height:42px;padding:0 12px}
  #acts{position:fixed;left:0;right:0;bottom:0;z-index:4;padding:8px max(16px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));transition:transform .25s,visibility .25s}
  #acts.empty{transform:translateY(100%);visibility:hidden} /* nothing to share yet: out of the way of the first question */
  #toast{bottom:calc(72px + env(safe-area-inset-bottom))}
  #acts button,#cta button{min-height:44px}
  body.mk #side{padding-bottom:calc(84px + env(safe-area-inset-bottom))}
  #mkfoot{padding:8px 16px 14px}
  #mkfoot a{display:inline-flex;align-items:center;min-height:40px}
  /* making: the key in one row, the whole-map button beside it (pinch to zoom: no + here) */
  body.mk #legend{height:48px;padding:2px 8px}
  body.mk .l1{gap:8px;padding-right:56px} /* 8px clear of the whole-map button */
  body.mk .lg{padding:0;gap:5px}
  body.mk #zoom{bottom:2px}
  body.mk #zi{display:none}
  #cta{padding:12px 16px}
}
/* a small phone held upright (iPhone SE, or 664 high inside an in-app browser): the head is made smaller so that the map keeps
   a third of the screen and the first rows of the list show */
@media (max-width:760px) and (max-height:700px){
  #head{padding-top:calc(52px + env(safe-area-inset-top));padding-bottom:8px}
  #kicker{display:none}
  #h{font-size:20px;margin-top:0;line-height:1.05}
  :lang(zh-Hans) #h{font-size:22px}
  #num{font-size:36px}
  #stat{grid-row:1;align-self:center} /* the number beside the title, not under it */
  #unit{font-size:11px}
  #trow{margin-top:8px}
  #sub{font-size:12px;line-height:1.4;margin-top:6px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
  #filters{margin-top:0}
}
@media (max-width:340px){ #top{gap:8px;font-size:13px} #top #home{min-width:1.4em} }
@media (max-width:380px){
  #filters{gap:6px}
  #who{gap:6px}
  .pc{padding:0 10px 0 8px;gap:5px}
  #year{max-width:84px;padding:0 4px}
  #tabs button{padding:0 10px}
  #mkcta{padding:0 10px}
}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* ?cover=1: the 1200x630 picture for link previews. Left: the map with nothing on it. Right: a white panel with the
   address, both titles, the number and the key in three lines. Smallest type 20px. */
body.cover #top,body.cover #zoom,body.cover #legend,body.cover #side,body.cover #trow,body.cover #filters,body.cover #load{display:none}
body.cover #app{grid-template-columns:760px 440px;grid-template-rows:minmax(0,1fr);grid-template-areas:"stage head"}
body.cover #head{padding:40px;display:flex;flex-direction:column;justify-content:center;border-left:1px solid var(--line)}
body.cover #kicker{font:700 20px/1.2 var(--disp);letter-spacing:.02em;text-transform:none;color:var(--muted)}
body.cover #h{font:600 48px/1.15 var(--font);letter-spacing:0;text-transform:none;margin-top:22px}
body.cover #h2{font-size:28px;margin-top:10px}
body.cover #stat{margin-top:30px;align-items:baseline}
body.cover #num{font-size:120px}
body.cover #unit{font-size:22px;text-transform:none;letter-spacing:0;font-family:var(--font)}
body.cover #sub{margin-top:26px;min-height:0;display:flex;flex-direction:column;gap:8px}
body.cover .ck{display:flex;align-items:center;gap:12px;font-size:22px;color:var(--ink)}
body.cover .ck .sw{width:22px;height:22px}
