:root {
  --bg-void: #040706;
  --bg-deep: #07110d;
  --bg-mid: #0c1813;
  --surface: #101c17;
  --surface-2: #15241e;
  --surface-3: #1c2e26;
  --leaf: #4cae6e;
  --leaf-bright: #6bc98a;
  --leaf-dim: rgba(76, 174, 110, 0.14);
  --citrus: #e2b04a;
  --citrus-hot: #f0c45c;
  --citrus-dim: rgba(226, 176, 74, 0.14);
  --cream: #e6ebe7;
  --ink: #e6ebe7;
  --muted: #8a9b91;
  --line: rgba(230, 235, 231, 0.1);
  --line-strong: rgba(230, 235, 231, 0.18);
  --danger: #e06a5a;
  --danger-dim: rgba(224, 106, 90, 0.14);
  --radius: 8px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Sora", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --motion-fast: 160ms;
  --motion: 280ms;
  --motion-slow: 480ms;
  --focus-ring: 0 0 0 3px rgba(76, 174, 110, 0.28);
  --header-h: 4.25rem;
  --bottom-nav-h: 0px;
  --page-pad-x: clamp(1rem, 4vw, 3rem);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-void);
  line-height: 1.5;
  overflow-x: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out),
    background-color 0.45s var(--ease-out), color 0.35s ease;
}

body.page-ready {
  opacity: 1;
  transform: none;
}

.night-sky {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 55% at 75% -5%, rgba(45, 90, 65, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at -5% 30%, rgba(30, 55, 45, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 40% 110%, rgba(20, 50, 70, 0.2) 0%, transparent 55%),
    linear-gradient(175deg, var(--bg-void) 0%, var(--bg-deep) 40%, var(--bg-mid) 100%);
}

.night-sky::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 28% 42%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 47% 12%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 63% 55%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 81% 28%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 91% 68%, rgba(255, 255, 255, 0.22), transparent);
  animation: star-drift 48s linear infinite;
  opacity: 0.65;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.top,
main,
footer {
  position: relative;
  z-index: 1;
}

/* ?? Header ?? */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.7rem clamp(1.25rem, 4vw, 3rem);
  color: var(--cream);
  background: rgba(4, 7, 6, 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.top.scrolled {
  background: rgba(4, 7, 6, 0.92);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.brand {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.28rem;
  line-height: 1;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: -0.03em;
  white-space: nowrap;
  transition: color 0.25s ease, transform 0.25s var(--ease-spring);
}

.brand:hover {
  color: var(--citrus);
  transform: translateY(-1px);
}

.main-nav {
  display: flex;
  gap: 0.15rem;
  flex-wrap: wrap;
  justify-content: center;
  min-width: 0;
}

@media (max-width: 900px) {
  :root {
    --header-h: 3.5rem;
    --bottom-nav-h: 3.85rem;
    --page-pad-x: max(0.85rem, env(safe-area-inset-left, 0px));
  }

  .top {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.45rem;
    padding:
      max(0.45rem, env(safe-area-inset-top, 0px))
      max(0.75rem, env(safe-area-inset-right, 0px))
      0.45rem
      max(0.75rem, env(safe-area-inset-left, 0px));
  }

  .brand {
    font-size: 1.12rem;
  }

  .main-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    order: unset;
    grid-column: unset;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    background: rgba(4, 7, 6, 0.94);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.38);
    padding:
      0.2rem 0.3rem
      max(0.3rem, env(safe-area-inset-bottom, 0px));
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex: 0 0 auto;
    min-width: 4.35rem;
    min-height: 2.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    scroll-snap-align: start;
    border-radius: 10px;
  }

  .nav-link::after {
    left: 28%;
    right: 28%;
    bottom: 0.22rem;
  }

  .nav-link:hover {
    transform: none;
  }

  .nav-badge {
    margin-left: 0.15rem;
    min-width: 0.95rem;
    height: 0.95rem;
    font-size: 0.6rem;
  }

  .auth-bar {
    justify-self: end;
    gap: 0.3rem;
    min-width: 0;
  }

  .auth-btn {
    font-size: 0.72rem;
    padding: 0.4rem 0.55rem;
    min-height: 2.35rem;
  }

  #logout-btn {
    display: none;
  }

  .theme-toggle {
    width: 2.35rem;
    height: 2.35rem;
  }

  .fridge-alert-btn,
  .notify-btn {
    min-height: 2.35rem;
    padding: 0.35rem 0.5rem;
  }

  .panels {
    padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 1.25rem);
  }

  .panel {
    padding: 1rem 0.95rem;
    border-radius: 14px;
    scroll-margin-top: calc(var(--header-h) + 0.5rem);
  }

  #match-ingredient-card,
  #pantry-alerts-card {
    scroll-margin-top: calc(var(--header-h) + 0.5rem);
  }

  .hero {
    padding:
      1.1rem max(0.85rem, env(safe-area-inset-right, 0px))
      0.85rem max(0.85rem, env(safe-area-inset-left, 0px));
  }

  .brand-hero {
    font-size: clamp(2.35rem, 12vw, 3.4rem);
  }

  .lede {
    font-size: 0.95rem;
  }

  .cta-row {
    margin-top: 1.25rem;
    gap: 0.55rem;
  }

  .cta-row .btn {
    flex: 1 1 auto;
    min-height: 2.75rem;
    padding: 0.75rem 1rem;
  }

  .hero-photo {
    min-height: 180px;
  }

  footer {
    padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 1.25rem);
  }

  .auth-dialog,
  .confirm-dialog,
  .follow-list-dialog,
  .ingredients-dialog,
  .post-detail-dialog,
  .delete-dialog {
    width: calc(100% - 1.25rem);
    max-width: calc(100vw - 1.25rem);
    margin: auto;
    max-height: min(92dvh, 100%);
  }

  .auth-dialog {
    padding: 1.1rem 1rem;
  }

  .confirm-dialog .auth-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .btn {
    min-height: 2.65rem;
  }

  .notify-panel {
    position: fixed;
    top: calc(var(--header-h) + 0.35rem);
    right: max(0.5rem, env(safe-area-inset-right, 0px));
    left: max(0.5rem, env(safe-area-inset-left, 0px));
    width: auto;
    max-width: none;
    max-height: min(70dvh, 28rem);
  }

  body.day .main-nav {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 28px rgba(20, 32, 25, 0.1);
  }
}

.nav-link {
  position: relative;
  color: rgba(230, 235, 231, 0.62);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  transition: color var(--motion-fast) ease, background var(--motion-fast) ease,
    transform var(--motion-fast) var(--ease-out);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.15rem;
  height: 1.5px;
  background: var(--citrus);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease-out);
}

.nav-link:hover {
  color: var(--cream);
  background: rgba(230, 235, 231, 0.05);
}

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

.nav-link.active::after {
  transform: scaleX(1);
}

.auth-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-user-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 999px;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}

.nav-user-btn:hover,
.nav-user-btn:focus-visible {
  transform: translateY(-1px) scale(1.04);
  outline: none;
  box-shadow: 0 0 0 3px rgba(76, 174, 110, 0.28);
}

.nav-user-btn[hidden] {
  display: none !important;
}

.nav-user-avatar {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  overflow: hidden;
  border: 1.5px solid rgba(226, 176, 74, 0.55);
  background: linear-gradient(145deg, rgba(76, 174, 110, 0.35), rgba(226, 176, 74, 0.22));
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-sizing: border-box;
}

.nav-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 999px;
}

.nav-user-avatar.has-story {
  overflow: visible;
  padding: 2px;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--bg, #1a221c), var(--bg, #1a221c)) padding-box,
    linear-gradient(135deg, #f7b733, #fc4a1a 45%, #c471ed 90%) border-box;
}

.nav-user-avatar.has-story.story-seen {
  background:
    linear-gradient(var(--bg, #1a221c), var(--bg, #1a221c)) padding-box,
    linear-gradient(135deg, #8a8a8a, #bdbdbd) border-box;
}

.nav-user-avatar.has-story img,
.nav-user-avatar.has-story > span {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

body.day .nav-user-avatar {
  color: #1d2a22;
  border-color: rgba(76, 174, 110, 0.45);
}

body.day .nav-user-avatar.has-story {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #f7b733, #fc4a1a 45%, #c471ed 90%) border-box;
  border-color: transparent;
}

body.day .nav-user-avatar.has-story.story-seen {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #8a8a8a, #bdbdbd) border-box;
}

.auth-btn {
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(230, 235, 231, 0.04);
  color: var(--citrus);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s var(--ease-spring);
}

.theme-toggle:hover {
  background: rgba(226, 176, 74, 0.12);
  transform: rotate(-12deg) scale(1.05);
}

.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

.theme-toggle .icon-sun {
  display: none;
}

body.day .theme-toggle .icon-moon {
  display: none;
}

body.day .theme-toggle .icon-sun {
  display: block;
}

/* ?? Buttons ?? */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius);
  padding: 0.85rem 1.35rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s var(--ease-spring), background 0.25s ease,
    box-shadow 0.25s ease, border-color 0.25s ease;
}

.btn[hidden],
.auth-btn[hidden],
.nav-user-btn[hidden],
.notify-wrap[hidden] {
  display: none !important;
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.btn.primary {
  background: var(--citrus);
  color: #12150f;
  box-shadow: 0 6px 24px rgba(226, 176, 74, 0.28);
}

.btn.primary:hover {
  background: var(--citrus-hot);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(226, 176, 74, 0.38);
}

.btn.ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line-strong);
}

.btn.ghost:hover {
  background: rgba(230, 235, 231, 0.08);
  border-color: rgba(230, 235, 231, 0.35);
  transform: translateY(-1px);
}

.btn.danger {
  background: var(--danger);
  border: 1px solid var(--danger);
  color: #fff;
  box-shadow: 0 6px 20px rgba(224, 106, 90, 0.25);
}

.btn.danger:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

/* ?? Hero ?? */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3rem) clamp(1rem, 2.5vw, 1.5rem);
}

#home-hero[hidden],
body.slim-chrome #home-hero,
body.on-profile #home-hero,
body.on-messages #home-hero {
  display: none !important;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    min-height: min(56vh, 480px);
  }
}

.hero-copy {
  position: relative;
  z-index: 2;
  color: var(--cream);
}

.brand-hero {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.lede {
  margin: 0;
  max-width: 36rem;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.45;
  color: rgba(230, 235, 231, 0.78);
}

.cta-row {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-photo {
  position: relative;
  min-height: 240px;
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(4, 7, 6, 0.15), rgba(4, 7, 6, 0.55)),
    url("https://images.unsplash.com/photo-1546069901-ba9599a7e63c?auto=format&fit=crop&w=1600&q=80")
      center / cover;
  box-shadow: var(--shadow);
  animation: slow-zoom 22s ease-in-out infinite alternate;
}

/* ?? Panels ?? */
.panels {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.35rem clamp(1.25rem, 4vw, 3rem) 3rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(1.35rem, 3vw, 2.25rem);
  box-shadow: var(--shadow);
  animation: panel-in 0.55s var(--ease-out) both;
  scroll-margin-top: 4.75rem;
}

#match-ingredient-card,
#pantry-alerts-card {
  scroll-margin-top: 4.75rem;
}

.panel[hidden] {
  display: none !important;
}

.panel h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  letter-spacing: -0.03em;
}

.section-sub {
  margin: 0 0 1.75rem;
  max-width: 40rem;
  color: var(--muted);
}

.matcher > .section-sub {
  color: #b7c6bd;
  font-size: 0.98rem;
  line-height: 1.55;
}

body.day .matcher > .section-sub {
  color: #3f5348;
}

.favorites-panel h3,
.history-panel h3,
.badges-panel h3,
.leaderboard h3 {
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
}

.favorites-panel,
.history-panel {
  margin-top: 1.5rem;
}

.profile-columns .badges-panel {
  margin-top: 0;
  align-self: start;
}

.favorites-panel ul,
.history-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.favorites-panel li,
.history-panel li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

/* ?? Forms / matcher ?? */
.match-form {
  display: grid;
  gap: 1rem;
  max-width: 52rem;
}

.fridge-panel {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.fridge-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.fridge-panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.fridge-add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
}

.fridge-or-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.15rem 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.fridge-or-divider::before,
.fridge-or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.fridge-or-divider span {
  flex-shrink: 0;
}

#load-pantry-btn {
  position: relative;
}

#load-pantry-btn[title] {
  cursor: help;
}

.fridge-add-row input,
.filter-grid select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
}

.fridge-add-row input:focus,
.filter-grid select:focus {
  outline: none;
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px var(--leaf-dim);
}

.search-filters {
  padding-top: 0.5rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (min-width: 560px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .filter-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.filter-grid label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #a8b8af;
  min-width: 0;
}

body.day .filter-grid label {
  color: #4a5f54;
}

.filter-grid select {
  min-width: 0;
  max-width: 100%;
}

.missing-ingredients {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  background: rgba(220, 120, 80, 0.08);
  border: 1px solid rgba(220, 120, 80, 0.25);
  border-radius: var(--radius);
}

.missing-ingredients strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #e8a07a;
}

.missing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
}

.missing-list--subs {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.65rem;
}

.missing-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  padding: 0.25rem 0.55rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.missing-list--subs .missing-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius);
}

.missing-item-name {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.sub-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  width: 100%;
}

.sub-hint-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--leaf-bright);
}

.sub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sub-chip {
  appearance: none;
  border: 1px solid rgba(76, 174, 110, 0.35);
  background: rgba(76, 174, 110, 0.1);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.sub-chip:hover {
  background: rgba(76, 174, 110, 0.2);
  border-color: var(--leaf);
  transform: translateY(-1px);
}

.sub-chip.you-have {
  border-color: rgba(76, 174, 110, 0.55);
  background: rgba(76, 174, 110, 0.22);
  color: var(--leaf-bright);
  font-weight: 600;
}

body.day .sub-chip {
  color: var(--ink);
}

.missing-none {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  color: var(--leaf-bright);
  background: var(--leaf-dim);
  border: 1px solid rgba(76, 174, 110, 0.25);
  border-radius: var(--radius);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
}

textarea,
.pantry-form input,
.profile-form input,
.auth-dialog input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  resize: vertical;
  min-height: 6rem;
}

textarea:focus,
.pantry-form input:focus,
.profile-form input:focus,
.auth-dialog input:focus {
  outline: none;
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px var(--leaf-dim);
}

.btn.voice {
  width: 3.4rem;
  min-width: 3.4rem;
  padding: 0;
  background: var(--surface-3);
  color: var(--cream);
  border: 1px solid var(--line);
}

.btn.voice:hover {
  background: var(--leaf);
  color: #0a110e;
}

.btn.voice.listening {
  background: var(--danger);
  border-color: var(--danger);
  animation: pulse-mic 1.2s ease-in-out infinite;
}

.voice-hint {
  margin: -0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--leaf-bright);
}

.voice-hint.error {
  color: var(--danger);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.25s var(--ease-spring);
}

