/* ===== CSS VARIABLES ===== */
:root {
  --primary: #1a5276;
  --primary-light: #2980b9;
  --primary-dark: #0e2f44;
  --accent: #f39c12;
  --accent-light: #f7c948;
  --success: #27ae60;
  --danger: #e74c3c;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --bg: #f8f9fa;
  --bg-alt: #ecf0f1;
  --white: #ffffff;
  --border: #dee2e6;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.3s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}
a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { line-height: 1.3; color: var(--primary-dark); }

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* ===== NAVIGATION ===== */
.navbar {
  background: var(--primary-dark);
  color: var(--white);
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
}
.navbar-brand .flag { font-size: 1.5rem; }
.navbar-brand:hover { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 2px;
  align-items: center;
}
.nav-links a {
  color: rgba(255,255,255,0.85);
  padding: 5px 5px;
  border-radius: var(--radius);
  font-size: 0.72rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== NAVBAR TOOLS (SEARCH — kept for overlay trigger) ===== */
.navbar-tools {
  display: inline-flex;
  gap: 8px;
  margin-left: 8px;
  align-items: center;
}
.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.08);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.nav-icon-btn:hover {
  color: var(--white);
  background: rgba(255,255,255,0.18);
}

/* Liked feed overlay (full-screen, like search overlay) */
.liked-feed-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.92);
  z-index: 10000;
  display: none;
  overflow-y: auto;
  padding: 80px 20px 20px;
}
.liked-feed-overlay.active { display: block; }
.liked-feed-content { max-width: 600px; margin: 0 auto; }
.liked-feed-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.liked-feed-header h3 { color: #fff; font-size: 1.3rem; }
.liked-feed-close { background: rgba(255,255,255,0.1); border: none; color: #fff; font-size: 1.5rem; width: 44px; height: 44px; border-radius: 6px; cursor: pointer; }
.liked-feed-card { display: flex; align-items: center; gap: 14px; padding: 16px; background: rgba(255,255,255,0.06); border-radius: 8px; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.1); transition: all 0.2s; text-decoration: none; }
.liked-feed-card:hover { background: rgba(255,255,255,0.12); transform: translateX(4px); }
.liked-feed-icon { color: #e74c3c; font-size: 1rem; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: rgba(231,76,60,0.12); display: inline-flex; align-items: center; justify-content: center; }
.liked-feed-info { flex: 1; min-width: 0; }
.liked-feed-title { color: #fff; font-weight: 600; font-size: 0.95rem; }
.liked-feed-page { color: rgba(255,255,255,0.5); font-size: 0.75rem; text-transform: uppercase; }
.liked-feed-remove { background: none; border: none; color: rgba(255,255,255,0.3); font-size: 1.2rem; cursor: pointer; padding: 4px; }
.liked-feed-remove:hover { color: #e74c3c; }
.liked-feed-empty { text-align: center; color: rgba(255,255,255,0.5); padding: 60px 20px; font-size: 1rem; }

/* ===== LIKED SECTION INDICATOR ===== */
/* ===== CONTENT CHUNKS ===== */
.content-chunk {
  border-radius: var(--radius);
  padding: 4px 6px;
  margin-bottom: 6px;
  transition: background 0.2s, outline-color 0.3s;
  cursor: default;
  -webkit-user-select: text;
  user-select: text;
}
.content-chunk:active {
  background: rgba(26,82,118,0.04);
}
.section-liked {
  outline: 2px solid rgba(231,76,60,0.35);
  outline-offset: -2px;
  background: rgba(231,76,60,0.03) !important;
}
/* Bullet list from split paragraphs */
.chunk-list {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
}
.chunk-list li {
  margin-bottom: 6px;
  line-height: 1.55;
  color: var(--text);
}

/* Heart pop animation on double-click */
.heart-pop {
  position: fixed;
  font-size: 2.5rem;
  color: #e74c3c;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%) scale(0);
  animation: heartPop 0.9s ease forwards;
}
@keyframes heartPop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(1); opacity: 0; }
}

/* ===== SWIPE NAVIGATION INDICATOR ===== */
.swipe-indicator {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  animation: swipeFade 0.6s ease forwards;
  pointer-events: none;
}
.swipe-next { right: 20px; }
.swipe-prev { left: 20px; }
@keyframes swipeFade {
  0% { opacity: 0; transform: translateY(-50%) scale(0.9); }
  30% { opacity: 1; transform: translateY(-50%) scale(1); }
  100% { opacity: 0; transform: translateY(-50%) scale(1); }
}

/* ===== HIDE HERO, NAVBAR & FOOTER (replaced by top/bottom nav) ===== */
.hero { display: none !important; }
.navbar { display: none !important; }
.footer { display: none !important; }

/* ===== TOP PAGE NAVIGATION BAR ===== */
.top-page-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--primary-dark);
  border-bottom: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* Page markers track */
.tpn-track {
  position: relative;
  height: 6px;
  background: rgba(255,255,255,0.12);
}
.tpn-track-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  pointer-events: none;
  transition: width 0.3s ease;
}
.tpn-marker {
  position: absolute;
  top: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: 2px solid var(--primary-dark);
  transform: translateX(-50%);
  cursor: pointer;
  transition: all var(--transition);
  z-index: 1;
}
.tpn-marker.active {
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(243,156,18,0.4);
}
.tpn-marker:hover { background: var(--accent-light); }
.tpn-controls {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
}
.tpn-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  text-decoration: none;
}
.tpn-btn:hover { background: rgba(255,255,255,0.2); color: var(--white); }
.tpn-btn.tpn-disabled { opacity: 0.25; pointer-events: none; }
.tpn-info {
  flex: 1;
  min-width: 0;
  text-align: center;
  cursor: pointer;
  padding: 4px 0;
}
.tpn-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Expandable page list (drops down from top nav) */
.tpn-list {
  max-height: 0;
  overflow: hidden;
  overflow-y: auto;
  transition: max-height 0.3s ease;
  background: var(--white);
  border-top: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.top-page-nav.expanded .tpn-list {
  max-height: 70vh;
}
.tpn-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 0.88rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  text-decoration: none;
}
.tpn-list-item:last-child { border-bottom: none; }
.tpn-list-item:hover { background: var(--bg-alt); }
.tpn-list-item.active {
  color: var(--primary);
  font-weight: 600;
  background: rgba(26,82,118,0.05);
  border-left: 3px solid var(--primary);
}
.tpn-list-item .tpn-list-icon { font-size: 1.1rem; flex-shrink: 0; width: 24px; text-align: center; }
.tpn-list-item .tpn-list-label { flex: 1; min-width: 0; }
/* Language switcher in page list */
.tpn-list-lang {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.tpn-lang-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  background: var(--white);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all var(--transition);
}
.tpn-lang-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.tpn-lang-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.tpn-list-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  background: rgba(26,82,118,0.04);
  cursor: pointer;
  transition: background var(--transition);
}
.tpn-list-search:hover { background: rgba(26,82,118,0.08); }
.tpn-list-liked {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e74c3c;
  border-bottom: 1px solid var(--border);
  background: rgba(231,76,60,0.04);
  cursor: pointer;
  transition: background var(--transition);
}
.tpn-list-liked span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(231,76,60,0.10);
  font-size: 1rem;
  flex-shrink: 0;
}
.tpn-list-liked:hover { background: rgba(231,76,60,0.08); }
.tpn-list-liked .tpn-liked-count {
  background: #e74c3c;
  color: #fff;
  font-size: 0.7rem;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* ===== BOTTOM SECTION NAVIGATION BAR ===== */
.bottom-section-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--primary-dark);
  border-top: none;
  z-index: 998;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.2);
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: bottom 0.15s ease-out;
}
/* Progress track with markers */
.bsn-track {
  position: relative;
  height: 6px;
  background: rgba(255,255,255,0.12);
  cursor: pointer;
}
.bsn-track-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.1s linear;
  pointer-events: none;
}
.bsn-marker {
  position: absolute;
  top: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: 2px solid var(--primary-dark);
  transform: translateX(-50%);
  cursor: pointer;
  transition: all var(--transition);
  z-index: 1;
}
.bsn-marker.active {
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(243,156,18,0.4);
}
.bsn-marker:hover { background: var(--accent-light); }
/* Controls */
.bsn-controls {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
}
.bsn-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.bsn-btn:hover:not(:disabled) { background: rgba(255,255,255,0.2); color: var(--white); }
.bsn-btn:disabled { opacity: 0.25; cursor: default; }
.bsn-info {
  flex: 1;
  min-width: 0;
  text-align: center;
  cursor: pointer;
  padding: 4px 0;
}
.bsn-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Expandable section list */
.bsn-list {
  max-height: 0;
  overflow: hidden;
  overflow-y: auto;
  transition: max-height 0.3s ease;
  background: var(--white);
  border-top: none;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.15);
}
.bottom-section-nav.expanded .bsn-list {
  max-height: 50vh;
}
.bsn-list-item {
  display: block;
  padding: 12px 20px;
  font-size: 0.88rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  text-decoration: none;
}
.bsn-list-item:last-child { border-bottom: none; }
.bsn-list-item:hover { background: var(--bg-alt); }
.bsn-list-item.active {
  color: var(--primary);
  font-weight: 600;
  background: rgba(26,82,118,0.05);
  border-left: 3px solid var(--primary);
}

