/* ===== CSS Variables — MeShiru Design Tokens v2 ===== */
/*
 * ブランド方向性: 親しみ・温かい食卓
 * primary  = トマトオレンジ（食卓らしい温かみ）
 * accent   = 葉野菜グリーン
 * warm     = 木目クリーム（カード背景アクセント）
 * 旧 8 色乱立は削減し、紫/ティール/ピンク/シアンは曜日色専用に格下げ
 */
:root {
  /* === ブランドカラー（v2 メイン） === */
  --primary: #FF6B35;            /* トマトオレンジ */
  --primary-light: #FFF4ED;      /* クリームオレンジ */
  --primary-dark: #E85822;       /* 濃いめ：プレス時 */
  --accent: #16A34A;             /* 葉野菜グリーン */
  --accent-light: #DCFCE7;
  --warm: #FDF6E3;               /* 木目クリーム */
  --warm-deep: #F5EBC8;
  --gradient: linear-gradient(135deg, #FF6B35, #FF8E53);

  /* === セマンティックカラー === */
  --success: #16A34A;
  --success-light: #DCFCE7;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --error: #EF4444;
  --error-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  /* === ニュートラル（暖色寄り） === */
  --bg: #FAFAF7;
  --bg-soft: #F5F4EE;
  --surface: #FFFFFF;
  --text: #111827;
  --text-secondary: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;

  /* === Shadow / Radius === */
  --shadow: 0 1px 8px rgba(0,0,0,.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.12);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* === Motion === */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* === Layout === */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tab-height: 56px;

  /* === 旧トークン互換（既存 CSS が依存しているため維持） === */
  --red: #FF6B6B;
  --red-light: #FFF0F0;
  --green: #16A34A;
  --green-light: #DCFCE7;
  --blue: #3B82F6;
  --blue-light: #DBEAFE;
  --purple: #7C3AED;
  --purple-light: #EDE9FE;
  --orange: #F59E0B;
  --orange-light: #FEF3C7;
  --teal: #0D9488;
  --teal-light: #CCFBF1;
  --pink: #EC4899;
  --pink-light: #FCE7F3;
  --cyan: #06B6D4;
  --cyan-light: #CFFAFE;

  /* Day colors（曜日表示専用 — 本文・CTA で使わないこと） */
  --day-mon: #3B82F6;
  --day-tue: #16A34A;
  --day-wed: #F59E0B;
  --day-thu: #7C3AED;
  --day-fri: #EC4899;
  --day-sat: #06B6D4;
  --day-sun: #EF4444;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom) + 16px);
}

/* ===== Header ===== */
.app-header {
  background: var(--gradient);
  color: white;
  padding: 16px 18px 14px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.app-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,.8);
}

.badge-free {
  background: rgba(255,255,255,.25);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.4);
}

/* ===== Site Links ===== */
.site-links {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  justify-content: space-around;
}

.site-links::-webkit-scrollbar { display: none; }

.site-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 20px;
  transition: background .15s;
}

.site-link:active {
  background: var(--border-light);
}

.site-link-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.site-link-favicon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ===== Ad Slots ===== */
.ad-slot {
  text-align: center;
  padding: 6px 16px;
  background: var(--border-light);
}

.ad-placeholder {
  background: #E5E7EB;
  color: var(--text-light);
  font-size: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px dashed var(--border);
}

/* ===== Main Content ===== */
.main-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 14px;
}

/* ===== Tab Content ===== */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Section Header ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-header h2 {
  font-size: 15px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  gap: 6px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
  font-family: inherit;
}

.btn:active {
  opacity: .75;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-dark);
}
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-green {
  background: var(--green);
  color: white;
}

.btn-blue {
  background: var(--blue);
  color: white;
}

.btn-purple {
  background: var(--purple);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.btn-icon:active {
  background: var(--border-light);
}

.btn-danger {
  background: #FEE2E2;
  color: #DC2626;
  border: 2px solid #FECACA;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* ===== Tag Filter Bar ===== */
.tag-filter-bar {
  margin: 8px 0 4px;
  overflow: hidden;
}
.tag-filter-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tag-filter-scroll::-webkit-scrollbar { display: none; }
.tag-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  border: 1.5px solid #ddd;
  color: #666;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.tag-filter-chip:hover {
  border-color: #aaa;
}
.tag-filter-chip.active {
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ===== Add Recipe Buttons ===== */
.add-recipe-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.add-recipe-buttons .btn {
  flex: 1;
  min-width: 0;
  justify-content: center;
  font-size: 12px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
}

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.search-bar input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}

.search-bar input:focus {
  border-color: var(--red);
}

.search-bar select {
  padding: 9px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  background: var(--surface);
  outline: none;
}

/* ===== Recipe Card ===== */
.recipe-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  position: relative;
  border-left: 4px solid var(--border);
  transition: box-shadow .15s, transform .1s;
}

.recipe-card.assigned {
  border-left-color: var(--red);
}

.recipe-card:active {
  transform: scale(0.99);
}

.recipe-card-image {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--border-light);
  flex-shrink: 0;
}

.recipe-card-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--red-light), #FFF9F0);
}

.recipe-card-body {
  flex: 1;
  min-width: 0;
}

.recipe-card-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.recipe-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
}