.chips button:hover {
  background: var(--leaf-dim);
  border-color: var(--leaf);
  color: var(--leaf-bright);
  transform: translateY(-2px);
}

.chips button.chip-added {
  transform: scale(0.94);
  background: var(--leaf);
  border-color: var(--leaf);
  color: #0a110e;
}

.prefs {
  margin: 0;
  padding: 1rem 0 0;
  border: none;
  border-top: 1px solid var(--line);
}

.prefs legend {
  padding: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.pref-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  margin-top: 0.75rem;
}

.pref-label {
  min-width: 3.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pref-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.pref-group input {
  accent-color: var(--leaf);
}

.status {
  margin-top: 1.25rem;
  color: var(--muted);
  animation: rise 0.35s var(--ease-out) both;
}

.status.error,
.error {
  color: var(--danger);
}

.summary {
  margin-top: 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  animation: rise 0.5s var(--ease-out) both;
}

.summary h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--leaf-bright);
  letter-spacing: -0.02em;
}

.stat span {
  font-size: 0.85rem;
  color: var(--muted);
}

.results {
  display: grid;
  gap: 1.75rem;
  margin-top: 2rem;
}

.results.loading::after {
  content: "";
  display: block;
  height: 120px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.recipe {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  margin: 0 -0.5rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid transparent;
  border-bottom: 1px solid var(--line);
  animation: rise 0.55s var(--ease-out) both;
  transition: background 0.3s ease, transform 0.35s var(--ease-out), border-color 0.3s ease;
  transform-style: preserve-3d;
}

.recipe:hover {
  background: var(--surface-2);
  border-color: var(--line);
  transform: translateY(-3px) translateZ(8px);
}

@media (min-width: 720px) {
  .recipe {
    grid-template-columns: 220px 1fr;
  }
}

.recipe img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-3);
  filter: brightness(0.88);
  transition: transform 0.5s var(--ease-out), filter 0.4s ease;
}

.recipe:hover img {
  transform: scale(1.03);
  filter: brightness(1);
}

.recipe-body h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.meta .score {
  color: var(--leaf-bright);
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius);
  background: var(--leaf-dim);
  color: var(--leaf-bright);
}

.tag.missing {
  background: var(--danger-dim);
  color: var(--danger);
}

.tag.pref {
  background: var(--citrus-dim);
  color: var(--citrus);
}

.steps-heading {
  margin: 0.85rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.ingredient-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: -0.35rem;
}

.ingredient-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease-spring);
}

.ingredient-pill:hover {
  border-color: var(--leaf);
  background: var(--leaf-dim);
  transform: translateY(-1px);
}

.ingredient-pill-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.ingredient-pill-remove {
  opacity: 0.55;
  font-size: 1rem;
  line-height: 1;
}

.ingredient-panel {
  margin: 0.85rem 0 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 14, 11, 0.35);
}

.ingredient-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.ingredient-panel-head .steps-heading {
  margin: 0;
}

.ingredient-match-pill {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--leaf-bright);
  background: var(--leaf-dim);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}

.ingredient-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.ingredient-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf), var(--leaf-bright));
  transition: width 0.35s ease;
}

.ingredient-groups {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .ingredient-groups {
    grid-template-columns: 1fr 1fr;
  }
}

.ingredient-group-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ingredient-group--have .ingredient-group-label {
  color: var(--leaf-bright);
}

.ingredient-group--need .ingredient-group-label {
  color: var(--citrus);
}

.ingredient-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.ingredient-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
}

.ingredient-row--have {
  background: rgba(107, 201, 138, 0.08);
  border-color: rgba(107, 201, 138, 0.18);
}

.ingredient-row--need {
  background: rgba(255, 193, 94, 0.06);
  border-color: rgba(255, 193, 94, 0.14);
}

.ingredient-row-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.ingredient-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.ingredient-row-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
}

.ingredient-row-amount {
  font-size: 0.78rem;
  color: var(--muted);
}

.ingredient-row-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.ingredient-row--have .ingredient-row-badge {
  color: var(--leaf-bright);
  background: var(--leaf-dim);
}

.ingredient-row--need .ingredient-row-badge {
  color: var(--citrus);
  background: var(--citrus-dim);
}

.steps,
.measurements {
  margin: 0 0 1rem;
  color: rgba(230, 235, 231, 0.82);
}

.measurements {
  list-style: none;
  padding: 0;
}

.measurements li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.88rem;
}

.measurements .ing-amount {
  color: var(--muted);
}

.measurements li.have .ing-name::before {
  content: "? ";
  color: var(--leaf-bright);
}

.measurements li.need .ing-name::before {
  content: "? ";
  color: var(--danger);
}

.steps {
  padding-left: 1.2rem;
}

.steps li::marker {
  color: var(--leaf-bright);
  font-weight: 600;
}

.video-link a {
  color: var(--leaf-bright);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(107, 201, 138, 0.35);
}

.recipe-video-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.65rem 0 0.85rem;
}

.recipe-video-btn,
.recipe-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  padding: 0.5rem 0.85rem;
}

.recipe-video-btn {
  border-color: rgba(255, 68, 68, 0.35);
  color: #ff8a8a;
}

.recipe-video-btn:hover {
  background: rgba(255, 68, 68, 0.12);
  border-color: rgba(255, 68, 68, 0.55);
  color: #ffb4b4;
}

.recipe-video-icon {
  font-size: 0.72rem;
  line-height: 1;
}

.fav-btn.is-favorited {
  border-color: rgba(255, 120, 160, 0.45);
  color: #ff9ec0;
  background: rgba(255, 120, 160, 0.1);
}

.fav-btn.is-favorited:hover {
  background: rgba(255, 120, 160, 0.16);
  border-color: rgba(255, 120, 160, 0.6);
  color: #ffc0d8;
}

.cook-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  padding: 0.5rem 0.85rem;
}

.cook-btn-icon {
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.cook-btn.is-cooked {
  border-color: rgba(76, 174, 110, 0.5);
  color: var(--leaf-bright, #6bc98a);
  background: rgba(76, 174, 110, 0.12);
}

.cook-btn.is-logging {
  opacity: 0.7;
  cursor: wait;
}

.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.recipe-actions .btn {
  font-size: 0.82rem;
  padding: 0.5rem 0.85rem;
}

/* ?? Dashboard / pantry / profile ?? */
.dashboard-grid {
  display: grid;
  gap: 1rem;
}

.dash-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease, box-shadow 0.3s ease;
  animation: rise 0.55s var(--ease-out) both;
}

.dash-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.dash-card.highlight {
  background: linear-gradient(135deg, var(--leaf-dim), var(--citrus-dim));
  border-color: rgba(76, 174, 110, 0.25);
}

.dash-card h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
}

/* ?? Dashboard ?? */
.dashboard-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dashboard-guest-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: rise 0.55s var(--ease-out) both;
}

.dashboard-guest-icon {
  display: block;
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.dashboard-guest-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
}

.dashboard-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(135deg, var(--leaf-dim), var(--surface-2) 55%, var(--citrus-dim));
  border: 1px solid rgba(76, 174, 110, 0.22);
  border-radius: var(--radius);
  animation: rise 0.5s var(--ease-out) both;
}

.dashboard-header-icon {
  font-size: 2.25rem;
  line-height: 1;
}

.dashboard-header-title {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

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

.dashboard-score-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(135deg, var(--leaf-dim), var(--citrus-dim));
  border-color: rgba(76, 174, 110, 0.25);
}

.score-ring {
  --score: 0;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  background: conic-gradient(var(--leaf-bright) calc(var(--score) * 1%), var(--line) 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  animation: rise 0.55s var(--ease-out) both;
}

.score-ring-inner {
  width: 5.75rem;
  height: 5.75rem;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.score-ring-inner strong {
  font-family: var(--font-display);
  font-size: 1.65rem;
  color: var(--leaf-bright);
}

.score-ring-inner span {
  font-size: 0.72rem;
  color: var(--muted);
}

.dashboard-score-copy {
  flex: 1 1 200px;
  min-width: 0;
}

.dashboard-score-copy h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
}

.dashboard-waste-bar {
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  margin: 0.85rem 0 0.35rem;
  overflow: hidden;
}

.dashboard-waste-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--leaf), var(--citrus));
  border-radius: 99px;
  transition: width 0.8s var(--ease-out);
}

.dashboard-waste-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.dashboard-month-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

.dashboard-stat-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease;
  animation: rise 0.55s var(--ease-out) both;
}

.dashboard-stat-card:nth-child(2) { animation-delay: 0.05s; }
.dashboard-stat-card:nth-child(3) { animation-delay: 0.1s; }
.dashboard-stat-card:nth-child(4) { animation-delay: 0.15s; }
.dashboard-stat-card:nth-child(5) { animation-delay: 0.2s; }

.dashboard-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.dashboard-stat-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--leaf-bright);
}

.dashboard-stat-card span {
  font-size: 0.78rem;
  color: var(--muted);
}

.dashboard-columns {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .dashboard-columns {
    grid-template-columns: 1fr 1fr;
  }
}

.dashboard-alltime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.dashboard-alltime-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--leaf-bright);
}

.dashboard-alltime-item span {
  font-size: 0.75rem;
  color: var(--muted);
}

.leaderboard-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease-out), border-color 0.25s ease;
}

.leaderboard-item:hover {
  transform: translateX(4px);
  border-color: var(--line-strong);
}

.leaderboard-item--me {
  background: var(--leaf-dim);
  border-color: rgba(76, 174, 110, 0.35);
}

.leaderboard-rank {
  font-size: 1.25rem;
  width: 2rem;
  text-align: center;
  flex-shrink: 0;
}

.leaderboard-body strong {
  display: block;
  font-size: 0.92rem;
  text-transform: capitalize;
}

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

.delete-warning {
  margin: 0 0 1rem;
  font-size: 0.88rem;
}

.delete-dialog .auth-actions {
  flex-wrap: wrap;
}

.mongo-banner {
  background: var(--danger-dim);
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid rgba(224, 106, 90, 0.25);
}

.pantry-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.pantry-form input {
  flex: 1 1 140px;
  width: auto;
}

.profile-form select {
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
}

.profile-form select {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.profile-country-hint {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.85rem;
}

.pantry-form label {
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
}

.pantry-form .btn {
  align-self: flex-end;
}

.pantry-list,
.leader-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pantry-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.alert-card {
  background: var(--citrus-dim);
  border-left: 3px solid var(--citrus);
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  border-radius: var(--radius);
}

.low-stock-msg,
.shopping-panel,
.shopping-inline {
  background: var(--leaf-dim);
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(76, 174, 110, 0.18);
  margin-top: 1rem;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  align-items: start;
}

.badge {
  text-align: center;
  padding: 0.7rem 0.55rem 0.75rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
  opacity: 0.45;
  font-size: 0.82rem;
  min-height: 0;
  height: auto;
}

.badge.earned {
  opacity: 1;
  background: var(--leaf-dim);
  border-color: rgba(76, 174, 110, 0.35);
}

.badge-icon {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.badge-rule {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.35;
}

.badge-progress {
  height: 4px;
  background: var(--line);
  border-radius: 99px;
  margin-top: 0.4rem;
  overflow: hidden;
}

.badges-panel h3 {
  margin: 0 0 0.65rem;
}

.badge-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--leaf), var(--citrus));
  border-radius: 99px;
  transition: width 0.6s var(--ease-out);
}

.badge-progress-label,
.badge-earned-label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.badge.earned .badge-earned-label {
  color: var(--leaf-bright);
  font-weight: 600;
}

/* ?? Profile ?? */
.profile-shell {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.profile-shell[hidden],
.profile-guest[hidden] {
  display: none !important;
}

.profile-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile-main {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}

.profile-aside {
  min-width: 0;
}

@media (min-width: 960px) {
  body.on-profile .panels {
    max-width: 920px;
  }
}

.profile-guest-card {
  text-align: center;
  padding: 2.75rem 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  animation: rise 0.55s var(--ease-out) both;
}

.profile-guest-icon {
  display: block;
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.profile-guest-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
}

.panel.profile,
.panel.messages-panel {
  padding-top: 1rem;
}

.profile-header {
  display: block;
  padding: 1.35rem 1.4rem;
  background:
    linear-gradient(160deg, rgba(76, 174, 110, 0.14), transparent 42%),
    var(--surface-2);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  animation: rise 0.45s var(--ease-out) both;
}

.profile-header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.25rem 1.5rem;
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 5.5rem;
  height: 5.5rem;
}

@media (min-width: 720px) {
  .profile-avatar-wrap {
    width: 6.25rem;
    height: 6.25rem;
  }
}

.profile-avatar,
.profile-avatar-wrap img.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(76, 174, 110, 0.45);
  box-shadow: 0 0 0 4px rgba(76, 174, 110, 0.12);
  box-sizing: border-box;
}

.profile-avatar-wrap.has-story .profile-avatar,
.profile-avatar-wrap.has-story img.profile-avatar-img {
  border-color: transparent;
  box-shadow: none;
  padding: 3px;
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(135deg, #f7b733, #fc4a1a 45%, #c471ed 90%) border-box;
  border: 3px solid transparent;
}

.profile-avatar-wrap.has-story.story-seen .profile-avatar,
.profile-avatar-wrap.has-story.story-seen img.profile-avatar-img {
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(135deg, #8a8a8a, #bdbdbd) border-box;
}

.profile-story-hit {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  padding: 0;
}

.profile-story-add {
  position: absolute;
  left: -2px;
  bottom: -2px;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
  background: #1a8cff;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  z-index: 3;
  padding: 0;
}

.profile-story-add:hover {
  transform: scale(1.06);
}

.profile-avatar {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--leaf-bright);
  background: var(--surface);
  flex-shrink: 0;
}

.profile-avatar-upload {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
  background: var(--leaf);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  z-index: 3;
}

.profile-avatar-upload:hover {
  transform: scale(1.06);
}

.profile-avatar-upload-icon {
  line-height: 1;
}

.profile-avatar-upload input {
  display: none;
}

.profile-identity {
  display: grid;
  gap: 0.4rem;
  flex: 1 1 220px;
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.profile-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  letter-spacing: -0.02em;
}

.profile-display-name {
  margin: -0.1rem 0 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: -0.01em;
}

body.day .profile-display-name {
  color: #1d2a22;
}

.profile-role {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--citrus);
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(226, 176, 74, 0.35);
  border-radius: 999px;
  background: rgba(226, 176, 74, 0.08);
}

.profile-meta {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.profile-social-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.4rem;
  margin: 0.25rem 0 0.15rem;
  padding: 0.55rem 0;
  border-top: 1px solid rgba(230, 235, 231, 0.08);
  border-bottom: 1px solid rgba(230, 235, 231, 0.08);
}

.profile-social-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 4.2rem;
}

.profile-social-stat--btn {
  border: 0;
  background: transparent;
  padding: 0.15rem 0.25rem;
  margin: -0.15rem -0.25rem;
  border-radius: 8px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
}

.profile-social-stat--btn:hover,
.profile-social-stat--btn:focus-visible {
  background: rgba(76, 174, 110, 0.12);
  outline: none;
}

