:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f6f5f1;
  font-synthesis: none;
  color-scheme: dark;
  --muted: #b0b4ad;
  --accent: #e0edcb;
  --line: #393c36;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: #ccb6a5;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #e2f4b8;
  outline-offset: 4px;
}
button {
  color: inherit;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
[hidden] {
  display: none !important;
}
#light {
  position: fixed;
  inset: 0;
  background: #ccb6a5;
  transition: background-color 0.18s ease;
  z-index: -1;
}
#chrome {
  transition: opacity 0.22s ease;
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 32px 40px;
  color: #24271f;
}
.brand {
  font-size: 29px;
  font-weight: 650;
  letter-spacing: -1.3px;
}
.brand span {
  display: block;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0;
  margin-top: 8px;
}
.masthead .quiet {
  color: inherit;
  border: 1px solid #292c2638;
  background: #ffffff40;
}
.quiet,
.icon-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
  border-radius: 9px;
  min-height: 44px;
}
.quiet:hover,
.icon-button:hover {
  background: #ffffff0d;
  color: #fff;
}
.masthead .quiet:hover {
  color: #111;
  background: #ffffff80;
}
.key {
  font-size: 11px;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: 7px;
  opacity: 0.6;
  font-weight: 450;
}
.dock-position {
  position: fixed;
  bottom: max(30px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 32px));
}
.panel {
  background: #1c1f1b;
  border: 1px solid #ffffff1c;
  border-radius: 20px;
  box-shadow: 0 20px 65px #0003;
}
.dock-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 21px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #a7b19b;
  font-weight: 650;
}
h1 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.8px;
  margin: 6px 0 0;
  font-weight: 520;
}
.heading-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
#dock {
  padding: 25px 26px 20px;
  max-height: calc(100dvh - 80px);
  overflow: auto;
  scrollbar-width: thin;
}
.presets {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 27px;
}
.preset {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: #bfc4b9;
  min-height: 73px;
}
.preset:hover {
  background: #ffffff08;
}
.preset[aria-pressed="true"] {
  background: #30352a;
  border-color: #65734e;
  color: #f0f6e6;
}
.swatch {
  background: var(--swatch);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #fff4;
}
.sliders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.control label,
.color-inputs label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
}
.control output,
.color-inputs output {
  font-variant-numeric: tabular-nums;
  color: #d9decf;
  font-size: 12px;
  font-weight: 450;
}
.range-captions {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #9da595;
  margin-top: 0;
}
input[type="range"] {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 32px;
  background: transparent;
  margin: 9px 0 0;
  cursor: pointer;
  touch-action: pan-y;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 8px;
  background: var(--track, #52594a);
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 8px;
  background: var(--track, #52594a);
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #edf1e6;
  border: 3px solid #1c1f1b;
  box-shadow: 0 0 0 1px #a7af9b;
  margin-top: -8px;
}
input[type="range"]::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #edf1e6;
  border: 3px solid #1c1f1b;
  box-shadow: 0 0 0 1px #a7af9b;
}
#temperature {
  --track: linear-gradient(90deg, #ffb067, #ffe6ce, #eef5ff);
}
#intensity {
  --track: linear-gradient(90deg, #32372e, #f3f7e9);
}
.dock-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 24px;
  gap: 12px;
}
.primary {
  background: var(--accent);
  color: #22291c;
  font-weight: 600;
  font-size: 13px;
  border: 0;
  border-radius: 10px;
  min-height: 46px;
  padding: 12px 18px;
  white-space: nowrap;
}
.primary:hover {
  background: #edf8db;
}
.color-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 1px solid #505649;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  min-height: 46px;
}
.color-toggle:hover,
.color-toggle[aria-expanded="true"] {
  background: #30352a;
}
#current-color {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffe4ce;
  border: 1px solid #ffffff40;
}
.setup-tip {
  text-align: center;
  color: #24271f;
  font-size: 12px;
  margin: 15px 0 0;
  text-shadow: 0 1px 6px #ffffff40;
}
.is-fullscreen .masthead,
.is-fullscreen .setup-tip {
  display: none;
}
.is-fullscreen .dock-position {
  bottom: max(24px, env(safe-area-inset-bottom));
}
.controls-hidden #chrome {
  opacity: 0;
  pointer-events: none;
}
.controls-hidden {
  cursor: none;
}
.reveal {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #fff3;
  border-radius: 10px;
  background: #1c1f1b;
  color: #fff;
  padding: 13px 18px;
  opacity: 0;
  cursor: pointer;
}
.reveal:focus-visible {
  opacity: 1;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
h2 {
  font-size: 15px;
  font-weight: 550;
  margin: 0;
  letter-spacing: -0.2px;
}
#color-panel {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 13px;
}
.picker-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 23px;
  margin-top: 9px;
}
#spectrum {
  min-height: 175px;
  position: relative;
  border-radius: 10px;
  touch-action: none;
  cursor: crosshair;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, transparent), #f00;
  overflow: hidden;
}
#picker-cursor {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px #0009;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.color-inputs label {
  font-size: 11px;
}
.color-inputs input[type="range"] {
  margin: 0 0 2px;
  height: 27px;
}
.color-inputs input[type="range"]::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -7px;
}
#hue {
  --track: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
