* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:root {
  --app-header-height: 88px;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: "Space Grotesk", "Inter", "Segoe UI", sans-serif;
  background-color: #fbfbfa;
  background-image: radial-gradient(#e1e1dd 1px, transparent 1px);
  background-size: 28px 28px;
  color: #2f3437;
  min-height: 100vh;
  user-select: none;
  overflow: hidden;
}

input:focus,
textarea:focus,
select:focus,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: none;
}

.mobile-blocker {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(251, 251, 250, 0.98);
  z-index: 9999;
}

.mobile-blocker-card {
  width: min(360px, 90vw);
  padding: 22px;
  border-radius: 16px;
  border: 1.5px solid #c9c9c3;
  background: #ffffff;
  box-shadow: 0 18px 32px rgba(60, 60, 67, 0.16);
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.mobile-blocker-card img {
  width: 52px;
  height: 52px;
}

.mobile-blocker-card h1 {
  font-size: 20px;
  color: #2f3437;
}

.mobile-blocker-card p {
  font-size: 13px;
  color: #6b6b6b;
}

body.is-mobile-blocked .mobile-blocker {
  display: flex;
}

body.is-mobile-blocked {
  overflow: hidden;
}

body.is-mobile-blocked > :not(.mobile-blocker) {
  display: none !important;
}

body.is-auth-loading .app-header,
body.is-auth-loading .dashboard,
body.is-auth-loading .login-layout,
body.is-auth-loading #toast {
  visibility: hidden;
}

.auth-loading {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fbfbfa;
  background-image: radial-gradient(#e1e1dd 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 50;
}

.auth-loading-logo {
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  animation: none;
}

.auth-loading-title {
  font-size: 17px;
  font-weight: 600;
  color: #2f3437;
  letter-spacing: -0.2px;
}

.auth-loading-subtitle {
  margin-top: 5px;
  font-size: 13px;
  color: #6b6b6b;
}

.auth-loading-dots {
  margin-top: 32px;
  display: flex;
  gap: 7px;
  align-items: center;
}

.auth-loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2f3437;
  animation: auth-dot-bounce 1.4s ease-in-out infinite;
}

.auth-loading-dots span:nth-child(2) { animation-delay: 0.18s; }
.auth-loading-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes auth-dot-bounce {
  0%, 60%, 100% { opacity: 0.2; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-6px); }
}

body.is-auth-loading .auth-loading {
  display: flex;
}

.dashboard-body {
  background-image: none;
  background-color: #fbfbfa;
  user-select: text;
  overflow: auto;
}

.settings-body {
  user-select: text;
  overflow: auto;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  position: relative;
  z-index: 20;
}

.editor-body .app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

.map-title {
  font-size: 20px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 10px;
  background: #f7f7f5;
  border: 1.5px solid #c9c9c3;
  box-shadow: 0 8px 16px rgba(60, 60, 67, 0.12);
  color: #2f3437;
  font-family: inherit;
  height: 34px;
  display: flex;
  align-items: center;
  font-weight: 600;
}

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

.app-brand {
  font-size: 18px;
  font-weight: 600;
  color: #2f3437;
  margin: 0;
}

.icon-link {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid #c9c9c3;
  background: #f7f7f5;
  color: #2f3437;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 8px 16px rgba(60, 60, 67, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.icon-link-img {
  width: 18px;
  height: 18px;
  display: block;
}

.icon-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(60, 60, 67, 0.18);
  background: #ffffff;
}

.icon-link:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(60, 60, 67, 0.16);
}

.app-logo {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1.5px solid #c9c9c3;
  background: #f7f7f5;
  padding: 2px;
  box-shadow: 0 6px 12px rgba(60, 60, 67, 0.12);
  object-fit: contain;
}

.app-logo.plain {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  width: 36px;
  height: 36px;
}

.app-header p {
  color: #6b6b6b;
  font-size: 13px;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-right: 0;
}

.header-search {
  --search-width: 200px;
  --search-gap: 6px;
  --search-toggle-size: 34px;
  --search-icon-shift-x: 0px;
  --search-icon-shift-y: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: var(--search-toggle-size);
}

.header-search .search-field {
  display: inline-flex;
  align-items: center;
  position: relative;
  margin-left: 0;
  width: 0;
  max-width: 0;
  opacity: 0;
  transform: translateX(-6px);
  overflow: hidden;
  pointer-events: none;
  transition:
    width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    max-width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.12s ease,
    transform 0.12s ease,
    margin-left 0.12s ease;
}

.header-search .search-field input {
  width: 100%;
  height: 34px;
  border: 1.5px solid #c9c9c3;
  border-radius: 8px;
  padding: 6px 52px 6px 10px;
  font-size: 12px;
  font-family: inherit;
  background: #ffffff;
  color: #2f3437;
}

.header-search .search-meta {
  position: absolute;
  left: calc(var(--search-toggle-size) + var(--search-gap));
  top: calc(100% + 6px);
  margin-top: 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.header-search.is-open .search-field {
  margin-left: var(--search-gap);
  width: var(--search-width);
  max-width: var(--search-width);
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  transition-delay: 0.12s, 0.12s, 0s, 0s, 0.12s;
}

.search-nav {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%) scale(0.96);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.search-nav-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #c9c9c3;
  background: #f7f7f5;
  color: #2f3437;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.search-nav-icon {
  display: block;
  width: 14px;
  height: 12px;
}

.search-nav-icon-right {
  transform: scaleX(-1);
}

.search-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.header-search.is-open .search-nav {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
  transition-delay: 0.12s;
}

.header-search.is-open .search-meta {
  opacity: 1;
  transform: translateY(0);
}