.btn-fav {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px;
  opacity: 0.4;
  transition: opacity .15s, transform .15s;
}

.btn-fav.active {
  opacity: 1;
  transform: scale(1.1);
}

.recipe-rating {
  display: flex;
  gap: 1px;
}

.star {
  color: #D1D5DB;
  font-size: 14px;
  cursor: pointer;
  transition: color .1s;
}

.star.filled {
  color: var(--orange);
}

/* ===== Chips / Tags ===== */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.chip.active {
  color: white;
  border-color: transparent;
}

.chip[data-day="0"].active { background: var(--day-mon); }
.chip[data-day="1"].active { background: var(--day-tue); }
.chip[data-day="2"].active { background: var(--day-wed); }
.chip[data-day="3"].active { background: var(--day-thu); }
.chip[data-day="4"].active { background: var(--day-fri); }
.chip[data-day="5"].active { background: var(--day-sat); }
.chip[data-day="6"].active { background: var(--day-sun); }

.chip[data-meal="breakfast"].active { background: #FB923C; }
.chip[data-meal="lunch"].active { background: #FACC15; color: #78350F; }
.chip[data-meal="dinner"].active { background: #6366F1; }
.chip[data-meal="snack"].active { background: #EC4899; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
}

.tag-day-0 { background: var(--blue-light); color: #1D4ED8; }
.tag-day-1 { background: var(--green-light); color: #15803D; }
.tag-day-2 { background: var(--orange-light); color: #B45309; }
.tag-day-3 { background: var(--purple-light); color: #6D28D9; }
.tag-day-4 { background: var(--pink-light); color: #BE185D; }
.tag-day-5 { background: var(--cyan-light); color: #0E7490; }
.tag-day-6 { background: #FEE2E2; color: #991B1B; }

.tag-breakfast { background: var(--orange-light); color: #B45309; }
.tag-lunch { background: #FEF9C3; color: #78350F; }
.tag-dinner { background: #E0E7FF; color: #4338CA; }
.tag-snack { background: var(--pink-light); color: #BE185D; }

/* ===== Weekly Grid ===== */
.weekly-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.weekly-day {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.weekly-day-header {
  padding: 12px 13px;
  color: white;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.weekly-day-header.day-0 { background: var(--day-mon); }
.weekly-day-header.day-1 { background: var(--day-tue); }
.weekly-day-header.day-2 { background: var(--day-wed); }
.weekly-day-header.day-3 { background: var(--day-thu); }
.weekly-day-header.day-4 { background: var(--day-fri); }
.weekly-day-header.day-5 { background: var(--day-sat); }
.weekly-day-header.day-6 { background: var(--day-sun); }

.weekly-day-header span:last-child {
  font-size: 10px;
  opacity: .9;
  font-weight: 600;
}

.weekly-day-body {
  padding: 10px 13px;
}

.weekly-meal-group {
  margin-bottom: 8px;
}

.weekly-meal-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.weekly-recipe-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
}

.weekly-recipe-item input[type="checkbox"] {
  accent-color: var(--red);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.weekly-recipe-item.checked .weekly-recipe-name {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.weekly-recipe-name {
  flex: 1;
  font-weight: 600;
  cursor: pointer;
}

.weekly-empty {
  color: var(--text-light);
  font-size: 13px;
  font-style: italic;
  padding: 8px 0;
}

/* ===== Week / Calendar Navigation ===== */
.week-nav, .calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.week-label, .month-label {
  font-size: 14px;
  font-weight: 700;
  min-width: 80px;
  text-align: center;
}

/* ===== Nutrition Summary Bar ===== */
.nutrition-summary-bar {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nutrition-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.nutrition-progress {
  flex: 1;
  height: 7px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.nutrition-progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 6px;
  transition: width .3s ease;
  width: 0%;
}

.nutrition-value {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 600;
}

/* ===== Calendar View Tabs ===== */
/* 週テーマ */
.week-theme-bar {
  margin-bottom: 10px;
  text-align: center;
}
.week-theme-label {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: var(--border-light);
  color: var(--text-secondary);
  transition: all .2s;
}
.week-theme-label.has-theme {
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  color: white;
  box-shadow: 0 2px 8px rgba(255,107,107,.3);
}

.cal-view-tabs {
  display: flex;
  background: var(--border-light);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 12px;
}

.cal-view-tab {
  flex: 1;
  padding: 7px 0;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: all .15s;
  font-family: inherit;
}

.cal-view-tab.active {
  background: var(--surface);
  color: var(--red);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ===== Calendar ===== */
.calendar-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-grid {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.calendar-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--gradient);
  min-width: 0;
}

.calendar-header-cell {
  text-align: center;
  padding: 10px 4px;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.calendar-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-cell {
  min-height: 68px;
  border: 1px solid var(--border-light);
  padding: 4px;
  overflow: hidden;
  min-width: 0;
}

.calendar-date {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 2px;
  color: var(--text);
}

.calendar-date.today {
  color: white;
  background: var(--red);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.calendar-recipe-dot {
  background: var(--blue-light);
  color: #1D4ED8;
  padding: 1px 3px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-bottom: 1px;
  max-width: 100%;
}

.calendar-cell.other-month {
  opacity: 0.3;
}

.calendar-cell.other-month .calendar-date {
  color: var(--text-light);
}

/* ===== Ingredient Categories ===== */
.ingredient-category {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
}

.ingredient-category-header {
  padding: 12px 13px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: var(--border-light);
}

.ingredient-category-header .count {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.ingredient-list {
  padding: 6px 13px;
}

.ingredient-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.ingredient-item:last-child {
  border-bottom: none;
}

.ing-row1 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ing-row2 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 27px;
}

.ingredient-item input[type="checkbox"] {
  accent-color: var(--red);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.ingredient-name {
  flex: 1;
  font-weight: 600;
}

.ingredient-qty {
  color: var(--text-secondary);
  font-size: 12px;
}

/* 買い物済みセクション */
.ing-done-section {
  margin-top: 8px;
}
.ing-done-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 8px 0;
  cursor: pointer;
  border-top: 1px dashed var(--border);
}
.ing-done-list .ingredient-item {
  opacity: 0.5;
}
.ing-done-list .ingredient-name {
  text-decoration: line-through;
}

/* 買ったボタン */
.ing-bought-btn {
  border: none;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  margin-left: auto;
  transition: all .2s;
}
.ing-bought-btn:active {
  transform: scale(0.95);
}
.ing-bought-btn.done {
  background: #DCFCE7;
  color: #16A34A;
}

.stock-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.stock-label {
  font-size: 9px;
  color: var(--text-light);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.ingredient-stock {
  width: 50px;
  padding: 4px 6px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  font-family: inherit;
}

.ingredient-stock:focus {
  border-color: var(--red);
  outline: none;
}

.ingredient-need {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  min-width: 40px;
  text-align: right;
}

/* ===== Shopping List ===== */
.shopping-period {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 13px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.shopping-period label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.shopping-period input[type="date"] {
  flex: 1;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  min-width: 0;
}

.shopping-period span {
  color: var(--text-light);
  font-size: 12px;
}

.budget-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px;
  margin-bottom: 14px;
}

.budget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.budget-header label {
  font-weight: 700;
  font-size: 14px;
}

.budget-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.budget-input-wrap .yen {
  font-weight: 700;
  color: var(--text-secondary);
}

.budget-input-wrap input {
  width: 80px;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  text-align: right;
  font-family: inherit;
}

.budget-input-wrap input:focus {
  border-color: var(--red);
  outline: none;
}

.budget-bar {
  height: 7px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.budget-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 6px;
  transition: width .3s ease;
  width: 0%;
}

.budget-bar-fill.warn {
  background: var(--orange);
}

.budget-bar-fill.over {
  background: #EF4444;
}

.budget-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

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

.shopping-category-header {
  padding: 10px 13px;
  font-weight: 700;
  font-size: 13px;
  background: var(--border-light);
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.shopping-item:last-child {
  border-bottom: none;
}

.shopping-item input[type="checkbox"] {
  accent-color: var(--red);
  width: 19px;
  height: 19px;
}

.shopping-item.checked .shopping-item-name {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.shopping-item-name {
  flex: 1;
  font-weight: 600;
}

.shopping-item-qty {
  color: var(--text-secondary);
  font-size: 12px;
}

.shopping-item-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ===== 統合タブ切替 ===== */
.unified-tabs {
  display: flex;
  gap: 0;
  background: var(--border-light);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 12px;
}
.unified-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
}
.unified-tab.active {
  background: var(--surface);
  color: var(--red);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* 統合食材アイテム - 買い物ビュー */
.ingredient-item.has-stock .ingredient-name {
  color: var(--text-secondary);
}
.ingredient-item .ing-price {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
}
.ingredient-item .ing-need-badge {
  font-size: 10px;
  font-weight: 700;
  color: white;
  background: var(--red);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}
.ingredient-item .ing-ok-badge {
  font-size: 10px;
  font-weight: 700;
  color: #16A34A;
  background: #DCFCE7;
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}
.ingredient-item.checked-item .ingredient-name {
  text-decoration: line-through;
  color: var(--text-secondary);
}
.ingredient-item .line-through {
  text-decoration: line-through;
  color: var(--text-secondary);
}

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn .15s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp .25s ease;
}

.modal-detail {
  max-height: 90vh;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

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

.modal-body {
  padding: 18px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border-light);
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--surface);
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px; /* iOS自動ズーム防止: 16px未満だとズームされる */
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  background: var(--surface);
  color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--red);
}

.form-group textarea {
  resize: vertical;
  line-height: 1.6;
  max-height: 150px;
  overflow-y: auto;
}

.required {
  color: #EF4444;
}

.hint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 20px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 44px;
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 14px;
  font-weight: 600;
}

.empty-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  font-weight: 500;
}

/* ===== Share Options ===== */
.share-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#share-result {
  margin-top: 16px;
}

#share-result textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  margin-bottom: 8px;
  resize: none;
}

#qr-container {
  margin-top: 16px;
  text-align: center;
}

#qr-container canvas,
#qr-container img {
  max-width: 200px;
}

/* ===== Nutrition Detail ===== */
.nutrition-detail {
  margin-top: 16px;
}

.nutrition-chart {
  width: 140px;
  height: 140px;
  margin: 0 auto 12px;
}

.nutrition-table {
  width: 100%;
  font-size: 13px;
}

.nutrition-table td {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}

.nutrition-table td:first-child {
  font-weight: 700;
}

.nutrition-table td:last-child {
  text-align: right;
  color: var(--text-secondary);
}

/* ===== Tab Bar ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 100;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 10px;
  font-weight: 600;
  transition: color var(--duration-fast) var(--ease);
  padding: 8px 0 6px;
  min-height: 48px;
  font-family: inherit;
}

.tab-item svg {
  width: 22px;
  height: 22px;
}

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

.tab-item.active svg {
  stroke: var(--primary);
}

.tab-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.tab-item span {
  line-height: 1;
}

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 14px);
  right: max(14px, calc((100vw - 600px) / 2 + 14px));
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gradient);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 107, 107, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: transform .15s;
}

.fab:active {
  transform: scale(0.9);
}

/* ===== Recipe Card Layout ===== */
.rc-top {
  display: flex;
  gap: 12px;
  cursor: pointer;
  align-items: center;
}

.rc-assign {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.rc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.rc-row:last-child {
  margin-bottom: 0;
}

/* 食事区分チップ */
.rc-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.rc-chip-meal-on {
  background: #6366F1;
  color: white;
  border-color: #6366F1;
}

.rc-chip-meal-on[data-meal="breakfast"] {
  background: #FB923C;
  border-color: #FB923C;
}

.rc-chip-meal-on[data-meal="lunch"] {
  background: #FACC15;
  border-color: #FACC15;
  color: #78350F;
}

.rc-chip-meal-on[data-meal="dinner"] {
  background: #6366F1;
  border-color: #6366F1;
}

.rc-chip-meal-on[data-meal="snack"] {
  background: #EC4899;
  border-color: #EC4899;
}

/* 食事タグチップ */
.rc-tags-row {
  flex-wrap: wrap;
  gap: 4px !important;
  margin-bottom: 2px;
}
.rc-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  border: 1.5px solid #ddd;
  color: #888;
  background: #f8f8f8;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.rc-tag:hover {
  border-color: #aaa;
  transform: scale(1.05);
}
.rc-tag-on {
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 曜日チップ（丸型） */
.rc-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.rc-day-on {
  color: white;
  border-color: transparent;
}

.rc-day-0 { background: var(--day-mon); }
.rc-day-1 { background: var(--day-tue); }
.rc-day-2 { background: var(--day-wed); }
.rc-day-3 { background: var(--day-thu); }
.rc-day-4 { background: var(--day-fri); }
.rc-day-5 { background: var(--day-sat); }
.rc-day-6 { background: var(--day-sun); }

/* 削除ボタン */
.rc-del {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background .15s;
}

.rc-del:active {
  background: #FEE2E2;
}

/* リンクボタン */
.rc-link-btn {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  font-size: 14px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
}
.rc-link-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* ===== Calendar Week/Day View ===== */
.cal-week-day {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  overflow: hidden;
  cursor: pointer;
}

.cal-week-day.cal-today {
  border: 2px solid var(--red);
}

.cal-week-day-header {
  padding: 10px 13px;
  color: white;
  font-weight: 800;
  font-size: 13px;
}

.cal-week-day-header.day-0 { background: var(--day-mon); }
.cal-week-day-header.day-1 { background: var(--day-tue); }
.cal-week-day-header.day-2 { background: var(--day-wed); }
.cal-week-day-header.day-3 { background: var(--day-thu); }
.cal-week-day-header.day-4 { background: var(--day-fri); }
.cal-week-day-header.day-5 { background: var(--day-sat); }
.cal-week-day-header.day-6 { background: var(--day-sun); }

/* ===== Date Picker Popup ===== */
.date-picker-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.dp-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.4);
}

.dp-box {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  padding: 18px;
  width: 100%;
  max-width: 300px;
  animation: slideUp .2s ease;
}

.dp-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}

.dp-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.dp-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--border-light);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s;
}

.dp-option:has(input:checked) {
  background: var(--red-light);
  color: var(--red);
}

.dp-option input[type="checkbox"] {
  accent-color: var(--red);
  width: 18px;
  height: 18px;
}

.dp-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #111827;
  color: white;
  padding: 9px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  animation: toastIn .25s ease, toastOut .25s ease 2.5s forwards;
  pointer-events: auto;
  white-space: nowrap;
}

.toast.success {
  background: #059669;
}

.toast.error {
  background: #DC2626;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(10px); }
}

/* ===== Tutorial ===== */
.tutorial-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.6);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tutorial-overlay.hidden { display: none; }

.tutorial-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 24px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: slideUp .3s ease;
}

.tutorial-slide { display: none; }
.tutorial-slide.active { display: block; animation: fadeIn .3s ease; }

.tutorial-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.tutorial-card h2 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}

.tutorial-card p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.tutorial-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.tutorial-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all .2s;
}

.tutorial-dots .dot.active {
  background: var(--red);
  width: 20px;
  border-radius: 4px;
}

.tutorial-actions {
  display: flex;
  gap: 10px;
}

.tutorial-actions .btn {
  flex: 1;
  justify-content: center;
}

/* ===== Hidden ===== */
.hidden {
  display: none !important;
}

/* ===== Responsive ===== */
@media (min-width: 601px) {
  .main-content {
    padding: 20px;
  }

  .modal {
    border-radius: var(--radius-lg);
    margin-bottom: 40px;
    max-height: 80vh;
  }

  .modal-overlay {
    align-items: center;
  }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ===== Serving Adjuster ===== */
.serving-adjuster {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.serving-controls {
  display: flex;
  align-items: center;
  gap: 0;
}

.serving-btn {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 800;
  color: var(--red);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  font-family: inherit;
}

.serving-btn:active {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.serving-count {
  width: 36px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

/* ===== Recipe Detail inside modal ===== */
.detail-image {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.detail-section {
  margin-bottom: 16px;
}

.detail-section h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--red);
}

.detail-ingredients-list {
  list-style: none;
}

.detail-ingredients-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}

.detail-steps {
  list-style: none;
  counter-reset: step;
}

.detail-steps li {
  counter-increment: step;
  padding: 8px 0;
  padding-left: 30px;
  position: relative;
  font-size: 14px;
  line-height: 1.6;
  border-bottom: 1px solid var(--border-light);
}

.detail-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 8px;
  width: 22px;
  height: 22px;
  background: var(--red);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ===== 性別セレクター ===== */
.gender-selector {
  display: flex;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
}

.gender-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.gender-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

.gender-btn.active {
  background: var(--primary);
  color: white;
}

/* ===== PFC入力フィールド ===== */
.pfc-inputs {
  display: flex;
  gap: 8px;
}

.pfc-input-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
}

.pfc-input-group input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  padding: 0;
}

.pfc-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.pfc-label.pfc-p { background: #3B82F6; }
.pfc-label.pfc-f { background: #F59E0B; }
.pfc-label.pfc-c { background: #10B981; }

.pfc-unit {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  flex-shrink: 0;
}

/* ===== PFCサマリーバー（週間献立） ===== */
.pfc-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.pfc-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pfc-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.pfc-tag.pfc-p { background: #3B82F6; }
.pfc-tag.pfc-f { background: #F59E0B; }
.pfc-tag.pfc-c { background: #10B981; }

.pfc-progress {
  flex: 1;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.pfc-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  width: 0%;
}

.pfc-p-fill { background: #3B82F6; }
.pfc-f-fill { background: #F59E0B; }
.pfc-c-fill { background: #10B981; }

.pfc-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 90px;
  text-align: right;
  white-space: nowrap;
}

/* ===== 自動献立ボタン ===== */
.btn-block {
  width: 100%;
}

/* ===== 外食 ===== */
.rest-genre-group {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
}
.rest-genre-header {
  padding: 10px 13px;
  font-weight: 700;
  font-size: 14px;
  background: var(--border-light);
}
.rest-genre-header .count {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.rest-card {
  padding: 12px 13px;
  border-bottom: 1px solid var(--border-light);
}
.rest-card:last-child { border-bottom: none; }
.rest-card-main {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.rest-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FEF3C7;
  border-radius: 10px;
  flex-shrink: 0;
}
.rest-info { flex: 1; min-width: 0; }
.rest-name {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rest-genre {
  font-size: 11px;
  color: var(--text-secondary);
}
.rest-budget {
  font-size: 11px;
  color: #B45309;
  font-weight: 600;
  margin-top: 2px;
}
.rest-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ===== コミュニティ ===== */
.ranking-card {
  background: linear-gradient(135deg, #FFF7ED, #FEF3C7);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.ranking-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
  color: #92400E;
}
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ranking-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ranking-medal {
  font-size: 20px;
  width: 28px;
  text-align: center;
}
.ranking-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.ranking-info {
  flex: 1;
  min-width: 0;
}
.ranking-name {
  font-size: 13px;
  font-weight: 700;
  display: block;
}
.ranking-theme {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranking-likes {
  font-size: 12px;
  font-weight: 700;
  color: #EF4444;
  white-space: nowrap;
}

/* フィードカード */
.feed-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.feed-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.feed-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.feed-user-info {
  flex: 1;
}
.feed-username {
  font-size: 14px;
  font-weight: 700;
  display: block;
}
.feed-date {
  font-size: 11px;
  color: var(--text-secondary);
}
.feed-theme {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #FF6B6B11, #FF8E5311);
  border-radius: 12px;
  margin-bottom: 10px;
}
.feed-theme-icon {
  font-size: 24px;
}
.feed-theme-text {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.feed-meals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.feed-meal-chip {
  padding: 4px 10px;
  background: var(--border-light);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.feed-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.feed-tag {
  font-size: 11px;
  color: var(--blue);
  font-weight: 600;
}
.feed-actions {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
}
.feed-like-btn,
.feed-comment-btn,
.feed-save-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 0;
  border-radius: 8px;
  transition: all .15s;
  font-family: inherit;
}
.feed-like-btn:active,
.feed-comment-btn:active,
.feed-save-btn:active {
  background: var(--border-light);
}
.feed-like-btn.liked {
  color: #EF4444;
}
.feed-like-btn.liked span {
  color: #EF4444;
}

/* タグフィルターバー */
.tag-filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tag-filter-bar::-webkit-scrollbar { display: none; }
.tag-filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
  font-family: inherit;
}
.tag-filter-chip.active {
  background: var(--red);
  border-color: var(--red);
  color: white;
}
.feed-tag {
  cursor: pointer;
}
.feed-tag:active {
  opacity: 0.6;
}

/* ポイント表示 */
.ranking-points {
  font-size: 10px;
  color: #F59E0B;
  font-weight: 600;
}
.ranking-bonus {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #10B981;
}
.feed-user-points {
  font-size: 10px;
  color: #F59E0B;
  font-weight: 600;
}

/* スポンサーカード */
.sponsor-card {
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.sponsor-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.sponsor-badge {
  font-size: 10px;
  font-weight: 800;
  background: #F59E0B;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
}
.sponsor-name {
  font-size: 14px;
  font-weight: 700;
}
.sponsor-prize {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.sponsor-prize-label {
  font-size: 11px;
  color: var(--text-secondary);
}
.sponsor-prize-text {
  font-size: 13px;
  font-weight: 800;
  color: #B45309;
}
.sponsor-hint {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0;
}

/* =====================================================
 * MeShiru v2 — 今日 / その他 / アフィリ / 歓迎 のスタイル
 * ===================================================== */

/* ===== 共通: btn-text ===== */
.btn-text {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast) var(--ease);
}
.btn-text:hover {
  background: var(--primary-light);
}
.btn-text:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== 今日タブ ===== */
.today-hero {
  background: var(--gradient);
  color: white;
  border-radius: var(--radius-lg);
  padding: 22px 18px 26px;
  margin: 14px 0 18px;
  box-shadow: var(--shadow);
}
.today-hero-label {
  font-size: 12px;
  opacity: 0.9;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.today-hero-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 6px 0 4px;
  line-height: 1.2;
}
.today-hero-sub {
  font-size: 13px;
  opacity: 0.95;
  font-weight: 500;
}

/* 今日の3スロット */
.today-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.today-slot {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}
.today-slot-empty {
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  box-shadow: none;
}
.today-slot-meal {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.today-slot-emoji {
  font-size: 18px;
}
.today-slot-empty-text {
  font-size: 13px;
  color: var(--text-light);
  padding: 6px 0 2px;
}
.today-slot-recipes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.today-slot-recipe {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease);
}
.today-slot-recipe:hover {
  background: var(--primary-light);
}
.today-slot-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.today-slot-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--warm);
  font-size: 18px;
}
.today-slot-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* クイックアクション */
.today-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

/* 今週ストリップ */
.today-week-section {
  margin-bottom: 22px;
}
.today-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.today-section-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.today-week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.strip-day {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 4px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.strip-day:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
}
.strip-day-today {
  background: var(--primary-light);
  border-color: var(--primary);
}
.strip-day-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}
.strip-day-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}
.strip-dots {
  display: flex;
  gap: 3px;
  align-items: center;
  height: 8px;
}
.strip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}
.strip-more {
  font-size: 9px;
  color: var(--primary);
  font-weight: 700;
  margin-left: 1px;
}
.strip-empty {
  font-size: 10px;
  color: var(--text-light);
  height: 8px;
}

/* 振り返り */
.today-recap-section {
  margin-bottom: 18px;
}
.today-recap {
  background: var(--warm);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--warm-deep);
}
.today-recap-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.today-recap-emoji {
  font-size: 16px;
}
.today-recap-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}
.today-recap-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ===== その他タブ ===== */
.more-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0 24px;
}
.more-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  transition: transform var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}
.more-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.more-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.more-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.more-card-body {
  width: 100%;
}
.more-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}
.more-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.more-about {
  border-top: 1px solid var(--border-light);
  padding-top: 18px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.more-about-link {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast) var(--ease);
}
.more-about-link:hover {
  background: var(--bg-soft);
  color: var(--text);
}
.more-about-version {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ===== アフィリエイト CTA ===== */
.affiliate-cta {
  margin-top: 16px;
  background: var(--warm);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  border: 1px solid var(--warm-deep);
}
.affiliate-cta-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.affiliate-cta-icon {
  font-size: 16px;
}
.affiliate-cta-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}
.affiliate-cta-pr {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}
.affiliate-cta-hint {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}
.affiliate-cta-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.affiliate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease);
  border: 1px solid transparent;
}
.affiliate-btn:hover {
  transform: translateY(-1px);
}
.affiliate-btn-rakuten {
  background: #BF0000;
  color: white;
}
.affiliate-btn-amazon {
  background: #232F3E;
  color: white;
}
.affiliate-btn-aeon {
  background: #E60012;
  color: white;
}
.affiliate-cta-disclosure {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 8px;
  line-height: 1.4;
}

/* ===== 歓迎モーダル ===== */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: welcome-fade var(--duration-normal) var(--ease);
}
@keyframes welcome-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.welcome-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: welcome-pop var(--duration-slow) var(--ease);
  text-align: center;
}
@keyframes welcome-pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.welcome-emoji {
  font-size: 48px;
  margin-bottom: 8px;
}
.welcome-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.welcome-lead {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 18px;
}
.welcome-features {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.welcome-note {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 18px;
  line-height: 1.6;
}
.welcome-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.welcome-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

/* ===== ヘルプモーダル（5 ステップガイド） ===== */
.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: welcome-fade var(--duration-normal) var(--ease);
}
.help-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 22px 20px;
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: welcome-pop var(--duration-slow) var(--ease);
}
.help-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.help-close:hover {
  background: var(--bg-soft);
  color: var(--text);
}
.help-close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.help-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 8px 0 18px;
}
.help-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}
.help-dot:hover {
  transform: scale(1.2);
}
.help-dot-active {
  background: var(--primary);
  width: 24px;
  border-radius: var(--radius-full);
}
.help-body {
  text-align: center;
  margin-bottom: 18px;
  min-height: 280px;
}
.help-step-icon {
  font-size: 48px;
  margin-bottom: 8px;
  line-height: 1;
}
.help-step-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.help-step-lead {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.7;
}
.help-step-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.help-step-list li {
  background: var(--bg-soft);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  border-left: 3px solid var(--primary);
}
.help-step-list li strong {
  color: var(--primary-dark);
  font-weight: 700;
}
.help-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}
.help-step-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.5px;
}
.help-actions .btn {
  flex-shrink: 0;
}
.help-actions .btn-text:disabled {
  color: var(--text-light);
  cursor: not-allowed;
}

