@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,300;0,400;0,600;1,300&family=Manrope:wght@300;400;500;600&family=Space+Grotesk:wght@300;400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* ── Core backgrounds ──────────────────────────────────── */
  --bg:              #0c0b12;
  --surface:         #131318;
  --surface-low:     #1b1b20;
  --surface-mid:     #1a1535;
  --surface-raised:  #2a292f;
  --surface-high:    #35343a;

  /* ── Text ──────────────────────────────────────────────── */
  --text:            #e4e1e9;
  --muted:           #9790ab;
  --text-on-primary: #1a0f40;

  /* ── Brand accent — gold (secondary in Stitch) ─────────── */
  --accent:          #c9a84c;
  --accent-hover:    #e0b84a;
  --accent-dim:      rgba(201,168,76,0.12);

  /* ── Primary — lavender (new from Stitch) ──────────────── */
  --primary:         #cabeff;
  --primary-dim:     rgba(202,190,255,0.12);
  --primary-deep:    #8063ff;
  --primary-darker:  #4717ca;

  /* ── Semantic accents ──────────────────────────────────── */
  --cyan:            #4dd9e8;
  --cyan-dim:        rgba(77,217,232,0.10);
  --magenta:         #c84fd8;
  --magenta-dim:     rgba(200,79,216,0.10);
  --green:           #162b1e;
  --green-text:      #7ecb7e;
  --red:             #2b1616;
  --red-text:        #cb7e7e;

  /* ── Legacy alias (keeps old templates working) ────────── */
  --border:          rgba(202,190,255,0.08);

  /* ── Radius scale ──────────────────────────────────────── */
  --radius-sm:       0.5rem;
  --radius-md:       1rem;
  --radius-lg:       1.5rem;
  --radius-xl:       2rem;
  --radius-pill:     9999px;

  /* ── Glassmorphism ─────────────────────────────────────── */
  --glass-bg:        rgba(27,27,32,0.55);
  --glass-blur:      24px;
  --glass-border:    rgba(202,190,255,0.10);
  --nebula-glow:     rgba(71,23,202,0.10);
}

body {
  font-family: 'Manrope', 'Georgia', sans-serif;
  background: var(--bg);
  position: relative;
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

@property --px { syntax: '<percentage>'; inherits: false; initial-value: 30%; }
@property --py { syntax: '<percentage>'; inherits: false; initial-value: 35%; }
@property --gx { syntax: '<percentage>'; inherits: false; initial-value: 70%; }
@property --gy { syntax: '<percentage>'; inherits: false; initial-value: 60%; }

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background: radial-gradient(circle at var(--px) var(--py), rgba(71,23,202,0.12) 0%, transparent 55%);
  animation: drift-purple 75s ease-in-out infinite alternate;
}

body::after {
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(201,168,76,0.08) 0%, transparent 50%);
  animation: drift-gold 90s ease-in-out infinite alternate;
}

/* ── Page shell ──────────────────────────────────────────── */

.page-content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 5.5rem 2rem 5rem; /* top clears fixed header, bottom clears mobile bottom-nav */
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-raised); border-radius: 10px; }

/* ── Typography ──────────────────────────────────────────── */

h1, h2, h3 {
  font-family: 'Noto Serif', Georgia, serif;
  font-weight: 400;
  color: var(--primary);
  letter-spacing: 0.02em;
}
h1 { font-size: 2.4rem; margin-bottom: 0.25rem; line-height: 1.2; }
h2 {
  font-size: 1.35rem;
  padding-bottom: 0.3rem;
  margin-top: 2rem;
  color: var(--accent);
  /* No border — use spacing to separate, per No-Line Rule */
}
h3 { font-size: 1.1rem; color: var(--text); }

/* Space Grotesk for data labels */
.data-label, .recipe-card-strip, .recipe-meta-bar__item {
  font-family: 'Space Grotesk', monospace;
  letter-spacing: 0.04em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
p { color: var(--text); }

hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
  margin: 2rem 0;
}

