:root {
  color-scheme: light;
  --paper: #faf9f6;
  --paper-2: #f7f5f1;
  --ink: #24211f;
  --hover: #8b2f32;
  --line: rgba(36, 33, 31, 0.08);
  --muted: rgba(36, 33, 31, 0.5);
  --fill: color-mix(in srgb, var(--ink) 5%, var(--paper));
  --wash: color-mix(in srgb, var(--hover) 9%, var(--paper));
  --wash-hover: color-mix(in srgb, var(--hover) 16%, var(--paper));
  --radius: 999px;
  --field: 10px;
  --space: 8px;
  --space-2: 14px;
  --space-3: 22px;
  --space-4: 32px;
  --label-gap: 12px;
  --label-col: 6rem;
  --control: 6.5rem;
  --control-sm: 3.2rem;
  --pad: 28px;
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", system-ui, sans-serif;
  --serif: "Libre Baskerville", serif;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--hover) 40%, transparent) transparent;
}

*::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--hover) 40%, transparent);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--hover) 65%, transparent);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

button,
summary,
.chip,
.upload,
.choice-trigger,
.about-label,
.sheet-edit-brush {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  min-height: 100vh;
  position: relative;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.lucide-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.studio {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--desk-w, 400px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  padding: 18px 22px 18px 18px;
  background: var(--paper);
  overflow-x: clip;
}

.renderer {
  position: fixed;
  top: 0;
  left: 0;
  width: 720px;
  height: 720px;
  border: 0;
  z-index: 0;
  pointer-events: none;
}

.masthead {
  position: relative;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

h1 {
  position: relative;
  z-index: 2;
  margin: 0;
  font-family: var(--serif);
  font-size: 2.75rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  color: var(--hover);
  cursor: default;
}

.mode-switch {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: -4px 0 0;
}

.mode-btn {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 16px;
  line-height: 1.2;
  color: var(--muted);
  cursor: pointer;
}

.mode-btn.is-active {
  color: var(--ink);
}

.mode-btn:hover,
.mode-btn:focus-visible {
  color: var(--hover);
}

.mode-switch .reset {
  display: none;
}

.desk[data-mode="create"] .paint-kit {
  display: none;
}

.desk[data-mode="customize"] .stack {
  display: none;
}

.paint-kit-summary {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.about {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.about-label {
  display: block;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.about-label:hover,
.about-label:focus-visible,
.about.is-open .about-label {
  color: var(--hover);
}

.about-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(22rem, 100%);
  max-width: 100%;
  padding: 10px 12px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper) 92%, #fff);
  box-shadow:
    0 0 0 1px rgba(36, 33, 31, 0.045),
    0 10px 24px rgba(36, 33, 31, 0.06);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.about-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 8px;
}

.about.is-open .about-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .about:hover .about-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
}

.about-menu p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.about-menu a {
  color: inherit;
  overflow-wrap: anywhere;
  text-underline-offset: 2px;
}

.about-menu a:hover,
.about-menu a:focus-visible {
  color: var(--hover);
}

.desk-shell {
  position: sticky;
  top: 18px;
  width: 100%;
  max-height: calc(100vh - 36px);
  min-width: 0;
  overflow: visible;
}

.desk-frame {
  position: relative;
  width: 100%;
  max-height: inherit;
  min-width: 0;
  overflow: visible;
}

.mobile-sheet {
  display: contents;
}

.mobile-sheet-handle {
  display: none;
}

.desk {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: inherit;
  min-width: 0;
  max-width: 100%;
  padding: 22px 22px 24px;
  border: 0;
  border-radius: 24px;
  background: color-mix(in srgb, var(--paper) 88%, #fff);
  box-shadow:
    0 0 0 1px rgba(36, 33, 31, 0.045),
    0 18px 48px rgba(36, 33, 31, 0.07);
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior-x: none;
  scrollbar-width: none;
}

.desk::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

@media (min-width: 721px) {
  .desk-resize {
    display: block;
    position: absolute;
    top: 0;
    right: -8px;
    bottom: 0;
    z-index: 9;
    width: 20px;
    cursor: ew-resize;
    touch-action: none;
  }

  .desk-resize::after {
    content: "";
    position: absolute;
    top: 18%;
    bottom: 18%;
    left: 50%;
    width: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--hover) 45%, transparent);
    transform: translateX(-50%);
  }

  .desk-resize:hover::after,
  .desk-resize.is-dragging::after {
    width: 4px;
    background: var(--hover);
  }

  body.is-desk-resizing {
    cursor: ew-resize;
    user-select: none;
  }

  body.is-desk-resizing * {
    cursor: ew-resize !important;
  }

  .desk {
    min-height: 0;
    gap: 20px;
    padding: 28px 8px 8px;
    background: transparent;
    box-shadow: none;
    overflow-x: clip;
    overflow-y: hidden;
  }

  .masthead {
    flex: 0 0 auto;
    gap: 12px;
    padding: 0 12px 4px;
  }

  .about-label {
    margin-top: 2px;
  }

  .mode-switch {
    gap: 12px;
    margin-top: 0;
  }

  .mobile-sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    gap: 0;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    padding: 0;
    border: 1px solid rgba(36, 33, 31, 0.1);
    border-radius: 22px;
    background: color-mix(in srgb, var(--paper) 88%, #fff);
    box-shadow: 0 4px 11px rgba(36, 33, 31, 0.04);
    overflow: hidden;
  }

  .mobile-sheet-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    padding: 18px var(--rail-gap, 28px) 18px 20px;
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior: contain;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: none;
  }

  .mobile-sheet-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .mobile-sheet-handle {
    display: none;
  }

  .stack {
    gap: 12px;
  }

  .stack > .field {
    display: block;
    min-height: 0;
    padding: 10px 10px 10px;
    border: 1px solid rgba(36, 33, 31, 0.1);
    border-radius: 22px;
    background: var(--paper);
    box-shadow: 0 3px 9px rgba(36, 33, 31, 0.035);
  }

  .stack > .field .scene-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
  }

  .stack > .field .scene-controls {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
    min-height: 30px;
  }

  .stack > .field .scene-row #scene,
  .stack > .field .scene-row .scene-caption {
    order: -1;
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 6px 6px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 15px;
    line-height: 22px;
  }

  .scene-row .upload,
  .scene-row .paint {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
  }

  .scene-row .upload {
    border: 1px solid rgba(36, 33, 31, 0.14);
    background: transparent;
    color: var(--ink);
  }

  .scene-row .upload svg,
  .scene-row .paint svg {
    width: 15px;
    height: 15px;
  }

  .scene-row .paint {
    border: 0;
    background: var(--hover);
    color: var(--paper);
    box-shadow: none;
  }

  .stack > .field .field-head {
    flex: 0 0 auto;
    align-self: center;
    width: fit-content;
    margin-left: auto;
    padding-left: 0;
  }

  .stack > .field .field-head .choice-trigger {
    display: grid;
    place-items: center;
    min-height: 30px;
    padding: 0;
    line-height: 1;
  }

  .stack > .field .field-head .count-word {
    display: none;
  }

  .stack > .field .field-head .count-num {
    display: inline-grid;
    place-items: center;
    width: auto;
    min-width: 34px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 8%, var(--paper));
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    color: var(--ink);
  }

  .stack > .field .field-head .choice-trigger:hover .count-num,
  .stack > .field .field-head .choice-trigger:focus-visible .count-num,
  .stack > .field .field-head .choice.is-open .count-num {
    background: color-mix(in srgb, var(--ink) 12%, var(--paper));
    color: var(--ink);
  }

  .stack > .field .field-head .choice-trigger::after {
    display: none;
  }

  .chips {
    gap: 6px;
  }
}

.desk-rail {
  position: absolute;
  top: 12px;
  right: 4px;
  bottom: 12px;
  z-index: 4;
  width: 22px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.desk-rail[hidden] {
  display: none;
}

.desk-scroll {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 32px;
  margin-left: -2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--hover) 40%, transparent);
  pointer-events: none;
  will-change: transform;
}

.desk-rail:hover .desk-scroll,
.desk-rail.is-dragging .desk-scroll {
  background: color-mix(in srgb, var(--hover) 65%, transparent);
}

.desk-rail.is-dragging {
  cursor: grabbing;
}

@media (pointer: coarse) {
  .mobile-sheet {
    --rail-gap: 44px;
  }

  .desk-rail {
    right: 0;
    width: 44px;
  }

  .desk-scroll {
    width: 5px;
    margin-left: -2.5px;
  }
}

.desk-resize {
  display: none;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space);
  margin: 0;
  min-width: 0;
}

.stack > .field {
  gap: 18px;
}

.stack > .field .field-head {
  justify-content: flex-start;
}

.field > span {
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
}

.field-head > span {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink);
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.field-head .choice {
  flex: 0 0 auto;
  width: auto;
}

.field-head .choice-trigger {
  display: flex;
  align-items: baseline;
  gap: 6px;
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0 16px 0 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}

.field-head .count-word {
  color: var(--muted);
}

.field-head .count-num {
  color: var(--ink);
}

.field-head .choice-trigger:hover .count-num,
.field-head .choice-trigger:focus-visible .count-num,
.field-head .choice.is-open .count-num {
  color: var(--hover);
}

.choice-menu.is-count {
  min-width: 2.6rem;
}

.choice-menu.is-count [role="option"] {
  justify-content: center;
  text-align: center;
}

.field-head .choice-trigger::after {
  right: 2px;
}

