.model-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid #6e5c23;
    border-radius: 8px;
    background: #1c1b12;
    color: var(--white);
    font-size: 12px;
    font-weight: 800;
}
.model-open:hover { border-color: var(--gold); }
.model-badge {
    font: 900 11px/1 Arial, sans-serif;
    color: var(--gold);
    direction: ltr;
}
.hero-art:has(.model-open), .detail-image:has(.model-open) { position: relative; }
.hero-art .model-open, .detail-image .model-open {
    position: absolute;
    inset-inline-end: 9px;
    inset-block-end: 9px;
}

body:has(.model-dialog[open]) { overflow: hidden; }
.model-dialog {
    width: min(660px, calc(100% - 28px));
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
    margin: auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--panel);
    color: var(--white);
    overscroll-behavior: contain;
}
.model-dialog::backdrop { background: rgb(0 0 0 / 76%); }
.model-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
}
.model-dialog-head h2 {
    margin: 0;
    color: var(--white);
    font-size: clamp(18px, 3vw, 22px);
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.model-summary {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}
.model-close {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--bg);
    color: var(--white);
    font-size: 23px;
    line-height: 1;
}
.model-close:hover { border-color: var(--gold); }
.model-preview {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    height: clamp(190px, 51vh, 440px);
    height: clamp(190px, 51dvh, 440px);
    overflow: hidden;
    background: radial-gradient(ellipse at center, #34342b, var(--bg) 75%);
}
.model-preview > * { grid-area: 1 / 1; }
.model-preview > .model-canvas {
    width: 100%;
    height: 100%;
    --poster-color: transparent;
    --progress-bar-height: 0px;
}
.model-preview > #model-poster {
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 12px;
    object-fit: contain;
    pointer-events: none;
}
.model-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 14px 0;
}
.model-controls button {
    min-width: 44px;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--white);
    font-size: 12px;
    font-weight: 800;
}
.model-controls button:hover:enabled { border-color: var(--gold); }
.model-controls button:disabled { opacity: .5; cursor: default; }
#model-status { margin: 0; padding: 7px 14px 12px; color: var(--muted); font-size: 13px; }

@media (max-width: 500px) {
    .hero-art .model-open, .detail-image .model-open { inset-inline-end: 5px; inset-block-end: 5px; }
    .hero-art .model-open { padding-inline: 8px; }
    .model-dialog-head { padding: 10px 12px; }
    .model-preview {
        height: clamp(175px, 47vh, 350px);
        height: clamp(175px, 47dvh, 350px);
    }
}
