:root {
  --bg: #fff8ef;
  --card: #ffffff;
  --ink: #1d1a17;
  --muted: #6f675e;
  --line: #ece3d6;
  --al: #17a34a;
  --al-soft: #e3f6e9;
  --alma: #e5484d;
  --alma-soft: #fdeaea;
  --bekle: #e09a00;
  --bekle-soft: #fff3d4;
  --accent: #ff5a1f;
  --shadow: 0 1px 2px rgba(40, 25, 10, .06), 0 6px 20px rgba(40, 25, 10, .06);
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120f; --card: #201c18; --ink: #f4eee6; --muted: #a89f94; --line: #332d27;
    --al-soft: #12301d; --alma-soft: #3a1a1b; --bekle-soft: #3a2c0b;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15120f; --card: #201c18; --ink: #f4eee6; --muted: #a89f94; --line: #332d27;
  --al-soft: #12301d; --alma-soft: #3a1a1b; --bekle-soft: #3a2c0b;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 96px;
}
h1, h2, h3, .brand, .verdict, .price { font-family: "Bricolage Grotesque", Inter, sans-serif; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; max-width: 640px; margin: 0 auto;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.brand { font-weight: 800; font-size: 24px; text-decoration: none; letter-spacing: -.02em; }
.brand span { color: var(--accent); margin-left: 4px; }
.top nav { display: flex; gap: 10px; align-items: center; }
.top nav a { text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); }
.top nav a.active { color: var(--ink); }
.chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 4px 10px; font-size: 13px; font-weight: 600; cursor: pointer;
}

main { max-width: 640px; margin: 0 auto; padding: 4px 16px; }

.hero { padding: 18px 2px 8px; }
.hero h1 { font-size: clamp(28px, 7vw, 40px); line-height: 1.05; margin: 0 0 8px; letter-spacing: -.03em; }
.hero p { margin: 0; color: var(--muted); }

