:root {
  --pixel-ink: #172024;
  --pixel-muted: #66757a;
  --pixel-line: rgba(255, 255, 255, 0.68);
  --pixel-glass: rgba(255, 255, 255, 0.62);
  --pixel-aqua: #0b8f90;
  --pixel-blue: #6d8df7;
  --pixel-danger: #d85b5b;
}

* {
  box-sizing: border-box;
}

.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;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

.pixel-app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  padding: 14px;
  color: var(--pixel-ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(102, 214, 210, 0.25), transparent 34%),
    radial-gradient(circle at 92% 4%, rgba(239, 133, 118, 0.18), transparent 30%),
    linear-gradient(135deg, #eefbf8 0%, #f8f7f3 48%, #f7eeee 100%);
}

.pixel-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 8px 10px 10px;
}

.pixel-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.pixel-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--pixel-aqua), var(--pixel-blue));
  font-weight: 900;
  box-shadow: 0 16px 36px rgba(11, 143, 144, 0.18), inset 0 1px 0 rgba(255,255,255,0.45);
}

.pixel-brand strong,
.pixel-brand small {
  display: block;
  line-height: 1.14;
}

.pixel-brand strong {
  font-size: 18px;
}

.pixel-brand small {
  margin-top: 3px;
  color: var(--pixel-muted);
  font-size: 12px;
}

.pixel-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-api-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding-inline: 14px 12px;
}

.top-api-button small {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: #0b6263;
  background: rgba(226, 252, 249, 0.78);
  font-size: 11px;
  font-weight: 820;
}

.pixel-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 12px;
  min-height: 0;
}

.pixel-toolbar,
.pixel-inspector,
.pixel-stage-wrap {
  border: 1px solid var(--pixel-line);
  background: var(--pixel-glass);
  box-shadow: 0 24px 70px rgba(29, 49, 55, 0.12), inset 0 1px 0 rgba(255,255,255,0.7);
  backdrop-filter: blur(22px) saturate(145%);
}

.pixel-toolbar {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
  border-radius: 24px;
}

.tool-tile {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 76px;
  padding: 13px 12px;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 18px;
  color: #243034;
  background: rgba(255,255,255,0.52);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 10px 24px rgba(31,53,59,0.05);
}

.tool-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(11,143,144,0.25);
}

.tool-tile.primary {
  color: #fff;
  background: linear-gradient(135deg, rgba(11,143,144,0.92), rgba(109,141,247,0.82));
}

.tool-tile.danger {
  color: #fff;
  background: linear-gradient(135deg, rgba(216,91,91,0.88), rgba(239,133,118,0.78));
}

.tool-tile.api-tool {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.72), rgba(238,243,244,0.52)),
    rgba(255,255,255,0.48);
}

.tool-tile.api-tool span {
  color: #0b6263;
}

.tool-tile input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tool-tile span {
  font-size: 14px;
  font-weight: 880;
}

.tool-tile small,
.tool-hint {
  color: rgba(61, 74, 78, 0.72);
  font-size: 11px;
  line-height: 1.45;
}

.tool-tile.primary small,
.tool-tile.danger small {
  color: rgba(255,255,255,0.78);
}

.tool-hint {
  padding: 8px 4px;
}

.pixel-stage-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 28px;
}

#pixelCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(rgba(37,48,51,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,48,51,0.04) 1px, transparent 1px),
    rgba(255,255,255,0.2);
  background-size: 32px 32px;
  cursor: grab;
}

#pixelCanvas.space-panning {
  cursor: grab;
}

#pixelCanvas.dragging {
  cursor: grabbing;
}

.node-toolbar {
  position: absolute;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 24px);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  box-shadow: 0 16px 44px rgba(31,53,59,0.16), inset 0 1px 0 rgba(255,255,255,0.82);
  backdrop-filter: blur(18px) saturate(150%);
  transform: translate(-50%, -110%);
}

.node-toolbar::-webkit-scrollbar {
  display: none;
}

.node-toolbar.hidden {
  display: none;
}

.node-toolbar button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(37,48,51,0.08);
  border-radius: 999px;
  color: #263033;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.92), rgba(231,236,238,0.7)),
    rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
}

