/* 色合い：木の実と台所（くるみ色・クリーム色・葉っぱの緑） */
:root {
  --bg: #f5eee2;
  --surface: #fffdf8;
  --surface-2: #fbf6ec;
  --header-bg: #fffaf2;
  --text: #3b2f26;
  --muted: #7a6656;
  --border: #eadfcd;
  --accent: #8a5a3b;
  --accent-text: #ffffff;
  --accent-soft: #f3e6d6;
  --leaf: #5f8545;
  --danger: #b3261e;
  --chip: #f1e7d8;
  --shadow: 0 2px 10px rgba(122, 75, 47, .10);
  --role-main-bg: #f3dfcf; --role-main: #8a4a26;
  --role-side-bg: #dde9cf; --role-side: #4d6b33;
  --role-soup-bg: #e9e0cf; --role-soup: #7a6040;
  --role-staple-bg: #f4ead0; --role-staple: #806417;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='%238a5a3b' opacity='.07'%3E%3Cellipse cx='30' cy='38' rx='9' ry='11'/%3E%3Cpath d='M19 30q11-12 22 0z'/%3E%3Cellipse cx='120' cy='40' rx='6' ry='7'/%3E%3Cellipse cx='50' cy='128' rx='7' ry='8'/%3E%3C/g%3E%3Cpath d='M110 100q18-18 30 0q-12 18-30 0z' fill='%236b8f4e' opacity='.09'/%3E%3C/svg%3E");
  --radius: 18px;
  --tabs-h: 60px;
  accent-color: var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1a16;
    --surface: #2a231d;
    --surface-2: #241e19;
    --header-bg: #251f1a;
    --text: #efe6da;
    --muted: #b3a493;
    --border: #3d332a;
    --accent: #d29a6e;
    --accent-text: #1f1a16;
    --accent-soft: #3a2c22;
    --leaf: #9cbf7e;
    --danger: #f2827a;
    --chip: #362c24;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
    --role-main-bg: #4a3123; --role-main: #f0bf9c;
    --role-side-bg: #2f3d25; --role-side: #b9d6a0;
    --role-soup-bg: #3e3426; --role-soup: #e2cba6;
    --role-staple-bg: #403520; --role-staple: #ead48f;
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='%23d29a6e' opacity='.06'%3E%3Cellipse cx='30' cy='38' rx='9' ry='11'/%3E%3Cpath d='M19 30q11-12 22 0z'/%3E%3Cellipse cx='120' cy='40' rx='6' ry='7'/%3E%3Cellipse cx='50' cy='128' rx='7' ry='8'/%3E%3C/g%3E%3Cpath d='M110 100q18-18 30 0q-12 18-30 0z' fill='%239cbf7e' opacity='.08'/%3E%3C/svg%3E");
  }
}

* { box-sizing: border-box; }
/* hidden を付けたものは、display を指定した部品でも隠す */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg) var(--pattern);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 8px; }
h1 { font-size: 18px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; color: var(--muted); margin-top: 16px; }
p { margin: 0 0 8px; }