/* 初回起動時の歓迎バナー（help モーダル冒頭に表示） */
.help-welcome-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient);
  color: white;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin: -8px -6px 14px -6px;
  font-size: 12px;
  font-weight: 700;
}
.help-welcome-emoji { font-size: 18px; }
.help-welcome-text { line-height: 1.4; }

/* 最終ステップの 2 ボタン CTA */
.help-final-cta {
  margin-top: 16px;
  padding: 14px 12px;
  background: var(--warm);
  border-radius: var(--radius);
  border: 1px solid var(--warm-deep);
  text-align: center;
}
.help-final-prompt {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.help-final-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.help-final-buttons .btn {
  width: 100%;
  justify-content: center;
}

/* レシピ庫の空状態 4 ボタン CTA */
.empty-state-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.empty-state-actions .btn {
  width: 100%;
  justify-content: center;
  font-size: 12px;
  padding: 12px 8px;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.empty-state-actions .btn svg {
  flex-shrink: 0;
}

/* 仮想タブのヘッダーに「← その他に戻る」 */
.back-to-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px 6px 0;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
}
.back-to-more:hover {
  color: var(--primary-dark);
}
.back-to-more:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ロゴをボタン化（今日タブへ戻る） */
.app-title-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.3;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  text-align: left;
}
.app-title-btn:focus-visible {
  outline: 2px solid white;
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* アフィリエイトボタンのタップ領域 44×44 確保 */
.affiliate-btn {
  min-height: 44px;
  padding: 12px 6px;
  font-size: 12px;
}

/* カスタム確認モーダル（confirm() 置換） */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9997;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: welcome-fade var(--duration-normal) var(--ease);
}
.confirm-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: welcome-pop var(--duration-slow) var(--ease);
}
.confirm-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.confirm-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  white-space: pre-wrap;
}
.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.confirm-actions .btn {
  min-width: 90px;
  justify-content: center;
}

