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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #2c2c2c;
    font-size: 13px;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

/* Section */
.section {
    margin-bottom: 24px;
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    color: #6e6e6e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Icon Grid (like Adobe XD) */
.icon-grid {
    display: flex;
    gap: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 2px;
}

.distribute-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.distribute-controls > div {
    display: flex;
    gap: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 2px;
}

.distribute-controls .tool-btn {
    flex-shrink: 0;
}

.distribute-controls .transform-label {
    font-size: 11px;
    color: #6e6e6e;
    font-weight: 600;
}

.distribute-controls .transform-input {
    width: 50px !important;
    height: 30px !important; /* 30px + 2px borders = 32px total to match tool-btn */
    box-sizing: border-box;
}

/* SVG Input */
.svg-input {
    width: 100%;
    min-height: 80px;
    padding: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 8px;
    background: #ffffff;
    color: #2c2c2c;
}

.svg-input:focus {
    outline: none;
    border-color: #0078d4;
}

.tool-btn {
    flex: 1;
    height: 32px;
    min-width: 32px;
    background: transparent;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e6e6e;
    transition: all 0.15s ease;
}

.tool-btn:hover {
    background-color: #f0f0f0;
    color: #2c2c2c;
}

.tool-btn:active {
    background-color: #e0e0e0;
}

.tool-btn.active {
    background-color: #0078d4;
    color: #ffffff;
}

.tool-btn.active:hover {
    background-color: #106ebe;
    color: #ffffff;
}

.tool-btn svg {
    width: 18px;
    height: 18px;
}

.divider {
    width: 1px;
    background-color: #e0e0e0;
    margin: 4px 2px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.action-buttons:last-child {
    margin-bottom: 0;
}

.action-btn {
    flex: 1;
    height: 32px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #2c2c2c;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background-color: #f8f8f8;
    border-color: #d0d0d0;
}

.action-btn:active {
    background-color: #f0f0f0;
}

.action-btn svg {
    width: 14px;
    height: 14px;
}

/* Border Radius Controls */
.radius-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.radius-toggles {
    display: flex;
    gap: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 2px;
}

.radius-toggle {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e6e6e;
    transition: all 0.15s ease;
}

.radius-toggle:hover {
    background-color: #f0f0f0;
    color: #2c2c2c;
}

.radius-toggle.active {
    background-color: #e8f0fe;
    color: #1a73e8;
}

.radius-toggle svg {
    width: 16px;
    height: 16px;
}

.radius-inputs {
    display: flex;
    gap: 6px;
    flex: 1;
}

.radius-input {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    color: #2c2c2c;
    text-align: center;
    transition: all 0.15s ease;
}

.radius-input:focus {
    outline: none;
    border-color: #1a73e8;
    background-color: #f8fbff;
}

.radius-input:hover {
    border-color: #d0d0d0;
}

/* Hide number input spinners */
.radius-input::-webkit-inner-spin-button,
.radius-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.radius-input[type=number] {
    -moz-appearance: textfield;
}

/* Transform Panel */
.transform-grid {
    display: grid;
    grid-template-columns: auto 65px auto auto 65px auto auto auto auto;
    grid-template-rows: auto auto;
    gap: 4px 4px;
    row-gap: 8px;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px;
}

.transform-label {
    font-size: 11px;
    font-weight: 500;
    color: #6e6e6e;
    min-width: 10px;
    flex-shrink: 0;
}

.transform-input {
    width: 100%;
    height: 26px;
    padding: 0 4px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 11px;
    color: #2c2c2c;
    text-align: center;
    transition: all 0.15s ease;
}

.transform-input:focus {
    outline: none;
    border-color: #1a73e8;
    background-color: #f8fbff;
}

.transform-input:hover {
    border-color: #d0d0d0;
}

.transform-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

/* Hide number input spinners */
.transform-input::-webkit-inner-spin-button,
.transform-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.transform-input[type=number] {
    -moz-appearance: textfield;
}

.transform-link,
.transform-lock,
.transform-rotate {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e6e6e;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.transform-link:hover,
.transform-lock:hover,
.transform-rotate:hover {
    background-color: #f0f0f0;
    color: #2c2c2c;
}

.transform-link.active,
.transform-lock.active {
    color: #1a73e8;
}

.transform-link svg,
.transform-lock svg,
.transform-rotate svg {
    width: 12px;
    height: 12px;
}

.transform-rotate-input {
    width: 45px !important;
}

.transform-unit {
    font-size: 11px;
    color: #6e6e6e;
    flex-shrink: 0;
}

/* Color Controls */
.color-control {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 8px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
}

.color-control:last-child {
    margin-bottom: 0;
}

.color-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1a73e8;
}

.color-checkbox:disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: auto;
    accent-color: #9e9e9e;
}

.color-picker:disabled,
.hex-input:disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: auto;
}

