* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f2f4f7;
  color: #18202a;
  overscroll-behavior: none;
}

.app {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: 16px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.toolbar h1 {
  margin: 0 0 4px;
  font-size: clamp(1.25rem, 3vw, 2rem);
}

.toolbar p,
.hint {
  margin: 0;
  color: #59636f;
}

button {
  border: 1px solid #aab2bc;
  border-radius: 8px;
  background: white;
  padding: 10px 14px;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: #f6f7f9;
}

button:active {
  transform: translateY(1px);
}

.graph-wrapper {
  width: 100%;
  height: min(72vh, 760px);
  min-height: 420px;
  overflow: hidden;
  border: 1px solid #aeb8c4;
  border-radius: 10px;
  background: white;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
}

#graphCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#graphCanvas.dragging {
  cursor: grabbing;
}

.hint {
  margin-top: 10px;
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 650px) {
  .app {
    padding: 10px;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar button {
    width: 100%;
  }

  .graph-wrapper {
    height: 70vh;
    min-height: 360px;
  }
}