.profile-social-stat strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--cream);
  line-height: 1;
}

.profile-social-stat span {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: none;
}

body.day .profile-social-stat strong {
  color: var(--ink);
}

.profile-edit-btn {
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: 999px;
}

.profile-edit-btn.is-open {
  background: rgba(76, 174, 110, 0.16);
  border-color: rgba(76, 174, 110, 0.4);
}

.profile-settings-icon {
  display: block;
}

.profile-edit-btn.is-open .profile-settings-icon {
  transform: rotate(30deg);
  transition: transform 0.25s var(--ease-out);
}

.profile-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.profile-badge--private {
  color: var(--citrus);
  border-color: rgba(226, 176, 74, 0.4);
  background: rgba(226, 176, 74, 0.1);
}

.profile-badge--inactive {
  color: var(--muted);
  background: rgba(128, 128, 128, 0.12);
}

.profile-edit-panel {
  display: grid;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface-2);
}

.profile-edit-panel[hidden] {
  display: none !important;
}

.profile-privacy-card h3,
.profile-bio-settings h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.profile-bio-settings {
  display: grid;
  gap: 0.45rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.profile-toggle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: 0.75rem;
}

.profile-toggle-label {
  min-width: 4.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.profile-toggle-group {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.profile-toggle-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.profile-toggle-btn.is-active {
  background: var(--leaf);
  color: #fff;
}

.profile-private-lock,
.profile-inactive-banner {
  text-align: center;
  padding: 2rem 1.25rem;
  border: 1px dashed var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface-2);
}

.profile-private-lock[hidden],
.profile-inactive-banner[hidden] {
  display: none !important;
}

.profile-private-lock h3,
.profile-inactive-banner h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
}

.follow-list-dialog {
  width: min(420px, 94vw);
  max-height: min(70vh, 560px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
  color: var(--ink);
}

.follow-list-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.follow-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.follow-list-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.follow-list-body {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  overflow-y: auto;
  max-height: min(55vh, 440px);
}

.follow-list-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.follow-list-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.6rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.follow-list-row:hover {
  background: rgba(76, 174, 110, 0.1);
}

.follow-list-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(76, 174, 110, 0.18);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.follow-list-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.follow-list-meta {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.follow-list-meta strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-bio-text {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  max-width: 40rem;
}

.profile-bio-empty {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}

.profile-bio-wrap {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.25rem;
  max-width: 30rem;
}

.profile-bio-view {
  display: grid;
  gap: 0.4rem;
  justify-items: start;
}

.profile-bio-view[hidden],
.profile-bio-form[hidden] {
  display: none !important;
}

.profile-bio-edit,
.profile-bio-cancel {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.profile-bio-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0;
  max-width: 30rem;
}

.profile-bio-form > label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.profile-bio-form .field-optional {
  font-weight: 400;
  opacity: 0.85;
}

#profile-display-name,
#profile-country {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  box-sizing: border-box;
}

#profile-display-name:focus,
#profile-country:focus {
  outline: none;
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px var(--leaf-dim);
}

body.day #profile-display-name,
body.day #profile-country {
  background: var(--surface);
  color: #1d2a22;
}

.profile-bio-form textarea,
#profile-bio {
  width: 100%;
  min-height: 2.8rem;
  max-height: 10rem;
  resize: vertical;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
  box-sizing: border-box;
}

body.day .profile-bio-form textarea,
body.day #profile-bio {
  background: var(--surface);
}

.profile-bio-form textarea:focus,
#profile-bio:focus {
  outline: none;
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px var(--leaf-dim);
}

.profile-bio-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.profile-bio-hint {
  font-size: 0.8rem;
}

.profile-bio-save {
  justify-self: start;
  min-width: 6.5rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

.profile-bio-save:disabled {
  opacity: 0.5;
  cursor: default;
}

.profile-action-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.profile-action-row[hidden] {
  display: none !important;
}

.profile-aside-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 1rem 1.05rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
}

.profile-aside-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.impact-dashboard-body {
  display: grid;
  gap: 1.1rem;
}

.impact-location {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.impact-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .impact-hero-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.impact-card {
  display: grid;
  gap: 0.35rem;
  padding: 1.15rem 1.2rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  background: var(--surface-2);
  animation: rise 0.45s var(--ease-out) both;
}

.impact-card--money {
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(226, 176, 74, 0.18) 0%, transparent 55%),
    var(--surface-2);
  border-color: rgba(226, 176, 74, 0.28);
}

.impact-card--waste {
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(76, 174, 110, 0.18) 0%, transparent 55%),
    var(--surface-2);
  border-color: rgba(76, 174, 110, 0.28);
}

.impact-card-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.impact-card-value {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.5vw, 2.1rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--cream);
}

.impact-card-value small {
  font-size: 0.55em;
  font-weight: 600;
  color: var(--muted);
}

body.day .impact-card-value {
  color: #1d2a22;
}

.impact-card-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.impact-month {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: rgba(0, 0, 0, 0.12);
}

body.day .impact-month {
  background: rgba(20, 40, 30, 0.04);
}

.impact-month h4 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1rem;
}

.impact-month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.impact-month-grid div {
  display: grid;
  gap: 0.15rem;
}

.impact-month-grid strong {
  font-size: 1.05rem;
}

.impact-month-grid span {
  font-size: 0.75rem;
  color: var(--muted);
}

.impact-footnote,
.impact-empty {
  margin: 0;
  font-size: 0.82rem;
}

.impact-empty {
  display: grid;
  gap: 0.35rem;
  padding: 1.25rem 0.5rem;
  text-align: center;
}

@media (max-width: 560px) {
  .impact-month-grid {
    grid-template-columns: 1fr;
  }
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.profile-stats-nudge {
  margin: 0;
  padding: 0.75rem 0.8rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(76, 174, 110, 0.35);
  background: rgba(76, 174, 110, 0.07);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.profile-stat-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
  animation: rise 0.4s var(--ease-out) both;
}

body.day .profile-stat-card {
  background: var(--surface);
}

.profile-stat-card:hover {
  border-color: var(--line-strong);
}

.profile-stat-card strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #9ee0b4;
  line-height: 1;
}

.profile-stat-card span {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
}

body.day .profile-stat-card strong {
  color: #1f7a45;
}

.profile-tabs {
  display: flex;
  gap: 0.15rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding: 0;
}

.profile-tabs[hidden] {
  display: none !important;
}

.profile-tab {
  position: relative;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}

.profile-tab[hidden] {
  display: none !important;
}

.profile-tab::after {
  content: "";
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: -1px;
  height: 2px;
  background: var(--citrus);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease-out);
}

.profile-tab:hover {
  color: var(--cream);
  background: transparent;
}

.profile-tab.active {
  color: var(--cream);
  background: transparent;
  border-color: transparent;
}

.profile-tab.active::after {
  transform: scaleX(1);
}

body.day .profile-tab:hover,
body.day .profile-tab.active {
  color: var(--ink);
}

.profile-tab-panel {
  animation: rise 0.35s var(--ease-out) both;
}

.profile-tab-panel[hidden] {
  display: none !important;
}

.profile-section-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.1rem 1.15rem 1.2rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
}

.profile-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.profile-section-head h3,
.profile-section-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.profile-section-sub {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
  line-height: 1.4;
}

.profile-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.profile-clear-btn {
  flex-shrink: 0;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}

.profile-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

@media (max-width: 560px) {
  .profile-posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.profile-posts-grid--empty {
  grid-template-columns: 1fr;
}

.profile-post-thumb {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-post-thumb:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.profile-post-thumb img,
.profile-post-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-post-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.4rem 0.45rem;
  font-size: 0.68rem;
  line-height: 1.25;
  color: #fff;
  text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
}

.profile-empty {
  text-align: center;
  padding: 2rem 1rem;
}

.profile-empty-icon {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.65rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 1rem;
}

.profile-empty p {
  margin: 0.25rem 0;
}

.profile-columns {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 768px) {
  .profile-columns {
    grid-template-columns: 1fr 1fr;
  }
}

.profile-edit-panel .profile-danger-card {
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.profile-danger-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.35rem;
  padding: 1rem 1.15rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid rgba(224, 106, 90, 0.28);
  background: linear-gradient(135deg, rgba(224, 106, 90, 0.08), var(--surface-2));
}

.profile-danger-card[hidden] {
  display: none !important;
}

.profile-danger-card h3 {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 0.98rem;
  color: var(--danger);
}

.profile-danger-copy p {
  margin: 0;
  max-width: 36rem;
  font-size: 0.86rem;
}

.profile-danger-card .btn.danger {
  flex-shrink: 0;
}

.profile-badges-link {
  display: inline-block;
  margin: 0.25rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--citrus);
  font: inherit;
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.profile-badges-link:hover,
.profile-badges-link:focus-visible {
  color: var(--citrus-hot);
  outline: none;
}

.profile-prefs-hint {
  margin: -0.35rem 0 1rem;
  font-size: 0.85rem;
}

.pref-chips {
  margin: 0.15rem 0 0.25rem;
}

.pref-chips-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.pref-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pref-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  animation: chipIn 0.35s var(--ease-out) both;
}

.pref-chip--allergy {
  border-color: rgba(224, 106, 90, 0.35);
  background: var(--danger-dim);
  color: var(--danger);
}

.pref-chip--cuisine {
  border-color: rgba(76, 174, 110, 0.3);
  background: var(--leaf-dim);
  color: var(--leaf-bright);
}

.pref-chips-empty {
  margin: 0;
  font-size: 0.85rem;
}

.profile-prefs-status {
  margin: 0;
  font-size: 0.85rem;
}

.profile-favorites,
.profile-history {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.profile-recipe-card,
.profile-history-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease-out), border-color 0.25s ease;
}

.profile-recipe-card:hover,
.profile-history-item:hover {
  transform: translateX(4px);
  border-color: var(--line-strong);
}

.profile-recipe-card--link {
  align-items: center;
}

.profile-recipe-open {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.profile-recipe-open:hover strong {
  color: var(--leaf-bright, #6bc98a);
}

.profile-recipe-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.profile-recipe-body strong,
.profile-history-body strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.profile-recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.profile-recipe-tag {
  padding: 0.15rem 0.45rem;
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid var(--line);
}

.profile-recipe-date {
  color: var(--muted);
}

.profile-history-date {
  flex-shrink: 0;
  width: 4.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
  padding-top: 0.15rem;
}

.profile-item-actions {
  flex-shrink: 0;
  align-self: center;
}

.profile-item-actions .btn {
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}

.profile-recipe-body,
.profile-history-body {
  flex: 1;
  min-width: 0;
}

.profile-top-bar {
  margin-bottom: 0.65rem;
}

.profile-top-bar[hidden],
.profile-back-btn[hidden] {
  display: none !important;
}

.profile-back-btn {
  font-size: 0.85rem;
}

.profile-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.profile-inline-form input {
  flex: 1 1 140px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.profile-restaurants {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.profile-restaurant-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.profile-restaurant-icon {
  font-size: 1.35rem;
}

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

.profile-restaurant-body strong {
  display: block;
  font-size: 0.92rem;
}

.profile-restaurant-body span {
  font-size: 0.78rem;
  color: var(--muted);
}

.post-username-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.post-username-link:hover {
  color: var(--leaf-bright);
}

.post-save-restaurant {
  font-size: 0.72rem;
  margin-left: auto;
}

.post-detail-dialog {
  width: min(560px, calc(100vw - 1.5rem));
  max-height: min(92dvh, 920px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface-2);
  color: var(--text);
  overflow: hidden;
}

.post-detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.post-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface-2);
  z-index: 1;
}

.post-detail-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.post-detail-body {
  max-height: calc(92vh - 3.5rem);
  overflow: auto;
  padding: 0.75rem;
}

.post-detail-body .post-card {
  margin: 0;
  border: none;
  background: transparent;
}

.post-detail-body .post-comments {
  max-height: none;
}

.post-detail-body .post-comments-list {
  max-height: min(280px, 35vh);
}

.profile-post-thumb {
  cursor: pointer;
}

.profile-post-thumb:focus-visible {
  outline: 2px solid var(--leaf-bright);
  outline-offset: 2px;
}

/* ?? Pantry ?? */
.pantry-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pantry-guest-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: rise 0.55s var(--ease-out) both;
}

.pantry-guest-icon {
  display: block;
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.pantry-guest-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
}

.pantry-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(135deg, var(--citrus-dim), var(--surface-2) 60%, var(--leaf-dim));
  border: 1px solid rgba(232, 168, 56, 0.22);
  border-radius: var(--radius);
  animation: rise 0.5s var(--ease-out) both;
}

.pantry-header-icon {
  font-size: 2.25rem;
  line-height: 1;
}

.pantry-header-title {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

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

.pantry-quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.pantry-stat-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease;
  animation: rise 0.55s var(--ease-out) both;
}

.pantry-stat-card:nth-child(2) { animation-delay: 0.05s; }
.pantry-stat-card:nth-child(3) { animation-delay: 0.1s; }
.pantry-stat-card:nth-child(4) { animation-delay: 0.15s; }
.pantry-stat-card:nth-child(5) { animation-delay: 0.2s; }

.pantry-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.pantry-stat-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--leaf-bright);
}

.pantry-stat-card span {
  font-size: 0.75rem;
  color: var(--muted);
}

.pantry-stat-card--warn strong { color: var(--citrus); }
.pantry-stat-card--danger strong { color: var(--danger); }
.pantry-stat-card--ok strong { color: var(--leaf-bright); }

