/* RSC 共通スタイル。S0 は節の見出しだけを置く(中身は S3・S4 が書く) */

/* tool */

/* a11y */
/* --- 文字は 14px 以上。インラインの font-size は書き換えず、値ごとに属性セレクタで引き上げる(.note・small は 13px まで可) --- */
[style*="font-size:9px"],[style*="font-size: 9px"],[style*="font-size:10px"],[style*="font-size: 10px"],[style*="font-size:11px"],
[style*="font-size: 11px"],[style*="font-size:12px"],[style*="font-size: 12px"],[style*="font-size:13px"],[style*="font-size: 13px"],
[style*="font-size:.7rem"],[style*="font-size: .7rem"],[style*="font-size:0.7rem"],[style*="font-size: 0.7rem"],[style*="font-size:0.75rem"],
[style*="font-size: 0.75rem"],[style*="font-size:.75rem"],[style*="font-size: .75rem"],[style*="font-size:0.78rem"],[style*="font-size: 0.78rem"],
[style*="font-size:.78rem"],[style*="font-size: .78rem"],[style*="font-size:.8rem"],[style*="font-size: .8rem"],[style*="font-size:0.8rem"],
[style*="font-size: 0.8rem"],[style*="font-size:0.82rem"],[style*="font-size: 0.82rem"],[style*="font-size:.82rem"],[style*="font-size: .82rem"],
[style*="font-size:.83rem"],[style*="font-size: .83rem"],[style*="font-size:0.83rem"],[style*="font-size: 0.83rem"],[style*="font-size:.85rem"],
[style*="font-size: .85rem"],[style*="font-size:0.85rem"],[style*="font-size: 0.85rem"],[style*="font-size:.87rem"],[style*="font-size: .87rem"],
[style*="font-size:0.87rem"],[style*="font-size: 0.87rem"],[style*="font-size:12.5px"],[style*="font-size:12.8px"]
{font-size:14px!important;line-height:1.6}
/* 子へ引き継ぐ親の指定(.85rem など)は上で直る。クラスで小さくしているもの */
label,.serving-row label,.help-text,.ingredient-header,.result-table th,.scale-badge,.badge,.viz-label,.scale-value,
.svc-head .k,.svc-worry .q,.svc-feat p,.svc-step p,.svc-scene .cap,.svc-cta p,.svc-nav-cta,.svc-hero .hchip,.preset-btn,
.toast{font-size:14px}
.help-icon{width:22px;height:22px;font-size:14px;line-height:1}
.result-heading{margin:0 0 10px;font-size:18px;font-weight:700;color:#1e293b;scroll-margin-top:84px}
.result-heading:focus{outline:none}

/* --- タップ対象は 44x44px 以上(文中のリンクを除く) --- */
.svc-brand,.svc-nav-links a{display:inline-flex;align-items:center;min-height:44px}
.svc-nav-links a{padding:0 4px}
.tap44{display:inline-flex;align-items:center;min-height:44px}
footer a{display:inline-flex;align-items:center;min-height:44px;padding:0 6px}
.preset-btn{min-height:44px;min-width:44px;padding:8px 14px;color:#4338ca}
.ingredient-header{gap:10px}
.ingredient-header span[style*="flex:0 0 32px"]{flex-basis:44px!important}
.ingredient-row{gap:10px}
.ingredient-row input{min-height:44px}
.del-btn{width:44px;height:44px;min-width:44px;padding:0;font-size:22px;line-height:1;color:#6b7280;display:inline-flex;align-items:center;justify-content:center}
.del-btn:hover,.del-btn:focus-visible{color:#b91c1c}
.del-btn:focus-visible,.preset-btn:focus-visible,.add-ing-btn:focus-visible{outline:3px solid #1e293b;outline-offset:2px}
.sr-only:focus{position:absolute;z-index:9999;width:auto;height:auto;min-height:44px;margin:0;overflow:visible;clip:auto;white-space:normal;display:inline-flex;align-items:center}
@media (max-width:640px){
  /* 行は「名前」「量・単位・×」の2段。× は 44px 角で、隣の入力欄と 8px 以上あける */
  .ingredient-row{grid-template-columns:1fr 1fr 44px;gap:10px;align-items:center}
  .ingredient-row input{font-size:16px;min-height:44px}
  #ratio{font-size:16px}
  .ing-name{grid-column:1 / -1}
  .del-btn{justify-self:end}
  .preset-btn{font-size:14px}
}

/* --- ボタンの色: 通常・hover・active・focus-visible・disabled のどれでも文字と背景の比 4.5:1 以上 --- */
button.btn,button.btn:hover,button.btn:active,button.btn:focus{opacity:1}
button.btn{background:#c2410c;color:#fff}
button.btn:hover{background:#9a3412}
button.btn:active{background:#7c2d12}
button.btn:focus-visible{outline:3px solid #1e293b;outline-offset:3px}
button.btn:disabled{background:#6b7280;color:#fff;cursor:not-allowed}
.btn[style*="background:#10b981"]{background:#047857!important}
.btn[style*="background:#10b981"]:hover{background:#065f46!important}
.btn[style*="background:#3b82f6"]{background:#1d4ed8!important}
.btn[style*="background:#3b82f6"]:hover{background:#1e40af!important}
.btn[style*="background:#f59e0b"]{background:#b45309!important}
.btn[style*="background:#f59e0b"]:hover{background:#92400e!important}
.add-ing-btn{color:#c2410c}
#clear-all-btn{color:#b91c1c!important}
#validation-error{color:#b91c1c!important}

/* --- 最初の画面: PC もヒーローを畳む(「計算ツールをすぐに使う」は残す) --- */
@media (min-width:641px){
  .svc-hero .svc-hero-in > div:not(.hbtns){display:none!important}
  .svc-hero-in{padding:20px 16px 18px!important}
  .svc-hero .hbtns{margin-top:12px}
  .svc-hero h1{font-size:26px}
  .card:has(#from-serving) > h2:first-child,.card:has(#from-serving) > h2:first-child + p{display:none!important}
}

/* --- 幅 260px(150% 拡大)でも横にあふれない。ads の節の minmax(250px) は 260px の画面で溢れるので、a11y の節で上書き --- */
.ads-block .ads-grid{grid-template-columns:repeat(auto-fit,minmax(min(250px,100%),1fr))}

#comparison-chart{max-width:100%}

/* --- 同意バナー(共有。変えない)が最後の本文を覆わないよう、出ている間だけ下に余白 --- */
body:has(#consent-banner-v2){padding-bottom:160px}

/* ads */
.ads-block{max-width:1080px;margin:0 auto;padding:32px 20px;background:#fff;border-top:1px solid #e5e7eb}
.ads-head{margin:0 0 6px;font-size:14px;line-height:1.4}
.ad-label{display:inline-block;padding:4px 8px;border:1px solid #64748B;border-radius:4px;background:#fff;color:#334155;font-size:14px;line-height:1.2;font-weight:700;letter-spacing:.08em;vertical-align:middle}
.ads-note{margin:0 0 16px;font-size:14px;line-height:1.6;color:#475569}
.ads-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:16px}
.ads-item{background:#f9fafb;border:1px solid #e5e7eb;border-radius:12px;padding:14px;text-align:center}
.ads-name{margin:0 0 4px;font-size:16px;font-weight:700;color:#1e293b}
.ads-desc{margin:0 0 10px;font-size:14px;line-height:1.5;color:#475569}
.ads-link{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;padding:10px 16px;background:#b3261e;color:#fff;font-size:14px;font-weight:700;line-height:1.4;border-radius:8px;text-decoration:none}
.ads-link:focus-visible{outline:3px solid #1e293b;outline-offset:2px}
