/* ============================================================
   MUBU — Make You or Break You
   Mobile-first CSS
   Primary: Light Blue (#1E90FF) | Secondary: Green (#28A745)
   ============================================================ */

:root {
  --primary: #1E90FF;
  --primary-dark: #1873CC;
  --secondary: #28A745;
  --dark: #2C3E50;
  --light: #F8F9FA;
  --white: #FFFFFF;
  --gray: #6C757D;
  --light-gray: #E9ECEF;
  --very-light-blue: #E8F4FD;
  --danger: #DC3545;
  --success: #28A745;
  --warning: #FFC107;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --header-h: 64px;
  --bottom-nav-h: 60px;
  --font: 'Roboto', Arial, Helvetica, sans-serif;
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--dark);
  background: var(--light);
  min-height: 100vh;
  padding-bottom: var(--bottom-nav-h);
}

@media (min-width: 768px) {
  body { padding-bottom: 0; }
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 16px; }

/* ========== HEADER ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  height: var(--header-h);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dark);
}
.logo-icon { color: var(--primary); display: flex; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text strong { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.5px; }
.logo-text small { font-size: 0.7rem; color: var(--gray); font-weight: 400; }

.main-nav { display: none; }
.main-nav ul { display: flex; gap: 4px; }
.main-nav a {
  display: block;
  padding: 8px 12px;
  color: var(--dark);
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
}
.main-nav a:hover, .main-nav a.active {
  background: var(--very-light-blue);
  color: var(--primary);
}

.header-actions { display: flex; align-items: center; gap: 8px; }
.user-greeting { font-size: 0.875rem; color: var(--gray); }

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--dark);
  border-radius: 1px;
  transition: var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 992px) {
  .main-nav { display: block; }
  .nav-toggle { display: none; }
  .d-none-mobile { display: inline; }
}

@media (max-width: 991px) {
  .main-nav.is-open {
    display: block;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 16px;
  }
  .main-nav.is-open ul { flex-direction: column; }
  .main-nav.is-open a { padding: 12px 16px; }
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  line-height: 1.3;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-outline-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.8);
}
.btn-outline-light:hover { background: #fff; color: var(--dark); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ========== ALERTS ========== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin: 16px auto;
  max-width: 1140px;
  width: calc(100% - 32px);
  font-size: 0.95rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ========== HERO ========== */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #1a5276 0%, #1E90FF 50%, #28A745 100%);
  background-size: cover;
  background-position: center;
  color: #fff;
  overflow: hidden;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45), rgba(0,0,0,0.55));
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 48px 16px;
  text-align: center;
}
.hero-title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  max-width: 560px;
  margin: 0 auto 28px;
  opacity: 0.95;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ========== SEARCH ========== */
.search-section {
  margin-top: -40px;
  position: relative;
  z-index: 10;
  padding-bottom: 32px;
}
.search-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.search-card h2 { font-size: 1.25rem; margin-bottom: 4px; }
.text-muted { color: var(--gray); font-size: 0.9rem; margin-bottom: 16px; }
.search-form .form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .search-form .form-row {
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
  }
}

/* ========== FORMS ========== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--dark);
}
.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: var(--font);
  border: 1.5px solid var(--light-gray);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: border-color var(--transition);
  color: var(--dark);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,144,255,0.15);
}
.form-control:disabled { background: var(--light-gray); cursor: not-allowed; }
.optional { font-weight: 400; color: var(--gray); font-size: 0.85rem; }
.form-note { font-size: 0.85rem; color: var(--gray); margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 480px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

.pin-input-wrapper { position: relative; }
.pin-input { letter-spacing: 0.4em; font-size: 1.25rem; text-align: center; }
.pin-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px;
}

/* ========== STATS ========== */
.stats-section {
  padding: 40px 0;
  background: var(--white);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  text-align: center;
}
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
  .stats-grid { grid-template-columns: repeat(6, 1fr); }
}
.stat-number {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--gray);
  font-weight: 500;
}

/* ========== POSITIONS ========== */
.positions-section { padding: 48px 0; }
.section-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 28px;
}
.positions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 768px) {
  .positions-grid { grid-template-columns: repeat(3, 1fr); }
}
.position-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  color: var(--dark);
  border-top: 4px solid var(--pos-color, var(--primary));
}
.position-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: var(--dark);
}
.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.position-card h3 { font-size: 1rem; margin-bottom: 4px; }
.position-card p { font-size: 0.85rem; color: var(--gray); }