/* ── Top navigation (fixed glass header) ────────────────── */

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 2rem;
  background: rgba(19,19,24,0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px var(--nebula-glow);
}

.top-nav__brand {
  font-family: 'Noto Serif', Georgia, serif;
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.02em;
  text-decoration: none;
  flex-shrink: 0;
}
.top-nav__brand:hover { opacity: 0.85; }
.brand-zo { color: #fff; }
.brand-rest {
  font-style: inherit;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.top-nav__links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-left: 2rem;
}

.top-nav__links a {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(228,225,233,0.55);
  text-decoration: none;
  transition: color 0.2s;
  padding-bottom: 2px;
}
.top-nav__links a:hover { color: var(--primary); }
.logout-btn {
  all: unset;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(228,225,233,0.55);
  cursor: pointer;
  transition: color 0.2s;
}
.logout-btn:hover { color: var(--primary); }
.top-nav__links a.active {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

.top-nav__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.top-nav__actions a {
  font-size: 0.82rem;
  color: rgba(228,225,233,0.55);
  text-decoration: none;
  transition: color 0.2s;
}
.top-nav__actions a:hover { color: var(--primary); }

.top-nav__user {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-decoration: none;
}

/* ── Mobile bottom nav ───────────────────────────────────── */

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(19,19,24,0.90);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--glass-border);
  padding: 0.5rem 0 0.75rem;
}

.bottom-nav__items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.bottom-nav__item a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: rgba(228,225,233,0.45);
  font-family: 'Space Grotesk', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
  padding: 0.3rem 1rem;
}
.bottom-nav__item a:hover,
.bottom-nav__item a.active { color: var(--primary); }
.bottom-nav__item .nav-icon {
  font-size: 1.3rem;
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}
.bottom-nav__item a.active .nav-icon {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

@media (max-width: 700px) {
  .top-nav__links { display: none; }
  .bottom-nav { display: block; }
  .page-content { padding-bottom: 5.5rem; }
}

/* ── Tables ──────────────────────────────────────────────── */

table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
th {
  text-align: left;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'Space Grotesk', monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.5rem 0.8rem;
  background: var(--surface-raised);
}
td {
  padding: 0.45rem 0.8rem;
  color: var(--text);
  border-bottom: 1px solid var(--glass-border);
}
tr:last-child td { border-bottom: none; }

/* ── Buttons ─────────────────────────────────────────────── */

button, input[type=submit] {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: var(--text-on-primary);
  border: none;
  padding: 0.55rem 1.5rem;
  cursor: pointer;
  font-family: 'Space Grotesk', inherit;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: var(--radius-pill);
  transition: opacity 0.2s, box-shadow 0.2s;
}
button:hover, input[type=submit]:hover {
  opacity: 0.9;
  box-shadow: 0 0 24px rgba(128,99,255,0.35);
}

/* Secondary / ghost button */
button[type=button] {
  background: transparent;
  border: 1px solid rgba(202,190,255,0.18);
  color: var(--primary);
  border-radius: var(--radius-pill);
}
button[type=button]:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
}

/* ── Inputs ──────────────────────────────────────────────── */

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=number], textarea, select {
  background: var(--surface-raised);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 0.55rem 0.9rem;
  font-family: 'Manrope', inherit;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(202,190,255,0.4);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

label {
  color: var(--muted);
  font-size: 0.82rem;
  font-family: 'Space Grotesk', monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.meta { color: var(--muted); font-size: 0.88rem; }

/* ── Season badge ────────────────────────────────────────── */

.season-badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-family: 'Space Grotesk', monospace;
  letter-spacing: 0.04em;
  background: var(--green);
  color: var(--green-text);
}
.season-badge.out { background: var(--red); color: var(--red-text); }

/* ── Glassmorphism utilities ─────────────────────────────── */

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

.glow-accent { box-shadow: 0 0 32px var(--accent-dim); }
.glow-primary { box-shadow: 0 0 32px var(--primary-dim); }
.glow-magenta { box-shadow: 0 0 32px var(--magenta-dim); }
.glow-cyan { box-shadow: 0 0 32px var(--cyan-dim); }

/* ── Recipe grid & cards ─────────────────────────────────── */

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
  margin-top: 1.25rem;
}

