/* Yosemite digital twin. Visual language after Apple's product pages: one clean typeface (San Francisco on Apple devices,
   Inter elsewhere), a slim frosted navigation bar, frosted-glass cards with large radii, near-white text with soft grey
   secondary text, sentence-case headings and pill-shaped controls. Map symbol colours (roads, people, fire...) are separate:
   warm colours still mean fire and danger only. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --bg: rgba(29, 29, 31, 0.74);          /* frosted glass */
  --bg-solid: #1d1d1f;
  --glass: saturate(180%) blur(20px);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --fill: rgba(255, 255, 255, 0.08);      /* controls */
  --fill-hover: rgba(255, 255, 255, 0.14);
  --on-bg: #f5f5f7;                       /* a selected control turns white */
  --on-text: #1d1d1f;
  --link: #2997ff;
  --cta: #0071e3;
  --accent: #8fd18f;                      /* tree labels (nature) */
  --accent2: #ff7ab8;                     /* pink = places */
  --nav-h: 52px;
  --radius: 18px;
  font-family: var(--font);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* panels with their own display rule must still hide */
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--text); font-size: 14px; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
button, select, input { font-family: inherit; letter-spacing: inherit; }
input[type=checkbox], input[type=range] { accent-color: #0a84ff; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
/* scrollbars like the overlay ones on a Mac: a slim translucent pill, no track or arrows (Windows draws a solid white bar) */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border: 4px solid transparent; background-clip: padding-box; border-radius: 980px; min-height: 36px; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.38); border-width: 3px; }
::-webkit-scrollbar-thumb:active { background-color: rgba(255, 255, 255, 0.5); border-width: 3px; }
@supports not selector(::-webkit-scrollbar) {   /* Firefox */
  * { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.28) transparent; }
}
#view { position: fixed; inset: 0; }
#view canvas { display: block; }
/* Unreal mode (?ue): Unreal's streamed picture under the page's see-through canvas */
#ueStream { position: absolute; inset: 0; z-index: 0; background: #0b0d10; pointer-events: none; overflow: hidden; }
#ueStream video { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; object-fit: cover !important; object-position: 50% 50%; }
#ueNote { position: fixed; left: 50%; top: calc(var(--nav-h) + 14px); transform: translateX(-50%); z-index: 3; padding: 8px 16px;
  border-radius: 980px; background: var(--bg); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); color: var(--muted); font-size: 13px; }

.panel {
  position: fixed; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

/* ---- controls: pills; a selected one turns white */
.tabs button, #toolbar button, #toolbar select, .wxmodes button, #fPresets button, .tools button, .play button, .play select, .frow select,
#poiCard button, #gForm button, .stat button, #drawerHead button {
  background: var(--fill); color: var(--text); border: 0; border-radius: 980px; padding: 7px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .2s, color .2s;
}
.tabs button:hover, #toolbar button:hover, #toolbar select:hover, .wxmodes button:hover, #fPresets button:hover, .tools button:hover,
.play button:hover, #poiCard button:hover, #gForm button:hover, .stat button:hover, #drawerHead button:hover { background: var(--fill-hover); }
.tabs button.on, #toolbar button.on, .wxmodes button.on, .tools button.on { background: var(--on-bg); color: var(--on-text); }
select option { background: var(--bg-solid); color: var(--text); }

/* ---- navigation bar: the name on the left, the sections on the right */
#nav { position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 6; display: flex; align-items: center; gap: 26px; padding: 0 22px;
  background: rgba(22, 22, 23, 0.8); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); border-bottom: 1px solid var(--line);
  transition: background .4s, border-color .4s; }
.brand { display: flex; align-items: baseline; gap: 9px; margin-right: auto; white-space: nowrap; font-family: var(--font-display); transition: opacity .4s; }
.brand b { font-size: 21px; font-weight: 600; letter-spacing: -0.022em; color: var(--text); }
.brand span { font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: -0.01em; }
#navLinks { display: flex; align-items: center; gap: 24px; transition: opacity .4s; }
#navLinks button { position: relative; background: none; border: 0; padding: 5px 0; color: rgba(245, 245, 247, 0.8); font-size: 13px; font-weight: 400;
  cursor: pointer; transition: color .2s; }
