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

body {
    font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

header {
    position: relative;
    text-align: center;
    margin-bottom: 25px;
    padding: 24px 24px 16px;
    border-bottom: 2px solid #f0f0f0;
}

header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5em;
    color: #000;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    text-align: center;
}

.header-logo {
    height: 1.2em;
    width: auto;
    vertical-align: middle;
    object-fit: contain;
}

header p {
    color: #000;
    font-size: 1.1em;
    text-align: center;
    width: 100%;
}

.header-buttons {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    z-index: 10;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.header-actions-left,
.header-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions-right {
    justify-content: flex-end;
}

.header-auth-slot {
    display: flex;
    align-items: center;
}

/* Icon Button Base Style */
.btn-icon,
a.btn-icon,
button.btn-icon {
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    box-sizing: border-box;
    font-size: 14px;
}

.btn-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.5;
}

.btn-icon-image {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

.btn-icon:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-icon:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#aboutBtn,
#feedbackBtn,
#coffeeBtn,
#themeToggleBtn {
    width: 40px;
    height: 40px;
    padding: 6px;
}

.theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.theme-toggle-icon svg {
    width: 100%;
    height: 100%;
}

.btn-theme-toggle {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-icon-coffee:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

/* Authentication styles */
.auth-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* User Menu Styles */
.user-menu {
    position: relative;
}

.user-menu-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #374151;
}

.user-menu-button:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
}

.user-name {
    font-weight: 500;
    color: #111827;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-name-large {
    font-weight: 600;
    color: #111827;
    font-size: 15px;
}

.user-email {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

.user-menu-chevron {
    color: #9ca3af;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.user-menu-button:hover .user-menu-chevron {
    color: #6b7280;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    min-width: 240px;
    z-index: 1000;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
}

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

.user-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
}

.user-menu-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.user-menu-item svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
    flex-shrink: 0;
}

.user-menu-item:hover svg {
    color: #374151;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.user-info span {
    font-size: 0.9em;
    color: #666;
}

.btn-login-google {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: #333;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-login-google:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

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

/* Logout button is now in user menu, styles removed */

.btn-login {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.3);
}

.btn-login:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.3);
}

.btn-login svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Login Modal Styles */
.login-modal-content {
    max-width: 400px;
    width: 90%;
}

.login-modal-body {
    padding: 20px;
}

.login-modal-description {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-providers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.btn-provider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: auto;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #dadce0;
    border-radius: 4px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-provider:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    border-color: #c0c0c0;
}

.btn-provider svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-provider span {
    flex: 1;
    text-align: left;
}

.btn-provider-google {
    border-color: #dadce0;
}

.btn-provider-google:hover {
    border-color: #c0c0c0;
    background: #f8f9fa;
}

.btn-provider-microsoft {
    border-color: #dadce0;
}

.btn-provider-microsoft:hover {
    border-color: #0078d4;
    background: #f3f9ff;
}

.hidden {
    display: none !important;
}

.cart-section {
    margin-bottom: 25px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    transition: all 0.2s;
    min-height: 80px;
}

.cart-section.drag-over {
    border: none;
    background: transparent;
    transform: none;
}

.cart-section .projects-section-content {
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
    border: 2px solid #667eea;
    transition: all 0.2s;
}

.cart-section.drag-over .projects-section-content {
    border: 2px dashed #667eea;
    background: #e8eaff;
    transform: scale(1.02);
}

.cart-content {
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
    align-content: flex-start;
}

.bulk-discount-progress {
    margin-bottom: 4px;
    margin-top: 0;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    padding-left: 0;
}

.bulk-discount-label-header {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 4px;
    line-height: 1;
}

.bulk-discount-track-wrapper {
    flex: 1;
    min-width: 0;
    position: relative;
    margin-bottom: 40px;
    margin-top: 4px;
    box-sizing: border-box;
}

.bulk-discount-track {
    position: relative;
    height: 3px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: visible;
    width: 100%;
}

.bulk-discount-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #667eea;
    border-radius: 2px;
    transition: transform 0.3s ease;
    z-index: 1;
}

.bulk-discount-marker {
    position: absolute;
    top: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    z-index: 2;
}

.bulk-discount-marker-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 2px solid #ccc;
    transition: all 0.3s;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.bulk-discount-marker-circle.reached {
    background: #667eea;
    border-color: #5568d3;
}

.bulk-discount-label {
    font-size: 10px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    line-height: 1.2;
    position: absolute;
    top: 13px;
    left: 50%;
    transform: translateX(-50%);
}

.cart-section-group {
    padding: 6px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    width: fit-content;
    min-width: 150px;
    max-width: 100%;
    display: inline-flex;
    flex-direction: column;
    flex-shrink: 0;
}

.cart-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
}

.cart-section-name {
    font-size: 11px;
    font-weight: 600;
    color: #667eea;
}

.cart-section-count {
    font-size: 10px;
    font-weight: 500;
    color: #666;
    background: #f8f9ff;
    padding: 1px 6px;
    border-radius: 8px;
}

.cart-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    align-items: flex-start;
    justify-content: flex-start;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    padding: 4px 6px;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    position: relative;
    width: auto;
    max-width: 100%;
    flex-shrink: 0;
    min-height: 44px;
}

.remove-cart-item-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: 1.5px solid white;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.remove-cart-item-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.remove-cart-item-btn:active {
    transform: scale(0.95);
}

.cart-item .filament-image-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    background: #f5f5f5;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item .filament-image-wrapper .filament-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.cart-item-stock-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(183, 28, 28, 0.92);
    color: #fff;
    box-shadow: 0 6px 12px rgba(120, 19, 19, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.88);
    pointer-events: none;
    z-index: 2;
}

.cart-item-stock-badge svg {
    width: 12px;
    height: 12px;
}

/* Container for My Filament items that includes image and checkbox */
.my-filament-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.cart-item .filament-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 2px;
    min-width: 0;
}

.cart-item-name {
    font-size: 10px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.cart-item-name-link {
    color: #1a73e8;
    text-decoration: none;
}

.cart-item-name-link:hover {
    text-decoration: underline;
}

.cart-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cart-item-projects {
    font-size: 9px;
    color: #666;
    white-space: nowrap;
}

.cart-item-quantity-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quantity-btn {
    width: 16px;
    height: 16px;
    border: none;
    background: #667eea;
    color: white;
    border-radius: 2px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
    line-height: 1;
}

.quantity-btn:hover {
    background: #5568d3;
    transform: scale(1.1);
}

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

.cart-item-quantity {
    font-size: 10px;
    font-weight: 600;
    color: #333;
    min-width: 14px;
    text-align: center;
}

.projects-section {
    margin-bottom: 25px;
}

.projects-section h2 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1.3em;
}

.projects-section-header {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #e8eaff 0%, #d8daff 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    transition: background 0.2s;
    text-align: left;
    margin-bottom: 12px;
    user-select: none;
}

.projects-section-header:hover {
    background: linear-gradient(135deg, #d8daff 0%, #c8caff 100%);
}

.projects-section-header.drag-over {
    background: linear-gradient(135deg, #c8caff 0%, #b8baff 100%);
    border: 2px dashed #667eea;
    transform: scale(1.02);
}

.projects-section-header .section-name {
    color: #667eea;
}


.projects-section-header .expand-icon {
    font-size: 12px;
    color: #667eea;
    transition: transform 0.2s;
    margin-left: 10px;
    flex-shrink: 0;
}

.projects-section-content {
    padding: 0;
}

.projects-section-content.drag-over {
    border: 2px dashed #667eea;
    background: #f8f9ff;
    border-radius: 8px;
    min-height: 100px;
    transition: all 0.2s;
}

.projects-grid.drag-over {
    border: 2px dashed #667eea;
    background: #f8f9ff;
    border-radius: 8px;
    min-height: 100px;
    transition: all 0.2s;
}

.project-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.makerworld-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.makerworld-link:hover {
    background-color: rgba(102, 126, 234, 0.1);
    transform: scale(1.05);
}

.makerworld-link:active {
    transform: scale(0.98);
}

.makerworld-image {
    height: 100%;
    max-height: 44px;
    width: auto;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.makerworld-link:hover .makerworld-image {
    opacity: 0.9;
}

.project-url-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    height: 44px;
    box-sizing: border-box;
}

.project-url-input.input-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc3545' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='7' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
}

#addProjectBtn {
    height: 44px;
    padding: 0 20px;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.project-url-input:focus {
    outline: none;
    border-color: #667eea;
}

.input-error-message {
    margin-top: -6px;
    margin-bottom: 12px;
    color: #dc3545;
    font-size: 12px;
    line-height: 1.4;
    padding-left: 4px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.project-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: visible;
    z-index: 1;
    border: 2px solid transparent;
}

.project-card-all-in-stock {
    border-color: #28a745 !important;
    box-shadow: 0 0 12px rgba(40, 167, 69, 0.6), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.project-card-some-in-stock {
    border-color: #ffc107 !important;
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.6), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.project-card-none-in-stock {
    border-color: #dc3545 !important;
    box-shadow: 0 0 12px rgba(220, 53, 69, 0.6), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    z-index: 2;
}

.project-stock-indicator {
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    line-height: 1.2;
    margin: 0 auto 10px auto;
    width: fit-content;
}

.project-stock-all {
    background: #28a745;
    color: white;
}

.project-stock-partial {
    background: #dc3545;
    color: white;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.project-card.drag-over {
    border: 2px dashed #667eea;
    background: #f8f9ff;
}

.project-card.project-drag-over {
    border: 2px dashed #28a745;
    background: #f0fff4;
    transform: translateY(-2px);
}

.project-card[draggable="true"] {
    cursor: move;
}

.project-card[draggable="true"]:hover {
    cursor: move;
}

.project-card-clickable {
    cursor: pointer;
}

.just-filament-project {
    border: 2px solid #6c757d;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Remove special styling for just-filament-project .project-name - use regular project-name styling */

.project-rhyme {
    color: #28a745;
    font-weight: 500;
    font-size: 12px;
    font-style: italic;
    line-height: 1.4;
    padding: 0 5px;
    margin-top: -5px;
    margin-bottom: 10px;
    text-align: center;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-wrap: break-word;
}

.just-filament-project .project-image,
.just-filament-project .project-image-placeholder {
    display: none !important;
}

.remove-project-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.remove-project-btn:hover {
    background: #c82333;
}

.project-card-buttons {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
}

.auto-populate-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 12px;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.auto-populate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.4);
}

.auto-populate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.auto-populate-btn:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auto-populate-btn.disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    opacity: 0.7;
    cursor: pointer;
    transform: none;
}

.auto-populate-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.auto-populate-btn.disabled:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(156, 163, 175, 0.4);
}

.auto-populate-icon {
    font-size: 14px;
}

.auto-populate-text {
    font-size: 11px;
}

/* Auto Colors scrolling status indicator - inside button */
.auto-colors-status {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    justify-content: center;
}

.auto-colors-status .status-spinner-inline {
    flex-shrink: 0;
}

.status-text-container {
    height: 14px;
    overflow: hidden;
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.status-messages {
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-out;
}

.status-message {
    height: 14px;
    line-height: 14px;
    font-size: 11px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.6;
    transition: opacity 0.2s ease-out;
}

.status-message.active {
    opacity: 1;
}

@keyframes statusSlideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-message.new {
    animation: statusSlideUp 0.25s ease-out;
}

/* Suggest Alternatives Button */
.suggest-alternatives-btn {
    flex: 1 1 0;
    padding: 8px 12px;
    margin: 0;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 0;
}

.suggest-alternatives-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(40, 167, 69, 0.4);
}

.suggest-alternatives-btn:active:not(:disabled) {
    transform: translateY(0);
}

.suggest-alternatives-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.suggest-alternatives-icon {
    font-size: 14px;
}

.suggest-alternatives-text {
    font-size: 11px;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
    min-width: 0;
}

.project-alert-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 10px;
    margin: 0;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.project-alert-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(55, 65, 81, 0.18);
}

.project-alert-btn-on {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    border-color: #0f766e;
    color: white;
}

.project-alert-btn-disabled,
.project-alert-btn-locked,
.project-alert-btn-saving {
    opacity: 0.82;
}

.project-alert-text {
    font-size: 11px;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
    min-width: 0;
}

.project-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 6px;
    background: #f5f5f5;
    padding: 8px;
    margin-bottom: 10px;
}

.project-image-placeholder {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8eaff 100%);
    margin-bottom: 10px;
    font-size: 48px;
    color: #667eea;
}

.project-name {
    font-weight: 600;
    color: #000;
    font-size: 13px;
    margin-bottom: 10px;
    text-align: center;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-name a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

.project-name a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.project-filaments {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 50px;
    position: relative;
    overflow: visible;
}

.filament-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filament-section-header {
    font-size: 11px;
    font-weight: 600;
    color: #000;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    padding: 4px 0;
}

.filament-section-content {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: flex-start;
    align-content: flex-start;
    min-height: 60px;
}

.filament-section-content.drag-over {
    background: #f8f9ff;
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 4px;
}

.project-filament-thumb {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: visible;
    background: #f5f5f5;
    flex-shrink: 0;
    flex-basis: calc((100% - 12px) / 3);
    max-width: calc((100% - 12px) / 3);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 1;
}

.project-filament-thumb .filament-cart-icon {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    object-fit: contain;
    z-index: 10;
    background: transparent;
}

.purchased-checkmark-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #28a745;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    line-height: 1;
}