.color-checkbox:disabled:hover,
.color-picker:disabled:hover,
.hex-input:disabled:hover {
    cursor: not-allowed !important;
}

.color-picker {
    width: 40px;
    height: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    background: #ffffff;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.color-picker::-moz-color-swatch {
    border: none;
    border-radius: 2px;
}

.color-label {
    flex: 1;
    font-size: 13px;
    color: #2c2c2c;
    font-weight: 400;
    cursor: default;
    min-width: 40px;
    transition: color 0.15s ease;
}

.color-checkbox:disabled ~ .color-label {
    color: #9e9e9e;
}

.hex-input {
    width: 70px;
    height: 24px;
    padding: 0 6px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    color: #2c2c2c;
    text-align: center;
}

.hex-input:focus {
    outline: none;
    border-color: #1a73e8;
    background-color: #ffffff;
}

.color-eyedropper {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e6e6e;
    transition: all 0.15s ease;
}

.color-eyedropper:hover {
    background-color: #f0f0f0;
    color: #2c2c2c;
}

.color-eyedropper:disabled {
    opacity: 0.3;
    cursor: not-allowed !important;
    pointer-events: auto;
    color: #d0d0d0;
}

.color-eyedropper:disabled:hover {
    background-color: transparent;
    cursor: not-allowed !important;
}

.color-eyedropper svg {
    width: 16px;
    height: 16px;
}

/* Opacity Control */
.opacity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 8px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.opacity-label {
    font-size: 13px;
    color: #2c2c2c;
    font-weight: 400;
    min-width: 50px;
}

.opacity-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, transparent 0%, #2c2c2c 100%);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.opacity-slider:disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: auto;
}

.opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1a73e8;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.opacity-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1a73e8;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.opacity-slider:disabled::-webkit-slider-thumb {
    background: #9e9e9e;
    cursor: not-allowed;
}

.opacity-slider:disabled::-moz-range-thumb {
    background: #9e9e9e;
    cursor: not-allowed;
}

.opacity-value {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: #2c2c2c;
    min-width: 40px;
    text-align: right;
}

