/* Shared styles for WB OBC Archive - Single source for EN/BN */

:root {
  --bg: #f6fbff;
  --text: #111827;
  --muted: #475569;
  --border: #d1d5db;
  --primary: #245d8d;
  --primary-light: #3f78af;
  --accent: #f97316;
  --primary-dark: #1c4a6b;
  --card-bg: #ffffff;
  --shadow: 0 1px 4px rgba(15,23,42,0.08);
  --shadow-lg: 0 10px 25px rgba(15,23,42,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --bn-font: 'Noto Sans Bengali', 'Hind Siliguri', sans-serif;
  --max-width: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --border: #334155;
    --primary: #60a5fa;
    --primary-light: #93c5fd;
    --primary-dark: #2563eb;
    --accent: #facc15;
    --card-bg: #111827;
    --shadow: 0 1px 4px rgba(0,0,0,0.25);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.35);
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: #000000;
    --muted: #000000;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --border: #ffffff;
      --muted: #ffffff;
    }
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

body.lang-bn {
  font-family: var(--bn-font), var(--font-sans);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 2.5rem; z-index: 9999;
  background: var(--primary); color: #fff; padding: 0.65rem 1rem;
  text-decoration: none; border-radius: var(--radius);
}
.skip-link:focus { left: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s;
}
@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(15,23,42,0.9); }
}

.site-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max-width); margin: 0 auto; padding: 0.6rem 1rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.55rem;
  font-weight: 700; font-size: 1.05rem; color: var(--primary);
  letter-spacing: -0.02em;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}
.site-logo:hover,
.site-logo:focus-visible {
  background: var(--card-bg);
  color: var(--primary);
  outline: none;
}

.site-nav { display: flex; gap: 0.5rem; align-items: center; }
.site-nav a {
  padding: 0.5rem 0.75rem; border-radius: var(--radius);
  color: var(--text); text-decoration: none; font-size: 0.875rem;
  transition: background 0.2s, color 0.2s;
}
.site-nav a:hover, .site-nav a.active { background: var(--card-bg); color: var(--primary); }

.nav-group { position: relative; }
.nav-group-toggle {
  display: flex; align-items: center; gap: 0.25rem;
  padding: 0.5rem 0.75rem; border: none; background: transparent;
  color: var(--text); font-size: 0.875rem; border-radius: var(--radius);
  cursor: pointer; transition: background 0.2s;
}
.nav-group-toggle:hover { background: var(--card-bg); }
.nav-caret { font-size: 0.625rem; opacity: 0.7; }
.nav-group-items {
  position: absolute; top: 100%; right: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 180px; opacity: 0; visibility: hidden;
  transform: translateY(-10px); transition: all 0.2s;
}
.nav-group-toggle[aria-expanded="true"] + .nav-group-items {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-group-items a {
  display: block; padding: 0.625rem 1rem; white-space: nowrap;
}

.language-switch {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.25rem 0.5rem; border-left: 1px solid var(--border);
  margin-left: 0.5rem; font-size: 0.875rem;
}
.language-switch a {
  color: var(--muted); text-decoration: none; padding: 0.25rem;
}
.language-switch a:hover, .language-switch [aria-current="true"] {
  color: var(--primary); font-weight: 600;
}

.nav-toggle { display: none; }
.nav-overlay { display: none; }

@media (max-width: 900px) {
  .nav-toggle {
    display: flex; flex-direction: column; gap: 4px;
    background: none; border: none; cursor: pointer; padding: 0.5rem;
  }
  .nav-toggle-bar { width: 24px; height: 2px; background: var(--text); }
  .site-nav {
    position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
    background: var(--bg); border-left: 1px solid var(--border);
    flex-direction: column; padding: 5rem 1.5rem 1.5rem; gap: 0;
    transition: right 0.3s; overflow-y: auto;
  }
  .site-nav.open { right: 0; }
  .nav-overlay {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 999; opacity: 0; visibility: hidden; transition: opacity 0.3s;
  }
  .nav-overlay.open { opacity: 1; visibility: visible; }
  .nav-group-items {
    position: static; box-shadow: none; border: none;
    background: var(--card-bg); border-radius: var(--radius);
    min-width: auto; opacity: 1; visibility: visible;
    transform: none; display: none; margin-top: 0.5rem;
  }
  .nav-group-toggle[aria-expanded="true"] + .nav-group-items { display: block; }
  .language-switch { border-left: none; margin: 1rem 0 0; padding: 0; }
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; padding: 2rem 0 1.5rem;
}
.hero-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }
.hero-eyebrow { font-size: 0.825rem; opacity: 0.95; margin-bottom: 0.5rem; }
.hero-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 0.75rem; line-height: 1.1; }
.hero-sub { font-size: 1rem; opacity: 0.96; max-width: 720px; margin-bottom: 1.2rem; line-height: 1.55; }
.hero-sub strong { color: #fff; }
.hero-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem; margin-top: 1rem;
}
.hero-stat {
  background: rgba(255,255,255,0.16); padding: 0.85rem 0.95rem;
  border-radius: var(--radius-lg); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18);
  min-height: 100px; display: flex; flex-direction: column; justify-content: center;
}
.hero-stat strong { display: block; font-size: 1.65rem; margin-bottom: 0.25rem; color: #fff; }
.hero-stat span { font-size: 0.9rem; opacity: 0.92; line-height: 1.45; }

@media (max-width: 720px) {
  .hero { padding: 2.5rem 0 1.5rem; }
  .hero-sub { font-size: 1rem; }
  .hero-stats { gap: 0.85rem; }
}

/* Panels */
.tab-panel { padding: 2rem 0; display: none; }
.tab-panel:not([hidden]) { display: block; animation: fadeIn 0.35s; }

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

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

.section-heading { font-size: 2rem; font-weight: 700; margin-bottom: 0.75rem; }
.section-sub { color: var(--muted); margin-bottom: 2rem; max-width: 800px; }

/* Cards & Grids */
.report-grid, .source-status-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem; margin: 1.5rem 0;
}
.report-card, .source-status {
  background: var(--card-bg); padding: 0.95rem;
  border-radius: var(--radius); border: 1px solid var(--border);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.report-card:hover, .source-status:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-lg);
  border-color: rgba(0, 0, 0, 0.08);
}
.source-status { text-decoration: none; color: inherit; display: block; }
.source-status strong,
.report-card strong {
  display: block; font-size: 1.3rem; margin-bottom: 0.5rem;
}
.source-status span,
.report-card p {
  font-size: 0.92rem; line-height: 1.55; color: var(--muted);
}
.source-status-grid a,
.report-grid article {
  min-height: 150px;
}
.source-status-grid a {
  padding: 1.2rem;
}
.source-status-grid a strong {
  color: var(--primary-dark);
}
.source-status-grid a span {
  display: block; margin-top: 0.45rem;
}

