/* BrickProof Main Stylesheet */

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

/* Theme tokens — extend :root / html[data-theme="dark"] for sitewide light-dark later */
:root {
    --bp-shell-max-width: 1200px;
    --bp-color-brand-500: #667eea;
    --bp-color-brand-600: #764ba2;
    --bp-color-brand-700: #5568d3;

    --bp-header-bg: #ffffff;
    --bp-header-text: var(--bp-color-brand-600);
    --bp-header-border: rgba(102, 126, 234, 0.2);
    --bp-header-shadow: 0 2px 12px rgba(102, 126, 234, 0.14);

    --bp-header-link: #5b4dc9;
    --bp-header-link-hover-bg: rgba(102, 126, 234, 0.1);
    --bp-header-link-underline: var(--bp-color-brand-500);
    --bp-header-logo-hover-opacity: 0.88;

    --bp-header-submenu-bg: #ffffff;
    --bp-header-submenu-border: rgba(102, 126, 234, 0.18);
    --bp-header-submenu-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    --bp-header-submenu-link: var(--bp-color-brand-600);
    --bp-header-submenu-link-hover-bg: rgba(102, 126, 234, 0.08);
    --bp-header-submenu-disabled: rgba(91, 77, 201, 0.45);

    --bp-header-announcement-bg: rgba(102, 126, 234, 0.12);
    --bp-header-announcement-text: #3b2f6b;
    --bp-header-announcement-link: var(--bp-color-brand-600);

    --bp-header-mobile-nav-bg: #ffffff;
    --bp-header-mobile-nav-border: rgba(102, 126, 234, 0.15);
    --bp-header-mobile-nav-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --bp-header-mobile-submenu-bg: rgba(102, 126, 234, 0.08);

    --bp-header-avatar-border: var(--bp-color-brand-500);
    --bp-header-avatar-bg: linear-gradient(135deg, var(--bp-color-brand-500) 0%, var(--bp-color-brand-600) 100%);
    --bp-header-avatar-text: #ffffff;
    --bp-header-avatar-hover-filter: brightness(1.08);
    --bp-header-avatar-active-filter: brightness(0.94);
    --bp-header-avatar-active-ring: 0 0 0 2px rgba(102, 126, 234, 0.85);

    --bp-header-burger: var(--bp-color-brand-600);

    --bp-btn-outline-border: var(--bp-color-brand-500);
    --bp-btn-outline-text: var(--bp-color-brand-500);
    --bp-btn-outline-hover-bg: rgba(102, 126, 234, 0.1);
    --bp-btn-outline-hover-text: var(--bp-color-brand-700);
    --bp-btn-outline-hover-border: var(--bp-color-brand-600);

    /* Outline buttons drawn on the site header (same as content on light bar) */
    --bp-header-cta-outline-border: var(--bp-btn-outline-border);
    --bp-header-cta-outline-text: var(--bp-btn-outline-text);
    --bp-header-cta-outline-hover-bg: var(--bp-btn-outline-hover-bg);
    --bp-header-cta-outline-hover-text: var(--bp-btn-outline-hover-text);
    --bp-header-cta-outline-hover-border: var(--bp-btn-outline-hover-border);
}

/* Optional: restore purple bar header when html has data-theme="dark" (toggle via JS later) */
html[data-theme="dark"] {
    --bp-header-bg: linear-gradient(135deg, var(--bp-color-brand-500) 0%, var(--bp-color-brand-600) 100%);
    --bp-header-text: #ffffff;
    --bp-header-border: transparent;
    --bp-header-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);

    --bp-header-link: #ffffff;
    --bp-header-link-hover-bg: rgba(255, 255, 255, 0.1);
    --bp-header-link-underline: #ffffff;
    --bp-header-logo-hover-opacity: 0.9;

    --bp-header-submenu-bg: rgba(102, 126, 234, 0.95);
    --bp-header-submenu-border: transparent;
    --bp-header-submenu-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    --bp-header-submenu-link: #ffffff;
    --bp-header-submenu-link-hover-bg: rgba(255, 255, 255, 0.1);
    --bp-header-submenu-disabled: rgba(255, 255, 255, 0.72);

    --bp-header-announcement-bg: rgba(0, 0, 0, 0.25);
    --bp-header-announcement-text: #ffffff;
    --bp-header-announcement-link: #ffffff;

    --bp-header-mobile-nav-bg: linear-gradient(135deg, var(--bp-color-brand-500) 0%, var(--bp-color-brand-600) 100%);
    --bp-header-mobile-nav-border: transparent;
    --bp-header-mobile-nav-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    --bp-header-mobile-submenu-bg: rgba(102, 126, 234, 0.8);

    --bp-header-avatar-border: rgba(255, 255, 255, 0.8);
    --bp-header-avatar-bg: rgba(255, 255, 255, 0.2);
    --bp-header-avatar-text: #ffffff;
    --bp-header-avatar-hover-filter: none;
    --bp-header-avatar-active-filter: none;
    --bp-header-avatar-active-ring: 0 0 0 2px rgba(102, 126, 234, 0.8);

    --bp-header-burger: #ffffff;

    /* White ghost buttons on purple header (Sign in, announcement actions) */
    --bp-header-cta-outline-border: #ffffff;
    --bp-header-cta-outline-text: #ffffff;
    --bp-header-cta-outline-hover-bg: #ffffff;
    --bp-header-cta-outline-hover-text: var(--bp-color-brand-500);
    --bp-header-cta-outline-hover-border: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.container {
    max-width: var(--bp-shell-max-width);
    margin: 20px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

@media (max-width: 768px) {
    .container {
        margin: 10px auto;
        border-radius: 8px;
    }
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header-logo {
    height: 125px;
    width: 125px;
    max-width: 125px;
    max-height: 125px;
    vertical-align: middle;
    object-fit: contain;
    display: inline-block;
}

.header p {
    opacity: 0.9;
    font-size: 1.1em;
}

.content {
    padding: 40px;
}

.upload-section {
    border: 3px dashed #667eea;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s;
}

.upload-section:hover {
    border-color: #764ba2;
    background: #f0f2ff;
}

.upload-section.dragover {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.02);
}

input[type="file"] {
    display: none;
}

.file-input-label {
    display: inline-block;
    padding: 15px 30px;
    background: #667eea;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s;
    margin: 10px;
}

.file-input-label:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    display: none;
}

.file-info.show {
    display: block;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

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

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

.error {
    display: none;
    padding: 15px 20px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c33;
    margin-top: 20px;
    margin-bottom: 20px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
    animation: slideIn 0.3s ease-out;
    /* Keep visible below sticky site header when scrollIntoView(..., block: 'start') runs */
    scroll-margin-top: 6.5rem;
}

.error.show {
    display: block;
}

/* Links inside error banners (e.g. tier upgrade CTAs) — match alert tone, not default browser blue */
.error a,
.text-error a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(204, 51, 51, 0.5);
    text-underline-offset: 3px;
}

.error a:hover,
.text-error a:hover {
    text-decoration-color: #c33;
    color: #a02828;
}

.error a:focus-visible,
.text-error a:focus-visible {
    outline: 2px solid #c33;
    outline-offset: 3px;
    border-radius: 3px;
}

/* Inline error text (e.g. image gallery grid) — align with .error banner when no parent .error */
.text-error {
    color: #c33;
}

.success-message.show {
    display: block;
}

.success-message {
    display: none;
    padding: 15px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 8px;
    color: white;
    margin-top: 20px;
    margin-bottom: 20px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    animation: slideIn 0.3s ease-out;
}

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

.review-section {
    display: none;
    margin-top: 30px;
}

.review-section.show {
    display: block;
}

/* Utility class for hiding elements */
.hidden {
    display: none !important;
}

/* State utility classes for show/hide */
.state-hidden {
    display: none !important;
}

/* .state-visible sets display: block for regular elements
   More specific selectors (like .items-grid) will override this */
.state-visible {
    display: block;
}

/* Table rows need display: table-row, not display: block */
tr.state-visible {
    display: table-row !important;
}
tr.state-hidden {
    display: none !important;
}

.invoice-summary {
    background: #f8f9ff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.invoice-summary h2 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 1.8em;
}

.invoice-summary .summary-intro {
    margin-top: 0;
    margin-bottom: 16px;
}

.invoice-summary .duplicate-receipt-warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 20px;
    color: #856404;
}

.invoice-summary .duplicate-receipt-actions {
    margin-top: 12px;
}

.invoice-summary .duplicate-receipt-copy {
    margin: 8px 0 6px;
}

.invoice-summary .duplicate-receipt-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin-top: 2px;
}

.invoice-summary .duplicate-receipt-choice {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
}

.invoice-summary .duplicate-receipt-choice-btn {
    width: fit-content;
}

.invoice-summary .duplicate-receipt-choice-copy {
    font-size: 0.8rem;
    line-height: 1.25;
    color: #6b7280;
    margin: 0;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.summary-item label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.summary-item label.summary-label-emphasis {
    color: #4f46e5;
    font-weight: 600;
}

.summary-item .value {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

/* Editable Input Styles */
.edit-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s;
}

.edit-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.edit-input.total-input {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
}

.summary-item input.edit-input {
    font-size: 1.1em;
    font-weight: 500;
}

.invoice-summary input[data-field="subtotal"],
.invoice-summary input[data-field="discount"],
.invoice-summary input[data-field="tax"],
.invoice-summary input[data-field="shipping"],
.invoice-summary input[data-field="total"] {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Invoice summary action row: Distribute + info + View Receipt */
.summary-actions {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.summary-actions .btn-distribute {
    flex: none;
    width: 100%;
    min-width: 0;
}

.summary-actions .btn-distribute .btn-label-compact {
    display: none;
}

.summary-action-helper {
    margin-top: -2px;
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.3;
}

.summary-action-status {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 2px;
    font-size: 0.82rem;
    color: #047857;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.summary-action-status-wrap {
    width: 100%;
    max-width: 100%;
    margin-top: -6px;
}

.summary-action-status-wrap.state-hidden {
    display: none !important;
}

.summary-action-status-wrap.state-visible {
    display: block;
}

.summary-actions.state-totals-applied .summary-action-helper {
    display: none;
}

.summary-actions .btn-distribute.state-reapply {
    opacity: 0.9;
}

.summary-view-action {
    grid-column: span 2;
    display: flex;
    align-items: flex-start;
}

.summary-view-action .btn-view-receipt {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.parser-rating-section {
    margin-top: 18px;
    padding: 14px 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.parser-rating-title {
    margin: 0 0 12px;
}

.parser-rating-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

.parser-rating-stars-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.parser-rating-selected {
    margin-left: 8px;
    font-weight: 700;
    color: #333;
}

.parser-feedback-section {
    margin: 6px 0 10px;
}

.parser-feedback-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.parser-rating-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.parser-retry-option {
    padding: 10px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
}

.parser-retry-title {
    margin: 0 0 2px;
    font-weight: 700;
}

.parser-retry-copy {
    margin: 0 0 8px;
}

.parser-rating-thanks {
    padding: 10px 0 14px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 12px;
}

.parser-rating-thanks-text {
    font-size: 1.05em;
    color: #333;
    margin: 0;
}

.parser-rating-section.parser-rating-submitted .parser-rating-title {
    display: none;
}

.review-section .notes {
    background: #fdf6dd;
    border-left-color: #f3c642;
    color: #5f5a44;
    font-size: 0.9em;
    margin-top: 14px;
    padding: 12px;
}

.line-items {
    margin-top: 30px;
}

.line-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.line-items h3 {
    color: #667eea;
    margin: 0;
    font-size: 1.5em;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

.line-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    transition: all 0.3s;
    position: relative;
}

.line-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.btn-remove-line {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.92em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    position: relative;
}

.btn-remove-line:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
    transform: scale(1.03);
}

.btn-remove-line:active {
    background: #fde8e8;
}

.btn-remove-line::before {
    content: '';
    position: absolute;
    inset: -9px;
}

.line-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}

.line-item-identity {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 0;
    align-items: flex-start;
}

.line-item-title {
    flex: 1;
    min-width: 0;
}

.line-item-thumb-wrap {
    flex-shrink: 0;
}

.line-item-thumb {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f8fafc;
}

.line-item-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.line-item-title h4 {
    color: #333;
    margin: 0 0 2px 0;
    font-size: 1.04rem;
    line-height: 1.25;
    font-weight: 650;
}

.line-item-title-display.state-hidden {
    display: none !important;
}

.line-item-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.line-item-title-actions {
    margin-top: 6px;
}

.line-item-lookup-btn {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 0.76rem;
    line-height: 1.1;
    white-space: nowrap;
}

.line-item-lookup-btn.state-hidden {
    display: none !important;
}

.line-item-lookup-btn-set {
    margin-left: 2px;
}

.bricklink-lookup-inline {
    margin: 3px 0 4px;
}

.bricklink-lookup-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.field-inline-labeled.field-inline-labeled-compact {
    min-width: 185px;
    flex: 1 1 220px;
}

.field-inline-labeled.field-inline-labeled-compact .edit-input {
    min-height: 34px;
}

.set-search-icon-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f8fafc;
    color: #4b5563;
    font-size: 0.85rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.set-search-icon-btn:hover {
    background: #eef2ff;
    border-color: #a5b4fc;
    color: #4338ca;
}

.line-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    color: #6b7280;
    font-size: 0.74rem;
    opacity: 0.88;
    margin-bottom: 4px;
}

.line-item-meta-theme {
    font-size: 0.73rem;
    font-weight: 500;
    flex-basis: 100%;
}

.line-item-meta-secondary-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-basis: 100%;
}

.line-item-meta-secondary {
    font-size: 0.73rem;
}

.line-item-meta-dot {
    color: #94a3b8;
    font-size: 0.7rem;
}

.line-item-meta-set-number {
    color: #4f46e5;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.line-item-meta-set-number:hover {
    text-decoration: underline;
}

.line-item-meta-set-number:focus-visible {
    outline: 2px solid #c7d2fe;
    outline-offset: 2px;
    border-radius: 3px;
}

.line-item-meta-item-no {
    color: #4f46e5;
    font-weight: 600;
    cursor: pointer;
}

.line-item-meta-item-no:hover {
    text-decoration: underline;
}

.line-item-meta-item-no:focus-visible {
    outline: 2px solid #c7d2fe;
    outline-offset: 2px;
    border-radius: 3px;
}

.line-item-title-edit-wrap {
    margin-bottom: 4px;
}

.line-item-title-edit {
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 0.9rem;
}

.line-item-title-input {
    min-height: 36px;
    font-size: 1.02rem;
    font-weight: 620;
    letter-spacing: 0.01em;
    background: #f8fafc;
    border: 1px solid #e6ebf2;
    border-radius: 8px;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.03);
}