.search-toggle {
  position: relative;
  width: var(--search-toggle-size);
  height: var(--search-toggle-size);
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.search-icon {
  width: 14px;
  height: 14px;
  display: block;
  transform: translate(var(--search-icon-shift-x), var(--search-icon-shift-y));
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.search-toggle .ai-btn-close {
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.header-search.is-open .search-toggle .search-icon {
  opacity: 0;
  transform: translate(var(--search-icon-shift-x), calc(var(--search-icon-shift-y) - 6px)) scale(0.9);
  transition-delay: 0s;
}

.header-search.is-open .search-toggle .ai-btn-close {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.26s;
}

.header-search:not(.is-open) .search-field {
  transition-delay: 0.14s, 0.14s, 0.28s, 0.28s, 0.28s;
}

.header-search:not(.is-open) .search-toggle .search-icon {
  transition-delay: 0.28s;
}

.header-search:not(.is-open) .search-toggle .ai-btn-close {
  transition-delay: 0s;
}

@media (max-width: 1180px) {
  .header-actions {
    flex-wrap: wrap;
    row-gap: 8px;
    justify-content: flex-end;
  }

  .header-search {
    --search-width: 160px;
  }
}

@media (max-width: 980px) {
  .app-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.header-actions a.ghost {
  font-size: 12px;
}

body.is-pro #upgradePlanLink {
  display: none !important;
}

.auth-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-status {
  font-size: 12px;
  color: #6b6b6b;
}

.save-status {
  font-size: 12px;
  color: #6b6b6b;
}

.selection-status {
  font-size: 12px;
  color: #2f3437;
  background: #f7f7f5;
  border: 1.5px solid #c9c9c3;
  border-radius: 999px;
  padding: 4px 8px;
  line-height: 1;
}

.connection-status {
  font-size: 12px;
  color: #185a9f;
  background: #e8f2ff;
  border: 1.5px solid #9ac3f5;
  border-radius: 999px;
  padding: 4px 8px;
  line-height: 1;
}

.auth-status:empty {
  display: none;
}

.save-status:empty {
  display: none;
}

.selection-status:empty {
  display: none;
}

.connection-status:empty {
  display: none;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

button,
button * {
  user-select: none;
  -webkit-user-select: none;
}

button,
a,
.ghost,
.icon-btn,
.profile-btn,
.toolbar button,
.node-menu button {
  touch-action: manipulation;
}

.toolbar,
.toolbar *,
.node-menu,
.node-menu * {
  user-select: none;
  -webkit-user-select: none;
}

.toolbar input,
.toolbar textarea,
.node-menu input,
.node-menu textarea {
  user-select: text;
  -webkit-user-select: text;
}


.workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 88px);
}

.editor-body .workspace {
  display: block;
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
}

.toolbar {
  --control-height: 34px;
  --control-radius: 8px;
  --control-gap: 8px;
  --control-font: 12px;
  background: #f7f7f5;
  border: 1.5px solid #cfcfc9;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: width 0.2s ease, padding 0.2s ease, border-color 0.2s ease;
  z-index: 15;
  margin: 18px 0 18px 28px;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(60, 60, 67, 0.12);
  user-select: none;
}

.editor-body .toolbar {
  position: fixed;
  top: calc(var(--app-header-height) + 2px);
  left: 28px;
  width: 252px;
  height: calc(100vh - var(--app-header-height) - 26px);
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 158, 153, 0.72) rgba(241, 241, 238, 0.74);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.55s ease;
}

.editor-body .toolbar::-webkit-scrollbar {
  width: 10px;
}

.editor-body .toolbar::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(244, 244, 241, 0.82), rgba(236, 236, 232, 0.78));
  border-radius: 999px;
}

.editor-body .toolbar::-webkit-scrollbar-thumb {
  min-height: 40px;
  background: rgba(161, 163, 158, 0.8);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.editor-body .toolbar::-webkit-scrollbar-thumb:hover {
  background: rgba(146, 148, 143, 0.84);
}

.editor-body .toolbar::-webkit-scrollbar-thumb:active {
  background: rgba(128, 130, 125, 0.9);
}

.toolbar-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 5;
}

.toolbar-toggle-icon {
  display: block;
  width: 100%;
  height: 100%;
}

.toolbar-show {
  position: fixed;
  top: calc(var(--app-header-height) + 12px);
  left: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1.5px solid #cfcfc9;
  background: #f7f7f5;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 10px 20px rgba(60, 60, 67, 0.2);
  cursor: pointer;
  opacity: 0;
  transform: translateX(-12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 17;
}

.toolbar-show .toolbar-toggle-icon {
  width: 22px;
  height: 22px;
  margin: 0 auto;
}

body.toolbar-hidden .toolbar-show {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  transition-delay: 0.5s;
}

body.toolbar-showing .toolbar-show {
  opacity: 0;
  transform: translateX(-12px);
  transition-delay: 0s;
  pointer-events: none;
}

.toolbar.hidden {
  width: 0;
  padding: 0;
  border-color: transparent;
  overflow: hidden;
}

.editor-body .toolbar.hidden {
  width: 252px;
  padding: 16px;
  border-color: #cfcfc9;
  overflow: visible;
  transform: translateX(calc(-100% - 28px));
  opacity: 0;
  pointer-events: none;
}

.workspace.toolbar-hidden {
  grid-template-columns: 0 1fr;
}

.editor-body .canvas-wrap {
  position: absolute;
  inset: 0;
}



.section h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  color: #6b6b6b;
}

.section {
  display: flex;
  flex-direction: column;
  gap: var(--control-gap);
}

.section > button {
  width: 100%;
  height: var(--control-height);
  padding: 8px 12px;
  border-radius: var(--control-radius);
  border: 1.5px solid #c9c9c3;
  background: #ffffff;
  color: #2f3437;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  font-size: var(--control-font);
  margin-bottom: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.section > button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 18px rgba(60, 60, 67, 0.14);
  background: #ffffff;
}

.section > button:active {
  transform: translateY(0);
  box-shadow: 0 8px 12px rgba(60, 60, 67, 0.12);
}

.section > button:last-child {
  margin-bottom: 0;
}

.section > button.danger {
  background: #fff1f0;
  border-color: #f2c7c4;
  color: #b42318;
}

.section label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #6b6b6b;
  margin-bottom: 0;
}

.file-input {
  position: relative;
  border: 1.5px solid #c9c9c3;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  color: #2f3437;
  background: #ffffff;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  overflow: hidden;
}

.toolbar .file-input,
.toolbar .file-input.icon {
  width: 100%;
  height: var(--control-height);
  border-radius: var(--control-radius);
  font-size: var(--control-font);
}

.file-input:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 18px rgba(60, 60, 67, 0.14);
  background: #ffffff;
}

.file-input:active {
  transform: translateY(0);
  box-shadow: 0 8px 12px rgba(60, 60, 67, 0.12);
}

.file-input.icon {
  justify-content: flex-start;
  padding: 6px 8px;
  font-size: 11px;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  column-gap: 10px;
  color: #2f3437;
}

.node-menu .file-input.icon {
  width: 100%;
  display: grid;
  justify-content: flex-start;
  text-align: left;
  grid-template-columns: 20px 1fr;
  column-gap: 10px;
  padding: 7px 10px;
  font-size: 12px;
  color: #2f3437;
}

.node-menu .file-input.icon .icon-glyph {
  width: 16px;
  height: 16px;
}

.file-input.icon .icon-glyph {
  width: 19px;
  height: 19px;
  display: inline-block;
}

.file-input.inline {
  align-self: flex-start;
}

