/* 栄養バランスチェッカー 共通スタイル。節ごとに担当が分かれる。 */

/* ===== tool ===== */
#r-chart-wrap { position: relative; height: 300px; max-width: 420px; margin: 16px auto; }
@media (max-width: 360px) { #r-chart-wrap { height: 260px; } }
#quiz-area, #result, #quiz-start { scroll-margin-top: 80px; }
#nbc-flow-status:empty { display: none; }
#nbc-flow-status:focus { outline: none; }
#r-sim { margin: 16px 0; padding: 4px 16px 12px; background: #f8fafc; border-radius: 12px; font-size: 14px; line-height: 1.8; color: #374151; }
#r-sim > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
#r-sim .sim-field { margin: 8px 0; }
#r-sim .sim-field label { display: block; font-weight: 600; margin-bottom: 4px; }
#r-sim .sim-field select { width: 100%; min-height: 44px; font-size: 14px; padding: 8px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #1f2937; }
#r-sim-result { font-weight: 600; margin: 12px 0 4px; }
@media (prefers-reduced-motion: reduce) { #q-bar { transition: none !important; } }

/* ===== a11y ===== */
/* 読み上げ用の状態表示(画面には出さない) */
#nbc-status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* 文字は 14px 以上(index.html のインライン style は書き換えず、ここで引き上げる。<small> と .note は対象外) */
[style*="font-size:9px"], [style*="font-size:10px"], [style*="font-size:11px"], [style*="font-size:12px"], [style*="font-size:13px"],
[style*="font-size: 12px"], [style*="font-size: 13px"],
[style*="font-size:.78rem"], [style*="font-size:.8rem"], [style*="font-size:0.8rem"], [style*="font-size:.85rem"] { font-size: 14px !important; }
.hd-cta, .hero-badge, .trust-badge, .pill, .btn-hero .free, .badge, label { font-size: 14px !important; }
.pill { font-size: 14px !important; }
#consent-banner-v2 { font-size: 14px !important; }

/* タップ対象は 44px 以上(文中のリンクを除く) */
a.sr-only:focus { clip: auto !important; width: auto !important; height: auto !important; overflow: visible !important; margin: 0 !important;
  min-height: 44px; display: inline-flex !important; align-items: center; white-space: normal; font-size: 14px !important; }
body > div[style*="background:#2E7D32"] a, nav[aria-label="パンくずリスト"] a, #tool-disclaimer li a, footer a, #consent-banner-v2 a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding-left: 6px; padding-right: 6px; box-sizing: border-box; }
.hd-cta { display: none; }
@media (min-width: 640px) { .hd-cta { display: inline-flex !important; align-items: center; min-height: 44px; } }

/* 横あふれ防止(広告リンクは折り返す) */
a[href*="px.a8.net"] { white-space: normal; max-width: 100%; }
img, canvas, table { max-width: 100%; }

/* 同意バナー(共有物)に隠れないよう、ページの下に余白と、スクロール時の余白を取る */
body:has(#consent-banner-v2) { padding-bottom: 140px; }
html:has(#consent-banner-v2) { scroll-padding-bottom: 150px; }

/* フォーカス枠は 3px。暗い背景では白 */
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #1d4ed8 !important; outline-offset: 2px !important; }
footer a:focus-visible, #consent-banner-v2 :focus-visible, body > div[style*="background:#2E7D32"] a:focus-visible { outline-color: #fff !important; }

/* コントラスト 4.5:1 以上(通常の文字)。大きな文字は 3:1 以上 */
[style^="color:#388E3C"], [style*=";color:#388E3C"], [style*=" color:#388E3C"] { color: #2E7D32 !important; }
[style^="color:#4CAF50"], [style*=";color:#4CAF50"], [style*=" color:#4CAF50"] { color: #2E7D32 !important; }
[style^="color:#9ca3af"], [style*=";color:#9ca3af"], [style*=" color:#9ca3af"] { color: #6b7280 !important; }
[style^="color:#FF6B6B"], [style*=";color:#FF6B6B"], [style*=" color:#FF6B6B"] { color: #B91C1C !important; }
[style^="color:#607D8B"], [style*=";color:#607D8B"], [style*=" color:#607D8B"] { color: #455A64 !important; }
[style^="color:#e65100"], [style*=";color:#e65100"], [style*=" color:#e65100"] { color: #bf360c !important; }
[style^="color:#f57c00"], [style*=";color:#f57c00"], [style*=" color:#f57c00"] { color: #9a3412 !important; }
[style^="color:#C8E6C9"], [style*=";color:#C8E6C9"], [style*=" color:#C8E6C9"] { color: #ffffff !important; }
[style^="color:#cbd5e1"], [style*=";color:#cbd5e1"], [style*=" color:#cbd5e1"] { color: #ffffff !important; }
[style^="color:#e0e7ff"], [style*=";color:#e0e7ff"], [style*=" color:#e0e7ff"] { color: #ffffff !important; }
.btn { background: #2E7D32 !important; }
.btn:hover { opacity: 1; background: #1B5E20 !important; }
.hd-cta { background: #2E7D32 !important; }
.hd-cta:hover { background: #1B5E20 !important; }
.btn-hero { background: linear-gradient(90deg, #C2410C, #B91C1C) !important; }
.btn-hero .free, .hero-badge em { color: #B91C1C !important; }
h1.hero-h .accent { color: #388E3C !important; }
.pill .ck { color: #2E7D32 !important; }
.logo small { color: #455A64 !important; }
.hero-strip .ph span { color: #111827 !important; }
a.sr-only, #back-to-top { background: #1B5E20 !important; }
#quiz-start .btn[data-nbc-start] { background: linear-gradient(90deg, #C2410C, #B91C1C) !important; }
#r-actions .btn:nth-of-type(1) { background: #6d28d9 !important; }
#r-actions .btn:nth-of-type(2) { background: #92400e !important; }
#r-actions .btn:nth-of-type(3) { background: #be185d !important; }
#r-delete.btn { background: #fff !important; color: #374151 !important; }
a[href*="twitter.com/intent"] { background: #0f1419 !important; color: #fff !important; }
a[href*="line.me"] { background: #05803a !important; color: #fff !important; }
body > div[style*="background:#2E7D32"] { color: #fff; }
footer div[style*="1e3a5f"] { background: linear-gradient(135deg, #1e3a5f, #1d4ed8) !important; }
footer div[style*="1e3a5f"] p { color: #fff !important; }

/* 動きを減らす設定のとき */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .btn:active, .btn-hero:hover, .quiz-opt:active { transform: none !important; }
}

/* ===== ads ===== */
.ads-block a:hover { background: #f3f4f6; }
.ads-block a:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
@media print { #ads-block { display: none !important; } }