/* ===== LANGUAGE SELECTOR ===== */
.lang-selector {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
  align-items: center;
  border-left: 1px solid rgba(255,255,255,0.2);
  padding-left: 10px;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 24px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.08);
  transition: all var(--transition);
  text-decoration: none;
}
.lang-btn:hover {
  color: var(--white);
  background: rgba(255,255,255,0.18);
}
.lang-btn.active {
  color: var(--white);
  background: var(--primary-light);
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: var(--white);
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></svg>') repeat;
  background-size: 200px;
}
.hero h1 { font-size: 2.8rem; margin-bottom: 16px; position: relative; }
.hero p { font-size: 1.2rem; opacity: 0.9; max-width: 700px; margin: 0 auto 30px; position: relative; }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  position: relative;
}
.hero-stat {
  text-align: center;
}
.hero-stat .number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}
.hero-stat .label {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 4px;
}

/* ===== SECTION ===== */
.section { padding: 60px 0; }
.section-alt { background: var(--bg-alt); }
.section-header {
  text-align: center;
  margin-bottom: 40px;
}
.section-header h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}
.section-header p {
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== CARDS ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card-header {
  background: var(--primary);
  color: var(--white);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-header .icon { font-size: 1.5rem; }
.card-header h3 { font-size: 1.1rem; font-weight: 600; color: var(--white); }
.card-body { padding: 24px; }
.card-body p { margin-bottom: 12px; color: var(--text); }
.card-body ul { padding-left: 0; }
.card-body ul li {
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  color: var(--text);
}
.card-body ul li::before {
  content: '\2022';
  color: var(--accent);
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* ===== INFO BOXES ===== */
.info-box {
  background: var(--white);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.info-box.warning { border-left-color: var(--accent); }
.info-box.success { border-left-color: var(--success); }
.info-box.danger { border-left-color: var(--danger); }
.info-box h4 { margin-bottom: 8px; font-size: 1rem; }
.info-box p { margin: 0; font-size: 0.95rem; }

/* ===== TABLES ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}
th {
  background: var(--primary);
  color: var(--white);
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}
td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
tr:hover td { background: rgba(26,82,118,0.03); }

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
  font-size: 0.9rem;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== SIDEBAR LAYOUT ===== */
.page-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: 66px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}
.sidebar h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  margin-bottom: 12px;
}
.sidebar a {
  display: block;
  padding: 8px 12px;
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: all var(--transition);
}
.sidebar a:hover, .sidebar a.active {
  background: rgba(26,82,118,0.08);
  color: var(--primary);
}
.main-content {
  min-width: 0;
}

/* ===== SEARCH ===== */
.search-box {
  position: relative;
  max-width: 500px;
  margin: 0 auto 30px;
}
.search-box input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 1rem;
  background: var(--white);
  transition: border-color var(--transition);
}
.search-box input:focus {
  outline: none;
  border-color: var(--primary-light);
}
.search-box .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-primary { background: rgba(26,82,118,0.1); color: var(--primary); }
.badge-accent { background: rgba(243,156,18,0.15); color: #c57e0a; }
.badge-success { background: rgba(39,174,96,0.15); color: var(--success); }

/* ===== MAP ===== */
.map-container {
  width: 100%;
  height: 500px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
}
.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 40px 0 20px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}
.footer h4 {
  color: var(--white);
  margin-bottom: 12px;
  font-size: 1rem;
}
.footer a { color: rgba(255,255,255,0.7); }
.footer a:hover { color: var(--accent); }
.footer ul li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
}