/* ========== CTA BANNER ========== */
.cta-banner {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 48px 0;
  text-align: center;
}
.cta-banner h2 { font-size: 1.5rem; margin-bottom: 8px; }
.cta-banner p { opacity: 0.95; margin-bottom: 20px; max-width: 480px; margin-left: auto; margin-right: auto; }

/* ========== AUTH ========== */
.auth-section {
  padding: 40px 0 60px;
  min-height: calc(100vh - var(--header-h) - 200px);
  display: flex;
  align-items: center;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px 24px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}
.auth-card-wide { max-width: 520px; }
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-header h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-header p { color: var(--gray); font-size: 0.95rem; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 0.9rem; }
.auth-footer p { margin-bottom: 8px; }

.account-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
.radio-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition);
  text-align: center;
}
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card.active, .radio-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--very-light-blue);
  color: var(--primary);
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.85);
  padding: 48px 0 32px;
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}
@media (min-width: 992px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1.5fr; }
}
.footer-brand strong { font-size: 1.25rem; color: #fff; }
.footer-brand .tagline { color: var(--primary); font-weight: 500; margin-top: 4px; }
.footer-links h4 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.9rem; display: block; padding: 4px 0; }
.footer-links a:hover { color: #fff; }
.footer-note { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.copyright { margin-top: 12px; }

/* ========== MOBILE BOTTOM NAV ========== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: var(--white);
  border-top: 1px solid var(--light-gray);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--gray);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 6px 8px;
  min-width: 56px;
}
.mob-nav-item.active, .mob-nav-item:hover { color: var(--primary); }
.mob-nav-item svg { stroke: currentColor; }
@media (min-width: 768px) {
  .mobile-bottom-nav { display: none; }
}

/* ========== ERROR PAGES ========== */
.error-section {
  padding: 80px 16px;
  text-align: center;
}
.error-code {
  font-size: 5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}
.error-section h1 { margin-bottom: 12px; }
.error-section p { color: var(--gray); margin-bottom: 24px; }

/* ========== LOCATION FIELDSET ========== */
.location-fieldset {
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}
.location-fieldset legend {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0 8px;
  color: var(--dark);
}

/* ========== GEOGRAPHY SELECTORS ========== */
.geo-selectors {
  display: contents; /* participate in parent grid */
}
.form-row-geo {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}
@media (min-width: 640px) {
  .form-row-geo {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}
.geo-field[hidden] { display: none !important; }
.label-spacer { display: block; height: 1.4em; margin-bottom: 6px; }
.search-hint {
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 8px;
}

/* ========== SECTION TITLES ========== */
.section-subtitle {
  text-align: center;
  color: var(--gray);
  font-size: 0.95rem;
  margin: -16px 0 28px;
}
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
.section-header-row .section-title { margin-bottom: 0; text-align: left; }
.section-link {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ========== EMPTY STATES ========== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.empty-icon {
  color: var(--gray);
  margin-bottom: 12px;
  opacity: 0.6;
}
.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.empty-state p {
  color: var(--gray);
  font-size: 0.95rem;
  max-width: 360px;
  margin: 0 auto 16px;
}

/* ========== LATEST POSTS ========== */
.latest-posts-section {
  padding: 48px 0;
  background: var(--white);
}
.posts-carousel {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
}
.posts-track {
  display: flex;
  gap: 16px;
  min-width: min-content;
}
.post-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--light);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--light-gray);
}
.post-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.post-avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}
.post-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--gray);
}
.post-excerpt {
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 10px;
  color: var(--dark);
}
.post-date {
  font-size: 0.8rem;
  color: var(--gray);
}

/* ========== VOTER EDUCATION ========== */
.education-section {
  padding: 48px 0;
}
.education-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .education-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
  .education-grid { grid-template-columns: repeat(3, 1fr); }
}
.edu-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.edu-card h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.edu-area {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 10px;
}
.edu-card p {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.5;
}
.education-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 24px;
  font-style: italic;
}

/* ========== ABOUT ========== */
.about-section {
  padding: 48px 0;
  background: var(--very-light-blue);
}
.about-card {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.about-card h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.about-brand {
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 16px;
}
.about-card p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--dark);
  margin-bottom: 12px;
}
.about-neutral {
  font-size: 0.9rem !important;
  color: var(--gray) !important;
}

/* ========== UTILITY ========== */
.text-center { text-align: center; }
.main-content { min-height: 50vh; }



/* ========== PHASE 4: PROFILE / FEED / NOTIFICATIONS ========== */
.page-title { font-size: 1.5rem; margin-bottom: 20px; }
.badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

