html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  overflow-x: hidden;
}

/* Style the header with a grey background and some padding */
:root { 
	--header-height: 72px; 
	/* Sidenav width (single source of truth) */
 	--sidenav-width: 250px;
}

body {
	box-sizing:border-box;
}

body.prevent-scroll {
    overflow: hidden;
}

.save-error {
  animation: flashError 0.6s;
}

@keyframes flashError {
  0% { outline: 2px solid red; }
  100% { outline: none; }
}

.logo {
	height:32px;
	padding-right:10px;
	padding-left:10px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 1000;

  left: 0;
  right: 0;
  width: 100%;        /* let left/right define it */
  box-sizing: border-box;
  overflow-x: clip;   /* or hidden */

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 16px 20px;
  background-color: #f1f1f1;
}

/* Style the header links */
.header a {
  display: inline-flex;       /* optional but tidy */
  align-items: center;        /* optional */
  color: black;
  text-align: center;
  padding: 12px;
  text-decoration: none;
  font-size: 18px;
  line-height: 25px;
  border-radius: 4px;
}

/* Style the logo link (notice that we set the same value of line-height and font-size to prevent the header to increase when the font gets bigger */
.header a.title {
	font-size: 25px;
	font-weight: bold;
}

/* Change the background color on mouse-over */
.header a:hover {
	background-color: #ddd;
	color: black;
}

/* Style the active/current link*/
.header a.active {
	background-color: dodgerblue;
	color: white;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-right .title-select {
  font-size: 0.95rem;
  font-weight: 600;
  background: transparent;
  border: none;
  padding: 2px 6px;
  cursor: pointer;
}

.header-right .title-select:focus {
  outline: none;
  border-bottom: 1px solid #888;
}


/* The ONLY scroller for the canvas */
/* keep viewport purely as the scroller */
.canvasViewport {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  position: relative;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch; /* FIXED */
  width: 100%;
  transition: margin-left 0.5s ease, width 0.5s ease;
}

/* iPad/touch: allow native panning anywhere (even on shapes) */
@media (pointer: coarse) {
  #canvasViewport,
  #canvasViewport * {
    touch-action: pan-x pan-y;
  }
}

/* Prevent annoying text selection in menus on long press */
#menu, #menu * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* The canvas itself */
#canvas {
  position: relative;
  width: 2000px;
  height: 1200px;
  border: 1px solid #f0f0f0;
  margin: 16px;
  overflow: visible;
}

.presenceCursor {
  position: absolute;
  width: 60px;   /* match viewBox roughly */
  height: 30px;
  overflow: visible;
  pointer-events: none;
  z-index: 1000;
}

.presenceLabel {
  font-family: sans-serif;
  font-size: 10px;
}

.presence-active {
  outline: 2px solid var(--presence-color);
  outline-offset: 2px;
  filter: drop-shadow(0 0 6px var(--presence-color));
}

.presence-tag {
  position: absolute;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  color: white;
  pointer-events: none;
  white-space: nowrap;
  transform: translate(0, 0);
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(30, 30, 30, 0.92);
  color: #ccc;
  font-size: 12px;
  font-family: monospace;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.status-bar__body {
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  gap: 8px;
  min-width: 0;
}

.status-bar__icon {
  color: #666;
  flex-shrink: 0;
}

.status-bar__body {
  cursor: pointer;
}

.status-bar__body:hover .status-bar__msg,
.status-bar__body:hover .status-bar__icon {
  color: #ccc;
}

.status-bar__msg {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.status-bar__log {
  border-top: 1px solid #333;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}

.status-bar__log-entry {
  display: flex;
  gap: 8px;
  padding: 2px 8px;
  line-height: 1.5;
}

.status-bar__log-entry:hover {
  background: rgba(255,255,255,0.05);
}

.status-bar__log-entry--navigable {
  cursor: pointer;
}

.status-bar__log-entry--navigable .status-bar__log-msg {
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.25);
  text-underline-offset: 2px;
}

.status-bar__log-entry--navigable:hover .status-bar__log-msg {
  color: #fff;
  text-decoration-color: rgba(255,255,255,0.6);
}

.status-bar__log-time {
  color: #999;
  flex-shrink: 0;
}

.status-bar__log-msg {
  color: #bbb;
}

@keyframes statusFlash {
  0%   { background: rgba(80, 130, 180, 0.5); }
  100% { background: rgba(30, 30, 30, 0.92); }
}

.status-bar--flash {
  animation: statusFlash 1.5s ease-out forwards;
}

@keyframes shapeFlash {
  0%   { box-shadow: 0 0 0 4px rgba(255, 200, 0, 0.9), 0 0 24px rgba(255, 200, 0, 0.5); }
  100% { box-shadow: none; }
}

.shape-flash {
  animation: shapeFlash 2s ease-out forwards;
}

.save-error {
  animation: flashError 6s;
}

@keyframes flashError {
  0% { outline: 2px solid red; }
  100% { outline: none; }
}

.title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-label {
  font-weight: 600;
}

.title-select {
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 2px 6px;
}

.title-select:focus {
  outline: none;
  border-bottom: 1px solid #888;
}

.blueprint-title-btn {
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 2px 6px;
  color: inherit;
  font-family: inherit;
}

.blueprint-title-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blueprint-title-btn:focus-visible {
  outline: none;
  border-bottom: 1px solid #888;
}

/* ── Blueprint manager dialog ──────────────────────────────── */

.confirm-dialog {
  width: 340px;
  max-width: 92vw;
  border: none;
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  font-family: inherit;
  font-size: 14px;
  overflow: hidden;
}

.confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.25);
}

