:root {
  --bg: #f3f0e8;
  --bg-accent: #e5efe8;
  --surface: #fffdf8;
  --ink: #1c2b24;
  --muted: #5a6b62;
  --line: #cfd8d2;
  --brand: #0f6b4c;
  --brand-dark: #0a4d37;
  --accent: #c45c26;
  --danger: #a33b2d;
  --warning: #b8860b;
  --info: #2a6f97;
  --success: #0f6b4c;
  --shadow: 0 12px 40px rgba(28, 43, 36, 0.08);
  --radius: 14px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #d9ebe1 0%, transparent 40%),
    radial-gradient(circle at 90% 10%, #f3dfcf 0%, transparent 35%),
    linear-gradient(180deg, var(--bg), var(--bg-accent));
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.container { width: min(1100px, 92vw); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(243, 240, 232, 0.85);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.brand span { color: var(--brand); }
.nav-links {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.95rem;
}
.nav-links a { color: var(--muted); }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.88rem; }

.page { padding: 2rem 0 4rem; }
.hero {
  display: grid;
  gap: 1.2rem;
  padding: 3rem 0 2rem;
  animation: rise 0.6s ease both;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.03em;
}
.hero p { margin: 0; color: var(--muted); font-size: 1.15rem; max-width: 40rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
  animation: rise 0.5s ease both;
}
.panel h2, .panel h3 {
  font-family: var(--font-display);
  margin-top: 0;
}

.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; gap: 1rem; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.metric {
  padding: 1.1rem;
  border-radius: 12px;
  background: linear-gradient(160deg, #fff, #f2f7f4);
  border: 1px solid var(--line);
}
.metric .value {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--brand);
}
.metric .label { color: var(--muted); font-size: 0.92rem; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #e7eee9;
  color: var(--ink);
}
.badge-discussion { background: #dceaf5; color: #1d4e70; }
.badge-voting { background: #f6e5c8; color: #7a4e00; }
.badge-reformulation { background: #f5e0d8; color: #7a2e12; }
.badge-mediation { background: #e8dff5; color: #4b2d73; }
.badge-approved { background: #d8f0e3; color: #0f5a3d; }
.badge-rejected { background: #f5d8d5; color: #7a1f16; }
.badge-archived { background: #e8e8e8; color: #555; }
.badge-draft { background: #eee; color: #666; }

.flash-wrap { margin: 1rem 0; }
.flash {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  border: 1px solid transparent;
}
.flash-success { background: #e5f6ec; border-color: #b7e0c6; }
.flash-danger { background: #fce8e6; border-color: #efc2bc; }
.flash-warning { background: #fff4d6; border-color: #f0d48a; }
.flash-info { background: #e7f2fa; border-color: #b9d6ea; }

label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.form-group { margin-bottom: 1rem; }
.form-hint { color: var(--muted); font-size: 0.88rem; margin-top: 0.25rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="datetime-local"], input[type="number"], select, textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
.form-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.checkbox-row { display: flex; gap: 0.5rem; align-items: center; margin: 0.4rem 0; }
.checkbox-row label { margin: 0; font-weight: 500; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; background: #dfe8e3; display: inline-block;
}
.avatar-lg { width: 96px; height: 96px; }

.comment {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}
.comment:first-child { border-top: 0; }
.comment-meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 0.35rem; }
.support-btn {
  background: none; border: none; color: var(--brand); cursor: pointer;
  font: inherit; padding: 0; font-weight: 600;
}
.support-btn:hover { text-decoration: underline; }

.vote-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.objection-form, .concern-form {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background: #faf7f1;
  border-radius: 10px;
  border: 1px dashed var(--line);
}
.objection-form.open, .concern-form.open { display: block; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  position: relative;
  padding: 0.75rem 0 0.75rem 1.2rem;
  border-left: 2px solid var(--line);
  margin-left: 0.4rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px; top: 1.1rem;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
}

.auth-card {
  width: min(440px, 92vw);
  margin: 3rem auto;
}
.muted { color: var(--muted); }
.stack-sm > * + * { margin-top: 0.5rem; }
.actions-inline { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,30,26,0.45);
  display: none; align-items: center; justify-content: center; z-index: 50;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.25rem; width: min(420px, 100%);
  box-shadow: var(--shadow);
  animation: rise 0.25s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.section-title h1, .section-title h2 {
  font-family: var(--font-display); margin: 0;
}

.list-link { font-weight: 600; color: var(--ink); }
.list-link:hover { color: var(--brand); }

footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
