/* ============================================================
   HUD CHROME — overlay layer for EDIT and ANNOTATE modes.
   Sits at top z-index inside .canvas-frame.
   ============================================================ */

.hud-chrome {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  --annot-line: var(--ash);
}
.hud-chrome > * { pointer-events: auto; }
.hud-chrome.mode-edit { --annot-line: #ffd400; }
.hud-chrome.mode-annotate { --annot-line: #ffd400; }

/* ============================================================
   EDIT chrome — dashed outline + handle
   ============================================================ */
.edit-chrome {
  position: absolute;
  border: 1.5px dashed rgba(255, 212, 0, 0.6);
  background: rgba(255, 212, 0, 0.04);
  cursor: grab;
  transition: background 120ms ease, border-color 120ms ease;
}
.edit-chrome:hover {
  border-color: rgba(255, 212, 0, 0.95);
  background: rgba(255, 212, 0, 0.08);
}
.edit-chrome.is-focused {
  border-color: #ffd400;
  background: rgba(255, 212, 0, 0.10);
  z-index: 5;
}
.edit-chrome.is-dragging {
  cursor: grabbing;
  border-style: solid;
  border-color: #ffea4d;
  background: rgba(255, 212, 0, 0.15);
}

.edit-corner {
  position: absolute;
  width: 14px; height: 14px;
  background: #ffd400;
  box-shadow: 0 0 0 1px #000;
}
.edit-corner.tl { top: -7px; left: -7px; }
.edit-corner.tr { top: -7px; right: -7px; }
.edit-corner.bl { bottom: -7px; left: -7px; }
.edit-corner.br { bottom: -7px; right: -7px; }

.edit-label {
  position: absolute;
  top: -34px;
  left: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #ffd400;
  color: #000;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  height: 26px;
  user-select: none;
}
.edit-label .lab {
  padding: 0 10px;
  display: flex;
  align-items: center;
}
.edit-reset {
  background: #000;
  color: #ffd400;
  border: none;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  height: 100%;
}
.edit-reset:hover { color: #ffea4d; }

/* ============================================================
   ANNOTATE chrome — numbered ring + balloon + pointer line
   ============================================================ */
.annot-line {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
  pointer-events: none;
}

.annot-ring {
  position: absolute;
  border: 1.5px solid rgba(255, 212, 0, 0.55);
  background: transparent;
  pointer-events: auto;
  transition: border-color 160ms ease;
}
.annot-ring:hover, .annot-ring.is-focused {
  border-color: #ffd400;
}
.annot-corner {
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid #ffd400;
}
.annot-corner.tl { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.annot-corner.tr { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.annot-corner.bl { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.annot-corner.br { bottom: -2px; right: -2px; border-left: none; border-top: none; }

.annot-badge {
  position: absolute;
  top: -16px;
  left: -16px;
  width: 32px;
  height: 32px;
  background: #ffd400;
  color: #000;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #000, 0 0 18px rgba(255, 212, 0, 0.4);
  z-index: 2;
}

.annot-balloon {
  position: absolute;
  background: #0a0a0a;
  border: 1.5px solid #ffd400;
  padding: 14px 16px 16px;
  color: #f0f0f0;
  pointer-events: auto;
  box-shadow: 0 0 30px rgba(255, 212, 0, 0.2);
  font-family: var(--font-sans);
}
.annot-balloon-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 212, 0, 0.3);
}
.annot-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #ffd400;
}
.annot-lab {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: #f0f0f0;
  text-transform: uppercase;
}
.annot-balloon-body {
  font-size: 13px;
  line-height: 1.55;
  color: #c8c4b8;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ============================================================
   MODE PICKER (top bar segmented control)
   ============================================================ */
.mode-picker {
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--void);
}
.mode-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--smoke);
  padding: 0 16px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: background 120ms ease, color 120ms ease;
}
.mode-btn:last-child { border-right: none; }
.mode-btn:hover { background: var(--void-2); color: var(--ash); }
.mode-btn.is-active {
  color: #000;
  background: #ffd400;
}
.mode-btn.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: #ffd400;
}
.mode-btn .dot {
  width: 7px; height: 7px;
  background: currentColor;
  border-radius: 50%;
}

/* Reset-all button */
.reset-all-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--smoke);
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.reset-all-btn:hover { color: #ffd400; background: var(--void-2); }
.reset-all-btn::before {
  content: '↺';
  font-size: 16px;
  letter-spacing: 0;
}

/* ============================================================
   Focused-element side panel (visible in EDIT and ANNOTATE)
   ============================================================ */
.element-inspector {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 320px;
  background: rgba(10,10,10,0.96);
  border: 1px solid #ffd400;
  color: var(--ash);
  z-index: 60;
  font-family: var(--font-sans);
  box-shadow: 0 0 40px rgba(255, 212, 0, 0.18);
}
.element-inspector .ei-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #ffd400;
  color: #000;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}
.element-inspector .ei-body { padding: 14px 16px 16px; }
.element-inspector .ei-lab {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.element-inspector .ei-desc {
  color: #c8c4b8;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 14px;
}
.element-inspector .ei-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid #333;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--smoke);
  text-transform: uppercase;
}
.element-inspector .ei-row input {
  background: #000;
  border: 1px solid #333;
  color: #f0f0f0;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 8px;
  width: 100%;
}
.element-inspector .ei-row input:focus { border-color: #ffd400; outline: none; }
.element-inspector .ei-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.element-inspector .ei-actions button {
  flex: 1;
  background: #000;
  border: 1px solid #333;
  color: #c8c4b8;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
}
.element-inspector .ei-actions button:hover {
  border-color: #ffd400;
  color: #ffd400;
}
