:root {
  --bg-color: #f7f5ef;
  --panel-bg: #ffffff;
  --primary: #4a6b35;
  --accent: #8c533c;
  --text-dark: #2c3529;
  --text-light: #667061;
  --border: #d2cbbe;
}

/* Jar Container Baseline */
.jar-container {
  display: flex;
  flex-direction: column-reverse;
  height: 280px;
  border: 3px solid #333;
  border-radius: 0 0 16px 16px;
  overflow: hidden;
  background-color: #a0c4df; /* Light Blue Water */
}

/* Soil Component Layer Colors */
.layer-gravel { background-color: #4a4a4a !important; } /* Dark Grey */
.layer-sand   { background-color: #d2c4a5 !important; } /* Light Sand */
.layer-silt   { background-color: #708090 !important; } /* Slate */
.layer-clay   { background-color: #a0522d !important; } /* Red-Brown */

body {
  font-family: system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
}

header {
  background-color: var(--primary);
  color: #fff;
  padding: 1rem;
  text-align: center;
}

header h1 { margin: 0 0 0.5rem 0; font-size: 1.5rem; }

nav button {
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  margin: 0 0.25rem;
}

nav button.active {
  background: #fff;
  color: var(--primary);
  font-weight: bold;
}

main { max-width: 800px; margin: 1.5rem auto; padding: 0 1rem; }

.test-module { display: none; }
.test-module.active-module { display: block; }

.test-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (min-width: 600px) {
  .test-container { grid-template-columns: 1fr 1fr; }
}

.results-card, .controls-panel {
  background: var(--panel-bg);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.canvas-wrapper {
  display: flex;
  justify-content: center;
  background: #eee;
  border-radius: 8px;
  overflow: hidden;
}

canvas { cursor: pointer; touch-action: none; }

.stats-list { list-style: none; padding: 0; }
.stats-list li { margin-bottom: 0.5rem; }
.gravel-row { font-size: 0.85rem; color: var(--text-light); }

.result-badge {
  background: var(--bg-color);
  padding: 0.75rem;
  border-radius: 4px;
  font-weight: bold;
  margin: 1rem 0;
  text-align: center;
}

.primary-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

/* pH Styles */
select {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.spectrum-bars {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.spectrum-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.swatch-preview {
  height: 50px;
  border-radius: 4px;
  background: #ccc;
  margin-bottom: 1rem;
}
