/* Lumin UV — Project Lumin brand: navy #16326d, solar gold #f4a730, off-white #fff9f3 */
:root {
  --navy: #16326d;
  --navy-deep: #0a1633;
  --ink: #050b1f;
  --gold: #f4a730;
  --cream: #fff9f3;
  --text: #eef1fb;
  --muted: #9aa6c8;
  --line: rgba(255, 255, 255, 0.09);
  --glass: rgba(12, 22, 52, 0.62);
  --glass-strong: rgba(12, 22, 52, 0.82);
  --card: rgba(255, 255, 255, 0.045);
  --accent-uv: #f4a730;
  --radius: 20px;
  --panel-w: 384px;
  --gap: 16px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  --display: 'Outfit', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ink);
  color: var(--text);
  font: 14px/1.45 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

#map { position: fixed; inset: 0; background: #070d22; }
.maplibregl-canvas { outline: none; }
.maplibregl-ctrl-bottom-right { bottom: 98px; }
.maplibregl-ctrl-group {
  background: var(--glass) !important; border: 1px solid var(--line); border-radius: 12px !important;
  backdrop-filter: blur(14px); box-shadow: none !important; overflow: hidden;
}
.maplibregl-ctrl-group button { width: 36px; height: 36px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: invert(1) opacity(0.85); }
.maplibregl-ctrl-attrib { background: rgba(5, 11, 31, 0.7) !important; color: var(--muted); font-size: 10px; }
.maplibregl-ctrl-attrib a { color: #c5cde6; }
.maplibregl-ctrl-attrib.maplibregl-compact { position: fixed; right: 10px; bottom: 6px; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.map-error { position: absolute; top: 45%; width: 100%; text-align: center; color: var(--muted); }

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* ---------------- top bar ---------------- */
.topbar {
  position: fixed; top: var(--gap); left: var(--gap); right: var(--gap);
  display: flex; gap: 12px; align-items: flex-start; z-index: 1000; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
/* Official Project Lumin lockup, reversed (cream + orange) for the dark UI */
.brand {
  display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 14px 0 12px; border-radius: 16px;
  text-decoration: none; flex: none;
}
.brand-logo { height: 34px; width: auto; display: block; }
.brand-tag {
  font: 700 11px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--cream);
  padding-left: 12px; border-left: 1.5px solid rgba(255, 249, 243, 0.2); white-space: nowrap;
}
.brand-tag::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff8000; margin-right: 6px; vertical-align: 1px; }

.search {
  position: relative; display: flex; align-items: center; gap: 8px; flex: 1; max-width: 460px;
  padding: 0 6px 0 14px; height: 48px; border-radius: 16px;
}
.search > svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 15px; height: 100%; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(0.5); }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 11px;
  background: rgba(244, 167, 48, 0.14); transition: background 0.2s;
}
.icon-btn:hover { background: rgba(244, 167, 48, 0.28); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: var(--gold); stroke-width: 2; }
.results {
  position: absolute; top: 54px; left: 0; right: 0; list-style: none; margin: 0; padding: 6px;
  border-radius: 16px; background: var(--glass-strong);
}
.results li { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; outline: none; }
.results li:hover, .results li:focus { background: rgba(255, 255, 255, 0.07); }
.results li span { color: var(--muted); font-size: 12px; }
.results li.none { cursor: default; color: var(--muted); }

.layers { margin-left: auto; display: flex; padding: 4px; border-radius: 14px; gap: 2px; }
.seg {
  border: 0; background: none; padding: 9px 14px; border-radius: 10px; color: var(--muted);
  font-weight: 600; font-size: 13px; transition: all 0.2s; white-space: nowrap;
}
.seg.active { background: rgba(255, 255, 255, 0.1); color: var(--text); }

/* ---------------- panel ---------------- */
.panel {
  position: fixed; z-index: 900; left: var(--gap); top: calc(var(--gap) + 62px); bottom: 106px;
  width: var(--panel-w); border-radius: var(--radius); overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 18px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
  transition: opacity 0.2s;
}
.panel.loading #details { opacity: 0.45; pointer-events: none; transition: opacity 0.2s; }
.sheet-handle { display: none; }

