/* ============================================================
   SMART AGRICULTURE DSS — Unified Research-Grade Design System
   Both Pages: Light Academic Theme (IEEE/ACM Professional)
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-warm: #f1f5f9;
  --text: #1a1a2e;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #1e40af;
  --accent-light: #3b82f6;
  --accent-bg: #eff6ff;
  --border: #d1d5db;
  --border-light: #e5e7eb;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  --radius: 6px;
  --radius-lg: 8px;
  --transition: 0.2s ease;
  --max-width: 1100px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
}

html { scroll-behavior: smooth; font-size: 16px; }
img { max-width: 100%; height: auto; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); text-decoration: underline; }

h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; border-bottom: 2px solid var(--text); padding-bottom: 0.4rem; margin-bottom: 1.25rem; }
h3 { font-size: 1.05rem; margin-bottom: 0.75rem; }
h4 { font-size: 0.95rem; margin-bottom: 0.5rem; }
p { margin-bottom: 0.85rem; font-size: 0.93rem; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; position: relative; }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.hamburger span { display: block; width: 18px; height: 1.5px; background: var(--text-secondary); margin: 4px 0; transition: var(--transition); }


/* ============================================================
   SHARED NAVBAR
   ============================================================ */

.research-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}
.research-navbar .container {
  display: flex; align-items: center; justify-content: space-between; height: 52px;
}
.research-nav-brand { font-weight: 700; font-size: 0.95rem; color: var(--text); text-decoration: none; }
.research-nav-brand:hover { text-decoration: none; }
.research-nav-brand span { color: var(--accent); }
.research-nav-links { display: flex; gap: 1.5rem; }
.research-nav-links a { color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; text-decoration: none; }
.research-nav-links a:hover, .research-nav-links a.active { color: var(--accent); text-decoration: none; }


/* ============================================================
   RESEARCH HEADER (Paper Title / Author)
   ============================================================ */

.research-header {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  max-width: 800px;
  margin: 0 auto;
}
.research-header h1 { font-size: 1.5rem; margin-bottom: 1rem; line-height: 1.4; }
.research-header .author {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.research-header .affiliation {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}
.research-header .course-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-top: 0.75rem;
  letter-spacing: 0.02em;
}


/* ============================================================
   RESEARCH CONTENT (About page sections)
   ============================================================ */

.research-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.research-content p { text-align: justify; }

.research-section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border-light);
}
.research-section:last-child { border-bottom: none; }
.section-number {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-right: 0.5rem;
}
.subsection-number {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-right: 0.4rem;
}


/* ============================================================
   APPLICATION PAGE — Hero & Layout
   ============================================================ */

.app-hero {
  text-align: center;
  padding: 3.5rem 1.5rem 2.5rem;
  border-bottom: 1px solid var(--border);
  max-width: 800px;
  margin: 0 auto;
}
.app-hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.2rem 0.7rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}
.app-hero h1 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  color: var(--text);
}
.app-hero > .container > p,
.app-hero > p {
  font-size: 0.93rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 1.75rem;
  line-height: 1.7;
}
.app-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.app-hero-cta:hover { background: var(--accent-light); color: #fff; text-decoration: none; }
.app-hero-cta svg { width: 14px; height: 14px; }

/* Stats Bar */
.app-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.app-stat {
  flex: 1;
  padding: 1rem 0.75rem;
  background: var(--bg-alt);
  text-align: center;
  border-right: 1px solid var(--border-light);
}
.app-stat:last-child { border-right: none; }
.app-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.app-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.1rem;
}

/* App Sections */
.app-section { padding: 3rem 0; }
.app-section-header { text-align: center; margin-bottom: 2.5rem; }
.app-section-header h2 { border-bottom: none; padding-bottom: 0; margin-bottom: 0.5rem; }
.app-section-header p { color: var(--text-secondary); font-size: 0.93rem; max-width: 550px; margin: 0 auto; text-align: center; }
.app-divider { border: none; border-top: 1px solid var(--border-light); margin: 0; }


/* ============================================================
   TABS (Application Dashboard)
   ============================================================ */

.app-tabs-wrapper { text-align: center; }
.app-tabs {
  display: inline-flex;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 3px;
  border: 1px solid var(--border);
  margin: 0 auto 2rem;
}
.app-tab-btn {
  padding: 0.5rem 1.15rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.83rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
}
.app-tab-btn:hover { color: var(--text-secondary); }
.app-tab-btn.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-weight: 600;
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }


/* ============================================================
   MODULE LAYOUT (Two-panel dashboard)
   ============================================================ */

