/* ============================================================
   Forte Recipes — Main Stylesheet
   "Healthy cooking, made simple."
   ============================================================ */

/* ===================== 1. CSS VARIABLES ===================== */

:root {
  /* Brand Colors */
  --color-green: #1B6B3A;
  --color-green-light: #2a8a4e;
  --color-green-dark: #145a2e;
  --color-gold: #E0A020;
  --color-gold-light: #f0c050;
  --color-offwhite: #F5F2EC;
  --color-near-black: #1a1a18;

  /* Semantic Colors */
  --color-bg: #F5F2EC;
  --color-surface: #ffffff;
  --color-text: #1a1a18;
  --color-text-secondary: #6b6b68;
  --color-text-tertiary: #9c9c98;
  --color-border: #e8e4dc;
  --color-border-light: #f0ece4;
  --color-danger: #C0392B;
  --color-danger-light: #e74c3c;

  /* Health Score Colors */
  --health-a: #1B6B3A;
  --health-b: #4CAF50;
  --health-c: #E0A020;
  --health-d: #E07820;
  --health-f: #C0392B;

  /* Macro Wheel Colors */
  --macro-protein: #4A90D9;
  --macro-carbs: #E0A020;
  --macro-fat: #E07855;

  /* Typography */
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Lora', Georgia, serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(27,107,58,0.06);
  --shadow-md: 0 4px 20px rgba(27,107,58,0.08);
  --shadow-lg: 0 8px 32px rgba(27,107,58,0.12);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --sidebar-width: 260px;
  --right-panel-width: 300px;
  --max-width: 1440px;
  --header-height: 60px;
  --bottom-nav-height: 64px;
}

/* Dark Mode */
[data-theme="dark"] {
  --color-bg: #141413;
  --color-surface: #1e1e1c;
  --color-text: #eae8e2;
  --color-text-secondary: #a8a8a4;
  --color-text-tertiary: #6b6b68;
  --color-border: #2a2a28;
  --color-border-light: #222220;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

/* ===================== 2. RESET ===================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

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

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol {
  list-style: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ===================== 3. TYPOGRAPHY ===================== */

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.3;
}

h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.4;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { margin-bottom: 0.75em; }
p:last-child { margin-bottom: 0; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }

/* ===================== 4. LINEN TEXTURE ===================== */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23d4c8b0'/%3E%3Crect width='1' height='1' x='0' y='0' fill='%23c8bc9e' fill-opacity='0.5'/%3E%3Crect width='1' height='1' x='2' y='2' fill='%23c8bc9e' fill-opacity='0.3'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

[data-theme="dark"] body::before {
  opacity: 0.02;
}

/* ===================== 5. LAYOUT ===================== */

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--right-panel-width);
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

@media (min-width: 1441px) {
  .app-layout {
    max-width: none;
    grid-template-columns: var(--sidebar-width) 1fr var(--right-panel-width);
  }
  .app-layout--no-right-panel {
    grid-template-columns: var(--sidebar-width) 1fr;
  }
}

.app-layout--no-right-panel {
  grid-template-columns: var(--sidebar-width) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: var(--space-lg);
  padding-top: calc(var(--space-lg) + 18px);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  background: var(--color-bg);
  z-index: 10;
}

.main-content {
  min-height: 100vh;
  padding: var(--space-lg);
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.right-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: var(--space-lg);
  border-left: 1px solid var(--color-border);
  overflow-y: auto;
  background: var(--color-bg);
}

/* Auth pages — no sidebar layout */
.auth-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-lg);
  position: relative;
  z-index: 1;
}

/* Static pages — single column centered */
.static-layout {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
  position: relative;
  z-index: 1;
}

/* ===================== 6. NAVIGATION ===================== */

/* Sidebar Nav */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
  padding-left: var(--space-md);
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  color: var(--color-green);
}

.sidebar-logo .logo-text {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-green);
}

.sidebar-logo-img {
  height: 36px;
  width: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.nav-link.active {
  background: rgba(27, 107, 58, 0.1);
  color: var(--color-green);
  font-weight: 600;
}

.nav-link svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sidebar-footer:empty {
  display: none;
}

.sidebar-nav {
  padding-bottom: var(--space-md);
}

.sidebar-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-sm) 0;
}

/* Secondary links under Profile / Settings — YouTube-style fineprint */
.sidebar-fineprint {
  display: flex;
  flex-wrap: wrap;
  column-gap: 10px;
  row-gap: 6px;
  padding: var(--space-sm) var(--space-md) 0;
}

.sidebar-fineprint a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.sidebar-fineprint a:hover {
  color: var(--color-green);
}

/* Top Header (mobile) */
.top-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--space-md);
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.top-header .logo-text {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-green);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.top-header-logo-img {
  height: 28px;
  width: auto;
}

.top-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.top-header-actions button {
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
}

/* Bottom Nav (mobile) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-sm);
  color: var(--color-text-tertiary);
  font-size: 0.65rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.bottom-nav-link.active {
  color: var(--color-green);
}

.bottom-nav-link svg {
  width: 24px;
  height: 24px;
}

/* ===================== 7. RECIPE CARD ===================== */

.recipe-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.recipe-card__image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 11;
  background: var(--color-border-light);
}

.recipe-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}

.recipe-card:hover .recipe-card__image {
  transform: scale(1.04);
}

.recipe-card__image-link {
  display: block;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.recipe-card__title-link {
  color: inherit;
  text-decoration: none;
}

.recipe-card__title-link:hover {
  text-decoration: underline;
}

.recipe-card__image-actions {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  display: flex;
  gap: var(--space-xs);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.recipe-card:hover .recipe-card__image-actions {
  opacity: 1;
}

.recipe-card__image-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-full);
  color: var(--color-text);
  transition: all var(--transition-fast);
}

.recipe-card__image-btn:hover {
  background: #fff;
  transform: scale(1.08);
}

.recipe-card__image-btn.liked {
  color: #e74c3c;
  background: rgba(231,76,60,0.12);
}

.recipe-card__image-btn.saved {
  color: var(--color-gold);
  background: rgba(255,255,255,0.9);
}

/* When saved, the button shows a filled check-circle. We fill the inner
   circle with gold and keep the check stroke white so it reads like
   Spotify's liked state but in the Forte brand color. */
.recipe-card__image-btn.bookmark-btn.saved svg circle {
  fill: var(--color-gold);
  stroke: var(--color-gold);
}
.recipe-card__image-btn.bookmark-btn.saved svg polyline,
.recipe-card__image-btn.bookmark-btn.saved svg line {
  stroke: #fff;
}

.recipe-card__image-btn svg {
  width: 18px;
  height: 18px;
}

.recipe-card__badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
}

