/* RecipeBox 共通スタイル（モバイルファースト・キッチンで見やすい高コントラスト） */
:root {
  --accent: #f97316;        /* オレンジ（料理の温かさ） */
  --accent-dark: #ea580c;
  --bg: #fffaf5;
  --card: #ffffff;
  --text: #292524;
  --muted: #78716c;
  --border: #e7e5e4;
  --danger: #dc2626;
  --label: #16a34a;         /* 献立ラベル（緑）。オレンジのタグと見分けるため色を分ける */
  --label-bg: #f0fdf4;
  --label-border: #bbf7d0;
  --label-text: #15803d;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(70px + var(--safe-bottom)); /* 下部ナビぶん */
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--accent-dark); text-decoration: none; }
h1 { font-size: 1.3rem; margin: 8px 0; }
h2 { font-size: 1.05rem; margin: 20px 0 8px; border-left: 4px solid var(--accent); padding-left: 8px; }
small { color: var(--muted); }

/* ---- バナー・通知 ---- */
.banner-warn {
  background: #fef3c7; color: #92400e; padding: 8px 12px; font-size: 0.85rem;
}
.notice {
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px;
  padding: 12px; margin: 12px 0; font-size: 0.92rem;
}

/* ---- ヘッダー・検索 ---- */
.page-head { padding: 12px 12px 4px; position: sticky; top: 0; background: var(--bg); z-index: 10; }
.search-form input[type="search"] {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 12px; font-size: 1rem; background: var(--card);
}
.head-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tag-scroll {
  display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  flex: 1; padding-bottom: 4px; scrollbar-width: none;
}
.tag-scroll::-webkit-scrollbar { display: none; }
.head-icon { font-size: 1.3rem; padding: 4px; flex-shrink: 0; }

/* ---- チップ（タグ） ---- */
.chip {
  display: inline-block; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; font-size: 0.85rem; background: var(--card); color: var(--text);
}
.chip-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-auto { border-style: dashed; }

/* ---- 献立ラベル（主菜/副菜/おやつ/作り置き） ----
   通常タグ（丸くて細いチップ）と区別できるよう、角丸の四角＋緑系にする */
