/* =========================================
   Controls Base Position (Desktop)
   ========================================= */

.diagram-controls {
  position: absolute !important;
  top: 12px !important; /* Desktop spacing */
  right: 8px !important;
  left: unset !important;
  bottom: unset !important;
  z-index: 10;
}

/* =========================================
   Controls Box Styling
   ========================================= */

.react-flow__controls {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  overflow: hidden;
}

.react-flow__controls-button {
  border: none;
  background: #fefefe;
  border-bottom: 1px solid #eee;

  box-sizing: content-box;
  display: flex;
  justify-content: center;
  align-items: center;

  width: 16px;
  height: 16px;
  padding: 5px;

  cursor: pointer;
  user-select: none;
}




/* Nodes: arrow by default */
.react-flow__node {
  cursor: default !important;
}

.react-flow__edge {
  cursor: default !important;
}


.react-flow__controls-button:last-child {
  border-bottom: none;
}

.react-flow__controls-button:hover {
  background: #f3f4f6;
}

.react-flow__controls-button:active {
  transform: scale(0.95);
}

/* =========================================
   Disable Controls While Placing
   ========================================= */

.controls-disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* =========================================
   Active Grid / Snap Button Style
   ========================================= */

.active-control {
  background: #e0e7ff !important;
  font-weight: bold;
}

/* When placement active ? override all control button cursors */
.diagram-controls.controls-disabled,
.diagram-controls.controls-disabled * {
  cursor: not-allowed !important;
}

/* =========================================
   COPY MODAL
========================================= */

.copy-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
}

.copy-modal-box {
  width: 420px;
  max-width: 94%;
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: copyModalFadeIn 0.2s ease-out;
}

.copy-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.copy-modal-body {
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
}

.copy-modal-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copy-btn-secondary {
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
  text-align: left;
  transition: 0.2s ease;
}

.copy-btn-secondary:hover {
  background: #f3f4f6;
}

.copy-btn-primary {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: 0.2s ease;
}

.copy-btn-primary:hover {
  background: #1d4ed8;
}

.copy-modal-actions {
  display: flex;
  justify-content: flex-end;
}

.copy-btn-cancel {
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  background: #f3f4f6;
  cursor: pointer;
  transition: 0.2s ease;
}

.copy-btn-cancel:hover {
  background: #e5e7eb;
}

/* Context Menu */
.context-menu {
  position: fixed;
  z-index: 2000;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

/* Popup Message */
.popup-message {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(245, 137, 137, 25);
  color: black;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  animation: fadeInOut 2.2s ease forwards;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Close Button */
.popup-close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}

/* Edge Context Menu */
.edge-menu {
  position: fixed;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 9999;
}

/* Edge Menu Item */
.edge-menu-item {
  padding: 8px 12px;
  cursor: pointer;
  color: #d32f2f;
}

/* Ghost Node Preview */
.ghost-node-preview {
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
}

.ghost-node-invalid-icon {
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* Diagram Wrapper */
.diagram-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  background-color: #ffffff;
}

/* Ghost Image Preview */
.ghost-node-image {
  object-fit: contain;
  opacity: 0.8;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
}

/* Hide cursor when valid placement */
.placement-cursor-none,
.placement-cursor-none * {
  cursor: none !important;
}

.placement-cursor-none .react-flow__node,
.placement-cursor-none .react-flow__node * {
  cursor: none !important;
}

/* Invalid placement cursor */
.placement-cursor-blocked,
.placement-cursor-blocked * {
  cursor: not-allowed !important;
}

/* Default cursor only when NOT in placement mode */
.react-flow__node:not(.placement-cursor-none):not(.placement-cursor-blocked),
.react-flow__node:not(.placement-cursor-none):not(.placement-cursor-blocked) * {
  cursor: default;
}

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

/* =========================================
   Responsive Adjustments
   ========================================= */

/* Large Laptops */
@media (max-width: 1200px) {
  .diagram-controls {
    right: 10px !important;
  }
}

/* Tablets */
@media (max-width: 992px) {
  .diagram-controls {
    top: 16px !important;
    right: 10px !important;
  }
}

/* =========================================
   Mobile (Fixed Properly)
   ========================================= */

@media (max-width: 768px) {
  .diagram-controls {
    top: 5px !important; /* ? push below tab bar */
    right: 2px !important; /* ? proper spacing from edge */
    transform: scale(0.9);
  }
}

/* Small Mobile */
@media (max-width: 576px) {
  .diagram-controls {
    top: -15px !important;
    right: -5px !important;
    transform: scale(0.85);
  }

  .copy-modal-box {
    width: 320px;
    max-width: 82%;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: copyModalFadeIn 0.2s ease-out;
  }
}

/* Extra Small Phones */
@media (max-width: 400px) {
  .diagram-controls {
    top: -20px !important;
    right: -10px !important;
    transform: scale(0.8);
  }
}


.react-flow__edge.selected path {
  stroke-width: 3;
}
/* this gets exported as style.css and can be used for the default theming */
/* these are the necessary styles for React Flow, they get used by base.css and style.css */
.react-flow {
  direction: ltr;
}
.react-flow__container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}
.react-flow__pane {
  z-index: 1;
  cursor: -webkit-grab;
  cursor: grab;
}
.react-flow__pane.selection {
    cursor: pointer;
  }