/* ===== ACCORDION ===== */
.accordion-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  overflow: hidden;
}
.accordion-header {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  transition: background var(--transition);
}
.accordion-header:hover { background: var(--bg-alt); }
.accordion-header .arrow { transition: transform var(--transition); }
.accordion-item.open .accordion-header .arrow { transform: rotate(180deg); }
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.accordion-body-inner { padding: 0 20px 20px; }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-light);
  border-radius: 3px;
}
.timeline-item {
  position: relative;
  margin-bottom: 24px;
  padding-left: 20px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -35px;
  top: 4px;
  width: 13px;
  height: 13px;
  background: var(--primary);
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--primary-light);
}
.timeline-item h4 { margin-bottom: 4px; }
.timeline-item p { color: var(--text-light); font-size: 0.9rem; }

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  background: var(--primary-light);
  transform: translateY(-3px);
}

/* ===== CHECKLIST / STEPS ===== */
.step-list { counter-reset: step-counter; }
.step-item {
  position: relative;
  padding: 20px 24px 20px 70px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  transition: transform var(--transition);
}
.step-item:hover { transform: translateX(4px); }
.step-item::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 20px;
  top: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.step-item h4 { margin-bottom: 4px; }
.step-item p { font-size: 0.9rem; color: var(--text-light); margin: 0; }
.step-item .step-meta {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.8rem;
}
.step-item .step-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-light);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-light);
  padding: 12px 0;
}
.breadcrumb a { color: var(--primary-light); }
.breadcrumb .sep { opacity: 0.5; }