#hex {
  width: 108px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
  background: #11140f;
  color: #fff;
  border: 1px solid #555d4e;
  border-radius: 6px;
  padding: 8px;
  min-height: 36px;
}
.hex-label {
  margin-top: 5px;
}
#hex[aria-invalid="true"] {
  border-color: #ffa69e;
}
.error {
  color: #ffb8af;
  font-size: 12px;
}
#favorites {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 18px;
}
#favorite-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.favorite {
  display: flex;
  border: 1px solid #4b5342;
  border-radius: 8px;
  overflow: hidden;
}
.favorite button {
  border: 0;
  background: transparent;
  padding: 9px;
  min-height: 44px;
  font-size: 11px;
}
.favorite button:hover {
  background: #fff1;
}
.favorite-apply {
  display: flex;
  gap: 6px;
  align-items: center;
}
.favorite-apply span {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}
.favorite-remove {
  color: #b5bfa9;
  border-left: 1px solid #4b5342 !important;
}
.help {
  position: fixed;
  top: 95px;
  right: 32px;
  width: min(430px, calc(100% - 32px));
  padding: 22px 25px;
  z-index: 3;
  max-height: calc(100dvh - 125px);
  overflow: auto;
}
.is-fullscreen .help {
  top: 20px;
  max-height: calc(100dvh - 40px);
}
.help p {
  font-size: 13px;
  line-height: 1.65;
  color: #c5ccbd;
}
.help .fine {
  font-size: 11px;
  color: #a7b09d;
}
dl {
  font-size: 12px;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
dl div {
  display: grid;
  grid-template-columns: 60px 1fr;
}
dt {
  font-family: ui-monospace, monospace;
  color: #e0edcb;
}
dd {
  margin: 0;
  color: #c5ccbd;
}
#toast {
  position: fixed;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 30px);
  width: max-content;
  z-index: 10;
  font-size: 13px;
  line-height: 1.5;
  color: #fff;
  background: #252b20;
  padding: 13px 20px;
  border-radius: 10px;
  border: 1px solid #7b8d67;
  box-shadow: 0 8px 25px #0003;
  pointer-events: none;
}
.noscript {
  padding: 20px;
  background: #222;
  color: #fff;
}
.dark-light .masthead,
.dark-light .setup-tip {
  color: #fff;
  text-shadow: none;
}
.dark-light .masthead .quiet {
  border-color: #fff5;
  background: #2225;
}
@media (max-width: 600px) {
  .masthead {
    padding: 23px 20px;
  }
  .brand {
    font-size: 25px;
  }
  .brand span {
    font-size: 11px;
  }
  .dock-position {
    bottom: max(17px, env(safe-area-inset-bottom));
  }
  #dock {
    padding: 20px 18px 16px;
    border-radius: 17px;
    max-height: calc(100dvh - 65px);
  }
  .presets {
    gap: 2px;
    margin-bottom: 20px;
  }
  .sliders {
    gap: 20px;
  }
  .dock-heading {
    margin-bottom: 13px;
  }
  .quiet,
  .icon-button {
    padding: 8px;
    font-size: 11px;
  }
  .heading-actions {
    gap: 0;
  }
  .preset {
    font-size: 10px;
  }
  .swatch {
    width: 27px;
    height: 27px;
  }
  .primary {
    padding: 12px;
    font-size: 12px;
  }
  .color-toggle {
    padding: 10px;
    font-size: 12px;
  }
  .setup-tip {
    font-size: 10px;
  }
  .key {
    display: none;
  }
  .help {
    right: 16px;
    top: 82px;
  }
  .picker-layout {
    gap: 15px;
  }
  .color-inputs output {
    font-size: 10px;
  }
  .control label {
    font-size: 12px;
  }
  h1 {
    font-size: 23px;
  }
}
@media (max-height: 690px) {
  .masthead {
    padding-top: 18px;
  }
  .brand span {
    display: none;
  }
  .dock-position {
    bottom: 12px;
  }
  .setup-tip {
    margin-top: 8px;
  }
  #dock {
    max-height: calc(100dvh - 65px);
  }
  .is-fullscreen #dock {
    max-height: calc(100dvh - 34px);
  }
  .is-fullscreen .dock-position {
    bottom: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #light,
  #chrome {
    transition: none;
  }
}
/* Reserve validation space so blur cannot move a button during a click. */
#hex-error {
  min-height: 18px;
  margin: 10px 0 0;
}
#hex-error[hidden] {
  display: block !important;
  visibility: hidden;
}
/* Explicit position wins over the normal and fullscreen bottom anchors. */
.dock-position[data-moved] {
  bottom: auto;
  transform: none;
}
#dock-heading {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
#dock-heading.dragging,
#dock-heading.dragging #move-panel {
  cursor: grabbing;
}
.dock-position.is-mini {
  width: min(440px, calc(100% - 32px));
}
.is-mini .preset-heading,
.is-mini .presets,
.is-mini #favorites,
.is-mini #save,
.is-mini #light-name,
.is-mini .setup-tip {
  display: none;
}
.is-mini #dock {
  padding: 16px 20px;
}
.is-mini .dock-heading {
  margin-bottom: 16px;
}
.is-mini .dock-footer {
  margin-top: 18px;
  padding-top: 14px;
}
.is-mini .sliders {
  gap: 22px;
}

