* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, system-ui, sans-serif;
  overflow: hidden;
  height: 100vh;
}

#c {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Control panel ── */

#ui {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 15, 30, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  width: 240px;
  backdrop-filter: blur(10px);
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  font-size: 11px;
  color: #e0e0e0;
}

#ui::-webkit-scrollbar {
  width: 3px;
}

#ui::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

h2 {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #9ecfff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Panel toggle ── */

#uiToggle {
  display: none;
  background: none;
  border: none;
  color: #9ecfff;
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

#ui.collapsed #uiBody {
  display: none;
}

#ui.collapsed {
  width: auto;
}

h3 {
  font-size: 9px;
  font-weight: 500;
  margin: 10px 0 5px;
  color: #5588aa;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 3px;
}

/* ── Controls ── */

.ct {
  margin-bottom: 7px;
}

.ct label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #8899aa;
  margin-bottom: 2px;
}

.v {
  font-weight: 500;
  color: #fff;
}

input[type=range] {
  width: 100%;
  height: 3px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  margin: 2px 0;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #5b9aff;
  cursor: pointer;
}

/* ── Button groups ── */

.bs {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.bs button {
  padding: 3px 6px;
  font-size: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  color: #999;
  cursor: pointer;
  transition: all 0.1s;
}

.bs button:hover,
.bs button.a {
  background: rgba(91, 154, 255, 0.2);
  border-color: #5b9aff;
  color: #fff;
}

/* ── Info bar ── */

#info {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  background: rgba(15, 15, 30, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  backdrop-filter: blur(10px);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #e0e0e0;
}

.ib {
  flex: 1;
  min-width: 120px;
}

.ib .lb {
  font-size: 9px;
  color: #5588aa;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 1px;
}

.ib .bg {
  font-size: 16px;
  font-weight: 500;
  color: #5bff9a;
}

.ib .su {
  font-size: 10px;
  color: #8899aa;
  margin-top: 1px;
}

/* ── Fit check badges ── */

.m {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  margin: 1px;
}

.m.y {
  background: rgba(91, 255, 154, 0.15);
  color: #5bff9a;
}

.m.n {
  background: rgba(255, 102, 68, 0.15);
  color: #ff6644;
}

/* ── Sun info ── */

.si {
  background: rgba(255, 200, 60, 0.08);
  border: 1px solid rgba(255, 200, 60, 0.15);
  border-radius: 6px;
  padding: 6px 8px;
  margin-top: 6px;
  font-size: 10px;
  color: #ddc866;
}

/* ── Hint ── */

#hint {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
}

/* ── Mobile ── */

@media (max-width: 600px) {
  #uiToggle {
    display: inline-block;
  }

  #ui {
    width: auto;
    max-width: calc(100vw - 20px);
  }

  #ui.collapsed {
    padding: 8px 12px;
  }

  #ui.collapsed h2 {
    margin-bottom: 0;
  }

  #info {
    display: none;
  }

  #hint {
    display: none;
  }
}
