:root {
  --cream: #FDEEF1;
  --cream-2: #F9DCE3;
  --sand: #F3C6D1;
  --terra: #D6336C;
  --terra-deep: #A61E4D;
  --ink: #3A1425;
  --ink-soft: #6B3A50;
  --paper: #FFF6F8;
  --line: rgba(58, 20, 37, 0.1);
  --muted-pill: rgba(58, 20, 37, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, select, input, textarea { font: inherit; color: inherit; }

.mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 15% 0%, rgba(242, 123, 163, 0.28), transparent 60%),
    radial-gradient(ellipse 55% 45% at 90% 20%, rgba(214, 51, 108, 0.16), transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(255, 177, 200, 0.22), transparent 60%);
  z-index: 0;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.top, .shell, .foot { position: relative; z-index: 2; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 24px 8px;
}

.brand img { width: 118px; height: auto; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-link, .btn-text {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color 0.15s ease;
  background: none;
  border: none;
  cursor: pointer;
}
.home-link:hover, .btn-text:hover { color: var(--terra); }

.btn-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: var(--terra);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-solid:hover { background: var(--terra-deep); }
.btn-solid:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 10px;
}

.title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  max-width: 16ch;
  margin-bottom: 12px;
}

.lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 42ch;
  margin-bottom: 28px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.tab.is-active {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
}

.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.filter-label select,
.compose-form select,
.compose-form input,
.compose-form textarea {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.86rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
}

.auth-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(214, 51, 108, 0.08);
  border: 1px solid rgba(214, 51, 108, 0.16);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty {
  padding: 28px 8px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.post-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.post-card:hover {
  border-color: rgba(214, 51, 108, 0.28);
  transform: translateY(-1px);
}

.vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 44px;
}

.vote-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.vote-btn.is-voted,
.vote-btn:hover {
  background: rgba(214, 51, 108, 0.1);
  border-color: rgba(214, 51, 108, 0.35);
  color: var(--terra);
}

.vote-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
}

.post-main { min-width: 0; }

.post-title {
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--muted-pill);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.chip.kind-feature { background: rgba(31, 138, 91, 0.12); color: #1F8A5B; }
.chip.kind-issue { background: rgba(198, 40, 74, 0.1); color: #C6284A; }
.chip.platform { background: rgba(58, 20, 37, 0.06); }
.chip.status { background: rgba(214, 51, 108, 0.1); color: var(--terra-deep); }
.chip.status-deciding {
  background: var(--muted-pill);
  color: var(--ink-soft);
  font-weight: 500;
}
.chip.badge-admin {
  background: rgba(214, 51, 108, 0.14);
  color: var(--terra-deep);
}

.back-btn {
  margin-bottom: 18px;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.back-btn:hover { color: var(--terra); }

.detail-card {
  padding: 22px 22px 28px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.detail-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 12px 0 14px;
}

.detail-body {
  font-size: 1rem;
  color: var(--ink);
  white-space: pre-wrap;
  margin: 18px 0 22px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 28px;
}

.replies-heading {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.reply {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.reply-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.reply-body {
  font-size: 0.95rem;
  color: var(--ink);
  white-space: pre-wrap;
}

.reply-time {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px 36px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.compose-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  border: none;
  border-radius: 18px;
  padding: 0;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(58, 20, 37, 0.18);
}
.compose-dialog::backdrop {
  background: rgba(58, 20, 37, 0.35);
}

.compose-form {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.compose-form h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.45rem;
}

.compose-hint { font-size: 0.9rem; color: var(--ink-soft); }
.compose-gate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(214, 51, 108, 0.08);
  border: 1px solid rgba(214, 51, 108, 0.16);
}
.compose-gate[hidden] { display: none; }

.compose-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compose-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.compose-error {
  font-size: 0.86rem;
  color: #C6284A;
}

.compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .title { max-width: none; }
  .toolbar { align-items: stretch; }
  .toolbar-right { width: 100%; }
  .filter-label { flex: 1; justify-content: space-between; }
  .filter-label select { flex: 1; }
}
