*,*::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 #185fa5;
  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: #fff;
  border: 1px solid #e5e3da;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 18px;
  overflow: hidden;
}
#track {
  width: 100%;
  height: auto;
  display: block;
  background: linear-gradient(to bottom, #d6e4f0 0%, #d6e4f0 60%, #c8b88a 60%, #b8a572 100%);
  border-radius: 6px;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.control {
  background: #fff;
  border: 1px solid #e5e3da;
  border-radius: 10px;
  padding: 14px 18px;
}
.control label {
  font-size: 13px;
  font-weight: 500;
  color: #1f1f1d;
  margin-bottom: 8px;
  display: block;
}
.control input[type=range] {
  width: 100%;
  accent-color: #185fa5;
  height: 28px;
}
.value-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
}
.value-display {
  font-size: 18px;
  font-weight: 600;
  color: #1f1f1d;
  font-variant-numeric: tabular-nums;
}
.hint {
  font-size: 11px;
  color: #888780;
}

.readout-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 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;
  color: #1f1f1d;
  font-variant-numeric: tabular-nums;
}
.readout-value .unit {
  font-size: 12px;
  color: #5f5e5a;
  font-weight: 500;
  margin-left: 2px;
}

.action-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.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;
  transition: background 0.15s, color 0.15s;
}
.btn-primary {
  background: #185fa5;
  color: #fff;
  border-color: #185fa5;
}
.btn-primary:hover { background: #134d87; }
.btn-secondary {
  background: #fff;
  color: #1f1f1d;
  border-color: #e5e3da;
}
.btn-secondary:hover { background: #f0eee5; }

.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 22px;
}
@media (min-width: 720px) {
  .charts-grid { grid-template-columns: 1fr 1fr; }
}
.chart-box {
  background: #fff;
  border: 1px solid #e5e3da;
  border-radius: 10px;
  padding: 14px 16px;
}
.chart-title {
  font-size: 12px;
  font-weight: 600;
  color: #5f5e5a;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chart-box canvas {
  width: 100%;
  height: auto;
  display: block;
}

.formulas {
  background: #fff;
  border: 1px solid #e5e3da;
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 18px;
}
.formulas h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
.formulas ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13.5px;
  color: #1f1f1d;
  line-height: 1.7;
}
.formulas li { margin-bottom: 6px; }
.formulas strong { font-weight: 600; }

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; }