/* A single settings-panel vocabulary: grip, segments, toggles and ranges. */
#dock {
  padding: 18px 22px;
  border-radius: 16px;
  background: #20221f;
}
#dock-heading {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
#move-panel {
  display: grid;
  place-items: center;
  width: 32px;
  height: 44px;
  padding: 0;
  border: 1px solid #4b5047;
  border-radius: 7px;
  background: #2c3029;
  color: #a5ae9c;
  cursor: grab;
  touch-action: none;
}
#move-panel:hover {
  background: #383e31;
  color: #e0edcb;
  border-color: #81916b;
}
.drag-grip {
  display: block;
  width: 12px;
  height: 22px;
  background: radial-gradient(circle, currentColor 1.5px, transparent 1.8px) 0
    0 / 6px 7px;
}
.panel-title h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap;
}
.panel-title #light-name {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
}
.segmented {
  display: flex;
  padding: 3px;
  background: #121510;
  border: 1px solid #424a39;
  border-radius: 9px;
  gap: 2px;
}
.segmented button {
  min-height: 36px;
  min-width: 48px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #a7b09e;
  font-size: 12px;
  font-weight: 550;
}
.segmented button:hover {
  color: #fff;
  background: #30372a;
}
.segmented button[aria-pressed="true"] {
  color: #eff5e5;
  background: #3c4830;
  border-color: #6c8051;
  box-shadow: 0 1px 3px #0004;
}
.settings-button {
  background: #30362b;
  border: 1px solid #545f46;
  border-radius: 8px;
  padding: 8px 12px;
  min-height: 40px;
  font-size: 12px;
  color: #e2e9d8;
  white-space: nowrap;
}
.settings-button:hover {
  background: #414b35;
  border-color: #84946e;
}
.preset-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.setting-label {
  font-size: 12px;
  font-weight: 550;
  color: #cad2bf;
}
.preset {
  border-color: #434b3a;
  background: #282d24;
}
.preset:hover {
  background: #343d2b;
  border-color: #809365;
}
.preset[aria-pressed="true"] {
  border-color: #bbd49a;
  background: #3b492e;
  box-shadow: inset 0 0 0 1px #bbd49a;
}
.control {
  padding: 13px 14px 10px;
  border: 1px solid #424a39;
  border-radius: 10px;
  background: #191d16;
}
.sliders {
  gap: 12px;
}
.control output {
  background: #303827;
  padding: 4px 7px;
  border-radius: 5px;
  color: #e6eedb;
}
.control label {
  min-height: 24px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 15px;
}
.setting-row label {
  cursor: pointer;
  font-size: 12px;
  font-weight: 550;
}
.setting-row label span {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 4px;
}
.switch {
  position: relative;
  width: 48px;
  height: 30px;
  padding: 3px;
  flex: 0 0 48px;
  border: 1px solid #69715f;
  border-radius: 18px;
  background: #373d31;
}
.switch span {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #b8c0ae;
  transition: transform 0.15s ease;
}
.switch[aria-checked="true"] {
  background: #c3dba2;
  border-color: #d3eab3;
}
.switch[aria-checked="true"] span {
  background: #29351d;
  transform: translateX(18px);
}
.dock-footer {
  border-top: 0;
  padding-top: 0;
  margin-top: 18px;
}
.color-toggle {
  background: #292f23;
  border-color: #566349;
}
.color-toggle[aria-expanded="true"] {
  border-color: #c3dba2;
  background: #3b492e;
}
.disclosure {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 4px;
  margin-top: -4px;
}
.color-toggle[aria-expanded="true"] .disclosure {
  transform: rotate(225deg);
  margin-top: 3px;
}
.primary[aria-pressed="true"] {
  background: #394b2b;
  border: 1px solid #c3dba2;
  color: #e6f3d5;
}
.is-mini #dock {
  padding: 14px 16px;
}
.is-mini #dock-heading {
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
}
.is-mini .panel-title #light-name {
  display: none;
}
.is-mini .sliders {
  gap: 10px;
}
.is-mini .control {
  padding: 10px;
}
.is-mini .dock-footer {
  padding-top: 0;
}
@media (max-width: 600px) {
  #dock {
    padding: 16px;
  }
  #dock-heading {
    gap: 7px;
  }
  .panel-title h1 {
    font-size: 12px;
  }
  .segmented button {
    min-width: 38px;
    padding: 6px;
  }
  #hide {
    padding: 8px;
  }
  .control {
    padding: 10px;
  }
  .control label {
    font-size: 11px;
    gap: 5px;
  }
  .control output {
    font-size: 10px;
    padding: 4px;
  }
  .sliders {
    gap: 10px;
  }
  .color-toggle {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .switch span {
    transition: none;
  }
}

.dock-position:not(.is-mini) #color-toggle,
.dock-position:not(.is-mini) #color-close {
  display: none;
}
.dock-position:not(.is-mini) .dock-footer {
  justify-content: flex-end;
}
.dock-position:not(.is-mini) #color-panel {
  margin-top: 18px;
  padding-top: 16px;
}

#dock .dock-footer {
  position: sticky;
  bottom: -18px;
  z-index: 2;
  background: #20221f;
  padding-top: 12px;
  padding-bottom: 8px;
  box-shadow: 0 -10px 12px #20221f;
}
#dock-heading {
  position: sticky;
  top: -18px;
  z-index: 3;
  background: #20221f;
  padding-top: 8px;
}