.line-item-title-textarea {
    width: 100%;
    min-height: 54px;
    max-height: 132px;
    line-height: 1.32;
    resize: none;
    overflow-y: auto;
    white-space: pre-wrap;
}

.collection-item-display-name-wrap .line-item-title-textarea {
    min-height: 76px;
}

.line-item-title-input:focus {
    background: #ffffff;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.line-item-set-controls {
    display: block;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #eef2f7;
}

.line-item-set-controls.state-hidden {
    display: none !important;
}

.bricklink-set-suggestion {
    margin-top: 6px;
    margin-bottom: 4px;
    padding: 8px 10px;
    background: #fff8e8;
    border: 1px solid #f1d99f;
    border-radius: 6px;
}

.bricklink-set-suggestion.state-hidden {
    display: none !important;
}

.bricklink-set-suggestion-copy {
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #7a5a17;
}

.bricklink-set-suggestion-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.line-item-meta .section-set-controls.state-visible {
    display: inline !important;
}

.line-item-badge.section-set-controls.state-visible {
    display: inline-block !important;
}

.set-search-icon-btn.section-set-controls.state-visible {
    display: inline-flex !important;
}

.line-item-set-controls .set-number-input-group {
    margin-bottom: 8px;
    gap: 12px;
}

.line-item-set-controls .set-search-select-wrapper .edit-input {
    min-height: 34px;
    padding: 6px 8px;
}

.description-edit {
    margin-top: 8px;
}