.label-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.label-scroll {
  display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; padding-bottom: 2px;
}
.label-scroll::-webkit-scrollbar { display: none; }
.lchip {
  display: inline-block; white-space: nowrap;
  border: 1px solid var(--label-border); border-radius: 8px;
  padding: 5px 14px; font-size: 0.85rem; font-weight: 600;
  background: var(--label-bg); color: var(--label-text);
}
.lchip-on { background: var(--label); border-color: var(--label); color: #fff; }
/* モード切替ボタン（🍽 選ぶ / ✏️ ラベル）。
   ラベルのチップを狭めないよう、普段はアイコンだけ。ONのときだけ文字も出す */
.label-edit-btn {
  flex-shrink: 0; border: 1px solid var(--border); background: var(--card);
  border-radius: 8px; padding: 5px 10px; font-size: 0.85rem; color: var(--muted);
  white-space: nowrap;
}
.label-edit-btn .mode-text { display: none; margin-left: 4px; }
.label-edit-btn.on { background: var(--label); border-color: var(--label); color: #fff; font-weight: 600; }
.label-edit-btn.on .mode-text { display: inline; }

/* 一覧の各行に出るラベル付けボタン（ラベル編集モードのときだけ表示）。
   狭い画面でレシピ名が潰れないよう、ボタンは行の下に横一列で出す */
.list .row-labels { display: none; }
.list.label-edit .row-labels { display: flex; width: 100%; padding-top: 2px; }
.list.label-edit .row-labels .lbtn { flex: 1; }
/* 編集モード中は行タップで詳細に飛ばない（ラベル付けに集中できる） */
.list.label-edit .list-item { pointer-events: none; }
.row-labels { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; }
.lbtn {
  border: 1px solid var(--label-border); background: var(--label-bg); color: var(--label-text);
  border-radius: 8px; min-width: 38px; height: 38px; padding: 0 8px;
  font-size: 0.9rem; font-weight: 600;
}
.lbtn.on { background: var(--label); border-color: var(--label); color: #fff; }
.lbtn.saving { opacity: .5; }
.lbtn.failed { border-color: var(--danger); color: var(--danger); }
/* 詳細ページのラベルは常に表示・横長 */
.row-labels-inline { flex-wrap: wrap; margin: 8px 0 4px; }
.row-labels-inline .lbtn { padding: 0 16px; font-size: 0.95rem; }
/* 一覧の行に出る小さなラベル表示 */
.minilabel {
  background: var(--label); color: #fff; border-radius: 4px;
  padding: 1px 6px; font-size: 0.72rem; font-weight: 600;
}

/* ---- 一覧: リスト表示 ---- */
.list { list-style: none; margin: 0; padding: 8px 12px; }
.list li { margin-bottom: 8px; }
/* カードの枠は行（li）側に持たせて、「＋」もカードの中に収まるようにする */
.list-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px;
}
.list-item {
  display: flex; gap: 12px; align-items: center;
  flex: 1; min-width: 0; color: var(--text);
}
.list-item img, .list-item .noimg {
  width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
}
.noimg {
  display: flex; align-items: center; justify-content: center;
  background: #fef3e2; font-size: 1.6rem;
}
.list-body { min-width: 0; }
.list-title { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-meta { display: flex; gap: 6px; align-items: center; font-size: 0.75rem; color: var(--muted); flex-wrap: wrap; }
.src { background: #f5f5f4; border-radius: 4px; padding: 1px 6px; }
.minitag { color: var(--accent-dark); }
.badge { background: #fbbf24; color: #78350f; border-radius: 4px; padding: 1px 6px; font-size: 0.72rem; }

/* ---- 一覧: グリッド表示（写真で探す） ---- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 8px 12px; }
.grid-item { position: relative; color: var(--text); }
.grid-item img, .grid-item .noimg {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block;
}
.grid-item .noimg { font-size: 2rem; }
.grid-title {
  display: block; font-size: 0.72rem; line-height: 1.3; margin-top: 2px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
/* タイル左上のしるし（ラベル・状態）。右上は「＋」ボタンが使う */
.grid-marks {
  position: absolute; top: 4px; left: 4px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
}
.grid-label {
  background: var(--label); color: #fff; border-radius: 4px;
  padding: 1px 6px; font-size: 0.7rem; font-weight: 600;
}

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }

/* ---- 下部ナビ ---- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + var(--safe-bottom));
}
/* リンクとボタンが混在するので、アイコン枠の高さを固定して縦位置を揃える */
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); min-width: 80px;
  background: none; border: none; padding: 0; font-family: inherit; /* button用のリセット */
}
.nav-icon {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 26px; font-size: 1.3rem; line-height: 1;
}
.nav-label { font-size: 0.7rem; line-height: 1.2; }
.nav-add { color: var(--accent-dark); font-weight: 700; }

/* ---- 詳細ページ ---- */
.detail { padding: 12px 16px; max-width: 640px; margin: 0 auto; }
.back { display: inline-block; margin-bottom: 4px; font-size: 0.9rem; }
.hero { width: 100%; border-radius: 14px; max-height: 300px; object-fit: cover; }
.edit-thumb { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 8px; }
.paste-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* 材料グループの見出し（【A】など）と、その中身のインデント。
   グループに属する行だけ左に線＋字下げするので、グループの終わりが目で分かる。 */
.ing-group-head {
  list-style: none; font-weight: 700; color: var(--accent);
  margin: 10px 0 2px; font-size: 0.95rem;
}
.ing-grouped {
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  margin-left: 2px;
}
.cook-body .ing-group-head { color: #fbbf24; }
.cook-body .ing-grouped { border-left-color: #fbbf24; }
.meta { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; }
.hint { color: var(--muted); font-size: 0.8rem; }

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

/* 人数変換ボタン */
.servings-picker { display: flex; align-items: center; gap: 4px; }
.serv-btn {
  min-width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); font-size: 1rem; color: var(--text);
}
.serv-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.serv-label { font-size: 0.85rem; color: var(--muted); }

/* 材料リスト */
.ing-list { list-style: none; padding: 0; margin: 8px 0; }
.ing-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-bottom: 1px dashed var(--border);
}
.ing-check { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.ing-name { flex: 1; }
.ing-amount { font-weight: 700; white-space: nowrap; }
input.ing-check:checked ~ .ing-name { color: var(--muted); text-decoration: line-through; }

/* 手順 */
.step-list { padding-left: 0; counter-reset: step; list-style: none; }
.step-list li {
  position: relative; padding: 10px 0 10px 44px; border-bottom: 1px dashed var(--border);
  counter-increment: step;
}
.step-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.tips { background: #fefce8; border-radius: 10px; padding: 10px 12px; }

/* タグ編集 */
.tag-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline { display: inline; }
.tag-add-form { display: flex; gap: 4px; align-items: center; }
.tag-add-form input[type="text"] {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.85rem; width: 170px;
}

.detail-actions { display: flex; gap: 10px; margin: 24px 0; align-items: center; }

/* ボタン類 */
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  border-radius: 12px; padding: 14px 20px; font-size: 1.05rem; font-weight: 700;
  text-align: center; width: 100%;
}
.btn-secondary {
  display: inline-block; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 16px; color: var(--text);
}
.btn-danger { background: none; border: 1px solid var(--danger); color: var(--danger); border-radius: 10px; padding: 10px 16px; }
.btn-small { border: 1px solid var(--border); background: var(--card); border-radius: 8px; padding: 8px 12px; }

/* 料理モード開始（下部固定）＋「今日つくる」ボタン */
.cook-start-row {
  position: fixed; bottom: calc(70px + var(--safe-bottom)); left: 12px; right: 12px; z-index: 15;
  display: flex; gap: 8px; align-items: stretch;
}
.cook-start {
  flex: 1;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 1.1rem;
  text-align: center; padding: 15px; border-radius: 14px;
  box-shadow: 0 4px 14px rgba(249, 115, 22, .4);
}
.tray-btn-lg {
  flex-shrink: 0; font-size: 0.9rem; padding: 15px 14px; border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}

/* =============== 「今日つくる」トレイ =============== */
/* 一覧の行・写真タイルに常時出る「＋」。押すと ✓ に変わる（モード切替なし） */
.tray-btn {
  border: 1px solid var(--label-border); background: var(--label-bg); color: var(--label-text);
  border-radius: 10px; padding: 10px 14px; font-size: 0.9rem; font-weight: 600;
  white-space: nowrap;
}
.tray-btn.on { background: var(--label); border-color: var(--label); color: #fff; }
/* リスト行の右端の丸ボタン（カードの中に収まる控えめなサイズ） */
.tray-plus {
  flex-shrink: 0; width: 36px; height: 36px; padding: 0;
  border-radius: 50%; font-size: 1rem; line-height: 1;
}
/* 写真表示ではタイルの右上に重ねる */
.grid-cell { position: relative; }
.tray-plus-grid {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 34px; height: 34px; font-size: 1rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .3);
}

/* ボトムナビの「今日つくる」件数バッジ */
.nav-badge {
  position: absolute; top: -6px; right: -14px;
  background: var(--label); color: #fff; border-radius: 999px;
  min-width: 18px; padding: 0 5px; font-size: 0.7rem; font-weight: 700;
  line-height: 18px; text-align: center;
}
.nav-badge[hidden] { display: none; }

/* 開始ボタン（トレイが空のときは出さない）。リストが伸びても常に見える位置 */
.tray-start { flex-shrink: 0; margin-top: 10px; background: var(--label); }
.tray-start[hidden] { display: none; }

/* トレイの中身（下から出るシート） */
/* 中身が増えても「料理モードで開始」が隠れないよう、
   見出しと開始ボタンは固定して、リストだけスクロールさせる */
.tray-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--card); border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .15);
  max-height: 75dvh; display: flex; flex-direction: column;
  padding: 14px 18px calc(20px + var(--safe-bottom));
  transform: translateY(110%); transition: transform .25s;
}
.tray-sheet.open { transform: translateY(0); }
.tray-sheet-head { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.tray-list {
  list-style: none; padding: 0; margin: 8px 0;
  flex: 1; min-height: 0; overflow-y: auto;
}
.tray-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 4px; border-bottom: 1px dashed var(--border);
}
.tray-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-del {
  flex-shrink: 0; border: 1px solid var(--border); background: var(--card); color: var(--muted);
  border-radius: 8px; width: 38px; height: 38px; font-size: 1.1rem;
}

