/* ─── FONTS ─────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

/* ─── RESET & BASE ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #07080f;
  --bg2:         #0d0f1c;
  --bg3:         #131629;
  --surface:     #181b2e;
  --surface2:    #1e2238;
  --border:      rgba(120,140,220,0.15);
  --border2:     rgba(120,140,220,0.28);
  --text:        #e8ecff;
  --text2:       #8b90b8;
  --text3:       #555a7a;
  --accent:      #6c8fff;
  --accent2:     #a78bfa;
  --gold:        #f4c97a;
  --green:       #4ade80;
  --red:         #f87171;

  /* axis colors — neon */
  --flavour-col: #ff2d78;
  --health-col:  #39ff6e;
  --ease-col:    #00e5ff;

  /* category colors */
  --cat-appetizer: #f97316;
  --cat-first:     #3b82f6;
  --cat-second:    #10b981;
  --cat-dessert:   #c084fc;

  --radius:    10px;
  --radius-lg: 16px;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

html, body {
  height: 100%; width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
}

/* ─── STAR FIELD ─────────────────────────────────────────────────────────── */
#starfield {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.star {
  position: absolute; border-radius: 50%; background: white;
  animation: twinkle var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);
}
@keyframes twinkle {
  0%,100% { opacity: var(--min-op); transform: scale(1); }
  50%      { opacity: var(--max-op); transform: scale(1.4); }
}

/* ─── LAYOUT ─────────────────────────────────────────────────────────────── */
#app {
  position: fixed;
  top: 0; left: 0; right: 0;
  bottom: 0;
  bottom: env(safe-area-inset-bottom, 0);
  height: 100vh;
  height: 100dvh;
  z-index: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* ─── HEADER ─────────────────────────────────────────────────────────────── */
#header {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(13,15,28,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid var(--border);
  z-index: 10;
  flex-wrap: wrap;
  min-height: 52px;
}

#logo {
  font-family: var(--font-head);
  font-size: 18px; font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #fff 0%, var(--accent2) 50%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
  text-decoration: none;
}
#logo svg { flex-shrink: 0; }

.filter-group {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.filter-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text3); margin-right: 2px;
}
.chip {
  font-size: 11px; padding: 3px 10px; border-radius: 20px; cursor: pointer;
  border: 0.5px solid var(--border); background: transparent;
  color: var(--text2); font-family: var(--font-body);
  transition: all .15s; white-space: nowrap; line-height: 1.4;
}
.chip:hover { border-color: var(--border2); color: var(--text); background: var(--surface); }
.chip.active {
  border-color: var(--accent);
  background: rgba(108,143,255,0.14);
  color: var(--accent);
}
.chip[data-cat="appetizer"].active { border-color: var(--cat-appetizer); background: rgba(249,115,22,.13); color: var(--cat-appetizer); }
.chip[data-cat="first"].active    { border-color: var(--cat-first);     background: rgba(59,130,246,.13); color: var(--cat-first); }
.chip[data-cat="second"].active   { border-color: var(--cat-second);    background: rgba(16,185,129,.13); color: var(--cat-second); }
.chip[data-cat="dessert"].active  { border-color: var(--cat-dessert);   background: rgba(192,132,252,.13); color: var(--cat-dessert); }

.separator { width: 0.5px; height: 20px; background: var(--border); flex-shrink: 0; margin: 0 4px; }

#header-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  border: 0.5px solid var(--border); background: transparent;
  color: var(--text2); display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.icon-btn:hover { background: var(--surface); color: var(--text); border-color: var(--border2); }
.icon-btn.active { background: rgba(108,143,255,0.15); border-color: var(--accent); color: var(--accent); }

#vote-toggle-btn {
  font-size: 11px; padding: 4px 11px; border-radius: 20px; cursor: pointer;
  border: 0.5px solid var(--border); background: transparent;
  color: var(--text2); font-family: var(--font-body);
  transition: all .15s; white-space: nowrap;
}
#vote-toggle-btn.active {
  border-color: var(--gold);
  background: rgba(244,201,122,.12);
  color: var(--gold);
}

/* ─── MAIN AREA ──────────────────────────────────────────────────────────── */
#main { flex: 1; position: relative; overflow: hidden; }

