:root {
  --bg: #fbf6ee; --card: #fff; --ink: #2b2a26; --muted: #6b665c; --line: #ece4d6;
  --green: #2f7d4a; --green-soft: #e6f3ea; --carrot: #e8772e; --carrot-soft: #fdf0e6;
  --bean: #7a4e2d; --bean-soft: #f5ece4; --red: #b8483a; --red-soft: #f8e6e3;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, sans-serif; }
a { color: var(--green); }
main { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }

/* header */
.hero { text-align: center; padding: 36px 16px 20px; background:
  radial-gradient(circle at 15% 20%, #fde3cf 0 90px, transparent 91px),
  radial-gradient(circle at 88% 70%, #dcefe1 0 110px, transparent 111px), var(--bg); }
.hero .emoji { font-size: 44px; letter-spacing: 6px; }
.hero h1 { font-family: var(--round); font-size: clamp(32px, 6vw, 52px); margin: 4px 0; color: var(--green); }
.hero .tag { font-family: var(--round); font-size: 20px; margin: 0 0 6px; color: var(--carrot); font-weight: 700; }
.hero .sub { color: var(--muted); margin: 0; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 0; padding: 0; list-style: none; }
.stats li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.howto { max-width: 760px; margin: 10px auto 0; color: var(--muted); font-size: 13px; text-align: left; }
.howto summary { cursor: pointer; text-align: center; }

/* sticky filter bar */
#bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line); }
#bar .lbl { font-weight: 600; margin-right: 4px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; }
.pill span { display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; }
.pill input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.pill input:focus-visible + span { outline: 2px solid var(--carrot); outline-offset: 2px; }
#count { margin-left: auto; color: var(--muted); font-size: 13px; }

/* add + passphrase */
#add { margin: 14px 0; background: var(--card); border: 1px dashed #d8ccb6; border-radius: 14px; padding: 10px 14px; }
#add summary { cursor: pointer; font-weight: 600; color: var(--green); }
#addform { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin-top: 10px; }
#addform label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); flex: 1 1 160px; }
#addform label.wide { flex: 3 1 320px; }
#pass { background: #fff7d6; border: 1px solid #f0dc8a; border-radius: 12px; padding: 10px 14px; margin: 14px 0; }
input, textarea, button { font: inherit; color: inherit; }
input, textarea { border: 1px solid #ddd3c2; border-radius: 8px; padding: 6px 8px; background: #fffdf9; }
input:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
button { border: 1px solid #d8ccb6; background: var(--card); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
button.primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }

/* cards */
#list, #manual { display: grid; gap: 14px; margin-top: 14px; }
.card { display: grid; grid-template-columns: 300px 1fr 300px; gap: 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: 0 1px 2px #0000000a, 0 4px 14px #00000008;
  transition: opacity .2s, background .2s; }
.card[hidden] { display: none; }
.card.other { opacity: .62; }
.card.r-yes { background: var(--green-soft); border-color: #b9dcc4; }
.card.r-no { opacity: .4; }
.card.manual { border-style: dashed; border-color: #d8ccb6; }
.pic { width: 300px; height: 225px; border-radius: 12px; overflow: hidden; background: var(--bean-soft);
  display: flex; align-items: center; justify-content: center; font-size: 42px; text-decoration: none; }
.pic img { width: 100%; height: 100%; object-fit: cover; }
.info h3 { margin: 4px 0 6px; font-size: 17px; line-height: 1.3; }
.info h3 a { color: var(--ink); text-decoration: none; }
.info h3 a:hover { color: var(--green); text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; }
.price { font-weight: 700; color: var(--ink); background: var(--carrot-soft); border-radius: 6px; padding: 0 6px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 12px; border-radius: 999px; padding: 2px 9px; background: var(--bean-soft); color: var(--bean); }
.badge.s0 { background: var(--green-soft); color: var(--green); }
.badge.s1 { background: #e7eefb; color: #2e5aa8; }
.badge.s2 { background: #f1eafb; color: #6a3fb0; }
.badge.s3 { background: #fbf3d6; color: #8a6a00; }
.hits { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.hits b { color: var(--ink); }
.del { margin-left: 6px; font-size: 12px; padding: 2px 8px; color: var(--red); }

/* controls */
.ctl { display: flex; flex-direction: column; gap: 6px; border-left: 1px solid var(--line); padding-left: 14px; }
.rate { display: flex; gap: 6px; }
.rate button { flex: 1; border-radius: 999px; }
.rate button[aria-pressed=true][data-r=yes] { background: var(--green); border-color: var(--green); color: #fff; }
.rate button[aria-pressed=true][data-r=no] { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.ctl input, .ctl textarea { width: 100%; }
.ctl textarea { field-sizing: content; min-height: 2.6em; resize: vertical; overflow: hidden; }
.nl { display: flex; flex-direction: column; gap: 2px; font-size: 12px; font-weight: 600; }
.nl.bohni { color: var(--bean); } .nl.bohni textarea { border-left: 4px solid var(--bean); }
.nl.moehri { color: var(--carrot); } .nl.moehri textarea { border-left: 4px solid var(--carrot); }
.nl textarea { font-weight: 400; color: var(--ink); font-size: 14px; }
.chatlink:not([hidden]) { display: inline-block; font-weight: 600; }
.saved { color: var(--muted); font-size: 12px; min-height: 1em; }

@media (max-width: 860px) {
  .card { grid-template-columns: 220px 1fr; }
  .pic { width: 220px; height: 165px; }
  .ctl { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 10px 0 0; }
}
@media (max-width: 480px) {
  .card { grid-template-columns: 1fr; }
  .pic { width: 100%; height: auto; aspect-ratio: 4 / 3; }
  #count { width: 100%; margin: 0; }
}

/* password gate */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate[hidden], #app[hidden] { display: none; }
.gatebox { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px 32px;
  box-shadow: 0 6px 24px #0000000f; text-align: center; display: flex; flex-direction: column; gap: 12px; min-width: 280px; }
.gatebox .emoji { font-size: 40px; }
.gatebox h1 { font-family: var(--round); color: var(--green); margin: 0; }
.gatebox label { display: flex; flex-direction: column; gap: 4px; text-align: left; font-size: 13px; color: var(--muted); }
#passmsg { margin: 0; color: var(--red); min-height: 1.2em; }
