.brand-mark img,
.library-brand img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

/* La miniatura debe reproducir exactamente el recorte cuadrado guardado. */
.avatar-button {
  box-sizing: border-box;
  padding: 0 !important;
}

.avatar-button > img {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: 50% 50%;
}

/* La medida calculada del nodo debe incluir borde y relleno, como en GitMind. */
.mind-node {
  box-sizing: border-box;
}

.mind-node.shape-underline:not(.root) {
  height: auto;
  border: 0;
  padding: 1px 4px 3px 14px;
  background: transparent;
  box-shadow: none;
}
.mind-node.shape-underline.side-left:not(.root) {
  padding-right: 14px;
  padding-left: 4px;
}
.mind-node.shape-underline.editing:not(.root) {
  min-height: 38px;
  border: 2px solid #ffb47d;
  border-radius: 7px;
  padding: 5px 11px;
  background: #fff;
  box-shadow: 0 0 0 2px #fff;
}
.mind-node .node-drag-cue {
  display: none !important;
}
.brand-mark:has(img) {
  padding: 0;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden;
}
.library-brand .brand-mark {
  box-shadow: none;
}
.folder-sidebar > .folder-tree-row {
  margin-bottom: 3px;
}
.space-heading {
  margin-top: 18px;
}
.space-color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.folder-tree-row small {
  margin-left: auto;
  color: #9298a8;
}
.welcome-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.library-sort-select {
  height: 39px;
  max-width: 210px;
  padding: 0 32px 0 12px;
  border: 1px solid #e1e4ec;
  border-radius: 11px;
  background: #fff;
  color: #596171;
}
.library-view-toggle {
  display: flex;
  padding: 3px;
  border: 1px solid #e1e4ec;
  border-radius: 11px;
  background: #fff;
}
.library-view-toggle button {
  width: 32px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #858b99;
}
.library-view-toggle button.active {
  color: #586fe8;
  background: #edf0ff;
}
.library-bulk-bar {
  position: sticky;
  top: 76px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 16px;
  padding: 10px 13px;
  border: 1px solid #dfe3f7;
  border-radius: 13px;
  background: #f7f8ff;
  box-shadow: 0 9px 25px #29326b12;
}
.library-bulk-bar strong {
  margin-right: auto;
}
.library-bulk-bar button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #4f5667;
}
.library-bulk-bar button.danger {
  color: #bd4356;
}
.library-list-view {
  grid-template-columns: 1fr !important;
}
.library-list-view .map-card,
.library-list-view .folder-card {
  min-height: 98px;
}
.library-list-view .map-card {
  display: grid;
  grid-template-columns: 165px 1fr auto;
  align-items: center;
}
.library-list-view .map-preview {
  height: 76px;
}
.map-card {
  position: relative;
}
.map-select-check {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  width: 18px;
  height: 18px;
  accent-color: #5f75ec;
}
.map-favorite {
  color: #9ca2b0;
}
.map-favorite.active {
  color: #f2a521;
}
.map-card-badges,
.map-tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.map-card-badges span,
.map-tag-row span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f0f2f8;
  color: #72798a;
  font-size: 9px;
  font-weight: 750;
}
.map-tag-row {
  margin-top: 6px;
}
.map-tag-row span {
  background: #eef0ff;
  color: #5d68c6;
}
.template-filters {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 10px;
  margin: 0 0 14px;
}
.template-filters input,
.template-filters select {
  height: 40px;
  padding: 0 11px;
  border: 1px solid #dfe2eb;
  border-radius: 10px;
  background: #fff;
}
.template-card em {
  display: block;
  margin-top: 5px;
  color: #8a90a0;
  font-size: 9px;
  font-style: normal;
}
.trash-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.import-failure-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}
.import-failure-list > div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 10px;
  background: #fff1f3;
  color: #a94455;
}
.import-failure-list span {
  font-size: 11px;
}
.collaborator-invite-row {
  display: grid;
  grid-template-columns: 1fr 135px auto;
  gap: 8px;
  margin-bottom: 14px;
}
.collaborator-invite-row input,
.collaborator-invite-row select {
  height: 41px;
  padding: 0 10px;
  border: 1px solid #dfe2eb;
  border-radius: 10px;
}
.collaborator-list,
.activity-list,
.backlink-list {
  display: grid;
  gap: 7px;
  max-height: 430px;
  overflow: auto;
}
.collaborator-list > div {
  display: grid;
  grid-template-columns: 34px 1fr auto 32px;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border-top: 1px solid #eceef3;
}
.collaborator-list img,
.avatar-fallback {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #edf0ff;
  color: #5e6bd0;
  font-weight: 800;
}
.collaborator-list small {
  display: block;
  color: #9298a7;
}
.collaborator-list em {
  font-size: 10px;
  font-style: normal;
  color: #747b8b;
}
.activity-list > div {
  display: flex;
  gap: 10px;
  padding: 9px;
  border-top: 1px solid #eceef3;
}
.activity-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: #6276eb;
}
.activity-list p {
  margin: 0;
}
.activity-list small {
  display: block;
  margin-top: 4px;
  color: #9298a7;
}
.backlink-list a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid #e5e7ee;
  border-radius: 11px;
  color: #414857;
  text-decoration: none;
}
.backlink-list a:hover {
  border-color: #aeb8ee;
  background: #f8f9ff;
}
.backlink-list small {
  display: block;
  color: #8c92a1;
}
.preference-list {
  display: grid;
  gap: 6px;
}
.toggle-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: #f7f8fb;
  text-align: left;
}
.toggle-row span {
  display: grid;
  gap: 3px;
}
.toggle-row i {
  width: 38px;
  height: 22px;
  padding: 3px;
  border-radius: 999px;
  background: #cdd1dc;
}
.toggle-row i:after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: 0.18s;
}
.toggle-row.active i {
  background: #6175e9;
}
.toggle-row.active i:after {
  transform: translateX(16px);
}
.ideas-split-panel {
  position: absolute;
  z-index: 20;
  top: 78px;
  right: 18px;
  bottom: 88px;
  width: 310px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  border: 1px solid #dfe2ea;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px #2c31432b;
}
.ideas-split-panel .panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.ideas-split-panel .panel-title div {
  display: grid;
  gap: 3px;
}
.ideas-split-panel .panel-title span {
  color: #8b91a0;
  font-size: 10px;
}
.ideas-panel-search,
.insert-library-search {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 11px 0;
  padding: 8px 10px;
  border: 1px solid #e0e3eb;
  border-radius: 10px;
  background: #fff;
}
.ideas-panel-search input,
.insert-library-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}
.ideas-panel-list {
  min-height: 0;
  flex: 1;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: auto;
}
.ideas-panel-list article {
  padding: 10px;
  border: 1px solid #e3e5ed;
  border-radius: 11px;
  background: #fafbff;
  cursor: grab;
}
.ideas-panel-list article p {
  margin: 5px 0;
  color: #747b8a;
  font-size: 11px;
}
.ideas-panel-list article small {
  color: #9298a7;
  font-size: 9px;
}
.editor-shell.focus-mode .editor-toolbar,
.editor-shell.focus-mode .editor-topbar > *:not(.editor-title) {
  opacity: 0.08;
  transition: 0.2s;
}
.editor-shell.focus-mode:hover .editor-toolbar,
.editor-shell.focus-mode:hover .editor-topbar > * {
  opacity: 1;
}
.editor-shell.split-ideas .react-flow {
  margin-right: 335px;
}
.editor-shell.editor-view-outline .react-flow {
  visibility: hidden;
}
.editor-shell.editor-view-outline .outline-panel {
  inset: 84px 18px 80px;
  width: auto;
  max-width: none;
}
.editor-shell.editor-view-combined .react-flow {
  margin-right: min(520px, 38vw);
}
.editor-shell.editor-view-combined .outline-panel {
  width: 38%;
  max-width: 520px;
}
.editor-actions
  .toolbar-select.editor-action-secondary[aria-label="Distribución del mapa"] {
  display: block !important;
  min-width: 150px;
}
.canvas-view-menu {
  position: relative;
  flex: 0 0 auto;
}
.canvas-view-menu > summary {
  min-width: 188px;
  height: 42px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  border-radius: 11px;
  color: #34363c;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.canvas-view-menu > summary::-webkit-details-marker {
  display: none;
}
.canvas-view-menu > summary:hover,
.canvas-view-menu[open] > summary {
  background: #f5f6f8;
}
.canvas-view-menu > summary svg {
  flex: 0 0 auto;
  transition: transform 160ms ease;
}
.canvas-view-menu[open] > summary svg {
  transform: rotate(180deg);
}
.canvas-view-popover {
  position: absolute;
  left: -8px;
  bottom: calc(100% + 13px);
  z-index: 80;
  width: 238px;
  padding: 10px 8px;
  display: grid;
  gap: 2px;
  border: 1px solid #eceef2;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 12px 34px rgba(35, 39, 51, 0.16),
    0 2px 8px rgba(35, 39, 51, 0.06);
  backdrop-filter: blur(18px);
}
.canvas-view-popover button {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 0 14px;
  justify-content: flex-start;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #34363c;
  font-size: 16px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}