/* ─── 3D CANVAS ──────────────────────────────────────────────────────────── */
#canvas-wrap {
  position: absolute; inset: 0;
  cursor: grab; user-select: none;
}
#canvas-wrap:active { cursor: grabbing; }
canvas#c3d { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

/* ─── ZOOM CONTROLS ──────────────────────────────────────────────────────── */
#zoom-controls {
  position: absolute; bottom: 20px; right: 16px;
  display: flex; flex-direction: column; gap: 4px; z-index: 5;
}
.zoom-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 0.5px solid var(--border2); background: rgba(13,15,28,0.7);
  backdrop-filter: blur(8px); cursor: pointer;
  color: var(--text2); font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.zoom-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--accent); }

/* ─── TOOLTIP ────────────────────────────────────────────────────────────── */
#tooltip {
  position: fixed; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: rgba(13,15,28,0.92); backdrop-filter: blur(12px);
  border: 0.5px solid var(--border2); border-radius: var(--radius);
  padding: 10px 12px; min-width: 150px; max-width: 200px; z-index: 40;
}
#tooltip.visible { opacity: 1; pointer-events: auto; }
#tooltip .tt-name { font-family: var(--font-head); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
#tooltip .tt-img { width: 100%; height: 80px; object-fit: cover; border-radius: 6px; margin-bottom: 6px; }
#tooltip .tt-cat { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
#tooltip .tt-axes { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
#tooltip .tt-ax { text-align: center; padding: 3px 2px; border-radius: 5px; background: var(--surface); }
#tooltip .tt-ax .ax-l { font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
#tooltip .tt-ax .ax-v { font-size: 13px; font-weight: 500; font-family: var(--font-head); }

/* ─── WARP TRANSITION ────────────────────────────────────────────────────── */
#warp-overlay {
  position: fixed; inset: 0; z-index: 48;
  pointer-events: none; overflow: hidden;
}
#warp-dot {
  position: absolute; border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0; pointer-events: none;
  will-change: transform, opacity;
}
#warp-dot.expanding {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.12s ease;
  transform: translate(-50%, -50%) scale(1); opacity: 1;
}
#warp-dot.contracting {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.6, 1), opacity 0.15s ease 0.4s;
  transform: translate(-50%, -50%) scale(0); opacity: 0;
}

/* Canvas warp zoom + blur */
#main {
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              filter    0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
#main.warping   { transform: scale(2.4); filter: blur(10px) brightness(1.5); }
#main.unwarping { transform: scale(1);   filter: none; }

/* Modal warp-in/out from center */
@keyframes modalWarpIn  { from { opacity:0; transform:scale(0.05); } to { opacity:1; transform:scale(1); } }
@keyframes modalWarpOut { from { opacity:1; transform:scale(1);    } to { opacity:0; transform:scale(0.05); } }

/* ─── MODAL ──────────────────────────────────────────────────────────────── */
#modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 16px;
}
#modal-overlay.open { display: flex; }
#modal-overlay.warp-in  #modal { animation: modalWarpIn  0.35s cubic-bezier(0.34,1.56,0.64,1) both; }
#modal-overlay.warp-out #modal { animation: modalWarpOut 0.25s cubic-bezier(0.4,0,1,1)         both; }

#modal {
  background: var(--bg2); border-radius: var(--radius-lg);
  border: 0.5px solid var(--border2);
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  position: relative;
  animation: modalIn .2s ease-out;
}
@keyframes modalIn { from { opacity:0; transform: translateY(12px) scale(.97); } to { opacity:1; transform: none; } }

#modal-close {
  position: sticky; top: 0; float: right; margin: 12px 12px -12px 0;
  width: 48px; height: 48px; border-radius: 6px; z-index: 2;
  background: var(--surface); border: 0.5px solid var(--border);
  color: var(--text2); cursor: pointer; font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
#modal-close:hover { background: var(--surface2); color: var(--text); }

.modal-hero {
  width: 100%; height: 180px; object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; display: block;
  cursor: zoom-in;
  pointer-events: auto;
}
.modal-hero-placeholder {
  width: 100%; height: 100px; background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--text3);
}