.pantry-columns {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .pantry-columns {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1100px) {
  .pantry-columns {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.pantry-add-hint,
.pantry-add-card h3,
.pantry-scan-card h3,
.pantry-alerts-card h3,
.pantry-items-card h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
}

.pantry-add-hint {
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.pantry-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.pantry-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease-out), border-color 0.25s ease;
}

.pantry-item:hover {
  transform: translateX(4px);
  border-color: var(--line-strong);
}

.pantry-item--expired { border-left: 3px solid var(--danger); }
.pantry-item--today { border-left: 3px solid var(--citrus); }
.pantry-item--soon { border-left: 3px solid #e8a838; }
.pantry-item--week { border-left: 3px solid var(--leaf); }
.pantry-item--fresh { border-left: 3px solid rgba(76, 174, 110, 0.35); }

.pantry-item-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.pantry-item-body {
  flex: 1;
  min-width: 0;
}

.pantry-item-body strong {
  display: block;
  text-transform: capitalize;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.pantry-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.pantry-expiry-badge {
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.72rem;
}

.pantry-expiry-badge--expired {
  background: var(--danger-dim);
  color: var(--danger);
}

.pantry-expiry-badge--today,
.pantry-expiry-badge--soon {
  background: var(--citrus-dim);
  color: var(--citrus);
}

.pantry-expiry-badge--week,
.pantry-expiry-badge--fresh {
  background: var(--leaf-dim);
  color: var(--leaf-bright);
}

.pantry-item-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.pantry-item-actions .btn {
  font-size: 0.78rem;
  padding: 0.4rem 0.65rem;
}

.alert-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.alert-card-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.alert-card-date {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.alert-card--expired {
  background: var(--danger-dim);
  border-left-color: var(--danger);
}

.alert-card--today,
.alert-card--soon {
  background: var(--citrus-dim);
  border-left-color: var(--citrus);
}

.alert-card--week,
.alert-card--fresh {
  background: var(--leaf-dim);
  border-left-color: var(--leaf);
}

.pantry-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

.pantry-empty--compact {
  padding: 1.25rem 0.5rem;
}

.pantry-empty span {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.pantry-empty p {
  margin: 0.25rem 0;
}

.fridge-alert-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s var(--ease-spring), border-color 0.2s ease;
}

.auth-icon-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.auth-icon-count,
#fridge-alert-count {
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #e06a5a;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

@media (max-width: 720px) {
  .auth-icon-label {
    display: none;
  }
}

.fridge-alert-btn[hidden] {
  display: none !important;
}

.fridge-alert-btn.has-alerts {
  border-color: rgba(224, 106, 90, 0.35);
  background: rgba(224, 106, 90, 0.12);
  color: #f0a898;
}

.fridge-alert-btn:hover {
  background: rgba(224, 106, 90, 0.22);
  transform: translateY(-1px);
}

#fridge-alert-count[hidden] {
  display: none !important;
}

.notify-wrap {
  position: relative;
}

.notify-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
}

.notify-btn:hover {
  border-color: var(--line-strong);
}

.notify-count {
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #e06a5a;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

.notify-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  width: min(360px, 92vw);
  max-height: 420px;
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  z-index: 120;
  animation: rise 0.25s var(--ease-out) both;
}

.notify-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface-2);
}

.notify-read-all {
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
}

.notify-list {
  display: flex;
  flex-direction: column;
}

.notify-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  color: inherit;
  font: inherit;
  width: 100%;
}

.notify-item:hover {
  background: var(--surface);
}

.notify-item.unread {
  background: rgba(76, 174, 110, 0.06);
}

.notify-item-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.notify-item-body {
  flex: 1;
  min-width: 0;
}

.notify-item-body p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.notify-item-time {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
  display: block;
}

.notify-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.fridge-notify-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: rgba(76, 174, 110, 0.08);
  border: 1px solid rgba(76, 174, 110, 0.25);
  border-radius: var(--radius);
}

.fridge-notify-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.expiry-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.expiry-preset {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.expiry-preset:hover {
  background: var(--leaf-dim);
  border-color: var(--leaf);
}

.fridge-alerts-hint {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
}

.low-stock-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.low-stock-chip {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px dashed rgba(76, 174, 110, 0.45);
  background: var(--surface);
  color: var(--leaf-bright);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  text-transform: capitalize;
}

.low-stock-chip:hover {
  background: var(--leaf-dim);
  transform: translateY(-1px);
}

.shopping-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.shopping-item-num {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--leaf-dim);
  color: var(--leaf-bright);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.shopping-item-body strong {
  display: block;
  text-transform: capitalize;
  font-size: 0.92rem;
}

.shopping-item-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.shopping-total {
  margin: 1rem 0 0;
  font-weight: 600;
  color: var(--leaf-bright);
  font-size: 0.95rem;
}

.leader-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.leader-list li span {
  color: var(--leaf-bright);
  font-weight: 600;
  margin-right: 0.35rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  color: var(--muted);
}

/* ?? Auth / toast / footer ?? */
.auth-dialog {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.35rem 1.5rem;
  max-width: 400px;
  width: calc(100% - 2rem);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  animation: dialog-in 0.35s var(--ease-out) both;
}

.auth-dialog::backdrop {
  background: rgba(4, 8, 6, 0.72);
  backdrop-filter: blur(6px);
}

.confirm-dialog {
  max-width: 360px;
}

.confirm-dialog-message {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-line;
}

.confirm-dialog .auth-actions {
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.confirm-dialog .auth-actions .btn {
  min-width: 6.5rem;
}

.auth-dialog form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-dialog h3 {
  margin: 0;
  font-family: var(--font-display);
}

.auth-subtitle {
  margin: -0.25rem 0 0.15rem;
  font-size: 0.86rem;
}

.auth-dialog label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.88rem;
}

.auth-hint {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.auth-hint[hidden],
#auth-confirm-wrap[hidden],
#auth-social[hidden] {
  display: none !important;
}

.auth-social {
  display: grid;
  gap: 0.65rem;
  justify-items: stretch;
}

.google-signin-btn {
  display: grid;
  justify-items: center;
  min-height: 2.5rem;
}

.auth-facebook-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: #1877f2;
  border-color: #1877f2;
  color: #fff;
}

.auth-facebook-btn:hover {
  filter: brightness(1.05);
}

.auth-facebook-btn[hidden] {
  display: none !important;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.55rem;
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auth-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: var(--danger-dim);
  border: 1px solid rgba(224, 106, 90, 0.28);
}

.auth-error[hidden] {
  display: none !important;
}

.toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: min(340px, calc(100vw - 2rem));
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
  max-width: 280px;
  font-size: 0.88rem;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast.error,
.toast.toast--error {
  border-color: rgba(224, 106, 90, 0.45);
  color: var(--danger);
}

.toast--rich {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  max-width: min(340px, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  pointer-events: auto;
}

.toast-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.toast-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.toast-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.toast-text {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
}

.toast--warn {
  border-color: rgba(226, 176, 74, 0.5);
  background:
    linear-gradient(135deg, rgba(226, 176, 74, 0.14), transparent 60%),
    var(--surface-2);
}

.toast--warn .toast-title {
  color: var(--citrus-hot);
}

.toast--success {
  border-color: rgba(76, 174, 110, 0.45);
  background:
    linear-gradient(135deg, rgba(76, 174, 110, 0.12), transparent 60%),
    var(--surface-2);
}

.toast--success .toast-title {
  color: var(--leaf-bright);
}

.toast--error .toast-title {
  color: var(--danger);
}

.pantry-scan-empty {
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  text-align: center;
  padding: 1.1rem 0.9rem 1rem;
  border-radius: 12px;
  border: 1px dashed rgba(226, 176, 74, 0.45);
  background:
    radial-gradient(ellipse 80% 70% at 50% 0%, rgba(226, 176, 74, 0.12), transparent 60%),
    var(--surface-2);
  animation: pantry-scan-empty-in 0.35s var(--ease-out);
}

@keyframes pantry-scan-empty-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pantry-scan-empty-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 1.35rem;
  background: var(--citrus-dim);
  border: 1px solid rgba(226, 176, 74, 0.35);
  margin-bottom: 0.15rem;
}

.pantry-scan-empty h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--citrus-hot);
}

.pantry-scan-empty p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 16rem;
}

.pantry-scan-empty-tips {
  margin: 0.35rem 0 0.55rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--ink);
}

.pantry-scan-empty-tips li::before {
  content: "? ";
  color: var(--citrus);
}

footer {
  padding: 0 clamp(1.25rem, 4vw, 3rem) 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

footer .muted,
.muted {
  color: var(--muted);
  opacity: 0.85;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ?? Day mode ?? */
body.day {
  color-scheme: light;
  --bg-void: #eef2ef;
  --bg-deep: #e4ebe6;
  --bg-mid: #d8e4dc;
  --surface: #ffffff;
  --surface-2: #f4f7f5;
  --surface-3: #eaf0ec;
  --ink: #142019;
  --cream: #142019;
  --muted: #5c6e64;
  --line: rgba(20, 32, 25, 0.1);
  --line-strong: rgba(20, 32, 25, 0.18);
  --leaf: #2f7a4d;
  --leaf-bright: #3d9a62;
  --shadow: 0 18px 40px rgba(20, 40, 30, 0.12);
}

body.day .night-sky {
  background:
    radial-gradient(ellipse 90% 55% at 80% -5%, rgba(120, 180, 140, 0.25) 0%, transparent 55%),
    linear-gradient(175deg, #e8f0ea 0%, #dce8e0 50%, #d0ddd4 100%);
}

body.day .night-sky::before {
  opacity: 0;
}

body.day .top {
  background: rgba(238, 242, 239, 0.85);
  color: var(--ink);
}

body.day .top.scrolled {
  background: rgba(255, 255, 255, 0.94);
}

body.day .nav-link {
  color: rgba(20, 32, 25, 0.55);
}

body.day .nav-link:hover,
body.day .nav-link.active,
body.day .brand,
body.day .btn.ghost {
  color: var(--ink);
}

body.day .lede,
body.day .steps {
  color: rgba(20, 32, 25, 0.72);
}

body.day .hero-photo {
  filter: brightness(1.05) saturate(0.95);
}

/* ?? Keyframes ?? */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chipIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes soft-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes star-drift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-4%);
  }
}

@keyframes pulse-mic {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@keyframes slow-zoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.06);
  }
}

@media (max-width: 720px) {
  .hero-copy {
    max-width: 100%;
  }
}

.inline-link {
  color: var(--leaf-bright);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(107, 201, 138, 0.35);
}

.inline-link:hover {
  color: var(--leaf);
}

.ingredient-panel--compact {
  margin-bottom: 0.85rem;
}

.ingredient-preview-list {
  list-style: none;
  margin: 0.65rem 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.ingredient-preview-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: rgba(230, 235, 231, 0.88);
}

.ingredient-preview-item--have span:last-child::before {
  content: "? ";
  color: var(--leaf-bright);
}

.ingredient-view-all {
  width: 100%;
  margin-top: 0.35rem;
}

.ingredient-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
}

.ingredient-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.ingredient-table thead {
  background: rgba(255, 255, 255, 0.04);
}

.ingredient-table th {
  text-align: left;
  padding: 0.55rem 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.ingredient-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.ingredient-table tbody tr:last-child td {
  border-bottom: none;
}

.ingredient-table-row--have {
  background: rgba(107, 201, 138, 0.06);
}

.ingredient-table-row--need {
  background: rgba(255, 193, 94, 0.04);
}

.ingredient-table-category {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* ?? Ingredients page ?? */
.ingredients-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ingredients-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(135deg, var(--leaf-dim), var(--surface-2) 55%, var(--citrus-dim));
  border: 1px solid rgba(107, 201, 138, 0.22);
  border-radius: var(--radius);
  animation: rise 0.5s var(--ease-out) both;
}

.ingredients-header-icon {
  font-size: 2.25rem;
  line-height: 1;
}

.ingredients-header-title {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.ingredients-header-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.ingredients-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.75rem;
}

.ingredients-stat-card {
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  animation: rise 0.45s var(--ease-out) both;
}

.ingredients-stat-card:nth-child(2) { animation-delay: 0.04s; }
.ingredients-stat-card:nth-child(3) { animation-delay: 0.08s; }
.ingredients-stat-card:nth-child(4) { animation-delay: 0.12s; }
.ingredients-stat-card:nth-child(5) { animation-delay: 0.16s; }

.ingredients-stat-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--leaf-bright);
}

.ingredients-stat-card span {
  font-size: 0.78rem;
  color: var(--muted);
}

.ingredients-layout {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 980px) {
  .ingredients-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: start;
  }
}

.ingredients-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ingredients-selected-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ingredients-selected-head h3,
.ingredients-library-head h3,
.ingredients-pantry-card h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
}

.ingredients-selected-hint {
  margin: 0;
  font-size: 0.85rem;
}

.ingredients-selected-list {
  min-height: 8rem;
}

.ingredients-add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.ingredients-add-form input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-body);
}

.ingredients-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.ingredients-library-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.ingredients-search {
  min-width: min(100%, 14rem);
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-body);
}

.ingredients-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.ingredients-category-tab {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ingredients-category-tab:hover,
.ingredients-category-tab.active {
  background: var(--leaf-dim);
  border-color: var(--leaf);
  color: var(--leaf-bright);
}

.ingredients-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.55rem;
  max-height: 28rem;
  overflow: auto;
  padding-right: 0.15rem;
}

.ingredients-catalog-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s ease, background 0.2s ease;
}

.ingredients-catalog-item:hover {
  transform: translateY(-2px);
  border-color: var(--leaf);
}

.ingredients-catalog-item.is-selected {
  background: var(--leaf-dim);
  border-color: var(--leaf);
}

.ingredients-catalog-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.ingredients-catalog-name {
  font-weight: 600;
  font-size: 0.88rem;
  text-transform: capitalize;
}

.ingredients-catalog-cat {
  font-size: 0.72rem;
  color: var(--muted);
}

.ingredients-pantry-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ingredients-pantry-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
}

.ingredients-pantry-chip.is-selected {
  background: var(--citrus-dim);
  border-color: var(--citrus);
}

.ingredients-pantry-chip-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.ingredients-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.ingredients-empty--compact {
  padding: 1.25rem;
}

.ingredients-empty span {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.ingredients-empty p {
  margin: 0.2rem 0;
}

.ingredients-selection-table .ingredients-remove {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

.ingredients-dialog {
  width: min(720px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.ingredients-dialog::backdrop {
  background: rgba(4, 8, 6, 0.72);
  backdrop-filter: blur(4px);
}

.ingredients-dialog-inner {
  padding: 1.1rem 1.25rem 1.25rem;
}

.ingredients-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ingredients-dialog-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--leaf-bright);
}

.ingredients-dialog-head h3 {
  margin: 0;
  font-family: var(--font-display);
}

.ingredients-dialog-body .ingredient-panel {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.fridge-alerts-hint {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
}

/* ?? Food Posts ?? */
.posts-panel {
  padding-top: 1rem;
}

.posts-section-sub {
  margin-bottom: 1rem;
  max-width: 36rem;
}

.posts-shell {
  --post-card-max: 470px;
  --reel-w: min(100%, 340px);
  --reel-h: calc(var(--reel-w) * 16 / 9);
  --post-media-ratio: 4 / 5;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 640px;
}

.posts-guest-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.35rem;
  background: rgba(226, 176, 74, 0.12);
  border: 1px solid rgba(226, 176, 74, 0.45);
  border-left: 3px solid var(--citrus);
  border-radius: var(--radius);
  color: var(--ink);
}

.posts-guest-banner[hidden] {
  display: none !important;
}

.posts-guest-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  background: rgba(226, 176, 74, 0.18);
  color: var(--citrus);
}

.posts-guest-icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.posts-guest-banner p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.posts-guest-banner .btn {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  color: var(--citrus-hot);
  text-decoration: underline;
  font-size: inherit;
  font-weight: 600;
}

.posts-toolbar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.posts-tab {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.posts-tab:hover {
  color: var(--ink);
  background: rgba(230, 235, 231, 0.06);
  border-color: var(--line-strong);
}

.posts-search-row {
  position: relative;
}

.posts-search-row input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.user-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 50;
  max-height: 280px;
  overflow: auto;
}

.user-search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.user-search-item:last-child {
  border-bottom: none;
}

.user-search-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--leaf-dim);
  color: var(--leaf-bright);
  font-weight: 700;
  font-size: 0.75rem;
  overflow: hidden;
  flex-shrink: 0;
}