/* Ensure checkmark badge works in cart items too */
.cart-item .filament-image-wrapper .purchased-checkmark-badge {
    width: 18px;
    height: 18px;
    font-size: 12px;
    top: 2px;
    right: 2px;
}

.project-filament-thumb:hover {
    transform: scale(1.1);
}

.project-filament-thumb .filament-image-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    background: #f5f5f5;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
}

.project-filament-thumb .filament-image-wrapper.filament-image-in-stock {
    border-color: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.6);
}

.project-filament-thumb .filament-image-wrapper.filament-image-out-of-stock {
    border-color: #dc3545;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.6);
}

.project-filament-thumb .filament-image-wrapper.filament-image-owned {
    border-color: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.6);
}

.filament-type-label {
    position: absolute;
    top: 2px;
    left: 2px;
    color: #000;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 2px;
    z-index: 5;
    pointer-events: none;
    line-height: 1.2;
}

.project-filament-thumb .filament-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: scale(1.176);
    clip-path: polygon(25% 15%, 85% 15%, 85% 85%, 15% 85%, 15% 25%, 25% 15%);
}

.filament-stock-indicators {
    position: absolute;
    top: 2px;
    right: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    pointer-events: none;
}

.stock-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.stock-indicator.in-stock {
    background: #28a745;
}

.stock-indicator.out-of-stock {
    background: #dc3545;
}

.stock-indicator.unknown {
    background: #6c757d;
}

.filament-context-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    min-width: 140px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    isolation: isolate;
}

.filament-context-menu.hidden {
    display: none;
}

.context-menu-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #333;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    width: 100%;
}

.context-menu-btn:hover {
    background: #f5f5f5;
}

.context-menu-btn span {
    font-size: 14px;
}

.context-menu-btn.remove-filament-btn {
    color: #dc3545;
}

.context-menu-btn.remove-filament-btn:hover {
    background: #fee;
    color: #c82333;
}

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

.input-section {
    margin-bottom: 20px;
}

.input-section h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.url-input-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#urlInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

#urlInput:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    align-self: flex-start;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 6px 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    padding: 12px 24px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.filament-search-input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    height: 44px;
    box-sizing: border-box;
}

.filament-search-input:focus {
    outline: none;
    border-color: #667eea;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #666;
    font-size: 1.1em;
}

.results-section {
    margin-top: 20px;
}

.results-section h2 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1.3em;
}

.table-container {
    overflow-x: auto;
}

.filament-category-section {
    margin-bottom: 20px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

.filament-type-section {
    margin-bottom: 10px;
    margin-left: 10px;
    margin-right: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

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

.category-header {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #e8eaff 0%, #d8daff 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    transition: background 0.2s;
    text-align: left;
    position: relative;
    user-select: none;
}

.category-header:hover {
    background: linear-gradient(135deg, #d8daff 0%, #c8caff 100%);
}

.category-name {
    color: #667eea;
    white-space: nowrap;
}

.category-content {
    padding: 10px;
    background: #fafafa;
}

.type-header {
    position: relative;
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8eaff 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    transition: background 0.2s;
    text-align: left;
}

.type-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
    flex-shrink: 0;
}

.filter-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    margin-right: 4px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #667eea;
    margin: 0;
}

.filter-checkbox:hover {
    color: #333;
}

.filter-checkbox span {
    white-space: nowrap;
}

.type-header:hover {
    background: linear-gradient(135deg, #e8eaff 0%, #d8daff 100%);
}

.type-header:active {
    background: linear-gradient(135deg, #d8daff 0%, #c8caff 100%);
}

.type-name {
    color: #667eea;
    white-space: nowrap;
}

.type-stock-count {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    margin-left: auto;
    margin-right: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.expand-icon {
    font-size: 12px;
    color: #667eea;
    transition: transform 0.2s;
    margin-left: 10px;
}

.collapse-sections-btn {
    margin-left: 8px;
    margin-right: 10px;
    flex-shrink: 0;
    font-size: 12px;
}

.section-thumbnails {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    z-index: 1;
}

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

.section-thumbnail {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: white;
    border: 1px solid #e0e0e0;
    padding: 2px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: scale(1.176); /* Scale up to compensate for 15% crop (1 / 0.85 ≈ 1.176) */
    clip-path: polygon(25% 15%, 85% 15%, 85% 85%, 15% 85%, 15% 25%, 25% 15%);
    border-radius: 2px;
    display: block;
}

.type-content {
    padding: 20px;
    background: #fafafa;
}

.type-content[style*="display: none"] {
    display: none !important;
}

.filament-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.filament-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: grab;
}

.filament-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.filament-card:active {
    cursor: grabbing;
}

.filament-card.highlighted {
    animation: highlightPulse 2s ease-in-out;
    border: 3px solid #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

@keyframes highlightPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px 10px rgba(102, 126, 234, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.filament-image-wrapper {
    width: 100%;
    max-width: 150px;
    height: 150px;
    border-radius: 6px;
    background: #f5f5f5;
    padding: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filament-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: scale(1.176); /* Scale up to compensate for 15% crop (1 / 0.85 ≈ 1.176) */
    clip-path: polygon(25% 15%, 85% 15%, 85% 85%, 15% 85%, 15% 25%, 25% 15%);
}

.filament-name {
    font-weight: 600;
    color: #333;
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.3;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filament-name a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

.filament-name a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.filament-status {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.status-label {
    font-weight: 500;
    color: #666;
}

.product-name a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

.product-name a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.availability {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.availability.in-stock {
    background: #d4edda;
    color: #155724;
}

.availability.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}

.availability.loading {
    background: #fff3cd;
    color: #856404;
}

.availability.unknown {
    background: #e9ecef;
    color: #6c757d;
}

.status-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 4px;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.error-message-detail {
    margin-top: 6px;
    font-size: 0.9em;
    line-height: 1.35;
}

.error a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hidden {
    display: none;
}

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

.modal.hidden {
    display: none;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s;
}

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

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8eaff 100%);
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

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

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.about-section {
    margin-bottom: 18px;
}

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

.about-section h4 {
    margin-bottom: 8px;
    color: #111827;
    font-size: 1em;
}

.about-section p,
.about-section li {
    color: #4b5563;
    line-height: 1.5;
}

.about-section ul {
    margin-left: 20px;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: #4f46e5;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.link-button:hover {
    color: #4338ca;
}

.privacy-policy-list {
    margin-left: 20px;
    color: #4b5563;
    line-height: 1.5;
    padding-left: 8px;
}

.privacy-policy-list > li {
    margin-bottom: 16px;
}

.privacy-policy-list > li:last-child {
    margin-bottom: 0;
}

.privacy-policy-list ul {
    margin-top: 6px;
    margin-left: 18px;
}

.privacy-policy-link-row {
    margin-top: 6px;
}

.login-legal-row {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 13px;
    text-align: center;
}

#privacyPolicyModal {
    z-index: 1105;
}

.about-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.about-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 6px 12px;
    width: 150px;
    height: 36px;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.about-action-btn:hover {
    transform: translateY(-1px);
    background: #f3f4f6;
    border-color: #d1d5db;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.about-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.about-action-icon {
    height: 18px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.btn-about-discord {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.btn-about-coffee {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.btn-about-coffee .about-action-icon {
    height: 22px;
}

.modal-projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-project-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-project-item:hover:not(.already-added) {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(4px);
}

.modal-project-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    background: #f5f5f5;
    padding: 4px;
}

.modal-project-info {
    flex: 1;
}

.modal-project-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
}

.modal-project-status {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.modal-no-projects {
    padding: 40px 20px;
    text-align: center;
}

/* Settings styles */
.settings-section {
    margin-bottom: 20px;
}

.settings-section h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.settings-description {
    color: #666;
    font-size: 13px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.settings-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.settings-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.settings-input:focus {
    outline: none;
    border-color: #667eea;
}

.settings-input[readonly] {
    background: #f5f5f5;
    cursor: not-allowed;
}

.settings-help {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 13px;
}

.settings-help p {
    margin-bottom: 8px;
    color: #333;
}

.settings-help ol {
    margin-left: 20px;
    margin-bottom: 10px;
    color: #555;
}

.settings-help ol li {
    margin-bottom: 5px;
}

.settings-help a {
    color: #667eea;
    text-decoration: none;
}

.settings-help a:hover {
    text-decoration: underline;
}

.settings-warning {
    background: #fff3cd;
    border: 1px solid rgba(255, 193, 7, 0.35);
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 12px;
    border-radius: 4px;
    color: #856404;
    font-size: 12px;
}

.api-key-status {
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
}

.api-key-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.api-key-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.settings-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

/* Responsive: Hide stock count first on smaller screens */
@media (max-width: 900px) {
    .type-stock-count {
        display: none;
    }
}

/* Responsive: Hide thumbnails from right to left on smaller screens */
@media (max-width: 800px) {
    .section-thumbnail.thumbnail-5 {
        display: none;
    }
}

@media (max-width: 750px) {
    .section-thumbnail.thumbnail-4 {
        display: none;
    }
}

@media (max-width: 700px) {
    .section-thumbnail.thumbnail-3 {
        display: none;
    }
}

@media (max-width: 650px) {
    .section-thumbnail.thumbnail-2 {
        display: none;
    }
}

/* Always keep at least thumbnail-1 visible */

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2em;
        gap: 8px;
    }
    
    .header-logo {
        height: 1.2em;
    }
    
    .header-buttons {
        position: static;
        margin-top: 15px;
        justify-content: center;
        width: 100%;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 16px;
    }

    .header-actions-left,
    .header-actions-right {
        justify-content: center;
    }
    
    .login-section {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .user-menu-button {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .user-name {
        max-width: 120px;
    }

    .filament-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .filament-image {
        max-width: 120px;
        height: 120px;
    }

    .filament-name {
        font-size: 12px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
}

/* My Filament Sub-section Styles */
.my-filament-subsection {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
}

.recently-bought-subsection {
    background: #f8fff8;
    border: 2px solid #28a745;
}

.regular-filament-subsection {
    background: #f8f9ff;
    border: 2px solid #667eea;
}

.my-filament-subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.recently-bought-subsection .my-filament-subsection-header {
    border-bottom-color: rgba(40, 167, 69, 0.3);
}

.regular-filament-subsection .my-filament-subsection-header {
    border-bottom-color: rgba(102, 126, 234, 0.3);
}

.my-filament-subsection-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.recently-bought-subsection .my-filament-subsection-title {
    color: #28a745;
}

.regular-filament-subsection .my-filament-subsection-title {
    color: #667eea;
}

.move-all-btn {
    padding: 6px 14px;
    font-size: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.move-all-btn:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.move-all-btn:active {
    transform: translateY(0);
}

.my-filament-subsection-divider {
    height: 2px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
    margin: 20px 0;
}

/* My Filament styles */
.my-filament-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 10px;
    pointer-events: auto;
}

.my-filament-header-controls * {
    pointer-events: auto;
}

.cart-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 10px;
    pointer-events: auto;
}

.cart-header-controls * {
    pointer-events: auto;
}

.my-filament-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.remove-from-cart-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 1;
    transition: opacity 0.2s;
}

.my-filament-checkbox-label.disabled .remove-from-cart-icon {
    opacity: 0.5;
}

.my-filament-checkbox-label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.my-filament-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
    margin: 0;
}

.my-filament-checkbox-label.disabled input[type="checkbox"] {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Checkbox below filament image in My Filament */
.my-filament-checkbox-label-below {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    color: #666;
    cursor: pointer;
    user-select: none;
    margin-top: 4px;
    padding: 2px 0;
}

.my-filament-checkbox-label-below.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.my-filament-checkbox-label-below input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #667eea;
    margin: 0;
}

.my-filament-checkbox-label-below.disabled input[type="checkbox"] {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Horizontal checkbox layout for My Filaments */
.my-filament-checkbox-label-horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    color: #666;
    cursor: pointer;
    user-select: none;
    margin-top: 2px;
    padding: 0;
    justify-content: center;
}

.my-filament-checkbox-label-horizontal.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.my-filament-checkbox-label-horizontal input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #667eea;
    margin: 0;
    flex-shrink: 0;
}

.my-filament-checkbox-label-horizontal.disabled input[type="checkbox"] {
    cursor: not-allowed;
    opacity: 0.5;
}


.add-to-cart-label {
    font-size: 9px;
    color: #666;
    white-space: nowrap;
}

.my-filament-header-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
    margin: 0;
}

.my-filament-content {
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
    align-content: flex-start;
}

/* Make My Filament items only as wide as their content */
.my-filament-content .cart-item {
    width: auto;
    max-width: 100%;
    flex-shrink: 0;
}

/* Tile filaments horizontally within each section */
.my-filament-content .cart-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    align-items: flex-start;
    justify-content: flex-start;
}

/* Make section groups fit content and allow horizontal tiling */
.my-filament-content .cart-section-group {
    width: fit-content;
    min-width: 150px;
    max-width: 100%;
    display: inline-flex;
    flex-direction: column;
    padding: 4px;
    flex-shrink: 0;
}

.my-filament-content .cart-item-info {
    flex: 0 1 auto;
    min-width: 0;
}

.my-filament-content .cart-item-name {
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    text-overflow: clip;
}

/* My Filament quantity controls - vertical layout */
.my-filament-quantity-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quantity-vertical-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.quantity-arrow-btn {
    width: 14px;
    height: 12px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    padding: 0;
    line-height: 1;
}

.quantity-arrow-btn:hover {
    color: #333;
}

.quantity-arrow-btn:active {
    color: #000;
}

.cart-item-quantity-input {
    width: 28px;
    height: 18px;
    border: 1px solid #ddd;
    border-radius: 2px;
    background: white;
    font-size: 10px;
    font-weight: 600;
    color: #333;
    text-align: center;
    padding: 0;
    margin: 0;
    appearance: textfield;
    -moz-appearance: textfield;
}

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

.cart-item-quantity-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 1px #667eea;
}

/* ========================================
   Alternatives Modal Styles
   ======================================== */

.alternatives-modal-content {
    max-width: 90%;
    width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.alternatives-modal-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    padding: 20px;
    border-bottom: none;
}

.alternatives-modal-header h3 {
    color: white;
    margin: 0;
}

.alternatives-close-btn {
    color: white;
    font-size: 28px;
    width: 36px;
    height: 36px;
    background: rgba(220, 53, 69, 0.9);
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s;
}

.alternatives-close-btn:hover {
    background: #dc3545;
    transform: scale(1.1);
}

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

.alternatives-modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    background: #f8f9fa;
}

.alternatives-accept-btn {
    padding: 14px 48px;
    font-size: 16px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.alternatives-accept-btn:hover {
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

/* Alternatives Row - one row per out-of-stock filament */
.alternatives-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.alternatives-original {
    flex-shrink: 0;
    width: 120px;
}

.alternatives-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 35px;
}

.alternatives-list {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

/* Filament Card in Alternatives Modal */
.alternatives-filament-card {
    width: 100px;
    background: white;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: 3px solid transparent;
}

.alternatives-filament-card.out-of-stock-card {
    cursor: default;
    width: 100%;
}

.alternatives-filament-card.alternative-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.alternatives-filament-card.selected {
    border-color: #28a745;
    box-shadow: 0 0 12px rgba(40, 167, 69, 0.4);
}

.alternatives-filament-card.best-match {
    background: linear-gradient(135deg, #fff 0%, #e8f5e9 100%);
}

/* Badge on cards */
.alternatives-card-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    z-index: 5;
}

.out-of-stock-badge {
    background: #dc3545;
    color: white;
}

.best-match-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

/* Image wrapper in alternatives modal */
.alternatives-image-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    background: #f5f5f5;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    border: 2px solid transparent;
}

.alternatives-image-wrapper.in-stock {
    border-color: #28a745;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.4);
}

.out-of-stock-card .alternatives-image-wrapper {
    border-color: #dc3545;
    box-shadow: 0 0 6px rgba(220, 53, 69, 0.4);
}

.alternatives-filament-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: scale(1.176);
    clip-path: polygon(25% 15%, 85% 15%, 85% 85%, 15% 85%, 15% 25%, 25% 15%);
}

.alternatives-filament-name {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin-bottom: 4px;
    min-height: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.alternatives-filament-type {
    font-size: 10px;
    font-weight: 700;
    color: #555;
    letter-spacing: 0.5px;
}

.alternatives-filament-color {
    font-size: 11px;
    font-weight: 600;
    color: #333;
}

.alternatives-stock-info {
    font-size: 9px;
    color: #28a745;
    font-weight: 500;
}

.no-alternatives {
    color: #666;
    font-style: italic;
    padding: 20px;
    text-align: center;
    width: 100%;
}

/* Responsive adjustments for alternatives modal */
@media (max-width: 768px) {
    .alternatives-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .alternatives-row {
        flex-direction: column;
        align-items: center;
    }
    
    .alternatives-original {
        width: auto;
    }
    
    .alternatives-arrow {
        padding-top: 0;
        transform: rotate(90deg);
    }
    
    .alternatives-list {
        justify-content: center;
    }
    
    .alternatives-filament-card {
        width: 85px;
    }
    
    .alternatives-image-wrapper {
        width: 65px;
        height: 65px;
    }
}

/* 2026 UI refresh */
:root {
    --ui-bg: #eef4ef;
    --ui-bg-warm: #faf5ee;
    --ui-surface: rgba(255, 255, 255, 0.8);
    --ui-surface-strong: rgba(255, 255, 255, 0.94);
    --ui-surface-muted: rgba(247, 250, 252, 0.9);
    --ui-ink: #162027;
    --ui-text: #25323a;
    --ui-muted: #657581;
    --ui-muted-strong: #4d5d68;
    --ui-line: rgba(22, 32, 39, 0.08);
    --ui-line-strong: rgba(22, 32, 39, 0.14);
    --ui-accent: #2f6df6;
    --ui-accent-deep: #224fd6;
    --ui-accent-soft: rgba(47, 109, 246, 0.1);
    --ui-brand: #17a76f;
    --ui-brand-deep: #11865a;
    --ui-brand-soft: rgba(23, 167, 111, 0.12);
    --ui-gold: #f0aa3c;
    --ui-gold-soft: rgba(240, 170, 60, 0.16);
    --ui-danger: #de5b5b;
    --ui-danger-soft: rgba(222, 91, 91, 0.14);
    --ui-warning: #c98007;
    --ui-shadow-lg: 0 32px 90px rgba(20, 30, 40, 0.14);
    --ui-shadow-md: 0 18px 44px rgba(20, 30, 40, 0.1);
    --ui-shadow-sm: 0 12px 28px rgba(20, 30, 40, 0.06);
}

body {
    font-family: 'Manrope', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(23, 167, 111, 0.16), transparent 24%),
        radial-gradient(circle at top right, rgba(47, 109, 246, 0.16), transparent 28%),
        linear-gradient(180deg, var(--ui-bg) 0%, var(--ui-bg-warm) 48%, #edf3ff 100%);
    min-height: 100vh;
    padding: 24px 14px 36px;
    color: var(--ui-text);
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: 0;
    filter: blur(20px);
}

body::before {
    top: -120px;
    left: -100px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(23, 167, 111, 0.24) 0%, transparent 68%);
}

body::after {
    right: -110px;
    bottom: -120px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(47, 109, 246, 0.2) 0%, transparent 68%);
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1460px;
    margin: 0 auto;
    padding: 24px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(248, 250, 252, 0.82) 100%);
    backdrop-filter: blur(16px);
    box-shadow: var(--ui-shadow-lg);
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 0%, rgba(23, 167, 111, 0.06), transparent 28%),
        radial-gradient(circle at 100% 10%, rgba(47, 109, 246, 0.06), transparent 26%);
    pointer-events: none;
}

