/* =========================================================
   /assets/css/feeding-calculator.css
   給与量計算ツール専用
   ========================================================= */

.page-intro {
  margin-bottom: 20px;
}

.page-intro-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.35;
  font-weight: 900;
  color: var(--text-main);
}

.page-intro-title .material-symbols-rounded {
  color: var(--pette-blue);
  font-size: 26px;
}

.page-intro-lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-muted);
}

/* =========================
   Calculator layout
   ========================= */

.feeding-calc {
  display: grid;
  gap: 18px;
}

.calc-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.calc-block {
  padding: 22px 0;
  border-bottom: 1px solid #eef1f4;
}

.calc-block:first-child {
  padding-top: 0;
}

.calc-block:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.calc-block-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 900;
  color: var(--text-main);
}

.calc-block-title small {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

/* 体重の「5.0 kg」横並び維持 */
.calc-block-title > span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.calc-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-input {
  width: 140px;
  height: 40px;
  padding: 8px 10px;
  border: 1px solid #dfe5ec;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  color: var(--text-main);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.calc-input:focus {
  outline: none;
  border-color: var(--pette-blue);
  box-shadow: 0 0 0 3px rgba(111, 156, 209, 0.22);
}

.calc-unit {
  font-size: 14px;
  color: var(--text-main);
}

.calc-weight-value {
  font-family: "Inter", sans-serif;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

/* =========================
   Range
   ========================= */

.calc-range {
  width: 100%;
  appearance: none;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--pette-blue) 0%,
    var(--pette-blue) var(--progress, 0%),
    #e5eaf0 var(--progress, 0%),
    #e5eaf0 100%
  );
  outline: none;
  cursor: pointer;
}

.calc-range::-webkit-slider-thumb {
  appearance: none;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--pette-blue);
  box-shadow: 0 5px 14px rgba(30, 42, 68, 0.22);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.calc-range::-webkit-slider-thumb:hover {
  transform: scale(1.06);
  box-shadow: 0 7px 18px rgba(30, 42, 68, 0.26);
}

.calc-range::-moz-range-thumb {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--pette-blue);
  box-shadow: 0 5px 14px rgba(30, 42, 68, 0.22);
  cursor: pointer;
}

/* =========================
   Choices
   ========================= */

.bcs-grid,
.calc-choice-grid {
  display: grid;
  gap: 10px;
}

.bcs-grid {
  grid-template-columns: repeat(5, 1fr);
}

.calc-choice-grid {
  grid-template-columns: repeat(4, 1fr);
}

.bcs-item,
.calc-choice {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #dfe5ec;
  border-radius: 12px;
  background: #fff;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.bcs-item:hover,
.calc-choice:hover {
  border-color: var(--pette-blue);
  color: var(--pette-blue);
}

.bcs-item:active,
.calc-choice:active {
  transform: scale(0.98);
}

.bcs-item.is-active,
.calc-choice.is-active {
  background: var(--pette-blue);
  border-color: var(--pette-blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(111, 156, 209, 0.28);
  transform: translateY(-1px);
}

/* =========================
   BCS image
   ========================= */

.bcs-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-height: 126px;
  padding: 10px 8px;
}

.bcs-item img,
.bcs-img {
  width: 100%;
  height: 58px;
  object-fit: contain;
  display: block;
  margin-bottom: 6px;
  filter: none;
  opacity: 0.68;
  transition: opacity .2s ease, filter .2s ease, transform .2s ease;
}

.bcs-label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  color: var(--text-muted);
  word-break: keep-all;
}

.bcs-item.is-active img,
.bcs-item.is-active .bcs-img {
  filter: brightness(0) invert(1);
  opacity: 1;
  transform: scale(1.04);
}

.bcs-item.is-active .bcs-label {
  color: #fff;
}

/* =========================
   Assist accordion
   ========================= */

.calc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  color: var(--pette-blue);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity .15s ease;
}

.calc-toggle:hover {
  opacity: .75;
}

.calc-toggle::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #eef4fb;
  color: var(--pette-blue);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.calc-toggle.is-open::after {
  content: "−";
}