/* ─── PHOTO LIGHTBOX ─────────────────────────────────────────────────────── */
#lightbox {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.95);
  align-items: center; justify-content: center;
  cursor: zoom-out;
  touch-action: none;
}
#lightbox.open { display: flex; }
#lightbox-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform .15s ease;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}
#lightbox-close {
  position: fixed; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: 0.5px solid rgba(255,255,255,.25);
  color: white; font-size: 20px; cursor: pointer; z-index: 201;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#lightbox-close:hover { background: rgba(255,255,255,.25); }
#lightbox-hint {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: rgba(255,255,255,.4); pointer-events: none;
  white-space: nowrap;
  transition: opacity 1s ease;
}

.modal-body { padding: 16px 20px 24px; }
.modal-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.modal-cat {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  padding: 2px 8px; border-radius: 20px; font-weight: 600;
}
.modal-time { font-size: 12px; color: var(--text2); }
.modal-title { font-family: var(--font-head); font-size: 22px; font-weight: 700; margin-bottom: 8px; line-height: 1.2; }
.modal-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 14px; }
.modal-tag { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--surface); border: 0.5px solid var(--border); color: var(--text2); }

.axes-bar {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 16px;
}
.axis-card {
  background: var(--surface); border-radius: var(--radius); padding: 10px 8px; text-align: center;
  border: 0.5px solid var(--border);
}
.axis-card .ax-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); margin-bottom: 4px; }
.axis-card .ax-num { font-family: var(--font-head); font-size: 24px; font-weight: 700; }
.axis-card .ax-bar-wrap { height: 3px; background: var(--surface2); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.axis-card .ax-bar { height: 100%; border-radius: 2px; }

.section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--text3);
  margin: 14px 0 7px; font-weight: 600;
}
.ingr-list { list-style: none; display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.ingr-list li {
  font-size: 13px; padding: 4px 10px; border-radius: 20px; font-weight: 500; display: inline-block; align-self: flex-start;
}
.method-text { font-size: 13px; line-height: 1.75; color: var(--text2); }
.ingr-hl { font-weight: 600; padding: 0 2px 1px; border-radius: 3px; }

/* vote section */
.vote-section {
  margin-top: 20px; padding-top: 16px; border-top: 0.5px solid var(--border);
}
.vote-title { font-family: var(--font-head); font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.vote-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.vote-row label { font-size: 11px; color: var(--text2); width: 90px; flex-shrink: 0; }
.vote-row input[type=range] {
  flex: 1; -webkit-appearance: none; height: 4px; border-radius: 2px; outline: none; cursor: pointer;
  background: var(--surface2);
}
.vote-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid var(--bg);
}
.vote-row .v-num { font-family: var(--font-head); font-size: 13px; font-weight: 600; width: 28px; text-align: right; }
.vote-submit {
  margin-top: 10px; padding: 8px 18px; border-radius: var(--radius); cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  border: none; color: white; font-family: var(--font-body); font-size: 13px; font-weight: 500;
  transition: opacity .15s;
}
.vote-submit:hover { opacity: .85; }
.vote-submit:disabled { opacity: .4; cursor: default; }
.vote-thanks { font-size: 12px; color: var(--green); margin-top: 8px; display: none; }
.vote-already { font-size: 12px; color: var(--text3); margin-top: 8px; display: none; }
.avg-row { margin-top: 10px; font-size: 12px; color: var(--text2); line-height: 1.7; }
.avg-row span { color: var(--gold); font-weight: 500; }

/* ─── SIDE PANEL (filters) ───────────────────────────────────────────────── */
#filter-panel {
  position: fixed; top: 0; right: -280px; width: 260px; height: 100%;
  background: rgba(13,15,28,0.96); backdrop-filter: blur(16px);
  border-left: 0.5px solid var(--border2); z-index: 80;
  transition: right .25s ease; overflow-y: auto; padding: 16px;
}
#filter-panel.open { right: 0; }
#filter-panel h3 { font-family: var(--font-head); font-size: 14px; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.fp-section { margin-bottom: 18px; }
.fp-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); margin-bottom: 7px; font-weight: 600; }
.fp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fp-chip {
  font-size: 11px; padding: 3px 10px; border-radius: 20px; cursor: pointer;
  border: 0.5px solid var(--border); background: transparent;
  color: var(--text2); transition: all .15s;
}
.fp-chip:hover { background: var(--surface); color: var(--text); }
.fp-chip.active { border-color: var(--accent); background: rgba(108,143,255,.14); color: var(--accent); }
.fp-chip[data-cat="appetizer"].active { border-color: var(--cat-appetizer); background: rgba(249,115,22,.13); color: var(--cat-appetizer); }
.fp-chip[data-cat="first"].active    { border-color: var(--cat-first);     background: rgba(59,130,246,.13); color: var(--cat-first); }
.fp-chip[data-cat="second"].active   { border-color: var(--cat-second);    background: rgba(16,185,129,.13); color: var(--cat-second); }
.fp-chip[data-cat="dessert"].active  { border-color: var(--cat-dessert);   background: rgba(192,132,252,.13); color: var(--cat-dessert); }
.fp-close { width: 100%; padding: 8px; margin-top: 8px; border-radius: var(--radius); border: 0.5px solid var(--border); background: var(--surface); color: var(--text2); cursor: pointer; font-family: var(--font-body); font-size: 12px; }
.fp-close:hover { color: var(--text); }

