body {
  margin: 0;
  overflow: hidden;
  background-color: #eef2f5;
  font-family: 'Segoe UI', Tahoma, sans-serif;
}

#canvas-container {
  width: 100vw;
  height: 100vh;
}

/* Updated to be a full-height Side Panel */
#ui-overlay {
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  padding: 20px;
  box-sizing: border-box;
  border-left: 1px solid #cbd5e1;
  color: #334155;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

#ui-overlay h1 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #0284c7;
}

#ui-overlay p {
  margin: 5px 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.4;
}

.stat {
  font-weight: bold;
  color: #0f172a;
}

.divider {
  border: 0;
  border-top: 1px solid #cbd5e1;
  margin: 15px 0;
}

#controls {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 5px;
}

.btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  color: white;
  transition: transform 0.1s, opacity 0.2s;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

#btn-autofill { background-color: #10b981; }

/* Event Log Styles */
#event-log-wrapper {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 0; /* Critical for flex scrolling */
  margin-top: 5px;
}

#event-log-wrapper h2 {
  font-size: 14px;
  color: #0f172a;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#event-log {
  flex-grow: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  overflow-y: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #334155;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.log-entry {
  margin-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 4px;
  word-wrap: break-word;
}

.log-time {
  color: #94a3b8;
  margin-right: 5px;
  font-weight: bold;
}