.description-edit label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.description-input {
    width: 100%;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.description-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Normalized LEGO Set Information */
.normalized-set-info {
    margin-top: 10px;
    padding: 10px;
    background: #f0f7ff;
    border: 1px solid #c3d9ff;
    border-radius: 6px;
}

/* Minifig search and info on line item - same blue border as LEGO set section */
.minifig-numbers-edit.section-minifig {
    margin-top: 15px;
    padding: 15px;
    background: #f0f7ff;
    border: 1px solid #c3d9ff;
    border-radius: 6px;
}

.set-info-header h5 {
    margin: 0 0 10px 0;
    color: #667eea;
    font-size: 1em;
    font-weight: 600;
}

.set-info-content {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.set-info-image {
    flex-shrink: 0;
}

.set-info-image .set-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

/* Minifig info (image + details) on line item - same layout as set info */
.minifig-info-image-and-details {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-top: 10px;
}

.minifig-info-image {
    flex-shrink: 0;
}

.minifig-info-image .minifig-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.set-info-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.set-info-item {
    display: flex;
    gap: 10px;
}

.set-info-label {
    font-weight: 500;
    color: #666;
    min-width: 60px;
    font-size: 0.9em;
}

.set-info-value {
    color: #333;
    font-size: 0.9em;
}

/* Ensure toggles align left under Includes label */
.line-item-toggles {
    padding-left: 0 !important;
    margin-left: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.line-item-toggles > label {
    display: block !important;
}

.line-item-toggles > div {
    padding-left: 0 !important;
    margin-left: 0 !important;
    justify-content: flex-start !important;
    display: flex !important;
}

.line-item-toggles .filter-toggle {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Responsive styles for Set Information section */
@media (max-width: 768px) {
    /* Stack Set Number and Includes vertically on smaller screens */
    .set-info-content > div:first-child {
        flex-direction: column !important;
        gap: 15px !important;
        align-items: stretch !important;
    }
    
    .set-select-wrapper {
        width: 100% !important;
        flex: none !important;
        min-width: 0 !important;
    }
    
    .set-select-wrapper input {
        width: 100% !important;
        min-width: 0 !important;
    }
    
    .line-item-toggles {
        width: 100% !important;
        flex: none !important;
        min-width: 0 !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
    }
    
    .line-item-toggles > div {
        padding-left: 0 !important;
        margin-left: 0 !important;
    }
    
    .line-item-toggles .filter-toggle {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
    
    .line-item-toggles > div {
        flex-wrap: wrap !important;
        gap: 10px !important;
        justify-content: flex-start !important;
    }
    
    .filter-toggle {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Ensure image and details stack on very small screens */
    .set-info-image-and-details,
    .minifig-info-image-and-details {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .set-info-image,
    .minifig-info-image {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .set-info-content {
        flex-direction: column;
    }
    
    .set-info-image .set-image,
    .minifig-info-image .minifig-image {
        width: 80px;
        height: 80px;
    }
}

.limited-edition-fields {
    margin-top: 10px;
    margin-bottom: 10px;
}

.edition-input-group {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.edition-input {
    flex: 1;
    min-width: 0;
}

.edition-input label {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.edition-input .edit-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: inherit;
    transition: border-color 0.2s;
}

.edition-input .edit-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.line-item-badges .limited-edition-fields {
    margin-top: 4px;
    margin-bottom: 0;
    width: 100%;
    max-width: none;
    align-self: stretch;
}

.line-item-badges .edition-input-group {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
}

.line-item-badges .edition-input .edit-input {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 0.8rem;
}

.line-item-badges .edition-input {
    flex: 0 0 92px;
}

.line-item-badges .edition-input:last-child {
    flex-basis: 112px;
}

.edition-input-connector {
    font-size: 0.74rem;
    color: #64748b;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .edition-input-group {
        flex-direction: column;
        gap: 10px;
    }
}

.line-item-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    margin: 0;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.line-item-badges {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 0;
    margin-left: auto;
    width: 240px;
    max-width: 40%;
    align-self: flex-start;
    align-items: stretch;
    justify-content: flex-start;
}

.line-item-badge-group {
    display: flex;
    flex-wrap: wrap;
    column-gap: 6px;
    row-gap: 10px;
    justify-content: flex-start;
}

.line-item-badge-group-includes {
    margin-top: 0;
}

.line-item-actions {
    margin-left: 10px;
    align-self: flex-start;
}

.line-item-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.badge-gift.active {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #f6d98d;
}

.badge-gift.inactive {
    background: #eceff3;
    color: #5e6775;
    opacity: 0.9;
    border: 1px solid #d6dde7;
}

.badge-gift-received.active {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #f6d98d;
}

.badge-gift-received.inactive {
    background: #eceff3;
    color: #5e6775;
    opacity: 0.9;
    border: 1px solid #d6dde7;
}

.badge-limited.active {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #b8e2eb;
}

.badge-limited.inactive {
    background: #eceff3;
    color: #5e6775;
    opacity: 0.9;
    border: 1px solid #d6dde7;
}

.badge-includes.active {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    font-weight: 700;
}

.badge-includes.inactive {
    background: #eef2f7;
    color: #5b6472;
    opacity: 0.9;
    border: 1px solid #d9e1ea;
}

.line-item-details {
    display: grid;
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 8px;
    padding-top: 9px;
    border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.line-item-pricing-grid .detail-item {
    min-width: 0;
}

.line-item .detail-item {
    font-size: 0.85em;
}

.line-item .detail-item label {
    display: block;
    color: #666;
    margin-bottom: 3px;
    font-size: 0.78rem;
}

.line-item .detail-item .value {
    font-weight: bold;
    color: #333;
}

.field-inline-labeled {
    position: relative;
}

.field-inline-label {
    position: absolute;
    top: 6px;
    left: 10px;
    font-size: 0.72rem;
    line-height: 1;
    color: #64748b;
    pointer-events: none;
    z-index: 1;
}

.line-item .field-inline-labeled .edit-input {
    padding-top: 19px;
    padding-bottom: 6px;
    min-height: 44px;
}

.line-item .field-inline-labeled-total .field-inline-label {
    color: #4f46e5;
    font-weight: 600;
}

.summary-item .field-inline-label {
    top: 6px;
    font-size: 0.72rem;
}

.summary-item .field-inline-labeled .edit-input {
    padding-top: 19px;
    padding-bottom: 6px;
    min-height: 44px;
}

.summary-item .field-inline-labeled-secondary .field-inline-label {
    color: #6b7280;
}

.summary-item .field-inline-labeled-total .field-inline-label {
    color: #4f46e5;
    font-weight: 600;
}

.set-numbers {
    margin-top: 10px;
}

.set-number-tag {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    margin-right: 5px;
    margin-top: 5px;
}

.set-numbers-edit {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.set-numbers-edit label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.set-numbers-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    font-family: inherit;
    transition: border-color 0.2s;
}

.set-numbers-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.line-item .detail-item input.edit-input,
.line-item .detail-item select.edit-input {
    width: 100%;
    margin-top: 2px;
}

.line-item .product-type-state-collection-group {
    gap: 8px;
    margin-top: 6px;
}

.line-item .product-type-state-collection-group .detail-item {
    min-width: 120px;
}

.line-item .product-type-state-collection-group .detail-item.detail-item-collection {
    flex: 1.35;
    min-width: 170px;
}

.pricing-label-emphasis {
    color: #4f46e5 !important;
    font-weight: 600;
}

.pricing-total-input {
    font-weight: 780;
    color: #4338ca;
    border-color: #bcc9ff;
    background: #f7f9ff;
}

.line-item-pricing-grid input[type="number"] {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.line-item-details-block {
    border-top: 1px solid #f3f6fa;
    padding-top: 8px;
}

@media (max-width: 768px) {
    .line-item {
        margin-bottom: 12px;
    }

    .line-item-header {
        margin-bottom: 8px;
    }

    .line-item-identity {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .line-item-title {
        min-width: 0;
        flex: 1;
    }

    .line-item-title h4 {
        margin-bottom: 1px;
    }

    .line-item-meta {
        gap: 1px 6px;
        margin-bottom: 3px;
    }

    .line-item-meta-theme {
        font-size: 0.71rem;
    }

    .line-item-meta-secondary {
        font-size: 0.71rem;
    }

    .line-item-meta-secondary-row {
        gap: 5px;
    }

    .line-item-badges {
        margin-top: 1px;
        gap: 3px;
        margin-left: 0;
        max-width: none;
        width: 100%;
        align-self: stretch;
        align-items: stretch;
    }

    .line-item-badge-group {
        gap: 5px 6px;
        justify-content: flex-start;
    }

    .line-item-badge-group-includes {
        margin-top: 2px;
    }

    .line-item-badges .limited-edition-fields {
        max-width: none;
        width: 100%;
        align-self: stretch;
    }

    .line-item-badges .edition-input-group {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        align-items: center;
    }

    .line-item-badges .edition-input-connector {
        display: inline;
    }

    .line-item-badges .edition-input {
        flex: 0 0 92px;
        min-width: 0;
    }

    .line-item-badges .edition-input:last-child {
        flex-basis: 112px;
    }

    .line-item-badges .edition-input .edit-input {
        min-height: 34px;
        font-size: 0.82rem;
    }

    .line-item-actions {
        margin-left: 0;
    }

    .line-item .field-inline-labeled .edit-input {
        min-height: 40px;
        padding-top: 17px;
        padding-bottom: 5px;
    }

    .line-item .product-type-state-collection-group {
        gap: 6px;
        margin-top: 5px;
    }

    .line-item-details.line-item-pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .line-item-details.line-item-pricing-grid .detail-item:last-child {
        grid-column: 1 / -1;
    }

    .section-accessory-selection {
        margin-top: 14px;
        padding-top: 12px;
    }

    .section-accessory-selection .btn {
        width: 100%;
        min-height: 40px;
        padding-top: 9px;
        padding-bottom: 9px;
        background: #6f7d8f;
        border-color: #6f7d8f;
    }

    .section-lego-set-selection .btn {
        width: 100%;
    }

    .section-accessory-selection .selected-accessories-list {
        margin-top: 6px !important;
    }
}

@media (max-width: 360px) {
    .line-item-details.line-item-pricing-grid {
        grid-template-columns: 1fr;
    }

    .line-item-details.line-item-pricing-grid .detail-item:last-child {
        grid-column: auto;
    }
}

.section-lego-set-selection {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.no-items {
    color: #666;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading {
    position: relative;
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    top: 50%;
    right: 15px;
    margin-top: -7px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

a.btn {
    text-decoration: none;
    color: inherit;
}

a.btn:hover {
    text-decoration: none;
    color: inherit;
}

a.btn:visited {
    text-decoration: none;
    color: inherit;
}

/* a.btn uses color:inherit (higher specificity than .btn-primary alone); force variant colors on link buttons */
a.btn.btn-primary,
a.btn.btn-primary:visited,
a.btn.btn-primary:hover,
a.btn.btn-primary:focus {
    color: #fff;
}

a.btn.btn-secondary,
a.btn.btn-secondary:visited,
a.btn.btn-secondary:hover,
a.btn.btn-secondary:focus {
    color: #fff;
}

.btn-primary {
    background: #667eea;
    color: white;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.notes {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    font-size: 0.95em;
}

/* ============================================
   Site Header Styles (Modern & Responsive)
   ============================================ */

.site-header {
    background: var(--bp-header-bg);
    color: var(--bp-header-text);
    box-shadow: var(--bp-header-shadow);
    border-bottom: 1px solid var(--bp-header-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

/* Optional announcement banner (Admin > General) */
.header-announcement {
    width: 100%;
    padding: 8px 20px;
    background: var(--bp-header-announcement-bg);
    color: var(--bp-header-announcement-text);
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.4;
}

.header-announcement-facebook-deletion {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header-announcement-facebook-deletion a {
    color: var(--bp-header-announcement-link);
    text-decoration: underline;
}

.header-facebook-dismiss-form {
    display: inline-block;
    margin: 0;
}

.header-content {
    max-width: var(--bp-shell-max-width);
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 74px;
}

.header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--bp-header-text);
    transition: opacity 0.2s;
}

.logo-link:hover {
    opacity: var(--bp-header-logo-hover-opacity);
}

.logo-link:focus-visible {
    outline: 2px solid var(--bp-color-brand-500);
    outline-offset: 4px;
    border-radius: 6px;
}

.site-header .header-logo {
    width: auto;
    margin-top: 0;
    object-fit: contain;
    display: none;
}

.site-header .header-logo-desktop {
    height: 50px;
    max-height: 50px;
    max-width: 280px;
}

.site-header .header-logo-mobile {
    height: 36px;
    max-height: 36px;
    max-width: 132px;
}

.site-header .header-logo-desktop.header-logo-light {
    display: block;
}

html[data-theme="dark"] .site-header .header-logo-desktop.header-logo-light {
    display: none;
}

html[data-theme="dark"] .site-header .header-logo-desktop.header-logo-dark {
    display: block;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
}

.header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.site-header .nav-menu {
    display: flex;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.site-header .nav-menu li {
    margin: 0;
}

.site-header .nav-menu a {
    display: block;
    padding: 9px 14px;
    color: var(--bp-header-link);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    border-radius: 6px;
    position: relative;
}

.site-header .nav-menu a:hover {
    background: var(--bp-header-link-hover-bg);
    transform: translateY(-1px);
}

.site-header .nav-menu a:focus-visible {
    outline: 2px solid var(--bp-color-brand-500);
    outline-offset: 2px;
}

.site-header .nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: var(--bp-header-link-underline);
    transition: transform 0.2s;
}

.site-header .nav-menu a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Header dropdown menu item styling */
.nav-menu .dropdown-menu-item {
    position: relative;
}

/* Create a bridge area to prevent hover gap between menu item and submenu */
.nav-menu .dropdown-menu-item::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
    z-index: 999;
}

/* Shared header submenu */
.site-header .header-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bp-header-submenu-bg);
    border: 1px solid var(--bp-header-submenu-border);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: var(--bp-header-submenu-shadow);
    min-width: 180px;
    padding: 12px 0 8px 0;
    margin-top: 0;
    z-index: 1000;
    list-style: none;
}

/* Show submenu when hovering over parent menu item or the submenu itself */
.nav-menu .dropdown-menu-item:hover .header-submenu,
.header-submenu:hover {
    display: block;
}

.site-header .header-submenu li {
    margin: 0;
    padding: 0;
}

.site-header .header-submenu a {
    display: block;
    padding: 10px 20px;
    color: var(--bp-header-submenu-link);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    position: relative;
}

.site-header .header-submenu-link-disabled {
    display: block;
    padding: 10px 20px;
    color: var(--bp-header-submenu-disabled);
    cursor: not-allowed;
    user-select: none;
}

.site-header .header-submenu a::after {
    display: none;
}

.site-header .header-submenu a:hover {
    background: var(--bp-header-submenu-link-hover-bg);
    color: var(--bp-header-submenu-link);
}

.site-header .header-submenu a:focus-visible {
    outline: 2px solid var(--bp-color-brand-500);
    outline-offset: -2px;
}

.header-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

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

.user-name {
    margin-right: 10px;
    font-weight: 500;
}

/* User menu: avatar + dropdown modal */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.site-header .user-menu-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--bp-header-avatar-border);
    background: var(--bp-header-avatar-bg);
    color: var(--bp-header-avatar-text);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, filter 0.2s;
}

.site-header .user-menu-avatar:hover {
    filter: var(--bp-header-avatar-hover-filter);
}

html[data-theme="dark"] .site-header .user-menu-avatar:hover {
    filter: none;
    background: rgba(255, 255, 255, 0.35);
    border-color: #ffffff;
}

.site-header .user-menu-avatar.active {
    filter: var(--bp-header-avatar-active-filter);
    box-shadow: var(--bp-header-avatar-active-ring);
}

html[data-theme="dark"] .site-header .user-menu-avatar.active {
    filter: none;
    background: rgba(255, 255, 255, 0.4);
    border-color: #ffffff;
}

.user-menu-initials {
    line-height: 1;
    text-transform: uppercase;
}

.user-menu-modal {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 12px 0;
    z-index: 1002;
    display: none;
}

.user-menu.open .user-menu-modal {
    display: block;
}

.user-menu-modal-name {
    padding: 0 16px 10px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    word-break: break-word;
}

.user-menu-modal-link {
    display: block;
    padding: 10px 16px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.user-menu-admin-trigger {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-menu-admin-item {
    position: relative;
}

.user-menu-admin-submenu {
    position: absolute;
    top: -8px;
    right: calc(100% + 6px);
    min-width: 220px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 8px 0;
    display: none;
    z-index: 1003;
}

.user-menu-admin-item:hover .user-menu-admin-submenu,
.user-menu-admin-item.state-open .user-menu-admin-submenu {
    display: block;
}

.user-menu-modal-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #5568d3;
}

.user-menu-modal-divider {
    height: 1px;
    background: #eee;
    margin: 6px 0;
}

.user-menu-modal-logout {
    color: #666;
}

.user-menu-modal-logout:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--bp-btn-outline-border);
    color: var(--bp-btn-outline-text);
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    display: inline-block;
}

.btn-outline:hover {
    background: var(--bp-btn-outline-hover-bg);
    color: var(--bp-btn-outline-hover-text);
    border-color: var(--bp-btn-outline-hover-border);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

a.btn.btn-outline:hover,
a.btn.btn-outline:focus {
    color: var(--bp-btn-outline-hover-text);
}

.site-header .auth-section .btn-outline,
.site-header .header-announcement .btn-outline {
    border-color: var(--bp-header-cta-outline-border);
    color: var(--bp-header-cta-outline-text);
}

.site-header .auth-section .btn-outline:hover,
.site-header .header-announcement .btn-outline:hover {
    background: var(--bp-header-cta-outline-hover-bg);
    color: var(--bp-header-cta-outline-hover-text);
    border-color: var(--bp-header-cta-outline-hover-border);
}

.site-header .auth-section a.btn.btn-outline:hover,
.site-header .auth-section a.btn.btn-outline:focus,
.site-header .header-announcement a.btn.btn-outline:hover,
.site-header .header-announcement a.btn.btn-outline:focus {
    color: var(--bp-header-cta-outline-hover-text);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 5px;
    z-index: 1001;
}

.site-header .mobile-menu-toggle:focus-visible {
    outline: 2px solid var(--bp-color-brand-500);
    outline-offset: 3px;
    border-radius: 4px;
}

.site-header .mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--bp-header-burger);
    border-radius: 3px;
    transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Main Content Spacing */
.main-content {
    min-height: calc(100vh - 70px);
    padding-top: 0;
}

/* Responsive Design */
@media (max-width: 968px) {
    .header-content {
        padding: 0 15px;
        height: 65px;
    }
    
    .site-title {
        font-size: 1.3rem;
    }
    
    .site-header .header-logo-desktop {
        height: 44px;
        max-height: 44px;
        max-width: 240px;
    }
    
    .nav-menu {
        gap: 5px;
    }
    
    .nav-menu a {
        padding: 8px 15px;
        font-size: 0.95rem;
    }
    
    .auth-section {
        gap: 8px;
    }
    
    .btn-outline,
    .btn-primary {
        padding: 6px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .mobile-menu-toggle {
        display: flex;
        order: 1;
        margin: 0;
        z-index: 2;
    }
    
    .header-nav {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        background: var(--bp-header-mobile-nav-bg);
        border-bottom: 1px solid var(--bp-header-mobile-nav-border);
        box-shadow: var(--bp-header-mobile-nav-shadow);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        z-index: 999;
    }
    
    .header-nav.active {
        max-height: calc(100vh - 65px);
        overflow-y: auto;
    }
    
    .nav-menu {
        flex-direction: column;
        padding: 20px;
        gap: 0;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu a {
        padding: 15px 20px;
        border-radius: 6px;
        width: 100%;
    }
    
    .nav-menu a::after {
        display: none;
    }
    
    /* Header submenu in mobile */
    .site-header .header-submenu {
        position: static;
        display: none;
        background: var(--bp-header-mobile-submenu-bg);
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin-top: 0;
        padding: 0;
    }
    
    .nav-menu .dropdown-menu-item:hover .header-submenu,
    .nav-menu .dropdown-menu-item.active .header-submenu {
        display: block;
    }
    
    .header-submenu a {
        padding-left: 40px;
    }
    
    .header-left {
        order: 2;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        z-index: 1;
        pointer-events: none;
    }

    .header-left .logo-link {
        pointer-events: auto;
    }

    .header-right {
        order: 3;
        margin-left: auto;
        z-index: 2;
    }
    
    .user-menu-modal {
        right: 8px;
        min-width: 180px;
    }

    .user-menu-admin-submenu {
        position: static;
        min-width: 0;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        margin-left: 12px;
        margin-bottom: 4px;
    }
    
    .auth-section {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .btn-outline,
    .btn-primary {
        width: 100%;
        text-align: center;
    }
    
    .site-title {
        font-size: 1.2rem;
    }
    
    .site-header .header-logo-desktop {
        height: 34px;
        max-height: 34px;
        max-width: 170px;
    }

    .site-header .header-logo-mobile {
        display: none;
    }

    .site-header .header-logo-desktop.header-logo-dark {
        display: none;
    }

    .site-header .header-logo-desktop.header-logo-light {
        display: block;
    }

    html[data-theme="dark"] .site-header .header-logo-desktop.header-logo-light {
        display: none;
    }

    html[data-theme="dark"] .site-header .header-logo-desktop.header-logo-dark {
        display: block;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 10px;
        height: 60px;
    }
    
    .logo-link {
        gap: 8px;
    }
    
    .site-title {
        font-size: 1.1rem;
    }
    
    .site-header .header-logo-desktop {
        height: 28px;
        max-height: 28px;
        max-width: 145px;
    }
    
    .header-nav {
        top: 60px;
    }

    .header-nav.active {
        max-height: calc(100vh - 60px);
    }
}

/* ============================================
   Footer Styles
   ============================================ */

.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.footer-copyright {
    margin: 0;
    opacity: 0.95;
}

.footer-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0;
}

.footer-nav a {
    display: inline-flex;
    align-items: center;
    color: white;
    text-decoration: none;
    opacity: 0.92;
    transition: opacity 0.2s;
}

.footer-nav a + a::before {
    content: "\00B7";
    margin: 0 10px;
    opacity: 0.75;
}

.footer-nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-legal-line {
    max-width: 1400px;
    margin: 10px auto 0;
    font-size: 0.8rem;
    opacity: 0.78;
    line-height: 1.35;
    text-align: center;
}

.footer-attribution {
    max-width: 1400px;
    margin: 8px auto 0;
    padding-top: 0;
    text-align: center;
}

.attribution-text {
    font-size: 0.8rem;
    opacity: 0.78;
    margin: 2px 0;
    line-height: 1.35;
}

.attribution-text a {
    color: white;
    text-decoration: underline;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.attribution-text a:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .footer {
        padding: 20px 15px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .footer-nav {
        justify-content: center;
    }
    
    .footer-legal-line {
        margin-top: 8px;
    }

    .footer-attribution {
        margin-top: 8px;
        padding-top: 0;
    }
    
    .attribution-text {
        font-size: 0.8rem;
    }
}

/* Set Search Styles */
.set-search-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.set-search-input-wrapper {
    position: relative;
}

.set-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.set-search-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.set-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 2px;
}

.search-result-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* LEGO Set Search Result Modal Item (with image) */
.search-result-item-modal {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: background-color 0.2s, border-color 0.2s;
}

.search-result-item-modal:hover:not(.keyboard-selected) {
    background-color: #f5f5f5;
}

.search-result-item-modal:active {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.search-result-item-modal.keyboard-selected {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.search-result-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
    background-color: white;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-number {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.search-result-name {
    color: #666;
    font-size: 1em;
    margin-bottom: 5px;
}

.search-result-theme {
    color: #999;
    font-size: 0.9em;
}

.search-result-set-number {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
}

.search-result-name {
    color: #666;
    font-size: 13px;
    margin-bottom: 2px;
}

.search-result-theme {
    color: #999;
    font-size: 12px;
}

.search-no-results,
.search-error {
    padding: 12px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Set Chips Styles */
.set-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
}

.set-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 16px;
    font-size: 13px;
    max-width: 100%;
}

.set-chip-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
    background-color: white;
}

.set-chip-icon-fallback {
    font-size: 1.2em;
    flex-shrink: 0;
}

.set-chip-number {
    font-weight: 600;
    color: #1976d2;
}

.set-chip-name {
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.set-chip-remove {
    background: none;
    border: none;
    color: #1976d2;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    margin-left: 4px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.set-chip-remove:hover {
    background-color: rgba(25, 118, 210, 0.1);
}

.set-chip-remove:focus {
    outline: none;
    background-color: rgba(25, 118, 210, 0.2);
}

/* Welcome Page Styles */
.page-header {
    text-align: center;
    padding: 40px 20px;
    border-bottom: 2px solid #f0f0f0;
}

.page-header h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
}

.page-header .lead {
    font-size: 1.3em;
    color: #666;
    font-weight: 300;
}

.page-header .lead-sub {
    font-size: 1em;
    color: #666;
    margin-top: 0.5rem;
}

.page-header .lead-sub a {
    color: #667eea;
}

/* Legal pages: Terms, Privacy, Accept Terms – modern doc layout */
.legal-page .page-header {
    padding: 2.5rem 1.5rem 1.5rem;
    border-bottom: none;
}

.legal-page .page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.legal-page .doc-meta {
    font-size: 0.875rem;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: #f1f5f9;
    border-radius: 9999px;
    margin-top: 0.25rem;
}

.legal-page .doc-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.legal-page .doc-content .doc-notice {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.legal-page .doc-content .doc-notice-pending {
    background: #fef3c7;
    border-color: #f59e0b;
}

.legal-page .doc-content .doc-notice-dismissed {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.legal-page .doc-content .doc-notice-request-param {
    background: #dbeafe;
    border-color: #3b82f6;
}

.legal-page .doc-content .doc-notice p {
    margin-bottom: 0;
}

.legal-page .doc-content section {
    margin-bottom: 2.25rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #f1f5f9;
}

.legal-page .doc-content section:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.legal-page .doc-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

.legal-page .doc-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #334155;
    margin: 1.25rem 0 0.5rem;
}

.legal-page .doc-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: #475569;
}

.legal-page .doc-content ul {
    margin: 0.75rem 0 1rem 1.5rem;
    line-height: 1.7;
    color: #475569;
}

.legal-page .doc-content li {
    margin-bottom: 0.5rem;
}

.legal-page .doc-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.legal-page .doc-content a:hover {
    text-decoration: underline;
}

.legal-page .doc-content strong {
    color: #334155;
}

/* Accept-terms: form card and CTA */
.legal-page .accept-terms-card {
    max-width: 560px;
    margin: 0 auto;
    padding: 2rem 1.5rem 2.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.legal-page .accept-terms-card .lead {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 1.25rem;
}

.legal-page .accept-terms-links {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.legal-page .accept-terms-links li {
    margin: 0;
}

.legal-page .accept-terms-links a {
    color: #667eea;
    font-weight: 500;
}

.legal-page .accept-terms-links a:hover {
    text-decoration: underline;
}

.legal-page .checkbox-label {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5;
    color: #334155;
}

.legal-page .checkbox-label input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0.15rem 0 0;
    flex-shrink: 0;
    accent-color: #667eea;
}

.legal-page .accept-terms-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.legal-page .accept-terms-actions .btn-outline {
    margin-left: auto;
}

@media (max-width: 768px) {
    .legal-page .doc-content,
    .legal-page .accept-terms-card {
        padding: 1.5rem 1rem 2rem;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
}

/* Home page landing sections */
.content-constrained {
    max-width: 960px;
    margin: 0 auto;
}

.landing-section {
    margin: 48px 0;
}

.landing-section h2 {
    color: #667eea;
    font-size: 1.75em;
    margin-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.landing-section p {
    font-size: 1.1em;
    line-height: 1.7;
    color: #555;
    margin-bottom: 1rem;
}

.hero-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0 3rem;
}

.hero-text {
    flex: 1;
    min-width: 280px;
}

.hero-title {
    font-size: 2.25em;
    color: #333;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.hero-tagline {
    font-size: 1.5em;
    font-weight: 600;
    color: #667eea;
    margin: 0 0 1rem;
    line-height: 1.3;
}

.hero-subheadline {
    font-size: 1.25em;
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.hero-cta-wrap {
    margin: 0;
}

.hero-cta {
    display: inline-block;
}

.hero-image-wrap {
    flex: 0 1 560px;
    max-width: 560px;
    min-width: 280px;
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.homepage-legal-notice {
    margin: -0.5rem 0 2rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.homepage-legal-notice p {
    margin: 0;
    font-size: 0.95em;
    color: #6b7280;
    line-height: 1.5;
}

.cloud-list {
    margin: 1rem 0 1rem 1.5rem;
    padding: 0;
    line-height: 1.7;
    color: #555;
}

.cloud-list li {
    margin-bottom: 0.35rem;
}

.founder-quote {
    margin: 1rem 0;
    padding-left: 1.25rem;
    border-left: 4px solid #667eea;
    color: #555;
    font-style: italic;
}

.hero-story-link {
    color: #667eea;
    font-weight: 500;
    text-decoration: none;
}

.hero-story-link:hover {
    text-decoration: underline;
}

.final-cta-one-liner {
    margin-bottom: 0.5rem;
}

.final-cta-section {
    text-align: center;
}

.final-cta-section .hero-cta-wrap {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        margin: 1.5rem 0 2rem;
    }
    .homepage-legal-notice {
        margin: -0.25rem 0 1.5rem;
    }
    .hero-image-wrap {
        flex: 1 1 auto;
        max-width: 100%;
        min-width: 0;
    }
    .hero-title {
        font-size: 1.75em;
    }
    .hero-tagline {
        font-size: 1.25em;
    }
    .hero-subheadline {
        font-size: 1.1em;
    }
}

.welcome-section,
.features-section,
.getting-started-section {
    margin: 40px 0;
}

.welcome-section h2,
.features-section h2,
.getting-started-section h2 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.welcome-section p {
    font-size: 1.1em;
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature-card {
    background: #f8f9ff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.feature-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-5px);
}

.feature-card h3 {
    color: #667eea;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.feature-card p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.feature-card .btn {
    margin-top: auto;
    width: 100%;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.features-section .btn,
.hero-section .btn,
.final-cta-section .btn,
.features-section .btn:visited,
.hero-section .btn:visited,
.final-cta-section .btn:visited,
.features-section .btn:hover,
.hero-section .btn:hover,
.final-cta-section .btn:hover {
    color: #fff;
}

.set-image-candidate-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    background: #fafbff;
}

.set-image-candidate-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.set-image-candidate-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.set-image-confidence-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.set-image-confidence-badge.confidence-high {
    background: #e8f7eb;
    color: #1f7a31;
    border-color: #7fcb8e;
}

.set-image-confidence-badge.confidence-medium {
    background: #fff7e6;
    color: #8b5e00;
    border-color: #ffd27a;
}

.set-image-confidence-badge.confidence-low {
    background: #ffeef0;
    color: #a3122a;
    border-color: #f4a2ad;
}

.set-image-confidence-badge.confidence-unknown {
    background: #f1f3f5;
    color: #495057;
    border-color: #ced4da;
}

.set-image-candidate-reason {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Override global hidden file input for set image search */
input[type="file"].set-image-file-input {
    display: block !important;
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
}

input[type="file"].set-image-file-input::file-selector-button {
    margin-right: 10px;
    padding: 6px 10px;
    border: 1px solid #c7c7c7;
    border-radius: 4px;
    background: #f3f4f6;
    color: #222;
    cursor: pointer;
}

.getting-started-list {
    list-style: none;
    counter-reset: step-counter;
    padding: 0;
}

.getting-started-list li {
    counter-increment: step-counter;
    margin-bottom: 30px;
    padding-left: 60px;
    position: relative;
}

.getting-started-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: #667eea;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
}

.getting-started-list li strong {
    display: block;
    color: #333;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.getting-started-list li p {
    color: #555;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2em;
    }
    
    .page-header .lead {
        font-size: 1.1em;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .getting-started-list li {
        padding-left: 50px;
    }
    
    .getting-started-list li::before {
        width: 35px;
        height: 35px;
        font-size: 1em;
    }
}

/* Collection Page Styles */
.page-header h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 10px;
}

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

/* Learn More Collapsible Section */
.learn-more-section {
    margin-top: 20px;
}

.receipt-upgrade-cta {
    margin-top: 0.9rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #e4e8f7;
    border-radius: 10px;
    background: #f8faff;
}

.receipt-upgrade-cta-text {
    margin: 0 0 0.55rem 0;
    color: #49536d;
    font-size: 0.92rem;
}

.receipt-upgrade-cta-btn {
    width: 100%;
    text-align: center;
}

.learn-more-toggle {
    width: 100%;
    background: transparent;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 12px 20px;
    color: #667eea;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    margin-bottom: 0;
}

.learn-more-toggle:hover {
    background: #f8f9ff;
    border-color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.learn-more-toggle .toggle-icon {
    transition: transform 0.3s;
    font-size: 0.9em;
}

.learn-more-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.learn-more-content {
    margin-top: 18px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.learn-more-content.expanded {
    max-height: 3000px;
    padding: 20px 0 12px;
    opacity: 1;
}

/* Benefits Row */
.benefits-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 22px;
    margin: 26px 0 16px;
    padding: 18px 0;
}

.benefit-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.benefit-icon {
    font-size: 3em;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.benefit-item h3 {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.benefit-item p {
    font-size: 0.95em;
    color: #666;
    margin: 0;
}

/* How It Works Section */
.how-it-works-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 2px solid #e0e0e0;
}

.how-it-works-section h3 {
    font-size: 1.8em;
    color: #667eea;
    text-align: center;
    margin-bottom: 20px;
}

.steps-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 18px;
}

.step-item {
    text-align: center;
    padding: 14px;
    position: relative;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.step-item h4 {
    font-size: 1em;
    color: #333;
    margin: 0;
    font-weight: 500;
    line-height: 1.4;
}

.helper-text {
    text-align: center;
    font-size: 0.95em;
    color: #666;
    font-style: italic;
    margin-top: 16px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* Smart Import page spacing refinements */
.container[data-smart-import-default-state] .page-header {
    padding-top: 28px;
    padding-bottom: 24px;
}

.container[data-smart-import-default-state] > .content {
    padding-top: 16px;
    padding-bottom: 32px;
}

.container[data-smart-import-default-state] .smart-import-intro {
    margin: 0 0 20px;
    font-size: 1.1em;
    color: #666;
}

.container[data-smart-import-default-state] .smart-import-disclaimer {
    margin-top: 0;
    margin-bottom: 16px;
}

.container[data-smart-import-default-state] .upload-section {
    margin-top: 6px;
    margin-bottom: 22px;
    border-color: #5f74e4;
    background: #f6f8ff;
    box-shadow: 0 8px 22px rgba(102, 126, 234, 0.12);
}

.container[data-smart-import-default-state] .upload-section-intro {
    margin: 16px 0;
    color: #666;
}

.container[data-smart-import-default-state] .upload-ready-helper {
    margin: 0 0 10px;
    text-align: center;
    color: #67718a;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container[data-smart-import-default-state] .page-header {
        padding-top: 20px;
        padding-bottom: 18px;
    }

    .container[data-smart-import-default-state] > .content {
        padding-top: 14px;
        padding-bottom: 24px;
    }

    .container[data-smart-import-default-state] .learn-more-section {
        margin-top: 14px;
    }

    .container[data-smart-import-default-state] .learn-more-content.expanded {
        padding: 14px 0 8px;
    }

    .container[data-smart-import-default-state] .benefits-row,
    .container[data-smart-import-default-state] .steps-row {
        gap: 16px;
    }

    .container[data-smart-import-default-state] .how-it-works-section {
        margin-top: 14px;
        padding-top: 14px;
    }

    .container[data-smart-import-default-state] .upload-section {
        margin-top: 4px;
        margin-bottom: 16px;
    }

    .container[data-smart-import-default-state] .upload-ready-helper {
        margin-bottom: 8px;
        font-size: 0.88rem;
    }
}

@media (max-width: 768px) {
    .benefits-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .steps-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.create-collection-section {
    margin-bottom: 30px;
}

.action-buttons-section {
    margin-bottom: 30px;
}

.action-buttons-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: stretch;
    margin-bottom: 20px;
}

.action-buttons-row .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    text-align: center;
}

.action-buttons-row .btn span {
    font-size: 1.2em;
    font-weight: bold;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.btn-premium {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    border: 1px solid rgba(251, 191, 36, 0.5);
}

.btn-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-premium:hover::before {
    left: 100%;
}

.btn-premium:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    border-color: rgba(251, 191, 36, 0.8);
    color: white !important;
}

.btn-premium .wand-icon {
    font-size: 1.2em;
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    position: relative;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.btn-premium .wand-icon .wand {
    font-size: 1.1em;
    margin-right: 2px;
}

.btn-premium .wand-icon .sparkle {
    font-size: 0.7em;
    position: absolute;
    animation: sparkleFloat 2s ease-in-out infinite;
}

.btn-premium .wand-icon .sparkle-1 {
    top: -4px;
    right: -2px;
    animation-delay: 0s;
}

.btn-premium .wand-icon .sparkle-2 {
    top: 2px;
    right: -6px;
    animation-delay: 1s;
}

@keyframes sparkleFloat {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1) translateY(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) translateY(-3px);
    }
}

a.btn-premium {
    color: white !important;
}

a.btn-premium:hover {
    color: white !important;
}

a.btn-premium:visited {
    color: white !important;
}

.create-form {
    background: #f8f9ff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-top: 20px;
}

.create-form h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input-readonly,
.form-input[readonly],
.form-input:disabled,
select.form-input-readonly,
select.form-input[readonly],
select.form-input:disabled {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
    opacity: 0.8;
}

.form-input-readonly:focus,
.form-input[readonly]:focus,
.form-input:disabled:focus,
select.form-input-readonly:focus,
select.form-input[readonly]:focus,
select.form-input:disabled:focus {
    border-color: #ddd;
    box-shadow: none;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.collections-list {
    margin-top: 30px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.1em;
}

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

.collection-card {
    background: #f8f9ff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

/* Default collection styling only applies when selected */
.collection-card.default-collection.selected {
    border: 2px solid #FFD700;
    background: linear-gradient(135deg, #fff9e6 0%, #e8ebff 100%);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.collection-card.selected {
    border: 2px solid #667eea;
    background: linear-gradient(135deg, #e8ebff 0%, #ffffff 100%);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.collection-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.collection-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-3px);
}

.collection-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 10px;
}

.collection-name {
    color: #333;
    font-size: 1.4em;
    margin: 0;
    cursor: pointer;
    flex: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.default-badge {
    font-size: 0.9em;
    color: #fbbf24;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.collection-name:hover {
    color: #667eea;
}

.collection-name-input {
    font-size: 1.4em;
    font-weight: 600;
    margin: 0;
    padding: 8px 12px;
    width: 100%;
}

.collection-actions {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-shrink: 0;
}

.collection-actions-menu {
    position: relative;
    flex-shrink: 0;
}

.collection-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 180px;
    margin-top: 5px;
    overflow: hidden;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.7;
}

.btn-icon:hover {
    opacity: 1;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.1);
}

.btn-icon.btn-danger:hover {
    background: rgba(220, 53, 69, 0.1);
}

.set-default-btn {
    color: #999;
}

.set-default-btn:hover {
    background: #f0f0f0;
    color: #fbbf24;
}

/* Shared table styles for receipts and insurance documents */

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 30px;
    padding: 10px 0 30px 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    background: white;
    margin-bottom: 0;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

/* Shared action menu styles */
.actions-cell {
    position: relative;
    white-space: nowrap;
}

.row-actions {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.menu-toggle {
    background: transparent;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.2s;
}

.menu-toggle:hover {
    opacity: 1;
    background: rgba(102, 126, 234, 0.1);
}

.menu-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 150px;
    z-index: 1000;
    display: none;
    margin-top: 5px;
    right: 0;
}

.menu-dropdown.menu-open-up {
    top: auto;
    bottom: calc(100% + 6px);
    margin-top: 0;
}

.menu-dropdown.menu-open-left {
    right: auto;
    left: 0;
}

.menu-dropdown.state-visible {
    display: block !important;
}

.menu-dropdown.state-hidden {
    display: none !important;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.95em;
    color: #333;
    transition: background 0.2s;
}

.menu-item:hover {
    background: #f8f9fa;
}

.menu-item.menu-item-danger {
    color: #dc3545;
}

.menu-item.menu-item-danger:hover {
    background: #fff5f5;
}

.menu-item-icon {
    font-size: 1em;
}

/* Mobile responsiveness for shared table styles */
@media (max-width: 768px) {
    .data-table th,
    .data-table td {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .table-wrapper {
        border-radius: 4px;
        margin-left: -10px;
        margin-right: -10px;
        width: calc(100% + 20px);
    }
}

.default-btn {
    color: #fbbf24;
}

.default-btn:hover {
    background: #fffbf0;
}

.collection-card-body {
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

.collection-image-container {
    margin-bottom: 12px;
}

.collection-image {
    position: relative;
    border: 1px solid #e6e8ef;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.collection-primary-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.collection-image-manage-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
}

.collection-image-placeholder {
    border: 1px dashed #cdd3e2;
    border-radius: 8px;
    padding: 18px;
    background: #fff;
    display: flex;
    justify-content: center;
}

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

.image-card {
    border: 1px solid #e6e8ef;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

/* In item Manage Images modal, allow action menus to escape card bounds. */
#imageGalleryModal .image-card {
    overflow: visible;
}

/* In collection Manage Images modal, allow action menus to escape card bounds. */
#collectionImageManagerModal .image-card {
    overflow: visible;
}

.image-card-image img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

/* Make collection-level manager cards square like item cards. */
#collectionImageManagerModal .image-card-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background-color: #f5f5f5;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
}

#collectionImageManagerModal .image-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-card-body {
    padding: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 2px 8px;
    font-weight: 600;
}

.badge-success {
    background: #e8f7ef;
    color: #1f7a45;
}

.badge-info {
    background: #eaf2ff;
    color: #2b5cb8;
}

.collection-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.collection-info:last-child {
    margin-bottom: 0;
}

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

.info-value {
    color: #333;
}

/* Collection-specific button styles */
#createCollectionBtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#createCollectionBtn span {
    font-size: 1.2em;
    font-weight: bold;
}

@media (max-width: 768px) {
    .collections-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons-row {
        flex-direction: column;
    }

    .action-buttons-row .btn {
        width: 100%;
        flex: 1 1 auto;
    }

    .create-form {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .collection-card-header {
        flex-direction: row;
        align-items: flex-start;
    }

    .collection-name {
        flex: 1 1 auto;
    }

    .collection-actions {
        align-self: flex-start;
    }
}

/* Collection Items Section */
.collection-items-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

/* Shared collection page should not add extra divider/whitespace above controls. */
.shared-collection-items-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.share-collection-highlights-wrap {
    padding: 0 10px;
}

.share-collection-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.share-collection-highlights-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 8px;
}

.share-highlight-card {
    background: #fff;
    border: 1px solid #e9edf7;
    border-radius: 10px;
    padding: 10px 12px;
}

.share-highlight-title {
    font-size: 0.78rem;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    text-align: center;
}

.share-highlight-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
    text-align: center;
}

.share-highlight-sub {
    font-size: 0.85rem;
    color: #4b5563;
    text-align: center;
}

.share-highlight-chip {
    display: inline-block;
    margin-right: 8px;
    white-space: nowrap;
}

.share-highlight-badge {
    margin-top: 6px;
    display: inline-block;
    font-size: 0.75rem;
    color: #4f46e5;
    background: #eef2ff;
    border-radius: 999px;
    padding: 2px 8px;
}

.share-highlight-breakdown {
    margin-top: 4px;
}

.share-highlight-breakdown summary {
    cursor: pointer;
    font-size: 0.82rem;
    color: #4b5563;
    text-align: center;
}

.share-highlight-breakdown-list {
    margin-top: 6px;
}

.share-highlight-breakdown-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #4b5563;
}

.share-highlight-breakdown-list {
    max-width: 220px;
    margin: 6px auto 0;
}

.scroll-to-top-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #764ba2;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.35), 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: 1000;
}

.scroll-to-top-btn:hover {
    background: #6a3f97;
    box-shadow: 0 8px 24px rgba(118, 75, 162, 0.5), 0 3px 10px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
}

.scroll-to-top-btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 16px rgba(118, 75, 162, 0.35), 0 2px 8px rgba(0, 0, 0, 0.18);
}

.scroll-to-top-btn:focus {
    outline: none;
}

.scroll-to-top-btn:focus-visible {
    outline: 2px solid rgba(118, 75, 162, 0.6);
    outline-offset: 2px;
}

.share-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-modal-action-btn {
    width: 100%;
}

.share-copy-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.share-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.share-copy-feedback {
    font-size: 0.85em;
    color: #2d6a4f;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.section-header h3 {
    color: #667eea;
    font-size: 1.8em;
    margin: 0;
}

.collection-items-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

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

.collection-share-btn {
    margin-left: 2px;
}

.collection-items-action-btn {
    white-space: nowrap;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

@media (max-width: 768px) {
    .section-header {
        align-items: flex-start;
    }

    .collection-items-controls {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        align-items: stretch;
    }

    .collection-items-sort-wrapper {
        grid-column: 1 / -1;
        display: flex !important;
        width: 100%;
        min-width: 0;
        gap: 8px;
        align-items: center;
    }

    .collection-items-sort-select {
        width: 100% !important;
        min-width: 0 !important;
    }

    .collection-items-action-btn {
        width: 100%;
        min-width: 0;
        white-space: normal;
        line-height: 1.2;
        padding: 8px 10px;
    }

    .collection-items-title-row {
        justify-content: space-between;
    }

    .collection-share-btn {
        width: 40px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    #toggleFiltersBtn {
        grid-column: 1 / -1;
    }

    #collectionItemsSortWrapper {
        grid-column: 1 / -1;
    }
}

/* Toggle Switch Styles */
.filter-toggle {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    font-size: 0.95em;
    color: #666;
}

.filter-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: background-color 0.3s, box-shadow 0.3s;
    flex-shrink: 0;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filter-toggle input[type="checkbox"]:checked + .toggle-slider,
.filter-toggle input[type="radio"]:checked + .toggle-slider {
    background-color: #667eea;
}

.filter-toggle input[type="checkbox"]:checked + .toggle-slider:before,
.filter-toggle input[type="radio"]:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.filter-toggle input[type="checkbox"]:focus + .toggle-slider,
.filter-toggle input[type="radio"]:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.filter-toggle:hover .toggle-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-toggle input[type="checkbox"]:checked ~ .toggle-label,
.filter-toggle input[type="radio"]:checked ~ .toggle-label {
    color: #667eea;
    font-weight: 600;
}

.toggle-label {
    transition: color 0.3s, font-weight 0.3s;
}

/* Keep old checkbox styles for backwards compatibility */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 0.95em;
    color: #666;
}

.filter-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

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

.filter-checkbox input[type="checkbox"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.filter-panel {
    background: #f8f9ff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-row.filter-row-toggles {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group.filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    flex: 1 1 100%;
    min-width: 100%;
    width: 100%;
}

/* Form group styling for toggle checkboxes - stack label then description below */
.form-group:has(.filter-toggle) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Description under label, indented to align with label text (toggle 48px + gap 12px) */
.form-group:has(.filter-toggle) .form-help-text {
    margin-top: 0.35em;
    margin-left: 60px;
}

/* Override form-group label styles when label is a filter-toggle */
.form-group > label.filter-toggle,
.form-group label.filter-toggle {
    display: inline-flex !important;
    margin-bottom: 0 !important;
}

/* Ensure filter-toggle labels are properly aligned regardless of parent */
.filter-toggle {
    display: inline-flex !important;
    align-items: center;
}

/* Image upload toggle group - toggle and content should stack vertically */
.image-upload-toggle-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 15px;
}

.image-upload-toggle-group > .all-items-section {
    width: 100%;
    margin-top: 0;
}

.filter-group.filter-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    min-width: auto;
}

.filter-label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
}

.filter-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    font-family: inherit;
    transition: border-color 0.2s;
    background-color: white;
}

.filter-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

select.filter-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
}

/* Theme Filter Styles */
.theme-filter-wrapper {
    min-height: 38px; /* Match filter-input height */
    transition: min-height 0.2s ease;
}

.theme-filter-wrapper.collapsed {
    min-height: 38px; /* Same height as other inputs */
    max-height: 38px;
    overflow: hidden;
}

.theme-filter-wrapper:not(.collapsed) {
    min-height: auto;
    max-height: none;
    overflow: visible;
}

.theme-filter-container-wrapper.state-visible {
    display: block !important;
}

.theme-filter-placeholder {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    color: #999;
    background-color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.theme-filter-placeholder:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.theme-filter-placeholder:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.theme-filter-wrapper {
    cursor: pointer;
}

.theme-filter-container-wrapper {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
}

.theme-filter-header {
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    color: #666;
    background: #f5f5f5;
}

.theme-filter-header:hover {
    background: #eeeeee;
    color: #667eea;
}

.theme-filter-container {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.theme-filter-container::-webkit-scrollbar {
    width: 8px;
}

.theme-filter-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.theme-filter-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.theme-filter-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.theme-filter-checkbox {
    user-select: none;
}

.theme-filter-checkbox:hover {
    color: #667eea;
}

.theme-filter-checkbox-input {
    cursor: pointer;
    accent-color: #667eea;
    margin: 0;
}

.theme-filter-loading {
    color: #666;
    font-style: italic;
    font-size: 0.9em;
    padding: 10px;
    text-align: center;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

.collection-items-container {
    min-height: 200px;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
    opacity: 1;
    transition: opacity 0.25s ease-in;
}

.item-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px 20px 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08),
                0 1px 2px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.limited-edition-banner {
    order: -1; /* Ensure it appears first in flex layout */
    width: calc(100% + 40px);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 12px 20px;
    margin: -20px -20px 20px -20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    flex-shrink: 0;
}

.limited-edition-banner .banner-label {
    font-size: 1em;
    white-space: nowrap;
}

.limited-edition-banner .banner-edition {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1em;
    font-weight: 800;
}

.limited-edition-banner .edition-number,
.limited-edition-banner .edition-total {
    font-size: 1.3em;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 28px;
    text-align: center;
}

.limited-edition-banner .edition-separator {
    font-size: 0.9em;
    font-weight: 600;
    opacity: 0.95;
}

.limited-edition-banner.accessory-banner {
    width: calc(100% + 32px);
    margin: -16px -16px 16px -16px;
    padding: 10px 16px;
    font-size: 0.9em;
    order: -1;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15),
                0 4px 8px rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    border-width: 2px;
    padding: 14px 18px 18px; /* Compensate for increased border */
}

.item-image {
    width: 100%;
    height: 180px;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(180deg, #fafbff 0%, #f5f7fb 100%);
    border: 1px solid #eef1f6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.item-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    pointer-events: none;
    border-radius: 8px;
}

.item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-image-clickable {
    cursor: pointer;
}

.item-card:hover .item-image img {
    transform: scale(1.03);
}

/* Image Navigation Arrows */
.image-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    line-height: 1;
    padding: 0;
}

.image-nav-arrow:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.image-nav-arrow-left {
    left: 10px;
}

.image-nav-arrow-right {
    right: 10px;
}

.image-nav-arrow.state-hidden {
    display: none !important;
}

.image-nav-arrow.state-flex {
    display: flex !important;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 10px;
}

.item-title-section {
    flex: 1;
    min-width: 0;
}

.item-name {
    color: #333;
    font-size: 1.3em;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(1.3em * 2);
}

.item-set-number-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.item-set-number {
    color: #666;
    font-size: 0.8em;
    font-weight: 500;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.item-theme-path-inline {
    color: #8c8c8c;
    font-size: 0.8em;
    font-weight: 500;
    line-height: 1.25;
    opacity: 0.62;
    margin-top: 4px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.item-includes-icons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 0;
    margin-left: auto; /* Push icons to the right */
}

.include-icon {
    font-size: 0.9em;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.include-icon:hover {
    opacity: 1;
}

/* Read-only badge - non-clickable minifigs badge in informational views */
.info-badge.read-only-badge {
    cursor: default;
    pointer-events: none;
}

.item-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.item-actions-menu {
    position: relative;
    flex-shrink: 0;
}

.btn-menu-toggle {
    background: transparent;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.5;
    line-height: 1;
    color: #666;
    font-weight: bold;
}

.item-card:hover .btn-menu-toggle {
    opacity: 1;
}

.btn-menu-toggle:hover {
    opacity: 1 !important;
    background: rgba(102, 126, 234, 0.1);
}

.item-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 180px;
    margin-top: 5px;
    overflow: hidden;
}

/* Used by image-card actions in the item Manage Images modal. */
.item-menu-dropdown.menu-open-up {
    top: auto !important;
    bottom: calc(100% + 6px) !important;
    margin-top: 0 !important;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: white;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.95em;
    color: #333;
    transition: background-color 0.2s;
    font-family: inherit;
}

.menu-item:hover {
    background: #f5f5f5;
}

.menu-item-danger {
    color: #dc3545;
}

.menu-item-danger:hover {
    background: rgba(220, 53, 69, 0.1);
}

.menu-icon {
    font-size: 1.1em;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.menu-text {
    flex: 1;
}

.sold-item {
    opacity: 1;
    border-color: #f0caca;
    background: #fff7f7;
}

.sold-item:hover {
    border-color: #e9b3b3;
    box-shadow: 0 10px 30px rgba(220, 53, 69, 0.12),
                0 4px 8px rgba(220, 53, 69, 0.08);
}

.item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.sold-badge {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.info-badge {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
    min-height: 24px;
}

.pieces-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.minifig-count-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.minifig-count-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

/* Minifig Instance Row Styles */
.minifigs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.minifig-instance-row {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    opacity: 1;
}

.minifig-instance-sold {
    background: #f5f5f5;
    opacity: 0.7;
}

.minifig-instance-image-container {
    flex-shrink: 0;
    margin-right: 12px;
}

.minifig-instance-image-clickable {
    cursor: pointer;
}

.minifig-instance-image-clickable:hover {
    opacity: 0.9;
}

.minifig-instance-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
}

.minifig-instance-placeholder {
    width: 60px;
    height: 60px;
    margin-right: 12px;
    background: #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    flex-shrink: 0;
}

.minifig-instance-placeholder-icon {
    font-size: 1.5em;
}

.minifig-instance-details {
    flex: 1;
    min-width: 0;
}

.minifig-instance-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.minifig-instance-fig-number {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
}

.minifig-instance-sold-info {
    font-size: 0.9em;
    color: #dc3545;
    margin-bottom: 8px;
}

.minifig-sold-fields {
    margin-top: 8px;
}

.minifig-sold-toggle {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.minifig-sold-fields-container {
    margin-top: 8px;
}

.minifig-sold-field-group {
    margin-bottom: 8px;
}

.minifig-sold-field-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.minifig-sold-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.minifigs-loading-state,
.minifigs-empty-state {
    text-align: center;
    padding: 20px;
}

.minifigs-empty-state {
    color: #666;
}

.minifigs-error-state {
    text-align: center;
    padding: 20px;
    color: #dc3545;
}

.year-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.state-badge {
    background: linear-gradient(135deg, #718096 0%, #5f6b7a 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(113, 128, 150, 0.3);
}

.state-badge-sealed {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    box-shadow: 0 2px 4px rgba(56, 161, 105, 0.3);
}

.state-badge-displayed {
    background: linear-gradient(135deg, #3182ce 0%, #2b6cb0 100%);
    box-shadow: 0 2px 4px rgba(49, 130, 206, 0.3);
}

.state-badge-sold {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.3);
}

.badge-value {
    font-weight: 600;
}

.limited-edition-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
}

.gift-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.badge-label {
    font-weight: 700;
    white-space: nowrap;
}

.badge-date, .badge-price, .badge-edition {
    font-size: 0.85em;
    opacity: 0.95;
    white-space: nowrap;
}

.sold-info {
    font-weight: 600;
}

.item-detail.sold-info .detail-label {
    color: #c43a43;
    font-weight: 700;
}

.sold-summary {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 2px;
}

.purchase-primary,
.valuation-primary,
.sold-primary {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.sold-amount {
    color: #9f3b3b;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sold-meta {
    color: #8a8a8a;
    font-size: 0.82em;
    font-weight: 500;
    line-height: 1.2;
}

.item-detail {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f5f5f5;
}

.item-detail:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    font-weight: 500;
    color: #8a8a8a;
    font-size: 0.88em;
}

.detail-label-with-meta {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.detail-label-meta {
    color: #8a8a8a;
    font-size: 0.82em;
    font-weight: 500;
    line-height: 1.2;
}

.detail-label-icon {
    font-size: 1.1em;
    line-height: 1;
    display: inline-block;
    cursor: help;
    flex-shrink: 0;
}

.detail-value {
    color: #333;
    font-size: 0.95em;
    font-weight: 500;
    text-align: right;
}

.purchase-summary,
.valuation-summary {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 2px;
}

.valuation-amount {
    color: #1f2937;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.purchase-meta,
.valuation-meta {
    color: #8a8a8a;
    font-size: 0.82em;
    font-weight: 500;
    line-height: 1.2;
}

.detail-value-with-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.cost-amount {
    flex-shrink: 0;
    font-weight: 700;
    color: #4f63d9;
    font-size: 1em;
    letter-spacing: 0.01em;
}

.btn-receipt-inline {
    padding: 2px 4px;
    font-size: 0.95em;
    opacity: 0.6;
    flex-shrink: 0;
}

.btn-receipt-inline:hover {
    opacity: 1;
}

.item-notes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.notes-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9em;
    display: block;
    margin-bottom: 5px;
}

.notes-value {
    color: #333;
    font-size: 0.9em;
    line-height: 1.4;
}

.accessories-badge {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.accessories-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

/* If accessories come directly after details, avoid extra divider/whitespace. */
.item-detail + .accessories-section {
    margin-top: 6px;
    padding-top: 6px;
    border-top: none;
}

/* Collection preference: hide financial detail rows on item cards for a denser layout. */
#collectionItemsSection.state-hide-financial-details .financial-detail-row {
    display: none !important;
}

/* Apply the same Financial Details toggle on collection cards. */
#collectionsList.state-hide-financial-details .collection-card-pricing-row {
    display: none !important;
}

.accessories-toggle {
    width: 100%;
    padding: 8px 10px;
    background: #f8f9ff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95em;
    font-weight: 600;
    color: #667eea;
    transition: all 0.2s;
}

.accessories-toggle:hover {
    background: #f0f2ff;
    border-color: #667eea;
}

.toggle-icon {
    font-size: 0.8em;
    transition: transform 0.2s;
}

.toggle-text {
    flex: 1;
    text-align: left;
    margin-left: 8px;
}

.accessories-list {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9ff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.accessory-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    background: white;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08),
                0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accessory-item:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12),
                0 2px 4px rgba(102, 126, 234, 0.08);
    border-color: #667eea;
    transform: translateY(-2px);
}

.accessory-item:last-child {
    margin-bottom: 0;
}

.accessory-type-badge {
    margin-bottom: 10px;
}

.accessory-type-badge-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.accessory-name {
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 12px;
    width: 100%;
}

.accessory-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.accessory-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.85em;
    flex: 1;
    min-width: 0;
}

.accessory-vendor {
    color: #777;
    font-style: italic;
    font-size: 0.9em;
}

.accessory-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.accessory-cost {
    color: #667eea;
    font-weight: 600;
    font-size: 0.95em;
    white-space: nowrap;
}

.manage-accessories-btn {
    font-size: 0.85em;
    padding: 5px 12px;
    display: block;
    width: 100%;
    text-align: center;
}

.accessories-management-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accessory-management-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s;
}

.accessory-management-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.accessory-management-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.accessory-management-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.accessory-management-details {
    flex: 1;
    min-width: 0;
}

.accessory-management-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 0.95em;
}

.accessory-management-type {
    font-size: 0.85em;
    color: #666;
    text-transform: capitalize;
}

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

.accessory-management-cost {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .item-image {
        height: 150px;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-group.filter-checkboxes {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .filter-toggle {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-group.filter-actions {
        justify-content: stretch;
    }
    
    .filter-group.filter-actions .btn {
        width: 100%;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.state-visible {
    display: block !important;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 845px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
}

.user-usage-section {
    margin-bottom: 1.25rem;
}
.user-usage-section:last-child {
    margin-bottom: 0;
}

/* Keep usage modal tables within modal width (override .data-table min-width) */
#userUsageModal .data-table {
    min-width: 0;
    width: 100%;
}
#userUsageModal .user-usage-section .data-table {
    table-layout: fixed;
}
#userUsageModal .user-usage-section .data-table th:first-child,
#userUsageModal .user-usage-section .data-table td:first-child {
    width: 70%;
}
#userUsageModal .user-usage-section .data-table th:last-child,
#userUsageModal .user-usage-section .data-table td:last-child {
    width: 30%;
    text-align: right;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.valuation-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.valuation-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

/* Keep radio + label side-by-side (override .form-group label { display: block }) */
.valuation-options .valuation-option {
    display: flex;
}

.valuation-option input[type="radio"] {
    margin: 0;
    margin-top: 3px;
    flex-shrink: 0;
}

.valuation-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.valuation-option-description {
    font-size: 0.85em;
    color: #666;
}

.valuation-option-recommendation {
    font-size: 0.8em;
    color: #555;
    font-style: italic;
    margin-top: 2px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.modal-large {
    max-width: 800px;
}

/* Receipt image modal: width fits the image to avoid huge whitespace */
.modal-image-viewer {
    width: max-content;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

.modal-image-viewer .modal-body {
    padding: 20px;
    width: max-content;
    max-width: 100%;
    max-height: 75vh;
    overflow: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Receipt image: fit within viewport; container shrinks to image so modal isn't overly wide */
.receipt-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
    width: max-content;
    max-width: 100%;
}

.receipt-image-view {
    max-width: 95vw;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.receipts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.receipt-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #f9f9f9;
    transition: all 0.2s;
}

.receipt-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.receipt-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.receipt-date {
    color: #666;
    font-size: 0.9em;
}

.receipt-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.receipt-detail {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.receipt-detail .detail-label {
    font-weight: 600;
    color: #666;
}

.receipt-detail .detail-value {
    color: #333;
}

.receipt-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #e0e0e0;
    font-weight: 700;
}

.receipt-total .detail-label {
    font-size: 1.1em;
    color: #333;
}

.receipt-total .detail-value {
    font-size: 1.2em;
    color: #667eea;
}

.receipt-notes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.receipt-notes .notes-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9em;
    display: block;
    margin-bottom: 5px;
}

.receipt-notes .notes-value {
    color: #333;
    font-size: 0.9em;
    line-height: 1.4;
}

.receipt-media {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.media-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.media-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.media-item {
    display: flex;
    align-items: center;
}

.media-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 0.9em;
    transition: all 0.2s;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    text-align: left;
    border: 1px solid #e0e0e0;
}

.media-link:hover {
    background: #f5f5f5;
    border-color: #667eea;
    color: #667eea;
}

.media-icon {
    font-size: 1.1em;
}

.media-type {
    font-weight: 500;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Override state-visible to use flex instead of block for loading overlay */
.loading-overlay.state-visible {
    display: flex !important;
}

.loading-modal {
    background: white;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: 300px;
    max-width: 600px;
}

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

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

.loading-message {
    font-size: 1.1em;
    color: #333;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-large {
        max-width: 95%;
    }
    
    .receipt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Image Gallery Styles */
.images-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-gallery-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Fullscreen Image Overlay */
.fullscreen-image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fullscreen-image-container {
    position: relative;
    width: 100%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: default;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 1);
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 28px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.fullscreen-nav:hover {
    background: rgba(255, 255, 255, 1);
}

.fullscreen-nav-left {
    left: 20px;
}

.fullscreen-nav-right {
    right: 20px;
}

.fullscreen-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    z-index: 10001;
}

.fullscreen-zoom-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10001;
}

.fullscreen-zoom-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-weight: bold;
}

.fullscreen-zoom-btn:hover {
    background: rgba(255, 255, 255, 1);
}

.fullscreen-zoom-in {
    font-size: 24px;
}

.fullscreen-zoom-out {
    font-size: 28px;
    line-height: 1;
}

.fullscreen-zoom-reset {
    font-size: 18px;
}

.fullscreen-auto-cycle-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 18px;
    padding: 8px 12px;
    display: none;
    align-items: center;
    gap: 12px;
}

.fullscreen-auto-cycle-btn {
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 0.85em;
    cursor: pointer;
}

.fullscreen-auto-cycle-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.fullscreen-auto-cycle-btn[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.28);
}

.fullscreen-auto-cycle-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.fullscreen-auto-cycle-speed-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
}

.fullscreen-auto-cycle-speed {
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.85em;
}

.fullscreen-auto-cycle-speed option {
    color: #111;
}

.fullscreen-auto-cycle-speed:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Info Tooltip Styles */
.info-tooltip-container {
    position: relative;
    display: inline-block;
}

.info-icon {
    cursor: help;
    font-size: 1.2em;
    color: #667eea;
    transition: color 0.2s;
}

.info-icon:hover {
    color: #764ba2;
}

.info-tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 10px 15px;
    border-radius: 6px;
    white-space: normal;
    font-size: 0.9em;
    z-index: 1000;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    max-width: 300px;
    width: max-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

/* Data Loads Page Styles */
.data-loads-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.data-load-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
}

.data-load-card h3 {
    margin-top: 0;
    color: #333;
}

.data-load-card .status-info {
    margin-bottom: 20px;
}

.data-load-card .status-info > div {
    margin-bottom: 10px;
}

.data-load-card .status-info .never-text {
    color: #999;
}

.data-load-card .status-info .error-message {
    color: #d32f2f;
    margin-top: 10px;
    padding: 10px;
    background: #ffebee;
    border-radius: 4px;
}

.data-load-card .btn {
    width: 100%;
}

.data-load-card [data-loader] {
    margin-top: 10px;
    text-align: center;
    color: #666;
}

@media (max-width: 768px) {
    .data-loads-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .data-load-card {
        padding: 14px;
        min-width: 0;
    }
    .data-load-card .btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* MSRP Review Page Styles */
#aiResultContent pre {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

#aiResultContent .ai-result-info {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #e8f4f8;
    border-left: 4px solid #007bff;
    border-radius: 4px;
}

/* Action Menu Styles */
.action-menu-container {
    position: relative;
    display: inline-block;
}

.action-menu-trigger {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    padding: 4px 8px;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
    vertical-align: middle;
}

.action-menu-trigger:hover {
    background-color: #f0f0f0;
    color: #333;
}

.action-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 1000;
    margin-top: 4px;
    overflow: hidden;
}

.action-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    color: #333;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.action-menu-item:last-child {
    border-bottom: none;
}

.action-menu-item:hover {
    background-color: #f5f5f5;
}

.action-menu-item-success {
    color: #28a745;
}

.action-menu-item-success:hover {
    background-color: #d4edda;
}

.action-menu-item-warning {
    color: #ffc107;
}

.action-menu-item-warning:hover {
    background-color: #fff3cd;
}

/* Vendor Maintenance Page Styles */
.status-enabled {
    background-color: #28a745;
    color: white;
}

.status-disabled {
    background-color: #6c757d;
    color: white;
}

.action-menu-item-danger {
    color: #dc3545;
}

.action-menu-item-danger:hover {
    background-color: #f8d7da;
}

.vendor-maintenance-other-vendors-header {
    margin-top: 40px;
}

.vendor-maintenance-button-spacing {
    margin-right: 8px;
}

.vendor-modal-content {
    max-width: 600px;
}

.other-vendor-receipts-modal-content {
    max-width: 1200px;
}

.associate-all-message {
    margin-bottom: 15px;
}

.associate-all-vendor-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
}

