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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f5f5;
    color: #111;
    min-height: 100vh;
    overflow: hidden;
}

/* Login View */
#login-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
}

.login-container {
    width: 100%;
    max-width: 340px;
    padding: 32px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.logo-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    letter-spacing: -2px;
    color: #111;
}

.sidebar-logo .logo-text {
    font-size: 1.5rem;
    letter-spacing: -1px;
}

#login-view h2 {
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

#login-view form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#login-view .form-group label {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 4px;
}

#login-view input {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
}

#login-view input:focus {
    outline: none;
    border-color: #111;
}

#login-view button[type="submit"] {
    margin-top: 6px;
    padding: 12px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

#login-view button[type="submit"]:hover { background: #333; }

.auth-switch {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-top: 20px;
}

.auth-switch a {
    color: #111;
    text-decoration: none;
    font-weight: 500;
}

#auth-error {
    color: #e53935;
    font-size: 0.8rem;
    text-align: center;
    margin-top: 14px;
    min-height: 18px;
}

/* Main App */
#app {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
}

#preview {
    position: absolute;
    top: 0;
    left: 280px;
    right: 300px;
    height: 100%;
    background: #f5f5f5;
}

#canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Sidebar */
#controls {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.06);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 4px;
    background: #f5f5f5;
    padding: 3px;
    border-radius: 8px;
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    color: #333;
}