.confirm-dialog-message {
  margin: 0;
  padding: 20px 20px 16px;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}

.confirm-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e8e8e8;
  background: #fafafa;
}

.blueprint-dialog {
  width: 680px;
  max-width: 95vw;
  border: none;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  font-family: inherit;
  font-size: 14px;
}

.blueprint-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.blueprint-dialog-body {
  display: flex;
  height: 400px;
}

.blueprint-dialog-list-col {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  background: #f7f7f7;
}

.blueprint-dialog-list-heading {
  padding: 14px 16px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
}

.blueprint-dialog-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 8px;
  overflow-y: auto;
  flex: 1;
}

.blueprint-dialog-item {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #333;
}

.blueprint-dialog-item:hover {
  background: #ebebeb;
}

.blueprint-dialog-item.is-selected {
  background: #dbeafe;
  color: #1d4ed8;
}

.blueprint-dialog-item.is-current::after {
  content: ' ✓';
  color: #16a34a;
  font-size: 11px;
}

.blueprint-dialog-detail-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 6px;
  min-width: 0;
}

.blueprint-dialog-detail-col label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
}

#blueprintDialogName {
  font-size: 15px;
  font-weight: 600;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: inherit;
  background: #f5f5f5;
}

#blueprintDialogName:not([readonly]):focus {
  outline: none;
  background: #fff;
  border-color: #3b82f6;
}

#blueprintDialogDesc {
  flex: 1;
  resize: none;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  background: #f5f5f5;
}

#blueprintDialogDesc:not([readonly]):focus {
  outline: none;
  background: #fff;
  border-color: #3b82f6;
}

.blueprint-dialog-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
}

.blueprint-dialog-footer-spacer {
  flex: 1;
}

.blueprint-btn {
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid #d0d0d0;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.blueprint-btn:hover:not(:disabled) {
  background: #f0f0f0;
}

.blueprint-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.blueprint-btn--primary {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.blueprint-btn--primary:hover:not(:disabled) {
  background: #2563eb;
  border-color: #2563eb;
}

.blueprint-btn--danger {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fff;
}

.blueprint-btn--danger:hover:not(:disabled) {
  background: #fef2f2;
}

.sidenav {
  position: fixed;
  top: var(--header-height, 72px); /* sits below header */
  left: 0;
  height: calc(100vh - var(--header-height, 72px));
  width: 250px;

  background-color: #111;
  z-index: 1001;

  overflow: auto;
  padding-top: 20px;

  /* slide off-canvas by default */
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

/* open state */
.sidenav-opened {
  transform: translateX(0);
}

/* closed state */
.sidenav-closed {
  transform: translateX(-100%);
}

.sidenav a {
	padding: 8px 8px 8px 32px;
	text-decoration: none;
	font-size: 25px;
	color: #818181;
	display: block;
	transition: 0.3s;
}

.sidenav a:hover {
	color: #f1f1f1;
}

.sidenav .closebtn {
	position: absolute;
	top: 0;
	right: 25px;
	font-size: 36px;
	margin-left: 50px;
}

/* When nav is open, shove the canvas viewport right */
.workspace.nav-open #canvasViewport {
  margin-left: var(--sidenav-width);
  width: calc(100% - var(--sidenav-width));
}

/* smooth it */
#canvas {
  transform: translateX(0);
  transition: transform 0.5s ease;
}

