* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               sans-serif;
  background: #f3f4f6;
}

.layout {
  display: flex;
  gap: 16px;
  padding: 16px;
  height: 100vh;
}

.strip-card {
  flex: 3;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  padding: 12px 12px 16px;
  display: flex;
  flex-direction: column;
}

.strip-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: #111827;
}

canvas {
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  display: block;
  max-width: 100%;
  height: auto;
}

#tocoCanvas {
  margin-top: 12px;
}

.side-panel {
  flex: 1;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.top-controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-group label {
  font-size: 0.8rem;
  color: #4b5563;
}

.field-group input[type="text"] {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  font-size: 0.85rem;
}

/* wider numeric/text inputs (baseline + range) */
.small-input {
  width: 10ch; /* enough for up to ~10 characters */
}

.correct-label {
  font-size: 0.8rem;
  color: #10b981;
}

.btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #4b5563;
}

.btn-secondary:hover {
  background: #374151;
}

.radio-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px 8px;
  margin-top: 4px;
}

.radio-group input[type="radio"] {
  margin-right: 3px;
}

.var-label {
  font-size: 0.75rem;
  color: #111827;
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* Make the variability row vertical on ALL screen sizes */
.field-row.variability-row {
  flex-direction: column;
  align-items: flex-start;
}

/* Range inputs layout */
.range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.range-inputs span {
  font-size: 0.9rem;
  color: #4b5563;
}

/* Mobile: side panel below, graphs full width */
@media (max-width: 900px) {
  .layout {
    flex-direction: column;
    height: auto;
  }

  .strip-card,
  .side-panel {
    width: 100%;
  }

  .radio-group {
    gap: 4px; /* keep it tight on mobile */
  }
}