.scene-row {
  display: flex;
  align-items: flex-start;
  gap: var(--label-gap);
}

.scene-controls {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.scene-row #scene,
.scene-caption {
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
}

.scene-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.scene-caption[hidden] {
  display: none;
}

.scene-caption img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--paper-2);
}

.scene-caption span {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-row.has-photo #scene {
  display: none;
}

.scene-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 2px;
}

textarea,
input,
select,
button {
  font: inherit;
  color: inherit;
}

#scene,
#apiKey,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 9px 14px;
}

select {
  height: 32px;
  padding: 0 28px 0 14px;
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%2324211f' stroke-opacity='0.45' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round' d='M1.2 1.2 5 4.8 8.8 1.2'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

#scene {
  resize: none;
  overflow-x: hidden;
  overflow-y: hidden;
  field-sizing: content;
  min-height: 38px;
  max-height: 16em;
  line-height: 1.45;
  padding: 9px 16px 9px 12px;
  border-radius: 12px;
}

#scene::-webkit-resizer {
  display: none;
}

#count {
  flex: 1;
  width: auto;
  min-width: 0;
  height: 32px;
}

#scene:focus-visible,
#apiKey:focus-visible,
select:focus-visible,
.choice-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--hover) 45%, transparent);
  outline-offset: 1px;
}

.choice {
  position: relative;
  flex: 1;
  min-width: 0;
}

select.choice-native {
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  min-width: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  flex: none;
}

.choice-trigger {
  position: relative;
  display: block;
  width: 100%;
  height: 32px;
  padding: 0 28px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
  font: inherit;
  font-size: 13px;
  line-height: 32px;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

.choice-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.2px solid currentColor;
  border-bottom: 1.2px solid currentColor;
  opacity: 0.45;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.choice.is-open .choice-trigger::after {
  transform: translateY(-30%) rotate(-135deg);
}

.choice-menu {
  box-sizing: border-box;
  position: fixed;
  inset: unset;
  z-index: 80;
  margin: 0;
  padding: 6px;
  width: max-content;
  min-width: 4.5rem;
  height: fit-content;
  max-height: min(240px, calc(100vh - 16px));
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper) 92%, #fff);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0;
  list-style: none;
  box-shadow:
    0 0 0 1px rgba(36, 33, 31, 0.045),
    0 10px 24px rgba(36, 33, 31, 0.06);
}

.choice-menu[hidden] {
  display: none;
}

.choice-menu [role="option"] {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}

.choice-menu [role="option"]:hover,
.choice-menu [role="option"]:focus {
  background: var(--wash-hover);
  color: var(--hover);
  outline: none;
}

.choice-menu [role="option"].is-selected {
  background: var(--wash);
  color: var(--hover);
}

.choice-menu [role="option"].is-selected:hover,
.choice-menu [role="option"].is-selected:focus {
  background: var(--wash-hover);
}

.sample-kit {
  margin: 0;
  padding: 0;
  border: 0;
}

.sample-kit > summary {
  display: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7.5px 8px;
  margin: 0;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7.5px 8px;
  flex: 1 0 100%;
}

.chip {
  border: 0;
  background: color-mix(in srgb, var(--hover) 8%, transparent);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.chip:hover,
.chip:focus-visible,
.chip.active {
  color: var(--hover);
  background: color-mix(in srgb, var(--hover) 14%, transparent);
}

.chip:focus-visible {
  outline: 1px solid var(--hover);
  outline-offset: 2px;
}

.upload {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.upload svg {
  display: block;
  width: 14px;
  height: 14px;
}

.upload input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.upload:hover,
.upload:focus-visible,
.upload.active {
  color: var(--hover);
}

.tools {
  display: flex;
  align-items: center;
  gap: var(--label-gap);
}

.tools .slide {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}

.tools .slide select,
.tools .slide .choice {
  flex: 1;
  width: auto;
  margin-left: 0;
}

.paint,
.reset,
.save,
.expand {
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
}

.paint {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
}

.paint svg {
  display: block;
  width: 14px;
  height: 14px;
}

.paint .lucide-icon {
  stroke-width: 1.75;
}

.reset,
.save,
.expand {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
}

.reset svg,
.save svg,
.expand svg {
  display: block;
  width: 14px;
  height: 14px;
}

.paint:hover,
.paint:focus-visible {
  color: var(--hover);
}

.reset:hover,
.reset:focus-visible,
.save:hover,
.save:focus-visible,
.expand:hover,
.expand:focus-visible {
  color: var(--hover);
}

.paint:focus-visible,
.reset:focus-visible,
.save:focus-visible,
.expand:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--hover) 45%, transparent);
  outline-offset: 1px;
}

.paint:disabled,
.save:disabled {
  opacity: 0.4;
  cursor: default;
}

.paint:disabled {
  cursor: wait;
}

.status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.status:empty {
  display: none;
}

.paint-kit {
  margin: 0;
  padding-top: 0;
  border-top: 0;
  min-width: 0;
  max-width: 100%;
}

.paint-kit > summary,
.pane > summary,
.keys summary {
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink);
}

.paint-kit > summary {
  font-size: 16px;
}

.paint-kit > summary::-webkit-details-marker,
.pane > summary::-webkit-details-marker,
.color-group > summary::-webkit-details-marker,
.effect-groups > details > summary::-webkit-details-marker,
.keys summary::-webkit-details-marker {
  display: none;
}

.paint-kit > summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 36px;
  line-height: 1;
}

.paint-kit > summary::after,
.pane > summary::after,
.color-group > summary::after,
.effect-groups > details > summary::after,
.keys > summary::after {
  content: "";
  display: block;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: 1px;
  border-right: 1.15px solid currentColor;
  border-bottom: 1.15px solid currentColor;
  transform: rotate(45deg);
  transform-origin: center;
  opacity: 0.45;
}

.paint-kit[open] > summary::after,
.pane[open] > summary::after,
.color-group[open] > summary::after,
.effect-groups > details[open] > summary::after,
.keys[open] > summary::after {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.paint-kit-body {
  display: none;
  flex-direction: column;
  margin-top: 8px;
  min-width: 0;
  max-width: 100%;
}

.paint-kit[open] > .paint-kit-body {
  display: flex;
}

.pane,
.paint-kit-body > .keys {
  margin: 0;
  padding: 4px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
  max-width: 100%;
}

.pane > summary,
.color-group > summary,
.effect-groups > details > summary {
  display: flex;
  align-items: center;
  gap: var(--label-gap);
  min-height: 36px;
  color: var(--muted);
}

.pane > summary .tool-reset,
.color-group > summary .tool-reset,
.effect-groups > details > summary .tool-reset {
  margin-left: auto;
}

.pane > summary::after,
.color-group > summary::after,
.effect-groups > details > summary::after {
  margin-left: 6px;
}

.paint-kit > summary .reset {
  margin-left: 0;
}

.pane > summary:hover,
.pane > summary:focus-visible,
.paint-kit > summary:hover,
.paint-kit > summary:focus-visible {
  color: var(--hover);
}

.effects-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--label-gap);
  min-height: 28px;
  margin: 0 0 12px;
}

#brushControls,
#placementControls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.place-board {
  display: flex;
  align-items: center;
  gap: var(--label-gap);
}

.place-board .slide {
  flex: 0 1 auto;
  min-width: 0;
  justify-content: flex-start;
}

.place-board .slide span {
  flex: 0 0 auto;
  width: auto;
}

.place-board .slide input[type="range"] {
  flex: 0 1 7.5rem;
  width: 7.5rem;
  max-width: 7.5rem;
  margin-left: 0;
}

.stick {
  position: relative;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
}

.stick:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--hover) 45%, transparent);
  outline-offset: 2px;
}

.stick.is-dragging {
  cursor: grabbing;
}

.stick-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 1px solid var(--hover);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: none;
  pointer-events: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#brushControls .slide:has(select),
#brushControls .slide:has(.choice),
.slide:has(select) + .slide,
.slide:has(.choice) + .slide {
  margin-top: 0;
}

#brushControls .slide:has(select),
#brushControls .slide:has(.choice) {
  margin-bottom: 22px;
}

#brushControls .slide.is-brush-type {
  gap: 8px;
}

#brushControls .slide.is-brush-type span {
  flex: 0 0 auto;
  width: auto;
}

#brushControls .slide.is-brush-type .choice {
  flex: 0 0 6.75rem;
  width: 6.75rem;
  min-width: 6.75rem;
  height: auto;
}

.effects-head .reset,
.paint-kit > summary .reset {
  margin-left: 0;
}

.color-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 132px;
  margin: 0;
}

.color-square {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 132px;
}