.recipe-card__body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recipe-card__author {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.recipe-card__avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.recipe-card__author-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.recipe-card__display-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-card__username {
  font-size: 12px;
  color: var(--color-text-tertiary);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-card__title {
  font-family: var(--font-serif);
  font-size: 17.5px;
  font-weight: 500;
  margin: 0;
  line-height: 1.3;
  color: var(--color-text);
  letter-spacing: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.recipe-card__title-link {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.recipe-card__flag {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.recipe-card__title a {
  transition: color var(--transition-fast);
}

.recipe-card__title a:hover {
  color: var(--color-green);
}

/* Time pill — bottom-left over the image */
.recipe-card__time-pill {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(4px);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.recipe-card__time-pill svg {
  width: 12px;
  height: 12px;
}

/* Stats row — 3 columns with vertical separators */
.recipe-card__stats {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-light);
  margin-top: auto;
}

.recipe-card__stat-col {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  flex-shrink: 0;
}

.recipe-card__stat-col--cal {
  align-items: center;
}

.recipe-card__stat-col--cal .recipe-card__stat-small {
  text-align: center;
}

.recipe-card__stat-big {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  font-feature-settings: 'tnum' 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.05;
}

.recipe-card__stat-big svg {
  width: 14px;
  height: 14px;
  fill: var(--color-gold);
  color: var(--color-gold);
}

.recipe-card__stat-small {
  font-size: 11px;
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

.recipe-card__stat-sep {
  width: 1px;
  height: 28px;
  background: var(--color-border);
  flex-shrink: 0;
}

.recipe-card__stat-author {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.recipe-card__stat-author .recipe-card__avatar { width: 26px; height: 26px; }
.recipe-card__stat-author .recipe-card__display-name { font-size: 12px; }
.recipe-card__stat-author .recipe-card__username { font-size: 11px; }

.recipe-card__stat-author-placeholder { flex: 1; }

/* Macro column in the card footer: a grams readout (one macro at a time) that
   the user clicks to cycle protein → carbs → fat. Styled as a stat column;
   the button chrome is reset so it matches the neighboring columns. */
.recipe-card__macro {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.recipe-card__macro .recipe-card__stat-small { text-transform: capitalize; }

.recipe-card__macro-dots {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.recipe-card__macro-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  opacity: 0.25;
  transition: opacity 0.15s ease;
}
.recipe-card__macro-dot[data-dot="protein"] { background: var(--macro-protein); }
.recipe-card__macro-dot[data-dot="carbs"]   { background: var(--macro-carbs); }
.recipe-card__macro-dot[data-dot="fat"]     { background: var(--macro-fat); }
.recipe-card__macro-dot.active { opacity: 1; }

.recipe-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-sm);
  color: var(--color-text-secondary);
  font-size: 0.8rem;
}

.recipe-card__meta svg {
  width: 14px;
  height: 14px;
  margin-right: 3px;
  vertical-align: -2px;
}

.recipe-card__meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.recipe-card__rating {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--color-gold);
  font-weight: 600;
  font-size: 0.8rem;
}

.recipe-card__rating svg {
  width: 14px;
  height: 14px;
}

.recipe-card__rating .review-count {
  color: var(--color-text-tertiary);
  font-weight: 400;
}

/* Expandable section */
.recipe-card__expand-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--space-sm) 0;
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
  gap: var(--space-xs);
  border-top: 1px solid var(--color-border-light);
  transition: color var(--transition-fast);
  margin-top: auto;
}

.recipe-card__expand-toggle:hover {
  color: var(--color-text-secondary);
}

.recipe-card__expand-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.recipe-card__expand-toggle.expanded svg {
  transform: rotate(180deg);
}

.recipe-card__expanded {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
  padding: 0 var(--space-md);
}

.recipe-card__expanded.open {
  max-height: 600px;
  padding: var(--space-md);
  padding-top: 0;
}

.recipe-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.recipe-card__section-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
}

.recipe-card__allergens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.allergen-tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: #eaf7ec;
  color: #27ae60;
  border: 1px solid #b8e6c4;
}

.allergen-tag--active {
  background: #fff3f0;
  color: #c0392b;
  border-color: #f5c6c0;
}

.recipe-card__description {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

.recipe-card__macros-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.recipe-card__balance-score {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.recipe-card__balance-score strong {
  font-weight: 700;
}

.recipe-card__balance-score strong.balance--a { color: #1b7a3d; }
.recipe-card__balance-score strong.balance--b { color: #5ca848; }
.recipe-card__balance-score strong.balance--c { color: #c5a217; }
.recipe-card__balance-score strong.balance--d { color: #d4771a; }
.recipe-card__balance-score strong.balance--f { color: #c0392b; }
.recipe-card__balance-score strong.balance--unrated { color: var(--color-text-tertiary); }

.recipe-card__nutrition-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: var(--space-xs) var(--space-md);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.8rem;
  border: 1px solid var(--color-border-light);
  transition: all var(--transition-fast);
  margin-bottom: var(--space-md);
}

.recipe-card__nutrition-btn:hover {
  background: var(--color-border-light);
  color: var(--color-text-primary);
}

.recipe-card__cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-green);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.recipe-card__cta:hover {
  background: var(--color-green-light);
  transform: translateY(-1px);
}

/* Tag chips */
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.tag:hover {
  background: rgba(27, 107, 58, 0.1);
  color: var(--color-green);
}

/* ===================== 8. HEALTH SCORE BADGE ===================== */

.health-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border: 2.5px solid currentColor;
}

.health-badge--small {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
}

.health-badge--A\+, .health-badge--A, .health-badge--A- { color: var(--health-a); }
.health-badge--B\+, .health-badge--B, .health-badge--B- { color: var(--health-b); }
.health-badge--C\+, .health-badge--C, .health-badge--C- { color: var(--health-c); }
.health-badge--D\+, .health-badge--D, .health-badge--D- { color: var(--health-d); }
.health-badge--F { color: var(--health-f); }
.health-badge--unrated {
  color: var(--color-text-tertiary);
  font-size: 0.5rem;
  letter-spacing: 0;
}

/* ===================== 9. MACRO LEGEND ===================== */

.macro-legend {
  display: flex;
  gap: var(--space-md);
  font-size: 0.75rem;
}

.macro-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.macro-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.macro-legend-dot--protein { background: var(--macro-protein); }
.macro-legend-dot--carbs { background: var(--macro-carbs); }
.macro-legend-dot--fat { background: var(--macro-fat); }

/* ===================== 10. BUTTONS ===================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--color-green);
  color: white;
}

.btn--primary:hover {
  background: var(--color-green-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn--secondary {
  background: transparent;
  color: var(--color-green);
  border-color: var(--color-green);
}

.btn--secondary:hover {
  background: rgba(27, 107, 58, 0.08);
}

.btn--gold {
  background: var(--color-gold);
  color: var(--color-near-black);
}

.btn--gold:hover {
  background: var(--color-gold-light);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn--ghost:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.btn--danger {
  background: var(--color-danger);
  color: white;
}

.btn--danger:hover {
  background: var(--color-danger-light);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn--lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn--block {
  width: 100%;
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* Social auth buttons */
.btn--google {
  background: #fff;
  color: #1a1a18;
  border: 1px solid var(--color-border);
  font-weight: 500;
}

.btn--google:hover {
  background: #f8f8f8;
  box-shadow: var(--shadow-sm);
}

.btn--apple {
  background: #000;
  color: #fff;
  font-weight: 500;
}

.btn--apple:hover {
  background: #222;
}

/* ===================== 11. FORMS ===================== */

.form-group {
  margin-bottom: var(--space-md);
}

/* Paired hrs + mins time input */
.time-input-group {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.time-input-group .time-input {
  width: 0;
  flex: 1 1 0;
  min-width: 0;
  padding-left: var(--space-sm);
  padding-right: var(--space-sm);
  text-align: center;
  -moz-appearance: textfield;
}
.time-input-group .time-input::-webkit-outer-spin-button,
.time-input-group .time-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.time-input__unit {
  color: var(--text-secondary);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px rgba(27, 107, 58, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-tertiary);
}

.form-textarea {
  resize: none;
  min-height: 100px;
  overflow: hidden;
}

textarea {
  resize: none;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b68' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-input--error {
  border-color: var(--color-danger);
}

.form-error {
  color: var(--color-danger);
  font-size: 0.8rem;
  margin-top: var(--space-xs);
}

.form-hint {
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
  margin-top: var(--space-xs);
}

/* Upload box */
.upload-box {
  position: relative;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md, 12px);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
  aspect-ratio: 4 / 3;
}
.upload-box:hover,
.upload-box--dragover {
  border-color: var(--color-primary);
}
.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-lg) var(--space-md);
  color: var(--color-text-tertiary);
  height: 100%;
}
.upload-placeholder p {
  margin: 0;
  font-size: 0.85rem;
}
.upload-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.upload-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.upload-remove-btn:hover {
  background: rgba(0,0,0,0.8);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-green);
  cursor: pointer;
}

.form-checkbox a {
  color: #2563eb;
  text-decoration: underline;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
}

/* Multiselect (co-creators) */
.multiselect {
  position: relative;
}
.multiselect-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: var(--color-surface);
}
.multiselect-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 20;
  padding: var(--space-sm);
  max-height: 280px;
  overflow-y: auto;
}
.multiselect-search {
  margin-bottom: var(--space-sm);
}
.multiselect-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.multiselect-option {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}
.multiselect-option:hover {
  background: var(--color-bg, #f5f5f5);
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.toggle.active {
  background: var(--color-green);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast);
}

.toggle.active::after {
  transform: translateX(20px);
}

/* ===================== 12. AUTH PAGES ===================== */

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-header .logo-text {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-green);
  margin-bottom: var(--space-sm);
}

.auth-header p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-social {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.auth-footer a {
  color: var(--color-green);
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-layout ~ .toast {
  bottom: auto;
  top: 24px;
  left: auto;
  right: 24px;
  max-width: 380px;
  transform: translateY(-120%);
}

/* ===================== 14. TOAST / SIGNUP NUDGE ===================== */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  z-index: 1000;
  transform: translateY(120%);
  opacity: 0;
  transition: all var(--transition-normal);
  max-width: 320px;
  border-left: 4px solid var(--color-green);
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast__message {
  flex: 1;
  font-size: 0.875rem;
}

.toast__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.toast__close {
  color: var(--color-text-tertiary);
  padding: 4px;
  font-size: 1.2rem;
  line-height: 1;
}

.toast__close:hover {
  color: var(--color-text);
}

/* ===================== 15. SKELETON LOADERS ===================== */

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(90deg,
    var(--color-border-light) 25%,
    var(--color-surface) 37%,
    var(--color-border-light) 63%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.skeleton-text {
  height: 14px;
  margin: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
}

.skeleton-text--title {
  height: 20px;
  width: 70%;
}

.skeleton-text--short {
  width: 40%;
}

.skeleton-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.skeleton-hero {
  border-radius: var(--radius-xl);
  overflow: hidden;
  height: 260px;
  margin-bottom: var(--space-xl);
}

.skeleton-section-title {
  height: 24px;
  width: 160px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}

/* ===================== 16. PAGE-SPECIFIC ===================== */

/* -- Sticky Search Bar (shared across pages) -- */
.home-search {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) 0;
}

.home-search .search-input-wrap {
  flex: 1;
  min-width: 0;
  margin-right: var(--space-md);
}

.home-search__globe {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-green);
  flex-shrink: 0;
  margin-left: auto;
  transition: color var(--transition-fast);
}

.home-search__globe svg {
  width: 40px;
  height: 40px;
}

.home-search__globe:hover {
  color: var(--color-gold);
}

/* Global New Recipe FAB */
.new-recipe-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 51px;
  height: 51px;
  border: 2.5px solid var(--color-green);
  border-radius: var(--radius-md);
  color: var(--color-green);
  background: transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.new-recipe-fab svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.75;
}

.new-recipe-fab:hover {
  color: var(--color-gold);
  border-color: var(--color-gold);
}

.main-content {
  position: relative;
}

/* -- Hero Banner -- */
.hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-xl);
  min-height: 260px;
}

.hero__track {
  display: flex;
  transition: transform 0.5s ease;
  will-change: transform;
}

.hero__slide {
  position: relative;
  /* Lock each slide to exactly the hero's content width — prevents
     content-driven widening that throws off translateX alignment. */
  flex: 0 0 100%;
  width: 100%;
  min-height: 260px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-green);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  padding: 0;
}