/* Notification bell */
.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--dark);
  border-radius: 50%;
}
.notif-bell:hover { background: var(--very-light-blue); color: var(--primary); }
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Profile */
.profile-section { padding: 24px 0 48px; }
.profile-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}
.profile-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}
.profile-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}
.profile-photo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
}
.profile-info { flex: 1; min-width: 160px; }
.profile-info h1 { font-size: 1.35rem; margin-bottom: 4px; }
.profile-role { color: var(--primary); font-weight: 500; font-size: 0.9rem; }
.profile-location { color: var(--gray); font-size: 0.9rem; margin-top: 4px; }
.profile-bio { margin-top: 10px; font-size: 0.95rem; line-height: 1.5; }
.profile-stats {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--light-gray);
}
.profile-stat { text-align: center; }
.profile-stat strong { display: block; font-size: 1.25rem; }
.profile-stat span { font-size: 0.8rem; color: var(--gray); }
.profile-section-block h2 { font-size: 1.15rem; margin-bottom: 16px; }
.following-list { display: flex; flex-direction: column; gap: 10px; }
.following-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.following-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
}
.following-avatar-ph {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 700;
}
.following-name { flex: 1; font-weight: 500; }

/* Feed */
.feed-section { padding: 24px 0 48px; }
.feed-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--light-gray);
  padding-bottom: 0;
}
.feed-tab {
  padding: 10px 16px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--gray);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}
.feed-tab.active, .feed-tab:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.feed-list { display: flex; flex-direction: column; gap: 16px; }
.feed-post {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.feed-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.feed-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
}
.feed-avatar-ph {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 1.1rem;
}
.feed-author { display: block; font-size: 0.95rem; }
.feed-time { font-size: 0.8rem; color: var(--gray); }
.feed-body { font-size: 0.95rem; line-height: 1.5; margin-bottom: 12px; white-space: pre-wrap; }
.feed-images { margin-bottom: 12px; border-radius: var(--radius-sm); overflow: hidden; }
.feed-images img { width: 100%; max-height: 360px; object-fit: cover; }
.feed-images-multi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.feed-actions {
  display: flex;
  gap: 4px;
  border-top: 1px solid var(--light-gray);
  padding-top: 10px;
}
.feed-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--gray);
  font-size: 0.85rem;
  font-family: var(--font);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.feed-action:hover { background: var(--very-light-blue); color: var(--primary); }
.feed-action.active { color: var(--primary); }
.feed-comments {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--light-gray);
}
.comment-item {
  font-size: 0.9rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--light-gray);
}
.comment-item time { display: block; font-size: 0.75rem; color: var(--gray); margin-top: 2px; }
.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.comment-form .form-control { flex: 1; }
.feed-pagination { text-align: center; margin-top: 24px; }

/* Notifications */
.notifications-section { padding: 24px 0 48px; }
.notif-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notif-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--white);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  border-left: 3px solid transparent;
}
.notif-item.unread {
  border-left-color: var(--primary);
  background: var(--very-light-blue);
}
.notif-content { flex: 1; }
.notif-content p { font-size: 0.9rem; color: var(--gray); margin: 4px 0; }
.notif-content time { font-size: 0.75rem; color: var(--gray); }
.notif-link { font-size: 0.85rem; font-weight: 500; white-space: nowrap; }

/* Checkbox rows for preferences */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--light-gray);
  cursor: pointer;
  font-size: 0.95rem;
}
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ========== PHASE 5: CANDIDATES ========== */
.candidates-section { padding: 24px 0 48px; }
.candidates-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .candidates-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
  .candidates-grid { grid-template-columns: repeat(3, 1fr); }
}
.candidate-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.candidate-card-link {
  display: flex;
  gap: 14px;
  color: var(--dark);
  align-items: flex-start;
}
.candidate-card-link:hover { color: var(--dark); }
.candidate-photo {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.candidate-photo-ph {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-size: 1.5rem; font-weight: 700;
}
.candidate-card-body h2 { font-size: 1.05rem; margin-bottom: 4px; }
.candidate-pos { font-size: 0.85rem; color: var(--gray); }
.candidate-followers { font-size: 0.8rem; color: var(--gray); margin-top: 4px; }
.verified-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary);
  background: #e8f5e9;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 4px;
}
.status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--light-gray);
  color: var(--gray);
}