.empty { text-align: center; padding: 18px 8px 22px; }
.empty h2 { font: 600 22px/1.2 var(--display); margin: 18px 0 8px; }
.empty p { color: var(--muted); margin: 0 0 18px; }
.empty-mark {
  width: 96px; height: 96px; margin: 6px auto 0; border-radius: 26px; background: var(--navy);
  display: grid; place-items: center;
  box-shadow: 0 0 0 10px rgba(244, 167, 48, 0.08), 0 0 60px rgba(244, 167, 48, 0.35);
  animation: breathe 4s ease-in-out infinite;
}
.empty-mark img { height: 72px; width: auto; }
@keyframes breathe { 50% { box-shadow: 0 0 0 14px rgba(244,167,48,.1), 0 0 80px rgba(244,167,48,.5); } }

.btn {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); padding: 10px 16px;
  border-radius: 12px; font-weight: 600; transition: all 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.11); }
.btn.primary { background: var(--gold); color: var(--navy-deep); border-color: transparent; }
.btn.primary:hover { background: #ffb948; }

.loc { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.loc h1 { font: 600 24px/1.15 var(--display); margin: 0; letter-spacing: -0.01em; }
.loc p { margin: 3px 0 0; }
.chip {
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 99px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line);
}

/* hero gauge */
.hero { text-align: center; padding: 10px 0 6px; position: relative; }
.hero::before {
  content: ''; position: absolute; left: 50%; top: 30px; width: 240px; height: 150px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent-uv) 30%, transparent), transparent 70%);
  filter: blur(14px); pointer-events: none; transition: background 0.6s;
}
.gauge { position: relative; width: 250px; margin: 6px auto 0; }
.gauge svg { width: 100%; display: block; overflow: visible; }
.gauge .track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 14; stroke-linecap: round; }
.gauge .arc { fill: none; stroke: url(#uvgrad); stroke-width: 14; stroke-linecap: round; transition: stroke-dasharray 0.5s ease; }
#gauge-dot { stroke: var(--cream); stroke-width: 4; transition: cx 0.5s ease, cy 0.5s ease, fill 0.5s; filter: drop-shadow(0 0 8px rgba(0,0,0,.5)); }
.gauge-center { position: absolute; left: 0; right: 0; bottom: 0; }
.uv-num { font: 700 64px/1 var(--display); letter-spacing: -0.04em; }
.uv-num small { font-size: 28px; color: var(--muted); font-weight: 600; }
.uv-label { color: var(--muted); font-size: 12px; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.cat-pill {
  --c: #3ecf8e; display: inline-block; margin-top: 12px; padding: 6px 16px; border-radius: 99px;
  font: 600 15px/1.2 var(--display); color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
}
.advice { margin: 12px 6px 4px; font-size: 14.5px; color: #d6dcf0; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-top: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.card h3 { font: 600 14px/1.2 var(--display); margin: 0; letter-spacing: 0.01em; }

.daybar { position: relative; display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 26px; }
.daybar i { background: var(--c); opacity: var(--o); border-radius: 3px; }
.daybar i:first-child { border-radius: 7px 3px 3px 7px; }
.daybar i:nth-child(24) { border-radius: 3px 7px 7px 3px; }
.daybar .nowmark {
  position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; border-radius: 2px;
  background: var(--cream); box-shadow: 0 0 0 2px rgba(5, 11, 31, 0.7), 0 0 10px rgba(255,255,255,.5);
}
.daybar-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 10.5px; margin-top: 6px; }
#window-text { color: #d6dcf0; font-weight: 600; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 13px;
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; }
.tile b { font: 600 19px/1.25 var(--display); }
.tile b small { font-size: 12px; font-weight: 600; }
.skin { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); gap: 2px; margin-top: 2px; }
.skin select {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font-size: 12px;
}
.skin select option { background: var(--navy-deep); }

.hourly { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.hourly::-webkit-scrollbar { display: none; }
.hr {
  flex: 0 0 30px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none;
  border: 0; padding: 4px 0; border-radius: 9px; transition: background 0.15s;
}
.hr:hover { background: rgba(255, 255, 255, 0.06); }
.hr.cur { background: rgba(255, 255, 255, 0.08); }
.hv { font: 600 12px/1 var(--display); height: 12px; }
.hb { height: 70px; width: 12px; display: flex; align-items: flex-end; background: rgba(255,255,255,.04); border-radius: 6px; }
.hb i { width: 100%; background: var(--c); border-radius: 6px; transition: height 0.4s; }
.hl { font-size: 10px; color: var(--muted); white-space: nowrap; }

.daily { list-style: none; margin: 0; padding: 0; }
.daily li { display: grid; grid-template-columns: 48px 1fr 22px 70px; gap: 10px; align-items: center; padding: 6px 0; }
.daily li + li { border-top: 1px solid var(--line); }
.dn { font-weight: 600; }
.db { position: relative; height: 8px; background: rgba(255, 255, 255, 0.06); border-radius: 99px; }
.db i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); border-radius: 99px; }
.db s { position: absolute; top: -3px; bottom: -3px; width: 2px; background: rgba(255,255,255,.45); border-radius: 2px; }
.daily b { font: 600 15px/1 var(--display); text-align: right; }
.dc { font-size: 12px; font-weight: 600; }