/* 画面下に一瞬出るお知らせ（5品を超えたときなど） */
.tray-toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(90px + var(--safe-bottom)); z-index: 60;
  background: rgba(41, 37, 36, .94); color: #fff; border-radius: 12px;
  padding: 12px 16px; font-size: 0.9rem; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.tray-toast.show { opacity: 1; }

/* =============== ログイン画面（合言葉） =============== */
.login-body {
  padding: 0; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
}
.login-box { width: 100%; max-width: 340px; padding: 24px; text-align: center; }
.login-icon {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 20px;
  background: #fef3e2; font-size: 2.2rem;
  display: flex; align-items: center; justify-content: center;
}
.login-box h1 { font-size: 1.4rem; margin: 0 0 4px; }
.login-lead { color: var(--muted); font-size: 0.9rem; margin: 0 0 20px; }
.login-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; margin-bottom: 14px;
}
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input[type="text"], .login-form input[type="password"] {
  width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 12px;
  font-size: 1rem; background: var(--card); text-align: center;
}
/* ログアウトボタン（タグ管理ページの下） */
.logout-form { margin-top: 32px; text-align: center; }
.logout-form .login-who { color: var(--muted); font-size: 0.85rem; margin: 0 0 8px; }

/* フォーム共通 */
.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.stack .label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; }
.stack input[type="text"], .stack input[type="url"], .stack input[type="number"], .stack textarea {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 1rem; background: var(--card); font-family: inherit;
}