.react-flow__pane.dragging {
    cursor: -webkit-grabbing;
    cursor: grabbing;
  }
.react-flow__viewport {
  transform-origin: 0 0;
  z-index: 2;
  pointer-events: none;
}
.react-flow__renderer {
  z-index: 4;
}
.react-flow__selection {
  z-index: 6;
}
.react-flow__nodesselection-rect:focus,
.react-flow__nodesselection-rect:focus-visible {
  outline: none;
}
.react-flow .react-flow__edges {
  pointer-events: none;
  overflow: visible;
}
.react-flow__edge-path,
.react-flow__connection-path {
  stroke: #b1b1b7;
  stroke-width: 1;
  fill: none;
}
.react-flow__edge {
  pointer-events: visibleStroke;
  cursor: pointer;
}
.react-flow__edge.animated path {
    stroke-dasharray: 5;
    -webkit-animation: dashdraw 0.5s linear infinite;
            animation: dashdraw 0.5s linear infinite;
  }
.react-flow__edge.animated path.react-flow__edge-interaction {
    stroke-dasharray: none;
    -webkit-animation: none;
            animation: none;
  }
.react-flow__edge.inactive {
    pointer-events: none;
  }
.react-flow__edge.selected,
  .react-flow__edge:focus,
  .react-flow__edge:focus-visible {
    outline: none;
  }
.react-flow__edge.selected .react-flow__edge-path,
  .react-flow__edge:focus .react-flow__edge-path,
  .react-flow__edge:focus-visible .react-flow__edge-path {
    stroke: #555;
  }
.react-flow__edge-textwrapper {
    pointer-events: all;
  }
.react-flow__edge-textbg {
    fill: white;
  }
.react-flow__edge .react-flow__edge-text {
    pointer-events: none;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
  }
.react-flow__connection {
  pointer-events: none;
}
.react-flow__connection .animated {
    stroke-dasharray: 5;
    -webkit-animation: dashdraw 0.5s linear infinite;
            animation: dashdraw 0.5s linear infinite;
  }
.react-flow__connectionline {
  z-index: 1001;
}
.react-flow__nodes {
  pointer-events: none;
  transform-origin: 0 0;
}
.react-flow__node {
  position: absolute;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  pointer-events: all;
  transform-origin: 0 0;
  box-sizing: border-box;
  cursor: -webkit-grab;
  cursor: grab;
}
.react-flow__node.dragging {
    cursor: -webkit-grabbing;
    cursor: grabbing;
  }
.react-flow__nodesselection {
  z-index: 3;
  transform-origin: left top;
  pointer-events: none;
}
.react-flow__nodesselection-rect {
    position: absolute;
    pointer-events: all;
    cursor: -webkit-grab;
    cursor: grab;
  }
.react-flow__handle {
  position: absolute;
  pointer-events: none;
  min-width: 5px;
  min-height: 5px;
  width: 6px;
  height: 6px;
  background: #1a192b;
  border: 1px solid white;
  border-radius: 100%;
}
.react-flow__handle.connectionindicator {
    pointer-events: all;
    cursor: crosshair;
  }
