:root {
  --sidebar-w: 340px;
  --ink: #2b2b2b;
  --muted: #6b6b6b;
  --rule: #e6e6e6;
}

body {
  margin: 0;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}

.app-root {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  padding: 24px 22px;
  border-right: 1px solid var(--rule);
  box-sizing: border-box;
  overflow-y: auto;
}

.main {
  flex: 1 1 auto;
  padding: 8px 16px;
}

.logo {
  display: block;
  width: 52px;
  height: auto;
  margin: 0 auto 18px;
}

.intro {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.slider-block {
  margin: 22px 0 8px;
}

.slider-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 14px;
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 22px 0;
}

.legend {
  font-size: 13px;
  line-height: 1.5;
}

.legend ul {
  padding-left: 18px;
  margin: 8px 0 0;
}

.legend li {
  margin-bottom: 6px;
}

/* Grey sliders (override rc-slider's default blue) */
.rc-slider-track {
  background-color: #9e9e9e;
}
.rc-slider-rail {
  background-color: #e2e2e2;
}
.rc-slider-handle,
.rc-slider-handle-dragging {
  border-color: #8a8a8a !important;
  background-color: #ffffff;
  box-shadow: none !important;
}
.rc-slider-handle:hover,
.rc-slider-handle:active,
.rc-slider-handle:focus {
  border-color: #6f6f6f !important;
  box-shadow: 0 0 0 4px rgba(140, 140, 140, 0.25) !important;
}
.rc-slider-dot {
  border-color: #d4d4d4;
}
.rc-slider-dot-active {
  border-color: #9e9e9e;
}

.edit-tabs {
  display: flex;
  margin: 14px 0 4px;
}

.edit-tabs label {
  flex: 1;
  text-align: center;
  padding: 7px 8px;
  border: 1px solid var(--rule);
  font-size: 13px;
  cursor: pointer;
}

.edit-tabs label:first-of-type { border-radius: 6px 0 0 6px; }
.edit-tabs label:last-of-type { border-radius: 0 6px 6px 0; border-left: none; }
.edit-tabs input { display: none; }
.edit-tabs label:has(input:checked) {
  background: #f0f0f0;
  font-weight: 600;
}

.help-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: #ffffff;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-style: normal;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
  z-index: 900;
}

.help-fab:hover {
  background: #f3f3f3;
  color: var(--ink);
}

.modal-section {
  margin: 16px 0 4px;
  font-size: 14px;
}

.modal-section:first-of-type { margin-top: 8px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: #fff;
  width: min(92%, 820px);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 8px;
  padding: 18px 24px 22px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.modal-doc {
  display: block;
  margin-top: 10px;
  background: #fff;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 16px; }

.modal-close {
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  padding: 0 4px;
}

.modal-close:hover { color: var(--ink); }

.modal-box ul {
  font-size: 13.5px;
  line-height: 1.5;
  padding-left: 18px;
}

.modal-box li { margin-bottom: 8px; }

.formula-group {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 6px 12px 12px;
  margin-top: 16px;
}

.point-detail {
  font-size: 13px;
  line-height: 1.55;
  background: #f7f7f7;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 10px 12px;
}

.point-detail .point-comp { font-weight: 600; margin-top: 4px; }
.point-detail .point-cond { color: var(--muted); }
.point-detail .point-sample { margin-top: 4px; font-weight: 600; }
.point-detail .point-warn { color: #b00020; margin-top: 4px; }

.formula-title {
  font-size: 14px;
}

.dev-toggle {
  font-size: 13px;
  font-weight: 600;
}

.dev-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.45;
}

.caveat {
  margin-top: 20px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  background: #faf6ee;
  border: 1px solid #ece2cc;
  border-radius: 6px;
  padding: 10px 12px;
}