header,
.cart-section,
.projects-section,
.results-section {
    position: relative;
    border: 1px solid var(--ui-line);
    border-radius: 22px;
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
    backdrop-filter: blur(12px);
    animation: surface-reveal 0.55s ease both;
}

@keyframes surface-reveal {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    z-index: 20;
    margin-bottom: 20px;
    padding: 18px 24px;
    border-bottom: none;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 250, 248, 0.84) 100%);
    overflow: visible;
}

.header-topline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
}

.header-brand {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

header::before {
    content: '';
    position: absolute;
    right: -36px;
    bottom: -60px;
    width: 240px;
    height: 180px;
    background: radial-gradient(circle, rgba(47, 109, 246, 0.16) 0%, transparent 70%);
    pointer-events: none;
}

header::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(22, 32, 39, 0.12), transparent);
}

header h1 {
    position: relative;
    width: auto;
    justify-content: center;
    text-align: center;
    font-size: clamp(1.85rem, 3vw, 2.75rem);
    letter-spacing: -0.04em;
    color: var(--ui-ink);
    margin-bottom: 0;
}

.header-logo {
    height: 1.08em;
}

header p {
    position: relative;
    max-width: none;
    margin: 0;
    text-align: center;
    color: var(--ui-muted);
    font-size: 0.95rem;
    line-height: 1.42;
}

.header-actions-left,
.header-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.header-actions-right {
    justify-content: flex-end;
}

.btn-icon,
a.btn-icon,
button.btn-icon,
.user-menu-button,
.btn-login {
    min-height: 40px;
    border-radius: 14px;
    border: 1px solid var(--ui-line);
    background: rgba(255, 255, 255, 0.82);
    color: var(--ui-muted-strong);
    box-shadow: 0 8px 18px rgba(20, 30, 40, 0.06);
}

.btn-icon:hover,
.user-menu-button:hover {
    background: rgba(255, 255, 255, 0.98);
    border-color: var(--ui-line-strong);
    color: var(--ui-ink);
    box-shadow: 0 14px 24px rgba(20, 30, 40, 0.1);
}

#aboutBtn,
#feedbackBtn,
#coffeeBtn {
    width: 40px;
    height: 40px;
    padding: 6px;
}

.btn-login,
.btn-primary {
    background: linear-gradient(135deg, #132029 0%, #24515e 100%);
    color: #fff;
    border-color: rgba(19, 32, 41, 0.3);
    box-shadow: 0 16px 26px rgba(19, 32, 41, 0.16);
}

.btn-login:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, #162833 0%, #2c6170 100%);
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(19, 32, 41, 0.22);
}

.btn-login:active,
.btn-primary:active {
    transform: translateY(0);
}

.btn-primary {
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.btn-secondary {
    min-height: 34px;
    padding: 8px 12px;
    border: 1px solid var(--ui-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ui-muted-strong);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 8px 18px rgba(20, 30, 40, 0.06);
}

.btn-secondary:hover {
    background: #fff;
    color: var(--ui-ink);
    border-color: var(--ui-line-strong);
}

.btn-danger {
    background: linear-gradient(135deg, #d74d58 0%, #b93b45 100%);
    border-color: rgba(185, 59, 69, 0.3);
    box-shadow: 0 16px 26px rgba(185, 59, 69, 0.18);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c9414c 0%, #a8343d 100%);
}

.user-menu-button {
    padding: 5px 10px 5px 5px;
}

.user-avatar,
.user-avatar-large {
    background: linear-gradient(135deg, var(--ui-accent) 0%, var(--ui-brand) 100%);
}

.user-name,
.user-name-large {
    color: var(--ui-ink);
}

.user-email,
.user-menu-chevron {
    color: var(--ui-muted);
}

.user-menu-dropdown {
    top: calc(100% + 10px);
    border: 1px solid var(--ui-line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    box-shadow: var(--ui-shadow-md);
}

.user-menu-header {
    background: linear-gradient(135deg, rgba(47, 109, 246, 0.08) 0%, rgba(23, 167, 111, 0.08) 100%);
}

.user-menu-divider {
    background: var(--ui-line);
}

.user-menu-item {
    color: var(--ui-text);
}

.user-menu-item:hover {
    background: rgba(47, 109, 246, 0.06);
    color: var(--ui-ink);
}

.cart-section,
.projects-section,
.results-section {
    margin-bottom: 18px;
    padding: 18px;
}

.compact-section {
    padding: 10px;
    border-radius: 18px;
}

.compact-section .projects-section-header {
    min-height: 48px;
}

.compact-section .projects-section-content {
    margin-top: 8px;
}

.projects-section-primary {
    padding: 18px;
}

.cart-section {
    min-height: 0;
}

.projects-section h2,
.results-section h2 {
    margin-bottom: 12px;
    color: var(--ui-muted);
    font-family: 'Manrope', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.projects-section-header,
.category-header,
.type-header {
    width: 100%;
    min-height: 54px;
    padding: 12px 14px;
    margin-bottom: 0;
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(47, 109, 246, 0.08) 0%, rgba(23, 167, 111, 0.06) 100%);
    color: var(--ui-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.projects-section-header:hover,
.category-header:hover,
.type-header:hover {
    transform: translateY(-1px);
    border-color: var(--ui-line-strong);
    background: linear-gradient(135deg, rgba(47, 109, 246, 0.12) 0%, rgba(23, 167, 111, 0.09) 100%);
    box-shadow: 0 12px 24px rgba(20, 30, 40, 0.08);
}

.projects-section-header .section-name,
.category-name,
.type-name,
.cart-section-name,
.my-filament-subsection-title {
    font-family: 'Manrope', sans-serif;
    color: var(--ui-ink);
    letter-spacing: -0.02em;
}

.projects-section-header .section-name,
.category-name,
.type-name {
    font-size: 1rem;
}

.projects-section-header .expand-icon,
.category-header .expand-icon,
.type-header .expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 0;
    border: 1px solid rgba(47, 109, 246, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--ui-accent-deep);
    font-size: 0.72rem;
}

.projects-section-header[aria-expanded="false"] .expand-icon,
.category-header[aria-expanded="false"] .expand-icon,
.type-header[aria-expanded="false"] .expand-icon {
    transform: rotate(-90deg);
}

.projects-section-content {
    margin-top: 10px;
}

.projects-section-content.drag-over,
.projects-grid.drag-over,
.project-card.drag-over,
.project-card.project-drag-over,
.filament-section-content.drag-over,
.cart-section.drag-over .projects-section-content {
    border-radius: 16px;
    border: 1px dashed rgba(47, 109, 246, 0.45);
    background: linear-gradient(135deg, rgba(47, 109, 246, 0.08) 0%, rgba(23, 167, 111, 0.08) 100%);
}

.project-input-container {
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px;
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.9);
}

.makerworld-link {
    width: 44px;
    height: 44px;
    padding: 8px;
    border: 1px solid var(--ui-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
}

.makerworld-link:hover {
    background-color: rgba(255, 255, 255, 1);
    border-color: var(--ui-line-strong);
    transform: translateY(-1px);
}

.makerworld-image {
    max-height: 100%;
}

.project-url-input,
.filament-search-input,
.settings-input,
#urlInput {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--ui-text);
    font-family: 'Manrope', sans-serif;
    font-size: 0.96rem;
    box-shadow: inset 0 1px 2px rgba(20, 30, 40, 0.04);
}

.project-url-input:focus,
.filament-search-input:focus,
.settings-input:focus,
#urlInput:focus {
    outline: none;
    border-color: rgba(47, 109, 246, 0.5);
    box-shadow: 0 0 0 5px rgba(47, 109, 246, 0.12);
}

.input-error-message {
    padding-left: 4px;
    color: var(--ui-danger);
}

.projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.project-card {
    min-height: 0;
    padding: 14px;
    border: 2px solid transparent;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.92) 100%);
    box-shadow: 0 12px 22px rgba(20, 30, 40, 0.05);
    overflow: hidden;
}

