:root {
  --bg0: #e8f0eb;
  --bg1: #f7faf8;
  --ink: #14261e;
  --ink-soft: #3d5a4c;
  --muted: #6b8578;
  --line: rgba(20, 38, 30, 0.12);
  --sage: #2f5d4a;
  --sage-deep: #1f3d32;
  --tomato: #d84a35;
  --cream: #fffdf9;
  --card: rgba(255, 253, 249, 0.88);
  --shadow: 0 12px 40px rgba(20, 38, 30, 0.12);
  --radius: 18px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --nav-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg0);
  line-height: 1.45;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
}

body.page-auth {
  padding-bottom: 0;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 10% -10%, #cfe3d6 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 0%, #f3d9cf 0%, transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #eef4f0);
}

.shell {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 12px 16px 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  backdrop-filter: blur(12px);
  background: rgba(247, 250, 248, 0.82);
  border-bottom: 1px solid var(--line);
  animation: fadeDown 0.45s ease both;
}

.topbar-brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--sage-deep);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.topbar-user {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.hero-app {
  padding: 18px 4px 8px;
  animation: rise 0.55s ease both;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sage);
}

.hero-app h1,
.auth-card h1,
.form-panel h1,
.detail-head h1 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--sage-deep);
}

.hero-app h1 {
  font-size: clamp(1.8rem, 6vw, 2.4rem);
}

.lead {
  margin: 0;
  color: var(--ink-soft);
  max-width: 34ch;
}

.toolbar {
  display: grid;
  gap: 12px;
  margin: 18px 0 14px;
  animation: rise 0.6s ease 0.05s both;
}

.filter-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 14px;
  box-shadow: var(--shadow);
}

.filter-panel summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  font-weight: 600;
}

.filter-panel summary::-webkit-details-marker {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: #d9ebe2;
  color: var(--sage-deep);
  font-size: 0.78rem;
  font-weight: 700;
}

.chip.muted {
  background: #e8ecea;
  color: var(--muted);
}

.filter-form {
  padding-bottom: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 14px;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--cream);
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 0.92rem;
  font-weight: 600;
}

.sort-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(255, 253, 249, 0.7);
  border-radius: 999px;
  border: 1px solid var(--line);
}

.sort-tab {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 12px;
  border-radius: 999px;
}

.sort-tab.is-active {
  background: var(--sage-deep);
  color: #fff;
}

.winner {
  display: block;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(135deg, #1f3d32, #3a6b55);
  color: #f6fff9;
  border-radius: calc(var(--radius) + 4px);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  animation: rise 0.65s ease 0.08s both;
}

.winner-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 4px;
}

.winner strong {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  margin-bottom: 6px;
}

.winner .stars {
  color: #ffd9a0;
}

.menu-list {
  display: grid;
  gap: 12px;
}

.menu-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(20, 38, 30, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: rise 0.5s ease both;
}

.menu-row:active {
  transform: scale(0.985);
}

.menu-thumb {
  min-height: 96px;
  background: #d7e4dc center/cover no-repeat;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.menu-meta {
  padding: 12px 12px 12px 0;
}

.menu-meta h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
}