.color-field .color-square {
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.color-square-map {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, var(--hue, #8b2f32));
  box-shadow: none;
  cursor: crosshair;
  touch-action: none;
}

.color-square-map:focus-visible {
  outline: 1px solid var(--hover);
  outline-offset: 2px;
}

.color-square-thumb {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: var(--pick, #8b2f32);
  box-shadow: none;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.color-square-hue {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #f00,
    #ff0,
    #0f0,
    #0ff,
    #00f,
    #f0f,
    #f00
  );
  cursor: pointer;
}

.color-square-hue::-webkit-slider-runnable-track {
  height: 10px;
  background: transparent;
  border: 0;
}

.color-square-hue::-moz-range-track {
  height: 10px;
  background: transparent;
  border: 0;
}

.color-square-hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(36, 33, 31, 0.28);
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
}

.color-square-hue::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(36, 33, 31, 0.28);
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
}

.color-square-hex {
  box-sizing: border-box;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-align: center;
}

.color-square-hex:focus-visible {
  outline: 1px solid var(--hover);
  outline-offset: 1px;
}

.effect-groups {
  display: flex;
  flex-direction: column;
}

.effect-groups details {
  border-top: 1px solid var(--line);
  padding: 4px 0;
}

.effect-groups details:last-child {
  padding-bottom: 0;
}

.effect-groups summary {
  display: flex;
  align-items: center;
  min-height: 36px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.effect-groups summary:hover,
.effect-groups summary:focus-visible {
  color: var(--hover);
}

.slide {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--label-gap);
  margin: 0;
  min-width: 0;
  max-width: 100%;
  min-height: 28px;
  touch-action: pan-y;
}

.effect-groups details .slide + .slide {
  margin-top: 14px;
}

.slide span,
.color-field > span,
.tools .slide span {
  flex: 0 0 var(--label-col);
  width: var(--label-col);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--ink);
}

.slide input[type="range"] {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 16px;
  margin: 0;
  padding: 0;
  background: transparent;
  accent-color: var(--hover);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  touch-action: pan-y;
}

.slide select,
.slide .choice {
  flex: 0 0 var(--control);
  width: var(--control);
  margin: 0;
  height: 32px;
  padding: 0 28px 0 12px;
  border: 1px solid var(--line);
  background-color: var(--paper);
  border-radius: var(--radius);
  font-size: 13px;
}

.slide .choice {
  padding: 0;
  border: 0;
  background: transparent;
  height: auto;
}

.slide .choice .choice-trigger {
  padding: 0 28px 0 12px;
}

.field .choice {
  width: 100%;
}

.field .field-head .choice {
  flex: 0 0 auto;
  width: auto;
}

.slide input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--line);
}

.slide input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5.5px;
  border: 1px solid var(--hover);
  background: var(--paper);
  border-radius: 50%;
  box-shadow: none;
  cursor: pointer;
}

.slide input[type="range"]::-moz-range-track {
  height: 1px;
  background: var(--line);
  border: 0;
}

.slide input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 1px solid var(--hover);
  background: var(--paper);
  border-radius: 50%;
  box-shadow: none;
  cursor: pointer;
}

.keys > .hint,
.keys > .field {
  margin-top: var(--space-2);
}

.paint-kit-body > .keys {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.paint-kit-body > .keys > summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--label-gap);
  min-height: 36px;
  color: var(--muted);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.wall {
  padding: 14px 12px 12px 10px;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  overflow-y: auto;
  min-height: calc(100vh - 36px);
  max-height: calc(100vh - 36px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

.sheet {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.sheet.active .frame {
  outline: 1px solid var(--hover);
  outline-offset: 3px;
}

.sheet.is-adjusting img {
  opacity: 0.88;
}

.sheet-edit {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  user-select: none;
}

.sheet-edit.is-bottom,
.sheet-edit.is-left,
.sheet-edit.is-right,
.sheet-edit.is-free,
.sheet-edit.is-dragging {
  position: absolute;
  flex: none;
  width: max-content;
  max-width: calc(100% - 14px);
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 18%, transparent);
  box-shadow: 0 0 0 1px rgba(36, 33, 31, 0.05);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.sheet-edit.is-bottom {
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
}

.sheet-edit.is-left,
.sheet-edit.is-right {
  flex-direction: column;
  padding: 6px 4px 5px;
  border-radius: 14px;
}

.sheet-edit.is-left {
  left: 8px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

.sheet-edit.is-right {
  left: auto;
  right: 8px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

.sheet-edit-grip {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  background:
    radial-gradient(circle at 25% 25%, var(--muted) 1px, transparent 1.2px),
    radial-gradient(circle at 75% 25%, var(--muted) 1px, transparent 1.2px),
    radial-gradient(circle at 25% 75%, var(--muted) 1px, transparent 1.2px),
    radial-gradient(circle at 75% 75%, var(--muted) 1px, transparent 1.2px);
  background-color: transparent;
  cursor: grab;
  opacity: 0.55;
  touch-action: none;
}

.sheet-edit-grip::before {
  content: "";
  position: absolute;
  inset: -8px -6px;
}

.sheet-edit-grip:hover,
.sheet-edit-grip:focus-visible {
  opacity: 1;
}

.sheet-edit-grip:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--hover) 45%, transparent);
  outline-offset: 2px;
}

.sheet-edit.is-dragging .sheet-edit-grip {
  cursor: grabbing;
}

.sheet-edit-color {
  position: relative;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  flex: 0 0 auto;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.sheet-edit-color:focus-visible {
  outline: none;
}

.sheet-edit-swatch {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    0 0 0 1px color-mix(in srgb, var(--ink) 16%, transparent);
  pointer-events: none;
}

.sheet-edit-color:hover .sheet-edit-swatch,
.sheet-edit-color:focus-visible .sheet-edit-swatch,
.sheet-edit-color[aria-expanded="true"] .sheet-edit-swatch {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.4),
    0 0 0 1px var(--hover),
    0 0 0 3px color-mix(in srgb, var(--hover) 16%, transparent);
}

.sheet-edit-sat {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-inline-end: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.01em;
}

.sheet-edit-sat-name {
  flex: 0 0 auto;
  line-height: 1;
  white-space: nowrap;
}

.sheet-edit.is-left .sheet-edit-sat,
.sheet-edit.is-right .sheet-edit-sat {
  align-items: center;
  margin-inline-end: 0;
}

.sheet-edit.is-left .sheet-edit-sat-name,
.sheet-edit.is-right .sheet-edit-sat-name {
  display: none;
}

.sheet-edit-sat-rail {
  position: relative;
  z-index: 0;
  flex: 0 0 58px;
  width: 58px;
  min-width: 58px;
  height: 8px;
  --sat: 0.5;
  --pigment: var(--hover);
}

.sheet-edit-sat-rail::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
  transform: translateY(-50%);
  pointer-events: none;
}

.sheet-edit-sat-rail::after {
  content: "";
  position: absolute;
  left: calc(var(--sat) * 100%);
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pigment);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--paper) 88%, #fff);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sheet-edit.is-left .sheet-edit-sat-rail,
.sheet-edit.is-right .sheet-edit-sat-rail {
  flex: 0 0 8px;
  width: 8px;
  min-width: 8px;
  height: 58px;
}

.sheet-edit.is-left .sheet-edit-sat-rail::before,
.sheet-edit.is-right .sheet-edit-sat-rail::before {
  left: 50%;
  right: auto;
  top: 0;
  bottom: 0;
  width: 2px;
  height: auto;
  transform: translateX(-50%);
}

.sheet-edit.is-left .sheet-edit-sat-rail::after,
.sheet-edit.is-right .sheet-edit-sat-rail::after {
  left: 50%;
  top: calc((1 - var(--sat)) * 100%);
}

.sheet-edit-sat-rail input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.sheet-edit.is-left .sheet-edit-sat-rail input,
.sheet-edit.is-right .sheet-edit-sat-rail input {
  writing-mode: vertical-lr;
  direction: rtl;
}

.sheet-edit-sat-rail input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 8px;
  height: 8px;
  box-shadow: none;
}

.sheet-edit-sat-rail input::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 0;
  box-shadow: none;
}


.sheet-edit-brush {
  position: relative;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  flex: 0 0 auto;
  color: var(--ink);
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.sheet-edit-brush:focus-visible {
  outline: none;
}

.sheet-edit-brush-face {
  position: relative;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
}

.sheet-edit-brush-face .lucide-icon {
  display: block;
  width: 13px;
  height: 13px;
}

.sheet-edit-brush:hover,
.sheet-edit-brush:focus-visible,
.sheet-edit-brush[aria-expanded="true"] {
  color: var(--hover);
}

.sheet-edit-brush:hover .sheet-edit-brush-face,
.sheet-edit-brush:focus-visible .sheet-edit-brush-face,
.sheet-edit-brush[aria-expanded="true"] .sheet-edit-brush-face {
  color: inherit;
}

.brush-ico {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brush-arc-readout-dot .brush-ico {
  width: 17px;
  height: 17px;
}

.sheet-color-menu {
  position: fixed;
  padding: 10px;
  min-width: 0;
  overflow: visible;
}

.brush-dial-menu {
  position: absolute;
  z-index: 4;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  pointer-events: none;
  --apex: 5px;
  --radius: 140px;
  --icon-r: 120px;
  --hash-r: 138px;
  --cy: 140px;
}

.brush-dial-menu[hidden] {
  display: none;
}

.brush-arc,
.brush-arc-face {
  width: 100%;
  height: 100%;
}

.brush-arc-face {
  position: relative;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
  background: transparent;
}

.brush-arc-ring {
  height: var(--radius);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.42), rgba(248, 245, 238, 0.24));
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
}

.brush-arc-hashes {
  position: absolute;
  left: 50%;
  top: var(--cy);
  width: 0;
  height: 0;
  --turn: 0deg;
  pointer-events: none;
}

.brush-arc-hash {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 7px;
  margin-left: -0.5px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--hover) 40%, transparent);
  transform-origin: 50% 0;
  transform: rotate(calc(var(--turn) + var(--ang))) translateY(calc(-1 * var(--hash-r)));
}

.brush-arc-hash.is-major {
  height: 11px;
  background: color-mix(in srgb, var(--hover) 62%, transparent);
}