.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  /* スマホのノッチや角の丸みに重ならないように（ホーム画面から開いたとき） */
  padding: calc(10px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left));
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}
.app-logo { width: 34px; height: 34px; flex: none; }
.app-header h1 { margin: 0; font-size: 20px; letter-spacing: .04em; color: var(--accent); }
.app-catch { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.season { margin-left: auto; flex: none; width: 90px; height: 44px; }
.season svg { width: 100%; height: 100%; }
@media (max-width: 420px) {
  .season { width: 60px; height: 30px; }
  .app-catch { font-size: 11px; }
}
/* 挿し絵 */
.illust { display: block; width: min(220px, 60%); height: auto; margin: 4px auto 8px; }
.illust.sm { width: min(140px, 40%); }
.illust.xs { width: 64px; }
.empty { text-align: center; padding: 4px 0; }
.empty p { margin-bottom: 4px; }
@media (prefers-color-scheme: dark) {
  .illust { opacity: .9; }
}
.badge {
  font-size: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 99px;
  vertical-align: middle;
}

.main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.section-head h2 { margin: 0; }

.muted { color: var(--muted); }
.note-text { color: var(--danger); } /* ホームの案の下に出る注意書き */
.kcal-text { font-weight: 600; margin: 4px 0; color: var(--muted); }
.terms h3 { margin: 12px 0 4px; color: var(--text, inherit); font-size: 14px; }
.terms p, .terms ol { margin: 0 0 6px; }
.terms ol { padding-left: 1.4em; }
.terms .terms-title { font-size: 15px; text-align: center; margin-top: 8px; }
.terms-items { list-style: none; padding-left: 1em; margin: 0 0 6px; }
.terms-end { text-align: right; margin: 4px 0; }
.terms-scroll { max-height: 45vh; overflow-y: auto; border: 1px solid var(--border, #ddd); border-radius: 8px; padding: 4px 14px; margin-top: 6px; }
.btn:disabled, .btn:disabled:hover { opacity: 0.45; filter: grayscale(1); cursor: not-allowed; }
.check input:disabled + * , .check:has(input:disabled) { color: var(--muted); cursor: not-allowed; }
.guide-list { margin: 6px 0 10px; padding-left: 1.3em; }
.guide-list li { margin: 6px 0; }
.guide-point { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 8px 10px; border-radius: 6px; font-weight: 600; }
.dish-entry { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.avoid-check { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; }
.row .input { flex: 1; min-width: 0; }

/* ボタン */
.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 99px;
  padding: 8px 16px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-text {
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  padding: 6px 4px;
  cursor: pointer;
}
.btn-text.danger { color: var(--danger); }
.btn-icon {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  flex: none;
}

/* 入力 */
.input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 13px; font-weight: 600; }
.check-group { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.check { display: inline-flex; align-items: center; gap: 4px; }

/* トグル */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.toggle-row:first-child, h2 + .toggle-row, p + .toggle-row { border-top: none; }
.toggle-label { font-weight: 600; }
.toggle-row select { width: auto; flex: none; }
.switch {
  appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 99px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background .2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }

/* 一覧 */
.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.list-item:first-child { border-top: none; }
.item-title { font-weight: 600; }
.item-actions { display: flex; gap: 4px; flex: none; }
.member-row { padding: 8px 0; align-items: center; }
/* 設定の「その他」：リンクを1行ずつ */
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 10px 0; border-top: 1px solid var(--border); }
.link-list li:first-child { border-top: none; }
.toggle-row + .link-list { border-top: 1px solid var(--border); }
.link-list a { color: var(--text); text-decoration: none; display: flex; justify-content: space-between; }
.link-list a::after { content: '›'; color: var(--muted); }

.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--chip);
  border-radius: 99px;
  padding: 1px 10px;
  font-size: 13px;
}
.chip-x {
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0 0 4px;
  font-size: 14px;
}
.picker { display: flex; flex-direction: column; gap: 6px; }

.pattern-group h3 { margin-bottom: 0; }
.slots { display: flex; flex-direction: column; gap: 6px; }
.slot-row { display: flex; gap: 6px; align-items: center; }
.slot-row select { flex: 1; min-width: 0; }

/* モーダル */
.modal {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  background: var(--surface);
  color: var(--text);
}
.modal::backdrop { background: rgba(0, 0, 0, .45); }
.modal-head { padding: 16px 16px 0; }
.modal-body { padding: 8px 16px 16px; overflow-y: auto; max-height: calc(100vh - 170px); }
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
/* 選択肢が多いとき（4つ以上）は、縦に並べて画面からはみ出さないようにする */
.modal-actions.many { flex-direction: column; align-items: stretch; }
.modal-actions.many .btn { width: 100%; }

/* 下部タブ */
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs[hidden] { display: none; }
.tutorial h2 { margin-top: 8px; }
.tutorial-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.tab {
  flex: 1;
  height: var(--tabs-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  min-width: 0;
  padding: 0 2px;
  text-align: center;
  line-height: 1.2;
}
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--accent); font-weight: 700; }
.tabs { background: var(--header-bg); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabs-h) + 16px);
  transform: translate(-50%, 20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  z-index: 1000;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-action {
  margin-left: 12px;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

pre { white-space: pre-wrap; word-break: break-all; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-list .check-group { flex-direction: column; gap: 6px; }
.meal-label {
  display: inline-block;
  min-width: 2em;
  font-weight: 700;
  color: var(--accent);
  margin-right: 8px;
}

/* 折りたたみ（詳しく設定） */
.more {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.more summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.more[open] summary { margin-bottom: 10px; }

/* お気に入り */
.star {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1.2;
  color: var(--muted);
  cursor: pointer;
  padding: 0 2px;
  flex: none;
}
.star.on { color: var(--accent); }

/* はじめかた */
.steps { list-style: none; margin: 0; padding: 0; }
.step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.step:first-child { border-top: none; }
.step-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}
.step.done .step-num { background: var(--accent); color: var(--accent-text); }
.step.soon { opacity: .6; }
.step-status { margin-top: 4px; }
.step .btn { flex: none; }

.row.wrap { flex-wrap: wrap; }
.notice {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 10px 0;
}
.demo-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
}
.demo-banner a { color: var(--accent); }

/* 朝・昼・夕の切り替え */
.seg {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--chip);
  border-radius: 99px;
  margin: 8px 0 12px;
}
.seg-btn {
  flex: 1;
  border: none;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  padding: 8px;
  cursor: pointer;
}
.seg-btn.active { background: var(--accent); color: var(--accent-text); font-weight: 700; }

/* 提案 */
.cands { display: grid; gap: 12px; }
/* 提案はカードの中に直接並べる（枠で囲まない） */
.cand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cand .btn { align-self: flex-start; }
.cand-head { font-weight: 700; color: var(--accent); font-size: 14px; }
.dishes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dishes .role {
  display: inline-block;
  min-width: 4.5em;
  font-size: 12px;
  color: var(--muted);
}
/* 料理の役割の札（色で献立のバランスが分かるように） */
.dishes .role[data-role] {
  min-width: 3.6em;
  margin-right: 6px;
  padding: 0 9px;
  border-radius: 99px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--chip);
}
.dishes .role[data-role="main"], .dishes .role[data-role="onedish"] { background: var(--role-main-bg); color: var(--role-main); }
.dishes .role[data-role="side"] { background: var(--role-side-bg); color: var(--role-side); }
.dishes .role[data-role="soup"] { background: var(--role-soup-bg); color: var(--role-soup); }
.dishes .role[data-role="staple"] { background: var(--role-staple-bg); color: var(--role-staple); }
.dishes li + li { border-top: 1px dashed var(--border); padding-top: 4px; }
.reasons { margin: 0; padding-left: 1.2em; color: var(--muted); }
/* 提案理由・朝ごはんの一言は、枠を付けない小さな文にする */
.reason-text { margin: 0; color: var(--muted); }
.dishes li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; }
/* 料理1品は2段：1段目に札と操作、2段目に料理名 */
.dishes li:has(> .dish-top) { display: block; padding: 6px 0; }
.dish-top { display: flex; align-items: center; gap: 4px; min-height: 28px; }
.dish-name { font-size: 16px; font-weight: 600; line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.dish-name.long { font-size: 14px; }
/* おうちごはんの主菜・一品料理は大きく。長い名前は fitDishNames で1行に収まるまで小さくする */
.dish-name.primary { font-size: 20px; white-space: nowrap; overflow-wrap: normal; }
.dish-name.primary.wrap { white-space: normal; overflow-wrap: anywhere; }
.dish-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.btn.btn-sm { padding: 3px 10px; font-size: 12px; min-height: 0; }
/* 「副菜も提案しますか？」 */
.course-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 12px; }
.course-add-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
/* レシピのURLと「読み込む」 */
.import-row { gap: 6px; flex-wrap: nowrap; }
.import-row .input { flex: 1; min-width: 0; }
.import-row .btn { flex: none; }
.import-note:empty { display: none; }
/* 買い物リストの量（押して直せる） */
.amount-edit { text-decoration: underline dotted; }
/* 料理ごとの「⋯」（選ぶ・固定・不要のメニュー） */
.dish-menu { border: none; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 6px; cursor: pointer; }
.lock-mark { font-size: 12px; }
.feedback .kcal-text { margin: 0 0 0 auto; align-self: center; }
.dishes li.removed .role, .dishes li.removed > .muted { opacity: .6; }
.lock-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 99px;
  padding: 1px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.lock-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.reasons-toggle summary { cursor: pointer; font-size: 13px; color: var(--muted); }

