:root {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  color: #1a1a1a;
  background-color: #f4f5f7;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  background: #f4f5f7;
}

h1,
p {
  margin: 0;
}

input,
button {
  font: inherit;
}

button {
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  border: 1px solid #d0d4dc;
  background: white;
  cursor: pointer;
}

button:hover {
  border-color: #a9b2c2;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
}

input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #ccd2dc;
  background: #fff;
}

input:focus {
  outline: 2px solid #bcd4ff;
  border-color: #7096e5;
}

.muted {
  color: #5e6678;
}

.fullscreen-center {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.column {
  display: grid;
  gap: 0.8rem;
}

.auth-card {
  width: min(420px, 92vw);
  background: white;
  border: 1px solid #dee3ec;
  border-radius: 14px;
  padding: 1.1rem;
  display: grid;
  gap: 0.8rem;
}

.auth-card-nested {
  width: 100%;
  border: none;
  padding: 0;
  margin: 0;
}

.maps-layout {
  max-width: 920px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.maps-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.maps-card {
  background: white;
  border: 1px solid #dee3ec;
  border-radius: 14px;
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
}

.maps-actions-row {
  display: flex;
  justify-content: flex-end;
}

.maps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.maps-list-item {
  border: 1px solid #e2e5ec;
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}

.map-link {
  color: inherit;
  text-decoration: none;
  display: grid;
  gap: 0.35rem;
  flex: 1;
}

.map-link:hover strong {
  text-decoration: underline;
}

.danger {
  border-color: #f1c4ca;
  color: #9d1f2d;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed #cfd5df;
  border-radius: 10px;
  text-align: center;
  color: #596173;
}

.error-box {
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #e6b5bd;
  background: #fff3f5;
  color: #9d1f2d;
}

.editor-layout {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr;
  background: #eceff5;
}

.editor-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #d9dfea;
  background: #f9fbff;
}

.editor-topbar-wrap {
  flex-wrap: wrap;
}

.editor-topbar-left,
.editor-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.editor-topbar-group {
  flex-wrap: wrap;
}

.link-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border: 1px solid #d0d4dc;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  background: #fff;
}

.map-title-input {
  min-width: 260px;
}

.save-state {
  font-size: 0.9rem;
}

.save-state-saving {
  color: #416cc2;
}

.save-state-saved {
  color: #157347;
}

.save-state-error {
  color: #a12a35;
}

.editor-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid #d9dfea;
  background: #eef4ff;
  color: #3f4e6d;
  font-size: 0.9rem;
}

.editor-canvas {
  min-height: 0;
}

.editor-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #e9ecf3;
  user-select: none;
  touch-action: none;
}

.editor-stage.is-panning {
  cursor: grabbing;
}

.editor-world {
  position: absolute;
  width: 20000px;
  height: 20000px;
  transform-origin: 0 0;
  will-change: transform;
}

.editor-edges {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.editor-nodes {
  position: absolute;
  inset: 0;
}

.mind-node {
  position: absolute;
  border: 2px solid #5676d0;
  border-radius: 10px;
  padding: 8px 10px;
  box-sizing: border-box;
  background: #fff;
  color: #1a1a1a;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mind-node-circle {
  border-radius: 999px;
}

.mind-node-note {
  border-style: solid;
}

.mind-node.is-selected {
  box-shadow: 0 0 0 3px rgba(94, 138, 255, 0.35);
}

.mind-node.is-connect-source {
  box-shadow: 0 0 0 3px rgba(65, 180, 120, 0.4);
}

.mind-node-label {
  width: 100%;
  outline: none;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
}

#connectModeBtn.is-active {
  border-color: #3d66d6;
  color: #2d52b8;
  background: #eef3ff;
}

.react-flow-wrapper {
  width: 100%;
  height: 100%;
}

.react-flow__node {
  font-size: 14px;
}