.associate-all-vendor-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

/* Invoice Selection Chips */
.set-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 4px 4px 4px 0;
    font-size: 0.9em;
}

.set-chip-remove {
    margin-left: 4px;
    padding: 2px 6px;
    font-size: 0.8em;
}

.accessory-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f6f8fb;
    border: 1px solid #e6ebf2;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 4px 4px 4px 0;
    font-size: 0.9em;
}

.accessory-chip .btn-icon {
    margin-left: 4px;
    padding: 2px 6px;
    font-size: 0.8em;
}

/* Parser Debug Panel - side-by-side raw text and DraftInvoiceDto output */
.parser-debug-side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 12px;
    align-items: start;
}
@media (max-width: 900px) {
    .parser-debug-side-by-side {
        grid-template-columns: 1fr;
    }
}
.parser-debug-raw,
.parser-debug-output {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
}
/* Independent scrollbars: each column scrolls on its own */
.parser-debug-raw.parser-debug-scroll,
.parser-debug-output.parser-debug-scroll {
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: auto;
}
.parser-debug-raw h5,
.parser-debug-output h5 {
    margin: 0 0 8px 0;
    font-size: 0.95em;
    color: #495057;
}
.parser-debug-pre {
    margin: 0;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.85em;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.parser-debug-section {
    margin-bottom: 16px;
}
.parser-debug-section h5 {
    margin: 0 0 6px 0;
    font-size: 0.9em;
    color: #495057;
}
.parser-debug-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
.parser-debug-table td {
    padding: 4px 8px;
    vertical-align: top;
    border-bottom: 1px solid #eee;
}
.parser-debug-label {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    width: 1%;
}
.parser-debug-value {
    word-break: break-word;
}
.parser-debug-empty,
.parser-debug-error {
    color: #6c757d;
    margin: 0;
    padding: 8px 0;
}
.parser-debug-error {
    color: #dc3545;
}

.insurance-document-generation-form-description {
	margin-bottom: 15px;
}

/* Profile page */
.admin-section {
	margin-bottom: 2rem;
}
.admin-section h3 {
	margin-bottom: 0.5rem;
	font-size: 1.15rem;
}
.section-description {
	color: #666;
	font-size: 0.9em;
	margin-bottom: 1rem;
}
.admin-form .form-group {
	margin-bottom: 1rem;
}
.badge {
	display: inline-block;
	padding: 0.25em 0.5em;
	font-size: 0.85em;
	border-radius: 4px;
}
.badge-success {
	background: #28a745;
	color: #fff;
}
.form-help {
	display: block;
	font-size: 0.85em;
	color: #666;
	margin-top: 4px;
}
.profile-storage-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.profile-storage-list li {
	padding: 4px 0;
}
.profile-checkbox-group {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 20px;
}
.profile-checkbox-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: normal;
	cursor: pointer;
}
.profile-checkbox-label input[type="checkbox"] {
	width: auto;
	margin: 0;
}