/* The area below the header */
.workspace {
  /* fill remaining height below header */
  height: calc(100vh - var(--header-height));
  display: flex;
  min-height: 0; /* IMPORTANT: allows child scrolling */
  position: relative;
  width: 100%;
  overflow: hidden; 
}

.sidetoggle {
	float:left;
	font-size:30px;
	cursor:pointer;
}

.chevron::before {
	border-style: double;
	border-width: 0.25em 0.25em 0 0;
	content: '';
	display: inline-block;
	height: 0.45em;
	left: 0.15em;
	position: relative;
	top: 0.15em;
	transform: rotate(-45deg);
	vertical-align: top;
	width: 0.45em;
}

.chevron.right:before {
	left: 0;
	transform: rotate(45deg);
}

.chevron.left:before {
	left: 0.25em;
	transform: rotate(-135deg);
}


.card, .action {
	width: 120px;
	-moz-box-sizing:border-box;
	-webkit-box-sizing:border-box;
	box-sizing:border-box;
	height: 80px;
	z-index: 20;
	position: relative;
	/*border-radius: 5px;*/
	border-top:8px solid #F0F0F0;
	transition: filter 0.2s ease-in-out; /* Smooth transition */
	transition: border 0.3s ease; /* Smooth transition for the border */
	box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
	cursor: grab;
}

.card.overlap::after,
.action.overlap::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    border-width: 16px 16px 0 0;
    border-style: solid;
    border-color: #f8f8f8 #fff #fff #fff;
    -webkit-box-shadow: 0 -1px 1px rgba(0,0,0,-0.3), -1px -1px 1px rgba(0,0,0,0.2);
    -moz-box-shadow: 0 -1px 1px rgba(0,0,0,-0.3), -1px -1px 1px rgba(0,0,0,0.2);
    box-shadow: 0 -1px 1px rgba(0,0,0,-0.3), -1px -1px 1px rgba(0,0,0,0.2);
    /* Firefox 3.0 damage limitation */
    display: block; width: 0;
}

.card:hover, 
.action:hover {
    box-shadow: 0 0 10px rgba(0, 0, 255, 0.5);
}

.card.empty::after,
.action.empty::after {
    content: "";
}

.cardBadge {
  position: absolute;
  top: -16px;
  right: -10px;

  width: 22px;
  height: 22px;
  border-radius: 6px;

  display: grid;
  place-items: center;

  font-size: 12px;
  line-height: 1;
  font-weight: 700;

  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0,0,0,0.15);

  pointer-events: none;   /* IMPORTANT: don’t interfere with drag/edit */
  user-select: none;
}

/* FontAwesome icon size tweak */
.cardBadge i {
  font-size: 12px;
  line-height: 1;
}

/* Default cards (action) do not show badge */
.card.action .cardBadge {
  display: none;
}

.phase {
	width: 140px;
	-moz-box-sizing:border-box;
	-webkit-box-sizing:border-box;
	box-sizing:border-box;
	z-index: 1;
	background: rgba(0,0,0,0.001);/*enables dragging */
	border: 1px solid transparent;
	border-top: solid darkgrey;
	padding-top: 0.5em;
	padding-bottom: 0.5em;
	border-radius:0.75em;
	height: calc(100% - 20px);
	top:10px;
	transition: filter 0.2s ease-in-out;
	cursor: grab;
}

.phase:hover .phase-resize-handle-L{
	visibility:visible;
}

.phase:hover .phase-resize-handle-R{
	visibility:visible;
}

.phase-resize-handle-L {
	width: 8px;
	height: 100%;
	position: absolute;
	top: 0;
	left: -2px;
	cursor: ew-resize;
	visibility:hidden;
}

.phase-resize-handle-R {
	width: 8px;
	height: 100%;
	position: absolute;
	top: 0;
	right: -2px;
	cursor: ew-resize;
	visibility:hidden;
}

.step {
	width: 130px;
	-moz-box-sizing:border-box;
	-webkit-box-sizing:border-box;
	box-sizing:border-box;
	z-index: 2;
	background: rgba(0,0,0,0.001);/*enables dragging */
	border: 1px solid transparent;
	border-top: 10px solid #e4f0fd;
	height: calc(100% - 50px);
	top: 40px;
	transition: filter 0.2s ease-in-out; /* Smooth transition */
	cursor: grab;
}

