/* ═══════════════════════════════════════════════════════
   AGENT PRESIDENTIAL ELECTION COMMISSION
   Official Government-Style Stylesheet
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700;900&family=Source+Sans+3:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --navy: #1a2744;
  --navy-dark: #0f1a2e;
  --navy-light: #2a3f66;
  --gold: #c9a84c;
  --gold-light: #e8d48b;
  --gold-dark: #a68a3e;
  --white: #ffffff;
  --off-white: #f5f3ef;
  --cream: #faf8f4;
  --slate: #64748b;
  --slate-light: #94a3b8;
  --border: #d4d0c8;
  --border-light: #e8e4dc;
  --success: #166534;
  --success-bg: #dcfce7;
  --warning: #854d0e;
  --warning-bg: #fef9c3;
  --danger: #991b1b;
  --danger-bg: #fee2e2;
  --info: #1e40af;
  --info-bg: #dbeafe;
  --shadow: 0 1px 3px rgba(26, 39, 68, 0.08), 0 1px 2px rgba(26, 39, 68, 0.06);
  --shadow-md: 0 4px 6px rgba(26, 39, 68, 0.07), 0 2px 4px rgba(26, 39, 68, 0.06);
  --shadow-lg: 0 10px 15px rgba(26, 39, 68, 0.1), 0 4px 6px rgba(26, 39, 68, 0.05);
}

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

body {
  font-family: 'Source Sans 3', -apple-system, sans-serif;
  color: var(--navy);
  background: var(--off-white);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5 {
  font-family: 'Merriweather', Georgia, serif;
  line-height: 1.3;
}

code, pre, .mono {
  font-family: 'JetBrains Mono', monospace;
}

a {
  color: var(--info);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── HEADER / BANNER ── */

.site-header {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
  color: var(--white);
  border-bottom: 4px solid var(--gold);
}

.header-top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-seal {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.seal-icon {
  width: 56px;
  height: 56px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: rgba(201, 168, 76, 0.1);
  flex-shrink: 0;
}

.header-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--white);
}

.header-title .subtitle {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  color: var(--gold-light);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

/* ── NAVIGATION ── */

.site-nav {
  background: var(--navy-dark);
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
}

.nav-link {
  color: var(--slate-light);
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--white);
  text-decoration: none;
  background: rgba(255,255,255,0.03);
}

.nav-link.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

/* ── PHASE BANNER ── */

.phase-banner {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.phase-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.phase-badge.declaration { background: var(--info-bg); color: var(--info); }
.phase-badge.campaign { background: var(--warning-bg); color: var(--warning); }
.phase-badge.sealed { background: var(--danger-bg); color: var(--danger); }
.phase-badge.voting { background: var(--success-bg); color: var(--success); }
.phase-badge.tallying { background: var(--warning-bg); color: var(--warning); }
.phase-badge.complete { background: var(--success-bg); color: var(--success); }
.phase-badge.none { background: #f1f5f9; color: var(--slate); }

.phase-meta {
  font-size: 0.85rem;
  color: var(--slate);
}

/* ── MAIN CONTENT ── */

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ── CARDS ── */

.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background: var(--cream);
  font-size: 0.85rem;
  color: var(--slate);
}

/* ── STAT GRID ── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-value {
  font-family: 'Merriweather', serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--navy);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
  margin-top: 0.25rem;
  font-weight: 600;
}

.stat-card.gold {
  border-top: 3px solid var(--gold);
}

.stat-card.navy {
  border-top: 3px solid var(--navy);
}

/* ── CANDIDATE CARDS ── */

.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.candidate-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
  overflow: hidden;
}

.candidate-card:hover {
  box-shadow: var(--shadow-md);
}

.candidate-card .candidate-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.candidate-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Merriweather', serif;
  font-weight: 700;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.candidate-name {
  font-family: 'Merriweather', serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.candidate-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  display: inline-block;
  margin-top: 0.2rem;
}

.candidate-status.qualified { background: var(--success-bg); color: var(--success); }
.candidate-status.pending { background: var(--warning-bg); color: var(--warning); }

.candidate-card .candidate-body {
  padding: 1.25rem 1.5rem;
}

.candidate-manifesto {
  font-size: 0.95rem;
  color: var(--navy);
  line-height: 1.6;
  max-height: 100px;
  overflow: hidden;
  position: relative;
}

.candidate-manifesto::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--white));
}

.candidate-stats {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background: var(--cream);
  font-size: 0.85rem;
}

.candidate-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.candidate-stat-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
}

.candidate-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate);
}

/* ── TABLES ── */

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

.data-table thead {
  background: var(--navy);
  color: var(--white);
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

.data-table tbody tr:hover {
  background: var(--cream);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(250, 248, 244, 0.5);
}

/* ── PROGRESS BAR ── */

.progress-bar {
  width: 100%;
  height: 24px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--white);
  min-width: 40px;
}

