@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── TOKENS ─────────────────────────────────── */
:root {
  --bg:           #f5f5f5;
  --surface:      #ffffff;
  --card-bg:      #ffffff;
  --text:         #111111;
  --text-muted:   #555555;
  --text-dim:     #9a9a9a;
  --accent:       #111111;
  --border:       #e8e8e8;
  --border-2:     #d0d0d0;
  --shadow:       0 1px 2px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.13);
  --radius:       6px;
  --nav-h:        60px;
  --f:            'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── BASE ────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--f);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }

/* ── SCROLLBAR ───────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #aaaaaa; }

/* ── NAV ─────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}

.nav-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-transform: uppercase;
  white-space: nowrap;
}

.search-wrap {
  flex: 1;
  max-width: 380px;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-family: var(--f);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.nav-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ── MILITARY CLOCK ──────────────────────────── */
.clock-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  padding-left: 20px;
}
.clock-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  line-height: 1.3;
}
.clock-label span {
  display: block;
  color: var(--text-dim);
}
.clock-time {
  font-family: 'Courier New', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1;
}
.clock-secs {
  font-family: 'Courier New', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  line-height: 1;
}

/* ── PAGE TITLE ──────────────────────────────── */
.page-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.page-header-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 40px 32px 32px;
}
.page-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

/* ── FILTERS ─────────────────────────────────── */
.filters-section {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
}
.filters-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  min-width: 36px;
  flex-shrink: 0;
}
.filter-btn {
  padding: 5px 13px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--f);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.filter-btn:hover {
  border-color: var(--text);
  color: var(--text);
  background: #f0f0f0;
}
.filter-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: #ffffff;
  font-weight: 600;
}

.sort-select {
  margin-left: auto;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.78rem;
  font-family: var(--f);
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  outline: none;
  transition: border-color 0.12s;
}
.sort-select:focus, .sort-select:hover { border-color: var(--text); }
.sort-select option { background: #fff; }

/* ── GRID ────────────────────────────────────── */
.grid-section {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}

.results-bar {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
}
.results-bar strong { color: var(--text-muted); margin-right: 3px; }

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ── CARD ────────────────────────────────────── */
.recipe-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.25s ease both;
}
.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

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

.card-thumb {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.card-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.recipe-card:hover .card-thumb-img { transform: scale(1.03); }

.card-thumb-type {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255,255,255,0.92);
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 8px;
  border-radius: 100px;
  backdrop-filter: blur(8px);
}

.card-body {
  padding: 16px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-dim);
}
.card-meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
}
.card-meta svg { width: 12px; height: 12px; flex-shrink: 0; }

.rating-stars { color: #d97706; font-size: 0.68rem; }

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 4px;
}

/* ── TAGS ────────────────────────────────────── */
.tag {
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
}
.tag-vegetarian      { background: #ecfdf5; color: #065f46; }
.tag-plant-based     { background: #ecfdf5; color: #064e3b; }
.tag-high-protein    { background: #fef2f2; color: #991b1b; }
.tag-quick           { background: #eff6ff; color: #1e40af; }
.tag-breakfast       { background: #fffbeb; color: #92400e; }
.tag-good-to-freeze  { background: #f0f9ff; color: #075985; }
.tag-batch-cooking   { background: #faf5ff; color: #6b21a8; }
.tag-family-friendly { background: #ecfdf5; color: #166534; }
.tag-good-on-the-go  { background: #ecfeff; color: #155e75; }
.tag-refuel          { background: #fff7ed; color: #9a3412; }
.tag-best-for-2      { background: #fdf4ff; color: #86198f; }
.tag-default         { background: #f5f5f5; color: #737373; }

/* ── EMPTY STATE ─────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; color: var(--text-muted); }

/* ── RECIPE DETAIL PAGE ──────────────────────── */
.recipe-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 32px 100px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 28px;
  transition: color 0.12s;
}
.back-link:hover { color: var(--text); }
.back-link svg { width: 14px; height: 14px; }

/* Photo recipes: full-bleed header with overlay */
.recipe-page-header {
  position: relative;
  width: 100%;
  min-height: 460px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 36px 36px;
  box-shadow: var(--shadow);
}

.recipe-page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.5)  0%,
    rgba(0,0,0,0.08) 35%,
    rgba(0,0,0,0.08) 55%,
    rgba(0,0,0,0.82) 100%
  );
  pointer-events: none;
}

.recipe-page-header .back-link {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  color: rgba(255,255,255,0.8);
}
.recipe-page-header .back-link:hover { color: #fff; }

.recipe-page-header-content {
  position: relative;
  z-index: 1;
}

.recipe-page-header .recipe-type-pill {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.2);
  backdrop-filter: blur(6px);
}

.recipe-page-header .recipe-title { color: #ffffff; text-shadow: 0 1px 8px rgba(0,0,0,0.4); }
.recipe-page-header .recipe-stat  { color: rgba(255,255,255,0.7); }
.recipe-page-header .recipe-stat strong { color: #fff; }
.recipe-page-header .recipe-stat svg { color: rgba(255,255,255,0.7); }

/* Non-photo recipes */
.recipe-hero {
  width: 100%;
  height: 280px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5.5rem;
  margin-bottom: 32px;
  overflow: hidden;
}
.recipe-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recipe-header { margin-bottom: 28px; }

.recipe-type-pill {
  display: inline-block;
  background: #f5f5f5;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.recipe-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 20px;
}

.recipe-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 18px;
}
.recipe-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-muted);
}
.recipe-stat svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }
.recipe-stat strong { color: var(--text); font-weight: 700; }

.recipe-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.recipe-content {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  margin-top: 32px;
}

.section-heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 14px;
}

/* Ingredients */
.ingredients-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  align-self: start;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  box-shadow: var(--shadow);
}
.ingredient-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.ingredient-row:last-child { border-bottom: none; }
.ingredient-amount {
  font-weight: 600;
  color: var(--text);
  min-width: 56px;
  flex-shrink: 0;
  font-size: 0.78rem;
}
.ingredient-name { color: var(--text-muted); line-height: 1.4; }

/* Method */
.method-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.method-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.method-step:last-child { margin-bottom: 0; }
.step-num {
  width: 26px;
  height: 26px;
  background: var(--text);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-text {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-muted);
  padding-top: 3px;
}

/* ── FOOTER ──────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  text-align: center;
  padding: 24px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.6;
}
footer strong { color: var(--text-muted); }

/* ── SIGN-OUT BUTTON ─────────────────────────── */
.signout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  margin-left: 8px;
}
.signout-btn:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--bg);
}

/* ── NAV LINKS & RIGHT CLUSTER ───────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 20px;
}
.nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: 100px;
  transition: color 0.12s, background 0.12s;
}
.nav-link:hover  { color: var(--text); background: var(--bg); }
.nav-link.active { color: var(--text); font-weight: 600; background: var(--bg); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Profile avatar chip in nav */
.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
  letter-spacing: 0.02em;
}
.nav-avatar:hover { opacity: 0.8; }
.nav-avatar-active { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--text); }

