:root {
    --cielab-drawer-width: 380px;
    --cielab-accent: #467e9f;
    --cielab-accent-hover: #446677;
    --cielab-border: #ccc;
}

.cielab-page-shiftable {
    transition: margin .3s ease;
}

.cielab-page-shift {
    margin-left: calc(-1 * var(--cielab-drawer-width)) !important;
    margin-right: var(--cielab-drawer-width) !important;
}

.cielab-root {
    --cielab-graph-height: 1500px;
    --cielab-mobile-width: 800px;
    position: relative;
    box-sizing: border-box;
}

.cielab-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.cielab-icon {
    width: 18px;
    height: 18px;
    display: block;
    color: inherit;
}

.cielab-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999985;
}

.cielab-toolbar[hidden] {
    display: none;
}

.cielab-toolbar-button {
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background-color: var(--cielab-accent);
    color: #fff;
    cursor: pointer;
    transition: background-color .2s;
}

.cielab-toolbar-button:hover,
.cielab-toolbar-button:focus-visible {
    background-color: var(--cielab-accent-hover);
}

.cielab-toolbar-button.is-loading .cielab-icon {
    animation: cielab-spin 1s linear infinite;
}

@keyframes cielab-spin {
    to { transform: rotate(360deg); }
}

.cielab-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--cielab-drawer-width);
    max-width: 90vw;
    height: 100%;
    background: #fff;
    color: inherit;
    border-left: 1px solid #e5e5e5;
    box-shadow: -2px 0 8px rgba(0, 0, 0, .06);
    transform: translateX(100%);
    transition: transform .3s ease;
    z-index: 9999990;
    display: flex;
    flex-direction: column;
}

.cielab-drawer.is-open {
    transform: translateX(0);
}

.cielab-drawer-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 15px 20px 0;
    flex: 0 0 auto;
}

.cielab-drawer-close {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    line-height: 0;
    opacity: .7;
}

.cielab-drawer-close:hover {
    opacity: 1;
}

.cielab-drawer-body {
    padding: 10px 20px 20px;
    overflow-y: auto;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
}

.cielab-help p,
.cielab-help li {
    font-size: 14px;
    line-height: 1.6;
}

.cielab-help a {
    color: #2e86f2;
}

.cielab-help-heading {
    text-align: center;
}

.cielab-filter-top {
    margin-bottom: 20px;
}

.cielab-clear-all {
    display: block;
    margin-left: auto;
    background: none;
    border: 0;
    color: var(--cielab-accent);
    font-size: 14px;
    padding: 0 0 10px;
    cursor: pointer;
}

.cielab-clear-all:hover {
    text-decoration: underline;
}

.cielab-accordion {
    clear: both;
}

.cielab-panel {
    border-bottom: 1px solid #e5e5e5;
}

.cielab-panel-title {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: none;
    border: 0;
    color: var(--cielab-accent);
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    padding: 12px 0;
    cursor: pointer;
}

.cielab-panel-toggle {
    flex: 0 0 auto;
    line-height: 0;
}

.cielab-panel .cielab-panel-minus,
.cielab-panel.is-open .cielab-panel-plus {
    display: none;
}

.cielab-panel.is-open .cielab-panel-minus {
    display: block;
}

.cielab-panel-body {
    display: none;
    padding-bottom: 12px;
}

.cielab-panel.is-open .cielab-panel-body {
    display: block;
}

.filter-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.4;
    padding: 3px 0;
    cursor: pointer;
}

.filter-option input[type="checkbox"] {
    margin: 2px 0 0;
    flex: 0 0 auto;
}

#search-box-wrapper {
    position: relative;
    display: block;
    margin-bottom: 5px;
}

#search-box {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--cielab-border);
    border-radius: 3px;
    padding: 8px 32px 8px 10px;
    font-size: 14px;
    color: #222;
    background: #fff;
}

.clear-search {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #444;
    background-color: #ddd;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 17px;
    cursor: pointer;
    display: none;
}

.clear-search:hover {
    background-color: #ccc;
}