.mode-btn.active {
    background: #fff;
    color: #111;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.sidebar-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pegstore-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pegstore-link:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Publish Button */
.btn-publish {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-publish:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Other Model Info */
.other-model-info {
    padding: 16px;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.5;
}

.other-model-info .hint {
    font-size: 0.75rem;
    color: #999;
    margin-top: 6px;
}

/* Publish Form */
.publish-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.form-field input[type="text"] {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
}

.form-field input[type="text"]:focus {
    outline: none;
    border-color: #6366f1;
}

/* Category Select Chips */
.category-select {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cat-chip {
    padding: 6px 10px;
    background: #f5f5f5;
    border: 1px solid transparent;
    border-radius: 16px;
    font-size: 0.75rem;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
}

.cat-chip:hover {
    background: #eee;
}

.cat-chip.active {
    background: #6366f1;
    color: #fff;
}

/* Collapsible Sections */
.control-section {
    border-bottom: 1px solid #f0f0f0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    cursor: pointer;
    user-select: none;
}

.section-header:hover { background: #fafafa; }

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-title svg {
    color: #888;
    flex-shrink: 0;
}

.section-header .chevron {
    transition: transform 0.2s;
    color: #bbb;
}

.section-header.collapsed .chevron {
    transform: rotate(-90deg);
}

.section-content {
    padding: 0 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-content.hidden { display: none; }

/* Compact Grid */
.compact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.compact-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.compact-field label {
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
}

.compact-field input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    font-size: 0.85rem;
    background: #fafafa;
    text-align: center;
}

.compact-field input:focus {
    outline: none;
    border-color: #111;
    background: #fff;
}

/* Hooks Row */
.hooks-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hook-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    cursor: pointer;
    background: #fafafa;
    font-size: 0.8rem;
    color: #666;
}

.hook-chip input { display: none; }

.hook-chip:has(input:checked) {
    background: #111;
    border-color: #111;
    color: #fff;
}

.hooks-label {
    font-size: 0.75rem;
    color: #888;
    margin-left: 4px;
}

.peg-spacing-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: #888;
    margin-top: 6px;
    padding: 6px 8px;
    background: #f8f8f8;
    border-radius: 4px;
}

.peg-spacing-info svg {
    flex-shrink: 0;
    opacity: 0.6;
}

/* Inline Slider */
.inline-slider {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline-slider label {
    font-size: 0.75rem;
    color: #666;
    min-width: 40px;
}

.inline-slider input[type="range"] {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: #e5e5e5;
    appearance: none;
    cursor: pointer;
}

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

.slider-val {
    font-size: 0.75rem;
    color: #111;
    font-weight: 500;
    min-width: 28px;
    text-align: right;
}

/* Inline Row */
.inline-row {
    display: flex;
    gap: 8px;
}

.inline-row select {
    flex: 1;
}

/* Toggle Chip */
.toggle-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    height: 32px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    cursor: pointer;
    background: #fafafa;
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
}

.toggle-chip input { display: none; }

.toggle-chip:has(input:checked) {
    background: #111;
    border-color: #111;
    color: #fff;
}

/* Pattern Note */
.pattern-note {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fffbe6;
    border-radius: 5px;
    font-size: 0.7rem;
    color: #8c7200;
}

.pattern-note svg { flex-shrink: 0; color: #d4a600; }

/* Select */
select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.85rem;
    background: #fafafa;
    color: #111;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

select:focus {
    outline: none;
    border-color: #111;
    background-color: #fff;
}

/* Drop Grid */
.drop-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.drop-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.drop-center {
    width: 36px;
    height: 36px;
    background: #f0f0f0;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
}

.drop-btn {
    width: 40px;
    height: 24px;
    padding: 0;
    font-size: 0.65rem;
    font-weight: 500;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
}

.drop-btn:hover:not(.disabled) {
    background: #f0f0f0;
    border-color: #ccc;
}

.drop-btn.active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.drop-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Buttons */
button {
    width: 100%;
    padding: 11px 14px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

button:hover { background: #333; }
button svg { flex-shrink: 0; }

.btn-secondary {
    background: transparent;
    border: 1px solid #e5e5e5;
    color: #666;
    font-size: 0.8rem;
    padding: 8px 14px;
}

.btn-secondary:hover {
    background: #fafafa;
    border-color: #ccc;
    color: #333;
}

/* Board Panel */
#board-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 16px rgba(0, 0, 0, 0.06);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.board-header {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.board-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111;
    margin: 0;
}

.board-header select {
    flex: 1;
    max-width: 140px;
    padding: 6px 8px;
    font-size: 0.7rem;
}

#board-preview {
    height: 220px;
    background: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
}

#board-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#model-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.model-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 6px;
}

.model-item:hover {
    border-color: #ccc;
    background: #fff;
}

.model-icon {
    width: 32px;
    height: 32px;
    background: #e9ecef;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.model-icon svg { color: #666; width: 16px; height: 16px; }

.model-info { flex: 1; min-width: 0; }

.model-name-input {
    width: 100%;
    font-size: 0.8rem;
    font-weight: 500;
    color: #111;
    border: 1px solid transparent;
    background: transparent;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 4px;
    font-family: inherit;
}

.model-name-input:hover {
    border-color: #e5e5e5;
    background: #fafafa;
}

.model-name-input:focus {
    outline: none;
    border-color: #111;
    background: #fff;
}

.model-dims {
    font-size: 0.65rem;
    color: #888;
    margin-top: 2px;
    padding-left: 4px;
}

.model-visibility {
    margin-top: 4px;
    padding-left: 4px;
}

.visibility-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    color: #888;
    cursor: pointer;
}

.visibility-toggle input {
    display: none;
}

.visibility-label {
    padding: 2px 6px;
    border-radius: 3px;
    background: #f0f0f0;
    transition: all 0.2s;
}

.visibility-toggle.public .visibility-label {
    background: #dcfce7;
    color: #166534;
}

.visibility-toggle:hover .visibility-label {
    background: #e5e5e5;
}

.visibility-toggle.public:hover .visibility-label {
    background: #bbf7d0;
}

.model-actions { display: flex; gap: 3px; }

.model-action-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-action-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.model-action-btn.delete:hover {
    background: #fee;
    border-color: #e53935;
}

.model-action-btn svg { width: 12px; height: 12px; color: #666; }
.model-action-btn.delete:hover svg { color: #e53935; }

.board-actions {
    padding: 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.download-actions {
    display: flex;
    gap: 6px;
}

.btn-accent {
    background: #2563eb;
    color: #fff;
}

.btn-accent:hover { background: #1d4ed8; }

.btn-download {
    flex: 1;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e5e5e5;
    font-size: 0.75rem;
    padding: 8px 10px;
}

.btn-download:hover:not(:disabled) {
    background: #eee;
    border-color: #ccc;
}

.btn-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.format-dropdown {
    flex: 1;
    position: relative;
}

.format-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    margin-bottom: 4px;
    overflow: hidden;
    z-index: 200;
}

.format-menu.show { display: flex; }

.format-menu button {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 0;
    text-align: left;
    font-size: 0.8rem;
    color: #333;
}

.format-menu button:hover { background: #f5f5f5; }
.format-menu button:not(:last-child) { border-bottom: 1px solid #f0f0f0; }

.model-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    text-align: center;
    color: #999;
}

.model-list-empty svg {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
    opacity: 0.4;
}

.model-list-empty p {
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Scrollbar */
.sidebar-content::-webkit-scrollbar,
#model-list::-webkit-scrollbar { width: 4px; }

.sidebar-content::-webkit-scrollbar-track,
#model-list::-webkit-scrollbar-track { background: transparent; }

.sidebar-content::-webkit-scrollbar-thumb,
#model-list::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 2px;
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label { display: block; }
.form-group input { width: 100%; }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow: hidden;
}

.peg-editor-content {
    width: 900px;
    max-width: 95vw;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    border-radius: 6px;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Peg Editor */
.peg-editor-layout {
    display: flex;
    height: 500px;
}

.peg-editor-preview {
    flex: 1;
    background: #f5f5f5;
    border-right: 1px solid #eee;
}

.peg-editor-preview canvas {
    width: 100%;
    height: 100%;
}

.peg-editor-controls {
    width: 340px;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.peg-section {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
}

.peg-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.peg-row {
    display: flex;
    gap: 8px;
}

.peg-row label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.7rem;
    color: #888;
}

.peg-row input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.85rem;
    text-align: center;
}

.peg-row input:focus {
    outline: none;
    border-color: #111;
}

.peg-row .unit {
    font-size: 0.7rem;
    color: #888;
    margin-left: 2px;
}

.peg-attach-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.peg-attach-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #555;
}

.peg-attach-option:hover {
    border-color: #bbb;
}

.peg-attach-option:has(input:checked) {
    background: #111;
    border-color: #111;
    color: #fff;
}

.peg-attach-option input {
    display: none;
}

.peg-attach-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: #e8f4fd;
    border-radius: 6px;
    margin-bottom: 10px;
}

.peg-attach-info svg {
    flex-shrink: 0;
    color: #1976d2;
    margin-top: 1px;
}

.peg-attach-info span {
    font-size: 0.7rem;
    color: #1565c0;
    line-height: 1.4;
}

.peg-attach-current {
    font-size: 0.8rem;
    color: #555;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.peg-attach-current strong {
    color: #111;
}

.peg-measure-toggle {
    margin-bottom: 8px;
}

.peg-measure-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.peg-measure-faces {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.peg-measure-face {
    font-size: 0.8rem;
    color: #555;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
}

.peg-measure-face strong {
    color: #111;
}

.peg-measure-input {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.peg-measure-input label {
    flex: 1;
    font-size: 0.75rem;
    color: #666;
}

.peg-measure-input input {
    width: 100%;
    margin-top: 4px;
}

.peg-measure-input button {
    white-space: nowrap;
}

.peg-editor-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.peg-editor-actions button {
    flex: 1;
}

/* Donation Modal */
.donation-content {
    width: 380px;
    max-width: 90vw;
    padding: 32px;
    text-align: center;
}

.donation-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.donation-content h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #111;
}

.donation-content > p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 24px;
}

.donation-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.donation-actions .btn-accent {
    padding: 14px 20px;
    font-size: 1rem;
    border-radius: 10px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.donation-actions .btn-secondary {
    padding: 10px 16px;
    font-size: 0.85rem;
}

.donation-note {
    font-size: 0.75rem;
    color: #888;
    margin-top: 20px;
    margin-bottom: 0;
}

/* Print Info Panel */
#print-info {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    min-width: 140px;
}

.print-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.print-info-row:not(:last-child) {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.print-info-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.print-info-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111;
}

/* Upload Bar */
#upload-bar {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.upload-btn:hover {
    background: #fff;
    border-color: #6366f1;
    color: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

#upload-filename {
    font-size: 0.8rem;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 6px;
}

#clear-upload-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 0.9rem;
    color: #888;
    cursor: pointer;
    transition: all 0.15s ease;
}

#clear-upload-btn:hover {
    background: #ff4444;
    border-color: #ff4444;
    color: #fff;
}

/* Category Bar */
#category-bar {
    position: absolute;
    top: 60px;
    left: 16px;
    right: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 10;
}

