:root {
    --brand-accent:     #FDB913;
    --surface-0:        #080808;
    --surface-1:        #1A1A1A;
    --surface-2:        #222222;
    --surface-canvas:   #030303;
    --surface-canvas-tile: #080808;
    --text-primary:     #F8FAFC;
    --text-secondary:   #CCCCCC;
    --text-tertiary:    #A1A1A1;
    --text-disabled:    #666666;
    --border-default:   #222222;
    --border-strong:    #333333;
    --radius-xs:        4px;
    --motion-fast:      150ms;
    --motion-base:      250ms;
    --motion-slow:      400ms;
    --motion-stat:      1000ms;
    --ease-out:         cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out:      cubic-bezier(0.65, 0, 0.35, 1);
    --shadow-canvas:    0 25px 50px -12px rgba(0,0,0,0.8);
    --focus-ring-tight: 0 0 0 2px rgba(253,185,19,0.30);
}

/* 1. BASE STYLES & SCROLLBARS */
body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--surface-0);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-0); }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-accent); }

#workspace { display: none; }

/* 2. CANVAS & VIEWER */
.checkerboard {
    background-image:
        linear-gradient(45deg, #080808 25%, transparent 25%),
        linear-gradient(-45deg, #080808 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #080808 75%),
        linear-gradient(-45deg, transparent 75%, #080808 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
    box-shadow: var(--shadow-canvas);
    transition: all var(--motion-base) var(--ease-out);
    overflow: hidden;
    background-color: #0e0e0e;
}

#main-canvas {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 4rem);
    transition: filter var(--motion-base) var(--ease-out), width var(--motion-base) var(--ease-out);
}

/* 3. OVERLAYS & GUIDES */
.grid-line-dashed {
    border: 1.5px dashed rgba(253, 185, 19, 1);
    position: absolute;
    pointer-events: none;
}

#col-grid-overlay {
    display: grid;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--motion-base);
}

.grid-cell {
    background-color: rgba(253, 185, 19, 0.3);
    outline: 1px solid rgba(253, 185, 19, 1);
    outline-offset: -1px;
}

#align-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: none;
    overflow: hidden;
    z-index: 40;
}

.sym-guide {
    position: absolute;
    background-color: var(--brand-accent);
    pointer-events: none;
    z-index: 41;
    box-shadow: 0 0 2px rgba(0,0,0,0.8);
}

.sym-v { width: 1px; height: 100%; top: 0; }
.sym-h { height: 1px; width: 100%; left: 0; }

.guide-label {
    position: absolute;
    background: var(--brand-accent);
    color: #0D0D0D;
    font-size: 13px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 2px;
    pointer-events: none;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
}

/* 4. ANIMATIONS */
.stat-bar { transition: width var(--motion-stat) var(--ease-out); }
.fade-in { animation: fadeIn var(--motion-base) var(--ease-in-out) forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 5. MOBILE WALL — desktop-only tool guard */
#mobile-wall {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--surface-0);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    font-family: 'Montserrat', sans-serif;
}
#mobile-wall-inner { max-width: 360px; }
#mobile-wall-logo {
    font-size: 3rem;
    font-weight: 900;
    color: var(--brand-accent);
    letter-spacing: -2px;
    margin-bottom: 1rem;
}
#mobile-wall h2 {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    margin-bottom: 0.75rem;
}
#mobile-wall p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.6;
}
@media (max-width: 1023px) {
    #mobile-wall { display: flex; }
}

#context-transition {
    position: fixed;
    inset: 0;
    background: var(--surface-0);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-slow) var(--ease-in-out);
}

#context-transition.active {
    opacity: 1;
    pointer-events: all;
}
