@charset "UTF-8";
:root {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: #ede6e8;
  background: #170d11;
  font-synthesis: none;
  --muted: #a98e95;
  --line: #3c252b;
  --panel: #23171c;
  --accent: #ff9aaf;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.editor-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background: #090708;
}
.ambient-background {
  position: absolute;
  inset: 8px;
  z-index: -1;
  pointer-events: none;
  border-radius: 28px;
  overflow: hidden;
}
.ambient-background::before {
  content: '';
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(ellipse at 30% 26%, #080608 8%, transparent 58%),
    radial-gradient(ellipse at 0% 0%, #e32151, transparent 52%),
    radial-gradient(ellipse at 100% 5%, #f32660, transparent 58%),
    radial-gradient(ellipse at 65% 110%, #9b0d31, transparent 55%), #100609;
}
/* Independent grain matches the reference's stepped texture motion. */
.ambient-background::after {
  content: '';
  position: absolute;
  inset: -160px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' opacity='.065' filter='url(%23n)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
  animation: ambient-grain 1.25s steps(5) infinite;
}
@keyframes ambient-grain {
  0%,
  100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-80px, -40px);
  }
  40% {
    transform: translate(-40px, -100px);
  }
  60% {
    transform: translate(-120px, -60px);
  }
  80% {
    transform: translate(-30px, -120px);
  }
}
.ambient-background canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ambient-background.canvas-ready::before {
  display: none;
}
.editor-page:has(#background-motion:not(:checked)) .ambient-background::before,
.editor-page:has(#background-motion:not(:checked)) .ambient-background::after {
  animation-play-state: paused;
}
.background-motion {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
@media (prefers-reduced-motion: reduce) {
  .background-motion {
    display: none;
  }
}
.editor-page .topbar {
  background: #100b10cc;
}
.editor-page .intro .subtitle {
  color: #c9c2c6;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid #4c3a3e;
  border-radius: 8px;
  padding: 10px 14px;
  background: #342126;
  color: #f4eeef;
  font-weight: 550;
  font-size: 13px;
}
button,
.feedback-link {
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover,
.feedback-link:hover {
  background: #492e35;
  border-color: #8c6972;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #300c17;
}
.primary:hover {
  background: #ffb7c6;
}
.quiet {
  background: transparent;
  border-color: var(--line);
  color: #cebfc3;
}
#paste-open {
  border-color: var(--accent);
}
.text-button {
  background: transparent;
  border: 0;
  padding: 4px;
  color: var(--accent);
  font-size: 12px;
}
a {
  color: #d4c4c8;
  text-decoration: none;
  font-size: 12px;
}
a:hover {
  text-decoration: underline;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input,
select,
textarea {
  min-width: 0;
  color: #ede6e8;
  background: #190f12;
  border: 1px solid #4a383c;
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 13px;
}
select {
  max-width: 100%;
}
input[type='color'] {
  padding: 3px;
  width: 40px;
  height: 36px;
  cursor: pointer;
}
input[type='checkbox'] {
  accent-color: #ff9aaf;
}
input[aria-invalid='true'],
textarea[aria-invalid='true'] {
  border-color: #ff9b94;
}
textarea {
  resize: vertical;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 550;
  letter-spacing: -1.2px;
  line-height: 1.2;
}
h2 {
  font-size: 16px;
  font-weight: 580;
  letter-spacing: -0.2px;
}
h3 {
  font-size: 13px;
  font-weight: 560;
}
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  padding: 0 38px;
}
.brand {
  font-size: 17px;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
}
.brand-icon {
  font-size: 31px;
  color: var(--accent);
  font-weight: 400;
}
.tag {
  font-size: 9px;
  letter-spacing: 1.1px;
  border: 1px solid #49373c;
  border-radius: 4px;
  padding: 5px 7px;
  margin-left: 6px;
  color: #c6b3b8;
}
.local {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: var(--accent);
}
main {
  max-width: 1600px;
  margin: auto;
  padding: 34px 38px 12px;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 30px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.6px;
  font-weight: 650;
  color: #b59da3;
  margin-bottom: 10px;
}
.subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.6;
}
.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.mobile-break {
  display: none;
}
.profile-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 17px;
  margin-bottom: 22px;
  background: linear-gradient(110deg, #2e1c21, #221619 60%);
}
.profile-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: #b59da3;
  gap: 4px;
}
.profile-label input,
.saved-select select {
  width: 100%;
  height: 38px;
  font-size: 13px;
  letter-spacing: 0;
}
.saved-row {
  display: flex;
  gap: 7px;
}
.saved-row select {
  flex: 1;
  min-width: 0;
}
.saved-row button {
  flex: none;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}
.profile-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.draft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #d6bf8f;
  white-space: nowrap;
  transition: color 200ms ease;
}
.draft::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.draft.saved {
  color: #dba8b5;
}
.profile-actions {
  display: flex;
  gap: 7px;
  margin-left: auto;
}
.profile-actions button {
  font-size: 11px;
  padding: 8px 11px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 325px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
}
.artwork-panel {
  padding: 22px;
  min-width: 0;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.section-heading .eyebrow {
  margin-bottom: 7px;
}
.history {
  display: flex;
  gap: 5px;
}
.history button {
  padding: 6px 10px;
  font-size: 18px;
  font-weight: 400;
  background: transparent;
}
.history svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
}
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 21px;
}
.preview-card {
  border: 1px solid #49373c;
  border-radius: 9px;
  overflow: hidden;
  background: #f9faf9;
  color: #422a30;
  min-width: 0;
}
.dark-card {
  background: #191b24;
  color: #e0d6d8;
}
.preview-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 15px;
  font-size: 11px;
  font-weight: 550;
}
.preview-label > span:last-child {
  font-size: 8px;
  letter-spacing: 1px;
  color: #9d7d85;
}
.preview-label .live {
  color: #e8adbc !important;
  display: flex;
  align-items: center;
  gap: 5px;
}
.canvas {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.canvas.panning,
.canvas.panning [data-node] {
  cursor: grabbing;
}
.canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.canvas.light {
  background: #f9faf9;
}
.canvas.dark {
  background: #191b24;
}
.canvas svg {
  width: 100%;
  height: 100%;
  overflow: hidden;
  transform: translate(var(--preview-x, 0px), var(--preview-y, 0px)) scale(var(--preview-zoom, 1));
  transform-origin: center;
}
.preview-navigation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 11px;
}
.preview-navigation button {
  min-width: 28px;
  min-height: 28px;
  padding: 3px 7px;
  font-size: 12px;
}
.preview-navigation output {
  min-width: 38px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.preview-navigation > span {
  color: var(--muted);
}
.canvas [data-node] {
  cursor: pointer;
  transition: opacity 0.15s;
}
.canvas.highlighting [data-node]:not(.selected) {
  opacity: 0.16;
}
.canvas.highlighting [data-node].selected {
  filter: drop-shadow(0 0 2px #ff9aaf);
}
.preview-foot {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 9px;
  border-top: 1px solid #9e7e8625;
  color: #96737c;
}
.preview-foot input {
  width: 22px;
  height: 22px;
  padding: 1px;
}
.preview-foot code {
  font-size: 9px;
  color: #b2989f;
}
.preview-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 13px 0 24px;
  color: var(--muted);
  font-size: 10px;
}
.preview-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.collection-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.count {
  display: inline-block;
  font-size: 10px;
  color: #c2afb4;
  background: #3b252a;
  padding: 4px 7px;
  border-radius: 5px;
  margin-left: 6px;
  vertical-align: middle;
}
.asset-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 9px;
  min-height: 108px;
}
.asset-card {
  position: relative;
  flex: 0 0 132px;
  min-width: 0;
}
.asset {
  width: 100%;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: #1c1114;
  border-color: #492d34;
}
.asset-remove {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 5px 8px;
  min-height: 28px;
  font-size: 10px;
}
.asset.active {
  border-color: #ff9aaf;
  box-shadow: 0 0 0 1px #ff9aaf;
}
.asset-preview {
  height: 75px;
  display: flex;
  justify-content: center;
  padding: 5px;
  background: #191b24;
}
.asset-preview svg {
  width: 100%;
  height: 100%;
}
.asset-title {
  display: block;
  font-size: 9px;
  padding: 9px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d0c1c5;
}
.drop-hint {
  font-size: 10px;
  color: #997780;
  padding: 10px 0 17px;
}
.export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.export-bar > div {
  display: flex;
  gap: 7px;
}
.export-bar button {
  font-size: 11px;
  padding: 9px 11px;
}
.palette-panel {
  padding: 23px 19px;
  border-left: 1px solid var(--line);
  background: #27181c;
  min-width: 0;
}
.panel-description {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 10px;
}
.palette-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 23px 8px 9px;
  font-size: 8px;
  letter-spacing: 1.2px;
  color: #a88c93;
}
.palette-columns span:last-child {
  padding-left: 24px;
}
.palette-list {
  max-height: 263px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px;
}
.palette-row {
  display: grid;
  grid-template-columns: 1fr 18px 1fr;
  gap: 8px;
  align-items: center;
  padding: 9px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
  background: transparent;
  min-height: 42px;
  width: 100%;
}
.palette-row:hover {
  background: #392429;
}
.palette-row.active {
  border-color: #6f4952;
  background: #3a252a;
}
.color-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.swatch {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid #ffffff28;
  flex-shrink: 0;
  background: repeating-conic-gradient(#737373 0% 25%, #ababab 0% 50%) 50%/8px 8px;
  overflow: hidden;
}
.swatch > span {
  display: block;
  width: 100%;
  height: 100%;
}
.color-text {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mapping-arrow {
  color: #97767e;
  font-size: 12px;
}
.color-editor {
  border-top: 1px solid #492d34;
  margin-top: 17px;
  padding-top: 17px;
}
.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}
.origin {
  font-size: 9px;
  color: #c7acb3;
  border-radius: 4px;
  background: #41282e;
  padding: 4px 6px;
}
.selected-source {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: var(--muted);
  margin-top: 9px;
  overflow-wrap: anywhere;
}
.target-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.target-controls input[type='color'] {
  width: 45px;
  height: 39px;
  flex-shrink: 0;
}
.target-controls label {
  flex: 1;
  min-width: 0;
}
.target-controls input[type='text'] {
  width: 100%;
  height: 39px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.field-label {
  display: block;
  font-size: 11px;
  color: #c5b1b6;
  margin: 16px 0 7px;
}
/* Edit scope: one choice, from the shared palette down to the clicked shape. */
.scope-options {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding: 17px 0 0;
  border: 0;
  border-top: 1px solid #492d34;
  min-width: 0;
}
/* Floating the legend keeps it below the divider and makes it an ordinary grid item. */
.scope-options .field-label {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0 0 1px;
}
/* Rows keep the old switch rhythm: 19px tall, 8px apart. */
.scope-option {
  display: flex;
  align-items: center;
  min-height: 19px;
  gap: 9px;
  font-size: 12px;
  color: #ede6e8;
  cursor: pointer;
}
.scope-option[hidden] {
  display: none;
}
.scope-option input {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #ff9aaf;
  cursor: pointer;
}
.scope-count {
  color: #c5b1b6;
}
.switch {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: #ede6e8;
  cursor: pointer;
}
/* Shared toggle: the "Animate background" switch style, tinted with the accent when on. */
input[role='switch'] {
  appearance: none;
  position: relative;
  width: 32px;
  height: 19px;
  flex: 0 0 32px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #39393d;
  cursor: pointer;
  transition: background 180ms ease;
}
input[role='switch']::before {
  content: '';
  position: absolute;
  inset: 2px auto auto 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0004;
  transition: transform 180ms ease;
}
input[role='switch']:checked {
  background: var(--accent);
}
input[role='switch']:checked::before {
  transform: translateX(13px);
}
input[role='switch']:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.editor-actions {
  display: flex;
  gap: 7px;
  margin-top: 11px;
}
.editor-actions button {
  font-size: 10px;
  padding: 8px 10px;
}
.editor-tip {
  font-size: 10px;
  line-height: 1.6;
  color: #a4868e;
  margin-top: 12px;
}
.resources {
  margin-top: 20px;
  border-top: 1px solid #492d34;
  padding-top: 17px;
}
.resources h3 {
  font-size: 11px;
}
.resources p {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 5px;
}
.resources button {
  font-size: 10px;
  margin-top: 10px;
  padding: 8px 10px;
}
footer {
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding: 17px 0;
  color: #9d7c84;
  font-size: 10px;
  line-height: 1.6;
}
/* Floating messages stay in view wherever the page is scrolled. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 16px;
  border: 1px solid #5b3a42;
  border-radius: 22px;
  background: #1e1216eb;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -12px #000b;
  color: #9fe0bd;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 16px) scale(0.96);
  transition:
    opacity 200ms ease-out,
    transform 200ms ease-out,
    visibility 0s 200ms;
}
.toast.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition:
    opacity 280ms ease-out,
    transform 280ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.toast[data-tone='error'] {
  border-color: #ffa79b8c;
  color: #ffa79b;
}
.toast[data-tone='info'] {
  color: var(--accent);
}
.toast-icon {
  display: none;
  flex: none;
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.toast:not([data-tone='error'], [data-tone='info']) .success-icon,
.toast[data-tone='error'] .error-icon,
.toast[data-tone='info'] .info-icon {
  display: block;
}
#status {
  margin: 0;
  color: #ede6e8;
}
.toast-action {
  flex: none;
  padding: 4px 10px;
  border-color: #ffffff2e;
  border-radius: 999px;
  background: #ffffff14;
  color: inherit;
  font-size: 12px;
}
.toast-action:hover {
  background: #ffffff26;
  border-color: #ffffff4d;
}
.toast-close,
.field-callout-close {
  flex: none;
  padding: 2px 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  opacity: 0.65;
}
.toast-close:hover,
.field-callout-close:hover {
  background: transparent;
  opacity: 1;
}
.toast:not([data-tone='error']) .toast-close {
  display: none;
}
.toast[data-tone='error'] {
  padding-right: 8px;
}
/* Field callouts sit in the top layer, so dialogs and transforms cannot clip them. */
.field-callout {
  position: fixed;
  inset: auto;
  margin: 0;
  display: flex;
  align-items: start;
  gap: 8px;
  width: max-content;
  max-width: min(300px, calc(100vw - 16px));
  padding: 11px 8px 11px 14px;
  overflow: visible;
  border: 1px solid #ffa79b99;
  border-radius: 10px;
  background: #3a1714;
  box-shadow: 0 16px 32px -12px #000c;
  color: #ffd9d3;
  font-size: 12px;
  line-height: 1.5;
  animation: callout-in 220ms ease-out;
}
.field-callout p {
  margin: 0;
}
.field-callout::before {
  content: '';
  position: absolute;
  top: -6px;
  left: var(--arrow-left, 16px);
  width: 10px;
  height: 10px;
  background: inherit;
  border: inherit;
  border-right: 0;
  border-bottom: 0;
  border-radius: 2px 0 0;
  transform: rotate(45deg);
}
.field-callout.above::before {
  top: auto;
  bottom: -6px;
  transform: rotate(225deg);
}
@keyframes callout-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.warnings {
  padding: 12px;
  border: 1px solid #6b5840;
  background: #30291e;
  border-radius: 7px;
  margin: 0 0 20px;
  color: #edcf9f;
  font-size: 11px;
  line-height: 1.6;
}
.warnings summary {
  cursor: pointer;
}
.warnings ul {
  padding-left: 19px;
  margin-bottom: 0;
}
dialog {
  background: #26181b;
  border: 1px solid #654d53;
  border-radius: 14px;
  color: #ede6e8;
  padding: 24px;
  width: min(720px, calc(100% - 32px));
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 25px 100px #0008;
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition:
    opacity 180ms ease-out,
    transform 180ms ease-out,
    overlay 180ms allow-discrete,
    display 180ms allow-discrete;
}
dialog[open] {
  opacity: 1;
  transform: none;
}
dialog::backdrop {
  background: #0b0708b5;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition:
    opacity 180ms ease-out,
    overlay 180ms allow-discrete,
    display 180ms allow-discrete;
}
dialog[open]::backdrop {
  opacity: 1;
}
@starting-style {
  dialog[open] {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  dialog[open]::backdrop {
    opacity: 0;
  }
}
.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dialog-actions {
  justify-content: flex-end;
  margin-top: 16px;
}
.confirm-dialog {
  width: min(420px, calc(100% - 32px));
}
.confirm-dialog h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}
dialog textarea {
  width: 100%;
  height: 330px;
  margin-top: 6px;
  font-size: 12px;
}
dialog input {
  width: 100%;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
#drop-overlay {
  position: fixed;
  inset: 15px;
  z-index: 20;
  background: #211518ee;
  border: 2px dashed var(--accent);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 25px;
  color: var(--accent);
  pointer-events: none;
}
.drop-icon {
  font-size: 34px;
  font-weight: 400;
  margin-bottom: 12px;
  animation: drop-bob 1.2s ease-in-out infinite;
}
#drop-overlay span {
  font-size: 13px;
  color: #bda7ad;
  margin-top: 12px;
}
.empty {
  color: #9d7d85;
  font-size: 12px;
  padding: 30px;
  text-align: center;
  line-height: 1.6;
}
@media (min-width: 1450px) {
  .canvas {
    height: 355px;
  }
  .palette-list {
    max-height: 300px;
  }
}
@media (max-width: 1150px) {
  main {
    padding: 25px 22px;
  }
  .topbar {
    padding: 0 22px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .artwork-panel {
    padding: 18px;
  }
  .canvas {
    height: 255px;
  }
  .intro {
    align-items: flex-start;
  }
  .import-actions {
    padding-top: 20px;
  }
}
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .palette-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .palette-list {
    max-height: none;
    overflow-y: visible;
    align-self: start;
  }
  .palette-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
  }
  .palette-panel > .section-heading,
  .panel-description,
  .palette-columns,
  .palette-list {
    grid-column: 1;
  }
  .color-editor {
    grid-column: 2;
    grid-row: 1/6;
    margin: 0;
    border: 0;
    padding: 0;
  }
  .resources {
    grid-column: 1/-1;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .resources button {
    margin: 0;
  }
  .canvas {
    height: 300px;
  }
  .palette-columns {
    margin-top: 16px;
  }
  .profile-actions {
    flex-wrap: wrap;
  }
  .intro {
    flex-direction: column;
    gap: 18px;
  }
  .import-actions {
    padding: 0;
  }
  .topbar .tag {
    display: none;
  }
}
@media (max-width: 540px) {
  main {
    padding: 22px 12px 8px;
  }
  .topbar {
    padding: 0 15px;
    height: 60px;
    gap: 15px;
  }
  .editor-page .topbar {
    gap: 8px;
  }
  .local {
    font-size: 0;
    gap: 0;
  }
  .topbar a {
    font-size: 11px;
  }
  .brand {
    font-size: 16px;
  }
  .intro {
    margin-bottom: 22px;
  }
  h1 {
    font-size: 29px;
  }
  .mobile-break {
    display: block;
  }
  .subtitle {
    font-size: 12px;
  }
  .profile-bar {
    grid-template-columns: 1fr;
    gap: 11px;
    padding: 12px;
  }
  .profile-actions {
    width: 100%;
    margin: 0;
  }
  .draft {
    font-size: 9px;
  }
  .artwork-panel {
    padding: 15px 12px;
  }
  .preview-grid {
    gap: 8px;
    margin-top: 16px;
  }
  .canvas {
    height: 205px;
    padding: 4px;
  }
  .preview-label {
    padding: 10px 8px;
    font-size: 9px;
  }
  .preview-label > span:last-child {
    display: none !important;
  }
  .preview-foot {
    font-size: 8px;
    padding: 7px;
    gap: 4px;
    height: 36px;
  }
  .preview-foot code {
    display: none;
  }
  .preview-controls {
    font-size: 9px;
    align-items: flex-start;
  }
  .preview-controls label {
    max-width: 155px;
  }
  .export-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .export-bar > div {
    justify-content: space-between;
  }
  .export-bar button {
    font-size: 10px;
  }
  .palette-panel {
    display: block;
    padding: 20px 15px;
  }
  .palette-columns {
    margin-top: 18px;
  }
  .color-editor {
    border-top: 1px solid var(--line);
    padding-top: 17px;
    margin-top: 17px;
  }
  .resources {
    gap: 15px;
  }
  .resources button {
    white-space: nowrap;
  }
  footer {
    font-size: 9px;
  }
  .history button {
    padding: 5px 9px;
  }
  .preview-controls > span {
    text-align: right;
  }
  dialog {
    padding: 18px;
  }
  dialog textarea {
    height: 260px;
  }
}
/* Original-color ramps fit the sidebar without horizontal scrolling. */
.tones {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.tones > .editor-tip {
  margin-top: 0;
}
.tone-group {
  margin-top: 12px;
}
.tone-heading {
  font-size: 10px;
  font-weight: 550;
  color: #ccbcc0;
  margin: 0 0 7px;
}
.tone-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px 3px;
}
.tone-button {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  padding: 4px 2px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 400;
}
.tone-button:hover {
  background: #462c32;
  border-color: #896770;
}
.tone-button[aria-pressed='true'] {
  background: #472d33;
  border-color: var(--accent);
}
.tone-button .swatch {
  width: 100%;
  height: 28px;
  border-radius: 3px;
}
.tone-step {
  font-size: 8px;
  color: #bfaaaf;
}
.tone-hex {
  font-size: 8px;
  letter-spacing: -0.25px;
  color: #dfd4d7;
  white-space: nowrap;
}
.tone-button:focus-visible {
  outline-offset: 1px;
}

.tone-steps {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 9px;
  background: #190f12;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.tone-steps::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(100% / 3);
  background: #472d33;
  box-shadow: inset 0 0 0 1px #9b6270;
  transition: transform 200ms ease;
}
.tone-steps:has(button:nth-child(2)[aria-pressed='true'])::before {
  transform: translateX(100%);
}
.tone-steps:has(button:nth-child(3)[aria-pressed='true'])::before {
  transform: translateX(200%);
}
.tone-steps button {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 7px 15px;
  font-size: 12px;
  color: var(--muted);
}
.tone-steps button:hover {
  background: #ffffff0d;
}
.tone-steps button[aria-pressed='true'] {
  color: var(--accent);
  transition: color 200ms ease;
}
.tone-steps button:focus-visible {
  outline-offset: -3px;
}

.document-page {
  max-width: 800px;
  padding-bottom: 64px;
  font-size: 15px;
  line-height: 1.8;
}
.document-page h1 {
  margin: 18px 0 24px;
}
.document-page h2 {
  font-size: 20px;
  margin: 32px 0 10px;
}
.document-page p {
  margin: 12px 0;
}
.document-page a {
  font-size: inherit;
  text-decoration: underline;
  color: var(--accent);
}
.document-page code {
  overflow-wrap: anywhere;
}
.topbar nav {
  margin-left: auto;
}
.feedback-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  white-space: nowrap;
}
.feedback-link:hover {
  text-decoration: none;
}
.noscript {
  padding: 20px;
  background: #30291e;
  color: #edcf9f;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 50;
  background: #24171a;
  padding: 12px;
}
.skip-link:focus {
  top: 12px;
}
.workspace-state {
  font-size: 11px;
  line-height: 1.6;
  color: #d6bf8f;
  margin: 0 0 12px;
}
.footer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
}
footer .footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
}
footer .footer-links a {
  white-space: nowrap;
}
.footer-credit {
  position: relative;
  display: block;
  padding: 17px 0;
  align-self: center;
  width: min(100%, 580px);
  text-align: center;
}
.footer-credit a {
  font: inherit;
}
.credit-sparkles {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
  color: var(--accent);
  opacity: 0;
  transition: opacity 350ms ease-in-out;
}
.footer-credit:is(:hover, :focus-within) .credit-sparkles {
  opacity: 1;
}
.reference-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: #fff;
  filter: drop-shadow(0 0 2px #ffffffaa);
}
.reference-star {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0.1;
  transform: scale(0.6);
  animation-name: none;
  animation-duration: 3.7s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.reference-star:nth-child(2n) {
  animation-duration: 2.3s;
  animation-delay: 0.8s;
}
.reference-star:nth-child(3n) {
  animation-duration: 4.6s;
  animation-delay: 2.7s;
}
.reference-star:nth-child(5n) {
  animation-delay: 1.6s;
}
.footer-credit:is(:hover, :focus-within) .reference-star {
  animation-name: credit-field-twinkle;
}
.reference-dust {
  opacity: 0.25;
}
@keyframes credit-field-twinkle {
  0%,
  100% {
    opacity: 0.1;
    transform: scale(0.6);
  }
  40% {
    opacity: 0.9;
    transform: scale(1.1);
  }
  65% {
    opacity: 0.2;
    transform: scale(0.8);
  }
}

@media (max-width: 540px) {
  footer {
    flex-wrap: wrap;
    gap: 17px;
  }
  footer .footer-links a {
    font-size: 11px;
  }
}

.brand img.brand-icon {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
  border-radius: 7px;
  flex-shrink: 0;
}

/* Feedback stays outside artwork so preview colors remain exact. */
button:enabled:active,
.feedback-link:active {
  transform: translateY(1px);
}
.feedback-flash {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  animation: feedback-in 150ms ease-out;
}
@keyframes feedback-in {
  from {
    outline-color: transparent;
  }
  to {
    outline-color: var(--accent);
  }
}
#drop-overlay:not([hidden]) {
  animation:
    drop-in 150ms ease-out,
    drop-breathe 1.8s ease-in-out 150ms infinite;
}
@keyframes drop-breathe {
  50% {
    border-color: #ff9aaf55;
  }
}
@keyframes drop-bob {
  50% {
    transform: translateY(5px);
  }
}
@keyframes drop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.tone-button {
  position: relative;
}
.tone-check {
  display: none;
  position: absolute;
  top: 17px;
  right: 3px;
  padding: 0 3px;
  border-radius: 3px;
  background: #300c17;
  color: #ffb7c6;
  font-size: 12px;
}
.tone-button[aria-pressed='true'] .tone-check {
  display: block;
}
.tone-button.picked .tone-check {
  animation: pop-in 200ms ease-out;
}
/* Dim labels, never swatches, so candidate colors stay comparable. */
#tone-ramps:has([aria-pressed='true'])
  .tone-button:not([aria-pressed='true'])
  :is(.tone-step, .tone-hex) {
  opacity: 0.6;
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}
.history .nudge-back {
  animation: nudge-back 260ms ease-out;
}
.history .nudge-forward {
  animation: nudge-forward 260ms ease-out;
}
@keyframes nudge-back {
  40% {
    transform: rotate(-20deg);
  }
}
@keyframes nudge-forward {
  40% {
    transform: rotate(20deg);
  }
}
.asset-card.entering {
  animation: asset-in 240ms ease-out var(--stagger, 0ms) both;
}
@keyframes asset-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.confirmed {
  animation: confirm-pop 300ms ease-out;
}
@keyframes confirm-pop {
  40% {
    transform: scale(0.96);
  }
}
.draft.saved-pop::before {
  animation: dot-pop 400ms ease-out;
}
@keyframes dot-pop {
  40% {
    transform: scale(1.8);
  }
}
.status-in {
  animation: status-in 250ms ease-out;
}
@keyframes status-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
.count-roll {
  animation: count-roll 250ms ease-out;
}
@keyframes count-roll {
  from {
    opacity: 0;
    transform: translateY(-40%);
  }
}
.shake {
  animation: shake 300ms ease-in-out;
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-4px);
  }
  40%,
  80% {
    transform: translateX(4px);
  }
}
.arrow {
  display: inline-block;
}
.arrow.dip {
  animation: dip 350ms ease-out;
}
@keyframes dip {
  40% {
    transform: translateY(3px);
  }
}
/* Entering highlight mode eases in the existing overlay; fills are never animated. */
.canvas.highlight-enter.highlighting [data-node].selected {
  animation: highlight-glow 300ms ease-out;
}
.canvas.highlight-enter.highlighting [data-node]:not(.selected) {
  animation: highlight-dim 200ms ease-out;
}
@keyframes highlight-glow {
  from {
    filter: drop-shadow(0 0 0 #ff9aaf00);
  }
}
@keyframes highlight-dim {
  from {
    opacity: 1;
  }
}
#copy-xml {
  min-width: 100px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  button:enabled:active,
  .feedback-link:active {
    transform: none;
  }
}
/* AI action button: a gradient pill with a light sweep and twinkling sparkles. */
.ai-button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border-color: transparent;
  background: linear-gradient(120deg, #ff9aaf, #d8a4ff 55%, #9fc8ff);
  color: #2a0c18;
  transition:
    background 0.15s,
    box-shadow 0.25s,
    transform 0.15s;
}
.ai-button:hover {
  background: linear-gradient(120deg, #ffb2c2, #e2b8ff 55%, #b5d5ff);
  border-color: transparent;
  box-shadow: 0 6px 20px -8px #d8a4ff;
}
.ai-button::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 35%, #ffffffaa 50%, transparent 65%);
  transform: translateX(-120%);
  animation: ai-shimmer 3.2s ease-in-out infinite;
}
.ai-sparkles {
  flex: none;
  width: 16px;
  height: 16px;
  overflow: visible;
  fill: currentColor;
}
.ai-sparkles path {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ai-button .spark-small,
.ai-button .spark-tiny {
  animation: ai-twinkle 2.4s ease-in-out infinite;
}
.ai-button .spark-tiny {
  animation-delay: -1.2s;
}
.ai-button:hover .spark-main {
  transform: rotate(90deg) scale(1.1);
}
.ai-button.confirmed .ai-sparkles {
  animation: ai-burst 300ms ease-out;
}
@keyframes ai-shimmer {
  0%,
  45% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}
@keyframes ai-twinkle {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.25;
    transform: scale(0.4);
  }
}
@keyframes ai-burst {
  50% {
    transform: scale(1.35) rotate(20deg);
  }
}
