:root { --ease-out: cubic-bezier(0.22, 1, 0.36, 1); }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: inherit; }

.custom-scrollbar::-webkit-scrollbar { width: 4px; height: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--c-track); border-radius: 2px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--c-muted); }

:focus-visible { outline: 2px solid var(--c-sec); outline-offset: 2px; }
button:focus:not(:focus-visible), input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible), select:focus:not(:focus-visible) { outline: none; }

input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  height: 12px; width: 12px; border-radius: 50%; background: var(--c-white); cursor: pointer; margin-top: -5px;
}
input[type="range"]::-webkit-slider-runnable-track { width: 100%; height: 2px; cursor: pointer; background: var(--c-track); }
input[type="range"]::-moz-range-track { width: 100%; height: 2px; cursor: pointer; background: var(--c-track); border: 0; }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--c-white); border: 0; cursor: pointer; }

.canvas-stage { background: var(--c-bg); }

#canvasWrap {
  position: relative;
  box-shadow: 0 24px 48px -16px color-mix(in oklab, var(--ombra), transparent 80%);
  outline: 1px solid var(--c-border);
  width: auto;
  height: 100%;
  max-height: 90vh;
  aspect-ratio: 1080 / 1350;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#canvasWrap canvas {
  display: block;
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

select, textarea { font-family: 'Inter', system-ui, sans-serif; }

.color-input {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border: 1px solid var(--c-track);
  border-radius: 4px; padding: 0; cursor: pointer; background: none; flex-shrink: 0;
}
.color-input::-webkit-color-swatch-wrapper { padding: 2px; }
.color-input::-webkit-color-swatch { border: none; border-radius: 2px; }
.color-input::-moz-color-swatch { border: none; border-radius: 2px; }

#toast {
  position: fixed; right: 14px; bottom: 14px; z-index: 60;
  background: var(--c-border); color: var(--c-primary); border: 1px solid var(--c-track);
  padding: 10px 12px; border-radius: 8px; opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s; pointer-events: none; font-size: 13px;
}
#toast.show { opacity: 1; transform: translateY(0); }

.text-block-ui {
    background: var(--c-sidebar);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    position: relative;
}