.file-input input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-label-text {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section input[type="text"],
.section textarea {
  border: 1.5px solid #c9c9c3;
  border-radius: var(--control-radius);
  padding: 6px 8px;
  font-size: var(--control-font);
  font-family: inherit;
  background: #ffffff;
  color: #2f3437;
  height: var(--control-height);
}

.section textarea {
  resize: vertical;
  min-height: var(--control-height);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-field input {
  flex: 1;
  min-width: 0;
}

.search-meta {
  margin-top: 4px;
  font-size: 11px;
  color: #6b6b6b;
  min-height: 14px;
}


.mindmap-node.search-match {
  outline: 2px dashed rgba(47, 52, 55, 0.45);
  outline-offset: 4px;
}

.mindmap-node.search-current {
  outline: 3px solid rgba(15, 23, 42, 0.8);
  outline-offset: 5px;
  box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.28), 0 16px 30px rgba(15, 23, 42, 0.2);
  transform: translate(-50%, -50%) scale(1.05);
  z-index: 3;
}

.mindmap-node.search-current .label {
  font-weight: 700;
}

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

.size-control {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.size-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid #c9c9c3;
  background: #f7f7f5;
  color: #2f3437;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 14px rgba(60, 60, 67, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.size-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 18px rgba(60, 60, 67, 0.16);
  background: #ffffff;
}

.size-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 12px rgba(60, 60, 67, 0.12);
}

.size-value {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 1.5px solid #c9c9c3;
  border-radius: 8px;
  padding: 0 6px;
  font-size: 12px;
  font-family: inherit;
  background: #ffffff;
  color: #2f3437;
  text-align: center;
  line-height: 34px;
}

.size-value::-webkit-outer-spin-button,
.size-value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.size-value[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.link-field input {
  flex: 1;
  min-width: 0;
  height: var(--control-height);
}

.link-field .ghost {
  height: var(--control-height);
  padding: 8px 12px;
  white-space: nowrap;
}

.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.is-disabled .color-trigger,
.is-disabled .custom-select,
.is-disabled .file-input {
  pointer-events: none;
}

.is-disabled .color-trigger:hover,
.is-disabled .custom-select .select-trigger:hover,
.is-disabled .file-input:hover {
  transform: none;
  box-shadow: none;
  background: inherit;
}

.custom-select.is-disabled .select-trigger,
.custom-select.is-disabled .select-trigger:hover {
  pointer-events: none;
  transform: none;
  box-shadow: none;
  background: #ffffff;
}

.is-disabled:hover,
.is-disabled:active {
  transform: none;
  box-shadow: none;
}

.custom-select {
  position: relative;
}

.custom-select .select-trigger {
  width: 100%;
  border: 1.5px solid #c9c9c3;
  border-radius: 8px;
  padding: 6px 32px 6px 10px;
  background: #ffffff;
  font-size: 12px;
  color: #2f3437;
  text-align: left;
  cursor: pointer;
  position: relative;
  font-family: inherit;
}

.toolbar .custom-select .select-trigger {
  height: var(--control-height);
  border-radius: var(--control-radius);
  font-size: var(--control-font);
  display: flex;
  align-items: center;
}

.node-menu .custom-select .select-trigger {
  height: var(--control-height);
  border-radius: var(--control-radius);
  font-size: var(--control-font);
  display: flex;
  align-items: center;
}

.custom-select .select-trigger::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'%3E%3Cpath fill='%236b6b6b' d='M5.5 7.5L10 12l4.5-4.5'/%3E%3C/svg%3E") no-repeat center;
  background-size: 12px;
}

.custom-select .select-options {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 1px);
  background: #ffffff;
  border: 1.5px solid #c9c9c3;
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 12px 24px rgba(60, 60, 67, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
}

.custom-select.open .select-options {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.custom-select .select-options button {
  border: none;
  background: transparent;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: #2f3437;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.custom-select .select-options button:hover,
.custom-select .select-options button.active {
  background: rgba(0, 0, 0, 0.06);
}

.section input[type="range"],
.node-menu input[type="range"],
.export-menu input[type="range"] {
  accent-color: #b8b8b2;
  height: 6px;
  width: 100%;
}

.section input[type="range"]::-webkit-slider-thumb,
.node-menu input[type="range"]::-webkit-slider-thumb,
.export-menu input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f7f7f5;
  border: 1.5px solid #c9c9c3;
}

.section input[type="range"]::-moz-range-thumb,
.node-menu input[type="range"]::-moz-range-thumb,
.export-menu input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f7f7f5;
  border: 1.5px solid #c9c9c3;
}

.color-select {
  position: relative;
  display: inline-flex;
  align-self: flex-start;
  width: fit-content;
}

.color-trigger {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid #c4c4be;
  background: #4f46e5;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-trigger .color-dot {
  display: none;
}

.color-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  background: #ffffff;
  border: 1.5px solid #c9c9c3;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 12px 24px rgba(60, 60, 67, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
  display: flex;
  flex-direction: column;
}

.color-select.open .color-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.color-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-section + .color-section {
  margin-top: 8px;
}

.color-title {
  font-size: 11px;
  color: #6b6b6b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.color-grid button {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid #c9c9c3;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.color-grid button.selected {
  outline: 2px solid #2f3437;
  outline-offset: 2px;
}

.color-picker {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid #c9c9c3;
  background: conic-gradient(
    #ff3b30,
    #ff9500,
    #ffcc00,
    #34c759,
    #5ac8fa,
    #007aff,
    #af52de,
    #ff3b30
  );
  cursor: pointer;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
  background: transparent;
}

.color-picker::-moz-color-swatch {
  border: none;
  border-radius: 6px;
  background: transparent;
}

.color-grid button:hover,
.color-trigger:hover,
.color-picker:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 18px rgba(60, 60, 67, 0.14);
}

.color-edit-btn {
  margin-top: 6px;
  align-self: flex-end;
  font-size: 11px;
  color: #bdbdb7;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
  display: inline;
  width: auto;
}

.color-edit-btn:hover {
  text-decoration: underline;
  color: #2e3437;
}

.section .color-edit-btn,
.node-menu .color-edit-btn {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  color: #bdbdb7;
  font-weight: 500;
}

.section .color-edit-btn:hover,
.node-menu .color-edit-btn:hover {
  transform: none;
  box-shadow: none;
  background: transparent;
  color: #2e3437;
}

.color-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #ffffff;
  color: #2f3437;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 1px solid #c9c9c3;
}

.color-select.editing .color-grid button.is-removable .color-remove {
  display: flex;
}

.section ul {
  list-style: disc;
  padding-left: 18px;
  font-size: 12px;
  color: #6b6b6b;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.header-dropdown {
  position: relative;
  display: inline-flex;
}

.header-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #ffffff;
  border: 1.5px solid #c9c9c3;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 12px 24px rgba(60, 60, 67, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
  width: 260px;
}

.header-dropdown.open .header-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.header-menu h3 {
  font-size: 13px;
  color: #2f3437;
  margin-bottom: 8px;
}

.header-menu ul {
  list-style: disc;
  padding-left: 18px;
  font-size: 12px;
  color: #6b6b6b;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.export-menu {
  width: 280px;
  background: #fbfbfa;
}

.export-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.export-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.export-label {
  font-size: 12px;
  color: #6b6b6b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.export-options {
  display: flex;
  gap: 8px;
}

