:root { --ink: #f4f7fb; --mut: #b9c3d4; --acc: #ffb020; --bg: #0b1020; --glass: rgba(9, 14, 28, 0.55); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#veil { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(1200px 700px at 50% 40%, #1b2a4a 0%, #0b1020 70%); z-index: 20; transition: opacity 1.2s ease; }
#veil.gone { opacity: 0; pointer-events: none; }
#veil .mark { font-size: clamp(44px, 9vw, 92px); font-weight: 800; letter-spacing: -0.03em; }
#loadmsg { color: var(--mut); font-size: 14px; }
#veil .bar { width: min(320px, 70vw); height: 3px; background: rgba(255, 255, 255, 0.12); border-radius: 3px; overflow: hidden; }
#loadbar { display: block; height: 100%; width: 0; background: var(--acc); transition: width 0.25s; }
#cap { position: fixed; left: max(28px, env(safe-area-inset-left)); bottom: 118px; max-width: min(720px, calc(100vw - 56px)); z-index: 5;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55); pointer-events: none; }
#cap > * { transition: opacity 0.7s ease, transform 0.7s ease; }
#cap::before { content: ''; position: absolute; inset: -90px -160px -60px -90px; z-index: -1;
  background: radial-gradient(closest-side, rgba(4, 8, 18, 0.62), rgba(4, 8, 18, 0)); }
#cap.out > * { opacity: 0; transform: translateY(10px); }
#kicker { color: var(--acc); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 13px; margin-bottom: 6px; }
#title { margin: 0; font-size: clamp(30px, 5.2vw, 64px); line-height: 1.04; font-weight: 800; letter-spacing: -0.02em; }
#sub { margin: 10px 0 0; color: #e3e9f3; font-size: clamp(15px, 1.7vw, 19px); max-width: 640px; }
#cap.big #title { font-size: clamp(38px, 7vw, 92px); }
@media (min-width: 761px) { #cap.narrow { max-width: max(280px, calc(100vw - 600px)); } #cap.narrow #title { font-size: clamp(28px, 3.6vw, 52px); } }
#legend { position: fixed; right: max(24px, env(safe-area-inset-right)); top: 22px; z-index: 5; display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: #e8edf5; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); transition: opacity 0.6s; }
#legend span { display: inline-flex; align-items: center; gap: 8px; }
#legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; box-shadow: 0 0 10px currentColor; }
#dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px max(24px, env(safe-area-inset-left)) calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 16px; z-index: 6;
  background: linear-gradient(to top, rgba(6, 10, 22, 0.78), rgba(6, 10, 22, 0)); }
#chips { display: flex; gap: 6px; flex-wrap: wrap; }
#chips button { all: unset; cursor: pointer; font-size: 12px; color: var(--mut); padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--glass); backdrop-filter: blur(6px); }
#chips button.on { color: #111; background: var(--acc); border-color: var(--acc); font-weight: 650; }
#ctl { display: flex; gap: 8px; align-items: center; flex: none; }
#ctl button, #ctl a { all: unset; cursor: pointer; font-size: 14px; padding: 9px 14px; border-radius: 10px; background: var(--glass); border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px); color: var(--ink); white-space: nowrap; }
#ctl #bExplore { background: var(--acc); color: #111; font-weight: 700; border-color: var(--acc); }
#ctl #bExplore.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 176, 32, 0.6); } 50% { box-shadow: 0 0 0 10px rgba(255, 176, 32, 0); } }
#foot { position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: 74px; font-size: 11px; color: rgba(230, 236, 245, 0.55); z-index: 5; pointer-events: none; }
@media (max-width: 760px) {
  #cap { bottom: 150px; left: 18px; right: 18px; }
  #dock { flex-direction: column-reverse; align-items: stretch; gap: 10px; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
  #chips { justify-content: center; } #chips button { font-size: 11px; padding: 4px 8px; }
  #ctl { justify-content: center; } #ctl #bExplore { flex: 1; text-align: center; }
  #foot { display: none; } #legend { top: 14px; right: 14px; font-size: 12px; }
}

#labels { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0; transition: opacity 0.8s; }
#labels.on { opacity: 1; }
#labels .pl { position: absolute; left: 0; top: 0; white-space: nowrap; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75); }
#labels .unit { font-weight: 750; font-size: 15px; background: rgba(8, 12, 24, 0.55); padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.25); }
#labels .room { font-size: 11px; color: #ffe2a8; }
#bom { position: fixed; right: max(24px, env(safe-area-inset-right)); top: 56px; width: min(520px, calc(100vw - 48px)); z-index: 6; display: flex; flex-direction: column;
  background: rgba(8, 12, 24, 0.78); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 14px; padding: 14px 16px; backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(14px); transition: opacity 0.8s ease, transform 0.8s ease; pointer-events: none; }
#bom.on { opacity: 1; transform: none; pointer-events: auto; }
#bom .sc { max-height: calc(100vh - 330px); overflow: hidden; }
#bom table { width: 100%; border-collapse: collapse; font-size: 12px; }
#bom td { padding: 3px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); vertical-align: top; }
#bom td.q { color: var(--mut); white-space: nowrap; text-align: right; }
#bom td.v { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
#bom tr.tot td { border-top: 2px solid var(--acc); border-bottom: 0; font-size: 14px; font-weight: 800; color: #fff; padding-top: 8px; }
#bom tr.tot td.v { color: var(--acc); }
#bom p { margin: 10px 2px 0; font-size: 11px; color: var(--mut); line-height: 1.45; }
@media (max-width: 760px) { #bom { top: 12px; right: 12px; left: 12px; width: auto; padding: 10px 12px; } #bom .sc { max-height: calc(100vh - 400px); } #bom table { font-size: 11px; }
  #labels .unit { font-size: 12px; padding: 2px 7px; } }