.hero:hover .hero__arrow { opacity: 1; }
.hero__arrow svg { width: 18px; height: 18px; }
.hero__arrow--prev { left: 12px; }
.hero__arrow--next { right: 12px; }
.hero__arrow:hover { background: white; box-shadow: var(--shadow-sm); }

.hero__dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: var(--space-sm);
}

.hero__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.hero__dot.active { background: white; width: 24px; }
.hero__dot:hover { background: rgba(255, 255, 255, 0.8); }

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(27, 107, 58, 0.85) 0%,
    rgba(27, 107, 58, 0.6) 50%,
    rgba(224, 160, 32, 0.4) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: var(--space-xl);
  color: white;
}

.hero__tagline {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: var(--space-xs);
}

.hero__title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.hero__subtitle {
  font-size: 0.95rem;
  opacity: 0.95;
  margin-bottom: var(--space-md);
  max-width: 560px;
  line-height: 1.4;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: white;
  color: var(--color-green);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.hero__cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* -- Category Chips -- */
.category-chips {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-xl);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-chips::-webkit-scrollbar { display: none; }

.category-chip {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.category-chip:hover {
  border-color: var(--color-green);
  color: var(--color-green);
}

.category-chip.active {
  background: var(--color-green);
  border-color: var(--color-green);
  color: white;
}

/* -- Feed -- */
/* -- Feed Sections -- */
.feed-section {
  margin-bottom: 4rem;
}

.feed-section__header {
  margin-bottom: var(--space-lg);
  text-align: center;
}

.feed-section__title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

/* -- Feed Grid (YouTube-style) -- */
.feed-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.feed-container .empty-state {
  grid-column: 1 / -1;
}

/* -- Discover Grid -- */
.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(280px, calc((100% - 2 * var(--space-lg)) / 3)), 1fr));
  gap: var(--space-lg);
}

.discover-header {
  margin-bottom: var(--space-xl);
}

.discover-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

/* -- Staff Picks Horizontal Scroll -- */
.staff-picks {
  margin-bottom: var(--space-xl);
}

.staff-picks__title {
  margin-bottom: var(--space-md);
}

.staff-picks__scroll {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  scrollbar-width: none;
}

.staff-picks__scroll::-webkit-scrollbar { display: none; }

.staff-picks__scroll .recipe-card {
  min-width: 280px;
  max-width: 280px;
}

/* -- For You (Tinder-style) -- */
/* ───────── For You — editorial scroll feed ───────── */
.foryou-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: calc(100vh - 2 * var(--space-lg));
  max-height: calc(100vh - 2 * var(--space-lg));
  padding: 0;
  position: relative;
  user-select: none;
  overflow: hidden;
}

.foryou-stage {
  position: relative;
  width: 620px;
  max-width: 100%;
  height: min(720px, 100%);
}

/* Floating back-to-home pill in the For You top-left. */
.foryou-back {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-green);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.foryou-back:hover {
  background: white;
  transform: translateX(-2px);
  box-shadow: var(--shadow-md);
}

.foryou-back svg {
  width: 16px;
  height: 16px;
}

/* Clip box: only one card visible at a time. */
.foryou-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 22px;
}

/* Vertical track that slides up/down to reveal cards. */
.foryou-track {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 22px;
  transition: transform 0.55s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}

.foryou-card {
  width: 100%;
  height: var(--foryou-card-h, 720px);
  flex-shrink: 0;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  background: var(--color-surface);
  box-shadow: 0 18px 50px rgba(27,107,58,0.16), 0 0 0 1px var(--color-border-light);
  display: flex;
  flex-direction: column;
}

/* Image */
.foryou-card__image-wrap {
  position: relative;
  flex: 0 0 56%;
  overflow: hidden;
}

.foryou-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.foryou-card__image-pill {
  position: absolute;
  background: rgba(255,255,255,0.96);
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-text);
}

.foryou-card__image-pill--cuisine {
  top: 14px;
  left: 14px;
}

.foryou-card__image-pill--time {
  bottom: 14px;
  right: 14px;
}

.foryou-card__image-pill svg {
  width: 12px;
  height: 12px;
}

.foryou-card__flag {
  font-size: 0.85rem;
  line-height: 1;
}

/* Body */
.foryou-card__body {
  flex: 1;
  padding: 18px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.foryou-card__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: pretty;
}

/* Why callout */
.foryou-card__why {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(224,160,32,0.08);
  border: 0.5px solid rgba(224,160,32,0.25);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--color-text);
}

.foryou-card__why-icon {
  width: 14px;
  height: 14px;
  color: var(--color-gold);
  flex-shrink: 0;
  margin-top: 2px;
}

.foryou-card__why-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 2px;
}

.foryou-card__why-text {
  text-wrap: pretty;
}

/* Macros strip */
.foryou-card__macros {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--color-offwhite);
  border: 1px solid var(--color-border-light);
  border-radius: 10px;
  padding: 10px 0;
}

.foryou-card__macro {
  text-align: center;
  border-right: 1px solid var(--color-border-light);
}

.foryou-card__macro:last-child {
  border-right: none;
}

.foryou-card__macro-big {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
  color: var(--color-text);
}

.foryou-card__macro-small {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-top: 3px;
}

/* Author + rating — 3-col grid keeps the rating dead-center on the card
   regardless of how wide the author block grows. */
.foryou-card__meta-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: 4px;
  gap: 8px;
}

.foryou-card__meta-row > .foryou-card__rating {
  justify-self: center;
}

.foryou-card__author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.foryou-card__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.foryou-card__display-name {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.15;
}

.foryou-card__username {
  font-size: 0.66rem;
  color: var(--color-text-tertiary);
}

.foryou-card__rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.foryou-card__rating-star {
  color: var(--color-gold);
}

.foryou-card__rating-count {
  font-size: 0.66rem;
  color: var(--color-text-tertiary);
  font-weight: 400;
}

/* CTA row */
.foryou-card__cta-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
  padding-bottom: 6px;
}

.foryou-card__save {
  flex: 1;
  padding: 11px 18px;
  border-radius: 11px;
  background: var(--color-gold);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  border: 2px solid var(--color-gold);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 4px 14px rgba(224,160,32,0.35);
  transition: background var(--transition-fast), color var(--transition-fast),
              box-shadow var(--transition-fast), transform var(--transition-fast);
}

.foryou-card__save svg {
  width: 16px;
  height: 16px;
}

.foryou-card__save:hover {
  filter: brightness(0.96);
}

.foryou-card__save.saved {
  background: var(--color-surface);
  color: var(--color-gold);
  box-shadow: none;
}

.foryou-card__save.saved:hover {
  filter: none;
  background: rgba(224, 160, 32, 0.08);
}

.foryou-card__recipe-link {
  padding: 11px 14px;
  border-radius: 11px;
  background: transparent;
  color: var(--color-green);
  font-weight: 600;
  font-size: 0.78rem;
  border: 1.5px solid var(--color-green);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.foryou-card__recipe-link:hover {
  background: var(--color-green);
  color: #fff;
}

.foryou-card__recipe-link svg {
  width: 14px;
  height: 14px;
}

/* Up/down nav arrows on the right */
.foryou-nav {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 6;
}

.foryou-nav-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), color var(--transition-fast),
              border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.foryou-nav-arrow svg {
  width: 18px;
  height: 18px;
}

.foryou-nav-arrow:hover:not(:disabled) {
  color: var(--color-green);
  border-color: var(--color-green);
  box-shadow: var(--shadow-md);
  transform: scale(1.06);
}

.foryou-nav-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Skeleton */
.foryou-card-skeleton {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

/* Empty state */
.foryou-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  background: var(--color-surface);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}

.foryou-empty h3 {
  font-family: var(--font-serif);
  margin-bottom: var(--space-sm);
}

.foryou-empty p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

/* Responsive */
@media (max-width: 880px) {
  .foryou-stage {
    width: 100%;
    max-width: 520px;
    height: min(680px, calc(100vh - 140px));
  }
  .foryou-card {
    height: 100%;
  }
  .foryou-nav {
    right: 8px;
  }
}

@media (max-width: 600px) {
  .foryou-stage {
    height: calc(100vh - var(--header-height) - var(--bottom-nav-height) - 40px);
  }
  .foryou-card__title {
    font-size: 1.18rem;
  }
  .foryou-card__body {
    padding: 16px 18px 18px;
    gap: 10px;
  }
  .foryou-nav-arrow {
    width: 38px;
    height: 38px;
  }
  .foryou-nav-arrow svg {
    width: 16px;
    height: 16px;
  }
}

/* -- Explore Map -- */
.explore-header {
  margin-bottom: var(--space-lg);
}

.explore-header h1 {
  margin-bottom: var(--space-xs);
}

.explore-map {
  position: relative;
  width: 100%;
  background: #7bafd4;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.explore-map svg {
  width: 100%;
  height: auto;
  display: block;
}

.explore-map__land {
  fill: #e0e0e0;
  stroke: #555;
  stroke-width: 0.5;
}

.explore-map__country {
  stroke: #555;
  stroke-width: 0.5;
  cursor: pointer;
  transition: fill var(--transition-fast);
}

.explore-map__country--popular {
  fill: var(--color-gold);
}

.explore-map__country--featured {
  fill: var(--color-green);
}

.explore-map__country--none {
  fill: #e0e0e0;
}

.explore-map__country--popular:hover {
  fill: #e6b800;
}

.explore-map__country--featured:hover {
  fill: #2a9d5c;
}

.explore-map__country--none:hover {
  fill: #ccc;
}