.canvas-view-popover button:hover,
.canvas-view-popover button.active {
  background: #f2f3f6;
}
.canvas-view-popover button.active {
  color: #34363c !important;
  font-weight: 600;
}
@media (max-width: 1180px) {
  .editor-actions
    .toolbar-select.editor-action-secondary[aria-label="Distribución del mapa"] {
    display: none !important;
  }
}
.insert-library-search {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}
.node-link-preview {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 260px;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid #dfe3eb;
  border-radius: 8px;
  background: #fff;
  color: #536ce0;
  text-decoration: none;
  font-size: 10px;
}
.node-attachment-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.node-attachment-cards a {
  max-width: 160px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #f0f2f8;
  color: #687083;
  font-size: 9px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.node-comment-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #6176eb;
  color: #fff;
  font-size: 9px;
  box-shadow: 0 3px 9px #33418f44;
}
.hide-comment-badges .node-comment-badge,
.hide-node-meta .node-link-preview,
.hide-node-meta .node-attachment-cards {
  display: none;
}
.export-preset-save {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.export-preset-save input {
  min-width: 0;
}

.export-modal {
  display: grid;
  width: min(1080px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  grid-template-columns: minmax(0, 1.16fr) minmax(370px, 0.84fr);
  column-gap: 16px;
  overflow-x: hidden;
  overflow-y: auto;
}

.export-modal > .modal-heading,
.export-modal > .export-format-grid,
.export-modal > .form-error {
  grid-column: 1 / -1;
}

.export-preview-card {
  grid-column: 1;
  display: grid;
  gap: 9px;
  margin-top: 16px;
  border: 1px solid #e3e7ef;
  border-radius: 14px;
  padding: 12px;
  background: #f8f9fc;
}

.export-preview-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #343b49;
  font-size: 12px;
}

.export-preview-card > header span {
  color: #7f8795;
  font-size: 10px;
  font-weight: 650;
}

.export-preview-stage {
  position: relative;
  display: grid;
  height: 330px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dfe3eb;
  border-radius: 11px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #f2f4f8 25%, transparent 25%),
    linear-gradient(-45deg, #f2f4f8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f2f4f8 75%),
    linear-gradient(-45deg, transparent 75%, #f2f4f8 75%);
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
  background-size: 16px 16px;
  touch-action: none;
}

.export-preview-stage > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.export-preview-empty,
.export-preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #7f8795;
  font-size: 11px;
  font-weight: 650;
}

.export-preview-loading {
  position: absolute;
  z-index: 4;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(2px);
}

.export-preview-error {
  color: #b64b5e;
}

.export-modal > .export-settings {
  grid-column: 2;
  align-self: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.export-modal > .export-settings > .check-row,
.export-modal > .export-settings > .export-watermark-panel,
.export-modal > .export-settings > .export-preset-save {
  grid-column: 1 / -1;
}

.export-watermark-toggle {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #e2e6ef;
  border-radius: 12px;
  background: #f7f8fc;
}

.export-watermark-toggle > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.export-watermark-toggle strong {
  color: #343b49;
  font-size: 12px;
}

.export-watermark-toggle small {
  color: #858d9b;
  font-size: 10px;
  font-weight: 600;
}

.export-watermark-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid #dfe4ef;
  border-radius: 14px;
  background: #fafbfe;
}

.export-watermark-panel > .watermark-mode-picker,
.export-watermark-panel > .watermark-text-color,
.export-watermark-panel > .watermark-position-block,
.export-watermark-panel > .watermark-reset-button {
  grid-column: 1 / -1;
}

.watermark-mode-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: #eef1f7;
}

.watermark-mode-picker button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #667082;
  font-size: 11px;
  font-weight: 750;
}

