:root {
  --ink: #172033;
  --leaf: #0f766e;
  --cream: #fffaf2;
  --line: #e8edf2;
}

html { scroll-behavior: smooth; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(15, 118, 110, .28);
  outline-offset: 2px;
}

.app-shell {
  width: 100%;
  max-width: 1800px;
  margin-left: auto;
  margin-right: auto;
}

.panel {
  border: 1px solid rgba(226, 232, 240, .9);
  background: rgba(255, 255, 255, .90);
  border-radius: 1.8rem;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
}

.page-title { font-size: clamp(2rem, 3vw, 3.35rem); line-height: .96; font-weight: 900; letter-spacing: -0.055em; }
.page-subtitle { margin-top: .75rem; max-width: 780px; color: #64748b; line-height: 1.7; }
.section-title { font-size: 1rem; line-height: 1.35; font-weight: 900; letter-spacing: -0.015em; }
.section-subtitle { margin-top: .25rem; font-size: .875rem; line-height: 1.55; color: #64748b; }
.eyebrow { font-size: .72rem; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; color: var(--leaf); }

.input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: rgba(255,255,255,.92);
  padding: .78rem .9rem;
  font-size: .925rem;
  font-weight: 650;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(15,23,42,.03);
}
.input::placeholder { color: #94a3b8; font-weight: 600; }
.input:focus { border-color: rgba(15,118,110,.55); box-shadow: 0 0 0 4px rgba(15,118,110,.10); outline: none; }
textarea.input { min-height: 92px; resize: vertical; font-weight: 500; line-height: 1.45; }

.btn-primary, .btn-muted, .btn-ghost, .btn-danger {
  display: inline-flex;
  min-height: 2.7rem;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border-radius: .95rem;
  padding: .68rem 1rem;
  font-size: .875rem;
  font-weight: 900;
  line-height: 1;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--leaf); color: white; box-shadow: 0 14px 32px rgba(15, 118, 110, .20); }
.btn-primary:hover { transform: translateY(-1px); background: #0d665f; }
.btn-muted { border: 1px solid #e2e8f0; background: white; color: #334155; }
.btn-muted:hover { transform: translateY(-1px); border-color: #cbd5e1; box-shadow: 0 10px 22px rgba(15, 23, 42, .06); }
.btn-ghost { background: transparent; color: #475569; padding-inline: .65rem; }
.btn-ghost:hover { background: #f1f5f9; }
.btn-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fecaca; transform: translateY(-1px); }

.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.4rem;
  border-radius: 1rem;
  padding: .78rem 1.1rem;
  font-size: .9rem;
  font-weight: 900;
  color: #64748b;
}
.nav-pill.active { background: #0f766e; color: white; box-shadow: 0 12px 28px rgba(15, 118, 110, .18); }

.tag-pill {
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: white;
  padding: .43rem .7rem;
  font-size: .76rem;
  font-weight: 850;
  color: #475569;
}
.tag-pill.active { border-color: rgba(15,118,110,.32); background: #dff8f1; color: #0f766e; }

.segmented { display: inline-flex; border-radius: 1rem; background: white; border: 1px solid #e2e8f0; padding: .18rem; }
.segmented-btn { border-radius: .78rem; padding: .62rem .9rem; font-size: .84rem; font-weight: 900; color: #64748b; }
.segmented-btn.active { background: #172033; color: white; }

.recipe-card, .meal-card, .shopping-row, .cook-row {
  border: 1px solid #e8edf2;
  background: white;
  border-radius: 1.25rem;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.recipe-card { padding: 1rem; cursor: pointer; }
.recipe-card:hover { transform: translateY(-2px); border-color: rgba(15,118,110,.25); box-shadow: 0 14px 30px rgba(15,23,42,.08); }
.recipe-card.active { border-color: rgba(15,118,110,.45); background: linear-gradient(180deg, #fff, #f5fffc); box-shadow: 0 14px 30px rgba(15,118,110,.11); }
.meal-card { padding: .95rem; }
.shopping-row { padding: .85rem; }
.shop-mode .shopping-row { padding: 1.05rem; border-radius: 1.4rem; }
.cook-row { padding: 1rem; }

.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(9.5rem, 1fr)); gap: .5rem; }
.calendar-head { padding: .55rem .35rem; text-align: center; font-size: .73rem; font-weight: 900; color: #64748b; text-transform: uppercase; letter-spacing: .09em; }
.calendar-day {
  min-height: 8.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  background: white;
  padding: .72rem;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.calendar-day:hover { transform: translateY(-1px); border-color: rgba(15,118,110,.28); box-shadow: 0 10px 24px rgba(15,23,42,.06); }
.calendar-day.selected { border-color: rgba(15,118,110,.65); background: #f5fffc; box-shadow: inset 0 0 0 2px rgba(15,118,110,.08); }
.calendar-day.outside { opacity: .48; background: #f8fafc; }
.calendar-day.today .date-badge { background: #0f766e; color: white; }
.date-badge { display: inline-grid; height: 2rem; min-width: 2rem; place-items: center; border-radius: .75rem; padding-inline: .45rem; font-size: .85rem; font-weight: 900; color: #334155; }
.meal-chip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: .75rem; background: #f1f5f9; padding: .35rem .5rem; font-size: .72rem; font-weight: 800; color: #334155; }
.meal-chip.cooked { background: #dff8f1; color: #0f766e; text-decoration: line-through; }

.recipe-detail-hero { background: radial-gradient(circle at 20% 10%, rgba(223,248,241,1), transparent 32%), radial-gradient(circle at 90% 0%, rgba(255,241,231,.95), transparent 36%), white; }
.nutri-box { border: 1px solid #e2e8f0; border-radius: 1rem; background: white; padding: .85rem; text-align: center; }
.nutri-box strong { display: block; font-size: 1.05rem; font-weight: 900; }
.nutri-box span { display: block; margin-top: .15rem; font-size: .72rem; font-weight: 800; color: #64748b; }

.check-tile { display: flex; gap: .8rem; align-items: flex-start; }
.check-tile input[type="checkbox"] { margin-top: .2rem; height: 1.25rem; width: 1.25rem; accent-color: #0f766e; flex: 0 0 auto; }
.check-tile.done .check-copy { color: #64748b; text-decoration: line-through; }

.shop-links a { color: #0f766e; font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.shop-links a:hover { color: #0d665f; }

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 640px) {
  .panel { border-radius: 1.25rem; }
  .calendar-grid { grid-template-columns: repeat(7, minmax(7.2rem, 1fr)); }
  .calendar-day { min-height: 7.5rem; padding: .55rem; border-radius: 1rem; }
  .nav-pill { min-width: 6.5rem; padding-inline: .85rem; }
}

@media print {
  header, nav, footer, #installBanner, #toast, #shareBanner, .no-print { display: none !important; }
  body { background: white !important; }
  .app-shell { max-width: none !important; padding: 0 !important; }
  .panel { box-shadow: none !important; border: 1px solid #d9dee6 !important; }
}
