:root { color-scheme: dark; --fg: #e8ecf1; --bg: #10151cdd; --accent: #ffd400; --alert: #ff3b30; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font: 14px/1.4 system-ui, sans-serif; color: var(--fg); background: #000; }
#map { position: fixed; inset: 0; }

#ui {
  position: fixed; z-index: 1; display: flex; flex-wrap: wrap; gap: .5rem;
  inset: auto 0 0 0; padding: .75rem max(.75rem, env(safe-area-inset-right)) max(.75rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
  background: var(--bg); backdrop-filter: blur(8px);
  border-top: 2px solid #ffffff22; border-radius: 1rem 1rem 0 0;
}
@media (min-width: 640px) {
  #ui { inset: 1rem auto auto 1rem; width: 23rem; border: 2px solid #ffffff22; border-radius: 1rem; }
}
#ui > * { flex: 1 1 calc(50% - .5rem); min-width: 0; }
#ui > :is(h1, output, progress, canvas) { flex: 1 1 100%; }
#ui > :is([name=shape], #cfg, label.cfg) { flex: 1 1 calc(25% - .5rem); }
#ui:not([data-cfg]) > .cfg { display: none; }
#ui > #day { flex: 6 1 calc(50% - .5rem); }
#ui > #clock { flex: 6 1 calc(50% - .5rem); }

h1 { margin: 0; font-size: 1.2rem; color: var(--accent); }
h1 small { font-weight: 400; color: #9aa7b6; font-size: .75rem; }
output { font-variant-numeric: tabular-nums; }
#status { color: #9aa7b6; }
#day, #clock { text-align: center; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .85rem; padding-inline: .35rem; }
label { display: grid; gap: .15rem; font-size: .75rem; color: #9aa7b6; }
select, button, input:is([type=date], [type=time]) { font: inherit; color: inherit; background: #ffffff14; border: 1px solid #ffffff2a; border-radius: .5rem; padding: .5rem .3rem; min-height: 2.5rem; min-width: 0; width: 100%; }
button { cursor: pointer; }
button:hover { background: #ffffff28; }
button[aria-pressed=true] { background: var(--accent); color: #000; border-color: var(--accent); }
button[aria-pressed=true]:hover { background: #ffe040; }
#count { padding: .6rem; border-radius: .5rem; background: #ffffff10; font-size: 1.1rem; text-align: center; }
#count.alert { background: var(--alert); color: #fff; font-weight: 700; }
#plot { width: 100%; height: 7rem; touch-action: none; cursor: pointer; }
progress { height: 1.4rem; width: 100%; accent-color: var(--accent); }
[hidden] { display: none; }
.tip .maplibregl-popup-content { background: #10151cf2; color: var(--fg); border: 1px solid #ffffff44; border-radius: .5rem; padding: .4rem .6rem; font-size: .8rem; white-space: pre-line; font-variant-numeric: tabular-nums; pointer-events: none; }
.tip .maplibregl-popup-tip { display: none; }
#map .maplibregl-canvas { cursor: crosshair; }
#coord { position: fixed; top: 0; left: 0; z-index: 1; pointer-events: none; padding: .25rem .45rem; border-radius: .4rem; background: #10151ccc; border: 1px solid #ffffff2a; font-size: .75rem; line-height: 1.3; white-space: pre-line; font-variant-numeric: tabular-nums; }
