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

html, body {
  height: 100%;
  background: #000;
  color: #fff;
  font-family: system-ui, -apple-system, sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

#viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#camera {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
}

#error[hidden] {
  display: none;
}

#error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
  text-align: center;
  background: #000;
  z-index: 10;
}

#error-message {
  font-size: 1.2rem;
  line-height: 1.5;
}

#retry {
  font-size: 1.2rem;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 2rem;
  background: #fff;
  color: #000;
  font-weight: 600;
}

#controls {
  padding: 1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

#profiles {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  scrollbar-width: none;
}

#profiles[hidden] {
  display: none;
}

.chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.55rem 0.8rem 0.55rem 1.1rem;
  border: 1px solid #666;
  border-radius: 2rem;
  background: #222;
  color: #fff;
}

.chip.active {
  background: #ffd60a;
  border-color: #ffd60a;
  color: #000;
}

.chip-delete {
  font-size: 1.4rem;
  line-height: 1;
  opacity: 0.7;
  padding: 0.1rem 0.35rem;
}

#zoom-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.zoom-icon {
  font-weight: 700;
  opacity: 0.8;
  line-height: 1;
}

.zoom-icon.small { font-size: 0.9rem; }
.zoom-icon.large { font-size: 1.8rem; }

/* Big, easy-to-grab slider */
#zoom {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 0.5rem;
  border-radius: 0.25rem;
  background: #444;
  outline: none;
}

#zoom::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

#zoom::-moz-range-thumb {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

#button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#zoom-value {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 4.5rem;
}

#save {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 2rem;
  background: #ffd60a;
  color: #000;
}

#save:active {
  transform: scale(0.97);
}

#toast {
  position: absolute;
  top: calc(1rem + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  color: #000;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  border-radius: 2rem;
  z-index: 20;
  white-space: nowrap;
}