.user-search-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-search-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.user-search-body strong {
  display: block;
  font-size: 0.88rem;
}

.user-search-body span {
  font-size: 0.75rem;
  color: var(--muted);
}

.user-search-follow {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0.3rem 0.55rem;
}

.posts-tab.active {
  background: linear-gradient(145deg, var(--leaf-bright), var(--leaf));
  border-color: transparent;
  color: #041208;
  box-shadow: 0 4px 14px rgba(76, 174, 110, 0.28);
}

.posts-compose {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(160deg, rgba(76, 174, 110, 0.08), transparent 42%),
    var(--surface-2);
  overflow: hidden;
  animation: rise 0.45s var(--ease-out) both;
}

.posts-compose.is-expanded {
  padding: 0;
  border-color: rgba(76, 174, 110, 0.28);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.posts-compose-prompt {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--motion-fast) ease, color var(--motion-fast) ease;
}

.posts-compose-prompt[hidden] {
  display: none !important;
}

.posts-compose-prompt:hover,
.posts-compose-prompt:focus-visible {
  background: rgba(76, 174, 110, 0.1);
  color: var(--ink);
  outline: none;
  border-color: transparent;
}

.posts-compose-prompt-avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--leaf);
  color: #041208;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(76, 174, 110, 0.35);
}

.posts-compose-prompt-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.posts-compose-prompt-text {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.posts-compose-prompt-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.posts-compose-body {
  padding: 1.15rem 1.2rem 1.25rem;
  display: grid;
  gap: 1rem;
  animation: panel-in var(--motion) var(--ease-out) both;
}

.posts-compose-body[hidden] {
  display: none !important;
}

.compose-head {
  display: grid;
  gap: 0.25rem;
}

.compose-head.posts-compose-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0;
}

.compose-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--leaf-bright);
}

.compose-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.15;
}

.compose-lead {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 36rem;
}

.posts-compose-collapse {
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  flex-shrink: 0;
}

.field-optional {
  font-weight: 500;
  color: var(--muted);
  opacity: 0.85;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
}

.post-type-toggle {
  display: inline-flex;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  margin: 0;
  gap: 0.15rem;
  width: fit-content;
}

.post-type-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--motion-fast) ease, color var(--motion-fast) ease;
}

.post-type-btn:hover {
  color: var(--ink);
}

.post-type-btn.is-active {
  background: var(--leaf);
  color: #041208;
}

.post-reel-hint {
  margin: -0.35rem 0 0;
  font-size: 0.78rem;
}

.post-reel-hint[hidden] {
  display: none !important;
}

.post-form {
  display: grid;
  gap: 0.95rem;
}

.compose-field {
  display: grid;
  gap: 0.4rem;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.compose-field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.compose-field input,
.compose-field textarea,
.surplus-form input,
.surplus-form textarea,
.post-form textarea,
.post-form input[type="text"] {
  width: 100%;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: rgba(0, 0, 0, 0.22);
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background var(--motion-fast) ease;
}

.compose-field input:focus,
.compose-field textarea:focus,
.surplus-form input:focus,
.surplus-form textarea:focus,
.post-form textarea:focus,
.post-form input[type="text"]:focus {
  outline: none;
  border-color: rgba(76, 174, 110, 0.55);
  box-shadow: var(--focus-ring);
  background: rgba(0, 0, 0, 0.3);
}

.compose-field--hero input {
  font-size: 1.02rem;
  padding: 0.9rem 1rem;
}

.compose-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.15rem;
}

.compose-submit {
  min-width: 9.5rem;
}

body.day .posts-tab.active {
  color: #041208;
}

body.day .posts-guest-banner {
  background: rgba(226, 176, 74, 0.16);
  color: #1d2a22;
}

.post-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.post-form-meta {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px dashed rgba(230, 235, 231, 0.14);
  background: rgba(0, 0, 0, 0.12);
}

.post-form-meta-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.post-media-label {
  position: relative;
  display: block;
  cursor: pointer;
}

.post-media-label input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.post-media-drop {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 1.6rem 1rem;
  text-align: center;
  border: 1.5px dashed rgba(76, 174, 110, 0.4);
  border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(180deg, rgba(76, 174, 110, 0.1), transparent 70%),
    rgba(0, 0, 0, 0.18);
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.post-media-label:hover .post-media-drop,
.post-media-label:focus-within .post-media-drop {
  border-color: rgba(76, 174, 110, 0.75);
  background:
    linear-gradient(180deg, rgba(76, 174, 110, 0.16), transparent 70%),
    rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.post-media-drop-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--leaf-dim);
  color: var(--leaf-bright);
  margin-bottom: 0.2rem;
}

.post-media-drop-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.post-media-drop-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.post-media-preview {
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--line);
  max-height: 320px;
  background: #000;
}

.post-media-preview.has-media + .post-media-label,
.post-form:has(.post-media-preview:not([hidden])) .post-media-drop {
  padding: 0.85rem 1rem;
}

.post-form:has(.post-media-preview:not([hidden])) .post-media-drop-icon,
.post-form:has(.post-media-preview:not([hidden])) .post-media-drop-hint {
  display: none;
}

.post-form:has(.post-media-preview:not([hidden])) .post-media-drop {
  display: flex;
  justify-content: center;
  padding: 0.65rem;
}

.post-form:has(.post-media-preview:not([hidden])) .post-media-drop-title {
  font-size: 0.82rem;
  color: var(--muted);
}

.post-media-preview img,
.post-media-preview video {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.posts-feed {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.posts-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.posts-empty span {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.post-card {
  width: 100%;
  max-width: var(--post-card-max);
  margin-inline: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  animation: rise 0.45s var(--ease-out) both;
}

.post-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.5rem;
}

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

.post-delete {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.post-delete:hover {
  color: #e06a5a;
  border-color: rgba(224, 106, 90, 0.35);
}

.post-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--leaf-dim);
  color: var(--leaf-bright);
  font-weight: 700;
  flex-shrink: 0;
}

.post-date {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

/* Photos + regular videos: same 4:5 frame */
.post-media-stage {
  width: 100%;
  aspect-ratio: var(--post-media-ratio);
  background: #050807;
  overflow: hidden;
}

.post-media {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  display: block;
  background: #000;
}

/* Inline reel: same 9:16 frame as Reels tab */
.reel-inline-stage {
  display: grid;
  place-items: center;
  background: #050807;
  width: 100%;
  padding: 0.85rem 0;
}

.post-media--reel {
  width: var(--reel-w);
  height: var(--reel-h);
  max-width: var(--reel-w);
  max-height: var(--reel-h);
  margin: 0 auto;
  object-fit: cover;
  background: #000;
  display: block;
  border-radius: 14px;
}

.post-card--reel {
  max-width: var(--post-card-max);
  margin-inline: auto;
}

.post-detail-body {
  --post-card-max: 100%;
  --reel-w: min(100%, 340px);
  --reel-h: calc(var(--reel-w) * 16 / 9);
}

.post-detail-body .post-card {
  max-width: 100%;
}

.post-detail-body .post-media-stage {
  border-radius: 0;
}

.post-detail-body .post-media--reel {
  border-radius: 14px;
}

.post-detail-body .reel-inline-stage {
  padding: 0.75rem 0;
}

.post-tag--reel {
  background: rgba(226, 176, 74, 0.16);
  color: var(--citrus);
  border: 1px solid rgba(226, 176, 74, 0.35);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

/* ?? Reels tab: Instagram-style player ?? */
body.on-reels {
  overflow: hidden;
}

body.on-reels .night-sky,
body.on-reels .grain {
  opacity: 0.35;
}

body.on-reels .panels {
  max-width: none;
  padding: 0;
  margin: 0;
}

body.on-reels footer {
  display: none !important;
}

body.on-reels .posts-panel > h2,
body.on-reels .posts-section-sub,
body.on-reels .posts-guest-banner,
body.on-reels .posts-search-row,
body.on-reels .posts-compose,
body.on-reels #posts-status {
  display: none !important;
}

body.on-reels .posts-panel {
  padding: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: #030605;
  box-shadow: none;
  min-height: calc(100dvh - var(--header-h));
}

body.on-reels .posts-shell {
  --reel-w: min(92vw, calc((100dvh - var(--header-h) - 5rem) * 9 / 16), 360px);
  --reel-h: min(calc(100dvh - var(--header-h) - 5rem), calc(var(--reel-w) * 16 / 9));
  max-width: none;
  gap: 0;
  height: calc(100dvh - var(--header-h));
  max-height: calc(100vh - var(--header-h));
}

body.on-reels .posts-toolbar {
  position: relative;
  z-index: 5;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  background: rgba(4, 7, 6, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.posts-feed--reels {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  background: #030605;
  -webkit-overflow-scrolling: touch;
}

.reel-slide {
  flex: 0 0 auto;
  width: 100%;
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  background: #030605;
}

.reel-player {
  position: relative;
  width: var(--reel-w);
  height: var(--reel-h);
  max-width: var(--reel-w);
  max-height: var(--reel-h);
  background: #000;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 24px 80px rgba(0, 0, 0, 0.55);
}

.reel-backdrop {
  display: none;
  pointer-events: none;
}

.reel-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}

.reel-mute-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.reel-safe {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 4.5rem 0.85rem 1.35rem;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.35) 0%,
    transparent 18%,
    transparent 55%,
    rgba(0, 0, 0, 0.72) 100%
  );
}

.reel-meta {
  flex: 1;
  min-width: 0;
  pointer-events: auto;
  max-width: calc(100% - 4.5rem);
}

.reel-author {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
}

.reel-avatar {
  width: 2rem;
  height: 2rem;
  font-size: 0.8rem;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.reel-author-text {
  min-width: 0;
}

.reel-username {
  color: #fff !important;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.reel-author .post-date {
  color: rgba(255, 255, 255, 0.72);
}

.reel-caption {
  margin: 0 0 0.4rem;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  white-space: pre-wrap;
}

.reel-tags {
  margin: 0;
}

.reel-tags .post-tag {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.reel-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  pointer-events: auto;
  padding-bottom: 0.25rem;
}

.reel-action {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 3rem;
  padding: 0.2rem !important;
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 0.72rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.reel-action-icon {
  font-size: 1.45rem;
  line-height: 1;
}

.reel-action.is-liked {
  color: #ff6b7a !important;
}

.reel-comments {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  max-height: 45%;
  overflow: auto;
  padding: 0.75rem;
  background: rgba(8, 14, 11, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
}

.posts-feed--reels .posts-empty {
  margin: auto;
  color: rgba(255, 255, 255, 0.75);
}

.posts-empty--reels {
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  padding: 2.75rem 1.25rem;
  border: 1px dashed rgba(76, 174, 110, 0.35);
  border-radius: calc(var(--radius) + 8px);
  background:
    linear-gradient(160deg, rgba(76, 174, 110, 0.1), transparent 55%),
    var(--surface-2);
}

.posts-empty--reels .btn {
  margin-top: 0.55rem;
}

/* Mobile: full-bleed Reels tab; feed keeps shared frames */
@media (max-width: 767px) {
  .posts-shell {
    --post-card-max: 100%;
    --reel-w: min(100%, 300px);
    --reel-h: calc(var(--reel-w) * 16 / 9);
  }

  body.on-reels .top {
    background: rgba(0, 0, 0, 0.55);
  }

  body.on-reels .posts-shell {
    --reel-w: 100%;
    --reel-h: 100%;
    height: calc(100dvh - var(--header-h) - var(--bottom-nav-h));
  }

  body.on-reels .posts-toolbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
    border: 0;
    padding-top: max(0.45rem, env(safe-area-inset-top, 0px));
  }

  body.on-reels .posts-tab {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
  }

  body.on-reels .posts-tab.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
  }

  .posts-feed--reels {
    height: 100%;
  }

  .reel-slide {
    width: 100%;
    height: 100%;
    min-height: 100%;
    padding: 0;
  }

  body.on-reels .reel-player {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }

  .reel-safe {
    padding:
      max(4.5rem, calc(env(safe-area-inset-top, 0px) + 3.75rem))
      max(0.85rem, env(safe-area-inset-right, 0.85rem))
      max(1.35rem, calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 0.75rem))
      max(0.85rem, env(safe-area-inset-left, 0.85rem));
  }

  .reel-inline-stage {
    padding: 0.65rem 0;
  }
}

/* Tablet / desktop: shared phone frame for feed + Reels */
@media (min-width: 768px) {
  .posts-shell {
    --reel-w: min(100%, 360px);
    --reel-h: calc(var(--reel-w) * 16 / 9);
  }

  body.on-reels .posts-shell {
    --reel-w: min(380px, calc((100dvh - var(--header-h) - 5rem) * 9 / 16));
    --reel-h: min(calc(100dvh - var(--header-h) - 5rem), calc(var(--reel-w) * 16 / 9));
  }

  .posts-feed--reels {
    padding: 0;
    background:
      radial-gradient(ellipse 55% 48% at 50% 48%, rgba(36, 58, 46, 0.4) 0%, transparent 68%),
      #030605;
  }

  .reel-slide {
    height: 100%;
    min-height: 100%;
    padding: clamp(0.5rem, 1.5vh, 1rem) clamp(0.75rem, 2vw, 1.5rem);
  }

  .reel-player {
    border-radius: 18px;
  }

  .reel-safe {
    padding: 1.15rem 1rem 1.2rem;
  }
}

.post-body {
  padding: 0.85rem 1rem 1rem;
}

.post-caption {
  margin: 0 0 0.65rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.post-tags,
.post-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.post-tag {
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.post-tag--recipe {
  border-color: rgba(76, 174, 110, 0.35);
}

.post-tag--restaurant {
  border-color: rgba(120, 160, 220, 0.35);
}

.post-hashtag {
  font-size: 0.78rem;
  color: var(--leaf-bright);
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.post-actions .btn {
  font-size: 0.78rem;
  padding: 0.35rem 0.6rem;
}

.post-like.is-liked,
.post-bookmark.is-saved {
  color: #f0a898;
  border-color: rgba(224, 106, 90, 0.35);
}

.post-comments {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.post-comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
}

.post-comment {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.post-comment-body {
  flex: 1;
  min-width: 0;
}

.post-comment-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.post-comment-time {
  font-size: 0.72rem;
  color: var(--muted);
}

.post-comment-text {
  margin: 0.2rem 0 0;
  line-height: 1.45;
  word-break: break-word;
}

.post-comment strong {
  font-size: 0.8rem;
  color: var(--leaf-bright);
}

.post-comment--reply {
  margin-left: 1.25rem;
  padding-left: 0.65rem;
  border-left: 2px solid rgba(76, 174, 110, 0.25);
}

.post-comment-reply-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.post-comment-edited {
  font-size: 0.68rem;
  color: var(--muted);
  font-style: italic;
}

.post-comment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.post-comment-like.is-liked {
  color: #f0a898;
  border-color: rgba(224, 106, 90, 0.35);
}

.post-comment-like-count {
  font-size: 0.72rem;
  color: var(--muted);
}

.post-comment-actions .btn {
  font-size: 0.68rem;
  padding: 0.2rem 0.35rem;
  line-height: 1.2;
}

.post-mention {
  color: var(--leaf-bright);
  font-weight: 600;
}

.post-comment-reply-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.45rem;
  background: var(--leaf-dim);
  border: 1px solid rgba(76, 174, 110, 0.25);
  border-radius: var(--radius);
  font-size: 0.8rem;
}

.post-comment-reply-hint strong {
  color: var(--leaf-bright);
}

.post-comment-edit {
  width: 100%;
  display: grid;
  gap: 0.45rem;
}

.post-comment-edit-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.post-comment-edit-actions {
  display: flex;
  gap: 0.35rem;
}

.post-comment-delete {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  color: var(--muted);
  line-height: 1;
}

.post-comment-delete:hover {
  color: #e06a5a;
  border-color: rgba(224, 106, 90, 0.35);
}

.post-comment-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.post-comment-form input {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
}

/* ?? Messages ?? */
.nav-badge {
  min-width: 1.05rem;
  height: 1.05rem;
  margin-left: 0.25rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--citrus);
  color: #1a1408;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
}

.messages-panel {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1rem 2rem;
}

.messages-guest {
  display: grid;
  place-items: center;
  min-height: 50vh;
}

.messages-guest[hidden],
.messages-shell[hidden],
.messages-chat-empty[hidden],
.messages-chat-active[hidden] {
  display: none !important;
}

.messages-shell {
  height: calc(100vh - var(--header-h) - 2.25rem);
  min-height: 420px;
  max-height: 820px;
}

.messages-panel.panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.messages-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  animation: rise 0.45s var(--ease-out) both;
}

.messages-inbox {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(76, 174, 110, 0.06), transparent 120px),
    var(--surface-2);
  min-height: 0;
}

.messages-inbox-head {
  padding: 1.1rem 1.1rem 0.35rem;
}

.messages-inbox-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.messages-inbox-sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
}