.report-meta {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent); font-weight: 600; margin-bottom: 0.5rem;
}
.report-card h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.report-card p { color: var(--muted); font-size: 0.9375rem; }
.source-status strong { display: block; font-size: 1.5rem; color: var(--primary); }
.source-status span { color: var(--muted); font-size: 0.875rem; }

/* Home Brief */
.home-brief {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem; margin: 1.5rem 0;
}
.home-brief article {
  background: var(--card-bg); padding: 1rem;
  border-radius: var(--radius); border-left: 4px solid var(--primary);
}
.home-brief strong { display: block; margin-bottom: 0.35rem; color: var(--primary); }
.home-brief span { color: var(--muted); font-size: 0.9rem; }

/* Search */
.search-panel { position: relative; margin: 1.5rem 0; }
.search-input {
  width: 100%; padding: 1rem 1.25rem; font-size: 1rem;
  border: 2px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg); color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
}
.site-search-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 400px; overflow-y: auto; z-index: 100;
  display: none;
}
.site-search-results:not(:empty) { display: block; }
.search-result-item {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.2s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--card-bg); }
.search-result-item strong { color: var(--primary); }
.search-result-item small { color: var(--muted); font-size: 0.75rem; }

.search-footer { margin-top: 1rem; }
.search-scope {
  display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 0.85rem;
  font-size: 0.85rem; color: var(--muted);
}
.query-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.query-actions a {
  padding: 0.45rem 0.9rem; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; font-size: 0.85rem;
  transition: all 0.2s;
}
.query-actions a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Tables */
.table-wrap {
  overflow-x: auto; margin: 2rem 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 0.75rem 0.85rem; text-align: left; border-bottom: 1px solid var(--border); }
th { 
  background: var(--card-bg); 
  font-weight: 600; 
  font-size: 0.8rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
td { font-size: 0.9rem; color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* Filters */
.obc-list-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end;
  margin: 1.2rem 0; padding: 0.95rem; background: var(--card-bg);
  border-radius: var(--radius); border: 1px solid var(--border);
}
.obc-list-toolbar label { display: flex; flex-direction: column; gap: 0.3rem; }
.obc-list-toolbar span { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.doc-status-filter {
  padding: 0.55rem 0.65rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text);
  min-width: 170px;
}
.filter-count { font-size: 0.84rem; color: var(--muted); margin-top: 0.35rem; }

/* Callout */
.callout {
  padding: 1.25rem; background: rgba(26,58,92,0.05);
  border-left: 4px solid var(--primary); border-radius: var(--radius);
  margin: 2rem 0; font-size: 0.9375rem;
}

/* Popup */
.contribute-popup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; opacity: 0; animation: fadeInOverlay 0.3s ease-out forwards;
}
@keyframes fadeInOverlay { to { opacity: 1; } }