/* URL 取り込みボタンの loading 状態 */
.btn[aria-busy="true"] {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}

/* ===== 「今日は外食したい」CTA（今日タブ ヒーロー直下） ===== */
.today-outing-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: linear-gradient(135deg, #FFF4ED 0%, #FDF6E3 100%);
  border: 1px solid var(--warm-deep);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
  text-align: left;
  font-family: inherit;
  min-height: 56px;
}
.today-outing-cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.today-outing-cta:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.today-outing-emoji {
  font-size: 24px;
  flex-shrink: 0;
}
.today-outing-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}
.today-outing-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.today-outing-sub {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.today-outing-arrow {
  color: var(--primary);
  flex-shrink: 0;
}

/* ===== 外食モーダル ===== */
.outing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9996;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: welcome-fade var(--duration-normal) var(--ease);
}
.outing-card {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 18px 18px;
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: outing-slide-up var(--duration-slow) var(--ease);
}
@keyframes outing-slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (min-width: 600px) {
  .outing-overlay {
    align-items: center;
    padding: 20px;
  }
  .outing-card {
    border-radius: var(--radius-lg);
  }
}
.outing-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 28px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-full);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.outing-close:hover {
  background: var(--bg-soft);
  color: var(--text);
}
.outing-close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.outing-header {
  margin-bottom: 14px;
  padding-right: 36px;
}
.outing-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.outing-lead {
  font-size: 12px;
  color: var(--text-secondary);
}
.outing-controls {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 14px;
  padding: 10px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.outing-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 100px;
}
.outing-control span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.outing-control select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  min-height: 40px;
}
.outing-controls .btn {
  flex-shrink: 0;
  min-height: 40px;
}
.outing-body {
  min-height: 240px;
}
.outing-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}
.outing-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.outing-meta-source {
  background: var(--bg-soft);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.outing-meta-count {
  color: var(--text);
}
.outing-note {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--warm);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}
.outing-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.outing-store {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 10px;
  transition: border-color var(--duration-fast) var(--ease);
}
.outing-store:hover {
  border-color: var(--primary);
}
.outing-store-photo {
  width: 92px;
  height: 92px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.outing-store-photo-fallback {
  background: var(--warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.outing-store-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.outing-store-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
}
.outing-store-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.outing-store-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-soft);
  color: var(--text-secondary);
  white-space: nowrap;
}
.outing-store-tag-dist {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.outing-store-catch {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.outing-store-address {
  font-size: 11px;
  color: var(--text-light);
  margin: 0;
  line-height: 1.4;
}
.outing-store-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.outing-store-actions .btn {
  font-size: 11px;
  padding: 7px 10px;
  min-height: 36px;
}
.outing-error {
  text-align: center;
  padding: 30px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.outing-error-icon {
  font-size: 36px;
}
.outing-error-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.outing-error-msg, .outing-error-hint {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.outing-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-secondary);
}
.outing-empty-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}
.outing-disclaimer {
  font-size: 10px;
  color: var(--text-light);
  line-height: 1.5;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  margin-top: 14px;
}
.outing-disclaimer a {
  color: var(--primary);
  text-decoration: underline;
}

/* ===== Phase C: パートナー店（外食モーダル内の上位セクション） ===== */
.partners-section {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--warm) 100%);
  border-radius: var(--radius);
  padding: 14px 12px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--warm-deep);
}
.partners-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.partners-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: 0.3px;
}
.partners-section-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.partners-section-lead {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}
.partners-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.partner-card {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
  text-align: left;
}
.partner-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.partner-card:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.partner-card-photo {
  width: 92px;
  height: 92px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.partner-card-photo-fallback {
  background: var(--warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.partner-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.partner-card-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.partner-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
}
.partner-badge-pill {
  background: var(--primary);
  color: white;
}
.partner-badge-recipe {
  background: var(--accent);
  color: white;
}
.partner-card-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
}
.partner-card-catch {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.partner-card-actions {
  margin-top: 4px;
}
.partner-card-cta {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ===== パートナー店 詳細モーダル ===== */
.partner-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9995;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: welcome-fade var(--duration-normal) var(--ease);
}
.partner-detail-card {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 720px;
  max-height: 95vh;
  overflow-y: auto;
  position: relative;
  animation: outing-slide-up var(--duration-slow) var(--ease);
}
@media (min-width: 600px) {
  .partner-detail-overlay { align-items: center; padding: 16px; }
  .partner-detail-card { border-radius: var(--radius-lg); }
}
.partner-detail-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  font-size: 28px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-full);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}
.partner-detail-close:hover { background: white; }
.partner-detail-close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.partner-detail-hero {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.partner-detail-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.partner-detail-photo-fallback {
  background: linear-gradient(135deg, var(--primary-light), var(--warm));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
}
.partner-detail-hero-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
}
.partner-detail-body {
  padding: 18px;
}
.partner-detail-head {
  margin-bottom: 12px;
}
.partner-detail-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.partner-detail-catch {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}
.partner-detail-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.partner-detail-info {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  line-height: 1.7;
}
.partner-detail-info p {
  margin-bottom: 2px;
}
.partner-detail-info strong {
  color: var(--text);
  font-weight: 700;
}
.partner-detail-desc {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* タブ */
.partner-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.partner-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
}
.partner-tab:hover { color: var(--text); background: var(--bg-soft); }
.partner-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.partner-panel.hidden { display: none; }
.partner-panel-lead {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.6;
}

