/* DVD Rebar — bản web thử nghiệm: khung xem 3D (Components/Viewer3D.razor, wwwroot/js/viewer3d.js). */
.v3 { flex: 1; min-height: 0; display: flex; flex-direction: column; --v3-bg: #ffffff; --v3-edge: #5a6068; --v3-grid: #d0453a; }
@media (prefers-color-scheme: dark) {
    .v3 { --v3-bg: #101318; --v3-edge: #9aa3b2; --v3-grid: #ff7a6e; }
}
.v3-bar { display: flex; align-items: center; gap: 4px 10px; padding: 5px 10px; background: var(--panel2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.v3-bar label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.v3-bar select { padding: 1px 4px; }
.v3-groups { position: relative; }
.v3-groups summary { cursor: pointer; user-select: none; padding: 1px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); list-style: none; }
.v3-groups summary::-webkit-details-marker { display: none; }
.v3-groups summary::after { content: " ▾"; color: var(--muted); }
.v3-glist {
    position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 210px; max-height: 340px; overflow: auto;
    background: var(--panel); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); padding: 6px 8px;
    display: flex; flex-direction: column; gap: 2px;
}
.v3-glist label small { color: var(--muted); margin-left: auto; padding-left: 10px; }
.v3-host { flex: 1; min-height: 0; position: relative; overflow: hidden; background: var(--v3-bg); touch-action: none; }
.v3-host > canvas { display: block; position: absolute; inset: 0; outline: none; }
.v3-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); text-align: center; padding: 24px; }
.v3-msg.bad { color: var(--bad); }
.v3-msg button { margin-top: 6px; }
.v3-info {
    position: absolute; right: 10px; top: 10px; z-index: 5; max-width: 340px; background: color-mix(in srgb, var(--panel) 94%, transparent);
    border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 4px 16px rgba(0, 0, 0, .16); padding: 7px 10px; font-size: 12px; line-height: 1.45;
}
.v3-info .v3-ih { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 2px; }
.v3-info .v3-x { margin-left: auto; border: none; background: none; padding: 0 2px; color: var(--muted); }
.v3-info .v3-m { color: var(--muted); }
/* Vòng 3: thanh mặt cắt, ghi chú cả dự án, nút bật (Đo) */
.v3-clip { padding-top: 3px; padding-bottom: 3px; }
.v3-clip input[type=range] { flex: 1; min-width: 120px; max-width: 420px; }
.v3-clip .mono { min-width: 70px; font-variant-numeric: tabular-nums; }
.v3-bar .mini.on { background: var(--sel); border-color: var(--accent, #1f6feb); font-weight: 600; }
.v3-notes { padding: 3px 10px; font-size: 12px; color: #9a6400; background: color-mix(in srgb, #ffd76a 18%, var(--panel2)); border-top: 1px solid var(--line); }
/* Vòng 3: trang /3d (cả dự án) */
.v3page { height: 100%; min-height: 480px; display: flex; flex-direction: column; }
.v3page-bar { display: flex; align-items: center; gap: 12px; padding: 6px 12px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.v3page-bar label { display: inline-flex; align-items: center; gap: 5px; }
.v3page-bar .sp { flex: 1; }
.v3page-msg { padding: 4px 12px; font-size: 12px; color: var(--muted); }
/* Vòng 4: thống kê thép trong cảnh (phần giữ lại sau mặt cắt / cấu kiện đang chọn) */
.v3-stats { border-top: 1px solid var(--line); background: var(--panel); max-height: 34%; overflow: auto; font-size: 12px; }
.v3-stats .v3s-head { padding: 4px 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.v3-stats .v3s-head b { font-weight: 600; }
.v3-stats .v3s-body { display: flex; gap: 18px; flex-wrap: wrap; padding: 2px 10px 8px; align-items: flex-start; }
.v3-stats table { border-collapse: collapse; }
.v3-stats th, .v3-stats td { border-bottom: 1px solid var(--line); padding: 2px 8px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v3-stats th:first-child, .v3-stats td:first-child { text-align: left; }
.v3-stats tfoot td { font-weight: 600; border-bottom: none; }
.v3-stats .v3s-note { color: var(--muted); max-width: 420px; }
.v3-stats select { padding: 1px 4px; width: auto; min-height: 22px; }
