/* ============================================================
   GreenSort — Global Styles & Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

/* ---------- CSS Variables ----------------------------------- */
:root {
  --bg-primary:      #080e1a;
  --bg-secondary:    #0d172a;
  --bg-card:         rgba(15, 23, 42, 0.7);
  --bg-card-hover:   rgba(30, 41, 59, 0.8);
  --border:          rgba(255, 255, 255, 0.08);
  --border-focus:    rgba(34, 197, 94, 0.45);

  --green:           #10b981;
  --green-glow:      rgba(16, 185, 129, 0.25);
  --green-dim:       #059669;
  --green-soft:      rgba(16, 185, 129, 0.12);

  --cyan:            #06b6d4;
  --cyan-glow:       rgba(6, 182, 212, 0.25);
  --cyan-dim:        #0891b2;
  --cyan-soft:       rgba(6, 182, 212, 0.12);

  --emerald:         #059669;
  --red:             #ef4444;
  --red-soft:        rgba(239, 68, 68, 0.12);
  --amber:           #f59e0b;
  --amber-soft:      rgba(245, 158, 11, 0.12);

  --text-primary:    #f8fafc;
  --text-secondary:  #94a3b8;
  --text-muted:      #64748b;

  --radius-sm:       8px;
  --radius-md:       14px;
  --radius-lg:       20px;
  --radius-xl:       28px;

  --shadow-card:     0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow:     0 0 40px rgba(16, 185, 129, 0.15);
  --transition:      0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Animated background gradient mesh */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 15% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 85% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(15, 23, 42, 0.5) 0%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Layout ------------------------------------------ */
.page-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Header ------------------------------------------ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 3.5rem);
  height: 74px;
  background: rgba(8, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #34d399, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: #34d399;
  background: var(--green-soft);
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background var(--transition), box-shadow var(--transition);
}

.status-dot.online  {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.status-dot.offline {
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}

.api-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}

.api-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* ---------- Main Container ---------------------------------- */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: clamp(2rem, 5vh, 4rem) clamp(1rem, 4vw, 2.5rem);
}

.container {
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* ---------- Hero Section ------------------------------------ */
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 6px 16px;
  border-radius: 30px;
  letter-spacing: 0.01em;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero h1 span {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  max-width: 700px;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero-desc strong {
  color: var(--text-primary);
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  width: 100%;
  margin-top: 1rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), border-color var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
  font-size: 1.5rem;
}

.stat-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ---------- KPI Grid (Analytics & Architecture) ------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  width: 100%;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), border-color var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.kpi-card.highlight-green {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.kpi-card.highlight-cyan {
  border-color: rgba(6, 182, 212, 0.35);
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.08) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.kpi-card.highlight-green .kpi-value {
  color: #34d399;
}

.kpi-card.highlight-cyan .kpi-value {
  color: #38bdf8;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Quote Card */
.quote-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.75rem;
  box-shadow: var(--shadow-card);
}

.quote-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.quote-text {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.quote-text strong {
  color: var(--text-primary);
}

/* Panel Card */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-card);
}

.panel-card.highlight-border {
  border-color: rgba(16, 185, 129, 0.3);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.panel-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-tag {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
}

.panel-title-wrap h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sample-pill {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.analytics-grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.75rem;
  width: 100%;
  min-width: 0;
}

/* ---------- Confusion Matrix -------------------------------- */
.matrix-container {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 1rem);
  margin: 0.5rem 0;
  width: 100%;
  min-width: 0;
}

.matrix-axis-y {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.matrix-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.matrix-axis-x {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.matrix-grid {
  display: grid;
  grid-template-columns: minmax(65px, 85px) 1fr 1fr;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.matrix-corner {
  background: transparent;
}

.matrix-header-col {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 4px 2px;
  line-height: 1.25;
  min-width: 0;
}

.matrix-header-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 4px 2px;
  line-height: 1.25;
  min-width: 0;
}

.matrix-cell {
  border-radius: var(--radius-md);
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--border);
  transition: transform var(--transition);
  min-width: 0;
  text-align: center;
}

.matrix-cell:hover {
  transform: scale(1.02);
}

.matrix-cell.true-pos {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.5);
}

.matrix-cell.true-neg {
  background: rgba(6, 182, 212, 0.22);
  border-color: rgba(6, 182, 212, 0.5);
}

