.modelWindowViewer.detection-model-mounted {
    width: 100%;
    height: min(72vh, 760px);
    min-height: 500px;
    aspect-ratio: auto;
}

#model .downloadModel,
#model .modelControl {
    display: none !important;
}

.dmv-shell {
    --dmv-border: #d4dbe0;
    --dmv-muted: #68737c;
    --dmv-accent: #087ea4;
    display: flex;
    width: 100%;
    height: 100%;
    min-height: inherit;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--dmv-border);
    border-radius: 6px;
    background: #f7f9fa;
    color: #20262b;
}

.dmv-toolbar {
    z-index: 3;
    display: flex;
    min-height: 52px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--dmv-border);
    background: #ffffff;
}

.dmv-toolbar-group {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
}

.dmv-mode-switch {
    overflow: hidden;
    border: 1px solid #c4ccd2;
    border-radius: 4px;
}

.dmv-mode-switch button {
    height: 32px;
    padding: 0 10px;
    border: 0;
    border-right: 1px solid #d4dbe0;
    background: #ffffff;
    color: #55616a;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
}

.dmv-mode-switch button:last-child {
    border-right: 0;
}

.dmv-mode-switch button:hover,
.dmv-mode-switch button:focus-visible {
    background: #eef3f5;
    color: #1e272d;
    outline: none;
}

.dmv-mode-switch button.is-active {
    background: #53616b;
    color: #ffffff;
}

.dmv-icon-button {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #4b565f;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease,
        color 120ms ease;
}

.dmv-icon-button:hover,
.dmv-icon-button:focus-visible {
    border-color: #bdc7ce;
    background: #f0f3f5;
    color: #11171b;
    outline: none;
}

.dmv-icon-button.is-active {
    border-color: #9bc9d8;
    background: #e8f5f9;
    color: #006d91;
}

.dmv-toolbar-divider {
    width: 1px;
    height: 24px;
    margin: 0 2px;
    background: #dce2e6;
}

.dmv-workspace {
    display: grid;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 1fr) 260px;
}

.dmv-viewport {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #10161b;
}

.dmv-canvas,
.dmv-canvas canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.dmv-canvas canvas {
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.dmv-canvas canvas:active {
    cursor: grabbing;
}

.dmv-state {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    padding: 24px;
    background: rgba(16, 22, 27, 0.94);
    color: #f3f6f7;
    text-align: center;
}

.dmv-state[hidden],
.dmv-viewport-summary[hidden] {
    display: none;
}

.dmv-state-icon {
    margin-bottom: 5px;
    color: #65cce9;
    font-size: 26px;
}

.dmv-state.is-error .dmv-state-icon {
    color: #ffb55f;
}

.dmv-state strong {
    font-size: 16px;
    letter-spacing: 0;
}

.dmv-state span {
    max-width: 520px;
    color: #acb6bd;
    font-size: 13px;
}

.dmv-state .btn {
    margin-top: 8px;
}

.dmv-viewport-summary {
    position: absolute;
    right: 12px;
    bottom: 10px;
    left: 12px;
    overflow: hidden;
    color: rgba(238, 244, 247, 0.82);
    font-size: 11px;
    line-height: 1.4;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px #000000;
    white-space: nowrap;
    pointer-events: none;
}

.dmv-inspector {
    min-width: 0;
    overflow: auto;
    border-left: 1px solid var(--dmv-border);
    background: #ffffff;
}

.dmv-inspector-section {
    padding: 14px;
    border-bottom: 1px solid #e3e7ea;
}

.dmv-inspector-section h4 {
    margin: 0 0 11px;
    color: #303940;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
}

.dmv-metadata {
    display: grid;
    grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
    gap: 7px 10px;
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
}

.dmv-metadata dt,
.dmv-metadata dd {
    min-width: 0;
    margin: 0;
}

.dmv-metadata dt {
    color: var(--dmv-muted);
    font-weight: 500;
}

.dmv-metadata dd {
    overflow-wrap: anywhere;
    color: #20262b;
    font-weight: 600;
}

.dmv-layers {
    display: grid;
    gap: 2px;
}

.dmv-layer {
    display: grid;
    min-width: 0;
    min-height: 30px;
    align-items: center;
    grid-template-columns: 18px 10px minmax(0, 1fr);
    gap: 7px;
    margin: 0;
    padding: 3px 4px;
    border-radius: 3px;
    color: #3d474e;
    font-size: 12px;
    cursor: pointer;
}

.dmv-layer:hover {
    background: #f1f4f6;
}

.dmv-layer input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--dmv-accent);
}

.dmv-layer-swatch {
    width: 9px;
    height: 9px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 50%;
}

.dmv-layer-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dmv-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    min-height: 0;
    border: 0;
    border-radius: 0;
}

.dmv-fatal-error {
    display: flex;
    min-height: 300px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    border: 1px solid #d7dce1;
    border-radius: 6px;
    background: #151b20;
    color: #ffffff;
    text-align: center;
}

.dmv-fatal-error i {
    color: #ffb55f;
    font-size: 25px;
}

.dmv-fatal-error span {
    max-width: 520px;
    color: #abb5bc;
    font-size: 13px;
}

@media (max-width: 900px) {
    .modelWindowViewer.detection-model-mounted {
        height: auto;
        min-height: 700px;
    }

    .dmv-toolbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .dmv-toolbar-group:last-child {
        width: 100%;
        justify-content: flex-end;
    }

    .dmv-workspace {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(420px, 1fr) minmax(180px, auto);
    }

    .dmv-inspector {
        display: grid;
        max-height: 240px;
        border-top: 1px solid var(--dmv-border);
        border-left: 0;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .dmv-inspector-section {
        border-right: 1px solid #e3e7ea;
        border-bottom: 0;
    }
}

@media (max-width: 560px) {
    .modelWindowViewer.detection-model-mounted {
        min-height: 780px;
    }

    .dmv-mode-switch {
        width: 100%;
    }

    .dmv-mode-switch button {
        min-width: 0;
        flex: 1 1 25%;
        padding: 0 5px;
    }

    .dmv-toolbar-group:last-child {
        overflow: hidden;
        justify-content: flex-start;
        padding-bottom: 2px;
    }

    .dmv-toolbar-group:last-child .dmv-icon-button {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
    }

    .dmv-toolbar-group:last-child {
        gap: 3px;
    }

    .dmv-workspace {
        grid-template-rows: minmax(400px, 1fr) minmax(310px, auto);
    }

    .dmv-inspector {
        display: block;
        max-height: 320px;
    }

    .dmv-inspector-section {
        border-right: 0;
        border-bottom: 1px solid #e3e7ea;
    }
}
