body {
    background-color: #f8f9fa !important;
}

:root {
    /* Height of the 3D view, as a percentage of the browser window height */
    --viewer-height: 75vh;
    --viewer-min-height: 400px;
}

#drop-message {
    position: absolute;
    width: 100%;
    z-index: 1000;
    height: var(--viewer-height);
    min-height: var(--viewer-min-height);
    margin: 2px;
    align-content: center;
    text-align: center;
    background: #ffffff;
    opacity: 0.7;
    pointer-events: none;
    justify-content: center;
    display: none;
}

#drop-message div {
    font-size: 24px;
    text-align: center;
    align-content: center;
    color: #ffffff;
    background: #1a1a1a;
    padding: 10px;
    cursor: pointer;
    display: inline-block;
    border-radius: 3px;
    opacity: 1;
    width: fit-content;
}

#three-container {
    position: relative;
    width: 100%;
    display: inline-block;
    border: solid 1px rgba(0,0,0,.125);
    margin: 2px;
    height: var(--viewer-height);
    min-height: var(--viewer-min-height);
    display: none;
}

.dg.main {
    position: absolute;
    top: 1px;
    right: -14px;
    z-index: 100;
    width: initial !important;
    height: inherit !important;
}

.close-button.close-bottom {
    display: none !important;
}

label {
    font-weight: normal;
    background-color: transparent;
}

/* Model tree panel (viewer_tree.js), same style as the toolbar */
.eye-tree {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 550;
    display: flex;
    flex-direction: column;
    width: 300px;
    min-width: 220px;
    max-width: calc(100% - 24px);
    max-height: 600px;
    resize: horizontal;
    overflow: hidden;
    box-sizing: border-box;
    border-radius: 8px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    color: #222;
    font: 13px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

.eye-tree svg {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.eye-tree-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 6px 4px 10px;
}

.eye-tree-title {
    font-weight: 600;
}

.eye-tree-total {
    flex: 1;
    color: #777;
    font-size: 12px;
}

.eye-tree-header button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #555;
    cursor: pointer;
}

.eye-tree-header button:hover {
    background: rgba(0, 0, 0, .08);
}

.eye-tree-search {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 8px 6px;
    padding: 0 8px;
    height: 30px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .06);
    color: #666;
}

.eye-tree-search:focus-within {
    box-shadow: 0 0 0 2px #2a7de1;
}

.eye-tree-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: inherit;
    font: inherit;
    color: #222;
}

.eye-tree-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0 4px 6px;
}

.eye-tree-row {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding-right: 6px;
    border-radius: 5px;
    white-space: nowrap;
    cursor: pointer;
    outline: none;
}

.eye-tree-row:hover {
    background: rgba(0, 0, 0, .06);
}

.eye-tree-row:focus-visible {
    box-shadow: inset 0 0 0 2px #2a7de1;
}

.eye-tree-row[aria-selected="true"] {
    background: rgba(42, 125, 225, .16);
    color: #1f5fae;
    font-weight: 600;
}

.eye-tree-twisty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: none;
    color: #777;
}

.eye-tree-twisty svg {
    width: 14px;
    height: 14px;
    transition: transform .12s;
}

.eye-tree-row[aria-expanded="true"] .eye-tree-twisty svg {
    transform: rotate(90deg);
}

.eye-tree-eye {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #666;
    cursor: pointer;
}

.eye-tree-eye:hover {
    background: rgba(0, 0, 0, .1);
}

.eye-tree-kind {
    color: #8a94a6;
}

.eye-tree-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eye-tree-label mark {
    padding: 0;
    border-radius: 2px;
    background: #ffe58a;
    color: inherit;
}

.eye-tree-count {
    color: #999;
    font-size: 11px;
}

.eye-tree-hidden .eye-tree-label,
.eye-tree-hidden .eye-tree-kind {
    opacity: .45;
}

.eye-tree-empty {
    padding: 8px 10px;
    color: #777;
    font-style: italic;
}

/* dark background */
.eye-tree.eye-dark {
    background: rgba(40, 40, 40, .92);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .6);
    color: #eee;
}

.eye-tree.eye-dark .eye-tree-total,
.eye-tree.eye-dark .eye-tree-count,
.eye-tree.eye-dark .eye-tree-empty {
    color: #aaa;
}

.eye-tree.eye-dark .eye-tree-header button,
.eye-tree.eye-dark .eye-tree-eye,
.eye-tree.eye-dark .eye-tree-twisty {
    color: #ccc;
}

.eye-tree.eye-dark .eye-tree-header button:hover,
.eye-tree.eye-dark .eye-tree-row:hover,
.eye-tree.eye-dark .eye-tree-eye:hover {
    background: rgba(255, 255, 255, .1);
}

.eye-tree.eye-dark .eye-tree-search {
    background: rgba(255, 255, 255, .1);
    color: #bbb;
}

.eye-tree.eye-dark .eye-tree-search input {
    color: #eee;
}

.eye-tree.eye-dark .eye-tree-row[aria-selected="true"] {
    background: rgba(42, 125, 225, .4);
    color: #fff;
}

.eye-tree.eye-dark .eye-tree-label mark {
    background: #8a6d00;
}

/* Viewer toolbar and help: same as the Eyeshot WebGL export (ThreeJsTemplate.html) */
.viewer-area {
    position: relative;
    margin-bottom: 48px; /* space between the viewer and the files grid below */
}

.eye-toolbar {
    position: absolute;
    left: 50%; /* centered, clear of the coordinate system icon on the left */
    transform: translateX(-50%);
    bottom: 14px;
    z-index: 600;
    display: none; /* shown when a model is loaded */
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 4px;
    width: max-content;
    max-width: calc(100% - 224px);
    box-sizing: border-box;
    border-radius: 8px;
    background: rgba(255, 255, 255, .85);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    font: 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-user-select: none;
    user-select: none;
}