.tabs { display: flex; gap: 8px; margin: 16px 0 12px; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); overflow: hidden; margin-bottom: 14px;
}
.card .media { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--line); }
.card .body { padding: 14px 16px 16px; }
.card a.title { text-decoration: none; }
.card h2 { font-size: 20px; margin: 0 0 2px; line-height: 1.2; letter-spacing: -.01em; }
.price { font-weight: 800; font-size: 22px; color: var(--accent); }
.meta { color: var(--muted); font-size: 13px; }
.note { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

.votes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.vote {
  border: 2px solid var(--line); background: var(--card); border-radius: 14px;
  padding: 10px 6px; cursor: pointer; font-weight: 700; font-size: 15px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.vote:active { transform: scale(.96); }
.vote .e { font-size: 22px; line-height: 1; }
.vote small { font-weight: 500; color: var(--muted); font-size: 12px; }
.vote.al.on { background: var(--al-soft); border-color: var(--al); }
.vote.alma.on { background: var(--alma-soft); border-color: var(--alma); }
.vote.bekle.on { background: var(--bekle-soft); border-color: var(--bekle); }
.vote:disabled { cursor: default; opacity: .85; }

.bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--line); margin-top: 12px; }
.bar i { display: block; height: 100%; transition: width .3s ease; }
.bar .al { background: var(--al); } .bar .alma { background: var(--alma); } .bar .bekle { background: var(--bekle); }
.legend { display: flex; gap: 12px; font-size: 13px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.legend b { color: var(--ink); }

.verdict {
  margin-top: 14px; padding: 14px 16px; border-radius: 14px; font-weight: 700; font-size: 18px;
  background: var(--bg); border: 1px dashed var(--line);
}
.verdict.al { background: var(--al-soft); border-color: var(--al); }
.verdict.alma { background: var(--alma-soft); border-color: var(--alma); }
.verdict.bekle { background: var(--bekle-soft); border-color: var(--bekle); }

.outcome { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; }
.outcome.bought { background: var(--al-soft); color: var(--al); }
.outcome.skipped { background: var(--alma-soft); color: var(--alma); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 700; cursor: pointer;
  background: var(--ink); color: var(--bg); text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.wa { background: #25d366; color: #06290f; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { padding: 8px 12px; font-size: 14px; border-radius: 12px; }

form.new { display: grid; gap: 14px; padding: 16px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
label small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=url], input[type=number], textarea, select {
  width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 12px;
  padding: 12px 14px; font-size: 16px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 84px; }
.price-row { display: grid; grid-template-columns: 1fr 96px; gap: 8px; }
.photo {
  border: 2px dashed var(--line); border-radius: 14px; padding: 18px; text-align: center; cursor: pointer;
  color: var(--muted); display: block;
}
.photo img { max-width: 100%; max-height: 260px; border-radius: 10px; display: block; margin: 0 auto; }
.switch { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.switch input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }

.comments { margin-top: 18px; }
.comments h3 { margin: 0 0 8px; font-size: 18px; }
.comment { padding: 10px 0; border-top: 1px solid var(--line); }
.comment b { font-size: 14px; }
.comment p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cform { display: grid; gap: 8px; margin-top: 10px; }

.share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.owner { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.owner h3 { margin: 0 0 8px; font-size: 16px; }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.back { display: inline-block; margin: 8px 0 12px; color: var(--muted); text-decoration: none; font-weight: 600; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }

.fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20;
  background: var(--accent); color: #fff; text-decoration: none; border-radius: 999px;
  padding: 14px 22px; font-weight: 800; box-shadow: 0 8px 24px rgba(255, 90, 31, .35);
  display: flex; align-items: center; gap: 6px; font-family: "Bricolage Grotesque", sans-serif; font-size: 18px;
}
.fab span { font-size: 24px; line-height: 1; }
.fab.hide { display: none; }

#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .2s ease; z-index: 30; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.skeleton { height: 220px; border-radius: var(--radius); background: linear-gradient(90deg, var(--line), var(--card), var(--line)); background-size: 200% 100%; animation: sh 1.2s infinite; margin-bottom: 14px; }
@keyframes sh { to { background-position: -200% 0; } }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat b { display: block; font-size: 28px; font-family: "Bricolage Grotesque", sans-serif; }
.stat small { color: var(--muted); }
.stat.ok b { color: var(--al); } .stat.no b { color: var(--alma); }

.lead { display: flex; align-items: center; gap: 6px; min-width: 0; }
.back-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-left: -8px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink); cursor: pointer;
}
.back-btn:hover, .back-btn:focus-visible { background: var(--line); }
.back-btn[hidden] { display: none; }
main > .card:first-child, main > h1:first-child { margin-top: 8px; }

.sortbar { display: flex; gap: 8px; overflow-x: auto; margin: 16px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
.sortbar::-webkit-scrollbar { display: none; }
.sortbar.sub { margin-top: 8px; }
.sortbar .chip { flex: none; padding: 7px 14px; font-size: 14px; }
.sortbar .chip.sm { padding: 5px 11px; font-size: 13px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 14px; }
.filters input { grid-column: 1 / -1; }
.filters input, .filters select { padding: 10px 12px; font-size: 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); width: 100%; }

/* ---- swipe mode ---- */
.swipe-cta { margin-top: 14px; background: var(--accent); color: #fff; }
.swipe-head { padding: 6px 2px 10px; }
.swipe-head h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }
.deck { position: relative; height: min(64vh, 560px); margin-top: 4px; }
.deck-skel { height: 100%; }
.scard {
  position: absolute; inset: 0; background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 10px 30px rgba(40, 25, 10, .12); overflow: hidden; display: flex; flex-direction: column;
  touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .25s ease;
  cursor: grab;
}
.scard:active { cursor: grabbing; }
.scard.next { transform: scale(.95) translateY(12px); opacity: .7; pointer-events: none; }
.scard img { width: 100%; flex: 1 1 50%; min-height: 0; object-fit: cover; background: var(--line); pointer-events: none; }
.scard .noimg { flex: 0 0 34%; display: grid; place-items: center; font-size: 72px; background: linear-gradient(135deg, var(--bekle-soft), var(--alma-soft)); }
.sbody { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; min-height: 0; flex: 1 1 auto; overflow: hidden; }
.sbody h2 { margin: 2px 0 0; font-size: 24px; line-height: 1.15; letter-spacing: -.01em; }
.sbody .price { font-size: 26px; }
.sbody .note { margin: 6px 0 4px; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.sbody > .meta:last-child { margin-top: auto; }
.stamp {
  position: absolute; top: 26px; padding: 6px 14px; border: 4px solid; border-radius: 12px; font: 800 30px "Bricolage Grotesque", sans-serif;
  opacity: 0; pointer-events: none; background: color-mix(in srgb, var(--card) 70%, transparent);
}
.stamp.al { left: 22px; color: var(--al); transform: rotate(-14deg); }
.stamp.alma { right: 22px; color: var(--alma); transform: rotate(14deg); }
.stamp.bekle { left: 50%; top: auto; bottom: 40%; color: var(--bekle); transform: translateX(-50%); }
.deck-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; border: 2px dashed var(--line); border-radius: 22px; }
.deck-empty h2 { margin: 0; }
.swipe-btns { display: flex; justify-content: center; gap: 18px; margin-top: 18px; }
.sbtn {
  width: 76px; height: 76px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; box-shadow: var(--shadow);
  transition: transform .08s ease;
}
.sbtn span { font-size: 26px; line-height: 1.1; }
.sbtn:active { transform: scale(.92); }
.sbtn.al { border-color: var(--al); color: var(--al); } .sbtn.alma { border-color: var(--alma); color: var(--alma); } .sbtn.bekle { border-color: var(--bekle); color: var(--bekle); width: 64px; height: 64px; align-self: center; }
.reveal {
  position: fixed; left: 50%; top: 70px; transform: translate(-50%, -12px); z-index: 25; width: min(92vw, 420px);
  padding: 12px 16px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow);
  display: grid; gap: 2px; opacity: 0; pointer-events: none; transition: .2s ease;
}
.reveal.show { opacity: 1; transform: translate(-50%, 0); }
.reveal.al { border-color: var(--al); } .reveal.alma { border-color: var(--alma); } .reveal.bekle { border-color: var(--bekle); }
body.swipe-mode { padding-bottom: 24px; overscroll-behavior: none; }
.scard { align-items: stretch; }

