:root {
    --primary: #0066cc;
    --primary-hover: #0052a3;
    --secondary: #6b7280;
    --accent: #f59e0b;
    --background: #f8f9fa;
    --surface: #ffffff;
    --surface-hover: #f1f3f4;
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --text: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --shadow: none;
    --shadow-lg: none;
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 24px;
    
    /* Flat design */
    --glass-background: #ffffff;
    --glass-border: #e0e0e0;
    --glass-shadow: none;
    --glass-backdrop: none;
    
    /* Flat design */
    --inset-shadow: none;
    --raised-shadow: none;
    --pressed-shadow: none;
    
    
    /* PCB Colors */
    --pcb-white: #f8f8f8;
    --pcb-black: #1a1a1a;
    --pcb-green: #2d5016;
    --pcb-blue: #1e3a8a;
    --silk-black: #000;
    --silk-white: #fff;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary: #4a9eff;
    --primary-hover: #2b89f0;
    --secondary: #9ca3af;
    --accent: #fbbf24;
    --background: #111827;
    --surface: #1f2937;
    --surface-hover: #374151;
    --border: #374151;
    --border-light: #4b5563;
    --text: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;

    /* Flat design */
    --glass-background: #1f2937;
    --glass-border: #374151;
    --glass-shadow: none;
    --glass-backdrop: none;

    /* Flat design */
    --inset-shadow: none;
    --raised-shadow: none;
    --pressed-shadow: none;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    touch-action: manipulation;
}

.container {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
}


.header {
    background: var(--glass-background);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 20px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text);
}