.swimlane {
	z-index: 1;
	-moz-box-sizing:border-box;
	-webkit-box-sizing:border-box;
	box-sizing:border-box;
	background: rgba(0,0,0,0.001);/*enables dragging */
	border: 1px solid transparent;
	border-left: solid darkgrey;
	padding-left:0.75em;
	border-radius:0.75em;
	width: calc(100% - 20px);
	height:115px;
	left:10px;
	transition: filter 0.2s ease-in-out; /* Smooth transition */
	cursor: grab;
}

.swimlane:hover .swimlane-resize-handle-T{
	visibility:visible;
}

.swimlane:hover .swimlane-resize-handle-B{
	visibility:visible;
}

.swimlane-resize-handle-T {
	width:100%;
	height: 4px;
	position: absolute;
	top: 0;
	left: 0;
	cursor: ns-resize;
	visibility:hidden;
}

.swimlane-resize-handle-B {
	width:100%;
	height: 4px;
	position: absolute;
	bottom: 0;
	left: 0;
	cursor: ns-resize;
	visibility:hidden;
}

.channel {
	z-index: 3;
	-moz-box-sizing:border-box;
	-webkit-box-sizing:border-box;
	box-sizing:border-box;
	background: rgba(0,0,0,0.001);/*enables dragging */
	border: 1px solid transparent;
	border-left: 10px solid #F0F0F0;
	width: calc(100% - 60px);
	height:90px;
	left:40px;
	transition: filter 0.2s ease-in-out; /* Smooth transition */
	cursor: grab;
}

.separator {
	z-index: 5;
	width: calc(100% - 40px);
	left: 5px;
	height: 20px;
	border-bottom: 2px solid darkgrey;
	background: rgba(0,0,0,0.001);/*enables dragging */
	position: relative;
	cursor: grab;
} 

.separator:hover {
	border-color: lightgrey;
}

.textCard{
	position:absolute;
	-moz-box-sizing:border-box;
	-webkit-box-sizing:border-box;
	box-sizing:border-box;
	/*border-radius: 0px 0px 5px 5px;*/
	display:block;
	width:100%;
	height:100%;
	overflow: clip;
	/*border:solid 1px lightgrey;*/
	padding: 1px;
	outline-color: lightgrey;
	background-color: white;
	font-family: sans-serif;
	font-size:12px;
	outline: 0px solid transparent;
}

.textCard:hover {
	cursor:text;
	display:inline-block;
}

.textPhase {
	position:absolute;
	-moz-box-sizing:border-box;
	-webkit-box-sizing:border-box;
	box-sizing:border-box;
	width:100%;
	height:18px;
	border:none;
	resize:none;
	text-align:center;
	outline-color: lightgrey;
	font-family: sans-serif;
	font-size:16px;
	text-transform: uppercase;
	outline: 0px solid transparent;
}

.textPhase:hover {
	cursor:text;
	display:inline-block;
}

.textStep {
	position:absolute;
	-moz-box-sizing:border-box;
	-webkit-box-sizing:border-box;
	box-sizing:border-box;
	width:100%;
	height:18px;
	border:none;
	resize:none;
	text-align:center;
	outline-color: lightgrey;
	font-family: sans-serif;
	font-size:14px;
	outline: 0px solid transparent;
}

.textStep:hover {
	cursor:text;
	display:inline-block;
}
.textSwimlane {
	position:absolute;
	-moz-box-sizing:border-box;
	-webkit-box-sizing:border-box;
	box-sizing:border-box;
	min-width:180px;
	height:18px;
	border:none;
	resize:none;
	overflow: clip;
	padding: 1px;
	text-align:left;
	outline-color: lightgrey;
	font-family: sans-serif;
	font-size:16px;
	text-transform: uppercase;
	outline: 0px solid transparent;
}

.textSwimlane:hover {
	cursor:text;
}

.textChannel {
	position:absolute;
	box-sizing:border-box;
	width:100px;
	height:100%;
	overflow:clip;
	border:1px solid transparent;

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

	text-align:center;
	outline-color: lightgrey;
	font-family: sans-serif;
	font-size:14px;
	outline: 0px solid transparent;
}

.textChannel:empty::before {
	content: "\00a0"; /* non-breaking space */
}

.textChannel:hover {
	cursor:text;
}