.recipe-card {
  background: var(--surface-low);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  /* No border — tonal shift from --bg provides separation */
}
.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px var(--nebula-glow), 0 0 0 1px var(--glass-border);
}

.recipe-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.recipe-card-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--surface-mid) 0%, var(--bg) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.8rem;
  opacity: 0.4;
}

.recipe-card-body {
  padding: 1.1rem 1.3rem 1.3rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.recipe-card h3 { margin: 0; font-size: 1rem; color: var(--text); font-family: 'Noto Serif', serif; }
.recipe-card h3 a { color: var(--text); }
.recipe-card h3 a:hover { color: var(--primary); }
.recipe-card p { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* ── Recipe card data strip ──────────────────────────────── */

.recipe-card-strip {
  display: flex;
  margin-top: auto;
  padding: 0.75rem 1.3rem;
  background: var(--surface-raised);
  /* No top border — background shift provides separation */
}

.recipe-card-strip__item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}

.recipe-card-strip__item + .recipe-card-strip__item {
  padding-left: 0.75rem;
}

.recipe-card-strip__sym { color: var(--accent); font-size: 0.85rem; flex-shrink: 0; }
.recipe-card-strip__item--cost .recipe-card-strip__sym { color: var(--magenta); }
.recipe-card-strip__item--diff .recipe-card-strip__sym { color: var(--cyan); }

/* ── Recipe detail meta bar ──────────────────────────────── */

.recipe-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0.75rem 0 1.5rem;
  padding: 1rem 1.4rem;
  background: var(--surface-low);
  border-radius: var(--radius-lg);
}

.recipe-meta-bar__item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.recipe-meta-bar__sym { color: var(--accent); }
.recipe-meta-bar__item--cost .recipe-meta-bar__sym { color: var(--magenta); }
.recipe-meta-bar__item--diff .recipe-meta-bar__sym { color: var(--cyan); }

/* ── Ingredient lists ────────────────────────────────────── */

.ingredient-list { list-style: none; padding: 0; }
.ingredient-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--glass-border);
}

