:root {
  --sandbox-surface: #fff8f8;
  --sandbox-paper: #f5f4f2;
  --sandbox-panel: #fff0f2;
  --sandbox-panel-strong: #ffe8ec;
  --sandbox-ink: #5d001e;
  --sandbox-muted: #574146;
  --sandbox-primary: #9a1750;
  --sandbox-primary-dark: #760039;
  --sandbox-outline: rgba(93, 0, 30, 0.14);
  --sandbox-outline-strong: rgba(93, 0, 30, 0.26);
  --sandbox-header-height: 72px;
  --sandbox-rail-width: 92px;
  --sandbox-panel-width: 392px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--sandbox-surface);
}

body.sandbox-page {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 64% 24%, rgba(154, 23, 80, 0.08), transparent 28rem),
    linear-gradient(120deg, #fff8f8 0%, #f5f4f2 58%, #fff0f2 100%);
  color: var(--sandbox-ink);
  font-family: Satoshi, system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

img {
  display: block;
  max-width: 100%;
}

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 300,
    "GRAD" 0,
    "opsz" 24;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 200;
  width: auto;
  height: auto;
  background: var(--sandbox-primary);
  color: #ffffff;
  padding: 0.75rem 1rem;
  text-decoration: none;
}

.sandbox-topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 3rem;
  height: var(--sandbox-header-height);
  padding-inline: 2rem;
  border-bottom: 1px solid rgba(221, 191, 197, 0.2);
  background: rgba(255, 248, 248, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sandbox-brand {
  justify-self: start;
  color: var(--sandbox-primary);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 2rem;
  text-decoration: none;
  text-transform: uppercase;
}

.sandbox-menu-toggle {
  display: none;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 0;
  background: color-mix(in oklab, var(--sandbox-panel), white 42%);
  color: var(--sandbox-primary);
}

.sandbox-menu-toggle .material-symbols-outlined {
  font-size: 1.25rem;
  line-height: 1;
}

.sandbox-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
}

.sandbox-nav a,
.sandbox-footer a {
  position: relative;
  color: var(--sandbox-muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1;
  opacity: 0.7;
  text-decoration: none;
  transition:
    color 180ms ease,
    opacity 180ms ease;
}

.sandbox-nav a:hover,
.sandbox-footer a:hover {
  color: var(--sandbox-ink);
  opacity: 1;
}

.sandbox-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 1px;
  background: var(--sandbox-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.sandbox-nav a[aria-current="page"] {
  color: var(--sandbox-ink);
  opacity: 1;
}

.sandbox-nav a:hover::after,
.sandbox-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.sandbox-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 0.75rem;
}

.sandbox-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  border-radius: 0;
  border: 1px solid transparent;
  padding: 0.75rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.sandbox-topbar .sandbox-button {
  min-height: 0;
  height: 2.5rem;
}

.sandbox-button .material-symbols-outlined {
  font-size: 1rem;
}

.sandbox-topbar .sandbox-button .material-symbols-outlined {
  line-height: 1;
}

.sandbox-button--ghost {
  border-color: rgba(138, 112, 118, 0.45);
  background: transparent;
  color: var(--sandbox-primary);
}

.sandbox-button--primary {
  border-color: var(--sandbox-primary);
  background: var(--sandbox-primary);
  color: #ffffff;
}

.sandbox-button:disabled {
  opacity: 0.45;
  transform: none;
}

.sandbox-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.sandbox-button--ghost:hover:not(:disabled) {
  background: color-mix(in oklab, var(--sandbox-primary), white 90%);
}

.sandbox-button--primary:hover:not(:disabled) {
  background: var(--sandbox-primary-dark);
  border-color: var(--sandbox-primary-dark);
}

.sandbox-shell {
  display: grid;
  grid-template-columns: var(--sandbox-rail-width) var(--sandbox-panel-width) minmax(0, 1fr);
  min-height: 100dvh;
  padding-top: var(--sandbox-header-height);
}

.sandbox-rail {
  position: sticky;
  top: var(--sandbox-header-height);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  height: calc(100dvh - var(--sandbox-header-height));
  padding: 1.1rem 0.9rem;
  border-right: 1px solid var(--sandbox-outline);
  background: rgba(255, 248, 248, 0.86);
}

.rail-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: rgba(93, 0, 30, 0.72);
  text-decoration: none;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.rail-item::after {
  content: attr(aria-label);
  position: absolute;
  left: calc(100% + 0.75rem);
  top: 50%;
  z-index: 31;
  padding: 0.42rem 0.6rem;
  background: rgba(93, 0, 30, 0.92);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  text-transform: uppercase;
  transform: translate(-0.25rem, -50%);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  white-space: nowrap;
}

.rail-item:hover::after,
.rail-item:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.rail-item:hover,
.rail-item--active {
  border-color: rgba(154, 23, 80, 0.2);
  background: rgba(255, 232, 236, 0.72);
  color: var(--sandbox-primary-dark);
  transform: translateY(-1px);
}

.sandbox-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--sandbox-header-height));
  border-right: 1px solid var(--sandbox-outline);
  background:
    linear-gradient(180deg, rgba(255, 248, 248, 0.94), rgba(255, 240, 242, 0.86)),
    var(--sandbox-panel);
  padding: clamp(1.15rem, 2vw, 1.6rem);
}

