:root {
  --bg: #0f0e0d;
  --card: #1a1715;
  --fg: #f3efe9;
  --muted: #a89f95;
  --border: #2c2824;
  --accent: #c9a992;
  --accent-fg: #14110f;
  --pink: #da85e6;
  --danger: #e57373;
  --font: "Source Sans 3", system-ui, sans-serif;
  --display: "Cormorant Garamond", Georgia, serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.5;
}
a { color: var(--accent); }
.wrap { max-width: 52rem; margin: 0 auto; padding: 1rem; }
.top {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border);
  padding: .75rem 1rem; background: #171513;
  position: sticky; top: 0; z-index: 20;
}
.brand { font-family: var(--display); font-size: 1.35rem; font-weight: 600; color: var(--fg); text-decoration: none; }
.nav a { margin-left: .75rem; font-size: .875rem; color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--fg); }
h1,h2 { font-family: var(--display); font-weight: 500; letter-spacing: -.02em; }
.muted { color: var(--muted); font-size: .875rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: .75rem;
  padding: 1rem 1.1rem; margin-bottom: .75rem;
}
.card h2 { margin: 0 0 .35rem; font-size: 1.25rem; }
.card h2 a { color: var(--fg); text-decoration: none; }
.card h2 a:hover { color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.tag {
  font-size: .7rem; padding: .15rem .5rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); background: #12100f;
  cursor: pointer; text-decoration: none;
}
.tag:hover, .tag.active { border-color: var(--pink); color: var(--pink); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.filters input[type=search], .filters input[type=text], .filters select, textarea {
  background: #12100f; border: 1px solid var(--border); color: var(--fg);
  border-radius: .4rem; padding: .55rem .7rem; font: inherit; width: 100%;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: .4rem; padding: .6rem 1rem; font: inherit;
  font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn-accent { background: var(--accent); color: var(--accent-fg); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--fg); }
.btn-pink { background: var(--pink); color: #1a0a1c; }
.err { color: var(--danger); font-size: .875rem; margin: .5rem 0; }
.ok { color: #8fbc8f; font-size: .875rem; margin: .5rem 0; }
.reply {
  border-left: 2px solid var(--border); padding: .6rem 0 .6rem .9rem; margin: .75rem 0;
}
.reply .meta { font-size: .75rem; color: var(--muted); margin-bottom: .25rem; }
.facet-grid {
  display: grid;
  gap: .75rem;
  align-items: start; /* tops of filter + results share one line */
}
@media (min-width: 720px) {
  .facet-grid { grid-template-columns: 14rem 1fr; }
}
.facet-box {
  max-height: 70vh;
  overflow: auto;
  padding-right: .25rem;
  margin-bottom: 0; /* align with results column top */
}
.facet-box > strong:first-child {
  display: block;
  line-height: 1.3;
}
.facet-box h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: .75rem 0 .35rem; }

/* Results column: count + subtle show-all sit on same top edge as Filter card */
.results-col {
  min-width: 0;
  margin: 0;
  padding: 0;
}
.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 0 0.55rem;
  min-height: 1.35rem; /* roughly matches “Filter by tags” title line */
  padding: 1rem 0 0; /* match .card top padding so tops align with Filter card */
}
.results-count {
  margin: 0;
  line-height: 1.3;
}
.subtle-link {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(168, 159, 149, 0.55);
}
.subtle-link:hover {
  color: var(--pink);
  text-decoration-color: var(--pink);
}
.results-col > .card:first-of-type {
  margin-top: 0;
}

/* Email gate modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-backdrop[hidden] { display: none !important; }
.modal {
  width: min(100%, 26rem); background: var(--card); border: 1px solid var(--border);
  border-radius: .85rem; padding: 1.25rem; box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.modal h2 { margin-top: 0; font-size: 1.35rem; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; overflow: hidden; }
.cf-turnstile { margin: .75rem 0; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.75rem;
  font-size: 0.875rem;
  color: var(--fg);
}
.icon-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--accent);
  border-radius: 999px;
  width: 1.6rem;
  height: 1.6rem;
  line-height: 1;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}
.icon-btn:hover { border-color: var(--accent); background: #221e1b; }
.react-bar { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.react-bar form { display: inline; }
.modal-wide { width: min(100%, 28rem); max-height: 92dvh; overflow: auto; }
.social-box {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: #12100f;
}
.social-row {
  display: grid;
  grid-template-columns: 1fr auto minmax(0, 1.2fr);
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
}
@media (max-width: 520px) {
  .social-row { grid-template-columns: 1fr; }
}
.social-label { color: var(--fg); font-weight: 600; min-width: 5.5rem; }
.social-radio { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.social-row input[type=text] {
  background: #0f0e0d;
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 0.35rem;
  padding: 0.4rem 0.5rem;
  font: inherit;
  width: 100%;
}
@media (max-width: 719px) {
  .results-head {
    padding-top: 0.25rem; /* results-head pad mobile */
  }
}