.matrix-cell.false-pos, .matrix-cell.false-neg {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.matrix-num {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.15rem, 3.5vw, 1.4rem);
  font-weight: 800;
  line-height: 1.1;
}

.true-pos .matrix-num { color: #34d399; }
.true-neg .matrix-num { color: #38bdf8; }
.false-pos .matrix-num, .false-neg .matrix-num { color: #fca5a5; }

.matrix-sub {
  font-size: clamp(0.65rem, 1.8vw, 0.72rem);
  color: var(--text-secondary);
  line-height: 1.2;
}

.matrix-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.summary-stat-label {
  color: var(--text-muted);
}

.summary-stat-val {
  font-weight: 700;
}

/* ---------- Metrics Table ----------------------------------- */
.table-responsive {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  box-sizing: border-box;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
  min-width: 440px;
}

.metrics-table th {
  padding: 10px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.metrics-table td {
  padding: 10px 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.metrics-table td:first-child,
.metrics-table th:first-child {
  white-space: nowrap;
}

.metrics-table.compact td {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.num-cell {
  text-align: right;
  font-family: 'Outfit', monospace, sans-serif;
}

.class-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.class-dot.organic { background: var(--green); }
.class-dot.recyclable { background: var(--cyan); }

.table-divider-row td {
  border-top: 1px solid var(--border);
}

.table-total-row td {
  border-top: 2px solid var(--border);
  color: var(--text-primary);
  font-weight: 600;
}

.highlight-row td {
  background: rgba(16, 185, 129, 0.07);
}

.stage-row td {
  background: rgba(255, 255, 255, 0.02);
}

.status-chip {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.status-chip.best {
  background: var(--green-soft);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 700;
}

.class-insights {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.class-insights strong {
  color: var(--text-primary);
}

.text-green { color: #34d399; }
.text-cyan { color: #38bdf8; }
.text-red { color: #f87171; }
.font-bold { font-weight: 700; }

/* ---------- Dataset Distribution ---------------------------- */
.dataset-distribution-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  width: 100%;
  min-width: 0;
}

.distribution-box {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.distribution-box h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.distribution-box p {
  word-break: normal;
  overflow-wrap: break-word;
}

.bar-stack {
  display: flex;
  width: 100%;
  max-width: 100%;
  height: 28px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 28px;
  box-sizing: border-box;
}

.bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1;
  box-sizing: border-box;
  padding: 0;
}

.bar-segment.train-seg { flex: 72 0 72%; width: 72%; background: var(--green-dim); }
.bar-segment.val-seg { flex: 18 0 18%; width: 18%; background: var(--cyan-dim); }
.bar-segment.test-seg { flex: 10 0 10%; width: 10%; background: #6366f1; }

.bar-stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.legend-dot.train-dot { background: var(--green-dim); }
.legend-dot.val-dot { background: var(--cyan-dim); }
.legend-dot.test-dot { background: #6366f1; }

.balance-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.balance-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.balance-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 600;
}

.balance-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.balance-fill.organic {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
}

.balance-fill.recyclable {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #38bdf8);
}

.tensor-info-card {
  background: rgba(13, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.tensor-info-card h5 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tensor-info-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.tensor-info-card code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: #38bdf8;
  word-break: break-all;
}

.convergence-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
  width: 100%;
}

.conv-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.conv-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.conv-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
}

/* ---------- Comparison Grid (Architecture) ------------------ */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.comparison-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid var(--border);
}

.comparison-card.bad {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.04) 0%, rgba(15, 23, 42, 0.4) 100%);
}

.comparison-card.good {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.06) 0%, rgba(15, 23, 42, 0.4) 100%);
}

.comp-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
}

.comp-badge.bad {
  background: var(--red-soft);
  color: #fca5a5;
}

.comp-badge.good {
  background: var(--green-soft);
  color: #34d399;
}

.comparison-card h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.comparison-card p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.param-callout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin: 0.25rem 0;
}

.param-callout.bad {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.param-callout.good {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.comp-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.comp-list li::before {
  content: "• ";
  color: var(--text-muted);
}

/* Specs List & Pipeline Flow */
.specs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.spec-name {
  color: var(--text-muted);
  font-weight: 500;
}

.spec-value {
  font-family: 'Outfit', monospace, sans-serif;
  font-weight: 700;
  color: var(--text-primary);
}

.pipeline-flow {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pipeline-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.p-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cyan-soft);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.p-text {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.p-text strong {
  color: var(--text-primary);
}

.p-text code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  color: #38bdf8;
}

/* ---------- Batch Scanner Styles ---------------------------- */
.batch-staging-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  width: 100%;
}

.staging-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.staging-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.staging-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.staging-remove:hover {
  background: var(--red);
}

.staging-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75);
  font-size: 0.65rem;
  color: #fff;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.batch-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.summary-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.summary-pill.organic {
  border-color: rgba(16, 185, 129, 0.35);
  background: var(--green-soft);
}

.summary-pill.recyclable {
  border-color: rgba(6, 182, 212, 0.35);
  background: var(--cyan-soft);
}

.summary-pill-label {
  color: var(--text-secondary);
}

.summary-pill-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.filter-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--green-soft);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.batch-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.batch-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition);
}