.module-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.module-panel {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.module-panel h3, .module-result h3, .module-result h4 { margin-bottom: 1rem; font-size: 1rem; border-bottom: none; padding-bottom: 0; }
.module-result {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  min-height: 420px;
}


/* ============================================================
   FORMS (Light Academic)
   ============================================================ */

.form-group { margin-bottom: 0.9rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
  letter-spacing: 0.01em;
}
.form-input, .form-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: var(--font);
  transition: all var(--transition);
  background: #fff;
  color: var(--text);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30,64,175,0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.btn-primary {
  display: block;
  width: 100%;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: var(--font);
  text-align: center;
  background: var(--accent);
  color: #fff;
  margin-top: 0.25rem;
}
.btn-primary:hover { background: var(--accent-light); }

/* Keep .btn-saas as alias for backward compat with JS */
.btn-saas {
  display: block;
  width: 100%;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: var(--font);
  text-align: center;
  background: var(--accent);
  color: #fff;
  margin-top: 0.25rem;
}
.btn-saas:hover { background: var(--accent-light); }


/* ============================================================
   UPLOAD AREA
   ============================================================ */

.upload-area {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 1rem;
  background: #fff;
}
.upload-area:hover, .upload-area.dragover { border-color: var(--accent); background: var(--accent-bg); }
.upload-icon { font-size: 1.75rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.upload-text { font-size: 0.85rem; color: var(--text-muted); }
.upload-text strong { color: var(--accent); }

.sample-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin-top: 0.75rem; }
.sample-img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  opacity: 0.75;
}
.sample-img:hover { border-color: var(--accent); opacity: 1; transform: scale(1.03); }


/* ============================================================
   MODEL STATUS
   ============================================================ */

.model-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  margin-top: 0.75rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}
.model-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.model-status-dot.loading { background: var(--amber); animation: pulse 1s infinite; }
.model-status-dot.ready { background: var(--green); }
.model-status-dot.error { background: var(--red); }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:0.3} }


/* ============================================================
   DISEASE RESULT
   ============================================================ */