.meta-line {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.meta-line.faint {
  opacity: 0.85;
  margin-top: 4px;
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 6px;
  font-size: 0.95rem;
}

.stars.empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.star {
  color: #c5d0ca;
}

.star.on {
  color: #e2a03a;
}

.score-num {
  margin-left: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.winner .score-num {
  color: #fff;
}

.tonight {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0;
  text-decoration: none;
  color: #f6fff9;
  background: linear-gradient(135deg, #243d55, #1f3d32 55%, #3a5a2e);
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  margin: 8px 0 16px;
  box-shadow: var(--shadow);
  animation: rise 0.55s ease both;
  min-height: 128px;
}

.tonight-media {
  min-height: 128px;
  background: #1a2a33 center/cover no-repeat;
}

.tonight-copy {
  padding: 14px 14px 14px 12px;
}

.tonight-label {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  opacity: 0.85;
  margin-bottom: 4px;
}

.tonight-copy strong {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: 4px;
}

.meta-line.on-dark {
  color: rgba(246, 255, 249, 0.75);
}

.tonight .stars .star {
  color: rgba(255, 255, 255, 0.35);
}

.tonight .star.on {
  color: #ffd9a0;
}

.tonight .score-num {
  color: #fff;
}

.chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.chip-scroll::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  flex: 0 0 auto;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: rgba(255, 253, 249, 0.8);
  border: 1px solid var(--line);
}

.chip-btn.is-active {
  background: var(--sage-deep);
  color: #fff;
  border-color: var(--sage-deep);
}

.menu-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #e3efe8;
  color: var(--sage-deep);
}

.tag-tonight {
  background: #243d55;
  color: #f4faf7;
}

.tag-fav {
  background: #f8e0e4;
  color: #a12845;
}

.tag-hate {
  background: #ece7e2;
  color: #5c534a;
}

.reaction-badges {
  display: inline-flex;
  gap: 10px;
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.rb-fav {
  color: #a12845;
}

.rb-hate {
  color: #6a6158;
}

.react-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

.btn-fav.is-on {
  background: #f8e0e4;
  color: #a12845;
}

.btn-hate.is-on {
  background: #ece7e2;
  color: #5c534a;
}

.check-inline {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--cream);
  font-weight: 700;
}

.check-inline input {
  width: auto !important;
}

.menu-row.is-tonight {
  border-color: rgba(36, 61, 85, 0.35);
  box-shadow: 0 10px 28px rgba(36, 61, 85, 0.12);
}

.sort-tabs {
  flex-wrap: wrap;
}

.sort-tab {
  flex: 1 1 40%;
}

@media (min-width: 520px) {
  .sort-tab {
    flex: 1;
  }
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  gap: 4px;
  padding: 8px 10px calc(8px + var(--safe-b));
  background: rgba(255, 253, 249, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-item {
  flex: 1;
  max-width: 110px;
  text-decoration: none;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 4px;
  border-radius: 14px;
}

.nav-item.is-active {
  color: var(--sage-deep);
  background: #e3efe8;
}

.nav-fab {
  color: #fff;
  background: var(--tomato);
  transform: translateY(-10px);
  box-shadow: 0 10px 24px rgba(216, 74, 53, 0.35);
  padding-top: 10px;
  padding-bottom: 10px;
}

.nav-fab.is-active,
.nav-fab:hover {
  color: #fff;
  background: #c53d2a;
}

.nav-ico {
  font-size: 1.05rem;
  line-height: 1;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.btn-primary {
  background: var(--sage-deep);
  color: #fff;
}

.btn-secondary {
  background: #d9ebe2;
  color: var(--sage-deep);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.btn-danger {
  background: #f8e4e0;
  color: #a12f1f;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 10px;
  font-size: 0.82rem;
  border-radius: 10px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.panel,
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 18px;
  box-shadow: var(--shadow);
}

.form-panel {
  margin-top: 8px;
}

.stack-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.stack-form.tight {
  margin-top: 8px;
  gap: 8px;
}

.stack-form label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.stack-form input,
.stack-form textarea,
.stack-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: var(--cream);
}

.stack-form textarea {
  resize: vertical;
  min-height: 90px;
}

.form-error {
  background: #f8e4e0;
  color: #8f2a1c;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
}

.page-auth {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px 16px;
}

.auth-shell {
  width: min(420px, 100%);
}

.brand {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--sage-deep);
  margin: 0 0 4px;
}

.back {
  margin: 4px 0 12px;
}

.back a {
  color: var(--sage);
  font-weight: 700;
  text-decoration: none;
}

.detail-head {
  margin-bottom: 16px;
}

.gallery {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.gallery-item {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #d7e4dc;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: cover;
}

.gallery-item figcaption {
  padding: 8px 12px 12px;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--cream);
}

.prose {
  margin-bottom: 18px;
}

.prose h2,
.panel h2,
.h-sub {
  font-family: var(--display);
  font-size: 1.2rem;
  margin: 0 0 8px;
  color: var(--sage-deep);
}

.prose p {
  margin: 0;
  white-space: pre-wrap;
}

.recipe {
  background: rgba(255, 253, 249, 0.7);
  border-left: 4px solid var(--sage);
  padding: 12px 14px;
  border-radius: 0 14px 14px 0;
}

.score-pick {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.score-max {
  font-weight: 600;
  opacity: 0.7;
  margin-left: 1px;
}

.stars .star {
  font-size: 0.72rem;
}

.score-pick label {
  display: block;
}

.score-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.score-pick span {
  display: block;
  text-align: center;
  padding: 12px 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--cream);
  font-weight: 800;
  color: var(--ink-soft);
}

.score-pick input:checked + span {
  background: var(--sage-deep);
  color: #fff;
  border-color: var(--sage-deep);
}

.rating-list,
.user-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.rating-list li,
.user-row {
  padding: 12px;
  border-radius: 14px;
  background: var(--cream);
  border: 1px solid var(--line);
}

.rating-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.user-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.user-row.is-inactive {
  opacity: 0.55;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.inline-details summary {
  list-style: none;
  cursor: pointer;
}

.inline-details summary::-webkit-details-marker {
  display: none;
}

.empty {
  text-align: center;
  padding: 36px 18px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px dashed var(--line);
}

.empty h2 {
  font-family: var(--display);
  margin: 0 0 8px;
}

.toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(920px, calc(100% - 24px));
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: toastIn 0.35s ease both, toastOut 0.4s ease 3.2s forwards;
}

.toast-success {
  background: #d9ebe2;
  color: var(--sage-deep);
}

.toast-error {
  background: #f8e4e0;
  color: #8f2a1c;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
}

@media (min-width: 720px) {
  .menu-row {
    grid-template-columns: 128px 1fr;
  }

  .menu-thumb {
    min-height: 112px;
  }
}