/* Padding Control */
.padding-control {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.padding-toggle {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e6e6e;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.padding-toggle:hover {
    background-color: #f0f0f0;
    color: #2c2c2c;
}

.padding-toggle.active {
    background-color: #e8f0fe;
    color: #1a73e8;
    border-color: #1a73e8;
}

.padding-toggle svg {
    width: 16px;
    height: 16px;
}

.padding-inputs-single {
    flex: 1;
    display: flex;
}

.padding-inputs-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.padding-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.padding-input-label {
    font-size: 10px;
    color: #6e6e6e;
    text-align: center;
    font-weight: 500;
}

.padding-input {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 12px;
    color: #2c2c2c;
    text-align: center;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.padding-input:focus {
    outline: none;
    border-color: #1a73e8;
    background-color: #f8fbff;
}

.padding-input:hover {
    border-color: #d0d0d0;
}

.padding-input::-webkit-inner-spin-button,
.padding-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.padding-input[type=number] {
    -moz-appearance: textfield;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1e1e1e;
        color: #d4d4d4;
    }

    .section-label {
        color: #999;
    }

    .icon-grid,
    .distribute-controls > div,
    .radius-toggles {
        background: #2d2d2d;
        border-color: #404040;
    }

    .tool-btn {
        color: #999;
    }

    .tool-btn:hover {
        background-color: #383838;
        color: #d4d4d4;
    }

    .tool-btn:active {
        background-color: #404040;
    }

    .divider {
        background-color: #404040;
    }

    .action-btn {
        background: #2d2d2d;
        border-color: #404040;
        color: #d4d4d4;
    }

    .action-btn:hover {
        background-color: #333;
        border-color: #555;
    }

    .action-btn:active {
        background-color: #383838;
    }

    .transform-grid {
        background: #2d2d2d;
        border-color: #404040;
    }

    .transform-label,
    .transform-unit {
        color: #999;
    }

    .transform-input {
        background: #2d2d2d;
        border-color: #404040;
        color: #d4d4d4;
    }

    .transform-input:focus {
        border-color: #1a73e8;
        background-color: #333;
    }

    .transform-input:hover {
        border-color: #555;
    }

    .transform-input:disabled {
        background-color: #252525;
    }

    .transform-link,
    .transform-lock,
    .transform-rotate {
        color: #999;
    }

    .transform-link:hover,
    .transform-lock:hover,
    .transform-rotate:hover {
        background-color: #383838;
        color: #d4d4d4;
    }

    .color-control {
        background: #2d2d2d;
        border-color: #404040;
    }

    .color-label {
        color: #d4d4d4;
    }

    .color-checkbox:disabled ~ .color-label {
        color: #666;
    }

    .color-picker {
        border-color: #404040;
        background: #2d2d2d;
    }

    .hex-input {
        background: #252525;
        border-color: #404040;
        color: #d4d4d4;
    }

    .hex-input:focus {
        border-color: #1a73e8;
        background-color: #333;
    }

    .color-eyedropper {
        color: #999;
    }

    .color-eyedropper:hover {
        background-color: #383838;
        color: #d4d4d4;
    }

    .color-eyedropper:disabled {
        color: #555;
    }

    .opacity-control {
        background: #2d2d2d;
        border-color: #404040;
    }

    .opacity-label {
        color: #d4d4d4;
    }

    .opacity-slider {
        background: linear-gradient(to right, transparent 0%, #d4d4d4 100%);
    }

    .opacity-slider::-webkit-slider-thumb {
        border-color: #2d2d2d;
    }

    .opacity-slider::-moz-range-thumb {
        border-color: #2d2d2d;
    }

    .opacity-value {
        color: #d4d4d4;
    }

    .padding-control {
        background: #2d2d2d;
        border-color: #404040;
    }

    .padding-toggle {
        border-color: #404040;
        color: #999;
    }

    .padding-toggle:hover {
        background-color: #383838;
        color: #d4d4d4;
    }

    .padding-toggle.active {
        background-color: #1a3a5c;
        color: #4da6ff;
        border-color: #4da6ff;
    }

    .padding-input-label {
        color: #999;
    }

    .padding-input {
        background: #2d2d2d;
        border-color: #404040;
        color: #d4d4d4;
    }

    .padding-input:focus {
        border-color: #1a73e8;
        background-color: #333;
    }

    .padding-input:hover {
        border-color: #555;
    }

    .svg-input {
        background: #2d2d2d;
        border-color: #404040;
        color: #d4d4d4;
    }

    .svg-input:focus {
        border-color: #0078d4;
    }

    .radius-toggle {
        color: #999;
    }

    .radius-toggle:hover {
        background-color: #383838;
        color: #d4d4d4;
    }

    .radius-toggle.active {
        background-color: #1a3a5c;
        color: #4da6ff;
    }

    .radius-input {
        background: #2d2d2d;
        border-color: #404040;
        color: #d4d4d4;
    }

    .radius-input:focus {
        border-color: #1a73e8;
        background-color: #333;
    }

    .radius-input:hover {
        border-color: #555;
    }

    .distribute-controls .transform-label {
        color: #999;
    }
}