.project-card::before {
    content: none;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(20, 30, 40, 0.08);
}

.project-card-all-in-stock {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 1px rgba(40, 167, 69, 0.12), 0 0 14px rgba(40, 167, 69, 0.28), 0 12px 22px rgba(20, 30, 40, 0.05);
}

.project-card-some-in-stock {
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.12), 0 0 14px rgba(255, 193, 7, 0.26), 0 12px 22px rgba(20, 30, 40, 0.05);
}

.project-card-none-in-stock {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.12), 0 0 14px rgba(220, 53, 69, 0.28), 0 12px 22px rgba(20, 30, 40, 0.05);
}

.project-card-all-in-stock::before {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.78), rgba(40, 167, 69, 0.2));
}

.project-card-some-in-stock::before {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.82), rgba(255, 193, 7, 0.22));
}

.project-card-none-in-stock::before {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.78), rgba(220, 53, 69, 0.2));
}

.just-filament-project {
    border-color: rgba(22, 32, 39, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 248, 0.92) 100%);
}

.project-name {
    min-height: 38px;
    margin-bottom: 10px;
    align-items: flex-start;
    justify-content: flex-start;
    color: var(--ui-ink);
    font-size: 0.92rem;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    overflow: visible;
}

.project-name a {
    color: var(--ui-ink);
    white-space: normal;
    line-height: 1.35;
}

.project-name a:hover {
    color: var(--ui-accent-deep);
}

.project-rhyme {
    margin-top: -2px;
    margin-bottom: 8px;
    padding: 0;
    color: var(--ui-brand-deep);
    font-size: 0.74rem;
    text-align: left;
}

.project-image,
.project-image-placeholder {
    width: 100%;
    height: 132px;
    margin-bottom: 10px;
    border-radius: 14px;
}

