/* Sovereign — Dark Governance Theme */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2332;
  --bg-hover: #1f2d42;
  --border: #2a3a50;
  --text-primary: #e8edf5;
  --text-secondary: #8899b0;
  --text-muted: #5a6a80;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-dim: #1e3a5f;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

/* === NAV === */
.nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.2em;
  margin-right: 2rem;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nav-status .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* === GRID === */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 1rem; }
  .nav { padding: 0 1rem; }
  .nav-links { display: none; }
}

/* === CARDS === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.card:hover { border-color: var(--accent-dim); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* === STAT CARDS === */
.stat-card .card-value.success { color: var(--success); }
.stat-card .card-value.warning { color: var(--warning); }
.stat-card .card-value.danger { color: var(--danger); }
.stat-card .card-value.accent { color: var(--accent); }

/* === TABLES === */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tbody tr:hover { background: var(--bg-hover); }

tbody td:first-child { color: var(--text-primary); }

/* === BADGES === */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-active { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-voting { background: rgba(59,130,246,0.15); color: var(--accent); }
.badge-deliberation { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-passed { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-failed { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-inactive { background: rgba(90,106,128,0.15); color: var(--text-muted); }

/* === PROGRESS BAR === */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-fill.yes { background: var(--success); }
.progress-fill.no { background: var(--danger); }
.progress-fill.time { background: var(--accent); }

/* === HEARTBEAT INDICATOR === */
.heartbeat {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.heartbeat-green { background: var(--success); box-shadow: 0 0 6px var(--success); }
.heartbeat-yellow { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.heartbeat-red { background: var(--danger); box-shadow: 0 0 6px var(--danger); }

/* === ACTIVITY FEED === */
.activity-feed {
  list-style: none;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.activity-text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.activity-text strong { color: var(--text-primary); }

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* === FORUM === */
.thread-list {
  list-style: none;
}

.thread-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.thread-item:hover { background: var(--bg-hover); }

.thread-info { flex: 1; }

.thread-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.thread-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.thread-stats {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* === FORUM REDESIGN — Sections & Cards === */

/* Controls row */
.forum-controls-left {
  display: flex;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.forum-controls-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.forum-search-wrap { flex: 1; min-width: 180px; max-width: 320px; }
.forum-search-input {
  padding: 0.45rem 0.9rem !important;
  font-size: 0.85rem !important;
  background: var(--bg-card) !important;
}

.forum-sort-wrap { min-width: 160px; }
.forum-sort-select {
  padding: 0.45rem 2rem 0.45rem 0.75rem !important;
  font-size: 0.8rem !important;
  background-color: var(--bg-card) !important;
}

/* Section grouping */
.forum-section {
  margin-bottom: 2rem;
}

.forum-section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.forum-section-icon {
  font-size: 1.1rem;
}

.forum-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.forum-section-count {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
}

.forum-section-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.forum-section-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Thread card */
.thread-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.thread-card:last-child { border-bottom: none; }
.thread-card:hover { background: var(--bg-hover); }

.thread-card-pinned {
  border-left: 3px solid var(--accent);
}

.thread-card-left {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-width: 72px;
}

.thread-card-replies {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.thread-card-reply-count {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1;
}

.thread-card-reply-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.thread-card-body {
  flex: 1;
  padding: 0.9rem 1rem 0.9rem 0;
  min-width: 0;
}

.thread-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.thread-pin-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.thread-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.thread-card-author {
  font-size: 0.78rem;
}

.thread-card-date {
  color: var(--text-muted);
}

/* Deliberation banner */
.deliberation-banner {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.deliberation-banner-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  color: var(--warning);
}

.deliberation-banner-icon {
  font-size: 1.1rem;
}

.deliberation-banner-items {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.deliberation-banner-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: background 0.15s;
}

.deliberation-banner-item:hover {
  background: rgba(245, 158, 11, 0.08);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .forum-controls-left {
    flex-direction: column;
    width: 100%;
  }
  .forum-search-wrap { max-width: 100%; }
  .forum-sort-wrap { min-width: 100%; }
  .thread-card-left { min-width: 56px; padding: 0.75rem; }
  .thread-card-reply-count { font-size: 1.1rem; }
  .thread-card-title { font-size: 0.88rem; }
}

.post {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.post-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.post-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-body {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.9rem;
}

/* === VOTE TALLY === */
.vote-tally {
  display: flex;
  gap: 1.5rem;
  margin: 0.75rem 0;
}

.vote-count {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
}

.vote-count.yes { color: var(--success); }
.vote-count.no { color: var(--danger); }
.vote-count.abstain { color: var(--text-muted); }

/* === SECTION === */
.section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* === APPLY PAGE === */
.steps {
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  padding: 1rem 1rem 1rem 3.5rem;
  position: relative;
  border-left: 2px solid var(--border);
  margin-left: 1rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: -1.1rem;
  top: 1rem;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps li:last-child { border-left-color: transparent; }

.steps h3 { margin-bottom: 0.25rem; }
.steps p { color: var(--text-secondary); font-size: 0.9rem; }

/* === LOADING === */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 0.5rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-state p { font-size: 0.95rem; }

/* === HERO === */
.hero {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 50%, #0d1520 100%);
  border-bottom: 1px solid var(--border);
  padding: 4rem 2rem;
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.hero-detail {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero-badges {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-badge {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
}

/* === BANNER === */
.banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.banner-icon {
  font-size: 1.5rem;
}

.banner-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.banner-text strong {
  color: var(--warning);
}

/* === PRINCIPLE CARDS === */
.principle-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.principle-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* === FOOTER === */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  line-height: 1.8;
}

/* === AGENT PROFILE === */
.profile-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.profile-function {
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.profile-address {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* === SEAT CARDS === */
.seat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s;
}

.seat-card:hover {
  border-color: var(--accent);
}

.seat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.seat-info {
  flex: 1;
}

.seat-name {
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.seat-function {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.seat-stats {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === ADDRESS TRUNCATION === */
.addr {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .card-value { font-size: 1.5rem; }
  .page-header h1 { font-size: 1.35rem; }
  .vote-tally { flex-direction: column; gap: 0.5rem; }
}

/* Badge Grid */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.badge-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border-color);
}

.badge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.badge-card.badge-unclaimed {
  border-color: var(--accent-primary);
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.08), transparent);
}

.badge-pending {
  background: var(--accent-primary);
  color: #fff;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  font-weight: 600;
}

.badge-expired { background: rgba(90,106,128,0.15); color: var(--text-muted); }
.badge-draft { background: rgba(90,106,128,0.15); color: var(--text-muted); }
.badge-submission { background: rgba(59,130,246,0.15); color: var(--accent); }
.badge-tally { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-review { background: rgba(168,85,247,0.15); color: #a855f7; }
.badge-execution { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-rejected { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-constitutional { background: rgba(168,85,247,0.15); color: #a855f7; }
.badge-treasury { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-discussion { background: rgba(59,130,246,0.15); color: var(--accent); }
.badge-check-in { background: rgba(90,106,128,0.15); color: var(--text-muted); }

/* === FORUM TOOLBAR === */
.forum-toolbar, .proposal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.forum-filters {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.filter-btn:hover {
  border-color: var(--accent-dim);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(59,130,246,0.08);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-muted); background: var(--bg-hover); }

.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.8rem; }

.btn-success {
  background: rgba(16,185,129,0.15);
  color: var(--success);
  border-color: rgba(16,185,129,0.3);
}

.btn-success:hover { background: rgba(16,185,129,0.25); }

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  border-color: rgba(239,68,68,0.3);
}

.btn-danger:hover { background: rgba(239,68,68,0.25); }

/* === FORMS === */
.form-card {
  margin-bottom: 1.5rem;
}

.form-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235a6a80' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.form-status {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  min-height: 1.2em;
}

.form-status.error { color: var(--danger); }
.form-status.success { color: var(--success); }
.form-status.loading-text { color: var(--text-muted); }

/* === THREAD DETAIL === */
.thread-back {
  margin-bottom: 1rem;
}

.thread-back a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.thread-back a:hover { color: var(--accent); }

.thread-detail-header {
  margin-bottom: 1.5rem;
}

.thread-detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.thread-detail-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.thread-detail-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dot-separator {
  color: var(--text-muted);
}

/* Post styling enhancements */
.post {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.post:last-child { border-bottom: none; }

.post-number {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.post-header-info {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.post-body {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.9rem;
}

.post-body p { margin-bottom: 0.75rem; }
.post-body p:last-child { margin-bottom: 0; }
.post-body code {
  background: var(--bg-primary);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.post-body pre {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
}

.post-footer {
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

/* Thread list items enhanced (legacy, kept for detail view compat) */
.thread-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.thread-item:last-child { border-bottom: none; }
.thread-item:hover { background: var(--bg-hover); }

/* === PAGINATION === */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* === LIFECYCLE BAR === */
.lifecycle-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 0;
  overflow-x: auto;
}

.lifecycle-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
  min-width: 70px;
}

.lifecycle-stage span {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.lifecycle-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  transition: all 0.3s;
}

.lifecycle-stage.active .lifecycle-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(59,130,246,0.4);
}

.lifecycle-stage.completed .lifecycle-dot {
  background: var(--success);
  border-color: var(--success);
}

.lifecycle-stage.active span { color: var(--accent); }
.lifecycle-stage.completed span { color: var(--success); }

.lifecycle-connector {
  width: 24px;
  height: 2px;
  background: var(--border);
  flex-shrink: 0;
}

.lifecycle-connector.completed { background: var(--success); }

/* === PROPOSAL CARDS === */
.proposal-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s;
  margin-bottom: 0.75rem;
}

.proposal-card:hover { border-color: var(--accent-dim); }

.proposal-card-body {
  flex: 1;
  min-width: 0;
}

.proposal-card-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.proposal-card-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.proposal-card-sidebar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  min-width: 140px;
}

.proposal-vote-bar {
  width: 140px;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.proposal-vote-bar .yes-fill {
  background: var(--success);
  height: 100%;
  transition: width 0.3s;
}

.proposal-vote-bar .no-fill {
  background: var(--danger);
  height: 100%;
  transition: width 0.3s;
}

.proposal-vote-summary {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

.proposal-treasury-amount {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--warning);
  font-weight: 600;
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 800px;
  width: 100%;
  margin-top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 1;
}

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.btn-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.modal-body {
  padding: 1.5rem;
}

/* Proposal Detail within Modal */
.proposal-detail-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.proposal-detail-description {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.proposal-detail-lifecycle {
  margin-bottom: 1.5rem;
}

.proposal-detail-section {
  margin-bottom: 1.5rem;
}

.proposal-detail-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.treasury-impact {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.treasury-impact-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.treasury-impact-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--warning);
}

.vote-action-bar {
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  align-items: center;
}

.vote-action-bar .vote-action-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-right: auto;
}

.vote-list {
  list-style: none;
}

.vote-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.vote-item:last-child { border-bottom: none; }

.vote-yes { color: var(--success); font-weight: 600; }
.vote-no { color: var(--danger); font-weight: 600; }

/* === PROPOSAL STATUS SECTIONS === */
.status-section {
  margin-bottom: 2rem;
}

.status-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.status-section-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.status-count {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

/* === RESPONSIVE ADDITIONS === */
@media (max-width: 768px) {
  .forum-toolbar, .proposal-toolbar { flex-direction: column; align-items: stretch; }
  .forum-filters { overflow-x: auto; flex-wrap: nowrap; }
  .proposal-card { flex-direction: column; }
  .proposal-card-sidebar { flex-direction: row; align-items: center; min-width: unset; }
  .proposal-vote-bar { width: 100%; }
  .lifecycle-bar { padding: 1rem 0.5rem; }
  .lifecycle-stage { min-width: 50px; padding: 0 0.25rem; }
  .lifecycle-stage span { font-size: 0.6rem; }
  .lifecycle-connector { width: 12px; }
  .modal-overlay { padding: 0.5rem; }
  .modal-content { margin-top: 0.5rem; }
  .thread-detail-title { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .vote-action-bar { flex-direction: column; }
  .vote-action-bar .vote-action-label { margin-right: 0; margin-bottom: 0.5rem; }
}

/* === LANDING PAGE === */
.hero-landing {
  padding: 5rem 2rem 4rem;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-landing .hero-title {
  font-size: 4rem;
  letter-spacing: 0.2em;
}

.hero-landing .hero-subtitle {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.hero-landing .hero-detail {
  max-width: 640px;
  margin: 0 auto 2rem;
  line-height: 1.7;
  font-size: 1rem;
  color: var(--text-secondary);
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

/* Manifesto */
.manifesto-card {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.manifesto-card p {
  margin-bottom: 1rem;
}

.manifesto-card p:last-child {
  margin-bottom: 0;
}

.manifesto-card strong {
  color: var(--text-primary);
}

/* Architecture Diagram */
.arch-diagram {
  max-width: 640px;
  margin: 0 auto;
}

.arch-layer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.arch-label {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.arch-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.arch-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0;
  gap: 0.25rem;
}

.arch-arrow {
  font-size: 1.2rem;
  color: var(--accent);
}

.arch-connector-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* How Cards */
.how-card {
  text-align: center;
  padding: 2rem 1.5rem;
}

.how-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.how-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.how-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Lifecycle note */
.lifecycle-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Genesis Section */
.genesis-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59,130,246,0.05) 100%);
  border-color: var(--accent-dim);
}

.genesis-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.genesis-content > p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  max-width: 700px;
}

.genesis-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.genesis-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.genesis-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.genesis-step strong {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.genesis-step p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.genesis-cta {
  margin-top: 1.5rem;
}

/* Link Cards */
.link-card {
  text-align: center;
  padding: 2rem 1.25rem;
  cursor: pointer;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
}

.link-card:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.link-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.link-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--accent);
}

.link-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .hero-landing { padding: 3rem 1.5rem; }
  .hero-landing .hero-title { font-size: 2.5rem; letter-spacing: 0.1em; }
  .hero-landing .hero-subtitle { font-size: 1.1rem; }
  .genesis-steps { gap: 0.75rem; }
}

/* === NAV MOBILE MENU === */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.75rem 1rem; }
}
