:root {
  --bg: #eef2f7;
  --card: #ffffff;
  --text: #121826;
  --muted: #5f6678;
  --accent: #1c2742;
  --shadow: 0 14px 32px rgba(16, 24, 40, 0.09);
  --radius-card: 20px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.app-shell { max-width: 560px; margin: 0 auto; padding: 14px; }
.topbar h1 { margin: 8px 0 4px; font-size: 1.4rem; }
.topbar p { margin: 0 0 14px; color: var(--muted); }
.cards { display: grid; gap: 14px; }
.empty-card{background:#fff;border-radius:16px;padding:18px;box-shadow:var(--shadow);color:var(--muted)}
.meal-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.meal-card img { width: 100%; height: 180px; object-fit: cover; display: block; }
.card-body { padding: 12px; }
.card-body h2 { margin: 0 0 8px; font-size: 1.02rem; }
.meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .88rem; }

.recipe-detail { max-width: 560px; margin: 0 auto; }
.hero {
  position: relative;
  z-index: 0;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.12) 0%, rgba(15, 23, 42, 0.02) 28%, rgba(15, 23, 42, 0) 72%, rgba(15, 23, 42, 0.12) 100%);
  pointer-events: none;
  z-index: 1;
}
.hero img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: center center;
  display: block;
  position: relative;
  z-index: 0;
}
.floating-btn {
  position: absolute;
  top: 16px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
  display: grid;
  place-items: center;
  text-decoration: none;
  color: #111827;
  z-index: 3;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, Arial, sans-serif;
}
.floating-btn.left { left: 16px; }
.floating-btn.right { right: 16px; }
.floating-icon {
  display: block;
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.95;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.floating-icon-back {
  width: 24px;
  height: 24px;
  transform: translateX(-1px) translateY(-0.5px);
}
.floating-icon-heart {
  width: 21px;
  height: 21px;
  transform: translateY(0.5px);
}

.detail-sheet {
  position: relative;
  z-index: 2;
  background: var(--card);
  margin-top: -34px;
  border-radius: 28px 28px 0 0;
  padding: 22px 16px 28px;
  min-height: 52vh;
  box-shadow: 0 -12px 34px rgba(15, 23, 42, 0.08);
}
.detail-sheet h1 {
  margin: 0 0 8px;
  font-size: 1.72rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.stats-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: #334155;
  font-size: .9rem;
  margin-bottom: 16px;
}
.stats-row span {
  background: #f4f6fb;
  border: 1px solid #e4e8f0;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.nutrition-card {
  background: #f8f9fc;
  border: 1px solid #edf1f6;
  border-radius: var(--radius-card);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.04);
}
.nutrition-head { display: flex; justify-content: space-between; align-items: center; }
.nutrition-head h2 { font-size: 1.02rem; margin: 0; font-weight: 700; }
.nutrition-head a { color: var(--accent); text-decoration: none; font-size: .88rem; font-weight: 600; }
.nutrition-body { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.donut {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: conic-gradient(#4CAF50 0 36.8%, #F4A742 36.8% 57.6%, #4A90E2 57.6% 100%);
  position: relative;
  flex: 0 0 auto;
}
.donut::after {
  content: "";
  position: absolute;
  inset: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.03);
}
.nutrition-body ul { margin: 0; padding: 0; list-style: none; font-size: .92rem; }
.nutrition-body li { margin: 6px 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.dot.protein { background:#4CAF50; }
.dot.fat { background:#F4A742; }
.dot.carb { background:#4A90E2; }

.tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-top: 2px;
}
.tab {
  border: 1px solid #d7dce7;
  background: #fff;
  color: #1f2a44;
  padding: 12px 16px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}
.tab.active {
  background: #1f2a44;
  color: #fff;
  border-color: #1f2a44;
  box-shadow: 0 10px 20px rgba(31, 42, 68, 0.16);
}
.tab-panel { display: none; padding-top: 14px; }
.tab-panel.active { display: block; }
.tab-panel li { margin-bottom: 10px; line-height: 1.5; }

@media (max-width: 344px) {
  .hero img { height: 300px; }
  .detail-sheet h1 { font-size: 1.34rem; }
}

@media (min-width: 390px) {
  .detail-sheet { padding: 24px 18px 30px; }
}

@media (min-width: 768px) {
  .recipe-detail { max-width: 620px; }
  .hero img { height: 400px; }
}