.disease-result { text-align: center; }
.disease-image-container {
  position: relative;
  display: inline-block;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.disease-image-container img { max-height: 280px; border-radius: var(--radius-lg); }
.disease-overlay {
  position: absolute; inset: 0;
  border: 3px solid transparent;
  border-radius: var(--radius-lg);
  pointer-events: none;
}
.disease-overlay.disease { border-color: var(--red); box-shadow: inset 0 0 40px rgba(220,38,38,0.08); }
.disease-overlay.healthy { border-color: var(--green); box-shadow: inset 0 0 40px rgba(22,163,74,0.08); }
.disease-name { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.6rem; }
.disease-name.disease { color: var(--red); }
.disease-name.healthy { color: var(--green); }

.confidence-bar-container {
  background: var(--bg-warm);
  border-radius: 100px;
  height: 22px;
  overflow: hidden;
  margin-bottom: 0.4rem;
  border: 1px solid var(--border-light);
}
.confidence-bar {
  height: 100%;
  border-radius: 100px;
  transition: width 0.8s ease;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 0.7rem;
  font-size: 0.72rem; font-weight: 700; color: #fff;
}
.confidence-bar.high { background: linear-gradient(90deg, #16a34a, #22c55e); }
.confidence-bar.medium { background: linear-gradient(90deg, #d97706, #f59e0b); }
.confidence-bar.low { background: linear-gradient(90deg, #dc2626, #ef4444); }

.treatment-box {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
  text-align: left;
}
.treatment-box h4 { font-size: 0.8rem; color: var(--amber); margin-bottom: 0.4rem; font-weight: 600; border-bottom: none; padding-bottom: 0; }
.treatment-box p { font-size: 0.83rem; color: var(--text-secondary); margin: 0; line-height: 1.5; text-align: left; }


/* ============================================================
   SOIL ANALYSIS BARS
   ============================================================ */

.soil-bar-group { margin-bottom: 1.1rem; }
.soil-bar-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.25rem; gap: 0.5rem; flex-wrap: wrap; }
.soil-bar-label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.soil-bar-value { font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.soil-bar-track {
  background: var(--bg-warm);
  border-radius: 6px;
  height: 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.soil-bar-fill { height: 100%; border-radius: 6px; transition: width 0.6s ease; position: absolute; top: 0; left: 0; }
.soil-bar-threshold { position: absolute; top: 0; width: 1.5px; height: 100%; background: var(--text); opacity: 0.3; }

.soil-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.soil-status.optimal { background: var(--green-bg); color: var(--green); }
.soil-status.deficient { background: var(--amber-bg); color: var(--amber); }
.soil-status.excess { background: var(--red-bg); color: var(--red); }


/* ============================================================
   CROP RECOMMENDATION CARDS
   ============================================================ */

.crop-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-bottom: 0.75rem;
  transition: all var(--transition);
}
.crop-card:hover { border-color: var(--accent); }
.crop-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.crop-rank {
  font-size: 0.75rem; font-weight: 700;
  background: var(--accent);
  color: #fff;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.crop-name { font-weight: 600; font-size: 1rem; text-transform: capitalize; color: var(--text); }
.crop-match { font-size: 0.85rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.crop-compare-row { display: flex; align-items: center; margin-bottom: 0.4rem; font-size: 0.78rem; }
.crop-compare-label { width: 85px; flex-shrink: 0; color: var(--text-muted); font-weight: 500; }
.crop-compare-bars { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.crop-compare-bar { height: 8px; border-radius: 4px; transition: width 0.6s ease; }
.crop-compare-bar.yours { background: var(--accent); opacity: 0.85; }
.crop-compare-bar.ideal { background: var(--text-muted); opacity: 0.25; }
.crop-compare-value { width: 72px; flex-shrink: 0; text-align: right; font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }


/* ============================================================
   CHART CONTAINERS
   ============================================================ */

.chart-container {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.chart-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.2rem; color: var(--text); }
.chart-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }
.chart-canvas-wrapper { position: relative; width: 100%; overflow: hidden; }
.chart-canvas-wrapper canvas { display: block; width: 100%; }
.chart-caption {
  margin-top: 1rem; padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem; color: var(--text-muted); line-height: 1.6;
}
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }

.chart-tooltip {
  position: fixed;
  background: var(--text);
  color: #fff;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.78rem;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.12s ease;
  max-width: 250px;
  line-height: 1.4;
}
.chart-tooltip.visible { opacity: 1; }


/* ============================================================
   PLACEHOLDER & SPINNER
   ============================================================ */

.placeholder-state { text-align: center; padding: 3rem 2rem; color: var(--text-muted); }
.placeholder-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.3; }
.placeholder-text { font-size: 0.9rem; line-height: 1.6; }

.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem; gap: 0.75rem; color: var(--text-muted); font-size: 0.88rem;
}


/* ============================================================
   APPLICATION FOOTER
   ============================================================ */

.app-footer {
  background: var(--text);
  color: #94a3b8;
  padding: 2rem 0;
  font-size: 0.8rem;
  margin-top: 2rem;
}
.app-footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.app-footer-brand { font-weight: 600; color: #fff; font-size: 0.9rem; margin-bottom: 0.2rem; }
.app-footer p { font-size: 0.8rem; color: #94a3b8; margin-bottom: 0.2rem; }
.app-footer a { color: #94a3b8; text-decoration: none; }
.app-footer a:hover { color: #fff; text-decoration: none; }
.app-footer-links { display: flex; gap: 1.25rem; }


/* ============================================================
   IEEE TABLES (Research)
   ============================================================ */

.ieee-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 1.25rem 0;
}
.ieee-table caption {
  caption-side: top;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.ieee-table thead th {
  background: var(--text);
  color: #fff;
  padding: 0.55rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.ieee-table tbody td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  font-size: 0.85rem;
  line-height: 1.5;
}
.ieee-table tbody tr:hover { background: var(--bg-alt); }
.ieee-table tbody td:first-child { font-weight: 500; }

.challenges-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; margin: 0.75rem 0; }
.challenges-table th { background: var(--bg-alt); padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border); }
.challenges-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border-light); vertical-align: top; }


/* ============================================================
   RESEARCH DIAGRAMS (Architecture, Model Flow)
   ============================================================ */

.research-diagram {
  background: #0f172a;
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  color: #e2e8f0;
  margin: 1.5rem 0;
  overflow-x: auto;
}
.arch-layer {
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  position: relative;
}
.arch-layer:hover { border-color: #3b82f6; }
.arch-layer:last-child { margin-bottom: 0; }
.arch-layer-tag {
  position: absolute;
  top: -9px; left: 14px;
  background: #0f172a;
  padding: 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3b82f6;
}
.arch-layer-content { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.arch-box {
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  font-size: 0.78rem;
  text-align: center;
  cursor: default;
  transition: all 0.2s ease;
  position: relative;
}
.arch-box:hover { border-color: #3b82f6; background: #273347; }
.arch-box .arch-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: var(--text);
  padding: 0.6rem;
  border-radius: 6px;
  font-size: 0.76rem;
  width: 200px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10;
  line-height: 1.4;
  text-align: left;
}
.arch-box:hover .arch-tooltip { display: block; }
.arch-arrow { text-align: center; color: #475569; font-size: 1rem; margin: -0.3rem 0; letter-spacing: 0.3em; }

/* Model Flow Diagram */
.model-flow {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 1.25rem;
  margin: 1rem 0;
}
.model-block {
  background: #fff;
  border: 2px solid var(--border-light);
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.4rem;
  text-align: center;
}
.model-block:hover { border-color: var(--accent); }
.model-block.frozen { border-color: #94a3b8; background: var(--bg-warm); }
.model-block.trainable { border-color: var(--accent); background: var(--accent-bg); }
.model-block-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
}
.model-block-label.frozen { color: var(--text-muted); }
.model-block-label.trainable { color: var(--accent); }
.model-arrow { text-align: center; color: #94a3b8; font-size: 1.1rem; margin: 0.15rem 0; }


/* ============================================================
   RESEARCH GRIDS & CARDS
   ============================================================ */

.research-grid { display: grid; gap: 1rem; margin: 1rem 0; }
.research-grid-2 { grid-template-columns: 1fr 1fr; }
.research-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.research-card {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 1rem;
}
.research-card-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 0.2rem; }
.research-card-role { font-size: 0.78rem; color: var(--accent); font-weight: 600; margin-bottom: 0.3rem; }
.research-card-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; text-align: left; }

.research-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }


/* ============================================================
   PIPELINE (Workflow steps)
   ============================================================ */

.pipeline { margin-bottom: 1.5rem; }
.pipeline-label {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); margin-bottom: 0.6rem;
}
.pipeline-steps { display: flex; gap: 0; overflow-x: auto; padding-bottom: 0.5rem; }
.pipeline-step {
  background: #fff;
  border: 1px solid var(--border-light);
  padding: 0.5rem 0.8rem;
  font-size: 0.78rem;
  white-space: nowrap;
  position: relative;
  flex-shrink: 0;
}
.pipeline-step:first-child { border-radius: 6px 0 0 6px; }
.pipeline-step:last-child { border-radius: 0 6px 6px 0; }
.pipeline-step:hover { background: var(--accent-bg); border-color: var(--accent); z-index: 1; }
.pipeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -7px; top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 7px solid var(--border-light);
  z-index: 2;
}


/* ============================================================
   FAQ (Accordion)
   ============================================================ */

.faq-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.faq-item {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  margin-bottom: 0.4rem;
  overflow: hidden;
}
.faq-question {
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}
.faq-question:hover { background: var(--bg-alt); }
.faq-question::after { content: '+'; font-size: 1rem; color: var(--text-secondary); flex-shrink: 0; margin-left: 0.5rem; }
.faq-item.open .faq-question::after { content: '\2212'; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item.open .faq-answer { max-height: 500px; padding: 0 0.85rem 0.65rem; }
.faq-answer p { font-size: 0.83rem; color: var(--text-secondary); margin: 0; text-align: left; }


/* ============================================================
   USE CASES
   ============================================================ */

.usecase-card { border-left: 3px solid var(--accent); background: var(--bg-alt); border-radius: 0 6px 6px 0; padding: 1rem; margin-bottom: 0.75rem; }
.usecase-scenario { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; color: var(--text); }
.usecase-response { font-size: 0.83rem; color: var(--text-secondary); margin-bottom: 0.3rem; text-align: left; }
.usecase-module {
  display: inline-block;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}


/* ============================================================
   TIMELINE (Future Roadmap)
   ============================================================ */

.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--border-light); }
.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.75rem; top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
}
.timeline-title { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.timeline-desc { font-size: 0.83rem; color: var(--text-secondary); text-align: left; }
.timeline-tag { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; color: var(--accent); letter-spacing: 0.05em; }


/* ============================================================
   RESEARCH FOOTER
   ============================================================ */

.research-footer {
  background: var(--text);
  color: #94a3b8;
  padding: 2rem 0;
  font-size: 0.8rem;
  margin-top: 2rem;
}
.research-footer-content { max-width: 820px; margin: 0 auto; padding: 0 1.5rem; }
.research-footer strong { color: #fff; }
.research-footer a { color: #94a3b8; text-decoration: none; }
.research-footer a:hover { color: #fff; text-decoration: none; }


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .module-layout { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 1fr; }
  .faq-columns { grid-template-columns: 1fr; }
  .research-two-col { grid-template-columns: 1fr; }
  .research-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .app-hero h1 { font-size: 1.25rem; }
  .app-stats { flex-direction: column; max-width: 280px; }
  .app-section { padding: 2rem 0; }
  .research-nav-links { display: none; }
  .research-nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 52px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem; gap: 0.5rem;
  }
  .hamburger { display: block; }
  .research-grid-2, .research-grid-3 { grid-template-columns: 1fr; }
  .pipeline-steps { flex-wrap: wrap; }
  .pipeline-step { border-radius: 6px !important; }
  .pipeline-step:not(:last-child)::after { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .research-header h1 { font-size: 1.25rem; }
}
@media (max-width: 480px) {
  .app-hero h1 { font-size: 1.1rem; }
  .app-tabs { flex-direction: column; }
  .sample-grid { grid-template-columns: repeat(2, 1fr); }
}