.export-option {
  flex: 1 1 0;
  border: 1.5px solid #c9c9c3;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 500;
  background: #f7f7f5;
  color: #2f3437;
  cursor: pointer;
  font-family: inherit;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(60, 60, 67, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.export-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 22px rgba(60, 60, 67, 0.18);
  background: #ffffff;
}

.export-option.is-active {
  background: #ffffff;
  border-color: #a8a8a1;
  box-shadow: inset 0 0 0 1px rgba(47, 52, 55, 0.06), 0 8px 14px rgba(60, 60, 67, 0.16);
}

.export-center {
  padding: 4px 8px;
  font-size: 11px;
  height: auto;
}

.export-preview {
  border: none;
  border-radius: 12px;
  background: transparent;
  padding: 0;
}

.export-paper {
  width: 100%;
  aspect-ratio: 210 / 297;
  background: #ffffff;
  border: 1.5px solid #c9c9c3;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
  position: relative;
  overflow: hidden;
  cursor: grab;
}

.export-paper.landscape {
  aspect-ratio: 297 / 210;
}

.export-paper.dragging {
  cursor: grabbing;
}

.export-preview-map {
  position: absolute;
  inset: 0;
  transform-origin: top left;
  pointer-events: none;
}

.export-scale-value {
  font-size: 11px;
  color: #6b6b6b;
}

.toolbar .section {
  padding-bottom: 14px;
  border-bottom: 1px solid #e6e6e3;
}

.toolbar .section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.canvas-wrap {
  position: relative;
  overflow: hidden;
}

.canvas {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: grab;
  z-index: 1;
  touch-action: none;
}

.canvas.panning {
  cursor: grabbing;
}

.canvas-inner {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  overflow: visible;
}

.canvas-inner.ai-fade {
  opacity: 0;
  transition: opacity 650ms ease;
}

.canvas-inner.ai-fade.ai-fade-visible {
  opacity: 1;
}

.links {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}

.link {
  stroke: #a1a1aa;
  stroke-width: 2;
  transition: stroke 0.2s ease, opacity 0.2s ease;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link.highlight {
  stroke: #007aff;
  stroke-width: 3;
}

.link.dim {
  opacity: 0.3;
}

.mindmap-node {
  position: absolute;
  padding: 10px 18px;
  min-width: 120px;
  width: max-content;
  cursor: grab;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 20px rgba(60, 60, 67, 0.15);
  overflow: visible;
}

.mindmap-node.image-node {
  padding: 0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.mindmap-node.image-node img {
  width: 100%;
  height: var(--image-height, 120px);
  object-fit: contain;
  display: block;
  background: transparent;
  border-radius: 8px 8px 0 0;
}

.mindmap-node.image-node .label {
  position: static;
  background: #f7f7f5;
  color: #2f3437;
  padding: 6px 8px;
  font-size: 12px;
  border-top: none;
  text-align: center;
  z-index: 1;
  white-space: normal;
  word-break: break-word;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  overflow: hidden;
}

.mindmap-node.image-node .resize-handle {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #9cc9f8;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  opacity: 0;
  cursor: nwse-resize;
  z-index: 2;
}

.mindmap-node.image-node .resize-handle::before {
  content: "";
}

.mindmap-node.image-node.selected .resize-handle {
  opacity: 1;
}

.mindmap-node:active {
  cursor: grabbing;
}

.mindmap-node.selected {
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.35), 0 14px 30px rgba(0, 122, 255, 0.4);
  transform: translate(-50%, -50%) scale(1.03);
}

.mindmap-node.hovered:not(.selected) {
  box-shadow: 0 10px 22px rgba(60, 60, 67, 0.2);
  transform: translate(-50%, -50%) scale(1.02);
}

.mindmap-node.connect-source {
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.45), 0 16px 30px rgba(0, 122, 255, 0.35);
}

.mindmap-node.connect-target {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.45), 0 10px 20px rgba(34, 197, 94, 0.18);
  cursor: copy;
}

.mindmap-node.connect-target:hover {
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.55), 0 14px 24px rgba(34, 197, 94, 0.24);
}

.mindmap-node.connect-disabled {
  opacity: 0.55;
}

.mindmap-node .label {
  outline: none;
  user-select: none;
  cursor: inherit;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: anywhere;
  text-align: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 2px 6px;
  pointer-events: none;
}

.mindmap-node,
.mindmap-node * {
  user-select: none;
  -webkit-user-select: none;
}

.mindmap-node.has-link .label {
  position: relative;
  padding-right: 26px;
}

.mindmap-node.has-link .label::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-color: currentColor;
  mask: url("assets/link_icon.svg") no-repeat center / contain;
  -webkit-mask: url("assets/link_icon.svg") no-repeat center / contain;
  opacity: 1;
}

.pill {
  border-radius: 999px;
}

.rounded {
  border-radius: 14px;
}

.ghost {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid #c9c9c3;
  background: #f7f7f5;
  cursor: pointer;
  font-weight: 500;
  color: #2f3437;
  font-family: inherit;
  text-decoration: none;
  box-shadow: 0 10px 18px rgba(60, 60, 67, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ghost.is-loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.ghost.is-loading::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: ghostSpinner 0.8s linear infinite;
}

.ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 22px rgba(60, 60, 67, 0.18);
  background: #ffffff;
}

.ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.ghost:active {
  transform: translateY(0);
  box-shadow: 0 8px 14px rgba(60, 60, 67, 0.16);
}

.ghost.danger {
  background: #fff1f0;
  border-color: #f2c7c4;
  color: #b42318;
}

/* Keep the left-toolbar Ask Mappy AI action visually flat like other toolbar buttons. */
.toolbar #askAiBtn.ghost {
  background: #ffffff;
  box-shadow: none;
}

.toolbar #askAiBtn.ghost:hover,
.toolbar #askAiBtn.ghost:active {
  box-shadow: none;
}

@media print {
  .app-header,
  .toolbar,
  .node-menu {
    display: none !important;
  }

  body {
    background: #ffffff !important;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .canvas-wrap {
    overflow: visible;
  }

  @page {
    margin: 0;
  }

  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

.icon-btn {
  font-size: 16px;
  line-height: 1;
  padding: 8px;
  width: 34px;
  height: 34px;
}

.icon-btn .icon-glyph {
  width: 18px;
  height: 18px;
  display: block;
}


.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2f3437;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  font-size: 13px;
}

.editor-body .toast {
  top: calc(var(--app-header-height) + 12px);
  bottom: auto;
  right: 28px;
}

@media (max-width: 980px) {
  .editor-body .toast {
    top: auto;
    bottom: 20px;
    right: 20px;
  }
}