.explore-map__tooltip {
  position: absolute;
  background: var(--color-text);
  color: var(--color-surface);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  white-space: nowrap;
}

.explore-map__tooltip.visible {
  opacity: 1;
}

.explore-legend {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.explore-legend__entry {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.explore-legend__swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-xs);
}

.explore-legend__swatch--popular {
  background: var(--color-gold);
}

.explore-legend__swatch--featured {
  background: var(--color-green);
}

.explore-legend__swatch--none {
  background: #e0e0e0;
}

/* -- Search -- */
.search-header {
  margin-bottom: var(--space-xl);
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--color-text-tertiary);
}

.search-input-wrap .form-input {
  padding-left: 44px;
  font-size: 1.1rem;
  padding-top: 14px;
  padding-bottom: 14px;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(280px, calc((100% - 2 * var(--space-lg)) / 3)), 1fr));
  gap: var(--space-lg);
}

.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--color-text-secondary);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-md);
}

.empty-state h3 {
  margin-bottom: var(--space-sm);
}

/* -- User result card -- */
.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.user-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.user-card__info {
  flex: 1;
}

.user-card__name {
  font-weight: 600;
}

.user-card__username {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* -- Profile -- */
.profile-header {
  position: relative;
  margin-bottom: var(--space-lg);
  padding: var(--space-lg) 0;
}

.profile-info {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xl);
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--color-border);
  flex-shrink: 0;
}