.watermark-mode-picker button.active {
  background: #fff;
  color: #4f68df;
  box-shadow: 0 2px 8px #25305d17;
}

.watermark-text-color {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 8px;
}

.watermark-text-color label,
.export-watermark-panel > label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.watermark-color-field input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 4px;
  border: 1px solid #dce1eb;
  border-radius: 9px;
  background: #fff;
}

.export-watermark-control > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.export-watermark-control strong {
  color: #4f5868;
  font-size: 10px;
}

.export-watermark-control input[type="range"] {
  width: 100%;
}

.watermark-position-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
  align-items: center;
}

.watermark-position-block > span {
  display: grid;
  gap: 3px;
  color: #4f5868;
  font-size: 10px;
}

.watermark-position-block small {
  color: #8a92a1;
  font-size: 9px;
  line-height: 1.35;
}

.watermark-position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 5px;
  border: 1px solid #dce1eb;
  border-radius: 10px;
  background: #fff;
}

.watermark-position-grid button {
  display: grid;
  width: 26px;
  height: 22px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.watermark-position-grid button i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a8afbc;
}

.watermark-position-grid button:hover,
.watermark-position-grid button.active {
  background: #e9edff;
}

.watermark-position-grid button.active i {
  width: 7px;
  height: 7px;
  background: #5873eb;
}

