body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #0c0c0e;
    touch-action: none;
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes tada {
    0% { transform: scale(1); }
    10%, 20% { transform: scale(0.9) rotate(-3deg); }
    30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
    40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0); }
}

.animate-tada {
    animation: tada 2s ease-in-out infinite;
}

.studio-bg {
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1.2px, transparent 1.2px);
    background-size: 24px 24px;
    background-color: #0e0e11;
    position: relative;
}

.layer-thumbnail {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background-color: #09090b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.15s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

#photoshop-layers-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: calc(100vh - 14rem) !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding-right: 0.25rem;
    padding-left: 0.1rem;
    scrollbar-gutter: stable;
}

#layers-sidebar {
    position: fixed !important;
    top: 4rem;
    right: 1.25rem;
    width: 260px;
    height: 560px;
    max-height: calc(100vh - 8rem);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.02) inset;
    cursor: default;
    background-color: rgba(18, 18, 20, 0.85) !important;
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    transition: border-color 0.2s ease;
}

#layers-sidebar:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

#layers-sidebar.dragging {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: rgba(18, 18, 20, 0.96) !important;
}

#layers-sidebar-header {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

#layers-sidebar-header:active {
    cursor: grabbing;
}

.layer-item {
    width: 100%;
}

.layer-item:hover .layer-thumbnail {
    border-color: rgba(255, 255, 255, 0.15);
}

.layer-item.dragging {
    opacity: 0.4;
    background-color: rgba(37, 99, 235, 0.1) !important;
    border-color: rgba(37, 99, 235, 0.5) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

#canvas-zoom-wrapper {
    position: relative;
    background-color: #ffffff;
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.04);
    transform-origin: center center;
    transition: none;
    will-change: transform;
}

.canvas-container {
    margin: 0 auto;
    overflow: visible !important;
}

.canvas-container.paint-mode,
.canvas-container.paint-mode canvas {
    cursor: none !important;
}

.custom-scroll::-webkit-scrollbar {
    height: 3px;
    width: 3px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

#ruler-top {
    cursor: ns-resize !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
}

#ruler-left {
    cursor: ew-resize !important;
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.02);
}

#guide-layer,
#snap-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    --gw: 1.5px;
    --gh: 12px;
}

#guide-layer {
    z-index: 20;
}

#snap-layer {
    z-index: 21;
}

.guide {
    position: absolute;
    pointer-events: auto;
    touch-action: none;
}

.guide::after {
    content: '';
    position: absolute;
    background: #06b6d4;
}

.guide-h {
    left: -20000px;
    width: 40000px;
    height: var(--gh);
    margin-top: calc(var(--gh) / -2);
    cursor: ns-resize;
}

.guide-h::after {
    left: 0;
    right: 0;
    top: calc(50% - var(--gw) / 2);
    height: var(--gw);
}

.guide-v {
    top: -20000px;
    height: 40000px;
    width: var(--gh);
    margin-left: calc(var(--gh) / -2);
    cursor: ew-resize;
}

.guide-v::after {
    top: 0;
    bottom: 0;
    left: calc(50% - var(--gw) / 2);
    width: var(--gw);
}

.snap-line {
    position: absolute;
    display: none;
    background: #ff007f;
    pointer-events: none;
}

.snap-line-v {
    top: -20000px;
    height: 40000px;
    width: var(--gw);
    margin-left: calc(var(--gw) / -2);
}

.snap-line-h {
    left: -20000px;
    width: 40000px;
    height: var(--gw);
    margin-top: calc(var(--gw) / -2);
}

#asset-modal,
#shape-variant-modal {
    will-change: opacity;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#modal-card,
#shape-modal-card {
    will-change: transform;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#text-properties-panel {
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

#text-properties-panel.dragging {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: rgba(18, 18, 20, 0.95) !important;
}

#text-properties-panel input,
#text-properties-panel select,
#text-properties-panel button {
    touch-action: manipulation;
}

#advanced-tools-adjuster input[type="range"] {
    touch-action: pan-x;
}