.contribute-popup {
  background: var(--bg); max-width: 480px; width: 100%;
  border-radius: var(--radius-lg); padding: 2rem;
  position: relative; box-shadow: var(--shadow-lg);
  transform: scale(0.9) translateY(10px); 
  animation: fadeInPopup 0.3s ease-out 0.1s forwards;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes fadeInPopup { to { transform: scale(1) translateY(0); } }

.popup-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; font-size: 1.5rem;
  color: var(--muted); cursor: pointer; padding: 0.25rem;
  line-height: 1; transition: color 0.2s, transform 0.2s;
}
.popup-close:hover { color: var(--text); transform: scale(1.1); }

.popup-icon {
  width: 64px; height: 64px; margin: 0 auto 1.5rem;
  color: var(--primary);
}
.contribute-popup h2 { font-size: 1.5rem; margin-bottom: 0.75rem; text-align: center; }
.contribute-popup p { color: var(--muted); margin-bottom: 1.5rem; text-align: center; }

.popup-actions { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.popup-btn {
  padding: 0.875rem 1.5rem; border-radius: var(--radius);
  text-decoration: none; font-weight: 600; font-size: 0.9375rem;
  transition: all 0.2s; display: inline-block;
}
.popup-btn.primary {
  background: var(--primary); color: #fff;
}
.popup-btn.primary:hover { background: var(--primary-light); transform: translateY(-2px); }

.popup-note {
  font-size: 0.875rem; color: var(--muted); text-align: center;
  padding: 1rem; background: var(--card-bg); border-radius: var(--radius);
  margin-bottom: 1rem;
}

.popup-footer { text-align: center; }
.popup-footer label {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; font-size: 0.8125rem; color: var(--muted); cursor: pointer;
}

/* Loading */
.loading-spinner {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem; color: var(--muted);
}
.loading-spinner::before {
  content: ''; width: 32px; height: 32px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; margin-right: 1rem;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loader for timeline and litigation */
.skeleton-container {
  position: relative;
  padding: 1rem;
}
.skeleton-item {
  height: 60px;
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}
.skeleton-item.tall {
  height: 120px;
}
.skeleton-container::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, var(--bg) 0%, var(--card-bg) 50%, var(--bg) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  pointer-events: none;
  opacity: 0.5;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Stats grid for litigation */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
}
.stat-card.warning {
  border-left: 4px solid #f59e0b;
}
.stat-card.success {
  border-left: 4px solid #10b981;
}
.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Search box */
.search-box {
  position: relative;
  margin: 1.5rem 0;
}
.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
}
.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}
.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--muted);
  pointer-events: none;
}

