/*
 * TOÁN TIN — 3D Core runtime styles.
 * Contract V3: file này chỉ style DOM do Core sở hữu và KHÔNG phụ thuộc Standalone Shell.
 */
.toantin-3d-core-host {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

[data-toantin-tool="math_3d"].three-core-runtime {
  --tt3d-core-border: #dce5f0;
  --tt3d-core-text: #17324d;
  --tt3d-core-danger: #dc3545;
  position: absolute;
  inset: 0;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

[data-toantin-tool="math_3d"] .three-webgl-canvas,
[data-toantin-tool="math_3d"] .three-label-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

[data-toantin-tool="math_3d"] .three-webgl-canvas { touch-action: none; }
[data-toantin-tool="math_3d"] .three-webgl-canvas[data-interaction-mode="orbit"] { cursor: grab; }
[data-toantin-tool="math_3d"] .three-webgl-canvas[data-interaction-mode="orbit"]:active { cursor: grabbing; }
[data-toantin-tool="math_3d"] .three-webgl-canvas[data-interaction-mode="select"] { cursor: crosshair; }
[data-toantin-tool="math_3d"] .three-label-layer { pointer-events: none; overflow: hidden; }

[data-toantin-tool="math_3d"] .three-vertex-label {
  padding: .13rem .36rem;
  border-radius: 6px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--tt3d-core-border);
  color: var(--tt3d-core-text);
  font: 800 .88rem/1.2 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  box-shadow: 0 2px 8px rgba(18,47,84,.08);
  white-space: nowrap;
}

[data-toantin-tool="math_3d"] .three-core-error {
  position: absolute;
  inset: 1rem;
  z-index: 6;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
  border: 1px dashed var(--tt3d-core-danger);
  border-radius: 10px;
  color: var(--tt3d-core-danger);
  background: #fff8f8;
  font: 650 .95rem/1.5 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}

[data-toantin-tool="math_3d"] .three-annotation-canvas {
  position:absolute;
  inset:0;
  z-index:3;
  width:100%;
  height:100%;
  display:block;
  pointer-events:none;
  touch-action:none;
  cursor:crosshair;
}
[data-toantin-tool="math_3d"] .three-annotation-canvas[data-active="true"] { pointer-events:auto; }
[data-toantin-tool="math_3d"] .three-webgl-canvas[data-interaction-mode="draw"] { cursor:crosshair; }
