body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f0f2f5;
  color: #333;
  margin: 0;
  padding: 0;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.room-label {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #000;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 2px #fff;
    pointer-events: none; 
}
h2, h3 {
  color: #333;
  margin-top: 0;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 8px;
}

.sidebar {
  width: 320px;
  background-color: #ffffff;
  border-right: 1px solid #d1d5db;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

#quickGuide {
  padding: 15px;
  background-color: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
}

#quickGuide h3 {
  border: none;
  padding-bottom: 5px;
  color: #4338ca;
}

#quickGuide ul {
  padding-left: 20px;
  margin: 0;
  font-size: 0.85em;
  color: #475569;
}

#controls, #toolControls, #propertiesPanel {
  padding: 15px;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#controls label {
  margin-bottom: 5px;
  font-size: 0.9em;
  font-weight: 500;
}

.scale-inputs, .history-controls {
  display: flex;
  gap: 10px;
}
.scale-inputs > div, .history-controls > button {
  flex: 1;
}

#controls input[type="number"], #propertiesPanel input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #CFD8DC;
  border-radius: 5px;
  font-size: 0.9em;
  box-sizing: border-box;
}

button {
  padding: 10px 15px;
  color: #333;
  background-color: #f4f4f5;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s ease;
}

button:hover {
  border-color: #a1a1aa;
  background-color: #e4e4e7;
}

button.primary, #toolControls button.active {
  background-color: #2563eb;
  color: white;
  border-color: #2563eb;
}
button.primary:hover, #toolControls button.active:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

button.danger {
  background-color: #dc2626;
  color: white;
  border-color: #dc2626;
}
button.danger:hover {
  background-color: #b91c1c;
  border-color: #b91c1c;
}

#toolControls button {
  text-align: left;
}
hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 5px 0;
}

#imageContainer {
  flex-grow: 1;
  position: relative;
  overflow: hidden;
  background-color: #e5e7eb;
}

#map {
  cursor: crosshair;
}

#map.panning {
  cursor: grabbing;
}

#jsonOutput {
  flex: 0 0 auto;   /* prevent flex from overriding resize */
  width: 100%;
  height: 150px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #CFD8DC;
  border-radius: 5px;
  font-family: monospace;
  font-size: 0.8em;
  white-space: pre-wrap;
  resize: vertical;   /* enable vertical resize */
  box-sizing: border-box;
  overflow: auto;     /* show scrollbar when needed */
}

.grid-overlay {
  background-image:
    linear-gradient(rgba(0,0,0,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.07) 1px, transparent 1px);
  background-size: 20px 20px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