.batch-item-card:hover {
  transform: translateY(-2px);
}

.batch-item-card.organic:hover {
  border-color: rgba(16, 185, 129, 0.4);
}

.batch-item-card.recyclable:hover {
  border-color: rgba(6, 182, 212, 0.4);
}

.batch-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
}

.batch-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.batch-no-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.05);
}

.batch-item-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.batch-item-badge.organic {
  background: rgba(16, 185, 129, 0.85);
  color: #fff;
}

.batch-item-badge.recyclable {
  background: rgba(6, 182, 212, 0.85);
  color: #fff;
}

.batch-item-meta {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.batch-filename {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.batch-class-tag.organic { color: #34d399; font-weight: 600; }
.batch-class-tag.recyclable { color: #38bdf8; font-weight: 600; }

.batch-conf-val {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ---------- Upload Card (Base) ------------------------------ */
.upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: border-color var(--transition);
}

.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(13, 23, 42, 0.4);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
}

.drop-zone:hover, .drop-zone.drag-active {
  border-color: var(--green);
  background: rgba(16, 185, 129, 0.04);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.12);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-icon-wrapper {
  width: 58px;
  height: 58px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 26px;
}

.drop-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.drop-hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.browse-link {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.drop-subhint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* Preview Wrap */
.preview-wrapper {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.preview-wrapper.visible {
  display: flex;
}

.preview-img-wrap {
  position: relative;
  max-width: 240px;
  max-height: 240px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background var(--transition);
}

.preview-remove:hover {
  background: var(--red);
}

.preview-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preview-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Action Bar */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.5rem;
}

.action-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.sample-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sample-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sample-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 10px;
  font-size: 0.78rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.sample-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-analyse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--green), #059669);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  transition: all var(--transition);
}

.btn-analyse:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-analyse:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.btn-analyse.loading .spinner {
  display: block;
}

.btn-analyse.loading .btn-label {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Result Card ------------------------------------- */
.result-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeInSlide 0.35s ease forwards;
}

.result-card.visible {
  display: flex;
}

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

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.result-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.result-badge {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 30px;
  letter-spacing: 0.02em;
}

.result-badge.organic {
  background: var(--green-soft);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.result-badge.recyclable {
  background: var(--cyan-soft);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.result-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.75rem;
  align-items: start;
}

.result-thumb-wrapper {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.result-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-class-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-class {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.result-class.organic {
  color: #34d399;
}

.result-class.recyclable {
  color: #38bdf8;
}

.result-code-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.result-code {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Confidence Bar */
.conf-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conf-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.conf-track {
  width: 100%;
  height: 9px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

.conf-fill {
  height: 100%;
  width: 0;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.conf-fill.organic {
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.conf-fill.recyclable {
  background: linear-gradient(90deg, #06b6d4, #38bdf8);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

/* Disposal Guide Box in Result */
.disposal-guide-box {
  background: rgba(13, 23, 42, 0.55);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.disposal-guide-box.organic {
  border-left: 4px solid var(--green);
}

.disposal-guide-box.recyclable {
  border-left: 4px solid var(--cyan);
}

.guide-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.guide-content {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guide-content strong {
  color: var(--text-primary);
}

.guide-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.25rem;
}

.guide-pill {
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.result-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-reset:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ---------- Guide Section ----------------------------------- */
.section-title-wrap {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.section-tag {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
}

.section-title-wrap h2 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 600px;
}

.stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.stream-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), border-color var(--transition);
}

.stream-card:hover {
  transform: translateY(-3px);
}

.stream-card.organic-stream:hover {
  border-color: rgba(16, 185, 129, 0.35);
}

.stream-card.recyclable-stream:hover {
  border-color: rgba(6, 182, 212, 0.35);
}

.stream-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stream-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.06);
}

.organic-stream .stream-icon-badge {
  background: var(--green-soft);
  color: var(--green);
}

.recyclable-stream .stream-icon-badge {
  background: var(--cyan-soft);
  color: var(--cyan);
}

.stream-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.stream-bin-tag {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stream-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.stream-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-block h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.detail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.check-list li::before {
  content: "• ";
  color: var(--green);
  font-weight: bold;
}

.cross-list li::before {
  content: "• ";
  color: var(--red);
  font-weight: bold;
}

.stream-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-val {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ---------- Workflow Steps ---------------------------------- */
.workflow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition);
}

.step-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.step-num {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--green);
}

.step-icon {
  font-size: 2rem;
  margin: 0.25rem 0;
}

.step-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.step-card p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Tips Section ------------------------------------ */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--shadow-card);
}

.tip-card-icon {
  font-size: 1.75rem;
}

.tip-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.tip-card p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---------- Footer ------------------------------------------ */
.footer {
  background: rgba(8, 14, 26, 0.95);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 3rem clamp(1.5rem, 5vw, 3.5rem) 1.5rem;
}

.footer-container {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-tagline {
  font-size: 0.86rem;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.6;
}

.footer-links-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-info {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.footer-links-group a {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-links-group a:hover {
  color: var(--green);
}

.footer-bottom {
  max-width: 980px;
  margin: 1.5rem auto 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-bottom strong {
  color: var(--text-secondary);
}

/* ---------- Toast ------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--red);
  color: #fca5a5;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------- Mobile Navigation & Drawer ---------------------- */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  transition: all var(--transition);
  z-index: 102;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle:hover, .menu-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.hamburger-bar {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.menu-toggle.active .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.active .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Backdrop */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 105;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 85vw);
  background: rgba(10, 18, 33, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.7);
  z-index: 110;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow-y: auto;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

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

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.drawer-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all var(--transition);
}

.mobile-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

.mobile-nav-link.active {
  background: var(--green-soft);
  border-color: rgba(16, 185, 129, 0.3);
}

.mobile-nav-link .nav-icon {
  font-size: 1.35rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-nav-link.active .nav-icon {
  background: rgba(16, 185, 129, 0.2);
}

.nav-text-group {
  display: flex;
  flex-direction: column;
}

.nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-nav-link.active .nav-title {
  color: #34d399;
}

.nav-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mobile-drawer-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.mobile-status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.mobile-status-text {
  display: flex;
  flex-direction: column;
}

.status-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-state {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.mobile-api-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}

.mobile-api-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ---------- Responsive Adjustments (Desktop to Mobile) ------ */

/* 1. Large Tablets & Small Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .header {
    padding: 0 clamp(1rem, 3vw, 2rem);
  }

  .nav-links {
    gap: 0.75rem;
  }

  .nav-link {
    font-size: 0.84rem;
    padding: 5px 10px;
  }

  .container {
    gap: 2.25rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .analytics-grid-two {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .dataset-distribution-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .comparison-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .footer-container {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 2rem;
  }
}

/* 2. Tablets & Small Viewports (<= 880px) */
@media (max-width: 880px) {
  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .header-status {
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  .api-btn.desktop-only {
    display: none;
  }

  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* 3. Phablets & Large Phones (<= 768px) */
@media (max-width: 768px) {
  main {
    padding: 2rem 0.85rem 3rem;
  }

  .container {
    gap: 1.75rem;
  }

  .hero {
    gap: 0.85rem;
    padding-top: 0.5rem;
  }

  .hero-desc {
    font-size: 0.92rem;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .stat-card {
    padding: 0.8rem 0.9rem;
    gap: 8px;
  }

  .stat-icon {
    font-size: 1.2rem;
  }

  .stat-value {
    font-size: 1rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .kpi-card {
    padding: 1rem;
  }

  .kpi-value {
    font-size: 1.5rem;
  }

  .upload-card {
    padding: 1.15rem;
    border-radius: var(--radius-lg);
  }

  .drop-zone {
    padding: 1.5rem 0.85rem;
  }

  .drop-title {
    font-size: 0.98rem;
  }

  .drop-hint {
    font-size: 0.82rem;
  }

  .drop-subhint {
    font-size: 0.72rem;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .action-left {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0.5rem;
  }

  .sample-chips {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .sample-chip {
    text-align: center;
    padding: 8px 6px;
    font-size: 0.76rem;
    border-radius: 10px;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .btn-analyse {
    width: 100%;
    padding: 13px 20px;
    font-size: 1rem;
    min-height: 48px;
  }

  .result-card {
    padding: 1.15rem;
    border-radius: var(--radius-lg);
  }

  .result-body {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .result-thumb-wrapper {
    max-width: 180px;
    margin: 0 auto;
  }

  .result-class {
    font-size: 1.3rem;
  }

  .stream-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .stream-card {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
  }

  .workflow-steps {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .step-card {
    padding: 1.15rem;
  }

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

  .tip-card {
    padding: 1.15rem;
  }

  .panel-card {
    padding: 1.15rem;
    border-radius: var(--radius-lg);
    gap: 1rem;
  }

  .panel-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }

  .matrix-container {
    margin: 0.25rem 0;
    gap: 0.65rem;
  }

  .matrix-grid {
    grid-template-columns: minmax(60px, 75px) 1fr 1fr;
    gap: 6px;
  }

  .matrix-cell {
    padding: 0.85rem 0.35rem;
  }

  .matrix-num {
    font-size: 1.2rem;
  }

  .matrix-summary-row {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }

  .batch-summary-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .batch-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .batch-item-meta {
    padding: 10px;
  }

  .convergence-summary {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .conv-card {
    padding: 0.85rem;
  }

  .conv-val {
    font-size: 1.15rem;
  }

  .footer {
    padding: 2.5rem 1.25rem 1.5rem;
    margin-top: 3rem;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* 4. Medium / Small Mobile Phones (<= 540px) */
@media (max-width: 540px) {
  .bar-segment span {
    display: none;
  }
}

/* 5. Compact Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  .header {
    height: 62px;
    padding: 0 0.75rem;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  .logo-icon {
    width: 30px;
    height: 30px;
    font-size: 15px;
    border-radius: 8px;
  }

  .header-status {
    display: none; /* Status is prominently displayed in mobile drawer */
  }

  .hero-badge {
    font-size: 0.72rem;
    padding: 4px 10px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .kpi-card {
    padding: 0.75rem;
    gap: 2px;
  }

  .kpi-label {
    font-size: 0.68rem;
  }

  .kpi-value {
    font-size: 1.3rem;
  }

  .kpi-sub {
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .matrix-container {
    gap: 0.4rem;
  }

  .matrix-axis-y {
    font-size: 0.62rem;
  }

  .matrix-axis-x {
    font-size: 0.65rem;
  }

  .matrix-grid {
    grid-template-columns: 55px 1fr 1fr;
    gap: 4px;
  }

  .matrix-header-col, .matrix-header-row {
    font-size: 0.68rem;
    padding: 2px;
  }

  .matrix-cell {
    padding: 0.65rem 0.25rem;
  }

  .matrix-num {
    font-size: 1.05rem;
  }

  .matrix-sub {
    font-size: 0.62rem;
  }

  .bar-stack {
    font-size: 0.62rem;
    height: 22px;
    line-height: 22px;
  }

  .bar-stack-legend {
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
  }

  .batch-summary-row {
    grid-template-columns: 1fr;
  }

  .batch-staging-grid {
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 6px;
  }

  .filter-controls {
    flex-direction: column;
  }

  .filter-btn {
    width: 100%;
    text-align: center;
    padding: 8px 12px;
  }

  .batch-results-grid {
    grid-template-columns: 1fr;
  }

  .stream-meta-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .quote-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.9rem;
    gap: 0.6rem;
  }

  .quote-icon {
    font-size: 1.4rem;
  }

  .quote-text {
    font-size: 0.84rem;
  }

  .specs-list .spec-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .param-callout {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .toast {
    left: 10px;
    right: 10px;
    bottom: 10px;
    text-align: center;
    padding: 10px 12px;
  }
}

/* 6. Extra Small Screens (<= 360px) */
@media (max-width: 360px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .matrix-grid {
    grid-template-columns: 48px 1fr 1fr;
  }

  .matrix-cell {
    padding: 0.5rem 0.2rem;
  }

  .matrix-num {
    font-size: 0.95rem;
  }

  .sample-chips {
    grid-template-columns: 1fr;
  }
}