/* ===== GLOBAL BOOK PROGRESS BAR ===== */
.book-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--success);
  z-index: 1002;
  transition: width 0.3s ease;
  pointer-events: none;
}

/* ===== PROGRESS BAR ===== */
.reading-progress {
  position: fixed;
  top: 2px;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 1001;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ===== SECTION REVEAL ANIMATION ===== */
/* Elements start visible by default; JS adds .will-reveal to hide them,
   then IntersectionObserver adds .revealed to animate them in.
   This ensures content is ALWAYS visible if JS fails or is slow. */
.will-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.will-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
/* Ensure hero is always visible */
.hero { opacity: 1 !important; transform: none !important; }
/* Reduced motion: skip animations entirely */
@media (prefers-reduced-motion: reduce) {
  .will-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ===== SCROLL LOCK (when menus expanded) ===== */
body.scroll-locked {
  overflow: hidden !important;
  touch-action: none;
}

/* ===== PAGE LOADING INDICATOR ===== */
.page-loader {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--primary-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}
.page-loader.loaded {
  opacity: 0;
  pointer-events: none;
}
.loader-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text {
  margin-top: 16px;
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
  font-weight: 500;
}
.loader-bar {
  width: 120px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  margin-top: 20px;
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  animation: loaderFill 1.5s ease-in-out infinite;
}
@keyframes loaderFill {
  0% { width: 0; }
  50% { width: 80%; }
  100% { width: 100%; }
}


/* ===== COLLAPSIBLE INFO BOXES (mobile) ===== */
.collapsible .collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.collapsible.expanded .collapsible-content {
  max-height: 4000px;
}
.collapsible-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.collapsible-arrow {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
  margin-left: auto;
  padding-left: 8px;
  color: var(--text-light);
}
.collapsible.expanded .collapsible-arrow {
  transform: rotate(180deg);
}

/* ===== READ MORE (mobile truncation) ===== */
.truncated-p {
  max-height: 4.8em;
  overflow: hidden;
  position: relative;
}
.truncated-p::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.5em;
  background: linear-gradient(transparent, var(--white));
  pointer-events: none;
}
.truncated-p.expanded {
  max-height: none;
}
.truncated-p.expanded::after {
  display: none;
}
.read-more-btn {
  display: inline-block;
  background: none;
  border: none;
  color: var(--primary-light);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 8px;
}
.read-more-btn:hover {
  color: var(--accent);
}


/* ===== INDEX CARD READ PROGRESS ===== */
.card-read-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 12px;
  border-top: 1px solid var(--border);
}
.card-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-alt);
  border-radius: 2px;
  overflow: hidden;
}
.card-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.card-read-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.card-read-pct {
  font-size: 0.7rem;
  color: var(--text-light);
  white-space: nowrap;
}

