* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  display: flex;
  height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #fafafa;
  overflow: hidden;
  color: #333;
}
#canvas-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #e0e0e0;
  padding: 10px;
  min-width: 0;
  gap: 20px;
}
#github-link {
  font-size: 15px;
  color: #444;
  display: flex;
  align-items: center;
  gap: 8px;
}
#github-link a {
  color: #0366d6;
  text-decoration: none;
}
#github-link a:hover {
  text-decoration: underline;
}
#canvas {
  background: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  display: block;
  cursor: crosshair;
  max-width: 100%;
  max-height: calc(100% - 30px);
  object-fit: contain;
}
#panel {
  width: 320px;
  min-width: 320px;
  background: #f5f5f5;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 1px solid #ddd;
}
h2 {
  font-size: 16px;
  font-weight: bold;
  margin: 4px 0 2px;
  color: #000;
}
hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 8px 0;
}
label {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 2px 0;
}
label.indent {
  padding-left: 18px;
}
select,
input[type="range"] {
  width: 100%;
  font-size: 13px;
  margin: 2px 0 4px;
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 2px;
}
.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
button {
  color: white;
  border: none;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 3px;
}
button:hover {
  opacity: 0.85;
}
.btn-full {
  grid-column: span 2;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0;
}
.stat-val {
  font-weight: bold;
}

/* Compare Modal Styling */
#compare-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
#compare-modal.show {
  display: flex;
}
#compare-box {
  background: #f0f0f0;
  padding: 25px;
  border-radius: 4px;
  max-width: 95vw;
  overflow-x: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  position: relative;
}
#compare-box h3 {
  margin-bottom: 15px;
  font-size: 20px;
  text-align: center;
}
#close-modal {
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #666;
}
#close-modal:hover {
  color: #000;
}
table {
  border-collapse: collapse;
  width: auto;
  margin: 0 auto;
}
th {
  background: #e0e0e0;
  padding: 10px 15px;
  border: 2px ridge #eee;
  text-align: center;
  font-size: 15px;
  font-weight: bold;
}
td {
  padding: 8px 15px;
  border: 2px ridge #eee;
  text-align: center;
  font-size: 15px;
}
tr.ok {
  background: #f9fbe7;
}
tr.err {
  background: #ffebee;
}
