/* Map-first dock. The native feature panels retain their original elements and handlers. */
body.dock-active { --ui-paper:#f8f4eb; --ui-ink:#302b2e; --ui-muted:#82756d; --ui-line:#ddd1c2; --ui-wash:#ece4d8; --ui-surface:#f0e9de; overflow:hidden; }
.dock-active>.topbar,.dock-active>.experience-nav,.dock-active .view-toolbar,.dock-active .map-actions,.dock-active .detail-actions,.dock-active .time-panel,.dock-active .compass,.dock-active .map-bottom,.dock-active .mobile-explore,.dock-active #feedback-open,.dock-active .map-status { display:none!important; }
.dock-active>main { position:absolute!important; inset:0!important; display:block!important; height:100%!important; min-height:0!important; margin:0!important; }
.dock-active .viewport { position:absolute!important; inset:0!important; width:100%!important; height:100%!important; }
.dock-active #scene { inset:0!important; }
.dock-active .map-attribution { bottom:0!important; min-height:23px; background:#fcf7ede6; font-size:8px; justify-content:center; z-index:70; }
#dock-ui { position:fixed; inset:0; z-index:65; pointer-events:none; color:#faf5eb; font-family:'Avenir Next',Avenir,'Trebuchet MS',sans-serif; font-size:13px; }
#dock-ui * { box-sizing:border-box; }
#dock-ui button,#dock-ui input,#dock-ui select { font:inherit; }
#dock-ui button { cursor:pointer; transition:background .15s,color .15s; }
#dock-ui button:disabled { cursor:wait; opacity:.45; }
#dock-ui a { color:inherit; text-decoration:none; }
#dock-ui button:focus-visible,#dock-ui a:focus-visible,#dock-ui input:focus-visible,#dock-ui select:focus-visible { outline:3px solid #b57688; outline-offset:3px; }
#dock-ui svg { width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; flex:none; }
#dock-ui [hidden] { display:none!important; }
#dock-ui .glass { background:#27282bea; border:1px solid #ffffff24; box-shadow:0 8px 28px #24212926; color:#faf5eb; backdrop-filter:blur(18px); }
#dock-ui .map-header { position:absolute; top:24px; left:28px; right:28px; display:flex; align-items:center; gap:28px; }
#dock-ui .wordmark { display:flex; align-items:center; gap:12px; font-weight:700; font-size:17px; letter-spacing:2px; color:#302b2e; text-shadow:0 1px 6px #fff9eec0; pointer-events:auto; }
#dock-ui .monogram { font:42px Georgia,serif; letter-spacing:-4px; padding:0 5px 7px 0; }
#dock-ui .wordmark small { display:block; font-size:7px; letter-spacing:1.3px; margin-top:4px; }
#dock-ui .search { display:flex; align-items:center; gap:12px; padding:0 17px; height:48px; width:355px; border-radius:12px; font-size:12px; pointer-events:auto; text-align:left; }
#dock-ui .search kbd { margin-left:auto; opacity:.55; white-space:nowrap; font:10px inherit; }
#dock-ui .header-tools { display:flex; gap:7px; margin-left:auto; pointer-events:auto; }
#dock-ui .header-tools button { height:46px; min-width:46px; border-radius:12px; display:flex; align-items:center; justify-content:center; gap:9px; }
#dock-ui .header-tools .labelled { padding:0 16px; font-size:11px; }
#dock-ui .command-dock { position:absolute; bottom:42px; left:50%; transform:translateX(-50%); padding:7px; border-radius:20px; display:flex; gap:3px; pointer-events:auto; }
#dock-ui .command-dock button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; width:80px; height:63px; background:transparent; color:#f7f0e2; border:0; border-radius:13px; font-size:10px; white-space:nowrap; }
#dock-ui .command-dock button:hover { background:#ffffff12; }
#dock-ui .command-dock button[aria-pressed=true] { color:#302a2c; background:#f2e8d8; }
#dock-ui .command-dock button[aria-pressed=true] svg { color:#84384d; }
#dock-ui .ambient-strip { position:absolute; left:28px; bottom:49px; border-radius:15px; padding:4px; pointer-events:auto; }
#dock-ui .ambient-strip button { background:none; border:0; color:inherit; display:flex; align-items:center; gap:12px; padding:9px 12px; }
#dock-ui .clock { display:block; text-align:left; font-size:17px; font-variant-numeric:tabular-nums; }
#dock-ui .ambient-strip small { color:#d5c5b9; font-size:9px; }
#dock-ui .map-tools { position:absolute; right:28px; bottom:49px; display:flex; align-items:center; padding:6px; gap:2px; border-radius:15px; pointer-events:auto; }
#dock-ui .map-tools button { width:39px; height:40px; border:0; background:none; color:inherit; border-radius:9px; display:grid; place-items:center; font-size:11px; }
#dock-ui .map-tools button[aria-pressed=true] { background:#eee3d0; color:#302b2e; }
#dock-ui .divider { width:1px; height:20px; margin:0 4px; background:#ffffff2a; }
#dock-ui .active-layer { position:absolute; top:91px; left:28px; display:flex; align-items:center; gap:9px; padding:7px 8px 7px 12px; background:#f9f4eae8; color:#473839; border:1px solid #89716424; border-radius:30px; pointer-events:auto; font-size:11px; }
#dock-ui .active-layer svg { width:15px; height:15px; }
#dock-ui .active-layer button { background:none; border:0; color:inherit; width:28px; height:28px; font-size:18px; }
#dock-ui .panel { position:absolute; top:96px; right:28px; width:340px; max-height:calc(100dvh - 239px); display:flex; flex-direction:column; border:1px solid #e5d7c6; border-radius:18px; background:#fcf8f0f7; color:#302b2e; box-shadow:0 18px 42px #291d222b; backdrop-filter:blur(20px); pointer-events:auto; overflow:hidden; }
#dock-ui #panel-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:20px 21px 12px; flex:none; }
#dock-ui #panel-heading h2 { font:27px/1.1 Georgia,serif; margin:0; letter-spacing:-.6px; }
#dock-ui #panel-heading button { background:#eee4d8; border:0; color:#47393b; width:32px; height:32px; border-radius:50%; font-size:23px; flex:none; }
#dock-ui #panel-tabs { display:flex; padding:0 21px 12px; gap:5px; flex:none; }
#dock-ui #panel-tabs:empty { display:none; }
#dock-ui #panel-tabs button { flex:1; min-height:34px; background:#efe6da; border:0; border-radius:7px; color:#776761; font-size:11px; padding:7px; }
#dock-ui #panel-tabs button[aria-pressed=true] { background:#803a4e; color:#fff8ec; }
#dock-ui .panel-scroll { overflow:auto; overscroll-behavior:contain; min-height:0; padding:0 21px 22px; scrollbar-width:thin; }
#dock-ui .panel p { font-size:11px; line-height:1.65; color:#8c776a; margin:7px 0 13px; }
#dock-ui .toggle { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:13px 0; border-bottom:1px solid #e8dac7; font-size:12px; cursor:pointer; }
#dock-ui .toggle input { appearance:none; width:34px; height:20px; background:#b7afa5; border:0; border-radius:15px; position:relative; margin:0; flex:none; cursor:pointer; }
#dock-ui .toggle input::after { content:''; position:absolute; width:14px; height:14px; top:3px; left:3px; border-radius:100%; background:#fffaf0; transition:transform .15s; }
#dock-ui .toggle input:checked { background:#893f55; }
#dock-ui .toggle input:checked::after { transform:translateX(14px); }
#dock-ui .range-label { display:flex; justify-content:space-between; align-items:center; font-size:11px; margin:18px 0 12px; }
#dock-ui input[type=range] { width:100%; accent-color:#893f55; height:22px; margin:0; cursor:pointer; }
#dock-ui .section-label { margin:22px 0 7px; font-size:9px; letter-spacing:1.5px; color:#8a7265; }
#dock-ui .row-action { display:flex; width:100%; gap:12px; align-items:center; text-align:left; background:transparent; border:0; border-bottom:1px solid #e4d6c4; padding:15px 0; color:#4b3b3f; }
#dock-ui .row-action>span { flex:1; font-size:12px; }
#dock-ui .row-action small { display:block; font-size:10px; color:#8c7667; margin-top:4px; line-height:1.45; }
#dock-ui .row-action>svg:last-child { width:14px; }
#dock-ui .presets { display:flex; gap:6px; margin:14px 0; }
#dock-ui .presets button { display:flex; flex:1; justify-content:center; align-items:center; gap:6px; min-height:43px; padding:8px; background:#eee2d3; color:#554149; border:0; border-radius:8px; font-size:11px; }
#dock-ui .presets button[aria-pressed=true] { background:#803a4e; color:#fff8ec; }
#dock-ui .note { font-size:10px!important; padding-top:12px; line-height:1.6; }
/* A single scrollable panel hosts the existing tools, so headings and content never separate. */
#dock-ui #native-slot:has(#sidebar)>#sidebar { display:block!important; position:static!important; inset:auto!important; width:auto!important; height:auto!important; max-height:none!important; padding:0!important; overflow:visible!important; border:0!important; background:none!important; box-shadow:none!important; transform:none!important; }
#dock-ui #sidebar>* { display:none!important; }
.dock-active[data-dock-panel=tram] #sidebar #tram-panel,.dock-active[data-dock-panel=bus] #sidebar #bus-panel,.dock-active[data-dock-panel=bato] #sidebar #ferry-panel,.dock-active[data-dock-panel=places] #sidebar #heritage-panel,.dock-active[data-dock-panel=parks] #sidebar #public-spaces-panel,.dock-active[data-dock-panel=flight] #sidebar #flight-panel,.dock-active[data-dock-panel=communes] #sidebar #commune-panel,.dock-active[data-dock-panel=rail] #dock-ui #sidebar .railway-panel,.dock-active[data-dock-panel=tour] #sidebar #guided-tour-panel,.dock-active[data-dock-panel=history] #sidebar #discovery-panel,.dock-active[data-dock-panel=sun] #sidebar #discovery-panel { display:block!important; }
#dock-ui #sidebar select,#dock-ui #sidebar input[type=search] { min-height:43px; border-radius:8px; padding:10px; font-size:12px; width:100%; margin-bottom:10px; background:#fffaf3; }
#dock-ui #sidebar button { min-height:36px; border-radius:7px; }
#dock-ui #sidebar summary { list-style:none; font-size:10px; letter-spacing:1px; color:#807065; margin-bottom:16px; }
#dock-ui #sidebar .section-heading { margin-top:8px; }
#dock-ui #sidebar .small { font-size:10px; color:#8b786b; }
#dock-ui #sidebar input { accent-color:#893f55; }
#dock-ui #bridge-panel { position:static; width:auto; max-height:none; margin:0; padding:0; border:0; border-radius:0; box-shadow:none; background:none; }
#dock-ui #bridge-panel #bridge-close { display:none; }
#dock-ui .flight-strip { position:absolute; top:91px; left:50%; transform:translateX(-50%); display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:5px; max-width:calc(100% - 56px); width:max-content; padding:9px 12px; border-radius:15px; pointer-events:auto; }
#dock-ui .flight-strip strong { display:flex; align-items:center; gap:8px; font-size:11px; margin:0 8px; }
#dock-ui .flight-strip button { border:0; border-radius:7px; background:#ffffff10; color:#fff6e7; padding:8px 10px; min-height:34px; font-size:10px; }
#dock-ui .flight-strip button.active { color:#31292d; background:#f3e5d0; }
#dock-ui .flight-strip .exit { background:#803a4e; }
#dock-ui #flight-note { width:100%; color:#d2bdb0; font-size:9px; text-align:center; }
.dock-active .flight-hud { display:none!important; }
.dock-active .flight-pad { bottom:135px!important; z-index:75; }
.dock-active .landmark-card,.dock-active .building-card { bottom:139px!important; max-height:52vh; border-radius:14px; }
.dock-active .place-card,.dock-active .station-card,.dock-active .ferry-card { border-radius:14px; background:#fcf8f0f5; border-color:#e1d4c5; }
.dock-active .place-overlay,.dock-active .station-overlay,.dock-active .ferry-overlay { bottom:130px!important; }
.dock-active #map-error { top:90px; bottom:auto; z-index:80; }
#dock-ui #map-loading { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); display:flex; align-items:center; gap:14px; color:#473539; padding:18px 24px; border-radius:12px; background:#f9f3e7ef; }
#dock-ui .loading-orbit { width:22px; height:22px; border:2px solid #d7c2b7; border-top-color:#843b4f; border-radius:50%; animation:dock-spin 1s linear infinite; }
@keyframes dock-spin { to { transform:rotate(360deg); } }
#dock-ui #dock-toast { position:absolute; left:50%; transform:translateX(-50%); bottom:136px; padding:12px 20px; border-radius:10px; color:#3b2e31; background:#fcf5e8; max-width:90%; box-shadow:0 8px 24px #21171d30; }
#dock-ui #restore-controls { position:absolute; top:24px; right:28px; display:flex; align-items:center; gap:10px; padding:12px; border-radius:10px; pointer-events:auto; }
.calm #dock-ui .map-header,.calm #dock-ui .command-dock,.calm #dock-ui .ambient-strip,.calm #dock-ui .map-tools,.calm #dock-ui .active-layer { display:none; }
#dock-ui dialog { pointer-events:auto; width:800px; max-width:calc(100% - 32px); max-height:82dvh; color:#332c2f; border:1px solid #e3d3c3; border-radius:18px; background:#fcf8ef; padding:32px; }
#dock-ui dialog::backdrop { background:#211c2280; backdrop-filter:blur(4px); }
#dock-ui .dialog-close { position:absolute; top:12px; right:12px; width:32px; height:32px; border:0; background:#eee3d4; border-radius:50%; font-size:22px; }
#dock-ui dialog h2 { font:34px/1.1 Georgia,serif; }
#dock-ui dialog p { line-height:1.6; color:#897267; font-size:12px; }
#dock-ui .coverage-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
#dock-ui .coverage-item { border:1px solid #e0ceba; background:#f4ecdf; border-radius:10px; padding:14px; text-align:left; color:#403338; }
#dock-ui .coverage-item h3 { font-size:14px; margin:0; }
#dock-ui .coverage-item small { display:flex; align-items:center; gap:6px; color:#843b4f; }
@media(max-width:1100px) {
 #dock-ui .command-dock button { width:65px; }
 #dock-ui .search { width:290px; }
 #dock-ui .header-tools .labelled span { display:none; }
 #dock-ui .wordmark { font-size:14px; }
 #dock-ui .wordmark small { display:none; }
}
@media(max-width:800px) {
 #dock-ui .map-header { top:16px; left:14px; right:14px; gap:12px; flex-wrap:wrap; }
 #dock-ui .wordmark { font-size:14px; }
 #dock-ui .wordmark .monogram { font-size:32px; padding-bottom:5px; }
 #dock-ui .header-tools { gap:5px; }
 #dock-ui .header-tools button { height:42px; min-width:42px; }
 #dock-ui .search { order:3; width:100%; height:43px; font-size:11px; }
 #dock-ui .command-dock { bottom:calc(29px + env(safe-area-inset-bottom)); width:calc(100% - 20px); padding:5px; gap:1px; border-radius:16px; }
 #dock-ui .command-dock button { flex:1; width:auto; min-width:0; height:58px; font-size:9px; gap:5px; border-radius:11px; }
 #dock-ui .command-dock svg { width:19px; height:19px; }
 #dock-ui .ambient-strip { bottom:calc(105px + env(safe-area-inset-bottom)); left:12px; padding:0; }
 #dock-ui .ambient-strip button { padding:7px 10px; gap:8px; min-height:44px; }
 #dock-ui .clock { font-size:13px; }
 #dock-ui .ambient-strip small { display:none; }
 #dock-ui .map-tools { right:12px; bottom:calc(105px + env(safe-area-inset-bottom)); padding:2px; border-radius:11px; }
 #dock-ui .map-tools button { width:34px; min-height:40px; }
 #dock-ui .map-tools .divider { margin:0; }
 #dock-ui .panel { top:auto; bottom:calc(105px + env(safe-area-inset-bottom)); left:10px; right:10px; width:auto; max-height:calc(100dvh - 260px); border-radius:17px; }
 #dock-ui .panel-scroll { padding:0 18px 18px; }
 #dock-ui #panel-heading { padding:17px 18px 12px; }
 #dock-ui #panel-heading h2 { font-size:25px; }
 #dock-ui #panel-tabs { padding:0 18px 10px; }
 .panel-open #dock-ui .ambient-strip,.panel-open #dock-ui .map-tools { display:none; }
 #dock-ui .active-layer { top:120px; left:14px; padding:3px 5px 3px 10px; font-size:10px; }
 #dock-ui .flight-strip { top:72px; left:10px; right:10px; transform:none; width:auto; max-width:none; gap:4px; padding:8px; }
 #dock-ui .flight-strip strong { width:100%; justify-content:center; margin:0 0 3px; }
 #dock-ui .flight-strip button { min-height:38px; padding:8px; }
 #dock-ui #flight-note { font-size:8px; text-align:left; }
 .flying #dock-ui .search,.flying #dock-ui .active-layer { display:none; }
 .flying #dock-ui .ambient-strip,.flying #dock-ui .map-tools { display:none; }
 .dock-active .flight-pad { bottom:calc(110px + env(safe-area-inset-bottom))!important; }
 .dock-active .map-attribution { font-size:6px; min-height:21px; bottom:env(safe-area-inset-bottom)!important; }
 .dock-active .landmark-card,.dock-active .building-card { bottom:calc(166px + env(safe-area-inset-bottom))!important; max-height:40vh; }
 .dock-active .place-overlay,.dock-active .station-overlay,.dock-active .ferry-overlay { bottom:calc(166px + env(safe-area-inset-bottom))!important; }
 .dock-active .place-card,.dock-active .station-card,.dock-active .ferry-card { max-height:38vh!important; }
 #dock-ui .coverage-grid { grid-template-columns:1fr; }
 #dock-ui dialog { padding:23px; }
 #dock-ui #restore-controls { top:16px; right:14px; }
}
@media(prefers-reduced-motion:reduce) { #dock-ui * { transition:none!important; } #dock-ui .loading-orbit { animation:none; } }

/* History keeps its timeline and illustrated reader, inside the same contextual surface. */
#dock-ui #dock-history-reader { display:none; }
.dock-active[data-dock-panel=history] #dock-ui #panel { width:690px; }
.dock-active[data-dock-panel=history] #dock-ui .panel-scroll { display:grid; grid-template-columns:190px minmax(0,1fr); gap:16px; padding-right:0; overflow:hidden; }
.dock-active[data-dock-panel=history] #dock-ui #panel-content { display:none; }
.dock-active[data-dock-panel=history] #dock-ui #dock-history-reader { display:block; min-height:0; }
.dock-active[data-dock-panel=history] #dock-ui #native-slot { overflow:auto; max-height:calc(100dvh - 322px); }
#dock-ui .history-reader { max-height:calc(100dvh - 322px); border:0; background:transparent; }
#dock-ui .history-chapter { padding:8px 22px 26px; }
#dock-ui .history-chapter h2 { font:30px/1.12 Georgia,serif; }
#dock-ui .history-prose p { font-size:13px; color:#40373a; }
#dock-ui .history-hook { font:16px/1.5 Georgia,serif; color:#473b3f; }
#dock-ui .history-heading h1 { font-size:23px; }
#dock-ui .history-heading p,#dock-ui .history-scroll-hint { display:none; }
.dock-active .history-map-label { bottom:135px; left:28px; width:310px; }
.dock-active #discovery-markers,.dock-active #archive-compare { bottom:0; }
@media(max-width:800px) {
 .dock-active[data-dock-panel=history] #dock-ui #panel { width:auto; }
 .dock-active[data-dock-panel=history] #dock-ui .panel-scroll { grid-template-columns:1fr; gap:8px; padding:0; }
 .dock-active[data-dock-panel=history] #dock-ui #native-slot { max-height:84px; padding:0 10px; }
 #dock-ui .history-reader { max-height:calc(100dvh - 422px); }
 #dock-ui .history-heading { display:none; }
 #dock-ui .history-timeline { flex-direction:row; height:74px; overflow-x:auto; }
 #dock-ui .history-timeline:before { display:none; }
 #dock-ui .history-timeline button { flex:0 0 155px; }
 .dock-active .history-map-label { display:none; }
 #dock-ui .history-chapter { padding:12px 24px 28px; }
}

#dock-ui #share-link { overflow-wrap:anywhere; user-select:all; }

@media(max-width:800px) { .flying.panel-open #dock-ui .flight-strip,.flying.panel-open .flight-pad { display:none!important; } }