.ingredient-list--inline { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ingredient-list--inline li { border: none; padding: 0; }
.ingredient-list--inline li a,
.ingredient-list--inline li span {
  display: inline-block;
  padding: 0.25rem 0.85rem;
  background: var(--surface-raised);
  border-radius: var(--radius-pill);
  color: var(--primary);
  font-size: 0.82rem;
  font-family: 'Space Grotesk', monospace;
  letter-spacing: 0.02em;
  transition: background 0.15s, box-shadow 0.15s;
}
.ingredient-list--inline li a:hover {
  background: var(--primary-dim);
  box-shadow: 0 0 12px var(--primary-dim);
}
.ingredient-list--inline li a.pill--in-season {
  background: var(--green);
  color: var(--green-text);
}
.ingredient-list--inline li a.pill--out-season {
  background: var(--red);
  color: var(--red-text);
}
.ingredient-list--inline li a.pill--peak-season {
  background: rgba(201,168,76,0.18);
  color: var(--accent);
  border-color: rgba(201,168,76,0.4);
}

/* ── Home page ───────────────────────────────────────────── */

.home-hero { margin-bottom: 0.5rem; }
.home-tagline { color: var(--muted); font-size: 1.05rem; margin-top: 0; font-style: italic; }

/* ── Recipe steps ────────────────────────────────────────── */

.steps ol { padding-left: 1.2rem; }
.steps li { margin-bottom: 1rem; }

/* ── Theme switcher ──────────────────────────────────────── */

.theme-switcher { display: flex; align-items: center; gap: 0.5rem; }
.theme-switcher select {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  width: auto;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.theme-switcher button {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

/* ── Footer ──────────────────────────────────────────────── */

.site-footer {
  margin-top: 4rem;
  padding: 2.5rem 0 1.5rem;
  border-top: 1px solid var(--glass-border);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.site-footer__name {
  font-family: 'Noto Serif', Georgia, serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--primary);
  display: block;
  margin-bottom: 0.35rem;
}

.site-footer__tagline {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  font-style: italic;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  align-items: center;
}

.site-footer__links a {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.site-footer__links a:hover { color: var(--primary); }

.site-footer__copy {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: rgba(155,148,171,0.45);
  margin: 0;
  text-align: center;
}

/* ── AI chart reading card ───────────────────────────────────── */
.ai-analysis-card {
  background: var(--surface-low);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.8rem;
  margin: 2rem 0;
}
.ai-analysis-card__heading {
  color: var(--accent);
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  margin: 0 0 1rem;
}
.ai-analysis-card__body {
  color: var(--primary);
  line-height: 1.75;
  font-size: 0.97rem;
}
.ai-analysis-card__meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0.8rem 0 0;
}
.ai-analysis-card__empty {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 0.8rem;
}
.ai-analysis-card__btn {
  margin-top: 1rem;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.45rem 1.1rem;
  font-size: 0.82rem;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.2s, color 0.2s;
}
.ai-analysis-card__btn:hover {
  background: var(--accent);
  color: #0e0a1f;
}

/* ── Section landing hero ────────────────────────────────────── */
.section-landing {
  padding: 3rem 0 2rem;
  text-align: center;
}
.section-eyebrow {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.75rem;
  text-align: center;
}
.section-title {
  font-family: 'Noto Serif', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400;
  color: var(--text);
  margin: 0 0 1rem;
  line-height: 1.2;
  text-align: center;
}
.section-title em { color: var(--primary); font-style: italic; }
.section-sub {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 52ch;
  margin-top: 0;
  margin-inline: auto;
  margin-bottom: 1.75rem;
  text-align: center;
}
.section-cta {
  display: inline-block;
  padding: 0.7rem 1.75rem;
  background: var(--primary-deep);
  color: var(--text);
  border-radius: var(--radius-pill);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  transition: background 0.2s, box-shadow 0.2s;
}
.section-cta:hover {
  background: var(--primary);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(128,99,255,0.4);
}
.section-prose {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: 70ch;
  margin-top: 0;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 2rem;
  text-align: center;
}

/* ── Breadcrumb ───────────────────────────────────────────────── */
.breadcrumb {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

/* ── Category card grid ──────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.category-card {
  background: var(--surface-low);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.2s;
}
.category-card:hover {
  box-shadow: 0 8px 40px var(--nebula-glow), 0 0 0 1px var(--glass-border);
}
.category-card__name {
  font-family: 'Noto Serif', serif;
  font-size: 1.05rem;
  color: var(--text);
  margin: 0 0 0.25rem;
}
.category-card__name a { color: inherit; }
.category-card__name a:hover { color: var(--primary); }
.category-card__count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 0.65rem;
}
.category-card__desc {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.5;
  margin: 0;
}

/* ── Ingredient detail hero ───────────────────────────────────── */
/* .ing-hero and related classes are now defined in ingredient_detail.html extra_head */

/* ── Nutrition rows ───────────────────────────────────────────── */
.nutrition-rows { margin: 0; }
.nutrition-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.45rem 0;
  gap: 1rem;
}
.nutrition-row + .nutrition-row {
  border-top: 1px solid rgba(255,255,255,0.03);
}
.nutrition-row--sub .nutrition-label {
  padding-left: 1.1rem;
  font-size: 0.8rem;
  color: rgba(155,148,171,0.55);
}
.nutrition-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}
.nutrition-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  color: var(--primary);
  white-space: nowrap;
}
.nutrition-value .nu { color: var(--muted); font-size: 0.75rem; margin-left: 0.15rem; }

/* ── Chart data sections ─────────────────────────────────────── */
.chart-section {
  background: var(--surface-low);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0;
}
.chart-section__eyebrow {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}
.chart-meta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
  font-size: 0.88rem;
}
.chart-meta-grid__label {
  color: var(--muted);
  font-family: 'Space Grotesk', sans-serif;
  white-space: nowrap;
}
.chart-meta-grid__value {
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
}
.chart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin: 0;
}
.chart-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0 0.75rem 0.65rem;
  border-bottom: 1px solid var(--glass-border);
}
.chart-table th:first-child { padding-left: 0; }
.chart-table td {
  padding: 0.55rem 0.75rem;
  color: var(--text);
  vertical-align: middle;
}
.chart-table td:first-child { padding-left: 0; }
.chart-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}
.chart-table .ct-pos {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--primary);
  font-size: 0.82rem;
}
.chart-table .ct-house {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--accent);
  font-size: 0.82rem;
}
.chart-table .ct-elem-fire    { color: #ff6633; }
.chart-table .ct-elem-earth   { color: #44aa77; }
.chart-table .ct-elem-air     { color: var(--cyan); }
.chart-table .ct-elem-water   { color: #4488ff; }
.chart-table .ct-retro        { color: var(--magenta); font-style: italic; }
.chart-table .ct-body         { display: flex; align-items: center; gap: 0.4rem; }
.chart-table .ct-emoji        { font-size: 1rem; line-height: 1; }

/* ── Circular image frame (shared: recipe detail + ingredient detail) ── */

.recipe-image-frame {
  position: relative;
  width: min(320px, 90vw);
  height: min(320px, 90vw);
  margin: 0 auto;
}

@media (min-width: 768px) {
  .recipe-image-frame {
    width: min(380px, 40vw);
    height: min(380px, 40vw);
  }
}

.recipe-image-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(202,190,255,0.18);
  animation: spin-ring 22s linear infinite;
}
.recipe-image-ring--inner {
  inset: 1rem;
  border-color: rgba(201,168,76,0.08);
  animation-duration: 16s;
  animation-direction: reverse;
}

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

@keyframes drift-purple {
  from { --px: 25%; --py: 30%; }
  to   { --px: 68%; --py: 62%; }
}

@keyframes drift-gold {
  from { --gx: 72%; --gy: 62%; }
  to   { --gx: 30%; --gy: 38%; }
}

.recipe-image-circle {
  position: absolute;
  inset: 2rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(74,73,77,0.35);
  box-shadow: 0 0 80px rgba(71,23,202,0.2);
}
.recipe-image-circle img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.recipe-image-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--surface-mid) 0%, var(--bg) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--muted);
  opacity: 0.35;
}