.panel-heading {
  flex: 0 0 auto;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--sandbox-outline);
}

.panel-kicker {
  margin: 0 0 0.45rem;
  color: var(--sandbox-primary);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.panel-heading h1 {
  max-width: 22rem;
  margin: 0;
  color: var(--sandbox-ink);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.15rem, 3.2vw, 2.95rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.92;
  white-space: nowrap;
}

.panel-heading p:last-child {
  margin: 0.55rem 0 0;
  color: var(--sandbox-muted);
  font-size: 0.82rem;
  font-weight: 300;
  line-height: 1.35;
}

.panel-tabs {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.9rem;
  border-bottom: 1px solid var(--sandbox-outline);
}

.panel-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(93, 0, 30, 0.62);
  padding: 0 0 0.65rem;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  text-align: left;
  transition:
    border-color 180ms ease,
    color 180ms ease;
}

.panel-tab--active,
.panel-tab:hover,
.panel-tab:focus-visible {
  border-color: var(--sandbox-primary);
  color: var(--sandbox-ink);
  outline: none;
}

.sandbox-status {
  min-height: 1.2rem;
  margin: 0.45rem 0 0;
  color: var(--sandbox-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.panel-options-scroll {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0.45rem;
  overflow-y: auto;
  padding-right: 0.2rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.panel-options-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.panel-options-scroll [hidden] {
  display: none;
}

.panel-options-scroll > .sandbox-status {
  margin-top: 0;
}

.outline-button,
.generate-button {
  border-radius: 0;
  font-weight: 700;
  line-height: 1;
}

.style-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  align-content: start;
}

.style-card {
  position: relative;
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--sandbox-ink);
  padding: 0;
  text-align: center;
}

.style-card::after {
  content: "";
  position: absolute;
  right: 0.35rem;
  top: 0.35rem;
  width: 1rem;
  height: 1rem;
  border: 1px solid rgba(93, 0, 30, 0.18);
  background: rgba(255, 248, 248, 0.62);
}

.style-card img {
  aspect-ratio: 1 / 1.12;
  width: 100%;
  border: 1px solid rgba(93, 0, 30, 0.1);
  background: var(--sandbox-paper);
  object-fit: cover;
  transition:
    filter 260ms ease,
    transform 700ms ease,
    border-color 260ms ease;
}

.style-card:hover img {
  border-color: rgba(154, 23, 80, 0.38);
  filter: contrast(1.05) saturate(1.04);
  transform: scale(1.035);
}

.style-card--selected img {
  border-color: var(--sandbox-primary);
}

.style-card--selected::after {
  border-color: var(--sandbox-primary);
  background: var(--sandbox-primary);
  box-shadow: inset 0 0 0 3px var(--sandbox-surface);
}

.style-card > span {
  min-height: 2.15rem;
  color: var(--sandbox-ink);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.12;
}

.accessory-section {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sandbox-outline);
}

