@font-face {
  font-family: 'Noto Serif SC';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(assets/noto-serif-sc.woff2?v=0ff6d274a9de) format('woff2');
}

:root{--paper:#f4ecdb;--paper-deep:#e7dabd;--ink:#332f26;--muted:#756b58;--line:#cfbfa2;--red:#984332;--red-deep:#763023;--trail:#42675f;--trail-active:#284c44;--map:#eae2ce;--serif:'Noto Serif SC','Songti SC','STSong',serif;--sans:'PingFang SC','Microsoft YaHei',sans-serif}
*{box-sizing:border-box}body{margin:0;color:var(--ink);font:16px/1.6 var(--sans);background:var(--paper);overflow:hidden}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer}button,a{touch-action:manipulation}button:focus-visible,a:focus-visible{outline:2px solid var(--red);outline-offset:4px}button{border:0;background:none}a{color:inherit}button svg{width:18px;height:18px;flex:none}button{display:inline-flex;align-items:center;justify-content:center;gap:8px}button:disabled{opacity:.5;cursor:default}[hidden]{display:none!important}.skip-link{position:fixed;z-index:9999;left:10px;top:-80px;background:var(--ink);color:white;padding:10px}.skip-link:focus{top:10px}
.site-header{height:90px;display:flex;align-items:center;justify-content:space-between;padding:0 32px;border-bottom:1px solid var(--line);background:var(--paper);position:relative;z-index:600;box-shadow:0 2px 12px #64543806}.brand{display:flex;align-items:center;text-decoration:none;gap:15px}.brand-seal{font:28px/1 var(--serif);color:#f8e8cf;background:var(--red);border:3px double var(--paper);outline:1px solid var(--red);width:40px;height:43px;display:grid;place-items:center;transform:rotate(-3deg)}.brand-word{font:600 34px/1.3 var(--serif);letter-spacing:5px}.brand-divider{width:1px;height:34px;background:var(--line);margin:0 5px}.brand-description{font:500 16px/1.45 var(--serif);letter-spacing:2px}.brand-description>span{display:block;font:12px/1.8 var(--sans);color:var(--muted);letter-spacing:2px}.header-actions{display:flex;align-items:center;gap:28px}.edition{font:14px var(--sans);color:var(--muted)}.edition span{color:var(--red);margin:0 4px;font:500 18px var(--serif)}.text-button{font-size:14px;gap:9px}.text-button:hover{color:var(--red)}.atlas-layout{height:calc(100dvh - 90px);min-height:460px;display:flex}.sidebar{width:324px;flex:none;background:var(--paper);display:flex;flex-direction:column;position:relative;z-index:450;border-right:1px solid var(--line);box-shadow:4px 0 18px #56482b06}.eyebrow{font:500 13px var(--serif);color:var(--muted);letter-spacing:4px}.filters{padding:22px 24px 17px;flex:none}.filter-heading,.field-heading{display:flex;align-items:center;justify-content:space-between}.filter-heading{margin-bottom:20px}.filter-heading h2{font:600 24px var(--serif);margin:0;letter-spacing:2px}.reset-button{font-size:13px;color:var(--muted);padding:5px 0}.reset-button:hover{color:var(--red)}.field-heading{margin-bottom:10px}.field-heading h3{font-size:14px;font-weight:500;margin:0}.field-heading>span{font-size:12px;color:var(--muted)}.type-filters{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.type-button{border:1px solid var(--line);padding:9px 3px 8px;display:flex;flex-direction:column;gap:5px;border-radius:2px;font-size:14px;background:#f8f2e42b;transition:background .18s,border-color .18s}.type-button svg{width:22px;height:22px;color:#72614c;stroke-width:1.4}.type-button:hover{border-color:#a78267;background:#ebe0c9}.type-button[aria-pressed=true]{background:#9843320c;border-color:var(--red);color:var(--red);box-shadow:inset 0 0 0 1px #98433212}.type-button[aria-pressed=true] svg{color:var(--red)}.period-heading{margin-top:22px}.period-filters{display:flex;flex-wrap:wrap;gap:7px}.period-button{border:1px solid #d5c8ae;border-radius:2px;font-size:14px;line-height:1.4;padding:6px 11px}.period-button:hover{background:#e6d6b88a}.period-button[aria-pressed=true]{color:#fff3dd;background:var(--red);border-color:var(--red)}.filter-note{font-size:12px;color:#857760;margin:10px 0 0}.sidebar-foot{margin-top:auto;padding:13px 24px;border-top:1px solid var(--line);font:13px var(--serif);letter-spacing:2px;color:var(--muted);display:flex;align-items:center;gap:10px}.tiny-seal{color:var(--red);border:1px solid #98433290;font:14px/1.3 var(--serif);padding:0 2px}
.map-surface{position:relative;flex:1;min-width:0;overflow:hidden;background:var(--map)}#map{height:100%;width:100%;background:var(--map);font:14px var(--sans);z-index:1}#map:after{content:'';position:absolute;inset:0;background-image:url('assets/paper.webp');background-size:800px auto;opacity:.29;pointer-events:none;z-index:300;mix-blend-mode:multiply}.leaflet-container{cursor:grab!important}.leaflet-dragging .leaflet-container{cursor:grabbing!important}.leaflet-control-attribution{background:#eee4cdbc!important;color:#776c56!important;font-size:10px!important;padding:3px 8px!important}.leaflet-control-attribution a{color:#776c56}.map-actions{position:absolute;right:25px;top:28px;z-index:410;display:flex;gap:8px}.map-button{border:1px solid #bba887;background:#f7eedcde;box-shadow:0 2px 8px #5a422011;font-size:14px;padding:9px 13px;border-radius:2px}.map-button:hover{background:#fff5de;color:var(--red)}.map-help{position:absolute;left:35px;bottom:38px;z-index:400;display:flex;align-items:center;gap:8px;font-size:12px;color:#7a6c53;pointer-events:none}.help-dot{width:5px;height:5px;background:var(--red);transform:rotate(45deg)}.compass{position:absolute;right:30px;bottom:150px;z-index:400;width:48px;opacity:.7;text-align:center;color:#6a5437;pointer-events:none}.compass>span{font:13px var(--serif)}.compass svg{display:block;width:48px;height:48px;fill:none;stroke:#816c4c;stroke-width:.6}.compass .needle{fill:var(--red);stroke:var(--red)}.leaflet-bottom.leaflet-right{bottom:29px;right:27px}.leaflet-control-zoom{border:1px solid #bba887!important;box-shadow:0 2px 8px #5a422011!important;border-radius:2px!important}.leaflet-control-zoom a{background:#f8efdded!important;color:#69583f!important;width:37px!important;height:36px!important;line-height:36px!important;border-radius:0!important;font-family:var(--sans)!important;font-size:23px!important;font-weight:400!important}.leaflet-control-zoom a:first-child{border-bottom:1px solid #c8b697!important}.leaflet-control-zoom a:hover{background:#fff4da!important;color:var(--red)!important}.leaflet-control-scale{margin-left:35px!important;margin-bottom:70px!important}.leaflet-control-scale-line{background:none!important;border-color:#8b7c64!important;color:#81725a!important;font-size:10px!important;text-shadow:none!important}.province-label{font:14px var(--serif);white-space:nowrap;color:#877451;letter-spacing:2px;text-align:center;pointer-events:none}.province-label span{text-shadow:0 1px 3px #f0e6ce,1px 0 3px #f0e6ce}.map-grid{pointer-events:none}.heritage-marker{width:33px!important;height:33px!important;display:flex;align-items:center;justify-content:center;background:#f7edd8ef;border:1.4px solid var(--marker-color,#984332);color:var(--marker-color,#984332);box-shadow:0 2px 5px #57401e20;border-radius:50%;transition:background .15s,box-shadow .15s;cursor:pointer!important}.heritage-marker svg{width:20px;height:20px;stroke-width:1.7;fill:none;stroke:currentColor}.heritage-marker:hover,.heritage-marker.is-selected{background:var(--marker-color,#984332);color:#fff2d9;box-shadow:0 0 0 5px #98433218}.heritage-marker:focus-visible{outline:2px solid var(--red);outline-offset:4px}.cluster-marker{width:40px!important;height:40px!important;color:#834d36;background:#f4e7cce8;border:1px solid #a7825a;box-shadow:inset 0 0 0 3px #f5ead6,inset 0 0 0 4px #b59971,0 3px 8px #57401e20;border-radius:50%;display:grid;place-items:center;font:500 17px var(--serif);cursor:pointer!important}.cluster-marker:hover{background:#ddc5a0}.map-status{position:absolute;bottom:30px;left:50%;transform:translateX(-50%);z-index:420;border:1px solid var(--line);background:#fbf2df;padding:10px 16px;font-size:14px;max-width:90%;text-align:center}
.leaflet-popup-content-wrapper{background:var(--paper)!important;color:var(--ink)!important;border:1px solid #bca78a;border-radius:3px!important;box-shadow:0 6px 25px #49372025!important;padding:0!important;overflow:hidden}.leaflet-popup-content{margin:0!important;width:260px!important;font:14px/1.6 var(--sans)!important}.leaflet-popup-tip{background:var(--paper)!important;box-shadow:none!important}.hover-image{display:block;width:260px;height:136px;object-fit:cover}.hover-info{padding:12px 15px 13px}.hover-info h3{font:500 20px var(--serif);margin:0 0 5px}.hover-meta{font-size:12px;color:var(--muted)}.hover-info p{margin:8px 0 0;font-size:13px;line-height:1.7}.hover-note{display:block;margin-top:10px;color:var(--red);font-size:12px}.hover-actions{display:flex;justify-content:space-between;margin-top:10px;align-items:center}.hover-actions button{font-size:12px;color:var(--red);padding:4px 0}.hover-actions a{font-size:12px;color:var(--muted);text-underline-offset:3px}
.detail-panel{position:absolute;z-index:460;right:25px;top:82px;width:360px;max-height:calc(100% - 105px);overflow:auto;scrollbar-width:thin;background:var(--paper);border:1px solid #bba887;box-shadow:0 8px 36px #53402326;border-radius:2px;animation:reveal .22s ease-out}.detail-hero{height:195px;position:relative}.detail-hero img{width:100%;height:100%;object-fit:cover}.detail-close{position:absolute;right:12px;top:12px;background:#f6eddae8;width:31px;height:31px;border-radius:50%;box-shadow:0 2px 10px #0002}.detail-type{position:absolute;left:16px;bottom:14px;background:#f6eddae8;color:#635038;font-size:12px;padding:3px 9px;display:flex;align-items:center;gap:6px;border:1px solid #ecdcc3}.detail-type svg{width:14px;height:14px}.detail-body{padding:21px 24px 23px}.detail-name{font:600 28px/1.45 var(--serif);letter-spacing:1px;margin:8px 0 10px}.detail-era{display:inline-block;font-size:13px;color:var(--red);border-top:1px solid #c9a793;border-bottom:1px solid #c9a793;padding:3px 0;margin-bottom:15px}.detail-location{display:flex;align-items:flex-start;gap:7px;font-size:14px;color:var(--muted);line-height:1.7}.detail-location svg{width:15px;height:15px;flex:none;margin-top:4px}.detail-description{font-size:16px;line-height:1.85;margin:17px 0 21px}.detail-focus{border-left:2px solid #b7976e;padding-left:12px;font-size:14px;line-height:1.8;color:#756247;margin:0 0 23px}.detail-focus strong{font-weight:500;color:#584934}.primary-button{background:var(--red);color:#fff1d9;display:flex;align-items:center;justify-content:center;text-decoration:none;font-size:15px;gap:9px;padding:11px 16px;border:1px solid var(--red-deep);border-radius:2px;box-shadow:inset 0 0 0 2px #ffffff0d;transition:background .15s}.primary-button:hover{background:var(--red-deep)}.primary-button svg{width:17px;height:17px}.detail-sources{border-top:1px solid var(--line);margin-top:20px;padding-top:12px;font-size:12px;color:var(--muted);line-height:1.8}.detail-sources summary{cursor:pointer;list-style:disclosure-closed;font-size:12px}.detail-sources[open] summary{list-style:disclosure-open}.detail-sources p{margin:8px 0 0;overflow-wrap:anywhere}.detail-sources a{text-underline-offset:3px}.about-dialog{border:1px solid #bba887;background:var(--paper);color:var(--ink);max-width:560px;width:calc(100% - 32px);max-height:85dvh;padding:36px 38px;box-shadow:0 16px 80px #31251d35}.about-dialog::backdrop{background:#2b271a60;backdrop-filter:blur(3px)}.about-dialog h2{font:600 28px var(--serif);margin:15px 0 22px}.about-dialog p{font-size:16px;line-height:1.85;margin:15px 0}.about-dialog strong{font:600 17px var(--serif);color:var(--red)}.about-dialog .about-lifetime{font-size:13px;color:var(--muted)}.source-note{border-top:1px solid var(--line);padding-top:10px;margin-top:22px}.source-note summary{font-size:13px;color:var(--muted);cursor:pointer}.source-note p{font-size:13px;color:var(--muted)}.about-dialog .primary-button{width:100%;margin-top:24px}.icon-button{width:32px;height:32px;flex:none}.icon-button:hover{background:#e7dac2}.dialog-close{position:absolute;right:12px;top:12px}.mobile-filter-button,.mobile-close,.mobile-help{display:none}@keyframes reveal{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(min-width:1600px){.sidebar{width:350px}.filters{padding-left:28px;padding-right:28px}.type-button{padding-top:12px;padding-bottom:10px}.detail-panel{width:390px}.detail-hero{height:215px}}
@media(max-height:780px) and (min-width:761px){.site-header{height:76px}.atlas-layout{height:calc(100dvh - 76px)}.filters{padding-top:14px;padding-bottom:13px}.filter-heading{margin-bottom:14px}.type-button{padding:7px 3px 6px;gap:3px}.period-heading{margin-top:15px}.period-button{padding:5px 10px}.field-heading{margin-bottom:7px}.detail-hero{height:155px}.detail-body{padding-top:15px}.detail-description{margin-top:12px;margin-bottom:16px}}
@media(max-width:1100px) and (min-width:761px){.sidebar{width:295px}.filters{padding-left:19px;padding-right:19px}.detail-panel{width:320px}.edition{display:none}.detail-body{padding-left:21px;padding-right:21px}}
@media(max-width:760px){body{overflow:hidden}.site-header{height:72px;padding:0 17px}.brand{gap:11px}.brand-seal{width:30px;height:34px;font-size:23px;border-width:2px}.brand-word{font-size:27px;letter-spacing:3px}.brand-divider,.brand-description,.edition,.about-button span{display:none}.header-actions{gap:16px}.about-button{width:28px;padding:0}.about-button svg{width:19px;height:19px}.mobile-filter-button{display:inline-flex;font-size:14px;gap:6px}.atlas-layout{height:calc(100dvh - 72px);min-height:0}.sidebar{position:fixed;left:0;top:72px;bottom:auto;max-height:calc(100dvh - 72px);width:min(330px,calc(100vw - 38px));transform:translateX(-105%);transition:transform .22s;z-index:650;box-shadow:6px 0 30px #32261925}.sidebar.open{transform:translateX(0)}.mobile-close{display:inline-flex}.filters{padding-top:16px}.filter-heading{margin-bottom:16px}.sidebar-backdrop{position:fixed;inset:72px 0 0;background:#2b271a45;z-index:640;display:block}.map-actions{right:15px;top:23px}.map-button{padding:8px 10px;font-size:13px;gap:6px}.map-button svg{width:15px;height:15px}.map-help{left:21px;bottom:31px;font-size:12px}.desktop-help{display:none}.mobile-help{display:inline}.compass{right:20px;bottom:120px;width:38px}.compass svg{width:38px;height:38px}.leaflet-bottom.leaflet-right{bottom:25px;right:15px}.leaflet-control-scale{margin-left:21px!important;margin-bottom:58px!important}.leaflet-control-zoom a{width:34px!important;height:34px!important;line-height:34px!important}.province-label{font-size:12px;letter-spacing:0}.heritage-marker{width:30px!important;height:30px!important}.heritage-marker svg{width:18px;height:18px}.detail-panel{left:10px;right:10px;top:auto;bottom:20px;width:auto;max-height:min(74dvh,620px);z-index:470}.detail-hero{height:160px}.detail-body{padding:19px 22px 21px}.detail-name{font-size:26px}.detail-description{margin:13px 0 18px}.detail-focus{margin-bottom:18px}.about-dialog{padding:28px 24px}.about-dialog h2{font-size:25px}.leaflet-control-attribution{font-size:9px!important;max-width:100%;white-space:normal}.map-status{bottom:30px}.sidebar-foot{padding-top:10px;padding-bottom:10px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.leaflet-tile-pane{filter:sepia(.82) saturate(.55) contrast(.85) brightness(1.06)}
.site-header:after{content:"";position:absolute;left:0;right:0;bottom:3px;border-top:1px solid #cfbfa244;pointer-events:none}
.map-surface:after{content:"";position:absolute;inset:12px;border:1px solid #9d84582b;z-index:390;pointer-events:none}
.atlas-layout{min-height:0}.sidebar{overflow-y:auto;scrollbar-width:thin;scrollbar-color:#c5b493 transparent}

.detail-dating{border:1px solid #c9b797;background:#e9dcc333;padding:12px 13px;margin:0 0 17px}.dating-basis{display:block;color:var(--red);font:500 13px var(--serif);letter-spacing:1px;margin-bottom:7px}.detail-dating dl,.hover-dating dl{margin:0}.detail-dating dl>div{margin-top:6px}.detail-dating dt{font-size:12px;color:var(--muted);line-height:1.6}.detail-dating dd{margin:1px 0 0;font-size:15px;line-height:1.65;overflow-wrap:anywhere}.detail-dating .dating-note{border-top:1px solid var(--line);padding-top:9px;margin:10px 0 0;font-size:13px;line-height:1.75;color:var(--muted)}
.hover-dating{border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin-top:9px;padding:8px 0}.hover-dating .dating-basis{font-size:12px;margin-bottom:4px}.hover-dating dl>div{display:grid;grid-template-columns:56px minmax(0,1fr);gap:7px;margin-top:3px}.hover-dating dt{font-size:12px;color:var(--muted)}.hover-dating dd{margin:0;font-size:13px;line-height:1.6;overflow-wrap:anywhere}

/* A reading trail on the map, with the weight and rhythm of a paper scroll. */
[hidden] { display:none !important; }
/* Keep the head of the foreground stone lion visible in wide photo cards. */
img[src="assets/photos/tang-tailing.jpg"] { object-position:50% 12%; }
button:disabled { cursor:default; opacity:.55; }
.exploration-header-button { color:var(--red); gap:8px; white-space:nowrap; }
.exploration-header-button svg { width:20px; height:20px; }
.exploration-count { font-size:12px; border:1px solid #a46654; min-width:22px; height:22px; padding:0 5px; display:inline-flex; align-items:center; justify-content:center; border-radius:2px; }
.trail-dock { position:absolute; z-index:435; left:25px; right:25px; bottom:29px; border:1px solid #bca27b; background:#f5ead5 url('assets/paper.webp') center/750px; box-shadow:0 6px 24px #4832171c; padding:13px 18px 10px; }
.has-detail .trail-dock { right:410px; }
.trail-dock::before,.trail-dock::after { content:''; width:5px; position:absolute; top:-4px; bottom:-4px; background:#87613e; border:1px solid #68472d; border-radius:3px; }
.trail-dock::before { left:-6px; } .trail-dock::after { right:-6px; }
.dock-heading { display:flex; align-items:center; gap:12px; }
.dock-title { border:0; background:none; padding:0; color:var(--ink); display:flex; gap:8px; align-items:center; font:600 17px var(--serif); text-align:left; min-width:0; }
.dock-title svg { width:19px; height:19px; flex:none; color:var(--red); }
.dock-title span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:300px; }
.dock-state { font-size:13px; color:var(--muted); white-space:nowrap; }
.dock-expand { margin-left:auto; flex:none; min-height:32px; font-size:14px; line-height:1.4; color:var(--red); padding:4px 6px; background:none; border:1px solid #98433280; border-radius:2px; white-space:nowrap; }
.dock-expand:hover { border-color:var(--red); background:#9843320c; }
.dock-stops { display:flex; align-items:center; overflow-x:auto; gap:12px; margin-top:9px; padding:2px 0 5px; scrollbar-width:thin; scrollbar-color:#b59e7b transparent; }
.dock-stop-group { display:flex; flex:none; align-items:center; gap:3px; }
.dock-remove-stop { flex:none; width:26px; height:26px; padding:0; color:var(--muted); border-radius:2px; }
.dock-remove-stop svg { width:14px; height:14px; }.dock-remove-stop:hover { color:var(--red); background:#9843320c; }
.dock-stop { padding:2px 0; display:flex; flex:none; align-items:center; gap:6px; font:500 14px var(--serif); color:var(--muted); border:0; background:none; }
.dock-stop span { display:inline-flex; align-items:center; justify-content:center; width:21px; height:21px; background:#e3eae0; color:var(--trail); border:1px solid #729084; border-radius:50%; font:12px var(--sans); }
.dock-stop.active { color:var(--red); }.dock-stop.active span { background:var(--trail-active); border-color:var(--trail-active); color:#fff5e1; }
.dock-map-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; border-top:1px solid #b59e7538; padding-top:6px; }
.dock-map-actions .text-button { font-size:12px; color:var(--muted); padding:0; }
.route-legend { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); }
.route-legend i { display:inline-block; width:15px; border-top:2px solid var(--red); }
.route-legend .dashed-line { border-color:#7a705d; border-top-style:dashed; margin-left:9px; }

.has-trail .map-help,.has-trail .compass { display:none; }
.has-trail .leaflet-control-scale { margin-bottom:168px !important; }
.has-trail .leaflet-bottom.leaflet-right { bottom:170px; }
.has-trail .map-status { bottom:164px; }
.trail-number { display:flex !important; align-items:center; justify-content:center; background:var(--trail); color:#fff4dd; border:1px solid #f6ebd7; border-radius:50%; font:600 12px var(--sans); box-shadow:0 1px 5px #263e353d; cursor:pointer; }
.trail-number.active { background:var(--trail-active); box-shadow:0 0 0 2px var(--trail-active),0 1px 5px #263e353d; }
.detail-view-tabs { display:flex; border-bottom:1px solid var(--line); gap:18px; margin:17px 0 10px; }
.detail-view-tabs button { border:0; border-bottom:2px solid transparent; background:none; padding:8px 0 10px; font:500 15px var(--serif); color:var(--muted); white-space:nowrap; }
.detail-view-tabs button[aria-selected=true] { color:var(--red); border-bottom-color:var(--red); }
.detail-view-tabs button span { font:12px var(--sans); margin-left:3px; }
.detail-panel.showing-relations .detail-hero { height:145px; }.detail-panel.showing-relations .detail-name { margin-top:0; }.detail-panel.showing-relations .detail-era { margin-bottom:0; }
.detail-trail-note { display:flex; align-items:center; gap:6px; margin:0 0 16px; color:var(--muted); font-size:12px; }
.detail-trail-note svg { width:14px; height:14px; flex:none; }.detail-trail-note button { border:0; background:none; padding:2px 0; margin-left:auto; color:var(--red); font-size:12px; white-space:nowrap; }
.relation-card { border:1px solid #bca27b80; padding:15px; margin-bottom:14px; background:#f5ebd952; }
.relation-label { font:500 13px var(--serif); letter-spacing:.5px; color:var(--red); }
.relation-destination { display:flex; align-items:center; gap:12px; margin:12px 0; }.relation-destination img { width:80px; height:72px; flex:none; object-fit:cover; filter:sepia(.1); }.relation-destination>div { min-width:0; }.relation-destination h3 { font:600 19px var(--serif); margin:0 0 5px; }.relation-destination span { display:block; color:var(--muted); font-size:13px; line-height:1.6; }
.relation-card h4 { font:500 16px var(--serif); margin:13px 0 7px; }.relation-card>p { font-size:16px; line-height:1.85; margin:7px 0 10px; }
.relation-card .relation-label { font-size:14px; }
.relation-state { display:block; color:var(--muted); font-size:14px; line-height:1.7; margin:9px 0 5px; }
.relation-card.is-visited { border-color:#bca27b55; background:#ede3d438; }
.relation-card.is-visited .next-station { background:transparent; }
.relation-card.is-visited .next-station:hover { background:var(--red); }
.theme-site-context { border-left:2px solid #9e7954; padding:10px 12px; background:#e9dbc33d; margin:12px 0; }
.theme-site-context>span { color:var(--muted); font-size:14px; }
.theme-site-context h4 { font:500 16px/1.7 var(--serif); margin:4px 0; }
.theme-site-context p { font-size:16px; line-height:1.8; margin:4px 0 0; }
.theme-readings { margin:10px 0; padding-left:11px; border-left:1px solid #c1aa87; }
.theme-readings p { font-size:14px; line-height:1.8; margin:5px 0; }
.theme-readings p span { color:var(--muted); }
.connection-reading { display:block; font:500 16px/1.8 var(--serif); margin-top:4px; }
.relation-sources { color:var(--muted); font-size:12px; line-height:1.8; margin:8px 0 12px; }.relation-sources summary { cursor:pointer; }.relation-sources a { display:block; margin:6px 0; overflow-wrap:anywhere; text-underline-offset:3px; }
.next-station { color:var(--red); border:1px solid #ab785a; background:#faf2e3; font:500 14px var(--serif); width:100%; padding:10px 8px; margin-top:3px; }.next-station:hover { color:#fff3dd; background:var(--red); border-color:var(--red); }
.relations-empty { border:1px dashed #bca47d; padding:18px; font-size:16px; line-height:1.85; }.relations-empty strong { font:500 18px var(--serif); }.relations-empty p { color:var(--muted); }.relations-empty .text-button { color:var(--red); font-size:14px; }
.exploration-dialog { border:1px solid #a78a61; background:var(--paper) url('assets/paper.webp') center/900px; color:var(--ink); padding:0; width:min(1000px,calc(100% - 48px)); max-width:1000px; max-height:88dvh; box-shadow:0 15px 90px #2e231b40; scrollbar-width:thin; scrollbar-color:#bba887 transparent; }
.exploration-dialog::backdrop { background:#2b271a66; backdrop-filter:blur(3px); }
.exploration-dialog-heading { display:flex; align-items:center; justify-content:space-between; padding:24px 30px 20px; border-bottom:1px solid var(--line); background:#f2e7d1; }
.exploration-dialog-heading h2 { font:600 30px var(--serif); margin:5px 0 0; letter-spacing:3px; }.exploration-dialog-heading .icon-button { width:40px; height:40px; }

.exploration-body { padding:20px 30px 28px; }

.exploration-toolbar { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; border-bottom:1px solid var(--line); padding-bottom:16px; }
.exploration-toolbar>div { min-width:0; }.exploration-toolbar strong { font:500 23px/1.4 var(--serif); }.exploration-toolbar p { font-size:14px; color:var(--muted); line-height:1.75; margin:7px 0 0; }.exploration-toolbar>.text-button { color:var(--red); white-space:nowrap; padding:5px 0; font-size:14px; }
.exploration-lifetime { color:var(--muted); font-size:14px; line-height:1.75; margin:14px 0 22px; }
.exploration-themes { margin-top:24px; border-top:1px solid var(--line); padding-top:18px; }.exploration-themes>summary { color:var(--red); font-size:14px; cursor:pointer; line-height:1.75; }.exploration-themes .scroll-story-grid { margin-top:18px; }
.scroll-stops { list-style:none; padding:0; margin:0; }
.scroll-stop-card { display:grid; grid-template-columns:32px 120px minmax(0,1fr) 28px; align-items:start; gap:17px; padding:20px 18px; border:1px solid #bca47d80; background:#faf3e69c; }
.scroll-stop-card.active { border-color:#a36b4d; }.scroll-stop-number { color:var(--trail); font:500 19px var(--serif); padding-top:5px; }
.scroll-stop-photo { padding:0; border:0; background:none; }.scroll-stop-photo img { width:120px; height:100px; object-fit:cover; filter:sepia(.12); }.scroll-stop-info { min-width:0; }
.scroll-stop-location { display:block; font-size:12px; color:var(--muted); letter-spacing:.5px; }.scroll-stop-name { display:block; border:0; background:none; padding:0; margin:5px 0 7px; text-align:left; color:var(--ink); font:600 23px var(--serif); }
.scroll-stop-basis { font-size:12px; color:#8b6748; }.scroll-stop-dates { display:flex; flex-wrap:wrap; gap:2px 16px; margin:4px 0 14px; }.scroll-stop-dates span { font-size:14px; line-height:1.75; }

.continue-stop { color:var(--red); padding:9px 0 0; font-size:14px; }.remove-stop { width:28px; height:28px; color:var(--muted); }
.scroll-connection { display:grid; grid-template-columns:168px minmax(0,1fr); gap:17px; padding:15px 20px 16px; }.connection-line { width:1px; min-height:40px; background:var(--red); margin-left:15px; position:relative; }.connection-line::after { content:''; position:absolute; left:-3px; top:50%; width:7px; height:7px; border-radius:50%; background:var(--red); }.scroll-connection p { font-size:14px; line-height:1.8; color:#6b5945; margin:6px 0 0; }.scroll-connection .relation-sources { margin-bottom:0; }.free-jump .connection-line { background:repeating-linear-gradient(to bottom,#9f8b6e 0 4px,transparent 4px 9px); }.free-jump .connection-line::after { background:#9f8b6e; }.free-jump .relation-label { color:var(--muted); }.branch-origin { display:block; color:var(--muted); font-size:12px; margin-top:4px; }
.scroll-editor-foot { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-top:24px; padding-top:18px; border-top:1px solid var(--line); }.scroll-editor-foot>span { font-size:13px; color:var(--muted); }.scroll-editor-foot .primary-button { font-size:14px; }
.scroll-empty { text-align:center; padding:24px 0 4px; }.empty-scroll-seal { display:inline-flex; color:var(--red); border:2px solid var(--red); font:27px var(--serif); width:39px; height:42px; align-items:center; justify-content:center; transform:rotate(-4deg); }.scroll-empty h3 { font:500 25px var(--serif); margin:18px 0 9px; }.scroll-empty>p { font-size:16px; line-height:1.8; color:var(--muted); margin:9px 0 22px; }.scroll-empty>.text-button { font-size:14px; color:var(--red); margin-top:20px; }
.scroll-story-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; text-align:left; }.scroll-story { padding:22px; border:1px solid #bca27b90; background:#faf2e2a0; }.scroll-story h4 { font:500 25px var(--serif); margin:13px 0 12px; }.scroll-story p { font-size:15px; line-height:1.85; margin:10px 0; color:#6b5945; }.scroll-story .story-route { font-size:13px; color:var(--muted); border-top:1px solid var(--line); padding-top:10px; }.scroll-story .primary-button { width:100%; margin-top:12px; font-size:14px; }

.atlas-toast { position:fixed; left:50%; bottom:22px; transform:translateX(-50%); z-index:1100; max-width:calc(100vw - 30px); width:max-content; border:1px solid #876749; background:#483b2df2; color:#fff3dd; padding:12px 17px; box-shadow:0 4px 22px #2e231b35; font-size:14px; line-height:1.65; text-align:center; }.atlas-toast button { color:#fff3dd; background:none; border:0; text-decoration:underline; padding:0 0 0 14px; }
.exploration-dialog .atlas-toast { position:sticky; top:auto; bottom:0; left:auto; transform:none; width:100%; max-width:100%; border:0; margin:0; }
.remove-trail-dialog { width:calc(100% - 32px); max-width:440px; max-height:calc(100dvh - 32px); overflow:auto; padding:26px 28px; border:1px solid #bca27b; background:var(--paper) url('assets/paper.webp') center/750px; color:var(--ink); box-shadow:0 12px 50px #31251d35; }
.remove-trail-dialog::backdrop { background:#2b271a60; }
.remove-trail-dialog h2 { font:600 24px var(--serif); margin:0 0 16px; }.remove-trail-dialog p { font-size:16px; line-height:1.85; margin:12px 0; }.remove-trail-dialog .remove-trail-kept { font-size:14px; color:var(--muted); }
.remove-trail-actions { display:flex; justify-content:flex-end; gap:12px; margin-top:22px; }.remove-trail-actions>button { min-height:44px; padding:9px 16px; }.remove-trail-actions .text-button { border:1px solid var(--line); border-radius:2px; }
@media (min-width:1600px) { .has-detail .trail-dock { right:438px; } }
@media (max-width:1100px) and (min-width:761px) { .has-detail .trail-dock { right:355px; }.has-detail .dock-heading { flex-wrap:wrap; gap:5px 10px; }.has-detail .dock-title { width:100%; }.has-detail .dock-title span { max-width:235px; }.has-detail .route-legend { display:none; }.has-detail .dock-map-actions { justify-content:flex-end; }.edition { display:none; } }
@media (max-width:760px) {
  .site-header { padding:0 14px; }.header-actions { gap:12px; }.exploration-header-button { gap:5px; font-size:14px; }.exploration-header-button svg { width:17px; height:17px; }.exploration-count { font-size:11px; width:18px; min-width:18px; height:18px; padding:0 2px; }.mobile-filter-button { font-size:14px; }
  .trail-dock,.has-detail .trail-dock { left:17px; right:17px; bottom:23px; padding:10px 12px 7px; }
  .dock-heading { gap:7px; }.dock-title { font-size:15px; gap:5px; }.dock-title svg { display:none; }.dock-title span { max-width:125px; }.dock-state { font-size:12px; }.dock-expand { font-size:12px; padding:4px 5px; }.dock-stops { gap:10px; margin-top:7px; }.dock-stop { font-size:13px; }.dock-stop span { width:18px; height:18px; font-size:11px; }.dock-map-actions { padding-top:4px; }.route-legend { font-size:11px; gap:4px; }.route-legend i { width:11px; }.route-legend .dashed-line { margin-left:5px; }.dock-map-actions .text-button { font-size:11px; }
  .dock-remove-stop { width:32px; height:32px; }
  .has-trail .leaflet-bottom.leaflet-right { bottom:155px; }.has-trail .leaflet-control-scale { margin-bottom:163px !important; }.has-trail .map-status { bottom:150px; font-size:11px; }
  .has-trail .detail-panel { bottom:161px; max-height:calc(100dvh - 290px); left:10px; right:10px; }.has-trail .detail-panel.showing-relations { max-height:min(52dvh,440px,calc(100dvh - 290px)); }.detail-panel.showing-relations .detail-hero { height:80px; }.detail-hero { height:135px; }.detail-body { padding:16px 19px 20px; }.detail-name { font-size:25px; }.detail-view-tabs { margin-top:13px; }.relation-card { padding:13px; }.relation-destination h3 { font-size:18px; }.relation-card>p { font-size:16px; }.detail-trail-note { font-size:12px; }
  .exploration-dialog { width:calc(100% - 20px); max-height:calc(100dvh - 24px); }.exploration-dialog-heading { padding:17px 19px 14px; }.exploration-dialog-heading h2 { font-size:25px; }.exploration-body { padding:17px 18px 22px; }

  .scroll-stop-card { grid-template-columns:25px minmax(0,1fr) 24px; gap:10px; padding:15px 12px; }.scroll-stop-photo { grid-column:2; width:100%; height:120px; }.scroll-stop-photo img { width:100%; height:120px; }.scroll-stop-info { grid-column:2; }.scroll-stop-number { grid-row:1; font-size:17px; }.remove-stop { grid-column:3; grid-row:1; }.scroll-stop-name { font-size:22px; }.scroll-stop-dates { flex-direction:column; gap:0; margin-bottom:12px; }.scroll-stop-dates span { font-size:14px; }.continue-stop { font-size:14px; }
  .scroll-connection { grid-template-columns:25px minmax(0,1fr); gap:10px; padding:14px 12px; }.connection-line { margin-left:12px; }.scroll-connection p { font-size:14px; }.scroll-connection .relation-label { font-size:13px; }.scroll-editor-foot { flex-direction:column; align-items:stretch; gap:12px; text-align:center; }.scroll-editor-foot .primary-button { width:100%; }
  .scroll-empty { padding-top:18px; }.scroll-empty h3 { font-size:23px; }.scroll-empty>p { font-size:15px; }.scroll-story-grid { grid-template-columns:1fr; gap:14px; }.scroll-story { padding:18px; }.scroll-story h4 { font-size:24px; }
  .atlas-toast { bottom:auto; top:82px; font-size:13px; padding:10px 13px; }.exploration-dialog~.atlas-toast { pointer-events:auto; }
}
@media (max-width:360px) { .header-actions { gap:9px; }.brand { gap:8px; }.brand-word { font-size:24px; }.exploration-header-button { font-size:13px; gap:4px; }.exploration-count { display:none; }.dock-title span { max-width:90px; } }
@media (max-width:360px) {
  .has-trail .detail-panel { bottom:177px; max-height:calc(100dvh - 306px); }
  .has-trail .detail-panel.showing-relations { max-height:min(52dvh,440px,calc(100dvh - 306px)); }
  .has-trail .leaflet-bottom.leaflet-right { bottom:171px; }.has-trail .leaflet-control-scale { margin-bottom:179px !important; }.has-trail .map-status { bottom:166px; }
}

@media (max-width:760px) { .exploration-toolbar { gap:12px; }.exploration-toolbar strong { font-size:21px; }.exploration-toolbar p,.exploration-lifetime { font-size:14px; }.exploration-lifetime { margin-bottom:18px; } }

/* Overlapping themes: mapped places, shared junctions and explicitly pending places. */

.exploration-tabs { display:flex; gap:28px; padding:0 30px; border-bottom:1px solid var(--line); }
.exploration-tabs button { padding:13px 0 11px; border-bottom:2px solid transparent; color:var(--muted); font:500 17px var(--serif); }
.exploration-tabs button[aria-selected=true] { color:var(--red); border-color:var(--red); }
.theme-search-label { display:block; font:500 17px var(--serif); margin-bottom:8px; }
.theme-search-field { display:flex; align-items:center; gap:12px; padding:10px 13px; border:1px solid #bca27b; background:#fbf4e6a0; }
.theme-search-field input { min-width:0; flex:1; width:100%; border:0; border-radius:0; background:transparent; color:var(--ink); font:16px/1.6 var(--sans); outline-offset:4px; }
.theme-search-field input::placeholder { color:var(--muted); }.theme-search-field input::-webkit-search-cancel-button { appearance:none; }
.theme-search-field:focus-within { border-color:var(--red); }.theme-search-field .text-button { flex:none; color:var(--red); }
.theme-category-filters { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0 22px; }
.theme-category-filters button { border:1px solid var(--line); padding:7px 12px; font:500 15px/1.6 var(--serif); background:#f8efdf; }
.theme-category-filters button:hover { border-color:var(--red); }.theme-category-filters button[aria-pressed=true] { color:var(--red); border-color:var(--red); background:#98433209; }
.theme-list-title { font:500 22px/1.5 var(--serif); margin:0 0 14px; }
.theme-preview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
.theme-preview { border:1px solid #bca27b90; background:#faf2e27a; min-width:0; }
.theme-preview:hover { border-color:#a1785c; }.theme-preview-button { display:flex; align-items:stretch; width:100%; padding:0; gap:0; text-align:left; }
.theme-preview-button>img { width:116px; height:136px; flex:none; object-fit:cover; filter:sepia(.1); }
.theme-preview-copy { display:flex; flex:1; flex-direction:column; align-items:flex-start; padding:13px 15px; min-width:0; }
.theme-preview-tag { font:12px/1.7 var(--sans); color:var(--muted); }
.theme-preview-copy strong { font:600 21px/1.55 var(--serif); margin:3px 0 6px; }
.theme-preview-summary { font:14px/1.75 var(--sans); color:var(--muted); }
.theme-search-empty { grid-column:1/-1; color:var(--muted); padding:18px 0; margin:0; }
.theme-back { margin-bottom:17px; color:var(--red); padding:3px 0; }
@media (max-width:760px) {
  .theme-preview-grid { grid-template-columns:minmax(0,1fr); gap:12px; }.theme-preview-button>img { width:80px; height:120px; }
  .theme-preview-copy { padding:10px 12px; }.theme-preview-copy strong { font-size:19px; line-height:1.6; margin:2px 0 4px; }
  .theme-preview-summary { font-size:13px; }.theme-category-filters { gap:7px; margin:13px 0 19px; }.theme-category-filters button { padding:6px 10px; font-size:14px; }
  .theme-search-label { font-size:16px; }.theme-list-title { font-size:20px; }
}
.theme-card { border:1px solid #bca27b90; background:#faf2e27a; padding:24px; margin-bottom:22px; }
.theme-card:last-child { margin-bottom:0; }
.theme-card-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.theme-card-heading>div { min-width:0; }
.theme-card h3 { font:600 27px/1.5 var(--serif); margin:7px 0 5px; letter-spacing:1px; }
.theme-card>p { font-size:15px; line-height:1.8; margin:10px 0; }
.theme-roster { display:flex; flex-wrap:wrap; gap:10px; margin:20px 0; }
.theme-place { display:inline-flex; align-items:center; justify-content:flex-start; gap:8px; padding:9px 12px; border:1px solid #bca27b90; font:500 15px var(--serif); background:#f8efdf; }
.theme-place small,.pending-badge { font:12px var(--sans); color:var(--muted); white-space:nowrap; }
.theme-place:hover { border-color:var(--red); color:var(--red); }
.shared-place { border-color:#a1785c; }.shared-place small { color:var(--red); }
.pending-place { border-style:dashed; color:var(--muted); background:none; }
.pending-place:hover { color:var(--muted); border-color:#bca27b90; }
.theme-start { padding:10px 18px; font-size:15px; }
.theme-chronology { border-top:1px solid var(--line); padding-top:16px; margin-top:20px; }
.theme-chronology h4 { font:600 20px/1.6 var(--serif); margin:0 0 12px; }
.chronology-lane+.chronology-lane { margin-top:18px; padding-top:14px; border-top:1px dashed var(--line); }
.chronology-lane h5 { font:500 17px/1.7 var(--serif); margin:0 0 10px; color:var(--ink); }
.chronology-kind { display:block; margin:2px 0 4px; font:12px/1.8 var(--sans); color:var(--muted); }
.theme-chronology ol { margin:0; padding-left:22px; }
.theme-chronology li { padding:0 0 15px 5px; overflow-wrap:anywhere; }
.theme-chronology li:last-child { padding-bottom:0; }
.theme-chronology li::marker { color:var(--muted); font:14px var(--serif); }
.chronology-date { display:block; padding-right:8px; color:var(--red); font:500 14px/1.8 var(--serif); }
.chronology-places { display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; }
.chronology-places .theme-endpoint { min-height:36px; max-width:100%; font-size:16px; text-align:left; }
.theme-chronology li>p { margin:7px 0; font-size:13px; line-height:1.8; color:var(--muted); }
.theme-relations,.theme-pending { border-top:1px solid var(--line); padding-top:12px; margin-top:14px; }
.theme-relations>summary,.theme-pending>summary { cursor:pointer; color:var(--red); font-size:14px; padding:3px 0; }
.theme-relations ol { list-style:none; margin:12px 0 0; padding:0; }
.theme-relations li { padding:17px 0 10px; border-bottom:1px solid #d5c8ae88; }
.theme-relations li:last-child { border-bottom:0; }
.theme-pair { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:0 0 9px; }
.theme-pair>span[aria-label] { color:#9b8060; }
.theme-endpoint { font:500 17px/1.7 var(--serif); color:var(--ink); border-bottom:1px solid #bca27b; padding:0; }
.theme-endpoint:hover { color:var(--red); border-color:var(--red); }
.pending-endpoint { color:var(--muted); font:500 17px/1.7 var(--serif); }
.pending-endpoint small { font:12px var(--sans); border:1px dashed #ab9473; padding:2px 4px; white-space:nowrap; }
.theme-relations li>p,.theme-pending article>p { font-size:15px; line-height:1.85; margin:8px 0; color:#6b5945; }
.theme-pending article { margin-top:16px; }
.theme-pending h4 { font:500 18px var(--serif); margin:0 0 8px; }
.pending-badge { border:1px dashed #ab9473; padding:3px 5px; margin-left:8px; }
.site-themes { padding:12px 0 14px; border-bottom:1px solid var(--line); }
.site-themes>span { color:#8b6748; font-size:14px; }
.site-themes>small { display:block; color:var(--muted); font-size:13px; line-height:1.7; margin-top:10px; }
.single-theme { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
.single-theme strong { font:500 15px/1.7 var(--serif); }
.theme-chips { display:flex; flex-wrap:wrap; gap:7px; margin-top:9px; }
.theme-chip { border:1px solid #bca27b90; background:#f7eedc; color:#6b5945; padding:7px 9px; font:500 14px var(--serif); }
.theme-chip:hover,.theme-chip.selected { color:var(--red); border-color:var(--red); background:#98433208; }
.active-theme-note { display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:13px; color:var(--muted); margin:14px 0; }
.relation-sequence { display:flex; flex-wrap:wrap; gap:3px 10px; align-items:baseline; border-left:2px solid var(--red); padding-left:10px; margin:0 0 12px; font:13px/1.8 var(--serif); }
.relation-sequence strong { color:var(--red); font-weight:600; }
.relation-sequence small { color:var(--muted); font:12px/1.8 var(--sans); }
.relation-sequence .sequence-origin { flex-basis:100%; }
.relation-sequence[data-chronology-direction="branch"] { border-color:var(--line); }
.pending-symbol { width:64px; height:64px; display:grid !important; place-items:center; flex:none; border:1px dashed #bca27b; font:25px var(--serif); color:#927b5a; }
.relation-card .pending-note { border-top:1px dashed #bca27b; padding-top:10px; font-size:14px; color:var(--muted); }
.pending-relation { border-style:dashed; }
.separate-root { font-size:14px; color:var(--muted); margin:20px 0 12px; }
@media (max-width:1100px) and (min-width:761px) { .header-actions { gap:18px; }.brand-description { letter-spacing:1px; }.brand { gap:12px; } }
@media (max-width:760px) {
  .header-actions { gap:9px; }

  .exploration-tabs { padding:0 18px; gap:24px; }.exploration-tabs button { font-size:16px; }
  .theme-card { padding:18px 15px; margin-bottom:18px; }.theme-card h3 { font-size:23px; letter-spacing:0; }.theme-card-heading { gap:10px; }
  .theme-card>p,.theme-relations li>p,.theme-pending article>p { font-size:15px; }.theme-roster { gap:8px; margin:16px 0; }
  .theme-place { font-size:14px; padding:8px 9px; gap:6px; }.theme-place small { font-size:11px; }
  .theme-start { width:100%; }.theme-pair { gap:7px; }.theme-endpoint,.pending-endpoint { font-size:16px; }
  .has-detail .dock-map-actions { flex-wrap:wrap; gap:6px 10px; }
}
@media (max-width:360px) { .brand { gap:7px; }.header-actions { gap:7px; } }

/* City lookup shares the atlas paper and ink controls. */
.sr-only { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.city-search { position:absolute; z-index:480; left:25px; top:28px; width:270px; max-width:calc(100% - 180px); }
.city-search-field { display:flex; align-items:center; min-height:44px; border:1px solid #bba887; background:#f7eedcf2; box-shadow:0 2px 8px #5a422011; border-radius:2px; }
.city-search-field:focus-within { border-color:var(--red); }
.city-search input { width:0; min-width:0; flex:1; border:0; outline:0; background:none; padding:10px 12px; font:14px/1.5 var(--sans); color:var(--ink); }
.city-search input::placeholder { color:var(--muted); }
.city-search input::-webkit-search-cancel-button { display:none; }
.city-clear { width:30px; min-height:42px; flex:none; padding:0; color:var(--muted); }
.city-clear svg { width:15px; height:15px; }
.city-locate { width:40px; min-height:42px; flex:none; border-left:1px solid #cfbfa266; color:var(--red); padding:0; }
.city-locate:hover,.city-clear:hover { background:#eadbc988; }
.city-results { margin:7px 0 0; padding:5px 0; list-style:none; width:340px; max-width:calc(100vw - 374px); max-height:310px; overflow-y:auto; background:var(--paper); border:1px solid #bba887; box-shadow:0 5px 20px #49372025; border-radius:2px; scrollbar-width:thin; }
.city-results li { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:10px 14px; cursor:pointer; }
.city-results li:hover,.city-results li[aria-selected=true] { background:#9843320b; color:var(--red); }
.city-results strong { font:500 16px/1.5 var(--serif); }
.city-results span { font-size:12px; color:var(--muted); white-space:nowrap; }
.city-search-message { margin:7px 0 0; padding:8px 11px; background:#f7eedcf2; border:1px solid var(--line); font-size:12px; line-height:1.7; }
@media (max-width:1100px) and (min-width:761px) { .city-search { width:225px; }.city-results { max-width:calc(100vw - 330px); } }
@media (max-width:760px) {
  .city-search { top:16px; left:18px; width:250px; max-width:calc(100% - 145px); }
  .city-search input { font-size:16px; padding:9px 10px; }
  .city-results { width:340px; max-width:calc(100vw - 36px); max-height:min(310px,48dvh); }
  .city-search-message { width:280px; max-width:calc(100vw - 36px); }
  .map-actions { top:16px; right:18px; }.map-actions .map-button { min-height:44px; }
}

.filter-heading-actions{display:flex;align-items:center;gap:12px}
.map-status .text-button{margin-left:12px;color:var(--red);text-decoration:underline}

.detail-photo-caption { margin:0 0 9px; font-size:12px; line-height:1.65; color:var(--muted); }
.site-photo-placeholder { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; background:var(--map); color:var(--muted); font:12px/1.5 var(--serif); text-align:center; }
.site-photo-placeholder svg { width:30px; height:30px; stroke:currentColor; fill:none; stroke-width:1.3; opacity:.7; }
.detail-hero>.site-photo-placeholder { width:100%; height:100%; }
.relation-destination>.site-photo-placeholder { flex:0 0 80px; width:80px; height:72px; gap:3px; font-size:10px; }
.relation-destination>.site-photo-placeholder svg { width:23px; height:23px; }
.scroll-stop-photo>.site-photo-placeholder { width:120px; height:100px; }
.theme-preview-button>.site-photo-placeholder { flex:0 0 116px; width:116px; height:136px; }
@media(max-width:760px) { .scroll-stop-photo>.site-photo-placeholder { width:100%; height:120px; } }

/* City experiences use a square seal beside the circular antiquity markers. */
.chronology-guide { margin:0 0 16px; color:var(--muted); font-size:13px; line-height:1.8; }
.theme-chronology .chronology-event { margin:0 0 15px; padding:10px 12px; border:1px dashed #b59d7b; background:#efe3cc55; }
.chronology-event .chronology-date { color:#76593e; }
.chronology-event-open { justify-content:flex-start; align-items:flex-start; text-align:left; padding:4px 0; font:500 16px/1.8 var(--serif); color:#624b34; }
.chronology-event-open svg { margin-top:5px; width:16px; height:16px; }
.chronology-event-open:hover { color:var(--red); }
.city-event-panel { position:absolute; z-index:470; top:82px; right:25px; display:flex; flex-direction:column; width:360px; max-height:calc(100% - 105px); overflow:hidden; padding:24px; border:1px solid #bba887; background:var(--paper) url('assets/paper.webp') center/750px; box-shadow:0 8px 36px #53402326; border-radius:2px; animation:reveal .22s ease-out; }
.city-event-body { min-height:0; overflow-y:auto; scrollbar-width:thin; overscroll-behavior:contain; padding-right:3px; }
.city-event-panel>.eyebrow { display:block; flex:none; padding-right:22px; letter-spacing:2px; line-height:1.8; }
.city-event-close { position:absolute; top:10px; right:10px; }
.city-event-date { margin:16px 0 5px; color:#76593e; font:500 14px/1.8 var(--serif); }
.city-event-panel h2 { margin:0 0 12px; font:600 26px/1.55 var(--serif); overflow-wrap:anywhere; }
.city-event-panel h2:focus-visible { outline:2px solid var(--red); outline-offset:3px; }
.city-event-location { display:flex; align-items:flex-start; gap:7px; font-size:14px; line-height:1.8; color:var(--muted); }
.city-event-location svg { width:15px; height:15px; flex:none; margin-top:5px; }
.city-event-reference { display:inline-block; margin-top:10px; padding:2px 7px; border:1px dashed #b59d7b; color:#76593e; font-size:12px; }
.city-event-description { margin:15px 0; font-size:15px; line-height:1.9; }
.city-event-sources { border-top:1px solid var(--line); padding-top:11px; color:var(--muted); font-size:12px; line-height:1.8; }
.city-event-sources summary { cursor:pointer; }
.city-event-sources a { display:block; margin-top:8px; overflow-wrap:anywhere; text-underline-offset:3px; }
.city-event-navigation { display:flex; justify-content:space-between; gap:12px; margin-top:14px; }
.city-event-actions { flex:none; }
.city-event-navigation button { min-height:40px; font-size:13px; padding:3px 0; }
.city-event-return { width:100%; margin-top:10px; font-size:14px; }
.city-event-marker { color:#6e5137; cursor:pointer !important; }
.city-event-seal { display:grid; place-items:center; width:36px; height:36px; border:1px solid #76593e; background:#f4e9d2f2; box-shadow:inset 0 0 0 3px #f4e9d2,inset 0 0 0 4px #ab9170,0 2px 8px #49372030; font:500 21px/1 var(--serif); }
.city-event-marker:focus-visible { outline:2px solid var(--red); outline-offset:4px; }
.city-event-map-label { position:absolute; top:43px; left:50%; transform:translateX(-50%); width:max-content; max-width:220px; padding:3px 7px; border:1px solid #b59d7b; background:#f4e9d2f2; box-shadow:0 2px 8px #49372018; white-space:nowrap; font:12px/1.7 var(--serif); }
.has-city-event .trail-dock { right:410px; }
.has-city-event .map-help,.has-city-event .compass { display:none; }
@media(max-width:1100px) and (min-width:761px) { .city-event-panel { width:320px; padding:20px; }.has-city-event .trail-dock { right:370px; } }
@media(max-width:760px) {
  .city-event-panel { top:auto; bottom:20px; left:10px; right:10px; width:auto; padding:18px; max-height:min(55dvh,calc(100dvh - 280px)); }
  .city-event-panel h2 { font-size:23px; }.city-event-date { margin-top:13px; }
  .city-event-actions { display:grid; grid-template-columns:1fr 1fr 1.2fr; gap:8px; margin-top:12px; }
  .city-event-navigation { display:contents; }
  .city-event-navigation button { min-height:44px; }.city-event-return { min-height:44px; }
  .city-event-return { margin-top:0; padding:8px 4px; font-size:13px; white-space:nowrap; }
  .has-city-event .trail-dock { right:18px; }
  .has-trail .city-event-panel { bottom:161px; max-height:min(42dvh,calc(100dvh - 425px)); }
}
@media(max-width:360px) { .has-trail .city-event-panel { bottom:177px; max-height:min(42dvh,calc(100dvh - 425px)); } }

/* A temporary, read-only performance of the existing dated stages. */
.chronology-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 14px; margin-bottom:12px; }
.chronology-heading h4,.chronology-heading h5 { margin:0; }
.chronology-play { min-height:36px; padding:5px 9px; border:1px solid #b59d7b; color:var(--red); font-size:13px; }
.chronology-play:hover { background:#9843320c; }
.chronology-play svg { width:15px; height:15px; }
.chronology-player { height:min(700px,calc(100% - 105px)); animation:none; }
.chronology-player-media { margin:12px 0; }
.chronology-context { padding:15px 0; border-bottom:1px solid var(--line); }
.chronology-context>span { font-size:12px; color:var(--muted); }
.chronology-context h3 { margin:7px 0; font-size:17px; line-height:1.7; }
.chronology-context p { font-size:14px; line-height:1.9; }
.chronology-visit-label { display:block; margin-top:12px; font-size:12px; color:var(--muted); }
#chronology-visit { width:100%; margin-top:5px; padding:9px 5px; border:1px solid var(--line); background:var(--paper); color:var(--ink); font:13px/1.7 var(--serif); }
.chronology-cohort { display:flex; flex-wrap:wrap; gap:5px 10px; margin:10px 0; }
.chronology-cohort>span { width:100%; font-size:12px; color:var(--muted); }
.chronology-cohort button { min-height:36px; font-size:13px; }
.chronology-next { margin-top:15px; }.chronology-next .relation-sequence { margin-bottom:12px; }
.chronology-cohort-note { font-size:12px; color:var(--muted); }
.chronology-ended { padding:20px 0; display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.stop-episode { display:block; color:var(--red); font-size:12px; line-height:1.8; margin:4px 0; }
.chronology-player-media figure { margin:0; min-width:0; }
.chronology-player-media img,.chronology-player-media .site-photo-placeholder { display:block; width:100%; height:170px; object-fit:cover; border:1px solid var(--line); }
.chronology-player-media .site-photo-placeholder { display:flex; }
.chronology-player-media figcaption { margin-top:6px; color:var(--muted); font-size:11px; line-height:1.7; overflow-wrap:anywhere; }
.chronology-player-media figcaption strong { display:block; font-weight:500; color:var(--ink); }
.chronology-player-media figcaption>span { display:block; }
.chronology-photo-credit a { text-underline-offset:2px; }
.chronology-player-media.multiple { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.chronology-player-media.multiple img,.chronology-player-media.multiple .site-photo-placeholder { height:105px; }
.chronology-player-places { display:flex; flex-wrap:wrap; gap:8px 14px; margin:12px 0; }
.chronology-player-places .theme-endpoint { font-size:14px; text-align:left; }
.chronology-player-controls { flex:none; padding-top:10px; border-top:1px solid var(--line); }
.chronology-status { margin:0 0 5px; color:var(--muted); font-size:12px; line-height:1.7; }
.chronology-map-note { display:flex; align-items:center; gap:7px; margin:0 0 5px; color:var(--muted); font-size:11px; line-height:1.5; }
.chronology-map-note span { width:20px; height:0; border-top:2px solid var(--red); }
.chronology-progress { display:flex; align-items:center; gap:10px; min-height:24px; }
.chronology-progress input { min-width:0; flex:1; width:100%; margin:0; cursor:pointer; accent-color:var(--red); }
.chronology-progress span { min-width:38px; font:12px/1.6 var(--sans); text-align:right; color:var(--muted); }
.chronology-player-actions { display:grid; grid-template-columns:40px minmax(60px,1fr) 40px minmax(80px,1.3fr); align-items:center; gap:6px; margin-top:8px; }
.chronology-player-actions button { width:100%; min-height:44px; padding:7px 3px; font-size:13px; white-space:nowrap; }
.chronology-player-actions .primary-button { gap:4px; }
.chronology-player-actions .primary-button svg { width:15px; height:15px; }
.chronology-player-marker { cursor:pointer !important; }
.chronology-player-marker:focus-visible { outline:2px solid var(--red); outline-offset:4px; }
.chronology-player-marker .city-event-map-label { overflow:hidden; text-overflow:ellipsis; }
.has-chronology-player .trail-dock { right:410px; }
.has-chronology-player .map-help,.has-chronology-player .compass { display:none; }
.has-chronology-player .leaflet-marker-pane,.has-chronology-player .leaflet-shadow-pane { visibility:hidden; }
.has-chronology-player .theme-line,.has-chronology-player .theme-point,.has-chronology-player .history-line,.has-chronology-player .relation-preview { visibility:hidden; }
@media(max-width:1100px) and (min-width:761px) { .has-chronology-player .trail-dock { right:370px; } }
@media(max-width:760px) {
  .chronology-player { padding:16px; height:min(46dvh,calc(100dvh - 310px)); }
  .chronology-player .city-event-date { margin-top:8px; font-size:13px; line-height:1.7; }
  .chronology-player h2 { font-size:22px; line-height:1.4; margin-bottom:4px; }
  .chronology-player-controls { padding-top:8px; }.chronology-status { margin-bottom:3px; }
  .has-chronology-player .trail-dock { right:18px; }
  .has-trail .chronology-player { height:min(40dvh,calc(100dvh - 400px)); max-height:none; }
  .chronology-player-marker .city-event-map-label { display:none; }
  .chronology-player-actions { grid-template-columns:38px minmax(60px,1fr) 38px minmax(80px,1.2fr); }
}
@media(max-width:760px) and (max-height:500px) and (orientation:landscape) {
  .chronology-player,.has-trail .chronology-player { top:70px; bottom:12px; left:auto; right:10px; width:min(320px,42vw); height:calc(100% - 82px); max-height:none; padding:12px; }
  .has-chronology-player .trail-dock { right:calc(min(320px,42vw) + 24px); }
  .chronology-player-actions { grid-template-columns:30px minmax(45px,1fr) 30px minmax(65px,1.2fr); gap:2px; }
  .chronology-player-actions button { font-size:11px; }
}
@media(max-width:360px) { .chronology-player .chronology-status { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); } }

/* Compact playback keeps the reading controls within reach. */
.chronology-player { padding:18px; height:min(520px,calc(100% - 105px)); }
.chronology-player>.eyebrow { font-size:11px; line-height:1.6; }
.chronology-player .city-event-date { margin:7px 0 3px; font-size:13px; line-height:1.5; }
.chronology-player h2 { margin:0 0 5px; font-size:23px; line-height:1.35; }
.chronology-player .city-event-location { font-size:12px; line-height:1.6; }
.chronology-player .city-event-location svg { width:13px; height:13px; margin-top:3px; }
.chronology-player .city-event-reference { margin-top:4px; padding:0 4px; font-size:11px; }
.chronology-player .city-event-description { margin:7px 0; font-size:14px; line-height:1.6; }
.chronology-player:not(.is-reading) .chronology-full-date,
.chronology-player:not(.is-reading) .chronology-player-media figcaption,
.chronology-player:not(.is-reading) .city-event-sources,
.chronology-player:not(.is-reading) .chronology-player-media figure:nth-child(n+3) { display:none; }
.chronology-player:not(.is-reading) .city-event-description { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden; }
.chronology-player-media { margin:6px 0; }
.chronology-player:not(.is-reading) .chronology-player-media img,
.chronology-player:not(.is-reading) .chronology-player-media .site-photo-placeholder { height:96px; }
.chronology-player-media.multiple { gap:7px; }
.chronology-player:not(.is-reading) .chronology-player-media.multiple img,
.chronology-player:not(.is-reading) .chronology-player-media.multiple .site-photo-placeholder { height:72px; }
.chronology-player-places { margin:5px 0; gap:3px 10px; }
.chronology-player-places .theme-endpoint { padding:0; font-size:12px; line-height:1.7; }
.chronology-playback-settings { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-bottom:3px; }
.chronology-playback-settings .chronology-status { margin:0; white-space:nowrap; }
.chronology-read { min-height:28px; padding:3px 0; font-size:12px; color:var(--red); }
.chronology-speed-label { display:flex; align-items:center; gap:3px; color:var(--muted); font-size:12px; white-space:nowrap; }
#chronology-speed { padding:3px; border:1px solid var(--line); border-radius:0; background:var(--paper); color:var(--ink); font:12px var(--serif); min-height:28px; }
.chronology-player-controls { padding-top:6px; }
.chronology-player-actions { margin-top:4px; }
/* Playback photographs use the free reading area instead of a corner thumbnail. */
.chronology-photo-preview { display:block; position:relative; width:100%; padding:0; border:0; background:#e9dfcb; cursor:zoom-in; }
.chronology-photo-preview:focus-visible { outline:2px solid var(--red); outline-offset:2px; }
.chronology-photo-preview-label { position:absolute; bottom:0; left:0; right:0; padding:3px 6px; background:#f4e9d2eb; color:var(--ink); font:11px/1.5 var(--sans); text-align:left; }
.chronology-photo-dialog { width:min(900px,calc(100vw - 24px)); max-width:900px; max-height:calc(100dvh - 24px); padding:16px; border:1px solid #bba887; background:var(--paper) url('assets/paper.webp') center/750px; color:var(--ink); }
.chronology-photo-dialog::backdrop { background:#2e231bbb; }
.chronology-photo-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.chronology-photo-heading h2 { margin:0; font:600 22px/1.5 var(--serif); }
.chronology-photo-content { overflow-y:auto; max-height:calc(100dvh - 190px); margin:12px 0; }
.chronology-photo-content img { display:block; width:100%; height:min(60dvh,600px); object-fit:contain; background:#e9dfcb; }
.chronology-photo-content p { margin:8px 0; font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
.chronology-photo-navigation { display:none; justify-content:space-between; align-items:center; gap:10px; }
.has-many-photos .chronology-photo-navigation { display:flex; }
.chronology-photo-navigation button { min-height:40px; }
.chronology-photo-dialog>.primary-button { width:100%; min-height:44px; }
/* Larger desktop previews fit the free body height, above the fixed controls. */
@media(min-width:761px) {
  .chronology-player:not(.is-reading) .city-event-body { display:flex; flex-direction:column; }
  .chronology-player:not(.is-reading) .city-event-body>p,
  .chronology-player:not(.is-reading) .city-event-body>h2 { flex:none; }
  .chronology-player:not(.is-reading) .city-event-date { margin:0 0 2px; }
  .chronology-player:not(.is-reading) h2 { margin-bottom:3px; }
  .chronology-player:not(.is-reading) .city-event-description { margin:3px 0; }
  .chronology-player:not(.is-reading) .city-event-location,
  .chronology-player:not(.is-reading) .city-event-reference { display:none; }
  .chronology-player:not(.is-reading) .chronology-player-places { margin:4px 0 0; }
  .chronology-player:not(.is-reading) .chronology-player-media { flex:1; min-height:0; max-height:192px; margin:4px 0; }
  .chronology-player:not(.is-reading) .chronology-player-media.multiple { max-height:144px; grid-template-rows:minmax(0,1fr); }
  .chronology-player:not(.is-reading) .chronology-player-media figure { display:flex; flex-direction:column; height:100%; }
  .chronology-player:not(.is-reading) .chronology-photo-preview { flex:1; min-height:0; height:100%; }
  .chronology-player:not(.is-reading) .chronology-player-media img,
  .chronology-player:not(.is-reading) .chronology-player-media .site-photo-placeholder,
  .chronology-player:not(.is-reading) .chronology-player-media.multiple img,
  .chronology-player:not(.is-reading) .chronology-player-media.multiple .site-photo-placeholder { height:100%; min-height:0; }
}
@media(min-width:761px) and (max-height:700px) {
  .chronology-player:not(.is-reading) h2 { font-size:21px; }
  .chronology-player:not(.is-reading) .city-event-description { font-size:13px; line-height:1.5; -webkit-line-clamp:2; }
}
/* Mobile playback stays text-only until the reader opens the full card. */
@media(max-width:760px) {
  .chronology-player:not(.is-reading),.has-trail .chronology-player:not(.is-reading) { height:min(300px,calc(100dvh - 280px)); max-height:none; padding:12px; }
  .has-trail .chronology-player:not(.is-reading) { height:min(300px,calc(100dvh - 400px)); }
  .chronology-player>.eyebrow { display:none; }
  .chronology-player h2 { padding-right:30px; font-size:20px; line-height:1.35; }
  .chronology-player:not(.is-reading) h2 { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:1; overflow:hidden; }
  .chronology-player .city-event-date { margin:0 0 3px; }
  .chronology-player .city-event-description { font-size:14px; line-height:1.6; margin:5px 0 8px; }
  .chronology-player:not(.is-reading) .city-event-location,
  .chronology-player:not(.is-reading) .city-event-reference,
  .chronology-player:not(.is-reading) .chronology-player-places,
  .chronology-player:not(.is-reading) .chronology-player-media { display:none; }
  .chronology-player.is-reading .chronology-player-media { display:block; }
  .chronology-player.is-reading .chronology-player-media figure { margin:12px 0; }
  .chronology-player.is-reading .chronology-player-media img { height:180px; object-fit:contain; }
  .chronology-photo-content img { height:min(58dvh,540px); }
}
@media(max-width:760px) and (orientation:portrait) {
  .chronology-player.is-reading,.has-trail .chronology-player.is-reading { height:min(68dvh,calc(100dvh - 220px)); max-height:none; bottom:20px; padding:12px; }
}
@media(max-width:760px) and (max-height:700px) and (orientation:portrait) {
  .chronology-player:not(.is-reading),.has-trail .chronology-player:not(.is-reading) { height:min(240px,calc(100dvh - 280px)); }
  .has-trail .chronology-player:not(.is-reading) { height:min(240px,calc(100dvh - 400px)); }
  .chronology-player:not(.is-reading) .city-event-date { font-size:12px; margin:0; }
  .chronology-player:not(.is-reading) h2 { font-size:18px; margin-bottom:2px; }
  .chronology-player:not(.is-reading) .city-event-description { font-size:13px; line-height:1.45; margin:3px 0 0; -webkit-line-clamp:2; }
  .has-trail .chronology-player:not(.is-reading) h2 { font-size:16px; }
  .has-trail .chronology-player:not(.is-reading) .city-event-description { font-size:12.5px; line-height:1.4; margin:2px 0 0; }
}
@media(max-width:760px) and (max-height:500px) and (orientation:landscape) {
  .chronology-player:not(.is-reading),.has-trail .chronology-player:not(.is-reading) { top:auto; height:min(240px,calc(100dvh - 82px)); }
  .chronology-player.is-reading,.has-trail .chronology-player.is-reading { height:calc(100% - 82px); padding:12px; }
  .chronology-player:not(.is-reading) .city-event-date { font-size:12px; }
  .chronology-player:not(.is-reading) h2 { font-size:16px; margin-bottom:3px; }
  .chronology-player:not(.is-reading) .city-event-description { font-size:13px; line-height:1.45; margin:3px 0 5px; -webkit-line-clamp:2; }
}
.chronology-player .city-event-body { flex:1; }

/* Filters open from the header on every screen, leaving the map full width. */
.mobile-filter-button { display:inline-flex; font-size:14px; gap:6px; }
.mobile-close { display:inline-flex; }
.sidebar { position:fixed; left:0; top:var(--filter-top,90px); bottom:auto; max-height:calc(100dvh - var(--filter-top,90px)); transform:none; z-index:650; box-shadow:6px 0 30px #32261925; }
.sidebar.open { transform:none; }
.sidebar-foot { flex:none; }
.sidebar-backdrop { position:fixed; top:var(--filter-top,90px); right:0; bottom:0; left:0; background:#2b271a45; z-index:640; }
