:root {
  --bg: #0f1412;
  --panel: rgba(18, 24, 22, 0.86);
  --panel-solid: #141b19;
  --line: rgba(255, 255, 255, 0.10);
  --text: #eef2ee;
  --muted: #a9b5ae;
  --accent: #e0b25a;
  --real: #10907f;
  --embellished: #d0453f;
  --fictional: #9a4fc4;
  --reference: #6b7f88;
  --warn: #f5b53d;
  --radius: 12px;
  --font: "Be Vietnam Pro", "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
:root[data-theme="light"] {
  --panel: rgba(250, 248, 242, 0.92);
  --panel-solid: #faf8f2;
  --line: rgba(0, 0, 0, 0.10);
  --text: #1d2420;
  --muted: #5b6660;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; }
#app, #viewport { position: fixed; inset: 0; }
#viewport canvas { display: block; touch-action: none; }

.panel { background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28); }

.topbar { position: fixed; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; gap: 10px;
  pointer-events: none; z-index: 5; }
.topbar > * { pointer-events: auto; }
.title { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px;
  backdrop-filter: blur(10px); min-width: 0; }
.title h1 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title p { margin: 2px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .chip { margin-left: auto; }

.icon-btn, .chip { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; }
.icon-btn { width: 40px; height: 40px; font-size: 18px; }
.chip { padding: 8px 12px; font-size: 13px; font-weight: 600; }
.icon-btn:hover, .chip:hover { border-color: var(--accent); }
#menuBtn { display: inline-block; }
/* computers: the menu button slides the side panel away (ui.js, remembered); phones use .open instead */
@media (min-width: 761px) {
  .sidebar { transition: transform 0.25s ease, opacity 0.25s ease, visibility 0s linear 0s; }
  .sidebar.collapsed { transform: translateX(calc(-100% - 24px)); opacity: 0; visibility: hidden;
                       transition: transform 0.25s ease, opacity 0.25s ease, visibility 0s linear 0.25s; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .sidebar.collapsed { transition: none; } }

.sidebar { position: fixed; top: 84px; left: 12px; bottom: 12px; width: 300px; overflow-y: auto; padding: 6px 14px 12px; z-index: 4; }
.sidebar section { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sidebar section:last-child { border-bottom: 0; }
.sidebar h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin: 4px 0 10px; font-weight: 600; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.btn-grid button { font: inherit; font-size: 12.5px; text-align: left; padding: 8px 10px; color: var(--text);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.btn-grid button:hover { border-color: var(--accent); }

.site-list { list-style: none; margin: 0; padding: 0; }
.site-list li { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.site-list li:hover, .site-list li.active { background: rgba(255, 255, 255, 0.07); }
.site-id { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; }
.site-name { flex: 1; min-width: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot.real, .bg-real { background: var(--real); }
.dot.embellished, .bg-embellished { background: var(--embellished); }
.dot.fictional, .bg-fictional { background: var(--fictional); }
.bg-reference { background: var(--reference); }
.warn { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--warn);
  color: #222; font-style: normal; font-weight: 800; font-size: 11px; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button { font: inherit; font-size: 12.5px; padding: 7px 6px; color: var(--text); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.seg button.on { border-color: var(--accent); background: rgba(224, 178, 90, 0.16); }
.seg-note { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); margin: 2px 0 0; }
.layers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.layers label { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.layers input { accent-color: var(--accent); }

.small, .small p { font-size: 12px; color: var(--muted); line-height: 1.5; }
.link { font: inherit; font-size: 12px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }

.info { position: fixed; top: 84px; right: 12px; width: 380px; max-height: calc(100% - 96px); overflow-y: auto;
  padding: 16px 18px 18px; z-index: 6; }
.info.hidden { display: none; }
.info .close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; font-size: 14px; }
.info h3 { margin: 0 34px 4px 0; font-size: 19px; line-height: 1.3; }
.info .sub { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.badge { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; color: #fff; }
.badge.warnb { background: var(--warn); color: #222; }
.info h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--accent); margin: 14px 0 4px; }
.info p { margin: 0; font-size: 14px; line-height: 1.55; }
.info .conflict { background: rgba(245, 181, 61, 0.12); border-left: 3px solid var(--warn); padding: 8px 10px; border-radius: 6px; }
.info .coords { font-size: 12px; color: var(--muted); margin-top: 14px; font-variant-numeric: tabular-nums; }
.info .actions { display: flex; gap: 8px; margin-top: 14px; }

.hint { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; z-index: 3;
  white-space: nowrap; transition: opacity 0.6s; }

.img-credit { position: fixed; right: 10px; bottom: 8px; font-size: 10.5px; color: #fff; background: rgba(0, 0, 0, 0.45);
  padding: 2px 7px; border-radius: 4px; z-index: 3; pointer-events: none; }
.img-credit.hidden { display: none; }

/* loading screen: 19th-century natural-history plates of the delta spread over old paper around the title, like a
   naturalist's page: insects and the kingfisher in the sky, birds and the river's culture (stilt houses, Khmer stupa) at
   the sides, plants, the buffalo, a boat in the flooded forest and the cá lóc along the bottom. Plates are multiplied
   onto the paper colour, so their white paper disappears and only the inks remain (web/ui/loading, CREDITS.md). */
.loading { --paper: #efe6d2; --ink: #3b3024; --ink-soft: #7a6a54; position: fixed; inset: 0; z-index: 20;
  background: var(--paper); color: var(--ink); transition: opacity 0.8s; overflow: hidden; }
.loading::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(120, 90, 50, 0.22) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.36 0 0 0 0 0.22 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.loading.done { opacity: 0; pointer-events: none; }
/* (no transforms or opacity on containers: they would isolate the plates from the paper and break the multiply) */
/* plates are laid out on a page at most 21:9 wide (wider screens: plain paper either side) */
.lp-page { position: absolute; top: 0; bottom: 0; left: max(0px, calc(50% - 117vh)); right: max(0px, calc(50% - 117vh)); }
.lp-item { --t: translate(-50%, -50%) rotate(var(--r, 0deg)); position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%);
  width: calc(var(--w) * min(1vh, 0.5625vw)); height: auto; mix-blend-mode: multiply;   /* (narrower than 16:9: sized as at 16:9) */ transform: var(--t); opacity: 0;
  animation: lpIn 1.1s ease-out var(--d, 0s) forwards; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.lp-flutter { animation: lpIn 1.1s ease-out var(--d, 0s) forwards, lpFlutter 5.5s ease-in-out calc(var(--d, 0s) + 1.1s) infinite; }
.lp-swim { animation: lpIn 1.1s ease-out var(--d, 0s) forwards, lpSwim 7s ease-in-out calc(var(--d, 0s) + 1.1s) infinite; }
@keyframes lpIn { from { opacity: 0; transform: var(--t) translateY(10px); } to { opacity: 1; transform: var(--t); } }
@keyframes lpFlutter { 0%, 100% { opacity: 1; transform: var(--t); } 50% { opacity: 1; transform: var(--t) rotate(2.5deg) translate(3px, -6px); } }
@keyframes lpSwim { 0%, 100% { opacity: 1; transform: var(--t); } 50% { opacity: 1; transform: var(--t) rotate(-1.5deg) translateX(8px); } }
@keyframes lpInPlain { from { opacity: 0; } to { opacity: 1; } }
.lp-card { --cw: min(460px, 30vw); position: absolute; left: calc(50% - var(--cw) / 2); top: 0; bottom: 6vh; width: var(--cw);
  display: flex; flex-direction: column; justify-content: center; text-align: center; }
.lp-card > * { opacity: 0; animation: lpInPlain 1.2s ease-out 0.5s forwards; }
.lp-palms { display: block; width: 86%; height: auto; margin: 0 auto 16px; mix-blend-mode: multiply; }
.lp-brocade { display: block; width: 100%; height: 10px; margin-bottom: 18px; opacity: 0.9; }
.loading-title { font-family: "EB Garamond", Garamond, "Times New Roman", serif; font-weight: 500; font-size: clamp(34px, 4.4vw, 64px);
  line-height: 1.02; letter-spacing: -0.01em; margin: 0 0 26px; color: var(--ink); }
.loading .bar { height: 2px; background: rgba(59, 48, 36, 0.16); border-radius: 0; overflow: hidden; }
.loading .bar > div { background: #7d2a22; transition: width 0.4s ease-out; }
.lp-status { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; }
.loading-text { font-size: 13px; color: var(--muted); margin-bottom: 14px; min-height: 18px; }
.loading .loading-text { font-family: "EB Garamond", Garamond, serif; font-size: 15px; color: var(--ink-soft); margin: 0; letter-spacing: 0.02em; }
.lp-credit { margin: 18px 0 0; font-family: "EB Garamond", Garamond, serif; font-size: 11px; line-height: 1.35; color: rgba(59, 48, 36, 0.5); }
@media (max-aspect-ratio: 1/1) {      /* portrait / phone: plates above and below, the title in the lower middle */
  .lp-item { left: calc(var(--mx) * 1%); top: calc(var(--my) * 1%); width: calc(var(--mw) * 1vw); }
  .lp-desk { display: none; }
  .lp-card { --cw: auto; left: 24px; right: 24px; width: auto; top: 50%; bottom: max(13%, 36vw); justify-content: center; }   /* (above the plants) */
  .lp-palms { display: none; }
  .loading-title { font-size: clamp(34px, 9.5vw, 84px); margin-bottom: 4vw; }
  .loading .loading-text { font-size: clamp(15px, 2.3vw, 22px); }
  .lp-credit { font-size: clamp(9.5px, 1.45vw, 14px); margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-item, .lp-card > * { animation: none !important; opacity: 1; }
}

.credits { color: var(--text); max-width: min(560px, 92vw); padding: 18px 20px; background: var(--panel-solid); }
.credits::backdrop { background: rgba(0, 0, 0, 0.45); }
.credits ul { padding-left: 18px; font-size: 13px; line-height: 1.6; }

/* map labels (CSS2D) */
.lbl { font-family: var(--font); color: #1c211e; font-weight: 600; white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px rgba(255, 255, 255, 0.8); user-select: none; }
.lbl.city { font-size: 15px; font-weight: 700; }
.lbl.town { font-size: 12.5px; }
.lbl.village { font-size: 11px; font-weight: 500; color: #2c332f; }
.lbl.peak { font-size: 11.5px; color: #4b3326; font-style: italic; }
.lbl.river { font-size: 12px; color: #1f5f8b; font-style: italic; }
.lbl.region { font-size: 14px; color: #6d6d6d; letter-spacing: 2px; }
.site-lbl { pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #1c211e; font: 600 12.5px var(--font);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); white-space: nowrap; transform: translateY(-14px); }
.site-lbl .site-id { width: 22px; height: 22px; font-size: 10.5px; }
.site-lbl:hover { outline: 2px solid var(--accent); }
.site-lbl.small { font-size: 11px; background: rgba(255, 255, 255, 0.8); }

@media (max-width: 760px) {
  #menuBtn { display: inline-block; }
  .sidebar { top: 70px; left: 8px; right: 8px; width: auto; bottom: auto; max-height: 62vh; display: none; }
  .sidebar.open { display: block; }
  .info { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; max-height: 55vh; }
  .title h1 { font-size: 14px; }
  .topbar { top: 8px; left: 8px; right: 8px; }
  .hint { display: none; }
}

/* Place search, sharing and accessible map controls. */
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.map-tools { display: flex; gap: 6px; margin-left: auto; }
.map-tools .icon-btn { width: 44px; height: 44px; display: grid; place-items: center; }
.map-tools svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topbar .map-tools + .chip { margin-left: 0; min-height: 44px; }
.compass { font-size: 12px; font-weight: 700; }
#compassNeedle { display: flex; flex-direction: column; align-items: center; line-height: 1; }
#compassNeedle span { color: var(--accent); margin-top: 2px; font-size: 15px; }
.new-help { border-color: var(--accent); }
.ux-dialog { color: var(--text); background: var(--panel-solid); padding: 20px; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto; }
.ux-dialog::backdrop { background: #080e0bac; backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.dialog-head h2 { margin: 0; font-size: 19px; }
.dialog-head button { min-height: 44px; }
.ux-dialog input { width: 100%; min-height: 48px; background: #ffffff0a; border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 12px; font: inherit; }
.ux-dialog input::placeholder { color: var(--muted); }
.place-results { list-style: none; margin: 0; padding: 0; max-height: 42dvh; overflow: auto; }
.place-result { width: 100%; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 8px; text-align: left; padding: 12px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 4px; min-height: 58px; }
.place-result span { color: var(--muted); font-size: 12px; }
.place-result:hover, .place-result[aria-selected="true"] { background: #e0b25a14; border-color: var(--accent); }
.control-list { margin: 0; line-height: 1.6; font-size: 14px; }
.control-list dt { color: var(--accent); font-weight: 700; margin: 12px 0 6px; }
.control-list dd { margin: 0 0 10px; }
.welcome { position: fixed; bottom: 28px; right: 12px; width: 290px; padding: 16px; z-index: 6; }
.welcome h2 { margin: 0; font-size: 17px; }
.welcome p { font-size: 13px; line-height: 1.5; color: var(--muted); }
.welcome .actions { display: flex; gap: 8px; }
.map-status:not(:empty) { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--panel-solid); color: var(--text); padding: 10px 16px; border: 1px solid var(--accent); border-radius: 10px; z-index: 30; font-size: 13px; max-width: 90vw; }
.site-list li { min-height: 42px; }
@media (max-width:760px), (pointer:coarse) {
  .map-tools { position: fixed; top: 72px; right: 8px; gap: 6px; }
  .sidebar { max-height: calc(100dvh - 158px); top: 124px; }
  .icon-btn, #menuBtn, .chip { min-width: 44px; min-height: 44px; }
  .btn-grid button, .seg button, .site-list li, .layers label { min-height: 44px; }
  .layers input { width: 20px; height: 20px; }
  .info .close { width: 44px; height: 44px; }
  .info h3 { margin-right: 44px; }
  .welcome { display: none; }
}
@media (max-width:480px) {
  .title { padding: 8px 10px; flex: 1; }
  .title p { display: none; }
  .title h1 { font-size: 13px; }
  .topbar { gap: 6px; }
  .map-tools { top: 60px; }
  .sidebar { top: 112px; }
}
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; } }

/* ---- antique plate theme (Claude Code, owner's request 2026-10-11): the interface as a 19th-century hand-coloured
   atlas of Indochina, matching the loading screen and the map table: parchment panels with a double ink rule, ink text
   in EB Garamond, small-caps headings, vermilion for the chosen buttons, round paper medallions for the map tools, a
   Cham brocade band under the title, serif map labels with a paper halo. Variables first, then the components. */
:root, :root[data-theme="light"] {
  --paper: #efe6d2; --paper-2: #e5d7b8; --ink: #3b3024; --ink-soft: #77664f; --vermilion: #7d2a22; --gold: #b6873a;
  --bg: #d9ccb0;
  --panel: rgba(239, 230, 210, 0.95);
  --panel-solid: #efe6d2;
  --line: rgba(59, 48, 36, 0.26);
  --text: #3b3024;
  --muted: #77664f;
  --accent: #7d2a22;
  --real: #3d7a68; --embellished: #a5432f; --fictional: #6c4a8c; --reference: #6b7a80; --warn: #c99331;
  --radius: 4px;
  --font: "EB Garamond", Garamond, "Palatino Linotype", "Times New Roman", serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.36 0 0 0 0 0.22 0 0 0 0.13 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --brocade: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='10'%3E%3Crect width='24' height='10' fill='%237d2a22'/%3E%3Crect width='24' height='1.5' fill='%232f2a3a'/%3E%3Crect y='8.5' width='24' height='1.5' fill='%232f2a3a'/%3E%3Cpath d='M0 5L6 2L12 5L6 8ZM12 5L18 2L24 5L18 8Z' fill='%23d9a441'/%3E%3Cpath d='M3 5L6 3.6L9 5L6 6.4ZM15 5L18 3.6L21 5L18 6.4Z' fill='%232f2a3a'/%3E%3C/svg%3E");
  --rule: inset 0 0 0 3px var(--paper), inset 0 0 0 4px rgba(59, 48, 36, 0.32);
  --lift: 0 6px 22px rgba(45, 30, 12, 0.32), 0 1px 2px rgba(45, 30, 12, 0.25);
}
html, body { font-size: 15px; }
.panel, .title, .ux-dialog, .credits, .welcome, .hint, .map-status:not(:empty) {
  background: var(--grain), var(--panel); color: var(--text); border: 1px solid rgba(59, 48, 36, 0.55);
  border-radius: var(--radius); box-shadow: var(--rule), var(--lift); backdrop-filter: none; -webkit-backdrop-filter: none; }
.sidebar { scrollbar-width: thin; scrollbar-color: rgba(59, 48, 36, 0.38) transparent; padding: 8px 16px 14px; }
.info { scrollbar-width: thin; scrollbar-color: rgba(59, 48, 36, 0.38) transparent; padding: 18px 20px 20px; }

/* title: the cartouche, with a brocade band */
.title { position: relative; padding: 9px 18px 15px; }
.title::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 5px; background: var(--brocade) repeat-x center / auto 5px; opacity: 0.92; }
.title h1 { font-family: var(--font); font-weight: 500; font-size: 21px; letter-spacing: 0.01em; color: var(--ink); }
.title p { font-style: italic; font-size: 13px; color: var(--ink-soft); margin-top: 0; }

/* headings: small capitals with a rubric rule */
.sidebar h2, .info h4 { font-family: var(--font); font-variant: small-caps; text-transform: lowercase; font-weight: 500;
  letter-spacing: 0.12em; font-size: 15.5px; color: var(--vermilion); display: flex; align-items: center; gap: 8px; }
.sidebar h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(125, 42, 34, 0.45), transparent); }
.sidebar section { border-bottom: 1px solid rgba(59, 48, 36, 0.16); }

/* buttons: paper slips with a thin ink edge; chosen ones in vermilion */
.btn-grid button, .seg button, .chip, .ux-dialog input, .place-result {
  font-family: var(--font); color: var(--ink); background: rgba(255, 250, 238, 0.55); border: 1px solid rgba(59, 48, 36, 0.3); border-radius: 3px; }
.btn-grid button, .seg button { font-size: 14px; line-height: 1.2; }
.btn-grid button:hover, .seg button:hover, .chip:hover, .place-result:hover { border-color: var(--vermilion); background: rgba(255, 250, 238, 0.9); }
.seg button.on { background: var(--vermilion); border-color: var(--vermilion); color: #f6eedc; box-shadow: inset 0 0 0 2px rgba(246, 238, 220, 0.25); }
.chip { font-weight: 600; letter-spacing: 0.04em; }
.layers label { font-size: 14px; }
.layers input { accent-color: var(--vermilion); }
.link { color: var(--vermilion); font-family: var(--font); font-size: 13.5px; text-decoration: underline; text-decoration-color: rgba(125, 42, 34, 0.35); text-underline-offset: 3px; }
.small, .small p { color: var(--ink-soft); font-size: 13px; }
.legend { color: var(--ink-soft); font-size: 13px; }

/* map tools: round paper medallions with a double ring */
.icon-btn { color: var(--ink); background: var(--grain), var(--panel); border: 1px solid rgba(59, 48, 36, 0.55); border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px rgba(59, 48, 36, 0.3), var(--lift); font-family: var(--font); }
.icon-btn:hover { border-color: var(--vermilion); color: var(--vermilion); }
.map-tools svg { stroke-width: 1.6; }
#compassNeedle span { color: var(--vermilion); }
.topbar .map-tools + .chip { border-radius: 999px; background: var(--grain), var(--panel); border-color: rgba(59, 48, 36, 0.55);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px rgba(59, 48, 36, 0.3), var(--lift); padding: 8px 14px; }
.info .close { border-radius: 50%; }

/* story sites and the info card */
.site-list li { font-size: 15px; border-radius: 3px; }
.site-list li:hover, .site-list li.active { background: rgba(125, 42, 34, 0.08); }
.site-id { font-family: var(--font); font-weight: 600; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px rgba(59, 48, 36, 0.45); }
.info h3 { font-family: var(--font); font-weight: 500; font-size: 25px; line-height: 1.15; color: var(--ink); }
.info .sub { font-style: italic; color: var(--ink-soft); font-size: 14.5px; }
.info p { font-size: 15.5px; line-height: 1.5; }
.info .conflict { background: rgba(201, 147, 49, 0.14); border-left: 3px solid var(--warn); border-radius: 2px; }
.badge { font-family: var(--font); font-size: 13px; border-radius: 3px; letter-spacing: 0.02em; }
.hint { font-style: italic; font-size: 14px; border-radius: 999px; }
.ux-dialog::backdrop, .credits::backdrop { background: rgba(40, 28, 14, 0.35); backdrop-filter: blur(2px); }
.dialog-head h2, .welcome h2 { font-family: var(--font); font-weight: 500; font-size: 23px; color: var(--ink); }
.control-list dt { color: var(--vermilion); }
.ux-dialog input::placeholder { color: var(--ink-soft); font-style: italic; }
:focus-visible { outline: 2px solid var(--vermilion); }

/* map labels: engraved serif names with a paper halo; story sites as paper tags */
.lbl { font-family: var(--font); color: #2e261c; font-weight: 600;
  text-shadow: 0 0 3px #f3ead6, 0 0 3px #f3ead6, 0 0 7px rgba(243, 234, 214, 0.9); }
.lbl.city { font-size: 18px; font-weight: 600; letter-spacing: 0.02em; }
.lbl.town { font-size: 14.5px; }
.lbl.village { font-size: 13px; font-weight: 500; color: #3d3326; }
.lbl.peak { font-size: 13.5px; color: #5a3a24; }
.lbl.river { font-size: 14px; color: #2f5a6a; }
.lbl.region { font-size: 15px; color: #6b5a44; letter-spacing: 0.3em; font-variant: small-caps; }
.site-lbl { background: var(--grain), rgba(239, 230, 210, 0.95); color: var(--ink); font: 600 14px var(--font);
  border: 1px solid rgba(59, 48, 36, 0.5); box-shadow: 0 3px 10px rgba(45, 30, 12, 0.35); }
.site-lbl.small { font-size: 12.5px; background: rgba(239, 230, 210, 0.85); }