#lightness-slider {
    margin-top: 20px;
}

#l-values {
    font-size: 14px;
    text-align: center;
    display: block;
    margin-top: 6px;
}

.range-slider {
    position: relative;
    width: 100%;
    height: 20px;
}

.range-slider-track,
.range-slider-fill {
    position: absolute;
    top: 50%;
    height: 5px;
    background-color: #e0e0e0;
    transform: translateY(-50%);
}

.range-slider-track {
    left: 0;
    width: 100%;
}

.range-slider-fill {
    background-color: #007BFF;
}

.range-slider-handle {
    position: absolute;
    top: 50%;
    width: 15px;
    height: 15px;
    background-color: #007BFF;
    border-radius: 50%;
    transform: translateY(-50%) translateX(-50%);
    cursor: pointer;
}

.range-slider-handle[data-handle="0"] { left: 0%; }
.range-slider-handle[data-handle="1"] { left: 100%; }

.results-display {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0 5px;
    padding: 5px 8px;
    color: var(--cielab-accent);
    background: #fff;
    border: 1px solid var(--cielab-border);
    font-size: 14px;
    border-width: 1px 0;
}

#results-text {
    margin-right: 10px;
}

#bulk-compare-button {
    cursor: pointer;
    text-decoration: underline;
}

.cielab-scroll {
    position: relative;
    width: 100%;
}

#graph-container {
    height: var(--cielab-graph-height);
    background: #fff;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.graph-image {
    border-radius: 4px;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.grid-line {
    stroke-width: 1px;
    shape-rendering: crispEdges;
    stroke: #ddd;
}

.x-axis .tick text,
.y-axis .tick text {
    font-size: 10px;
    user-select: none;
    -webkit-user-select: none;
}

.chromium-dropshadow {
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, .5));
}

.with-drop-shadow {
    filter: url(#roundedDropShadow);
}

#three-container {
    height: 100vh;
    overflow: hidden !important;
    position: relative;
}

#renderCanvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.cielab-rotate-button {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background-color: var(--cielab-accent);
    color: #fff;
    cursor: pointer;
    z-index: 10;
}

.cielab-rotate-button:hover {
    background-color: var(--cielab-accent-hover);
}

.cielab-rotate-button .cielab-icon {
    animation: cielab-spin 3s linear infinite;
}

.cielab-rotate-button.is-paused .cielab-icon {
    animation: none;
}

.text-bubble {
    position: absolute;
    background-color: #fff;
    border: 1px solid var(--cielab-border);
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
    color: #222;
    white-space: nowrap;
    box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, .3);
    z-index: 20;
}

.cielab-menu-bubble {
    position: fixed;
    z-index: 9999987;
}

#custom-tooltip {
    position: absolute;
    min-width: 400px;
    max-width: 400px;
    background: #fff;
    color: #222;
    border: 1px solid var(--cielab-border);
    padding: 10px;
    z-index: 9999986;
    box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, .3);
    border-radius: 4px;
}

.t-title {
    font-weight: bold;
}

.t-data {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px;
}

.t-swatch {
    width: 150px;
    max-width: fit-content;
    height: 280px;
    object-fit: cover;
}

.tooltip-attributes p {
    font-size: 14px;
    text-align: left;
    margin: 0 0 3px 10px;
}

.tooltip-close-button-container {
    position: absolute;
    top: 5px;
    right: 5px;
}

.tooltip-close-button-container #close-button {
    font-size: 15px;
    line-height: 15px;
    margin: 0;
    padding: 0;
}

.circle-icon {
    background-color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #222;
    border: 1px solid var(--cielab-border);
    transition: all .2s;
    cursor: pointer;
}

.circle-icon:hover {
    color: #666;
}

.add-to-compare,
.already-added {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    background: var(--cielab-accent);
    padding: 5px 10px;
    border-radius: 6px;
    border: 0;
    cursor: pointer;
    margin: 5px 0 0 10px;
    font-size: 14px;
}

.add-to-compare:hover,
.already-added:hover {
    background-color: var(--cielab-accent-hover);
}