/* 記録 */
.modal.wide { width: min(760px, calc(100vw - 32px)); }
.rows { display: flex; flex-direction: column; gap: 12px; }
.log-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.log-row.excluded { opacity: .45; }
.thumb-lg {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  flex: none;
  background: var(--chip);
}
.thumb-error { display: flex; align-items: center; padding: 8px; color: var(--danger); }
.thumbs { display: flex; gap: 4px; flex: none; }
.thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--chip);
}
.day h3 { margin-bottom: 0; }
.card-details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.card-details > summary::-webkit-details-marker { display: none; }
.card-details > summary::before { content: "▸"; color: var(--muted); font-size: 14px; }
.card-details[open] > summary::before { content: "▾"; }
.card-details > summary h2 { margin: 0; }
.card-details-body { margin-top: 10px; }
.hint { color: var(--accent); margin: 0; }
.allergy-note {
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
}
.allergy-note .item-title { color: var(--danger); }
.allergy-inline { color: var(--danger); }
.allergy-note ul { margin: 4px 0; padding-left: 1.2em; }
.feedback { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.opt-lines { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 12px; }
.opt-lines > .field, .opt-lines .ing-options { margin: 0; }
.shape-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mood-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.decided .cand-head { color: var(--leaf, var(--accent)); }
.decided-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.ingredients summary { cursor: pointer; color: var(--accent); }
.ingredients ul { margin: 6px 0; padding-left: 1.2em; }
.ingredients li { margin-bottom: 4px; }
.ing-dish { font-weight: 700; margin-right: 6px; }
.servings .input { width: auto; flex: none; }

/* アドバイス */
/* 概要：小さな絵と最初のひと言を横に並べ、右上に閉じるボタン */
.advice-top { display: flex; align-items: flex-start; gap: 10px; }
.advice-top .illust { margin: 0; flex: none; }
.advice-text { flex: 1; margin: 0; font-weight: 600; }
.advice-close { flex: none; border: none; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 2px; cursor: pointer; }
.advice-text-sub { margin: 6px 0 0; }
.advice-more-link { text-align: right; }
/* アドバイスで勧めるレシピ（枠は付けず、左の線だけで区切る） */
.advice-cards { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 10px; }
.advice-card { border-left: 3px solid var(--leaf); padding: 2px 0 2px 12px; text-align: left; }
.advice-card-name { font-size: 17px; font-weight: 700; margin: 4px 0 2px; }
.advice-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.advice-card-actions .btn { padding: 6px 14px; font-size: 13px; }
.chip-new { background: var(--role-side-bg); color: var(--role-side); font-weight: 700; }
.advice-item { padding: 10px 0; border-top: 1px solid var(--border); }
.advice-item:first-of-type { border-top: none; }
.advice-recipes { margin: 6px 0 0; padding-left: 1.2em; }
.advice-recipes a { color: var(--accent); }
.idea-actions { display: inline-flex; gap: 10px; margin-left: 10px; align-items: baseline; }
.idea-actions a { color: var(--accent); }
.idea-actions .btn-text { padding: 0; font-size: 13px; }
.site-links {list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.site-links a { display: block; padding: 10px; border: 1px solid var(--border); border-radius: 8px; text-align: center; color: var(--accent); }
.form-actions { margin-top: 14px; }
.ing-row { display: flex; gap: 6px; align-items: center; }
.ing-row .ing-name { flex: 1; min-width: 0; }
.ing-row .ing-amount { width: 5.5em; flex: none; }
.ing-row .ing-unit { width: 5.5em; flex: none; }
.dish-url {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* 食品群のバー */
.bars { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.bar-label { width: 7.5em; flex: none; }
.bar { flex: 1; height: 10px; background: var(--chip); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar-num { width: 3em; text-align: right; flex: none; }
.bar-row.low .bar-label, .bar-row.low .bar-num { color: var(--danger); font-weight: 600; }

@media (max-width: 560px) {
  .log-row { flex-direction: column; }
  .thumb-lg { width: 100%; height: 200px; }
}

/* 買い物・在庫 */
.shop-list .check { align-items: flex-start; gap: 8px; }
.shop-list .check input { margin-top: 4px; }
.stock-edit { flex-wrap: wrap; margin-top: 4px; }
.stock-edit .input-amount { flex: 0 0 72px; width: 72px; }
.stock-edit .input { flex: 0 0 auto; width: auto; }
.stock-edit .input-date { flex: 0 0 auto; width: auto; }
.warn { color: #b3361b; font-weight: 600; }
@media (prefers-color-scheme: dark) {
    .warn { color: #ff9b85; }
}

/* 作り置き */
.batch-days { list-style: none; padding: 0; margin: 4px 0 8px; }
.batch-days li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.batch-days li:last-child { border-bottom: none; }
.batch-date { flex: 0 0 auto; min-width: 7.5em; font-weight: 600; }
.plain { list-style: none; padding: 0; margin: 4px 0; }
/* 在庫優先・使いたい食材 */
.ing-options { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px; }
.must-row { gap: 6px; }
.must-row .input { flex: 1 1 140px; max-width: 220px; }
.ing-notes { background: var(--accent-soft); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.batch-shopping { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 6px; }
.dishes li.add-row { border: none; padding-top: 0; }

/* 案の買い物リスト（開け閉めできる） */
.shopping-box { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 6px; }
.shopping-box > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.shopping-box > summary::-webkit-details-marker { display: none; }
.shopping-box > summary::after { content: '▼'; font-size: 0.8em; color: var(--muted, #888); }
.shopping-box[open] > summary::after { content: '▲'; }
/* 「選ぶ」の一覧 */
.pick-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 40vh; overflow-y: auto; }
.pick-item { border: 1px solid var(--border); background: var(--surface); color: inherit; border-radius: 999px; padding: 4px 12px; cursor: pointer; font: inherit; }
.pick-item.on { border-color: var(--accent); background: var(--accent-soft); }
.prefer-stock { gap: 8px; cursor: pointer; }
.prefer-stock .field-label { margin: 0; }

.must-box { display: flex; flex-direction: column; gap: 6px; }
.must-row .input-amount { flex: 0 0 90px; width: 90px; }
.must-row select.input { flex: 0 0 auto; width: auto; }