.kit { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kit li {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); opacity: 0.45; transition: all 0.3s;
}
.kit li span { font-size: 22px; filter: grayscale(1); transition: filter 0.3s; }
.kit li.on { opacity: 1; color: var(--text); background: rgba(244, 167, 48, 0.1); border-color: rgba(244, 167, 48, 0.35); }
.kit li.on span { filter: none; }
.reapply { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.hot { list-style: none; margin: 0; padding: 0; counter-reset: hot; }
.hot li {
  display: grid; grid-template-columns: 18px 1fr auto 34px; align-items: center; gap: 8px; padding: 7px 6px;
  border-radius: 10px; cursor: pointer; counter-increment: hot; outline: none;
}
.hot li::before { content: counter(hot); color: var(--muted); font-size: 12px; font-weight: 600; }
.hot li:hover, .hot li:focus { background: rgba(255, 255, 255, 0.06); }
.hn { font-weight: 600; }
.hc { font-size: 12px; font-weight: 600; }
.hot b {
  font: 700 14px/26px var(--display); text-align: center; border-radius: 8px; color: var(--navy-deep); background: var(--c);
}
.foot { margin-top: 16px; padding: 0 4px; }
.foot p { margin: 0 0 6px; }

/* ---------------- legend ---------------- */
.legend {
  position: fixed; z-index: 800; right: var(--gap); top: calc(var(--gap) + 62px); width: 300px;
  padding: 10px 12px; border-radius: 14px; font-size: 10.5px;
}
.legend-bar {
  height: 9px; border-radius: 99px;
  background: linear-gradient(90deg, #2a9d74 0%, #3ecf8e 9.4%, #a6d957 15.6%, #f9e04a 18.75%, #f9b233 31%, #f8922c 37.5%,
    #f26b2a 43.75%, #e8413a 50%, #d0234f 56%, #b01866 62.5%, #9b2fd0 68.75%, #7e22ce 75%, #6a1eba 81%, #541498 87.5%, #420c7a 93.75%, #320862 100%);
}
.legend-ticks { position: relative; height: 14px; margin: 5px 6px 0; font-weight: 600; }
.legend-ticks span { position: absolute; transform: translateX(-50%); }
.legend-names { display: grid; grid-template-columns: 18.75% 18.75% 12.5% 18.75% 31.25%; margin-top: 3px; color: var(--muted); }
.legend-extra { display: flex; gap: 14px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); }
.legend-extra span { display: flex; align-items: center; gap: 6px; }
.lg-line { width: 18px; height: 2px; background: #d8b4fe; border-radius: 2px; }

/* ---------------- timeline ---------------- */
.timeline {
  position: fixed; z-index: 950; left: calc(var(--panel-w) + var(--gap) * 2); right: var(--gap); bottom: var(--gap);
  border-radius: var(--radius); padding: 12px 18px 10px 12px; display: flex; gap: 14px; align-items: center;
}
.play {
  width: 50px; height: 50px; border-radius: 50%; border: 0; flex: none; display: grid; place-items: center;
  background: var(--gold); box-shadow: 0 6px 20px rgba(244, 167, 48, 0.35); transition: transform 0.15s;
}
.play:hover { transform: scale(1.05); }
.play svg { width: 22px; height: 22px; fill: var(--navy-deep); }
.play .i-pause, .play.playing .i-play { display: none; }
.play.playing .i-pause { display: block; }
.tl-main { flex: 1; min-width: 0; }
.tl-label { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tl-label b { font: 600 17px/1.2 var(--display); }
.tl-label .muted { font-size: 12.5px; }
.btn-chip { margin-left: auto; cursor: pointer; color: var(--gold); }
.tl-track { position: relative; margin-top: 6px; padding-bottom: 16px; }
#slider {
  --pct: 20%;
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; margin: 0; cursor: pointer;
  position: relative; z-index: 2;
}
#slider::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold) var(--pct), rgba(255, 255, 255, 0.12) var(--pct));
}
#slider::-moz-range-track { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); }
#slider::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--gold); }
#slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%;
  background: var(--cream); border: 4px solid var(--gold); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
#slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--cream); border: 4px solid var(--gold);
}
.tl-ticks { position: absolute; left: 10px; right: 10px; top: 20px; height: 14px; }
.tick { position: absolute; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.tick.day { color: var(--text); font-weight: 600; }
.tick.now { top: -16px; width: 2px; height: 10px; background: var(--cream); border-radius: 2px; opacity: 0.6; }

/* ---------------- marker & probe ---------------- */
.pin { position: relative; width: 22px; height: 22px; }
.pin-dot {
  position: absolute; inset: 4px; border-radius: 50%; background: var(--gold); border: 3px solid var(--cream);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.pin-pulse { position: absolute; inset: -10px; border-radius: 50%; background: rgba(244, 167, 48, 0.35); animation: pulse 2s ease-out infinite; }
@keyframes pulse { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

.probe {
  position: fixed; left: 0; top: 0; z-index: 1200; pointer-events: none; display: flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 10px; font-size: 12px; color: var(--muted);
  background: var(--glass-strong); border: 1px solid var(--line); backdrop-filter: blur(10px);
}
.probe b { color: var(--text); font: 700 14px/1 var(--display); }
.probe i { width: 10px; height: 10px; border-radius: 50%; }

.toast {
  position: fixed; z-index: 1300; left: 50%; top: 80px; transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--line);
  backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
  :root { --panel-w: 344px; }
  .legend { top: auto; bottom: 112px; right: 64px; width: 220px; }
  .layers .seg { padding: 9px 10px; }
}

@media (max-width: 760px) {
  :root { --gap: 10px; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .brand { height: 42px; padding: 0 10px; gap: 9px; }
  .brand-logo { height: 27px; }
  .brand-tag { font-size: 10px; padding-left: 9px; }
  .search { order: 3; flex: 1 0 100%; max-width: none; height: 44px; }
  .layers { margin-left: auto; }
  .seg { padding: 8px 9px; font-size: 12px; }
  .legend { display: none; }
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }
  .peak-tag small { display: none; }

  .timeline {
    left: var(--gap); right: var(--gap); bottom: auto; top: 128px; padding: 8px 12px 6px 8px; gap: 10px;
  }
  .play { width: 40px; height: 40px; }
  .tl-label b { font-size: 15px; }
  .tl-label .muted { font-size: 11px; }

  .panel {
    left: 0; right: 0; bottom: 0; top: auto; width: auto; height: 42vh; border-radius: 22px 22px 0 0;
    padding: 6px 16px calc(16px + env(safe-area-inset-bottom)); transition: height 0.35s ease;
  }
  .panel.open { height: 64vh; }
  .sheet-handle { display: block; width: 100%; height: 22px; position: sticky; top: -6px; z-index: 2; cursor: pointer; }
  .sheet-handle::after { content: ''; display: block; width: 44px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.25); margin: 8px auto 0; }
  .uv-num { font-size: 54px; }
  .gauge { width: 220px; }
}

.window-card .card-head { flex-direction: column; gap: 3px; }
.gauge .arc { stroke-dasharray: 0 283; }
#details.nodata > section { display: none; }
.err p { margin: 0 0 12px; color: #d6dcf0; }
.err { margin-top: 16px; }


/* peak marker */
.peak { --c: #a855f7; background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.peak-tag {
  display: flex; flex-direction: column; align-items: center; padding: 5px 10px 6px; border-radius: 10px; line-height: 1.1;
  background: rgba(10, 18, 44, 0.88); border: 1.5px solid var(--c); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 55%, transparent);
  backdrop-filter: blur(6px); white-space: nowrap;
}
.peak-tag small { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }
.peak-tag b { font: 700 15px/1.1 var(--display); color: #fff; }
.peak-stem { width: 2px; height: 10px; background: var(--c); }
.peak-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid #fff; margin-top: -1px; margin-bottom: -6px;
  animation: peakpulse 2s ease-out infinite; }
@keyframes peakpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 70%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.probe .pc { margin-left: 6px; padding-left: 8px; border-left: 1px solid var(--line); color: #cfd8f0; }