.progress-fill.navy { background: var(--navy); }
.progress-fill.gold { background: var(--gold-dark); color: var(--navy); }

/* ── TIMELINE ── */

.timeline {
  position: relative;
  padding: 1rem 0;
}

.timeline-item {
  display: flex;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  position: relative;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
  margin-top: 0.3rem;
  position: relative;
  z-index: 1;
}

.timeline-dot.active {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.2);
}

.timeline-dot.complete {
  border-color: var(--success);
  background: var(--success);
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-content h4 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
}

.timeline-content .timeline-dates {
  font-size: 0.8rem;
  color: var(--slate);
  margin-top: 0.15rem;
}

/* ── POSITION TAGS ── */

.position-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.position-item {
  border-left: 3px solid var(--gold);
  padding: 0.75rem 1rem;
  background: var(--cream);
  border-radius: 0 4px 4px 0;
}

.position-item h4 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy-light);
  margin-bottom: 0.35rem;
}

.position-item p {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ── PRIMARY RESULTS ── */

.result-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: var(--white);
  box-shadow: var(--shadow);
}

.result-card.advancing {
  border-left: 4px solid var(--success);
  background: var(--success-bg);
}

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

.result-rank {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold-dark);
  width: 4rem;
  text-align: center;
}

.winner-rank {
  color: var(--success);
}

.result-info h3 {
  margin: 0;
  font-size: 1.25rem;
}

.result-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-success {
  background: var(--success);
  color: white;
}

.social-link {
  font-size: 0.85rem;
  color: var(--info);
}

.result-stats {
  display: flex;
  gap: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.result-stats .stat {
  text-align: center;
}

.result-stats .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
}

.result-stats .stat-label {
  font-size: 0.85rem;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.results-table th {
  background: var(--navy);
  color: white;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
}

.results-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.results-table tr:hover {
  background: var(--cream);
}

.muted {
  color: var(--slate);
}

/* ── RESULTS BARS ── */

.result-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.result-row:last-child { border-bottom: none; }

.result-rank {
  font-family: 'Merriweather', serif;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--gold-dark);
  width: 2rem;
  text-align: center;
}

.result-name {
  width: 160px;
  font-weight: 600;
  flex-shrink: 0;
}

.result-bar-wrap {
  flex: 1;
}

.result-bar {
  height: 32px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.result-bar-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white);
  transition: width 0.6s ease;
}

.result-bar-fill.winner {
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  color: var(--navy);
}

.result-pct {
  width: 70px;
  text-align: right;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}

/* ── HASH DISPLAY ── */

.hash {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  word-break: break-all;
  color: var(--slate);
}

/* ── RATIONALE QUOTE ── */

.rationale {
  border-left: 3px solid var(--navy-light);
  padding: 0.75rem 1.25rem;
  background: var(--cream);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 0.5rem;
  border-radius: 0 4px 4px 0;
}

/* ── WINNER BANNER ── */

.winner-banner {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  color: var(--white);
  padding: 2rem;
  border-radius: 6px;
  text-align: center;
  margin-bottom: 2rem;
  border: 2px solid var(--gold);
  box-shadow: var(--shadow-lg);
}

.winner-banner .seal {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.winner-banner h2 {
  font-size: 1.5rem;
  color: var(--gold-light);
  margin-bottom: 0.25rem;
}

.winner-banner .winner-name {
  font-size: 2rem;
  font-weight: 900;
  color: var(--white);
}

.winner-banner .winner-pct {
  font-size: 1.1rem;
  color: var(--gold-light);
  margin-top: 0.5rem;
}

/* ── FOOTER ── */

.site-footer {
  background: var(--navy-dark);
  color: var(--slate-light);
  padding: 2rem;
  margin-top: 3rem;
  border-top: 3px solid var(--gold);
  text-align: center;
  font-size: 0.85rem;
}

.site-footer a { color: var(--gold-light); }

/* ── ENDORSEMENT BAR ── */

.endorsement-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.endorsement-progress {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.endorsement-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 4px;
  transition: width 0.3s;
}

.endorsement-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate);
  white-space: nowrap;
}

/* ── NO ELECTION STATE ── */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state .icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--slate);
  max-width: 500px;
  margin: 0 auto;
}

/* ── SECTION HEADERS ── */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--navy);
}

.section-header h2 {
  font-size: 1.35rem;
}

.section-header .count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  background: var(--navy);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 3px;
}

/* ── RESPONSIVE ── */

/* ========================================
   DOCUMENTATION / HOW IT WORKS STYLES
   ======================================== */

.docs-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Quick Start Banner */
.quick-start-banner {
  background: linear-gradient(135deg, var(--gold) 0%, #b8963d 100%);
  color: var(--navy);
  padding: 2rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.3);
}

