:root {
  --bg-deep: #0a0f14;
  --bg-panel: #111a22;
  --bg-elevated: #172430;
  --border: #243040;
  --text: #e8eef4;
  --text-muted: #8fa3b8;
  --accent: #3d9be9;
  --accent-dim: #2563a8;
  --accent-glow: rgba(61, 155, 233, 0.25);
  --success: #3ecf8e;
  --warning: #e8b84a;
  --danger: #f07178;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 12px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-deep);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(61, 155, 233, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 155, 233, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 15, 20, 0.85);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  box-shadow: 0 0 20px var(--accent-glow);
}

.brand-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Stepper */
.stepper {
  margin-bottom: 2rem;
}

.stepper-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.stepper-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.45;
  transition: opacity 0.2s;
}

.stepper-item.is-active,
.stepper-item.is-done {
  opacity: 1;
}

.stepper-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 600;
  border: 2px solid var(--border);
  background: var(--bg-panel);
}

.stepper-item.is-active .stepper-num {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.stepper-item.is-done .stepper-num {
  border-color: var(--success);
  background: rgba(62, 207, 142, 0.15);
  color: var(--success);
}

.stepper-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

/* Panels */
.panel {
  display: none;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.panel.is-visible {
  display: block;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.panel-lead {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.panel-lead code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  background: var(--bg-elevated);
  border-radius: 4px;
}

/* Dropzone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 3rem 2rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(61, 155, 233, 0.06);
}

.dropzone.has-file {
  border-color: var(--success);
  border-style: solid;
}

.dropzone-icon {
  font-size: 2rem;
  color: var(--accent);
}

.dropzone-title {
  font-weight: 500;
}

.dropzone-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

/* Check cards */
.check-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.check-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.check-card:hover:not(:disabled) {
  border-color: var(--accent-dim);
}

.check-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.check-card:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.check-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.check-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.check-badge {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2em 0.5em;
  border-radius: 4px;
  background: var(--bg-panel);
  color: var(--text-muted);
}

.check-card.is-selected .check-badge {
  background: rgba(61, 155, 233, 0.2);
  color: var(--accent);
}

/* Form */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.field select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field input[type="number"],
.field input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.field input[type="number"]:focus,
.field input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field input[type="file"] {
  display: block;
  width: 100%;
  max-width: 420px;
  padding: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.field-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.summary-card {
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.summary-title {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.summary-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
  font-size: 0.9rem;
}

.summary-dl dt {
  color: var(--text-muted);
}

.summary-dl dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
}

/* Buttons */
.panel-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
  justify-content: flex-end;
}

.btn {
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #52a8f0;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--text-muted);
}

/* Results */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  background: rgba(240, 113, 120, 0.12);
  border: 1px solid var(--danger);
  color: #ffc9cc;
}

.alert.is-info {
  background: rgba(61, 155, 233, 0.12);
  border-color: var(--accent);
  color: #b8daf5;
}

.span-block {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.span-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.span-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.span-title {
  margin: 0;
  font-size: 1.1rem;
  font-family: var(--mono);
}

.span-total {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

.span-total strong {
  font-family: var(--mono);
}

.leg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.leg-table th,
.leg-table td {
  padding: 0.55rem 0.65rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.leg-table th:first-child,
.leg-table td:first-child {
  text-align: left;
}

.leg-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.leg-table tbody tr:hover {
  background: rgba(61, 155, 233, 0.04);
}

.leg-table .mono {
  font-family: var(--mono);
}

.alert-warn {
  background: rgba(240, 113, 120, 0.12);
  border: 1px solid var(--danger);
  color: #ffc9cc;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.span-block--warn {
  border-left: 3px solid var(--danger);
  padding-left: 1rem;
}

.status-badge {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 0.35rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 6px;
}

.status-badge--ok {
  background: rgba(62, 207, 142, 0.15);
  color: var(--success);
  border: 1px solid rgba(62, 207, 142, 0.4);
}

.status-badge--exceeded {
  background: rgba(240, 113, 120, 0.2);
  color: #ffc9cc;
  border: 1px solid var(--danger);
}

.verdict {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
}

.verdict--ok {
  color: var(--success);
}

.verdict--warn {
  color: #ffc9cc;
}

.tag-match-table th,
.tag-match-table td {
  text-align: left;
}

.tag-match-table td:nth-child(3) {
  text-align: center;
}

.leader-coord-table .leader-snap-cell {
  text-align: center;
  vertical-align: middle;
  min-width: 140px;
}

.pid-coverage-snap-wrap {
  margin: 0.75rem 0 1rem;
}

.pid-coverage-snap {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.leader-snap {
  display: block;
  max-width: 220px;
  max-height: 160px;
  width: auto;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.leader-nearby {
  font-size: 0.9rem;
  line-height: 1.35;
  word-break: break-word;
}

.detail-sticker-table .leader-snap-cell {
  text-align: center;
  vertical-align: middle;
  min-width: 130px;
}

.leg-table tbody tr.row-warn {
  background: rgba(240, 113, 120, 0.08);
}

.status-badge--not_ok {
  background: rgba(240, 113, 120, 0.2);
  color: #ffc9cc;
  border: 1px solid var(--danger);
}

.status-badge--warning {
  background: rgba(232, 184, 74, 0.15);
  color: var(--warning);
  border: 1px solid rgba(232, 184, 74, 0.35);
}

.supports-pill {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.support-tag {
  padding: 0.35rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* Loading */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(10, 15, 20, 0.88);
  backdrop-filter: blur(4px);
}

.loading-overlay[hidden] {
  display: none;
}

.loading-overlay.has-preview {
  justify-content: flex-end;
  padding: 2rem;
}

.loading-preview {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.loading-preview iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0.33;
  filter: saturate(0.95) contrast(0.95);
}

.loading-scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 16px var(--accent-glow);
  animation: scan 2.4s ease-in-out infinite;
}

.loading-preview-label {
  position: absolute;
  right: 1.25rem;
  bottom: 1rem;
  margin: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #c9def2;
  background: rgba(10, 15, 20, 0.68);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.loading-status {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scan {
  0% {
    top: 12%;
    opacity: 0.4;
  }
  50% {
    top: 82%;
    opacity: 1;
  }
  100% {
    top: 12%;
    opacity: 0.4;
  }
}

.results-table-light-wrap {
  margin-top: 1rem;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid #d0d7de;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.results-table--light {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  color: #1a2332;
  background: #ffffff;
}

.results-table--light th,
.results-table--light td {
  border: 1px solid #e2e8f0;
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.results-table--light th {
  background: #f6f8fa;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.results-table--light tbody tr:nth-child(even) {
  background: #fafbfc;
}

.results-table--light tbody tr.row-delta-warn {
  background: #fff4f4;
}

.results-table--light .cell-over-tolerance {
  background: #ffd8d8;
  color: #8b1a1a;
  font-weight: 700;
}

.cii-3d-results {
  max-width: none;
}

.cii-3d-results .panel-lead,
.cii-3d-results .results-meta {
  margin-bottom: 0.5rem;
}

.cii-3d-summary-compact {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  line-height: 1.45;
}

.cii-3d-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 0.75rem;
  align-items: stretch;
  min-height: calc(100vh - 9.5rem);
  height: calc(100vh - 9.5rem);
  /* The 3D viewer is a light-surfaced workspace (light canvas, light panels and
     a light maximized background), so flip the shared theme tokens to
     dark-on-light here. This guarantees legible text in every panel and both
     embedded and full-screen modes. */
  --text: #1c2940;
  --text-muted: #51637e;
  --border: #c4d0dc;
  --bg-elevated: #ffffff;
}

.cii-3d-layout.is-maximized {
  position: fixed;
  inset: 0;
  z-index: 1200;
  min-height: 100vh;
  height: 100vh;
  margin: 0;
  padding: 0.5rem;
  gap: 0.5rem;
  background: #e8eef4;
  grid-template-columns: minmax(0, 1fr) 240px;
}

.cii-3d-viewer-wrap {
  position: relative;
  min-height: 0;
  height: 100%;
  border: 1px solid #c4d0dc;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f4f7fa;
}

.cii-3d-viewer-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.cii-3d-viewer-toolbar {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  gap: 0.35rem;
  max-width: calc(100% - 1rem);
  /* Never let a tall, wrapped toolbar spill past the viewer and hide buttons
     (e.g. on small/zoomed windows or in full screen). Cap it to the viewer
     height and scroll internally so every button — including "Exit full
     screen" — always stays reachable from the top. */
  max-height: calc(100% - 1.1rem);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 2px;
  pointer-events: auto;
}

/* Slim, unobtrusive scrollbar only shows when the toolbar actually overflows. */
.cii-3d-viewer-toolbar::-webkit-scrollbar {
  width: 8px;
}

.cii-3d-viewer-toolbar::-webkit-scrollbar-thumb {
  background: rgba(40, 60, 90, 0.28);
  border-radius: 6px;
}

.cii-3d-viewer-toolbar button,
.cii-3d-toolbar-btn {
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(40, 60, 90, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: #2a3c50;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(20, 40, 70, 0.14);
  backdrop-filter: blur(6px);
  transition: background 0.12s, border-color 0.12s;
}

.cii-3d-viewer-toolbar button:hover,
.cii-3d-toolbar-btn:hover {
  background: #ffffff;
  border-color: rgba(40, 80, 140, 0.38);
}

.cii-3d-viewer-toolbar button:disabled,
.cii-3d-toolbar-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.cii-3d-viewer-toolbar button.is-active,
.cii-3d-toolbar-btn.is-active {
  background: #1565c0;
  border-color: #1a78d4;
  color: #ffffff;
}

.cii-3d-toolbar-btn[data-accent="nodes"].is-active {
  background: #2e7d32;
  border-color: #388e3c;
}

.cii-3d-toolbar-btn[data-accent="tags"].is-active {
  background: #6a1b9a;
  border-color: #7b1fa2;
}

.cii-3d-toolbar-btn[data-accent="measure"].is-active {
  background: #e65100;
  border-color: #ef6c00;
}

.cii-3d-toolbar-btn[data-accent="move"].is-active {
  background: #e91e8c;
  border-color: #f06292;
  color: #fff;
}

.cii-3d-toolbar-btn[data-accent="remove"].is-active {
  background: #d32f2f;
  border-color: #ef5350;
  color: #fff;
}

.cii-3d-toolbar-btn[data-accent="flow"].is-active {
  background: #2f7fb8;
  border-color: #8fd3ff;
  color: #fff;
}

.cii-3d-add-idf-btn {
  white-space: nowrap;
  color: #1b7a44;
  border-color: rgba(27, 122, 68, 0.35);
}

.cii-3d-add-idf-btn:hover {
  background: #f0fbf4;
  border-color: rgba(27, 122, 68, 0.6);
  color: #156337;
}

.cii-3d-add-idf-btn:active {
  background: #1b7a44;
  border-color: #1b7a44;
  color: #ffffff;
}

.cii-3d-viewer-wrap.is-measuring canvas {
  cursor: default;
}

.cii-3d-viewer-wrap.is-moving-idf canvas {
  cursor: pointer;
}

.cii-3d-viewer-wrap.is-moving-idf::after {
  content: "Click IDF pipe(s) to select · Apply move to translate · Undo reverses last move · Esc clears selection or exits";
}

.cii-3d-viewer-wrap.is-removing-idf canvas {
  cursor: crosshair;
}

.cii-3d-viewer-wrap.is-removing-idf::after {
  content: "Click IDF(s) to select · Drag a window to multi-select · Remove selected in panel · Esc clears or exits";
}

.cii-3d-zoom-rect.is-idf-select {
  border-color: rgba(211, 47, 47, 0.9);
  background: rgba(211, 47, 47, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.cii-3d-idf-move-panel {
  position: absolute;
  left: 0.65rem;
  top: 0.55rem;
  z-index: 14;
  width: min(19rem, calc(100% - 1.3rem));
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(233, 30, 140, 0.28);
  border-radius: 10px;
  background: rgba(255, 248, 252, 0.97);
  box-shadow: 0 8px 28px rgba(233, 30, 140, 0.12);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.cii-3d-idf-move-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.cii-3d-idf-move-panel-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c2185b;
}

.cii-3d-idf-move-close {
  padding: 0.22rem 0.55rem;
  border: 1px solid rgba(40, 60, 90, 0.2);
  border-radius: 5px;
  background: #f7f9fc;
  color: #4a6078;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.cii-3d-idf-move-close:hover {
  background: #ffffff;
  border-color: rgba(233, 30, 140, 0.35);
  color: #c2185b;
}

.cii-3d-idf-move-hint {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #5a7088;
}

.cii-3d-idf-move-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cii-3d-idf-move-selected.has-selection {
  color: var(--text);
}

.cii-3d-idf-move-selected .cii-3d-move-chip {
  border-color: rgba(233, 30, 140, 0.28);
  background: rgba(233, 30, 140, 0.08);
  color: #ad1457;
}

.cii-3d-idf-move-empty {
  font-size: 0.78rem;
  color: #5a7088;
}

.cii-3d-idf-move-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.cii-3d-idf-move-grid label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4a6078;
}

.cii-3d-idf-move-grid input {
  width: 100%;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(40, 60, 90, 0.22);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.cii-3d-idf-move-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cii-3d-idf-move-apply,
.cii-3d-idf-move-undo,
.cii-3d-idf-move-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.38rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.cii-3d-idf-move-apply {
  border: 1px solid rgba(233, 30, 140, 0.35);
  background: rgba(233, 30, 140, 0.14);
  color: #ad1457;
}

.cii-3d-idf-move-apply:hover {
  background: rgba(233, 30, 140, 0.22);
}

.cii-3d-idf-move-clear {
  border: 1px solid rgba(40, 60, 90, 0.2);
  background: #f7f9fc;
  color: #4a6078;
}

.cii-3d-idf-move-clear:hover {
  background: #ffffff;
  border-color: rgba(40, 80, 140, 0.35);
}

.cii-3d-idf-move-undo {
  border: 1px solid rgba(61, 155, 233, 0.32);
  background: rgba(61, 155, 233, 0.1);
  color: #1d5f9a;
}

.cii-3d-idf-move-undo:hover:not(:disabled) {
  background: rgba(61, 155, 233, 0.18);
  border-color: rgba(61, 155, 233, 0.45);
}

.cii-3d-idf-move-undo:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.cii-3d-idf-move-undo svg {
  flex: 0 0 auto;
}

.cii-3d-idf-remove-panel {
  position: absolute;
  left: 0.65rem;
  top: 0.55rem;
  z-index: 14;
  width: min(19rem, calc(100% - 1.3rem));
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(211, 47, 47, 0.3);
  border-radius: 10px;
  background: rgba(255, 250, 250, 0.97);
  box-shadow: 0 8px 28px rgba(211, 47, 47, 0.12);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.cii-3d-idf-remove-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.cii-3d-idf-remove-panel-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #b71c1c;
}

.cii-3d-idf-remove-close {
  padding: 0.22rem 0.55rem;
  border: 1px solid rgba(211, 47, 47, 0.25);
  border-radius: 5px;
  background: #fff5f5;
  color: #c62828;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.cii-3d-idf-remove-close:hover {
  background: #ffebee;
  border-color: rgba(211, 47, 47, 0.4);
}

.cii-3d-idf-remove-hint {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #5a4040;
}

.cii-3d-idf-remove-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.6rem;
  padding: 0.45rem 0.5rem;
  border: 1px dashed rgba(211, 47, 47, 0.28);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.cii-3d-idf-remove-selected.has-selection {
  border-style: solid;
  background: rgba(255, 235, 238, 0.72);
}

.cii-3d-idf-remove-selected .cii-3d-remove-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(211, 47, 47, 0.12);
  border: 1px solid rgba(211, 47, 47, 0.22);
  color: #b71c1c;
  font-size: 0.72rem;
  font-weight: 650;
}

.cii-3d-idf-remove-empty {
  font-size: 0.74rem;
  color: #8a6060;
}

.cii-3d-idf-remove-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cii-3d-idf-remove-apply,
.cii-3d-idf-remove-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.38rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.cii-3d-idf-remove-apply {
  border: 1px solid rgba(211, 47, 47, 0.38);
  background: rgba(211, 47, 47, 0.14);
  color: #b71c1c;
}

.cii-3d-idf-remove-apply:hover:not(:disabled) {
  background: rgba(211, 47, 47, 0.22);
}

.cii-3d-idf-remove-apply:disabled,
.cii-3d-idf-remove-clear:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.cii-3d-idf-remove-clear {
  border: 1px solid rgba(40, 60, 90, 0.2);
  background: #f7f9fc;
  color: #4a6078;
}

.cii-3d-idf-remove-clear:hover:not(:disabled) {
  background: #ffffff;
  border-color: rgba(40, 80, 140, 0.35);
}

.cii-3d-measure-panel {
  position: absolute;
  left: 0.65rem;
  top: 0.55rem;
  z-index: 14;
  width: min(18.5rem, calc(100% - 1.3rem));
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(40, 60, 90, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 28px rgba(20, 40, 70, 0.16);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.cii-3d-measure-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.cii-3d-measure-panel-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #2a3c50;
}

.cii-3d-measure-clear {
  padding: 0.22rem 0.55rem;
  border: 1px solid rgba(40, 60, 90, 0.2);
  border-radius: 5px;
  background: #f7f9fc;
  color: #4a6078;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.cii-3d-measure-clear:hover {
  background: #ffffff;
  border-color: rgba(21, 101, 192, 0.35);
  color: #1565c0;
}

.cii-3d-measure-hint {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #5a7088;
}

.cii-3d-measure-endpoints {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.cii-3d-measure-endpoint {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.76rem;
  line-height: 1.35;
  color: #33485c;
}

.cii-3d-measure-endpoint-badge {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #ffffff;
}

.cii-3d-measure-endpoint--a .cii-3d-measure-endpoint-badge {
  background: #ff6f00;
}

.cii-3d-measure-endpoint--b .cii-3d-measure-endpoint-badge {
  background: #6a1b9a;
}

.cii-3d-measure-rows {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.cii-3d-measure-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.38rem 0.55rem;
  border-radius: 7px;
  background: #f7f9fc;
  border: 1px solid rgba(40, 60, 90, 0.08);
}

.cii-3d-measure-axis {
  min-width: 1.8rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.cii-3d-measure-row--x .cii-3d-measure-axis,
.cii-3d-measure-row--x .cii-3d-measure-value {
  color: #c62828;
}

.cii-3d-measure-row--y .cii-3d-measure-axis,
.cii-3d-measure-row--y .cii-3d-measure-value {
  color: #2e7d32;
}

.cii-3d-measure-row--z .cii-3d-measure-axis,
.cii-3d-measure-row--z .cii-3d-measure-value {
  color: #1565c0;
}

.cii-3d-measure-value {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cii-3d-measure-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding-top: 0.15rem;
  border-top: 1px solid rgba(40, 60, 90, 0.1);
}

.cii-3d-measure-summary > div {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  font-size: 0.72rem;
  color: #5a7088;
}

.cii-3d-measure-summary strong {
  font-size: 0.82rem;
  color: #1565c0;
  font-variant-numeric: tabular-nums;
}

.cii-3d-measure-actions {
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(40, 60, 90, 0.1);
}

.cii-3d-measure-move-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(21, 101, 192, 0.4);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(33, 118, 209, 0.16), rgba(21, 101, 192, 0.1));
  color: #134c8f;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cii-3d-measure-move-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(33, 118, 209, 0.26), rgba(21, 101, 192, 0.18));
  border-color: rgba(21, 101, 192, 0.65);
  color: #0d3c73;
}

.cii-3d-measure-move-btn.is-active {
  background: linear-gradient(180deg, #2176d1, #1565c0);
  border-color: #1257a8;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(21, 101, 192, 0.3);
}

.cii-3d-measure-move-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Floating "select an IDF to move by Δ" popup. */
.cii-3d-measure-move-popup {
  position: absolute;
  left: 50%;
  top: 0.7rem;
  transform: translateX(-50%);
  z-index: 24;
  width: min(24rem, calc(100% - 1.4rem));
  display: grid;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(21, 101, 192, 0.4);
  border-radius: 11px;
  background: rgba(247, 251, 255, 0.98);
  box-shadow: 0 12px 36px rgba(15, 50, 100, 0.24);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  animation: cii-3d-move-popup-in 0.16s ease-out;
}

@keyframes cii-3d-move-popup-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.cii-3d-measure-move-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.cii-3d-measure-move-popup-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #134c8f;
}

.cii-3d-measure-move-popup-close {
  padding: 0.18rem 0.5rem;
  border: 1px solid rgba(21, 101, 192, 0.35);
  border-radius: 5px;
  background: #eef5fe;
  color: #1565c0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.cii-3d-measure-move-popup-close:hover {
  background: #ffffff;
  border-color: #1565c0;
}

.cii-3d-measure-move-popup-delta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cii-3d-measure-move-popup-d {
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  background: #eef3fb;
  border: 1px solid rgba(40, 60, 90, 0.1);
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cii-3d-measure-move-popup-d.d-x { color: #c62828; }
.cii-3d-measure-move-popup-d.d-y { color: #2e7d32; }
.cii-3d-measure-move-popup-d.d-z { color: #1565c0; }

.cii-3d-measure-move-popup-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #3a5168;
}

.cii-3d-measure-move-popup-hint strong { color: #134c8f; }
.cii-3d-measure-move-popup-hint strong.warn { color: #c62828; }

.cii-3d-viewer-wrap.is-measuring.is-measure-move-pick canvas {
  cursor: grab;
}

.cii-3d-viewer-wrap.is-measuring.is-measure-move-pick::after {
  content: "Click an IDF to move it by Δ · Esc finishes";
}

.cii-3d-toolbar-opacity {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(40, 60, 90, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 6px rgba(20, 40, 70, 0.14);
  backdrop-filter: blur(6px);
  font-size: 0.78rem;
  font-weight: 600;
  color: #2a3c50;
  cursor: default;
}

.cii-3d-toolbar-opacity input[type="range"] {
  width: 88px;
  accent-color: #1565c0;
}

.cii-3d-toolbar-opacity input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cii-3d-toolbar-opacity-value {
  min-width: 2.2rem;
  font-variant-numeric: tabular-nums;
  color: #4a6078;
}

.cii-3d-layout.is-maximized .cii-3d-sidebar {
  max-height: calc(100vh - 1rem);
  overflow-y: auto;
}

.cii-3d-zoom-rect {
  position: absolute;
  z-index: 15;
  border: 2px dashed #1565c0;
  background: rgba(21, 101, 192, 0.1);
  pointer-events: none;
  box-sizing: border-box;
}

.cii-3d-viewer-wrap::after {
  content: "Double-click to zoom in close · Shift+drag window zoom";
  position: absolute;
  left: auto;
  right: 0.65rem;
  bottom: 0.55rem;
  font-size: 0.72rem;
  color: rgba(50, 70, 100, 0.55);
  pointer-events: none;
  z-index: 2;
}

.cii-3d-viewer-wrap.is-measuring::after {
  content: "Click to measure · Use nav rail for rotate/pan/zoom · Esc clears";
}

/* ── Axes configuration panel ──────────────────────────────────────── */
.cii-3d-axes-panel {
  position: absolute;
  z-index: 26;
  top: 2.7rem;
  right: 0.55rem;
  width: 270px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(30, 60, 110, 0.18);
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(10, 30, 70, 0.22), 0 2px 8px rgba(10, 30, 70, 0.1);
  backdrop-filter: blur(12px);
  color: #1e3054;
  font-size: 0.82rem;
  overflow: hidden;
}

.cii-3d-axes-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.85rem 0.55rem;
  background: linear-gradient(135deg, #e8f0ff 0%, #f0f6ff 100%);
  border-bottom: 1px solid rgba(30, 60, 110, 0.12);
}

.cii-3d-axes-panel-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.83rem;
  color: #1a3560;
  letter-spacing: 0.01em;
}

.cii-3d-axes-close {
  padding: 0.15rem 0.4rem;
  background: none;
  border: 1px solid rgba(30, 60, 110, 0.18);
  border-radius: 5px;
  color: #6080aa;
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}

.cii-3d-axes-close:hover {
  background: rgba(30, 60, 110, 0.1);
  color: #1a3560;
}

.cii-3d-axes-panel-body {
  padding: 0.85rem 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cii-3d-axes-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cii-3d-axes-label {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  font-weight: 600;
  color: #2a4070;
  white-space: nowrap;
  flex-shrink: 0;
}

.cii-3d-axes-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
}

.cii-3d-axes-icon--up {
  background: #e3edff;
  color: #1565c0;
}

.cii-3d-axes-icon--east {
  background: #e5f5ee;
  color: #1b5e20;
}

.cii-3d-axes-select {
  flex: 1;
  padding: 0.32rem 0.55rem;
  border: 1px solid rgba(30, 60, 110, 0.22);
  border-radius: 6px;
  background: #f7f9ff;
  color: #1e3054;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.12s;
  max-width: 140px;
}

.cii-3d-axes-select:focus {
  border-color: #1565c0;
  box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.18);
}

/* Radio button group for Up-axis selection */
.cii-3d-axes-radio-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.28rem;
}

.cii-3d-axes-radio-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem 0.3rem 0.45rem;
  border: 1.5px solid rgba(30, 60, 110, 0.18);
  border-radius: 7px;
  background: #f7f9ff;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  font-size: 0.8rem;
  user-select: none;
}

.cii-3d-axes-radio-label:has(input:checked) {
  border-color: #1565c0;
  background: #e3edff;
}

.cii-3d-axes-radio-label input[type="radio"] {
  accent-color: #1565c0;
  margin: 0;
}

.cii-3d-axes-radio-badge {
  font-weight: 800;
  font-size: 0.82rem;
  color: #1565c0;
  letter-spacing: 0.02em;
}

.cii-3d-axes-radio-desc {
  color: #4a6080;
  font-size: 0.73rem;
  font-weight: 500;
}

.cii-3d-axes-hint {
  margin: 0;
  font-size: 0.73rem;
  color: #7090b8;
  line-height: 1.4;
  padding: 0.3rem 0.25rem 0;
  border-top: 1px solid rgba(30, 60, 110, 0.08);
}

.cii-3d-axes-apply {
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
  border: none;
  border-radius: 7px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(21, 101, 192, 0.32);
  transition: background 0.14s, box-shadow 0.14s, transform 0.08s;
}

.cii-3d-axes-apply:hover {
  background: linear-gradient(135deg, #1976d2 0%, #1e88e5 100%);
  box-shadow: 0 4px 14px rgba(21, 101, 192, 0.42);
}

.cii-3d-axes-apply:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(21, 101, 192, 0.25);
}
/* ─────────────────────────────────────────────────────────────────── */

.cii-3d-view-menu {
  position: absolute;
  z-index: 20;
  min-width: 148px;
  padding: 0.35rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}

.cii-3d-view-menu-title {
  padding: 0.35rem 0.75rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cii-3d-view-menu button {
  display: block;
  width: 100%;
  padding: 0.42rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
}

.cii-3d-view-menu button:hover,
.cii-3d-view-menu button:focus-visible {
  background: rgba(61, 155, 233, 0.18);
  outline: none;
}

.cii-3d-nav-ribbon {
  position: absolute;
  top: 50%;
  right: 12px;
  z-index: 18;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 7px;
  border: 1px solid rgba(30, 60, 110, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 28px rgba(20, 40, 80, 0.12);
  backdrop-filter: blur(10px);
  transform: translateY(-50%);
}

.cii-3d-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 52px;
  padding: 8px 6px 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #4a6078;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.cii-3d-nav-btn span {
  line-height: 1.1;
}

.cii-3d-nav-btn:hover {
  background: #eef4fc;
  border-color: #d4e2f4;
  color: #1e4a8a;
}

.cii-3d-nav-btn.is-active {
  background: linear-gradient(180deg, #eef4ff, #e3edfb);
  border-color: #b8cff0;
  color: #1d4ed8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.cii-3d-nav-btn svg {
  flex: 0 0 auto;
}

.cii-3d-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 100%;
  overflow-y: auto;
  /* Light card surface so dark-on-light text stays readable whether the sidebar
     floats over the dark app page (embedded) or the light maximized backdrop. */
  padding: 0.75rem 0.7rem;
  background: #ffffff;
  border: 1px solid #d4dde7;
  border-radius: 10px;
  color: var(--text);
}

.cii-3d-legend {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.cii-3d-legend span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cii-3d-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.cii-3d-controls {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.cii-3d-controls label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cii-3d-opacity-control {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.cii-3d-opacity-control input[type="range"] {
  flex: 1 1 120px;
  min-width: 120px;
  accent-color: var(--accent, #1565c0);
}

.cii-3d-opacity-control input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cii-3d-opacity-label {
  min-width: 5.5rem;
}

.cii-3d-opacity-value {
  min-width: 2.5rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.cii-3d-selection-info {
  margin-top: 0.15rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 212, 0, 0.12);
  border: 1px solid rgba(255, 212, 0, 0.35);
  font-size: 0.84rem;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.4;
}

.cii-3d-session-undo-bar {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.cii-3d-session-undo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.48rem 0.65rem;
  border: 1px solid rgba(61, 155, 233, 0.32);
  border-radius: 8px;
  background: rgba(61, 155, 233, 0.1);
  color: #1d5f9a;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.cii-3d-session-undo-btn:hover:not(:disabled) {
  background: rgba(61, 155, 233, 0.18);
  border-color: rgba(61, 155, 233, 0.45);
}

.cii-3d-session-undo-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.cii-3d-session-undo-btn svg {
  flex: 0 0 auto;
}

.cii-3d-session-undo-hint {
  margin: 0;
}

.cii-3d-toolbar-btn.cii-3d-session-undo-toolbar-btn {
  border-color: rgba(61, 155, 233, 0.28);
  color: #1d5f9a;
}

.cii-3d-toolbar-btn.cii-3d-session-undo-toolbar-btn:hover:not(:disabled) {
  background: rgba(61, 155, 233, 0.12);
  border-color: rgba(61, 155, 233, 0.4);
}

.cii-3d-move-panel {
  display: grid;
  gap: 0.55rem;
  padding: 0.65rem;
  border: 1px solid rgba(233, 30, 140, 0.28);
  border-radius: 8px;
  background: rgba(233, 30, 140, 0.06);
}

.cii-3d-view-status {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  z-index: 13;
  max-width: min(28rem, calc(100% - 1.3rem));
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  border: 1px solid rgba(40, 80, 140, 0.22);
  background: rgba(255, 255, 255, 0.94);
  color: #2a3c50;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(20, 40, 70, 0.16);
  pointer-events: none;
}

.cii-3d-view-status.is-error {
  border-color: rgba(198, 40, 40, 0.35);
  background: rgba(255, 235, 238, 0.96);
  color: #b71c1c;
}

.params-3d-view-field .field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: var(--text);
}

.params-3d-view-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.build-3d-modal {
  max-width: 34rem;
}

.build-3d-modal-body {
  display: grid;
  gap: 0.85rem;
}

.build-3d-modal-body .field label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: #1f2d4d;
}

.build-3d-modal-body input[type="file"],
.build-3d-modal-body input[type="number"],
.build-3d-modal-body input[type="text"] {
  width: 100%;
  color: #15315c;
  background: #f3f7ff;
  border: 1px solid rgba(30, 60, 110, 0.25);
}

.build-3d-modal-body input[type="file"]:focus,
.build-3d-modal-body input[type="number"]:focus,
.build-3d-modal-body input[type="text"]:focus {
  border-color: #3d9be9;
  box-shadow: 0 0 0 3px rgba(61, 155, 233, 0.18);
}

.build-3d-expected {
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(40, 80, 140, 0.18);
  background: rgba(40, 80, 140, 0.05);
  color: #233456;
}

.build-3d-expected ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.build-3d-expected li {
  margin: 0.15rem 0;
  font-size: 0.82rem;
  color: #2a3c5e;
}

.build-3d-modal-body .field-hint {
  color: #50617f;
}

.build-3d-modal-body .build-3d-modal-msg {
  color: #50617f;
}

.build-3d-modal-msg {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.build-3d-modal-msg.is-error {
  color: #b71c1c;
  font-weight: 600;
}

.cii-3d-save-view-btn {
  white-space: nowrap;
}

.cii-3d-move-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e91e8c;
}

.cii-3d-move-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cii-3d-move-selected.has-selection {
  color: var(--text);
}

.cii-3d-move-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.32rem 0.45rem;
  border: 1px solid rgba(233, 30, 140, 0.28);
  border-radius: 6px;
  background: rgba(233, 30, 140, 0.08);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #ad1457;
}

.cii-3d-move-chip small {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.cii-3d-move-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.cii-3d-move-grid label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cii-3d-move-grid input {
  width: 100%;
  padding: 0.36rem 0.42rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text);
  font: 0.8rem var(--mono);
}

.cii-3d-move-actions {
  display: flex;
  gap: 0.45rem;
}

.cii-3d-move-apply,
.cii-3d-move-undo,
.cii-3d-move-clear {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.42rem 0.5rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.cii-3d-move-apply {
  border: 1px solid rgba(233, 30, 140, 0.35);
  background: #e91e8c;
  color: #fff;
}

.cii-3d-move-clear {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
}

.cii-3d-move-undo {
  border: 1px solid rgba(61, 155, 233, 0.32);
  background: rgba(61, 155, 233, 0.1);
  color: #1d5f9a;
}

.cii-3d-move-undo:hover:not(:disabled) {
  background: rgba(61, 155, 233, 0.18);
}

.cii-3d-move-undo:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.cii-3d-toolbar-btn.cii-3d-undo-move-btn {
  border-color: rgba(61, 155, 233, 0.28);
  color: #1d5f9a;
}

.cii-3d-toolbar-btn.cii-3d-undo-move-btn:hover:not(:disabled) {
  background: rgba(61, 155, 233, 0.12);
  border-color: rgba(61, 155, 233, 0.4);
}

.cii-3d-stats {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.cii-3d-spacing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.cii-3d-spacing-table th,
.cii-3d-spacing-table td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.45rem;
  text-align: left;
  color: #1c2940;
}

.cii-3d-spacing-table th {
  font-weight: 700;
  color: #15315c;
  background: #eef3fb;
}

.cii-3d-anchor-panel {
  margin: 0.75rem 0 1rem;
}

.cii-anchor-prompt {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cii-anchor-prompt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 1.25rem;
  align-items: start;
}

.cii-anchor-schematic-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 0.85rem;
}

.cii-anchor-schematic {
  display: block;
  width: 100%;
  height: auto;
  min-height: 240px;
  max-height: 420px;
  border-radius: calc(var(--radius) - 2px);
  background: #ffffff;
}

.cii-anchor-schematic-bg {
  fill: #ffffff;
}

.cii-anchor-schematic-line {
  stroke: #7b8ea8;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.cii-anchor-schematic-node {
  fill: #3d9be9;
  stroke: #ffffff;
  stroke-width: 1.5;
}

.cii-anchor-schematic-node.is-seed {
  fill: #f59e0b;
  stroke: #8a4b00;
  stroke-width: 2;
}

.cii-anchor-schematic-node.is-support {
  fill: #2e7d52;
}

.cii-anchor-schematic-label {
  fill: #334155;
  font: 600 11px "JetBrains Mono", monospace;
  text-anchor: middle;
}

.cii-anchor-schematic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.cii-anchor-form {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.7);
}

.cii-anchor-form input[type="number"] {
  width: 100%;
}

@media (max-width: 960px) {
  .cii-anchor-prompt-layout {
    grid-template-columns: 1fr;
  }

  .cii-3d-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 1fr) auto;
    height: auto;
    min-height: calc(100vh - 10rem);
  }

  .cii-3d-viewer-wrap {
    min-height: 420px;
    height: min(62vh, 720px);
  }
}

@media (max-width: 600px) {
  .stepper-label {
    display: none;
  }

  .panel {
    padding: 1.25rem;
  }

  .leg-table {
    font-size: 0.75rem;
  }
}

/* ── Define Support Types editor ──────────────────────────────────────── */
.st-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(12, 24, 44, 0.5);
  backdrop-filter: blur(3px);
}

.st-modal {
  display: flex;
  flex-direction: column;
  width: min(1040px, 96vw);
  max-height: 90vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(10, 30, 70, 0.4);
  overflow: hidden;
}

.st-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, #e8f0ff 0%, #f4f8ff 100%);
  border-bottom: 1px solid rgba(30, 60, 110, 0.12);
}

.st-modal-title {
  margin: 0;
  font-size: 1.05rem;
  color: #15315c;
}

.st-modal-sub {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: #4a5f7d;
}

.st-modal-close {
  flex: none;
  padding: 0.25rem 0.5rem;
  background: none;
  border: 1px solid rgba(30, 60, 110, 0.2);
  border-radius: 6px;
  color: #60799f;
  font-size: 0.85rem;
  cursor: pointer;
}

.st-modal-close:hover {
  background: rgba(30, 60, 110, 0.1);
  color: #15315c;
}

.st-modal-toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1.2rem;
  border-bottom: 1px solid rgba(30, 60, 110, 0.1);
  font-size: 0.8rem;
}

.st-spacer {
  flex: 1 1 auto;
}

.st-axis-pill,
.st-source-pill {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #eef3fb;
  color: #2a3c50;
}

.st-source-pill.is-user {
  background: #e3f5e8;
  color: #1b6b37;
}

.st-source-pill.is-default {
  background: #eef3fb;
  color: #44607f;
}

.st-identifier {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.15rem;
}

.st-identifier-label {
  font-weight: 600;
  color: #2a3c50;
  white-space: nowrap;
}

.st-identifier-input {
  width: min(20rem, 46vw);
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(30, 60, 110, 0.22);
  border-radius: 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #24344c;
  background: #fff;
}

.st-identifier-input:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.18);
}

.st-identifier-input::placeholder {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.72rem;
  color: #7a8da6;
}

.st-vocab summary {
  cursor: pointer;
  color: #1565c0;
  font-weight: 600;
}

.st-vocab-list {
  margin-top: 0.45rem;
  padding: 0.6rem 0.7rem;
  background: #f7f9fc;
  border: 1px solid rgba(30, 60, 110, 0.12);
  border-radius: 8px;
  font-size: 0.76rem;
  line-height: 1.7;
  color: #3a4d66;
}

.st-vocab-list code {
  background: #e7eefb;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  color: #1a3a6b;
}

.st-modal-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 0.8rem 1.2rem 1rem;
}

.st-table-wrap {
  overflow: auto;
  border: 1px solid rgba(30, 60, 110, 0.14);
  border-radius: 10px;
}

.st-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.st-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 0.5rem 0.55rem;
  background: #f2f6fd;
  color: #2c4d70;
  border-bottom: 1px solid rgba(30, 60, 110, 0.16);
  white-space: nowrap;
}

.st-table tbody td {
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid rgba(30, 60, 110, 0.08);
  vertical-align: middle;
}

.st-in {
  width: 100%;
  padding: 0.34rem 0.45rem;
  border: 1px solid rgba(30, 60, 110, 0.22);
  border-radius: 6px;
  font-size: 0.79rem;
  color: #24344c;
  background: #fff;
}

.st-in:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.18);
}

.st-in.st-readonly,
.st-in.st-readonly:disabled {
  background: #eef2f8;
  color: #5a6d84;
  border-color: rgba(30, 60, 110, 0.12);
  cursor: default;
  box-shadow: none;
}

.st-in.st-readonly:focus,
.st-in.st-readonly:disabled:focus {
  border-color: rgba(30, 60, 110, 0.12);
  box-shadow: none;
}

.st-table tbody tr.st-row-default td:nth-child(4) .st-in {
  background: #fff;
  color: #24344c;
}

.st-arrows {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* The "Support type (as used in 3D software)" box is an override field: it stays
   empty and shows the active default as a clear, italic hint. Typing a value
   overrides the default; clearing it (or Restore to defaults) reverts to it. */
.st-override::placeholder {
  color: #6a7d96;
  font-style: italic;
  opacity: 1;
}

.st-override:not(:placeholder-shown) {
  color: #0d47a1;
  font-weight: 600;
}

.st-row-del {
  padding: 0.25rem 0.45rem;
  border: 1px solid rgba(180, 40, 40, 0.25);
  border-radius: 6px;
  background: #fff;
  color: #b23838;
  cursor: pointer;
  font-size: 0.78rem;
}

.st-row-del:hover {
  background: #fdecec;
}

.st-add-row {
  margin-top: 0.7rem;
  padding: 0.45rem 0.85rem;
  border: 1px dashed rgba(25, 118, 210, 0.45);
  border-radius: 7px;
  background: #f4f8ff;
  color: #1565c0;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}

.st-add-row:hover {
  background: #e9f1ff;
}

.st-modal-footer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem;
  border-top: 1px solid rgba(30, 60, 110, 0.12);
  background: #fafcff;
}

.st-footer-msg {
  font-size: 0.8rem;
  color: #4a5f7d;
}

.st-footer-msg.is-error {
  color: #c0392b;
  font-weight: 600;
}

.st-footer-msg.is-ok {
  color: #1b6b37;
  font-weight: 600;
}

.st-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}

.st-btn-primary {
  background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(21, 101, 192, 0.32);
}

.st-btn-primary:hover {
  background: linear-gradient(135deg, #1976d2 0%, #1e88e5 100%);
}

.st-btn-ghost {
  background: #fff;
  border-color: rgba(30, 60, 110, 0.22);
  color: #36507a;
}

.st-btn-ghost:hover {
  background: #eef3fb;
}

/* ── IDF drawing PDF export ─────────────────────────────────────────── */
.cii-3d-toolbar-btn[data-accent="pdf"] {
  color: #b3261e;
}

.cii-3d-toolbar-btn[data-accent="pdf"]:hover {
  background: #fdeceb;
  border-color: #e6a39e;
}

.drawing-export-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 22, 38, 0.62);
  padding: 24px;
}

.drawing-export-modal {
  display: flex;
  flex-direction: column;
  width: min(1180px, 96vw);
  height: min(880px, 94vh);
  background: #f6f8fb;
  border: 1px solid #c7d2e2;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(10, 20, 40, 0.45);
  overflow: hidden;
  color: #1c2940;
}

.drawing-export-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #d7e0ec;
}

.drawing-export-title {
  font-weight: 700;
  font-size: 15px;
  color: #16243c;
}

.drawing-export-close {
  border: none;
  background: transparent;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  color: #5a6b86;
  padding: 4px 8px;
  border-radius: 6px;
}

.drawing-export-close:hover {
  background: #eef2f8;
  color: #1c2940;
}

.drawing-export-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: #fbfcfe;
  border-bottom: 1px solid #e1e8f2;
}

.drawing-export-tool {
  border: 1px solid #c2cee0;
  background: #fff;
  color: #283a5a;
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.drawing-export-tool:hover {
  background: #eef3fb;
  border-color: #9fb4d4;
}

.drawing-export-tool.is-active {
  background: #1565c0;
  border-color: #1976d2;
  color: #fff;
}

.drawing-export-divider {
  width: 1px;
  height: 20px;
  background: #d4dce8;
}

.drawing-export-page {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #34466a;
}

.drawing-export-page select {
  border: 1px solid #c2cee0;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12.5px;
  color: #1c2940;
  background: #fff;
}

.drawing-export-spacer {
  flex: 1 1 auto;
}

.drawing-export-hint {
  font-size: 11.5px;
  color: #6a7990;
}

.drawing-export-cancel {
  border: 1px solid #c2cee0;
  background: #fff;
  color: #45587a;
  border-radius: 7px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.drawing-export-cancel:hover {
  background: #eef3fb;
}

.drawing-export-generate {
  border: 1px solid #1976d2;
  background: #1565c0;
  color: #fff;
  border-radius: 7px;
  padding: 6px 15px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.drawing-export-generate:hover {
  background: #1976d2;
}

.drawing-export-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: auto;
  background: #e9eef5;
}

.drawing-export-surface {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  background: #fff;
  border: 1px solid #cfd9e7;
  box-shadow: 0 6px 20px rgba(20, 35, 60, 0.16);
}

.drawing-export-surface.is-adding {
  cursor: crosshair;
}

.drawing-export-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.drawing-export-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.drawing-export-layer {
  position: absolute;
  inset: 0;
}

.drawing-export-tag-wrap {
  position: absolute;
  transform: translate(-2px, -50%);
  max-width: 220px;
}

.drawing-export-tag {
  display: inline-block;
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  white-space: pre-wrap;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid transparent;
  outline: none;
  cursor: grab;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff;
  min-width: 14px;
}

.drawing-export-tag-wrap.is-selected .drawing-export-tag,
.drawing-export-tag:focus {
  border-color: #1976d2;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 1px rgba(25, 118, 210, 0.35);
}

.drawing-export-tag-wrap.is-dragging .drawing-export-tag {
  cursor: grabbing;
}

.drawing-export-tag-del {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: #d32f2f;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  display: none;
  padding: 0;
}

.drawing-export-tag-wrap:hover .drawing-export-tag-del,
.drawing-export-tag-wrap.is-selected .drawing-export-tag-del {
  display: block;
}

/* Kind-specific callout styling for the isometric drawing editor */
.drawing-export-tag--support {
  background: #fff;
  border: 1px solid #1c2940;
  border-radius: 2px;
  padding: 2px 5px;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: none;
  text-align: left;
}

.drawing-export-tag--continuation {
  background: #fff;
  border: 1px solid #2f5f9b;
  border-radius: 2px;
  padding: 2px 5px;
  text-shadow: none;
}

.drawing-export-tag-wrap--bubble,
.drawing-export-tag-wrap--weld {
  transform: translate(-50%, -50%);
}

.drawing-export-tag--bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 2px;
  border: 1.4px solid currentColor;
  border-radius: 50%;
  background: #fff;
  font-weight: 700;
  text-shadow: none;
}

.drawing-export-tag--weld {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 2px;
  border: 1.3px solid currentColor;
  border-radius: 2px;
  background: #fff;
  font-weight: 700;
  text-shadow: none;
}

.drawing-export-tag--valve,
.drawing-export-tag--flange {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 2px;
  padding: 1px 4px;
  text-shadow: none;
}