/* swipe screen fills exactly one screen on any phone: header, title, card (flexible), buttons always visible */
body.swipe-mode { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
body.swipe-mode .top { flex: none; position: relative; width: 100%; }
body.swipe-mode main {
  flex: 1 1 auto; min-height: 0; width: 100%; display: flex; flex-direction: column;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
body.swipe-mode .swipe-head { flex: none; padding: 0 2px 8px; }
body.swipe-mode .swipe-head h1 { font-size: 22px; margin: 0 0 2px; }
body.swipe-mode .swipe-head p { margin: 0; font-size: 13px; }
body.swipe-mode .deck { flex: 1 1 auto; height: auto; min-height: 220px; margin-top: 0; }
body.swipe-mode .swipe-btns { flex: none; margin-top: 12px; }
body.swipe-mode main > .row { flex: none; margin-top: 4px !important; min-height: 20px; }
.scard .noimg { flex: 1 1 30%; min-height: 70px; max-height: 38%; font-size: clamp(40px, 9vh, 72px); width: 100%; align-self: stretch; }
.scard img { max-height: 55%; }
.sbody { flex: 1 1 auto; }
@media (max-height: 700px) { body.swipe-mode .swipe-head p { display: none; } .sbtn { width: 64px; height: 64px; } .sbtn.bekle { width: 56px; height: 56px; } }
.ts:empty { display: none; } .ts { display: flex; justify-content: center; }

/* feed: small photo beside the text; the full photo is on the question page */
.card .head { display: flex; gap: 12px; align-items: flex-start; margin-top: 4px; }
.card .head-text { flex: 1; min-width: 0; }
.card .thumb { flex: none; width: 92px; height: 92px; border-radius: 12px; overflow: hidden; background: var(--line); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .head .note { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.adm-row { margin-left: auto; display: inline-flex; gap: 8px; } .linkbtn.adm { color: var(--alma); font-size: 12px; } .comment .adm-row { margin-left: 8px; }