/* 自慢レシピカード */
.signature-recipe {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 10px;
}
.signature-recipe-photo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.signature-recipe-photo-fallback {
  background: var(--warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.signature-recipe-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.signature-recipe-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
}
.signature-recipe-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}
.signature-recipe-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--text-light);
}
.signature-recipe-meta-item {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}
.signature-recipe .btn {
  font-size: 11px;
  padding: 7px 10px;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

/* 予約カレンダー */
.partner-reservation-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 4px;
  background: var(--bg-soft);
  padding: 8px;
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.reservation-slot-header {
  background: transparent;
}
.reservation-day-header {
  text-align: center;
  padding: 6px 2px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 10px;
}
.reservation-day-header.is-today {
  background: var(--primary-light);
  border: 1px solid var(--primary);
}
.reservation-day-name {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 10px;
}
.reservation-day-num {
  font-weight: 800;
  color: var(--text);
  font-size: 14px;
}
.reservation-slot-time {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.reservation-slot {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
  min-height: 36px;
}
.reservation-slot:not(:disabled):hover {
  transform: translateY(-1px);
  background: var(--primary-light);
}
.reservation-slot:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.reservation-slot-open { color: var(--accent); }
.reservation-slot-normal { color: var(--info); }
.reservation-slot-few { color: var(--warning); }
.reservation-slot-full {
  color: var(--text-light);
  background: var(--bg-soft);
  cursor: not-allowed;
}
.partner-reservation-note {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.5;
  padding: 8px 10px;
  background: var(--warm);
  border-radius: var(--radius-sm);
}

/* ===== 今日タブ「外食の予定」セクション ===== */
.today-reservations {
  margin-top: 18px;
}
.today-reservations-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 8px 0 6px;
  letter-spacing: 0.3px;
}
.today-reservation {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 6px;
}
.today-reservation-past {
  background: var(--bg-soft);
  opacity: 0.92;
}
.today-reservation-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.today-reservation-thumb-fallback {
  background: var(--warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.today-reservation-body {
  flex: 1;
  min-width: 0;
}
.today-reservation-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-reservation-date {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== レスポンシブ調整 ===== */
@media (min-width: 480px) {
  .more-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 720px) {
  .more-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== モーション削減対応 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
