/* =====================================================================
   style.css — 家計の黄金比（予算配分） ツール固有の微調整のみ。
   共通スタイルは /_shared/shirugear.css に任せる（結果表示は sg-result）。
   ===================================================================== */

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

/* 補助ラベルを入力直下に詰める */
.sg-field .sg-help {
  margin-top: var(--sg-space-1);
}

/* 配分モデルの切替タブ */
.hb-modes {
  display: flex;
  gap: 8px;
  margin-bottom: var(--sg-space-4);
}
.hb-modes label {
  flex: 1 1 0;
  text-align: center;
  padding: 10px 8px;
  border: 1px solid var(--sg-border, #e5e7eb);
  border-radius: var(--sg-radius, 8px);
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}
.hb-modes input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.hb-modes label:has(input:checked) {
  border-color: var(--sg-primary, #3b5bdb);
  background: rgba(59, 91, 219, 0.08);
  font-weight: 600;
  color: var(--sg-primary, #3b5bdb);
}

/* 区切り線 */
.sg-hr {
  border: none;
  border-top: 1px solid var(--sg-border, #e5e7eb);
  margin: var(--sg-space-4) 0;
}

/* 費目の配分行 */
.hb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--sg-border, #eef0f4);
}
.hb-row:last-child {
  border-bottom: none;
}
.hb-row__name {
  flex: 1 1 auto;
  font-size: 0.92rem;
  line-height: 1.4;
}
.hb-row__pct {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.hb-pct-input {
  width: 4.5rem;
  text-align: right;
}
.hb-row__unit {
  font-size: 0.85rem;
  color: var(--sg-muted, #777);
}
.hb-row__amt {
  flex: 0 0 auto;
  min-width: 6.5rem;
  text-align: right;
  font-weight: 600;
}

/* 合計%の表示 */
.hb-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: var(--sg-space-4);
  padding: 10px 12px;
  border-radius: var(--sg-radius, 8px);
  background: rgba(59, 91, 219, 0.06);
  font-size: 0.92rem;
}
.hb-total__label {
  color: var(--sg-muted, #777);
}
.hb-total__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hb-total.is-warn {
  background: rgba(220, 120, 20, 0.1);
}
.hb-total.is-warn .hb-total__value {
  color: #c26a00;
}
