/* ─── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: Roboto, Arial, sans-serif;
  background: #F5F7F7;
}

/* ─── Screen-reader only ────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ─── App shell ─────────────────────────────────────────────────── */
body { display: flex; flex-direction: column; }

#sim-app {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* ─── Stage badge ───────────────────────────────────────────────── */
.stage-badge {
  background: #EAF4F4;
  color: #2C5050;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 10px 14px;
  flex-shrink: 0;
  line-height: 1.4;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #D0E4E4;
}

/* ─── Canvas section ────────────────────────────────────────────── */
#canvas-section {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

#sim-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
}

/* ─── Controls panel ────────────────────────────────────────────── */
#controls-panel {
  background: #ffffff;
  border-top: 1px solid #D8E2E2;
  padding: 10px 14px 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─── Settings row ──────────────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.damping-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.slider-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  transition: opacity 0.15s;
}

.slider-label {
  font-size: 11px;
  font-weight: 600;
  color: #5A7272;
  white-space: nowrap;
  flex-shrink: 0;
}

input[type="range"] {
  flex: 1;
  min-width: 60px;
  accent-color: #004445;
  cursor: pointer;
}

input[type="range"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ─── Action row ────────────────────────────────────────────────── */
.action-row {
  display: flex;
  gap: 8px;
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  height: 32px;
  padding: 0 18px;
  border: none;
  border-radius: 5px;
  font-family: Roboto, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: #004445;
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: #006668; }
.btn-primary:disabled { background: #8A9A9B; cursor: not-allowed; opacity: 0.75; }

.btn-secondary {
  background: transparent;
  color: #004445;
  border: 1.5px solid #004445;
}
.btn-secondary:hover:not(:disabled) { background: #EAF4F4; }
.btn-secondary:disabled { color: #8A9A9B; border-color: #B0BFBF; cursor: not-allowed; opacity: 0.75; }

.btn-secondary.active {
  background: #EAF4F4;
  border-color: #004445;
}

.btn:focus-visible { outline: 3px solid #FFD166; outline-offset: 2px; }
input[type="range"]:focus-visible { outline: 3px solid #FFD166; outline-offset: 2px; }