.node-menu {
  position: absolute;
  --control-height: 34px;
  --control-radius: 8px;
  --control-gap: 8px;
  --control-font: 12px;
  background: #f7f7f5;
  border: 1.5px solid #cfcfc9;
  border-radius: var(--control-radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: var(--control-gap);
  box-shadow: 0 12px 24px rgba(60, 60, 67, 0.16);
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
  width: min(150px, 80vw);
}

.node-menu.show {
  opacity: 1;
  transform: translateY(-50%);
  pointer-events: auto;
}

.node-menu > button {
  border: 1.5px solid #c9c9c3;
  background: #ffffff;
  padding: 8px 10px;
  border-radius: var(--control-radius);
  font-size: var(--control-font);
  font-weight: 500;
  min-height: var(--control-height);
  height: auto;
  color: #2f3437;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  line-height: 1.25;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.node-menu > button:hover,
.node-menu .link-field .ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 18px rgba(60, 60, 67, 0.14);
  background: #ffffff;
  color: #2f3437;
}

.node-menu > button:active,
.node-menu .link-field .ghost:active {
  transform: translateY(0);
  box-shadow: 0 8px 12px rgba(60, 60, 67, 0.12);
}

.node-menu > button.is-active {
  background: #e8f2ff;
  border-color: #9ac3f5;
  color: #185a9f;
}

.node-menu > button.danger {
  background: #fff1f0;
  border-color: #f2c7c4;
  color: #b42318;
}

.node-menu .menu-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: var(--control-font);
  color: #6b6b6b;
  margin: 0;
}

.node-menu input[type="text"],
.node-menu textarea {
  border: 1.5px solid #c9c9c3;
  border-radius: var(--control-radius);
  padding: 6px 8px;
  font-size: var(--control-font);
  height: var(--control-height);
  font-family: inherit;
  background: #ffffff;
  color: #2f3437;
}

.node-menu textarea {
  resize: vertical;
  min-height: var(--control-height);
}

.node-menu .color-trigger {
  width: 22px;
  height: 22px;
}

.node-menu .file-input.icon {
  height: var(--control-height);
  padding: 6px 8px;
  font-size: var(--control-font);
  border-radius: var(--control-radius);
}

.node-menu .link-field input,
.node-menu .link-field .ghost {
  height: var(--control-height);
  font-size: var(--control-font);
}

.node-menu .link-field .ghost {
  padding: 8px 10px;
  white-space: nowrap;
}

#menuNodeSizeValue {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}

.node-menu input[type="range"] {
  width: 100%;
}


.toast.show {
  opacity: 1;
}

