:root {
  --forest-deep: #0a1612;
  --forest-mid: #122820;
  --moss: #4ade80;
  --fern: #86efac;
  --bark: #fcd34d;
  --mist: rgba(209, 250, 229, 0.85);
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(74, 222, 128, 0.08), transparent),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 40px,
      rgba(74, 222, 128, 0.02) 40px,
      rgba(74, 222, 128, 0.02) 41px
    ),
    var(--forest-deep);
  color: var(--mist);
  min-height: 100vh;
  overflow: hidden;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 1.25rem;
  background: rgba(18, 40, 32, 0.92);
  border-bottom: 1px solid rgba(74, 222, 128, 0.15);
  position: relative;
  z-index: 10;
}

.toolbar h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0;
  color: var(--fern);
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

button {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(134, 239, 172, 0.35);
  border-radius: 8px;
  background: rgba(10, 22, 18, 0.8);
  color: var(--fern);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

button:hover {
  background: rgba(74, 222, 128, 0.15);
  transform: translateY(-1px);
}

.hint {
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.65;
  flex: 1 1 100%;
}

.viewport {
  position: relative;
  height: calc(100vh - 120px);
  overflow: hidden;
  cursor: grab;
}

.viewport.panning { cursor: grabbing; }

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

.edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.edges line {
  stroke: rgba(134, 239, 172, 0.45);
  stroke-width: 2;
  stroke-linecap: round;
}

.node {
  position: absolute;
  min-width: 100px;
  max-width: 200px;
  padding: 0.65rem 0.85rem;
  background: linear-gradient(145deg, var(--forest-mid), #0d1f18);
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: move;
  user-select: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.node:focus {
  outline: 2px solid var(--bark);
  outline-offset: 2px;
}

.node.selected {
  border-color: var(--bark);
  box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.25);
}

.node[contenteditable="true"] {
  cursor: text;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  padding: 0.5rem;
  background: rgba(10, 22, 18, 0.85);
  color: rgba(209, 250, 229, 0.6);
  z-index: 10;
}
