.look-playground {
  display: grid;
  grid-template-columns: minmax(340px, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
  align-items: stretch;
}

.look-controls {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
  padding: clamp(18px, 2.35vw, 26px);
}

.look-controls fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.look-controls legend,
.look-sliders label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
}

.look-controls legend {
  padding: 0;
  margin-bottom: 8px;
}

.look-choice {
  display: inline-grid;
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.look-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.look-choice input:focus-visible + span,
.look-controls :is(input[type="range"], input[type="checkbox"], button):focus-visible {
  outline: 2px solid var(--accent, #dfe2ec);
  outline-offset: 3px;
}

.look-themes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--fill);
}

.look-theme {
  display: grid;
  min-height: 34px;
  place-items: center;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.look-choice input:checked + .look-theme {
  background: var(--fill-2, rgb(255 255 255 / .14));
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--edge);
}

.look-accents {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
}

.look-swatch {
  display: grid;
  height: 38px;
  place-items: center;
  border-radius: 9px;
}

.look-swatch::before {
  content: '';
  display: block;
  width: min(21px, 76%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--look-swatch);
  box-shadow: inset 0 1px 1px rgb(255 255 255 / .42);
}

.look-choice:has([value="graphite"]) { --look-swatch: #c8cfdd; }
.look-choice:has([value="neutral"]) { --look-swatch: #ececec; }
.look-choice:has([value="blue"]) { --look-swatch: #729fff; }
.look-choice:has([value="violet"]) { --look-swatch: #bc8bff; }
.look-choice:has([value="pink"]) { --look-swatch: #ff8abf; }
.look-choice:has([value="orange"]) { --look-swatch: #ffab72; }
.look-choice:has([value="green"]) { --look-swatch: #77daa4; }
.look-choice:has([value="custom"]) { --look-swatch: conic-gradient(#f685b7, #f8b77e, #9ad78e, #72cce7, #a995f1, #f685b7); }

.look-choice input:checked + .look-swatch {
  box-shadow: inset 0 0 0 1px var(--accent, #dfe2ec);
  background: var(--fill);
}

.look-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.look-wallpapers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.look-wall {
  display: grid;
  grid-template-rows: 27px auto;
  gap: 5px;
  justify-items: stretch;
  min-height: 46px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
  border-radius: 8px;
}

.look-wall-chip {
  display: block;
  border-radius: 7px;
  background: var(--look-wallpaper);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .16);
}

.look-choice input:checked + .look-wall {
  color: var(--text);
  font-weight: 650;
}

.look-choice input:checked + .look-wall .look-wall-chip {
  outline: 1px solid var(--accent, #dfe2ec);
  outline-offset: 1px;
}

[data-look-wallpaper="aurora"] {
  --look-wallpaper: radial-gradient(ellipse at 20% 24%, #8061fa 0, transparent 57%), radial-gradient(ellipse at 76% 30%, #e887bd 0, transparent 63%), radial-gradient(ellipse at 72% 91%, #41d5bb 0, transparent 67%), #1d2854;
}

[data-look-wallpaper="dune"] {
  --look-wallpaper: radial-gradient(ellipse at 17% 25%, #ffa259 0, transparent 61%), radial-gradient(ellipse at 74% 41%, #d8738f 0, transparent 61%), linear-gradient(149deg, #7b3d4a, #352647);
}

[data-look-wallpaper="stone"] {
  --look-wallpaper: radial-gradient(ellipse at 15% 17%, #adb3bd 0, transparent 70%), radial-gradient(ellipse at 87% 77%, #768793 0, transparent 64%), #34414b;
}

[data-look-wallpaper="ocean"] {
  --look-wallpaper: radial-gradient(ellipse at 17% 35%, #497fff 0, transparent 70%), radial-gradient(ellipse at 75% 78%, #22c4b4 0, transparent 65%), #164d69;
}

[data-look-wallpaper="snow"] {
  --look-wallpaper: radial-gradient(ellipse at 18% 17%, #f8fcff 0, transparent 73%), radial-gradient(ellipse at 85% 73%, #a3b7e5 0, transparent 61%), #d7e1f6;
}

.look-sliders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 16px;
}

.look-slider {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 6px;
  align-items: baseline;
}

.look-slider output {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.look-slider input {
  width: 100%;
  height: 20px;
  grid-column: 1 / -1;
  margin: 0;
  accent-color: var(--accent, #dfe2ec);
  border-radius: 6px;
}

.look-slider input:disabled {
  opacity: .45;
}

.look-slider input[name="hue"] {
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, #ff667f, #ffc470, #87da86, #6cc8de, #828cff, #e596e1, #ff667f) center / 100% 5px no-repeat;
}

.look-slider input[name="hue"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border: 1px solid rgb(0 0 0 / .5);
  border-radius: 50%;
  background: #f2f3fa;
}

.look-slider input[name="hue"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 1px solid rgb(0 0 0 / .5);
  border-radius: 50%;
  background: #f2f3fa;
}

.look-controls-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.look-solid {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.look-solid input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #dfe2ec);
}

.look-stage {
  --look-scale: 1;
  --look-accent: #c8cfdd;
  --look-glass: rgb(29 29 40 / .64);
  --look-blur: 36px;
  --look-shade: rgb(16 20 38 / .28);
  --look-ink: #f4f5fb;
  --look-muted: #c8ccd8;
  --look-surface: rgb(255 255 255 / .08);
  --look-line: rgb(255 255 255 / .16);
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  margin: 0;
  min-width: 0;
  min-height: 510px;
  padding: clamp(16px, 3vw, 36px);
  overflow: hidden;
  background: linear-gradient(var(--look-shade), var(--look-shade)), var(--look-wallpaper);
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12);
}

.look-stage[data-look-theme="light"] {
  --look-shade: rgb(232 239 255 / .2);
  --look-ink: #181c2a;
  --look-muted: #394358;
  --look-surface: rgb(255 255 255 / .35);
  --look-line: rgb(20 30 54 / .15);
}

.look-workspace,
.look-window {
  grid-area: 1 / 1;
  min-width: 0;
  border-radius: 16px;
}

.look-workspace {
  width: min(94%, 460px);
  min-height: 225px;
  justify-self: start;
  align-self: center;
  margin-bottom: 91px;
  color: #202737;
  background: #eef1f9;
  box-shadow: 0 20px 58px rgb(20 32 70 / .24);
  transform: rotate(-4deg);
  overflow: hidden;
}

.look-workspace-bar {
  display: flex;
  gap: 5px;
  min-height: 35px;
  align-items: center;
  padding: 0 14px;
  background: #e3e8f3;
}

.look-workspace-bar i {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #98a5bc;
}

.look-workspace-bar span {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
}

.look-workspace-document {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  font-size: 14px;
  color: #323e55;
}

.look-workspace-document code {
  display: block;
  max-width: 100%;
  padding: 9px 10px;
  border-radius: 7px;
  background: #dce4f1;
  color: #243751;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.look-workspace-document .look-selection {
  margin: 2px 0 0;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid #617bb6;
  background: #dde8fb;
  max-width: max-content;
}

.look-window {
  z-index: 1;
  justify-self: end;
  align-self: center;
  width: min(calc(25rem * var(--look-scale)), 94%);
  margin-top: 102px;
  padding: 1em;
  font-size: calc(.89rem * var(--look-scale));
  color: var(--look-ink);
  background: var(--look-glass);
  -webkit-backdrop-filter: blur(var(--look-blur)) saturate(1.32);
  backdrop-filter: blur(var(--look-blur)) saturate(1.32);
  box-shadow: inset 0 0 0 1px var(--look-line), 0 23px 66px rgb(15 18 34 / .36);
}

.look-window-header {
  display: flex;
  align-items: center;
  gap: .55em;
  padding-bottom: .75em;
  border-bottom: 1px solid var(--look-line);
}

.look-window-header img {
  width: 1.7em;
  height: 1.7em;
}

.look-window-mode {
  margin-inline-start: auto;
  min-width: 0;
  padding: .25em .54em;
  border-radius: 999px;
  background: var(--look-surface);
  background: color-mix(in srgb, var(--look-accent) 16%, var(--look-surface));
  color: var(--look-muted);
  font-size: .77em;
  text-align: right;
}

.look-window-question {
  margin: 1em 0 .65em;
  color: var(--look-muted);
  font-size: .88em;
}

.look-window-answer {
  padding: .78em .9em;
  border-inline-start: 3px solid var(--look-accent);
  border-radius: 8px;
  background: var(--look-surface);
}

.look-window-answer p {
  margin: .45em 0 0;
  line-height: 1.5;
}

.look-window-answer code {
  padding: .12em .29em;
  border-radius: 4px;
  background: var(--look-surface);
}

@media (max-width: 850px) {
  .look-playground { grid-template-columns: minmax(0, 1fr); }
  .look-stage { grid-row: 1; min-height: 325px; }
  .look-workspace { width: min(91%, 480px); min-height: 172px; margin-bottom: 68px; }
  .look-window { margin-top: 75px; width: min(calc(25rem * var(--look-scale)), 87%); }
}

@media (max-width: 425px) {
  .look-stage { min-height: 295px; padding: 11px; border-radius: 17px; }
  .look-workspace { min-height: 144px; margin-bottom: 49px; }
  .look-workspace-document { padding: 11px; gap: 6px; }
  .look-window { max-width: calc(100% - 4px); margin-top: 70px; }
  .look-controls { gap: 14px; padding: 16px; }
  .look-wallpapers { gap: 5px; }
  .look-sliders { column-gap: 12px; }
}

@media (max-width: 850px) and (min-height: 760px) {
  .look-stage { position: sticky; z-index: 2; top: 74px; }
  .look-controls :is(input, button) { scroll-margin-block-start: 465px; }
}

@media (prefers-reduced-transparency: reduce) {
  .look-window {
    background: #252937;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .look-stage[data-look-theme="light"] .look-window { background: #f0f2fa; }
}