.ai-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(#f7f7f5, #f7f7f5) padding-box,
    linear-gradient(60deg, #8fb8ff, #a9c6ff, #ffb8c6, #ffdd7a, #ace8dc, #a9c6ff) border-box;
  background-size: 100% 100%, 240% 240%;
  background-position: 0 0, 0% 50%;
  cursor: pointer;
  font-weight: 500;
  color: #2f3437;
  font-family: inherit;
  box-shadow: 0 10px 18px rgba(60, 60, 67, 0.12);
  z-index: 10;
  min-height: 42px;
  min-width: 42px;
  isolation: isolate;
  animation: aiBorderShift 10s ease-in-out infinite;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: visible;
  transition: padding 0.28s cubic-bezier(0.22, 1, 0.36, 1), gap 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-btn.is-disabled {
  pointer-events: auto;
  cursor: pointer;
}

.ai-upsell {
  position: fixed;
  right: 24px;
  bottom: 80px;
  width: min(260px, 80vw);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid #c9c9c3;
  background: #ffffff;
  box-shadow: 0 16px 28px rgba(60, 60, 67, 0.16);
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 55;
}

.ai-upsell.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ai-upsell p {
  font-size: 12px;
  color: #6b6b6b;
  line-height: 1.4;
}

.ai-upsell .ghost {
  width: 100%;
}

.ai-btn.is-disabled:hover + .ai-upsell,
.ai-btn.is-disabled:focus-visible + .ai-upsell,
.ai-upsell:hover,
.ai-upsell:focus-within {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}


.ai-btn-text {
  display: inline-flex;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  transition: opacity 0.12s ease, transform 0.12s ease, max-width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-btn-close {
  position: absolute;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.modal .ai-btn-close {
  position: relative;
  opacity: 1;
  transform: scale(1);
}

.ai-btn-close::before,
.ai-btn-close::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.ai-btn-close::before {
  transform: rotate(45deg);
}

.ai-btn-close::after {
  transform: rotate(-45deg);
}

.ai-btn.is-open .ai-btn-text {
  opacity: 0;
  transform: translateY(-6px) scale(0.9);
  max-width: 0;
}

.ai-btn.is-open .ai-btn-close {
  opacity: 1;
  transform: scale(1);
}

.ai-btn.is-open {
  padding: 0;
  gap: 0;
}

.ai-btn.is-open {
  transition-delay: 0.12s;
}

.ai-btn.is-open .ai-btn-text {
  transition-delay: 0s, 0s, 0.12s;
}

.ai-btn.is-open .ai-btn-close {
  transition-delay: 0.26s;
}

.ai-btn:not(.is-open) {
  transition-delay: 0.14s;
}

.ai-btn:not(.is-open) .ai-btn-text {
  transition-delay: 0.28s, 0.28s, 0.14s;
}

.ai-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 22px rgba(60, 60, 67, 0.18);
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(60deg, #8fb8ff, #a9c6ff, #ffb8c6, #ffdd7a, #ace8dc, #a9c6ff) border-box;
  background-size: 100% 100%, 240% 240%;
  background-position: 0 0, 0% 50%;
  animation-duration: 4s;
}


.ai-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 14px rgba(60, 60, 67, 0.16);
}

.ai-modal[hidden] {
  display: none;
}

.ai-modal {
  position: fixed;
  right: 24px;
  bottom: 90px;
  width: min(420px, 92vw);
  height: min(72vh, 640px);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ai-modal.open {
  opacity: 1;
  transform: translateY(0);
}

.ai-modal-card {
  position: relative;
  width: 100%;
  max-height: 100%;
  background: #f7f7f5;
  border: 1.5px solid transparent;
  background:
    linear-gradient(#f7f7f5, #f7f7f5) padding-box,
    linear-gradient(60deg, #8fb8ff, #a9c6ff, #ffb8c6, #ffdd7a, #ace8dc, #a9c6ff) border-box;
  background-size: 100% 100%, 240% 240%;
  background-position: 0 0, 0% 50%;
  animation: aiBorderShift 10s ease-in-out infinite;
  border-radius: 18px;
  box-shadow: 0 18px 32px rgba(60, 60, 67, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ai-modal.open .ai-modal-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ai-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e6e6e3;
  background: #fbfbfa;
}

.ai-modal-header h3 {
  font-size: 18px;
  color: #2f3437;
  margin-bottom: 4px;
}

.ai-modal-header p {
  font-size: 12px;
  color: #6b6b6b;
}

.ai-chat {
  flex: 1;
  padding: 16px 18px;
  background: #fbfbfa;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-empty {
  border: 1.5px dashed #d6d2c8;
  border-radius: 14px;
  padding: 12px 14px;
  color: #6b6b6b;
  font-size: 12px;
  display: grid;
  gap: 8px;
  background: #ffffff;
}

.ai-empty strong {
  color: #2f3437;
  font-size: 13px;
}

.ai-empty ul {
  list-style: none;
  display: grid;
  gap: 6px;
}

.ai-thinking {
  font-style: italic;
  color: #6b6b6b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.ai-typing-text {
  font-size: 13px;
}

.ai-new-message {
  align-self: center;
  margin: 6px auto 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid #c9c9c3;
  background: #ffffff;
  font-size: 11px;
  color: #2f3437;
  box-shadow: 0 8px 14px rgba(60, 60, 67, 0.08);
  cursor: pointer;
}

.ai-new-message:active {
  transform: translateY(1px);
}

.ai-message {
  max-width: 72%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid #c9c9c3;
  font-size: 13px;
  color: #2f3437;
  background: #ffffff;
  box-shadow: 0 8px 14px rgba(60, 60, 67, 0.08);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  animation: aiMessageIn 0.18s ease-out;
  transform-origin: top left;
  will-change: transform, opacity;
}

.ai-message a.ai-source-link {
  color: #2f3437;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.ai-dots span {
  display: inline-block;
  animation: aiDotPulse 1s infinite;
}

.ai-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes aiDotPulse {
  0%,
  80%,
  100% {
    opacity: 0.2;
  }
  40% {
    opacity: 1;
  }
}

.ai-message.user {
  align-self: flex-end;
  background: #f7f7f5;
}

@keyframes aiMessageIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-message.assistant {
  align-self: flex-start;
}

.ai-controls {
  padding: 12px 16px;
  border-top: 1px solid #e6e6e3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f7f5;
}

.ai-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.ai-controls .file-input.icon {
  column-gap: 6px;
  padding: 5px 8px;
  font-size: 10px;
}

.ai-link-input {
  flex: 1 1 240px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.ai-link-input input {
  flex: 1 1 auto;
  border: 1.5px solid #c9c9c3;
  border-radius: 8px;
  height: 34px;
  padding: 0 8px;
  font-size: 11px;
  font-family: inherit;
  background: #ffffff;
  color: #2f3437;
}

.ai-link-input .ghost {
  padding: 6px 10px;
  font-size: 11px;
}

.ai-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1.5px solid #c9c9c3;
  background: #ffffff;
  font-size: 11px;
  color: #2f3437;
}

.ai-chip-label {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-chip-status {
  font-size: 10px;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid #c9c9c3;
  padding: 2px 6px;
  color: #5e6468;
  background: #f4f4f2;
}

.ai-chip-status[data-status="loaded"] {
  border-color: #b7d7bf;
  background: #edf8f0;
  color: #2f6a3f;
}

.ai-chip-status[data-status="processing"] {
  border-color: #b7c6ea;
  background: #eef3ff;
  color: #3f5a95;
}

.ai-chip-status[data-status="partial"] {
  border-color: #e6d3aa;
  background: #fff8e8;
  color: #8a6730;
}

.ai-chip-status[data-status="failed"],
.ai-chip-status[data-status="skipped"] {
  border-color: #e6c3c1;
  background: #fff1f1;
  color: #8e4741;
}


.ai-chip button {
  border: none;
  background: transparent;
  color: #6b6b6b;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  margin-left: 2px;
}

.ai-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  color: #6b6b6b;
}


.ai-field textarea {
  border: 1.5px solid #c9c9c3;
  border-radius: 10px;
  padding: 7px 9px;
  font-size: 12px;
  font-family: inherit;
  background: #ffffff;
  color: #2f3437;
  resize: vertical;
}

.ai-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #6b6b6b;
}

.ai-detail-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1.5px solid #c9c9c3;
  background: #ffffff;
}

.ai-detail-arrow {
  width: auto;
  height: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: #2f3437;
  box-shadow: none;
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ai-detail-arrow:disabled {
  color: #b7b7b2;
  cursor: not-allowed;
  opacity: 0.6;
}

.ai-detail-arrow-icon {
  width: 14px;
  height: 12px;
  display: block;
}

.ai-detail-arrow-icon-right {
  transform: scaleX(-1);
}

.ai-detail-value {
  min-width: 70px;
  text-align: center;
  font-weight: 400;
  color: #2f3437;
  text-transform: capitalize;
  transition: opacity 0.16s ease;
  display: inline-block;
}

.ai-detail-value.is-changing {
  opacity: 0;
}

.ai-action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@keyframes aiBorderShift {
  0% {
    background-position: 0 0, 0% 50%;
  }
  50% {
    background-position: 0 0, 100% 50%;
  }
  100% {
    background-position: 0 0, 0% 50%;
  }
}

@keyframes ghostSpinner {
  to {
    transform: rotate(360deg);
  }
}

/* ── Map preloader ── */
.map-loader {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 14% 18%, rgba(250, 206, 104, 0.2), transparent 48%),
    radial-gradient(circle at 82% 12%, rgba(140, 169, 255, 0.18), transparent 52%),
    rgba(251, 251, 250, 0.94);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.24s ease;
}

.map-loader.is-hiding {
  opacity: 0;
  pointer-events: none;
}

.map-loader-glow {
  position: absolute;
  width: min(50vw, 500px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 156, 181, 0.16), transparent 70%);
  filter: blur(2px);
  animation: mapLoaderPulse 1.8s ease-in-out infinite;
}

.map-loader-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(92vw, 330px);
  border: 1.5px solid #d9ddd8;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 22px 34px rgba(60, 60, 67, 0.16);
  padding: 24px 22px 20px;
}

.map-loader-logo {
  width: 52px;
  height: 52px;
  opacity: 0.96;
  filter: drop-shadow(0 8px 12px rgba(60, 60, 67, 0.14));
}

.map-loader-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #2f3437;
}

.map-loader-subtitle {
  margin: 0;
  font-size: 13px;
  color: #6b6b6b;
}

.map-loader-spinner {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(214, 216, 212, 0.95);
  border-top-color: #2f3437;
  border-radius: 50%;
  animation: ghostSpinner 1.05s linear infinite;
  margin-top: 8px;
  will-change: transform;
}

/* Reuse the editor loader design for auth/login related loading overlays. */
.auth-loading.map-loader {
  display: none;
}

body.is-auth-loading .auth-loading.map-loader {
  display: flex;
}

@keyframes mapLoaderPulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.62;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

.dashboard {
  padding: 24px 28px 48px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.dashboard-header h2 {
  font-size: 16px;
  color: #2f3437;
}

.settings-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-header h2 {
  font-size: 26px;
  margin-bottom: 6px;
}

.settings-header p {
  color: #6b6b6b;
  font-size: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.settings-card {
  background: #ffffff;
  border: 1.5px solid #e0e0db;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 24px rgba(60, 60, 67, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  min-height: 260px;
}

.settings-card h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b6b6b;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #6b6b6b;
  width: 100%;
}

.settings-description {
  font-size: 12px;
  color: #6b6b6b;
  line-height: 1.4;
}


.settings-field input {
  border: 1.5px solid #c9c9c3;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  background: #ffffff;
  color: #2f3437;
  width: 100%;
  height: 34px;
}

.settings-field .custom-select .select-trigger {
  height: 34px;
  font-size: 13px;
  display: flex;
  align-items: center;
  border-radius: 8px;
}

.settings-field .custom-select .select-options {
  border-radius: 10px;
}

.settings-field .custom-select .select-options button {
  font-size: 13px;
  padding: 8px 10px;
}

.settings-field input:disabled {
  background: #f7f7f5;
  color: #6b6b6b;
}

.settings-note {
  font-size: 12px;
  color: #6b6b6b;
  margin-top: 4px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
}

.settings-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.settings-actions .settings-note {
  margin-top: 0;
}

.settings-form .ghost {
  width: 100%;
}

.settings-card .ghost {
  width: 100%;
  font-size: 13px;
  margin-top: auto;
}

.settings-card.danger-zone {
  border-color: #f2c7c4;
  background: #fff6f5;
}

.settings-card.danger-zone h3 {
  color: #b42318;
}

.settings-note.error {
  color: #b42318;
}

.settings-value {
  font-size: 13px;
  color: #2f3437;
}

.dashboard-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.dashboard-card {
  background: #ffffff;
  border: 1.5px solid #c9c9c3;
  border-radius: 12px;
  padding: 18px;
  display: grid;
  gap: 10px;
}


.dashboard-title {
  border: 1.5px solid #c9c9c3;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 14px;
  font-family: inherit;
  background: #f7f7f5;
  color: #2f3437;
}

.dashboard-meta {
  font-size: 12px;
  color: #6b6b6b;
}

.dashboard-actions {
  display: flex;
  gap: 8px;
}

.dashboard-empty {
  font-size: 13px;
  color: #6b6b6b;
  padding: 24px;
  border: 1.5px dashed #c9c9c3;
  border-radius: 12px;
  background: #fbfbfa;
}

.login-body {
  background-color: #fbfbfa;
  background-image: none;
  overflow: auto;
  user-select: text;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 48px;
  align-items: stretch;
  padding: 48px;
  min-height: 100vh;
}

.login-media {
  border: 1.5px solid #c9c9c3;
  border-radius: 18px;
  background: #f7f7f5;
  min-height: calc(100vh - 96px);
  height: 100%;
  box-shadow: 0 16px 28px rgba(60, 60, 67, 0.12);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  padding: 32px;
}

.login-media-placeholder {
  color: #ffffff;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.3;
  max-width: 500px;
  position: relative;
  z-index: 2;
}

.login-media::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: linear-gradient(
    120deg,
    rgba(120, 170, 255, 0.92),
    rgba(255, 126, 170, 0.9),
    rgba(255, 200, 88, 0.92),
    rgba(120, 224, 206, 0.92),
    rgba(120, 170, 255, 0.92)
  );
  background-size: 200% 200%;
  animation: gradientShift 12s ease-in-out infinite;
  z-index: 0;
}

.login-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.35), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.25), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.2), transparent 55%);
  z-index: 1;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}