/* ─── ADMIN PANEL ────────────────────────────────────────────────────────── */
#admin-overlay {
  display: none; position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 16px;
}
#admin-overlay.open { display: flex; }

#admin-panel {
  background: var(--bg2); border-radius: var(--radius-lg);
  border: 0.5px solid var(--border2);
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  padding: 22px 24px 28px; position: relative;
  animation: modalIn .2s ease-out;
}
#admin-panel h2 { font-family: var(--font-head); font-size: 18px; font-weight: 700; margin-bottom: 16px; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text3); margin-bottom: 4px; font-weight: 600; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; background: var(--surface); border: 0.5px solid var(--border2);
  border-radius: var(--radius); color: var(--text); font-family: var(--font-body);
  font-size: 13px; padding: 8px 11px; outline: none;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--accent); }
.form-group textarea { min-height: 80px; resize: vertical; line-height: 1.6; }
.form-group select option { background: var(--bg2); }

.axes-form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.axis-input-group label { font-size: 10px; }
.axis-input-group input { text-align: center; }
.axis-hint { font-size: 10px; color: var(--text3); margin-top: 2px; text-align: center; }

.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.btn-primary {
  flex: 1; padding: 10px; border-radius: var(--radius); cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  border: none; color: white; font-family: var(--font-body); font-size: 13px; font-weight: 500;
}
.btn-primary:hover { opacity: .85; }
.btn-secondary {
  padding: 10px 16px; border-radius: var(--radius); cursor: pointer;
  background: transparent; border: 0.5px solid var(--border2);
  color: var(--text2); font-family: var(--font-body); font-size: 13px;
}
.btn-secondary:hover { background: var(--surface); color: var(--text); }

/* tag selector in admin form */
.tag-selector { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tag-toggle {
  font-size: 11px; padding: 3px 10px; border-radius: 20px; cursor: pointer;
  border: 0.5px solid var(--border); background: transparent; color: var(--text2); transition: all .15s;
}
.tag-toggle:hover { background: var(--surface); color: var(--text); }
.tag-toggle.selected { border-color: var(--accent2); background: rgba(167,139,250,.14); color: var(--accent2); }
.add-tag-row { display: flex; gap: 6px; margin-top: 6px; }
.add-tag-row input { flex: 1; padding: 5px 9px; border-radius: 20px; font-size: 11px; }
.add-tag-row button {
  padding: 5px 12px; border-radius: 20px; border: 0.5px solid var(--border2);
  background: var(--surface); color: var(--text2); cursor: pointer; font-size: 11px;
}
.add-tag-row button:hover { color: var(--text); }

/* ─── PENDING PANEL ──────────────────────────────────────────────────────── */
#pending-overlay {
  display: none; position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 16px;
}
#pending-panel {
  background: var(--bg2); border-radius: var(--radius-lg);
  border: 0.5px solid var(--border2);
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  padding: 20px 22px; animation: modalIn .2s ease-out;
}
#pending-panel h2 { font-family: var(--font-head); font-size: 16px; font-weight: 700; margin-bottom: 14px; }
#auth-overlay {
  display: none; position: fixed; inset: 0; z-index: 70;
  background: rgba(0,0,0,.75); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 16px;
}
#auth-overlay.open { display: flex; }
#auth-box {
  background: var(--bg2); border-radius: var(--radius-lg);
  border: 0.5px solid var(--border2); padding: 28px 28px 24px; max-width: 340px; width: 100%;
  text-align: center; animation: modalIn .2s ease-out;
}
#auth-box h3 { font-family: var(--font-head); font-size: 17px; font-weight: 700; margin-bottom: 6px; }
#auth-box p { font-size: 13px; color: var(--text2); margin-bottom: 18px; }
#google-signin-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 10px; border-radius: var(--radius);
  background: white; color: #1a1a1a; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500; font-family: var(--font-body);
  transition: opacity .15s;
}
#google-signin-btn:hover { opacity: .9; }
#auth-cancel { margin-top: 10px; background: none; border: none; color: var(--text3); cursor: pointer; font-size: 12px; }