.textSeparator {
	position:absolute;
	-moz-box-sizing:border-box;
	-webkit-box-sizing:border-box;
	box-sizing:border-box;
	min-width:180px;
	height:20px;
	border:none;
	resize:none;
	left:15px;
	text-align:left;
	outline-color: lightgrey;
	font-family: sans-serif;
	font-size:14px;
	outline: 0px solid transparent;
}

.textSeparator:hover {
	cursor:text;
	display:inline-block;
}
		
/* Draggables: allow scroll-start, but don't select text */
.draggable {
  position: absolute;
  user-select: none;
  -webkit-user-select: none;
}

/* During an active drag, you can disable scroll (optional but usually nicer) */
/* During an active drag, disable native panning anywhere in the viewport */
body.is-dragging #canvasViewport,
body.is-dragging #canvasViewport * {
  touch-action: none;
}

body.is-dragging {
  -webkit-user-select: none;
  user-select: none;
}

[contenteditable=true]:empty:not(:focus):before {
	content: attr(placeholder);
	color:lightgrey;
	pointer-events: none;
	display: block;
}

.ghost {
  position: absolute;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 20;
  /* Clear container boundary */
  border: 1px solid rgba(120, 120, 120, 0.2);
  /* Slight separation from background */
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
  /* Optional subtle translucency */
  opacity: 0.95;
}

.fadeDiv {
	opacity: 0;
	transition: opacity 100ms 100ms linear;
}

#menu {
	position: fixed;
	z-index: 9999;
	visibility: hidden;
	opacity: 0;
	padding: 0px;
	font-family: sans-serif;
	font-size: 11px;
	background: #fff;
	color: #555;
	border: 1px solid #C6C6C6;
	-webkit-transition: opacity .25s ease-in-out;
	-moz-transition: opacity .25s ease-in-out;
	transition: opacity .25s ease-in-out;
	-webkit-box-shadow: 2px 2px 2px 0px rgba(143, 144, 145, 1);
	-moz-box-shadow: 2px 2px 2px 0px rgba(143, 144, 145, 1);
	box-shadow: 2px 2px 2px 0px rgba(143, 144, 145, 1);
}

#menu a {
	display: block;
	color: #555;
	text-decoration: none;
	padding: 6px 8px 6px 30px;
	width: 180px;
	position: relative;
}

#menu a img,
#menu a i.fa {
	height: 20px;
	font-size: 17px;
	width: 20px;
	position: absolute;
	left: 5px;
	top: 2px;
}

#menu a span {
	color: #BCB1B3;
	float: right;
}

#menu a:hover {
	color: #fff;
	background: #3879D9;
}

#menu hr {
	border: 1px solid #EBEBEB;
	border-bottom: 0;
}

#menu, #menu * {
  -webkit-user-select: none;
  user-select: none;
}

/* ─── Card-type cascade submenu ─────────────────────────────────────────── */

.menu-card-submenu-parent {
	display: block;
	color: #555;
	text-decoration: none;
	padding: 6px 8px 6px 30px;
	width: 180px;
	position: relative;
	cursor: default;
	box-sizing: border-box;
}

.menu-card-submenu-parent i.fa:first-child {
	height: 20px;
	font-size: 17px;
	width: 20px;
	position: absolute;
	left: 5px;
	top: 2px;
}

.menu-submenu-arrow {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 12px;
}

.menu-card-submenu-parent:hover {
	color: #fff;
	background: #3879D9;
}

.menu-card-submenu {
	display: none;
	position: absolute;
	left: 100%;
	top: -1px;
	z-index: 10000;
	background: #fff;
	border: 1px solid #C6C6C6;
	-webkit-box-shadow: 2px 2px 2px 0px rgba(143, 144, 145, 1);
	-moz-box-shadow: 2px 2px 2px 0px rgba(143, 144, 145, 1);
	box-shadow: 2px 2px 2px 0px rgba(143, 144, 145, 1);
}

.menu-card-submenu-parent:hover .menu-card-submenu {
	display: block;
}

.menu-card-submenu a {
	display: block;
	color: #555;
	text-decoration: none;
	padding: 6px 8px 6px 30px;
	width: 180px;
	position: relative;
	box-sizing: border-box;
}

.menu-card-submenu a i.fa {
	height: 20px;
	font-size: 17px;
	width: 20px;
	position: absolute;
	left: 5px;
	top: 2px;
}

.menu-card-submenu a:hover {
	color: #fff;
	background: #3879D9;
}