.msg-search-wrap {
  position: relative;
  margin: 0.55rem 0.9rem 0.65rem;
}

.msg-user-search {
  width: 100%;
  padding: 0.65rem 2rem 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.msg-user-search:focus {
  outline: none;
  border-color: rgba(76, 174, 110, 0.55);
  box-shadow: 0 0 0 3px rgba(76, 174, 110, 0.16);
}

.msg-search-clear {
  position: absolute;
  top: 0.45rem;
  right: 0.4rem;
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.msg-search-clear:hover {
  color: var(--ink);
  background: var(--leaf-dim);
}

.msg-user-results {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  animation: rise 0.2s var(--ease-out) both;
}

.msg-user-result {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.msg-user-result:last-child {
  border-bottom: 0;
}

.msg-user-result:hover,
.msg-user-result:focus-visible {
  background: var(--leaf-dim);
  outline: none;
}

.msg-user-result-meta {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.msg-user-result-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-user-result-meta .muted {
  font-size: 0.75rem;
}

.msg-conversation-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0.15rem 0 0.85rem;
  scrollbar-width: thin;
}

.msg-conversation-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.msg-conversation-item:hover {
  background: rgba(76, 174, 110, 0.08);
}

.msg-conversation-item.active {
  background: var(--leaf-dim);
  border-left-color: var(--leaf);
}

.msg-conversation-item.unread strong {
  color: var(--ink);
}

.msg-conversation-item.unread .msg-conversation-preview {
  color: var(--cream);
  font-weight: 500;
}

.msg-avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--surface-3), rgba(76, 174, 110, 0.18));
  color: var(--leaf-bright);
  font-size: 0.72rem;
  font-weight: 700;
  overflow: hidden;
  border: 1px solid var(--line);
}

.msg-avatar-lg {
  width: 2.65rem;
  height: 2.65rem;
  font-size: 0.8rem;
}

.msg-avatar-short {
  width: 2.85rem;
  height: 2.85rem;
  font-size: 0.85rem;
  box-shadow: 0 0 0 2px rgba(76, 174, 110, 0.28);
}

.msg-handle {
  color: var(--leaf-bright);
  font-weight: 600;
}

.msg-chat-peer.is-short-name .msg-chat-peer-meta strong {
  font-size: 1.05rem;
}

.msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-conversation-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.msg-conversation-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.msg-conversation-top strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.94rem;
}

.msg-conversation-time {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.msg-conversation-preview {
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-unread-badge {
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: var(--leaf);
  color: #041208;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

.msg-empty {
  display: grid;
  gap: 0.25rem;
  padding: 1.5rem 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.msg-empty strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.messages-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background:
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(76, 174, 110, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(226, 176, 74, 0.05), transparent 50%),
    var(--surface);
}

.messages-chat-empty {
  flex: 1;
  display: grid;
  place-content: center;
  padding: 2rem 1.25rem;
  animation: rise 0.5s var(--ease-out) both;
}

.messages-chat-empty-card {
  width: min(100%, 400px);
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  text-align: center;
  color: var(--muted);
  padding: 1.75rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(16, 28, 23, 0.55);
}

.messages-chat-empty-art {
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: 0.35rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(226, 176, 74, 0.35), transparent 45%),
    radial-gradient(circle at 70% 70%, rgba(76, 174, 110, 0.35), transparent 50%),
    var(--surface-2);
  border: 1px solid var(--line);
}

.messages-chat-empty h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ink);
}

.messages-chat-empty p {
  margin: 0;
  max-width: 22rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.messages-chat-active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  animation: rise 0.28s var(--ease-out) both;
}

.messages-chat-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 28, 23, 0.78);
  backdrop-filter: blur(10px);
}

.msg-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s var(--ease-spring);
}

.msg-icon-btn svg {
  width: 1.05rem;
  height: 1.05rem;
}

.msg-icon-btn:hover {
  transform: translateY(-1px);
}

.msg-delete-chat-btn {
  position: relative;
  flex-shrink: 0;
}

.msg-chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}

.msg-delete-chat-btn:hover,
.msg-delete-chat-btn:focus-visible {
  color: #e06a5a;
  border-color: rgba(224, 106, 90, 0.45);
  background: rgba(224, 106, 90, 0.12);
}

.msg-delete-chat-btn::after {
  content: attr(title);
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  background: #101c17;
  border: 1px solid var(--line);
  color: var(--cream);
  font-size: 0.72rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 4;
}

.msg-delete-chat-btn:hover::after,
.msg-delete-chat-btn:focus-visible::after {
  opacity: 1;
  transform: none;
}

.msg-back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 1.05rem;
  cursor: pointer;
  flex-shrink: 0;
}

.msg-back-btn:hover {
  background: var(--leaf-dim);
  border-color: rgba(76, 174, 110, 0.35);
}

.msg-chat-peer {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.2rem 0.45rem 0.2rem 0.15rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.msg-chat-peer:hover {
  background: rgba(76, 174, 110, 0.1);
}

.msg-chat-peer-meta {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.msg-chat-peer-meta strong {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-chat-peer-hint {
  font-size: 0.72rem;
}

.msg-thread {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
  scrollbar-width: thin;
}

.msg-day-sep {
  display: flex;
  justify-content: center;
  margin: 0.65rem 0 0.4rem;
}

.msg-day-sep span {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(16, 28, 23, 0.65);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.msg-bubble {
  position: relative;
  max-width: min(78%, 30rem);
  align-self: flex-start;
  padding: 0.62rem 0.85rem 0.45rem;
  border-radius: 16px 16px 16px 5px;
  background: rgba(230, 235, 231, 0.08);
  border: 1px solid rgba(230, 235, 231, 0.14);
  color: var(--ink);
  animation: msgIn 0.28s var(--ease-out) both;
}

.msg-bubble:not(.mine) {
  background: #1a2220;
  border-color: rgba(230, 235, 231, 0.12);
}

.msg-delete-btn {
  position: absolute;
  top: 0.2rem;
  right: 0.25rem;
  width: 1.35rem;
  height: 1.35rem;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--cream);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.msg-bubble.mine {
  align-self: flex-end;
  padding-right: 1.6rem;
  background: linear-gradient(160deg, rgba(76, 174, 110, 0.42), rgba(76, 174, 110, 0.22));
  border-color: rgba(76, 174, 110, 0.5);
  border-radius: 16px 16px 5px 16px;
}

.msg-bubble.mine:hover .msg-delete-btn,
.msg-bubble.mine:focus-within .msg-delete-btn,
.msg-delete-btn:focus-visible {
  opacity: 1;
}

.msg-delete-btn:hover,
.msg-delete-btn:focus-visible {
  background: rgba(224, 106, 90, 0.85);
  outline: none;
}

@media (hover: none) {
  .msg-delete-btn {
    opacity: 0.85;
  }
}

.msg-bubble.clustered {
  margin-top: 0.12rem;
}

.msg-bubble.has-next time {
  display: none;
}

.msg-bubble p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.93rem;
  line-height: 1.4;
}

.msg-bubble time {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.66rem;
  color: var(--muted);
  text-align: right;
}

.msg-thread-empty {
  margin: auto 0;
}

.msg-compose-form {
  display: grid;
  gap: 0.55rem;
  padding: 0.8rem 0.95rem 0.95rem;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(76, 174, 110, 0.05), transparent 55%),
    rgba(12, 22, 18, 0.72);
  backdrop-filter: blur(12px);
}

.msg-compose-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: end;
  padding: 0.45rem 0.45rem 0.45rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.msg-compose-box:focus-within {
  border-color: rgba(76, 174, 110, 0.55);
  box-shadow: 0 0 0 3px rgba(76, 174, 110, 0.14);
}

  .msg-emoji-panel {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .msg-sticker-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .msg-sticker {
    font-size: 3.5rem;
  }

.msg-attach-btn {
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s var(--ease-spring);
}

.msg-attach-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.msg-attach-btn:hover {
  color: var(--leaf-bright);
  background: var(--leaf-dim);
  transform: translateY(-1px);
}

.msg-attach-btn.recording {
  color: #fff;
  background: #e06a5a;
  animation: msgPulse 1s ease infinite;
}

.msg-attach-btn.recording:hover {
  color: #fff;
  background: #d45748;
}

.msg-attach-btn.is-open {
  color: var(--leaf-bright);
  background: var(--leaf-dim);
}

.msg-emoji-picker {
  display: grid;
  gap: 0.55rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  animation: msg-emoji-picker-in 0.22s var(--ease-out) both;
}

.msg-emoji-toolbar {
  display: grid;
  gap: 0.4rem;
}

.msg-emoji-search {
  width: 100%;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--cream);
  font: inherit;
  font-size: 0.82rem;
}

.msg-emoji-search:focus {
  outline: none;
  border-color: rgba(76, 174, 110, 0.5);
  box-shadow: 0 0 0 3px rgba(76, 174, 110, 0.12);
}

.msg-emoji-search[hidden] {
  display: none !important;
}

.msg-sticker-pack-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
}

.msg-sticker-pack-tabs[hidden] {
  display: none !important;
}

.msg-sticker-pack-tab {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.msg-sticker-pack-tab img,
.msg-sticker-pack-tab span {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  font-size: 1.2rem;
  line-height: 1;
}

.msg-sticker-pack-tab.active,
.msg-sticker-pack-tab:hover {
  border-color: rgba(76, 174, 110, 0.45);
  background: rgba(76, 174, 110, 0.12);
  transform: translateY(-1px);
}

.msg-emoji-empty {
  grid-column: 1 / -1;
  padding: 1rem 0.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.msg-sticker-pack-head {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.1rem;
  margin-bottom: 0.15rem;
}

.msg-sticker-pack-head strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.msg-sticker-pack-head .muted {
  font-size: 0.75rem;
}

.msg-sticker-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.msg-emoji-picker[hidden] {
  display: none !important;
}

@keyframes msg-emoji-picker-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.msg-emoji-picker-tabs {
  display: flex;
  gap: 0.35rem;
}

.msg-emoji-tab {
  flex: 1;
  padding: 0.4rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.msg-emoji-tab:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.04);
}

.msg-emoji-tab.active {
  color: var(--leaf-bright);
  background: var(--leaf-dim);
  border-color: rgba(76, 174, 110, 0.28);
}

.msg-emoji-panel {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.25rem;
  max-height: 180px;
  overflow: auto;
  padding-right: 0.15rem;
}

.msg-emoji-item {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s var(--ease-spring);
}

.msg-emoji-item img {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
}

.msg-emoji-item:hover,
.msg-emoji-item:focus-visible {
  background: rgba(76, 174, 110, 0.14);
  transform: scale(1.08);
  outline: none;
}

.msg-sticker-panel {
  display: grid;
  gap: 0.35rem;
  max-height: 240px;
  overflow: auto;
}

.msg-sticker-item {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 20%, rgba(76, 174, 110, 0.12), transparent 60%),
    var(--surface);
  color: var(--cream);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s var(--ease-spring);
}

.msg-sticker-item img,
.msg-sticker-item span {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
  font-size: 1.85rem;
  line-height: 1;
}

.msg-sticker-item small {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
}

.msg-sticker-item:hover,
.msg-sticker-item:focus-visible {
  border-color: rgba(76, 174, 110, 0.4);
  background: rgba(76, 174, 110, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.msg-bubble-sticker,
.msg-bubble-emoji {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  padding: 0.2rem 0.35rem 0.35rem;
}

.msg-bubble-sticker.mine,
.msg-bubble-emoji.mine {
  background: transparent !important;
}

.msg-sticker {
  display: block;
  font-size: 4.2rem;
  line-height: 1;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22));
  animation: msg-sticker-pop 0.28s var(--ease-spring) both;
}

.msg-sticker-img {
  display: block;
  width: min(7.5rem, 42vw);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.28));
  animation: msg-sticker-pop 0.28s var(--ease-spring) both;
}

.msg-emoji-only {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1.15;
}

.msg-react-btn {
  position: absolute;
  top: 0.2rem;
  left: 0.25rem;
  width: 1.35rem;
  height: 1.35rem;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--cream);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 2;
}

.msg-bubble.mine .msg-react-btn {
  left: auto;
  right: 1.7rem;
}

.msg-bubble:hover .msg-react-btn,
.msg-bubble.is-reacting .msg-react-btn,
.msg-bubble:focus-within .msg-react-btn {
  opacity: 1;
}

.msg-reaction-bar {
  position: absolute;
  top: -2.15rem;
  left: 0;
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.28rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  z-index: 5;
}

.msg-bubble.mine .msg-reaction-bar {
  left: auto;
  right: 0;
}

.msg-bubble.is-reacting .msg-reaction-bar {
  display: inline-flex;
}

.msg-reaction-bar[hidden] {
  display: none !important;
}

.msg-bubble.is-reacting .msg-reaction-bar[hidden] {
  display: inline-flex !important;
}

.msg-react-quick {
  width: 1.85rem;
  height: 1.85rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s var(--ease-spring);
}

.msg-react-quick:hover {
  background: rgba(76, 174, 110, 0.14);
  transform: scale(1.12);
}