.node-toolbar button:hover {
  border-color: rgba(11,143,144,0.24);
  color: #0b6263;
}

.node-toolbar button.danger {
  color: #8f2424;
  background: rgba(255, 235, 232, 0.88);
}

.canvas-marquee {
  position: absolute;
  z-index: 10;
  display: none;
  border: 1px solid rgba(11,143,144,0.8);
  background: rgba(11,143,144,0.12);
  border-radius: 8px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
}

.canvas-marquee.active {
  display: block;
}

.floating-cutout {
  position: absolute;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 50%;
  color: #0b6263;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.92), rgba(226,252,249,0.72)),
    rgba(255,255,255,0.74);
  box-shadow: 0 14px 32px rgba(31,53,59,0.16), inset 0 1px 0 rgba(255,255,255,0.84);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transform: translate(-50%, -115%);
}

.floating-cutout.hidden {
  display: none;
}

.canvas-empty,
.canvas-status {
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(16px);
}

.canvas-empty {
  left: 50%;
  top: 50%;
  display: grid;
  gap: 12px;
  width: min(470px, calc(100% - 48px));
  padding: 18px;
  border-radius: 22px;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--pixel-muted);
}

.canvas-empty strong {
  color: var(--pixel-ink);
  font-size: 18px;
}

.canvas-empty.hidden {
  display: none;
}

.canvas-empty-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: auto;
}

.canvas-status {
  left: 14px;
  bottom: 14px;
  min-height: 30px;
  padding: 8px 11px;
  border-radius: 999px;
  color: #3d4a4e;
  font-size: 12px;
  font-weight: 780;
}

.pixel-inspector {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 10px;
  border-radius: 24px;
}

.panel-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 20px;
  background: rgba(255,255,255,0.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 12px 26px rgba(31,53,59,0.05);
}

.panel-card h2 {
  margin: -5px 0 2px;
  font-size: 16px;
  line-height: 1.2;
}

.panel-help {
  margin: 0;
  color: #59666b;
  font-size: 12px;
  line-height: 1.5;
}

.alpha-help {
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.7), rgba(234,239,240,0.5)),
    rgba(255,255,255,0.46);
}

.source-grid-help {
  padding: 9px 10px;
  border: 1px solid rgba(11,143,144,0.14);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(226,252,249,0.62), rgba(235,239,241,0.48)),
    rgba(255,255,255,0.46);
}

.cutout-sample {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 14px;
  color: #536166;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.72), rgba(234,239,240,0.5)),
    rgba(255,255,255,0.5);
  font-size: 12px;
  font-weight: 780;
}

.cutout-sample::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 1px solid rgba(37,48,51,0.16);
  border-radius: 50%;
  background: var(--cutout-color, linear-gradient(135deg, #fff, #dfe8ea));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.panel-card textarea,
.panel-card input,
.panel-card select {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 14px;
  padding: 9px 10px;
  color: #263033;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.88), rgba(233,238,239,0.66)),
    rgba(255,255,255,0.62);
  outline: none;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.84), 0 8px 20px rgba(31,53,59,0.04);
}

.panel-card input[type="checkbox"] {
  accent-color: var(--pixel-aqua);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.95), rgba(224,230,232,0.72)),
    rgba(255,255,255,0.76);
}

