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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f1923;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    height: 100vh;
}

.controls {
    width: 250px;
    min-width: 250px;
    background: #0f1923;
    color: #c8d6e0;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.controls h1 {
    font-size: 18px;
    font-weight: 600;
    color: #e8f0f4;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.byline {
    font-size: 11px;
    color: #5a7080;
    margin-top: -12px;
    margin-bottom: -10px;
}

.filename-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: -8px;
    margin-bottom: -8px;
}

.unsaved-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00d4aa;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.unsaved-dot.visible {
    opacity: 1;
}

.filename-input {
    background: transparent;
    border: none;
    border-bottom: 1px dashed #2a3f50;
    color: #7a8f9e;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 2px 0;
    outline: none;
    width: 100%;
    min-width: 0;
    transition: border-color 0.2s, color 0.2s;
}

.filename-input:hover {
    border-bottom-style: solid;
    border-bottom-color: #3a5060;
}

.filename-input:focus {
    color: #c8d6e0;
    border-bottom-style: solid;
    border-bottom-color: #00d4aa;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 13px;
    color: #7a8f9e;
    display: flex;
    justify-content: space-between;
}

.control-group label span {
    color: #e8f0f4;
    font-weight: 500;
}

.separator {
    border: none;
    border-top: 1px solid #1e2d3a;
    margin: 2px 0;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #1a2d3d;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #00d4aa;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #00d4aa;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.seed-group label {
    margin-bottom: 2px;
}

.seed-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.seed-input {
    flex: 1;
    background: #1a2d3d;
    border: 1px solid #2a3f50;
    border-radius: 4px;
    color: #e8f0f4;
    font-family: monospace;
    font-size: 13px;
    padding: 6px 8px;
    outline: none;
    min-width: 0;
}

.seed-input:focus {
    border-color: #00d4aa;
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
    background: #00d4aa;
    color: #0f1923;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-small:hover {
    background: #00b892;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #7a8f9e;
}

.checkbox-group input[type="checkbox"] {
    accent-color: #00d4aa;
    width: 16px;
    height: 16px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

button {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

#load-design,
#save-design {
    background: #1a2d3d;
    color: #c8d6e0;
}

#load-design:hover,
#save-design:hover {
    background: #243d50;
}

#export-svg {
    background: #00d4aa;
    color: #0f1923;
    font-weight: 600;
}

#export-svg:hover {
    background: #00b892;
}

.canvas-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    background: #142028;
    cursor: grab;
}

.canvas-area.panning {
    cursor: grabbing;
    user-select: none;
}

#voronoi-svg {
    transform-origin: 0 0;
    flex-shrink: 0;
}

.svg-wrapper {
    flex-shrink: 0;
}