.login-panel {
  max-width: 420px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-brand .app-logo {
  width: 70px;
  height: 70px;
}

.login-brand h1 {
  font-size: 41px;
  color: #2f3437;
}

.login-title {
  font-size: 36px;
  color: #2f3437;
  margin-bottom: 10px;
}

.login-subtitle {
  font-size: 16px;
  color: #6b6b6b;
  margin-bottom: 26px;
}


.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #6b6b6b;
}

.login-field input {
  border: 1.5px solid #c9c9c3;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  background: #ffffff;
  color: #2f3437;
  width: 100%;
  height: 34px;
}

.login-field input.login-input-lg {
  height: 42px;
  padding: 9px 12px;
  font-size: 14px;
}

.login-field.is-error input {
  border-color: #b42318;
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.12);
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #6b6b6b;
  cursor: pointer;
  padding: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: #2f3437;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

.password-toggle .eye-shape {
  opacity: 1;
}

.password-toggle .eye-slash {
  opacity: 1;
  transform: scale(1);
  transform-origin: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.password-toggle.is-visible .eye-slash {
  opacity: 0;
  transform: scale(0.9);
}

.login-field[hidden] {
  display: none;
}

.login-criteria[hidden] {
  display: none;
}

.login-criteria {
  border: 1.5px solid #e0e0db;
  border-radius: 12px;
  background: #fbfbfa;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: #6b6b6b;
}

.login-criteria-title {
  font-weight: 600;
  color: #2f3437;
  font-size: 12px;
}

.login-criteria ul {
  list-style: none;
  display: grid;
  gap: 6px;
}

.login-criteria li {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s ease;
}

.login-criteria li::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #c9c9c3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #2f3437;
  background: #ffffff;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.login-criteria li.is-met {
  color: #2f3437;
}

.login-criteria li.is-met::before {
  content: "✓";
  border-color: #2f3437;
  background: #f7f7f5;
}

.login-forgot {
  display: flex;
  justify-content: flex-end;
}

.text-link-btn {
  border: none;
  background: transparent;
  padding: 0;
  color: #2f3437;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

.text-link-btn:hover {
  text-decoration: underline;
}

.text-btn {
  border: none;
  background: transparent;
  color: #2f3437;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.text-btn:hover {
  text-decoration: underline;
}

.login-btn {
  width: 100%;
  border-radius: 8px;
  border: 1.5px solid #c9c9c3;
  background: #f7f7f5;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #2f3437;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 10px 18px rgba(60, 60, 67, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  height: 34px;
}

.login-btn.login-btn-lg {
  height: 42px;
  padding: 10px 14px;
  font-size: 14px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 22px rgba(60, 60, 67, 0.18);
  background: #ffffff;
}

.login-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 14px rgba(60, 60, 67, 0.16);
}

.login-note {
  font-size: 13px;
  color: #6b6b6b;
  min-height: 16px;
}

.login-note.error {
  color: #b42318;
}

.login-note.success {
  color: #1f7a3b;
  font-weight: 600;
}

.login-note.success::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 999px;
  background: rgba(31, 122, 59, 0.14);
  color: #1f7a3b;
  font-size: 12px;
}