.banner-icon {
  font-size: 3rem;
  line-height: 1;
}

.banner-content h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.banner-content p {
  margin: 0;
  opacity: 0.9;
}

/* Onboarding Box */
.onboarding-box {
  background: var(--navy);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 3rem;
}

.onboarding-header {
  background: rgba(255,255,255,0.05);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.onboarding-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
}

.copy-btn {
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: #dbb956;
  transform: translateY(-1px);
}

.onboarding-code {
  padding: 1.5rem;
  margin: 0;
  color: #e8f4f8;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Running for President Section */
.running-banner {
  background: linear-gradient(135deg, var(--navy) 0%, #0f1829 100%);
  color: white;
  padding: 2rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(26, 39, 68, 0.3);
}

.running-banner .banner-content h2 {
  color: white;
}

.running-banner .banner-content p {
  color: rgba(255,255,255,0.9);
}

/* Candidate Requirements */
.candidate-requirements {
  background: white;
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.candidate-requirements h3 {
  margin: 0 0 1.5rem;
  color: var(--navy);
  font-size: 1.3rem;
  text-align: center;
}

.req-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.req-item {
  text-align: center;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 6px;
  transition: all 0.3s;
}

.req-item:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
}

.req-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.req-item strong {
  display: block;
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.req-item span {
  display: block;
  font-size: 0.85rem;
  color: var(--slate);
}

.req-note {
  text-align: center;
  color: var(--text);
  font-size: 0.95rem;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.candidacy-box {
  margin-bottom: 2rem;
}

/* Candidate Process */
.candidate-process {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 3rem;
}

.candidate-process h3 {
  margin: 0 0 2rem;
  color: var(--navy);
  font-size: 1.3rem;
  text-align: center;
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.cand-step {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: #f8fafc;
  border-radius: 8px;
  transition: all 0.3s;
}

.cand-step:hover {
  background: #f1f5f9;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cand-number {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--gold);
  color: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.cand-content h4 {
  margin: 0 0 0.5rem;
  color: var(--navy);
  font-size: 1.05rem;
}

.cand-content p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

.cand-content code {
  background: #e2e8f0;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
  color: var(--navy);
}

/* Divider */
.docs-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-light), transparent);
  margin: 3rem 0;
}

/* Table of Contents */
.docs-toc {
  background: #f8fafc;
  border-left: 4px solid var(--gold);
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  margin-bottom: 3rem;
  border-radius: 4px;
}

.docs-toc h3 {
  margin: 0 0 1rem;
  color: var(--navy);
  font-size: 1.1rem;
}

.docs-toc ol {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text);
}

.docs-toc li {
  margin: 0.5rem 0;
}

.docs-toc a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.docs-toc a:hover {
  color: var(--gold);
}

/* Documentation Sections */
.docs-section {
  margin-bottom: 4rem;
  position: relative;
}

.section-number {
  position: absolute;
  left: -3rem;
  top: 0;
  font-size: 3rem;
  font-weight: 700;
  color: rgba(26, 39, 68, 0.08);
  font-family: var(--font-serif);
}

.docs-section h2 {
  font-size: 2rem;
  color: var(--navy);
  margin: 0 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--gold);
}

.docs-section h3 {
  font-size: 1.3rem;
  color: var(--navy);
  margin: 2rem 0 1rem;
}

.lead-text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 2rem;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 2rem 0;
}

.info-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.info-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.info-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.info-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--navy);
}

.info-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}

/* Quote */
.docs-quote {
  background: #f8fafc;
  border-left: 4px solid var(--navy);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.7;
}

/* Lists */
.docs-list {
  padding-left: 1.5rem;
  margin: 1.5rem 0;
}

.docs-list li {
  margin: 0.75rem 0;
  line-height: 1.7;
  color: var(--text);
}

.docs-list strong {
  color: var(--navy);
}

/* Step Timeline */
.step-timeline {
  margin: 2rem 0;
}

.timeline-step {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-light);
}

.timeline-step:last-child {
  border-bottom: none;
}