/* ── Recipe form components ──────────────────────────────────── */

.step-row {
  border: 1px solid var(--border);
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Ghost button with accent colour — used on import-from-URL link */
.btn-ghost-accent {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 0.4rem 0.9rem;
  text-decoration: none;
  border-radius: 4px;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}
.btn-ghost-accent:hover { background: var(--accent-dim); color: var(--accent-hover); }

/* ── Ingredient import review ────────────────────────────────── */

/* The global table rule already sets width:100% and border-collapse:collapse.
   These overrides tune padding and colours for the review table specifically. */
.ing-review-table thead tr { border-bottom: 1px solid var(--border); }
.ing-review-table th { color: var(--accent); padding: 0.5rem 0.75rem; }
.ing-review-table tbody tr { border-bottom: 1px solid var(--border); vertical-align: top; }
.ing-review-table td { padding: 0.6rem 0.75rem; }
.ing-review-table td:first-child { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.ing-review-table td:nth-child(2) { font-size: 0.85rem; max-width: 260px; }

.ing-search-panel { margin-top: 0.4rem; max-width: 340px; }
.ing-search-results {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.ing-create-hint { margin-top: 0.5rem; font-size: 0.8rem; color: var(--muted); }

.ing-search-results-group { margin-top: 0.4rem; }
.ing-search-results-group strong {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.ing-search-result {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface-raised);
  color: var(--text);
  border: none;
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  margin-bottom: 0.15rem;
  cursor: pointer;
  font-size: 0.82rem;
}
.ing-search-result:hover { background: var(--surface-high); }
.ing-search-result .badge {
  font-size: 0.65rem;
  padding: 0.1em 0.4em;
  border-radius: 3px;
  margin-left: 0.4em;
  vertical-align: middle;
}
.ing-search-result .badge-mw  { background: var(--primary-deep); color: #fff; }
.ing-search-result .badge-ing { background: var(--cyan); color: #000; }

/* ── Recipe detail page extras ───────────────────────────────── */

.recipe-description {
  color: var(--muted);
  font-size: 1rem;
  max-width: 38rem;
  line-height: 1.75;
  margin: 0 0 1.5rem;
}

.step-title {
  font-size: 0.7rem;
  color: var(--primary);
  display: block;
  margin-bottom: 0.25rem;
  font-family: 'Space Grotesk', monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Flash messages ─────────────────────────────────────────── */

.flash-messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.flash-message {
  padding: 0.65rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--surface-low);
  border-left: 3px solid var(--cyan);
  border-radius: 0 0.5rem 0.5rem 0;
  font-size: 0.9rem;
}
.flash-message--warning { border-left-color: var(--magenta); }

/* ── Narrow form wrapper (login, register, chart form) ───────── */
.form-narrow { max-width: 420px; }

/* ── 3D chart widget (shared: home, profile, charts page) ───── */

.chart-panel {
  background: var(--surface-low);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1.5rem 0;
  padding: 1rem;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 1.5rem 0;
}


.chart-controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-width: 60%;
  justify-content: flex-end;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  display: none;
  background: rgba(19,19,24,0.95);
  border: 1px solid #47464d;
  color: #c9c5cd;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  min-width: 140px;
  z-index: 20;
  line-height: 1.7;
}

/* ── Utilities ───────────────────────────────────────────────── */

/* Display */
.hidden       { display: none; }
.d-inline     { display: inline; }

/* Flex helpers */
.flex-col     { display: flex; flex-direction: column; }
.flex-row     { display: flex; align-items: center; }
.gap-xs       { gap: 0.2rem; }
.gap-sm       { gap: 0.4rem; }
.gap-md       { gap: 1rem; }
.gap-lg       { gap: 1.5rem; }

/* Spacing — margin */
.mt-xs        { margin-top: 0.2rem; }
.mt-sm        { margin-top: 0.4rem; }
.mt-md        { margin-top: 0.5rem; }
.mt-lg        { margin-top: 1.5rem; }
.mb-xs        { margin-bottom: 0.25rem; }
.mb-sm        { margin-bottom: 0.4rem; }
.mb-md        { margin-bottom: 0.5rem; }
.mb-lg        { margin-bottom: 1.5rem; }
.ml-md        { margin-left: 1rem; }

/* Sizing */
.w-full       { width: 100%; box-sizing: border-box; }
.max-w-select { max-width: 340px; }

/* Typography */
.text-xs      { font-size: 0.75rem; }
.text-sm      { font-size: 0.8rem; }
.text-md      { font-size: 0.85rem; }
.text-muted   { color: var(--muted); }
.text-accent  { color: var(--accent); }
.text-primary { color: var(--primary); }
.text-error   { color: var(--red-text); font-size: 0.875rem; }
.lh-relaxed   { line-height: 1.75; }
.nowrap       { white-space: nowrap; }

/* Material Symbols icon utility */
.icon {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-size: inherit;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}
.icon-sm       { font-size: 0.85rem; }
.icon-md       { font-size: 0.95rem; }
.icon-unfilled { font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20; }