.react-flow__handle-bottom {
    top: auto;
    left: 50%;
    bottom: -4px;
    transform: translate(-50%, 0);
  }
.react-flow__handle-top {
    left: 50%;
    top: -4px;
    transform: translate(-50%, 0);
  }
.react-flow__handle-left {
    top: 50%;
    left: -4px;
    transform: translate(0, -50%);
  }
.react-flow__handle-right {
    right: -4px;
    top: 50%;
    transform: translate(0, -50%);
  }
.react-flow__edgeupdater {
  cursor: move;
  pointer-events: all;
}
.react-flow__panel {
  position: absolute;
  z-index: 5;
  margin: 15px;
}
.react-flow__panel.top {
    top: 0;
  }
.react-flow__panel.bottom {
    bottom: 0;
  }
.react-flow__panel.left {
    left: 0;
  }
.react-flow__panel.right {
    right: 0;
  }
.react-flow__panel.center {
    left: 50%;
    transform: translateX(-50%);
  }
.react-flow__attribution {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.5);
  padding: 2px 3px;
  margin: 0;
}
.react-flow__attribution a {
    text-decoration: none;
    color: #999;
  }
@-webkit-keyframes dashdraw {
  from {
    stroke-dashoffset: 10;
  }
}
@keyframes dashdraw {
  from {
    stroke-dashoffset: 10;
  }
}
.react-flow__edgelabel-renderer {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.react-flow__edge.updating .react-flow__edge-path {
      stroke: #777;
    }
.react-flow__edge-text {
    font-size: 10px;
  }
.react-flow__node.selectable:focus,
  .react-flow__node.selectable:focus-visible {
    outline: none;
  }
.react-flow__node-default,
.react-flow__node-input,
.react-flow__node-output,
.react-flow__node-group {
  padding: 10px;
  border-radius: 3px;
  width: 150px;
  font-size: 12px;
  color: #222;
  text-align: center;
  border-width: 1px;
  border-style: solid;
  border-color: #1a192b;
  background-color: white;
}
.react-flow__node-default.selectable:hover, .react-flow__node-input.selectable:hover, .react-flow__node-output.selectable:hover, .react-flow__node-group.selectable:hover {
      box-shadow: 0 1px 4px 1px rgba(0, 0, 0, 0.08);
    }
.react-flow__node-default.selectable.selected,
    .react-flow__node-default.selectable:focus,
    .react-flow__node-default.selectable:focus-visible,
    .react-flow__node-input.selectable.selected,
    .react-flow__node-input.selectable:focus,
    .react-flow__node-input.selectable:focus-visible,
    .react-flow__node-output.selectable.selected,
    .react-flow__node-output.selectable:focus,
    .react-flow__node-output.selectable:focus-visible,
    .react-flow__node-group.selectable.selected,
    .react-flow__node-group.selectable:focus,
    .react-flow__node-group.selectable:focus-visible {
      box-shadow: 0 0 0 0.5px #1a192b;
    }
.react-flow__node-group {
  background-color: rgba(240, 240, 240, 0.25);
}
.react-flow__nodesselection-rect,
.react-flow__selection {
  background: rgba(0, 89, 220, 0.08);
  border: 1px dotted rgba(0, 89, 220, 0.8);
}
.react-flow__nodesselection-rect:focus,
  .react-flow__nodesselection-rect:focus-visible,
  .react-flow__selection:focus,
  .react-flow__selection:focus-visible {
    outline: none;
  }
.react-flow__controls {
  box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.08);
}
.react-flow__controls-button {
    border: none;
    background: #fefefe;
    border-bottom: 1px solid #eee;
    box-sizing: content-box;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 16px;
    height: 16px;
    cursor: pointer;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
    padding: 5px;
  }
.react-flow__controls-button:hover {
      background: #f4f4f4;
    }
.react-flow__controls-button svg {
      width: 100%;
      max-width: 12px;
      max-height: 12px;
    }
.react-flow__controls-button:disabled {
      pointer-events: none;
    }
.react-flow__controls-button:disabled svg {
        fill-opacity: 0.4;
      }