.accessory-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.accessory-section-heading span {
  color: var(--sandbox-primary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.accessory-section-heading strong {
  color: var(--sandbox-ink);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.accessory-grid {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.panel-footer {
  display: grid;
  flex: 0 0 auto;
  gap: 0.8rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sandbox-outline);
}

.generate-button {
  display: grid;
  min-height: 3.5rem;
  border: 0;
  background: rgba(93, 0, 30, 0.16);
  color: rgba(93, 0, 30, 0.46);
  font-size: 1rem;
}

.generate-button span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
}

.generate-button:not(:disabled) {
  background: var(--sandbox-primary);
  color: #ffffff;
}

.panel-footer-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.outline-button {
  min-height: 2.8rem;
  border: 1px solid var(--sandbox-outline-strong);
  background: rgba(255, 255, 255, 0.52);
  color: var(--sandbox-ink);
}


.sandbox-canvas {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  min-height: calc(100dvh - var(--sandbox-header-height));
  overflow: hidden;
  background:
    linear-gradient(rgba(245, 244, 242, 0.82), rgba(245, 244, 242, 0.82)),
    url("/images/external/index-layered-fabrics.png") center/cover;
}

.sandbox-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 248, 248, 0.58), transparent 28%),
    radial-gradient(circle at 50% 46%, rgba(255, 248, 248, 0.92), rgba(255, 248, 248, 0.48) 32%, transparent 54%);
}

.canvas-status {
  position: absolute;
  right: 2rem;
  top: 1.5rem;
  z-index: 2;
  display: flex;
  gap: 0.5rem;
}

.canvas-status span {
  width: 0.5rem;
  height: 0.5rem;
  background: rgba(154, 23, 80, 0.36);
}

.canvas-status span:first-child {
  background: var(--sandbox-primary);
}

.dropzone {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  display: grid;
  justify-items: center;
  width: min(42rem, calc(100% - 4rem));
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid rgba(93, 0, 30, 0.13);
  background: rgba(255, 248, 248, 0.66);
  text-align: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    border-color 220ms ease,
    background-color 220ms ease,
    transform 220ms ease;
}

.dropzone-empty-state {
  display: grid;
  justify-items: center;
}

.dropzone-preview-state {
  display: none;
  justify-items: center;
  width: 100%;
}

.dropzone:focus-visible,
.dropzone.is-dragging {
  border-color: rgba(154, 23, 80, 0.38);
  background: rgba(255, 248, 248, 0.82);
  outline: none;
  transform: translateY(-2px);
}

.dropzone-mark {
  display: grid;
  place-items: center;
  width: clamp(5.5rem, 10vw, 8rem);
  height: clamp(5.5rem, 10vw, 8rem);
  margin-bottom: 1.35rem;
  border: 1px solid rgba(154, 23, 80, 0.18);
  background: rgba(255, 232, 236, 0.66);
  color: var(--sandbox-primary);
  transform: rotate(-6deg);
}

.dropzone-mark .material-symbols-outlined {
  font-size: clamp(2.7rem, 5vw, 4rem);
}

.dropzone.has-preview {
  width: min(46rem, calc(100% - 3rem));
  padding: clamp(1rem, 2vw, 1.35rem);
  border-color: transparent;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dropzone.has-preview:focus-visible,
.dropzone.has-preview.is-dragging {
  border-color: rgba(154, 23, 80, 0.18);
  background: rgba(255, 248, 248, 0.28);
  transform: none;
}

.dropzone.has-preview .dropzone-empty-state {
  display: none;
}

.dropzone.has-preview .dropzone-preview-state {
  display: grid;
}

.editor-preview-frame {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(34rem, 100%);
  overflow: hidden;
}

.editor-preview-image {
  width: 100%;
  max-height: min(62dvh, 34rem);
  border: 1px solid rgba(93, 0, 30, 0.13);
  object-fit: contain;
  background: rgba(255, 248, 248, 0.82);
  box-shadow: 0 1.2rem 3rem rgba(93, 0, 30, 0.12);
  transform-origin: center;
  transition: transform 180ms ease;
}

.editor-before-after-control {
  position: absolute;
  right: 0.9rem;
  bottom: 0.9rem;
  z-index: 4;
}

.editor-before-after-control:disabled {
  opacity: 0;
  pointer-events: none;
}

.editor-preview-frame::before,
.editor-preview-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}

.editor-preview-frame::before {
  background:
    radial-gradient(
      circle at 50% 42%,
      rgba(255, 255, 255, 0.96),
      rgba(255, 248, 250, 0.82) 30%,
      rgba(255, 177, 198, 0.28) 54%,
      transparent 78%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.94),
      rgba(255, 232, 238, 0.3)
    );
}

.editor-preview-frame::after {
  inset: -12% -45%;
  background: linear-gradient(
    112deg,
    transparent 34%,
    rgba(255, 255, 255, 0.8) 48%,
    rgba(255, 177, 198, 0.36) 54%,
    transparent 68%
  );
  transform: translateX(-64%) skewX(-10deg);
}