.profile-meta {
  flex: 1;
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.profile-name {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
}

.profile-username {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-top: 2px;
}

.profile-stats {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  color: var(--color-text);
}

.profile-stat {
  color: var(--color-text-secondary);
}

.profile-stat .value {
  font-weight: 700;
  color: var(--color-text);
}

.profile-bio {
  color: var(--color-text);
  font-size: 0.9rem;
  margin-top: var(--space-sm);
  line-height: 1.4;
  max-width: 60ch;
  overflow-wrap: anywhere;
}

.profile-joined {
  margin-top: 2px;
}

.profile-socials {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

.profile-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-surface, #f5f5f5);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  transition: all var(--transition-fast);
}

.profile-social:hover {
  background: var(--color-green, #5a8a3a);
  border-color: var(--color-green, #5a8a3a);
  color: #fff;
}

.form-helper {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin: 4px 0 0 0;
  text-align: right;
}

.form-helper--warn {
  color: var(--color-yellow, #b87b00);
}

.form-helper--max {
  color: var(--color-danger, #dc2626);
}

.profile-tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.profile-tab {
  padding: var(--space-sm) var(--space-md);
  font-weight: 500;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.profile-tab:hover {
  color: var(--color-text);
}

.profile-tab.active {
  color: var(--color-green);
  border-bottom-color: var(--color-green);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

/* -- Profile content sections -- */
.profile-section {
  margin-top: var(--space-xl);
}

.profile-section__title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-md) 0;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

/* -- Contribution row cards (review/comment feed) -- */
.profile-contributions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.profile-contrib-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
}

.profile-contrib-card__thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm, 6px);
  object-fit: cover;
  background: var(--color-border);
  flex-shrink: 0;
}

.profile-contrib-card__thumb--placeholder {
  background: var(--color-border);
}

.profile-contrib-card__body {
  flex: 1;
  min-width: 0;
}

.profile-contrib-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: 4px;
}

.profile-contrib-card__recipe {
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-contrib-card__recipe:hover {
  color: var(--color-green);
}

.profile-contrib-card__date {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.profile-contrib-card__stars {
  display: inline-flex;
  gap: 2px;
  color: var(--color-yellow, #f59e0b);
  margin-bottom: 4px;
}

.profile-contrib-card__kind {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.profile-contrib-card__text {
  color: var(--color-text);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
  overflow-wrap: anywhere;
}

/* -- Draft cards -- */
.draft-badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  background: var(--color-yellow, #f59e0b);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.draft-progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.draft-progress__bar {
  flex: 1;
  height: 6px;
  background: var(--color-surface-alt, #2a2a3e);
  border-radius: 3px;
  overflow: hidden;
}

.draft-progress__fill {
  height: 100%;
  background: var(--color-green);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* -- Profile review cards -- */
.profile-reviews-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 700px;
}

.profile-review-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: border-color var(--transition-fast);
}

.profile-review-card:hover {
  border-color: var(--color-green);
}

.profile-review-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.profile-review-card__recipe-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.profile-review-card__info {
  flex: 1;
  min-width: 0;
}

.profile-review-card__recipe-title {
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-review-card__recipe-title:hover {
  color: var(--color-green);
}

.profile-review-card__stars {
  display: flex;
  gap: 2px;
  margin-top: 2px;
}

.review-star {
  width: 14px;
  height: 14px;
  color: var(--color-text-secondary);
}

.review-star--filled {
  color: var(--color-yellow, #f59e0b);
}

.profile-review-card__date {
  flex-shrink: 0;
  white-space: nowrap;
}

.profile-review-card__text {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.profile-reviews-more {
  margin-top: var(--space-lg);
  text-align: center;
}

/* -- Health Wizard -- */
.health-wizard {
  max-width: 600px;
}

.health-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-xl);
}

.health-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.health-step-dot.active {
  border-color: var(--color-green);
  background: var(--color-green);
  color: #fff;
}

.health-step-dot.completed {
  border-color: var(--color-green);
  background: var(--color-surface);
  color: var(--color-green);
}

.health-step-line {
  flex: 1;
  height: 2px;
  background: var(--color-border);
}

.health-panel__title {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.health-panel__desc {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-lg);
}

.health-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.health-field--full {
  grid-column: 1 / -1;
}

.health-label {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.health-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.health-chips--lg {
  gap: var(--space-sm);
}

.chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.health-chips--lg .chip {
  padding: 10px 20px;
  font-size: 0.95rem;
}

.chip:hover {
  border-color: var(--color-green);
  color: var(--color-text);
}

.chip.active {
  background: var(--color-green);
  border-color: var(--color-green);
  color: #fff;
}

.health-nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.health-review {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.health-review__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.health-review__row:last-child {
  border-bottom: none;
}

.health-review__row--highlight {
  background: var(--color-surface-alt, rgba(0,0,0,0.02));
  font-weight: 600;
}

.health-review__label {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.health-review__value {
  font-weight: 600;
  font-size: 0.9rem;
}

.health-info-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--color-text-secondary);
  font-size: 0.65rem;
  font-weight: 700;
  font-style: normal;
  color: var(--color-text-secondary);
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 4px;
}

.health-info-bubble:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: var(--color-bg);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 400;
  white-space: normal;
  width: 260px;
  line-height: 1.4;
  z-index: 10;
  pointer-events: none;
}

.health-field-error {
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 4px;
}

.health-unit-toggle {
  display: flex;
  gap: var(--space-xs);
}

@media (max-width: 480px) {
  .health-form-grid {
    grid-template-columns: 1fr;
  }
}

/* -- Saved page -- */
.saved-tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.saved-tab {
  padding: var(--space-sm) var(--space-md);
  font-weight: 500;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.saved-tab.active {
  color: var(--color-green);
  border-bottom-color: var(--color-green);
}

.saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(280px, calc((100% - 2 * var(--space-lg)) / 3)), 1fr));
  gap: var(--space-lg);
}

/* -- Create Recipe -- */
/* Method Picker */
.create-method-picker {
  max-width: 700px;
  margin: 0 auto;
  padding: var(--space-xl) 0;
}

.create-import-panel,
.create-auto-panel {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-xl) 0;
}

.create-wizard {
  max-width: 640px;
  margin: 0 auto;
}

.wizard-steps {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--color-text-tertiary);
  font-weight: 500;
}

.wizard-step.active {
  color: var(--color-green);
}

.wizard-step.completed {
  color: var(--color-green);
}

.wizard-step__number {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border);
  font-size: 0.75rem;
  font-weight: 700;
}

.wizard-step.active .wizard-step__number {
  border-color: var(--color-green);
  background: var(--color-green);
  color: white;
}

.wizard-step.completed .wizard-step__number {
  border-color: var(--color-green);
  background: var(--color-green);
  color: white;
}

.wizard-step__connector {
  flex: 1 1 24px;
  min-width: 16px;
  height: 2px;
  background: var(--color-border);
}

.wizard-step.completed + .wizard-step__connector {
  background: var(--color-green);
}

.wizard-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.wizard-panel.active {
  display: block;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

/* Dynamic ingredient/instruction rows */
.dynamic-row {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  align-items: center;
}

.dynamic-row .form-input {
  flex: 1;
}

.dynamic-row .qty-field {
  position: relative;
  flex: 0 0 auto;
  width: 70px;
}

.dynamic-row .qty-field .form-input {
  width: 100%;
  max-width: 100%;
}

.qty-error {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 2px;
  color: var(--color-danger);
  font-size: 0.75rem;
  white-space: nowrap;
  line-height: 1.2;
}

.qty-field.has-error .qty-error {
  display: block;
}

.qty-field.has-error .form-input {
  border-color: var(--color-danger);
}

.dynamic-row:has(.qty-field.has-error) {
  margin-bottom: calc(var(--space-sm) + 16px);
}

.dynamic-row .remove-btn {
  color: var(--color-danger);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
}

.dynamic-row .remove-btn:hover {
  background: rgba(192, 57, 43, 0.08);
}

.add-row-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-green);
  font-weight: 500;
  font-size: 0.85rem;
  padding: var(--space-sm) 0;
}

.add-row-btn:hover {
  text-decoration: underline;
}

.add-row-actions {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.add-row-btn--section {
  color: var(--color-text-secondary, #888);
}

.section-header-row {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-sm);
  margin-top: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--color-green);
}

.section-header-row:first-child {
  margin-top: 0;
}

.section-header-row input {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  background: transparent;
  padding: var(--space-xs) 0;
  color: var(--color-text);
}

.section-header-row input::placeholder {
  font-style: italic;
  color: var(--color-text-secondary, #999);
}

.section-header-row input:focus {
  outline: none;
}

.section-header-row .remove-btn {
  color: var(--color-danger);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
}

.section-header-row .remove-btn:hover {
  background: rgba(192, 57, 43, 0.08);
}

.drag-handle {
  cursor: grab;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.drag-handle:hover {
  opacity: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.section-header-row.dragging,
.dynamic-row.dragging {
  opacity: 0.4;
}

.reorder-active {
  color: var(--color-green) !important;
  font-weight: 600;
}

/* -- Settings -- */
.avatar-upload {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.avatar-upload__clickable {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  width: 80px;
  height: 80px;
}
.avatar-upload__preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
  display: block;
}
.avatar-upload__overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.avatar-upload__clickable:hover .avatar-upload__overlay {
  opacity: 1;
}
.avatar-upload__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.settings-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.settings-section h3 {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row__info h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.settings-row__info p {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.settings-danger {
  border: 1px solid rgba(192, 57, 43, 0.2);
  background: rgba(192, 57, 43, 0.03);
}

/* -- Settings tabs -- */
.settings-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0;
  overflow-x: auto;
}
.settings-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.settings-tab:hover {
  color: var(--color-text);
}
.settings-tab.active {
  color: var(--color-green);
  border-bottom-color: var(--color-green);
}
.settings-tab__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-green);
  margin-left: 6px;
  vertical-align: middle;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.settings-tab.dirty .settings-tab__dot {
  opacity: 1;
}
.settings-tabpanel {
  display: none;
}
.settings-tabpanel.active {
  display: block;
}
.settings-subsection {
  padding-top: var(--space-md);
  margin-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}
.settings-subsection:first-child,
.settings-section > h3 + .settings-subsection,
.settings-section > h3 + p + .settings-subsection {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}
.settings-subsection h4 {
  font-size: 0.95rem;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}
.settings-save-bar {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}
.settings-section__save {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}

/* -- Avatar cropper modal -- */
.avatar-cropper {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}
.avatar-cropper__stage {
  position: relative;
  width: 280px;
  height: 280px;
  max-width: 100%;
  background: #1a1a1a;
  border-radius: var(--radius-md);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.avatar-cropper__stage:active {
  cursor: grabbing;
}
.avatar-cropper__stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: 0 0;
  max-width: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.avatar-cropper__mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
}
.avatar-cropper__controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  max-width: 280px;
}
.avatar-cropper__controls label {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}
.avatar-cropper__controls input[type="range"] {
  flex: 1;
  accent-color: var(--color-green);
}

/* -- FAQ Accordion -- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.faq-item {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
}

.faq-question svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--transition-normal);
  color: var(--color-text-secondary);
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow), padding var(--transition-slow);
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 var(--space-lg) var(--space-lg);
}

.faq-answer p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* -- Feedback Stars -- */
.star-widget {
  display: flex;
  gap: var(--space-xs);
}

.star-widget .star {
  cursor: pointer;
  color: var(--color-border);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.star-widget .star:hover,
.star-widget .star.active {
  color: var(--color-gold);
  transform: scale(1.15);
}

.star-widget .star svg {
  width: 32px;
  height: 32px;
}

/* -- Right Panel Sections -- */
.panel-section {
  margin-bottom: var(--space-xl);
}

.panel-section__title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.panel-trending-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  font-size: 0.85rem;
}

.panel-trending-item .rank {
  font-weight: 700;
  color: var(--color-gold);
  font-size: 0.8rem;
  width: 20px;
}

.panel-trending-item .title {
  color: var(--color-text);
  font-weight: 500;
}

.panel-trending-item .title:hover {
  color: var(--color-green);
}

.panel-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* -- Featured Chefs Panel -- */
.panel-chef-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.panel-chef-item:hover {
  background: var(--color-surface-alt);
}

.panel-chef-item__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.panel-chef-item__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.panel-chef-item__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-chef-item__username {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

.panel-chef-item__followers {
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* -- Modal -- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 480px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  transition: transform var(--transition-normal);
}

.modal-backdrop.visible .modal {
  transform: translateY(0);
}

.modal h3 {
  margin-bottom: var(--space-md);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* ---- Post-confirm modal ---- */
.post-confirm {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.post-confirm__lede {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.5;
}

.post-confirm__row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-offwhite);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.post-confirm__row > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.post-confirm__row strong {
  font-size: 0.95rem;
  color: var(--color-text);
}

.post-confirm__row span {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.post-confirm__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.post-confirm__icon--public { color: var(--color-green); }
.post-confirm__icon--private { color: var(--color-gold); }

.post-confirm__note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* -- Static page content -- */
.static-content h1 {
  margin-bottom: var(--space-lg);
  color: var(--color-green);
}

.static-content h2 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.static-content p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

.static-content ul, .static-content ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.static-content li {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
  line-height: 1.6;
  list-style: disc;
}

.static-content ol li {
  list-style: decimal;
}

/* Section heading */
.section-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

/* ===================== 17. ANIMATIONS ===================== */

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
  opacity: 0;
}

.animate-slide-up {
  animation: slideUp 0.4s ease forwards;
  opacity: 0;
}

/* Page entrance */
.main-content {
  animation: fadeIn 0.3s ease;
}

/* -- Collections Grid -- */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 20px;
}

@media (max-width: 880px) {
  .collections-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Variant A — Photo mosaic.
   The tile is a column: square cover on top, name + meta below.
   Cover swaps between a 2x2 photo grid (user collections) and a
   tinted block + icon (system tiles: Created / Drafts / Saved). */
.collection-tile {
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  transition: transform var(--transition-fast);
}

.collection-tile:hover {
  transform: translateY(-2px);
}

.collection-tile__cover {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #F0ECE4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(27, 107, 58, 0.06);
  transition: box-shadow var(--transition-fast);
}

.collection-tile:hover .collection-tile__cover {
  box-shadow: 0 4px 20px rgba(27, 107, 58, 0.08);
}

/* Recipe-thumbnail mosaic. Layout adapts to thumb count:
   1 = full bleed, 2 = side-by-side, 3 = "peace sign" (1 top + 2 below),
   4+ = 2x2 grid. */
.collection-tile__mosaic {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 2px;
  background: #F0ECE4;
}

.collection-tile__mosaic--one {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.collection-tile__mosaic--two {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

.collection-tile__mosaic--three {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.collection-tile__mosaic--three > :first-child {
  grid-column: 1 / span 2;
}

.collection-tile__mosaic--four {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.collection-tile__mosaic img,
.collection-tile__mosaic-empty {
  width: 100%;
  height: 100%;
  /* Allow the image to shrink below its intrinsic size so 1fr rows split
     evenly instead of being pushed to the image's natural height. */
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  display: block;
}

.collection-tile__mosaic-empty {
  background: #F0ECE4;
}

/* System cover — solid tinted block with a centered icon. */
.collection-tile__cover--system {
  display: flex;
  align-items: center;
  justify-content: center;
}

.collection-tile__cover--green {
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(135deg, #1B6B3A 0%, #145a2e 100%);
}

.collection-tile__cover--gold {
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(135deg, #E0A020 0%, #b8861a 100%);
}

.collection-tile__cover--cream {
  background: #F0ECE4;
  border: 1px solid var(--color-border);
}

.collection-tile__sysicon {
  display: inline-flex;
  color: #fff;
}

.collection-tile__sysicon svg {
  width: 56px;
  height: 56px;
  color: inherit;
}

.collection-tile__cover--cream .collection-tile__sysicon {
  color: var(--color-green);
}

/* Pin pill — small caps badge on system tiles. */
.collection-tile__pin {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #145a2e;
}

/* ===================== Collection Detail Hero ===================== */

.collection-hero__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  margin-bottom: var(--space-md);
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.collection-hero__back:hover {
  background: var(--color-offwhite);
  color: var(--color-text);
}

.collection-hero__back svg {
  width: 18px;
  height: 18px;
}

.collection-hero {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  border-radius: var(--radius-xl, 18px);
  background: linear-gradient(135deg, rgba(27, 107, 58, 0.10), rgba(27, 107, 58, 0.02));
  border: 1px solid rgba(27, 107, 58, 0.15);
  position: relative;
  overflow: hidden;
}

.collection-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 60%;
  height: 180%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.35), transparent 70%);
  pointer-events: none;
}

.collection-hero--saved {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.04));
  border-color: rgba(212, 175, 55, 0.3);
}
.collection-hero--saved .collection-hero__icon {
  background: var(--color-gold);
  color: #fff;
}

.collection-hero--created {
  background: linear-gradient(135deg, rgba(27, 107, 58, 0.14), rgba(27, 107, 58, 0.03));
  border-color: rgba(27, 107, 58, 0.25);
}
.collection-hero--created .collection-hero__icon {
  background: var(--color-green);
  color: #fff;
}

.collection-hero--drafts {
  background: linear-gradient(135deg, rgba(27, 107, 58, 0.12), rgba(27, 107, 58, 0.02));
  border-color: rgba(27, 107, 58, 0.22);
}
.collection-hero--drafts .collection-hero__icon {
  background: var(--color-green);
  color: #fff;
}

.collection-hero--user .collection-hero__icon {
  background: var(--color-green);
  color: #fff;
}

.collection-hero__icon {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg, 14px);
  background: var(--color-green);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 1;
}

.collection-hero__icon svg {
  width: 40px;
  height: 40px;
}

.collection-hero__text {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.collection-hero__eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
}

.collection-hero__title {
  margin: 0 0 var(--space-xs) 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15;
  font-weight: 700;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.collection-hero__subtitle {
  margin: 0 0 var(--space-sm) 0;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

.collection-hero__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.collection-hero__count {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--color-text);
}

.collection-hero__actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.collection-hero__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-xs) var(--space-sm);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.collection-hero__action:hover {
  background: #fff;
  border-color: var(--color-green);
  color: var(--color-green);
  transform: translateY(-1px);
}

.collection-hero__action svg {
  width: 16px;
  height: 16px;
}

.collection-hero__action--danger:hover {
  border-color: #c0392b;
  color: #c0392b;
}

.collection-hero__action--primary {
  background: var(--color-green);
  border-color: var(--color-green);
  color: #fff;
}

.collection-hero__action--primary:hover {
  background: var(--color-green-dark, var(--color-green));
  border-color: var(--color-green);
  color: #fff;
  filter: brightness(0.95);
}

@media (max-width: 720px) {
  .collection-hero {
    flex-wrap: wrap;
    padding: var(--space-md);
  }
  .collection-hero__icon {
    width: 64px;
    height: 64px;
  }
  .collection-hero__icon svg {
    width: 28px;
    height: 28px;
  }
  .collection-hero__actions {
    width: 100%;
    margin-top: var(--space-sm);
  }
  .collection-hero__action span {
    display: none;
  }
}

[data-theme="dark"] .collection-hero__action {
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .collection-hero__action:hover {
  background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .collection-hero__count {
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Collection edit (multi-select) mode ---------- */

.collection-editbar {
  position: sticky;
  top: calc(var(--nav-height, 60px) + var(--space-sm));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  background: var(--color-bg, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.collection-editbar[hidden] { display: none; }

.collection-editbar__count {
  font-size: 0.9rem;
  color: var(--color-text);
}

.collection-editbar__count strong {
  color: var(--color-green);
  font-size: 1.05rem;
  margin-right: 4px;
}

.collection-editbar__spacer { flex: 1; }

/* In edit mode, hide card controls that would compete with the select affordance,
   and show a circular checkbox on the top-right of each card. */
.saved-grid--edit .recipe-card {
  cursor: pointer;
  user-select: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.saved-grid--edit .recipe-card:hover {
  transform: translateY(-2px);
}

.saved-grid--edit .recipe-card__image-actions,
.saved-grid--edit .recipe-card__expand-toggle {
  pointer-events: none;
  opacity: 0.35;
}

.saved-grid--edit .recipe-card a {
  pointer-events: none;
}

.recipe-card__select {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all var(--transition-fast);
  color: transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.recipe-card__select svg {
  width: 16px;
  height: 16px;
}

.recipe-card--selected .recipe-card__select {
  background: var(--color-green);
  border-color: var(--color-green);
  color: #fff;
}

.recipe-card--selected {
  outline: 3px solid var(--color-green);
  outline-offset: -1px;
  border-radius: var(--radius-lg, 14px);
}

.recipe-card--selected::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(27, 107, 58, 0.08);
  border-radius: inherit;
  pointer-events: none;
}

[data-theme="dark"] .collection-editbar {
  background: var(--color-bg, #1a1a1a);
}

[data-theme="dark"] .recipe-card__select {
  background: rgba(30, 30, 30, 0.95);
  border-color: var(--color-border);
}

/* Drafts list edit mode */
.drafts-list--edit .drafts-list__item {
  cursor: pointer;
  user-select: none;
}

.drafts-list--edit .drafts-list__actions {
  pointer-events: none;
  opacity: 0.35;
}

.drafts-list--edit .drafts-list__item a {
  pointer-events: none;
}

.drafts-list__select {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--space-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: transparent;
}

.drafts-list__select svg {
  width: 14px;
  height: 14px;
}

.drafts-list__item--selected .drafts-list__select {
  background: var(--color-green);
  border-color: var(--color-green);
  color: #fff;
}

.drafts-list__item--selected {
  background: rgba(27, 107, 58, 0.08);
  outline: 2px solid var(--color-green);
  outline-offset: -1px;
}

[data-theme="dark"] .drafts-list__select {
  background: rgba(30, 30, 30, 0.95);
}

/* Collection-tile skeleton — matches the new cover-on-top layout. */
.collection-tile--skeleton {
  pointer-events: none;
  background: transparent;
  border: none;
}

.collection-tile--skeleton .sk-block,
.collection-tile--skeleton .sk-line {
  background: linear-gradient(90deg,
    rgba(0,0,0,0.06) 0%,
    rgba(0,0,0,0.12) 50%,
    rgba(0,0,0,0.06) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.collection-tile--skeleton .sk-block {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 0;
}

.collection-tile--skeleton .sk-line {
  height: 14px;
}

.collection-tile--skeleton .sk-line--title { width: 70%; height: 18px; }
.collection-tile--skeleton .sk-line--sub   { width: 45%; height: 13px; opacity: 0.7; }

[data-theme="dark"] .collection-tile--skeleton .sk-block,
[data-theme="dark"] .collection-tile--skeleton .sk-line {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.06) 0%,
    rgba(255,255,255,0.14) 50%,
    rgba(255,255,255,0.06) 100%);
  background-size: 200% 100%;
}

.collection-tile__name {
  font-family: 'Lora', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
  color: var(--color-text);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.collection-tile__count {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0;
}

.collection-tile__menu {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.collection-tile__menu svg { width: 14px; height: 14px; }

.collection-tile:hover .collection-tile__menu {
  opacity: 1;
}

.collection-tile__menu:hover {
  color: var(--color-green);
}

/* "+ New Collection" tile — dashed cover, plus chip centered. */
.collection-tile--new {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
}

.collection-tile__cover--new {
  background: transparent;
  border: 2px dashed var(--color-border);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-green);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.collection-tile--new:hover .collection-tile__cover--new {
  border-color: var(--color-green);
  background: rgba(27, 107, 58, 0.04);
  box-shadow: none;
}

.collection-tile__plus {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  background: rgba(27, 107, 58, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-green);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.collection-tile__plus svg { width: 22px; height: 22px; }

.collection-tile--new:hover .collection-tile__plus {
  background: var(--color-green);
  color: #fff;
}

.collection-picker {
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.collection-picker__search {
  margin-bottom: var(--space-xs);
}

.collection-picker__search .form-input {
  width: 100%;
  font-size: 0.9rem;
}

.collection-picker__new-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm);
  background: transparent;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.collection-picker__new-btn:hover {
  background: var(--color-offwhite);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.collection-picker__new-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--color-offwhite);
  font-size: 1.1rem;
  line-height: 1;
}

.collection-picker__new-btn:hover .collection-picker__new-icon {
  background: var(--color-gold);
  color: #fff;
}

.collection-picker__new-form {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-xs) 0;
}

.collection-picker__new-form .form-input {
  flex: 1;
}

.collection-picker__section-label {
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

.collection-picker__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.collection-picker__item:hover {
  background: var(--color-offwhite);
}

.collection-picker__item--saved .collection-picker__name {
  font-weight: 600;
}

.collection-picker__checkbox {
  accent-color: var(--color-gold);
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.collection-picker__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-picker__badge-new {
  display: inline-block;
  margin-left: var(--space-xs);
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--color-gold);
  border-radius: var(--radius-full);
  vertical-align: middle;
}

.collection-picker__empty {
  padding: var(--space-md) 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  text-align: center;
}

.collection-picker__list {
  display: flex;
  flex-direction: column;
}

/* Inline "Change" link inside toasts (matches Spotify-style action). */
.toast__action-link {
  background: transparent;
  border: none;
  color: var(--color-gold);
  font-weight: 600;
  font-size: inherit;
  cursor: pointer;
  padding: 0 var(--space-xs);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.toast__action-link:hover {
  color: var(--color-gold-dark, var(--color-gold));
  opacity: 0.85;
}

/* -- Draft Indicator -- */
.draft-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(224, 160, 32, 0.1);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-lg);
  font-size: 0.85rem;
  color: var(--color-gold);
  font-weight: 500;
}

/* -- Form Validation Error -- */
.form-error-msg {
  color: var(--color-danger);
  font-size: 0.8rem;
  margin-top: var(--space-xs);
}

/* -- Publish Success -- */
.publish-success h2 {
  font-family: var(--font-serif);
  color: var(--color-green);
}

/* ===================== ORGANIZE PAGE ===================== */

/* -- Section Tabs -- */
.organize-tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.organize-tab {
  padding: var(--space-sm) var(--space-md);
  font-weight: 500;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.organize-tab:hover {
  color: var(--color-text);
}

.organize-tab.active {
  color: var(--color-green);
  border-bottom-color: var(--color-green);
}

/* -- Toolbar -- */
.organize-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.organize-toolbar__folders {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  flex: 1;
}

.folder-pill {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.folder-pill--new {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-style: dashed;
}

.folder-pill--new svg {
  width: 14px;
  height: 14px;
}

.folder-pill:hover {
  border-color: var(--color-green);
  color: var(--color-green);
}

.folder-pill.active {
  background: var(--color-green);
  color: white;
  border-color: var(--color-green);
}

/* -- Sort & Filter Chips (Spotify-style) -- */
.sf-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
  position: relative;
}

.sf-chips.dropdown-open {
  overflow: visible;
}

.sf-chips::-webkit-scrollbar { display: none; }

.sf-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(0,0,0,0.06);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
}

.sf-chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.sf-chip:hover {
  background: rgba(0,0,0,0.1);
}

.sf-chip.active {
  background: var(--color-green);
  color: white;
}

.sf-chip--x {
  padding: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
}

.sf-chip--x svg {
  width: 16px;
  height: 16px;
}

.sf-chip--x:hover {
  background: rgba(0,0,0,0.12);
}

.sf-chips__divider {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  flex-shrink: 0;
}

/* Sort dropdown */
.sf-chip-wrap {
  position: relative;
  flex-shrink: 0;
}

.sf-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 170px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  padding: 4px;
  overflow: hidden;
}

.sf-dropdown.open { display: block; }

.sf-dropdown__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  border: none;
  background: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  border-radius: var(--radius-md);
  font-family: inherit;
  transition: background 0.12s ease;
}

.sf-dropdown__item:hover {
  background: rgba(0,0,0,0.05);
}

.sf-dropdown__item.active {
  color: var(--color-green);
  font-weight: 600;
}

/* -- View Toggle (Card/List) -- */
.view-toggle {
  display: inline-flex;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 2px;
  flex-shrink: 0;
}

.view-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.view-toggle__btn svg {
  width: 18px;
  height: 18px;
}

.view-toggle__btn.active {
  background: var(--color-green);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* -- List View (Spotify-style) -- */
.recipe-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recipe-list-header {
  display: grid;
  grid-template-columns: 36px 52px 1fr 100px 100px 72px 72px;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xs) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-xs);
  user-select: none;
}

.recipe-list-header__col {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.recipe-list-header__col:hover {
  color: var(--color-text-primary);
}

.recipe-list-header__col.sorted {
  color: var(--color-primary);
}

.recipe-list-header__col .sort-arrow {
  display: inline-flex;
  font-size: 0.6rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.recipe-list-header__col:hover .sort-arrow,
.recipe-list-header__col.sorted .sort-arrow {
  opacity: 1;
}

.recipe-list-header__num {
  justify-content: center;
  cursor: default;
}

.recipe-list-header__col[data-sort-col="cuisine"],
.recipe-list-header__col[data-sort-col="time"],
.recipe-list-header__col[data-sort-col="health"],
.recipe-list-header__col[data-sort-col="rating"] {
  justify-content: center;
}

.recipe-list-row {
  display: grid;
  grid-template-columns: 36px 52px 1fr 100px 100px 72px 72px;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.recipe-list-row__num {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-align: center;
}

.recipe-list-row:hover {
  background: var(--color-border);
}

.recipe-list-row__thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.recipe-list-row__info {
  min-width: 0;
}

.recipe-list-row__title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-list-row__meta {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.recipe-list-row__cuisine {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  justify-self: center;
}

.recipe-list-row__time {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.recipe-list-row__time svg { width: 14px; height: 14px; }

.recipe-list-row__health {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recipe-list-row__health .health-badge {
  width: 28px;
  height: 28px;
  font-size: 0.65rem;
}

.recipe-list-row__rating {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-gold);
}

.recipe-list-row__rating svg { width: 14px; height: 14px; }

/* -- Grocery Sub-tabs (Pill) -- */
.grocery-subtabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.grocery-subtab {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.grocery-subtab.active {
  background: var(--color-green);
  color: white;
  border-color: var(--color-green);
}

/* -- Grocery Items -- */
.grocery-add-row {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.grocery-add-row .form-input { flex: 1; }

.grocery-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.grocery-item__checkbox {
  accent-color: var(--color-green);
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.grocery-item__name { flex: 1; }

.grocery-item__name.checked {
  text-decoration: line-through;
  color: var(--color-text-tertiary);
}

.grocery-item__qty {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.grocery-item__remove {
  color: var(--color-text-tertiary);
  transition: color var(--transition-fast);
  cursor: pointer;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 4px;
}

.grocery-item__remove:hover { color: var(--color-danger, #c0392b); }
.grocery-item__remove svg { width: 16px; height: 16px; }

.grocery-source-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

/* -- Meal Calendar -- */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.calendar-header__title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 220px;
  text-align: center;
}

.calendar-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.calendar-header__nav:hover {
  background: var(--color-green);
  color: white;
  border-color: var(--color-green);
}

.calendar-header__nav svg { width: 18px; height: 18px; }

.calendar-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.calendar-grid {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
  min-width: 700px;
}

.calendar-grid__corner {
  background: var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.calendar-grid__day-header {
  padding: var(--space-sm);
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  background: var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.calendar-grid__day-header .date-num {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-weight: 400;
}

.calendar-grid__slot-label {
  padding: var(--space-sm);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.calendar-grid__slot {
  padding: 4px;
  border-bottom: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  min-height: 54px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.calendar-grid__slot:hover {
  background: rgba(27, 107, 58, 0.05);
}

.calendar-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  background: rgba(27, 107, 58, 0.08);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--color-green);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-chip img {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.calendar-chip__remove {
  margin-left: auto;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.calendar-chip__remove:hover { color: var(--color-danger, #c0392b); }
.calendar-chip__remove svg { width: 12px; height: 12px; }

/* -- Chip Toggle (Meal Prep multi-select) -- */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle { cursor: pointer; }
.chip-toggle input { display: none; }
.chip-toggle .chip {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  transition: all 0.15s;
  user-select: none;
}
.chip-toggle input:checked + .chip {
  background: var(--color-green);
  color: white;
  border-color: var(--color-green);
}
.chip-toggle .chip:hover {
  border-color: var(--color-green);
}

/* -- Meal Prep Selection Mode -- */
.cal-selection-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #eaf5e8;
  border: 1.5px solid var(--color-green);
  border-radius: 12px;
  margin-bottom: 16px;
  box-sizing: border-box;
  max-width: 100%;
}
.cal-selection-banner__info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.cal-selection-banner__info > div {
  min-width: 0;
  overflow: hidden;
}
.cal-selection-banner__info strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-selection-banner__info p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-selection-banner__actions {
  flex-shrink: 0;
}
.cal-selection-banner__img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.cal-selection-banner__actions .btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.cal-selection-banner__actions .btn--primary {
  background: var(--color-green) !important;
  color: white !important;
  border: 1.5px solid var(--color-green) !important;
}
.cal-selection-banner__actions .btn--ghost {
  background: white !important;
  color: var(--color-text-secondary) !important;
  border: 1.5px solid var(--color-border) !important;
}

.calendar-grid--selection .calendar-grid__slot {
  transition: background 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.calendar-grid--selection .cal-slot--unselected {
  background: var(--color-bg-secondary, #f0ede6);
  opacity: 0.6;
}
.calendar-grid--selection .cal-slot--selected {
  background: white;
  box-shadow: inset 0 0 0 2.5px var(--color-green);
  opacity: 1;
}
.calendar-grid--selection .cal-slot--unselected:hover {
  opacity: 0.85;
}
.cal-slot__preview {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 2px;
}

/* -- Recipe Picker List -- */
.recipe-picker {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.recipe-picker__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.recipe-picker__item:hover {
  background: var(--color-border);
}

.recipe-picker__item input[type="radio"],
.recipe-picker__item input[type="checkbox"] {
  accent-color: var(--color-green);
  flex-shrink: 0;
}

.recipe-picker__item img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.recipe-picker__item span {
  font-size: 0.85rem;
  font-weight: 500;
}

/* -- Select from Saved Button (in New Folder modal) -- */
.select-from-saved-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-primary) 4%, transparent);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.select-from-saved-btn:hover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.select-from-saved-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  flex-shrink: 0;
}

.select-from-saved-btn__icon svg {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
}

.select-from-saved-btn__text {
  display: flex;
  flex-direction: column;
  text-align: left;
  flex: 1;
  min-width: 0;
}

.select-from-saved-btn__text strong {
  font-size: 0.85rem;
  color: var(--color-text-primary);
}

.select-from-saved-btn__text small {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.select-from-saved-btn__arrow {
  width: 16px;
  height: 16px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.select-from-saved-btn:hover .select-from-saved-btn__arrow {
  transform: translateX(2px);
  color: var(--color-primary);
}

/* -- Select from Saved Overlay -- */
.select-saved-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.select-saved-header h3 {
  margin-bottom: 0;
}

.select-saved-body {
  max-height: 400px;
  overflow-y: auto;
}

.select-saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-sm);
}

.select-saved-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
  cursor: pointer;
  transition: box-shadow var(--transition-fast), outline var(--transition-fast);
  outline: 2px solid transparent;
}

.select-saved-card:hover {
  box-shadow: var(--shadow-md);
}

.select-saved-card.selected {
  outline: 2px solid var(--color-primary);
}

.select-saved-card__bubble {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.25);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.select-saved-card__bubble.checked {
  background: #fff;
  border-color: #fff;
}

.select-saved-card__bubble svg {
  width: 14px;
  height: 14px;
  color: #000;
}

.select-saved-card__img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.select-saved-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
}

.select-saved-card__badge .health-badge {
  width: 28px;
  height: 28px;
  font-size: 0.6rem;
}

.select-saved-card__body {
  padding: var(--space-sm);
}

.select-saved-card__title {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-saved-card__meta {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
}

.select-saved-card__meta svg {
  width: 12px;
  height: 12px;
}

/* List mode */
.select-saved-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.select-saved-list-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
}

.select-saved-list-row:hover {
  background: var(--color-border);
}

.select-saved-list-row.selected {
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.select-saved-list-row .select-saved-card__bubble {
  position: static;
  flex-shrink: 0;
  border-color: var(--color-text-secondary);
  background: transparent;
}

.select-saved-list-row.selected .select-saved-card__bubble {
  background: #fff;
  border-color: var(--color-text-primary);
}

.select-saved-list-row img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.select-saved-list-row__info {
  min-width: 0;
  flex: 1;
}

.select-saved-list-row__title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-saved-list-row__meta {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 2px;
}

.select-saved-list-row__meta svg {
  width: 12px;
  height: 12px;
}

/* Action bar */
.select-saved-action {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

/* Widen modal for selection overlay */
.modal:has(.select-saved-header) {
  max-width: 560px;
}

/* -- Manage Folders Modal -- */
.manage-folder-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.manage-folder-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.manage-folder-row__name {
  flex: 1;
}

.manage-folder-row__delete {
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

.manage-folder-row__delete:hover {
  color: var(--color-danger, #c0392b);
}

/* -- Folder Choice Modal -- */
.folder-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.folder-choice-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 600px) {
  .folder-choice-grid--3col {
    grid-template-columns: 1fr;
  }
}

.folder-choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  text-align: center;
}

.folder-choice-card:hover {
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px rgba(27, 107, 58, 0.12);
}

.folder-choice-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-offwhite);
  color: var(--color-green);
}

.folder-choice-card__icon svg {
  width: 24px;
  height: 24px;
}

.folder-choice-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.folder-choice-card__desc {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

/* -- Auto-Create Filter Sections -- */
.auto-filter-sections {
  max-height: 50vh;
  overflow-y: auto;
  padding-right: var(--space-xs);
}

.auto-filter-section {
  margin-bottom: var(--space-md);
}

.auto-filter-section .form-label {
  margin-bottom: var(--space-xs);
}

.category-chips--wrap {
  flex-wrap: wrap;
  overflow-x: visible;
  padding-bottom: 0;
  margin-bottom: 0;
}

.category-chips--wrap .category-chip {
  padding: 6px 14px;
  font-size: 0.8rem;
}

/* -- Auto-Filter Preview Counter -- */
.auto-filter-preview {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-offwhite);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  color: var(--color-text-secondary);
}

.auto-filter-preview__count {
  font-weight: 700;
  color: var(--color-green);
  font-size: 1.1rem;
}

.auto-filter-preview--empty .auto-filter-preview__count {
  color: var(--color-danger, #c0392b);
}

.auto-filter-preview__no-selection {
  display: none;
  color: var(--color-text-tertiary);
  font-style: italic;
}

.auto-filter-preview--no-selection .auto-filter-preview__no-selection {
  display: inline;
}

.auto-filter-preview--no-selection .auto-filter-preview__match {
  display: none;
}

.form-hint-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-xs);
}

.form-char-count {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  margin-left: auto;
}

.form-char-count--limit {
  color: var(--color-danger, #c0392b);
  font-weight: 600;
}

/* ===================== 18. RESPONSIVE ===================== */

@media (max-width: 1200px) {
  .app-layout {
    grid-template-columns: var(--sidebar-width) 1fr;
  }

  .right-panel {
    display: none;
  }
}

@media (max-width: 1170px) {
  .feed-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 880px) {
  .app-layout {
    grid-template-columns: 1fr;
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
  }

  .sidebar {
    display: none;
  }

  .top-header {
    display: flex;
  }

  .bottom-nav {
    display: flex;
  }

  .static-layout {
    padding-top: calc(var(--space-2xl) + var(--header-height));
    padding-bottom: calc(var(--space-2xl) + var(--bottom-nav-height));
  }

  .main-content {
    padding: var(--space-md);
  }

  .home-search {
    top: var(--header-height);
  }

  .home-search .search-input-wrap {
    flex: 1 1 0;
    min-width: 0;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .hero {
    min-height: 200px;
    border-radius: var(--radius-lg);
  }

  .hero__slide { min-height: 200px; }
  .hero__arrow { display: none; }
  .hero__title { font-size: 1.2rem; }
  .collections-grid { grid-template-columns: 1fr; }

  .feed-container {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .discover-grid {
    grid-template-columns: 1fr;
  }

  .search-results-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .saved-grid {
    grid-template-columns: 1fr;
  }

  .profile-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-name-row {
    justify-content: center;
  }

  .profile-stats {
    justify-content: center;
  }

  .auth-card {
    padding: var(--space-lg);
  }

  .toast {
    left: auto;
    right: 16px;
    bottom: calc(var(--bottom-nav-height) + 16px);
    max-width: calc(100vw - 32px);
    width: 320px;
  }

  /* Organize page responsive */
  .calendar-grid {
    grid-template-columns: 60px repeat(7, 1fr);
    font-size: 0.75rem;
  }

  .calendar-header__title {
    font-size: 0.95rem;
    min-width: 160px;
  }

  .recipe-list-header {
    grid-template-columns: 28px 44px 1fr auto;
  }

  .recipe-list-header__col[data-sort-col="cuisine"],
  .recipe-list-header__col[data-sort-col="time"],
  .recipe-list-header__col[data-sort-col="health"] {
    display: none;
  }

  .recipe-list-row {
    grid-template-columns: 28px 44px 1fr auto;
  }

  .recipe-list-row__cuisine,
  .recipe-list-row__time,
  .recipe-list-row__health {
    display: none;
  }

  .recipe-list-row__thumb {
    width: 44px;
    height: 44px;
  }

  .organize-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .organize-tab {
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .feed-container {
    grid-template-columns: 1fr;
  }
}

/* ===================== 19. UTILITIES ===================== */

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.text-center { text-align: center; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.w-full { width: 100%; }

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: 2px;
}

/* Selection color */
::selection {
  background: rgba(27, 107, 58, 0.2);
}

/* ===================== IMPORT RECIPE STATES ===================== */

.upload-crop-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.78rem;
  padding: 6px 12px 6px 14px;
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--color-green);
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

/* Auto-expanding textareas */
.create-wizard textarea {
  overflow: hidden;
  resize: none;
  min-height: 56px;
}

.import-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xl) 0;
  gap: var(--space-sm);
}

.import-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-green);
  border-radius: 50%;
  animation: import-spin 0.8s linear infinite;
}

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

.import-loading__message {
  font-weight: 600;
  color: var(--color-text);
  transition: opacity 0.3s;
}

.import-loading__sub {
  font-size: 0.85rem;
}

.import-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md);
  margin-top: var(--space-md);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md, 12px);
  gap: var(--space-xs);
}

.import-error__icon {
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  background: var(--color-danger, #C0392B);
  border-radius: 50%;
}

.import-error__text {
  font-weight: 500;
  color: var(--color-danger, #C0392B);
}

.import-error__hint {
  font-size: 0.85rem;
}

.import-error__hint a {
  color: var(--color-green);
  text-decoration: underline;
  font-weight: 600;
}

.import-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md, 12px);
  gap: var(--space-xs);
}

.import-success__icon {
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  background: var(--color-green);
  border-radius: 50%;
}

.import-success__text {
  font-weight: 500;
  color: var(--color-green);
}

.import-success__hint {
  font-size: 0.85rem;
}

.import-success--partial {
  background: #fefce8;
  border-color: #fde68a;
}

.import-success--partial .import-success__icon {
  background: #f59e0b;
}

.import-success--partial .import-success__text {
  color: #b45309;
}

/* -- Dropdown Multiselect -- */
.ms {
  position: relative;
  width: 100%;
}

.ms-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  width: 100%;
  padding: 7px 40px 7px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
  position: relative;
}

.ms-control:hover {
  border-color: var(--color-text-tertiary);
}

.ms.open .ms-control,
.ms-control:focus {
  outline: none;
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px rgba(27, 107, 58, 0.12);
}

.ms-placeholder {
  color: var(--color-text-tertiary);
  font-size: 0.95rem;
  padding: 2px 2px;
}

.ms-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 10px;
  border-radius: var(--radius-full);
  background: var(--color-green);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  user-select: none;
}

.ms-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  transition: background var(--transition-fast);
}

.ms-chip__remove:hover {
  background: rgba(255, 255, 255, 0.4);
}

.ms-caret {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-text-tertiary);
  transition: transform var(--transition-fast);
}

.ms.open .ms-caret {
  transform: translateY(-50%) rotate(180deg);
}

.ms.ms--full .ms-control {
  cursor: not-allowed;
}

.ms.ms--full .ms-caret {
  opacity: 0.35;
}

.ms-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  display: none;
  overflow: hidden;
}

.ms.open .ms-panel {
  display: block;
}

.ms-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}

.ms-search input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.9rem;
  box-sizing: border-box;
}

.ms-search input:focus {
  outline: none;
  border-color: var(--color-green);
}

.ms-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}

.ms-group-label {
  padding: 8px 10px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text);
  transition: background var(--transition-fast);
}

.ms-option:hover {
  background: var(--color-bg);
}

.ms-option__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.ms-option__check svg {
  width: 12px;
  height: 12px;
  color: #fff;
  opacity: 0;
}

.ms-option.selected .ms-option__check {
  background: var(--color-green);
  border-color: var(--color-green);
}

.ms-option.selected .ms-option__check svg {
  opacity: 1;
}

.ms-empty {
  padding: 16px;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 0.85rem;
}

/* -- Drafts List -- */
.create-drafts-panel {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-lg) 0;
}
.drafts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.drafts-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.drafts-list__item:hover {
  border-color: var(--color-green);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.drafts-list__info { flex: 1; min-width: 0; }
.drafts-list__title {
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drafts-list__meta {
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}
.drafts-list__actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}