.react-flow__minimap {
  background-color: #fff;
}
.react-flow__minimap svg {
  display: block;
}
.react-flow__resize-control {
  position: absolute;
}
.react-flow__resize-control.left,
.react-flow__resize-control.right {
  cursor: ew-resize;
}
.react-flow__resize-control.top,
.react-flow__resize-control.bottom {
  cursor: ns-resize;
}
.react-flow__resize-control.top.left,
.react-flow__resize-control.bottom.right {
  cursor: nwse-resize;
}
.react-flow__resize-control.bottom.left,
.react-flow__resize-control.top.right {
  cursor: nesw-resize;
}
/* handle styles */
.react-flow__resize-control.handle {
  width: 4px;
  height: 4px;
  border: 1px solid #fff;
  border-radius: 1px;
  background-color: #3367d9;
  transform: translate(-50%, -50%);
}
.react-flow__resize-control.handle.left {
  left: 0;
  top: 50%;
}
.react-flow__resize-control.handle.right {
  left: 100%;
  top: 50%;
}
.react-flow__resize-control.handle.top {
  left: 50%;
  top: 0;
}
.react-flow__resize-control.handle.bottom {
  left: 50%;
  top: 100%;
}
.react-flow__resize-control.handle.top.left {
  left: 0;
}
.react-flow__resize-control.handle.bottom.left {
  left: 0;
}
.react-flow__resize-control.handle.top.right {
  left: 100%;
}
.react-flow__resize-control.handle.bottom.right {
  left: 100%;
}
/* line styles */
.react-flow__resize-control.line {
  border-color: #3367d9;
  border-width: 0;
  border-style: solid;
}
.react-flow__resize-control.line.left,
.react-flow__resize-control.line.right {
  width: 1px;
  transform: translate(-50%, 0);
  top: 0;
  height: 100%;
}
.react-flow__resize-control.line.left {
  left: 0;
  border-left-width: 1px;
}
.react-flow__resize-control.line.right {
  left: 100%;
  border-right-width: 1px;
}
.react-flow__resize-control.line.top,
.react-flow__resize-control.line.bottom {
  height: 1px;
  transform: translate(0, -50%);
  left: 0;
  width: 100%;
}
.react-flow__resize-control.line.top {
  top: 0;
  border-top-width: 1px;
}
.react-flow__resize-control.line.bottom {
  border-bottom-width: 1px;
  top: 100%;
}
/* =================================================
   CANVAS TOOLBAR STYLES
   Base styles - Desktop first approach
   ================================================= */

.canvas-toolbar-container {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  height: 37px;
  gap: 5px;
  background: #fff;
  padding: 4px 4px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  align-items: center;
  transition: all 0.2s ease;
}

/* Button group container */
.toolbar-button-group {
  display: flex;
  gap: 8px;
}

/* Base button style - includes both button and div elements */
.toolbar-button {
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid #e3e8ef;
  background: #f9fbff;
  min-width: 0;
  height: 29px;
  display: flex;
  gap: 1px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  user-select: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
  color: #1e293b;
  font-weight: normal;
  font-family: inherit;
}

/* Remove default button styles */
.toolbar-button,
.toolbar-button:disabled {
  all: revert;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #e3e8ef;
  background: #f9fbff;
  min-width: 0;
  height: 29px;
  display: flex;
  gap: 1px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  user-select: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.15s ease;
  color: #1e293b;
  font-weight: normal;
  font-family: inherit;
}

/* Hover state for enabled buttons */
.toolbar-button:hover:not(.disabled):not(:disabled) {
  background: #eff6ff;
  border-color: #94a3b8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Active state for enabled buttons */
.toolbar-button:active:not(.disabled):not(:disabled) {
  background: #e2e8f0;
  transform: scale(0.97);
}

/* Disabled button style - handles both class and attribute */
/* NOTE: Do NOT use pointer-events: none here — it prevents the browser from
   rendering cursor: not-allowed. Click blocking is handled in the onClick handler. */
.toolbar-button.disabled,
.toolbar-button:disabled {
  opacity: 0.45;
  cursor: not-allowed !important;
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
  transform: none;
  box-shadow: none;
}

/* Remove hover effects for disabled buttons — keep cursor: not-allowed */
.toolbar-button.disabled:hover,
.toolbar-button:disabled:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  transform: none;
  box-shadow: none;
  cursor: not-allowed !important;
}

