/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 40px 16px 60px;
  min-height: 100vh;
  background-color: #f0f2f5;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: #222;
  font-size: 15px;
}

/* === Card === */
#content {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  padding: 32px 36px 36px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.09), 0 4px 20px rgba(0,0,0,0.11);
  border: 1.5px solid #e0e3e9;
}

/* === Typography === */
h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 20px;
}

p {
  line-height: 1.7;
  color: #444;
  margin: 0 0 16px;
}

b {
  color: #222;
  font-weight: 600;
}

a {
  color: #4d8f5a;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* === Back navigation === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: #999;
  text-decoration: none;
  margin-bottom: 20px;
}

.back-link:hover {
  color: #4d8f5a;
  text-decoration: none;
}

/* === Navigation list (index page) === */
.nav-links {
  list-style: none;
  padding: 0;
  margin: 0 0 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-links li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #f8f9fb;
  border: 1.5px solid #e0e3e9;
  border-radius: 10px;
  color: #1a1a2e;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.nav-links li a:hover {
  border-color: #6aaa74;
  background: #f5fbf6;
  text-decoration: none;
}

.nav-links li a::after {
  content: "→";
  color: #6aaa74;
  font-size: 0.9rem;
}

/* === Control section dividers === */
.control-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #bbb;
  margin: 0 0 8px 2px;
}

.control-section-divider {
  border: none;
  border-top: 1px solid #e4e7ed;
  margin: 12px 0 12px;
}

/* === Section label === */
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
  margin: 0 0 14px 2px;
}

/* === Control group === */
.control-group {
  background: #f8f9fb;
  border: 1.5px solid #e4e7ed;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.control-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #999;
  margin: 0 0 14px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  color: #555;
  font-size: 0.9rem;
}

.control-row:last-child {
  margin-bottom: 0;
}

.control-label {
  min-width: 140px;
  color: #555;
}

/* === Range slider === */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #dde0e6;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  width: 140px;
  vertical-align: middle;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6aaa74;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6aaa74;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* === Value badge === */
.slider-value {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4d8f5a;
  background: #eef6ef;
  border-radius: 5px;
  padding: 2px 7px;
}

/* === Buttons === */
input[type="button"],
button {
  background: #fff;
  color: #4d8f5a;
  border: 1.5px solid #c6e0cb;
  border-radius: 7px;
  padding: 7px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

input[type="button"]:hover,
button:hover {
  background: #6aaa74;
  color: #fff;
  border-color: #6aaa74;
}

/* === Action row === */
.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 20px;
}

/* === Canvas === */
canvas {
  display: block;
  border-radius: 10px;
  border: 1.5px solid #e0e3e9;
  background: #f8f9fb;
  max-width: 100%;
  margin-bottom: 12px;
}

#canvas01, #canvas02 {
  width: 726px;
  height: 400px;
}

/* === Reaktionsgruppen (Edukte / Produkte) === */
.reaktionsgruppe-wrapper {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.reaktionsgruppe {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.reaktionsgruppe-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #4d8f5a;
  background: #eef6ef;
  border: 1.5px solid #c6e0cb;
  border-radius: 7px 7px 0 0;
  padding: 5px 12px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.reaktionsgruppe-stoffe {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.reaktionsgruppe-stoffe .control-group {
  flex: 1 1 0;
  min-width: 0;
  margin-bottom: 0;
  border-radius: 0 0 10px 10px;
  border-top: none;
}

.reaktionsgruppe-stoffe .control-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.reaktionsgruppe-stoffe .control-label {
  min-width: 0;
}

.reaktionsgruppe-stoffe input[type="range"] {
  width: 100%;
}

/* === Count display === */
.count-display {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 12px 16px;
  background: #f8f9fb;
  border: 1.5px solid #e4e7ed;
  border-radius: 10px;
  font-size: 0.875rem;
  color: #666;
  margin-top: 4px;
}

.count-display span {
  font-weight: 600;
  color: #222;
}