.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.4rem;
}

.msg-reactions[hidden] {
  display: none !important;
}

.msg-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(16, 28, 23, 0.7);
  color: var(--cream);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.msg-reaction-chip span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}

.msg-reaction-chip.is-mine {
  border-color: rgba(76, 174, 110, 0.5);
  background: rgba(76, 174, 110, 0.16);
}

.msg-bubble.has-reactions {
  margin-bottom: 0.15rem;
}

@keyframes msg-sticker-pop {
  from {
    opacity: 0;
    transform: scale(0.86);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

body.day .msg-emoji-picker {
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 40, 30, 0.12);
}

body.day .msg-emoji-tab:hover {
  color: #1d2a22;
  background: rgba(20, 40, 30, 0.04);
}

body.day .msg-sticker-item {
  background: #f4f7f5;
  color: #1d2a22;
}

.msg-send-btn {
  display: inline-grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--leaf-bright), var(--leaf));
  color: #041208;
  cursor: pointer;
  transition: transform 0.18s var(--ease-spring), filter 0.18s ease, opacity 0.18s ease;
}

.msg-send-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.1rem;
}

.msg-send-btn:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.04);
  filter: brightness(1.05);
}

.msg-send-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.msg-attach-preview {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 2.3rem 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  animation: rise 0.22s var(--ease-out) both;
}

.msg-attach-preview img,
.msg-attach-preview video {
  max-width: 148px;
  max-height: 96px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.msg-attach-preview audio {
  width: min(100%, 240px);
}

.msg-attach-doc-chip {
  display: grid;
  gap: 0.1rem;
  font-size: 0.85rem;
}

.msg-attach-doc-chip span {
  color: var(--muted);
  font-size: 0.75rem;
}

.msg-attach-remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 1.55rem;
  height: 1.55rem;
  border: 0;
  border-radius: 8px;
  background: rgba(224, 106, 90, 0.18);
  color: #e06a5a;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

@keyframes msgPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.msg-compose-form textarea {
  width: 100%;
  min-height: 2.55rem;
  max-height: 140px;
  resize: none;
  padding: 0.65rem 0.35rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
}

.msg-compose-form textarea:focus {
  outline: none;
  box-shadow: none;
}

.msg-compose-form textarea::placeholder {
  color: var(--muted);
}

.msg-bubble.has-media {
  max-width: min(88%, 22rem);
  padding: 0.4rem 0.45rem 0.4rem;
}

.msg-bubble.has-media p {
  padding: 0 0.4rem;
}

.msg-bubble.has-media time {
  padding: 0 0.4rem;
}

.msg-media-image {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.3rem;
}

.msg-media-video {
  display: block;
  width: 100%;
  max-height: 280px;
  border-radius: 12px;
  margin-bottom: 0.3rem;
  background: #000;
}

.msg-media-voice {
  position: relative;
  margin-bottom: 0.3rem;
  padding: 0.45rem 0.5rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
  min-width: 200px;
}

.msg-media-voice audio {
  width: 100%;
  min-width: 180px;
  height: 2.25rem;
}

.msg-media-voice.is-loading audio {
  opacity: 0.35;
}

.msg-voice-skeleton {
  display: none;
  align-items: center;
  gap: 0.35rem;
  height: 2.25rem;
  padding: 0 0.25rem;
}

.msg-media-voice.is-loading .msg-voice-skeleton {
  display: flex;
  position: absolute;
  inset: 0.45rem 0.5rem;
  pointer-events: none;
}

.msg-voice-skeleton span {
  display: block;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(230, 235, 231, 0.18);
  animation: msgPulse 1s ease infinite;
}

.msg-voice-skeleton span:nth-child(1) { width: 18%; }
.msg-voice-skeleton span:nth-child(2) { width: 42%; animation-delay: 0.12s; }
.msg-voice-skeleton span:nth-child(3) { width: 22%; animation-delay: 0.24s; }

.msg-voice-duration {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: var(--muted);
  text-align: right;
}

.msg-media-doc {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.3rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.14);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.msg-media-doc:hover {
  border-color: rgba(76, 174, 110, 0.45);
  background: rgba(76, 174, 110, 0.1);
}

.msg-media-doc-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(76, 174, 110, 0.28), rgba(76, 174, 110, 0.12));
  color: var(--leaf-bright);
}

.msg-media-doc-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.msg-media-doc-meta {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.msg-media-doc-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}

.msg-media-doc-meta span {
  color: var(--muted);
  font-size: 0.72rem;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

body.day .messages-layout,
body.day .messages-chat {
  background: #fff;
  box-shadow: 0 16px 40px rgba(20, 40, 30, 0.08);
}

body.day .messages-inbox {
  background:
    linear-gradient(180deg, rgba(76, 174, 110, 0.08), transparent 120px),
    #f3f7f4;
}

body.day .messages-chat-head {
  background: rgba(255, 255, 255, 0.88);
}

body.day .msg-compose-form {
  background:
    linear-gradient(180deg, rgba(76, 174, 110, 0.06), transparent 55%),
    rgba(255, 255, 255, 0.92);
}

body.day .msg-compose-box {
  background: #fff;
  box-shadow: 0 1px 0 rgba(20, 40, 30, 0.04);
}

body.day .msg-media-voice,
body.day .msg-media-doc {
  background: rgba(20, 40, 30, 0.04);
}

body.day .msg-day-sep span {
  background: #eef2ef;
}

body.day .messages-chat-empty-card {
  background: #f7f9f8;
}

body.day .msg-bubble:not(.mine) {
  background: #f1f3f2;
  border-color: rgba(20, 40, 30, 0.1);
  color: #1d2a22;
}

body.day .msg-bubble.mine {
  background: linear-gradient(160deg, rgba(76, 174, 110, 0.32), rgba(76, 174, 110, 0.18));
  border-color: rgba(76, 174, 110, 0.42);
}

body.day .msg-conversation-item.unread .msg-conversation-preview {
  color: #1d2a22;
}

@media (max-width: 760px) {
  .messages-panel {
    padding: 0.5rem 0.65rem calc(var(--bottom-nav-h) + 1rem);
  }

  .messages-shell {
    height: calc(100dvh - var(--header-h) - var(--bottom-nav-h) - 1rem);
    max-height: none;
  }

  .messages-layout {
    grid-template-columns: 1fr;
    border-radius: calc(var(--radius) + 2px);
  }

  .messages-layout:not(.chat-open) .messages-chat {
    display: none;
  }

  .messages-layout.chat-open .messages-inbox {
    display: none;
  }

  .msg-back-btn {
    display: inline-flex;
  }

  .messages-chat-active {
    min-height: 100%;
  }

  .msg-compose-box {
    grid-template-columns: 1fr auto;
    border-radius: 16px;
    padding: 0.4rem;
  }

  .msg-attach-tools {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding: 0 0.15rem 0.1rem;
  }

  .msg-compose-form textarea {
    padding-left: 0.55rem;
  }

  .msg-emoji-panel {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .msg-sticker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .msg-sticker {
    font-size: 3.5rem;
  }

  .msg-sticker-img {
    width: min(6.5rem, 46vw);
  }

  .msg-reaction-bar {
    top: -2.35rem;
  }
}

@media (max-width: 600px) {
  .post-form-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body {
    opacity: 1;
    transform: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal],
  .hero-photo {
    animation: none !important;
    transform: none !important;
  }
}

/* ?? Meal plan ?? */
.meal-plan-panel .section-sub {
  color: #b7c6bd;
}

body.day .meal-plan-panel .section-sub {
  color: #3f5348;
}

.meal-plan-controls {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.meal-plan-days {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.meal-plan-days-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #a8b8af;
  margin-right: 0.25rem;
}

.meal-plan-day-btn {
  appearance: none;
  min-width: 2.4rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.meal-plan-day-btn:hover {
  border-color: var(--line-strong);
}

.meal-plan-day-btn.active {
  background: var(--leaf-dim);
  border-color: var(--leaf);
  color: var(--leaf-bright);
}

.meal-plan-filters {
  margin: 0;
}

.meal-plan-ingredients textarea {
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  resize: vertical;
  min-height: 4rem;
}

.meal-plan-ingredients textarea:focus {
  outline: none;
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px var(--leaf-dim);
}

.meal-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.meal-plan-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 900px) {
  .meal-plan-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.meal-plan-day {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}

.meal-plan-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.meal-plan-day-head strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.meal-plan-day-count {
  font-size: 0.75rem;
  color: #a8b8af;
}

.meal-plan-slots {
  display: grid;
  gap: 0.65rem;
}

.meal-plan-slot-row {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
}

.meal-plan-slot-row--empty {
  opacity: 0.85;
}

.meal-plan-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.meal-plan-slot {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--leaf-bright);
}

.meal-plan-slot-empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.meal-plan-recipe {
  display: grid;
  grid-template-columns: 3.75rem 1fr;
  gap: 0.65rem;
  align-items: start;
}

.meal-plan-recipe img {
  width: 3.75rem;
  height: 3.75rem;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  background: var(--surface-2);
}

.meal-plan-recipe-body {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}

.meal-plan-recipe-body h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.3;
  font-family: var(--font-display);
}

.meal-plan-meta {
  font-size: 0.76rem;
  color: #a8b8af;
}

body.day .meal-plan-meta,
body.day .meal-plan-day-count {
  color: #4a5f54;
}

.meal-plan-missing {
  font-size: 0.76rem;
  color: #e8a07a;
}

.meal-plan-day-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.meal-plan-day-actions .btn {
  font-size: 0.74rem;
  padding: 0.3rem 0.55rem;
}

.meal-plan-grocery {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.meal-plan-grocery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.meal-plan-grocery-head h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.meal-plan-grocery-hint {
  margin: 0;
  font-size: 0.85rem;
  max-width: 36rem;
}

.meal-plan-grocery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.meal-plan-grocery-list {
  display: grid;
  gap: 0.45rem;
}

.grocery-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.55rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
}

.grocery-item.is-checked {
  opacity: 0.55;
}

.grocery-item.is-checked strong {
  text-decoration: line-through;
}

.grocery-item input {
  margin-top: 0.2rem;
  accent-color: var(--leaf);
}

.grocery-item-body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.grocery-item-body strong {
  font-size: 0.92rem;
}

.grocery-meta,
.grocery-sub {
  font-size: 0.76rem;
  color: #a8b8af;
}

.grocery-sub {
  color: var(--leaf-bright);
}

body.day .grocery-meta {
  color: #4a5f54;
}

.meal-plan-grocery-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--leaf-bright);
}

.meal-plan-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  grid-column: 1 / -1;
}

.meal-plan-day--empty {
  justify-content: center;
  min-height: 8rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.pref-banner {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  color: var(--leaf-bright);
  background: rgba(76, 174, 110, 0.1);
  border: 1px solid rgba(76, 174, 110, 0.28);
  border-radius: var(--radius);
}

.pref-recommend-label {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--leaf-bright);
}

.profile-restaurants--recommended {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.profile-restaurant-card--rec {
  border-color: rgba(76, 174, 110, 0.35);
}

/* ?? Discover restaurants ?? */
.restaurants-panel .section-sub {
  color: #b7c6bd;
  max-width: 42rem;
}

body.day .restaurants-panel .section-sub {
  color: #3f5348;
}

.discover-controls {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0 1.1rem;
}

.discover-location-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.discover-location-row input[type="search"] {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
}

.discover-location-row input[type="search"]:focus {
  outline: none;
  border-color: var(--leaf);
}

#discover-query {
  width: 100%;
  max-width: 28rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
}

.discover-suggestions {
  display: grid;
  gap: 0.2rem;
  max-width: 36rem;
  padding: 0.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.discover-suggestion {
  appearance: none;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  padding: 0.55rem 0.65rem;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
}

.discover-suggestion:hover {
  background: var(--leaf-dim);
}

.discover-filters--simple {
  grid-template-columns: repeat(2, minmax(140px, 220px));
  max-width: 28rem;
}

.discover-filters {
  margin: 0;
}

.discover-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.45rem;
  padding-top: 1.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.discover-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--leaf);
}

.discover-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1rem;
  align-items: start;
  min-height: 28rem;
}

.discover-map {
  height: min(68vh, 560px);
  min-height: 280px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--surface-2);
  z-index: 1;
}

.discover-map-fallback {
  height: 100%;
  display: grid;
  place-content: center;
  gap: 0.35rem;
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
}

.discover-map .leaflet-container {
  height: 100%;
  width: 100%;
  font: inherit;
  background: #0c1813;
}

body.day .discover-map .leaflet-container {
  background: #d8e4dc;
}

.discover-side {
  position: relative;
  display: grid;
  gap: 0.75rem;
  height: min(68vh, 560px);
  max-height: min(68vh, 560px);
  overflow: hidden;
}

.discover-results {
  display: grid;
  gap: 0.45rem;
  overflow: auto;
  height: 100%;
  max-height: none;
  padding-right: 0.15rem;
  align-content: start;
}

.discover-empty {
  margin: 0;
  padding: 1rem 0.25rem;
  font-size: 0.92rem;
}

.discover-card {
  appearance: none;
  width: 100%;
  text-align: left;
  display: grid;
  gap: 0.28rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease-out);
}

.discover-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.discover-card.is-active {
  border-color: rgba(226, 176, 74, 0.55);
  background: var(--citrus-dim);
}

.discover-card.is-saved strong::after {
  content: " ?";
  color: var(--citrus);
  font-size: 0.85em;
}

.discover-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.discover-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.discover-chip {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: var(--leaf-dim);
  color: var(--leaf-bright);
  border: 1px solid rgba(76, 174, 110, 0.28);
}

.discover-detail {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.05rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid rgba(226, 176, 74, 0.35);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: auto;
  max-height: none;
  animation: discover-detail-in 0.3s var(--ease-out);
}

.discover-detail[hidden] {
  display: none !important;
}

.discover-side.is-detail-open .discover-results {
  visibility: hidden;
  pointer-events: none;
}

@keyframes discover-detail-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.discover-detail-head {
  position: relative;
  margin-bottom: 0.15rem;
}

.discover-detail-back {
  margin: 0 0 0.65rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.discover-detail-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--citrus);
}

.discover-detail-head h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
}

.discover-detail-section {
  margin: 0.35rem 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--leaf-bright);
}

.discover-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.discover-facts {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.discover-fact {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.discover-fact dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
}

.discover-fact dd {
  margin: 0;
  word-break: break-word;
}

.discover-fact a {
  color: var(--leaf-bright);
}

.discover-reviews-note {
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
}

.discover-reviews {
  margin: 0.2rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--ink);
}

@media (max-width: 900px) {
  .discover-layout {
    grid-template-columns: 1fr;
  }

  .discover-map {
    height: 42vh;
    min-height: 240px;
  }

  .discover-side {
    height: min(52vh, 420px);
    max-height: min(52vh, 420px);
  }

  .discover-check {
    padding-top: 0.35rem;
  }
}

