/* NutriMap Japan — スタイルシート v2.0 */
/* カラーパレット（SD-001 §4.1 準拠） */
/* primary: #2D6A2D  secondary: #1A5276  warning: #C0392B  info: #2471A3 */
/* background: #FAFAFA  card: #FFFFFF  border: #E0E0E0 */
/* text-main: #212121  text-sub: #757575 */

/* ── リセット & ベース ─────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --primary:    #2D6A2D;
  --secondary:  #1A5276;
  --warning:    #C0392B;
  --info:       #2471A3;
  --bg:         #FAFAFA;
  --card:       #FFFFFF;
  --border:     #E0E0E0;
  --text:       #212121;
  --text-sub:   #757575;
  --light-blue: #EEF4FF;
  --gold:       #CCAA00;
  --radius:     6px;
  --shadow:     0 1px 4px rgba(0,0,0,.08);
}

:focus-visible {
  outline: 2px solid #1A5276;
  outline-offset: 2px;
}

/* スクロールバー幅を常時確保＝コンテンツ高が変わってスクロールバーが出入りしても
   本文が左右にズレない（検索結果ページ等での横シフト予防の保険）。 */
html { scroll-behavior: smooth; scrollbar-gutter: stable; color-scheme: only light; }

body {
  font-family: "Noto Sans JP", Meiryo, "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 1rem;
  font-weight: 500;   /* Noto Sans JP 400 は和文で細く読みにくいため中太を基本に */
  line-height: 1.7;
  margin: 0;
  color: var(--text);
  background: #fff;   /* サイト全体の背景はトップページ同様に白を基調 */
}

a { color: var(--secondary); }
a:hover { opacity: .85; }

img { max-width: 100%; height: auto; }

/* ── レイアウト ───────────────────────────────────────── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main.container {
  margin-top: 2rem;
  margin-bottom: 3rem;
}

/* 法務系ページ（免責・利用規約・プライバシー・お問い合わせ）共通レイアウト。
   非adminページはCSPでインラインstyle属性がブロックされるためクラスで指定する。 */
.legal-page {
  max-width: 820px;
  margin: 2.5rem auto 3.5rem;
  padding: 0 1.25rem;
  line-height: 1.85;
}
.legal-page h1 { margin-bottom: .25rem; }
.legal-page .legal-updated { color: var(--text-sub); font-size: .85rem; margin: 0 0 1.6rem; }
.legal-page .legal-note { color: var(--text-sub); font-size: .9rem; margin: .6rem 0 1.4rem; }
.legal-page h2 {
  margin-top: 1.9rem;
  font-size: 1.12rem;
  color: var(--secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: .3rem;
}
.legal-page ul { padding-left: 1.3rem; }
.legal-page li { margin: .35rem 0; }
.legal-narrow { max-width: 640px; }

/* よくあるご質問（FAQ）：モダンなアコーディオン。details/summary で JS 不要・CSPセーフ。 */
.faq { max-width: 880px; }
.faq .faq-lead { color: var(--text-sub); margin: 0 0 2rem; }
.faq .faq-cat {
  margin: 2.4rem 0 1rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--primary);
  border: none;
  border-left: 4px solid var(--primary);
  padding: .1rem 0 .1rem .65rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.faq-cat-ico {
  flex: 0 0 auto;
  width: 1.2em;
  height: 1.2em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  margin: .65rem 0;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.faq-item:hover { border-color: #bcd3bc; }
.faq-item[open] {
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(45, 106, 45, .09);
}
.faq-q {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 1.05rem 1.2rem;
  font-weight: 600;
  font-size: .98rem;
  line-height: 1.6;
  color: #2b2b2b;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::before {
  content: "Q";
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.faq-q::after {
  content: "＋";
  margin-left: auto;
  color: var(--primary);
  font-size: 1.15rem;
  line-height: 1.6;
  transition: transform .2s;
}
.faq-item[open] .faq-q::after { content: "－"; }
.faq-a {
  padding: 0 1.2rem 1.2rem 3.55rem;
  color: #454545;
  font-size: .94rem;
  line-height: 1.85;
}
.faq-a a { color: var(--primary); font-weight: 600; text-decoration: none; }
.faq-a a:hover { text-decoration: underline; }
/* 「解決しない場合はこちら」独立バナー（FAQリストの外・ページ末尾） */
.faq-contact-box {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: 2.2rem 0 .5rem;
  padding: 1.15rem 1.35rem;
  background: var(--surface-tint, #eef4ff);
  background: #eef7ee;
  border: 1px solid #cfe6cf;
  border-radius: 14px;
}
.faq-contact-ico {
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  stroke: var(--primary);
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.faq-contact-title {
  margin: 0 0 .2rem;
  font-weight: 700;
  color: var(--primary);
}
.faq-contact-text p { margin: 0; color: #454545; font-size: .95rem; line-height: 1.7; }
.faq-contact-text a { color: var(--primary); font-weight: 700; text-decoration: none; }
.faq-contact-text a:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .faq-a { padding-left: 1.2rem; }
  .faq-contact-box { flex-direction: column; text-align: center; }
}
/* お問い合わせフォーム（CSPでインラインstyle属性が無効化されるためクラスで指定） */
.legal-field { margin-bottom: 1rem; }
.legal-form label { display: block; margin-bottom: .25rem; font-weight: 600; }
.legal-req { color: var(--warning); }
.legal-form input[type="text"],
.legal-form input[type="email"],
.legal-form textarea {
  width: 100%;
  padding: .55rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: inherit;
  box-sizing: border-box;
}
.legal-form textarea { resize: vertical; }
.legal-hp { display: none !important; }   /* ハニーポット（display:none を確実に効かせる） */
.legal-alert { padding: 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.legal-alert-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.legal-alert-danger { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }
#main-content {
  padding-bottom: 4rem;
}

/* ── ヘッダー（sticky） ───────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .75rem 1.25rem;
  max-width: 1080px;
  margin: 0 auto;
}

.site-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo:hover { opacity: .9; }

/* ヘッダー検索バー */
.header-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.header-search input[type="search"] {
  flex: 1;
  padding: .4rem .8rem;
  font-size: .9rem;
  border: none;
  border-radius: var(--radius);
  background: rgba(255,255,255,.18);
  color: #fff;
  outline: none;
}
.header-search input[type="search"]::placeholder { color: rgba(255,255,255,.7); }
.header-search input[type="search"]:focus {
  background: rgba(255,255,255,.28);
  outline: 2px solid rgba(255,255,255,.6);
}

/* ヘッダーナビ */
.site-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-shrink: 0;
}
.site-nav a {
  color: rgba(255,255,255,.9);
  text-decoration: none;
  font-size: .9rem;
  white-space: nowrap;
}
.site-nav a:hover { color: #fff; text-decoration: underline; }

/* ハンバーガー（モバイル） */
.hamburger-menu { display: none; }
.hamburger-summary {
  list-style: none;
  cursor: pointer;
  color: #fff;
  font-size: 1.4rem;
  padding: .25rem .5rem;
}
.hamburger-summary::-webkit-details-marker { display: none; }
.hamburger-nav {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  background: var(--primary);
  padding: .75rem 1.25rem 1rem;
  border-top: 1px solid rgba(255,255,255,.2);
}
.hamburger-nav a {
  color: rgba(255,255,255,.9);
  text-decoration: none;
  font-size: 1rem;
  padding: .25rem 0;
}

/* タブレット・デスクトップ: フラットナビ */
@media (min-width: 768px) {
  .hamburger-menu { display: none !important; }
  .site-nav { display: flex !important; }
}
@media (max-width: 767px) {
  .site-nav { display: none !important; }
  .hamburger-menu { display: block; }
  .header-search { display: none; }
}

/* ── 安全情報バナー ────────────────────────────────────── */
.safety-banner {
  background: #FFF3CD;
  border-bottom: 2px solid var(--warning);
  padding: .6rem 1.25rem;
  font-size: .9rem;
  color: #856404;
  text-align: center;
}
.safety-banner a { color: var(--warning); font-weight: 600; }

/* ── フッター ─────────────────────────────────────────── */
.site-footer {
  background: #1a1a1a;
  color: rgba(255,255,255,.7);
  padding: 2rem 1.25rem 1.5rem;
  font-size: .85rem;
}
.site-footer .footer-inner {
  max-width: 1080px;
  margin: 0 auto;
}
.site-footer .footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: block;
  margin-bottom: .5rem;
}
.site-footer .footer-disclaimer {
  margin: .5rem 0 1rem;
  line-height: 1.6;
  color: rgba(255,255,255,.6);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .75rem;
}
.footer-links a { color: rgba(255,255,255,.75); text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-copy { color: rgba(255,255,255,.4); font-size: .8rem; }

/* ── パンくずリスト ────────────────────────────────────── */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  font-size: .85rem;
  margin-bottom: 1.25rem;
  color: var(--text-sub);
}
.breadcrumb a { color: var(--secondary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--text-sub); }

/* ── ヒーローセクション（トップページ） ────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1a4a1a 100%);
  color: #fff;
  padding: 3rem 1.25rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0 0 .5rem;
  color: #fff;
  border: none;
}
.hero p {
  font-size: 1.05rem;
  opacity: .85;
  margin: 0 0 1.5rem;
}
.hero-search {
  display: flex;
  max-width: 600px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
}
.hero-search input[type="search"] {
  flex: 1;
  padding: .75rem 1rem;
  font-size: 1rem;
  border: none;
  outline: none;
  color: var(--text);
}
.hero-search button {
  padding: .75rem 1.25rem;
  background: #fff;
  color: var(--secondary);
  border: none;
  border-left: 2px solid var(--secondary);
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.hero-search button:hover {
  background: var(--secondary);
  color: #fff;
}

/* ヘッダードロップダウン（position:fixedはJSで付与） */
#header-search-results {
  display: none;
  z-index: 500;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  overflow: hidden;
}

/* Google風オートコンプリートラッパー */
.hero-search-wrap {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}
.hero-search-wrap .hero-search {
  max-width: 100%;
  margin: 0;
}

/* オートコンプリートドロップダウン共通 */
#hero-dropdown,
#search-dropdown,
#header-search-results {
  text-align: left;
}

#hero-dropdown,
#search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 400;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  overflow: hidden;
}

/* スマホ：トップの検索候補は全幅だと外側に触れる隙間がなく、候補の下（ページ）をスクロール
   しづらい。幅を狭めて左寄せにし、右側にページをスクロールできる隙間を作る。
   また先頭の <群> 接頭辞（<魚類> 等）を隠して食品名が読めるようにする（PCは表示）。 */
@media (max-width: 576px) {
  #hero-dropdown { right: auto; width: 80%; min-width: 240px; }
  #hero-dropdown .dd-group { display: none; }
  /* 候補は8個まで表示（9個目以降を隠す。「すべて検索」リンクは food-item ではないので残る）。 */
  #hero-dropdown .dropdown-food-item:nth-of-type(n+9) { display: none; }
  /* /foods/search の検索候補：スマホでは幅が広すぎるため、虫眼鏡ボタンの左border（縦線）まで
     に右端を詰める。ボタン幅54px＋input-group右border2px＝56px分だけ右を空ける
     （実測：viewport 360/390 とも wrap.right−button.x=56px で一定）。PCは right:0 のまま不変。 */
  #search-dropdown { right: 56px; }
  /* 候補の見え方をトップページ(hero)と合わせる：<群>接頭辞を隠し、候補は8件まで表示。 */
  #search-dropdown .dd-group { display: none; }
  #search-dropdown .dropdown-food-item:nth-of-type(n+9) { display: none; }
}

/* /foods/search ページ用ラッパー */
.search-autocomplete-wrap {
  position: relative;
  max-width: 560px;   /* PCで横に伸びすぎないよう上限。スマホは画面幅未満のため実質全幅で無影響 */
}
.search-autocomplete-wrap #search-dropdown {
  border-top: 1px solid #ddd;
  border-radius: 8px;
  margin-top: 2px;
}

/* ── セクション見出し ─────────────────────────────────── */
h1, h2, h3 { margin-top: 0; }
h1 {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: .3rem;
  font-size: 1.5rem;
}
h2 { color: var(--primary); font-size: 1.25rem; }
h3 { color: var(--text); font-size: 1.05rem; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-title h2 { margin: 0; }
.section-title a { font-size: .9rem; }

/* ── カード共通 ───────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── 食品カード ───────────────────────────────────────── */
.food-card-wrap {
  position: relative;
}
.food-card {
  display: block;
  padding: .9rem 1rem 2.8rem; /* 右下ボタン分の余白 */
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s, border-color .15s;
  position: relative;
}
.food-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
  border-color: var(--secondary);
}
.food-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
  margin-bottom: .4rem;
}
.food-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
  margin: 0;
  flex: 1;
}
.food-card-source {
  font-size: .8rem;
  color: var(--text-sub);
  margin: 0 0 .5rem;
}
.food-card-category {
  display: inline-block;
  background: var(--primary-light, #EEF4FF);
  color: var(--secondary);
  font-size: .72rem;
  font-weight: 600;
  padding: .1rem .45rem;
  border-radius: 3px;
  margin-bottom: .3rem;
}
.food-card-nutrients {
  font-size: .74rem;
  color: var(--text-sub);
  /* 数値幅がまちまちでも列が揃うようグリッドで整列（flex-wrapだと末尾項目が不揃いに折返す）。 */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .22rem .5rem;
  align-items: baseline;
  margin: .45rem 0 0;
}
.food-card-nutrients .fcn-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.food-card-nutrients .fcn-label { color: #9aa3ad; margin-right: .28rem; }
.food-card-nutrients .fcn-val { color: var(--text); font-weight: 600; font-family: "Roboto Mono", monospace; }
.food-card-sep {
  color: var(--border);
}
.food-card-pfc {
  font-size: .85rem;
  color: var(--text-sub);
  font-family: "Roboto Mono", monospace;
}
.food-card-pfc strong { color: var(--text); }
.food-card-actions {
  position: absolute;
  bottom: .6rem;
  right: .6rem;
}

/* ── 精度バッジ ───────────────────────────────────────── */

/* ── カテゴリバッジ ───────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 3px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-category { background: #E8F5E9; color: var(--primary); }
.badge-ai { background: #E3F2FD; color: var(--info); }
.badge-pr { background: #FFF3E0; color: #E65100; }
.badge-alert-active { background: #FFEBEE; color: var(--warning); }
.badge-alert-resolved { background: #F5F5F5; color: var(--text-sub); }
.badge-academic { background: #EDE7F6; color: #512DA8; }

/* ── ボタン ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .9rem;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn-primary { background: var(--secondary); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--secondary); color: var(--secondary); }
.btn-sm { padding: .3rem .65rem; font-size: .82rem; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-compare {
  background: var(--light-blue);
  color: var(--secondary);
  border: 1px solid var(--secondary);
  font-size: .82rem;
}
.btn-compare.added {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}
.bookmark-cta {
  background: var(--gold);
  color: #fff;
  border: none;
  padding: .45rem .9rem;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
}
.bookmark-cta:hover { opacity: .88; }

/* ── 検索フォーム（検索ページ） ───────────────────────── */
.search-form-wrap {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
  align-items: center;
}
.search-input-group {
  display: flex;
  flex: 1;
  border: 2px solid var(--secondary);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.search-input-group input[type="search"] {
  flex: 1;
  padding: .6rem 1rem;
  font-size: 1rem;
  border: none;
  outline: none;
  color: var(--text);
}
.search-input-group button {
  padding: .6rem 1rem;
  background: #fff;
  color: var(--secondary);
  border: none;
  border-left: 2px solid var(--secondary);
  cursor: pointer;
  font-size: 1rem;
  transition: background .15s, color .15s;
}
.search-input-group button:hover {
  background: var(--secondary);
  color: #fff;
}

.search-filters {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.search-filters label { color: var(--text-sub); }
.search-filters select {
  padding: .3rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  background: #fff;
}

.htmx-indicator {
  display: none;
  /* 出現時に後続要素を押し下げない。in-flow だと検索のたびにスピナー「検索中...」が
     現れ、下の本文が縦に約27pxジャンプする（＝「下のCSSがズレる」の原因）。
     absolute で流れから外し、レイアウトを動かさず元の位置に重ねて表示する。 */
  position: absolute;
  color: var(--secondary);
  font-size: .88rem;
  margin-left: .5rem;
}
.htmx-request .htmx-indicator { display: inline; }
.footer-data-label { opacity: .75; margin-right: .25rem; }
/* hx-indicator で別要素を指す場合、htmx はその要素自身に htmx-request を付与するため、
   同一要素セレクタでも表示できるようにする（例: 承認キューの「AI修正中…」）。 */
.htmx-indicator.htmx-request { display: inline; }

.search-results-count {
  font-size: .9rem;
  color: var(--text-sub);
  margin-bottom: .75rem;
}
.search-results-count strong { color: var(--text); }

/* ── 検索結果リスト ───────────────────────────────────── */
#search-results, #results {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
}
#search-results > .search-results-count,
#search-results > .empty-state,
#search-results > aside,
#search-results > .pager,
#results > .search-results-count,
#results > .empty-state,
#results > aside,
#results > .pager {
  grid-column: 1 / -1;
}
#search-results > .pager,
#results > .pager {
  width: 100%;
  margin-top: 2rem;
}
@media (max-width: 640px) {
  #search-results, #results {
    grid-template-columns: 1fr;
  }
}