/* Public candidate profile */
.candidate-profile-section { padding: 24px 0 48px; }
.candidate-profile-header {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
  align-items: flex-start;
}
.cp-photo {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
}
.cp-photo-ph {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-size: 2.5rem; font-weight: 700;
}
.cp-info { flex: 1; min-width: 180px; }
.cp-info h1 { font-size: 1.5rem; margin-bottom: 4px; }
.cp-position { color: var(--gray); font-size: 0.95rem; margin-bottom: 6px; }
.cp-followers { margin-top: 8px; font-size: 0.9rem; }
.cp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-block {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
}
.cp-block h2 { font-size: 1.15rem; margin-bottom: 14px; }
.cp-block h3 { font-size: 0.95rem; margin-bottom: 6px; }
.cp-block p { font-size: 0.95rem; line-height: 1.55; color: var(--dark); }
.cp-background {
  display: grid;
  gap: 20px;
}
@media (min-width: 640px) {
  .cp-background { grid-template-columns: repeat(3, 1fr); }
}
.agenda-list { display: flex; flex-direction: column; gap: 14px; }
.agenda-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.agenda-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
}
.agenda-item h3 { font-size: 1rem; margin-bottom: 4px; }
.agenda-item p { font-size: 0.9rem; color: var(--gray); }

/* Dashboard */
.dashboard-section { padding: 24px 0 48px; }
.dash-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}
.dash-header h1 { font-size: 1.5rem; }
.dash-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
@media (min-width: 640px) {
  .dash-stats { grid-template-columns: repeat(4, 1fr); }
}
.dash-stat {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}
.dash-stat strong { display: block; font-size: 1.35rem; margin-bottom: 4px; }
.dash-stat span { font-size: 0.8rem; color: var(--gray); }
.dash-modules {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .dash-modules { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
  .dash-modules { grid-template-columns: repeat(3, 1fr); }
}
.dash-module {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  color: var(--dark);
  transition: transform var(--transition), box-shadow var(--transition);
  border-left: 4px solid var(--primary);
}
a.dash-module:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--dark);
}
.dash-module h3 { font-size: 1.05rem; margin-bottom: 6px; }
.dash-module p { font-size: 0.85rem; color: var(--gray); }
.dash-module-soon { opacity: 0.7; border-left-color: var(--light-gray); }

.agenda-fieldset {
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.agenda-fieldset legend {
  font-weight: 600;
  padding: 0 8px;
  font-size: 0.9rem;
}
.sub-status-box {
  background: var(--light);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.sub-status-box p { margin-bottom: 4px; font-size: 0.95rem; }
.sub-history { list-style: none; }
.sub-history li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--light-gray);
  font-size: 0.9rem;
}
.status-active { color: var(--secondary); }
.status-pending { color: var(--warning); }
.status-expired, .status-suspended, .status-cancelled { color: var(--danger); }

/* ========== PHASE 7: OPINION POLLS ========== */
.polls-section { padding: 24px 0 48px; }
.poll-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.poll-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.poll-rank {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  min-width: 36px;
}
.poll-avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.poll-avatar-ph {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 1.1rem;
}
.poll-info { flex: 1; min-width: 0; }
.poll-info strong { font-size: 0.95rem; }
.poll-bar-wrap {
  height: 8px;
  background: var(--light-gray);
  border-radius: 4px;
  margin: 6px 0 2px;
  overflow: hidden;
}
.poll-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  min-width: 2px;
  transition: width 0.6s ease;
}
.poll-pct {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark);
}
.poll-vote-radio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray);
  cursor: pointer;
}
.poll-vote-radio input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ========== PHASE 9: ADMIN ========== */
.admin-nav {
  margin: 12px 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}