#navLinks button:hover, #navLinks button.on { color: #fff; }
#navLinks button.on:not(.cta)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -14px; height: 2px; border-radius: 2px; background: var(--text); }
#navLinks button.cta { background: var(--cta); color: #fff; border-radius: 980px; padding: 5px 13px; font-size: 12.5px; }
#navLinks button.cta:hover, #navLinks button.cta.on { background: #0077ed; }
#menu { position: relative; display: flex; align-items: center; }
#menuBtn { display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 5px 0; color: rgba(245, 245, 247, 0.8);
  font-size: 13px; cursor: pointer; transition: color .2s, opacity .4s; }
#menuBtn:hover, #menuBtn[aria-expanded="true"] { color: #fff; }
#menuBtn .chev { transition: transform .25s; }
#menuBtn[aria-expanded="true"] .chev { transform: rotate(180deg); }
#menuBtn .mb-narrow, #menuBtn .mb-restore { display: none; }
#menuList { position: absolute; top: calc(100% + 14px); right: -8px; width: 330px; padding: 10px; display: flex; flex-direction: column;
  max-height: calc(100vh - var(--nav-h) - 24px); overflow: auto; }
#menuList[hidden] { display: none; }
#menuList > button { text-align: left; background: none; border: 0; color: var(--text); padding: 9px 10px; border-radius: 10px; font-size: 14px; cursor: pointer; }
#menuList > button:hover { background: var(--fill); }
#menuList > button.on { background: var(--fill-hover); }
#menuList h3 { font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 10px 6px; letter-spacing: 0; }
#toolbar { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: dense; gap: 6px; padding: 2px; }   /* the View controls */
#toolbar select { grid-column: 1 / -1; width: 100%; min-width: 0; text-align: left; }
#toolbar #btnGuide, #toolbar #btnLayers, #toolbar #btnRisk { display: none; }   /* the sections open these */
@media (min-width: 1181px) {   /* wide: the sections are links in the bar, so the popover holds just the View controls */
  #menuList > button[data-sec], #menuList h3 { display: none; }
}
@media (max-width: 1180px) {   /* narrower: one Menu with the sections and the View controls */
  #navLinks { display: none; }
  #menuBtn .mb-wide { display: none; } #menuBtn .mb-narrow { display: inline; }
}

/* ---- the drawer: one section at a time, below the bar on the right, down to just above the controls hint */
:root { --panel-max: calc(100vh - var(--nav-h) - 74px); --mm-room: 300px; }
#drawer { top: calc(var(--nav-h) + 12px); right: 16px; width: 360px; max-height: var(--panel-max); display: flex; flex-direction: column;
  padding: 16px 18px 16px; z-index: 4; }
#drawer[hidden] { display: none; }
#drawerHead { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; }
#drawerHead b { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.022em; color: var(--text); }
#drawerHead button { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; font-size: 13px; color: var(--muted); }
#drawer > aside.panel { position: static; background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  padding: 0; width: auto; max-height: none; min-height: 0; overflow: auto; flex: 1 1 auto; }
#drawer > aside[hidden] { display: none !important; }
#drawer .tabs, #drawer #layers > .phead, #drawer .fold { display: none !important; }
#drawer #right > .phead:first-child { margin-top: 0; }

