/* ==========================================================================
   FLAT DESIGN SYSTEM - SIH 2026 RESEARCH EXPLORER
   Zero depth, high-contrast typography, bold color blocking & geometric structure.
   ========================================================================== */

:root {
  /* Core Palette */
  --bg-canvas: #FFFFFF;
  --bg-muted: #F3F4F6;
  --bg-card: #F9FAFB;
  --bg-card-hover: #F3F4F6;
  --bg-surface: #FFFFFF;
  --bg-dark: #111827;
  
  --text-main: #111827;
  --text-muted: #4B5563;
  --text-light: #9CA3AF;
  --text-inverse: #FFFFFF;
  
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --primary-tint: #EFF6FF;
  --primary-text: #1D4ED8;
  
  --secondary: #10B981;
  --secondary-hover: #059669;
  --secondary-tint: #ECFDF5;
  --secondary-text: #047857;
  
  --accent: #F59E0B;
  --accent-hover: #D97706;
  --accent-tint: #FFFBEB;
  --accent-text: #B45309;
  
  --danger: #EF4444;
  --danger-tint: #FEF2F2;
  
  --border-light: #E5E7EB;
  --border-dark: #111827;
  
  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Radii */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;
  
  /* Strictly Zero Shadow */
  --shadow-none: none;
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-canvas);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden !important;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-muted);
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* ==========================================================================
   HERO / BANNER (Poster Aesthetic)
   ========================================================================== */
.hero-banner {
  background-color: var(--primary);
  color: var(--text-inverse);
  position: relative;
  overflow: hidden;
  padding: 2.25rem 1.5rem;
}

/* Geometric Decorative Background Elements */
.geo-shape {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.geo-circle-1 {
  width: 320px;
  height: 320px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.08);
  top: -100px;
  right: 15%;
}

.geo-square-1 {
  width: 220px;
  height: 220px;
  background-color: rgba(255, 255, 255, 0.06);
  transform: rotate(25deg);
  bottom: -80px;
  left: 20%;
}

.geo-circle-2 {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-full);
  background-color: rgba(245, 158, 11, 0.2);
  top: 30px;
  right: -40px;
}