.admin-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray);
  background: var(--light);
  white-space: nowrap;
}
.admin-nav a:hover { color: var(--dark); background: var(--light-gray); }
.admin-nav a.active {
  background: var(--primary);
  color: #fff;
}
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--light-gray);
}
.admin-table th {
  font-weight: 600;
  color: var(--gray);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.admin-table tr:hover td { background: var(--light); }

/* ========== PHASE 11: CHATBOT ========== */
.chatbot-section { padding: 24px 0 48px; }
.chat-window {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-height: 320px;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.chat-bubble {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: normal;
}
.chat-bot {
  background: var(--light);
  color: var(--dark);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-user {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.chat-form .form-control { flex: 1; }
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chat-suggest {
  border: 1px solid var(--light-gray);
  background: var(--white);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: var(--gray);
  cursor: pointer;
}
.chat-suggest:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}

/* ========== PHASE 12: PWA + NOTIFICATIONS POLISH ========== */
.offline-bar {
  background: #5d4037;
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 12px;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.pwa-install-banner {
  background: var(--white);
  border-bottom: 1px solid var(--light-gray);
  box-shadow: var(--shadow);
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 900;
}
.pwa-install-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}
.pwa-install-actions {
  display: flex;
  gap: 8px;
}
body.is-offline .main-content {
  opacity: 0.95;
}
/* Safe area for notched phones + bottom nav */
.mobile-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@supports (padding: max(0px)) {
  .mobile-bottom-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}

/* ========== LIVE STREAMING ========== */
.dash-module-live {
  border-left-color: #e53935 !important;
}
.dash-module-live h3 { color: #c62828; }
.btn-go-live {
  display: inline-flex;
  align-items: center;
  background: #e53935;
  border-color: #e53935;
}
.btn-go-live:hover { background: #c62828; border-color: #c62828; }
.live-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .live-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
  .live-grid { grid-template-columns: repeat(3, 1fr); }
}
.live-card {
  display: block;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: var(--dark);
  position: relative;
  min-height: 140px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
}
.live-card:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.live-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #e53935;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.live-card-body {
  padding: 48px 16px 16px;
}
.live-card-body h2 { font-size: 1.1rem; margin-bottom: 6px; color: #fff; }
.live-card-body p { font-size: 0.9rem; opacity: 0.85; margin-bottom: 8px; }
.live-viewers { font-size: 0.8rem; opacity: 0.75; }
.live-now-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: #1a1a2e;
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.live-now-banner:hover { color: #fff; }
.live-studio-section { padding: 16px 0 48px; }
.live-studio-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 900px) {
  .live-studio-layout { grid-template-columns: 1fr 320px; align-items: start; }
}
.live-video-panel {
  background: #0d0d0d;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.live-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.9rem;
}
.live-badge {
  background: #e53935;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.live-badge-ended { background: #666; }
.live-title { flex: 1; font-weight: 600; }
.live-viewer-count { opacity: 0.85; font-size: 0.85rem; }
.live-video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.live-video-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.live-placeholder {
  color: #aaa;
  font-size: 0.95rem;
  padding: 20px;
  text-align: center;
}
.live-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: #1a1a1a;
}
.live-meta {
  padding: 10px 14px;
  background: #111;
  color: #ddd;
  font-size: 0.9rem;
}
.live-meta a { color: #90caf9; }
.live-chat-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  max-height: 560px;
}
.live-chat-panel h2 {
  font-size: 1rem;
  margin-bottom: 10px;
}
.live-comments {
  flex: 1;
  overflow-y: auto;
  min-height: 220px;
  max-height: 400px;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 10px;
  background: var(--light);
}
.live-comment {
  font-size: 0.9rem;
  margin-bottom: 8px;
  line-height: 1.4;
}
.live-comment strong {
  color: var(--primary);
  margin-right: 6px;
}
.live-comment-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Election countdown */
.election-countdown {
  margin-top: 28px;
  padding: 16px 20px;
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  display: inline-block;
  backdrop-filter: blur(4px);
}
.countdown-label {
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  margin-bottom: 10px;
  font-weight: 500;
}
.countdown-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.countdown-unit {
  min-width: 64px;
  text-align: center;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 8px 10px;
}
.cd-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.cd-lbl {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Subscription lock */
.lock-badge {
  display: inline-block;
  font-size: 0.7rem;
  background: #fff3cd;
  color: #856404;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  margin-left: 6px;
}
.dash-module.is-locked {
  opacity: 0.75;
  position: relative;
}
.dash-module.is-locked::after {
  content: "🔒";
  position: absolute;
  top: 12px;
  right: 12px;
}

/* Floating chat widget (public) */
.chat-fab {
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 950;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary, #1E90FF);
  color: #fff;
  border: none;
  box-shadow: 0 6px 20px rgba(30,144,255,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-fab:hover { filter: brightness(1.08); }
.chat-widget {
  position: fixed;
  right: 18px;
  bottom: 140px;
  width: min(360px, calc(100vw - 24px));
  height: 440px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  z-index: 960;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chat-widget.is-open { display: flex; }
.chat-widget-header {
  background: var(--primary, #1E90FF);
  color: #fff;
  padding: 12px 14px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-widget-header button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}
.chat-widget-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f7f9fc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-widget-body .chat-bubble { max-width: 92%; }
.chat-widget-form {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid #e8eef5;
  background: #fff;
}
.chat-widget-form input {
  flex: 1;
  border: 1px solid #dde5ef;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
}
@media (max-width: 640px) {
  .chat-fab { bottom: 72px; right: 12px; }
  .chat-widget { bottom: 134px; right: 12px; height: 400px; }
}

/* Phone country code row */
.phone-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.phone-row .country-code-select {
  max-width: 160px;
  flex: 0 0 160px;
}
.phone-row input[type="tel"] {
  flex: 1;
}
@media (max-width: 480px) {
  .phone-row { flex-direction: column; }
  .phone-row .country-code-select { max-width: none; flex: 1; }
}

/* Mobile Join short label */
.join-short { display: none; }
.join-full { display: inline; }
@media (max-width: 640px) {
  .join-short { display: inline; }
  .join-full { display: none; }
  .header-actions .btn-sm { padding: 0.35rem 0.65rem; }
  .logo-text small { display: none; }
}

/* Countdown — mobile one line, red numbers */
@media (max-width: 640px) {
  .election-countdown {
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
  }
  .countdown-label { font-size: 0.72rem; margin-bottom: 6px; }
  .countdown-grid {
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: space-between;
  }
  .countdown-unit {
    min-width: 0;
    flex: 1;
    padding: 6px 4px;
  }
  .cd-num {
    font-size: 1rem;
    color: #ff3b3b;
  }
  .cd-lbl { font-size: 0.6rem; }
}

/* Post image gallery */
.feed-image-btn {
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  display: block;
  width: 100%;
}
.feed-image-btn img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.feed-images-multi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img {
  max-width: 92vw;
  max-height: 85vh;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
}
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-counter {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 0.9rem;
}

/* Share sheet */
.share-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1900;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.share-sheet {
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 16px 16px 0 0;
  padding: 16px;
}
.share-sheet-title { font-weight: 700; margin-bottom: 12px; }
.share-sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.share-opt {
  display: block;
  text-align: center;
  padding: 12px 8px;
  border-radius: 10px;
  background: var(--light, #f0f4f8);
  color: var(--dark, #222);
  text-decoration: none;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Marketplace */
.marketplace-filters { margin-bottom: 20px; }
.marketplace-card-img { position: relative; overflow: hidden; border-radius: 12px 12px 0 0; }
.marketplace-card-img img { width: 100%; height: 180px; object-fit: cover; display: block; }
.marketplace-card .img-count {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 0.75rem; padding: 2px 8px; border-radius: 999px;
}
.marketplace-grid { margin-top: 8px; }

/* Contribution amount chips */
.amount-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.amount-chip {
  border: 1px solid var(--primary, #1E90FF);
  background: #fff;
  color: var(--primary, #1E90FF);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}
.amount-chip.active,
.amount-chip:hover {
  background: var(--primary, #1E90FF);
  color: #fff;
}

/* Comment replies */
.comment-item { margin-bottom: 12px; }
.comment-reply-btn {
  background: none; border: none; color: var(--primary, #1E90FF);
  font-size: 0.8rem; cursor: pointer; padding: 0 4px;
}
.comment-replies {
  margin-left: 16px;
  margin-top: 6px;
  border-left: 2px solid #e5e7eb;
  padding-left: 10px;
}
.comment-reply {
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.reply-form-wrap { margin-top: 8px; margin-left: 16px; }
.reply-form { display: flex; gap: 8px; align-items: center; }
.reply-form .form-control { flex: 1; }


/* Invite & Earn */
.invite-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.invite-link-row .form-control {
  flex: 1;
  min-width: 180px;
}

/* Admin settings layout */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 16px;
}
.settings-card h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.settings-fields .form-group {
  margin-bottom: 14px;
}
.settings-actions {
  margin-top: 20px;
}
.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .price-grid { grid-template-columns: 1fr; }
}

/* Marketplace material cards */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.material-card {
  display: flex;
  flex-direction: column;
  background: var(--white, #fff);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid #e8eef5;
}
.material-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(30,144,255,0.15);
  color: inherit;
}
.material-card-img {
  position: relative;
  height: 180px;
  background: #f0f4f8;
}
.material-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.material-card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.material-card-body h3 {
  font-size: 1.05rem;
  margin: 0 0 6px;
  color: var(--dark, #1a2332);
}
.material-card-meta {
  font-size: 0.82rem;
  color: var(--gray, #6b7280);
  margin-bottom: 8px;
}
.material-card-price {
  font-weight: 700;
  color: var(--primary, #1E90FF);
  margin-top: auto;
}
.material-detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.material-detail-gallery img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
}
