/* css/style.css - 献立アプリ スタイル（iPhone最適化） */

:root {
  --primary: #FF6B35;
  --primary-dark: #E05A28;
  --secondary: #4CAF93;
  --danger: #E53935;
  --bg: #F7F7F7;
  --card-bg: #FFFFFF;
  --border: #E8E8E8;
  --text: #1A1A1A;
  --text-sub: #666666;
  --breakfast: #FF9800;
  --lunch: #4CAF93;
  --dinner: #5C6BC0;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --tab-h: 68px;
  --header-h: 52px;
}

/* ===== リセット・ベース ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  user-select: none;
}

body {
  overscroll-behavior: none;
}

/* ===== アプリシェル ===== */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
}

/* ===== ヘッダー ===== */
.app-header {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--header-h);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top);
}

/* ===== タブコンテンツエリア ===== */
.tab-content-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px 16px;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* ===== ボトムタブバー ===== */
.tab-bar {
  display: flex;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: var(--tab-h);
  border: none;
  background: none;
  color: var(--text-sub);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn .tab-icon {
  font-size: 22px;
  line-height: 1;
}

.tab-btn.active {
  color: var(--primary);
}

/* ===== カードベース ===== */
.day-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
}

.day-card.today {
  border: 2px solid var(--primary);
}

.day-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  background: #FAFAFA;
}

.day-date {
  font-size: 16px;
  font-weight: 700;
}