.hero-container {
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.brand-top-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 4px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-badge {
  display: inline-block;
  background-color: var(--accent);
  color: var(--text-dark);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #FFFFFF;
}

.hero-subtitle {
  font-size: 0.95rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 0.25rem;
}

.hero-right-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

/* GitHub Button */
.btn-github {
  background-color: #111827;
  color: #FFFFFF;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s;
}

.btn-github:hover {
  background-color: #000000;
  border-color: #FFFFFF;
  transform: scale(1.04);
}

.github-subtext {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Stats Blocks */
.hero-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat-box {
  background-color: #FFFFFF;
  color: var(--text-main);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  min-width: 110px;
  display: flex;
  flex-direction: column;
}

.stat-primary .stat-number { color: var(--primary); }
.stat-secondary .stat-number { color: var(--secondary); }
.stat-accent .stat-number { color: var(--accent); }

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==========================================================================
   MOBILE ACTION BAR (Sticky at Top on Mobile)
   ========================================================================== */
.mobile-action-bar {
  display: none;
  background-color: var(--bg-surface);
  border-bottom: 2px solid var(--border-light);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 30;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.mobile-right-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: 44px;
  max-height: 44px;
  padding: 0 !important;
  background-color: #111827;
  color: #FFFFFF;
  border-radius: var(--radius-md);
  text-decoration: none;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.btn-icon-round:hover {
  background-color: #000000;
  border-color: var(--primary);
  transform: scale(1.05);
}

.btn-icon-round svg {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  display: block;
  fill: currentColor;
}

.btn-mobile-filter {
  flex: 1;
  position: relative;
}

.filter-count-badge {
  background-color: var(--accent);
  color: var(--text-dark);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   MAIN APP SHELL
   ========================================================================== */
.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  min-height: auto;
}

/* ==========================================================================
   STANDALONE DECOUPLED SEARCH COMMAND BAR
   ========================================================================== */
.search-command-section {
  margin-bottom: 1.5rem;
}

.search-command-bar {
  background-color: #FFFFFF;
  border: 2.5px solid var(--border-dark);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  padding: 0.4rem 0.6rem 0.4rem 0.85rem;
  gap: 0.6rem;
  transition: border-color 0.2s, background-color 0.2s;
}

.search-command-bar:focus-within {
  border-color: var(--primary);
  background-color: var(--primary-tint);
}

.search-icon-badge {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  padding: 0.5rem 1.75rem 0.5rem 0;
  outline: none;
}

.search-input-wrap input::placeholder {
  color: #9CA3AF;
}

.clear-search-btn {
  position: absolute;
  right: 0.2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.search-scope-block {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-left: 2px solid var(--border-light);
  padding-left: 0.6rem;
}

.scope-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.search-scope-select {
  border: 1px solid var(--border-light);
  background-color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

.shortcut-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background-color: var(--bg-muted);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  user-select: none;
}

/* ==========================================================================
   SIDEBAR (Desktop & Mobile Drawer - Decoupled Filters)
   ========================================================================== */
.sidebar-drawer {
  width: 340px;
  min-width: 340px;
  background-color: var(--bg-muted);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  margin: 1.5rem 0 1.5rem 1.5rem;
  z-index: 20;
}

.sidebar-header {
  padding: 1.25rem;
  border-bottom: 2px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-muted);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.sidebar-heading {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.sidebar-subheading {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close-drawer {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-main);
  cursor: pointer;
}

.sidebar-scrollable {
  padding: 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.filter-block {
  margin-bottom: 1.35rem;
}

.block-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.block-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.multi-hint {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Form selects */
.form-select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background-color: #FFFFFF;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.form-select:focus {
  border-color: var(--primary);
}

/* Segmented Category Buttons */
.flat-segmented-control {
  display: flex;
  background-color: #E5E7EB;
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.flat-segment {
  flex: 1;
  padding: 0.5rem 0.25rem;
  border: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.flat-segment.active {
  background-color: var(--primary);
  color: #FFFFFF;
}

/* Multi-select Tech Tag Pills */
.tech-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tech-tag-pill {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #FFFFFF;
  color: var(--text-main);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.tech-tag-pill:hover {
  background-color: #E5E7EB;
}

.tech-tag-pill.active {
  background-color: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

/* Checkbox Stack */
.checkbox-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.flat-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.flat-checkbox-label input[type="checkbox"] {
  display: none;
}

.flat-checkbox {
  width: 18px;
  height: 18px;
  background-color: #FFFFFF;
  border: 2px solid #D1D5DB;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.flat-checkbox-label input[type="checkbox"]:checked + .flat-checkbox,
.flat-table input[type="checkbox"]:checked + .flat-checkbox {
  background-color: var(--primary);
  border-color: var(--primary);
}

.flat-checkbox-label input[type="checkbox"]:checked + .flat-checkbox::after,
.flat-table input[type="checkbox"]:checked + .flat-checkbox::after {
  content: "✓";
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 900;
}

.sidebar-apply-mobile {
  display: none;
  margin-top: 1rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  min-height: 44px;
}

.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: scale(1.03);
}

.btn-secondary {
  background-color: var(--bg-muted);
  color: var(--text-main);
}
.btn-secondary:hover {
  background-color: #E5E7EB;
  transform: scale(1.03);
}

.btn-outline {
  background-color: transparent;
  border: 3px solid var(--text-main);
  color: var(--text-main);
}
.btn-outline:hover {
  background-color: var(--text-main);
  color: #FFFFFF;
  transform: scale(1.03);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  min-height: 32px;
}

.btn-block {
  width: 100%;
}

.btn-text-bold {
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.btn-text-bold:hover {
  text-decoration: underline;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-body {
  flex: 1;
  padding: 1.5rem 2rem;
  min-width: 0;
}

.desktop-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-light);
}

.search-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.summary-count {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-main);
}

.summary-count strong {
  font-weight: 800;
  color: var(--primary);
}

.edition-pill {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  background-color: var(--accent-tint);
  color: var(--accent-text);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* Export Dropdown */
.export-dropdown {
  position: relative;
}

.flat-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background-color: #FFFFFF;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-md);
  width: 280px;
  max-width: calc(100vw - 2rem);
  padding: 0.5rem;
  display: none;
  z-index: 100;
}

.flat-dropdown-menu.show {
  display: block;
}

.dropdown-header {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
}

.dropdown-item:hover {
  background-color: var(--primary-tint);
  color: var(--primary);
}

.item-badge-icon {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  background-color: var(--bg-muted);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
}

.dropdown-separator {
  height: 2px;
  background-color: var(--border-light);
  margin: 0.4rem 0;
}

/* Active Chips */
.active-chips-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  background-color: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

.chips-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.flat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.chip-x {
  cursor: pointer;
  font-weight: 800;
  color: var(--danger);
}

.btn-clear-all {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--danger);
  cursor: pointer;
  text-transform: uppercase;
}

/* Sub Toolbar */
.sub-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.view-toggle-block {
  display: flex;
  background-color: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 2px;
}

.view-pill {
  padding: 0.35rem 0.75rem;
  border: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.view-pill.active {
  background-color: #FFFFFF;
  color: var(--text-main);
}

/* ==========================================================================
   CARDS GRID (Color Block Architecture)
   ========================================================================== */
.flat-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.25rem;
}

.flat-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  border: 2px solid transparent;
  transition: transform 0.2s, background-color 0.2s, border-color 0.2s;
  cursor: pointer;
}

.flat-card:hover {
  background-color: var(--bg-card-hover);
  transform: scale(1.02);
  border-color: var(--primary);
}

.flat-card.selected {
  border-color: var(--primary);
  background-color: var(--primary-tint);
}

.card-header-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.color-badge {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.badge-software {
  background-color: var(--secondary);
  color: #FFFFFF;
}

.badge-hardware {
  background-color: var(--accent);
  color: var(--text-dark);
}

.mono-id-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
}

.theme-tag-flat {
  font-size: 0.7rem;
  font-weight: 600;
  background-color: var(--primary-tint);
  color: var(--primary-text);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.year-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  background-color: var(--bg-dark);
  color: #FFFFFF;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.card-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.star-btn {
  background: none;
  border: none;
  font-size: 1.15rem;
  line-height: 1;
  color: #D1D5DB;
  cursor: pointer;
  transition: color 0.15s;
}

.star-btn.favorited {
  color: var(--accent);
}

.card-heading {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.card-org-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.card-body-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
  flex: 1;
}

.card-bottom-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 2px solid var(--border-light);
  margin-top: auto;
}

.meta-tags-row {
  display: flex;
  gap: 0.35rem;
}

.meta-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

.meta-pill.active-pill {
  background-color: var(--primary-tint);
  border-color: var(--primary);
  color: var(--primary-text);
}

/* ==========================================================================
   TABLE VIEW
   ========================================================================= */
.flat-table-wrapper {
  background-color: #FFFFFF;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.flat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.flat-table th {
  background-color: var(--bg-muted);
  padding: 0.85rem 1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 2px solid var(--border-light);
}

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

.flat-table tr:hover {
  background-color: var(--bg-card-hover);
}

mark {
  background-color: var(--accent);
  color: var(--text-dark);
  padding: 0 3px;
  font-weight: 700;
}

/* Empty State */
.flat-empty-card {
  text-align: center;
  padding: 4rem 2rem;
  background-color: var(--bg-muted);
  border-radius: var(--radius-lg);
  margin-top: 1rem;
}

.empty-graphic {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.empty-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.empty-text {
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto 1.5rem auto;
  font-size: 0.9rem;
}

/* ==========================================================================
   FOOTER & DISCLAIMER (Clean Unobtrusive Block)
   ========================================================================== */
.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
}

.footer-card {
  background-color: var(--bg-muted);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.footer-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #E5E7EB;
}

.footer-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  display: block;
}

.footer-edition {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: underline;
}

.footer-disclaimer p {
  font-size: 0.78rem;
  line-height: 1.6;
  color: #6B7280;
}

.footer-disclaimer strong {
  color: var(--text-main);
}

.footer-disclaimer a {
  color: var(--primary);
}

/* ==========================================================================
   MODAL DIALOG (Flat High-Contrast)
   ========================================================================== */
.flat-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 24, 39, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.flat-modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.flat-modal-card {
  background-color: #FFFFFF;
  border: 3px solid var(--border-dark);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 880px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-top {
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-muted);
}

.modal-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-close-cross {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-main);
  cursor: pointer;
  padding: 0 4px;
}

.modal-scroll-area {
  padding: 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.modal-main-heading {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 1.25rem;
}

/* Info Matrix */
.info-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  background-color: var(--bg-muted);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.info-cell {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.info-data {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Flat Tabs */
.flat-tabs-nav {
  display: flex;
  background-color: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.flat-tab-btn {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: all var(--transition-fast);
}

.flat-tab-btn:hover:not(.active) {
  color: var(--text-dark);
  background-color: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .flat-tab-btn:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.05);
}

.flat-tab-btn.active {
  background-color: var(--primary);
  color: #FFFFFF;
}

.flat-tab-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.flat-tab-action-btn:hover {
  background-color: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.flat-tab-action-btn:active {
  transform: scale(0.97);
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

.flat-prose {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-main);
}

.flat-prose strong {
  font-weight: 800;
  color: var(--text-dark);
}

.flat-prose p,
.section-content p,
.prose-p {
  margin-bottom: 0.85rem;
}

.flat-prose p:last-child,
.section-content p:last-child,
.prose-p:last-child {
  margin-bottom: 0;
}

.flat-prose ul,
.section-content ul,
.prose-ul {
  margin: 0.4rem 0 0.85rem 1.25rem;
  padding-left: 0.5rem;
  list-style-type: disc;
}

.flat-prose ol,
.section-content ol {
  margin: 0.4rem 0 0.85rem 1.25rem;
  padding-left: 0.5rem;
}

.flat-prose li,
.section-content li,
.prose-li {
  margin-bottom: 0.3rem;
  line-height: 1.55;
}

.flat-prose ul ul,
.section-content ul ul,
.prose-sub-ul {
  margin: 0.3rem 0 0.6rem 1.25rem;
  padding-left: 0.5rem;
  list-style-type: circle;
}

.flat-prose ul ul li,
.section-content ul ul li,
.prose-sub-li {
  margin-bottom: 0.25rem;
  line-height: 1.5;
  color: var(--text-main);
}

.sections-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-flat-box {
  background-color: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.section-flat-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.section-flat-content {
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.content-block {
  margin-bottom: 1.25rem;
}

.block-heading {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.flat-callout {
  background-color: var(--bg-muted);
  border-left: 4px solid var(--primary);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.flat-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.flat-links-list a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  word-break: break-all;
}

.json-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.json-schema-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.flat-code-block {
  background-color: var(--bg-dark);
  color: #A7F3D0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  max-height: 380px;
  overflow: auto;
}

.modal-bottom-bar {
  padding: 1rem 1.5rem;
  border-top: 2px solid var(--border-light);
  background-color: var(--bg-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.modal-bottom-left,
.modal-bottom-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.flat-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 200;
}

.flat-toast {
  background-color: var(--bg-dark);
  color: #FFFFFF;
  border: 2px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideToast 0.2s ease-out;
}

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

/* ==========================================================================
   RESPONSIVE DESIGN (Mobile First Optimizations)
   ========================================================================== */
@media (max-width: 960px) {
  .hero-banner {
    padding: 1.75rem 1rem;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }

  .hero-right-col {
    width: 100%;
    align-items: flex-start;
  }

  .btn-github {
    display: none;
  }
  
  .hero-stats {
    width: 100%;
    justify-content: space-between;
  }
  
  .stat-box {
    flex: 1;
    min-width: 90px;
    padding: 0.6rem 0.8rem;
  }
  
  .stat-number {
    font-size: 1.35rem;
  }

  .mobile-action-bar {
    display: flex;
  }

  .desktop-top-bar {
    display: none;
  }

  .search-command-bar {
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
  }

  .search-input-wrap {
    width: 100%;
    order: 1;
  }

  .search-icon-badge {
    order: 0;
  }

  .shortcut-pill {
    display: none;
  }

  .search-scope-block {
    order: 2;
    border-left: none;
    padding-left: 0;
    margin-top: 0.35rem;
    width: 100%;
    justify-content: flex-end;
  }

  /* Slide-in Drawer on Mobile */
  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.6);
    z-index: 40;
    display: none;
  }
  
  .sidebar-backdrop.show {
    display: block;
  }

  .sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 360px;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease-in-out;
    border-right: 3px solid var(--border-dark);
  }

  .sidebar-drawer.open {
    transform: translateX(0);
  }

  .btn-close-drawer {
    display: block;
  }

  .sidebar-apply-mobile {
    display: block;
  }

  .main-body {
    padding: 1rem;
  }

  .flat-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .flat-modal-backdrop {
    padding: 0.75rem;
  }

  .flat-modal-card {
    max-height: 94vh;
  }
  
  .modal-top {
    padding: 1rem;
  }
  
  .modal-scroll-area {
    padding: 1rem;
  }
  
  .modal-main-heading {
    font-size: 1.15rem;
  }
  
  .modal-bottom-bar {
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .modal-bottom-left,
  .modal-bottom-right {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }
  
  .modal-bottom-left .btn,
  .modal-bottom-right .btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.5rem 0.6rem;
    justify-content: center;
  }
}