/* ===== PAGE TRANSITION ===== */
.page-transition {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--primary-dark);
  z-index: 30000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.page-transition.active {
  opacity: 1;
}
.page-transition-content {
  text-align: center;
}
.page-transition-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}
.page-transition-label {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 0.9;
}

/* ===== NEXT PAGE BUTTON ===== */
.next-page-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 480px;
  margin: 40px auto 100px;
  padding: 20px 24px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}
.next-page-btn:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  color: inherit;
}
.next-page-info {
  flex: 1;
  min-width: 0;
}
.next-page-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.next-page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}
.next-page-arrow {
  font-size: 1.5rem;
  color: var(--primary-light);
  flex-shrink: 0;
}
@media (max-width: 960px) {
  .next-page-btn {
    margin: 24px 16px 100px;
  }
}

/* ===== WELCOME WALKTHROUGH ===== */
.walkthrough-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: walkthroughIn 0.3s ease;
}
.walkthrough-overlay.closing {
  opacity: 0;
  transition: opacity 0.3s ease;
}
@keyframes walkthroughIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.walkthrough-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px 32px 32px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: cardSlideUp 0.3s ease;
}
@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.walkthrough-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}
.walkthrough-title {
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin-bottom: 12px;
}
.walkthrough-text {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 24px;
}
.walkthrough-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.walkthrough-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
}
.walkthrough-dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}
.walkthrough-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.walkthrough-next {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.walkthrough-next:hover { background: var(--primary-light); }
.walkthrough-skip, .walkthrough-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.walkthrough-skip:hover, .walkthrough-back:hover {
  border-color: var(--text-light);
  color: var(--text);
}

/* ===== TRY CURRENCY TAG ===== */
.try-tag {
  display: inline;
  font-size: 0.8em;
  color: var(--text-light);
  font-weight: 400;
  white-space: nowrap;
}

/* ===== LIKED FEED PAGE ===== */
.liked-page-empty { text-align: center; padding: 60px 20px; color: var(--text-light); font-size: 1.05rem; }
.liked-page-group { margin-bottom: 32px; }
.liked-page-source-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--primary); color: #fff; border-radius: var(--radius) var(--radius) 0 0; margin-bottom: 0; }
.liked-page-source-label { font-weight: 700; font-size: 0.95rem; letter-spacing: 0.3px; }
.liked-page-source-link { color: rgba(255,255,255,0.8); font-size: 0.8rem; font-weight: 600; }
.liked-page-source-link:hover { color: #fff; }
.liked-section-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; margin-bottom: 12px; border-bottom: 1px solid var(--border); font-size: 0.8rem; }
.liked-section-source { color: var(--primary-light); font-weight: 600; }
.liked-section-source:hover { color: var(--accent); }
.liked-section-remove { background: none; border: 1px solid rgba(231,76,60,0.3); color: #e74c3c; border-radius: 50px; padding: 4px 12px; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.liked-section-remove:hover { background: #e74c3c; color: #fff; border-color: #e74c3c; }

/* ===== PRINT STYLES ===== */
@media print {
  .navbar, .nav-toggle, .back-to-top, .reading-progress, .book-progress-bar, .sidebar, .liked-feed-overlay, .heart-pop, .swipe-indicator, .top-page-nav, .bottom-section-nav, .card-read-progress, .collapsible-arrow, .read-more-btn, .walkthrough-overlay, .next-page-btn { display: none !important; }
  .collapsible .collapsible-content { max-height: none !important; }
  .truncated-p { max-height: none !important; }
  .truncated-p::after { display: none !important; }
  .hero { padding: 20px 0 !important; background: var(--primary) !important; -webkit-print-color-adjust: exact; }
  .page-layout { grid-template-columns: 1fr !important; }
  .card { break-inside: avoid; box-shadow: none !important; border: 1px solid var(--border); }
  .section { padding: 20px 0; }
  .footer { padding: 10px 0; }
  body { font-size: 12pt; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: var(--text-light); }
  a.card::after, .nav-links a::after, .sidebar a::after { content: none; }
}

/* ===== UTILITY: 2-COLUMN GRID ===== */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ===== IMAGE INTEGRATION ===== */
/* Hero with background image + gradient overlay */
.hero--image {
  background-size: cover;
  background-position: center;
  position: relative;
}
.hero--image::before {
  background: linear-gradient(135deg, rgba(14,47,68,0.88) 0%, rgba(26,82,118,0.78) 50%, rgba(41,128,185,0.72) 100%);
}
.hero--image .container { position: relative; z-index: 2; }

/* Full-width section break image */
.section-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin: 24px 0;
  box-shadow: var(--shadow);
}