/* ─── COMMENTS ───────────────────────────────────────────────────────────── */
.comments-section {
  margin-top: 20px; padding-top: 16px; border-top: 0.5px solid var(--border);
}
.comments-title { font-family: var(--font-head); font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.comment-item {
  background: var(--surface); border-radius: var(--radius); padding: 10px 12px;
  margin-bottom: 8px; border: 0.5px solid var(--border);
}
.comment-author { font-size: 12px; font-weight: 600; color: var(--accent2); margin-bottom: 3px; }
.comment-text { font-size: 13px; color: var(--text2); line-height: 1.55; white-space: pre-wrap; }
.comment-date { font-size: 10px; color: var(--text3); margin-top: 4px; }
.comment-delete-btn {
  font-size: 10px; color: var(--red); background: none; border: none; cursor: pointer;
  float: right; opacity: .6; padding: 0;
}
.comment-delete-btn:hover { opacity: 1; }
.comment-form { margin-top: 12px; }
.comment-form input,
.comment-form textarea {
  width: 100%; background: var(--surface); border: 0.5px solid var(--border2);
  border-radius: var(--radius); color: var(--text); font-family: var(--font-body);
  font-size: 13px; padding: 8px 11px; outline: none; margin-bottom: 7px;
  transition: border-color .15s;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--accent); }
.comment-form textarea { min-height: 70px; resize: vertical; }
.comment-submit {
  padding: 7px 18px; border-radius: var(--radius); cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  border: none; color: white; font-family: var(--font-body); font-size: 12px; font-weight: 500;
}
.comment-login-prompt {
  font-size: 12px; color: var(--text3); margin-top: 8px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.comment-login-btn {
  font-size: 11px; padding: 4px 12px; border-radius: 20px; cursor: pointer;
  border: 0.5px solid var(--border2); background: var(--surface);
  color: var(--text2); font-family: var(--font-body); transition: all .15s;
}
.comment-login-btn:hover { color: var(--text); border-color: var(--accent); }
.no-comments { font-size: 12px; color: var(--text3); margin-bottom: 8px; }

/* ─── INGREDIENT SEARCH ──────────────────────────────────────────────────── */
#ingr-search-wrap {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 0.5px solid var(--border2);
  border-radius: 20px; padding: 4px 10px;
  transition: border-color .15s; flex-shrink: 1; min-width: 0;
}
#ingr-search-wrap:focus-within { border-color: var(--accent); }
#ingr-search {
  background: none; border: none; outline: none;
  color: var(--text); font-family: var(--font-body); font-size: 12px;
  width: 130px; min-width: 0;
}
#ingr-search::placeholder { color: var(--text3); }
#ingr-search-clear {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 15px; padding: 0; line-height: 1; flex-shrink: 0;
}
#ingr-search-clear:hover { color: var(--text); }

