@charset "UTF-8";
/* Gun Barrel Visualizer — DSU cross-section styles ported from the Automated Stick Creation mockup.
   Self-contained: local CSS custom properties provide fallbacks so the component renders correctly
   anywhere it is embedded (full page or compact panel). */
.gun-barrel-stack {
  --gun-header-height: 36px;
  --gun-axis-row-height: 52px;
  --gun-header-font-size: 11px;
  --gun-axis-label-size: 9px;
  --gun-row-height: 48px;
  --gun-abbrev-size: 14px;
  --gun-name-size: 10px;
  --gun-value-size: 12px;
  --gun-well-size: 28px;
  --gun-gap: 16px;
  --gun-cell-pad-y: 10px;
  --gun-cross-pad-y: 8px;
  --gun-measurement-height: 16px;
  --gun-measurement-label-size: 9px;
  --gun-well-label-size: 8px;
  --gun-major-line-color: rgba(79, 80, 96, 0.12);
  --gun-border: #d6d6de;
  --gun-body-color: #2e2e38;
  --gun-muted: #656579;
  --gun-weight-bold: 600;
  --gun-primary-font: inherit;
  --gun-hover-bg: rgba(46, 46, 56, 0.06);
  --gun-surface: #fff;
  --gun-surface-alt: #f5f5f7;
  --gun-surface-muted: #fcfcfd;
  --gun-divider: rgba(46, 46, 56, 0.12);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gun-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--gun-surface);
  font-family: var(--gun-primary-font);
}
.gun-barrel-stack.gun-barrel-stack--compact {
  --gun-header-height: 28px;
  --gun-axis-row-height: 40px;
  --gun-row-height: 40px;
  --gun-abbrev-size: 12px;
  --gun-name-size: 9px;
  --gun-value-size: 11px;
  --gun-well-size: 22px;
  --gun-gap: 12px;
  --gun-cell-pad-y: 6px;
  --gun-measurement-height: 14px;
  --gun-measurement-label-size: 8px;
  --gun-well-label-size: 7px;
  border-radius: 8px;
}

.gun-barrel-header-row,
.gun-barrel-axis-row,
.gun-barrel-layer {
  display: grid;
  grid-template-columns: 15% 5% 75% 5%;
}

.gun-barrel-header-row {
  border-bottom: 1px solid var(--gun-divider);
  background: var(--gun-surface-alt);
}

.gun-barrel-header-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--gun-header-height);
  padding: 8px 16px;
  font-size: var(--gun-header-font-size);
  font-weight: var(--gun-weight-bold);
  color: var(--gun-body-color);
  text-align: center;
  min-width: 0;
}
.gun-barrel-header-cell:not(:last-child) {
  border-right: 8px solid var(--gun-surface);
}

.gun-barrel-axis-row {
  border-top: 1px solid var(--gun-divider);
  background: var(--gun-surface);
}

.gun-barrel-axis-spacer {
  min-width: 0;
  min-height: var(--gun-axis-row-height);
  background: var(--gun-surface);
}
.gun-barrel-axis-spacer:not(:last-child) {
  border-right: 8px solid var(--gun-surface);
}

.gun-barrel-axis-cell {
  min-width: 0;
  padding: 10px 0 14px;
  border-right: 8px solid var(--gun-surface);
  background: var(--gun-surface-muted);
}

.gun-barrel-axis-scale {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.gun-barrel-axis-title {
  font-size: var(--gun-axis-label-size);
  font-weight: var(--gun-weight-bold);
  color: var(--gun-muted);
  text-align: center;
  line-height: 1.1;
}

.gun-barrel-axis-labels {
  position: relative;
  min-height: calc(var(--gun-axis-label-size) + 2px);
}

.gun-barrel-axis-ticks {
  position: relative;
  min-height: 10px;
  padding-top: 1px;
}
.gun-barrel-axis-ticks::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  border-top: 2px solid #8f8f9b;
}

.gun-barrel-axis-label {
  position: absolute;
  top: 0;
  font-size: var(--gun-axis-label-size);
  color: var(--gun-muted);
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
}

.gun-barrel-axis-tick {
  position: absolute;
  z-index: 1;
  top: 0;
  width: 1px;
  height: 10px;
  background: #5f5f6d;
  transform: translateX(-50%);
}

