html { background: #1c1c1e; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  width: 240px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 14px;
  background: #1c1c1e;
  color: #f2f2f7;
  padding: 14px 14px 4px;
  gap: 14px;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.version { font-size: 11px; color: #636366; font-weight: 400; margin-left: 4px; vertical-align: middle; }
.title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-left: 8px;
}
.title-flip { color: #ff9f0a; text-decoration: underline; }

/* Main content wrapper (preserves flex gap after popup.html refactor) */
#main-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Toggle row */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.label {
  color: #ebebf5cc;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 8px;
}

/* iOS-style toggle switch */
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; margin-right: 8px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: #3a3a3c;
  border-radius: 13px;
  transition: background 0.2s;
  cursor: pointer;
}
.slider::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  left: 2px; top: 2px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.switch input:checked + .slider { background: #ff9f0a; }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* Intensity slider */
.intensity-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider-track-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 16px;
}

input[type=range]#intensitySlider {
  -webkit-appearance: none;
  width: calc(100% - 16px);
  margin: 0 8px;
  height: 3px;
  background:
    linear-gradient(#1c1c1e, #1c1c1e) 25% center / 2px 5px no-repeat,
    linear-gradient(#1c1c1e, #1c1c1e) 50% center / 2px 5px no-repeat,
    linear-gradient(#1c1c1e, #1c1c1e) 75% center / 2px 5px no-repeat,
    linear-gradient(to right, #ffb340 0%, #ff9f0a var(--pf-fill, 50%), #3a3a3c var(--pf-fill, 50%));
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
  touch-action: pan-y;
}

input[type=range]#intensitySlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #ff9f0a;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  cursor: pointer;
}

.slider-ticks { display: none; }

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #ebebf599;
  padding: 0 8px;
}
.slider-labels span { cursor: pointer; }

/* Action buttons */
.actions-wrap { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.actions {
  display: flex;
  gap: 8px;
}
.btn {
  flex: 1;
  padding: 8px 0;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn.primary   { background: #ff9f0a; color: #1c1c1e; text-decoration: underline; }
.btn.secondary { background: transparent; border-color: #ff9f0a; color: #ff9f0a; }