/* Native <button disabled> overrides: browsers set pointer-events: none and cursor: default
   by default on disabled buttons. We override both so the not-allowed cursor is visible. */
button.toolbar-button:disabled,
button.toolbar-button:disabled:hover {
  pointer-events: auto !important;
  cursor: not-allowed !important;
}

/* Organize button */
.organize-button {
  position: relative;
}

/* Divider style */
.toolbar-divider {
  width: 1px;
  height: 36px;
  background: #d0d7e2;
  margin: 0 4px;
}

/* Dropdown menu (opens upward) */
.organize-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: auto;
  top: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 6px;
  z-index: 1200;
  min-width: 220px;
}

/* Dropdown menu item */
.dropdown-menu-item {
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  color: #1e293b;
  transition: background 0.15s ease;
}

.dropdown-menu-item:hover {
  background: #f1f5f9;
}

/* Arrow icon for dropdown */
.dropdown-arrow {
  font-size: 12px;
  opacity: 0.7;
  margin-left: 4px;
}

/* ================================
   MODAL BACKDROP
================================ */

.modal-backdrop-trans {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
}

/* ================================
   MODAL BOX
================================ */

.remove-modal-box {
  width: 500px;
  max-width: 94%;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
}

/* ================================
   HEADER
================================ */

.remove-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.remove-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

/* close button */

.modal-close-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  color: #6b7280;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: #111827;
}

/* ================================
   BODY
================================ */