#colourPicker {
	position:fixed;
	z-index:1000;
	background-color: white;
	border:solid 1px lightgrey;
	border-radius:3px;
	display:none;
}

input[type="color" i] {
	border-radius: 10%;
	inline-size: 20px;
	block-size: 20px;
	padding: 1px;
	border-width: 1px;
	border-style: solid;
}

/* Affects area between outer circle and color swatch. Firefox doesn't have an equivalent. */
input[type="color" i]::-webkit-color-swatch-wrapper {
	padding: 1px;
}

/* Affects the inner circle, i.e. the current color selection */
/*input[type="color" i]::-webkit-color-swatch {
	border-radius: 10%;
}

input[type="color" i]::-moz-color-swatch {
	border-radius: 10%;
}*/


/* IMPORTANT:
   The SVG overlay covers the whole canvas.
   It must remain pointer-events:none or dragging shapes will break.
*/
.connector {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index:30;
	pointer-events:none;
}

.connector-line {
  pointer-events: stroke;      /* key change: no "visible" requirement */
  stroke: black;               /* painted */
  stroke-opacity: 0;           /* invisible */
  stroke-width: 16;
  fill: none;
  transition: stroke 0.2s ease-in-out, stroke-opacity 0.2s ease-in-out, filter 0.2s ease-in-out;
}

.visible-line {
	position:absolute;
    stroke: black;
    stroke-width: 2;
    fill: none;
	z-index:1;
	transition: stroke 0.2s ease-in-out;
	pointer-events:none;
}

.elbow-point {
	position:absolute;
    fill: transparent;
	pointer-events:all;
	cursor:pointer;
    stroke: transparent;
    stroke-width: 1;
    transition: fill 0.2s ease-in-out, stroke 0.2s ease-in-out;
}

.drag-point,
.elbow-point {
  touch-action: none;
}

/* Hovering a line stroke -> Highlight line + all elbow circles */
.connector-line:hover {
  stroke: rgb(132, 173, 249);
  stroke-opacity: 1;           /* <-- this is what you were missing */
  filter: drop-shadow(0px 0px 5px rgba(0, 0, 255, 0.9));
}

.connector-line:hover ~ .elbow-point {
    fill: blue;
    stroke: blue;
	filter: drop-shadow(0px 0px 5px rgba(0, 0, 255, 0.9));
}

.connector-line:hover ~ .drag-point {
    fill: blue;
    stroke: blue;
	filter: drop-shadow(0px 0px 5px rgba(0, 0, 255, 0.9));
}

/* Hovering an elbow circle -> Highlight only that elbow */
.elbow-point:hover {
    fill: blue;
    stroke: blue;
	filter: drop-shadow(0px 0px 5px rgba(0, 0, 255, 0.9));
}

.drag-point {
	fill: transparent;
	pointer-events:all;
	cursor:grab;
    stroke: transparent;
    stroke-width: 1;
    transition: fill 0.2s ease-in-out, stroke 0.2s ease-in-out;
}

/* Hovering an end drag circle -> Highlight only that point */
.drag-point:hover {
    fill: blue;
    stroke: blue;
	filter: drop-shadow(0px 0px 5px rgba(0, 0, 255, 0.9));
}

.card.glowRight::after,
.action.glowRight::after  {
	content: '';
	position: absolute;
	top: 50%;
	right: -8px; /* Adjust to position the circle outside the border */
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	background-color: rgba(51, 255, 0, 0.7); /* Green color */
	border-radius: 50%; /* Makes it a circle */
	box-shadow: 0 0 10px rgba(51, 255, 0, 0.7); /* Glow effect */
}

.card.glowLeft::after,
.action.glowLeft::after {
	content: '';
	position: absolute;
	top: 50%;
	left: -8px; /* Adjust to position the circle outside the border */
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	background-color: rgba(51, 255, 0, 0.7); /* Green color */
	border-radius: 50%; /* Makes it a circle */
	box-shadow: 0 0 10px rgba(51, 255, 0, 0.7); /* Glow effect */
}

.card.glowTop::after,
.action.glowTop::after {
	content: '';
	position: absolute;
	top: -14px; /* Adjust to position the circle outside the top border */
	left: 50%;
	transform: translateX(-50%);
	width: 16px;
	height: 16px;
	background-color: rgba(51, 255, 0, 0.7); /* Green color */
	border-radius: 50%; /* Makes it a circle */
	box-shadow: 0 0 10px rgba(51, 255, 0, 0.7); /* Glow effect */
}