/* ─── RECIPE COUNT (clickable) ───────────────────────────────────────────── */
#recipe-count {
  position: absolute; bottom: 20px; left: 20px; z-index: 5;
  font-size: 16px; color: var(--text3);
  background: rgba(13,15,28,0.6); padding: 5px 12px; border-radius: 20px;
  backdrop-filter: blur(6px); border: 0.5px solid var(--border);
  cursor: pointer; transition: all .15s; user-select: none;
}
#recipe-count:hover { border-color: var(--border2); color: var(--text2); }

/* ─── RECIPE LIST PANEL ──────────────────────────────────────────────────── */
#recipe-list-overlay {
  display: none; position: fixed; inset: 0; z-index: 45;
  pointer-events: none;
}
#recipe-list-overlay.open { display: block; pointer-events: auto; }

#recipe-list-panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 320px; background: rgba(10,9,20,0.97);
  backdrop-filter: blur(20px);
  border-right: 0.5px solid var(--border2);
  display: flex; flex-direction: column;
  animation: slideInLeft .2s ease-out;
}
@keyframes slideInLeft { from { transform: translateX(-100%); } to { transform: none; } }

#recipe-list-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}
#recipe-list-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; }
#recipe-list-close {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--surface); border: 0.5px solid var(--border);
  color: var(--text2); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
#recipe-list-close:hover { color: var(--text); }

#recipe-list-items { overflow-y: auto; flex: 1; padding: 8px; }

.recipe-list-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px; border-radius: var(--radius); cursor: pointer;
  transition: background .12s; margin-bottom: 4px;
  border: 0.5px solid transparent;
}
.recipe-list-item:hover { background: var(--surface); border-color: var(--border); }
.recipe-list-item.list-hovered { background: var(--surface2); border-color: var(--gold); }

.rli-img {
  width: 52px; height: 52px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
  background: var(--surface2);
}
.rli-placeholder {
  width: 52px; height: 52px; border-radius: 6px; flex-shrink: 0;
  background: var(--surface2); display: flex; align-items: center;
  justify-content: center; font-size: 20px;
}
.rli-body { flex: 1; min-width: 0; }
.rli-title { font-size: 13px; font-weight: 500; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rli-tags { display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 4px; }
.rli-tag { font-size: 10px; padding: 1px 6px; border-radius: 10px; background: var(--surface2); color: var(--text3); }
.rli-scores { display: flex; gap: 6px; }
.rli-score { font-size: 10px; font-weight: 600; font-family: var(--font-head); }

@media (max-width: 600px) {
  /* full screen on mobile */
  #recipe-list-panel {
    width: 100%; border-right: none;
  }
  #ingr-search { width: 110px; }
}

/* ─── LOADING ────────────────────────────────────────────────────────────── */
#loading {
  position: absolute; inset: 0; z-index: 100;
  background: var(--bg); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
}
#loading .l-logo { font-family: var(--font-head); font-size: 28px; font-weight: 800; background: linear-gradient(120deg, #fff, var(--accent2), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
#loading .l-sub { font-size: 12px; color: var(--text3); }
.spinner { width: 28px; height: 28px; border: 2px solid var(--surface2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── MOBILE ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #header { padding: 8px 10px; gap: 6px; }
  #logo { font-size: 15px; }
  .filter-group .filter-label { display: none; }
  .separator { display: none; }
  .chip { font-size: 10px; padding: 2px 7px; }
  #vote-toggle-btn { font-size: 10px; padding: 3px 7px; }
  .modal-title { font-size: 18px; }
  .axes-form { grid-template-columns: 1fr 1fr; }

  /* recipe modal: sheet from bottom */
  #modal-overlay { align-items: flex-end; padding: 0; }
  #modal {
    max-height: 95vh;
    max-height: 95dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .modal-hero { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-hero-placeholder { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

  /* close button: inside modal content, not clipped */
  #modal-close {
    position: absolute; top: 12px; right: 12px; margin: 0;
  }

  /* admin form: sheet from bottom, sticky action buttons */
  #admin-overlay { align-items: flex-end; padding: 0; }
  #admin-panel {
    max-height: 94vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: 0;
  }
  .form-actions {
    position: sticky; bottom: 0;
    background: var(--bg2);
    padding: 12px 0 20px;
    margin-top: 12px;
    border-top: 0.5px solid var(--border);
  }
}

/* scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 2px; }