.remove-modal-body {
  display: flex;
  gap: 12px;
  padding: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

.icon-container {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.remove-text {
  flex: 1;
}

/* ================================
   ACTIONS
================================ */

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
}

/* ================================
   BUTTONS
================================ */

.modal-btn-danger {
  padding: 8px 18px;
  border-radius: 6px;
  border: none;
  background: #f35757;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.modal-btn-danger:hover {
  background: #f35757;
}

.modal-btn-ghost {
  padding: 8px 18px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #111827;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.modal-btn-ghost:hover {
  background: #f3f4f6;
}

/* =================================================
   TABLET (1024px ↓)
   ================================================= */
@media (min-width: 1024px) and (max-width: 1280px) {
  .canvas-toolbar-container {
    bottom: 90px;
    padding: 6px 8px;
    height: 35px;
  }

  .toolbar-button,
  .toolbar-button:disabled {
    min-width: 70px;
    height: 32px;
    padding: 6px 2px;
    font-size: 12px;
    gap: 8px;
  }

  .organize-dropdown {
    min-width: 200px;
  }
  .remove-modal-box,
  .dark-modal-box {
    max-width: 90%;
  }
}

/* =================================================
   TABLET PORTRAIT (900px ↓)
   ================================================= */
@media (min-width: 900px) and (max-width: 1023px) {
  .canvas-toolbar-container {
    bottom: 20px;
    padding: 8px 8px;
    height: 40px;
    width: auto;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  .toolbar-button-group {
    gap: 6px;
  }
  .toolbar-button,
  .toolbar-button:disabled {
    min-width: 70px;
    height: 28px;
    padding: 6px 2px;
    font-size: 12px;
    gap: 5px;
  }

  .toolbar-divider {
    height: 32px;
  }
  .organize-dropdown {
    right: 0;
    left: auto;
  }
}

/* =================================================
   MOBILE (768px ↓)
   ONE LINE - NO WRAPPING
   ================================================= */
@media (min-width: 768px) and (max-width: 899px) {
  .canvas-toolbar-container {
    bottom: 10px;
    padding: 6px 12px;
    height: 40px;
    width: auto;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  .toolbar-button-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    white-space: nowrap;
  }

  .toolbar-button,
  .toolbar-button:disabled {
    min-width: 55px;
    height: 28px;
    padding: 4px 6px;
    font-size: 11px;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .toolbar-divider {
    height: 26px;
    margin: 0 2px;
    flex-shrink: 0;
  }

  .organize-dropdown,
  .dropdown-arrow,
  .hide-on-mobile {
    display: none;
  }

  .remove-modal-box,
  .dark-modal-box {
    padding: 18px;
    gap: 14px;
  }

  .remove-modal-title {
    font-size: 17px;
  }
  .remove-modal-body {
    gap: 8px;
  }
  .modal-actions {
    gap: 8px;
  }

  .modal-btn-ghost,
  .modal-btn-danger {
    padding: 7px 16px;
    font-size: 13px;
  }
}


@media (min-width: 481px) and (max-width: 767px) {
  .canvas-toolbar-container {
    bottom: 10px;
    padding: 6px 6px;
    height: 40px;
    width: auto;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 2px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  .toolbar-button span,
  .toolbar-button .label {
    display: none !important;
  }

  .toolbar-button-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    white-space: nowrap;
  }

  .toolbar-button,
  .toolbar-button:disabled {
    min-width: 55px;
    height: 28px;
    padding: 4px 6px;
    font-size: 11px;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .toolbar-divider {
    height: 26px;
    margin: 0 2px;
    flex-shrink: 0;
  }

  .organize-dropdown,
  .dropdown-arrow,
  .hide-on-mobile {
    display: none;
  }

  .remove-modal-box,
  .dark-modal-box {
    padding: 18px;
    gap: 14px;
  }

  .remove-modal-title {
    font-size: 17px;
  }
  .remove-modal-body {
    gap: 8px;
  }
  .modal-actions {
    gap: 8px;
  }

  .modal-btn-ghost,
  .modal-btn-danger {
    padding: 7px 16px;
    font-size: 13px;
  }
}

/* =================================================
   SMALL PHONES (480px ↓)
   ================================================= */
@media (max-width: 480px) {
  .canvas-toolbar-container {
    bottom: 16px;
    padding: 4px 8px;
    height: 36px;
    gap: 3px;
  }

  .toolbar-button span,
  .toolbar-button .label {
    display: none !important;
  }

  .toolbar-button-group {
    gap: 3px;
  }

  .toolbar-button,
  .toolbar-button:disabled {
    min-width: 48px;
    height: 26px;
    padding: 3px 4px;
    font-size: 10px;
    gap: 3px;
  }

  .toolbar-divider {
    height: 22px;
    margin: 0 1px;
  }

  .remove-modal-box,
  .dark-modal-box {
    padding: 16px;
    gap: 12px;
    width: 100%;
  }

  .remove-modal-title {
    font-size: 16px;
  }

  .remove-modal-body {
    font-size: 13px;
    gap: 8px;
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-actions button {
    width: 100%;
  }

  .modal-btn-ghost,
  .modal-btn-danger {
    padding: 10px 18px;
    font-size: 14px;
  }

  .icon-container {
    width: 24px;
    height: 24px;
  }

  .icon-container svg {
    width: 24px;
    height: 24px;
  }
}

/* =================================================
   EXTRA SMALL (360px ↓)
   ================================================= */
@media (max-width: 360px) {
  .canvas-toolbar-container {
    padding: 4px 6px;
    gap: 2px;
    width: 95%;
  }

  .toolbar-button span,
  .toolbar-button .label {
    display: none !important;
  }

  .toolbar-button,
  .toolbar-button:disabled {
    min-width: 44px;
    height: 24px;
    padding: 2px 3px;
    font-size: 9px;
  }

  .toolbar-divider {
    height: 20px;
  }
}

/* =================================================
   TOUCH DEVICE OPTIMIZATIONS
   ================================================= */
@media (hover: none) and (pointer: coarse) {
  .toolbar-button {
    padding: 12px;
  }

  .toolbar-button:hover:not(.disabled):not(:disabled) {
    background: #f9fbff;
    border-color: #e3e8ef;
  }

  .modal-btn-ghost,
  .modal-btn-danger {
    padding: 12px 20px;
  }

  .dropdown-menu-item {
    padding: 10px 12px;
  }
}

/* =================================================
   PRINT STYLES
   ================================================= */
@media print {
  .canvas-toolbar-container,
  .modal-backdrop-trans {
    display: none !important;
  }
}