.card.glowBottom::after,
.action.glowBottom::after {
	content: '';
	position: absolute;
	bottom: -8px; /* Adjust to position the circle outside the bottom border */
	left: 50%;
	transform: translateX(-50%);
	width: 16px;
	height: 16px;
	background-color: rgba(51, 255, 0, 0.7); /* Green color */
	border-radius: 50%; /* Makes it a circle */
	box-shadow: 0 0 10px rgba(51, 255, 0, 0.7); /* Glow effect */
}

.no-pointer-events {
	pointer-events: none;
}

.highlightRow {
	box-shadow: 0 0 10px rgba(51, 255, 0, 0.7); /* Glow effect */
}

.highlightCol {
	box-shadow: 0 0 10px rgba(51, 255, 0, 0.7); /* Glow effect */
}

#shapeHint {
	position: fixed;
	z-index: 10000;
	pointer-events: none;
	background: rgba(30, 30, 30, 0.88);
	color: #f0f0f0;
	font-size: 12px;
	line-height: 1.6;
	padding: 6px 10px;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	white-space: nowrap;
	display: none;
	max-width: 280px;
}

#shapeHint.is-visible {
	display: block;
}

#shapeHint .shapeHint-row {
	display: flex;
	gap: 6px;
}

#shapeHint .shapeHint-label {
	color: #aaa;
	text-transform: capitalize;
	min-width: 60px;
}

#shapeHint .shapeHint-value {
	color: #fff;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Conflict management dialog */
.edit-conflict-dialog {
  border: 1px solid #d6d6d6;
  border-radius: 12px;
  padding: 20px 20px 18px 20px;
  width: min(980px, 94vw);
  max-width: 980px;
  box-sizing: border-box;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
  background: #ffffff;
  color: #222;
  position: relative;
}

.edit-conflict-dialog::backdrop {
  background: rgba(0, 0, 0, 0.28);
}

.edit-conflict-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid #cfcfcf;
  border-radius: 999px;
  background: #fff;
  color: #444;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.edit-conflict-close:hover {
  background: #f3f3f3;
}

.edit-conflict-header {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  padding-right: 40px;
}

.edit-conflict-subheader {
  font-size: 14px;
  color: #666;
  margin-bottom: 18px;
}

.edit-conflict-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}

.edit-conflict-option {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.edit-conflict-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
}

.conflict-preview-card,
.conflict-preview-generic {
  box-sizing: border-box;
  border-radius: 8px;
  padding: 12px;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  width: 100%;
  min-height: 220px;
  display: block;
}

.conflict-preview-card {
  border: 1px solid #d8d8d8;
  border-top: 8px solid #4e8cba;
  background: #fff;
  aspect-ratio: 3 / 2;
}

.conflict-preview-card.action {
  border-top-color: #4e8cba;
}

.conflict-preview-card.pain {
  border-top-color: #e45521;
}

.conflict-preview-card.opportunity {
  border-top-color: #559e38;
}

.conflict-preview-card.comment {
  border-top-color: #8f6dc0;
}

.conflict-preview-generic {
  border: 1px solid #d8d8d8;
  background: #fafafa;
  min-height: 220px;
}

.edit-conflict-action {
  padding: 10px 12px;
  border: 1px solid #c7c7c7;
  border-radius: 8px;
  background: #f5f5f5;
  color: #222;
  font: inherit;
  cursor: pointer;
}

.edit-conflict-action:hover {
  background: #ececec;
}

@media (max-width: 720px) {
  .edit-conflict-options {
    grid-template-columns: 1fr;
  }

  .conflict-preview-card {
    aspect-ratio: auto;
    min-height: 160px;
  }
}

.editing-reacquire {
  animation: editingReacquirePulse 1.2s ease-out;
}

@keyframes editingReacquirePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.7);
  }
  100% {
    box-shadow: 0 0 0 18px rgba(66, 133, 244, 0);
  }
}

/* ─── Pain/Opportunity link highlight pulse ──────────────────────────────── */

@keyframes linkPulsePain {
  0%   { outline-color: rgba(200, 0, 0, 0.9);  outline-offset: 0px; }
  50%  { outline-color: rgba(200, 0, 0, 0.5);  outline-offset: 4px; }
  100% { outline-color: rgba(200, 0, 0, 0.9);  outline-offset: 0px; }
}

