/* =====================================================================
   style.css — カフェイン摂取量チェック ツール固有の微調整のみ。
   共通スタイルは /_shared/shirugear.css に任せる（結果表示は sg-result）。
   ===================================================================== */

/* 結果値・内訳はタブ幅数字で桁を揃える */
.sg-result__value,
.sg-result-row__value {
  font-variant-numeric: tabular-nums;
}

.sg-mb-4 {
  margin-bottom: var(--sg-space-4);
}

/* 飲料の入力行：飲み物名（左）＋杯数入力（右） */
.cf-drink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--sg-border, #e5e7eb);
}
.cf-drink:first-child {
  border-top: none;
}
.cf-drink__name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.95rem;
  cursor: pointer;
  min-width: 0;
}
.cf-drink__title {
  font-weight: 600;
}
.cf-drink__meta {
  font-size: 0.78rem;
  color: var(--sg-muted, #777);
}
.cf-drink__control {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.cf-drink__input {
  width: 76px;
  text-align: right;
}
.cf-drink__unit {
  font-size: 0.85rem;
  color: var(--sg-muted, #777);
}

/* 目安上限を超えたときの注意色 */
.sg-result.is-warn .sg-result__value {
  color: #d9480f;
}
.sg-result.is-warn .sg-result__sub {
  color: #d9480f;
  font-weight: 600;
}

.sg-mt-2 {
  margin-top: var(--sg-space-2, 8px);
}

/* 比較する対象（上限の目安）の切替 */
.cf-target {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--sg-border, #e5e7eb);
}
.cf-target__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sg-muted, #777);
}
.cf-target__options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cf-target__btn {
  font: inherit;
  font-size: 0.9rem;
  padding: 6px 14px;
  border: 1px solid var(--sg-border, #cbd5e1);
  border-radius: 999px;
  background: var(--sg-surface, #fff);
  color: var(--sg-text, #1f2937);
  cursor: pointer;
}
.cf-target__btn[aria-pressed="true"] {
  background: var(--sg-primary, #3b5bdb);
  border-color: var(--sg-primary, #3b5bdb);
  color: #fff;
  font-weight: 600;
}

/* 上限の目安との比較バー */
.cf-gauge {
  margin-top: 14px;
  text-align: left;
}
.cf-gauge__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.cf-gauge__target {
  font-size: 0.85rem;
  color: var(--sg-muted, #777);
}
.cf-gauge__pct {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cf-gauge__track {
  height: 12px;
  border-radius: 999px;
  background: var(--sg-border, #e5e7eb);
  overflow: hidden;
}
.cf-gauge__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.25s ease;
  background: #2f9e44; /* 既定=緑 */
}
.cf-gauge.is-ok .cf-gauge__fill {
  background: #2f9e44; /* 緑=余裕 */
}
.cf-gauge.is-near .cf-gauge__fill {
  background: #f08c00; /* 黄=近い */
}
.cf-gauge.is-over .cf-gauge__fill {
  background: #e03131; /* 赤=超過 */
}
.cf-gauge.is-over .cf-gauge__pct {
  color: #e03131;
}
.cf-gauge__remain {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--sg-muted, #777);
}
.cf-gauge.is-over .cf-gauge__remain {
  color: #e03131;
  font-weight: 600;
}