/* User Management DataTables (Pending Invites, App Users) */
.user-mgmt-table-wrapper {
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
	border: 1px solid #e8e8e8;
	overflow: hidden;
	margin-bottom: 1rem;
	padding-left: 16px;
	padding-right: 16px;
}
.user-mgmt-table-wrapper .dataTables_wrapper { padding: 0; }
.user-mgmt-table-wrapper [class*="dt-"]:not(.dt-layout-row) { padding: 0; }
.user-mgmt-table-wrapper table.dataTable {
	width: 100% !important;
	margin: 0;
	border-collapse: collapse;
}
.user-mgmt-table-wrapper table.dataTable thead th {
	background: linear-gradient(180deg, #f6f7f9 0%, #eef0f4 100%);
	color: #374151;
	font-weight: 600;
	font-size: 0.8125rem;
	padding: 14px 16px !important;
	border-bottom: 2px solid #e5e7eb;
	text-align: left;
	vertical-align: middle;
}
.user-mgmt-table-wrapper table.dataTable thead th,
.user-mgmt-table-wrapper table.dataTable thead th > * {
	vertical-align: middle;
}
.user-mgmt-table-wrapper table.dataTable thead th .dt-column-header,
.user-mgmt-table-wrapper table.dataTable thead th [class*="dt-column"] {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
}
.user-mgmt-table-wrapper table.dataTable thead th.dt-orderable-asc,
.user-mgmt-table-wrapper table.dataTable thead th.dt-orderable-desc,
.user-mgmt-table-wrapper table.dataTable thead th[class*="dt-orderable"] {
	cursor: pointer;
}
.user-mgmt-table-wrapper table.dataTable thead th .dt-column-order {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	margin-left: 0.35rem;
	vertical-align: middle;
	opacity: 0.6;
	font-size: 0.65rem;
	line-height: 0.9;
}
.user-mgmt-table-wrapper table.dataTable thead th.dt-orderable-asc .dt-column-order::before,
.user-mgmt-table-wrapper table.dataTable thead th.dt-orderable-desc .dt-column-order::before {
	content: "\25b2";
	display: block;
	opacity: 0.4;
}
.user-mgmt-table-wrapper table.dataTable thead th.dt-orderable-asc .dt-column-order::after,
.user-mgmt-table-wrapper table.dataTable thead th.dt-orderable-desc .dt-column-order::after {
	content: "\25bc";
	display: block;
	opacity: 0.4;
}
.user-mgmt-table-wrapper table.dataTable thead th.dt-ordering-asc .dt-column-order {
	opacity: 1;
}
.user-mgmt-table-wrapper table.dataTable thead th.dt-ordering-asc .dt-column-order::before {
	content: "\25b2";
	display: block;
	opacity: 1;
	color: #667eea;
}
.user-mgmt-table-wrapper table.dataTable thead th.dt-ordering-asc .dt-column-order::after {
	content: "\25bc";
	display: block;
	opacity: 0.25;
}
.user-mgmt-table-wrapper table.dataTable thead th.dt-ordering-desc .dt-column-order {
	opacity: 1;
}
.user-mgmt-table-wrapper table.dataTable thead th.dt-ordering-desc .dt-column-order::before {
	content: "\25b2";
	display: block;
	opacity: 0.25;
}
.user-mgmt-table-wrapper table.dataTable thead th.dt-ordering-desc .dt-column-order::after {
	content: "\25bc";
	display: block;
	opacity: 1;
	color: #667eea;
}
.user-mgmt-table-wrapper div.dt-layout-cell:last-child {
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.user-mgmt-table-wrapper table.dataTable tbody td {
	padding: 12px 16px !important;
	border-bottom: 1px solid #f0f0f0;
	font-size: 0.9375rem;
	color: #374151;
}
.user-mgmt-table-wrapper table.dataTable tbody tr:hover { background-color: #f8fafc; }
.user-mgmt-table-wrapper table.dataTable tbody tr:last-child td { border-bottom: none; }
.user-mgmt-table-wrapper .dt-layout-row.dt-layout-bottom,
.user-mgmt-table-wrapper .dataTables_wrapper .dt-layout-row:last-child {
	padding: 14px 0;
	background: #f8f9fb;
	border-top: 1px solid #e8e8e8;
	font-size: 0.875rem;
	color: #4b5563;
}
.user-mgmt-table-wrapper .dt-length select,
.user-mgmt-table-wrapper .dt-layout-row select {
	min-width: 3.25rem;
	height: 36px;
	padding: 6px 28px 6px 10px;
	font-size: 0.875rem;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
}
.user-mgmt-table-wrapper .dt-paging button,
.user-mgmt-table-wrapper .dt-paging .dt-paging-button,
.user-mgmt-table-wrapper .dt-paging a {
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	font-size: 0.875rem;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
}
.user-mgmt-table-wrapper .dt-paging .dt-paging-button.current,
.user-mgmt-table-wrapper .dt-paging button.current {
	background: #667eea;
	border-color: #667eea;
	color: #fff;
}
.user-mgmt-table-wrapper .dtr-details {
	padding: 0.75rem 1rem 0.75rem 2rem;
	background: #f8f9fb;
	border-bottom: 1px solid #e8e8e8;
}
.user-mgmt-table-wrapper .dt-responsive-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; font-size: 0.875rem; }
.user-mgmt-table-wrapper .dt-responsive-label { font-weight: 600; color: #4b5563; min-width: 7rem; }
.user-mgmt-table-wrapper .dt-responsive-value { color: #374151; }

@media (max-width: 768px) {
	.user-mgmt-table-wrapper {
		border-radius: 8px;
		overflow: visible;
	}
	.user-mgmt-table-wrapper table.dataTable thead th,
	.user-mgmt-table-wrapper table.dataTable tbody td {
		padding: 10px 12px;
		font-size: 0.875rem;
	}
	.user-mgmt-table-wrapper div.dt-layout-cell:last-child {
		display: block;
		align-items: center;
	}
}

/* Collection item add/edit modal: Smart Import–style line item card */
.modal .line-item--collection-modal {
	margin-bottom: 0;
}

.modal .line-item--collection-modal:hover {
	box-shadow: none;
	border-color: #e0e0e0;
}

.collection-item-form-card .line-item-header-compact {
	align-items: flex-start;
	width: 100%;
}

.collection-item-form-card .line-item-identity {
	flex: 1;
	min-width: 0;
	align-items: flex-start;
}

/* Badges inside identity (Smart Import order); force full row below thumb + name/lookup on mobile */
@media (max-width: 768px) {
	.collection-item-form-card .collection-item-header-badges.line-item-badges {
		flex-basis: 100%;
		margin-top: 0.35rem;
	}

	/* Global .filter-toggle uses space-between on mobile; keep Sold? label beside the switch */
	.collection-item-form-card .collection-item-form-notes-sold label.filter-toggle {
		justify-content: flex-start;
	}
}

.collection-item-form-card .collection-item-line-item-title {
	flex: 1;
	min-width: 0;
}

.collection-item-add-lookup-identity .line-item-meta {
	margin-top: 0.25rem;
}

/* Add Item modal: Set # / Item # in metadata (open lookup when clicked). */
.collection-item-form-card .collection-item-add-lookup-meta-link {
	display: inline;
	margin: 0;
	padding: 0;
	border: none;
	background: none;
	font: inherit;
	font-size: 0.73rem;
	font-weight: 600;
	line-height: inherit;
	color: #4f46e5;
	cursor: pointer;
	text-align: left;
	text-decoration: none;
	vertical-align: baseline;
}

.collection-item-form-card .collection-item-add-lookup-meta-link:hover {
	text-decoration: underline;
}

.collection-item-form-card .collection-item-add-lookup-meta-link:focus-visible {
	outline: 2px solid #4f46e5;
	outline-offset: 2px;
}

/* Edit modal / non-interactive meta (no .collection-item-add-lookup-meta-link) */
.collection-item-form-card .line-item-meta-set-number:not(.collection-item-add-lookup-meta-link),
.collection-item-form-card .line-item-meta-item-no:not(.collection-item-add-lookup-meta-link) {
	color: inherit;
	font-size: 0.73rem;
	font-weight: 500;
	cursor: default;
	text-decoration: none;
}