.panel-card select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #66757a 50%),
    linear-gradient(135deg, #66757a 50%, transparent 50%),
    linear-gradient(145deg, rgba(255,255,255,0.88), rgba(233,238,239,0.66));
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%,
    0 0;
  background-size: 5px 5px, 5px 5px, 100% 100%;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.panel-card select option {
  color: #263033;
  background: #f1f4f4;
}

.panel-card input:focus,
.panel-card select:focus,
.panel-card textarea:focus {
  border-color: rgba(11,143,144,0.32);
  box-shadow: 0 0 0 3px rgba(102,214,210,0.14), inset 0 1px 0 rgba(255,255,255,0.84);
}

.panel-card textarea {
  resize: vertical;
}

.panel-card label {
  display: grid;
  gap: 5px;
  color: #5b686d;
  font-size: 12px;
  font-weight: 760;
}

.generation-progress {
  display: grid;
  gap: 7px;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 14px;
  background: rgba(255,255,255,0.54);
  color: #536166;
  font-size: 12px;
  font-weight: 780;
}

.generation-progress.hidden {
  display: none;
}

.generation-progress div {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(37,48,51,0.08);
}

.generation-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pixel-aqua), var(--pixel-blue));
  transition: width .28s ease;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.checkbox-line {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.checkbox-line input {
  width: 16px;
  min-height: 16px;
}

.pixel-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 999px;
  color: #253033;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.88), rgba(230,235,237,0.62)),
    rgba(255,255,255,0.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 10px 24px rgba(31,53,59,0.06);
  font-weight: 840;
  text-decoration: none;
  cursor: pointer;
}

.pixel-button.primary {
  color: #fff;
  border-color: rgba(255,255,255,0.52);
  background: linear-gradient(135deg, rgba(11,143,144,0.94), rgba(109,141,247,0.86));
}

.pixel-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.sprite-meta,
.selected-info,
.api-status,
.api-note,
.api-config-note,
.api-command {
  color: #59666b;
  font-size: 12px;
  line-height: 1.5;
}

.api-status {
  min-height: 38px;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 14px;
  background: rgba(255,255,255,0.54);
  color: #243034;
  font-weight: 820;
}

.api-status.mock {
  color: #79521a;
  background: rgba(255, 246, 222, 0.72);
}

.api-status.external {
  color: #0c6263;
  background: rgba(226, 252, 249, 0.78);
}

.api-config-note {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(11, 143, 144, 0.18);
  border-radius: 14px;
  background: rgba(226, 252, 249, 0.58);
}

.api-config-note strong {
  color: #0c6263;
  font-size: 13px;
}

.api-config-note p {
  margin: 0;
}

.api-env-table {
  display: grid;
  gap: 7px;
}

.api-env-table div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 12px;
  background: rgba(255,255,255,0.58);
}

.api-env-table span {
  color: #5b686d;
  font-size: 11px;
  font-weight: 860;
}

.api-env-table code {
  min-width: 0;
  color: #38464a;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-command {
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 14px;
  background: rgba(255,255,255,0.54);
}

.api-command span {
  color: #243034;
  font-weight: 840;
}

.api-command code {
  display: block;
  max-height: 72px;
  overflow: auto;
  padding: 8px;
  border-radius: 10px;
  background: rgba(23, 32, 36, 0.07);
  color: #253033;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-all;
}

.api-guide {
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 14px;
  background: rgba(255,255,255,0.44);
  color: #536166;
  font-size: 12px;
  line-height: 1.5;
}

.api-guide strong {
  color: #243034;
  font-size: 13px;
}

.api-guide p {
  margin: 0;
}

.api-guide a {
  color: #0b8f90;
  font-weight: 840;
}

.api-guide code {
  color: #253033;
  font-size: 11px;
  font-weight: 820;
}

.api-config-modal {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 28px;
  padding: 0;
  color: var(--pixel-ink);
  background: rgba(255,255,255,0.76);
  box-shadow: 0 32px 90px rgba(18, 35, 40, 0.24);
  backdrop-filter: blur(24px) saturate(155%);
}

.cutout-modal {
  width: min(900px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 28px;
  padding: 0;
  color: var(--pixel-ink);
  background: rgba(255,255,255,0.78);
  box-shadow: 0 32px 90px rgba(18, 35, 40, 0.24);
  backdrop-filter: blur(24px) saturate(155%);
}

.cutout-modal::backdrop {
  background: rgba(18, 28, 32, 0.42);
  backdrop-filter: blur(10px);
}

.cutout-panel {
  position: relative;
  display: grid;
  gap: 13px;
  padding: 24px;
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.94), rgba(241,250,249,0.7)),
    rgba(255,255,255,0.72);
}

.cutout-panel h2 {
  margin: -6px 48px 0 0;
  font-size: 25px;
  line-height: 1.16;
}

.cutout-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cutout-preview-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.cutout-preview-card span {
  color: #536166;
  font-size: 12px;
  font-weight: 840;
}

