/* 3D-Viewer und Begehung (iPad) */
.v3d { display: flex; flex-direction: column; height: 100%; min-height: 420px; background: var(--surface); }
.v3d-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.v3d-grp { display: inline-flex; gap: 2px; padding-right: 6px; border-right: 1px solid var(--line-2); }
.v3d-grp:last-child { border-right: 0; }
.v3d-bar button { min-height: 36px; padding: 4px 10px; border-color: transparent; background: transparent; font-size: 13px; }
.v3d-bar button:hover { background: var(--hover); }
.v3d-bar button.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.v3d-bar svg { width: 18px; height: 18px; }
.v3d-bar select { width: auto; min-height: 36px; padding: 4px 8px; font-size: 13px; }
.v3d-grow { flex: 1; }
.v3d-main { flex: 1; display: grid; grid-template-columns: 280px minmax(0, 1fr) 320px; min-height: 0; position: relative; }
.v3d.no-tree .v3d-main { grid-template-columns: 0 minmax(0, 1fr) 320px; }
.v3d.no-props .v3d-main { grid-template-columns: 280px minmax(0, 1fr) 0; }
.v3d.no-tree.no-props .v3d-main { grid-template-columns: 0 minmax(0, 1fr) 0; }
.v3d.no-tree .v3d-tree, .v3d.no-props .v3d-props { display: none; }
.v3d-tree, .v3d-props { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.v3d-tree { border-right: 1px solid var(--line); grid-column: 1; grid-row: 1; }
.v3d-stage { grid-column: 2; grid-row: 1; }
.v3d-props { grid-column: 3; grid-row: 1; }
.v3d-props { border-left: 1px solid var(--line); }
.v3d-ph { padding: 10px; border-bottom: 1px solid var(--line-2); }
.v3d-list, .v3d-pbody { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
.v3d-pbody { padding: 10px 12px; }
.v3d-node { display: flex; align-items: center; gap: 4px; min-height: 32px; padding-right: 4px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.v3d-node:hover { background: var(--surface-2); }
.v3d-node.sel { background: var(--accent-soft); color: var(--accent); }
.v3d-node.off .v3d-nm { color: var(--ink-3); text-decoration: line-through; }
.v3d-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3d-tg { width: 22px; min-height: 26px; padding: 0; border: 0; background: transparent; color: var(--ink-3); justify-content: center; flex: none; display: inline-flex; align-items: center; }
.v3d-vis { min-height: 26px; width: 30px; padding: 0; border: 0; background: transparent; color: var(--ink-3); justify-content: center; opacity: .5; }
.v3d-node:hover .v3d-vis, .v3d-node.off .v3d-vis { opacity: 1; }
.v3d-vis svg { width: 15px; height: 15px; }
.v3d-stage { position: relative; min-width: 0; min-height: 0; background: var(--surface-2); overflow: hidden; touch-action: none; }
.v3d-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.v3d-stage.crosshair canvas { cursor: crosshair; }
.v3d-status { position: absolute; left: 10px; right: 10px; bottom: 8px; font-size: 12px; color: var(--ink-3); pointer-events: none; text-shadow: 0 0 6px var(--surface-2); }
.v3d-labels { position: absolute; inset: 0; pointer-events: none; }
.v3d-ml { position: absolute; transform: translate(-50%, -130%); background: #c4351f; color: #fff; font: 600 12px var(--sans); padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.v3d-tool { position: absolute; top: 10px; left: 10px; width: min(330px, calc(100% - 20px)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 13px; }
.v3d-th { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.v3d-th b { flex: 1; }
.v3d-th button { min-height: 30px; padding: 2px 9px; font-size: 12.5px; }
.v3d-th button svg { width: 15px; height: 15px; }
.v3d-row { display: grid; grid-template-columns: 82px 1fr 1fr; gap: 8px; align-items: center; padding: 4px 0; }
.v3d-row input[type=range] { width: 100%; min-height: 28px; padding: 0; border: 0; accent-color: var(--accent); background: transparent; }
.v3d-row:has(input:only-of-type) { grid-template-columns: 82px 1fr; }
.v3d-hint { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }
.v3d-meas { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid var(--line-2); }
.v3d-meas b { font-size: 16px; color: #c4351f; font-variant-numeric: tabular-nums; }
.v3d-meas span { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.v3d-walkpad { position: absolute; right: 14px; bottom: 34px; display: grid; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(2, 48px); gap: 6px; }
.v3d-walkpad button { min-height: 48px; padding: 0; justify-content: center; font-size: 18px; background: color-mix(in srgb, var(--surface) 88%, transparent); touch-action: none; user-select: none; -webkit-user-select: none; }
.v3d-walkpad [data-w=f] { grid-column: 2; grid-row: 1; } .v3d-walkpad [data-w=l] { grid-column: 1; grid-row: 2; }
.v3d-walkpad [data-w=b] { grid-column: 2; grid-row: 2; } .v3d-walkpad [data-w=r] { grid-column: 3; grid-row: 2; }
.v3d-walkpad [data-w=u] { grid-column: 1; grid-row: 1; } .v3d-walkpad [data-w=d] { grid-column: 3; grid-row: 1; }
.v3d-crumb { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; line-height: 1.6; }
.v3d-pname { font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.v3d-pname span { display: block; font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.v3d-pbody details { border-top: 1px solid var(--line-2); padding: 6px 0; }
.v3d-pbody summary { font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 0; }
.v3d-pbody table { font-size: 12.5px; }
.v3d-pbody th { font-weight: 400; color: var(--ink-3); width: 44%; padding: 4px 8px 4px 0; border: 0; white-space: normal; vertical-align: top; }
.v3d-pbody td { padding: 4px 0; border: 0; word-break: break-word; }
.v3d-empty { color: var(--ink-3); font-size: 13px; padding: 14px; text-align: center; }
@media (max-width: 900px) {
  .v3d .v3d-main, .v3d.no-tree .v3d-main, .v3d.no-props .v3d-main, .v3d.no-tree.no-props .v3d-main { grid-template-columns: minmax(0, 1fr); }
  .v3d .v3d-stage { grid-column: 1; }
  .v3d-tree, .v3d-props { position: absolute; top: 0; bottom: 0; z-index: 4; width: min(320px, 86vw); box-shadow: var(--shadow); }
  .v3d-tree { left: 0; } .v3d-props { right: 0; }
  .v3d-bar button span { display: none; }
  .v3d-bar button { padding: 4px 8px; min-width: 40px; justify-content: center; }
}