.day-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
}
.day-name.sun { color: #E53935; }
.day-name.sat { color: #1976D2; }

.today-badge {
  font-size: 11px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-weight: 600;
}

/* ===== 食事セクション（新構造） ===== */
.meal-section {
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
}
.meal-section:last-child { border-bottom: none; }

.meal-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.meal-label {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
}

.meal-breakfast .meal-label { color: var(--breakfast); }
.meal-lunch     .meal-label { color: var(--lunch); }
.meal-dinner    .meal-label { color: var(--dinner); }

.meal-edit-btn {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
  color: var(--text-sub);
}
.meal-edit-btn:active { background: #F0F0F0; }
.meal-edit-btn.small { font-size: 12px; padding: 2px 4px; }

.meal-dish-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}

.meal-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.dinner-dish {
  padding: 3px 0;
}

.dish-role {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--dinner);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  min-width: 32px;
  text-align: center;
}

.dinner-style-badge {
  font-size: 10px;
  background: #EDE7F6;
  color: #4527A0;
  border-radius: 999px;
  padding: 1px 7px;
  font-weight: 600;
}

.link-btn {
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
  opacity: 0.6;
  flex-shrink: 0;
}
.link-btn:active { opacity: 1; background: #F0F0F0; }

/* ===== カレンダーヘッダー ===== */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}

.week-nav {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
  -webkit-tap-highlight-color: transparent;
}

.week-label {
  font-size: 18px;
  font-weight: 700;
}

.generate-area {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

/* ===== ボタン ===== */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.btn-primary:active { background: var(--primary-dark); }

.btn-secondary {
  background: var(--card-bg);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-danger {
  background: #FFEBEE;
  color: var(--danger);
  border: 1.5px solid var(--danger);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-add {
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  flex: 1;
}

/* ===== 買い物リスト ===== */
.shopping-header {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.days-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.days-selector label {
  font-size: 14px;
  font-weight: 600;
}

.days-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.days-controls button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  background: #fff;
  color: var(--primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.days-num {
  font-size: 18px;
  font-weight: 700;
  min-width: 48px;
  text-align: center;
}

.shopping-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-sub);
}

.shop-category {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
}

.shop-category.all-checked {
  opacity: 0.6;
}

.shop-cat-header {
  background: #F5F5F5;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.shop-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  gap: 10px;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s;
}
.shop-item:last-child { border-bottom: none; }
.shop-item:active { background: #F5F5F5; }
.shop-item.checked { background: #F9F9F9; }
.shop-item.checked .shop-name { text-decoration: line-through; color: var(--text-sub); }

.shop-check {
  font-size: 20px;
  min-width: 24px;
}

.shop-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shop-name {
  font-size: 15px;
  font-weight: 500;
}

.shop-amount {
  font-size: 12px;
  color: var(--text-sub);
}

.shop-fresh {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
}
.shop-fresh.raw_fish   { background: #FFF3E0; color: #E65100; }
.shop-fresh.raw_meat   { background: #FCE4EC; color: #C62828; }
.shop-fresh.leafy_veg  { background: #E8F5E9; color: #2E7D32; }
.shop-fresh.firm_veg   { background: #E3F2FD; color: #1565C0; }
.shop-fresh.root_veg   { background: #EDE7F6; color: #4527A0; }
.shop-fresh.dairy      { background: #F3E5F5; color: #6A1B9A; }
.shop-fresh.pantry     { /* 非表示 */ display: none; }

/* ===== 好み設定 ===== */
.prefs-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

.prefs-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
  margin-bottom: 10px;
}

.tag {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 4px 10px 4px 12px;
  font-size: 13px;
  font-weight: 500;
}
.tag-bad  { background: #FFEBEE; color: var(--danger); }
.tag-good { background: #E8F5E9; color: #2E7D32; }

.tag button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  color: inherit;
  opacity: 0.7;
  line-height: 1;
}

.add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.input-field {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  background: #FAFAFA;
  color: var(--text);
  -webkit-appearance: none;
}
.input-field:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.recipe-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.recipe-tag {
  background: #F5F5F5;
  color: var(--text-sub);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s;
}
.recipe-tag:active { background: #E0E0E0; }

/* ===== 設定タブ ===== */
.settings-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

.settings-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.form-group {
  margin-bottom: 10px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.room-info {
  background: #F0FFF4;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.room-code-display {
  font-size: 16px;
  margin-bottom: 4px;
}
.room-code-display strong {
  font-size: 20px;
  letter-spacing: 0.1em;
  color: var(--secondary);
}
.sync-status {
  font-size: 12px;
  color: var(--text-sub);
}

.sync-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.divider {
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
}
.join-row {
  display: flex;
  gap: 8px;
}
.input-code {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  font-size: 16px;
}

.app-version {
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 12px;
}

/* ===== モーダル ===== */
#modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: flex-end;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}

.modal-box {
  position: relative;
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #F5F5F5;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-search {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.picker-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

.picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s;
}
.picker-option:active { background: #F5F5F5; }
.picker-option.selected {
  background: #FFF3F0;
}

.picker-name {
  font-size: 15px;
  font-weight: 500;
}
.picker-meta {
  font-size: 12px;
  color: var(--text-sub);
}

/* ===== トースト通知 ===== */
.toast {
  position: fixed;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 30, 30, 0.9);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.toast-error {
  background: rgba(229, 57, 53, 0.95);
}

/* ===== エンプティステート ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-sub);
  font-size: 16px;
}

/* ===== スクロールバー非表示 ===== */
::-webkit-scrollbar { display: none; }

/* ===== 食事表示トグル ===== */
.meal-vis-toggles {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  background: var(--card-bg);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: var(--shadow);
}

.vis-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  justify-content: center;
}

.vis-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ===== レシピサイトバー ===== */
.recipe-site-bar {
  background: #FFF8F5;
  border: 1px solid #FFD5C0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.recipe-site-bar strong { color: var(--text); }

.btn-link {
  background: none;
  border: 1px solid var(--primary);
  border-radius: 6px;
  color: var(--primary);
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: auto;
}

/* ===== 買い物リスト：鮮度説明 ===== */
.fresh-note {
  font-size: 11px;
  color: var(--text-sub);
  background: #F5F5F5;
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 10px;
  line-height: 1.4;
}

/* ===== 買い物リスト：日付＋鮮度メタ ===== */
.shop-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.shop-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: #FFF3EE;
  border-radius: 6px;
  padding: 1px 6px;
}

/* ===== 設定：レシピサイト選択 ===== */
.site-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  cursor: pointer;
  padding: 6px 0;
}

.site-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ===== デスクトップ向け追加スタイル ===== */
@media (min-width: 480px) {
  #app {
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
  }
}

/* ===== 買い物リスト：使用メニュー名 ===== */
.shop-name-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.shop-menus {
  font-size: 11px;
  color: var(--text-sub);
  line-height: 1.3;
  margin-top: 1px;
}

/* ===== 調味料：1ヶ月非表示ボタン ===== */
.btn-hide-seasoning {
  background: none;
  border: 1px solid #BDBDBD;
  border-radius: 6px;
  color: #9E9E9E;
  font-size: 10px;
  padding: 2px 7px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn-hide-seasoning:active {
  background: #F5F5F5;
}

/* ===== 非表示の調味料ボタン（リスト上部）===== */
.btn-hidden-seasonings {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 10px;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow);
}
.btn-hidden-seasonings.disabled {
  color: var(--text-sub);
  border-color: var(--border);
  cursor: default;
}
.btn-hidden-seasonings:not(.disabled):active {
  background: #F5F5F5;
}

/* ===== 非表示調味料モーダル内リスト ===== */
.hidden-seasoning-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.hidden-seasoning-row:last-child {
  border-bottom: none;
}
.hidden-seasoning-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hidden-seasoning-name {
  font-size: 15px;
  font-weight: 500;
}
.hidden-seasoning-exp {
  font-size: 11px;
  color: var(--text-sub);
}
.btn-unhide {
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn-unhide:active {
  opacity: 0.8;
}

/* ===== ネットのレシピを追加ボタン（週アクション内）===== */
.week-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.btn-add-net-recipe {
  flex: 1;
  background: linear-gradient(135deg, #4CAF93, #2E9E7A);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  min-width: 0;
  box-shadow: 0 2px 6px rgba(76,175,147,0.35);
}
.btn-add-net-recipe:active {
  opacity: 0.85;
}

/* ===== 日カードの「＋」ボタン ===== */
.btn-day-add {
  background: none;
  border: 1.5px solid var(--secondary);
  border-radius: 6px;
  color: var(--secondary);
  font-size: 14px;
  font-weight: 700;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: auto;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}
.btn-day-add:active {
  background: #E8F5F0;
}

/* ===== ネットのレシピ追加モーダルフォーム ===== */
.add-recipe-form {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.select-field {
  appearance: none;
  -webkit-appearance: none;
  background: #FAFAFA url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}

/* 食事種類ボタン */
.meal-type-picker {
  display: flex;
  gap: 6px;
}

.meal-type-btn {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 6px;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.meal-type-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.meal-type-btn:active {
  opacity: 0.8;
}

/* 追加確定ボタン */
.btn-add-confirm {
  width: 100%;
  margin-top: 4px;
  font-size: 16px;
  padding: 14px;
}

/* ===== ピッカー：メイン情報エリアと除外ボタン ===== */
.picker-option {
  gap: 6px;
}
.picker-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}
.picker-main .picker-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-exclude-recipe {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  flex-shrink: 0;
  opacity: 0.5;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}
.btn-exclude-recipe:active {
  opacity: 1;
  background: #FFEBEE;
}

/* ===== 設定：除外レシピ管理ボタン ===== */
.btn-excluded-mgr {
  display: block;
  width: 100%;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.btn-excluded-mgr.has-excluded {
  border-color: #FFCDD2;
  color: var(--danger);
  background: #FFF8F8;
}
.btn-excluded-mgr:active {
  background: #F5F5F5;
}

/* ===== 📋 レシピ決定ボタン ===== */
.btn-decide-recipe {
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  padding: 4px 5px;
  border-radius: 6px;
  opacity: 0.55;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.btn-decide-recipe:active { opacity: 1; background: #E8F5E9; }

/* ===== レシピ決定モーダル ===== */
.modal-box-wide { max-width: 560px; width: 94vw; }

.ingredient-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.ing-name {
  flex: 2;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  min-width: 0;
}
.ing-amount {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  min-width: 0;
}
.ing-cat {
  flex: 1.5;
  padding: 7px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  min-width: 0;
}
.btn-remove-ing {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  flex-shrink: 0;
}
.btn-add-ingredient {
  margin-top: 6px;
  padding: 8px 16px;
  background: none;
  border: 1px dashed var(--primary);
  color: var(--primary);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
}

/* ===== 買い物リスト：参考メニューリンク ===== */
.shop-menu-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 11px;
}
.shop-menu-link:active { text-decoration: underline; }
.shop-menu-text { font-size: 11px; color: var(--text-sub); }
.shop-menu-sep { font-size: 11px; color: var(--text-sub); }

/* ===== カスタムレシピバッジ（ピッカー内）===== */
.picker-custom-badge {
  display: inline-block;
  background: #E8F5E9;
  color: #2E7D32;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 5px;
  vertical-align: middle;
}

/* ===== 人数セレクター ===== */
.serving-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.serving-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
}

.serving-btns {
  display: flex;
  gap: 4px;
  flex: 1;
}

.serving-btn {
  flex: 1;
  height: 34px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.serving-btn:active {
  background: #F0F0F0;
}
.serving-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== レシピピッカー：新着・外部バッジ ===== */
.picker-new-badge {
  display: inline-block;
  background: linear-gradient(135deg, #FF6B35, #FF9800);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 5px;
  vertical-align: middle;
}
.picker-community-badge {
  display: inline-block;
  background: #E3F2FD;
  color: #1565C0;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 5px;
  vertical-align: middle;
}