/* ── グリッドレイアウト ───────────────────────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (max-width: 1023px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── 食品グループカード（背景写真・名前オーバーレイ） ───────── */
.group-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.group-card:hover { transform: translateY(-3px); box-shadow: 0 7px 20px rgba(0,0,0,.15); }
.group-card-thumb { position: relative; height: 132px; overflow: hidden; background: var(--blue-light); }
.group-card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.group-card:hover .group-card-img { transform: scale(1.06); }
.group-card-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.66) 0%, rgba(0,0,0,.15) 45%, rgba(0,0,0,0) 72%); }
.group-card-emoji {
  position: absolute; top: .5rem; left: .5rem; z-index: 1; font-size: 1.25rem;
  background: rgba(255,255,255,.88); width: 2rem; height: 2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.group-card-name {
  position: absolute; left: .75rem; right: .75rem; bottom: .55rem; z-index: 1;
  color: #fff; font-weight: 700; font-size: 1.18rem; line-height: 1.25; text-shadow: 0 1px 5px rgba(0,0,0,.65);
}
.group-card-body { padding: .7rem .85rem .95rem; }
.group-card-count {
  display: inline-block; font-size: .76rem; font-weight: 700; color: var(--primary);
  background: var(--blue-light); padding: .12rem .55rem; border-radius: 999px;
}
.group-card-desc { margin: .5rem 0 0; font-size: .82rem; color: var(--text-sub); line-height: 1.6; }

/* ── 記事カード ───────────────────────────────────────── */
.article-card {
  background: #fff;
  border: 1px solid #e4eaf0;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: box-shadow .15s ease, transform .15s ease;
}
.article-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.article-card-thumb {
  position: relative;
  height: 148px;
  background: linear-gradient(135deg, #EEF4FF 0%, #c8d8ee 100%);
  display: flex;
  align-items: flex-end;
  padding: .625rem .75rem;
  overflow: hidden;
}
.article-card-cat-pill {
  position: relative;
  z-index: 1;
}
.article-card-thumb[data-cat="新商品"]  { background: linear-gradient(135deg, #e8f5e9, #81c784); }
.article-card-thumb[data-cat="安全情報"] { background: linear-gradient(135deg, #fff3e0, #ffb74d); }
.article-card-thumb[data-cat="トレンド"] { background: linear-gradient(135deg, #e3f2fd, #64b5f6); }
.article-card-thumb[data-cat="データ"]  { background: linear-gradient(135deg, #f3e5f5, #ba68c8); }
.article-card-thumb[data-cat="seasonal"]    { background: linear-gradient(135deg, #e8f5e9, #66bb6a); }
.article-card-thumb[data-cat="data_driven"] { background: linear-gradient(135deg, #e8eaf6, #7986cb); }
.article-card-thumb[data-cat="safety"]      { background: linear-gradient(135deg, #1a2a4a, #2c3e6a); }
.article-card-cat-pill {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  font-size: .72rem;
  font-weight: 700;
  color: #336699;
}
.article-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-card-body {
  padding: .875rem 1rem .1rem;
}
.article-card-badges {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  margin-bottom: .4rem;
}
.article-card-excerpt {
  font-family: "BIZ UDPGothic", "Noto Sans JP", sans-serif;
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin: 0 0 .5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-title {
  font-family: "BIZ UDPGothic", "Noto Sans JP", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #111111;
  margin: 0 0 .35rem;
  line-height: 1.4;
  min-height: 2.8em;   /* 2行分を確保し、1行件名でも抜粋の開始位置を揃える */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-date {
  font-family: "BIZ UDPGothic", "Noto Sans JP", sans-serif;
  font-size: .78rem;
  color: #aab8c4;
}
.article-card-excerpt {
  font-size: .82rem;
  color: var(--text-sub);
  margin: .3rem 0 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── カテゴリタブ ─────────────────────────────────────── */
.category-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.category-tab {
  padding: .4rem .85rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--border);
  color: var(--text-sub);
  background: var(--card);
  transition: all .15s;
}
.category-tab:hover, .category-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
/* 選択ソースの「○○の記事一覧を見る」CTA。タブの長さ・画面幅に依存しないよう、
   タブ行内ではなく常に独立行で右寄せにする（折り返しによる位置ずれを根絶）。
   CSP（非adminは style-src nonce のみ・インラインstyle不可）のため class で制御する。 */
.safety-source-more { white-space: nowrap; }
.safety-more-row {
  display: flex;
  justify-content: flex-end;
  margin: -.5rem 0 1rem;
}
.safety-more-row.is-hidden { display: none; }
/* タブ行の右端に固定配置するアクションボタン（最新記事「記事一覧を見る」・
   安全情報「安全情報一覧を見る」で共用）。flex の margin-left:auto で右寄せ。 */
.tab-action-right {
  margin-left: auto;
  align-self: center;
  white-space: nowrap;
}
/* タブ行右端のアクション群（動的CTA＋固定ボタンを横並びで右寄せ）。
   最新記事: [○○の記事一覧を見る ›][記事一覧を見る] を右端にまとめる。 */
.tab-action-group {
  margin-left: auto;
  display: flex;
  gap: .5rem;
  align-items: center;
}
.article-cat-more { white-space: nowrap; }
.article-cat-more.is-hidden { display: none; }
/* グリッド内の空メッセージを全列ぶち抜きで表示（CSPでインラインstyle不可のためclass化）。 */
.grid-col-span-all { grid-column: 1 / -1; }

/* ── 食品詳細ページ ───────────────────────────────────── */
.food-detail-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  margin-bottom: .5rem;
}
/* 件名（食品名）と「比較に追加」を横並び・データソースを件名直下に */
.food-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  width: 100%;
}
.food-title-row > h1 { margin: 0; }
.food-title-compare { flex-shrink: 0; margin: 0; }
.food-datasource {
  font-size: .85rem;
  color: var(--text-sub);
  margin: .15rem 0 .1rem;
}
.food-name-en {
  font-size: .95rem;
  color: var(--text-sub);
  margin: 0;
}
.food-name-sci {
  font-size: .95rem;
  color: var(--text-sub);
  margin: 0;
}
.weight-converter {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin: .75rem 0 1rem;
  font-size: .88rem;
  color: var(--text-sub);
}
.weight-converter label { font-weight: 600; color: var(--text); }
.weight-converter input[type="number"] {
  width: 5.5rem;
  padding: .25rem .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  text-align: right;
}
.weight-converter-unit { color: var(--text-sub); }
.weight-converter-reset {
  font-size: .8rem;
  color: var(--secondary);
  background: none;
  border: 1px solid var(--secondary);
  border-radius: var(--radius);
  padding: .2rem .65rem;
  cursor: pointer;
}
.weight-converter-reset:hover { background: var(--primary-light, #EEF4FF); }

.food-detail-meta {
  font-size: .88rem;
  color: var(--text-sub);
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.food-detail-meta span { display: flex; align-items: center; gap: .25rem; }

/* PFCグラフエリア */
.pfc-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.pfc-summary h2 { font-size: 1rem; margin-bottom: .75rem; }
.pfc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1rem;
  font-size: .8rem;
  color: var(--text-sub);
  margin-bottom: .5rem;
}
.pfc-legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.pfc-swatch {
  width: 16px;
  height: 11px;
  border-radius: 2px;
  flex-shrink: 0;
}
.pfc-swatch-content { background: #2D6A2D; }
.pfc-swatch-dri { background: rgba(0, 0, 0, .12); }
.radar-dri-values {
  font-size: .8rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin: .25rem 0 .5rem;
}
.chart-howto {
  background: var(--light-blue);
  border-radius: var(--radius);
  padding: .6rem .8rem;
  font-size: .85rem;
  line-height: 1.7;
  color: #333;
  margin: .25rem 0 .75rem;
}
.radar-table-label {
  font-size: .8rem;
  color: var(--text-sub);
  margin: .4rem 0 .2rem;
}
.radar-table-wrap {
  overflow-x: auto;
  margin-bottom: .6rem;
}
.radar-mini-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;   /* 全列を均等幅に固定し、数値が変わっても枠がずれないようにする */
  min-width: 560px;      /* 8列ぶんの最小幅。狭い画面では radar-table-wrap が横スクロール */
}
.radar-mini-table td {
  border: 1px solid var(--border);
  padding: .15rem .3rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.radar-mini-table .rmt-name {
  font-size: .62rem;
  color: var(--text-sub);
}
.radar-mini-table .rmt-val {
  font-size: .72rem;
  font-weight: 600;
  color: #333;
}
.pfc-weight-input {
  width: 3.6em;
  padding: .05rem .25rem;
  font-size: .8rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  text-align: right;
  color: var(--primary);
  font-weight: 600;
}
.pfc-chart-wrap {
  position: relative;
  height: 180px;
  margin-bottom: .5rem;
}
.pfc-note {
  font-size: .75rem;
  color: var(--text-sub);
  margin-top: .25rem;
}
.energy-display {
  margin-top: .75rem;
}
.energy-caption {
  display: block;
  font-size: .8rem;
  color: var(--text-sub);
  margin-bottom: .15rem;
}
.energy-value {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  font-size: 1.05rem;
  font-family: "Roboto Mono", monospace;
}
.energy-display strong { color: var(--primary); font-size: 1.3rem; }
.energy-kj { color: var(--text-sub); }

/* 栄養素テーブル（details折り畳み） */
.nutrient-section {
  margin-bottom: .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.nutrient-section summary {
  background: var(--light-blue);
  padding: .6rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: .5rem;
  user-select: none;
}
.nutrient-section summary:hover { background: #dce9f8; }
.nutrient-section summary::-webkit-details-marker { display: none; }
.nutrient-section summary::before {
  content: "▶";
  font-size: .7rem;
  transition: transform .2s;
}
.nutrient-section[open] summary::before { transform: rotate(90deg); }
.nutrient-section > .nutrient-table { margin: 0; }

.nutrient-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.nutrient-table td, .nutrient-table th {
  padding: .4rem .75rem;
  border-bottom: 1px solid var(--border);
}
.nutrient-table thead th {
  background: var(--bg);
  color: var(--secondary);
  font-size: .8rem;
  font-weight: 600;
}
.nutrient-table thead th.nt-col-name { text-align: center !important; }
.nutrient-table thead th.nt-col-val { text-align: center !important; width: 25%; }
.nutrient-table thead th.nt-col-unit { text-align: center !important; width: 12%; }
.nutrient-table tr:last-child td { border-bottom: none; }
.nutrient-table .nt-name { color: var(--text); width: 50%; }
/* 成分名から栄養素の説明ページ(/nutrients)へのリンク。表内で控えめに（青字・hoverで下線）。 */
.nutrient-table .nt-name .nt-link { color: var(--secondary); text-decoration: none; }
.nutrient-table .nt-name .nt-link:hover { text-decoration: underline; }
.nutrient-table .nt-value {
  text-align: right;
  font-family: "Roboto Mono", monospace;
  color: var(--text);
  width: 25%;
}
.nutrient-table .nt-unit { color: var(--text-sub); width: 12%; font-size: .82rem; }
.nutrient-table .nt-badge { width: 13%; text-align: right; }
.nutrient-table .nt-no-data {
  color: #9E9E9E;
  font-style: italic;
}

/* レーダーチャートエリア */
.radar-chart-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.radar-chart-wrap h2 { font-size: 1rem; margin-bottom: .75rem; }
.radar-canvas-container {
  position: relative;
  max-width: 360px;
  margin: 0 auto;
}

/* アレルゲン警告ボックス */
.allergen-warning {
  background: #FFEBEE;
  border-left: 4px solid var(--warning);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .9rem 1rem;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.allergen-warning .warning-title {
  font-weight: 700;
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .35rem;
}
.allergen-warning p { margin: 0; color: #5D1515; }

.pesticide-warning {
  background: #FFF8E1;
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  font-size: .88rem;
  color: #4A3B00;
}

.allergen-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .5rem;
}
.allergen-tag {
  display: inline-block;
  padding: .2rem .6rem;
  background: #FFEBEE;
  border: 1px solid var(--warning);
  border-radius: 3px;
  font-size: .82rem;
  color: var(--warning);
  font-weight: 600;
}

/* バリエーション */
.variations-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.variations-list li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
}
.variations-list li:last-child { border-bottom: none; }
.variations-list a { color: var(--secondary); text-decoration: none; }
.variations-list a:hover { text-decoration: underline; }
.variation-kcal {
  font-family: "Roboto Mono", monospace;
  font-size: .85rem;
  color: var(--text-sub);
}

/* 比較ボタンエリア */
.food-cta-bar {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--light-blue);
  border-radius: var(--radius);
}

/* ── 食品比較ページ ───────────────────────────────────── */
.compare-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.compare-scroll-top {
  display: none;
}
.compare-scroll-top-inner { height: 1px; }

/* 食品群一覧の栄養素テーブル（旧インラインstyleはCSPで無効化されスクロール枠が効かず
   画面外へはみ出していた）。スクロール枠＋食品名列を左固定＋ヘッダー行を上固定にする。 */
/* 外側は控えめに（太い囲みは付けない）。横スクロールヒントの基準として position:relative。 */
.group-table-scroll { position: relative; margin-top: 1rem; }
.group-table-wrap {
  overflow: auto;
  max-height: 78vh;
  -webkit-overflow-scrolling: touch;
  /* スクロールバー（右の縦棒・下の横棒）は非表示。タッチでスクロールでき、見出し固定と
     ‹ › バッジでスクロール可能なことは伝わる。 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.group-table-wrap::-webkit-scrollbar { display: none; }
/* 横スクロールのヒント（scroll-hint 風）＝表の中央にスワイプ手アイコン＋「左右にスクロール
   できます」を重ね、一度スクロールする（か数秒後）とフェアウトして消える。CSP安全・依存なし。 */
.scroll-hint-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;   /* 表の操作を妨げない */
  z-index: 5;
  opacity: 1;
  transition: opacity .45s ease;
}
.scroll-hint-overlay.is-dismissed { opacity: 0; }
.scroll-hint-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  max-width: 90%;
  padding: .55rem 1rem;
  background: rgba(30, 41, 59, .82);
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .28);
}
.scroll-hint-hand {
  font-size: 1.2rem;
  animation: scroll-hint-swipe 1.3s ease-in-out infinite;
}
@keyframes scroll-hint-swipe {
  0%, 100% { transform: translateX(-5px) rotate(-8deg); }
  50%      { transform: translateX(5px) rotate(8deg); }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-hint-hand { animation: none; }
}
/* 比較ページの横スクロールヒント（スマホのみ）。PC(≥768px)は display:none で一切出さない。
   表が縦に長いのでピルは上端寄せにし、初回表示時に見える位置に置く。 */
.compare-scroll-hint, .nut-rank-hint { position: relative; }
.compare-scroll-hint .scroll-hint-overlay,
.nut-rank-hint .scroll-hint-overlay { display: none; align-items: flex-start; }
/* 比較ヒントは見出し(項目)の上だと目立たないため、たんぱく質あたり(表の先頭の栄養素行)に出す。
   sticky は使わずその行の位置に留める。実測：たんぱく質行Y=184〜232px(食品数で変動)のため、
   pill(約40px)が全食品数でたんぱく質〜脂質帯に重なる 190px を採用。overlay は PC(≥768px)では
   display:none のため、この margin-top はスマホのみに効き PC に影響しない。 */
.compare-scroll-hint .scroll-hint-pill { margin-top: 190px; }
/* 栄養成分ランキングのヒントは見出し(項目)の上だと目立たないため、順位2あたりの中央に出す。
   sticky は使わずその行の位置に留める（align-items:flex-start＋margin-top で下げる）。 */
.nut-rank-hint .scroll-hint-pill { margin-top: 106px; }
@media (max-width: 767px) {
  .compare-scroll-hint .scroll-hint-overlay,
  .nut-rank-hint .scroll-hint-overlay { display: flex; }
}
.group-table {
  width: 100%;
  min-width: 560px;            /* 狭い画面では圧縮せず横スクロール */
  margin: 0;                   /* グローバル table{margin-top:1rem} を打ち消す（sticky見出しが
                                  スクロール時に16px上へジャンプするのを防ぐ） */
  border-collapse: separate;   /* collapse だと sticky 見出しの境界線がスクロールで消えるため separate */
  border-spacing: 0;
  font-size: .92rem;
  background: #fff;
}
.group-table th,
.group-table td {
  padding: .55rem .8rem;
  border: none;                            /* グローバル th,td{border:1px} を打ち消す */
  border-bottom: 1px solid var(--border);  /* 行の区切り */
  border-right: 1px solid var(--border);   /* 列の区切り（separate なので sticky 列でも追従し、
                                              左罫線のグリッチ／短い縦線残りが起きない） */
  white-space: nowrap;
  text-align: right;
}
.group-table thead th {                 /* ヘッダー行を上に固定（縦スクロール時も残る） */
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--light-blue);
  color: var(--secondary);
  border-top: 1px solid var(--border);      /* 表の上辺の横線（sticky見出しに持たせるので常に上端に残る） */
  border-bottom: 2px solid var(--secondary);
}
.group-table .sortable { cursor: pointer; }
.group-table th.gt-name,
.group-table td.gt-name {                /* 食品名列を左に固定（横スクロール時も残る） */
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  white-space: normal;
  background: #fff;
  border-left: 1px solid var(--border);   /* 表の左端の縦線。sticky セル自身に持たせるので
                                             スクロールしても常に左端に留まりグリッチしない。 */
  box-shadow: 2px 0 4px rgba(0, 0, 0, .06);
  min-width: 105px;
  max-width: 36vw;   /* 食品名列を約1/3狭める（旧 150px/58vw） */
  /* 長すぎる英名だけを折り返して隣の列へのはみ出しを防ぐ（anywhereは単語途中で切れて
     列が最小幅まで縮むため使わない。break-wordは通常は単語単位で折り返す）。 */
  overflow-wrap: break-word;
}
.group-table thead th.gt-name {          /* 左上の角＝縦横どちらの固定より前面に */
  z-index: 3;
  background: var(--light-blue);
}
.group-table td.gt-name a { color: var(--secondary); font-weight: 600; text-decoration: none; }
.group-table td.gt-name a:hover { text-decoration: underline; }
/* border-collapse を確実に separate に（collapse だと sticky 列の左罫線がスクロールで
   消え、左上に短い縦線が残る。id 指定で確実に適用する）。 */
#food-group-table { border-collapse: separate !important; border-spacing: 0 !important; }

.compare-table-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary);
  margin: 1.4rem 0 .5rem;
  padding-bottom: .3rem;
  border-bottom: 2px solid var(--light-blue);
}
.compare-table-source {
  font-size: .8rem;
  color: var(--text-sub);
  margin: -.2rem 0 .2rem;
  line-height: 1.4;
}
.compare-summary-wrap { margin-bottom: 1.5rem; }
.compare-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}
.compare-table {
  width: 100%;
  min-width: 680px;        /* 狭い画面は圧縮せず横スクロール */
  table-layout: fixed;     /* 数値の桁数が変わっても列幅を固定（再配分しない） */
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  font-size: .88rem;
  background: var(--card);
}
.compare-table th,
.compare-table td {
  padding: .45rem .75rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}
.compare-table th { background: var(--light-blue); color: var(--secondary); text-align: left; }
.compare-table .row-label {
  text-align: left;
  font-weight: 600;
  background: var(--bg);
  color: var(--text);
  white-space: normal;
  width: 200px;
  min-width: 160px;
  max-width: 240px;
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 2px 0 4px rgba(0,0,0,.06);
}
.compare-table thead .row-label {
  background: var(--light-blue);
  z-index: 3;
  text-align: center;
}
.compare-weight-conv {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: .5rem;
  gap: 0;
}
.compare-weight-row1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
}
.compare-weight-row2 {
  font-size: .72rem;
  color: var(--text-sub);
  margin-top: .15rem;
  white-space: nowrap;
}
.compare-weight-input {
  width: 52px;
  padding: .1rem .25rem;
  font-size: .75rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  text-align: center;
  color: var(--text);
  background: #fff;
}
.compare-weight-unit {
  font-size: .75rem;
  color: var(--text-sub);
  font-weight: 400;
}
.compare-weight-reset {
  background: var(--light-blue);
  color: var(--secondary);
  border: 1px solid var(--secondary);
  border-radius: 3px;
  padding: .1rem .4rem;
  font-size: .72rem;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
}
.compare-table .col-food-name {
  text-align: center;
  width: auto;          /* fixed レイアウトで残り幅を3食品で均等分割 */
  min-width: 160px;
  max-width: none;
  white-space: normal;
  font-weight: 600;
  padding: 0;
}
.col-food-wrap {
  position: relative;
  padding: .5rem .5rem .4rem;
  height: 100%;
  box-sizing: border-box;
}
.compare-table .col-food-name .col-food-info {
  text-align: center;
  padding: 0 1.6rem 0 .2rem;
}
.col-food-remove {
  position: absolute;
  top: .3rem;
  right: .3rem;
  width: 1.3rem;
  height: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff0f5;
  color: #e8a0a0 !important;
  border: 1px solid #f8bbd0;
  border-radius: 50%;
  font-size: .7rem;
  line-height: 1;
  text-decoration: none !important;
  font-weight: 700;
  transition: color .15s, border-color .15s, background .15s;
}
.col-food-remove:hover {
  color: #c62828 !important;
  border-color: #c62828;
  background: #ffcdd2;
}
.compare-table .col-food-name a { color: var(--secondary); text-decoration: none; font-size: .88rem; }
.compare-table .col-total {
  background: #f5f0ff;
  color: var(--text);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  width: 96px;
  min-width: 90px;
}
.compare-table .col-total-head {
  text-align: center;
  color: var(--secondary);
  background: #e8e0ff;
  vertical-align: middle;
}
.compare-table .val-max { background: #E8F5E9; color: #1B5E20; font-weight: 700; }
.compare-table .val-min { background: #F5F5F5; color: #757575; }

/* 比較列ヘッダの識別メタ（検索カードと同項目：食品群・データソース・安全情報） */
.compare-col-category {
  display: inline-block;
  background: var(--primary-light, #EEF4FF);
  color: var(--secondary);
  font-size: .68rem;
  font-weight: 600;
  padding: .08rem .4rem;
  border-radius: 3px;
  margin-top: .3rem;
}
.compare-col-source {
  display: block;
  font-size: .72rem;
  color: var(--text-sub);
  margin: .2rem 0 0;
  line-height: 1.3;
}
.compare-col-safety {
  display: block;
  font-size: .72rem;
  color: #C0392B;
  font-weight: 600;
  margin: .2rem 0 0;
}

/* 最大値/最小値の凡例色見本（CSP対応：インラインstyle廃止） */
.compare-minmax-legend { margin-bottom: .5rem; }
.compare-legend-swatch {
  display: inline-block;
  width: .8rem;
  height: .8rem;
  border-radius: 2px;
  vertical-align: middle;
}
.compare-legend-max { background: #E8F5E9; border: 1px solid #2D6A2D; }
.compare-legend-min { background: #F5F5F5; border: 1px solid #ccc; }

/* 重量換算対象外（廃棄率）の注記 */
.compare-noscale-mark { color: var(--text-sub); font-size: .72rem; margin-left: .1rem; }
.compare-noscale-note {
  font-size: .8rem;
  color: var(--text-sub);
  line-height: 1.7;
  margin: .6rem 0 0;
}

/* URLコピーボタン（CSP対応：インラインstyle廃止） */
.compare-copy-btn {
  background: var(--light-blue);
  border: 1px solid var(--secondary);
  color: var(--secondary);
}
/* execCommand フォールバック用の画面外テキストエリア（CSP対応でインラインstyleを使わない） */
.copy-offscreen { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

/* グループ／小分類見出し（詳細ページの nt_group / nt_subgroup / nt_subsubgroup に対応） */
.compare-table .subsection-header-row td {
  background: #f4f7fb !important;
  font-weight: 600;
  font-size: .82rem;
  color: var(--text-sub);
}
.compare-table .cmp-h1 .row-label { padding-left: .6rem; font-weight: 700; color: var(--secondary); }
.compare-table .cmp-h2 .row-label { padding-left: 1.4rem; }
.compare-table .cmp-h3 .row-label { padding-left: 2.2rem; }
/* 値行の階層インデント（詳細ページの indent に対応） */
.compare-table td.row-label.cmp-indent1 { padding-left: 1.5rem; }
.compare-table td.row-label.cmp-indent2 { padding-left: 2.3rem; }
.compare-table td.row-label.cmp-indent3 { padding-left: 3.1rem; }
.compare-table td.row-label.cmp-indent4 { padding-left: 3.9rem; }
.compare-table .no-data { color: #9E9E9E; font-style: italic; }
/* 番号付きテーブル見出し（01.〜11.）だけを薄ゴールドの帯で区別（線なし・色で識別）。
   グループ見出しは section-header-row も持つため :not で除外する */
.compare-table .section-header-row:not(.subsection-header-row) td {
  background: #fbf1cf !important;
  font-weight: 700;
  color: #8a6a00 !important;
}
.compare-table .val-mono { font-family: "Roboto Mono", monospace; }
.compare-table .row-unit {
  text-align: center;
  font-size: .82rem;
  color: var(--text-sub);
  white-space: nowrap;
  width: 54px;
  min-width: 40px;
}
.compare-table thead .row-unit {
  background: var(--light-blue);
  font-weight: 600;
  color: var(--secondary);
}

@media (max-width: 767px) {
  .compare-table .row-label {
    width: 110px;
    min-width: 90px;
    max-width: 120px;
    font-size: .8rem;
    padding: .35rem .4rem;
  }
  .compare-table .row-unit {
    min-width: 28px;
    font-size: .75rem;
    padding: .35rem .3rem;
  }
  .compare-table th,
  .compare-table td {
    padding: .35rem .5rem;
    font-size: .82rem;
  }
  /* 食品が1つだけのとき、min-width:680px の余白が単一食品列に集中して広くなりすぎる
     （実測：1食品=420px／2食品=210px）。1食品時は表を内容幅にし、食品列を2食品時と同じ
     210px に固定して広がりを抑える（PC は @media 外なので不変）。 */
  .compare-table.cmp-1food { min-width: 0; }
  .compare-table.cmp-1food .col-food-name { width: 210px; max-width: 210px; }
}

/* 比較テーブル 食品名チップ（縦スクロール時に表示） */
.compare-food-chips {
  display: none;
  position: sticky;
  z-index: 10;
  background: var(--light-blue);
  border-bottom: 2px solid var(--border);
  padding: .25rem .6rem;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
  overflow: hidden;
}
.compare-chips-label {
  display: none;
  flex-shrink: 0;
}
/* 合計ラベルはモバイルでもpill形状で表示 */
#compare-chips-label-total {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .74rem;
  font-weight: 600;
  color: var(--secondary);
  background: #f5f0ff;
  border: 1px solid var(--secondary);
  border-radius: 999px;
  padding: .12rem .6rem;
  white-space: nowrap;
}
.compare-chips-label-active {
  background: var(--secondary) !important;
  color: #fff !important;
  border-color: var(--secondary) !important;
}
.compare-food-chip {
  font-size: .74rem;
  font-weight: 600;
  color: var(--secondary);
  background: #fff;
  border: 1px solid var(--secondary);
  border-radius: 999px;
  padding: .12rem .6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  text-align: center;
}
.col-food-num {
  display: inline;
  font-size: .85rem;
  color: var(--secondary);
  font-weight: 700;
  margin-right: .2rem;
}
.compare-food-chip-active {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

/* PC（768px以上）：チップを列幅に合わせてセル形状に */
@media (min-width: 768px) {
  .compare-food-chips {
    flex-wrap: nowrap;
    gap: 0;
    padding: 0;
    align-items: stretch;
  }
  .compare-chips-label {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-sub);
    background: var(--bg);
    border-right: 1px solid var(--border);
    white-space: nowrap;
    text-align: center;
  }
  #compare-chips-label-total,
  #compare-chips-label-unit {
    border-left: 1px solid var(--border);
    border-right: none;
    /* PC ではpillスタイルをセル形状に上書き */
    border-radius: 0;
    background: var(--bg);
    padding: .45rem .5rem;
  }
  .compare-food-chip {
    border-radius: 0;
    border: none;
    border-left: 1px solid var(--border);
    max-width: none;
    padding: .45rem .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-shrink: 0;
    background: var(--light-blue);
    color: var(--secondary);
    white-space: normal;         /* 折り返して全体を表示 */
    overflow: hidden;
    text-overflow: clip;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .compare-food-chip-active {
    background: var(--light-blue);  /* 水色のまま */
    color: var(--secondary);
    border-bottom: 3px solid var(--secondary); /* 選択中は下線で表示 */
  }
}

/* 比較パネル（fixed） */
.compare-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 2px solid var(--secondary);
  box-shadow: 0 -2px 12px rgba(0,0,0,.12);
  padding: .4rem .9rem;
  z-index: 200;
  display: none;
}
.compare-panel.visible { display: block; }
.compare-panel-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;   /* 内容を画面中央揃え（全ページ共通） */
  gap: .35rem .4rem;
  flex-wrap: wrap;
}
/* ページ上部へ戻るボタン（全ページ共通） */
.scroll-top-btn {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: var(--primary); color: #fff; font-size: 1.4rem; line-height: 1;
  cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.25);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  z-index: 250;
}
.scroll-top-btn.visible { opacity: .92; visibility: visible; transform: translateY(0); }
.scroll-top-btn:hover { opacity: 1; background: var(--secondary); }
.compare-panel.visible ~ .scroll-top-btn { bottom: 5rem; }
@media (max-width: 600px) { .scroll-top-btn { bottom: 1rem; right: 1rem; width: 42px; height: 42px; } }

.compare-panel-label { font-size: .78rem; color: #555; font-weight: 600; flex-shrink: 0; }
/* チップ群を親(.compare-panel-inner)のflowに直接展開し、ラベル＋商品名＋ボタンを
   一連の横並び（改行は折り返しのみ）にする。これでチップが単独行で縦に伸びない。 */
#compare-chips { display: contents; }
#compare-clear-btn { background: #fff; border: 1px solid #ccc; color: #555; }
/* トップは body.home-v2 のため、home.css の全称リセット(.home-v2 * {padding:0;margin:0})と
   .home-v2 a{color:inherit} が全ページ共通chromeの比較パネルまで潰す（余白消失・比較ボタンが灰文字）。
   ID指定(=クラスより強い)で必要なボックス/色を復元し、全ページで同じ見た目にする。 */
#compare-panel { padding: .4rem .9rem; }
#compare-panel .compare-panel-inner { margin: 0 auto; }  /* 中央寄せ復元（.home-v2 *{margin:0}で左寄せになる） */
#compare-panel .compare-chip { padding: .12rem .5rem; }
#compare-panel .btn-sm { padding: .3rem .65rem; }
#compare-panel #compare-link { color: #fff; }
.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: var(--light-blue);
  border: 1px solid var(--secondary);
  border-radius: 999px;
  padding: .12rem .5rem;
  font-size: .74rem;
  color: var(--secondary);
}
.compare-chip button {
  background: none;
  border: none;
  color: var(--secondary);
  cursor: pointer;
  font-size: .9rem;
  padding: 0;
  line-height: 1;
}

/* ── 記事詳細 ──────────────────────────────────────────── */
.article-hero {
  position: relative;
  height: 360px;
  overflow: hidden;
  margin-bottom: 0;
}
.article-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-hero-grad {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a2a3a 0%, #336699 60%, #4a90c4 100%);
}
.article-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 30%, rgba(0,0,0,.72) 100%);
}
.article-hero-foot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 1.25rem;
  max-width: 1040px;
  margin: 0 auto;
}
.article-hero-badge {
  display: inline-block;
  padding: .25rem .8rem;
  border-radius: 999px;
  background: rgba(60,200,100,.9);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
/* 安全情報記事のヒーローの「安全情報」＋「重要」バッジ＝トップ安全カードの重要バッジと
   同じ書体・角丸・余白に統一（色は意味に合わせ 安全情報=緑 / 重要=#C0392B）。 */
.article-hero-badge.article-hero-badge-safety,
.article-hero-badge.article-hero-badge-important {
  font-family: "BIZ UDPGothic", "Noto Sans JP", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.04em;
  padding: 0.34rem 0.72rem;
  border-radius: 8px;
}
.article-hero-badge.article-hero-badge-safety { background: #2E8B57; }
.article-hero-badge.article-hero-badge-important {
  background: #C0392B;
  margin-left: .4rem;
}
.article-hero-badge-important .sib-ico {
  position: relative;
  top: -0.08em;
  margin-left: -0.12em;
  margin-right: 0.05em;
}
.article-hero-title {
  color: #fff;
  font-family: "BIZ UDPGothic", "Noto Sans JP", sans-serif;   /* 件名フォント試用 */
  font-size: 32px;
  font-weight: 700;   /* BIZ UDPGothic の太字は700が最大 */
  line-height: 1.3;
  margin: 0 0 .4rem;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.article-hero-meta {
  color: rgba(255,255,255,.75);
  font-size: .82rem;
  margin: 0;
}
@media (max-width: 768px) {
  .article-hero { height: 220px; }
  .article-hero-title { font-size: 1.3rem; }
}

/* ── safety記事カード：重要オーバーレイ ─────────────────── */
/* mhlw 輸入食品違反カード（厚労省レターヘッド背景＋件名を白余白に） */
.mhlw-thumb { background: #fff; }
.mhlw-thumb .article-card-img { object-fit: cover; object-position: top center; }
.mhlw-card-badge {
  position: absolute; top: .5rem; right: .5rem; z-index: 3;
  background: #C0392B; color: #fff;
  font-family: "BIZ UDPGothic", "Noto Sans JP", sans-serif;
  font-size: 14px; font-weight: 400; line-height: 1;
  padding: .14rem .26rem; border-radius: 3px; letter-spacing: .04em;
}
.mhlw-card-content {
  position: absolute; left: .85rem; right: .85rem; bottom: 1.5rem; z-index: 2;
  display: flex; flex-direction: column; gap: .2rem;
}
.mhlw-card-kicker { font-size: .79rem; font-weight: 700; color: #C0392B; letter-spacing: .02em; }
.mhlw-card-title {
  font-size: .92rem; font-weight: 700; color: #1a2a4a; line-height: 1.32;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 2px rgba(255,255,255,.7);
}
/* 対象名画像がある mhlw カード：食品写真の上に暗幕＋白文字で速報見出し＋件名を重ねる */
.mhlw-onimg-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: flex-end; gap: .2rem;
  padding: .7rem .85rem 1.2rem;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.78) 100%);
}
.mhlw-onimg-kicker { font-size: .76rem; font-weight: 800; color: #fff; letter-spacing: .02em; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.mhlw-onimg-title {
  font-size: .92rem; font-weight: 700; color: #fff; line-height: 1.32;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,.75);
}

.safety-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 55%, rgba(0,0,0,.65) 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: .5rem .7rem;
  z-index: 2;
}
.safety-card-overlay-badge {
  display: inline-block;
  background: #C0392B;
  color: #fff;
  font-family: "BIZ UDPGothic", "Noto Sans JP", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  padding: .14rem .26rem;
  border-radius: 3px;
  margin-bottom: .25rem;
  letter-spacing: .04em;
}
/* トップの安全カード重要バッジと同じ⚠️微調整（左詰め・上げ・文字間）を安全ページにも適用 */
.safety-card-overlay-badge .sib-ico,
.mhlw-card-badge .sib-ico { position: relative; top: -0.08em; margin-left: -0.12em; margin-right: 0.05em; }
.safety-card-overlay-text {
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.safety-thumb-title {
  position: absolute;
  inset: 0 0 2.8rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .6rem .85rem;
  z-index: 1;
  overflow: hidden;
}
/* 長い件名は上下にはみ出させず、3行で省略（…）。枠内中央に配置。 */
.safety-thumb-title span {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: rgba(255,255,255,.92);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,.35);
}

/* ── safety記事詳細：商品画像（左フロート） ─────────────── */
.article-body-floatwrap { display: flow-root; }
.safety-product-figure {
  float: left;
  width: 210px;
  margin: 0 1.5rem 1rem 0;
  text-align: center;
}
.safety-product-img {
  width: 100%;
  max-height: 230px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #f0e0e0;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.safety-product-caption {
  font-size: .8rem;
  color: #C0392B;
  font-weight: 600;
  margin-top: .4rem;
}
@media (max-width: 600px) {
  .safety-product-figure {
    float: none;
    width: 100%;
    margin: 0 0 1rem 0;
  }
}

/* 2カラムレイアウト */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
  max-width: 1040px;
  margin: 2rem auto 3rem;
  padding: 0 1.25rem;
}
@media (max-width: 860px) {
  .article-layout { grid-template-columns: 1fr; }
}

/* 本文スタイル強化 */
.article-body {
  max-width: 700px;   /* 長すぎる1行を抑えて読みやすく（2カラム時は列幅が優先） */
  font-family: "BIZ UDPGothic", "Noto Sans JP", sans-serif;   /* 本文フォント試用 */
}
.article-body h2 {
  border-left: 4px solid #336699;
  padding-left: .75rem;
  font-size: 1.28rem;
  color: #1a2a3a;
  margin-top: 2.8rem;
  margin-bottom: 1rem;
}
.article-body h3 {
  font-size: 1.1rem;
  color: #336699;
  margin-top: 1.8rem;
}
.article-body h4 { color: #336699; }
.article-body p {
  font-size: 18px;
  font-weight: 400;   /* 本文はボールドを外し標準にしてすっきり見せる */
  line-height: 1.95;
  margin-bottom: 1.5rem;
  letter-spacing: .02em;
}
.article-body ul, .article-body ol { padding-left: 1.5rem; font-size: 18px; font-weight: 400; line-height: 1.95; }
.article-body li { margin-bottom: .5rem; }
.article-body a { color: var(--secondary); }
/* 記事内の比較表（bleachでclass属性は除去されるため要素セレクタで装飾） */
.article-body table {
  border-collapse: collapse;
  width: fit-content;        /* 内容幅に縮める */
  max-width: 100%;           /* 枠を超えない */
  margin: 1rem auto 1.25rem; /* 左右auto＝文章枠の中央に配置 */
  font-size: .95rem;
  display: block;            /* はみ出す広い表は横スクロール可能に */
  overflow-x: auto;
}
.article-body th, .article-body td {
  border: 1px solid #d6e0ec;
  padding: .5rem .7rem;
  text-align: left;
  vertical-align: top;
}
.article-body thead th { background: #EEF4FF; color: #336699; font-weight: bold; white-space: nowrap; }
.article-body tbody tr:nth-child(even) { background: #f7faff; }
.article-body caption { caption-side: top; font-size: .85rem; color: #666; margin-bottom: .3rem; text-align: left; }
.article-body blockquote {
  border-left: 3px solid #c8d8ee;
  padding: .75rem 1rem;
  background: #f4f8fd;
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: #556;
  margin: 1.25rem 0;
}

/* サイドバー */
.article-sidebar-card {
  background: #fff;
  border: 1px solid #e4eaf0;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  margin-bottom: 1.25rem;
  position: sticky;
  top: 1.5rem;
}
.article-sidebar-heading {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #336699;
  margin: 0 0 .875rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid #EEF4FF;
}
.article-sidebar-food {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 0;
  border-bottom: 1px solid #f0f4f8;
  text-decoration: none;
  color: inherit;
}
.article-sidebar-food:last-child { border-bottom: none; }
.article-sidebar-food:hover .article-sidebar-food-name { color: #336699; }
.article-sidebar-food-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #336699;
  flex-shrink: 0;
}
.article-sidebar-food-name {
  font-size: .875rem;
  font-weight: 600;
  flex: 1;
}
.article-sidebar-food-kcal {
  font-size: .75rem;
  color: #aaa;
}
.article-sidebar-about {
  font-size: .82rem;
  line-height: 1.7;
  color: #556;
  margin: 0 0 .875rem;
}
.article-sidebar-cta {
  display: block;
  text-align: center;
  padding: .5rem 1rem;
  background: #336699;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
}
.article-sidebar-cta:hover { background: #2a5580; }
.article-meta {
  font-size: .85rem;
  color: var(--text-sub);
  margin-bottom: 1rem;
}
.affiliate-widget {
  background: #f9f9f9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1.5rem;
}

.article-paper-link {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  background: #eef4ff;
  border: 1px solid #c3d6f5;
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-top: 1.5rem;
  font-size: .875rem;
}
.article-paper-link-label {
  font-weight: 600;
  color: #336699;
  white-space: nowrap;
}
.article-paper-link-url {
  color: #336699;
  word-break: break-all;
}

/* ── 安全情報 ──────────────────────────────────────────── */
.alert-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  margin-bottom: .75rem;
  box-shadow: var(--shadow);
}
.alert-card.alert-active { border-left: 4px solid var(--warning); }
.alert-card.alert-resolved { border-left: 4px solid #A5D6A7; }
.alert-card-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
}
.alert-card-title { font-size: 1rem; font-weight: 600; margin: 0 0 .4rem; }
.alert-card-desc { font-size: .88rem; color: var(--text); margin: 0 0 .35rem; }
.alert-card-meta { font-size: .8rem; color: var(--text-sub); }

/* ── ページネーション ──────────────────────────────────── */
.pagination {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-top: 1.5rem;
  font-size: .9rem;
}
.pagination a { color: var(--secondary); text-decoration: none; padding: .3rem .6rem; border: 1px solid var(--border); border-radius: var(--radius); }
.pagination a:hover { background: var(--light-blue); }
.pagination .current { color: var(--text-sub); padding: .3rem .6rem; }

/* ── ページネーション（新デザイン） ─────────────────────── */
.pager { display:flex; align-items:center; justify-content:center; gap:.75rem; margin-top:2.5rem; }
.pager-btn {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .6rem 1.4rem; border-radius: 8px;
  background: #fff; border: 1.5px solid #c8d8ee; color: #336699;
  font-size: .875rem; font-weight: 600; text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.pager-btn:hover { background: #eef4ff; border-color: #336699; box-shadow: 0 2px 6px rgba(51,102,153,.18); }
.pager-btn-current {
  padding: .6rem 1.1rem; border-radius: 8px;
  background: #336699; border: 1.5px solid #336699; color: #fff;
  font-size: .875rem; font-weight: 700; min-width: 2.6rem; text-align: center;
  box-shadow: 0 2px 6px rgba(51,102,153,.3);
}
.pager-btn-disabled {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .6rem 1.4rem; border-radius: 8px;
  background: #f7f7f7; border: 1.5px solid #e5e5e5; color: #c0c0c0;
  font-size: .875rem; font-weight: 600; cursor: default;
}
.pager-btn-num { padding: .6rem .95rem; min-width: 2.6rem; justify-content: center; }
.pager-ellipsis {
  display: inline-flex; align-items: center; padding: .6rem .2rem;
  color: #999; font-weight: 600; font-size: .875rem;
}

/* ── 研究論文リンク ─────────────────────────────────────── */
.research-links {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: .5rem; margin-top: .5rem;
}
.research-link-primary {
  display: inline-flex; align-items: center;
  font-size: .875rem; font-weight: 600; color: #fff;
  background: #336699; border-radius: 6px;
  padding: .4rem 1rem; text-decoration: none;
  transition: background .15s;
}
.research-link-primary:hover { background: #264d73; }
.research-link-article {
  display: inline-flex; align-items: center;
  font-size: .82rem; color: #336699; text-decoration: none;
  border: 1.5px solid #336699; border-radius: 6px;
  padding: .35rem .85rem;
  transition: background .15s, color .15s;
}
.research-link-article:hover { background: #eef4ff; }

/* ── テーブル（汎用） ─────────────────────────────────── */
table { border-collapse: collapse; width: 100%; margin-top: 1rem; }
table caption { font-weight: bold; text-align: left; margin-bottom: .5rem; color: var(--primary); }
th, td { padding: .4rem .75rem; border: 1px solid var(--border); text-align: left; }
thead th, th { background: var(--light-blue); }

/* ── フォーム ──────────────────────────────────────────── */
input[type="search"],
input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: .55rem .9rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid #1A5276;
  outline-offset: 1px;
  border-color: var(--secondary);
}
label {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: .3rem;
  color: var(--text);
}
.form-group { margin-bottom: 1rem; }

/* ── 管理画面：記事編集フォーム ─────────────────────────── */
.admin-edit-wrap {
  border: 2px solid #336699;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  background: #f0f6ff;
}
.admin-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.admin-edit-title {
  color: #336699;
  font-weight: 700;
  font-size: 1rem;
}
.admin-edit-note { color: #888; font-size: 0.8rem; }
.admin-edit-form { display: flex; flex-direction: column; gap: 1rem; }
.admin-edit-field { margin-bottom: 0; }
.admin-edit-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: 'Consolas', 'Courier New', monospace !important;
  font-size: 0.85rem !important;
  line-height: 1.6;
  resize: vertical;
  background: #fff;
  min-height: 400px;
}
.admin-edit-preview {
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.8;
  min-height: 200px;
  max-height: 500px;
  overflow-y: auto;
}
.admin-edit-btns {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.25rem;
}
.admin-btn-save {
  background: #336699;
  color: #fff;
  padding: 0.5rem 1.75rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
}
.admin-btn-cancel {
  background: #fff;
  color: #555;
  padding: 0.5rem 1.25rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
}

/* ── エラーページ ─────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 4rem 1.25rem;
}
.error-code {
  font-size: 5rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: .25rem;
}
.error-message { font-size: 1.2rem; color: var(--text-sub); margin-bottom: 1.5rem; }
.error-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* ── 法的ページ ───────────────────────────────────────── */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
}
.legal-content h2 { font-size: 1.1rem; margin-top: 1.75rem; }
.legal-content p, .legal-content li { font-size: .95rem; line-height: 1.8; }

/* ── 管理画面 ──────────────────────────────────────────── */
.admin-header {
  background: #1a1a2e;
  color: #fff;
  padding: .75rem 1.25rem;
}
.admin-header .admin-nav { display: flex; gap: 1rem; margin-top: .5rem; }
.admin-header .admin-nav a { color: rgba(255,255,255,.8); text-decoration: none; font-size: .88rem; }
.admin-header .admin-nav a:hover { color: #fff; }
.admin-status-badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 3px;
  font-size: .78rem;
  font-weight: 700;
}
.admin-status-ok { background: #E8F5E9; color: #1B5E20; }
.admin-status-warn { background: #FFF3E0; color: #E65100; }
.admin-status-error { background: #FFEBEE; color: var(--warning); }

/* ── 管理画面：記事カード共通 ─────────────────────────── */
.admin-article-card {
  border: 1px solid #e4eaf0;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.admin-article-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.admin-article-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a2a3a;
}
.admin-article-card-date {
  color: #aaa;
  font-size: 0.8rem;
  white-space: nowrap;
}
.admin-article-preview-toggle {
  cursor: pointer;
  color: #336699;
  font-size: 0.9rem;
  padding: 0.4rem 0;
  user-select: none;
}
.admin-article-preview-body {
  margin-top: 0.75rem;
  padding: 1rem 1.25rem;
  background: #f8f9fa;
  border-radius: 6px;
  max-height: 520px;
  overflow-y: auto;
  line-height: 1.8;
  font-size: 0.9rem;
}
.admin-article-thumb-wrap {
  margin: 0.75rem 0;
}
.admin-article-thumb {
  max-width: 280px;
  height: auto;
  border-radius: 6px;
  display: block;
}
.admin-article-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.admin-btn-publish { background:#336699; color:#fff; padding:.375rem 1.25rem; border:none; border-radius:4px; cursor:pointer; font-weight:600; font-size:.875rem; }
.admin-btn-danger  { background:#dc3545; color:#fff; padding:.375rem 1.25rem; border:none; border-radius:4px; cursor:pointer; font-weight:600; font-size:.875rem; }
.admin-btn-secondary { background:#6c757d; color:#fff; padding:.375rem 1.25rem; border:none; border-radius:4px; cursor:pointer; font-weight:600; font-size:.875rem; }
.admin-btn-warning { background:#e65100; color:#fff; padding:.375rem 1.25rem; border:none; border-radius:4px; cursor:pointer; font-weight:600; font-size:.875rem; }
.admin-btn-outline { background:#f8f9fa; color:#336699; padding:.375rem 1.25rem; border:1px solid #dee2e6; border-radius:4px; cursor:pointer; font-weight:600; font-size:.875rem; text-decoration:none; display:inline-block; }
.admin-article-img-field { width:100%; padding:.5rem .75rem; border:1px solid #ccc; border-radius:4px; font-size:.875rem; box-sizing:border-box; }
.admin-article-img-preview { margin-top:.5rem; max-width:100%; max-height:260px; object-fit:cover; border-radius:6px; border:1px solid #e4eaf0; display:none; }
.admin-article-img-preview.active { display:block; }
.admin-article-img-wrap { margin-bottom:.75rem; }
.admin-img-actions { display:flex; align-items:center; gap:.5rem; margin-top:.5rem; }
.admin-edit-sub-label { font-size:.8rem; color:#888; margin-top:.5rem; display:block; }
.admin-fetch-indicator { font-size:.8rem; color:#336699; margin-left:.5rem; }
.admin-pub-badge { display:inline-block; padding:.15rem .6rem; background:#E8F5E9; color:#2e7d32; border-radius:4px; font-size:.75rem; font-weight:700; margin-left:.4rem; }

/* ── 管理画面：データソース管理 ────────────────────────── */
.ds-source-cards { display:flex; flex-direction:column; gap:.75rem; }
.ds-source-card { background:#fff; border:1.5px solid #e4eaf0; border-radius:10px; padding:1rem 1.25rem; border-left:4px solid #336699; }
.ds-source-card-inactive { border-left-color:#bbb; opacity:.8; }
.ds-source-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; flex-wrap:wrap; margin-bottom:.4rem; }
.cal-event-card-row { display:grid; grid-template-columns:auto 1fr auto; gap:.75rem; align-items:center; padding:.65rem 1rem; }
.ds-source-name-block { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.ds-source-display-name { font-size:.95rem; font-weight:700; color:#1a2a3a; }
.ds-source-code { font-size:.72rem; background:#f0f4f8; color:#555; border-radius:4px; padding:.1rem .4rem; font-family:monospace; }
.ds-source-badges { display:flex; gap:.35rem; flex-wrap:wrap; align-items:center; }
.ds-source-desc { margin:.25rem 0 .6rem; }
.ds-source-meta { display:flex; flex-wrap:wrap; gap:.25rem 1.25rem; font-size:.8rem; color:#555; align-items:center; }
.ds-source-actions { margin-top:.75rem; }
.ds-hero-inline { display:flex; align-items:center; gap:2rem; flex-wrap:wrap; background:#EEF4FF; border-radius:10px; padding:1rem 1.25rem; margin-bottom:1rem; }
.ds-hero-num { font-size:2.75rem; font-weight:900; color:#336699; line-height:1; }
.ds-hero-label { font-size:.95rem; font-weight:600; color:#1a2a3a; margin:.2rem 0 .25rem; }
.ds-hero-sub { font-size:.75rem; color:#888; }
.ds-hero-kpis { display:flex; gap:1.25rem; }
.ds-hero-kpi { text-align:center; }
.ds-hero-kpi-num { display:block; font-size:1.6rem; font-weight:800; color:#336699; line-height:1.1; }
.ds-hero-kpi-label { font-size:.72rem; color:#888; }
.ds-subsection-title { font-size:.9rem; font-weight:700; color:#444; margin:1.25rem 0 .75rem; }
.ds-hero { background:linear-gradient(135deg,#1a2a3a 0%,#336699 100%); color:#fff; border-radius:12px; padding:2rem 2rem 1.5rem; margin-bottom:1.75rem; display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; gap:1.5rem; }
.ds-hero-num { font-size:3.5rem; font-weight:900; line-height:1; letter-spacing:-.02em; }
.ds-hero-label { font-size:1.1rem; font-weight:600; margin:.25rem 0 .5rem; opacity:.95; }
.ds-hero-sub { font-size:.8rem; opacity:.7; }
.ds-hero-stats { display:flex; gap:1.5rem; flex-wrap:wrap; }
.ds-hero-stat { text-align:center; }
.ds-hero-stat-num { display:block; font-size:2rem; font-weight:800; line-height:1.1; }
.ds-hero-stat-label { font-size:.72rem; opacity:.75; }
.ds-section { background:#fff; border:1px solid #e4eaf0; border-radius:10px; padding:1.25rem 1.5rem; margin-bottom:1.25rem; }
.ds-section-title { font-size:1rem; font-weight:700; color:#336699; margin:0 0 1rem; padding-bottom:.5rem; border-bottom:1px solid #e4eaf0; }
.ds-cat-grid { display:flex; flex-direction:column; gap:.45rem; }
.ds-cat-row { display:grid; grid-template-columns:120px 1fr 52px 42px; align-items:center; gap:.5rem; font-size:.85rem; }
.ds-cat-name { font-weight:600; color:#1a2a3a; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ds-cat-bar-wrap { background:#EEF4FF; border-radius:999px; height:10px; overflow:hidden; }
.ds-cat-bar { height:100%; background:#336699; border-radius:999px; transition:width .4s ease; }
.ds-cat-count { text-align:right; color:#555; }
.ds-cat-pct { text-align:right; color:#888; font-size:.78rem; }
.ds-sample-table-wrap { overflow-x:auto; }
.ds-sample-table { width:100%; border-collapse:collapse; font-size:.875rem; }
.ds-sample-table th { background:#EEF4FF; color:#336699; font-weight:700; padding:.5rem .75rem; text-align:left; border-bottom:2px solid #ccd9e8; white-space:nowrap; }
.ds-sample-table td { padding:.5rem .75rem; border-bottom:1px solid #f0f4f8; vertical-align:middle; }
.ds-sample-table tr:last-child td { border-bottom:none; }
.ds-sample-table tr:hover td { background:#fafbfc; }
.ds-food-name { font-weight:600; color:#1a2a3a; max-width:280px; }
.ds-food-group-tag { font-size:.72rem; background:#EEF4FF; color:#336699; border-radius:4px; padding:.1rem .45rem; white-space:nowrap; }
.ds-num-cell { text-align:right; font-family:monospace; color:#444; white-space:nowrap; }
.ds-sample-note { margin-top:.75rem; }
.ds-source-table-wrap { overflow-x:auto; }
.ds-source-table { width:100%; border-collapse:collapse; font-size:.875rem; }
.ds-source-table th { background:#EEF4FF; color:#336699; font-weight:700; padding:.45rem .75rem; text-align:left; border-bottom:2px solid #ccd9e8; white-space:nowrap; }
.ds-source-table td { padding:.5rem .75rem; border-bottom:1px solid #d0d8e4; vertical-align:top; }
.ds-source-table tr:last-child td { border-bottom:none; }
.ds-source-table tbody tr:hover td { background:#f7faff; }
.ds-source-table-th { background:#EEF4FF;color:#336699;font-weight:700;padding:.45rem .75rem;text-align:left;border-bottom:2px solid #ccd9e8;white-space:nowrap; }
.ds-source-table-td { padding:.5rem .75rem;border-bottom:1px solid #d0d8e4;vertical-align:top; }
.ds-small-link { font-size:.75rem; color:#336699; }
.ds-format-badge { background:#EEF4FF; color:#336699; }
.ds-tos-badge-ok { background:#E8F5E9; color:#2e7d32; }
.ds-tos-badge-ng { background:#FFEBEE; color:#c62828; }
.ds-tos-badge-pending { background:#FFF8E1; color:#e65100; }
.ds-active-badge { background:#E8F5E9; color:#2e7d32; }
.ds-inactive-badge { background:#f5f5f5; color:#888; }
.ds-processing-badge { background:#fff3e0; color:#e65100; animation:ds-pulse 1.4s ease-in-out infinite; }
@keyframes ds-pulse { 0%,100% { opacity:1; } 50% { opacity:.5; } }
/* ── パイプライン ステッパー ───────────────────── */
.ps-stepper { display:flex; align-items:flex-start; overflow-x:auto; padding:.6rem .25rem .4rem; gap:0; margin-top:.5rem; }
.ps-step { display:flex; flex-direction:column; align-items:center; gap:.25rem; flex-shrink:0; }
.ps-dot { width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:.7rem; font-weight:700; }
.ps-label { font-size:.65rem; white-space:nowrap; text-align:center; line-height:1.2; }
.ps-conn { width:18px; height:2px; flex-shrink:0; margin-top:12px; }
.ps-step-done    .ps-dot   { background:#2e7d32; color:#fff; }
.ps-step-done    .ps-label { color:#2e7d32; }
.ps-conn-done                { background:#2e7d32; }
.ps-step-running .ps-dot   { background:#e65100; color:#fff; animation:ds-pulse .9s ease-in-out infinite; }
.ps-step-running .ps-label { color:#e65100; font-weight:700; animation:ds-pulse .9s ease-in-out infinite; }
.ps-step-failed  .ps-dot   { background:#c62828; color:#fff; }
.ps-step-failed  .ps-label { color:#c62828; }
.ps-step-skipped .ps-dot   { background:#bbb; color:#fff; }
.ps-step-skipped .ps-label { color:#aaa; }
.ps-step-pending .ps-dot   { background:#f0f4f8; color:#aaa; border:2px solid #dde3ec; }
.ps-step-pending .ps-label { color:#aaa; }
.ps-conn-pending             { background:#dde3ec; }
.ds-tos-btn { padding:.25rem .75rem; font-size:.8rem; }
.ds-fetch-btn { padding:.25rem .75rem; font-size:.8rem; }
.ds-fetch-ok { font-size:.85rem; color:#2e7d32; font-weight:600; }
.ds-fetch-err { font-size:.85rem; color:#c62828; }
.pipeline-running { font-size:.85rem; color:#e65100; font-weight:600; }
.pipeline-ready   { font-size:.85rem; color:#2e7d32; font-weight:600; }
.pipeline-status-banner { background:#fff3e0; border:1px solid #ffb74d; border-left:4px solid #e65100; border-radius:6px; padding:.6rem 1rem; font-size:.875rem; color:#e65100; margin-bottom:1rem; }
.pipeline-status-source { font-weight:600; color:#bf360c; }
.ds-tos-note { margin:0 0 .4rem; }
@keyframes version-alert-pulse {
  0%, 100% { background:#fff0f0; border-color:#e53935; box-shadow:0 0 0 0 rgba(229,57,53,0); }
  50%       { background:#ffcdd2; border-color:#b71c1c; box-shadow:0 0 8px 3px rgba(229,57,53,0.35); }
}
.ds-version-alert { display:flex; justify-content:space-between; align-items:flex-start; gap:.5rem; border:2px solid #e53935; border-radius:6px; padding:.5rem .75rem; font-size:.85rem; font-weight:700; color:#b71c1c; margin:.4rem 0; animation:version-alert-pulse 2.4s ease-in-out infinite; }
.ds-alert-dismiss-btn { flex-shrink:0; padding:.1rem .45rem; font-size:.75rem; font-weight:600; border:1px solid #b71c1c; border-radius:4px; background:transparent; color:#b71c1c; cursor:pointer; line-height:1.4; }
.ds-alert-dismiss-btn:hover { background:#b71c1c; color:#fff; }
.admin-scan-alert-banner { display:flex; align-items:center; gap:.75rem; padding:.875rem 1.25rem; border-radius:8px; margin-bottom:1.25rem; font-size:.9rem; font-weight:700; }
.admin-scan-alert-critical { background:#fff0f0; border:2px solid #dc3545; color:#b71c1c; animation:version-alert-pulse 2.4s ease-in-out infinite; }
.admin-scan-alert-high     { background:#fff4e6; border:2px solid #fd7e14; color:#7d4000; animation:version-alert-pulse 2.4s ease-in-out infinite; }
.admin-scan-alert-icon  { font-size:1.25rem; flex-shrink:0; }
.admin-scan-alert-text  { flex:1; }
.admin-scan-alert-link  { white-space:nowrap; flex-shrink:0; font-weight:700; font-size:.85rem; color:inherit; text-decoration:underline; }
.admin-version-alert-banner { display:flex; flex-direction:column; gap:.5rem; margin-bottom:1.25rem; }
.admin-version-alert-item { display:flex; align-items:center; gap:.75rem; padding:.75rem 1rem; border:2px solid #e53935; border-radius:8px; text-decoration:none; color:#b71c1c; font-weight:700; font-size:.9rem; animation:version-alert-pulse 2.4s ease-in-out infinite; }
.admin-version-alert-item:hover { opacity:.85; }
.admin-version-alert-icon { font-size:1.2rem; flex-shrink:0; }
.admin-version-alert-text { flex:1; }
.admin-version-alert-link { font-size:.8rem; font-weight:600; white-space:nowrap; flex-shrink:0; }
.ds-schedule-list { display:flex; flex-direction:column; gap:.75rem; }
.ds-schedule-item { display:grid; grid-template-columns:130px 180px 1fr; align-items:center; gap:.75rem; padding:.5rem .75rem; background:#fafbfc; border-radius:6px; font-size:.875rem; }
.ds-schedule-badge { font-size:.72rem; font-weight:700; background:#336699; color:#fff; border-radius:4px; padding:.2rem .5rem; text-align:center; }
.ds-schedule-name { font-weight:700; color:#1a2a3a; }

/* ── 管理画面：ダッシュボード ─────────────────────────── */
.admin-page-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}
.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e4eaf0;
}
.admin-page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a2a3a;
  margin: 0;
}
.admin-page-subtitle {
  font-size: 0.85rem;
  color: #9aabb8;
  margin: 0;
}

/* KPI カード */
.admin-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.admin-kpi-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.07), 0 0 0 1px rgba(0,0,0,.04);
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow .15s ease, transform .15s ease;
  border-top: 3px solid #336699;
}
.admin-kpi-card:hover {
  box-shadow: 0 6px 18px rgba(51,102,153,.15);
  transform: translateY(-2px);
}
.admin-kpi-card-alert {
  border-top-color: #CCAA00;
}
.admin-kpi-badge {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #EEF4FF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: #336699;
  line-height: 1;
}
.admin-kpi-badge-alert {
  background: #FFF8E1;
  color: #CCAA00;
}
.admin-kpi-body {}
.admin-kpi-num {
  font-size: 2rem;
  font-weight: 800;
  color: #1a2a3a;
  line-height: 1;
  letter-spacing: -.02em;
}
.admin-kpi-label {
  font-size: 0.78rem;
  color: #8a9aaa;
  margin-top: 0.25rem;
}

/* セクションヘッダ */
.admin-section-header {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #aab8c4;
  margin: 0 0 0.875rem;
}

/* アクションカードグリッド */
.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.75rem;
}
.admin-action-card {
  background: #fff;
  border: 1.5px solid #e4eaf0;
  border-radius: 8px;
  padding: 0.875rem 1rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: border-color .15s, background .15s;
}
.admin-action-card:hover {
  border-color: #336699;
  background: #f4f8fd;
}
.admin-action-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #336699;
  flex-shrink: 0;
}
.admin-action-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #2a3a4a;
  flex: 1;
}
.admin-action-arrow {
  color: #c0ccd8;
  font-size: 1.1rem;
  line-height: 1;
}

/* ── 管理画面：Claude API 設定 ─────────────────────────── */
.admin-claude-wrap {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.admin-claude-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-claude-back {
  color: #336699;
  text-decoration: none;
}
.admin-claude-title {
  margin: 0;
}
.admin-claude-note {
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.admin-claude-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
.admin-claude-thead-row {
  background: #EEF4FF;
}
.admin-claude-th {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 2px solid #336699;
  font-size: 0.875rem;
}
.admin-claude-row {
  border-bottom: 1px solid #dee2e6;
}
.admin-claude-td {
  padding: 0.5rem;
  font-size: 0.875rem;
  vertical-align: middle;
}
.admin-claude-td-mono {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.8rem;
  color: #555;
}
.admin-claude-td-model {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: #336699;
}
.admin-claude-td-date {
  font-size: 0.78rem;
  color: #999;
}
.admin-claude-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.admin-claude-select {
  font-size: 0.82rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  max-width: 260px;
}
.admin-claude-save-btn {
  padding: 0.3rem 1rem;
  font-size: 0.85rem;
}
.admin-claude-saved-msg {
  font-size: 0.82rem;
  color: #1B5E20;
  font-weight: 700;
}
.claude-spec-section { margin-bottom: 2rem; }
.claude-spec-heading { font-size: 1rem; font-weight: 700; color: #336699; margin: 0 0 .75rem; }
.claude-spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; margin-bottom: .5rem; }
.claude-spec-card { background: #fafbfc; border: 1px solid #dde3ec; border-radius: 8px; padding: .75rem 1rem; }
.claude-spec-card-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.claude-spec-label-name { font-weight: 700; font-size: .95rem; color: #1a1a2e; }
.claude-tier-badge { font-size: .68rem; font-weight: 700; border-radius: 3px; padding: .1rem .4rem; white-space: nowrap; }
.claude-tier-lite     { background: #E8F5E9; color: #2e7d32; }
.claude-tier-standard { background: #EEF4FF; color: #336699; }
.claude-tier-pro      { background: #EDE7F6; color: #512DA8; }
.claude-tier-新規     { background: #FFF8E1; color: #e65100; }
.claude-spec-desc { font-size: .78rem; color: #555; margin: 0 0 .5rem; line-height: 1.5; }
.claude-spec-new { font-style: italic; }
.claude-spec-rows { display: flex; flex-direction: column; gap: .2rem; }
.claude-spec-row { display: flex; justify-content: space-between; font-size: .78rem; }
.claude-spec-key { color: #666; }
.claude-spec-val { font-weight: 600; color: #1a1a2e; }
.claude-spec-note { font-size: .75rem; color: #888; margin: .25rem 0 1.5rem; }

/* ── スクロールトップ ─────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }

/* ── ユーティリティ ───────────────────────────────────── */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-sub { color: var(--text-sub); }
.text-sm { font-size: .85rem; }
.text-center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-sub);
  font-size: .95rem;
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: .5rem; }

/* ── 食品安全・リコール情報ページ ────────────────────────── */
.safety-sources-section {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.safety-sources-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--secondary);
  margin: 0 0 1rem;
}
.safety-sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .875rem;
}
.safety-source-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  background: var(--bg);
}
.safety-source-card-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .35rem;
}
.safety-source-flag { font-size: 0.85rem; font-weight: 600; }
.safety-source-name {
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
}
.safety-source-name-en {
  font-size: .75rem;
  color: var(--text-sub);
  margin: 0 0 .25rem;
}
.safety-source-target {
  font-size: .8rem;
  color: var(--text);
  margin: 0 0 .5rem;
  line-height: 1.45;
}
.safety-source-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}
.safety-source-interval {
  font-size: .72rem;
  color: var(--text-sub);
}
.safety-source-link {
  font-size: .75rem;
  color: var(--secondary);
  text-decoration: none;
  white-space: nowrap;
}
.safety-source-link:hover { text-decoration: underline; }
.safety-sources-note {
  font-size: .78rem;
  color: var(--text-sub);
  margin: .75rem 0 0;
}

/* アラートカード */
.alert-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: .875rem;
}
.alert-active  { border-left: 4px solid var(--warning); }
.alert-resolved { border-left: 4px solid var(--primary); }
.alert-card-header {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.alert-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 .35rem;
  line-height: 1.5;
}
.alert-card-orig {
  font-size: .78rem;
  color: var(--text-sub);
  margin: 0 0 .35rem;
}
.alert-card-desc {
  font-size: .88rem;
  color: var(--text);
  margin: 0 0 .35rem;
  line-height: 1.55;
}
.alert-card-desc-en { color: var(--text-sub); }
.alert-card-meta {
  font-size: .78rem;
  color: var(--text-sub);
  margin: 0;
}

/* バッジ追加（安全情報専用） */
.badge-investigating {
  background: #FFF3E0;
  color: #E65100;
  border-radius: 4px;
  padding: .15rem .45rem;
  font-size: .72rem;
  font-weight: 600;
}
.badge-source-type {
  background: var(--light-blue);
  color: var(--secondary);
  border-radius: 4px;
  padding: .15rem .45rem;
  font-size: .72rem;
  font-weight: 600;
}
.badge-lang-en {
  background: #f5f5f5;
  color: #888;
  border-radius: 4px;
  padding: .15rem .4rem;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .03em;
}

/* モバイル調整 */
@media (max-width: 767px) {
  main.container { margin-top: 1.25rem; }
  h1 { font-size: 1.25rem; }
  .pfc-chart-wrap { height: 150px; }
  .food-cta-bar { flex-direction: column; align-items: flex-start; }
  .compare-intro { flex-direction: column; align-items: flex-start; }
  .safety-sources-grid { grid-template-columns: 1fr; }
}

/* ─── 記事生成中バッジ（ダッシュボードKPIカード内） ─── */
.gen-dashboard-badge {
  display: inline-block;
  margin-top: .3rem;
  font-size: .72rem;
  font-weight: 700;
  color: #336699;
  background: #e8f0fa;
  border: 1px solid #c8d8ec;
  border-radius: 10px;
  padding: .1rem .55rem;
  animation: gen-pulse 1.4s ease-in-out infinite;
}

/* ─── 記事生成パネル ─────────────────────────────────── */
.article-gen-panel {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}
.article-gen-header { margin-bottom: .6rem; }
.article-gen-desc { font-size: .85rem; color: #666; margin-left: .5rem; }
.article-gen-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.article-gen-pipeline-row {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid #dee2e6;
}
.article-gen-pipeline-label { font-size: .8rem; color: #666; }

/* ─── 記事生成ステッパー ─────────────────────────────── */
.gen-stepper {
  margin-top: .6rem;
  padding: .75rem 1rem;
  background: #f0f4fa;
  border: 1px solid #c8d8ec;
  border-radius: 6px;
  min-width: 260px;
}
.gen-stepper-title {
  font-size: .78rem;
  font-weight: 700;
  color: #336699;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}
.gen-step {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  padding: .25rem 0;
  font-size: .88rem;
  border-left: 3px solid transparent;
  padding-left: .5rem;
}
.gen-step-icon {
  width: 1.2rem;
  text-align: center;
  flex-shrink: 0;
  margin-top: .1rem;
}
.gen-step-body {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}
.gen-step-line {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.gen-step-detail {
  font-size: .76rem;
  color: #7a8aa0;
  line-height: 1.45;
}
.gen-step-running .gen-step-detail { color: #3f6492; }
.gen-step-done .gen-step-detail { color: #9aa6b6; }
.gen-step-done   { border-left-color: #28a745; }
.gen-step-done .gen-step-icon  { color: #28a745; font-size: .95rem; }
.gen-step-done .gen-step-label { color: #444; }
.gen-step-running { border-left-color: #336699; border-left-width: 4px; background: #dce8f8; border-radius: 0 4px 4px 0; padding-top: .35rem; padding-bottom: .35rem; }
.gen-step-running .gen-step-icon  { color: #1a5fa8; font-size: 1rem; }
.gen-step-running .gen-step-label { color: #1a5fa8; font-weight: 700; font-size: .95rem; }
.gen-step-pending { border-left-color: #ddd; }
.gen-step-pending .gen-step-icon  { color: #bbb; }
.gen-step-pending .gen-step-label { color: #aaa; }
.gen-step-failed  { border-left-color: #dc3545; }
.gen-step-failed .gen-step-icon   { color: #dc3545; }
.gen-step-failed .gen-step-label  { color: #dc3545; font-weight: 700; }
.gen-step-est {
  font-size: .76rem;
  color: #666;
  margin-left: .2rem;
}
.gen-step-footer {
  margin-top: .6rem;
  padding-top: .5rem;
  border-top: 1px solid #c8d8ec;
  font-size: .85rem;
  font-weight: 600;
}
.gen-step-done-msg { color: #2e7d32; }
.gen-step-fail-msg { color: #c62828; }
.gen-step-skipped { border-left-color: #d6a800; }
.gen-step-skipped .gen-step-icon  { color: #b8860b; }
.gen-step-skipped .gen-step-label { color: #8a6d00; }
.gen-step-skip-msg { color: #8a6d00; }
.gen-step-skip-reasons {
  margin: .35rem 0 .2rem;
  padding-left: 1.1rem;
  font-weight: 500;
  color: #6b5600;
  font-size: .82rem;
}
.gen-step-skip-reasons li { margin: .1rem 0; }
.gen-step-refresh-link { color: #336699; font-weight: 700; text-decoration: underline; margin-left: .3rem; }
@keyframes gen-pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.gen-step-running .gen-step-icon { animation: gen-pulse 1.4s ease-in-out infinite; }
.admin-btn-retry-mt { margin-top: .4rem; }

/* ── 記事生成テーマ管理 ──────────────────────────────────────────────── */
.admin-theme-note { font-size:.85rem; color:#666; background:#f5f8ff; border-left:3px solid #336699; padding:.6rem .9rem; margin-bottom:1.2rem; line-height:1.6; }
.admin-theme-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:1rem; }
.admin-theme-card { background:#fff; border:1px solid #dde4ef; border-radius:8px; padding:1rem; }
.admin-theme-card-editing { border-color:#336699; }
.admin-theme-card-header { display:flex; align-items:center; gap:.5rem; margin-bottom:.7rem; flex-wrap:wrap; }
.admin-theme-month-label { font-weight:700; font-size:1.05rem; color:#336699; }
.admin-theme-count { font-size:.8rem; color:#888; background:#eef2fa; border-radius:10px; padding:.1rem .5rem; }
.admin-theme-edit-btn { margin-left:auto; padding:.2rem .7rem; font-size:.82rem; }
.admin-theme-edit-hint { font-size:.8rem; color:#888; margin-left:auto; }
.admin-theme-list { margin:0; padding-left:1.3rem; }
.admin-theme-item { font-size:.85rem; color:#333; padding:.15rem 0; line-height:1.5; }
.admin-theme-empty { font-size:.85rem; color:#aaa; list-style:none; }
.admin-theme-textarea { width:100%; box-sizing:border-box; font-size:.85rem; border:1px solid #ccd4e0; border-radius:6px; padding:.5rem; resize:vertical; font-family:inherit; line-height:1.6; }
.admin-theme-edit-actions { display:flex; align-items:center; gap:.5rem; margin-top:.5rem; }

/* ── 管理画面 共通：ページヘッダー戻りリンク ──────────────────────── */
.admin-back-link { font-size:.85rem; color:#336699; text-decoration:none; padding:.3rem .7rem; border:1px solid #c8d8ec; border-radius:6px; white-space:nowrap; }
.admin-back-link:hover { background:#eef4ff; }

/* ── お問い合わせ一覧 ─────────────────────────────────────────────── */
.admin-empty-state { padding:2rem; text-align:center; color:#777; background:#f8f9fa; border:1px dashed #ccd4e0; border-radius:8px; }
.admin-action-count { display:inline-block; min-width:1.4rem; margin-left:.5rem; padding:.05rem .4rem; background:#dc3545; color:#fff; font-size:.72rem; font-weight:700; border-radius:999px; text-align:center; }
.admin-contact-list { display:flex; flex-direction:column; gap:.8rem; }
.admin-contact-card { border:1px solid #dee2e6; border-radius:8px; padding:.9rem 1.1rem; background:#fff; }
.admin-contact-unread { border-left:4px solid #336699; background:#f4f8fd; }
.admin-contact-head { display:flex; justify-content:space-between; align-items:baseline; gap:.8rem; }
.admin-contact-subject { font-weight:700; color:#2b3a4a; font-size:1rem; }
.admin-contact-newdot { color:#dc3545; font-size:.7rem; margin-right:.2rem; vertical-align:middle; }
.admin-contact-date { color:#888; font-size:.8rem; white-space:nowrap; }
.admin-contact-meta { display:flex; flex-wrap:wrap; gap:.3rem 1rem; margin:.35rem 0 .55rem; font-size:.83rem; color:#555; }
.admin-contact-name { font-weight:600; }
.admin-contact-email { color:#336699; text-decoration:none; }
.admin-contact-email:hover { text-decoration:underline; }
.admin-contact-ip { color:#999; }
.admin-contact-body { white-space:pre-wrap; line-height:1.7; font-size:.9rem; color:#333; background:#fafbfc; border:1px solid #eef1f4; border-radius:6px; padding:.7rem .85rem; }
.admin-contact-actions { display:flex; gap:.6rem; margin-top:.7rem; }
.admin-contact-actions .admin-btn-outline,
.admin-contact-actions .admin-btn-danger { padding:.3rem .9rem; font-size:.82rem; }

/* ── タブ ──────────────────────────────────────────────────────────── */
.admin-tab-bar { display:flex; gap:.3rem; border-bottom:2px solid #c8d8ec; margin-bottom:1.2rem; }
.admin-tab-btn { background:none; border:none; padding:.5rem 1.1rem; font-size:.95rem; color:#666; cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-2px; font-family:inherit; }
.admin-tab-btn:hover { color:#336699; }
.admin-tab-active { color:#336699; font-weight:700; border-bottom-color:#336699; }

/* ── 旬食材管理テーブル ──────────────────────────────────────────── */
.admin-ingredient-toolbar { display:flex; align-items:center; gap:.7rem; flex-wrap:wrap; margin-bottom:1rem; }
.admin-ingredient-filters { display:flex; gap:.5rem; flex-wrap:wrap; flex:1; }
.admin-ingredient-filters select { padding:.3rem .6rem; border:1px solid #ccd4e0; border-radius:6px; font-size:.88rem; font-family:inherit; }
.admin-ingredient-count { font-size:.85rem; color:#888; margin-bottom:.4rem; }
.admin-ingredient-table { width:100%; border-collapse:collapse; font-size:.88rem; }
.admin-ingredient-table th { background:#eef4ff; color:#336699; font-weight:700; padding:.5rem .7rem; text-align:left; border-bottom:2px solid #c8d8ec; white-space:nowrap; }
.admin-ingredient-table td { padding:.45rem .7rem; border-bottom:1px solid #eaedf5; vertical-align:top; }
.admin-ingredient-table tr:hover td { background:#f8faff; }
.admin-ingredient-name { font-weight:600; }
.admin-ingredient-months { color:#555; white-space:nowrap; }
.admin-ingredient-note { color:#666; font-size:.83rem; max-width:220px; }
.admin-ingredient-actions { white-space:nowrap; }
.admin-ingredient-inactive td { opacity:.5; }
.admin-ingredient-cat { display:inline-block; padding:.1rem .45rem; border-radius:4px; font-size:.8rem; font-weight:600; }
.admin-ingredient-cat-野菜  { background:#e8f5e9; color:#2e7d32; }
.admin-ingredient-cat-果物  { background:#fff3e0; color:#e65100; }
.admin-ingredient-cat-魚類  { background:#e3f2fd; color:#1565c0; }
.admin-ingredient-cat-海産物 { background:#e0f7fa; color:#00695c; }
.admin-ingredient-cat-その他 { background:#f3e5f5; color:#6a1b9a; }
.admin-ingredient-toggle { padding:.15rem .55rem; font-size:.8rem; border:none; border-radius:4px; cursor:pointer; }
.admin-ingredient-toggle-on  { background:#c8e6c9; color:#2e7d32; }
.admin-ingredient-toggle-off { background:#ffcdd2; color:#c62828; }
.admin-ingredient-empty { text-align:center; color:#aaa; padding:1.5rem; }

/* 旬食材 追加・編集フォーム */
.admin-ingredient-add-wrapper { background:#f5f8ff; border:1px solid #c8d8ec; border-radius:8px; padding:1rem; margin-bottom:1rem; }
.admin-ingredient-form-title { font-weight:700; color:#336699; margin:0 0 .8rem; }
.admin-ingredient-edit-form { padding:.8rem; background:#f5f8ff; border-radius:6px; }
.admin-ingredient-form-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:.6rem 1rem; margin-bottom:.8rem; }
.admin-ingredient-form-grid label { display:block; font-size:.8rem; color:#555; margin-bottom:.2rem; }
.admin-ingredient-form-grid input,
.admin-ingredient-form-grid select,
.admin-ingredient-form-grid textarea { width:100%; box-sizing:border-box; padding:.3rem .5rem; border:1px solid #ccd4e0; border-radius:5px; font-size:.87rem; font-family:inherit; }
.admin-ingredient-form-grid textarea { resize:vertical; }
.admin-ingredient-form-actions { display:flex; gap:.5rem; }

/* MEXT 特殊記号凡例 */
.mext-legend {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding: .65rem 1rem;
  background: #f9fafb;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: .77rem;
  color: var(--text-sub);
}
.mext-legend-title {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: .4rem;
  font-size: .8rem;
}
.mext-legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mext-legend-list li { white-space: nowrap; }
.mext-legend-list code {
  font-family: "Roboto Mono", monospace;
  font-size: .8rem;
  font-weight: 600;
  color: #336699;
  background: none;
  padding: 0;
}

/* ── ヘッダードロップダウン ─────────────────────────── */
.dropdown-food-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .45rem .5rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 4px;
  line-height: 1.4;
}
.dropdown-food-item:hover {
  background: var(--light-blue);
  color: var(--secondary);
}
.dropdown-food-name {
  font-size: .92rem;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-more-link {
  display: block;
  padding: .4rem .5rem;
  font-size: .85rem;
  color: var(--secondary);
  text-decoration: none;
  border-top: 1px solid var(--border);
  margin-top: .25rem;
}
.dropdown-more-link:hover { text-decoration: underline; }
.dropdown-empty {
  font-size: .88rem;
  color: var(--text-sub);
  padding: .5rem;
  margin: 0;
}

/* ── 栄養素テーブル拡張（グループ・インデント） ─────── */
/*
 * ボーダー設計方針（二重線防止）：
 *   全行は td の border-bottom 1本のみ。
 *   グループ/サブグループは背景色+上部余白で区別し、
 *   border-top は一切使わない。
 */
.nutrient-table .nt-group-header td {
  background: #EEF4FF;
  color: var(--secondary);
  font-weight: 700;
  font-size: .82rem;
  padding: .55rem .75rem .35rem;
  letter-spacing: .02em;
}
/* 値付きグループヘッダー（有機酸・灰分等：Row3単独値行） */
.nutrient-table .nt-group-header-val td {
  background: #EEF4FF;
  color: var(--secondary);
  font-weight: 700;
  font-size: .82rem;
  padding: .55rem .75rem .35rem;
  letter-spacing: .02em;
}
.nutrient-table .nt-group-header-val .nt-name { color: var(--secondary); }
.nutrient-table .nt-group-header-val .nt-value { color: var(--text); font-weight: 600; }
.nutrient-table .nt-group-header-val .nt-value.nt-no-data { color: #9E9E9E; }
.nutrient-table .nt-group-header-val .nt-unit { color: var(--text-sub); font-weight: 400; }
.nutrient-table .nt-group-end td {
  padding: 0;
  height: 0;
  border: none;
}
.nutrient-table .nt-subrow .nt-name {
  padding-left: 2.4rem;
  font-size: .85rem;
  color: var(--text-sub);
}
.nutrient-table .nt-subrow2 .nt-name {
  padding-left: 3.6rem;
  font-size: .82rem;
  color: var(--text-sub);
}
.nutrient-table .nt-subrow3 .nt-name {
  padding-left: 4.8rem;
  font-size: .81rem;
  color: var(--text-sub);
}
.nutrient-table .nt-subrow4 .nt-name {
  padding-left: 6.0rem;
  font-size: .80rem;
  color: var(--text-sub);
}
.nutrient-table .nt-bold { font-weight: 700; color: var(--text) !important; }
.nutrient-table .nt-subgroup-header td {
  background: none;
  color: var(--text);
  font-weight: 400;
  font-size: .85rem;
  padding: .45rem .75rem .25rem 2.4rem;
  letter-spacing: .01em;
}
.nutrient-table .nt-subsubgroup-header td {
  background: none;
  color: var(--text);
  font-weight: 400;
  font-size: .85rem;
  padding: .45rem .75rem .25rem 3.6rem;
  letter-spacing: .01em;
}
.nutrient-table .nt-subrow-head td {
  background: #F5F9FF;
  font-size: .85rem;
  padding: .45rem .75rem .25rem;
}
.nutrient-table .nt-subrow-head .nt-name {
  padding-left: 2.4rem;
  color: var(--secondary);
  font-weight: 600;
  letter-spacing: .01em;
}
.nutrient-table .nt-subrow-head .nt-value {
  color: var(--text);
  font-weight: 400;
}
.nutrient-table .nt-subrow-head .nt-value.nt-no-data { color: #9E9E9E; }
.nutrient-table .nt-subrow-head .nt-unit { color: var(--text-sub); font-weight: 400; }
.nutrient-table .nt-toplevel td {
  background: #EEF4FF;
  color: var(--secondary);
  font-weight: 600;
  font-size: .82rem;
  padding: .5rem .75rem .3rem;
  letter-spacing: .02em;
}
.nutrient-table .nt-toplevel .nt-value {
  color: var(--text);
  font-weight: 400;
}
.nutrient-table .nt-toplevel .nt-value.nt-no-data { color: #9E9E9E; }
.nutrient-table .nt-toplevel .nt-unit { color: var(--text-sub); }

/* ── 全成分データ外側アコーディオン ─────────────────── */
.nutrient-section.pro-section > summary {
  background: #E8F5E9;
  color: #2E7D32;
}
.nutrient-section.pro-section > summary:hover { background: #d0ebd2; }
.nutrient-section.pro-section > summary::before { color: #2E7D32; }

/* ── 内側アコーディオン（11表それぞれ） ─────────────── */
.nutrient-section.pro-inner {
  margin: .5rem .75rem;
  border-radius: 4px;
}
.nutrient-section.pro-inner:last-of-type { margin-bottom: .75rem; }
.nutrient-section.pro-inner > summary {
  background: #E8F5E9;
  color: #2E7D32;
  font-size: .88rem;
  padding: .45rem .85rem;
}
.nutrient-section.pro-inner > summary::before { color: #2E7D32; }
.nutrient-section.pro-inner > summary:hover { background: #d0ebd2; }
.nutrient-section.pro-inner > .nutrient-table { margin: 0; }

.pro-note {
  font-size: .78rem;
  color: var(--text-sub);
  margin: .4rem .75rem .25rem;
  line-height: 1.5;
}

/* ── アミノ酸・脂肪酸マルチ基準テーブル ──────────── */
.pro-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pro-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: .82rem;
}
.pro-table th, .pro-table td {
  padding: .35rem .6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.pro-table thead tr:first-child th {
  background: #E8F5E9;
  color: #2E7D32;
  font-weight: 700;
  font-size: .78rem;
  text-align: center;
}
.pro-table thead tr:last-child th {
  background: var(--bg);
  color: var(--text-sub);
  font-size: .75rem;
  font-weight: 600;
  text-align: center;
}
.pro-table .pt-name {
  text-align: left;
  color: var(--text);
  width: 9rem;
  white-space: normal;
  word-break: keep-all;
}
.pro-table .pt-val {
  text-align: right;
  font-family: "Roboto Mono", monospace;
  min-width: 4.5rem;
}
.pro-table .pt-no-data {
  color: #BDBDBD;
  font-style: italic;
  text-align: center;
}
.pro-table .pt-group td {
  background: #f5f8fd;
  color: var(--secondary);
  font-weight: 700;
  font-size: .78rem;
  padding: .3rem .6rem;
  border-top: 1px solid #c5d8ef;
  letter-spacing: .02em;
}
.pro-table .pt-unit {
  font-size: .72rem;
  color: var(--text-sub);
  font-family: inherit;
}

/* ── DRI全年齢・性別充足率テーブル ─────────────────────── */
.dri-all-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  min-width: 480px;
}
.dri-all-tbl th, .dri-all-tbl td {
  border: 1px solid #ddd;
  padding: .3rem .5rem;
  text-align: center;
  white-space: nowrap;
}
.dri-all-tbl thead th {
  background: #eef4ff;
  color: #336699;
  font-weight: 600;
}
.dri-all-tbl small { font-size: .75rem; font-weight: normal; color: #555; }
.dri-all-tbl td.dri-age { text-align: left; font-weight: 500; background: #fafafa; }
.dri-all-tbl td.dri-hi  { background: #c8e6c9; color: #1b5e20; font-weight: 700; }
.dri-all-tbl td.dri-md  { background: #fff9c4; color: #555; }
.dri-all-tbl td.dri-lo  { color: #888; }
.dri-all-tbl td.dri-nd  { color: #bbb; }

/* ── PFC DRI セレクター ────────────────────────────────── */
.pfc-dri-selector {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: .4rem;
  margin-bottom: .5rem;
  font-size: .85rem;
  color: var(--text-sub);
  overflow-x: auto;
}
.pfc-dri-label { white-space: nowrap; }
.pfc-sel {
  padding: .2rem .4rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: .85rem;
  background: #fff;
  color: #333;
  cursor: pointer;
}
.pfc-sel:focus { outline: 2px solid #336699; }

/* ── 記事生成枠ウィジェット（管理ダッシュボード・生成ログ）── */
.admin-credit-card {
  border: 1px solid #d6e0ee; border-radius: 8px; background: #f6f9fe;
  padding: 14px 16px; margin: 16px 0; }
.admin-credit-warn { border-color: #e8c14a; background: #fff9e8; }
.admin-credit-danger { border-color: #d9534f; background: #fdecec; }
.admin-credit-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.admin-credit-title { font-weight: 700; color: #336699; }
.admin-credit-danger .admin-credit-title { color: #b02a26; }
.admin-credit-link { font-size: .85rem; color: #336699; text-decoration: none; }
.admin-credit-alert { background: #d9534f; color: #fff; border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; font-weight: 700; }
.admin-credit-bar { height: 12px; background: #e3e9f2; border-radius: 6px; overflow: hidden; margin-bottom: 6px; }
.admin-credit-bar-fill { display: block; height: 100%; background: #4a90d9; border-radius: 6px; transition: width .4s; }
.admin-credit-warn .admin-credit-bar-fill { background: #e8a317; }
.admin-credit-danger .admin-credit-bar-fill { background: #d9534f; }
.admin-credit-bar-fill.p0   { width: 0; }
.admin-credit-bar-fill.p10  { width: 10%; }
.admin-credit-bar-fill.p20  { width: 20%; }
.admin-credit-bar-fill.p30  { width: 30%; }
.admin-credit-bar-fill.p40  { width: 40%; }
.admin-credit-bar-fill.p50  { width: 50%; }
.admin-credit-bar-fill.p60  { width: 60%; }
.admin-credit-bar-fill.p70  { width: 70%; }
.admin-credit-bar-fill.p80  { width: 80%; }
.admin-credit-bar-fill.p90  { width: 90%; }
.admin-credit-bar-fill.p100 { width: 100%; }
.admin-credit-figs { font-size: .92rem; color: #333; }
.admin-credit-remain { color: #666; }
.admin-credit-lastfail { margin-top: 8px; font-size: .85rem; color: #b02a26; }

/* ── 生成ログ一覧 ── */
.admin-genlog-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .9rem; }
.admin-genlog-table th, .admin-genlog-table td { border-bottom: 1px solid #e3e9f2; padding: 8px 10px; text-align: left; vertical-align: top; }
.admin-genlog-table th { background: #eef4ff; color: #336699; font-weight: 700; }
.admin-genlog-table tr.genlog-failed { background: #fdf3f3; }
.genlog-at { white-space: nowrap; color: #555; }
.genlog-ok { color: #2e7d32; font-weight: 700; }
.genlog-ng { color: #b02a26; font-weight: 700; }
.genlog-reason strong { color: #b02a26; }
.genlog-detail { display: block; color: #888; font-size: .8rem; margin-top: 3px; word-break: break-all; }
.genlog-cost { white-space: nowrap; color: #555; text-align: right; }
.admin-empty { color: #888; padding: 20px 0; }

/* ── 食品詳細「この食品について」KB事実カード ── */
.food-facts-note { color: #666; font-size: .85rem; margin: .2rem 0 .8rem; }
.food-facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.food-fact-card { border: 1px solid #e2e8f0; border-left: 4px solid #336699; border-radius: 6px; padding: 12px 14px; background: #fff; }
.food-fact-axis { display: inline-block; font-size: .72rem; font-weight: 700; color: #336699; background: #EEF4FF; border-radius: 10px; padding: 1px 10px; margin-bottom: 6px; }
.food-fact-text { margin: 4px 0 8px; line-height: 1.6; font-size: .92rem; color: #222; }
.food-fact-src { margin: 0; font-size: .76rem; color: #888; }
.food-fact-src a { color: #336699; }
.food-fact-safety   { border-left-color: #cc3333; }
.food-fact-safety   .food-fact-axis { color: #cc3333; background: #fdeaea; }
.food-fact-handling { border-left-color: #2e8b57; }
.food-fact-handling .food-fact-axis { color: #2e8b57; background: #e8f5ec; }
.food-fact-season   { border-left-color: #CCAA00; }
.food-fact-season   .food-fact-axis { color: #998200; background: #fbf6e0; }
.food-fact-culture  { border-left-color: #7a5ba6; }
.food-fact-culture  .food-fact-axis { color: #7a5ba6; background: #f1ecf7; }

/* ── 管理ダッシュボード 公開記事カテゴリ別 ── */
.admin-pubcat-card { border:1px solid #e2e8f0; border-radius:8px; background:#fff; padding:14px 16px; margin-bottom:16px; }
.admin-pubcat-head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:10px; }
.admin-pubcat-title { font-weight:700; color:#336699; }
.admin-pubcat-total { color:#666; font-size:.9rem; }
.admin-pubcat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:10px; }
.admin-pubcat-item { display:flex; flex-direction:column; align-items:center; padding:10px 6px; border-radius:6px; background:#EEF4FF; border-top:3px solid #336699; }
.admin-pubcat-count { font-size:1.5rem; font-weight:700; color:#336699; line-height:1.1; }
.admin-pubcat-name { font-size:.8rem; color:#555; margin-top:3px; }
.admin-pubcat-academic { background:#f1ecf7; border-top-color:#7a5ba6; }
.admin-pubcat-academic .admin-pubcat-count { color:#7a5ba6; }
.admin-pubcat-safety { background:#fdeaea; border-top-color:#cc3333; }
.admin-pubcat-safety .admin-pubcat-count { color:#cc3333; }
.admin-pubcat-seasonal { background:#fbf6e0; border-top-color:#CCAA00; }
.admin-pubcat-seasonal .admin-pubcat-count { color:#998200; }
.admin-pubcat-event { background:#e8f5ec; border-top-color:#2e8b57; }
.admin-pubcat-event .admin-pubcat-count { color:#2e8b57; }

/* ── 管理ダッシュボード コンテンツ指標 ── */
.admin-metrics-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:10px; }
.admin-metric { display:flex; flex-direction:column; padding:10px 12px; border-radius:6px; background:#f7f9fc; border-left:3px solid #336699; }
.admin-metric-num { font-size:1.4rem; font-weight:700; color:#336699; line-height:1.15; }
.admin-metric-num small { font-size:.78rem; font-weight:600; color:#888; }
.admin-metric-name { font-size:.78rem; color:#555; margin-top:2px; }

/* ── モバイル見づらさ修正（2026-06-15） ── */
/* 英名・学名の長い英字列が折り返さず横はみ出す問題を修正 */
.food-name-en, .food-name-sci { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 767px) {
  /* PFC凡例：狭い画面では各項目を1行に分けて詰まり/重なりを解消 */
  .pfc-legend-item { width: 100%; }
}

/* 比較トレイ表示中、モバイルではスクロールトップ丸ボタンを隠す
   （モバイルのトレイはチップが縦積みで高く、5rem上げても×ボタンに重なるため） */
@media (max-width: 600px) {
  .compare-panel.visible ~ .scroll-top-btn { display: none; }
}

/* 検索ページ等：MEXT表記凡例が狭幅で横はみ出すのを防ぐ
   （flex行だと長い項目が折り返さず溢れるため、モバイルではblock化して縦積み＋折り返し） */
@media (max-width: 767px) {
  .mext-legend-list { display: block; }
  .mext-legend-list li { white-space: normal; display: block; margin-bottom: .15rem; }
}

/* 食品詳細「カロリーと三大栄養素」グラフのモバイル可読性・操作性 */
@media (max-width: 767px) {
  /* 食事摂取基準セレクタ：横スクロールをやめ折り返して「の目安値」まで見えるように */
  .pfc-dri-selector { flex-wrap: wrap; overflow-x: visible; row-gap: .35rem; font-size: .9rem; }
  /* 年齢・性別セレクトは内容幅に（global select{width:100%} の打ち消し）＋タップ確保 */
  .pfc-sel { width: auto; min-height: 2rem; font-size: .9rem; }
  /* 凡例：inline-flexだと長文が折り返さないため block 化して折り返す＋少し大きく */
  .pfc-legend { display: block; font-size: .85rem; }
  .pfc-legend-item { display: block; margin-bottom: .35rem; line-height: 1.6; }
  .pfc-legend-item .pfc-swatch { display: inline-block; vertical-align: middle; margin-right: .35rem; }
  /* 重量入力：タップしやすく＆iOSのフォーカス時ズーム回避（16px） */
  .pfc-weight-input { font-size: 16px; width: 3.6em; padding: .2rem .35rem; min-height: 1.9rem; }
}

/* 比較の固定チップバー：2行目（○g）は改行させない（食品名=1行目は折り返し可） */
.compare-food-chips .rdr-bar-title-line:last-child { white-space: nowrap; }

/* 緑黄色野菜バッジ（厚労省分類・食品詳細） v84 */
.food-ryokuoyasai{margin:.45rem 0 0;display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.ryokuoyasai-badge{display:inline-block;background:#2e7d32;color:#fff;font-size:.8rem;font-weight:bold;padding:.15rem .65rem;border-radius:1rem;white-space:nowrap}
.ryokuoyasai-note{font-size:.75rem;color:#555}
.ryokuoyasai-note a{color:#336699}

/* 栄養成分ページ v85 */
.nut-wrap{max-width:880px;margin:0 auto;padding:1rem 0}
.nut-hd{border-bottom:3px solid #336699;padding-bottom:.5rem;margin-bottom:1rem}
.nut-hd h1{font-size:1.7rem;color:#336699;margin:0;border-bottom:none;padding-bottom:0}
.nut-badge{background:#EEF4FF;color:#336699;border-radius:4px;padding:.1rem .55rem;font-size:.8rem;margin-left:.6rem;vertical-align:middle}
.nut-unit-inline{color:#777;font-size:.82rem;font-weight:400;margin-left:.6rem;vertical-align:middle}
/* 通称（ビタミンA/E・プロビタミンA 等・common_alias由来）＝原本名の後ろに控えめに併記 */
.nut-alias{color:#6b86a6;font-size:.62em;font-weight:400;vertical-align:middle}
.nut-chip-alias{color:var(--text-sub);font-size:.82em}
/* もっと詳しく（hfnet・国立健康栄養研究所の解説カード） */
.nut-hfnet .nut-hf-block{margin:0 0 .85rem}
.nut-hfnet .nut-hf-block:last-of-type{margin-bottom:.4rem}
.nut-hf-label{display:inline-block;background:#EEF4FF;color:#336699;border-radius:4px;padding:.08rem .5rem;font-size:.8rem;font-weight:700;margin-bottom:.3rem}
.nut-hfnet .nut-hf-block p{margin:.2rem 0 0;line-height:1.75}
.nut-hf-src{margin:.2rem 0 0;font-size:.8rem}
.nut-hf-src a{color:#6b7d95}
.nut-meta{color:#777;font-size:.85rem;margin-top:.25rem}
.nut-card{background:#fafbfd;border:1px solid #e5e9f0;border-radius:10px;padding:1rem 1.2rem;margin:1.1rem 0}
.nut-card h2{font-size:1.05rem;color:#336699;margin:0 0 .6rem;border-left:4px solid #CCAA00;padding-left:.5rem}
.nut-src{color:#336699;font-size:.85rem}
.nut-caa{color:#555;font-size:.85rem;margin:.5rem 0 0}
.nut-dri{margin:0;padding-left:1.1rem}
.nut-dri li{margin:.2rem 0}
.nut-dri-l{display:inline-block;min-width:8rem;color:#555}
.nut-rank{width:100%;border-collapse:collapse;margin-top:.3rem}
.nut-rank th,.nut-rank td{padding:.5rem .6rem;border-bottom:1px solid #eee;font-size:.88rem;text-align:left}
.nut-rank th{background:#336699;color:#fff;font-weight:normal}
.nut-rank a{color:#336699;text-decoration:none}
.nut-rank a:hover{text-decoration:underline}
.nut-rk{width:2.2rem;text-align:center;color:#336699;font-weight:bold}
.nut-vl{white-space:nowrap;font-weight:bold;color:#1a8a55}
.nut-gr{color:#888;font-size:.75rem;white-space:nowrap}
.nut-po{color:#666;font-size:.75rem}
.nut-est{color:#c80;font-size:.7rem}
.nut-note{color:#999;font-size:.75rem;margin-top:.8rem;line-height:1.5}
.nut-back{margin-top:1rem}
.nut-back a{color:#336699}
.nut-list{display:flex;flex-wrap:wrap;gap:.4rem}
.nut-chip{background:#fff;border:1px solid #d8e0ec;border-radius:1rem;padding:.3rem .8rem;font-size:.85rem;color:#336699;text-decoration:none}
.nut-chip:hover{background:#EEF4FF}
/* 栄養成分ページ（スマホのみ・PC不変）：
   ① .nut-wrap に左右余白を付けタイトル等が画面端に張り付かないように。
   ② ランキング表は横スクロールにして各列（特に食品名）に十分な幅を確保し、
      食品名が1文字ずつ縦に潰れるのを防ぐ。 */
@media (max-width: 767px) {
  .nut-wrap { padding-left: 16px; padding-right: 16px; }
  .nut-rank-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nut-rank { min-width: 560px; }                 /* 各列に余裕を持たせ横スクロール */
  .nut-rank th:nth-child(2), .nut-rank td:nth-child(2) { min-width: 8.5rem; }  /* 食品名 */
  .nut-po { white-space: nowrap; }                /* 目安量（小さじ1杯…）を1行に */
}

/* 検索結果の栄養成分誘導カード v86 */
.nut-search-hit{grid-column:1/-1;display:flex;align-items:center;gap:.6rem;background:#EEF4FF;border:1px solid #cdddf5;border-radius:10px;padding:.7rem 1rem;text-decoration:none;color:#336699;margin-bottom:.3rem}
.nut-search-hit:hover{background:#e3edfb}
.nut-search-tag{background:#336699;color:#fff;font-size:.72rem;border-radius:4px;padding:.15rem .5rem;white-space:nowrap}
.nut-search-name{font-weight:bold;font-size:1rem}
.nut-search-go{color:#5a7aa0;font-size:.85rem}

/* 検索ドロップダウンの栄養成分候補 v87 */
.dropdown-nut-item{display:flex;align-items:center;gap:.5rem}
.dropdown-nut-tag{background:#336699;color:#fff;font-size:.68rem;border-radius:3px;padding:.1rem .4rem;white-space:nowrap;flex-shrink:0}

/* 人気記事ランキング一覧（/articles/ranking）v92 */
.rank-page-list{list-style:none;margin:1.25rem 0 0;padding:0;max-width:820px}
.rank-page-item{border-bottom:1px solid #e8e8e8}
.rank-page-item:last-child{border-bottom:none}
.rank-page-link{display:flex;align-items:center;gap:16px;padding:14px 6px;text-decoration:none;color:inherit;transition:background .15s}
.rank-page-link:hover{background:#f6f9f7}
.rank-page-num{flex:0 0 auto;width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:1rem;background:#f1f1f1;color:#333}
.rank-page-num.rank-top{color:#fff}
.rank-page-num.rank-1{background:#f1c40f}
.rank-page-num.rank-2{background:#b2bab7}
.rank-page-num.rank-3{background:#d35400}
.rank-page-thumb{flex:0 0 auto;width:72px;height:72px;border-radius:8px;overflow:hidden;background:#eef1f0}
.rank-page-img{width:100%;height:100%;object-fit:cover;display:block}
.rank-page-text{display:flex;flex-direction:column;gap:4px;min-width:0}
.rank-page-title{font-size:.95rem;font-weight:700;color:#333;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.rank-page-date{font-size:.78rem;color:#999}
@media (max-width:600px){
  .rank-page-thumb{width:56px;height:56px}
  .rank-page-num{width:34px;height:34px;font-size:.9rem}
  .rank-page-link{gap:12px}
}

/* ── 参考資料・データの出典ページ (/sources) ── */
.refpage { max-width: 960px; margin: 0 auto; padding: 0 20px 3rem; }
.refpage-lead { padding: 1.4rem 0 0.4rem; }
.refpage-lead h1 { color: var(--primary); font-size: 1.6rem; margin: 0 0 0.75rem; }
.refpage-lead p { color: #3f4d45; font-size: 0.95rem; line-height: 1.9; max-width: 760px; }
.refpage-policy { margin-top: 1.1rem; background: #eef7f1; border: 1px solid #d6ebdd; border-radius: 12px; padding: 1rem 1.25rem; font-size: 0.85rem; color: #2f5a42; line-height: 1.8; }
.refpage-policy strong { color: var(--primary); }
.refpage-group { margin-top: 2.4rem; }
.refpage-group > h2 { font-size: 1.2rem; color: #27332c; display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.35rem; border: 0; padding: 0; }
.refpage-group > h2::before { content: ""; width: 6px; height: 22px; background: var(--primary); border-radius: 3px; flex: 0 0 auto; }
.refpage-group-note { font-size: 0.8rem; color: #5f6d63; margin: 0 0 1rem 1rem; line-height: 1.7; }
.ref-src { background: #fff; border: 1px solid #e7efe9; border-radius: 14px; padding: 1.3rem 1.4rem; margin-bottom: 0.9rem; box-shadow: 0 4px 14px rgba(45, 106, 45, .05); }
.ref-src-top { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }
.ref-src-top h3 { font-size: 1.02rem; color: #27332c; margin: 0; }
.ref-org { font-size: 0.72rem; color: #fff; background: var(--primary); border-radius: 5px; padding: 2px 10px; font-weight: 500; white-space: nowrap; }
.ref-org.semi { background: #7a8f84; }
.ref-dl { display: grid; grid-template-columns: 150px 1fr; gap: 0.4rem 0.9rem; margin: 0.8rem 0 0; font-size: 0.85rem; line-height: 1.75; }
.ref-dl dt { color: var(--primary); font-weight: 700; }
.ref-dl dd { color: #3f4d45; margin: 0; }
.ref-links { margin-top: 0.85rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ref-links a { display: inline-flex; align-items: center; gap: 0.35rem; background: #eef7f1; border: 1px solid #d6ebdd; border-radius: 20px; padding: 0.35rem 0.85rem; font-size: 0.8rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.ref-links a:hover { background: #e0f0e6; }
.ref-read { background: #fff; border: 1px solid #e7efe9; border-radius: 14px; padding: 1.1rem 1.3rem; }
.ref-read table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ref-read th, .ref-read td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid #e7efe9; vertical-align: top; line-height: 1.7; }
.ref-read tr:last-child th, .ref-read tr:last-child td { border-bottom: 0; }
.ref-read th { color: var(--primary); width: 150px; white-space: nowrap; font-weight: 700; }
.refpage-foot { margin-top: 1.8rem; font-size: 0.78rem; color: #5f6d63; border-top: 1px solid #e7efe9; padding-top: 1.1rem; line-height: 1.9; }

/* サイトマップ（人が見るHTMLサイトマップ /sitemap） */
.sitemap-links { list-style: none; margin: .5rem 0 0; padding: 0; }
.sitemap-links li { padding: .55rem .2rem; border-bottom: 1px solid #e7efe9; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; }
.sitemap-links li:last-child { border-bottom: none; }
.sitemap-links li a { font-weight: 600; color: var(--secondary); text-decoration: none; }
.sitemap-links li a:hover { text-decoration: underline; }
.sitemap-note { color: #5f6d63; font-size: .82rem; }
.sitemap-subhead { margin: 1.2rem 0 .5rem; font-weight: 600; color: #5f6d63; font-size: .88rem; }
.sitemap-groups { display: flex; flex-wrap: wrap; gap: .45rem; }
.sitemap-chip { display: inline-block; padding: .35rem .75rem; border: 1px solid #e0e0e0; border-radius: 999px; background: #fff; color: var(--text); text-decoration: none; font-size: .84rem; }
.sitemap-chip:hover { border-color: var(--secondary); color: var(--secondary); }
@media (max-width: 600px) {
  .ref-dl { grid-template-columns: 1fr; gap: 0.1rem 0; }
  .ref-dl dt { margin-top: 0.5rem; }
  .ref-read th { width: auto; white-space: normal; }
}

/* ── 旬カレンダー (/seasonal) ── */
.shun-page { max-width: 1080px; margin: 0 auto; padding: 0 20px 3rem; }
.shun-lead { padding: 1.4rem 0 0.6rem; }
.shun-lead h1 { color: var(--primary); font-size: 1.6rem; margin: 0 0 0.5rem; }
.shun-lead p { color: var(--text-sub); font-size: 0.9rem; margin: 0; line-height: 1.8; max-width: 720px; }

/* 月ナビ（丸ピル・現在月に「今」バッジ） */
.shun-months { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.1rem 0 1.7rem; }
.shun-month { position: relative; border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 999px; padding: 0.5rem 1.05rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.shun-month:hover { border-color: var(--primary); color: var(--primary); }
.shun-month.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.shun-now { position: absolute; top: -8px; right: -6px; background: #e8730c; color: #fff; font-size: 0.6rem; line-height: 1; padding: 2px 5px; border-radius: 999px; font-weight: 700; }

/* 見出し */
.shun-head { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.9rem; }
.shun-head-title { font-size: 1.25rem; color: var(--text); margin: 0; font-weight: 700; }
.shun-head-count { font-size: 0.85rem; color: var(--primary); font-weight: 700; }

/* カテゴリチップ */
.shun-cats { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 1.4rem; }
.shun-chip { border: 1px solid var(--border); background: #fff; color: var(--text-sub); border-radius: 999px; padding: 0.35rem 0.85rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.shun-chip:hover { border-color: var(--primary); color: var(--primary); }
.shun-chip.active { background: #eef7f1; border-color: var(--primary); color: var(--primary); }
.shun-chip-n { color: #b0b0b0; font-weight: 500; margin-left: 2px; }
.shun-chip.active .shun-chip-n { color: var(--primary); }

/* カードグリッド */
.shun-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.shun-card { display: flex; align-items: center; gap: 0.65rem; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem 0.85rem; text-decoration: none; color: var(--text); transition: transform .12s, box-shadow .12s; }
.shun-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .1); }
/* タイル（絵文字 or 頭文字）。背景・文字色はカテゴリ色で塗り分け（下記）。 */
.shun-tile { width: 46px; height: 46px; flex-shrink: 0; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; line-height: 1; background: #eef1ef; }
.shun-tile-mono { font-size: 1.3rem; font-weight: 800; color: #5f6d63; font-family: "Noto Sans JP", sans-serif; }
.shun-card-body { display: flex; flex-direction: column; min-width: 0; }
.shun-card-name { font-size: 0.9rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.shun-card-meta { font-size: 0.72rem; color: var(--text-sub); line-height: 1.35; margin-top: 2px; }
.shun-empty { color: var(--text-sub); padding: 1.5rem 0; grid-column: 1 / -1; }

/* カテゴリ別の「カード背景色」＋タイル色（野菜=緑・果物=ピンク・魚類=青・海産物=シアン・
   海藻=緑青・きのこ=茶・肉=赤・穀物豆=金・飲料=緑・その他=灰）。一群ごとに色でまとまる。 */
.shun-card.shun-veg   { background: #eef8f1; border-color: #d7ecdd; }
.shun-veg   .shun-tile { background: #c6e9cf; } .shun-veg   .shun-tile-mono { color: #2b7a4b; }
.shun-card.shun-fruit { background: #fff1f5; border-color: #ffdbe6; }
.shun-fruit .shun-tile { background: #ffd2df; } .shun-fruit .shun-tile-mono { color: #c93f6d; }
.shun-card.shun-fish  { background: #eef3ff; border-color: #dae4fb; }
.shun-fish  .shun-tile { background: #cddffb; } .shun-fish  .shun-tile-mono { color: #2f62c4; }
.shun-card.shun-sea   { background: #ecf9fb; border-color: #d2ecf1; }
.shun-sea   .shun-tile { background: #c2e6ee; } .shun-sea   .shun-tile-mono { color: #1a86a0; }
.shun-card.shun-alga  { background: #edf7f1; border-color: #d8ece2; }
.shun-alga  .shun-tile { background: #cbe7da; } .shun-alga  .shun-tile-mono { color: #1e8a6e; }
.shun-card.shun-mush  { background: #f9f4ec; border-color: #ecdfce; }
.shun-mush  .shun-tile { background: #e4d2ba; } .shun-mush  .shun-tile-mono { color: #8a5a2b; }
.shun-card.shun-meat  { background: #fff2f0; border-color: #ffd8d1; }
.shun-meat  .shun-tile { background: #ffcfc7; } .shun-meat  .shun-tile-mono { color: #c0392b; }
.shun-card.shun-grain { background: #fbf8ea; border-color: #efe7c8; }
.shun-grain .shun-tile { background: #ecdfb2; } .shun-grain .shun-tile-mono { color: #a5822a; }
.shun-card.shun-drink { background: #f2f9ec; border-color: #dcecd0; }
.shun-drink .shun-tile { background: #d3e7c3; } .shun-drink .shun-tile-mono { color: #4f7f30; }
.shun-card.shun-other { background: #f5f7f6; border-color: #e4e8e6; }
.shun-other .shun-tile { background: #dbe0dd; } .shun-other .shun-tile-mono { color: #5f6d63; }

@media (max-width: 560px) {
  .shun-grid { grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 10px; }
  .shun-month { padding: 0.45rem 0.85rem; font-size: 0.85rem; }
  .shun-lead h1 { font-size: 1.4rem; }
}

/* ── 食品詳細：MEXT成分表 備考欄 ── */
.food-remark { margin-top: 1.2rem; }
.food-remark .food-remark-block { margin-top: .8rem; }
.food-remark .food-remark-label { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--secondary); margin-bottom: .25rem; }
.food-remark .food-remark-raw { white-space: pre-line; background: #f6f8fc; border: 1px solid #dde6f0; border-left: 3px solid var(--secondary); border-radius: 8px; padding: .8rem 1rem; font-size: .9rem; line-height: 1.85; color: #333; margin: 0; }
.food-remark .food-remark-src { font-size: .75rem; color: var(--text-sub); margin: .35rem 0 0; }
/* 食品の説明（食品群別留意点）＝学名直下の単独配置（「この食品について」セクション廃止に伴う） */
.food-desc-under-sci { margin: .7rem 0 1rem; }
.food-desc-under-sci .food-remark-label { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--secondary); margin-bottom: .25rem; }
.food-desc-under-sci .food-remark-raw { white-space: pre-line; background: #f6f8fc; border: 1px solid #dde6f0; border-left: 3px solid var(--secondary); border-radius: 8px; padding: .8rem 1rem; font-size: .9rem; line-height: 1.85; color: #333; margin: 0; }
.food-desc-under-sci .food-remark-src { font-size: .75rem; color: var(--text-sub); margin: .35rem 0 0; }

/* htmx インジケータ（htmx 既定の <style> 注入を CSP 対応で止めたため等価定義を収蔵。
   includeIndicatorStyles=false と対＝base.html の htmx-config meta 参照） */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

/* ── 管理画面：キャッシュ削除の結果表示（/admin/system/cache）───────────── */
.cache-purge-result {
  display: inline-block;
  padding: .45rem .7rem;
  border-radius: 6px;
  font-size: .85rem;
  line-height: 1.5;
}
.cache-purge-ok  { background: #EAF5EC; color: #2D6A2D; border: 1px solid #C6E3CB; }
.cache-purge-ng  { background: #FBECEA; color: #A03127; border: 1px solid #EFCBC6; }
