/* Galaxy homepage and /space alias. Shared site typography and dark palette. */
body.site-space { margin:0; }
.site-space .site-content { width:100%; max-width:none; padding:0 24px 12px; margin:0; box-sizing:border-box; }
.space-root { height:calc(100dvh - 102px); min-height:540px; max-width:1800px; margin:auto; display:grid; grid-template-rows:auto minmax(0,1fr) auto auto; gap:12px; }
.space-hud { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:12px 4px 6px; }
.site-space .space-kicker { margin:0 0 7px; font-size:10px; letter-spacing:.14em; text-transform:uppercase; color:#c5cbb1; }
.space-kicker span { margin-left:10px; padding-left:12px; border-left:1px solid #45453d; color:#aaa69d; letter-spacing:.04em; }
.site-space .space-copy h1 { margin:0; font-size:30px; line-height:1.25; font-weight:450; letter-spacing:-.035em; }
.site-space .space-copy>p:last-child { font-size:12px; color:#aaa69d; margin:7px 0 0; }
.space-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.space-toolbar input { min-width:140px; width:180px; font-size:13px; padding:11px 12px; border:1px solid #373630; border-radius:7px; background:#22221e; color:#eeeae3; }
.site-space .space-root button { font-family:inherit; cursor:pointer; }
.space-toolbar button,.space-zoom button { padding:10px 13px; border:1px solid #45453d; background:#22221e; color:#d8d6cd; border-radius:7px; font-size:12px; min-height:40px; }
.space-toolbar button:hover,.space-zoom button:hover { border-color:#c5cbb1; color:#eeeae3; }
.space-viewport { position:relative; overflow:hidden; border:1px solid #373630; border-radius:12px; background:#171715; isolation:isolate; }
#space-canvas { display:block; width:100%; height:100%; touch-action:none; cursor:grab; outline-offset:-4px; }
.space-labels { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.site-space .space-label { position:absolute; left:0; top:0; transform:translate(-50%,0); pointer-events:auto; border:0; border-radius:5px; background:transparent; color:#eeeae3; font-size:13px; text-align:center; white-space:nowrap; padding:5px 9px; text-decoration:none; line-height:1.2; }
.space-label strong { font-weight:500; display:block; }
.space-label small { display:block; font-size:9px; color:#aaa69d; margin-top:5px; letter-spacing:.04em; text-transform:uppercase; }
.site-space .space-label.is-moon { font-size:11px; padding:5px 7px; max-width:180px; overflow:hidden; text-overflow:ellipsis; background:#171715d9; border:1px solid #373630; }
.site-space .space-label:hover,.site-space .space-label:focus-visible { background:#2c2e25; color:#c5cbb1; z-index:10; }
.space-location { position:absolute; top:18px; left:20px; display:flex; align-items:center; gap:12px; pointer-events:none; color:#bcb9ae; font-size:11px; letter-spacing:.03em; }
#space-location::before { content:""; display:inline-block; width:5px; height:5px; background:#c5cbb1; border-radius:50%; margin:0 8px 2px 0; }
#space-scale { color:#8d8d80; border-left:1px solid #45453d; padding-left:12px; }
.space-zoom { position:absolute; right:16px; bottom:16px; display:flex; gap:4px; }
.space-zoom button { font-size:20px; width:42px; padding:6px; }
.space-inspector { position:absolute; left:18px; bottom:18px; width:218px; max-width:calc(100% - 110px); border-left:2px solid var(--planet-color,#c5cbb1); padding:12px 15px; background:#1b1a18ef; border-radius:0 8px 8px 0; }
.site-space .space-inspector h2 { margin:0 0 6px; font-size:20px; font-weight:450; }
.site-space .space-inspector p:not(.space-kicker) { font-size:12px; line-height:1.55; color:#aaa69d; margin:0 0 10px; }
.site-space .space-inspector a { color:#c5cbb1; font-size:12px; text-decoration:none; display:inline-block; padding:5px 0; }
.space-directory { position:absolute; top:12px; right:12px; bottom:12px; width:330px; max-width:calc(100% - 24px); box-sizing:border-box; background:#22221ef5; border:1px solid #45453d; border-radius:9px; z-index:20; padding:15px; display:flex; flex-direction:column; backdrop-filter:blur(12px); }
.space-root [hidden] { display:none!important; }
.space-directory-heading { display:flex; justify-content:space-between; align-items:center; font-size:14px; }
.space-directory-heading button { border:0; background:transparent; color:#aaa69d; font-size:23px; width:32px; min-height:36px; }
.site-space .space-directory>p { margin:4px 0 12px; font-size:11px; color:#aaa69d; }
.site-space .space-directory ul { padding:0; margin:0; overflow:auto; list-style:none; overscroll-behavior:contain; }
.site-space .space-directory li { margin:0; padding:0; border-top:1px solid #373630; }
.site-space .space-directory a { display:block; padding:10px 3px; font-size:12px; color:#eeeae3; text-decoration:none; }
.site-space .space-directory a:hover { color:#c5cbb1; }
.space-directory a small { display:block; font-size:10px; color:#aaa69d; margin-top:4px; overflow-wrap:anywhere; }
.space-filters { display:flex; justify-content:center; align-items:center; gap:6px; overflow-x:auto; scrollbar-width:thin; padding:0 0 2px; }
.space-filters button { flex:none; padding:8px 11px; min-height:36px; font-size:11px; color:#aaa69d; border:1px solid transparent; border-radius:7px; background:transparent; }
.space-filters button::before { content:""; display:inline-block; width:6px; height:6px; margin:0 7px 1px 0; border-radius:50%; background:var(--planet-color); }
.space-filters button[aria-pressed=true],.space-filters button:hover { color:#eeeae3; border-color:#373630; background:#22221e; }
.space-meta { display:flex; justify-content:space-between; gap:12px; color:#aaa69d; font-size:10px; padding:0 4px; }
.space-meta strong { font-weight:450; color:#c5cbb1; }
@media(max-width:1000px) {
 .space-hud { align-items:flex-start; }
 .space-toolbar { max-width:280px; justify-content:flex-end; }
 .space-toolbar input { width:100%; }
 .space-filters { justify-content:flex-start; }
}
@media(max-width:600px) {
 .site-shell.site-space .site-content { width:100%; padding:0 10px 8px; }
 .space-root { height:calc(100dvh - 84px); min-height:540px; gap:7px; }
 .space-hud { display:block; padding:6px 4px 4px; }
 .site-space .space-copy h1 { font-size:24px; }
 .site-space .space-copy>p:last-child { font-size:11px; }
 .space-toolbar { max-width:none; flex-wrap:nowrap; margin-top:12px; gap:5px; }
 .space-toolbar input { width:0; min-width:0; flex:1; font-size:16px; padding:9px; }
 .space-toolbar button { font-size:11px; padding:9px; white-space:nowrap; min-height:42px; }
 .space-kicker span { margin-left:6px; padding-left:8px; }
 .space-location { top:12px; left:13px; font-size:10px; }
 .space-meta { font-size:9px; line-height:1.5; }
 #space-hint { max-width:100px; }
 .space-meta>span:last-child { max-width:220px; text-align:right; }
 .space-inspector { left:10px; bottom:10px; padding:9px 11px; width:190px; }
 .site-space .space-inspector h2 { font-size:17px; }
 .space-inspector .space-kicker { margin-bottom:3px; font-size:9px; }
 .space-zoom { right:10px; bottom:10px; flex-direction:column; }
 .space-filters button { min-height:40px; }
 .site-space .space-label { font-size:12px; }
}
/* Immersive galaxy revision: canvas owns the viewport, controls float above it. */
html:has(body.site-space),body.site-space { overflow:hidden!important; width:100%; height:100%; background:#080a0b!important; }
.site-space>.site-header { display:none; }
.site-shell.site-space .site-content { width:100%; margin:0; padding:0; }
.space-root { position:fixed; inset:0; width:100%; height:100dvh; min-height:0; max-width:none; display:block; }
.space-viewport { position:absolute; inset:0; border:0; border-radius:0; background:#080a0b; }
.space-hud { position:absolute; z-index:5; top:0; left:0; right:0; padding:26px 30px; pointer-events:none; align-items:flex-start; background:linear-gradient(#080a0bc4,transparent); }
.space-copy,.space-toolbar { pointer-events:auto; }
.site-space .space-kicker a { color:#c5cbb1; text-decoration:none; letter-spacing:.12em; }
.site-space .space-copy h1 { font-size:23px; font-weight:400; letter-spacing:-.025em; }
.site-space .space-copy>p:last-child { font-size:11px; color:#92978f; }
.space-toolbar { padding-top:2px; }
.space-toolbar input { background:#11151880; border:0; border-radius:4px; width:165px; }
.space-toolbar button,.space-zoom button { border:0; border-radius:4px; background:#11151880; color:#b4bab4; }
.space-toolbar button:hover,.space-zoom button:hover { background:#2a302c; }
.space-label { text-shadow:0 1px 9px #000,0 1px 5px #000; }
.site-space .space-label.is-moon { background:#0a1013b5; border:0; }
.space-label small { color:#a2aba7; }
.space-location { top:125px; left:30px; font-size:10px; opacity:.8; }
.space-filters { position:absolute; z-index:5; left:25px; right:25px; bottom:48px; padding:0; pointer-events:none; }
.space-filters button { pointer-events:auto; border:0; background:transparent; }
.space-filters button[aria-pressed=true],.space-filters button:hover { background:#26302b9c; border:0; }
.space-meta { position:absolute; z-index:4; left:30px; right:30px; bottom:22px; color:#7d8985; pointer-events:none; }
.space-meta strong { color:#a0aba4; }
.space-inspector { bottom:120px; left:30px; background:#0b1115ad; backdrop-filter:blur(8px); border:0; border-radius:0; padding:14px 16px; }
.space-zoom { bottom:115px; right:30px; }
.space-directory { top:85px; bottom:100px; right:30px; background:#111719e8; border:0; border-radius:4px; }
.site-space .space-directory li { border-color:#26302e; }
@media(max-width:1000px) { .space-toolbar { max-width:none; } .space-toolbar input { width:145px; } .space-filters { justify-content:center; } }
@media(max-width:600px) {
 .space-hud { display:flex; padding:18px 18px 38px; gap:16px; }
 .space-copy { max-width:190px; }
 .site-space .space-copy h1 { font-size:18px; max-width:180px; }
 .site-space .space-copy>p:last-child { display:none; }
 .space-kicker span { display:none; }
 .space-toolbar { margin:0; display:grid; grid-template-columns:1fr 1fr; gap:4px; max-width:162px; }
 .space-toolbar input { width:100%; min-width:0; grid-column:1/-1; box-sizing:border-box; padding:7px 9px; font-size:16px; }
 .space-toolbar button { padding:7px; font-size:10px; min-height:36px; }
 .space-location { top:107px; left:18px; font-size:9px; }
 .space-filters { left:12px; right:12px; bottom:58px; justify-content:flex-start; }
 .space-meta { left:18px; right:18px; bottom:18px; font-size:9px; }
 .space-inspector { left:18px; bottom:120px; max-width:calc(100% - 120px); padding:10px 12px; }
 .space-zoom { right:18px; bottom:124px; }
 .space-directory { top:110px; right:12px; bottom:108px; max-width:calc(100% - 24px); }
}
.site-space #space-browse { display:block; padding:6px 0; color:#aaa69d; font-size:11px; border:0; background:transparent; }
.site-space #space-browse:hover { color:#c5cbb1; }
.site-space #space-parent { display:block; padding:6px 0; color:#a8b9bd; font-size:11px; border:0; background:transparent; }
.site-space .space-inspector .space-mass { color:#bfccc4; font-size:11px; line-height:1.5; }
.site-space .space-label.is-topic { max-width:200px; padding:6px 10px; background:#142326cc; border-bottom:1px solid #789c9b7a; }
.space-label.is-topic strong { overflow:hidden; text-overflow:ellipsis; }
.space-noscript { position:fixed; z-index:20; top:160px; left:30px; right:30px; color:#eeeae3; }
.space-viewport { touch-action:auto; user-select:none; cursor:grab; }
.space-labels { touch-action:none; }
#space-canvas { cursor:inherit; }
.space-label { -webkit-user-drag:none; user-select:none; }
.space-zoom #space-orbit { width:auto; font-size:11px; padding:8px 12px; }
.space-zoom #space-motion { width:94px; font-size:11px; padding:8px; }
.space-zoom #space-motion[aria-pressed=true] { color:#eeeae3; background:#38443ba6; }
.space-zoom #space-motion:disabled { opacity:.6; cursor:default; }
.space-zoom #space-orbit[aria-pressed=true] { color:#eeeae3; background:#38443ba6; }
@media(max-width:600px){.space-zoom #space-orbit{padding:8px;font-size:10px;}#space-hint{max-width:148px;}}
@media(max-width:600px){.space-zoom #space-motion{width:60px;font-size:10px;} .space-zoom{align-items:flex-end;}}

/* Persistent exit to the original homepage, even before WebGL loads. */
.space-actions { display:grid; justify-items:end; gap:12px; pointer-events:auto; }
.space-views { display:flex; align-items:center; gap:4px; padding:3px; background:#101619c9; border-radius:6px; }
.space-views a { padding:7px 11px; color:#acb5b6; font-size:12px; text-decoration:none; border-radius:4px; white-space:nowrap; }
.space-views a[aria-current] { color:#f1eee5; background:#303735; }
.space-views a:hover,.space-views a:focus-visible { color:#fff; background:#303735; }
.space-toolbar { flex-wrap:nowrap; }
.space-toolbar input { width:150px; }
.space-directory li { display:flex; gap:10px; align-items:center; }
.space-directory { top:140px; }
.space-directory li>a { flex:1; min-width:0; }
.space-locate { flex:none; padding:8px; font-size:11px; border:1px solid #394343; border-radius:4px; color:#c7d3ca; background:transparent; }
.space-locate:hover { background:#303735; }
.space-inspector { width:250px; }
.site-space .space-inspector h2 { overflow-wrap:anywhere; }
.site-space .space-label { box-sizing:border-box; }
.site-space .space-label.is-moon { padding:6px 8px; }
.space-noscript a { color:#d9e4da; }
@media(max-width:1100px) {
 .space-copy { max-width:260px; }
 .space-kicker span { display:none; }
 .space-toolbar input { width:120px; }
 .space-toolbar button { padding:10px; }
}
@media(max-width:700px) {
 .space-hud { display:grid; grid-template-columns:1fr; padding:18px; gap:14px; }
 .space-copy { max-width:none; }
 .site-space .space-copy h1 { max-width:none; font-size:19px; }
 .site-space .space-copy>p:last-child { display:none; }
 .space-actions { display:contents; }
 .space-views { position:absolute; top:12px; right:14px; }
 .space-views a { font-size:11px; padding:7px 9px; }
 .space-toolbar { display:grid; grid-template-columns:minmax(70px,1fr) auto auto auto; width:100%; max-width:none; gap:4px; padding:0; }
 .space-toolbar input { width:100%; min-width:0; grid-column:auto; box-sizing:border-box; padding:10px 8px; font-size:16px; }
 .space-toolbar button { font-size:10px; padding:8px 7px; min-height:40px; }
 .space-location { top:135px; left:18px; max-width:calc(100% - 36px); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
 .space-directory { top:154px; }
}

/* Reserve real HUD space; short screens must not stack text over the map controls. */
.space-root { --space-hud-bottom:140px; }
.space-location { top:calc(var(--space-hud-bottom) + 2px); }
.space-directory { top:calc(var(--space-hud-bottom) + 30px); }
.space-inspector { box-sizing:border-box; display:flex; flex-direction:column; max-height:calc(100dvh - var(--space-hud-bottom) - 156px); }
.space-inspector-details { min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; touch-action:pan-y; }
.space-inspector-actions { flex-shrink:0; display:flex; flex-wrap:wrap; align-items:center; gap:0 12px; padding-top:4px; border-top:1px solid #ffffff14; }
.space-directory { touch-action:pan-y; }
.space-filters { justify-content:flex-start; scroll-padding-inline:4px; }
.space-filters button:first-child { margin-left:auto; }
.space-filters button:last-child { margin-right:auto; }
.site-space .space-root :is(button,a,input):focus-visible { outline:2px solid #d8e5df; outline-offset:3px; }
.space-inspector-details:focus-visible { outline:1px solid #d8e5df; outline-offset:2px; }
.space-directory-heading { flex-shrink:0; gap:12px; }
.space-directory-heading button,.space-locate { min-height:40px; min-width:40px; }
.space-directory ul { min-height:0; }
.space-hud { padding-top:max(26px,env(safe-area-inset-top)); padding-left:max(30px,env(safe-area-inset-left)); padding-right:max(30px,env(safe-area-inset-right)); }
.space-meta { bottom:max(18px,env(safe-area-inset-bottom)); }
@media(max-width:700px) {
 .space-hud { padding:18px; padding-top:max(18px,env(safe-area-inset-top)); }
 .space-inspector { max-height:min(32dvh,calc(100dvh - var(--space-hud-bottom) - 150px)); }
 .site-space .space-inspector :is(#space-open,#space-browse,#space-parent) { min-height:36px; padding:8px 0; }
 .space-zoom button { min-height:44px; min-width:44px; }
}
@media(max-height:520px) {
 .space-hud { display:grid; grid-template-columns:1fr; padding:12px max(18px,env(safe-area-inset-right)) 8px max(18px,env(safe-area-inset-left)); gap:8px; }
 .space-copy { max-width:none; }
 .site-space .space-copy h1,.site-space .space-copy>p:last-child,.space-kicker span { display:none; }
 .site-space .space-kicker { margin:0; min-height:30px; display:flex; align-items:center; }
 .space-actions { display:contents; }
 .space-views { position:absolute; top:10px; right:max(18px,env(safe-area-inset-right)); }
 .space-toolbar { display:flex; max-width:none; width:100%; gap:6px; margin:0; padding:0; }
 .space-toolbar input { flex:1; min-width:60px; width:0; font-size:16px; }
 .space-toolbar button { min-height:40px; font-size:11px; padding:8px; }
 .space-inspector { bottom:70px; left:max(18px,env(safe-area-inset-left)); width:260px; max-width:calc(100% - 100px); max-height:calc(100dvh - var(--space-hud-bottom) - 106px); }
 .space-directory { bottom:65px; }
 .space-zoom { right:max(18px,env(safe-area-inset-right)); bottom:70px; flex-direction:row; }
 .space-filters { left:max(18px,env(safe-area-inset-left)); right:max(18px,env(safe-area-inset-right)); bottom:max(12px,env(safe-area-inset-bottom)); }
 .space-meta { display:none; }
}
/* Restaurant pins live on the main Earth. Only the explicit solar-system link
   retains the older optional explorer. */
.space-earth-places { position:absolute; z-index:4; left:30px; bottom:120px; width:300px; max-width:calc(100% - 110px); max-height:calc(100dvh - var(--space-hud-bottom) - 160px); overflow:auto; padding:14px 16px; box-sizing:border-box; background:#0b1115df; backdrop-filter:blur(8px); touch-action:pan-y; cursor:auto; scrollbar-width:thin; }
.site-space .space-earth-places h2 { margin:0 0 6px; font-size:18px; font-weight:450; }
.site-space .space-earth-places h3 { margin:12px 0 5px; font-size:16px; font-weight:500; overflow-wrap:anywhere; }
.site-space .space-earth-places p { margin:5px 0 10px; font-size:13px; color:#aab9bd; line-height:1.5; }
.site-space .space-earth-places a { color:#c6d8db; font-size:13px; text-decoration:none; }
/* Maintain control contrast over bright aerial imagery without changing the galaxy. */
.space-root[data-earth-surface=true] .space-hud { background:linear-gradient(#080a0bfa,#080a0bce 65%,transparent); }
.space-root[data-earth-surface=true] .space-location { background:#0b1115e6; opacity:1; padding:6px 8px; border-radius:4px; }
.space-root[data-earth-surface=true] .space-filters { background:#0b1115e6; border-radius:4px; }
.space-root[data-earth-surface=true] .space-meta { background:#0b1115e6; padding:4px 6px; color:#b4bfbb; border-radius:4px; }
.space-root[data-earth-surface=true] .space-toolbar input,.space-root[data-earth-surface=true] .space-toolbar button,.space-root[data-earth-surface=true] .space-zoom button { background:#0b1115e6; color:#d9e2dd; }
.space-place-actions { display:flex; flex-wrap:wrap; gap:4px 12px; }
.space-earth-places button { border:0; background:transparent; padding:8px 0; min-height:40px; font-family:inherit; font-size:14px; color:#e0e8e4; text-align:left; }
.space-earth-places button:hover { color:#fff; text-decoration:underline; }
.site-space .space-earth-places .space-place-credit { font-size:12px; margin:10px 0 0; }
.space-place-search-row { display:flex; align-items:center; gap:8px; margin-top:8px; }
.space-place-search-row input { width:100%; min-width:0; padding:10px 8px; font:inherit; font-size:16px; background:#172023; border:1px solid #405055; border-radius:3px; color:#eee; }
.space-place-search-row button { min-width:32px; font-size:24px; text-align:center; }
#space-place-results { max-height:180px; overflow:auto; padding:0; margin:8px 0 0; list-style:none; overscroll-behavior:contain; }
#space-place-results li { border-top:1px solid #ffffff15; }
#space-place-results button { width:100%; padding:10px 0; line-height:1.4; }
#space-place-results small { display:block; color:#a5b2b5; font-size:12px; }
.site-space .space-label.is-place { max-width:220px; font-size:14px; line-height:1.2; padding:8px 10px; overflow:hidden; text-overflow:ellipsis; background:#0b171ce8; color:#e4f0ec; border:1px solid #81a5af55; }
@media(max-width:700px) {
 .space-earth-places { left:14px; bottom:120px; padding:10px 12px; width:calc(100% - 100px); max-width:none; max-height:34dvh; }
 .space-place-actions { gap:0 10px; }
 .site-space .space-earth-places h2 { font-size:16px; }
 .site-space .space-earth-places .space-place-credit { font-size:12px; }
}
@media(max-height:520px) { .space-earth-places { bottom:70px; max-height:calc(100dvh - var(--space-hud-bottom) - 100px); } }
#space-earth-viewer { width:100vw; height:100dvh; max-width:none; max-height:none; margin:0; padding:0; border:0; background:#080a0b; color:#eeeae3; overflow:hidden; }
#space-earth-viewer::backdrop { background:#080a0b; }
#space-earth-frame { display:block; width:100%; height:100%; border:0; visibility:hidden; background:#080a0b; }
#space-earth-viewer[data-state=ready] #space-earth-frame { visibility:visible; }
.space-earth-wait { position:absolute; inset:0; display:grid; place-content:center; text-align:center; gap:12px; padding:30px; }
.space-earth-wait p { font-size:20px; max-width:420px; }
.space-earth-wait a { color:#a9c3cd; font-size:14px; }
#space-earth-close { position:absolute; bottom:max(25px,env(safe-area-inset-bottom)); left:25px; padding:12px 16px; min-height:44px; border:1px solid #35444a; border-radius:5px; color:#eeeae3; background:#142127; }
#space-earth-viewer[data-state=ready] :is(.space-earth-wait,#space-earth-close) { display:none; }
.space-label[data-node=earth] strong { color:#cde7f1; }
.space-label[data-node=earth] small { color:#9ac8da; }
.space-filters button[data-planet=earth] { color:#cde7f1; background:#1c333b99; }
/* Three view choices need their own row on narrow phones. */
@media(max-width:480px) {
 .space-hud { gap:8px; }
 .space-views { position:static; grid-row:1; justify-self:start; }
 .space-copy { grid-row:2; }
 .space-copy .space-kicker { display:none; }
 .space-toolbar { grid-row:3; }
}
