* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.subtitle {
    color: #666;
    font-size: 0.95rem;
}

.workspace {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.canvas-container {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 15px;
    overflow: hidden;
}

#canvas {
    width: 100%;
    height: auto;
    display: block;
    background: #fafafa;
    border-radius: 8px;
}

/* SVG Section Styling */
.section {
    stroke: #333;
    stroke-width: 1.5;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.section:hover {
    opacity: 0.85;
}

.section.unfilled {
    fill: #f0f0f0;
}

.section-number {
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    fill: #555;
    pointer-events: none;
    text-anchor: middle;
    dominant-baseline: middle;
}

/* Palette Panel */
.palette-panel {
    width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    flex-shrink: 0;
}

.palette-panel h2 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.current-color {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 8px;
}

.current-color span:first-child {
    font-size: 0.85rem;
    color: #666;
}

.color-display {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid #ddd;
    background: #f0f0f0;
}

#current-color-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.palette {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.palette-color {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #fafafa;
}

.palette-color:hover {
    background: #f0f0f0;
}

.palette-color.selected {
    border-color: #2c3e50;
    background: #e8f4fd;
}

.palette-color .swatch {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.palette-color .number {
    font-weight: 700;
    font-size: 1rem;
    color: #333;
}

.instructions {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 10px;
}

.instructions h3 {
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.instructions ul {
    list-style: none;
    font-size: 0.85rem;
    color: #666;
}

.instructions li {
    padding: 4px 0;
    padding-left: 15px;
    position: relative;
}

.instructions li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: #999;
}

.status {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
}

#sync-status {
    font-size: 0.8rem;
    color: #888;
}

#sync-status.connected {
    color: #27ae60;
}

#sync-status.error {
    color: #e74c3c;
}

#sync-status.rate-limited {
    color: #f39c12;
}

/* Responsive */
@media (max-width: 768px) {
    .workspace {
        flex-direction: column;
    }

    .palette-panel {
        width: 100%;
    }

    .palette {
        grid-template-columns: repeat(5, 1fr);
    }

    .palette-color {
        flex-direction: column;
        padding: 6px;
    }

    .palette-color .swatch {
        width: 32px;
        height: 32px;
    }
}