.editor-preview-frame.is-revealing .editor-preview-image {
  animation: editorResultReveal 1.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.editor-preview-frame.is-revealing::before {
  animation: editorResultFlash 1.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.editor-preview-frame.is-revealing::after {
  animation: editorResultFinalShine 1.05s cubic-bezier(0.22, 1, 0.36, 1) 0.82s both;
}

.editor-generation-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  border: 1px solid rgba(93, 0, 30, 0.13);
  background:
    radial-gradient(
      circle at 50% 38%,
      rgba(255, 255, 255, 0.42),
      transparent 15rem
    ),
    linear-gradient(
      135deg,
      rgba(255, 240, 242, 0.46),
      rgba(239, 210, 216, 0.34)
    );
  color: rgba(36, 24, 27, 0.76);
  font-family: "Satoshi", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  overflow: hidden;
  text-align: center;
  text-transform: uppercase;
  backdrop-filter: blur(8px) saturate(0.72);
  -webkit-backdrop-filter: blur(8px) saturate(0.72);
}

.editor-generation-overlay[hidden] {
  display: none;
}

.editor-generation-overlay::before {
  content: "";
  position: absolute;
  inset: -12% -45%;
  background: linear-gradient(
    112deg,
    transparent 34%,
    rgba(255, 255, 255, 0.76) 48%,
    rgba(255, 177, 198, 0.34) 54%,
    transparent 68%
  );
  opacity: 0;
  transform: translateX(-64%) skewX(-10deg);
  animation: editorGenerationScan 1.55s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.editor-generation-overlay::after {
  content: attr(data-label);
  position: relative;
  z-index: 1;
}

.dropzone.is-generating .editor-preview-image {
  filter: saturate(0.82) contrast(0.9) brightness(0.92);
}

.editor-history {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: min(34rem, 100%);
  margin-top: 1.2rem;
  color: var(--sandbox-ink);
  font-size: 0.78rem;
  font-weight: 500;
  overflow-x: auto;
  padding: 0 0 0.25rem;
  scrollbar-width: thin;
}

.editor-history-entry {
  display: grid;
  flex: 0 0 auto;
  gap: 0.42rem;
  justify-items: center;
}

.editor-history-entry[hidden] {
  display: none;
}

.editor-history-item {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 5.8rem;
  height: 5.8rem;
  padding: 0.25rem;
  border: 1px solid rgba(93, 0, 30, 0.16);
  background: rgba(255, 248, 248, 0.78);
  cursor: pointer;
  line-height: 0;
  overflow: hidden;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.editor-history-item:hover,
.editor-history-item:focus-visible,
.editor-history-item--active {
  border-color: var(--sandbox-primary);
  box-shadow: 0 0 0 0.18rem rgba(154, 23, 80, 0.16);
  outline: none;
}

.editor-history-item:hover {
  transform: translateY(-1px);
}

.editor-history-item img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
}

.editor-history span {
  width: 5.8rem;
  line-height: 1.1;
  text-align: center;
}

.editor-history-generated-list {
  display: contents;
}

.dropzone.has-preview #editor-selected-file {
  display: none;
}

.editor-canvas-tools {
  position: absolute;
  inset: auto 0 1.25rem;
  z-index: 3;
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 1rem;
  padding-inline: clamp(1rem, 2vw, 2rem);
  pointer-events: none;
}

.dropzone.has-preview + .editor-canvas-tools {
  display: grid;
}

.editor-canvas-tools > :first-child {
  justify-self: start;
}

.editor-tool-button,
.editor-zoom-control {
  border: 1px solid rgba(93, 0, 30, 0.13);
  background: rgba(255, 248, 248, 0.78);
  color: var(--sandbox-ink);
  box-shadow: 0 0.75rem 2rem rgba(93, 0, 30, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: auto;
}

.editor-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.65rem;
  padding: 0 1rem;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.editor-tool-button .material-symbols-outlined {
  font-size: 1.05rem;
}

.editor-tool-button--icon {
  width: 3.15rem;
  padding: 0;
}

.editor-tool-button:hover:not(:disabled),
.editor-tool-button:focus-visible {
  border-color: rgba(154, 23, 80, 0.36);
  background: rgba(255, 240, 242, 0.9);
  color: var(--sandbox-primary-dark);
  outline: none;
  transform: translateY(-1px);
}

.editor-tool-button:disabled {
  color: rgba(93, 0, 30, 0.34);
  box-shadow: none;
  opacity: 0.7;
}

.editor-tool-button[aria-pressed="true"] {
  border-color: rgba(154, 23, 80, 0.34);
  background: var(--sandbox-primary);
  color: #ffffff;
}

.editor-zoom-control {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.65rem;
  padding: 0 0.4rem 0 0.9rem;
}

.editor-zoom-control input[type="range"] {
  width: clamp(5.5rem, 10vw, 8.5rem);
  accent-color: var(--sandbox-primary);
}

.editor-zoom-control output {
  min-width: 3.3rem;
  color: var(--sandbox-ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  text-align: right;
}

.dropzone h2 {
  margin: 0;
  color: var(--sandbox-ink);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.6rem, 5vw, 5.25rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.96;
}

.dropzone p {
  max-width: 34rem;
  margin: 1rem 0 1.6rem;
  color: var(--sandbox-muted);
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  font-weight: 300;
}

.editor-result {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--sandbox-outline);
  background: var(--sandbox-outline);
}

.editor-result[hidden] {
  display: none;
}

.editor-result article {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
  margin: 0;
  padding: clamp(1rem, 2vw, 1.4rem);
  background: rgba(255, 248, 248, 0.88);
}

.editor-result span {
  color: var(--sandbox-primary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.editor-result img {
  width: 100%;
  max-height: 26rem;
  object-fit: contain;
  background: rgba(245, 244, 242, 0.78);
}

.sandbox-gallery {
  position: relative;
  grid-column: 2 / -1;
  min-width: 0;
  min-height: calc(100dvh - var(--sandbox-header-height));
  overflow-y: auto;
  background:
    radial-gradient(circle at 86% 12%, rgba(154, 23, 80, 0.08), transparent 24rem),
    linear-gradient(135deg, rgba(255, 248, 248, 0.96), rgba(245, 244, 242, 0.9));
}

.sandbox-gallery[hidden] {
  display: none;
}

.gallery-shell {
  display: grid;
  gap: 1.4rem;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(1.4rem, 3vw, 2.6rem);
}

.gallery-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
}

.gallery-header h1 {
  margin: 0;
  color: var(--sandbox-ink);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.9;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: clamp(1rem, 2.4vw, 1.6rem);
  align-items: start;
}

.gallery-card {
  position: relative;
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  margin: 0;
}

.gallery-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(93, 0, 30, 0.12);
  background: rgba(255, 240, 242, 0.72);
  overflow: hidden;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    filter 220ms ease,
    transform 700ms ease;
}

.gallery-card:hover img {
  filter: contrast(1.05) saturate(1.03);
  transform: scale(1.035);
}

.gallery-download-button {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--sandbox-outline-strong);
  background: rgba(255, 248, 248, 0.94);
  color: var(--sandbox-primary-dark);
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.gallery-download-button:hover,
.gallery-download-button:focus-visible {
  border-color: var(--sandbox-primary);
  background: rgba(255, 240, 242, 0.98);
  color: var(--sandbox-primary);
  outline: none;
  transform: translateY(-1px);
}

.gallery-download-button .material-symbols-outlined {
  font-size: 1.2rem;
}

.gallery-card figcaption {
  display: grid;
  gap: 0.2rem;
}

.gallery-card strong {
  color: var(--sandbox-ink);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}

.gallery-card span {
  color: var(--sandbox-muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
}

.gallery-empty {
  display: grid;
  justify-items: start;
  max-width: 32rem;
  margin-top: 1rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--sandbox-outline);
  background: rgba(255, 248, 248, 0.66);
}

.gallery-empty[hidden] {
  display: none;
}

.gallery-empty .material-symbols-outlined {
  color: var(--sandbox-primary);
  font-size: 2rem;
}

.gallery-empty h2 {
  margin: 0.7rem 0 0;
  color: var(--sandbox-ink);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 0.95;
}

.gallery-empty p {
  max-width: 26rem;
  margin: 0.75rem 0 1.2rem;
  color: var(--sandbox-muted);
  font-size: 0.95rem;
  font-weight: 300;
}

.sandbox-footer {
  display: none;
}

@media (min-width: 861px) {
  body.sandbox-page {
    height: 100dvh;
    overflow: hidden;
  }

  .sandbox-shell {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .sandbox-panel,
  .sandbox-canvas,
  .sandbox-gallery {
    height: calc(100dvh - var(--sandbox-header-height));
    min-height: 0;
  }

  .sandbox-panel {
    overflow: hidden;
  }
}

@media (max-width: 1120px) {
  :root {
    --sandbox-rail-width: 76px;
    --sandbox-panel-width: 380px;
  }

  .sandbox-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .sandbox-menu-toggle {
    display: inline-grid;
  }

  .sandbox-brand {
    justify-self: start;
  }

  .sandbox-nav {
    display: none;
  }

  .sandbox-actions {
    margin-left: auto;
  }

  .sandbox-button {
    padding-inline: 1rem;
  }
}

@media (max-width: 860px) {
  body.sandbox-page {
    background: var(--sandbox-surface);
  }

  .sandbox-topbar {
    min-height: 68px;
  }

  :root {
    --sandbox-header-height: 68px;
  }

  .sandbox-shell {
    grid-template-columns: 1fr;
    max-width: 100vw;
    overflow-x: hidden;
    padding-bottom: calc(6.8rem + env(safe-area-inset-bottom, 0px));
  }

  .sandbox-rail {
    position: fixed;
    inset: calc(var(--sandbox-header-height) + 0.75rem) 1rem auto auto;
    z-index: 70;
    flex-direction: row;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 0.35rem;
    border: 1px solid var(--sandbox-outline);
    background: rgba(255, 248, 248, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .rail-item {
    width: 2.45rem;
    height: 2.45rem;
  }

  .rail-item::after {
    display: none;
  }

  .sandbox-panel {
    display: contents;
    min-height: 0;
    border: 0;
    background: none;
    padding: 0;
  }

  .panel-heading {
    order: 1;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    padding: 1.15rem 1rem 0.75rem;
    border-bottom: 0;
    background: var(--sandbox-surface);
  }

  .panel-heading p:last-child {
    display: none;
  }

  .sandbox-canvas {
    order: 2;
  }

  .panel-tabs {
    display: none;
  }

  .panel-tabs::-webkit-scrollbar {
    display: none;
  }

  .panel-tab {
    flex: 0 0 auto;
    padding-bottom: 0.75rem;
    font-size: 0.96rem;
    text-align: center;
  }

  .panel-options-scroll {
    order: 4;
    flex: none;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow: hidden;
    margin-top: 0;
    padding: 0.95rem 1rem 1.15rem;
    background: var(--sandbox-surface);
  }

  .style-grid {
    display: flex;
    width: calc(100% + 2rem);
    min-width: 0;
    gap: 0.75rem;
    margin-inline: -1rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0 1rem 0.25rem;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .style-grid::-webkit-scrollbar {
    display: none;
  }

  .style-card {
    flex: 0 0 clamp(6.8rem, 30vw, 8.75rem);
    scroll-snap-align: start;
  }

  .style-card > span {
    min-height: 1.8rem;
  }

  .accessory-section {
    margin-top: 0.9rem;
    padding-top: 0.85rem;
  }

  .panel-footer {
    position: fixed;
    inset: auto 0 0;
    z-index: 80;
    order: 5;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--sandbox-outline);
    background: rgba(255, 248, 248, 0.94);
    box-shadow: 0 -1rem 2rem rgba(93, 0, 30, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .generate-button {
    min-height: 3.2rem;
  }

  .panel-footer-actions {
    grid-template-columns: auto;
    order: 2;
  }

  .outline-button {
    min-height: 3.2rem;
    padding-inline: 0.95rem;
  }

  .panel-heading h1 {
    max-width: 100%;
    padding-right: 6.25rem;
    font-size: clamp(1.85rem, 8vw, 2.45rem);
    white-space: normal;
  }

  .sandbox-canvas {
    display: block;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0 1rem 1rem;
    background:
      linear-gradient(rgba(245, 244, 242, 0.72), rgba(245, 244, 242, 0.72)),
      url("/images/external/index-layered-fabrics.png") center/cover;
  }

  .sandbox-canvas::before,
  .canvas-status {
    display: none;
  }

  .sandbox-gallery {
    grid-column: 1;
    min-height: calc(100dvh - var(--sandbox-header-height));
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }

  .dropzone {
    width: 100%;
    margin: 0;
    padding: 1rem;
  }

  .dropzone.has-preview {
    width: 100%;
    padding: 0;
  }

  .editor-preview-frame {
    width: 100%;
  }

  .editor-preview-image {
    max-height: min(38dvh, 21rem);
  }

  .editor-history {
    gap: 0.55rem;
    margin-top: 0.55rem;
    font-size: 0.68rem;
    padding-bottom: 0;
  }

  .editor-history-item {
    width: 3.6rem;
    height: 3.6rem;
    padding: 0.16rem;
  }

  .editor-history span {
    width: 3.6rem;
  }

  .editor-canvas-tools {
    position: static;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0 0;
  }

  .editor-replace-image-button {
    width: 2.65rem;
    padding-inline: 0;
  }

  .editor-replace-image-button span:not(.material-symbols-outlined) {
    display: none;
  }

  .editor-zoom-control {
    grid-column: auto;
    justify-self: end;
    justify-content: flex-end;
    order: 0;
    min-width: 0;
    max-width: 100%;
  }

  .editor-zoom-control input[type="range"] {
    width: clamp(4.5rem, 24vw, 6rem);
  }

  .editor-zoom-control output {
    min-width: 2.7rem;
    font-size: 0.74rem;
  }

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

@media (max-width: 560px) {
  .sandbox-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.65rem;
    padding-inline: 0.9rem;
  }

  .sandbox-brand {
    width: 42px;
    height: 46px;
    overflow: hidden;
    background: url("/images/specchio-mobile-logo.png") center / contain no-repeat;
    color: transparent;
    font-size: 0;
    letter-spacing: 0;
    text-indent: -9999px;
  }

  .sandbox-actions {
    gap: 0.5rem;
    min-width: 0;
    max-width: 100%;
  }

  .sandbox-menu-toggle {
    width: 2.25rem;
    height: 2.25rem;
  }

  .sandbox-button {
    min-height: 2.45rem;
    gap: 0.35rem;
    padding-inline: 0.65rem;
  }

  .sandbox-topbar .sandbox-button--ghost {
    width: 2.45rem;
    padding-inline: 0;
  }

  .sandbox-topbar .sandbox-button--ghost span:not(.material-symbols-outlined) {
    display: none;
  }

  .sandbox-topbar .nav-auth-button span:first-child {
    font-size: 0;
  }

  .sandbox-topbar .nav-auth-button span:first-child::after {
    content: "Entrar";
    font-size: 0.75rem;
  }

  .sandbox-topbar .nav-account-link {
    width: 2.45rem;
    padding-inline: 0;
  }

  .sandbox-topbar .nav-account-link #user-greeting {
    display: none;
  }

  .sandbox-topbar .sandbox-button .material-symbols-outlined {
    font-size: 0.95rem;
  }

  .style-grid {
    gap: 0.65rem;
  }

  .style-card span:last-child {
    font-size: 0.68rem;
  }

  .gallery-header {
    align-items: start;
    flex-direction: column;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dropzone h2 {
    font-size: clamp(2.35rem, 15vw, 3.8rem);
  }
}

@keyframes editorGenerationScan {
  0%,
  100% {
    opacity: 0;
    transform: translateX(-64%) skewX(-10deg);
  }

  14% {
    opacity: 0.95;
  }

  62% {
    opacity: 0.95;
    transform: translateX(64%) skewX(-10deg);
  }

  78% {
    opacity: 0;
    transform: translateX(64%) skewX(-10deg);
  }
}

@keyframes editorResultFlash {
  0% {
    opacity: 0;
  }

  28% {
    opacity: 1;
  }

  58% {
    opacity: 0.82;
  }

  100% {
    opacity: 0;
  }
}

@keyframes editorResultReveal {
  0%,
  24% {
    opacity: 0;
    filter: brightness(1.24) saturate(0.92);
  }

  62% {
    opacity: 0.34;
    filter: brightness(1.14) saturate(0.98);
  }

  100% {
    opacity: 1;
    filter: brightness(1) saturate(1);
  }
}

@keyframes editorResultFinalShine {
  0%,
  100% {
    opacity: 0;
    transform: translateX(-64%) skewX(-10deg);
  }

  18% {
    opacity: 0.95;
  }

  68% {
    opacity: 0.95;
    transform: translateX(64%) skewX(-10deg);
  }

  86% {
    opacity: 0;
    transform: translateX(64%) skewX(-10deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