@keyframes linkPulseOpportunity {
  0%   { outline-color: rgba(0, 160, 60, 0.9);  outline-offset: 0px; }
  50%  { outline-color: rgba(0, 160, 60, 0.5);  outline-offset: 4px; }
  100% { outline-color: rgba(0, 160, 60, 0.9);  outline-offset: 0px; }
}

.card.linked-highlight-pain {
  outline: 3px solid rgba(200, 0, 0, 0.9);
  outline-offset: 0px;
  animation: linkPulsePain 0.9s ease-in-out 3;
}

.card.linked-highlight-opportunity {
  outline: 3px solid rgba(0, 160, 60, 0.9);
  outline-offset: 0px;
  animation: linkPulseOpportunity 0.9s ease-in-out 3;
}

@keyframes linkPulseComment {
  0%   { outline-color: rgba(0, 100, 220, 0.9);  outline-offset: 0px; }
  50%  { outline-color: rgba(0, 100, 220, 0.4);  outline-offset: 4px; }
  100% { outline-color: rgba(0, 100, 220, 0.9);  outline-offset: 0px; }
}

.draggable.linked-highlight-comment {
  outline: 3px solid rgba(0, 100, 220, 0.9);
  outline-offset: 0px;
  animation: linkPulseComment 0.9s ease-in-out 3;
}

/* ─── Hotspot overlay glow (applied via JS custom property) ──────────────── */

.card.hotspot-active {
  box-shadow: var(--hotspot-glow), 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

/* ─── Hotspot toggle button ──────────────────────────────────────────────── */

.hotspot-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid #bbb;
  border-radius: 5px;
  background: #f3f3f3;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: #444;
  box-shadow: 0 2px 0 rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.10);
  transition: background 0.1s, color 0.1s, border-color 0.1s, box-shadow 0.1s, transform 0.1s;
}

.hotspot-toggle-btn:hover {
  background: #e6e6e6;
  border-color: #999;
}

.hotspot-toggle-btn--active {
  background: #2a2a2a;
  color: #fff;
  border-color: #111;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 2px rgba(0,0,0,0.3);
  transform: translateY(1px);
}

.hotspot-toggle-btn--active:hover {
  background: #3a3a3a;
}

.hotspot-toggle-btn--working {
  opacity: 0.6;
  cursor: wait;
}

/* ─── Link dialog ────────────────────────────────────────────────────────── */

.link-dialog {
  border: none;
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  min-width: 340px;
  max-width: 480px;
  width: 90vw;
}

.link-dialog::backdrop {
  background: rgba(0,0,0,0.35);
}

.link-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #e0e0e0;
}

.link-dialog-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #222;
}

.link-dialog-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #888;
  padding: 0 2px;
}

.link-dialog-close:hover {
  color: #333;
}

.link-dialog-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px 0;
}

.link-dialog-empty {
  padding: 12px 16px;
  color: #888;
  font-size: 0.9rem;
  margin: 0;
}

.link-dialog-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  cursor: pointer;
}

.link-dialog-row:hover {
  background: #f5f5f5;
}

.link-dialog-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.link-dialog-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 11px;
}

.link-dialog-badge--pain {
  background: rgba(255, 0, 0, 0.12);
  color: #c00;
}

.link-dialog-badge--opportunity {
  background: rgba(0, 180, 70, 0.12);
  color: #007a30;
}

.link-dialog-badge--action {
  background: rgba(0,0,0,0.07);
  color: #444;
}

.link-dialog-preview {
  font-size: 0.88rem;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.link-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid #e0e0e0;
}

.link-dialog-btn {
  padding: 6px 16px;
  border-radius: 5px;
  border: 1px solid #bbb;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.link-dialog-btn--cancel {
  background: #f3f3f3;
  color: #444;
}

.link-dialog-btn--cancel:hover {
  background: #e6e6e6;
}

.link-dialog-btn--confirm {
  background: #2a2a2a;
  color: #fff;
  border-color: #111;
}

.link-dialog-btn--confirm:hover {
  background: #444;
}

.link-dialog-filter-wrap {
  padding: 8px 16px 4px;
}

.link-dialog-filter {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.9rem;
}

.link-dialog-filter:focus {
  outline: none;
  border-color: #666;
}

.link-dialog-section-header {
  padding: 6px 16px 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #007a30;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f9f9f9;
  border-top: 1px solid #eee;
}

.link-dialog-section-header:first-child {
  border-top: none;
}

.link-dialog-section-header--unlinked {
  color: #666;
}