.notification {
    position: fixed;
    background-color: #444;
    color: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    z-index: 999999999;
    opacity: 0;
    transition: opacity .5s ease;
    pointer-events: none;
}

.notification.show {
    opacity: 1;
    pointer-events: auto;
}

.notification img {
    width: 50px;
    margin-right: 10px;
}

@media (max-width: 768px) {
    .notification {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        bottom: 10px;
        width: 90%;
        max-width: 90%;
        padding: 10px;
        justify-content: center;
        box-sizing: content-box;
    }
}

@media (min-width: 769px) {
    .notification {
        bottom: 20px;
        left: 20px;
        padding: 15px;
    }
}

.modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, .6);
    overscroll-behavior: contain;
    z-index: 9999995;
}

html.cielab-scroll-locked,
body.cielab-scroll-locked {
    overflow: hidden !important;
    overscroll-behavior: contain;
}

.modal-content {
    width: 100%;
    min-height: 100%;
    background-color: #fff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 90px;
}

.modal-button {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--cielab-accent);
    color: #fff;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    z-index: 1;
    position: fixed;
    top: 40px;
    border: 2px solid #f2f2f2;
    transition: background-color .2s;
}

.modal-button:hover {
    background-color: var(--cielab-accent-hover);
}

.modal-button.is-loading .cielab-icon {
    animation: cielab-spin 1s linear infinite;
}

.modal-close-button { right: 20px; }
.modal-email-button { right: 60px; }
.modal-export-button { right: 100px; }
.modal-pdf-button { right: 140px; }

#comparison-modal-content .table-1,
#comparison-modal-content table {
    display: table !important;
    font-size: 14px;
    color: #222;
    margin: 0 auto;
}

#comparison-modal-content td {
    vertical-align: top;
    padding: 6px 8px;
}

#comparison-modal-content .title {
    font-weight: 500;
    font-size: 15px;
}

#comparison-modal-content img {
    height: 340px;
    object-fit: cover;
}

#comparison-modal-content .remove-item {
    position: absolute;
    bottom: 5px;
    right: 5px;
    cursor: pointer;
}

.cielab-email-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 9999998;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cielab-email-modal.is-open {
    display: flex;
}

.cielab-email-dialog {
    background: #fff;
    color: #222;
    border-radius: 6px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}

.cielab-email-dialog h3 {
    margin: 0 0 16px;
    font-size: 20px;
}

.cielab-email-dialog label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin: 12px 0 4px;
}

.cielab-email-dialog input[type="email"],
.cielab-email-dialog input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--cielab-border);
    border-radius: 3px;
    font-size: 14px;
    color: #222;
    background: #fff;
}

.cielab-email-status {
    font-size: 13px;
    min-height: 18px;
    margin: 10px 0 0;
    color: #a02c2c;
}

.cielab-email-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.cielab-button-primary,
.cielab-button-secondary {
    padding: 9px 20px;
    border-radius: 4px;
    border: 1px solid var(--cielab-accent);
    font-size: 14px;
    cursor: pointer;
}

.cielab-button-primary {
    background: var(--cielab-accent);
    color: #fff;
}

.cielab-button-primary:hover {
    background: var(--cielab-accent-hover);
    border-color: var(--cielab-accent-hover);
}

.cielab-button-primary[disabled] {
    opacity: .6;
    cursor: default;
}

.cielab-button-secondary {
    background: #fff;
    color: var(--cielab-accent);
}

@media (max-width: 780px) {
    :root {
        --cielab-drawer-width: min(340px, 85vw);
    }

    .cielab-page-shift {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

@media (max-width: 600px) {
    .cielab-scroll {
        overflow: scroll !important;
        scroll-behavior: smooth !important;
        -webkit-overflow-scrolling: touch;
        height: 90vh;
        margin: auto;
    }

    #graph-container {
        width: var(--cielab-mobile-width) !important;
        height: var(--cielab-graph-height) !important;
    }
}

@media (max-width: 809px) {
    #custom-tooltip {
        left: 50% !important;
        transform: translateX(-50%);
    }
}
