.canvas-area {
  flex: 1;
  display: flex;
  overflow: auto;
  padding: 100px;
  background: radial-gradient(#1e293b 1px, transparent 1px), #080b11;
  background-size: 20px 20px;
  position: relative;
  scroll-behavior: smooth;
}
/* Premium scrollbar styling for two-way canvas scroll */
.canvas-area::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.canvas-area::-webkit-scrollbar-track {
  background: rgba(8, 11, 17, 0.4);
  border-radius: 8px;
}
.canvas-area::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.25);
  border: 2px solid #080b11;
  border-radius: 8px;
}
.canvas-area::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.45);
}
.canvas-wrap {
  margin: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(99, 102, 241, 0.15);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.canvas-wrap:hover {
  box-shadow: 0 20px 70px rgba(99, 102, 241, 0.2), 0 0 0 2px rgba(99, 102, 241, 0.3);
}
#cert-canvas {
  display: block;
  background: #fff;
}
.field-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Drag Boundaries & Bounding Box */
.drag-handle {
  position: absolute;
  border: 1px solid rgba(99, 102, 241, 0.4);
  cursor: move;
  pointer-events: all;
  background: transparent;
  transition: border-color 0.15s ease;
}
.drag-handle:hover {
  border-color: #6366f1;
}
.drag-handle.selected {
  border: 2px solid #818cf8;
  background: rgba(99, 102, 241, 0.02);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}
.drag-handle.locked {
  cursor: not-allowed;
  border-style: dashed;
  border-color: rgba(245, 158, 11, 0.9);
  background: rgba(245, 158, 11, 0.04);
}

/* Circular Resize Nodes */
.drag-handle .corner-node {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #ffffff;
  border: 1.5px solid #818cf8;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.drag-handle .node-tl { top: -4.5px; left: -4.5px; }
.drag-handle .node-tr { top: -4.5px; right: -4.5px; }
.drag-handle .node-bl { bottom: -4.5px; left: -4.5px; }
.drag-handle .node-br { bottom: -4.5px; right: -4.5px; }

.drag-handle .resize-br {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 12px;
  height: 12px;
  background: transparent;
  cursor: se-resize;
  z-index: 10;
}

/* Floating Layer Badge */
.drag-handle .layer-badge {
  position: absolute;
  top: -28px;
  left: -2px;
  background: #818cf8;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 3px;
  letter-spacing: 0.01em;
  z-index: 5;
}

/* Hotkeys floating guide */
.hotkeys-guide {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background: rgba(13, 18, 30, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #94a3b8;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 10;
}
.hotkeys-guide .hk-title {
  font-weight: 700;
  color: #cbd5e1;
  margin-right: 4px;
}
.hotkeys-guide .hk-tag {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 10px;
  font-weight: 700;
}

/* ──────────────────────────────────────────────────────────────
   PREMIUM LIGHT MODE OVERRIDES
   ────────────────────────────────────────────────────────────── */
.canvas-area {
  background: radial-gradient(#cbd5e1 1px, transparent 1px), #f1f5f9 !important;
  background-size: 20px 20px !important;
}
.canvas-wrap {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
}
.canvas-wrap:hover {
  box-shadow: 0 15px 45px rgba(79, 70, 229, 0.12), 0 0 0 1.5px rgba(79, 70, 229, 0.2) !important;
}

.hotkeys-guide {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  color: #64748b !important;
}
.hotkeys-guide .hk-title {
  color: #334155 !important;
}
.hotkeys-guide .hk-tag {
  background: rgba(0, 0, 0, 0.04) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  color: #334155 !important;
}

/* ──────────────────────────────────────────────────────────────
   RESPONSIVE DESIGN OVERRIDES
   ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .canvas-area {
    order: 1;
    min-height: 330px;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 14px;
    overflow: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    -webkit-overflow-scrolling: touch;
  }
  .canvas-wrap {
    flex: 0 0 auto;
    margin: 0 auto;
  }
}