.calc-assist {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  margin-top: 0;
  padding: 0 14px;
  border-radius: 12px;
  background: #f6f8fb;
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-muted);
  transition:
    max-height 0.35s ease,
    opacity 0.25s ease,
    transform 0.25s ease,
    margin-top 0.25s ease,
    padding 0.25s ease,
    border-color 0.25s ease;
}

.calc-assist.is-open {
  max-height: 220px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 10px;
  padding: 12px 14px;
  border-color: #e5eaf0;
}

/* =========================
   Result
   ========================= */

.calc-result {
  position: sticky;
  bottom: 12px;
  z-index: 20;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;

  background: #fff;
  border: 1px solid rgba(111, 156, 209, 0.42);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.calc-result-label {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  color: var(--text-muted);
}

.calc-result-main {
  margin: 0;
  color: var(--text-main);
  line-height: 1;
}

.calc-result-num {
  font-family: "Inter", sans-serif;
  font-size: 42px;
  font-weight: 900;
  color: var(--pette-blue);
  letter-spacing: -0.03em;
}

.calc-result-unit {
  margin-left: 5px;
  font-size: 16px;
  font-weight: 900;
  color: var(--text-main);
}

/* =========================
   Mobile
   ========================= */

@media (max-width: 640px) {
  .wrapper {
    padding: 20px 16px 72px;
  }

  .page-intro {
    margin-bottom: 18px;
  }

  .page-intro-title {
    font-size: 24px;
  }

  .calc-card {
    padding: 18px;
    border-radius: 16px;
  }

  .calc-block {
    padding: 20px 0;
  }

  .calc-block-title {
    display: block;
    font-size: 16px;
    margin-bottom: 13px;
  }

  .calc-block-title small {
    display: block;
    margin-top: 2px;
  }

  .calc-block-title > span {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    margin-top: 2px;
  }

  .calc-weight-value {
    font-size: 28px;
  }

  .calc-input {
    width: 130px;
  }

  .bcs-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .bcs-item {
    min-height: 104px;
    padding: 9px 5px;
    border-radius: 12px;
  }

  .bcs-item img,
  .bcs-img {
    height: 48px;
    margin-bottom: 5px;
  }

  .bcs-label {
    font-size: 12.5px;
    line-height: 1.35;
  }

  .calc-choice-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .calc-choice {
    min-height: 46px;
    font-size: 13px;
  }

  .calc-result {
    align-items: flex-end;
    padding: 18px 20px;
  }

  .calc-result-num {
    font-size: 38px;
  }
}

/* =========================
   Narrow phones
   ========================= */

@media (max-width: 390px) {
  .bcs-grid {
    gap: 6px;
  }

  .bcs-item {
    min-height: 98px;
    padding: 8px 4px;
  }

  .bcs-item img,
  .bcs-img {
    height: 42px;
  }

  .bcs-label {
    font-size: 11.5px;
  }
}

/* =========================
   Life Stage
   ========================= */

.calc-life-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.calc-life-grid .calc-choice {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  min-height: 64px;
  padding: 10px 6px;
  line-height: 1.4;
}

.calc-life-grid .calc-choice small {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.3;
}

.calc-life-grid .calc-choice.is-active small {
  color: rgba(255,255,255,0.9);
}

/* =========================
   Neuter
   ========================= */

.calc-neuter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.calc-neuter-grid .calc-choice {
  min-height: 54px;
}

/* =========================
   Constitution
   ========================= */

.calc-constitution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 640px) {
  .calc-constitution-grid {
    gap: 8px;
  }
}

/* =========================
   Advice（説明BOXのみ）
   ========================= */

.calc-advice {
  margin-top: -10px;
}

/* 説明BOX */
.calc-info-box {
  background: #f8f3ea;
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.75;
  margin-top: 20px;
}

.calc-info-box p {
  margin: 0 0 8px;
}

.calc-info-box p:last-child {
  margin-bottom: 0;
}

.calc-result-kcal {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.85;
}

.calc-help {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}