.eye-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #333;
    font: inherit;
    cursor: pointer;
}

.eye-toolbar button:hover {
    background: rgba(0, 0, 0, .08);
}

.eye-toolbar button:focus-visible {
    outline: 2px solid #2a7de1;
    outline-offset: 1px;
}

.eye-toolbar button.command-selected {
    background: rgba(42, 125, 225, .15);
    color: #1f5fae;
}

.eye-toolbar svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.eye-sep {
    width: 1px;
    margin: 4px 2px;
    background: rgba(0, 0, 0, .15);
}

.eye-help {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 60px;
    z-index: 601;
    display: none;
    width: max-content;
    max-width: min(460px, calc(100% - 24px));
    max-height: calc(100% - 90px);
    overflow: auto;
    box-sizing: border-box;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
    color: #222;
    font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.eye-help.eye-open {
    display: block;
}

.eye-help b {
    display: block;
    margin-top: 6px;
}

.eye-help b:first-child {
    margin-top: 0;
}

.eye-help table {
    border-collapse: collapse;
}

.eye-help td {
    padding: 1px 12px 1px 0;
    vertical-align: top;
}

.eye-help td:first-child {
    width: 42%;
    color: #555;
}

/* dark background */
.eye-toolbar.eye-dark {
    background: rgba(40, 40, 40, .85);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}

.eye-toolbar.eye-dark button {
    color: #eee;
}

.eye-toolbar.eye-dark button:hover {
    background: rgba(255, 255, 255, .12);
}

.eye-toolbar.eye-dark button.command-selected {
    background: rgba(42, 125, 225, .4);
    color: #fff;
}

.eye-toolbar.eye-dark .eye-sep {
    background: rgba(255, 255, 255, .2);
}

.eye-help.eye-dark {
    background: rgba(40, 40, 40, .95);
    color: #eee;
}

.eye-help.eye-dark td:first-child {
    color: #bbb;
}

#command-select-edges {
    text-align: center;
    border: solid 1px black;
    border-radius: 3px;
    padding: 10px;
    background: #1a1a1a;
    opacity: 0.75;
    z-index: 999;
    position: absolute;
    left: 23px;
    top: 9px;
    display: none;
}

#command-select-edges td {
    padding: 3px;
    font-size: 18px;
    text-align: right;
    color: #ffffff;
}

.box-shadow {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.k-switch-on .k-switch-thumb {
    background-color: white;
}

@media (min-width: 1200px) {
    #start-page {
        margin-left: 70px;
        margin-right: 70px;
    }
}

@media (min-width: 1400px) {
    #start-page {
        margin-left: 160px;
        margin-right: 160px;
    }
}

@media (min-width: 1600px) {
    #start-page {
        margin-left: 260px;
        margin-right: 260px;
    }
}

#col-sx {
    flex: 1;
    padding: 20px 20px 20px 10px;
    max-width: 680px;
}

#col-dx {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#start-upload {
    background: #ffffff;
    width: 360px;
    height: 360px;
    text-align: center;
    place-items: center;
    display: grid;
    border-radius: 12px;
    position: relative;
}

@media (max-width: 992px) {
    .d-flex {
        flex-direction: column !important;
    }

    #col-dx, #col-sx {
        width: 100%;
        padding: 10px;
    }

    #start-upload {
        margin-top: 20px;
    }
}

/* Footnote of the upload size limit: under the upload box, as wide as it */
#start-upload-note {
    width: 360px;
    max-width: 100%;
    font-style: italic;
}

#start-description {
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

#start-upload-box, #start-upload-drop {
    place-items: center;
    vertical-align: middle;
    height: 310px;
    width: 310px;
    display: grid;
    border: dashed 3px #777777;
    border-radius: 12px;
}

#start-upload-drop {
    position: absolute;
    background: #eeeeee;
    pointer-events: none;
    display: none;
}

.upload-button {
    display: flex;
    align-items: center;
    background-color: #1e90ff;
    color: white;
    border: none;
    border-radius: 7px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .upload-button:hover {
        background-color: #0071eb;
    }

    .upload-button i {
        margin-right: 10px;
    }

#log-container {
    width: 100%;
    margin: 2px;
    padding: 3px 3px 0px 3px;
    border: 0px;
    background-color: #444444;
    height: 227px;
    overflow-y: auto;
    font-size: 14px;
    font-family: Courier New, Courier, monospace;
    display: none;
}

#log-x {
    float: right;
    width: 19.5px;
    height: 30px;
}

#log-clear {
    color: #ed143d;
    margin-right: 2px;
    cursor: pointer;
    font-weight: bold;
    display: none;
}

.log-class {
    top: -58px;
    position: inherit;
}

.k-tooltip {
    padding-inline: 3px;
    padding-block: 3px;
}

.k-tooltip .k-callout {
    right: -14px;
}

.k-tooltip-content {
    font-size: 12px;
}

#log-list {
}

.log-entry {
    padding: 3px;
    margin-bottom: 3px;
    border: solid 1px #999999;
    color: #ffffff;
    background: #222222;
}

#error-upload {
    border: solid 1px #8b0000;
    border-radius: 9px;
    color: darkred;
    font-size: small;
    padding: 5px 9px;
    background-color: #ffe4e1;
    display: none;
}

.icon-show, .icon-hide, .icon-log {
    cursor: pointer;
    margin-right: 8px;
    font-size: 8px;
    position: relative;
    top: -2px;
}