/* Float images for inline content */
.img-float-right {
  float: right;
  max-width: 320px;
  margin: 0 0 16px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.img-float-left {
  float: left;
  max-width: 320px;
  margin: 0 24px 16px 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* Card thumbnail */
.card-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Caption */
.img-caption {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 6px;
  font-style: italic;
}

/* ===== OVERFLOW PREVENTION ===== */
/* IMPORTANT: Do NOT use overflow-x:hidden on html — it breaks position:fixed on mobile Safari */
body { padding-top: 60px; }
body.has-bottom-nav { padding-bottom: 70px; }
body.has-bottom-nav .back-to-top { bottom: 80px; }

/* ===== SITE-WIDE SEARCH OVERLAY ===== */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 20px;
  overflow-y: auto;
}

.search-overlay.active {
  display: flex;
}

.search-overlay-content {
  width: 100%;
  max-width: 800px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-overlay-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}

.search-overlay-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.search-overlay-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.search-overlay-input {
  flex: 1;
  padding: 16px 20px;
  font-size: 1.3rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  outline: none;
  transition: all var(--transition);
}

.search-overlay-input:focus {
  border-color: var(--primary-light);
  background: rgba(255, 255, 255, 0.08);
}

.search-overlay-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-results {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.search-result-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition);
  cursor: pointer;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-light);
  transform: translateX(4px);
}