/* ?? AI Food Scanner ?? */
.pantry-scan-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pantry-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pantry-scan-upload-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.pantry-scan-preview-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  max-height: 180px;
  background: var(--surface-2);
}

.pantry-scan-preview {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.pantry-scan-results {
  display: grid;
  gap: 0.55rem;
}

.pantry-scan-confirm-hint {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.pantry-scan-caption {
  margin: 0;
  font-size: 0.8rem;
}

.pantry-scan-list {
  display: grid;
  gap: 0.35rem;
  max-height: 220px;
  overflow: auto;
}

.pantry-scan-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 0.9rem;
}

.pantry-scan-item input {
  accent-color: var(--leaf);
}

.pantry-scan-item-conf {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.pantry-scan-confirm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ?? Nutrition dashboard & recipe panels ?? */
.nutrition-dashboard {
  margin: 0 0 1.15rem;
}

.nutrition-dashboard-inner {
  padding: 1.05rem 1.15rem 1.15rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(226, 176, 74, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 70% at 0% 100%, rgba(76, 174, 110, 0.1), transparent 50%),
    var(--surface);
}

.nutrition-dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.nutrition-dashboard-head h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.nutrition-dashboard-head .muted {
  margin: 0;
  font-size: 0.82rem;
}

.nutrition-dashboard-kcal {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  flex-shrink: 0;
  padding: 0.35rem 0.7rem 0.4rem;
  border-radius: 999px;
  background: var(--citrus-dim);
  border: 1px solid rgba(226, 176, 74, 0.35);
}

.nutrition-dashboard-kcal em {
  font-family: var(--font-display);
  font-style: normal;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--citrus-hot);
  line-height: 1;
}

.nutrition-dashboard-kcal span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--citrus);
  letter-spacing: 0.02em;
}

.nutrition-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.nutrition-dash-card {
  display: grid;
  gap: 0.2rem;
  justify-items: center;
  padding: 0.75rem 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  text-align: center;
}

.nutrition-dash-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.nutrition-dash-value small {
  margin-left: 0.12rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.75;
}

.nutrition-dash-name {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.nutrition-dash-card--protein .nutrition-dash-value { color: var(--leaf-bright); }
.nutrition-dash-card--carbs .nutrition-dash-value { color: #8ec5ef; }
.nutrition-dash-card--fat .nutrition-dash-value { color: #e8b07a; }

.nutrition-panel {
  margin: 0.65rem 0 0.85rem;
  padding: 0.8rem 0.85rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.nutrition-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.nutrition-panel-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nutrition-kcal {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--citrus);
}

.nutrition-kcal em {
  font-family: var(--font-display);
  font-style: normal;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--citrus-hot);
  line-height: 1;
}

.nutrition-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.nutrition-stat {
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  padding: 0.55rem 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid transparent;
  text-align: center;
}

body.day .nutrition-stat {
  background: rgba(255, 255, 255, 0.65);
}

.nutrition-stat--protein { border-color: rgba(76, 174, 110, 0.28); }
.nutrition-stat--carbs { border-color: rgba(90, 159, 212, 0.28); }
.nutrition-stat--fat { border-color: rgba(212, 137, 74, 0.28); }

.nutrition-stat-value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.nutrition-stat-value small {
  margin-left: 0.1rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.7;
}

.nutrition-stat-name {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.nutrition-stat--protein .nutrition-stat-value { color: var(--leaf-bright); }
.nutrition-stat--carbs .nutrition-stat-value { color: #8ec5ef; }
.nutrition-stat--fat .nutrition-stat-value { color: #e8b07a; }

.nutrition-track {
  display: flex;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
}

.nutrition-track--lg {
  height: 8px;
}

body.day .nutrition-track {
  background: rgba(0, 0, 0, 0.08);
}

.nutrition-seg {
  display: block;
  height: 100%;
  min-width: 0;
  transition: width 0.45s var(--ease-out);
}

.nutrition-seg--protein { background: linear-gradient(90deg, #3d9a5c, #6bc98a); }
.nutrition-seg--carbs { background: linear-gradient(90deg, #4a8fc4, #8ec5ef); }
.nutrition-seg--fat { background: linear-gradient(90deg, #c47a3a, #e8b07a); }

.nutrition-panel-note {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
}

@media (max-width: 640px) {
  .nutrition-dashboard-head {
    flex-wrap: wrap;
  }

  .nutrition-dashboard-grid,
  .nutrition-stat-row {
    gap: 0.35rem;
  }

  .nutrition-dash-value,
  .nutrition-stat-value {
    font-size: 1.1rem;
  }
}

/* ?? 24h stories ?? */
.story-viewer {
  width: min(420px, 100vw);
  max-width: 100vw;
  height: min(780px, 100vh);
  max-height: 100vh;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #0b0b0b;
  color: #fff;
}

.story-viewer::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.story-viewer-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #111;
  overflow: hidden;
}

.story-progress {
  display: flex;
  gap: 4px;
  padding: 0.65rem 0.75rem 0.35rem;
  flex-shrink: 0;
}

.story-progress-seg {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.story-progress-seg i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  border-radius: inherit;
}

.story-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem 0.55rem;
  flex-shrink: 0;
}

.story-viewer-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.story-viewer-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.story-viewer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-viewer-meta {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.story-viewer-meta strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-viewer-meta .muted {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.72rem;
}

.story-viewer-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.story-viewer-actions .btn.ghost {
  color: #fff;
  border-color: transparent;
}

.story-viewer-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #000;
}

.story-viewer-media {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.story-viewer-video {
  background: #000;
}

.story-viewer-media[hidden] {
  display: none !important;
}

.story-sound-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 5;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
}

.story-sound-btn[hidden] {
  display: none !important;
}

.story-sound-btn:hover {
  background: rgba(0, 0, 0, 0.72);
}

.story-sound-btn .story-sound-on[hidden],
.story-sound-btn .story-sound-off[hidden] {
  display: none !important;
}

.story-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32%;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  padding: 0;
}

.story-nav-prev { left: 0; }
.story-nav-next { right: 0; }

.story-viewer-caption {
  margin: 0;
  padding: 0.75rem 1rem 1rem;
  font-size: 0.92rem;
  line-height: 1.35;
  flex-shrink: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}

.story-delete-btn {
  font-size: 0.78rem !important;
}

.story-views-btn {
  position: absolute;
  left: 0.75rem;
  bottom: 0.85rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.story-views-btn[hidden] {
  display: none !important;
}

.story-views-btn:hover {
  background: rgba(0, 0, 0, 0.72);
}

.story-views-icon {
  display: grid;
  place-items: center;
  opacity: 0.9;
}

.story-viewers-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  max-height: 55%;
  display: flex;
  flex-direction: column;
  background: #161616;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.story-viewers-sheet[hidden] {
  display: none !important;
}

.story-viewers-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem 0.25rem;
}

.story-viewers-sheet-head strong {
  font-size: 0.95rem;
}

.story-viewers-note {
  margin: 0;
  padding: 0 0.9rem 0.55rem;
  font-size: 0.75rem;
}

.story-viewers-list {
  list-style: none;
  margin: 0;
  padding: 0 0.4rem 0.75rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.story-viewers-empty {
  padding: 1rem 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.88rem;
  text-align: center;
}

.story-viewer-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.55rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.story-viewer-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.story-viewer-row-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.story-viewer-row-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-viewer-row-name {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quick add scan modes */
.pantry-scan-modes {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.65rem;
  background: var(--surface);
}

.pantry-scan-mode {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.pantry-scan-mode.is-active {
  background: var(--leaf);
  color: #fff;
}

.pantry-barcode-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.pantry-barcode-row input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  font: inherit;
}

.pantry-barcode-video {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  background: #000;
}

/* Surplus share */
.surplus-shell {
  display: grid;
  gap: 1.15rem;
  max-width: 720px;
}

.surplus-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
}

.surplus-tabs {
  display: inline-flex;
  padding: 0.2rem;
  gap: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

.surplus-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--motion-fast) ease, color var(--motion-fast) ease;
}

.surplus-tab:hover {
  color: var(--ink);
}

.surplus-tab.is-active {
  background: var(--leaf);
  color: #041208;
}

.surplus-locate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.surplus-compose {
  display: grid;
  gap: 1.1rem;
  padding: 1.25rem 1.3rem 1.35rem;
  border: 1px solid rgba(76, 174, 110, 0.22);
  border-radius: calc(var(--radius) + 8px);
  background:
    linear-gradient(155deg, rgba(76, 174, 110, 0.12), transparent 45%),
    linear-gradient(335deg, rgba(226, 176, 74, 0.06), transparent 40%),
    var(--surface-2);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  animation: rise 0.45s var(--ease-out) both;
}

.surplus-form {
  display: grid;
  gap: 0.9rem;
}

.surplus-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.surplus-list {
  display: grid;
  gap: 0.75rem;
}

.surplus-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface-2);
  animation: rise 0.35s var(--ease-out) both;
  transition: border-color var(--motion) ease, transform var(--motion) var(--ease-out);
}

.surplus-card:hover {
  border-color: rgba(76, 174, 110, 0.28);
}

.surplus-card-body {
  min-width: 0;
  flex: 1;
}

.surplus-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.surplus-card-meta,
.surplus-card-owner,
.surplus-card-note {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.surplus-card-note {
  color: var(--ink);
}

.surplus-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(226, 176, 74, 0.16);
  color: var(--citrus);
}

.surplus-card-actions {
  flex-shrink: 0;
}

.surplus-empty {
  text-align: center;
  padding: 2.25rem 1rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: rgba(0, 0, 0, 0.12);
}

.surplus-empty span {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

body.day .surplus-compose,
body.day .posts-compose {
  background:
    linear-gradient(155deg, rgba(76, 174, 110, 0.1), transparent 45%),
    #f7faf7;
  border-color: rgba(76, 174, 110, 0.22);
  box-shadow: 0 12px 28px rgba(20, 40, 30, 0.08);
}

body.day .compose-field input,
body.day .compose-field textarea,
body.day .surplus-form input,
body.day .surplus-form textarea,
body.day .post-form textarea,
body.day .post-form input[type="text"] {
  background: #fff;
}

body.day .post-media-drop,
body.day .post-form-meta,
body.day .surplus-tabs,
body.day .post-type-toggle {
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 560px) {
  .surplus-form-row,
  .post-form-row {
    grid-template-columns: 1fr;
  }

  .surplus-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .surplus-tabs,
  .surplus-locate-btn {
    width: 100%;
    justify-content: center;
  }

  .surplus-compose,
  .posts-compose-body {
    padding: 1rem;
  }

  .surplus-card {
    flex-direction: column;
  }

  .compose-actions {
    justify-content: stretch;
  }

  .compose-submit {
    width: 100%;
  }
}

/* ?? Final site-wide UI polish ?? */
::selection {
  background: rgba(76, 174, 110, 0.35);
  color: var(--cream);
}

body.day ::selection {
  background: rgba(76, 174, 110, 0.28);
  color: #0d1a12;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: rgba(76, 174, 110, 0.55);
}

.nav-link:focus-visible,
.brand:focus-visible,
.btn:focus-visible,
.posts-tab:focus-visible,
.profile-tab:focus-visible,
.profile-toggle-btn:focus-visible {
  box-shadow: var(--focus-ring);
}

.panel.panel-enter {
  animation: panel-in var(--motion-slow) var(--ease-out) both;
}

.nav-link:hover {
  transform: translateY(-1px);
}

.nav-link::after {
  height: 2px;
  border-radius: 999px;
}

.btn,
.posts-tab,
.profile-tab,
.profile-toggle-btn,
.post-type-btn {
  transition: transform var(--motion-fast) var(--ease-spring), background var(--motion-fast) ease,
    border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, color var(--motion-fast) ease,
    filter var(--motion-fast) ease;
}

.btn:active:not(:disabled),
.posts-tab:active,
.profile-tab:active,
.profile-toggle-btn:active,
.post-type-btn:active {
  transform: translateY(1px) scale(0.985);
}

.post-card,
.dash-card,
.profile-section-card,
.recipe-card,
.meal-card,
.discover-detail,
.messages-layout {
  transition: border-color var(--motion) ease, box-shadow var(--motion) ease,
    transform var(--motion) var(--ease-out);
}

.post-card:hover,
.dash-card:hover,
.profile-section-card:hover,
.recipe-card:hover {
  border-color: rgba(230, 235, 231, 0.18);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.toast {
  transition: opacity var(--motion) var(--ease-out), transform var(--motion) var(--ease-out);
}

.toast.show {
  transform: translateY(0);
}

dialog::backdrop {
  background: rgba(4, 7, 6, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: soft-fade var(--motion) var(--ease-out) both;
}

dialog[open] {
  animation: panel-in var(--motion) var(--ease-out) both;
}

input,
textarea,
select,
button,
a {
  -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(230, 235, 231, 0.14);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(230, 235, 231, 0.28);
  background-clip: padding-box;
}

@media (hover: hover) and (pointer: fine) {
  .post-media,
  .profile-posts-grid img,
  .profile-posts-grid video {
    transition: transform var(--motion-slow) var(--ease-out), filter var(--motion) ease;
  }

  .post-card:hover .post-media:not(.post-media--reel),
  .profile-posts-grid > *:hover img,
  .profile-posts-grid > *:hover video {
    transform: scale(1.02);
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel.panel-enter,
  .nav-link.active::after,
  dialog[open],
  dialog::backdrop {
    animation: none !important;
  }

  .post-card:hover,
  .dash-card:hover,
  .profile-section-card:hover,
  .recipe-card:hover,
  .nav-link:hover,
  .btn:hover,
  .btn:active {
    transform: none;
  }

  .post-card:hover .post-media:not(.post-media--reel) {
    transform: none;
  }
}

/* Extra phone polish */
@media (max-width: 560px) {
  .profile-header,
  .profile-header-top,
  .dashboard-header,
  .pantry-header,
  .ingredients-header {
    flex-wrap: wrap;
    gap: 0.55rem;
  }

  .posts-toolbar,
  .profile-tabs,
  .surplus-tabs,
  .post-type-toggle {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .posts-toolbar::-webkit-scrollbar,
  .profile-tabs::-webkit-scrollbar,
  .surplus-tabs::-webkit-scrollbar,
  .post-type-toggle::-webkit-scrollbar {
    display: none;
  }

  .posts-tab,
  .profile-tab,
  .post-type-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .dashboard-grid,
  .profile-stats-grid {
    grid-template-columns: 1fr;
  }

  .post-card {
    border-radius: 12px;
  }

  .compose-actions,
  .pantry-scan-actions,
  .auth-actions {
    gap: 0.45rem;
  }

  .compose-actions .btn,
  .pantry-scan-actions .btn {
    flex: 1 1 auto;
  }

  .story-viewer {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
  }
}

@media (max-width: 380px) {
  .nav-link {
    min-width: 3.9rem;
    font-size: 0.68rem;
    padding: 0.4rem 0.4rem;
  }

  .brand {
    font-size: 1.02rem;
  }

  .auth-bar .auth-btn#login-open-btn {
    padding: 0.35rem 0.45rem;
  }
}