.project-image {
    padding: 8px;
    background: linear-gradient(145deg, #f5f7fb 0%, #edf3ef 100%);
}

.project-image-placeholder {
    background: linear-gradient(145deg, rgba(47, 109, 246, 0.14) 0%, rgba(23, 167, 111, 0.16) 100%);
    color: var(--ui-accent);
}

.project-filaments {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(22, 32, 39, 0.08);
    gap: 10px;
}

.filament-section {
    padding: 10px;
    border: 1px solid rgba(22, 32, 39, 0.05);
    border-radius: 14px;
    background: rgba(246, 248, 250, 0.85);
}

.filament-section-header {
    color: var(--ui-muted);
    font-family: 'Manrope', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.filament-section-content {
    min-height: 0;
    justify-content: flex-start;
    gap: 6px;
}

.project-filament-thumb {
    width: 60px;
    height: 60px;
    flex-basis: auto;
    max-width: none;
    border-radius: 14px;
    background: linear-gradient(145deg, #f7fafc 0%, #edf1f6 100%);
}

.project-filament-thumb:hover {
    transform: translateY(-2px) scale(1.03);
}

.project-filament-thumb .filament-image-wrapper {
    border-radius: 12px;
}

.filament-type-label {
    top: 4px;
    left: 4px;
    border: 1px solid rgba(22, 32, 39, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--ui-ink);
    font-family: 'Manrope', sans-serif;
    font-size: 0.45rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stock-indicator {
    width: 18px;
    height: 18px;
    box-shadow: 0 8px 12px rgba(20, 30, 40, 0.14);
}

.project-card-buttons {
    gap: 8px;
    padding-top: 10px;
}

.auto-populate-btn,
.suggest-alternatives-btn,
.project-alert-btn {
    min-height: 38px;
    border-radius: 12px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 14px 22px rgba(20, 30, 40, 0.12);
}

.auto-populate-btn {
    background: linear-gradient(135deg, #2f6df6 0%, #2297f0 100%);
}

.auto-populate-btn:hover:not(:disabled),
.auto-populate-btn.disabled:hover {
    box-shadow: 0 18px 26px rgba(47, 109, 246, 0.24);
}

.suggest-alternatives-btn {
    background: linear-gradient(135deg, #18a66f 0%, #118e90 100%);
}

.suggest-alternatives-btn:hover:not(:disabled) {
    box-shadow: 0 18px 26px rgba(23, 167, 111, 0.24);
}

.project-alert-btn {
    box-shadow: 0 14px 22px rgba(20, 30, 40, 0.1);
    letter-spacing: 0;
}

.project-alert-btn-on {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}

.project-alert-btn:hover {
    box-shadow: 0 18px 26px rgba(15, 118, 110, 0.2);
}

.empty-surface-message,
.no-alternatives {
    border: 1px dashed rgba(22, 32, 39, 0.16);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(247, 250, 252, 0.9) 100%);
    color: var(--ui-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.no-alternatives {
    padding: 12px;
}

.empty-surface-message {
    width: 100%;
    padding: 12px;
    text-align: center;
}

.empty-surface-message.compact {
    padding: 10px;
}

.cart-section .projects-section-content {
    padding: 12px;
    border: 1px solid var(--ui-line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.88) 0%, rgba(244, 250, 248, 0.92) 100%);
}

.bulk-discount-progress {
    margin-bottom: 10px;
    gap: 12px;
    padding: 12px 14px 8px;
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--ui-shadow-sm);
}

.bulk-discount-label-header {
    padding-top: 0;
    color: var(--ui-muted);
    font-family: 'Manrope', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bulk-discount-track-wrapper {
    margin-top: 4px;
    margin-bottom: 24px;
}

.bulk-discount-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(22, 32, 39, 0.08);
}

.bulk-discount-progress-fill {
    background: linear-gradient(90deg, var(--ui-accent) 0%, var(--ui-brand) 100%);
    border-radius: 999px;
    box-shadow: 0 10px 18px rgba(47, 109, 246, 0.24);
}

.bulk-discount-marker-circle {
    width: 16px;
    height: 16px;
    background: #fff;
    border-color: rgba(22, 32, 39, 0.22);
    box-shadow: 0 8px 16px rgba(20, 30, 40, 0.12);
}

.bulk-discount-marker-circle.reached {
    background: var(--ui-ink);
    border-color: var(--ui-ink);
}

.bulk-discount-label {
    top: 18px;
    color: var(--ui-muted);
    font-size: 0.68rem;
}

.cart-content,
.my-filament-content {
    gap: 10px;
}

.cart-section-group {
    min-width: 200px;
    padding: 8px;
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 22px rgba(20, 30, 40, 0.05);
}

.cart-section-header {
    margin-bottom: 8px;
    padding: 2px 4px 8px;
    border-bottom: 1px solid rgba(22, 32, 39, 0.08);
}

.cart-section-name {
    color: var(--ui-ink);
    font-size: 0.86rem;
}

.cart-section-count,
.type-stock-count {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ui-muted-strong);
    font-size: 0.72rem;
    font-weight: 700;
}

.cart-grid {
    gap: 8px;
}

.cart-item {
    min-height: 74px;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid rgba(22, 32, 39, 0.08);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fafb 100%);
    box-shadow: none;
}

.cart-item-card {
    width: 152px;
    min-height: 0;
    padding: 5px 5px 3px;
    justify-content: center;
    gap: 0;
}

.cart-item .filament-image-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(145deg, #f6f8fb 0%, #edf2f6 100%);
}

.cart-item-info {
    gap: 4px;
}

.cart-item-card-info {
    width: 100%;
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
}

.cart-item-card-body {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.cart-item-name {
    color: var(--ui-ink);
    font-size: 0.72rem;
    line-height: 1.22;
    white-space: normal;
}

.cart-item-card-title {
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.86rem;
    line-height: 1.04;
}

.cart-item-name-link {
    color: var(--ui-ink);
}

.cart-item-name-link:hover {
    color: var(--ui-accent-deep);
}

.cart-item-visual {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.cart-item-card-body .cart-item-visual {
    width: auto;
    flex: 0 0 auto;
}

.cart-item-card .filament-image-wrapper {
    width: 74px;
    height: 74px;
    border-radius: 14px;
}

.cart-item-meta,
.my-filament-quantity-controls {
    gap: 6px;
}

.cart-item-footer {
    width: 100%;
    justify-content: center;
}

.cart-item-card-body .cart-item-footer {
    width: auto;
    justify-content: center;
    align-items: center;
}

.cart-item-quantity-controls-horizontal {
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.cart-item-quantity-controls-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

.quantity-arrow-btn {
    width: 18px;
    height: 14px;
    border-radius: 999px;
    background: rgba(22, 32, 39, 0.08);
    color: var(--ui-muted-strong);
}

.quantity-arrow-btn:hover {
    background: rgba(47, 109, 246, 0.12);
    color: var(--ui-accent-deep);
}

.cart-item-card .quantity-arrow-btn {
    width: 23px;
    height: 23px;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1;
}

.cart-item-card .cart-item-quantity-controls-vertical .quantity-arrow-btn {
    width: 18px;
    height: 14px;
    font-size: 8px;
    font-weight: 400;
}

.cart-item-quantity-input {
    width: 32px;
    height: 22px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 8px;
    color: var(--ui-ink);
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.96);
}

.cart-item-card .cart-item-quantity-input {
    width: 36px;
    height: 28px;
    border-radius: 9px;
    font-size: 0.86rem;
    font-weight: 700;
}

.cart-item-card .cart-item-quantity-controls-vertical .cart-item-quantity-input {
    width: 32px;
    height: 22px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
}

.cart-item-quantity-input:focus {
    border-color: rgba(47, 109, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.12);
}

.my-filament-subsection {
    padding: 10px;
    border-radius: 16px;
    border-width: 1px;
}

.recently-bought-subsection {
    background: linear-gradient(180deg, rgba(23, 167, 111, 0.08) 0%, rgba(255, 255, 255, 0.78) 100%);
    border-color: rgba(23, 167, 111, 0.18);
}

.regular-filament-subsection {
    background: linear-gradient(180deg, rgba(47, 109, 246, 0.07) 0%, rgba(255, 255, 255, 0.78) 100%);
    border-color: rgba(47, 109, 246, 0.16);
}

.my-filament-subsection-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(22, 32, 39, 0.08);
}

.my-filament-subsection-title {
    font-size: 0.98rem;
}

.move-all-btn {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--ui-brand) 0%, #0f8c93 100%);
    box-shadow: 0 12px 20px rgba(23, 167, 111, 0.18);
}

.move-all-btn:hover {
    box-shadow: 0 16px 24px rgba(23, 167, 111, 0.24);
}

.my-filament-checkbox-label,
.my-filament-checkbox-label-horizontal,
.filter-checkbox {
    color: var(--ui-muted);
}

.my-filament-checkbox-label input[type="checkbox"],
.my-filament-checkbox-label-horizontal input[type="checkbox"],
.my-filament-header-checkbox,
.filter-checkbox input[type="checkbox"] {
    accent-color: var(--ui-accent);
}

.results-toolbar {
    display: grid;
    grid-template-columns: auto minmax(240px, 420px) auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.results-heading {
    margin: 0;
}

.results-search {
    display: flex;
    justify-content: center;
}

.results-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.results-timestamp {
    margin-bottom: 12px;
    padding-left: 4px;
    color: var(--ui-muted);
    font-size: 0.82rem;
}

.table-container {
    overflow: visible;
}

.filament-category-section {
    margin-bottom: 14px;
    border: 1px solid var(--ui-line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 28px rgba(20, 30, 40, 0.05);
}

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

.category-header {
    border-radius: 18px 18px 0 0;
    font-size: 1rem;
}

.category-content {
    padding: 10px;
    background: transparent;
}

.filament-type-section {
    margin: 0 0 10px;
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.88);
}

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

.type-header {
    gap: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px 16px 0 0;
    box-shadow: none;
}

.type-filters {
    gap: 8px;
    margin-right: 0;
    padding: 4px 8px;
    border: 1px solid var(--ui-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
}

.type-content {
    padding: 12px;
    background: transparent;
}

.section-thumbnails {
    gap: 8px;
}

.section-thumbnail {
    width: 30px;
    height: 30px;
    border: 1px solid var(--ui-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 16px rgba(20, 30, 40, 0.06);
}

.filament-grid {
    grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
    gap: 12px;
    padding: 0;
}

.filament-card {
    align-items: flex-start;
    padding: 12px;
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    text-align: left;
    box-shadow: 0 14px 24px rgba(20, 30, 40, 0.04);
}

.filament-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 28px rgba(20, 30, 40, 0.08);
}

.filament-card.highlighted {
    border-width: 2px;
    border-color: rgba(47, 109, 246, 0.45);
    box-shadow: 0 0 0 10px rgba(47, 109, 246, 0.08);
}

.filament-image-wrapper,
.filament-card > .filament-image:not(.cart-thumb) {
    width: 100%;
    max-width: none;
    height: 138px;
    margin-bottom: 10px;
    border-radius: 14px;
    background: linear-gradient(145deg, #f6f8fb 0%, #edf3ef 100%);
}

.filament-card > .filament-image:not(.cart-thumb) {
    display: block;
    padding: 0;
}

.filament-name {
    min-height: 30px;
    margin-bottom: 8px;
    align-items: flex-start;
    justify-content: flex-start;
    color: var(--ui-ink);
    font-size: 0.84rem;
    text-align: left;
}

.filament-name a {
    color: var(--ui-ink);
}

.filament-name a:hover {
    color: var(--ui-accent-deep);
}

.filament-name-error {
    color: var(--ui-danger);
}

.filament-status {
    gap: 6px;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid rgba(22, 32, 39, 0.06);
}

.status-item {
    gap: 12px;
}

.status-label {
    color: var(--ui-muted);
    font-family: 'Manrope', sans-serif;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.availability {
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.availability.in-stock {
    background: var(--ui-brand-soft);
    color: var(--ui-brand-deep);
}

.availability.out-of-stock {
    background: var(--ui-danger-soft);
    color: #b33c3c;
}

.availability.loading {
    background: rgba(240, 170, 60, 0.16);
    color: var(--ui-warning);
}

.availability.unknown {
    background: rgba(22, 32, 39, 0.08);
    color: var(--ui-muted);
}

.loading {
    padding: 20px;
    border: 1px solid var(--ui-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--ui-shadow-sm);
}

.spinner {
    border-width: 5px;
    border-color: rgba(22, 32, 39, 0.08);
    border-top-color: var(--ui-accent);
}

.loading p {
    color: var(--ui-muted);
}

.error {
    margin-top: 20px;
    border: 1px solid rgba(222, 91, 91, 0.18);
    border-left: none;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(222, 91, 91, 0.12) 0%, rgba(255, 255, 255, 0.92) 100%);
    color: #9e3131;
}

.modal {
    padding: 24px;
    background: rgba(14, 22, 28, 0.42);
    backdrop-filter: blur(12px);
}

.modal-content,
.alternatives-modal-content {
    width: min(92vw, 680px);
    max-height: 86vh;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--ui-shadow-lg);
    backdrop-filter: blur(18px);
}

.modal-content-compact {
    width: min(92vw, 560px);
}

.modal-header,
.alternatives-modal-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--ui-line);
    background: linear-gradient(135deg, rgba(47, 109, 246, 0.08) 0%, rgba(23, 167, 111, 0.08) 100%);
}

.modal-header h3,
.alternatives-modal-header h3 {
    color: var(--ui-ink);
    font-family: 'Manrope', sans-serif;
    font-size: 1.08rem;
}

.modal-close,
.alternatives-close-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--ui-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--ui-muted-strong);
}

.modal-close:hover,
.alternatives-close-btn:hover {
    background: #fff;
    color: var(--ui-ink);
}

.modal-body,
.alternatives-modal-body {
    padding: 18px;
}

.about-section h4,
.settings-section h4 {
    color: var(--ui-ink);
}

.about-section p,
.about-section li,
.settings-description,
.privacy-policy-list,
.privacy-policy-list li,
.modal-project-status {
    color: var(--ui-muted);
}

.about-action-btn {
    border: 1px solid var(--ui-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 20px rgba(20, 30, 40, 0.06);
}

.about-action-btn:hover {
    background: #fff;
}

.link-button,
.settings-help a {
    color: var(--ui-accent-deep);
}

.settings-warning,
.settings-help,
.api-key-status,
.modal-project-item,
.modal-filament-info,
.alternatives-row,
.alternatives-modal-footer {
    border: 1px solid var(--ui-line);
    border-radius: 14px;
}

.settings-warning {
    margin-top: 10px;
    padding: 10px 12px;
    border-left: none;
    background: rgba(240, 170, 60, 0.14);
    color: #8a5c00;
}

.settings-warning-danger {
    color: #a13232;
    background: rgba(222, 91, 91, 0.12);
}

.settings-help {
    background: rgba(247, 250, 252, 0.86);
}

.settings-input-group {
    gap: 12px;
}

.api-key-status.success {
    background: rgba(23, 167, 111, 0.12);
    color: var(--ui-brand-deep);
    border-color: rgba(23, 167, 111, 0.2);
}

.api-key-status.error {
    background: rgba(222, 91, 91, 0.12);
    color: #a13232;
    border-color: rgba(222, 91, 91, 0.18);
}

.settings-section-divider {
    border-top: 1px solid var(--ui-line);
    margin-top: 24px;
    padding-top: 24px;
}

.settings-title-danger,
.delete-modal-title,
.modal-project-name-danger {
    color: var(--ui-danger) !important;
}

.settings-danger-button {
    margin-top: 16px;
}

.delete-modal-copy,
.delete-modal-warning {
    margin-bottom: 16px;
}

.delete-modal-list {
    margin-left: 22px;
    margin-bottom: 18px;
    color: var(--ui-muted);
}

.delete-modal-warning {
    color: var(--ui-danger);
    font-weight: 700;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-filament-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: rgba(247, 250, 252, 0.86);
}

.modal-filament-preview {
    width: 64px !important;
    height: 64px !important;
    flex-shrink: 0;
}

.modal-filament-title {
    margin: 0;
    color: var(--ui-ink);
    font-weight: 700;
}

.modal-no-projects {
    color: var(--ui-muted);
    font-style: italic;
    text-align: center;
    padding: 22px;
}

.modal-project-item {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.84);
}

.modal-project-item:hover:not(.already-added) {
    background: rgba(47, 109, 246, 0.06);
    border-color: rgba(47, 109, 246, 0.18);
    transform: translateX(0);
}

.modal-project-name {
    color: var(--ui-ink);
}

.alternatives-modal-content {
    width: min(94vw, 980px);
}

.alternatives-row {
    background: rgba(247, 250, 252, 0.84);
}

.alternatives-modal-footer {
    background: rgba(247, 250, 252, 0.86);
}

.alternatives-accept-btn {
    min-height: 42px;
}

.alternatives-filament-card {
    border-width: 1px;
    border-color: var(--ui-line);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff 0%, #f7fafc 100%);
    box-shadow: 0 12px 22px rgba(20, 30, 40, 0.05);
}

.alternatives-filament-card.selected {
    border-color: rgba(23, 167, 111, 0.3);
}

.alternatives-filament-card.best-match {
    background: linear-gradient(145deg, rgba(23, 167, 111, 0.1) 0%, #fff 100%);
}

.alternatives-image-wrapper {
    background: linear-gradient(145deg, #f6f8fb 0%, #edf3ef 100%);
}

code {
    padding: 0.18em 0.45em;
    border-radius: 8px;
    background: rgba(22, 32, 39, 0.08);
    color: var(--ui-ink);
    font-size: 0.9em;
}

@media (max-width: 1180px) {
    .results-toolbar {
        grid-template-columns: 1fr;
    }

    .results-search,
    .results-actions {
        justify-content: stretch;
    }

    .results-actions {
        justify-content: flex-start;
    }

    .type-stock-count {
        margin-left: 0;
    }
}

@media (max-width: 900px) {
    .container {
        padding: 18px;
        border-radius: 24px;
    }

    header {
        padding: 18px 20px 16px;
    }

    .header-topline {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .header-brand {
        grid-row: 1;
    }

    .header-actions-left,
    .header-actions-right {
        justify-content: center;
        flex-wrap: wrap;
    }

    .compact-section {
        padding: 8px;
    }

    .project-input-container {
        flex-wrap: wrap;
    }

    .btn-primary {
        width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding: 14px 10px 28px;
    }

    .container {
        padding: 14px;
        border-radius: 20px;
    }

    header {
        padding: 16px 16px 14px;
    }

    .header-actions-left,
    .header-actions-right {
        width: auto;
        justify-content: center;
        border-radius: 0;
    }

    header h1 {
        font-size: 1.9rem;
        line-height: 1.1;
    }

    .cart-section,
    .projects-section,
    .results-section {
        padding: 14px;
        border-radius: 18px;
    }

    .project-input-container {
        padding: 10px;
    }

    .projects-grid,
    .filament-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .project-card {
        min-height: 0;
    }

    .project-image,
    .project-image-placeholder,
    .filament-image-wrapper,
    .filament-card > .filament-image:not(.cart-thumb) {
        height: 120px;
    }

    .filament-card {
        padding: 12px;
    }

    .cart-section-group,
    .my-filament-content .cart-section-group {
        width: 100%;
        min-width: 0;
    }

    .cart-item,
    .my-filament-item {
        width: 100%;
    }

    .type-header,
    .category-header,
    .projects-section-header {
        min-height: 0;
        padding: 12px;
        flex-wrap: wrap;
    }

    .type-filters {
        order: 4;
        width: 100%;
        justify-content: flex-start;
    }

    .modal,
    .modal-content,
    .alternatives-modal-content {
        padding: 12px;
    }

    .modal-body,
    .alternatives-modal-body,
    .alternatives-modal-footer {
        padding: 14px;
    }
}

@media (max-width: 560px) {
    .projects-grid,
    .filament-grid {
        grid-template-columns: 1fr;
    }

    .results-toolbar {
        gap: 12px;
    }

    .confirm-actions {
        flex-direction: column;
    }

    .confirm-actions .btn-secondary,
    .confirm-actions .btn-danger,
    .results-actions .btn-secondary {
        width: 100%;
    }
}

html[data-theme="dark"] {
    color-scheme: dark;
    --ui-bg: #0d1318;
    --ui-bg-warm: #121a21;
    --ui-surface: rgba(18, 25, 32, 0.82);
    --ui-surface-strong: rgba(15, 22, 29, 0.96);
    --ui-surface-muted: rgba(21, 29, 37, 0.92);
    --ui-ink: #edf4fb;
    --ui-text: #d6dfe7;
    --ui-muted: #93a4b1;
    --ui-muted-strong: #c5d0d8;
    --ui-line: rgba(148, 163, 184, 0.16);
    --ui-line-strong: rgba(148, 163, 184, 0.3);
    --ui-accent: #7eb1ff;
    --ui-accent-deep: #bfd9ff;
    --ui-accent-soft: rgba(126, 177, 255, 0.18);
    --ui-brand: #4dcc93;
    --ui-brand-deep: #9ce6c1;
    --ui-brand-soft: rgba(77, 204, 147, 0.18);
    --ui-gold: #f0bd61;
    --ui-gold-soft: rgba(240, 189, 97, 0.2);
    --ui-danger: #ff9898;
    --ui-danger-soft: rgba(255, 152, 152, 0.18);
    --ui-warning: #f0c96a;
    --ui-shadow-lg: 0 40px 96px rgba(0, 0, 0, 0.46);
    --ui-shadow-md: 0 20px 48px rgba(0, 0, 0, 0.34);
    --ui-shadow-sm: 0 12px 30px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(77, 204, 147, 0.12), transparent 24%),
        radial-gradient(circle at top right, rgba(126, 177, 255, 0.14), transparent 28%),
        linear-gradient(180deg, #0b1015 0%, #111820 48%, #121b24 100%);
}

html[data-theme="dark"] body::before {
    background: radial-gradient(circle, rgba(77, 204, 147, 0.16) 0%, transparent 68%);
}

html[data-theme="dark"] body::after {
    background: radial-gradient(circle, rgba(126, 177, 255, 0.16) 0%, transparent 68%);
}

html[data-theme="dark"] .container {
    border-color: rgba(148, 163, 184, 0.1);
    background: linear-gradient(180deg, rgba(8, 12, 17, 0.9) 0%, rgba(13, 19, 25, 0.95) 100%);
}

html[data-theme="dark"] .container::before {
    background:
        radial-gradient(circle at 12% 0%, rgba(77, 204, 147, 0.08), transparent 28%),
        radial-gradient(circle at 100% 10%, rgba(126, 177, 255, 0.08), transparent 26%);
}

html[data-theme="dark"] header,
html[data-theme="dark"] .cart-section,
html[data-theme="dark"] .projects-section,
html[data-theme="dark"] .results-section,
html[data-theme="dark"] .filament-category-section,
html[data-theme="dark"] .filament-type-section,
html[data-theme="dark"] .cart-section .projects-section-content,
html[data-theme="dark"] .cart-section-group,
html[data-theme="dark"] .my-filament-subsection,
html[data-theme="dark"] .project-input-container,
html[data-theme="dark"] .filament-section,
html[data-theme="dark"] .bulk-discount-progress,
html[data-theme="dark"] .settings-help,
html[data-theme="dark"] .modal-filament-info,
html[data-theme="dark"] .alternatives-row,
html[data-theme="dark"] .alternatives-modal-footer,
html[data-theme="dark"] .type-filters,
html[data-theme="dark"] .modal-project-item,
html[data-theme="dark"] .empty-surface-message,
html[data-theme="dark"] .no-alternatives {
    border-color: var(--ui-line);
    background: rgba(16, 22, 29, 0.88);
}

html[data-theme="dark"] header {
    background: linear-gradient(145deg, rgba(16, 23, 30, 0.96) 0%, rgba(11, 17, 23, 0.9) 100%);
}

html[data-theme="dark"] header::before {
    background: radial-gradient(circle, rgba(126, 177, 255, 0.18) 0%, transparent 70%);
}

html[data-theme="dark"] header::after {
    background: linear-gradient(90deg, transparent, rgba(237, 244, 251, 0.14), transparent);
}

html[data-theme="dark"] .btn-icon,
html[data-theme="dark"] a.btn-icon,
html[data-theme="dark"] button.btn-icon,
html[data-theme="dark"] .user-menu-button,
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .modal-close,
html[data-theme="dark"] .alternatives-close-btn,
html[data-theme="dark"] .btn-provider,
html[data-theme="dark"] .makerworld-link,
html[data-theme="dark"] .cart-item-quantity-input,
html[data-theme="dark"] .quantity-arrow-btn {
    border-color: var(--ui-line);
    background: rgba(20, 28, 36, 0.92);
    color: var(--ui-muted-strong);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .btn-icon:hover,
html[data-theme="dark"] a.btn-icon:hover,
html[data-theme="dark"] button.btn-icon:hover,
html[data-theme="dark"] .user-menu-button:hover,
html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .modal-close:hover,
html[data-theme="dark"] .alternatives-close-btn:hover,
html[data-theme="dark"] .btn-provider:hover,
html[data-theme="dark"] .makerworld-link:hover,
html[data-theme="dark"] .quantity-arrow-btn:hover {
    background: rgba(28, 38, 48, 0.98);
    color: var(--ui-ink);
    border-color: var(--ui-line-strong);
}

html[data-theme="dark"] #coffeeBtn {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(255, 255, 255, 0.9);
    color: #111827;
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] #coffeeBtn:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #111827;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .btn-login,
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .move-all-btn {
    background: linear-gradient(135deg, #8ab9ff 0%, #53d3a0 100%);
    color: #081018;
    border-color: rgba(138, 185, 255, 0.28);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .btn-login:hover,
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .move-all-btn:hover {
    background: linear-gradient(135deg, #9ec6ff 0%, #66dbac 100%);
}

html[data-theme="dark"] .project-alert-btn {
    background: rgba(20, 28, 36, 0.92);
    border-color: var(--ui-line);
    color: var(--ui-muted-strong);
}

html[data-theme="dark"] .project-alert-btn-on {
    background: linear-gradient(135deg, #57d9ad 0%, #62b7ff 100%);
    border-color: rgba(87, 217, 173, 0.38);
    color: #081018;
}

html[data-theme="dark"] .btn-danger {
    background: linear-gradient(135deg, #ff9696 0%, #f06d7a 100%);
    color: #190b0e;
    border-color: rgba(255, 152, 152, 0.28);
}

html[data-theme="dark"] .btn-theme-toggle {
    color: #ffd86f;
}

html[data-theme="dark"] .projects-section-header,
html[data-theme="dark"] .category-header,
html[data-theme="dark"] .type-header {
    border-color: var(--ui-line);
    background: linear-gradient(135deg, rgba(126, 177, 255, 0.12) 0%, rgba(77, 204, 147, 0.1) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .projects-section-header:hover,
html[data-theme="dark"] .category-header:hover,
html[data-theme="dark"] .type-header:hover {
    background: linear-gradient(135deg, rgba(126, 177, 255, 0.18) 0%, rgba(77, 204, 147, 0.15) 100%);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .projects-section-header .expand-icon,
html[data-theme="dark"] .category-header .expand-icon,
html[data-theme="dark"] .type-header .expand-icon,
html[data-theme="dark"] .cart-section-count,
html[data-theme="dark"] .type-stock-count {
    background: rgba(20, 28, 36, 0.94);
    border-color: rgba(126, 177, 255, 0.18);
    color: var(--ui-accent-deep);
}

html[data-theme="dark"] .project-card,
html[data-theme="dark"] .filament-card,
html[data-theme="dark"] .alternatives-filament-card,
html[data-theme="dark"] .cart-item,
html[data-theme="dark"] .modal-project-item,
html[data-theme="dark"] .btn-provider {
    border-color: var(--ui-line);
    background: linear-gradient(180deg, rgba(20, 28, 36, 0.96) 0%, rgba(13, 19, 25, 0.96) 100%);
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .project-card::before {
    background: linear-gradient(90deg, rgba(126, 177, 255, 0.54), rgba(77, 204, 147, 0.52));
}

html[data-theme="dark"] .project-card-all-in-stock {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 1px rgba(40, 167, 69, 0.22), 0 0 18px rgba(40, 167, 69, 0.34), 0 18px 30px rgba(0, 0, 0, 0.26) !important;
}

html[data-theme="dark"] .project-card-some-in-stock {
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.2), 0 0 18px rgba(255, 193, 7, 0.32), 0 18px 30px rgba(0, 0, 0, 0.26) !important;
}

html[data-theme="dark"] .project-card-none-in-stock {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.22), 0 0 18px rgba(220, 53, 69, 0.34), 0 18px 30px rgba(0, 0, 0, 0.26) !important;
}

html[data-theme="dark"] .project-card-all-in-stock::before {
    background: linear-gradient(90deg, rgba(64, 201, 103, 0.82), rgba(64, 201, 103, 0.24));
}

html[data-theme="dark"] .project-card-some-in-stock::before {
    background: linear-gradient(90deg, rgba(255, 208, 64, 0.86), rgba(255, 208, 64, 0.24));
}

html[data-theme="dark"] .project-card-none-in-stock::before {
    background: linear-gradient(90deg, rgba(255, 99, 111, 0.82), rgba(255, 99, 111, 0.24));
}

html[data-theme="dark"] .project-image,
html[data-theme="dark"] .project-image-placeholder,
html[data-theme="dark"] .filament-image-wrapper,
html[data-theme="dark"] .filament-card > .filament-image:not(.cart-thumb),
html[data-theme="dark"] .cart-item .filament-image-wrapper,
html[data-theme="dark"] .alternatives-image-wrapper,
html[data-theme="dark"] .section-thumbnail,
html[data-theme="dark"] .modal-project-image {
    background: linear-gradient(145deg, rgba(24, 33, 42, 0.98) 0%, rgba(15, 22, 29, 0.96) 100%);
}

html[data-theme="dark"] .project-image-placeholder {
    color: var(--ui-accent-deep);
}

html[data-theme="dark"] .cart-item-stock-badge {
    background: rgba(255, 107, 107, 0.94);
    color: rgba(23, 28, 33, 0.96);
    border-color: rgba(12, 18, 24, 0.82);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .filament-type-label {
    background: rgba(12, 18, 24, 0.86);
    color: #d8e8ff;
    border-color: rgba(126, 177, 255, 0.24);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .project-rhyme,
html[data-theme="dark"] .bulk-discount-label-header,
html[data-theme="dark"] .bulk-discount-label,
html[data-theme="dark"] .status-label,
html[data-theme="dark"] .results-timestamp,
html[data-theme="dark"] .login-legal-row,
html[data-theme="dark"] .login-modal-description {
    color: var(--ui-muted);
}

html[data-theme="dark"] .bulk-discount-track {
    background: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .bulk-discount-progress-fill {
    background: linear-gradient(90deg, #8ab9ff 0%, #53d3a0 100%);
    box-shadow: 0 10px 18px rgba(83, 211, 160, 0.2);
}

html[data-theme="dark"] .bulk-discount-marker-circle {
    background: rgba(20, 28, 36, 0.96);
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .bulk-discount-marker-circle.reached {
    background: var(--ui-accent-deep);
    border-color: var(--ui-accent-deep);
}

html[data-theme="dark"] .project-url-input,
html[data-theme="dark"] .filament-search-input,
html[data-theme="dark"] .settings-input,
html[data-theme="dark"] #urlInput,
html[data-theme="dark"] .settings-input[readonly] {
    border-color: var(--ui-line);
    background: rgba(14, 20, 27, 0.94);
    color: var(--ui-text);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .project-url-input:focus,
html[data-theme="dark"] .filament-search-input:focus,
html[data-theme="dark"] .settings-input:focus,
html[data-theme="dark"] #urlInput:focus,
html[data-theme="dark"] .cart-item-quantity-input:focus {
    border-color: rgba(126, 177, 255, 0.5);
    box-shadow: 0 0 0 5px rgba(126, 177, 255, 0.14);
}

html[data-theme="dark"] .quantity-arrow-btn {
    background: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .quantity-arrow-btn:hover {
    background: rgba(126, 177, 255, 0.18);
    color: var(--ui-accent-deep);
}

html[data-theme="dark"] .user-menu-dropdown,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .alternatives-modal-content,
html[data-theme="dark"] .login-modal-content {
    border-color: var(--ui-line);
    background: rgba(12, 18, 24, 0.96);
}

html[data-theme="dark"] .modal {
    background: rgba(3, 8, 12, 0.66);
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .alternatives-modal-header,
html[data-theme="dark"] .user-menu-header {
    background: linear-gradient(135deg, rgba(126, 177, 255, 0.12) 0%, rgba(77, 204, 147, 0.1) 100%);
}

html[data-theme="dark"] .user-menu-divider,
html[data-theme="dark"] .settings-section-divider {
    background: var(--ui-line);
}

html[data-theme="dark"] .user-menu-item:hover,
html[data-theme="dark"] .modal-project-item:hover:not(.already-added) {
    background: rgba(126, 177, 255, 0.1);
    border-color: rgba(126, 177, 255, 0.22);
}

html[data-theme="dark"] .about-action-btn {
    background: rgba(20, 28, 36, 0.92);
    color: var(--ui-text);
}

html[data-theme="dark"] .about-action-btn:hover {
    background: rgba(28, 38, 48, 0.98);
}

html[data-theme="dark"] .btn-provider-google:hover {
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .btn-provider-microsoft:hover {
    background: rgba(126, 177, 255, 0.1);
    border-color: rgba(126, 177, 255, 0.28);
}

html[data-theme="dark"] .alternatives-filament-card.best-match {
    background: linear-gradient(145deg, rgba(77, 204, 147, 0.14) 0%, rgba(13, 19, 25, 0.98) 100%);
}

html[data-theme="dark"] .alternatives-filament-card.selected {
    border-color: rgba(77, 204, 147, 0.34);
}

html[data-theme="dark"] .settings-warning {
    background: rgba(240, 189, 97, 0.14);
    color: #ffd67c;
}

html[data-theme="dark"] .settings-warning-danger {
    background: rgba(255, 152, 152, 0.14);
    color: #ffb5b5;
}

html[data-theme="dark"] .api-key-status.success {
    background: rgba(77, 204, 147, 0.14);
    border-color: rgba(77, 204, 147, 0.22);
}

html[data-theme="dark"] .api-key-status.error {
    background: rgba(255, 152, 152, 0.14);
    border-color: rgba(255, 152, 152, 0.22);
    color: #ffb5b5;
}

html[data-theme="dark"] .availability.unknown {
    background: rgba(148, 163, 184, 0.14);
    color: var(--ui-muted-strong);
}

html[data-theme="dark"] code {
    background: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .link-button:hover,
html[data-theme="dark"] .settings-help a:hover,
html[data-theme="dark"] .project-name a:hover,
html[data-theme="dark"] .filament-name a:hover,
html[data-theme="dark"] .cart-item-name-link:hover {
    color: var(--ui-accent);
}

.cart-actions-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 16px;
}

.cart-send-btn {
    min-width: 220px;
}

.bambu-cart-modal-content {
    max-width: 760px;
}

.bambu-cart-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bambu-cart-modal-summary {
    margin: 0;
    color: var(--ui-text-secondary);
    line-height: 1.5;
}

.bambu-cart-modal-status {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.45;
    border: 1px solid transparent;
}

.bambu-cart-modal-status.info {
    background: rgba(26, 115, 232, 0.08);
    border-color: rgba(26, 115, 232, 0.16);
    color: #0f4fa8;
}

.bambu-cart-modal-status.success {
    background: rgba(31, 165, 91, 0.1);
    border-color: rgba(31, 165, 91, 0.18);
    color: #12663a;
}

.bambu-cart-modal-status.error {
    background: rgba(204, 67, 67, 0.08);
    border-color: rgba(204, 67, 67, 0.16);
    color: #9d2e2e;
}

.bambu-cart-modal-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 4px;
}

.bambu-cart-empty-state {
    padding: 18px;
    border: 1px dashed rgba(31, 41, 55, 0.14);
    border-radius: 14px;
    text-align: center;
    color: var(--ui-text-secondary);
    background: rgba(148, 163, 184, 0.06);
}

.bambu-cart-modal-item {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(31, 41, 55, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.8);
}

.bambu-cart-modal-item.sending {
    border-color: rgba(26, 115, 232, 0.24);
    box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.08);
}

.bambu-cart-modal-item.done {
    border-color: rgba(31, 165, 91, 0.24);
    box-shadow: 0 0 0 1px rgba(31, 165, 91, 0.08);
}

.bambu-cart-modal-item.failed {
    border-color: rgba(204, 67, 67, 0.22);
    box-shadow: 0 0 0 1px rgba(204, 67, 67, 0.06);
}

.bambu-cart-modal-item.blocked {
    opacity: 0.78;
}

.bambu-cart-modal-item-media {
    display: flex;
    align-items: flex-start;
}

.bambu-cart-modal-thumb {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(148, 163, 184, 0.08);
}

.bambu-cart-modal-item-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bambu-cart-modal-item-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.bambu-cart-modal-item-title {
    font-weight: 600;
    color: var(--ui-text-primary);
}

.bambu-cart-modal-item-subtitle {
    margin-top: 4px;
    color: var(--ui-text-secondary);
    font-size: 0.9rem;
}

.bambu-cart-item-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.bambu-cart-item-status.ready {
    background: rgba(26, 115, 232, 0.1);
    color: #0f4fa8;
}

.bambu-cart-item-status.sending {
    background: rgba(26, 115, 232, 0.14);
    color: #0f4fa8;
}

.bambu-cart-item-status.success {
    background: rgba(31, 165, 91, 0.12);
    color: #12663a;
}

.bambu-cart-item-status.error {
    background: rgba(204, 67, 67, 0.12);
    color: #9d2e2e;
}

.bambu-cart-item-status.muted {
    background: rgba(148, 163, 184, 0.14);
    color: #516170;
}

.bambu-cart-variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bambu-cart-variant-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(31, 41, 55, 0.16);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ui-text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.bambu-cart-variant-option.selected {
    border-color: rgba(26, 115, 232, 0.36);
    background: rgba(26, 115, 232, 0.08);
    color: #0f4fa8;
}

.bambu-cart-variant-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bambu-cart-variant-option input {
    margin: 0;
}

.bambu-cart-modal-item-note {
    color: var(--ui-text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

.bambu-cart-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 24px 24px;
}

html[data-theme="dark"] .bambu-cart-modal-status.info {
    background: rgba(96, 165, 250, 0.14);
    border-color: rgba(96, 165, 250, 0.22);
    color: #bfdbfe;
}

html[data-theme="dark"] .bambu-cart-modal-status.success {
    background: rgba(74, 222, 128, 0.14);
    border-color: rgba(74, 222, 128, 0.2);
    color: #bbf7d0;
}

html[data-theme="dark"] .bambu-cart-modal-status.error {
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.2);
    color: #fecaca;
}

html[data-theme="dark"] .bambu-cart-empty-state,
html[data-theme="dark"] .bambu-cart-modal-item {
    background: rgba(15, 23, 42, 0.68);
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .bambu-cart-modal-thumb {
    background: rgba(30, 41, 59, 0.8);
}

html[data-theme="dark"] .bambu-cart-item-status.ready,
html[data-theme="dark"] .bambu-cart-item-status.sending {
    background: rgba(96, 165, 250, 0.16);
    color: #bfdbfe;
}

html[data-theme="dark"] .bambu-cart-item-status.success {
    background: rgba(74, 222, 128, 0.16);
    color: #bbf7d0;
}

html[data-theme="dark"] .bambu-cart-item-status.error {
    background: rgba(248, 113, 113, 0.16);
    color: #fecaca;
}

html[data-theme="dark"] .bambu-cart-item-status.muted {
    background: rgba(100, 116, 139, 0.22);
    color: #cbd5e1;
}

html[data-theme="dark"] .bambu-cart-variant-option {
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

html[data-theme="dark"] .bambu-cart-variant-option.selected {
    border-color: rgba(96, 165, 250, 0.3);
    background: rgba(96, 165, 250, 0.12);
    color: #bfdbfe;
}

@media (max-width: 720px) {
    .cart-item-card {
        width: 100%;
        min-height: 0;
    }

    .cart-header-controls {
        width: 100%;
        justify-content: flex-start;
        margin: 0;
    }

    .cart-actions-bar {
        justify-content: stretch;
    }

    .cart-send-btn {
        width: 100%;
        min-width: 0;
    }

    .bambu-cart-modal-item {
        grid-template-columns: 1fr;
    }

    .bambu-cart-modal-item-media {
        justify-content: center;
    }

    .bambu-cart-modal-item-header {
        flex-direction: column;
    }

    .bambu-cart-item-status {
        align-self: flex-start;
    }

    .bambu-cart-modal-footer {
        flex-direction: column-reverse;
        padding: 0 20px 20px;
    }

    .bambu-cart-modal-footer button {
        width: 100%;
    }
}


/* ==========================================================================
   UI refresh (2026-09): typography, quieter status, card footer, card menu,
   filament picker, cart bar, toast, catalog, settings tabs.
   Later in the cascade on purpose: these rules supersede the earlier layers.
   ========================================================================== */

/* ---------- Typography: Manrope for UI, Orbitron only for the wordmark ---------- */
/* Author display rules would otherwise override the hidden attribute (picker rows, tabs, buttons) */
[hidden] {
    display: none !important;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

body,
#urlInput,
.settings-input,
.projects-section h2,
.results-section h2,
.projects-section-header .section-name,
.category-name,
.type-name,
.cart-section-name,
.my-filament-subsection-title,
.filament-section-header,
.filament-type-label,
.bulk-discount-label-header,
.status-label,
.modal-header h3,
.alternatives-modal-header h3 {
    font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.btn-secondary {
    text-transform: none;
    letter-spacing: normal;
}

/* Functional text never drops below 11px */
.filament-type-label {
    top: 3px;
    left: 3px;
    padding: 1px 5px;
    font-size: 0.6875rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0.02em;
}

.availability,
.status-label,
.bulk-discount-label,
.results-timestamp {
    font-size: 0.6875rem;
}

.quantity-arrow-btn,
.cart-item-card .cart-item-quantity-controls-vertical .quantity-arrow-btn {
    min-width: 26px;
    min-height: 20px;
    font-size: 0.6875rem;
}

/* ---------- Quieter surfaces ---------- */
header,
.cart-section,
.projects-section,
.results-section {
    animation: none;
}

/* overflow: clip keeps the rounded clipping without creating a scroll container, so the cart bar can stick */
.container {
    overflow: clip;
}

header {
    padding: 14px 20px;
    margin-bottom: 16px;
}

.header-topline {
    grid-template-columns: minmax(0, 1fr) auto;
}

.header-brand {
    align-items: flex-start;
    gap: 2px;
}

header h1 {
    justify-content: flex-start;
    text-align: left;
    font-size: clamp(1.45rem, 2.1vw, 1.9rem);
}

header p {
    text-align: left;
    font-size: 0.875rem;
}

@media (max-width: 900px) {
    .header-topline {
        grid-template-columns: minmax(0, 1fr);
    }

    .header-actions-right {
        justify-content: flex-start;
        justify-self: start;
    }
}

/* Project cards: status reads from a text line, not a glow */
html .project-card.project-card-all-in-stock,
html .project-card.project-card-some-in-stock,
html .project-card.project-card-none-in-stock {
    border-width: 1.5px !important;
    box-shadow: 0 8px 18px rgba(20, 30, 40, 0.06) !important;
}

html .project-card.project-card-all-in-stock { border-color: rgba(23, 167, 111, 0.55) !important; }
html .project-card.project-card-some-in-stock { border-color: rgba(201, 128, 7, 0.6) !important; }
html .project-card.project-card-none-in-stock { border-color: rgba(222, 91, 91, 0.65) !important; }

html[data-theme="dark"] .project-card.project-card-all-in-stock,
html[data-theme="dark"] .project-card.project-card-some-in-stock,
html[data-theme="dark"] .project-card.project-card-none-in-stock {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] .project-card.project-card-all-in-stock { border-color: rgba(77, 204, 147, 0.5) !important; }
html[data-theme="dark"] .project-card.project-card-some-in-stock { border-color: rgba(240, 189, 97, 0.55) !important; }
html[data-theme="dark"] .project-card.project-card-none-in-stock { border-color: rgba(255, 152, 152, 0.6) !important; }

.project-card:hover {
    transform: none;
}

/* Filament groups inside a card are labeled rows, not nested panels */
.filament-section,
html[data-theme="dark"] .filament-section {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.project-filaments {
    gap: 12px;
}

.filament-section-header {
    margin-bottom: 6px;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
}

/* Swatch status: a solid border plus a shape marker, no glow */
.project-filament-thumb .filament-image-wrapper.filament-image-in-stock,
.project-filament-thumb .filament-image-wrapper.filament-image-owned {
    border-color: rgba(23, 167, 111, 0.7);
    box-shadow: none;
}

.project-filament-thumb .filament-image-wrapper.filament-image-out-of-stock {
    border-color: var(--ui-danger);
    box-shadow: none;
}

.project-filament-thumb .filament-image-wrapper.filament-image-unknown {
    border: 2px dashed var(--ui-line-strong);
    box-shadow: none;
}

.thumb-status {
    position: absolute;
    right: 3px;
    bottom: 3px;
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
}

.thumb-status-out {
    background: var(--ui-danger);
    color: #fff;
}

html[data-theme="dark"] .thumb-status-out {
    color: #1a0f10;
}

.thumb-status-unknown {
    background: var(--ui-surface-strong);
    color: var(--ui-muted-strong);
    border: 1px solid var(--ui-line-strong);
}

.project-filament-thumb:hover {
    transform: none;
}

/* Cart: material groups are headed rows; items stay as tiles */
.cart-section-group,
html[data-theme="dark"] .cart-section-group {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.cart-item-stock-badge-unknown {
    display: grid;
    place-items: center;
    background: var(--ui-surface-strong);
    color: var(--ui-muted-strong);
    border: 1px solid var(--ui-line-strong);
    font-size: 0.6875rem;
    font-weight: 800;
}

html[data-theme="dark"] .cart-item-stock-badge.cart-item-stock-badge-unknown {
    background: var(--ui-surface-strong);
    color: var(--ui-muted-strong);
    border-color: var(--ui-line-strong);
}

/* Settings callouts: tinted box instead of a thick side stripe */
.settings-warning,
html[data-theme="dark"] .settings-warning {
    border: none;
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--ui-gold-soft);
    color: var(--ui-text);
}

.settings-warning-danger,
html[data-theme="dark"] .settings-warning-danger {
    background: var(--ui-danger-soft);
}

.api-key-status.info {
    background: var(--ui-accent-soft);
    color: var(--ui-text);
}

.settings-help,
.settings-help li,
.settings-help p,
html[data-theme="dark"] .settings-help,
html[data-theme="dark"] .settings-help li,
html[data-theme="dark"] .settings-help p {
    color: var(--ui-text);
}

.settings-help a,
html[data-theme="dark"] .settings-help a {
    color: var(--ui-accent-deep);
    font-weight: 700;
}

/* ---------- Project card layout ---------- */
.projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 16px;
}

.project-card {
    container-type: inline-size;
    display: flex;
    flex-direction: column;
}

.project-card-head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.project-card-head .project-name {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    margin-bottom: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.card-menu-btn,
.card-icon-btn {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--ui-muted-strong);
    cursor: pointer;
    transition: background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out;
}

.card-menu-btn {
    margin: -6px -6px 0 0;
}

.card-menu-btn:hover,
.card-menu-btn[aria-expanded="true"],
.card-icon-btn:hover {
    background: var(--ui-accent-soft);
    color: var(--ui-ink);
}

/* Empty project: a dashed, swatch-sized "+" shows where colors go */
.filament-slot {
    align-self: flex-start;
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border: 2px dashed var(--ui-line-strong);
    border-radius: 14px;
    color: var(--ui-muted);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: border-color 160ms ease-out, background-color 160ms ease-out, color 160ms ease-out;
}

.filament-slot:hover,
.project-card.drag-over .filament-slot {
    border-color: var(--ui-accent);
    background: var(--ui-accent-soft);
    color: var(--ui-accent-deep);
}

@media (prefers-reduced-motion: reduce) {
    .filament-slot {
        transition: none;
    }
}

/* Hidden on screen, still read by screen readers */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.project-card-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
}

.card-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--ui-text);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.3;
}

.card-status-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: 800;
    line-height: 1;
    background: var(--ui-line-strong);
    color: var(--ui-ink);
}

.card-status-ready .card-status-icon::before { content: '✓'; }
.card-status-buy .card-status-icon::before { content: '✓'; }
.card-status-partial .card-status-icon::before,
.card-status-blocked .card-status-icon::before { content: '!'; }
.card-status-checking .card-status-icon::before { content: '…'; }
.card-status-empty .card-status-icon::before { content: '+'; }

.card-status-ready .card-status-icon,
.card-status-buy .card-status-icon {
    background: var(--ui-brand);
    color: #fff;
}

.card-status-partial .card-status-icon {
    background: var(--ui-gold);
    color: #1d1405;
}

.card-status-blocked .card-status-icon {
    background: var(--ui-danger);
    color: #fff;
}

html[data-theme="dark"] .card-status-ready .card-status-icon,
html[data-theme="dark"] .card-status-buy .card-status-icon,
html[data-theme="dark"] .card-status-blocked .card-status-icon {
    color: #0d1318;
}

.card-status-empty,
.card-status-checking {
    color: var(--ui-muted-strong);
    font-weight: 600;
}

.card-status .auto-colors-status {
    color: var(--ui-text);
}

.project-card-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    padding-top: 0;
}

.project-card-buttons .card-action,
.project-card-buttons .auto-populate-btn.card-action {
    flex: 1 1 auto;
    min-width: max-content;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    white-space: nowrap;
    word-break: normal;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out;
}

.project-card-buttons .card-action:hover {
    transform: none;
    box-shadow: none;
}

.project-card-buttons .card-action-primary {
    min-height: 38px;
}

.project-card-buttons .card-action-secondary,
.project-card-buttons .auto-populate-btn.card-action-secondary {
    background: transparent;
    border-color: var(--ui-line-strong);
    color: var(--ui-ink);
}

.project-card-buttons .card-action-secondary:hover {
    background: var(--ui-accent-soft);
}

.project-card-buttons .card-action-quiet {
    flex: 0 0 auto;
    background: transparent;
    border-color: var(--ui-line-strong);
    color: var(--ui-ink);
}

.project-card-buttons .card-action-quiet:hover {
    background: var(--ui-accent-soft);
}

.project-card-buttons .card-action-fix {
    background: var(--ui-gold-soft);
    border-color: rgba(201, 128, 7, 0.45);
    color: var(--ui-ink);
}

.project-card-buttons .card-action-fix:hover {
    background: rgba(240, 170, 60, 0.26);
}

.auto-populate-btn.card-action .auto-populate-text {
    white-space: nowrap;
    word-break: normal;
    font-size: inherit;
}

.auto-populate-btn.card-action .auto-populate-icon {
    font-size: 0.875rem;
}

.project-card-buttons .project-alert-btn.card-icon-btn {
    flex: 0 0 auto;
    min-height: 0;
    padding: 0;
    border-color: var(--ui-line-strong);
    box-shadow: none;
}

.project-card-buttons .project-alert-btn.card-icon-btn.project-alert-btn-on {
    background: var(--ui-accent-soft);
    border-color: var(--ui-accent);
    color: var(--ui-accent-deep);
}

@container (max-width: 250px) {
    .project-card-buttons .auto-populate-btn.card-action {
        flex: 0 0 auto;
        min-width: 38px;
        padding: 0 10px;
    }

    .project-card-buttons .auto-populate-btn.card-action .auto-populate-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

.project-card-highlight {
    animation: card-highlight 1.2s ease-out 1;
}

@keyframes card-highlight {
    0% { outline: 3px solid var(--ui-accent); outline-offset: 2px; }
    100% { outline: 3px solid transparent; outline-offset: 6px; }
}

/* ---------- Floating menus (card ⋯ menu and swatch options) ---------- */
.card-menu {
    z-index: 100000;
    min-width: 212px;
    max-width: min(280px, calc(100vw - 16px));
    padding: 6px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 14px;
    background: var(--ui-surface-strong);
    box-shadow: 0 16px 36px rgba(20, 30, 40, 0.18);
}

html[data-theme="dark"] .card-menu {
    background: #16202a;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.card-menu-item {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--ui-ink);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.card-menu-item:hover,
.card-menu-item:focus-visible {
    background: var(--ui-accent-soft);
    outline: none;
}

.card-menu-item.is-danger {
    color: var(--ui-danger);
}

html:not([data-theme="dark"]) .card-menu-item.is-danger {
    color: #b93838;
}

.card-menu-separator {
    height: 1px;
    margin: 5px 6px;
    background: var(--ui-line-strong);
}

.filament-context-menu .context-menu-btn:focus-visible {
    outline: 2px solid var(--ui-accent);
    outline-offset: -2px;
}

/* ---------- Filament picker ---------- */
.filament-picker {
    width: min(760px, calc(100vw - 32px));
    height: min(760px, calc(100vh - 48px));
    max-height: calc(100vh - 48px);
    margin: auto;
    padding: 0;
    border: 1px solid var(--ui-line-strong);
    border-radius: 20px;
    background: var(--ui-surface-strong);
    color: var(--ui-text);
    box-shadow: 0 30px 80px rgba(10, 20, 30, 0.28);
    overflow: hidden;
}

html[data-theme="dark"] .filament-picker {
    background: #121b23;
}

.filament-picker::backdrop {
    background: rgba(14, 22, 28, 0.5);
}

.filament-picker[open] {
    display: flex;
}

.filament-picker-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.filament-picker-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 10px;
}

.filament-picker-heading h3 {
    margin: 0;
    color: var(--ui-ink);
    font-size: 1.125rem;
    font-weight: 800;
}

.filament-picker-subtitle {
    margin: 2px 0 0;
    color: var(--ui-muted-strong);
    font-size: 0.875rem;
    line-height: 1.4;
}

.filament-picker-tools {
    display: flex;
    gap: 10px;
    padding: 0 20px 12px;
}

.filament-picker-tools .filament-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
}

.filament-picker-auto {
    flex: 0 0 auto;
    white-space: nowrap;
}

.filament-picker-list {
    flex: 1 1 auto;
    min-height: 200px;
    overflow-y: auto;
    padding: 0 12px 12px;
    border-top: 1px solid var(--ui-line);
    border-bottom: 1px solid var(--ui-line);
}

.picker-group-title {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0;
    padding: 12px 8px 6px;
    background: var(--ui-surface-strong);
    color: var(--ui-muted-strong);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

html[data-theme="dark"] .picker-group-title {
    background: #121b23;
}

.picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
}

.picker-row.is-in-project {
    background: var(--ui-brand-soft);
}

.picker-toggle {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto 26px;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.picker-toggle:hover {
    background: var(--ui-accent-soft);
}

.picker-swatch {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    background: #eef2f5;
}

.picker-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.picker-color {
    overflow: hidden;
    color: var(--ui-ink);
    font-size: 0.9375rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.picker-type {
    color: var(--ui-muted-strong);
    font-size: 0.8125rem;
}

.picker-stock {
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
}

.picker-stock-in { color: var(--ui-brand-deep); }
.picker-stock-out { color: var(--ui-danger); }
.picker-stock-unknown { color: var(--ui-muted-strong); }

html:not([data-theme="dark"]) .picker-stock-out { color: #b93838; }

.picker-mark {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1.5px solid var(--ui-line-strong);
    border-radius: 8px;
    color: var(--ui-ink);
    font-size: 0.875rem;
    font-weight: 800;
}

.picker-mark::before {
    content: '+';
}

.picker-toggle[aria-pressed="true"] .picker-mark {
    background: var(--ui-brand);
    border-color: var(--ui-brand);
    color: #fff;
}

html[data-theme="dark"] .picker-toggle[aria-pressed="true"] .picker-mark {
    color: #0d1318;
}

.picker-toggle[aria-pressed="true"] .picker-mark::before {
    content: '✓';
}

.picker-own {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 4px;
    color: var(--ui-muted-strong);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.picker-own input {
    width: 16px;
    height: 16px;
    accent-color: var(--ui-brand);
}

.filament-picker-empty {
    margin: 16px 8px;
    color: var(--ui-muted-strong);
    font-size: 0.875rem;
}

.filament-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px 16px;
}

.filament-picker-count {
    color: var(--ui-muted-strong);
    font-size: 0.875rem;
}

@media (max-width: 560px) {
    .filament-picker-tools {
        flex-direction: column;
    }

    .picker-toggle {
        grid-template-columns: 36px minmax(0, 1fr) 26px;
    }

    .picker-stock {
        grid-column: 2;
        grid-row: 2;
    }

    .picker-mark {
        grid-column: 3;
        grid-row: 1 / span 2;
    }
}

/* ---------- Cart bar (sticky summary at the top) ---------- */
.cart-bar {
    position: sticky;
    top: 12px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 16px;
    padding: 8px 8px 8px 12px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 16px;
    background: #fbfcfd;
    box-shadow: 0 10px 24px rgba(20, 30, 40, 0.1);
}

html[data-theme="dark"] .cart-bar {
    background: #131c24;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.cart-bar-summary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 6px 8px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--ui-ink);
    font-size: 0.9375rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.cart-bar-summary:hover {
    background: var(--ui-accent-soft);
}

.cart-bar-icon {
    display: inline-grid;
    place-items: center;
    color: var(--ui-brand-deep);
}

.cart-bar-view-label {
    color: var(--ui-accent-deep);
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
}

html:not([data-theme="dark"]) .cart-bar-view-label {
    color: #1f4fcf;
}

.cart-bar .cart-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.cart-bar .cart-actions-bar.hidden {
    display: none;
}

.cart-send-reason {
    color: var(--ui-muted-strong);
    font-size: 0.8125rem;
    font-weight: 600;
}

.cart-bar .cart-send-btn {
    min-height: 40px;
    padding: 0 18px;
    white-space: nowrap;
}

.cart-bar .cart-send-btn:disabled {
    opacity: 1;
    background: var(--ui-line);
    border-color: var(--ui-line-strong);
    color: var(--ui-muted-strong);
    box-shadow: none;
    cursor: not-allowed;
}

.section-count {
    color: var(--ui-muted-strong);
    font-weight: 600;
}

@media (max-width: 640px) {
    .cart-bar {
        top: 8px;
    }

    .cart-bar .cart-actions-bar {
        width: 100%;
        justify-content: space-between;
    }

    .cart-bar-view-label {
        display: none;
    }
}

/* ---------- Bulk sale ---------- */
.bulk-discount-progress {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "label summary"
        "track track";
    column-gap: 12px;
    row-gap: 6px;
    align-items: baseline;
}

.bulk-discount-label-header {
    grid-area: label;
}

.bulk-discount-summary {
    grid-area: summary;
    margin: 0;
    color: var(--ui-text);
    font-size: 0.8125rem;
    font-weight: 700;
}

.bulk-discount-track-wrapper {
    grid-area: track;
    min-width: 0;
}

@media (max-width: 560px) {
    .bulk-discount-progress {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "label"
            "summary"
            "track";
    }

    /* The sentence above carries the tier details; per-marker labels collide at this width */
    .bulk-discount-label {
        display: none;
    }
}

.bulk-discount-progress-fill {
    width: 100% !important;
    transform-origin: left center;
    transition: transform 240ms ease-out;
}

/* ---------- First-run steps ---------- */
.projects-intro {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 4px 0 18px;
    padding: 14px 4px 4px;
    list-style: none;
    counter-reset: intro-step;
}

.projects-intro li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
    counter-increment: intro-step;
}

.projects-intro li::before {
    content: counter(intro-step);
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--ui-brand-soft);
    color: var(--ui-brand-deep);
    font-size: 0.875rem;
    font-weight: 800;
}

.projects-intro-title {
    color: var(--ui-ink);
    font-size: 0.9375rem;
    font-weight: 800;
}

@media (max-width: 820px) {
    .projects-intro {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* ---------- Website vs. extension copy ---------- */
html.is-web .extension-only,
html.is-extension .web-only {
    display: none !important;
}

.bookmarklet-link {
    display: inline-block;
    padding: 1px 10px;
    border: 1px dashed var(--ui-brand);
    border-radius: 999px;
    background: var(--ui-brand-soft);
    color: var(--ui-brand-deep);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: grab;
}

.bookmarklet-link:hover,
.bookmarklet-link:focus-visible {
    border-style: solid;
}

.bookmarklet-link:focus-visible,
.bambu-cart-store-link:focus-visible {
    outline: 3px solid var(--ui-accent);
    outline-offset: 2px;
}

.bambu-cart-store-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--ui-accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 160ms ease-out;
}

.bambu-cart-store-link:hover {
    background: var(--ui-accent-deep);
}

html[data-theme="dark"] .bambu-cart-store-link {
    color: #0d1318;
}

@media (prefers-reduced-motion: reduce) {
    .bambu-cart-store-link {
        transition: none;
    }
}

/* ---------- Catalog ---------- */
.results-heading-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.results-toolbar {
    align-items: center;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 100001;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: max-content;
    max-width: min(560px, calc(100vw - 32px));
    padding: 12px 10px 12px 16px;
    border-radius: 14px;
    background: #1a2530;
    color: #f2f6f9;
    box-shadow: 0 14px 34px rgba(10, 20, 30, 0.3);
    transform: translateX(-50%);
}

.toast:has(#errorMessage.hidden) {
    display: none;
}

html[data-theme="dark"] .toast {
    background: #e9eff4;
    color: #101820;
}

.toast-text {
    padding-top: 3px;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
}

.toast-text a {
    color: inherit;
    text-decoration: underline;
}

.toast-close {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.8;
    cursor: pointer;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .toast-close:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* ---------- Settings tabs ---------- */
.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    padding: 4px;
    border: 1px solid var(--ui-line);
    border-radius: 12px;
    background: var(--ui-surface-muted);
}

.settings-tab {
    flex: 1 1 0;
    min-height: 36px;
    padding: 0 12px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--ui-muted-strong);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
}

.settings-tab[aria-selected="true"] {
    background: var(--ui-surface-strong);
    color: var(--ui-ink);
    box-shadow: 0 2px 8px rgba(20, 30, 40, 0.08);
}

html[data-theme="dark"] .settings-tab[aria-selected="true"] {
    background: #1d2833;
}

.settings-panel:focus-visible {
    outline: 2px solid var(--ui-accent);
    outline-offset: 4px;
    border-radius: 8px;
}

.settings-panel .settings-section + .settings-section {
    margin-top: 20px;
}

/* ---------- Footer ---------- */
.app-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 10px;
    padding: 22px 0 4px;
    color: var(--ui-muted-strong);
    font-size: 0.8125rem;
}

.app-footer a {
    color: var(--ui-accent-deep);
    font-weight: 700;
    text-decoration: none;
}

html:not([data-theme="dark"]) .app-footer a {
    color: #1f4fcf;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* ---------- Keyboard focus ---------- */
.project-filament-thumb:focus-visible,
.keyboard-activator:focus-visible,
.category-header:focus-visible,
.card-menu-btn:focus-visible,
.card-icon-btn:focus-visible,
.project-card-buttons .card-action:focus-visible,
.picker-toggle:focus-visible,
.settings-tab:focus-visible,
.cart-bar-summary:focus-visible,
.toast-close:focus-visible {
    outline: 3px solid var(--ui-accent);
    outline-offset: 2px;
}

.picker-own input:focus-visible {
    outline: 2px solid var(--ui-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .card-menu-btn,
    .card-icon-btn,
    .project-card-buttons .card-action,
    .bulk-discount-progress-fill,
    .project-card-highlight {
        transition: none;
        animation: none;
    }
}
