:root {
    color-scheme: light;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: #172033;
    background: #f1f5f9;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: clamp(1rem, 4vw, 3rem);
    background:
        radial-gradient(circle at 12% 8%, #dbeafe 0, transparent 30rem),
        #f1f5f9;
}

.editor {
    width: min(100%, 76rem);
    margin: 0 auto;
}

.page-heading {
    margin: 0 0 1.5rem;
}

.eyebrow {
    margin: 0 0 0.45rem;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.045em;
}

.subtitle {
    margin: 0.5rem 0 0;
    color: #526078;
    line-height: 1.6;
}

.workspace {
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid #e2e8f0;
    border-radius: 1.15rem;
    background: #fff;
    box-shadow: 0 1.5rem 4rem rgb(15 23 42 / 10%);
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.tool-group,
.palette {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

button {
    min-height: 2.65rem;
    border: 1px solid #dbe2ed;
    border-radius: 0.6rem;
    background: #fff;
    color: #344054;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 650;
    cursor: pointer;
}

.tool-button {
    padding: 0 0.85rem;
}

.tool-button[aria-pressed="true"] {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.swatch {
    width: 2rem;
    min-height: 2rem;
    padding: 0;
    border-radius: 50%;
}

.blue { background: #3b82f6; }
.red { background: #ef4444; }
.green { background: #10b981; }
.amber { background: #f59e0b; }
.purple { background: #8b5cf6; }

button:hover {
    filter: brightness(0.96);
}

button:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}

.status {
    min-height: 1.35rem;
    margin: 1.1rem 0 0.75rem;
    color: #526078;
    font-size: 0.9rem;
}

.canvas-frame {
    overflow: hidden;
    border: 1px solid #dbe2ed;
    border-radius: 0.75rem;
    background-color: #fff;
    background-image: radial-gradient(#dce3ed 0.8px, transparent 0.8px);
    background-size: 18px 18px;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
    cursor: crosshair;
}

.hint {
    margin: 0.8rem 0 0;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .tool-group {
        width: 100%;
        flex-wrap: wrap;
    }

    .tool-button {
        flex: 1 1 auto;
        padding: 0 0.6rem;
    }
}