.gun-barrel-layer {
  min-height: var(--gun-row-height);
  border-bottom: 1px solid var(--gun-divider);
  background: var(--gun-surface);
}
.gun-barrel-layer:last-child {
  border-bottom: none;
}

.gun-barrel-label-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gun-cell-pad-y) 18px;
  background: var(--gun-surface);
  min-width: 0;
  border-right: 8px solid var(--gun-surface);
}

.gun-barrel-formation-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}

.gun-barrel-abbreviation {
  font-size: var(--gun-abbrev-size);
  line-height: 1;
  font-weight: var(--gun-weight-bold);
  letter-spacing: 0.04em;
  text-align: center;
}

.gun-barrel-name {
  font-size: var(--gun-name-size);
  font-weight: var(--gun-weight-bold);
  color: var(--gun-body-color);
  text-align: center;
}

.gun-barrel-well-count,
.gun-barrel-dev-phase {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gun-cell-pad-y) 12px;
  font-size: var(--gun-value-size);
  font-weight: var(--gun-weight-bold);
  color: var(--gun-body-color);
  background: var(--gun-surface);
  min-width: 0;
}

.gun-barrel-well-count {
  border-right: 8px solid var(--gun-surface);
  position: relative;
  overflow: visible;
}

.gun-barrel-well-count-trigger,
.gun-barrel-dev-phase-trigger {
  width: 100%;
  min-height: calc(var(--gun-well-size) + 8px);
  border: 1px dashed transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--gun-body-color);
  font-family: var(--gun-primary-font);
  font-size: var(--gun-value-size);
  font-weight: var(--gun-weight-bold);
  cursor: pointer;
}
.gun-barrel-well-count-trigger:disabled,
.gun-barrel-dev-phase-trigger:disabled {
  cursor: default;
}

.gun-barrel-well-count-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.gun-barrel-well-count-trigger:not(:disabled):hover,
.gun-barrel-dev-phase-trigger:not(:disabled):hover {
  border-color: #b8b8c2;
  background: rgba(255, 255, 255, 0.4);
}

.gun-barrel-dev-phase-trigger.is-required {
  border-color: #c62828;
  color: #c62828;
}
.gun-barrel-dev-phase-trigger.is-required:not(:disabled):hover {
  border-color: #c62828;
  background: rgba(198, 40, 40, 0.06);
}

.gun-barrel-well-count-input,
.gun-barrel-dev-phase-select {
  padding: 6px 8px;
  border: 1px solid #8f8f9b;
  border-radius: 6px;
  background: var(--gun-surface);
  font-family: var(--gun-primary-font);
  font-size: var(--gun-value-size);
  font-weight: var(--gun-weight-bold);
  text-align: center;
  color: var(--gun-body-color);
  position: relative;
  z-index: 1;
}

.gun-barrel-well-count-input {
  width: 64px;
  min-width: 64px;
}

.gun-barrel-well-count-editor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gun-barrel-well-count-stepper {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.gun-barrel-well-count-stepper-btn {
  width: 16px;
  height: 14px;
  border: 1px solid #b8b8c2;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.4);
  color: #5f5f6d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 10px;
  font-weight: var(--gun-weight-bold);
  line-height: 1;
  cursor: pointer;
}
.gun-barrel-well-count-stepper-btn:hover {
  background: rgba(255, 255, 255, 0.58);
  color: var(--gun-body-color);
}

.gun-barrel-dev-phase-select {
  width: 56px;
  min-width: 56px;
  max-width: 100%;
}

.gun-barrel-wells-panel {
  position: relative;
  display: block;
  min-height: 100%;
  height: 100%;
  padding: 0;
  background-color: var(--gun-surface);
  min-width: 0;
  border-right: 8px solid var(--gun-surface);
}

.gun-barrel-major-line-layer,
.gun-barrel-setback-layer,
.gun-barrel-internal-line-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gun-barrel-setback-layer,
.gun-barrel-internal-line-layer {
  z-index: 1;
}

.gun-barrel-major-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--gun-major-line-color);
  z-index: 0;
}

.gun-barrel-setback-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(198, 40, 40, 0.25);
}

.gun-barrel-setback-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed #c62828;
}

.gun-barrel-setback-label {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #8f1f1f;
  font-size: var(--gun-well-label-size);
  font-weight: var(--gun-weight-bold);
  line-height: 1;
  white-space: nowrap;
}

.gun-barrel-internal-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed #1565c0;
}

