*,*::before,*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Arial, sans-serif;
  background: #f7f6f2;
  color: #1f1f1d;
  line-height: 1.5;
  padding: 24px 16px 60px;
}
.container { max-width: 1100px; margin: 0 auto; }

header { margin-bottom: 18px; }
h1 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 6px; font-weight: 600; }
.subtitle { color: #5f5e5a; font-size: 14px; margin: 0; max-width: 720px; }

.info-banner {
  background: #fff;
  border: 1px solid #e5e3da;
  border-left: 3px solid #1565c0;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 22px;
  font-size: 13px;
  color: #444441;
}
.info-banner strong { color: #1f1f1d; font-weight: 600; }

.sim-area {
  background: #1a1a1a;
  border: 1px solid #3a3a36;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 18px;
}
#pool {
  width: 100%;
  height: auto;
  display: block;
  cursor: crosshair;
  border-radius: 6px;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.control {
  background: #fff;
  border: 1px solid #e5e3da;
  border-radius: 10px;
  padding: 14px 18px;
}
.control label {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
}
.control input[type=range] {
  width: 100%;
  accent-color: #1565c0;
}
.value-row { margin-top: 4px; }
.value-display {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.btn-group {
  display: flex;
  gap: 4px;
  background: #ebe9e1;
  padding: 4px;
  border-radius: 6px;
}
.src-btn {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #5f5e5a;
  transition: all 0.15s;
}
.src-btn.active {
  background: #fff;
  color: #1f1f1d;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.readout-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.readout {
  background: #fff;
  border: 1px solid #e5e3da;
  border-radius: 8px;
  padding: 10px 14px;
  text-align: center;
}
.readout-label {
  font-size: 10px;
  color: #5f5e5a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 4px;
}
.readout-value {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.readout-value .unit {
  font-size: 12px;
  color: #5f5e5a;
  margin-left: 2px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.btn-primary, .btn-secondary {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: #1565c0; color: #fff; border-color: #1565c0; }
.btn-primary:hover { background: #104f95; }
.btn-secondary { background: #fff; color: #1f1f1d; border-color: #e5e3da; }
.btn-secondary:hover { background: #f0eee5; }
.toggle-label {
  font-size: 13px;
  color: #5f5e5a;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.explanations {
  background: #fff;
  border: 1px solid #e5e3da;
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 18px;
}
.explanations h2 { font-size: 16px; margin: 0 0 14px; font-weight: 600; }
.exp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 600px) {
  .exp-grid { grid-template-columns: 1fr 1fr; }
}
.exp-box {
  padding: 12px 14px;
  background: #f7f6f2;
  border-radius: 6px;
}
.exp-box h3 {
  font-size: 13px;
  margin: 0 0 6px;
  font-weight: 600;
  color: #1565c0;
}
.exp-box p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #1f1f1d;
}

footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid #e5e3da;
  font-size: 12.5px;
  color: #5f5e5a;
  line-height: 1.6;
}
footer .brand { font-weight: 600; color: #1f1f1d; }