.beta-badge {
    background: var(--accent);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-btn,
.info-btn {
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 8px;
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.theme-btn:hover,
.info-btn:hover {
    background: var(--surface-hover);
}

.install-btn {
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.install-btn:hover {
    background: var(--surface-hover);
}

.install-btn i {
    font-size: 16px;
}


.version {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
}

.main {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    gap: 0;
    height: calc(100vh - 70px);
}

.sidebar {
    background: var(--glass-background);
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
}

.left-sidebar {
    border-right: 1px solid var(--glass-border);
}

.right-sidebar {
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 24px;
}



.control-section {
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

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


.section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    color: var(--secondary);
}

.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
}

.select {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--surface);
    font-size: 14px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.select:focus {
    outline: none;
    border-color: var(--primary);
}

.hole-description {
    padding: 12px;
    background: var(--surface-hover);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.description-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.holes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.checkbox-group:hover {
    background: var(--surface-hover);
}

.checkbox-group.checked {
    background: var(--primary);
    color: white !important;
    border-color: var(--primary);
}

.checkbox-group.checked span {
    color: white !important;
}

.checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid currentColor;
    position: relative;
}

.checkbox-group.checked .checkbox::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.hole-type {
    display: flex;
    gap: 8px;
}

.radio-group {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.radio-group:hover {
    background: #f5f5f5;
}

.radio-group.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.upload-zone {
    border: 2px dashed var(--border);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--surface);
    position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: #f9f9f9;
}

.upload-content {
    padding: 20px;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--secondary);
}

.upload-text {
    font-size: 14px;
    color: var(--secondary);
}

.image-thumbnail {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-info {
    position: absolute;
    bottom: -20px;
    left: 0;
    font-size: 10px;
    color: var(--text-light);
    white-space: nowrap;
}

.color-scheme {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.threshold-control {
    margin-top: 20px;
}

.range {
    width: 100%;
    height: 2px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

.range::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    cursor: pointer;
    border-radius: 50%;
}

.range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.canvas-container {
    background: var(--background);
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

.canvas-container.dragover {
    background: #e3f2fd;
    border: 2px dashed var(--primary);
}

#previewCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#previewCanvas:active {
    cursor: grabbing;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.canvas-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 16px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}


.btn {
    height: 44px;
    padding: 0 24px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    background: #333;
}

.btn:disabled {
    background: var(--border);
    color: var(--secondary);
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}


/* Modern Components */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.section-header i {
    color: var(--text-secondary);
    font-size: 16px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.label i {
    font-size: 14px;
    color: var(--text-muted);
}

/* Modern Upload Zone */
.upload-zone.modern {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface);
}

.upload-zone.modern:hover,
.upload-zone.modern.dragover {
    border-color: var(--primary);
    background: var(--surface-hover);
}

.upload-icon {
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* Modern Range Slider */
.range.modern {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-light);
    outline: none;
    cursor: pointer;
}

.range.modern::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.range.modern::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
}

.range.modern::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

/* Button Group */
.button-group {
    display: flex;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.toggle-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-right: 1px solid var(--border);
}

.toggle-btn:last-child {
    border-right: none;
}

.toggle-btn:hover {
    background: var(--surface-hover);
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
}

.toggle-btn i {
    font-size: 14px;
}

/* Color Scheme Grid */
.color-scheme-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.color-scheme-btn {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.color-scheme-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.color-scheme-btn.active {
    border-color: var(--primary);
    background: var(--surface-hover);
    box-shadow: 0 0 0 1px var(--primary);
}

.color-preview {
    display: flex;
    width: 32px;
    height: 16px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.pcb-color,
.silk-color {
    flex: 1;
}

.color-scheme-btn span {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Modern Checkbox */
.checkbox-row {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 0;
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: var(--surface);
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-custom i {
    font-size: 10px;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.checkbox-input:checked + .checkbox-custom i {
    opacity: 1;
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--primary);
}

/* Modern Checkbox Group */
.checkbox-group.modern {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-group.modern:hover {
    background: var(--surface-hover);
}

.checkbox-group.modern .checkbox {
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.checkbox-group.modern.checked .checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-group.modern span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.checkbox-group.modern.disabled {
    cursor: not-allowed;
}

.checkbox-group.modern.disabled:hover {
    background: transparent;
}

/* Export Buttons Column */
.export-buttons-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Coffee Section */
/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface);
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--hover);
    color: var(--text);
}

.modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.preview-controls .select {
    flex: 1;
    max-width: 200px;
}

#gerberPreviewCanvas {
    width: 100%;
    height: 500px;
    background: #2a2a2a;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.preview-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--background);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

#previewStatus {
    font-family: 'SF Mono', 'Monaco', monospace;
}

.coffee-section {
    margin-top: auto;
    padding-top: 24px;
}

.coffee-btn {
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    width: 100%;
}

.coffee-btn:hover {
    background: #d97706;
    border-color: #d97706;
}

.coffee-btn i {
    font-size: 16px;
}

/* Primary Button */
.btn.primary {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn.primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn.primary:disabled {
    background: var(--text-muted);
    border-color: var(--text-muted);
    cursor: not-allowed;
}

.btn.primary i {
    font-size: 16px;
}

/* Secondary Button */
.btn.secondary {
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn.secondary:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.btn.secondary:disabled {
    background: var(--surface);
    color: var(--text-muted);
    border-color: var(--text-muted);
    cursor: not-allowed;
}

.btn.secondary i {
    font-size: 16px;
}

/* Remove Button */
.remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.remove-btn i {
    font-size: 12px;
}

/* Image Controls */
.image-controls {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* Canvas Controls */
.canvas-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
}

.control-group {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.control-group label i {
    font-size: 14px;
    color: var(--text-muted);
}

.control-buttons {
    display: flex;
    gap: 4px;
}

.control-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* 中央配置ボタンは少し小さくして3つ並べる */
#centerHorizontal,
#centerVertical,
#centerBoth {
    width: 24px;
    height: 24px;
}

#centerHorizontal i,
#centerVertical i,
#centerBoth i {
    font-size: 12px;
}

.control-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.active {
    background: var(--primary);
    color: white;
}

.control-btn i {
    font-size: 14px;
}

/* Bounding Box */
.bounding-box {
    position: absolute;
    border: 2px solid var(--primary);
    border-radius: 4px;
    pointer-events: none;
    display: none;
}

.bounding-box.active {
    display: block;
}

.bbox-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border: 1px solid white;
    border-radius: 50%;
    pointer-events: auto;
    cursor: pointer;
}

.bbox-handle.nw { top: -4px; left: -4px; cursor: nw-resize; }
.bbox-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.bbox-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.bbox-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }
.bbox-handle.n { top: -4px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.bbox-handle.s { bottom: -4px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.bbox-handle.w { top: 50%; left: -4px; transform: translateY(-50%); cursor: w-resize; }
.bbox-handle.e { top: 50%; right: -4px; transform: translateY(-50%); cursor: e-resize; }

.bbox-rotate {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: var(--accent);
    border: 1px solid white;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bbox-rotate i {
    font-size: 10px;
    color: white;
}

/* Tool Palette */
.tool-palette {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 4px;
    pointer-events: auto;
}

.tool-btn {
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.tool-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-light);
}

.tool-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tool-btn.active:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.tool-btn i {
    font-size: 16px;
}

/* Render Mode Buttons */
.render-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.render-mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    font-weight: 500;
}

.render-mode-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.render-mode-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
}

.render-mode-btn.active:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.render-mode-btn i {
    font-size: 18px;
}

.render-mode-btn span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* About Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 0.6;
}

.modal-body {
    padding: 24px;
}

.about-logo {
    text-align: center;
    margin-bottom: 24px;
}

.about-brand-logo {
    width: 48px;
    height: auto;
}

.about-info {
    text-align: center;
    margin-bottom: 32px;
}

.about-info h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
}

.about-info .version {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--secondary);
}

.about-info .description {
    margin: 0;
    font-size: 14px;
    color: var(--text);
}

.about-author {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.about-author p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--text);
}

.about-author p:last-child {
    margin: 0;
}

.about-author a {
    color: var(--primary);
    text-decoration: none;
}

.about-author a:hover {
    text-decoration: underline;
}

.about-support {
    background: var(--surface-hover);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 24px;
}

.about-support h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.about-support p {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}

.support-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.support-link:hover {
    opacity: 0.9;
}

.about-links {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.about-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.about-link:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.coffee-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #FFDD00;
    color: #000;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.coffee-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 221, 0, 0.4);
}

/* Fix version badge and add credits styles */
.about-info .version {
    display: inline-block;
    margin: 0 0 8px 0;
    padding: 4px 12px;
    font-size: 12px;
    background: #0066cc;
    color: white;
    border-radius: 4px;
    font-weight: 600;
}

.about-credits {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border);
}

.about-credits p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--text);
}

.about-credits p:last-child {
    margin: 0;
    font-weight: 500;
}

.about-credits a {
    color: var(--primary);
    text-decoration: none;
}

.about-credits a:hover {
    text-decoration: underline;
}

/* Remove unused about-logo styles */
.about-logo {
    display: none;
}
