* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f6f8;
}

.screen-home {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  background: #f5f6f8;
  position: relative;
}

/* ── ヘッダー ── */
.home-header {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: #fff;
  padding: 22px 20px 16px;
  border-bottom: 1px solid #eee;
}
.home-greet {
  font-size: 18px;
  font-weight: 700;
  color: #222;
}
.home-date {
  margin-top: 6px;
  font-size: 13px;
  color: #888;
}

.bell-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #5aaad4;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
.bell-btn:active { background: #4a9cc8; transform: scale(0.94); }
.bell-btn svg { width: 19px; height: 19px; }
.bell-dot {
  position: absolute;
  top: 7px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ff5b5b;
  border: 2px solid #5aaad4;
}

.home-toast {
  position: absolute;
  top: 66px;
  right: 20px;
  max-width: 220px;
  background: #333;
  color: #fff;
  font-size: 12.5px;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
}
.home-toast.show { opacity: 1; transform: translateY(0); }

/* ── 本文（スクロール領域） ── */
.home-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 24px;
}

/* ── 冷蔵庫の状態パネル ── */
.fridge-panel {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.fridge-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
}

.fridge-photo {
  position: relative;
  height: 190px;
  border-radius: 10px;
  background: linear-gradient(155deg, #e4edf3 0%, #cddce6 100%);
  border: 1px solid #d3e0e8;
  overflow: hidden;
  cursor: pointer;
  transition: filter 0.15s;
}
.fridge-photo:active { filter: brightness(0.96); }

/* 冷蔵庫内カメラの実際の画像 */
.fridge-photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* カメラ映像が入るまでのプレースホルダー表示 */
.fridge-photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #93a7b3;
}
.fridge-photo-placeholder svg { width: 30px; height: 30px; }
.fridge-photo-placeholder span {
  font-size: 12.5px;
  font-weight: 600;
}

/* 撮影中であることを示すバッジ */
.live-badge {
  position: absolute;
  top: 10px; left: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(20, 24, 28, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 4px 9px 4px 7px;
  border-radius: 32px;
  z-index: 2;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ff5b5b;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* 最終更新時刻 */
.fridge-photo-updated {
  position: absolute;
  bottom: 10px; right: 12px;
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(20, 24, 28, 0.5);
  padding: 3px 9px;
  border-radius: 32px;
  z-index: 2;
}

.list-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.list-btn {
  padding: 16px 10px;
  background: #5aaad4;
  color: #fff;
  border: none;
  border-radius: 32px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.list-btn:active { background: #4a9cc8; transform: scale(0.96); }

/* ── 賞味期限が近い食品 ── */
.expiring-section { margin-top: 22px; }
.expiring-section h2 {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
}
.expiring-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.expiring-scroll::-webkit-scrollbar { display: none; }

.food-card {
  flex: 0 0 auto;
  width: 84px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.food-thumb {
  width: 100%;
  height: 66px;
  border-radius: 8px;
  background: #eef4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.food-thumb svg { width: 24px; height: 24px; color: #6ab0d8; }
.food-name {
  font-size: 11px;
  font-weight: 600;
  color: #333;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.food-days {
  margin-top: 4px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #d9534f;
  background: #fbe3e2;
  border-radius: 32px;
  padding: 3px 0;
}
.food-days.ok {
  color: #3d8b52;
  background: #e0f0e4;
}

/* ── ボトムナビ ── */
.bottom-nav {
  flex-shrink: 0;
  display: flex;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.nav-item {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  cursor: pointer;
  color: #a0aab3;
  font-size: 10.5px;
  font-weight: 600;
  transition: color 0.15s;
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item.active { color: #5aaad4; }