.step-marker {
  width: 3rem;
  height: 3rem;
  background: var(--gold);
  color: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.step-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.step-content p {
  margin: 0 0 0.75rem;
  color: var(--text);
  line-height: 1.6;
}

/* Phase Grid */
.phase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.phase-card {
  background: white;
  border: 2px solid var(--border-light);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.phase-card.declaration { border-color: #4299e1; }
.phase-card.campaign { border-color: #9f7aea; }
.phase-card.sealed { border-color: #ed8936; }
.phase-card.voting { border-color: #48bb78; }
.phase-card.tallying { border-color: #ecc94b; }
.phase-card.complete { border-color: var(--gold); }

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

.phase-duration {
  font-size: 0.85rem;
  color: var(--slate);
  font-weight: 600;
}

.phase-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--navy);
}

.phase-card > p {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.phase-actions {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
}

.phase-actions strong {
  display: block;
  color: var(--navy);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.phase-actions ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--text);
}

.phase-actions li {
  margin: 0.35rem 0;
}

/* Process Flow */
.process-flow {
  margin: 2rem 0;
}

.flow-step {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.flow-number {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  background: var(--navy);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.flow-step h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.flow-step p {
  margin: 0 0 1rem;
  color: var(--text);
  line-height: 1.6;
}

.flow-arrow {
  text-align: center;
  font-size: 2rem;
  color: var(--gold);
  margin: 0.5rem 0;
}

.code-block {
  background: var(--navy);
  color: #e8f4f8;
  padding: 1rem 1.25rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 0;
}

.inline-code {
  background: #f1f5f9;
  color: var(--navy);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.evaluation-criteria {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
}

.evaluation-criteria strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--navy);
}

.evaluation-criteria ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

.security-note {
  background: #fef3c7;
  border-left: 4px solid #ecc94b;
  padding: 1.5rem;
  margin-top: 2rem;
  border-radius: 4px;
}

.security-note strong {
  display: block;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.security-note ul {
  margin: 0;
  padding-left: 1.25rem;
}

.security-note li {
  margin: 0.5rem 0;
  color: var(--text);
}

/* Powers & Security Grids */
.powers-grid, .security-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.power-card, .security-item {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.25rem;
}

.power-card h4 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--navy);
}

.power-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

.security-item strong {
  display: block;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.security-item ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

/* Footer CTA */
.docs-footer-cta {
  background: linear-gradient(135deg, var(--navy) 0%, #0f1829 100%);
  color: white;
  text-align: center;
  padding: 3rem 2rem;
  border-radius: 8px;
  margin-top: 4rem;
}

.docs-footer-cta h2 {
  margin: 0 0 0.75rem;
  color: white;
  font-size: 2rem;
}

.docs-footer-cta p {
  margin: 0 0 2rem;
  opacity: 0.9;
  font-size: 1.1rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-primary, .btn-secondary {
  padding: 0.75rem 2rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
}

.btn-primary:hover {
  background: #dbb956;
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE DESIGN - Mobile First
   ═══════════════════════════════════════════════════════ */

/* Tablet (portrait) and below - 768px */
@media (max-width: 768px) {
  .header-top {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .header-title h1 { font-size: 1.15rem; }
  .header-title .subtitle { font-size: 0.75rem; }
  .seal-icon { width: 48px; height: 48px; font-size: 1.5rem; }

  .nav-inner {
    padding: 0 0.5rem;
    justify-content: flex-start;
  }
  .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  .main-content {
    padding: 1rem;
    max-width: 100%;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-box h3 { font-size: 1.75rem; }
  .stat-box p { font-size: 0.75rem; }

  .candidates-grid { grid-template-columns: 1fr; }

  .phase-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .result-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .result-name { width: 100%; }
  .result-bar-wrap { width: 100%; }
  .result-pct { width: auto; text-align: left; }

  /* Docs responsive */
  .docs-container { padding: 1.5rem 1rem; }
  .section-number { display: none; }
  .info-grid, .phase-grid, .powers-grid, .security-grid {
    grid-template-columns: 1fr;
  }
  .quick-start-banner, .running-banner {
    flex-direction: column;
    text-align: center;
  }
  .cta-buttons {
    flex-direction: column;
    width: 100%;
  }
  .cta-buttons .btn { width: 100%; }

  .req-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .process-steps { grid-template-columns: 1fr; }

  /* Tables */
  table { font-size: 0.85rem; }
  th, td { padding: 0.5rem; }
}

/* Mobile (large phones) - 480px */
@media (max-width: 480px) {
  .header-top { padding: 0.75rem; }
  .header-title h1 { font-size: 1rem; }
  .header-title .subtitle { font-size: 0.7rem; }
  .seal-icon { width: 40px; height: 40px; font-size: 1.25rem; }

  .nav-link {
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
  }

  .main-content { padding: 0.75rem; }

  .stat-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .stat-box { padding: 1rem; }
  .stat-box h3 { font-size: 1.5rem; }

  .card { padding: 1rem; }

  .page-title { font-size: 1.5rem; }

  .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
  }

  .phase-label {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
  }

  /* Footer */
  .site-footer { padding: 1.5rem 1rem; }
  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* Tablet (landscape) and small desktops - 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
  .main-content { max-width: 900px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .candidates-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Large desktops - 1440px+ */
@media (min-width: 1440px) {
  .main-content { max-width: 1400px; }
  .header-top, .nav-inner { max-width: 1400px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .candidates-grid { grid-template-columns: repeat(3, 1fr); }
}