/* ── SHARED BUTTONS ──────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-family: var(--f);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
  white-space: nowrap;
}
.btn-primary:hover:not(:disabled) { background: #222; }
.btn-primary:active:not(:disabled) { transform: scale(0.99); }
.btn-primary:disabled { background: #888; cursor: not-allowed; }
.btn-primary.full-width { width: 100%; justify-content: center; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-family: var(--f);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-2); background: var(--bg); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-family: var(--f);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
  align-self: flex-end;
}
.btn-outline:hover { border-color: var(--text); background: var(--bg); }

/* ── CONNECT BANNER ──────────────────────────── */
.connect-banner {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.connect-banner.hidden { display: none; }
.connect-banner-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.connect-banner-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ── DASHBOARD HEADER ────────────────────────── */
.dash-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.dash-header-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 36px 32px 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.dash-date {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.dash-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

/* ── DASHBOARD SECTIONS ──────────────────────── */
.dash-section { padding: 28px 0; }
.dash-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
}
.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* ── HERO RING GAUGES ────────────────────────── */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hero-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.ring-wrap { width: 90px; height: 90px; }
.ring-svg  { width: 100%; height: 100%; }
.hero-card-val {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}
.hero-card-status {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
}

/* ── METRIC CARDS ────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent, var(--border));
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}
.metric-card:hover  { box-shadow: var(--shadow-hover); }
.metric-card.dim    { opacity: 0.45; }
.card-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.card-val {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 4px;
  transition: color 0.3s;
}
.card-val.loading { color: var(--text-dim); }
.card-status {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.card-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ── INSIGHTS ────────────────────────────────── */
.insights-list { display: flex; flex-direction: column; gap: 12px; }
.insights-empty { font-size: 0.85rem; color: var(--text-dim); }
.insight-card {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.insight-positive { border-left: 3px solid #10b981; }
.insight-warning  { border-left: 3px solid #f59e0b; }
.insight-info     { border-left: 3px solid #3b82f6; }

.insight-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.insight-positive .insight-icon { background: #ecfdf5; color: #10b981; }
.insight-warning  .insight-icon { background: #fffbeb; color: #f59e0b; }
.insight-info     .insight-icon { background: #eff6ff; color: #3b82f6; }
.insight-icon svg { width: 16px; height: 16px; }

.insight-title  { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.insight-text   { font-size: 0.82rem; color: var(--text-muted); line-height: 1.55; }
.insight-action { font-size: 0.78rem; font-weight: 600; color: var(--text-dim); margin-top: 6px; }

/* ── TRENDS ──────────────────────────────────── */
.trends-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.trend-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.trend-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.trend-chart-wrap { height: 100px; position: relative; }

/* ── MODAL ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 300;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 400;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  width: min(480px, calc(100vw - 40px));
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.modal.hidden { display: none; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; }
.modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
}
.modal-subtext { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 20px; }
.form-error { font-size: 0.78rem; color: #c62828; font-weight: 500; min-height: 18px; margin-bottom: 12px; }

/* ── PROFILE PAGE ────────────────────────────── */
.profile-page { min-height: calc(100vh - var(--nav-h) - 64px); }
.profile-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}
.pf-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
}
.pf-avatar-wrap {
  flex-shrink: 0;
}
.pf-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}
.pf-title    { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px; }
.pf-subtitle { font-size: 0.84rem; color: var(--text-muted); }
.pf-section  { margin-bottom: 40px; }
.pf-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.pf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pf-garmin-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.pf-garmin-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 10px;
  line-height: 1.5;
}
.pf-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
}
.pf-status-ok  { font-size: 0.8rem; font-weight: 600; color: #10b981; }
.pf-status-err { font-size: 0.8rem; font-weight: 600; color: #ef4444; }

/* ── FORM ELEMENTS ───────────────────────────── */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--f);
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.form-input:focus {
  border-color: var(--text);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.form-input.error {
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229,57,53,0.08);
}
.form-input[readonly] { opacity: 0.6; cursor: default; }

/* ── THEME TOGGLE ─────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--bg);
}

/* ── DARK MODE ───────────────────────────────── */
[data-theme="dark"] {
  --bg:           #0d0d0d;
  --surface:      #161616;
  --card-bg:      #161616;
  --text:         #efefef;
  --text-muted:   #909090;
  --text-dim:     #4a4a4a;
  --accent:       #efefef;
  --border:       #242424;
  --border-2:     #383838;
  --shadow:       0 1px 2px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.5);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.7);
}

/* Nav background is hardcoded white — override */
[data-theme="dark"] .nav { background: rgba(13,13,13,0.95); }

/* var(--text) is now light, so foreground on it must be dark */
[data-theme="dark"] .btn-primary                    { color: #111; }
[data-theme="dark"] .btn-primary:hover:not(:disabled){ background: #d8d8d8; }
[data-theme="dark"] .nav-avatar                     { color: #111; }
[data-theme="dark"] .pf-avatar                      { color: #111; }
[data-theme="dark"] .step-num                       { color: #111; }
[data-theme="dark"] .nav-avatar-active              { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--text); }

/* Hardcoded white backgrounds */
[data-theme="dark"] .connect-banner   { background: var(--surface); }
[data-theme="dark"] .modal            { background: var(--surface); }
[data-theme="dark"] .recipe-type-pill { background: var(--bg); }

/* Input/filter overrides */
[data-theme="dark"] .filter-btn:hover   { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .sort-select option { background: #1a1a1a; color: var(--text); }
[data-theme="dark"] .form-input:focus   { box-shadow: 0 0 0 3px rgba(255,255,255,0.06); }

/* Tag dark palette */
[data-theme="dark"] .tag-vegetarian      { background: #052e1c; color: #6ee7b7; }
[data-theme="dark"] .tag-plant-based     { background: #052e1c; color: #6ee7b7; }
[data-theme="dark"] .tag-high-protein    { background: #2d1515; color: #fca5a5; }
[data-theme="dark"] .tag-quick           { background: #162038; color: #93c5fd; }
[data-theme="dark"] .tag-breakfast       { background: #221a08; color: #fcd34d; }
[data-theme="dark"] .tag-good-to-freeze  { background: #071b2d; color: #7dd3fc; }
[data-theme="dark"] .tag-batch-cooking   { background: #1a0f2e; color: #c4b5fd; }
[data-theme="dark"] .tag-family-friendly { background: #071e10; color: #86efac; }
[data-theme="dark"] .tag-good-on-the-go  { background: #051820; color: #67e8f9; }
[data-theme="dark"] .tag-refuel          { background: #221105; color: #fb923c; }
[data-theme="dark"] .tag-best-for-2      { background: #1e0828; color: #e879f9; }
[data-theme="dark"] .tag-default         { background: #1e1e1e; color: #909090; }

/* Insight icon backgrounds */
[data-theme="dark"] .insight-positive .insight-icon { background: rgba(16,185,129,0.15); }
[data-theme="dark"] .insight-warning  .insight-icon { background: rgba(245,158,11,0.15); }
[data-theme="dark"] .insight-info     .insight-icon { background: rgba(59,130,246,0.15); }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 860px) {
  .clock-label { display: none; }
  .clock-wrap  { padding-left: 14px; }
}
@media (max-width: 720px) {
  .recipe-content   { grid-template-columns: 1fr; }
  .ingredients-card { position: static; }
  .nav-count        { display: none; }
  .nav-inner,
  .filters-section,
  .grid-section,
  .recipe-page,
  .page-header-inner { padding-left: 20px; padding-right: 20px; }
  .recipe-page-header { padding: 22px 24px 28px; }
}
@media (max-width: 540px) {
  .search-wrap  { flex: 1; }
  .recipe-grid  { grid-template-columns: 1fr; }
  .clock-wrap   { display: none; }
  .page-title   { font-size: 1.8rem; }
}
