* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  background: #efe9dd;
  color: #2b2417;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #d6c6a5;
  border-bottom: 2px solid #5c4b2c;
}

.brand {
  font-weight: bold;
  letter-spacing: 0.8px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid #5c4b2c;
  background: #fdf7e5;
}

#zoom-level {
  min-width: 48px;
  text-align: center;
  font-size: 13px;
}

.topbar button,
.import-label {
  background: #fdf7e5;
  border: 1px solid #5c4b2c;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
}

.import-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.import-label input {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  min-height: calc(100vh - 54px);
}

.board-wrapper {
  position: relative;
  overflow: auto;
  padding: var(--board-padding, 20px);
}

.board {
  position: relative;
  width: 1600px;
  height: 1200px;
  background: #f7f2e7;
  border: 2px dashed #c4b48f;
  user-select: none;
}

.board-content {
  position: relative;
  width: 1600px;
  height: 1200px;
  transform-origin: top left;
}

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

.node {
  position: absolute;
  width: 220px;
  min-height: 80px;
  background: #fff8e9;
  border: 2px solid #5c4b2c;
  box-shadow: 3px 3px 0 #5c4b2c;
  padding: 10px;
  cursor: grab;
  user-select: none;
}

.node.selected {
  outline: 3px solid #2b2417;
}

.node-id {
  font-weight: bold;
  margin-bottom: 6px;
}

.node-text {
  font-size: 13px;
  line-height: 1.3;
  max-height: 120px;
  overflow: hidden;
}

.panel {
  border-left: 2px solid #5c4b2c;
  background: #fdf7e5;
  padding: 16px;
  overflow: auto;
}

.panel h2,
.panel h3 {
  margin: 0 0 10px 0;
}

.panel-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d6c6a5;
}

.panel label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  gap: 6px;
  margin-bottom: 10px;
}

.ip-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.ip-row label {
  flex: 1;
  margin-bottom: 0;
}

.ip-row button {
  padding: 6px 10px;
  border: 1px solid #5c4b2c;
  background: #fdf7e5;
  cursor: pointer;
}

.panel input,
.panel textarea,
.panel select {
  padding: 6px 8px;
  border: 1px solid #5c4b2c;
  background: #fffaf0;
  font-family: inherit;
}

.row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

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

.choice-item {
  border: 1px solid #c4b48f;
  padding: 8px;
  margin-bottom: 8px;
  background: #fff;
}

.choice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

#validation {
  background: #fff;
  padding: 8px;
  border: 1px solid #c4b48f;
  min-height: 80px;
  white-space: pre-wrap;
}