.gun-barrel-internal-line-label {
  position: absolute;
  bottom: 4px;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0d47a1;
  font-size: var(--gun-well-label-size);
  font-weight: var(--gun-weight-bold);
  line-height: 1;
  white-space: nowrap;
}

.gun-barrel-measurement-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: var(--gun-measurement-height);
  pointer-events: none;
  z-index: 3;
}

.gun-barrel-measurement-segment {
  position: absolute;
  top: 0;
  height: var(--gun-measurement-height);
  pointer-events: none;
}
.gun-barrel-measurement-segment::before {
  content: "";
  position: absolute;
  top: calc(var(--gun-measurement-height) / 2 - 1px);
  left: 0;
  right: 0;
  border-top: 1px solid #4f5060;
}

.gun-barrel-measurement-label {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 4px;
  background: rgba(255, 255, 255, 0.92);
  font-size: var(--gun-measurement-label-size);
  font-weight: var(--gun-weight-bold);
  color: #4f5060;
  line-height: 1;
  white-space: nowrap;
  pointer-events: auto;
}
.gun-barrel-measurement-label.is-editable {
  cursor: text;
}

.gun-barrel-measurement-input {
  width: 52px;
  padding: 1px 4px;
  border: 1px solid #8f8f9b;
  border-radius: 4px;
  background: var(--gun-surface);
  font-family: var(--gun-primary-font);
  font-size: var(--gun-measurement-label-size);
  font-weight: var(--gun-weight-bold);
  color: #4f5060;
  line-height: 1;
  text-align: center;
}

.gun-barrel-well-column {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-50%);
  z-index: 2;
}
.gun-barrel-well-column.is-draggable {
  cursor: grab;
}
.gun-barrel-well-column.is-dragging {
  cursor: grabbing;
}

.gun-barrel-well-segment {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--gun-well-size);
  height: var(--gun-well-size);
  border: 2px solid #111;
  border-radius: 50%;
}
.gun-barrel-well-segment.is-setback-conflict {
  border-color: #c62828;
  box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.16);
}

.gun-barrel-well-label {
  position: absolute;
  top: calc(50% + var(--gun-well-size) / 2 + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--gun-well-label-size);
  font-weight: var(--gun-weight-bold);
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

.gun-barrel-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--gun-muted);
  font-size: 13px;
}

/* ─── Dark theme ──────────────────────────────────────────────────────────
   Redefine the surface/token custom properties so every `var(--gun-*)` reference
   flips to the dark palette, keeping the visualizer consistent with the rest of
   the app (mirrors the `body.motif-theme-dark` pattern used across the host app). */
body.motif-theme-dark .gun-barrel-stack {
  --gun-surface: #1e1e28;
  --gun-surface-alt: #23232f;
  --gun-surface-muted: #262631;
  --gun-divider: rgba(255, 255, 255, 0.12);
  --gun-border: #33333e;
  --gun-body-color: #f3f3f5;
  --gun-muted: #a9a9b4;
  --gun-hover-bg: rgba(255, 255, 255, 0.06);
  --gun-major-line-color: rgba(255, 255, 255, 0.12);
}
body.motif-theme-dark .gun-barrel-stack .gun-barrel-well-count-trigger:not(:disabled):hover,
body.motif-theme-dark .gun-barrel-stack .gun-barrel-dev-phase-trigger:not(:disabled):hover {
  border-color: #4a4a57;
  background: rgba(255, 255, 255, 0.08);
}

/* ─── Right-click context menu (Add / Delete well) ────────────────────────
   Rendered inside `.gun-barrel-stack`, so it inherits the `--gun-*` tokens and
   flips with dark mode. Positioned `fixed` at the cursor. */
.gun-barrel-context-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.gun-barrel-context-menu {
  position: fixed;
  z-index: 1001;
  width: max-content;
  min-width: 0;
  padding: 2px;
  background: var(--gun-surface, #fff);
  border: 1px solid var(--gun-border, #d6d6de);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.gun-barrel-context-menu-item {
  display: block;
  width: 100%;
  padding: 5px 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--gun-body-color, #2e2e38);
  font-family: var(--gun-primary-font, inherit);
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}
.gun-barrel-context-menu-item:hover, .gun-barrel-context-menu-item:focus-visible {
  background: var(--gun-hover-bg, rgba(46, 46, 56, 0.06));
  outline: none;
}