.brush-arc-face:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--hover) 45%, transparent);
  outline-offset: -3px;
}

.brush-arc-face.is-dragging {
  cursor: grabbing;
}

.brush-arc-track {
  position: absolute;
  left: 50%;
  top: var(--cy);
  width: 0;
  height: 0;
}

.brush-arc-tick {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(36, 33, 31, 0.5);
  font: inherit;
  line-height: 1;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  transform: rotate(var(--ang));
}

.brush-arc-tick::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 44px;
  transform: translate(-50%, calc(-1 * var(--icon-r) - 6px));
}

.brush-arc-tick.is-far {
  visibility: hidden;
  pointer-events: none;
}

.brush-arc-spoke {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 42px;
  transform: translate(-50%, calc(-1 * var(--icon-r))) rotate(calc(-1 * var(--ang)));
  pointer-events: none;
}

.brush-arc-mark {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: transparent;
}

.brush-arc-label {
  display: block;
  font-family: var(--ui);
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: -0.011em;
  line-height: 1;
  text-transform: lowercase;
  white-space: nowrap;
}

.brush-arc-tick.is-active,
.brush-arc-tick:hover {
  color: var(--hover);
}

.brush-arc-tick.is-active .brush-arc-mark {
  width: 18px;
  height: 18px;
  background: transparent;
}

.brush-arc-tick.is-active .brush-ico {
  width: 15px;
  height: 15px;
}

.brush-arc-tick.is-active .brush-arc-label {
  font-size: 12px;
}

.brush-arc-pointer {
  position: absolute;
  left: 50%;
  top: 3px;
  z-index: 3;
  width: 1.5px;
  height: 10px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--hover) 80%, transparent);
  transform: translateX(-50%);
  pointer-events: none;
}

.brush-arc-readout {
  display: none;
}

.frame {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.sheet.active .frame:has(img),
.sheet.is-expanded .frame:has(img) {
  cursor: grab;
  touch-action: none;
}

.frame.is-nudging,
.frame.is-nudging img,
.frame.is-carrying,
.frame.is-carrying img,
body:has(.frame.is-carrying) {
  cursor: grabbing;
}

.frame.is-nudging .wash-lift,
.frame.is-carrying .wash-lift {
  will-change: transform;
}

.frame-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.frame .expand {
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
}

.frame .expand svg {
  width: 11px;
  height: 11px;
}

.frame .expand:hover,
.frame .expand:focus-visible {
  color: var(--hover);
  background: transparent;
}

.frame .pick {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1.25px solid color-mix(in srgb, var(--ink) 28%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  color: transparent;
  cursor: pointer;
}

.frame .pick::before,
.frame .pick::after {
  grid-area: 1 / 1;
}

.frame .pick::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}

.frame .pick:hover,
.frame .pick:focus-visible {
  border-color: var(--hover);
}

.frame .pick:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--hover) 45%, transparent);
  outline-offset: 2px;
}

.frame .pick.picked {
  border-color: var(--hover);
}

.frame .pick.picked::after {
  background: var(--hover);
}

.frame .pick:disabled {
  opacity: 0.28;
  cursor: default;
}

.frame .sheet-close {
  display: none;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
}

.sheet.is-expanded .sheet-close {
  display: grid;
  place-items: center;
}

.frame .sheet-close svg {
  display: block;
  width: 16px;
  height: 16px;
}

.frame .sheet-close:hover,
.frame .sheet-close:focus-visible {
  color: var(--hover);
  background: transparent;
}

.frame .sheet-close:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--hover) 45%, transparent);
  outline-offset: 1px;
}

.frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.wash-lift {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.frame.is-nudging .wash-lift,
.frame.is-carrying .wash-lift {
  filter: drop-shadow(0 6px 14px rgba(36, 33, 31, 0.14));
}

.caption {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 14px;
  padding: 8px 2px 0;
  border-top: 0;
  font-size: 12px;
  color: var(--muted);
}

.caption-name {
  position: relative;
  z-index: 4;
  min-width: 0;
  padding-right: 2px;
  white-space: nowrap;
}

.caption-meta {
  display: flex;
  align-items: center;
  gap: 2px;
}

.caption > .sheet-edit {
  min-width: 0;
  justify-content: safe center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.caption > .sheet-edit::-webkit-scrollbar {
  display: none;
}

.caption > .sheet-edit .sheet-edit-sat-name {
  display: none;
}

.sheet-stage {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--paper);
}

.sheet-stage[hidden] {
  display: none;
}

.sheet-stage .sheet {
  position: relative;
  display: block;
  width: min(100dvw, 100dvh);
  height: min(100dvw, 100dvh);
  max-width: 100%;
  cursor: default;
}

.sheet-stage .sheet .frame {
  width: 100%;
  height: 100%;
  max-height: none;
}

.sheet-stage .caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 3;
  padding: 0;
  pointer-events: none;
}

.sheet-stage .caption .save,
.sheet-stage .caption .caption-name,
.sheet-stage .caption .sheet-edit {
  pointer-events: auto;
}

.sheet-stage .sheet-edit {
  gap: 8px;
}

.sheet-stage .sheet-edit.is-bottom,
.sheet-stage .sheet-edit.is-left,
.sheet-stage .sheet-edit.is-right,
.sheet-stage .sheet-edit.is-free,
.sheet-stage .sheet-edit.is-dragging {
  padding: 7px 12px;
}

.sheet-stage .sheet-edit.is-left,
.sheet-stage .sheet-edit.is-right {
  gap: 6px;
  padding: 8px 4px 7px;
}


.sheet-stage .sheet-edit-grip {
  width: 12px;
  height: 12px;
}

.sheet-stage .sheet-edit-color {
  width: 20px;
  height: 20px;
}

.sheet-stage .sheet-edit-swatch {
  width: 18px;
  height: 18px;
}

.sheet-stage .sheet-edit-sat {
  gap: 12px;
  margin-inline-end: 4px;
  font-size: 12px;
}

.sheet-stage .sheet-edit.is-left .sheet-edit-sat,
.sheet-stage .sheet-edit.is-right .sheet-edit-sat {
  margin-inline-end: 0;
}

.sheet-stage .sheet-edit-sat-rail {
  flex-basis: 76px;
  width: 76px;
  min-width: 76px;
  height: 10px;
}

.sheet-stage .sheet-edit-sat-rail::after {
  width: 10px;
  height: 10px;
}

.sheet-stage .sheet-edit.is-left .sheet-edit-sat-rail,
.sheet-stage .sheet-edit.is-right .sheet-edit-sat-rail {
  flex-basis: 10px;
  width: 10px;
  min-width: 10px;
  height: 76px;
}

.sheet-stage .sheet-edit-sat-rail input::-webkit-slider-thumb,
.sheet-stage .sheet-edit-sat-rail input::-moz-range-thumb {
  width: 10px;
  height: 10px;
}

.sheet-stage .sheet-edit-brush {
  width: 20px;
  height: 20px;
}

.sheet-stage .sheet-edit-brush-face {
  width: 18px;
  height: 18px;
}

.sheet-stage .sheet-edit-brush-face .lucide-icon {
  width: 14px;
  height: 14px;
}

.brush-dial-menu.is-stage .brush-arc-label {
  font-size: 11px;
}

.sheet-stage .expand {
  display: none;
}

body.is-sheet-open {
  overflow: hidden;
}

.mobile-editor {
  display: none;
}

.frame .veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
}

.frame .veil.error {
  color: var(--hover);
  padding: 18px;
  text-align: center;
}