.cutout-preview-card canvas {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 18px;
  background:
    linear-gradient(45deg, rgba(37,48,51,0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(37,48,51,0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(37,48,51,0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(37,48,51,0.06) 75%),
    rgba(255,255,255,0.62);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  image-rendering: pixelated;
}

.cutout-tool-row,
.cutout-zoom-row,
.cutout-selection-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.cutout-tool-row button,
.cutout-zoom-row button,
.cutout-selection-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 999px;
  color: #253033;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.9), rgba(230,235,237,0.66)),
    rgba(255,255,255,0.62);
  font-size: 12px;
  font-weight: 830;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
}

.cutout-tool-row button.active,
.cutout-zoom-row button.active {
  color: #fff;
  border-color: rgba(11,143,144,0.18);
  background: linear-gradient(135deg, rgba(11,143,144,0.92), rgba(109,141,247,0.78));
}

.cutout-zoom-row span {
  min-width: 58px;
  color: #536166;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.cutout-preview-card canvas[data-tool="erase-brush"],
.cutout-preview-card canvas[data-tool="restore-brush"] {
  cursor: crosshair;
}

.cutout-preview-card canvas[data-tool="pan"] {
  cursor: grab;
}

.cutout-preview-card canvas[data-tool="pan"].dragging {
  cursor: grabbing;
}

.api-config-modal::backdrop {
  background: rgba(18, 28, 32, 0.42);
  backdrop-filter: blur(10px);
}

.api-config-panel {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 24px;
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.94), rgba(241,250,249,0.7)),
    rgba(255,255,255,0.72);
}

.api-config-panel h2 {
  margin: -6px 48px 0 0;
  font-size: 25px;
  line-height: 1.16;
}

.api-modal-intro {
  margin: 0;
  color: #536166;
  font-size: 13px;
  line-height: 1.55;
}

.api-timeout-note {
  margin: -2px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.68);
  border-radius: 14px;
  color: #5f696d;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.72), rgba(234,239,240,0.52)),
    rgba(255,255,255,0.48);
  font-size: 12px;
  line-height: 1.5;
}

.api-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  color: #253033;
  font-size: 22px;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78), 0 10px 24px rgba(31,53,59,0.08);
}

.api-config-panel label {
  display: grid;
  gap: 6px;
  color: #536166;
  font-size: 12px;
  font-weight: 820;
}

.api-config-panel input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 14px;
  padding: 9px 11px;
  color: #253033;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.92), rgba(232,237,239,0.68)),
    rgba(255,255,255,0.72);
  outline: none;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.76);
}

.api-provider-picks {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.api-provider-picks span {
  color: #536166;
  font-size: 12px;
  font-weight: 840;
}

.api-provider-picks button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 999px;
  color: #253033;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.9), rgba(230,235,237,0.66)),
    rgba(255,255,255,0.62);
  font-size: 11px;
  font-weight: 820;
}

.api-test-button {
  justify-self: start;
}

.api-security-note {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid rgba(11,143,144,0.18);
  border-radius: 14px;
  background: rgba(226,252,249,0.66);
  color: #536166;
  font-size: 12px;
  line-height: 1.5;
}

.api-security-note strong {
  color: #0c6263;
}

.api-security-note p {
  margin: 0;
}

.api-token-link {
  justify-self: start;
  color: #0b8f90;
  font-size: 12px;
  font-weight: 860;
  text-decoration: none;
}

.api-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.sprite-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  max-height: 160px;
  overflow: auto;
}

.sprite-preview canvas {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 10px;
  background: rgba(255,255,255,0.5);
  image-rendering: pixelated;
}

.pixel-toast-region {
  position: fixed;
  z-index: 1000;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 9px;
  width: min(360px, calc(100vw - 36px));
}

.pixel-toast {
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 16px;
  color: #263033;
  background: rgba(255,255,255,0.84);
  box-shadow: 0 18px 50px rgba(31,53,59,0.18);
  backdrop-filter: blur(18px);
  font-size: 13px;
}

.pixel-toast.error {
  color: #631e1e;
  background: rgba(255,235,232,0.92);
}

@media (max-width: 1080px) {
  body {
    overflow: auto;
  }

  .pixel-app {
    height: auto;
    min-height: 100vh;
  }

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

  .pixel-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .pixel-stage-wrap {
    min-height: 62vh;
  }
}

@media (max-width: 720px) {
  .pixel-topbar,
  .pixel-top-actions {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

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