.watermark-reset-button {
  min-height: 34px;
  border: 1px solid #dce1eb;
  border-radius: 9px;
  background: #fff;
  color: #667082;
  font-size: 10px;
  font-weight: 700;
}

.watermark-reset-button:hover {
  border-color: #bfc8ee;
  color: #4f68df;
}

.export-preview-watermark-layer {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  font-weight: 900;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.export-preview-stage:has(.export-preview-watermark-layer.is-single) {
  cursor: grab;
}

.export-preview-stage:has(.export-preview-watermark-layer.is-single):active {
  cursor: grabbing;
}

.export-preview-watermark-layer.is-repeated {
  display: grid;
  align-items: center;
  justify-items: center;
}

.export-preview-watermark-layer.is-repeated span {
  display: block;
}

.export-preview-watermark-single {
  position: absolute;
  display: block;
}

@media (max-width: 760px) {
  .export-modal {
    grid-template-columns: minmax(0, 1fr);
  }

  .export-modal > .export-preview-card,
  .export-modal > .export-settings {
    grid-column: 1;
  }

  .export-modal > .export-settings {
    grid-template-columns: 1fr;
  }

  .export-modal > .export-settings > * {
    grid-column: 1 / -1;
  }

  .export-preview-stage {
    height: 190px;
  }

  .export-preview-card > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

.export-watermark-layer {
  position: absolute;
  z-index: 999999;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  font-weight: 900;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.export-watermark-layer.is-repeated {
  display: grid;
  align-items: center;
  justify-items: center;
}

.export-watermark-layer.is-repeated span {
  display: block;
}

.export-watermark-single {
  position: absolute;
  display: block;
}
.slideshow-order {
  position: absolute;
  z-index: 3;
  left: 22px;
  top: 74px;
  bottom: 44px;
  width: 230px;
  padding: 8px;
  overflow: auto;
  border-radius: 14px;
  background: #111522cc;
  backdrop-filter: blur(12px);
}
.slideshow-order button {
  width: 100%;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 7px;
  align-items: center;
  margin-bottom: 6px;
  padding: 8px;
  border: 1px solid #ffffff1f;
  border-radius: 9px;
  background: #ffffff0c;
  color: #fff;
  text-align: left;
}
.slideshow-order button.active {
  border-color: #8090ff;
  background: #6878e933;
}
.slideshow-order span {
  color: #9ba4b8;
}
.slideshow-order strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.slideshow > section {
  margin-left: 240px;
}
@media (max-width: 900px) {
  .welcome-actions {
    justify-content: flex-start;
  }
  .library-sort-select {
    max-width: none;
  }
  .library-list-view .map-card {
    grid-template-columns: 120px 1fr;
  }
  .collaborator-invite-row {
    grid-template-columns: 1fr;
  }
  .ideas-split-panel {
    width: 280px;
  }
  .editor-shell.split-ideas .react-flow {
    margin-right: 300px;
  }
  .slideshow-order {
    width: 180px;
  }
  .slideshow > section {
    margin-left: 190px;
  }
}
@media (max-width: 650px) {
  .template-filters {
    grid-template-columns: 1fr;
  }
  .library-view-toggle,
  .library-sort-select {
    display: none;
  }
  .library-bulk-bar {
    flex-wrap: wrap;
  }
  .library-bulk-bar strong {
    width: 100%;
  }
  .ideas-split-panel {
    left: 10px;
    right: 10px;
    top: 76px;
    width: auto;
  }
  .editor-shell.split-ideas .react-flow {
    margin-right: 0;
  }
  .slideshow-order {
    display: none;
  }
  .slideshow > section {
    margin-left: 0;
  }
}

/* GitMind-style structural dragging (v35) */
html.mapas-node-dragging,
html.mapas-node-dragging body,
html.mapas-node-dragging .react-flow,
html.mapas-node-dragging .react-flow__pane {
  cursor: grabbing !important;
}

.react-flow__node.mapas-drag-source-node .mind-node,
.react-flow__node.dragging .mind-node {
  opacity: 0 !important;
}

.react-flow__node.mapas-drag-origin-node {
  z-index: 24 !important;
  pointer-events: none !important;
}

.mapas-drag-origin-node .react-flow__resize-control,
.mapas-drag-origin-node .node-drag-cue,
.mapas-drag-origin-node .collapse-node,
.mapas-drag-origin-node button {
  display: none !important;
}

.react-flow__edge.mapas-drag-edge-hidden {
  opacity: 0 !important;
}

.mind-node.mapas-drag-ghost {
  position: fixed !important;
  z-index: 1005 !important;
  top: 0 !important;
  left: 0 !important;
  box-sizing: border-box !important;
  width: var(--drag-width) !important;
  height: var(--drag-height) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  opacity: 0.96 !important;
  pointer-events: none !important;
  transform-origin: center !important;
  will-change: transform;
  filter: drop-shadow(0 12px 24px rgba(35, 40, 52, 0.2));
  transition: none !important;
}

.mind-node.mapas-drag-ghost.mapas-drag-ghost-surface {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-radius: 7px !important;
  box-shadow:
    0 0 0 1px rgba(255, 138, 31, 0.18),
    0 12px 24px rgba(35, 40, 52, 0.16) !important;
}

.mapas-drag-ghost .react-flow__resize-control,
.mapas-drag-ghost .node-drag-cue,
.mapas-drag-ghost .collapse-node,
.mapas-drag-ghost button,
.mapas-drag-ghost input,
.mapas-drag-ghost textarea {
  display: none !important;
}

.mind-node.drop-child {
  border-color: #ff8a1f !important;
  outline: 2px solid rgba(255, 138, 31, 0.72) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px rgba(255, 138, 31, 0.12) !important;
  transform: none !important;
}

.mind-node.drop-before::before,
.mind-node.drop-after::after {
  right: -4px !important;
  left: -4px !important;
  height: 4px !important;
  background: #ff8a1f !important;
  box-shadow: 0 0 0 4px rgba(255, 138, 31, 0.12) !important;
}

.mapas-drop-preview-layer {
  position: fixed;
  z-index: 1002;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 70ms ease;
}

.mapas-drop-preview-layer.active {
  opacity: 1;
}

.mapas-drop-preview-layer > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mapas-drop-preview-path {
  fill: none;
  stroke: #ff8a1f;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mapas-drop-preview-node {
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  width: var(--preview-width, 50px);
  height: var(--preview-height, 20px);
  border: 2px solid #ff8a1f;
  border-radius: 7px;
  background: rgba(255, 138, 31, 0.24);
  box-shadow: 0 3px 10px rgba(255, 138, 31, 0.22);
  will-change: transform;
  transition:
    transform 70ms linear,
    width 70ms linear,
    height 70ms linear;
}

.mapas-drop-preview-layer.mode-before .mapas-drop-preview-node,
.mapas-drop-preview-layer.mode-after .mapas-drop-preview-node {
  border-radius: 999px;
  background: rgba(255, 138, 31, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  .mapas-drop-preview-layer,
  .mapas-drop-preview-node {
    transition: none !important;
  }
}

/* Unified map design inspector (v38) */
.map-style-panel,
.style-panel {
  position: fixed !important;
  z-index: 45 !important;
  top: 82px !important;
  right: 18px !important;
  bottom: 88px !important;
  width: min(460px, calc(100vw - 36px)) !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  box-sizing: border-box;
  overscroll-behavior: contain;
  border: 1px solid #e2e6ef !important;
  border-radius: 18px !important;
  padding-bottom: 26px !important;
  background: #fff !important;
  box-shadow: 0 20px 54px rgba(31, 39, 57, 0.18) !important;
  scrollbar-color: #c8ceda transparent;
  scrollbar-width: thin;
}

.style-panel.design-node-mode > .design-scope-card + .style-label .segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.style-panel.design-node-mode > .toggle-row {
  width: calc(100% - 30px) !important;
  max-width: none !important;
  box-sizing: border-box;
}

.map-style-panel::-webkit-scrollbar,
.style-panel::-webkit-scrollbar {
  width: 8px;
}

.map-style-panel::-webkit-scrollbar-thumb,
.style-panel::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #c8ceda;
  background-clip: padding-box;
}

.map-style-panel > .panel-title,
.style-panel > .panel-title {
  position: sticky;
  z-index: 4;
  top: 0;
  min-height: 70px;
  border-bottom: 1px solid #edf0f5;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.map-style-panel > .panel-title strong,
.style-panel > .panel-title strong {
  color: #252a36;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.design-tabs {
  position: sticky;
  z-index: 3;
  top: 70px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  border-bottom: 1px solid #edf0f5;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.design-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  color: #6b7382;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.design-tabs button:hover {
  color: #405bc7;
  background: #f4f6fd;
}

.design-tabs button.active {
  color: #3f5bd0;
  background: #edf1ff;
  box-shadow: inset 0 0 0 1px #cbd5ff;
}

.design-context-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 14px 15px 4px;
  border: 1px solid #dce5ff;
  border-radius: 11px;
  padding: 10px 11px;
  color: #4964cf;
  background: #f5f7ff;
}

.design-context-banner span,
.design-preset-intro span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.design-context-banner strong,
.design-preset-intro strong {
  color: #343c4e;
  font-size: 11px;
}

.design-context-banner span,
.design-preset-intro span {
  font-size: 10px;
  line-height: 1.4;
}

.design-scope-card {
  display: grid;
  gap: 7px;
  margin: 14px 15px 16px;
  border: 1px solid #dfe5f3;
  border-radius: 12px;
  padding: 11px;
  background: #f8f9fc;
}

.design-scope-card label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.design-scope-card label > span {
  color: #4c5566;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.design-scope-card select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid #dbe0ea;
  border-radius: 9px;
  outline: 0;
  padding: 0 30px 0 10px;
  color: #3d4657;
  background: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
}

.design-scope-card select:focus {
  border-color: #7790ed;
  box-shadow: 0 0 0 3px rgba(91, 124, 250, 0.13);
}

.design-scope-card small {
  color: #858d9b;
  font-size: 9px;
  line-height: 1.45;
}

.design-reset-button {
  display: flex;
  width: calc(100% - 30px);
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #e0e4ec;
  border-radius: 9px;
  margin: 10px 15px 0;
  color: #687181;
  background: #fff;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.design-reset-button:hover {
  border-color: #aebcf0;
  color: #455fc8;
  background: #f6f8ff;
}

.style-panel.design-node-mode > .style-preset-section {
  display: none !important;
}

.style-panel.design-presets-mode
  > *:not(.panel-title):not(.design-tabs):not(.style-preset-section) {
  display: none !important;
}

.style-panel.design-presets-mode .style-preset-section {
  display: grid;
  gap: 14px;
  margin: 18px 15px 0;
  border: 0;
  padding: 0;
}

.design-preset-intro {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #e0e6fb;
  border-radius: 12px;
  padding: 13px;
  color: #526bd0;
  background: linear-gradient(135deg, #f8f9ff, #f2f5ff);
}

.style-preset-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.style-preset-heading > strong {
  color: #343a48;
  font-size: 13px;
}

.design-save-preset {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #526fe0 !important;
  border-radius: 9px !important;
  padding: 0 12px !important;
  color: #fff !important;
  background: #5874df !important;
  box-shadow: 0 5px 14px rgba(70, 94, 194, 0.2);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.design-save-preset:hover {
  background: #4863cf !important;
}

.style-preset-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.style-preset-section > small {
  display: grid;
  min-height: 108px;
  place-items: center;
  border: 1px dashed #d8deee;
  border-radius: 12px;
  padding: 18px;
  color: #858e9f;
  background: #fafbfe;
  text-align: center;
  line-height: 1.5;
}

.style-preset-list > span {
  display: grid;
  grid-template-columns: 1fr 30px;
  overflow: hidden;
  border: 1px solid #e1e5ed;
  border-radius: 10px;
  background: #fff;
}

.style-preset-list > span > button {
  min-width: 0;
  min-height: 42px;
  border: 0;
  padding: 0 10px;
  color: #505a6b;
  background: transparent;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.style-preset-list > span > button:last-child {
  padding: 0;
  color: #9a6570;
  text-align: center;
}

.style-preset-list > span:hover {
  border-color: #9aacf0;
  box-shadow: 0 5px 14px rgba(55, 70, 125, 0.08);
}

.style-fab.active {
  display: none !important;
}

/* Keep the fit/center action independent and visually anchored to the canvas. */
.canvas-center-control {
  position: fixed !important;
  z-index: 46 !important;
  right: auto !important;
  bottom: 17px !important;
  left: 50% !important;
  width: 46px !important;
  min-width: 46px !important;
  height: 46px !important;
  border: 1px solid #e1e5ed !important;
  border-radius: 14px !important;
  color: #687181 !important;
  background: rgba(255, 255, 255, 0.97) !important;
  box-shadow: 0 10px 28px rgba(31, 39, 57, 0.16) !important;
  transform: translateX(-50%) !important;
  backdrop-filter: blur(14px);
}

.canvas-center-control:hover {
  color: #405bc7 !important;
  background: #f7f8ff !important;
}

/* Keep every map-wide switch inside the inspector's content column. */
.map-style-panel .toggle-row {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.map-style-panel > .toggle-row {
  width: calc(100% - 30px) !important;
  margin-right: 15px !important;
  margin-left: 15px !important;
}

.map-style-panel .style-label > .toggle-row {
  width: 100% !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

.map-style-panel .toggle-row > span {
  min-width: 0;
  padding-right: 12px;
}

.map-style-panel .toggle-row > i {
  flex: 0 0 42px;
}

.design-danger-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: calc(100% - 30px);
  margin: 20px 15px 2px;
  border: 1px solid #f1d9dd;
  border-radius: 13px;
  padding: 13px;
  box-sizing: border-box;
  background: #fffafb;
}

.design-danger-zone > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.design-danger-zone strong {
  color: #4b505c;
  font-size: 12px;
}

.design-danger-zone small {
  color: #858b98;
  font-size: 10px;
  line-height: 1.4;
}

.design-danger-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #dfb8c0;
  border-radius: 10px;
  padding: 0 13px;
  color: #9c4355;
  background: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.design-danger-action:hover {
  border-color: #cf8f9d;
  color: #873548;
  background: #fff5f7;
}

/* Avatar crop editor */
.avatar-editor-backdrop {
  position: fixed;
  z-index: 120;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 24px);
  box-sizing: border-box;
  overflow: hidden;
  background: rgba(27, 32, 43, 0.42);
  backdrop-filter: blur(5px);
}

.avatar-editor-dialog {
  display: grid;
  gap: 18px;
  width: min(430px, 100%);
  max-width: 100%;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 20px;
  padding: 18px;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 28px 80px rgba(20, 27, 42, 0.3);
}

.avatar-editor-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.avatar-editor-dialog > header > span {
  display: grid;
  gap: 3px;
}

.avatar-editor-dialog > header strong {
  color: #272d39;
  font-size: 18px;
}

.avatar-editor-dialog > header small {
  color: #7b8392;
  font-size: 11px;
}

.avatar-crop-stage {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  overflow: hidden;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #e9ecf3;
  box-shadow:
    0 0 0 2px #c9d4ff,
    0 14px 34px rgba(41, 50, 73, 0.2);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.avatar-crop-stage:active {
  cursor: grabbing;
}

.avatar-crop-stage > img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  max-height: none;
  pointer-events: none;
  user-select: none;
  will-change: width, height, transform;
}

.avatar-crop-mask {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  pointer-events: none;
}

.avatar-editor-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.avatar-editor-controls > label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  color: #697283;
  font-size: 11px;
  font-weight: 700;
}

.avatar-editor-controls > label strong {
  color: #4d5667;
}

.avatar-editor-controls input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
}

.avatar-center-button {
  min-height: 38px;
  white-space: nowrap;
}

.avatar-editor-error {
  margin: -6px 0 0;
}

.avatar-editor-dialog > footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid #edf0f5;
  padding-top: 15px;
}

.avatar-editor-dialog > footer button {
  min-height: 40px;
}

@media (max-width: 850px) {
  .map-style-panel,
  .style-panel {
    top: 70px !important;
    right: 10px !important;
    bottom: 82px !important;
    width: min(430px, calc(100vw - 20px)) !important;
  }

  .design-danger-zone {
    grid-template-columns: 1fr;
  }

  .design-danger-action {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .avatar-editor-dialog {
    padding: 15px;
  }

  .avatar-crop-stage {
    width: min(240px, calc(100vw - 94px));
    height: min(240px, calc(100vw - 94px));
  }

  .avatar-editor-controls {
    grid-template-columns: 1fr;
  }

  .avatar-center-button {
    width: 100%;
  }

  .avatar-editor-dialog > footer {
    flex-wrap: wrap;
  }

  .avatar-editor-dialog > footer button {
    flex: 1 1 130px;
  }
}