@media (max-width: 720px), (max-height: 540px) and (max-width: 960px) {
  html,
  body {
    height: var(--app-h, 100dvh);
    max-height: var(--app-h, 100dvh);
    min-height: var(--app-h, 100dvh);
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
  }

  .studio {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    height: var(--app-h, 100dvh);
    min-height: var(--app-h, 100dvh);
    max-height: var(--app-h, 100dvh);
    overflow: hidden;
    padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .desk-shell {
    position: relative;
    top: auto;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-height: min(44dvh, 360px);
  }

  .desk-shell:has(.paint-kit[open]) {
    flex: 0 0 min(54dvh, 460px);
    height: min(54dvh, 460px);
    max-height: min(54dvh, 460px);
  }

  .desk-frame {
    height: 100%;
    max-height: inherit;
  }

  .desk {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    margin: 0;
    padding: 12px 14px 10px;
    gap: 10px;
    border-radius: 16px;
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior: contain;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
  }

  .desk:has(.paint-kit[open]) {
    height: 100%;
  }

  .mobile-sheet-body {
    display: contents;
  }

  .desk-rail,
  .desk-resize {
    display: none !important;
  }

  h1 {
    font-size: 1.2rem;
  }

  .about-label {
    margin: 4px 0 0;
    padding: 4px 0;
    min-height: 28px;
    font-size: 12px;
  }

  .about-menu {
    display: none;
    position: static;
    width: 100%;
    max-width: 100%;
    padding: 4px 0 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  .about.is-open .about-menu {
    display: flex;
  }

  .about-menu::before {
    display: none;
  }

  .stack {
    gap: 10px;
  }

  .field {
    gap: 8px;
  }

  .stack > .field {
    display: block;
  }

  .stack > .field .field-head {
    justify-content: flex-start;
    gap: 12px;
    min-width: 0;
  }

  .mode-switch {
    margin-top: 0;
    gap: 16px;
  }

  .field-head {
    justify-content: flex-start;
    gap: 12px;
  }

  #scene,
  #apiKey,
  .color-square-hex {
    font-size: 16px;
  }

  #scene {
    min-height: 44px;
    max-height: 6em;
    padding: 10px 12px 10px 12px;
    font-size: 16px;
  }

  .scene-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
  }

  .scene-controls {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
  }

  .scene-row #scene,
  .scene-caption {
    width: 100%;
  }

  .scene-caption {
    min-height: 44px;
    padding: 6px 12px 6px 6px;
  }

  .scene-caption img {
    width: 36px;
    height: 36px;
  }

  .sample-kit > summary {
    display: none;
  }

  .chips {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 0 24px 2px 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .chips::-webkit-scrollbar {
    display: none;
  }

  .chips-row {
    display: contents;
  }

  .chip {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 4px 9px;
    font-size: 12px;
    line-height: 1.25;
    scroll-snap-align: start;
  }

  .chip:active {
    color: var(--hover);
    background: color-mix(in srgb, var(--hover) 14%, transparent);
  }

  .tools {
    gap: 8px;
  }

  .paint-kit {
    padding-top: 10px;
  }

  .paint-kit-body {
    margin-top: 4px;
  }

  .paint,
  .upload,
  .reset,
  .save,
  .expand {
    width: 44px;
    height: 44px;
  }

  .scene-actions .upload {
    width: 44px;
    height: 44px;
  }

  .scene-actions .paint {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--hover) 14%, transparent);
    background: var(--wash);
    color: var(--hover);
  }

  .paint svg,
  .upload svg,
  .reset svg,
  .save svg,
  .expand svg {
    width: 18px;
    height: 18px;
  }

  .paint:active,
  .upload:active,
  .reset:active,
  .save:active,
  .expand:active,
  .sheet-close:active {
    color: var(--hover);
  }

  .paint-kit[open] {
    max-height: none;
    overflow: visible;
  }

  .paint-kit > summary,
  .pane > summary,
  .keys > summary,
  .effect-groups summary {
    min-height: 44px;
    padding: 8px 0;
  }

  .paint-kit > summary::after,
  .pane > summary::after,
  .keys > summary::after {
    width: 8px;
    height: 8px;
  }

  .slide {
    min-height: 44px;
    gap: 10px;
  }

  #brushControls,
  #placementControls {
    gap: 0;
  }

  #brushControls .slide:has(select),
  #brushControls .slide:has(.choice) {
    margin-bottom: 4px;
  }

  .effect-groups details .slide + .slide {
    margin-top: 0;
  }

  .slide input[type="range"] {
    flex: 1 1 auto;
    flex-basis: auto;
    width: auto;
    min-width: 0;
    height: 44px;
  }

  .slide input[type="range"]::-webkit-slider-runnable-track {
    height: 2px;
  }

  .slide input[type="range"]::-webkit-slider-thumb {
    width: 11px;
    height: 11px;
    margin-top: -4.5px;
    box-shadow: none;
  }

  .slide input[type="range"]::-moz-range-track {
    height: 2px;
  }

  .slide input[type="range"]::-moz-range-thumb {
    width: 11px;
    height: 11px;
    box-shadow: none;
  }

  select,
  #count,
  .choice-trigger,
  .slide select,
  .slide .choice {
    min-height: 44px;
    height: 44px;
  }

  .field-head .choice-trigger,
  .field-head #count {
    min-height: 36px;
    height: auto;
    line-height: 1.3;
    padding: 8px 20px 8px 0;
  }

  .choice-trigger {
    line-height: 42px;
  }

  .field-head .choice-trigger {
    line-height: 1.3;
  }

  .choice-menu {
    max-width: calc(100vw - 16px);
    padding: 8px;
  }

  .choice-menu [role="option"] {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
  }

  .color-field,
  .color-square {
    width: min(220px, 100%);
  }

  .color-square-map {
    min-height: 160px;
  }

  .color-square-hue {
    height: 18px;
  }

  .color-square-hue::-webkit-slider-runnable-track,
  .color-square-hue::-moz-range-track {
    height: 18px;
  }

  .color-square-hue::-webkit-slider-thumb,
  .color-square-hue::-moz-range-thumb {
    width: 11px;
    height: 11px;
    box-shadow: none;
  }

  .color-square-hex {
    height: 44px;
  }

  .stick {
    width: 88px;
    height: 88px;
  }

  .stick-thumb {
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
  }

  .place-board {
    gap: 14px;
  }

  .place-board .slide input[type="range"] {
    flex-basis: auto;
    width: auto;
    max-width: none;
  }

  .caption {
    align-items: center;
    gap: 8px;
    padding: 10px 2px 4px;
  }

  .sheet-edit {
    flex: 1 1 auto;
    gap: 8px;
    max-width: none;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sheet-edit.is-left,
  .sheet-edit.is-right,
  .sheet-edit.is-bottom,
  .sheet-edit.is-free,
  .sheet-edit.is-dragging {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none;
    flex-direction: row;
    width: auto;
    max-width: none;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .sheet-edit-grip {
    display: none;
  }

  .sheet-edit-color {
    width: 34px;
    height: 34px;
  }

  .sheet-edit-swatch {
    width: 16px;
    height: 16px;
  }

  .sheet-edit-sat {
    font-size: 12px;
    margin-inline-end: 0;
  }

  .sheet-edit-sat-name {
    display: none;
  }

  .sheet-edit-sat-rail {
    width: min(96px, 28vw);
    height: 44px;
  }

  .sheet-edit-sat-rail::before {
    height: 3px;
  }

  .sheet-edit-sat-rail::after {
    width: 8px;
    height: 8px;
  }

  .sheet-edit.is-left .sheet-edit-sat-rail,
  .sheet-edit.is-right .sheet-edit-sat-rail {
    width: min(96px, 28vw);
    height: 44px;
  }

  .sheet-edit.is-left .sheet-edit-sat-rail::before,
  .sheet-edit.is-right .sheet-edit-sat-rail::before {
    left: 0;
    right: 0;
    top: 50%;
    bottom: auto;
    width: auto;
    height: 3px;
    transform: translateY(-50%);
  }

  .sheet-edit.is-left .sheet-edit-sat-rail::after,
  .sheet-edit.is-right .sheet-edit-sat-rail::after {
    left: calc(var(--sat) * 100%);
    top: 50%;
  }

  .sheet-edit.is-left .sheet-edit-sat-rail input,
  .sheet-edit.is-right .sheet-edit-sat-rail input {
    writing-mode: horizontal-tb;
    direction: ltr;
  }

  .sheet-edit-brush {
    width: 34px;
    height: 34px;
  }

  .sheet-edit-brush-face {
    width: 22px;
    height: 22px;
  }

  .sheet-edit-brush-face .lucide-icon {
    width: 16px;
    height: 16px;
  }

  .brush-arc-readout-name {
    font-size: 11px;
  }

  .brush-arc-tick::after {
    width: 40px;
    height: 44px;
  }

  .sheet-color-menu {
    padding: 8px;
  }

  .sheet-color-menu.color-square {
    width: min(156px, calc(100vw - 32px));
    gap: 5px;
  }

  .sheet-color-menu .color-square-map {
    min-height: 0;
  }

  .sheet-color-menu .color-square-hue,
  .sheet-color-menu .color-square-hue::-webkit-slider-runnable-track,
  .sheet-color-menu .color-square-hue::-moz-range-track {
    height: 12px;
  }

  .sheet-color-menu .color-square-hue::-webkit-slider-thumb,
  .sheet-color-menu .color-square-hue::-moz-range-thumb {
    width: 8px;
    height: 8px;
  }

  .sheet-color-menu .color-square-hex {
    height: 36px;
    font-size: 16px;
  }

  .frame-tools {
    top: 2px;
    right: 2px;
    gap: 2px;
  }

  .frame .expand,
  .frame .pick,
  .frame .sheet-close {
    width: 44px;
    height: 44px;
  }

  .frame .pick {
    display: none;
  }

  .frame .expand svg,
  .frame .sheet-close svg {
    width: 16px;
    height: 16px;
  }

  .frame .pick::after {
    width: 6px;
    height: 6px;
  }

  .sheet-stage {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
      env(safe-area-inset-left);
  }

  .sheet-stage .caption {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .sheet-stage .sheet-edit {
    flex: 0 0 auto;
    width: max-content;
    max-width: calc(100% - 96px);
    gap: 4px;
    padding: 3px 5px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--paper) 42%, transparent);
    box-shadow: 0 0 0 1px rgba(36, 33, 31, 0.04);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }

  .sheet-stage .sheet-edit-color {
    width: 32px;
    height: 32px;
  }

  .sheet-stage .sheet-edit-swatch {
    width: 12px;
    height: 12px;
  }

  .sheet-stage .sheet-edit-sat {
    gap: 6px;
    margin-inline-end: 6px;
  }

  .sheet-stage .sheet-edit-sat-rail {
    width: 64px;
    height: 32px;
  }

  .sheet-stage .sheet-edit-sat-rail::before {
    height: 1.5px;
  }

  .sheet-stage .sheet-edit-sat-rail::after,
  .sheet-stage .sheet-edit-sat-rail input::-webkit-slider-thumb,
  .sheet-stage .sheet-edit-sat-rail input::-moz-range-thumb {
    width: 7px;
    height: 7px;
  }

  .sheet-stage .sheet-edit-brush {
    width: 32px;
    height: 32px;
  }

  .sheet-stage .sheet-edit-brush-face {
    width: 18px;
    height: 18px;
  }

  .sheet-stage .sheet-edit-brush-face .lucide-icon {
    width: 13px;
    height: 13px;
  }

  .wall {
    flex: 1 1 0;
    width: 100%;
    min-height: 0;
    max-height: none;
    padding: 2px 2px 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .keys #apiKey,
  .keys .choice-trigger {
    min-height: 44px;
    height: 44px;
  }
}

@media (max-width: 720px) {
  .studio {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: var(--app-h, 100dvh);
    max-height: var(--app-h, 100dvh);
    padding: max(28px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
  }

  .desk-shell,
  .desk-frame,
  .desk {
    display: contents;
  }

  .masthead {
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 16px 14px;
  }

  .masthead h1 {
    font-size: 2.15rem;
    font-weight: 400;
  }

  .mobile-sheet-body {
    display: contents;
  }

  .mobile-sheet {
    grid-row: 3;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 0;
    max-height: min(46dvh, 400px);
    padding: 5px 14px 12px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--paper) 88%, #fff);
    box-shadow: none;
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior: contain;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: none;
  }

  .mobile-sheet::-webkit-scrollbar {
    display: none;
  }

  .mobile-sheet.is-expanded {
    height: min(68dvh, 580px);
    max-height: min(68dvh, 580px);
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior: contain;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }

  .mode-switch {
    position: sticky;
    top: 28px;
    z-index: 7;
    flex: 0 0 auto;
    margin: 2px 0 4px;
    padding-bottom: 4px;
    background: color-mix(in srgb, var(--paper) 88%, #fff);
  }

  .mobile-sheet-handle {
    position: sticky;
    top: 0;
    z-index: 8;
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 100%;
    min-height: 28px;
    padding: 0;
    border: 0;
    background: color-mix(in srgb, var(--paper) 94%, #fff);
    cursor: ns-resize;
    touch-action: none;
  }

  .mobile-sheet-grip {
    display: block;
    width: 36px;
    height: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 22%, transparent);
  }

  .mobile-sheet-label {
    display: none;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
  }

  .mobile-sheet.has-paintings:not(.is-expanded) {
    height: 44px;
    max-height: 44px;
    padding: 4px 14px 6px;
    overflow: hidden;
  }

  .mobile-sheet.has-paintings:not(.is-expanded) > .stack,
  .mobile-sheet.has-paintings:not(.is-expanded) > .paint-kit,
  .mobile-sheet.has-paintings:not(.is-expanded) > .mode-switch {
    display: none;
  }

  .mobile-sheet.has-paintings:not(.is-expanded) .mobile-sheet-handle {
    flex: 1 1 auto;
    gap: 4px;
  }

  .mobile-sheet.has-paintings:not(.is-expanded) .mobile-sheet-label {
    display: block;
  }

  .mobile-sheet .paint-kit {
    display: none;
  }

  .desk[data-mode="customize"] .mobile-sheet .paint-kit {
    display: block;
  }

  .wall {
    grid-row: 2;
    align-self: stretch;
    min-height: 0;
  }

  .sheet.active .frame,
  .sheet.active .frame:has(img),
  .sheet.is-expanded .frame:has(img) {
    outline: none;
    cursor: grab;
    touch-action: none;
  }

  .masthead {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 0;
  }

  .masthead .about {
    display: none;
  }

  .wall {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
    padding: 8px 0 0;
  }

  .wall:empty {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    padding: 8px 0 0;
  }

  .wall:empty::before {
    content: "";
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    border-radius: 18px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.7), transparent 58%),
      var(--paper-2);
    box-shadow:
      inset 0 0 0 1px rgba(36, 33, 31, 0.035),
      0 10px 28px rgba(36, 33, 31, 0.05);
  }

  .wall .grid {
    min-height: 0;
    height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }

  /* One variation at a time — stacked sheets were overlapping expand/save chrome. */
  .wall .sheet:not(.active) {
    display: none;
  }

  .wall .sheet.active {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
  }

  .wall .sheet.active .frame {
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }

  .variation-pager {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 7px;
    padding: 2px 0 0;
  }

  .wall:has(.sheet.active):has(.sheet:nth-child(2)) .variation-pager {
    display: flex;
  }

  .variation-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ink) 18%, transparent);
    cursor: pointer;
  }

  .variation-dot.is-active {
    background: var(--hover);
  }

  .mobile-sheet {
    max-height: none;
    padding: 8px;
    border-radius: 26px;
    background: color-mix(in srgb, var(--paper) 92%, #fff);
    box-shadow: none;
    overflow: visible;
  }

  .mobile-sheet:not(.has-paintings) {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .mobile-sheet .mode-switch,
  .mobile-sheet-handle,
  .mobile-sheet .paint-kit {
    display: none !important;
  }

  .mobile-sheet > .stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
  }

  .mobile-sheet .sample-kit {
    display: block;
    margin: 0;
    padding: 0 2px;
  }

  .mobile-sheet .chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 0 2px 2px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-sheet .chips::-webkit-scrollbar {
    display: none;
  }

  .mobile-sheet .stack > .field {
    display: block;
    min-height: 0;
    padding: 10px 10px 10px;
    border: 1px solid rgba(36, 33, 31, 0.1);
    border-radius: 22px;
    background: var(--paper);
    box-shadow: 0 3px 9px rgba(36, 33, 31, 0.035);
  }

  .mobile-sheet .scene-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
  }

  .mobile-sheet .scene-controls {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
    min-height: 32px;
  }

  .mobile-sheet .scene-row #scene,
  .mobile-sheet .scene-caption {
    order: -1;
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .mobile-sheet #scene {
    padding: 6px 6px 2px;
    font-size: 16px;
    line-height: 22px;
  }

  .mobile-sheet .scene-row .field-head {
    flex: 0 0 auto;
    align-self: center;
    width: fit-content;
    margin-left: auto;
    padding-left: 0;
  }

  .mobile-sheet .field-head .choice-trigger {
    display: grid;
    place-items: center;
    min-height: 32px;
    padding: 0;
    border: 0;
    line-height: 1;
    color: var(--muted);
  }

  .mobile-sheet .field-head .count-word {
    display: none;
  }

  .mobile-sheet .field-head .count-num {
    display: inline-grid;
    place-items: center;
    width: auto;
    min-width: 36px;
    height: 32px;
    padding: 0 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 8%, var(--paper));
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: var(--ink);
  }

  .mobile-sheet .field-head .choice-trigger:hover .count-num,
  .mobile-sheet .field-head .choice-trigger:focus-visible .count-num,
  .mobile-sheet .field-head .choice.is-open .count-num {
    background: color-mix(in srgb, var(--ink) 12%, var(--paper));
    color: var(--ink);
  }

  .mobile-sheet .field-head .choice-trigger::after {
    display: none;
  }

  .mobile-sheet .scene-row .upload,
  .mobile-sheet .scene-row .paint {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
  }

  .mobile-sheet .scene-row .upload {
    border: 1px solid rgba(36, 33, 31, 0.14);
    background: transparent;
    color: var(--ink);
  }

  .mobile-sheet .scene-row .upload svg,
  .mobile-sheet .scene-row .paint svg {
    width: 16px;
    height: 16px;
  }

  .mobile-sheet .scene-row .paint {
    border: 0;
    background: var(--hover);
    color: var(--paper);
    box-shadow: none;
  }

  .mobile-sheet.has-paintings,
  .mobile-sheet.has-paintings:not(.is-expanded) {
    height: auto;
    max-height: min(43dvh, 350px);
    padding: 6px 10px max(10px, env(safe-area-inset-bottom));
    overflow: hidden;
    background: transparent;
    box-shadow: none;
  }

  .mobile-sheet.has-paintings > .stack,
  .mobile-sheet.has-paintings > .mode-switch,
  .mobile-sheet.has-paintings > .mobile-sheet-handle,
  .mobile-sheet.has-paintings > .paint-kit {
    display: none !important;
  }

  .mobile-editor {
    display: none;
  }

  .mobile-sheet.has-paintings .mobile-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .mobile-tool-panel {
    display: none;
    place-items: center;
    min-height: 0;
    max-height: 190px;
    overflow-x: auto;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .mobile-tool-panel:has([data-tool-panel].is-active) {
    display: grid;
    min-height: 82px;
  }

  .mobile-tool-panel::-webkit-scrollbar {
    display: none;
  }

  [data-tool-panel] {
    display: none;
  }

  [data-tool-panel].is-active {
    display: flex;
  }

  .mobile-color-panel {
    justify-content: center;
    width: 100%;
    padding: 2px 4px 0;
  }

  #mobilePigments.color-square {
    width: min(88vw, 360px);
    gap: 9px;
  }

  #mobilePigments .color-swatches {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    padding: 1px 2px;
    overflow: visible;
  }

  #mobilePigments .color-swatch {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(36, 33, 31, 0.08);
    border-radius: 50%;
    background: #8b2f32;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
    cursor: pointer;
  }

  #mobilePigments .color-swatch.is-active {
    box-shadow:
      0 0 0 2px var(--paper),
      0 0 0 3px color-mix(in srgb, var(--hover) 70%, #24211f);
  }

  #mobilePigments .color-square-map {
    min-height: 0;
    height: 72px;
    aspect-ratio: auto;
    border-radius: 14px;
  }

  #mobilePigments .color-square-thumb {
    width: 12px;
    height: 12px;
    border-width: 2px;
    box-shadow: 0 1px 4px rgba(36, 33, 31, 0.18);
  }

  #mobilePigments .color-square-hue {
    height: 8px;
  }

  #mobilePigments .color-square-hue::-webkit-slider-runnable-track,
  #mobilePigments .color-square-hue::-moz-range-track {
    height: 8px;
  }

  #mobilePigments .color-square-hue::-webkit-slider-thumb,
  #mobilePigments .color-square-hue::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 1.5px solid #fff;
    box-shadow: 0 1px 3px rgba(36, 33, 31, 0.2);
  }

  #mobilePigments .color-square-hex {
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--muted);
  }

  .mobile-brush-panel,
  .mobile-color-panel {
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
  }

  .mobile-tick-control {
    position: relative;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-tick-head {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    pointer-events: none;
  }

  .mobile-tick-scale {
    position: relative;
    display: block;
    width: min(88vw, 390px);
    height: 48px;
    --value: 50;
    background:
      linear-gradient(90deg, transparent 49.7%, var(--hover) 49.7% 50.3%, transparent 50.3%),
      repeating-linear-gradient(
        90deg,
        transparent 0 7px,
        color-mix(in srgb, var(--ink) 24%, transparent) 7px 8px
      );
    background-position: center;
    background-size: 100% 32px, auto 18px;
    background-repeat: no-repeat;
    mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  }

  .mobile-tick-scale::after {
    content: "";
    position: absolute;
    left: calc(var(--value) * 1%);
    top: 50%;
    width: 9px;
    height: 9px;
    box-sizing: border-box;
    border: 1px solid var(--hover);
    border-radius: 50%;
    background: var(--paper);
    transform: translate(-50%, -50%);
    pointer-events: none;
  }

  .mobile-tick-scale input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
    touch-action: pan-y;
  }

  .mobile-tool-dock {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 10px 6px 9px;
    border: 0;
    border-radius: 28px;
    background: color-mix(in srgb, var(--paper) 82%, #fff);
    box-shadow:
      0 0 0 1px rgba(36, 33, 31, 0.05),
      0 10px 28px rgba(36, 33, 31, 0.05);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .mobile-tool {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: color-mix(in srgb, var(--ink) 38%, transparent);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.15;
    cursor: pointer;
  }

  .mobile-tool-circle {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    max-width: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    transition: color 160ms ease;
  }

  .mobile-tool-circle svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-color-icon {
    --tool-color: var(--hover);
  }

  .mobile-color-icon svg {
    color: inherit;
  }

  .mobile-tool.is-active {
    color: var(--hover);
  }

  .mobile-tool.is-active .mobile-color-icon svg {
    color: var(--tool-color);
  }

  .mobile-tool.is-active .mobile-tool-circle {
    background: transparent;
    box-shadow: none;
  }

  .grid {
    align-content: start;
  }

  .sheet .caption {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 7px 3px 2px;
  }

  .sheet .caption > .sheet-edit {
    display: none;
  }

  .caption-name {
    font-size: 11px;
  }
}

@media (max-width: 720px) and (min-width: 560px) {
  .wall .grid {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 960px) and (max-height: 540px) {
  .studio {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
  }

  .desk-shell,
  .desk-frame {
    display: block;
  }

  .desk {
    display: flex;
  }

  .mobile-sheet {
    display: contents;
  }

  .mobile-sheet-handle {
    display: none;
  }

  .mobile-sheet .paint-kit {
    display: none;
  }

  .desk[data-mode="customize"] .mobile-sheet .paint-kit {
    display: block;
  }

  .desk-shell,
  .desk-shell:has(.paint-kit[open]) {
    flex: 0 0 min(320px, 46vw);
    width: min(320px, 46vw);
    max-height: none;
    height: 100%;
  }

  .desk {
    height: auto;
  }

  .desk:has(.paint-kit[open]) {
    height: 100%;
  }

  .wall {
    flex: 1 1 0;
    min-height: 0;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  h1 {
    font-size: 1.15rem;
  }

  .about-label {
    margin: 4px 0 0;
    padding: 4px 0;
    min-height: 0;
  }
}

.stack > .field #scene:focus,
.stack > .field #scene:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Lock the composer on every breakpoint so 44px mobile touch-target
   rules cannot pull the + / 3 / brush off one row. */
.stack > .field {
  font-family: var(--ui);
}

.stack > .field #scene,
.stack > .field .scene-caption {
  min-height: 0;
  max-height: 8em;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-family: var(--ui);
}

.scene-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
}

.scene-controls {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  min-height: 32px;
}

.scene-controls .upload,
.scene-controls .paint,
.scene-controls .choice,
.scene-controls .choice-trigger {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  padding: 0;
  line-height: 1;
}

.scene-controls .field-head .choice,
.scene-controls .field-head .choice-trigger {
  flex: 0 0 auto;
  width: auto;
  min-width: 36px;
  max-width: none;
}

.scene-controls .count-num {
  flex: 0 0 auto;
  width: auto;
  min-width: 36px;
  max-width: none;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  padding: 0 8px;
  line-height: 1;
}

.scene-controls .field-head {
  display: flex;
  align-items: center;
  align-self: center;
  width: auto;
  min-width: 36px;
  height: 32px;
  margin-left: auto;
  padding: 0;
}

.scene-controls .choice-trigger::after {
  display: none;
}

@media (max-width: 720px) {
  .mobile-sheet .stack > .field {
    padding: 12px 12px 10px;
  }

  .mobile-sheet .scene-row {
    gap: 8px;
  }

  .mobile-sheet #scene {
    padding: 2px 4px 0;
    font-size: 16px;
    line-height: 22px;
  }

  .masthead h1 {
    font-family: var(--serif);
    font-weight: 500;
  }
}

/* Library and full-page composition workspace. */
.library-status { position: fixed; bottom: 6px; left: 20px; z-index: 70; font-size: 12px; color: var(--muted); pointer-events: none; }
.library-status:empty { display: none; }
.composition-library { margin-bottom: 32px; }
.pinned-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 22px; }
.pinned-composition { padding: 0; border: 0; background: none; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.pinned-composition img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; background: var(--paper-2); }
.pinned-composition span { display: block; padding: 10px 0; overflow-wrap: anywhere; }
.caption .caption-name { font: inherit; color: var(--ink); border: 0; border-bottom: 1px solid transparent; background: transparent; min-width: 60px; width: 120px; padding: 8px 0; text-overflow: ellipsis; }
.caption .caption-name:hover, .caption .caption-name:focus { border-bottom-color: var(--line); }
.pin-variation:disabled { opacity: .4; cursor: default; }
.caption { flex-wrap: wrap; gap: 8px; }
.sheet-stage { grid-template-columns: minmax(0,1fr) 300px; place-items: stretch; }
.sheet-stage .sheet { width: 100%; height: 100dvh; min-width: 0; max-width: none; display: block; }
.sheet-stage .sheet .frame { width: 100%; height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: var(--paper); }
.sheet-stage .sheet .frame img:not(.wash-lift) { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.sheet-stage .caption { top: max(12px,env(safe-area-inset-top)); bottom: auto; right: 52px; left: 20px; justify-content: flex-start; }
.sheet-stage .caption > * { pointer-events: auto; }
.sheet-stage .caption .sheet-edit { position: fixed; top: auto; bottom: 24px; left: calc((100vw - 300px) / 2); right: auto; transform: translateX(-50%); background: var(--paper); border-radius: 30px; padding: 10px 18px; }
.sheet-stage .caption .caption-name { width: min(220px,25vw); background: var(--paper); }
.sheet-stage .frame-tools { top: max(12px,env(safe-area-inset-top)); right: 12px; }
.sheet-stage .sheet-close { width: 40px; height: 40px; background: var(--paper); border-radius: 50%; }
.canvas-customize { padding: 24px 20px; overflow-y: auto; height: 100dvh; background: var(--paper-2); }
.canvas-customize h2 { font: 18px var(--serif); margin: 0 0 24px; }
.canvas-customize .paint-kit { display: block !important; max-height: none !important; height: auto !important; overflow: visible !important; }
.canvas-customize .paint-kit-body { display: block; }
.canvas-customize .paint-kit-summary, .canvas-customize .keys { display: none; }
.brush-arc-hash[hidden] { display: none; }
.brush-arc-tick::after { width: 44px; height: 44px; }
@media (max-width: 720px) {
  .wall { display: block; overflow-y: auto; max-height: none; padding: 12px; }
  .wall .grid { height: auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: auto; gap: 20px 12px; }
  .wall .sheet:not(.active), .wall .sheet.active { display: block; height: auto; }
  .wall .sheet .frame, .wall .sheet.active .frame { height: auto; aspect-ratio: 1; border-radius: 0; }
  .wall .variation-pager { display: none !important; }
  .wall .sheet-edit { display: none; }
  .wall .caption-name { width: 100%; }
  .pinned-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 12px; }
  .sheet-stage { grid-template-columns: 1fr; grid-template-rows: minmax(0,1fr) minmax(180px,32dvh); padding: 0; }
  .sheet-stage .sheet { height: 100%; min-height: 0; }
  .sheet-stage .sheet .frame { height: 100%; }
  .sheet-stage .caption { top: max(8px,env(safe-area-inset-top)); left: 12px; right: 52px; bottom: auto; gap: 4px; }
  .sheet-stage .caption .caption-name { width: 100%; padding: 4px; }
  .sheet-stage .caption .sheet-edit { position: absolute; top: auto; bottom: auto; left: 0; right: auto; transform: none; margin-top: 10px; display: none; }
  .canvas-customize { height: 100%; padding: 14px 20px max(20px,env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
  .canvas-customize h2 { margin-bottom: 12px; }
  .canvas-customize .paint-kit { margin: 0; }
  .canvas-customize .pane { display: block; }
  .library-status { left: 12px; bottom: 0; max-width: calc(100vw - 24px); background: var(--paper); }
}
.sheet .caption { display: flex; align-items: center; }
.sheet-stage .sheet .frame { background: #f3eee4; }
.sheet-stage .pin-variation { flex: 0 0 auto; }
@media (max-width: 720px) {
  .wall .sheet .frame { touch-action: pan-y; }
  .wall .caption .caption-name { flex-basis: 100%; }
  .sheet-stage .caption .caption-name { flex-basis: 100%; }
}
/* Give each brush a real touch target and keep labels upright. */
.brush-arc-tick { width: 44px; height: 44px; transform-origin: 0 0; transform: rotate(var(--ang)) translateY(calc(-1 * var(--icon-r))) rotate(calc(-1 * var(--ang))) translateX(-50%); }
.brush-arc-tick::after { inset: 0; transform: none; }
.brush-arc-spoke { top: 0; left: 0; width: 44px; transform: none; }

/* Quiet image-level pins; saved images appear only in the upper collection. */
.composition-library[hidden] { display: none; }
.wall .sheet.is-library-pinned { display: none !important; }
.pinned-card { position: relative; min-width: 0; }
.pinned-composition { width: 100%; }
.pin-variation { position: absolute; z-index: 5; top: 6px; left: 6px; display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 13px; border: 0; border-radius: 0; box-shadow: none; appearance: none; background: transparent; color: var(--muted); }
.pin-variation svg { display: block; width: 13px; height: 13px; opacity: .42; transition: opacity 160ms ease; }
.pin-variation[aria-pressed="true"] { color: var(--hover); background: transparent; }
.pin-variation[aria-pressed="true"] svg { fill: color-mix(in srgb, var(--hover) 12%, transparent); }
.pin-variation:hover, .pin-variation:focus-visible { color: var(--hover); background: transparent; }
.pin-variation:focus-visible { outline: 1px solid var(--hover); outline-offset: -4px; }
.sheet-stage .pin-variation { top: max(10px,env(safe-area-inset-top)); left: auto; right: 56px; }
.sheet-stage .caption { right: 106px; }

.pin-variation[aria-pressed="true"] svg { opacity: .62; }
.pin-variation:hover svg, .pin-variation:focus-visible svg { opacity: .9; }
@media (prefers-reduced-motion: reduce) { .pin-variation svg { transition: none; } }

/* Match the image actions and lift their marks without shrinking hit targets. */
.frame .expand { color: var(--muted); }
.frame .expand svg, .pin-variation svg { width: 13px; height: 13px; opacity: .42; transform: translateY(-4px); transition: opacity 160ms ease; }
.frame .expand svg { stroke-width: 1; }
.frame .expand svg path { stroke-width: inherit; }
.frame .expand:hover svg, .frame .expand:focus-visible svg, .pin-variation:hover svg, .pin-variation:focus-visible svg { opacity: .9; }
.pin-variation[aria-pressed="true"] svg { opacity: .62; }
@media (prefers-reduced-motion: reduce) { .frame .expand svg, .pin-variation svg { transition: none; } }

.pinned-card > .caption-name { display: block; width: 100%; min-width: 0; padding: 10px 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--ink); font: inherit; text-overflow: ellipsis; }
.caption-name { cursor: text; }
.caption .caption-name:focus, .pinned-card > .caption-name:focus { outline: none; border-bottom: 1px solid color-mix(in srgb, var(--hover) 40%, transparent); }
.pinned-card > .caption-name:hover { border-bottom-color: var(--line); }

@media (max-width: 720px) {
  .sheet-stage .caption .sheet-edit {
    display: flex;
    position: fixed;
    left: 50%;
    bottom: calc(max(180px, 32dvh) + 12px);
    top: auto;
    right: auto;
    transform: translateX(-50%);
    margin: 0;
    padding: 8px 14px;
    width: auto;
    background: var(--paper);
    border-radius: 30px;
  }
}

/* Keep the variation name out of the full canvas header. */
.sheet-stage .caption > .caption-name { display: none; }

/* Image pins retain their compact corner placement outside fullscreen. */
.pin-variation { top: 0; left: 0; }
.pin-variation svg { transform: translate(-5px, -7px); }

/* Fullscreen corner actions share one alignment and sizing system. */
.sheet-stage {
  --canvas-action-top: env(safe-area-inset-top, 0px);
  --canvas-action-left: env(safe-area-inset-left, 0px);
  --canvas-action-right: env(safe-area-inset-right, 0px);
  --canvas-action-size: 44px;
  --canvas-action-icon: 13px;
}
.sheet-stage .pin-variation {
  top: var(--canvas-action-top);
  left: var(--canvas-action-left);
  right: auto;
}
.sheet-stage .caption {
  top: var(--canvas-action-top);
  left: var(--canvas-action-left);
  right: var(--canvas-action-right);
  bottom: auto;
  padding: 0;
  justify-content: flex-end;
}
.sheet-stage .caption-meta { margin-left: auto; }
.sheet-stage .pin-variation,
.sheet-stage .caption .save {
  width: var(--canvas-action-size);
  height: var(--canvas-action-size);
  min-height: var(--canvas-action-size);
  padding: 0;
  display: grid;
  place-items: center;
}
.sheet-stage .pin-variation svg,
.sheet-stage .caption .save svg {
  width: var(--canvas-action-icon);
  height: var(--canvas-action-icon);
  transform: none;
  opacity: .42;
  transition: opacity 160ms ease;
}
.sheet-stage .pin-variation[aria-pressed="true"] svg { opacity: .62; }
.sheet-stage .pin-variation:hover svg,
.sheet-stage .pin-variation:focus-visible svg,
.sheet-stage .caption .save:hover svg,
.sheet-stage .caption .save:focus-visible svg { opacity: .9; }

/* Stable brush geometry keeps the dial flowing through each selection. */
.brush-arc-tick, .brush-arc-label { transition: color 160ms ease; }
.brush-arc-tick .brush-arc-mark, .brush-arc-tick.is-active .brush-arc-mark { width: 16px; height: 16px; }
.brush-arc-tick .brush-arc-label, .brush-arc-tick.is-active .brush-arc-label { font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .brush-arc-tick, .brush-arc-label { transition: none; } }

/* Give the desktop canvas dial and its toolbar a shared, roomier footprint. */
@media (min-width: 721px) {
  .sheet-stage .caption .sheet-edit {
    width: min(360px, calc(100vw - 348px));
    max-width: none;
    gap: 18px;
    padding: 12px 20px;
  }
  .sheet-stage .caption .sheet-edit-sat { flex: 1; min-width: 0; }
  .sheet-stage .caption .sheet-edit-sat-rail {
    flex: 1;
    width: auto;
    min-width: 0;
  }
}

/* Mobile settings unfold from the canvas toolbar; desktop retains its sidebar. */
.canvas-settings-toggle, .canvas-settings-close { display: none; }
@media (max-width: 720px) {
  .sheet-stage { grid-template-rows: minmax(0, 1fr); }
  .sheet-stage .sheet { height: 100%; }
  .sheet-stage .caption .sheet-edit {
    bottom: max(16px, env(safe-area-inset-bottom));
    width: max-content;
    max-width: calc(100vw - 24px);
    gap: 8px;
    padding: 6px 10px;
  }
  .sheet-stage .canvas-customize {
    display: none;
    position: fixed;
    z-index: 10;
    left: 50%;
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 68px);
    transform: translateX(-50%);
    width: min(340px, calc(100vw - 24px));
    height: auto;
    max-height: min(440px, calc(100dvh - 120px));
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 28px rgba(36,33,31,.08);
    overscroll-behavior: contain;
  }
  .sheet-stage.is-settings-open .canvas-customize { display: block; }
  .canvas-settings-toggle, .canvas-settings-close {
    display: grid; place-items: center;
    width: 44px; height: 44px; flex: 0 0 44px;
    padding: 11px; border: 0; border-radius: 50%;
    background: transparent; color: var(--ink);
  }
  .canvas-settings-toggle svg, .canvas-settings-close svg { width: 22px; height: 22px; }
  .canvas-settings-toggle[aria-expanded=true] { background: var(--fill); }
  .canvas-settings-close { position: absolute; top: 8px; right: 8px; }
  .canvas-customize h2 { padding-right: 36px; }
  .canvas-customize .slide input[type=range] { min-height: 44px; }
}

/* Keep toolbar glyphs consistent across canvas and responsive layouts. */
.sheet-edit { --editor-icon-size: 16px; }
.sheet-edit .sheet-edit-brush-face,
.sheet-edit .sheet-edit-brush-face .lucide-icon,
.sheet-edit .canvas-settings-toggle svg {
  width: var(--editor-icon-size);
  height: var(--editor-icon-size);
  flex-shrink: 0;
}
.sheet-edit .canvas-settings-toggle svg {
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.explorations-link { margin-top: -5px; color: var(--muted); font-size: 12px; text-decoration: none; }
.explorations-link:hover, .explorations-link:focus-visible { color: var(--hover); text-decoration: underline; }
