/* 3D tool UI — model viewer + archive-style controls (studio dark) */
.viewer-wrap {
    margin-top: 4px;
    margin-bottom: 14px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    position: relative;
}
.viewer-wrap:fullscreen,
.viewer-wrap:-webkit-full-screen {
    border-radius: 0;
    width: 100vw;
    height: 100vh;
}
.viewer-wrap:fullscreen model-viewer,
.viewer-wrap:-webkit-full-screen model-viewer {
    width: 100vw;
    height: 100vh;
    padding: 30px 30px 80px;
}
.viewer-wrap model-viewer {
    width: 100%;
    height: 440px;
    background: transparent;
    display: block;
    padding: 20px 20px 65px;
    box-sizing: border-box;
}
.viewer-controls-bar {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    white-space: nowrap;
}
.viewer-ctrl-btn {
    padding: 7px 18px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.viewer-ctrl-btn:hover { background: rgba(255, 255, 255, 0.3); }
.custom-progress-bar {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 12, 41, 0.7);
    backdrop-filter: blur(6px);
    z-index: 20;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.custom-progress-bar.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.custom-progress-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    padding: 18px 24px;
    text-align: center;
    min-width: 240px;
}
.custom-progress-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.custom-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    overflow: hidden;
}
.custom-progress-track .update-bar,
.custom-top-line .update-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #67e8f9, #a3e635);
    border-radius: 999px;
    transition: width 0.2s ease;
}
.custom-top-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 21;
}
.viewer-stats {
    display: none;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 10px;
}
.viewer-stats.visible { display: flex; }
.viewer-stat {
    flex: 1;
    min-width: 90px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid #243044;
    text-align: center;
}
.viewer-stat .val { font-size: 16px; font-weight: 800; color: #e2e8f0; }
.viewer-stat .lbl { font-size: 12px; color: #94a3b8; margin-top: 2px; }

.td-3d-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.85rem 0 0.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
}
.td-3d-check input { width: 16px; height: 16px; accent-color: #67e8f9; }

.td-3d-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}
.td-3d-example {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #334155;
    background: rgba(15, 23, 42, 0.7);
    color: #cbd5e1;
    font-size: 0.78rem;
    cursor: pointer;
}
.td-3d-example:hover {
    border-color: rgba(103, 232, 249, 0.45);
    color: #fff;
}
.td-3d-char {
    font-size: 0.72rem;
    color: #94a3b8;
    text-align: right;
    margin-top: 0.35rem;
}

.mv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
}
.mv-card {
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    padding: 0.85rem;
    background: rgba(15, 23, 42, 0.55);
    text-align: center;
    cursor: pointer;
    position: relative;
}
.mv-card h4 { margin: 0 0 0.45rem; font-size: 0.9rem; color: #e2e8f0; }
.mv-card .req { color: #f87171; font-size: 0.72rem; font-weight: 700; }
.mv-card .opt { color: #94a3b8; font-size: 0.72rem; }
.mv-card img {
    display: none;
    width: 100%;
    max-height: 110px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 0.4rem;
}
.mv-card.has-file { border-style: solid; border-color: rgba(56, 189, 248, 0.45); }
.mv-card.has-file img { display: block; }
.mv-card.has-file .mv-hint,
.mv-card.has-file .mv-icon { display: none; }
.mv-hint { margin: 0; font-size: 0.8rem; color: #94a3b8; }
.mv-icon { font-size: 1.4rem; color: #67e8f9; margin: 0.35rem 0; opacity: 0.85; }
.mv-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}
.mv-card.has-file .mv-remove { display: inline-flex; }

.td-3d-adv { display: grid; gap: 0.75rem; margin: 0.5rem 0 0.25rem; }
.td-3d-adv-card {
    padding: 0.9rem 1rem;
    border: 1px solid #243044;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.65);
}
.td-3d-adv-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}
.td-3d-adv-label {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.td-3d-tip {
    display: inline-flex;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: rgba(103, 232, 249, 0.15);
    color: #67e8f9;
    font-size: 10px;
    font-weight: 800;
    cursor: help;
}
.td-3d-val {
    min-width: 88px;
    padding: 0.35rem 0.55rem;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #67e8f9;
    font-size: 0.85rem;
    font-weight: 800;
    text-align: center;
}
.td-3d-range {
    width: 100%;
    accent-color: #67e8f9;
}
.td-3d-limits {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 600;
}

@media (max-width: 640px) {
    .mv-grid { grid-template-columns: 1fr; }
    .viewer-wrap model-viewer { height: 330px; }
}