.login-success {
  border: 1.5px solid #c9c9c3;
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-success[hidden] {
  display: none;
}

.login-success-title {
  font-size: 16px;
  color: #2f3437;
  font-weight: 600;
}

.login-success-text {
  font-size: 13px;
  color: #6b6b6b;
  line-height: 1.4;
}

.login-resend {
  display: flex;
  justify-content: flex-end;
}

.login-switch {
  display: flex;
  gap: 6px;
  justify-content: center;
  font-size: 13px;
  color: #6b6b6b;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
  color: #6b6b6b;
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #e2e2de;
}

.login-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.google-mark {
  width: 18px;
  height: 18px;
  display: inline-flex;
}

.google-mark svg {
  width: 18px;
  height: 18px;
  display: block;
}

@media (max-width: 960px) {
  .login-layout {
    grid-template-columns: 1fr;
    padding: 32px;
  }

  .login-media {
    min-height: 260px;
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-loader-glow,
  .map-loader-spinner {
    animation: none;
  }
}

.profile-menu {
  position: relative;
  display: inline-flex;
}

.profile-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid #c9c9c3;
  background: #f7f7f5;
  color: #2f3437;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.profile-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 18px rgba(60, 60, 67, 0.14);
  background: #ffffff;
}

.profile-btn.is-signed-in {
  background: #2f3437;
  border-color: #2f3437;
  color: #ffffff;
}

.profile-badge {
  font-size: 14px;
  line-height: 1;
  text-transform: uppercase;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #ffffff;
  border: 1.5px solid #c9c9c3;
  border-radius: 12px;
  padding: 12px;
  min-width: 200px;
  box-shadow: 0 14px 26px rgba(60, 60, 67, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 40;
}

.profile-menu.open .profile-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.profile-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-section[hidden] {
  display: none;
}

.profile-welcome {
  font-size: 13px;
  font-weight: 600;
  color: #2f3437;
}

.profile-email {
  font-size: 12px;
  color: #6b6b6b;
}

.profile-action {
  border: 1.5px solid #c9c9c3;
  background: #f7f7f5;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-family: inherit;
  color: #2f3437;
  cursor: pointer;
  text-align: left;
  height: 34px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 8px 14px rgba(60, 60, 67, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.profile-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 18px rgba(60, 60, 67, 0.16);
  background: #ffffff;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.45);
}

.modal-card {
  position: relative;
  width: min(420px, 92vw);
  background: #ffffff;
  border-radius: 14px;
  border: 1.5px solid #c9c9c3;
  box-shadow: 0 18px 32px rgba(60, 60, 67, 0.2);
  padding: 18px;
  z-index: 1;
}

.modal.danger-modal .modal-card {
  border-color: #f2c7c4;
  background: #fff6f5;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-header h3 {
  font-size: 16px;
  color: #2f3437;
}

.modal.danger-modal .modal-header h3 {
  color: #b42318;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #6b6b6b;
}

.modal-field input {
  border: 1.5px solid #c9c9c3;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  background: #ffffff;
  color: #2f3437;
}

.modal-note {
  font-size: 12px;
  color: #6b6b6b;
  min-height: 16px;
}

.modal-note.error {
  color: #b42318;
}

.modal-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6b6b6b;
  font-size: 12px;
}

.modal-divider::before,
.modal-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #e2e2de;
}

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

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

.plans-body {
  background-color: #fbfbfa;
  background-image: none;
  overflow: auto;
  user-select: text;
}

.plans-title {
  font-size: 58px;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #2f3437;
  font-weight: 600;
}

.plans-section-header {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.plans {
  max-width: none;
  margin: 0 auto;
  padding: 28px max(20px, (100vw - 980px) / 2) 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  line-height: 1.6;
}

.plans-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
  padding: 28px;
  border-radius: 22px;
  border: 1.5px solid #c9c9c3;
  background: #f7f7f5;
  box-shadow: 0 18px 32px rgba(60, 60, 67, 0.16);
  position: relative;
  overflow: hidden;
}

.plans-hero::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: linear-gradient(
    120deg,
    rgba(120, 170, 255, 0.62),
    rgba(255, 126, 170, 0.6),
    rgba(255, 200, 88, 0.62),
    rgba(120, 224, 206, 0.62),
    rgba(120, 170, 255, 0.62)
  );
  background-size: 200% 200%;
  animation: gradientShift 18s ease-in-out infinite;
  z-index: 0;
}

.plans-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.35), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.25), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.2), transparent 55%);
  z-index: 1;
}

.plans-hero > * {
  position: relative;
  z-index: 2;
}

.plans-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plans-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: #6b6b6b;
}

.plans-hero h2 {
  font-size: 36px;
  line-height: 1.1;
  margin: 0;
}

.plans-hero p {
  font-size: 15px;
  color: #4a4d50;
}

.plans-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.plans-hero-note {
  font-size: 12px;
  color: #6b6b6b;
}

.plans-hero-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plans-highlight {
  border: 1.5px solid #c9c9c3;
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 12px 20px rgba(60, 60, 67, 0.1);
}

.plans-highlight.secondary {
  background: #f7f7f5;
}

.plans-highlight-label {
  font-size: 12px;
  font-weight: 600;
  color: #2f3437;
  display: block;
  margin-bottom: 10px;
}

.plans-highlight ul {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: #4a4d50;
}

.plans-highlight li::before {
  content: "+";
  margin-right: 8px;
  color: #2f3437;
  font-weight: 600;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.plan-card {
  position: relative;
  border: 1.5px solid #c9c9c3;
  border-radius: 18px;
  padding: 20px;
  background: #ffffff;
  box-shadow: 0 14px 26px rgba(60, 60, 67, 0.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.plan-list {
  flex: 1;
}

.plan-card.featured {
  border-color: #2f3437;
  box-shadow: 0 18px 32px rgba(60, 60, 67, 0.18);
  transform: none;
}

.plan-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #2f3437;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.plan-price {
  font-size: 32px;
  font-weight: 700;
}

.plan-price span {
  font-size: 14px;
  color: #6b6b6b;
  font-weight: 500;
  margin-left: 4px;
}

.plan-summary {
  font-size: 13px;
  color: #6b6b6b;
}

.plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: #4a4d50;
}

.plan-list li::before {
  content: "+";
  margin-right: 8px;
  color: #2f3437;
  font-weight: 600;
}

.plans-faq {
  margin-top: 0;
  padding: 50px 0;
  color: #2e3437;
}

.plans-faq-head {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.plans-faq-head h3 {
  font-size: 30px;
}

.plans-faq-head p {
  color: #5e6569;
}

.plans-faq-list {
  display: grid;
  gap: 12px;
}

.plans-faq-item {
  background: #ffffff;
  border: 1px solid #d6d2c8;
  border-radius: 14px;
  padding: 12px 16px;
}

.plans-faq-item summary {
  color: #2e3437;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.plans-faq-item summary::-webkit-details-marker {
  display: none;
}

.plans-faq-item summary::after {
  content: "+";
  float: right;
}

.plans-faq-item[open] summary::after {
  content: "-";
}

.plans-faq-item p {
  margin-top: 8px;
  font-size: 13px;
  color: #5e6569;
}

.plans .ghost {
  height: 44px;
  padding: 10px 20px;
  font-size: 15px;
}

.plans .ghost.plans-primary {
  background: #2f3437;
  border-color: #2f3437;
  color: #ffffff;
  box-shadow: 0 12px 18px rgba(60, 60, 67, 0.18);
}

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    border-right: none;
    border-bottom: 1px solid #e3e4ef;
  }

  .section {
    flex: 1 1 200px;
  }

  .plans-hero {
    grid-template-columns: 1fr;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .plan-card.featured {
    transform: none;
  }

}