/* タグ管理 */
.tag-manage-list { list-style: none; padding: 0; }
.tag-manage-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px dashed var(--border);
}
.tag-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tag-actions input[type="text"] { padding: 8px; border: 1px solid var(--border); border-radius: 8px; width: 150px; }
.tag-actions select { padding: 8px; border: 1px solid var(--border); border-radius: 8px; max-width: 150px; background: #fff; }
.tag-merge-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
details summary { list-style: none; padding: 4px 10px; cursor: pointer; color: var(--muted); }

/* =============== 料理モード =============== */
/* 縦にヘッダー→タブ→進捗バー→手順エリア、と積む。
   タブの有無で手順エリアの高さが自動で変わるよう flex で組む */
.cook-body {
  margin: 0; background: #1c1917; color: #fafaf9;
  height: 100dvh; overflow: hidden; padding-bottom: 0;
  display: flex; flex-direction: column;
  -webkit-user-select: none; user-select: none;
}
.cook-head, .cook-tabs, .cook-progress-bar { flex-shrink: 0; }
.cook-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(28, 25, 23, .96); color: #fff;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 24px;
}
.cook-overlay h1 { font-size: 1.2rem; }
.cook-overlay p { font-size: 1.3rem; }
.cook-hint { font-size: 0.95rem !important; color: #d6d3d1; }
.cook-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
}
.cook-exit { color: #d6d3d1; font-size: 1rem; z-index: 60; position: relative; flex-shrink: 0; }
.cook-ing-btn {
  background: #44403c; color: #fff; border: none; border-radius: 999px;
  padding: 8px 14px; font-size: 0.95rem; z-index: 60; position: relative;
}
.cook-progress-bar { height: 4px; background: #44403c; }
.cook-progress-bar div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }

/* 消灯防止の状態バッジ（左下・タップを邪魔しないよう pointer-events: none） */
.wake-badge {
  position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 30; font-size: 0.75rem; color: #d6d3d1;
  background: rgba(0, 0, 0, 0.45); padding: 5px 12px; border-radius: 999px;
  pointer-events: none;
}
.wake-badge.off { color: #fbbf24; }

/* レシピ切替タブ（複数レシピのときだけ出る） */
.cook-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 8px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cook-tabs::-webkit-scrollbar { display: none; }
.cook-tab {
  flex: 0 0 auto; max-width: 48%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: #292524; color: #d6d3d1; border: 1px solid #44403c;
  border-radius: 999px; padding: 7px 14px; font-size: 0.88rem;
}
.cook-tab.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }

/* 本体: レシピごとに1レーン。横スナップスクロールで行き来する */
.cook-deck {
  flex: 1; min-height: 0;
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; overscroll-behavior-x: contain;
  /* ここは scroll-behavior: smooth にしない。scroll-snap と競合して
     タブから切り替えたときに移動しないことがあるため（スナップで十分気持ちいい） */
}
.cook-deck::-webkit-scrollbar { display: none; }
/* 1レーン＝1レシピまるごと。材料＋全手順を縦スクロールで読む */
.cook-lane {
  flex: 0 0 100%; width: 100%; height: 100%;
  scroll-snap-align: start;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth; /* 「材料へ」で戻るときをなめらかに */
}
.cook-lane::-webkit-scrollbar { display: none; }
/* 下に大きめの余白を取る。こうしないと手順が少ないレシピで、
   最後の手順を「浮き上がる位置（画面のやや上）」まで持ち上げられない */
.cook-recipe { padding: 16px 20px calc(50vh + env(safe-area-inset-bottom, 0px)); }
.cook-hero {
  width: 100%; max-height: 190px; object-fit: cover;
  border-radius: 12px; display: block; margin-bottom: 12px;
}
.cook-title { font-size: 1.15rem; margin: 0 0 4px; color: #fafaf9; }
.cook-source { display: inline-block; font-size: 0.85rem; color: #fdba74; margin-bottom: 12px; }
.cook-h2 {
  font-size: 1rem; color: #d6d3d1; margin: 22px 0 6px;
  border-left: 4px solid var(--accent); padding-left: 8px;
}
.cook-overlay-list {
  list-style: none; padding: 0; margin: 10px 0 18px;
  font-size: 1.05rem; color: #d6d3d1;
}
.cook-overlay-list li { margin: 4px 0; }

/* 材料（開閉できる） */
.cook-ing { background: #292524; border-radius: 12px; padding: 4px 14px 8px; }
.cook-ing > summary {
  list-style: none; cursor: pointer; color: #fafaf9; font-weight: 700;
  padding: 10px 0; font-size: 1rem;
}
.cook-ing > summary::-webkit-details-marker { display: none; }
.cook-ing > summary::after { content: ' ▾'; color: #a8a29e; }
.cook-ing[open] > summary::after { content: ' ▴'; }
.cook-ing .ing-row { border-color: #44403c; padding: 9px 2px; }
.cook-ing .ing-amount { color: #fdba74; }
.cook-ing .ing-list { margin: 0 0 4px; }

/* 手順: 全部並べて縦に読む。中央付近のものが浮き上がる */
.cook-steps { list-style: none; padding: 0; margin: 0; }
.cook-step {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 2px; border-bottom: 1px solid #292524;
  opacity: .45;
  /* 文字サイズではなく拡大縮小で変えるので、行送りがガタつかない */
  transform: scale(.97); transform-origin: left center;
  transition: opacity .22s ease, transform .22s ease;
}
.cook-step.focus { opacity: 1; transform: scale(1); }
.cook-step-no {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: #44403c; color: #d6d3d1; font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background .22s ease, color .22s ease;
}
.cook-step.focus .cook-step-no { background: var(--accent); color: #fff; }
.cook-step-text { font-size: 1.15rem; line-height: 1.75; margin: 0; }
.cook-step.focus .cook-step-text { font-weight: 600; }

.cook-tips { background: #292524; border-radius: 12px; padding: 12px 14px; margin-top: 18px; }
.cook-tips strong { color: #fbbf24; font-size: 0.9rem; }
.cook-tips p { margin: 6px 0 0; font-size: 1rem; color: #d6d3d1; }

.cook-finish { text-align: center; margin-top: 32px; }
.cook-finish p { font-size: 1.1rem; color: #d6d3d1; }
.cook-finish .btn { width: auto; padding: 14px 32px; }

/* 単位トグル（元の分量 ⇄ グラム換算） */
.unit-toggle { display: inline-flex; margin: 8px 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.unit-btn { background: var(--card); border: none; padding: 8px 16px; font-size: 0.9rem; color: var(--muted); }
.unit-btn.on { background: var(--accent); color: #fff; font-weight: 700; }

/* 料理モードボタンと下部アクション（編集・削除）の重なり回避 */
.detail { padding-bottom: 96px; }

/* 栄養バッジ（カロリー・PFC） */
.nutrition {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px;
  padding: 10px 14px; margin: 12px 0; font-size: 0.95rem;
}
.nut-label { font-size: 0.8rem; color: var(--muted); background: #fff; border-radius: 6px; padding: 2px 8px; }
.nut-cal b { font-size: 1.15rem; color: var(--accent-dark); }
.nut-macro i { font-style: normal; font-weight: 700; color: var(--muted); margin-right: 1px; }
.nut-macro b { font-size: 1.05rem; }
.nut-p b { color: #16a34a; }
.nut-f b { color: #ea580c; }
.nut-c b { color: #2563eb; }

/* 料理モードの材料シート内グラムトグル */
/* 料理モードの材料内 元⇄グラム切替 */
.cook-unit-toggle {
  display: inline-flex; border: 1px solid #57534e; border-radius: 8px;
  overflow: hidden; flex-shrink: 0; margin: 2px 0 8px;
}
.cook-unit-toggle .unit-btn { padding: 5px 12px; font-size: 0.85rem; background: #292524; color: #d6d3d1; border: none; }
.cook-unit-toggle .unit-btn.on { background: var(--accent); color: #fff; }

/* =============== 利用者の管理（ichiko専用・T6） =============== */
.user-list { list-style: none; padding: 0; margin: 8px 0 0; }
.user-row { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.user-row.user-off { opacity: .6; }
.user-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.user-name { font-weight: 700; }
.user-id { color: var(--muted); }
.user-badge {
  font-size: 0.72rem; background: #fef3e2; color: var(--accent-dark);
  border-radius: 6px; padding: 1px 8px;
}
.user-badge-off { background: #fef2f2; color: #b91c1c; }
.user-meta { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.user-actions { display: flex; flex-direction: column; gap: 14px; padding: 8px 0 4px; }
.user-form { gap: 8px; margin-top: 0; }
.user-form input[type="number"] { width: 120px; }
/* ボタンは中身ぶんの幅に（下の「停止する」と見た目をそろえる） */
.user-form button { align-self: flex-start; }

/* 発行したID・パスワードを1回だけ見せる箱 */
.cred-box {
  background: #f0fdf4; border: 1px solid var(--label-border);
  border-radius: 12px; padding: 12px 14px; margin: 12px 0;
}
.cred-box strong { color: var(--label-text); }
.cred-list { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 10px; }
.cred-list dt { color: var(--muted); font-size: 0.85rem; }
.cred-list dd { margin: 0; }
.cred-list code {
  background: #fff; border: 1px solid var(--label-border); border-radius: 6px;
  padding: 2px 8px; font-size: 1rem; user-select: all;
}
.cred-pw { font-size: 1.1rem !important; font-weight: 700; letter-spacing: .04em; }

/* =============== アカウントメニュー（ホーム右上の👤） =============== */
.acct { position: relative; flex-shrink: 0; }
.acct > summary { list-style: none; cursor: pointer; }
.acct > summary::-webkit-details-marker { display: none; }
/* 開いている間は透明なフタを画面全体にかぶせる。
   「外側をタップして閉じる」ときに、裏のレシピまで開いてしまうのを防ぐ */
.acct[open]::before { content: ''; position: fixed; inset: 0; z-index: 20; }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; min-width: 190px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  display: flex; flex-direction: column; gap: 4px;
}
.acct-who {
  margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
  font-size: 0.9rem; font-weight: 600; line-height: 1.4;
}
.acct-menu a, .acct-menu button {
  display: block; width: 100%; text-align: left;
  background: none; border: none; padding: 8px 2px;
  font-size: 0.95rem; font-family: inherit; color: var(--text);
}
.acct-menu a { color: var(--text); }
.acct-menu button { color: var(--danger); cursor: pointer; }
