/* Typography */

/* M PLUS 2 (M+ FONTS Project, SIL OFL 1.1 — vendor/fonts/OFL.txt), the M+ family nullschool uses */

@font-face {
  font-family: "M PLUS 2";
  font-weight: 100 900;
  font-display: swap;
  src: url(vendor/fonts/mplus2-latin.woff2) format("woff2");
}

/* Page and map layers */

html,
body {
  margin: 0;
  height: 100%;
  background: #0b1622;
  color: #ddd;
  font: 300 15px/1.45 "M PLUS 2", system-ui, sans-serif;
  overflow: hidden;
  cursor: crosshair;
}

#overlay,
#borders,
#particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#overlay,
#borders {
  transform-origin: 0 0;
  /* Stretch the layers on the GPU while zooming. */
  will-change: transform;
}

a {
  color: #8cf;
}

/* Bottom-left dock: click readout stacked above the information panel. */

#dock {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  cursor: default;
}

.box {
  background: rgba(4, 12, 24, .82);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 6px;
  padding: 10px 14px;
}

.grid {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  row-gap: 5px;
  align-items: center;
}

.lbl {
  color: #aaa;
  text-align: right;
  padding-right: 10px;
  border-right: 1px solid rgba(255, 255, 255, .5);
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.title {
  font-weight: 600;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

#panelBody {
  margin-top: 8px;
}

#panelToggle {
  font-size: 16px;
  line-height: 1;
}

.foot {
  margin-top: 8px;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
  color: #fff;
}

/* Buttons and forecast controls */

button.link {
  background: none;
  border: 0;
  color: #ccc;
  font: inherit;
  padding: 1px 6px;
  border-radius: 3px;
  cursor: pointer;
}

button.link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}

button.link.on {
  color: #fd9;
  background: rgba(255, 210, 120, .18);
}

.controls {
  display: flex;
  gap: 4px;
  margin-left: -6px;
}

#zone {
  color: #aaa;
}

.fc {
  color: #fc6;
}

/* PM2.5 legend */

#legendBar {
  display: block;
  width: 300px;
  height: 10px;
  border-radius: 2px;
}

#legendTicks {
  position: relative;
  display: block;
  height: 14px;
  width: 300px;
  font-size: 11px;
  color: #bbb;
}

#legendTicks span {
  position: absolute;
  transform: translateX(-50%);
}

/* Timeline slider */

#slider {
  width: 300px;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #888 var(--now, 100%), #c90 var(--now, 100%));
}

#slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

#slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

/* Map readout and date picker */

#readout {
  font-variant-numeric: tabular-nums;
}

#marker {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -9px 0 0 -9px;
  border: 2px solid #4f4;
  border-radius: 50%;
  pointer-events: none;
}

#datePick {
  background: transparent;
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 3px;
  font: inherit;
  font-size: 13px;
  padding: 0 4px;
  color-scheme: dark;
}

.controls {
  align-items: center;
}

#borders {
  /* The top layer handles mouse input. */
  cursor: grab;
}

#borders:active {
  cursor: grabbing;
}

/* Area drawing tools and landmark list (top right) */

#borders.drawing {
  cursor: crosshair;
}

button.link:disabled {
  opacity: .4;
  cursor: default;
  background: none;
}

#area[hidden] {
  display: none;
}

#areaTools {
  position: absolute;
  right: 18px;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  cursor: default;
}

button.tool {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
}

button.tool svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#area {
  position: absolute;
  right: 74px;
  top: 18px;
  width: 320px;
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  cursor: default;
}

#areaTabs {
  flex-wrap: wrap;
  margin-bottom: 4px;
}

#areaStatus {
  margin: 4px 0;
  color: #aaa;
  font-size: 13px;
}

#areaStatus:empty {
  display: none;
}

#areaList {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}

#areaList button {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

#areaList .kind {
  color: #888;
  font-size: 12px;
  white-space: nowrap;
}
