/* BMR Calculator — scoped styles (bmr-) */

.bmr-form {
  display: block;
  padding: 1.15rem 1rem 1.35rem;
}

.bmr-intro {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-muted, #5a4a42);
}

/* Unit segmented control */
.bmr-units {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1rem;
  flex-wrap: wrap;
}

.bmr-unit {
  flex: 1 1 0;
  min-width: 140px;
}

.bmr-unit input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bmr-unit span {
  display: block;
  text-align: center;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--color-beige-border, #e0d4c4);
  border-radius: 10px;
  background: #fff;
  color: #4a0e1f;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.bmr-unit input:checked + span {
  background: var(--color-primary, #8b2942);
  border-color: var(--color-primary, #8b2942);
  color: #fff;
}

.bmr-unit input:focus-visible + span {
  outline: 2px solid var(--color-primary, #8b2942);
  outline-offset: 2px;
}

/* Inputs grid */
.bmr-inputs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 0.9rem;
  margin: 0 0 0.9rem;
}

.bmr-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* The class rule above otherwise overrides the [hidden] attribute, leaving the
   metric and imperial height fields both visible at once. */
.bmr-field[hidden] {
  display: none;
}

.bmr-field--wide {
  margin: 0 0 0.9rem;
}

.bmr-field--name {
  margin: 0 0 1.5rem;
  padding: 0 0 1.25rem;
  border-bottom: 1px solid var(--color-beige-border, #e0d4c4);
}

.bmr-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted, #6b5e58);
}

.bmr-opt {
  font-weight: 400;
  color: var(--color-muted, #9a8470);
  font-size: 0.74rem;
}

.bmr-field input,
.bmr-field select {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--color-beige-border, #e0d4c4);
  border-radius: 10px;
  background: #fff;
  color: #2a2220;
  font-size: 1rem;
}

.bmr-ftin {
  display: flex;
  gap: 0.5rem;
}

.bmr-ftin__cell {
  position: relative;
  flex: 1;
}

.bmr-ftin__cell input {
  width: 100%;
  padding-right: 2.2rem;
  box-sizing: border-box;
}

.bmr-ftin__unit {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--color-muted, #9a8470);
}

/* Result */
.bmr-result[hidden],
.bmr-empty[hidden] {
  display: none;
}

.bmr-empty {
  margin: 0.6rem 0 0;
  padding: 0.9rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-muted, #6b5e58);
  background: var(--color-beige, #faf3e8);
  border: 1px dashed var(--color-beige-border, #e0d4c4);
  border-radius: 10px;
}

/* Gauge — matches the BMI / Calorie dial. */
.bmr-gauge {
  max-width: 300px;
  margin: 0.4rem auto 0.6rem;
}

.bmr-gauge__svg {
  width: 100%;
  height: auto;
  display: block;
}

.bmr-gauge__ends {
  display: flex;
  justify-content: space-between;
  max-width: 270px;
  margin: -0.4rem auto 0;
  font-size: 0.72rem;
  color: var(--color-muted, #9a8470);
}

.bmr-gauge__rim {
  filter: drop-shadow(0 1px 1px rgba(74, 14, 31, 0.06));
}

.bmr-gauge__arc {
  filter: drop-shadow(0 1px 2px rgba(74, 14, 31, 0.12));
}

.bmr-gauge__ticks line {
  stroke: #6b5e58;
  stroke-width: 1;
  opacity: 0.5;
}

.bmr-gauge__needle {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.bmr-gauge__needle-line {
  stroke: #3a2c26;
}

.bmr-gauge__needle-hub-outer {
  fill: none;
  stroke: #d4a017;
  stroke-width: 2;
}

.bmr-gauge__needle-hub {
  fill: #7a1834;
}

.bmr-gauge__num {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-serif, Georgia, "Times New Roman", serif);
  fill: var(--color-primary, #8b2942);
}

.bmr-gauge__unit {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font, system-ui, sans-serif);
  fill: #9a8470;
}

.bmr-gauge__cat {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font, system-ui, sans-serif);
  fill: #6b5e58;
}

.bmr-summary {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1.5;
  color: #3a2c26;
}

/* Facts */
.bmr-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0 0 1.1rem;
}

.bmr-fact {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-beige-border, #e7d9c3);
  border-radius: 10px;
  background: var(--color-beige, #faf3e8);
}

.bmr-fact__k {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted, #8a6b52);
}

.bmr-fact__v {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary, #8b2942);
}

/* Section title */
.bmr-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary, #8b2942);
  border-bottom: 2px solid var(--color-beige-border, #eadfce);
  padding-bottom: 0.35rem;
  margin: 0 0 0.4rem;
}

.bmr-section-note {
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--color-muted, #8a7363);
}

/* Activity table — each row is a tappable button that selects that level. */
.bmr-levels {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0 0 1.1rem;
}

.bmr-level {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--color-beige-border, #e7d9c3);
  border-radius: 10px;
  background: #fff;
  color: #3a2c26;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.bmr-level:hover {
  background: #fbf4ef;
}

.bmr-level.is-active {
  background: #fbf4ef;
  border-color: var(--color-primary, #8b2942);
  box-shadow: 0 0 0 1px var(--color-primary, #8b2942) inset;
}

.bmr-level__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}

.bmr-level__text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.bmr-level__label {
  font-size: 0.9rem;
  font-weight: 600;
}

.bmr-level__hint {
  font-size: 0.74rem;
  color: var(--color-muted, #8a7363);
}

.bmr-level__cal {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-primary, #8b2942);
  white-space: nowrap;
}

.bmr-level__cal small {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--color-muted, #9a8470);
  margin-left: 0.18rem;
  text-transform: uppercase;
}

/* Advice */
.bmr-advice__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary, #8b2942);
  border-bottom: 2px solid var(--color-beige-border, #eadfce);
  padding-bottom: 0.35rem;
  margin: 0 0 0.7rem;
}

.bmr-advice__list {
  margin: 0;
  padding-left: 1.1rem;
}

.bmr-advice__list li {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #3a2c26;
}

@media (max-width: 480px) {
  .bmr-facts {
    grid-template-columns: 1fr;
  }

  .bmr-level__label {
    font-size: 0.86rem;
  }
}