.category-label {
    font-size: 0.75rem;
    color: #888;
    padding: 8px 0;
}

.category-pill {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.category-pill:hover {
    background: #fff;
    border-color: #6366f1;
    color: #4f46e5;
}

.category-pill.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: transparent;
    color: #fff;
}

/* Preset Pills Bar (legacy) */
#preset-bar {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 10;
}

.preset-pill {
    width: 90px;
    height: 90px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    white-space: nowrap;
}

.preset-pill:hover {
    background: #fff;
    border-color: #6366f1;
    color: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.preset-pill.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.printer-select-row {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

#printer-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.75rem;
    background: #fafafa;
    color: #333;
    cursor: pointer;
}

#printer-select:focus {
    outline: none;
    border-color: #111;
}

#size-warning {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.size-warning-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #dc2626;
}

/* Face Edit Modal */
.face-edit-content {
    width: 420px;
    max-width: 95vw;
}

.face-edit-layout {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.face-edit-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.face-edit-section > label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shape-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.shape-btn {
    width: 44px;
    height: 44px;
    padding: 8px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shape-btn:hover {
    background: #eee;
}

.shape-btn.active {
    border-color: #7c3aed;
    background: #f5f3ff;
}

.shape-btn svg {
    color: #444;
}

.shape-btn.active svg {
    color: #7c3aed;
}

.face-edit-row {
    display: flex;
    gap: 12px;
}

.face-edit-field {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.face-edit-field.full-width {
    flex: 1;
}

.face-edit-field span:first-child {
    font-size: 0.8rem;
    color: #666;
    min-width: 60px;
}

.face-edit-field input[type="number"] {
    width: 70px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
}

.face-edit-field input[type="range"] {
    flex: 1;
}

.face-edit-field .unit {
    font-size: 0.75rem;
    color: #999;
}

.extrude-buttons {
    display: flex;
    gap: 8px;
    width: 100%;
}

.extrude-btn {
    flex: 1;
    padding: 10px 14px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
}

.extrude-btn:hover {
    background: #eee;
}

.extrude-btn.active[data-direction="cut"] {
    border-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

.extrude-btn.active[data-direction="add"] {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #16a34a;
}

.face-edit-actions {
    display: flex;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.face-edit-actions button {
    flex: 1;
    padding: 12px 16px;
}

/* Face Edit Mode Indicator */
.face-edit-mode-active #canvas {
    cursor: crosshair;
}

.face-edit-mode-indicator {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #7c3aed;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.face-edit-mode-indicator button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 8px;
}

.face-edit-mode-indicator button:hover {
    background: rgba(255, 255, 255, 0.3);
}

#edit-faces-btn.active {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

#edit-faces-btn.active:hover {
    background: #6d28d9;
}