/* panels fold to their header (outside the drawer); everything can be hidden at once (Hide panels or H) */
.phead { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.panel.folded > :not(.phead) { display: none !important; }
.fold { background: none !important; border: 0 !important; color: var(--muted); font-size: 14px; cursor: pointer; padding: 2px 4px !important; transition: transform .2s; }
.tabs .fold { margin-left: auto; }
.panel.folded .fold[data-fold] { transform: rotate(-90deg); }
.hbtns { display: flex; gap: 2px; }
/* ?bare: only the map and its labels (for pictures and embeds) */
body.bare #nav, body.bare #drawer, body.bare #risk, body.bare #help, body.bare #minimapBox, body.bare #status, body.bare #poiCard,
body.bare #guide, body.bare #caption, body.bare #ueNote { display: none !important; }
body.ui-hidden #menuList, body.ui-hidden #drawer, body.ui-hidden #risk, body.ui-hidden #help, body.ui-hidden #minimapBox,
body.ui-hidden #status, body.ui-hidden #poiCard, body.ui-hidden #guide, body.ui-hidden .brand, body.ui-hidden #navLinks { opacity: 0; pointer-events: none; }
body.ui-hidden #nav { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.ui-hidden #menuBtn { background: var(--bg); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); border-radius: 980px; padding: 6px 14px; color: var(--text); }
body.ui-hidden #menuBtn .mb-wide, body.ui-hidden #menuBtn .mb-narrow, body.ui-hidden #menuBtn .chev { display: none; }
body.ui-hidden #menuBtn .mb-restore { display: inline; }
#risk, #poiCard, #guide { transition: opacity .5s; }

/* ---- section contents */
#left { padding: 0; }
#layers h2 { font-size: 13px; font-weight: 600; color: var(--text); margin: 2px 0 0; }
#right h2 { font-size: 13px; font-weight: 600; color: var(--text); margin: 18px 0 8px; letter-spacing: -0.01em; }
#right h2:first-of-type { margin-top: 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab { display: none; } .tab.on { display: block; }

.facts { margin: 0; display: grid; grid-template-columns: 112px 1fr; gap: 9px 12px; font-size: 13.5px; line-height: 1.4; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.note { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 12px 0 0; }
.muted { color: var(--muted); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--fill); border-radius: 14px; padding: 12px; }
.stat .v { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.stat .k { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.stat.wide { grid-column: span 2; }
.stat button { margin-top: 8px; padding: 5px 12px; font-size: 12px; }

#places { list-style: none; margin: 0; padding: 0; }
#places li { padding: 9px 10px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
#places li:hover { background: var(--fill); }
#places li small { color: var(--muted); white-space: nowrap; }

.wx { border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; background: var(--fill); }
.wx .top { display: flex; justify-content: space-between; align-items: baseline; }
.wx .name { font-weight: 600; font-size: 13.5px; }
.wx .temp { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.wx .cond { font-size: 13px; margin: 2px 0 6px; color: var(--text); }
.wx .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; font-size: 12px; color: var(--muted); }
.wx .upd { font-size: 11px; color: var(--muted); margin-top: 6px; }
#sun { font-size: 13px; line-height: 1.55; }
.time { margin-top: 10px; font-size: 12px; color: var(--muted); display: grid; gap: 6px; }
.time input[type=range] { width: 100%; }

/* ---- bottom of the screen: minimap, camera readout, controls hint */
#help { left: 50%; transform: translateX(-50%); bottom: 14px; padding: 7px 16px; font-size: 12px; color: var(--muted); white-space: nowrap; border-radius: 980px; }
#help b { color: var(--text); font-weight: 600; }
@media (max-width: 1320px) { #help { left: auto; right: 16px; transform: none; } }   /* clear of the camera readout on the left */
@media (max-width: 1060px) { #help { display: none; } }
#minimapBox { left: 16px; bottom: 50px; padding: 6px; }
#minimap { display: block; width: 300px; border-radius: 13px; cursor: crosshair; }
#mmBig { position: absolute; top: 12px; left: 12px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(29,29,31,.72);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; padding: 0; }
#mmBig:hover { background: rgba(29,29,31,.92); }
#minimapBox.big { left: 50%; top: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); z-index: 7; padding: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
#status { left: 16px; bottom: 14px; padding: 7px 14px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); border-radius: 980px; }
#status b { font-weight: 600; color: var(--text); }

/* ---- labels on the map */
.label { color: #fff; font-size: 12px; font-weight: 600; text-shadow: 0 1px 3px #000, 0 0 6px #000; cursor: pointer; white-space: nowrap;
  padding-left: 12px; position: relative; pointer-events: auto; }
.label::before { content: ""; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 0 2px rgba(0,0,0,.5); }
.label.tree::before { background: var(--accent); }
.label.way { font-size: 11px; font-weight: 500; padding-left: 0; cursor: default; pointer-events: none; opacity: .92; }
.label.way::before { display: none; }
.label.way.road { color: #e6eaef; } .label.way.trail { color: #9df5c0; }
.poi { display: flex; align-items: center; gap: 5px; cursor: pointer; pointer-events: auto; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.poi i { font-style: normal; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px;
  background: #ff7ab8; border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.6); text-shadow: none; transition: transform .2s; }
.poi.high i { width: 28px; height: 28px; font-size: 15px; }
.poi.low { font-size: 11px; opacity: .9; }
.poi:hover i { transform: scale(1.15); }

/* ---- Layers */
.layer { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; margin: 12px 0 3px; cursor: pointer; }
.layer small { margin-left: auto; color: var(--muted); font-weight: 400; }
.legend { margin: 0 0 4px 26px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.legend.keys { display: flex; flex-wrap: wrap; gap: 3px 12px; }
.legend.ends { display: flex; justify-content: space-between; }
.key { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sw { display: inline-block; width: 14px; height: 4px; border-radius: 2px; flex: none; }
.sw.wind { height: 2px; background: linear-gradient(90deg, rgba(106,140,196,0), #6a8cc4 35%, #d0e2fb 75%, #fff); }
.warr { display: inline-block; font-style: normal; font-weight: 700; color: #cfe8ff; }
.sw.walk { height: 10px; background: linear-gradient(90deg, #2acc57, #e0d040, #d23a2a); }
#poiList { list-style: none; margin: 6px 0 0 18px; padding: 0; max-height: 26vh; overflow: auto; }
#poiList li { padding: 6px 9px; border-radius: 9px; cursor: pointer; font-size: 12.5px; display: flex; gap: 8px; align-items: baseline; }
#poiList li:hover { background: var(--fill); }
#poiList li small { margin-left: auto; color: var(--muted); white-space: nowrap; }

/* ---- place card */
#poiCard { left: 16px; top: calc(var(--nav-h) + 12px); width: 360px; max-height: calc(100vh - var(--nav-h) - var(--mm-room)); overflow: auto; padding: 18px 18px 16px;
  font-size: 13.5px; line-height: 1.45; z-index: 5; }
#poiCard h3 { margin: 0 0 2px; font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.022em; padding-right: 34px; }
#poiCard .cat { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
#poiCard h4 { margin: 14px 0 5px; font-size: 13px; font-weight: 600; color: var(--text); }
#poiCard ul { margin: 0; padding-left: 18px; line-height: 1.5; }
#poiCard .rt { display: flex; flex-wrap: wrap; gap: 6px; }
#poiCard .rt span { background: var(--fill); border-radius: 980px; padding: 4px 10px; font-size: 12px; }
#poiCard .src { font-size: 11.5px; color: var(--muted); line-height: 1.55; word-break: break-word; }
#poiCard .btns { display: flex; gap: 6px; margin-top: 12px; }
#poiCard .go { background: var(--cta) !important; color: #fff !important; }
#poiCard .x { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; padding: 0; display: grid; place-items: center; color: var(--muted); }
#poiCard .ph { margin: 6px 0 2px; }
#poiCard .ph > img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 13px; cursor: zoom-in; background: var(--fill); }
#poiCard figcaption { font-size: 10.5px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
#poiCard .thumbs { display: flex; gap: 6px; margin-top: 6px; }
#poiCard .thumbs img { width: 33%; height: 54px; object-fit: cover; border-radius: 9px; cursor: pointer; opacity: .55; border: 2px solid transparent; transition: opacity .2s; }
#poiCard .thumbs img.on { opacity: 1; border-color: var(--text); }

/* ---- Sierra, the AI park guide (chat like Messages) */
body.guide-open #right { display: none; }
#guide { right: 16px; top: calc(var(--nav-h) + 12px); width: 370px; height: var(--panel-max); min-height: 320px; display: flex; flex-direction: column;
  padding: 14px 16px; z-index: 4; }
#guide header { display: flex; align-items: center; gap: 11px; }
#guide .gav { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 17px; color: #fff;
  background: linear-gradient(145deg, #34c759, #1f7a3a); }
#guide.talking .gav { animation: gpulse 1.1s ease-in-out infinite; }
@keyframes gpulse { 50% { box-shadow: 0 0 0 7px rgba(52,199,89,.22); } }
#guide .gname { display: flex; flex-direction: column; line-height: 1.25; }
#guide .gname b { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
#guide .gname small { color: var(--muted); font-size: 12px; }
#guide .x { margin-left: auto; width: 30px; height: 30px; display: grid; place-items: center; background: var(--fill); color: var(--muted); border: 0; border-radius: 50%; cursor: pointer; }
.gopts { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 10px 0 8px; flex-wrap: wrap; }
.gopts label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.gopts a { color: var(--link); margin-left: auto; }
#gLog { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.gm { max-width: 86%; padding: 8px 12px; border-radius: 18px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; }
.gm.amir { background: var(--fill-hover); align-self: flex-start; border-bottom-left-radius: 6px; }
.gm.you { background: #0a84ff; color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.gm.sys { align-self: center; font-size: 11.5px; color: var(--muted); background: none; text-align: center; }
#gForm { display: flex; gap: 6px; margin-top: 10px; }
#gInput { flex: 1; min-width: 0; background: var(--fill); color: var(--text); border: 1px solid transparent; border-radius: 980px; padding: 9px 14px; font-size: 13.5px; outline: none; }
#gInput:focus { border-color: rgba(10,132,255,.6); }
#gForm button { padding: 7px 12px; font-size: 14px; }
#gSend { background: var(--cta) !important; color: #fff; }
#gMic.on { background: #ff453a !important; animation: gpulse 1.1s ease-in-out infinite; }
#gNote:empty { display: none; }

/* ---- the welcome tour: only the landscape, Sierra's captions and the name stay on screen */
body.touring #menu, body.touring #navLinks, body.touring #drawer, body.touring #help, body.touring #minimapBox,
body.touring #status, body.touring #poiCard, body.touring #guide { opacity: 0; pointer-events: none; }
#menu, #drawer, #help, #minimapBox, #status { transition: opacity .8s; }
#caption { position: fixed; left: 50%; transform: translateX(-50%); bottom: 64px; max-width: min(820px, calc(100vw - 32px)); z-index: 6;
  background: var(--bg); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 24px; font-family: var(--font-display); font-size: 21px; font-weight: 500; line-height: 1.4; letter-spacing: -0.015em;
  text-align: center; color: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
#caption button { display: block; margin: 10px auto 0; background: var(--fill); border: 0; color: var(--muted); border-radius: 980px; padding: 5px 12px; cursor: pointer; font-size: 12px; }

#welcome { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; transition: opacity .8s;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.55), rgba(0,0,0,.9));
  backdrop-filter: blur(16px) saturate(120%); -webkit-backdrop-filter: blur(16px) saturate(120%); }
#welcome.hide { opacity: 0; pointer-events: none; }
.wbox { text-align: center; max-width: 980px; padding: 0 24px; }
.wkicker { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--muted); letter-spacing: -0.01em; }
.wbox h2 { margin: 6px 0 16px; font-family: var(--font-display); font-size: clamp(40px, 6.4vw, 80px); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em;
  background: linear-gradient(180deg, #fff 35%, #b9b9be); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wsub { font-size: 19px; color: var(--muted); line-height: 1.45; margin: 0 auto 30px; max-width: 580px; }
#wStart { font-size: 17px; font-weight: 500; padding: 12px 26px; border-radius: 980px; border: 0; cursor: pointer; color: #fff; background: var(--cta); transition: background .2s; }
#wStart:hover { background: #0077ed; }
.wlink { display: block; margin: 18px auto 0; background: none; border: 0; color: var(--link); cursor: pointer; font-size: 17px; }
.wlink:hover { text-decoration: underline; }
.wlink::after { content: " ›"; }
.whint { color: #86868b; font-size: 13px; margin-top: 26px; }

#loading { position: fixed; inset: 0; display: grid; place-items: center; background: #000; z-index: 10; transition: opacity .6s; }
#loading .box { width: 320px; text-align: center; }
#loading h2 { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.022em; margin: 0 0 16px; }
.bar { height: 4px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; }
#loadBar { height: 100%; width: 0; background: var(--text); transition: width .2s; }
#loadText { color: var(--muted); font-size: 13px; }

/* ---- analysis map legends (Layers and Hazards) */
.ovleg { margin: 2px 0 6px 26px; }
.vlist { list-style: none; margin: 4px 0; padding: 0; }
.vlist li { display: flex; align-items: center; gap: 8px; padding: 4px 7px; border-radius: 8px; font-size: 12.5px; cursor: pointer; line-height: 1.35; }
.vlist.static li, .vlist li.none { cursor: default; }
.vlist li:hover { background: var(--fill); }
.vlist.static li:hover { background: none; }
.vlist li > small { margin-left: auto; color: var(--muted); white-space: nowrap; }
.vlist .nm small { color: var(--muted); }
.vlist .sq { width: 12px; height: 12px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.vlist.picking li:not(.on) { opacity: .45; }
.vlist li.on { background: var(--fill-hover); }
.gbar { height: 8px; border-radius: 4px; margin: 6px 0 2px; background: linear-gradient(90deg, rgba(200,215,90,.3), #c8d75a 15%, #73e33c 60%, #1ef028); }
.opac { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.opac input { flex: 1; }
button.link { background: none; border: 0; color: var(--link); cursor: pointer; font-size: 12.5px; padding: 0; }
button.link:hover { text-decoration: underline; }

/* ---- Hazards panel (wildfire and rockfall) */
body.risk-open #right { display: none; }
#risk { right: 16px; top: calc(var(--nav-h) + 12px); width: 370px; max-height: var(--panel-max); overflow: auto; padding: 14px 16px 16px; z-index: 4; }
#risk h2 { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 2px; }
#risk h3, #risk h4 { font-size: 13px; font-weight: 600; color: var(--text); margin: 16px 0 6px; }
.rsec + .rsec { border-top: 1px solid var(--line); margin-top: 12px; }
.frow { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-size: 13px; flex-wrap: wrap; }
.frow > label { width: 74px; color: var(--muted); }
.frow select, .play select { padding: 5px 10px; font-size: 12.5px; }
#fWindSet { display: flex; align-items: center; gap: 6px; }
#fWindSpd { width: 86px; }
#risk button.big { width: 100%; margin: 10px 0 8px; padding: 11px; font-size: 15px; font-weight: 600; border-radius: 980px; cursor: pointer; color: #fff;
  border: 0; background: linear-gradient(180deg, #e0582c, #a8341a); transition: filter .2s; }
#risk button.big:hover { filter: brightness(1.1); }
#risk button.big.on { box-shadow: inset 0 0 0 2px #fff; }
.presets { font-size: 12px; color: var(--muted); }
#fPresets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
#fPresets button { text-align: left; padding: 8px 11px; font-size: 12.5px; line-height: 1.3; border-radius: 13px; }
#fPresets button small { display: block; color: var(--muted); font-size: 11px; }
.fnote { font-size: 12.5px; margin: 10px 0 0; color: #ffd9b0; line-height: 1.45; }
.fnote:empty { display: none; }
.play { display: flex; align-items: center; gap: 7px; margin-top: 12px; }
.play button { padding: 4px 11px; font-size: 14px; }
.play input[type=range] { flex: 1; accent-color: #ff7a3d; }
.fclock { font-size: 12px; color: var(--muted); text-align: center; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
#fStats .stat { padding: 9px 10px; }
#fStats .stat .v { font-size: 17px; }
.adv { border-radius: 12px; padding: 9px 11px; font-size: 12.5px; line-height: 1.5; border-left: 3px solid #7f8c99; background: var(--fill); }
.adv.c1 { border-color: #4caf50; } .adv.c2 { border-color: #e8d13b; } .adv.c3 { border-color: #f08c2a; } .adv.c4 { border-color: #d63a2a; } .adv.c5 { border-color: #8e24aa; }
#fAdvice ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.5; }
#fAdvice li + li { margin-top: 3px; }
#fThreat { list-style: none; margin: 0; padding: 0; max-height: 210px; overflow: auto; }
#fThreat li { display: flex; gap: 8px; align-items: baseline; padding: 5px 8px; border-radius: 9px; font-size: 12.5px; cursor: pointer; }
#fThreat li:hover { background: var(--fill); }
#fThreat li small { margin-left: auto; white-space: nowrap; color: #ffb58a; }
#fThreat .hit { color: #ff7d6b; } #fThreat .ok { color: #8fe39a; } #fThreat li.none { color: var(--muted); cursor: default; }
.tools { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.tools button { padding: 6px 12px; font-size: 12.5px; }
.tools button:disabled { opacity: .4; cursor: default; }
#fClear { margin-top: 6px; }
#toolHint { position: fixed; top: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 6; background: rgba(120,40,10,.9); border: 0;
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); color: #fff; padding: 8px 16px; border-radius: 980px; font-size: 13px; pointer-events: none; white-space: nowrap; }
body[data-tool] #view canvas { cursor: crosshair; }
.fire-ign { color: #fff; font-size: 12px; font-weight: 700; background: rgba(150,30,10,.88); border: 1px solid #ffb37a; border-radius: 980px; padding: 3px 10px;
  pointer-events: auto; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.sw.hsw { width: 16px; height: 16px; border-radius: 50%; background: #1b6fd1; color: #fff; font-size: 10px; font-weight: 800; display: inline-grid; place-items: center; }
.heli { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 800 12px var(--font); color: #fff;
  background: #1b6fd1; border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.6); cursor: pointer; pointer-events: auto; transition: transform .2s; }
.heli:hover { transform: scale(1.15); }

/* ---- wildlife */
#wildList { margin-left: 18px; }
#wildList li { align-items: flex-start; }
#wildList .em { font-size: 16px; width: 20px; text-align: center; flex: none; }
#wildList .nm small { font-size: 11px; }
#wildNote:empty { display: none; }
.animal-tag { font-size: 18px; line-height: 1; text-shadow: 0 1px 4px rgba(0,0,0,.8); pointer-events: none; filter: drop-shadow(0 0 2px rgba(255,255,255,.6)); }
#gbifCard { position: fixed; z-index: 5; width: 280px; padding: 12px 36px 12px 14px; font-size: 13px; line-height: 1.5; border-radius: 14px;
  max-height: calc(100vh - 16px); max-width: calc(100vw - 16px); overflow: auto; }
#gbifCard i, #gbifCard small { color: var(--muted); }
#gbifCard .x { position: absolute; top: 9px; right: 9px; width: 24px; height: 24px; border-radius: 50%; background: var(--fill); border: 0; color: var(--muted); cursor: pointer; font-size: 11px; }
body.ui-hidden #gbifCard { display: none; }

/* ---- weather in the 3D view */
.wxmodes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.wxmodes button { padding: 7px 4px; font-size: 12.5px; }
.wxint { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.wxint input { flex: 1; }
.wxint b { color: var(--text); font-weight: 600; min-width: 62px; }
.wxnote { font-size: 12px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
#wxStrike { color: var(--text); border-left: 3px solid #9cc9ff; padding-left: 10px; }
#wxStrike.close { border-color: #ffd23f; }
.bolt-tag { color: #fff; font-size: 12px; font-weight: 600; background: rgba(20,35,80,.88); border: 1px solid #9cc9ff; border-radius: 980px; padding: 3px 5px 3px 11px;
  white-space: nowrap; box-shadow: 0 2px 10px rgba(0,0,0,.5); pointer-events: auto; transition: opacity 1.4s; }
.bolt-tag.fade { opacity: 0; }
.bolt-tag button { margin-left: 7px; font: inherit; font-size: 11px; color: #fff; background: rgba(170,50,20,.88); border: 1px solid #ffb37a; border-radius: 980px; padding: 1px 8px; cursor: pointer; }
.bolt-tag button:hover { background: rgba(200,70,30,.95); }
#wxSnow { border-left: 3px solid #cfe6ff; padding-left: 10px; }
#wxSnow b { color: var(--text); font-weight: 600; }
.snow-sta { font-size: 11px; color: #eaf4ff; background: rgba(20,40,70,.8); border: 1px solid rgba(207,230,255,.55); border-radius: 980px;
  padding: 2px 8px; white-space: nowrap; pointer-events: auto; cursor: help; }
.snow-sta b { font-weight: 700; }

/* ---- phones and small windows */
@media (max-width: 900px) {
  #nav { padding: 0 16px; gap: 14px; }
  .brand b { font-size: 19px; } .brand span { font-size: 13px; }
  #drawer { left: 12px; right: 12px; width: auto; max-height: 56vh; }
  #menuList { right: -4px; width: min(300px, calc(100vw - 24px)); }
  #minimapBox { display: none; }
  #help { display: none; }
  #status { right: auto; }
  #poiCard { left: 12px; right: 12px; top: auto; bottom: 60px; width: auto; max-height: 45vh; }
  #guide { left: 12px; right: 12px; width: auto; top: auto; bottom: 60px; height: 52vh; }
  #risk { left: 12px; right: 12px; width: auto; top: auto; bottom: 60px; max-height: 52vh; }
  #caption { bottom: 60px; font-size: 17px; }
  #toolHint { top: auto; bottom: 60px; white-space: normal; text-align: center; }
}