.search-result-page {
  color: var(--primary-light);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-result-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.search-result-snippet {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1.5;
}

.search-result-snippet mark {
  background: rgba(243, 156, 18, 0.3);
  color: var(--accent-light);
  padding: 2px 4px;
  border-radius: 3px;
}

.search-no-results {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 60px 20px;
  font-size: 1.1rem;
}

.search-loading {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  padding: 40px 20px;
  font-size: 1rem;
}

/* ===== RESPONSIVE ===== */
/* Medium screens - nav compression */
@media (max-width: 1200px) {
  .nav-links a {
    padding: 4px 4px;
    font-size: 0.68rem;
  }
  .nav-links { gap: 1px; }
  .navbar-brand { font-size: 1.1rem; }
  .lang-selector { margin-left: 4px; padding-left: 6px; }
  .lang-btn { width: 28px; height: 22px; font-size: 0.65rem; }
}

@media (max-width: 960px) {
  .hero h1 { font-size: 1.8rem; }
  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .page-layout { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .grid-2col { grid-template-columns: 1fr; }
  .section-image { height: 160px; }
  .img-float-right, .img-float-left { float: none; max-width: 100%; margin: 0 0 16px 0; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    padding: 10px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  }
  .nav-links a {
    padding: 10px 16px;
    font-size: 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; min-height: 44px; min-width: 44px; }
  .navbar-tools {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 10px 16px 4px;
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
  .lang-selector {
    border-left: none;
    padding: 10px 0 4px;
    margin-left: 0;
  }
  .lang-btn { width: 40px; height: 30px; font-size: 0.8rem; }
  .hero { padding: 50px 0 40px; }
  .section { padding: 40px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .back-to-top { bottom: 20px; right: 20px; width: 44px; height: 44px; font-size: 1rem; }
  .step-item { padding-left: 60px; }
  .step-item::before { left: 14px; width: 32px; height: 32px; }
  td, th { padding: 8px 10px; font-size: 0.82rem; }
  .table-wrapper { margin-bottom: 16px; }
  .tab-btn { min-height: 44px; padding: 10px 16px; }
  .map-filter-btn { min-height: 44px; }
  /* Smaller font for more info density */
  html { font-size: 15px; }

  /* Hide sidebar on mobile */
  .sidebar { display: none; }


  /* Mobile content card sections */
  .main-content > div[id] {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 16px !important;
    margin-bottom: 12px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }
  .main-content > div[id] > h2,
  section.section > .container > .section-header > h2 {
    position: sticky;
    top: 55px;
    z-index: 50;
    background: var(--white);
    padding: 12px 16px 10px !important;
    margin: -16px -16px 12px !important;
    border-bottom: 2px solid var(--accent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  section.section > .container > .section-header > h2 {
    background: var(--bg);
    margin: 0 0 12px;
    padding: 12px 0 10px;
  }
  section.section.section-alt > .container > .section-header > h2 {
    background: var(--bg-alt);
  }
  /* Consistent inner spacing — !important overrides inline styles */
  .main-content p { line-height: 1.7; margin-bottom: 10px !important; }
  .main-content h3 { margin-top: 14px !important; margin-bottom: 8px !important; }
  .main-content h4 { margin-top: 10px !important; margin-bottom: 6px !important; }
  .main-content ul, .main-content ol { margin-bottom: 10px; }
  /* Nested cards get border, consistent margin */
  .main-content > div[id] .card,
  .main-content > div[id] .info-box,
  .main-content > div[id] .table-wrapper {
    box-shadow: none;
    border: 1px solid var(--border);
    margin-bottom: 12px !important;
    margin-top: 0 !important;
  }
  .main-content > div[id] .card { border-radius: var(--radius); }
  .main-content > div[id] .card-body { padding: 14px !important; }
  .main-content > div[id] .card-header { padding: 12px 14px !important; }
  .main-content > div[id] .info-box { padding: 14px !important; margin-bottom: 12px !important; }
  /* Card grid consistent gap */
  .main-content > div[id] .card-grid { gap: 12px !important; }
  .main-content > div[id] .grid-2col { gap: 12px !important; }
  /* Table uniform spacing */
  .main-content > div[id] .table-wrapper { margin-bottom: 12px !important; border-radius: var(--radius); }
  /* Section image spacing */
  .main-content .section-image { margin: 10px 0 !important; height: 140px; }

  /* Responsive table card-view for wide tables */
  .table-card-mobile thead { display: none; }
  .table-card-mobile tbody tr {
    display: block;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    padding: 16px;
  }
  .table-card-mobile tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
  }
  .table-card-mobile tbody td:last-child { border-bottom: none; }
  .table-card-mobile tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--primary);
    margin-right: 12px;
    flex-shrink: 0;
    max-width: 40%;
  }
  .table-card-mobile tbody td:empty { display: none; }
}

/* Extra small screens */
@media (max-width: 480px) {
  .hero h1 { font-size: 1.4rem; }
  .hero p { font-size: 1rem; }
  .hero-stat .number { font-size: 1.5rem; }
  .hero-stats { gap: 12px; }
  .section { padding: 30px 0; }
  .section-header h2 { font-size: 1.5rem; }
  .container { padding: 0 10px; }
  .main-content > div[id] { padding: 14px 12px !important; margin-bottom: 10px !important; }
  .main-content > div[id] > h2 { margin: -14px -12px 10px !important; padding: 10px 12px 8px !important; font-size: 1.15rem; }
  .main-content > div[id] .info-box { padding: 12px !important; }
  .main-content > div[id] .card-body { padding: 12px !important; }
  .main-content > div[id] .card-header { padding: 10px 12px !important; }
  .card-body { padding: 14px; }
  .info-box { padding: 12px 14px; }
  .search-box input { padding: 12px 16px 12px 44px; font-size: 0.9rem; }
  td, th { padding: 6px 8px; font-size: 0.78rem; }
  .tabs { gap: 2px; }
  .tab-btn { padding: 8px 12px; font-size: 0.8rem; }
  .badge { font-size: 0.7rem; padding: 2px 8px; }
  .district-grid { grid-template-columns: 1fr; }
}