/* Case summary grid */
.case-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.case-summary-grid article {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}
.case-summary-grid strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.case-summary-grid span {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Data load warning */
.data-load-warning {
  padding: 1rem; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 1.5rem; color: var(--text);
}

/* Litigation note jump callout */
.litigation-note-jump {
  background: var(--card-bg);
  border-left: 4px solid var(--primary);
  padding: 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}
.litigation-note-jump a {
  color: var(--primary);
  text-decoration: underline;
}

/* Fade in animation for loaded content */
.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll-triggered fade-in for timeline and litigation entries */
.scroll-fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.scroll-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth transition for language switching on lists */
.stagger-list {
  transition: opacity 0.2s ease-out;
}

/* Staggered animation for list items */
.stagger-list > li {
  opacity: 0;
  animation: fadeInList 0.4s ease-out forwards;
}
.stagger-list > li:nth-child(1) { animation-delay: 0.05s; }
.stagger-list > li:nth-child(2) { animation-delay: 0.1s; }
.stagger-list > li:nth-child(3) { animation-delay: 0.15s; }
.stagger-list > li:nth-child(4) { animation-delay: 0.2s; }
.stagger-list > li:nth-child(5) { animation-delay: 0.25s; }
.stagger-list > li:nth-child(6) { animation-delay: 0.3s; }
.stagger-list > li:nth-child(7) { animation-delay: 0.35s; }
.stagger-list > li:nth-child(8) { animation-delay: 0.4s; }
.stagger-list > li:nth-child(9) { animation-delay: 0.45s; }
.stagger-list > li:nth-child(10) { animation-delay: 0.5s; }

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

/* ---------------------------------------------------------------
   Reusable interaction/animation utilities.
   Add these classes to any card, grid item, or stat block on any
   page that links this stylesheet — no per-page CSS needed.
   .lift            hover/focus elevation for a clickable card
   .stagger-in > *  fades+rises each direct child in on load, one
                    after another (works for grids up to 10 items)
   .accent-*        4px top accent stripe for visual variety in a
                     grid of otherwise-identical cards
   --------------------------------------------------------------- */
.lift {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.lift:hover, .lift:focus-visible {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg, 0 10px 25px rgba(0,0,0,0.15));
}

.stagger-in > * {
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0.03s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.09s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.21s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.27s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.33s; }
.stagger-in > *:nth-child(7) { animation-delay: 0.39s; }
.stagger-in > *:nth-child(8) { animation-delay: 0.45s; }
.stagger-in > *:nth-child(9) { animation-delay: 0.51s; }
.stagger-in > *:nth-child(10) { animation-delay: 0.57s; }

.accent-blue   { border-top: 4px solid #245478 !important; }
.accent-gold   { border-top: 4px solid #b57917 !important; }
.accent-green  { border-top: 4px solid #1a5c3e !important; }
.accent-red    { border-top: 4px solid #a94331 !important; }

@media (prefers-reduced-motion: reduce) {
  .stagger-in > * { opacity: 1; animation: none; }
  .lift:hover, .lift:focus-visible { transform: none; }
}

/* Responsive Tables - Card View on Mobile */
@media (max-width: 768px) {
  /* Timeline & Litigation Tables -> Cards */
  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap th,
  .table-wrap td,
  .table-wrap tr {
    display: block;
  }
  
  .table-wrap thead {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
  
  .table-wrap tr {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow);
  }
  
  .table-wrap td {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
    min-height: auto;
    align-items: start;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  
  .table-wrap td:last-child {
    border-bottom: none;
  }
  
  .table-wrap td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
    display: block;
  }
  
  /* OBC List - Horizontal Scroll with Sticky First Column */
  .obc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
  }
  
  .obc-table-wrap::after {
    content: '← Scroll →';
    position: absolute;
    bottom: 0.5rem;
    right: 1rem;
    background: var(--primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    pointer-events: none;
    opacity: 0.8;
  }
  
  .obc-table-wrap table {
    min-width: 100%;
  }
  
  .obc-table-wrap th:first-child,
  .obc-table-wrap td:first-child {
    position: sticky;
    left: 0;
    background: var(--card-bg);
    z-index: 10;
    min-width: 60px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  }
  
  /* Touch-friendly buttons and inputs */
  button,
  input[type="text"],
  input[type="search"],
  select,
  a.btn {
    min-height: 48px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Larger tap targets for nav */
  .site-nav a,
  .nav-group-toggle,
  .language-switch a {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
  }
}

/* Smart Sticky Header - Hide on scroll down, show on scroll up */
.site-header {
  transition: transform 0.3s ease;
}

.site-header.header-hidden {
  transform: translateY(-100%);
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 999;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: var(--primary-light);
  transform: translateY(-3px);
}

@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 52px;
    height: 52px;
  }
}

/* Mobile Drawer Navigation Improvements */
@media (max-width: 900px) {
  .site-nav {
    background: var(--bg);
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
  }
  
  .site-nav.open {
    right: 0;
    animation: slideIn 0.3s ease-out;
  }
  
  @keyframes slideIn {
    from { right: -100%; }
    to { right: 0; }
  }
  
  .nav-overlay.open {
    backdrop-filter: blur(4px);
  }
  
  /* Better spacing in mobile nav */
  .site-nav > * {
    margin-bottom: 0.5rem;
  }
  
  .nav-group-items {
    margin-left: 1rem;
    border-left: 2px solid var(--border);
    padding-left: 1rem;
  }
}

/* Popup Mobile Optimization */
@media (max-width: 600px) {
  .contribute-popup {
    max-width: 95vw;
    padding: 1.5rem;
    max-height: 85vh;
  }
  
  .contribute-popup h2 {
    font-size: 1.25rem;
  }
  
  .popup-btn {
    width: 100%;
    text-align: center;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }
  
  .scroll-to-top {
    transition: opacity 0.2s, visibility 0.2s;
  }
  
  .stagger-in > * {
    opacity: 1;
    animation: none;
  }
  
  .lift:hover,
  .lift:focus-visible {
    transform: none;
  }
}

/* Data load warning */
.data-load-warning {
  padding: 1rem; background: #fef3c7; border: 1px solid #f59e0b;
  border-radius: var(--radius); margin-bottom: 1.5rem; color: #92400e;
}

/* Responsive */
@media (max-width: 600px) {
  .hero-title { font-size: 1.75rem; }
  .hero-sub { font-size: 1rem; }
  .section-heading { font-size: 1.5rem; }
  .contribute-popup { padding: 1.5rem; }
  .obc-list-toolbar { flex-direction: column; align-items: stretch; }
  .doc-status-filter { min-width: 100%; }
}
